@cyberismo/backend 0.0.23 → 0.0.24

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 (129) hide show
  1. package/dist/domain/cards/index.js +63 -1
  2. package/dist/domain/cards/index.js.map +1 -1
  3. package/dist/domain/cards/lib.js +3 -0
  4. package/dist/domain/cards/lib.js.map +1 -1
  5. package/dist/domain/cards/schema.d.ts +8 -0
  6. package/dist/domain/cards/schema.js +7 -0
  7. package/dist/domain/cards/schema.js.map +1 -1
  8. package/dist/domain/cards/service.d.ts +2 -0
  9. package/dist/domain/cards/service.js +16 -0
  10. package/dist/domain/cards/service.js.map +1 -1
  11. package/dist/domain/project/service.js +1 -1
  12. package/dist/domain/project/service.js.map +1 -1
  13. package/dist/domain/resources/index.js +63 -1
  14. package/dist/domain/resources/index.js.map +1 -1
  15. package/dist/domain/resources/schema.d.ts +9 -0
  16. package/dist/domain/resources/schema.js +8 -1
  17. package/dist/domain/resources/schema.js.map +1 -1
  18. package/dist/domain/resources/service.d.ts +12 -0
  19. package/dist/domain/resources/service.js +47 -4
  20. package/dist/domain/resources/service.js.map +1 -1
  21. package/dist/public/THIRD-PARTY.txt +3594 -1626
  22. package/dist/public/assets/arc-DFTvTCxD.js +1 -0
  23. package/dist/public/assets/architecture-YZFGNWBL-DsWVZJri.js +1 -0
  24. package/dist/public/assets/architectureDiagram-Q4EWVU46-AN0fWZIG.js +36 -0
  25. package/dist/public/assets/array-xS8TccZC.js +1 -0
  26. package/dist/public/assets/blockDiagram-DXYQGD6D-RrIidZT3.js +132 -0
  27. package/dist/public/assets/c4Diagram-AHTNJAMY-CW7AUKhY.js +10 -0
  28. package/dist/public/assets/channel-BxffgrNT.js +1 -0
  29. package/dist/public/assets/chunk-2KRD3SAO-D5XH6bj9.js +1 -0
  30. package/dist/public/assets/chunk-336JU56O-CVDEj5x8.js +2 -0
  31. package/dist/public/assets/chunk-426QAEUC-CIWkCWTf.js +1 -0
  32. package/dist/public/assets/chunk-4BX2VUAB-O8dxzEpn.js +1 -0
  33. package/dist/public/assets/chunk-4TB4RGXK-Bt4fWDlh.js +206 -0
  34. package/dist/public/assets/chunk-55IACEB6-R-yr7oHq.js +1 -0
  35. package/dist/public/assets/chunk-5FUZZQ4R-D7L4hZzZ.js +62 -0
  36. package/dist/public/assets/chunk-5PVQY5BW-D46cRkay.js +2 -0
  37. package/dist/public/assets/chunk-67CJDMHE-1fLguPDq.js +1 -0
  38. package/dist/public/assets/chunk-7N4EOEYR-BPbEiVZr.js +1 -0
  39. package/dist/public/assets/chunk-AA7GKIK3-DZOqN73n.js +1 -0
  40. package/dist/public/assets/chunk-BSJP7CBP-BQPMRa-Q.js +1 -0
  41. package/dist/public/assets/chunk-CFjPhJqf.js +1 -0
  42. package/dist/public/assets/chunk-CIAEETIT-CoKBG93U.js +1 -0
  43. package/dist/public/assets/chunk-EDXVE4YY-BxmMvdBY.js +1 -0
  44. package/dist/public/assets/chunk-ENJZ2VHE-BrjxYY_T.js +10 -0
  45. package/dist/public/assets/chunk-FMBD7UC4-DChB7ne2.js +15 -0
  46. package/dist/public/assets/chunk-FOC6F5B3-DyK4SoM2.js +1 -0
  47. package/dist/public/assets/chunk-ICPOFSXX-6-ABzkfw.js +122 -0
  48. package/dist/public/assets/chunk-K5T4RW27-432kjUXO.js +94 -0
  49. package/dist/public/assets/chunk-KGLVRYIC-ChpiuJys.js +1 -0
  50. package/dist/public/assets/chunk-LIHQZDEY-C65uflEj.js +1 -0
  51. package/dist/public/assets/chunk-ORNJ4GCN-DPvOqXKg.js +1 -0
  52. package/dist/public/assets/chunk-OYMX7WX6-BecMUsrL.js +231 -0
  53. package/dist/public/assets/chunk-QZHKN3VN-d1i_Lm1t.js +1 -0
  54. package/dist/public/assets/chunk-U2HBQHQK-C6yvwOAo.js +70 -0
  55. package/dist/public/assets/chunk-X2U36JSP-D1C3tOED.js +1 -0
  56. package/dist/public/assets/chunk-XPW4576I-BH37LuuF.js +32 -0
  57. package/dist/public/assets/chunk-YZCP3GAM-D83gHdmx.js +1 -0
  58. package/dist/public/assets/chunk-ZZ45TVLE-DrCjtkdu.js +1 -0
  59. package/dist/public/assets/classDiagram-6PBFFD2Q-CRYacdjd.js +1 -0
  60. package/dist/public/assets/classDiagram-v2-HSJHXN6E-qOJXC_A9.js +1 -0
  61. package/dist/public/assets/clone-Bno0nirE.js +1 -0
  62. package/dist/public/assets/colors-DZGTowqM.js +1 -0
  63. package/dist/public/assets/cose-bilkent-S5V4N54A-BdSMsFO7.js +1 -0
  64. package/dist/public/assets/cytoscape.esm-DpmcErfs.js +321 -0
  65. package/dist/public/assets/dagre-D0KOcyEK.js +1 -0
  66. package/dist/public/assets/dagre-KV5264BT-C_l1Bck_.js +4 -0
  67. package/dist/public/assets/defaultLocale-B6dPnyNg.js +1 -0
  68. package/dist/public/assets/diagram-5BDNPKRD-D6FxiIv1.js +10 -0
  69. package/dist/public/assets/diagram-G4DWMVQ6-COGBv7tQ.js +24 -0
  70. package/dist/public/assets/diagram-MMDJMWI5-U6E9w334.js +43 -0
  71. package/dist/public/assets/diagram-TYMM5635-Tvfdnlo4.js +24 -0
  72. package/dist/public/assets/dist-C6vvxvVV.js +1 -0
  73. package/dist/public/assets/erDiagram-SMLLAGMA-VcPXkmy9.js +85 -0
  74. package/dist/public/assets/flatten-BKeNCJRx.js +1 -0
  75. package/dist/public/assets/flowDiagram-DWJPFMVM-PRQdlypB.js +162 -0
  76. package/dist/public/assets/ganttDiagram-T4ZO3ILL-CSVaTciZ.js +292 -0
  77. package/dist/public/assets/gitGraph-7Q5UKJZL-C6GVmHC4.js +1 -0
  78. package/dist/public/assets/gitGraphDiagram-UUTBAWPF-DMa-Gcy1.js +106 -0
  79. package/dist/public/assets/graphlib-BYojtb6k.js +1 -0
  80. package/dist/public/assets/identity-nF-8qK2-.js +1 -0
  81. package/dist/public/assets/index-oVbUFngg.js +737 -0
  82. package/dist/public/assets/info-OMHHGYJF-CjsmQeYR.js +1 -0
  83. package/dist/public/assets/infoDiagram-42DDH7IO-COL_Na4w.js +2 -0
  84. package/dist/public/assets/init-B9nbfZCT.js +1 -0
  85. package/dist/public/assets/isEmpty-Di-NpihJ.js +1 -0
  86. package/dist/public/assets/ishikawaDiagram-UXIWVN3A-B3HoSFaq.js +70 -0
  87. package/dist/public/assets/journeyDiagram-VCZTEJTY-kH30WNF3.js +139 -0
  88. package/dist/public/assets/kanban-definition-6JOO6SKY-RdjEsejt.js +89 -0
  89. package/dist/public/assets/katex-Bfn1OZEl.js +257 -0
  90. package/dist/public/assets/line-DrKJYWGi.js +1 -0
  91. package/dist/public/assets/linear-C8MDrvxz.js +1 -0
  92. package/dist/public/assets/mermaid-parser.core-BeZK8g2G.js +4 -0
  93. package/dist/public/assets/mindmap-definition-QFDTVHPH-CNWWI4MF.js +96 -0
  94. package/dist/public/assets/ordinal-BXaEVJbT.js +1 -0
  95. package/dist/public/assets/packet-4T2RLAQJ-Dq0Z9G3r.js +1 -0
  96. package/dist/public/assets/path-C7Bv0Qdk.js +1 -0
  97. package/dist/public/assets/pie-ZZUOXDRM-Coeb8Atk.js +1 -0
  98. package/dist/public/assets/pieDiagram-DEJITSTG-CrDW-30P.js +30 -0
  99. package/dist/public/assets/quadrantDiagram-34T5L4WZ-BoDA5WQ-.js +7 -0
  100. package/dist/public/assets/radar-PYXPWWZC-BF2NN2TG.js +1 -0
  101. package/dist/public/assets/range-DuD7Go1R.js +1 -0
  102. package/dist/public/assets/reduce-5tLTMRkg.js +1 -0
  103. package/dist/public/assets/requirementDiagram-MS252O5E-BnG7epLH.js +84 -0
  104. package/dist/public/assets/rough.esm-DE7XMpOC.js +1 -0
  105. package/dist/public/assets/sankeyDiagram-XADWPNL6-oyTFoxhB.js +10 -0
  106. package/dist/public/assets/sequenceDiagram-FGHM5R23-hwG2jT_2.js +157 -0
  107. package/dist/public/assets/src-ps-3oTnY.js +1 -0
  108. package/dist/public/assets/stateDiagram-FHFEXIEX-BiYqw63j.js +1 -0
  109. package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-CggSrcDh.js +1 -0
  110. package/dist/public/assets/time-Bgnk7ODM.js +1 -0
  111. package/dist/public/assets/timeline-definition-GMOUNBTQ-9MnBod43.js +120 -0
  112. package/dist/public/assets/treeView-SZITEDCU-IRdgIoRV.js +1 -0
  113. package/dist/public/assets/treemap-DK8fitek.js +1 -0
  114. package/dist/public/assets/treemap-W4RFUUIX-C-JBwyWW.js +1 -0
  115. package/dist/public/assets/vennDiagram-DHZGUBPP-sEA6JNL-.js +34 -0
  116. package/dist/public/assets/wardley-RL74JXVD-DdU04Q7E.js +1 -0
  117. package/dist/public/assets/wardleyDiagram-NUSXRM2D-Dws321pY.js +20 -0
  118. package/dist/public/assets/xychartDiagram-5P7HB3ND-BcqyvmmW.js +7 -0
  119. package/dist/public/index.html +30 -1
  120. package/package.json +7 -7
  121. package/src/domain/cards/index.ts +73 -0
  122. package/src/domain/cards/lib.ts +4 -0
  123. package/src/domain/cards/schema.ts +9 -0
  124. package/src/domain/cards/service.ts +26 -1
  125. package/src/domain/project/service.ts +1 -1
  126. package/src/domain/resources/index.ts +74 -0
  127. package/src/domain/resources/schema.ts +14 -0
  128. package/src/domain/resources/service.ts +50 -4
  129. package/dist/public/assets/index-Cdn_jRWy.js +0 -720
@@ -0,0 +1,10 @@
1
+ import{B as e,C as t,K as n,V as r,W as i,_ as a,a as o,b as s,s as c,u as l,v as u}from"./chunk-ICPOFSXX-6-ABzkfw.js";import{_ as d,m as f}from"./src-ps-3oTnY.js";import{n as p}from"./ordinal-BXaEVJbT.js";import{t as m}from"./colors-DZGTowqM.js";var h=m(`4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab`);function g(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function _(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function v(e,t){let n=0;if(t===void 0)for(let t of e)(t=+t)&&(n+=t);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function y(e){return e.target.depth}function b(e){return e.depth}function x(e,t){return t-1-e.height}function S(e,t){return e.sourceLinks.length?e.depth:t-1}function C(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?_(e.sourceLinks,y)-1:0}function w(e){return function(){return e}}function T(e,t){return D(e.source,t.source)||e.index-t.index}function E(e,t){return D(e.target,t.target)||e.index-t.index}function D(e,t){return e.y0-t.y0}function O(e){return e.value}function k(e){return e.index}function A(e){return e.nodes}function j(e){return e.links}function M(e,t){let n=e.get(t);if(!n)throw Error(`missing: `+t);return n}function N({nodes:e}){for(let t of e){let e=t.y0,n=e;for(let n of t.sourceLinks)n.y0=e+n.width/2,e+=n.width;for(let e of t.targetLinks)e.y1=n+e.width/2,n+=e.width}}function P(){let e=0,t=0,n=1,r=1,i=24,a=8,o,s=k,c=S,l,u,d=A,f=j,p=6;function m(){let e={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return h(e),y(e),b(e),x(e),F(e),N(e),e}m.update=function(e){return N(e),e},m.nodeId=function(e){return arguments.length?(s=typeof e==`function`?e:w(e),m):s},m.nodeAlign=function(e){return arguments.length?(c=typeof e==`function`?e:w(e),m):c},m.nodeSort=function(e){return arguments.length?(l=e,m):l},m.nodeWidth=function(e){return arguments.length?(i=+e,m):i},m.nodePadding=function(e){return arguments.length?(a=o=+e,m):a},m.nodes=function(e){return arguments.length?(d=typeof e==`function`?e:w(e),m):d},m.links=function(e){return arguments.length?(f=typeof e==`function`?e:w(e),m):f},m.linkSort=function(e){return arguments.length?(u=e,m):u},m.size=function(i){return arguments.length?(e=t=0,n=+i[0],r=+i[1],m):[n-e,r-t]},m.extent=function(i){return arguments.length?(e=+i[0][0],n=+i[1][0],t=+i[0][1],r=+i[1][1],m):[[e,t],[n,r]]},m.iterations=function(e){return arguments.length?(p=+e,m):p};function h({nodes:e,links:t}){for(let[t,n]of e.entries())n.index=t,n.sourceLinks=[],n.targetLinks=[];let n=new Map(e.map((t,n)=>[s(t,n,e),t]));for(let[e,r]of t.entries()){r.index=e;let{source:t,target:i}=r;typeof t!=`object`&&(t=r.source=M(n,t)),typeof i!=`object`&&(i=r.target=M(n,i)),t.sourceLinks.push(r),i.targetLinks.push(r)}if(u!=null)for(let{sourceLinks:t,targetLinks:n}of e)t.sort(u),n.sort(u)}function y({nodes:e}){for(let t of e)t.value=t.fixedValue===void 0?Math.max(v(t.sourceLinks,O),v(t.targetLinks,O)):t.fixedValue}function b({nodes:e}){let t=e.length,n=new Set(e),r=new Set,i=0;for(;n.size;){for(let e of n){e.depth=i;for(let{target:t}of e.sourceLinks)r.add(t)}if(++i>t)throw Error(`circular link`);n=r,r=new Set}}function x({nodes:e}){let t=e.length,n=new Set(e),r=new Set,i=0;for(;n.size;){for(let e of n){e.height=i;for(let{source:t}of e.targetLinks)r.add(t)}if(++i>t)throw Error(`circular link`);n=r,r=new Set}}function C({nodes:t}){let r=g(t,e=>e.depth)+1,a=(n-e-i)/(r-1),o=Array(r);for(let n of t){let t=Math.max(0,Math.min(r-1,Math.floor(c.call(null,n,r))));n.layer=t,n.x0=e+t*a,n.x1=n.x0+i,o[t]?o[t].push(n):o[t]=[n]}if(l)for(let e of o)e.sort(l);return o}function P(e){let n=_(e,e=>(r-t-(e.length-1)*o)/v(e,O));for(let i of e){let e=t;for(let t of i){t.y0=e,t.y1=e+t.value*n,e=t.y1+o;for(let e of t.sourceLinks)e.width=e.value*n}e=(r-e+o)/(i.length+1);for(let t=0;t<i.length;++t){let n=i[t];n.y0+=e*(t+1),n.y1+=e*(t+1)}H(i)}}function F(e){let n=C(e);o=Math.min(a,(r-t)/(g(n,e=>e.length)-1)),P(n);for(let e=0;e<p;++e){let t=.99**e,r=Math.max(1-t,(e+1)/p);L(n,t,r),I(n,t,r)}}function I(e,t,n){for(let r=1,i=e.length;r<i;++r){let i=e[r];for(let e of i){let n=0,r=0;for(let{source:t,value:i}of e.targetLinks){let a=i*(e.layer-t.layer);n+=U(t,e)*a,r+=a}if(!(r>0))continue;let i=(n/r-e.y0)*t;e.y0+=i,e.y1+=i,V(e)}l===void 0&&i.sort(D),R(i,n)}}function L(e,t,n){for(let r=e.length-2;r>=0;--r){let i=e[r];for(let e of i){let n=0,r=0;for(let{target:t,value:i}of e.sourceLinks){let a=i*(t.layer-e.layer);n+=W(e,t)*a,r+=a}if(!(r>0))continue;let i=(n/r-e.y0)*t;e.y0+=i,e.y1+=i,V(e)}l===void 0&&i.sort(D),R(i,n)}}function R(e,n){let i=e.length>>1,a=e[i];B(e,a.y0-o,i-1,n),z(e,a.y1+o,i+1,n),B(e,r,e.length-1,n),z(e,t,0,n)}function z(e,t,n,r){for(;n<e.length;++n){let i=e[n],a=(t-i.y0)*r;a>1e-6&&(i.y0+=a,i.y1+=a),t=i.y1+o}}function B(e,t,n,r){for(;n>=0;--n){let i=e[n],a=(i.y1-t)*r;a>1e-6&&(i.y0-=a,i.y1-=a),t=i.y0-o}}function V({sourceLinks:e,targetLinks:t}){if(u===void 0){for(let{source:{sourceLinks:e}}of t)e.sort(E);for(let{target:{targetLinks:t}}of e)t.sort(T)}}function H(e){if(u===void 0)for(let{sourceLinks:t,targetLinks:n}of e)t.sort(E),n.sort(T)}function U(e,t){let n=e.y0-(e.sourceLinks.length-1)*o/2;for(let{target:r,width:i}of e.sourceLinks){if(r===t)break;n+=i+o}for(let{source:r,width:i}of t.targetLinks){if(r===e)break;n-=i}return n}function W(e,t){let n=t.y0-(t.targetLinks.length-1)*o/2;for(let{source:r,width:i}of t.targetLinks){if(r===e)break;n+=i+o}for(let{target:r,width:i}of e.sourceLinks){if(r===t)break;n-=i}return n}return m}var F=Math.PI,I=2*F,L=1e-6,R=I-L;function z(){this._x0=this._y0=this._x1=this._y1=null,this._=``}function B(){return new z}z.prototype=B.prototype={constructor:z,moveTo:function(e,t){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+=`Z`)},lineTo:function(e,t){this._+=`L`+(this._x1=+e)+`,`+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+=`Q`+ +e+`,`+ +t+`,`+(this._x1=+n)+`,`+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,a){this._+=`C`+ +e+`,`+ +t+`,`+ +n+`,`+ +r+`,`+(this._x1=+i)+`,`+(this._y1=+a)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(i<0)throw Error(`negative radius: `+i);if(this._x1===null)this._+=`M`+(this._x1=e)+`,`+(this._y1=t);else if(d>L)if(!(Math.abs(u*s-c*l)>L)||!i)this._+=`L`+(this._x1=e)+`,`+(this._y1=t);else{var f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((F-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>L&&(this._+=`L`+(e+y*l)+`,`+(t+y*u)),this._+=`A`+i+`,`+i+`,0,0,`+ +(u*f>l*p)+`,`+(this._x1=e+b*s)+`,`+(this._y1=t+b*c)}},arc:function(e,t,n,r,i,a){e=+e,t=+t,n=+n,a=!!a;var o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;if(n<0)throw Error(`negative radius: `+n);this._x1===null?this._+=`M`+c+`,`+l:(Math.abs(this._x1-c)>L||Math.abs(this._y1-l)>L)&&(this._+=`L`+c+`,`+l),n&&(d<0&&(d=d%I+I),d>R?this._+=`A`+n+`,`+n+`,0,1,`+u+`,`+(e-o)+`,`+(t-s)+`A`+n+`,`+n+`,0,1,`+u+`,`+(this._x1=c)+`,`+(this._y1=l):d>L&&(this._+=`A`+n+`,`+n+`,0,`+ +(d>=F)+`,`+u+`,`+(this._x1=e+n*Math.cos(i))+`,`+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)+`h`+ +n+`v`+ +r+`h`+-n+`Z`},toString:function(){return this._}};function V(e){return function(){return e}}function H(e){return e[0]}function U(e){return e[1]}var W=Array.prototype.slice;function ee(e){return e.source}function G(e){return e.target}function K(e){var t=ee,n=G,r=H,i=U,a=null;function o(){var o,s=W.call(arguments),c=t.apply(this,s),l=n.apply(this,s);if(a||=o=B(),e(a,+r.apply(this,(s[0]=c,s)),+i.apply(this,s),+r.apply(this,(s[0]=l,s)),+i.apply(this,s)),o)return a=null,o+``||null}return o.source=function(e){return arguments.length?(t=e,o):t},o.target=function(e){return arguments.length?(n=e,o):n},o.x=function(e){return arguments.length?(r=typeof e==`function`?e:V(+e),o):r},o.y=function(e){return arguments.length?(i=typeof e==`function`?e:V(+e),o):i},o.context=function(e){return arguments.length?(a=e??null,o):a},o}function q(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function te(){return K(q)}function ne(e){return[e.source.x1,e.y0]}function re(e){return[e.target.x0,e.y1]}function ie(){return te().source(ne).target(re)}var J=(function(){var e=d(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,9],n=[1,10],r=[1,5,10,12],i={trace:d(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:`error`,4:`SANKEY`,5:`NEWLINE`,10:`EOF`,11:`field[source]`,12:`COMMA`,13:`field[target]`,14:`field[value]`,18:`DQUOTE`,19:`ESCAPED_TEXT`,20:`NON_ESCAPED_TEXT`},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:d(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 7:let e=r.findOrCreateNode(a[s-4].trim().replaceAll(`""`,`"`)),t=r.findOrCreateNode(a[s-2].trim().replaceAll(`""`,`"`)),n=parseFloat(a[s].trim());r.addLink(e,t,n);break;case 8:case 9:case 11:this.$=a[s];break;case 10:this.$=a[s-1];break}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:t,20:n},{1:[2,6],7:11,10:[1,12]},e(n,[2,4],{9:13,5:[1,14]}),{12:[1,15]},e(r,[2,8]),e(r,[2,9]),{19:[1,16]},e(r,[2,11]),{1:[2,1]},{1:[2,5]},e(n,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:t,20:n},{15:18,16:7,17:8,18:t,20:n},{18:[1,19]},e(n,[2,3]),{12:[1,20]},e(r,[2,10]),{15:21,16:7,17:8,18:t,20:n},e([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:d(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:d(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,c=0,l=0,u=0,f=2,p=1,m=a.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;a.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){n.length-=2*e,i.length-=e,a.length-=e}d(b,`popStack`);function x(){var e=r.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}d(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=n[n.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=o[w]&&o[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],o[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(c+1)+`:
2
+ `+h.showPosition()+`
3
+ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(c+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:n.push(S),i.push(h.yytext),a.push(h.yylloc),n.push(T[1]),S=null,C?(S=C,C=null):(l=h.yyleng,s=h.yytext,c=h.yylineno,v=h.yylloc,u>0&&u--);break;case 2:if(k=this.productions_[T[1]][1],D.$=i[i.length-k],D._$={first_line:a[a.length-(k||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(k||1)].first_column,last_column:a[a.length-1].last_column},y&&(D._$.range=[a[a.length-(k||1)].range[0],a[a.length-1].range[1]]),E=this.performAction.apply(D,[s,l,c,g.yy,T[1],i,a].concat(m)),E!==void 0)return E;k&&(n=n.slice(0,-1*k*2),i=i.slice(0,-1*k),a=a.slice(0,-1*k)),n.push(this.productions_[T[1]][0]),i.push(D.$),a.push(D._$),A=o[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0},`parse`)};i.lexer=(function(){return{EOF:1,parseError:d(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:d(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:d(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:d(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:d(function(){return this._more=!0,this},`more`),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:d(function(e){this.unput(this.match.slice(e))},`less`),pastInput:d(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:d(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:d(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
+ `+t+`^`},`showPosition`),test_match:d(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e===!1?!1:e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:d(function(){return this.next()||this.lex()},`lex`),begin:d(function(e){this.conditionStack.push(e)},`begin`),popState:d(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:d(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:d(function(e){this.begin(e)},`pushState`),stateStackSize:d(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:d(function(e,t,n,r){switch(n){case 0:return this.pushState(`csv`),4;case 1:return this.pushState(`csv`),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState(`escaped_text`),18;case 6:return 20;case 7:return this.popState(`escaped_text`),18;case 8:return 19}},`anonymous`),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}}})();function a(){this.yy={}}return d(a,`Parser`),a.prototype=i,i.Parser=a,new a})();J.parser=J;var Y=J,X=[],Z=[],Q=new Map,ae=d(()=>{X=[],Z=[],Q=new Map,o()},`clear`),oe=class{constructor(e,t,n=0){this.source=e,this.target=t,this.value=n}static{d(this,`SankeyLink`)}},se=d((e,t,n)=>{X.push(new oe(e,t,n))},`addLink`),ce=class{constructor(e){this.ID=e}static{d(this,`SankeyNode`)}},le={nodesMap:Q,getConfig:d(()=>s().sankey,`getConfig`),getNodes:d(()=>Z,`getNodes`),getLinks:d(()=>X,`getLinks`),getGraph:d(()=>({nodes:Z.map(e=>({id:e.ID})),links:X.map(e=>({source:e.source.ID,target:e.target.ID,value:e.value}))}),`getGraph`),addLink:se,findOrCreateNode:d(e=>{e=c.sanitizeText(e,s());let t=Q.get(e);return t===void 0&&(t=new ce(e),Q.set(e,t),Z.push(t)),t},`findOrCreateNode`),getAccTitle:u,setAccTitle:r,getAccDescription:a,setAccDescription:e,getDiagramTitle:t,setDiagramTitle:i,clear:ae},$=class e{static{d(this,`Uid`)}static{this.count=0}static next(t){return new e(t+ ++e.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return`url(`+this.href+`)`}},ue={left:b,right:x,center:C,justify:S},de={draw:d(function(e,t,r,i){let{securityLevel:a,sankey:o}=s(),c=l.sankey,u;a===`sandbox`&&(u=f(`#i`+t));let m=f(a===`sandbox`?u.nodes()[0].contentDocument.body:`body`),g=a===`sandbox`?m.select(`[id="${t}"]`):f(`[id="${t}"]`),_=o?.width??c.width,v=o?.height??c.width,y=o?.useMaxWidth??c.useMaxWidth,b=o?.nodeAlignment??c.nodeAlignment,x=o?.prefix??c.prefix,S=o?.suffix??c.suffix,C=o?.showValues??c.showValues,w=i.db.getGraph(),T=ue[b];P().nodeId(e=>e.id).nodeWidth(10).nodePadding(10+(C?15:0)).nodeAlign(T).extent([[0,0],[_,v]])(w);let E=p(h);g.append(`g`).attr(`class`,`nodes`).selectAll(`.node`).data(w.nodes).join(`g`).attr(`class`,`node`).attr(`id`,e=>(e.uid=$.next(`node-`)).id).attr(`transform`,function(e){return`translate(`+e.x0+`,`+e.y0+`)`}).attr(`x`,e=>e.x0).attr(`y`,e=>e.y0).append(`rect`).attr(`height`,e=>e.y1-e.y0).attr(`width`,e=>e.x1-e.x0).attr(`fill`,e=>E(e.id));let D=d(({id:e,value:t})=>C?`${e}
7
+ ${x}${Math.round(t*100)/100}${S}`:e,`getText`);g.append(`g`).attr(`class`,`node-labels`).attr(`font-size`,14).selectAll(`text`).data(w.nodes).join(`text`).attr(`x`,e=>e.x0<_/2?e.x1+6:e.x0-6).attr(`y`,e=>(e.y1+e.y0)/2).attr(`dy`,`${C?`0`:`0.35`}em`).attr(`text-anchor`,e=>e.x0<_/2?`start`:`end`).text(D);let O=g.append(`g`).attr(`class`,`links`).attr(`fill`,`none`).attr(`stroke-opacity`,.5).selectAll(`.link`).data(w.links).join(`g`).attr(`class`,`link`).style(`mix-blend-mode`,`multiply`),k=o?.linkColor??`gradient`;if(k===`gradient`){let e=O.append(`linearGradient`).attr(`id`,e=>(e.uid=$.next(`linearGradient-`)).id).attr(`gradientUnits`,`userSpaceOnUse`).attr(`x1`,e=>e.source.x1).attr(`x2`,e=>e.target.x0);e.append(`stop`).attr(`offset`,`0%`).attr(`stop-color`,e=>E(e.source.id)),e.append(`stop`).attr(`offset`,`100%`).attr(`stop-color`,e=>E(e.target.id))}let A;switch(k){case`gradient`:A=d(e=>e.uid,`coloring`);break;case`source`:A=d(e=>E(e.source.id),`coloring`);break;case`target`:A=d(e=>E(e.target.id),`coloring`);break;default:A=k}O.append(`path`).attr(`d`,ie()).attr(`stroke`,A).attr(`stroke-width`,e=>Math.max(1,e.width)),n(void 0,g,0,y)},`draw`)},fe=d(e=>e.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,``).replaceAll(/([\n\r])+/g,`
8
+ `).trim(),`prepareTextForParsing`),pe=d(e=>`.label {
9
+ font-family: ${e.fontFamily};
10
+ }`,`getStyles`),me=Y.parse.bind(Y);Y.parse=e=>me(fe(e));var he={styles:pe,parser:Y,db:le,renderer:de};export{he as diagram};
@@ -0,0 +1,157 @@
1
+ import{B as e,C as t,D as n,L as r,P as i,U as a,V as o,W as s,_ as c,a as l,b as u,c as d,i as f,k as p,r as m,s as h,v as g,y as _}from"./chunk-ICPOFSXX-6-ABzkfw.js";import{_ as v,m as y,v as b}from"./src-ps-3oTnY.js";import{t as x}from"./dist-C6vvxvVV.js";import{f as S,h as C}from"./chunk-5PVQY5BW-D46cRkay.js";import{n as w,t as T}from"./chunk-XPW4576I-BH37LuuF.js";import{a as E,c as D,i as O,n as k,r as A,s as j}from"./chunk-YZCP3GAM-D83gHdmx.js";import{t as M}from"./chunk-QZHKN3VN-d1i_Lm1t.js";var N=x(),P=(function(){var e=v(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,2],n=[1,3],r=[1,4],i=[2,4],a=[1,9],o=[1,11],s=[1,12],c=[1,14],l=[1,15],u=[1,17],d=[1,18],f=[1,19],p=[1,25],m=[1,26],h=[1,27],g=[1,28],_=[1,29],y=[1,30],b=[1,31],x=[1,32],S=[1,33],C=[1,34],w=[1,35],T=[1,36],E=[1,37],D=[1,38],O=[1,39],k=[1,40],A=[1,42],j=[1,43],M=[1,44],N=[1,45],P=[1,46],F=[1,47],I=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],L=[1,74],ee=[1,80],R=[1,81],te=[1,82],ne=[1,83],z=[1,84],B=[1,85],V=[1,86],re=[1,87],H=[1,88],U=[1,89],W=[1,90],ie=[1,91],ae=[1,92],oe=[1,93],G=[1,94],se=[1,95],K=[1,96],ce=[1,97],le=[1,98],ue=[1,99],de=[1,100],fe=[1,101],pe=[1,102],me=[1,103],he=[1,104],ge=[1,105],_e=[2,78],ve=[4,5,17,51,53,54],ye=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],be=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],xe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Ce=[5,52],q=[70,71,72,73],J=[1,151],we={trace:v(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NEWLINE`,6:`SD`,10:`INVALID`,14:`create`,15:`box`,16:`restOfLine`,17:`end`,19:`autonumber`,20:`NUM`,21:`off`,22:`activate`,24:`deactivate`,30:`title`,31:`legacy_title`,32:`acc_title`,33:`acc_title_value`,34:`acc_descr`,35:`acc_descr_value`,36:`acc_descr_multiline_value`,37:`loop`,38:`rect`,39:`opt`,40:`alt`,42:`par`,44:`par_over`,45:`critical`,47:`break`,48:`option`,49:`and`,50:`else`,51:`participant`,52:`AS`,53:`participant_actor`,54:`destroy`,56:`note`,59:`over`,61:`links`,62:`link`,63:`properties`,64:`details`,66:`,`,67:`left_of`,68:`right_of`,70:`+`,71:`-`,72:`()`,73:`ACTOR`,75:`CONFIG_START`,76:`CONFIG_CONTENT`,77:`CONFIG_END`,78:`SOLID_OPEN_ARROW`,79:`DOTTED_OPEN_ARROW`,80:`SOLID_ARROW`,81:`SOLID_ARROW_TOP`,82:`SOLID_ARROW_BOTTOM`,83:`STICK_ARROW_TOP`,84:`STICK_ARROW_BOTTOM`,85:`SOLID_ARROW_TOP_DOTTED`,86:`SOLID_ARROW_BOTTOM_DOTTED`,87:`STICK_ARROW_TOP_DOTTED`,88:`STICK_ARROW_BOTTOM_DOTTED`,89:`SOLID_ARROW_TOP_REVERSE`,90:`SOLID_ARROW_BOTTOM_REVERSE`,91:`STICK_ARROW_TOP_REVERSE`,92:`STICK_ARROW_BOTTOM_REVERSE`,93:`SOLID_ARROW_TOP_REVERSE_DOTTED`,94:`SOLID_ARROW_BOTTOM_REVERSE_DOTTED`,95:`STICK_ARROW_TOP_REVERSE_DOTTED`,96:`STICK_ARROW_BOTTOM_REVERSE_DOTTED`,97:`BIDIRECTIONAL_SOLID_ARROW`,98:`DOTTED_ARROW`,99:`BIDIRECTIONAL_DOTTED_ARROW`,100:`SOLID_CROSS`,101:`DOTTED_CROSS`,102:`SOLID_POINT`,103:`DOTTED_POINT`,104:`TXT`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:v(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.apply(a[s]),a[s];case 4:case 10:this.$=[];break;case 5:case 11:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:case 12:case 13:this.$=a[s];break;case 8:case 9:case 14:this.$=[];break;case 16:a[s].type=`createParticipant`,this.$=a[s];break;case 17:a[s-1].unshift({type:`boxStart`,boxData:r.parseBoxData(a[s-2])}),a[s-1].push({type:`boxEnd`,boxText:a[s-2]}),this.$=a[s-1];break;case 19:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-2]),sequenceIndexStep:Number(a[s-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:`sequenceIndex`,sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:`sequenceIndex`,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor};break;case 24:this.$={type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1].actor};break;case 30:r.setDiagramTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 31:r.setDiagramTitle(a[s].substring(7)),this.$=a[s].substring(7);break;case 32:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 33:case 34:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 35:a[s-1].unshift({type:`loopStart`,loopText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:`loopEnd`,loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 36:a[s-1].unshift({type:`rectStart`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_START}),a[s-1].push({type:`rectEnd`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[s-1];break;case 37:a[s-1].unshift({type:`optStart`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:`optEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 38:a[s-1].unshift({type:`altStart`,altText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.ALT_START}),a[s-1].push({type:`altEnd`,signalType:r.LINETYPE.ALT_END}),this.$=a[s-1];break;case 39:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 40:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 41:a[s-1].unshift({type:`criticalStart`,criticalText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.CRITICAL_START}),a[s-1].push({type:`criticalEnd`,signalType:r.LINETYPE.CRITICAL_END}),this.$=a[s-1];break;case 42:a[s-1].unshift({type:`breakStart`,breakText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_START}),a[s-1].push({type:`breakEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[s-1];break;case 44:this.$=a[s-3].concat([{type:`option`,optionText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[s]]);break;case 46:this.$=a[s-3].concat([{type:`and`,parText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.PAR_AND},a[s]]);break;case 48:this.$=a[s-3].concat([{type:`else`,altText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.ALT_ELSE},a[s]]);break;case 49:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 50:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 51:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 52:case 57:a[s-1].draw=`actor`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 53:a[s-1].type=`destroyParticipant`,this.$=a[s-1];break;case 54:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 55:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 56:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 58:this.$=[a[s-1],{type:`addNote`,placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 59:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:`addNote`,placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 60:this.$=[a[s-1],{type:`addLinks`,actor:a[s-1].actor,text:a[s]}];break;case 61:this.$=[a[s-1],{type:`addALink`,actor:a[s-1].actor,text:a[s]}];break;case 62:this.$=[a[s-1],{type:`addProperties`,actor:a[s-1].actor,text:a[s]}];break;case 63:this.$=[a[s-1],{type:`addDetails`,actor:a[s-1].actor,text:a[s]}];break;case 66:this.$=[a[s-2],a[s]];break;case 67:this.$=a[s];break;case 68:this.$=r.PLACEMENT.LEFTOF;break;case 69:this.$=r.PLACEMENT.RIGHTOF;break;case 70:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0},{type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor}];break;case 71:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4].actor}];break;case 72:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor}];break;case 73:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s],activate:!1,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-4].actor}];break;case 74:this.$=[a[s-5],a[s-1],{type:`addMessage`,from:a[s-5].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-5].actor}];break;case 75:this.$=[a[s-3],a[s-1],{type:`addMessage`,from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 76:this.$={type:`addParticipant`,actor:a[s-1],config:a[s]};break;case 77:this.$=a[s-1].trim();break;case 78:this.$={type:`addParticipant`,actor:a[s]};break;case 79:this.$=r.LINETYPE.SOLID_OPEN;break;case 80:this.$=r.LINETYPE.DOTTED_OPEN;break;case 81:this.$=r.LINETYPE.SOLID;break;case 82:this.$=r.LINETYPE.SOLID_TOP;break;case 83:this.$=r.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=r.LINETYPE.STICK_TOP;break;case 85:this.$=r.LINETYPE.STICK_BOTTOM;break;case 86:this.$=r.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=r.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=r.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=r.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=r.LINETYPE.DOTTED;break;case 100:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=r.LINETYPE.SOLID_CROSS;break;case 102:this.$=r.LINETYPE.DOTTED_CROSS;break;case 103:this.$=r.LINETYPE.SOLID_POINT;break;case 104:this.$=r.LINETYPE.DOTTED_POINT;break;case 105:this.$=r.parseMessage(a[s].trim().substring(1));break}},`anonymous`),table:[{3:1,4:t,5:n,6:r},{1:[3]},{3:5,4:t,5:n,6:r},{3:6,4:t,5:n,6:r},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:o,8:8,9:10,10:s,13:13,14:c,15:l,18:16,19:u,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:m,32:h,34:g,36:_,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,5]),{9:48,13:13,14:c,15:l,18:16,19:u,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:m,32:h,34:g,36:_,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,7]),e(I,[2,8]),e(I,[2,9]),e(I,[2,15]),{13:49,51:D,53:O,54:k},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:F},{23:56,73:F},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(I,[2,30]),e(I,[2,31]),{33:[1,62]},{35:[1,63]},e(I,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:L},{23:75,55:76,73:L},{23:77,73:F},{69:78,72:[1,79],78:ee,79:R,80:te,81:ne,82:z,83:B,84:V,85:re,86:H,87:U,88:W,89:ie,90:ae,91:oe,92:G,93:se,94:K,95:ce,96:le,97:ue,98:de,99:fe,100:pe,101:me,102:he,103:ge},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:F},{23:111,73:F},{23:112,73:F},{23:113,73:F},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],_e),e(I,[2,6]),e(I,[2,16]),e(ve,[2,10],{11:114}),e(I,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(I,[2,22]),{5:[1,118]},{5:[1,119]},e(I,[2,25]),e(I,[2,26]),e(I,[2,27]),e(I,[2,28]),e(I,[2,29]),e(I,[2,32]),e(I,[2,33]),e(ye,i,{7:120}),e(ye,i,{7:121}),e(ye,i,{7:122}),e(be,i,{41:123,7:124}),e(xe,i,{43:125,7:126}),e(xe,i,{7:126,43:127}),e(Se,i,{46:128,7:129}),e(ye,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Ce,_e,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:F},{69:146,78:ee,79:R,80:te,81:ne,82:z,83:B,84:V,85:re,86:H,87:U,88:W,89:ie,90:ae,91:oe,92:G,93:se,94:K,95:ce,96:le,97:ue,98:de,99:fe,100:pe,101:me,102:he,103:ge},e(q,[2,79]),e(q,[2,80]),e(q,[2,81]),e(q,[2,82]),e(q,[2,83]),e(q,[2,84]),e(q,[2,85]),e(q,[2,86]),e(q,[2,87]),e(q,[2,88]),e(q,[2,89]),e(q,[2,90]),e(q,[2,91]),e(q,[2,92]),e(q,[2,93]),e(q,[2,94]),e(q,[2,95]),e(q,[2,96]),e(q,[2,97]),e(q,[2,98]),e(q,[2,99]),e(q,[2,100]),e(q,[2,101]),e(q,[2,102]),e(q,[2,103]),e(q,[2,104]),{23:147,73:F},{23:149,60:148,73:F},{73:[2,68]},{73:[2,69]},{58:150,104:J},{58:152,104:J},{58:153,104:J},{58:154,104:J},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:D,53:O,54:k},{5:[1,160]},e(I,[2,20]),e(I,[2,21]),e(I,[2,23]),e(I,[2,24]),{4:a,5:o,8:8,9:10,10:s,13:13,14:c,15:l,17:[1,161],18:16,19:u,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:m,32:h,34:g,36:_,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:a,5:o,8:8,9:10,10:s,13:13,14:c,15:l,17:[1,162],18:16,19:u,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:m,32:h,34:g,36:_,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:a,5:o,8:8,9:10,10:s,13:13,14:c,15:l,17:[1,163],18:16,19:u,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:m,32:h,34:g,36:_,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,164]},{4:a,5:o,8:8,9:10,10:s,13:13,14:c,15:l,17:[2,47],18:16,19:u,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:m,32:h,34:g,36:_,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,50:[1,165],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,166]},{4:a,5:o,8:8,9:10,10:s,13:13,14:c,15:l,17:[2,45],18:16,19:u,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:m,32:h,34:g,36:_,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,49:[1,167],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,168]},{17:[1,169]},{4:a,5:o,8:8,9:10,10:s,13:13,14:c,15:l,17:[2,43],18:16,19:u,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:m,32:h,34:g,36:_,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,48:[1,170],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:a,5:o,8:8,9:10,10:s,13:13,14:c,15:l,17:[1,171],18:16,19:u,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:m,32:h,34:g,36:_,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{16:[1,172]},e(I,[2,50]),{16:[1,173]},e(I,[2,55]),e(Ce,[2,76]),{76:[1,174]},{16:[1,175]},e(I,[2,52]),{16:[1,176]},e(I,[2,57]),e(I,[2,53]),{23:177,73:F},{23:178,73:F},{23:179,73:F},{58:180,104:J},{23:181,72:[1,182],73:F},{58:183,104:J},{58:184,104:J},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(I,[2,17]),e(ve,[2,11]),{13:186,51:D,53:O,54:k},e(ve,[2,13]),e(ve,[2,14]),e(I,[2,19]),e(I,[2,35]),e(I,[2,36]),e(I,[2,37]),e(I,[2,38]),{16:[1,187]},e(I,[2,39]),{16:[1,188]},e(I,[2,40]),e(I,[2,41]),{16:[1,189]},e(I,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:J},{58:196,104:J},{58:197,104:J},{5:[2,75]},{58:198,104:J},{23:199,73:F},{5:[2,58]},{5:[2,59]},{23:200,73:F},e(ve,[2,12]),e(be,i,{7:124,41:201}),e(xe,i,{7:126,43:202}),e(Se,i,{7:129,46:203}),e(I,[2,49]),e(I,[2,54]),e(Ce,[2,77]),e(I,[2,51]),e(I,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:J},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:v(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:v(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,c=0,l=0,u=0,d=2,f=1,p=a.slice.call(arguments,1),m=Object.create(this.lexer),h={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(h.yy[g]=this.yy[g]);m.setInput(e,h.yy),h.yy.lexer=m,h.yy.parser=this,m.yylloc===void 0&&(m.yylloc={});var _=m.yylloc;a.push(_);var y=m.options&&m.options.ranges;typeof h.yy.parseError==`function`?this.parseError=h.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){n.length-=2*e,i.length-=e,a.length-=e}v(b,`popStack`);function x(){var e=r.pop()||m.lex()||f;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}v(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=n[n.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=o[w]&&o[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],o[w])this.terminals_[O]&&O>d&&j.push(`'`+this.terminals_[O]+`'`);M=m.showPosition?`Parse error on line `+(c+1)+`:
2
+ `+m.showPosition()+`
3
+ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(c+1)+`: Unexpected `+(S==f?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:m.match,token:this.terminals_[S]||S,line:m.yylineno,loc:_,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:n.push(S),i.push(m.yytext),a.push(m.yylloc),n.push(T[1]),S=null,C?(S=C,C=null):(l=m.yyleng,s=m.yytext,c=m.yylineno,_=m.yylloc,u>0&&u--);break;case 2:if(k=this.productions_[T[1]][1],D.$=i[i.length-k],D._$={first_line:a[a.length-(k||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(k||1)].first_column,last_column:a[a.length-1].last_column},y&&(D._$.range=[a[a.length-(k||1)].range[0],a[a.length-1].range[1]]),E=this.performAction.apply(D,[s,l,c,h.yy,T[1],i,a].concat(p)),E!==void 0)return E;k&&(n=n.slice(0,-1*k*2),i=i.slice(0,-1*k),a=a.slice(0,-1*k)),n.push(this.productions_[T[1]][0]),i.push(D.$),a.push(D._$),A=o[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0},`parse`)};we.lexer=(function(){return{EOF:1,parseError:v(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:v(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:v(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:v(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:v(function(){return this._more=!0,this},`more`),reject:v(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:v(function(e){this.unput(this.match.slice(e))},`less`),pastInput:v(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:v(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:v(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
+ `+t+`^`},`showPosition`),test_match:v(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:v(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e===!1?!1:e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:v(function(){return this.next()||this.lex()},`lex`),begin:v(function(e){this.conditionStack.push(e)},`begin`),popState:v(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:v(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:v(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:v(function(e){this.begin(e)},`pushState`),stateStackSize:v(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:v(function(e,t,n,r){switch(n){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin(`CONFIG`),75;case 8:return 76;case 9:return this.popState(),this.begin(`ALIAS`),77;case 10:return this.popState(),this.popState(),77;case 11:return t.yytext=t.yytext.trim(),73;case 12:return t.yytext=t.yytext.trim(),this.begin(`ALIAS`),73;case 13:return t.yytext=t.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return t.yytext=t.yytext.trim(),this.popState(),10;case 16:return this.begin(`LINE`),15;case 17:return this.begin(`ID`),51;case 18:return this.begin(`ID`),53;case 19:return 14;case 20:return this.begin(`ID`),54;case 21:return this.popState(),this.popState(),this.begin(`LINE`),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin(`LINE`),37;case 24:return this.begin(`LINE`),38;case 25:return this.begin(`LINE`),39;case 26:return this.begin(`LINE`),40;case 27:return this.begin(`LINE`),50;case 28:return this.begin(`LINE`),42;case 29:return this.begin(`LINE`),44;case 30:return this.begin(`LINE`),49;case 31:return this.begin(`LINE`),45;case 32:return this.begin(`LINE`),48;case 33:return this.begin(`LINE`),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin(`ID`),22;case 45:return this.begin(`ID`),24;case 46:return 30;case 47:return 31;case 48:return this.begin(`acc_title`),32;case 49:return this.popState(),`acc_title_value`;case 50:return this.begin(`acc_descr`),34;case 51:return this.popState(),`acc_descr_value`;case 52:this.begin(`acc_descr_multiline`);break;case 53:this.popState();break;case 54:return`acc_descr_multiline_value`;case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return t.yytext=t.yytext.trim(),73;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},`anonymous`),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}}})();function Te(){this.yy={}}return v(Te,`Parser`),Te.prototype=we,we.Parser=Te,new Te})();P.parser=P;var F=P,I={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},L={FILLED:0,OPEN:1},ee={LEFTOF:0,RIGHTOF:1,OVER:2},R={ACTOR:`actor`,BOUNDARY:`boundary`,COLLECTIONS:`collections`,CONTROL:`control`,DATABASE:`database`,ENTITY:`entity`,PARTICIPANT:`participant`,QUEUE:`queue`},te=class{constructor(){this.state=new M(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=o,this.setAccDescription=e,this.setDiagramTitle=s,this.getAccTitle=g,this.getAccDescription=c,this.getDiagramTitle=t,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(u().wrap),this.LINETYPE=I,this.ARROWTYPE=L,this.PLACEMENT=ee}static{v(this,`SequenceDB`)}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,t,n,r,i){let a=this.state.records.currentBox,o;if(i!==void 0){let e;e=i.includes(`
7
+ `)?i+`
8
+ `:`{
9
+ `+i+`
10
+ }`,o=w(e,{schema:T})}r=o?.type??r,o?.alias&&(!n||n.text===t)&&(n={text:o.alias,wrap:n?.wrap,type:r});let s=this.state.records.actors.get(e);if(s){if(this.state.records.currentBox&&s.box&&this.state.records.currentBox!==s.box)throw Error(`A same participant should only be defined in one Box: ${s.name} can't be in '${s.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(a=s.box?s.box:this.state.records.currentBox,s.box=a,s&&t===s.name&&n==null)return}if(n?.text??(n={text:t,type:r}),(r==null||n.text==null)&&(n={text:t,type:r}),this.state.records.actors.set(e,{box:a,name:t,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??`participant`}),this.state.records.prevActor){let t=this.state.records.actors.get(this.state.records.prevActor);t&&(t.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let t,n=0;if(!e)return 0;for(t=0;t<this.state.records.messages.length;t++)this.state.records.messages[t].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[t].from===e&&n++,this.state.records.messages[t].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[t].from===e&&n--;return n}addMessage(e,t,n,r){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:t,message:n.text,wrap:n.wrap??this.autoWrap(),answer:r})}addSignal(e,t,n,r,i=!1,a){if(r===this.LINETYPE.ACTIVE_END&&this.activationCount(e??``)<1){let t=Error(`Trying to inactivate an inactive participant (`+e+`)`);throw t.hash={text:`->>-`,token:`->>-`,line:`1`,loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:[`'ACTIVE_PARTICIPANT'`]},t}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:t,message:n?.text??``,wrap:n?.wrap??this.autoWrap(),type:r,activate:i,centralConnection:a??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();let t=/^:?wrap:/.exec(e)===null?/^:?nowrap:/.exec(e)===null?void 0:!1:!0;return{cleanedText:(t===void 0?e:e.replace(/^:?(?:no)?wrap:/,``)).trim(),wrap:t}}autoWrap(){return this.state.records.wrapEnabled===void 0?u().sequence?.wrap??!1:this.state.records.wrapEnabled}clear(){this.state.reset(),l()}parseMessage(e){let t=e.trim(),{wrap:n,cleanedText:r}=this.extractWrap(t),i={text:r,wrap:n};return b.debug(`parseMessage: ${JSON.stringify(i)}`),i}parseBoxData(e){let t=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e),n=t?.[1]?t[1].trim():`transparent`,i=t?.[2]?t[2].trim():void 0;if(window?.CSS)window.CSS.supports(`color`,n)||(n=`transparent`,i=e.trim());else{let t=new Option().style;t.color=n,t.color!==n&&(n=`transparent`,i=e.trim())}let{wrap:a,cleanedText:o}=this.extractWrap(i);return{text:o?r(o,u()):void 0,color:n,wrap:a}}addNote(e,t,n){let r={actor:e,placement:t,message:n.text,wrap:n.wrap??this.autoWrap()},i=[].concat(e,e);this.state.records.notes.push(r),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:t})}addLinks(e,t){let n=this.getActor(e);try{let e=r(t.text,u());e=e.replace(/&equals;/g,`=`),e=e.replace(/&amp;/g,`&`);let i=JSON.parse(e);this.insertLinks(n,i)}catch(e){b.error(`error while parsing actor link text`,e)}}addALink(e,t){let n=this.getActor(e);try{let e={},i=r(t.text,u()),a=i.indexOf(`@`);i=i.replace(/&equals;/g,`=`),i=i.replace(/&amp;/g,`&`);let o=i.slice(0,a-1).trim();e[o]=i.slice(a+1).trim(),this.insertLinks(n,e)}catch(e){b.error(`error while parsing actor link text`,e)}}insertLinks(e,t){if(e.links==null)e.links=t;else for(let n in t)e.links[n]=t[n]}addProperties(e,t){let n=this.getActor(e);try{let e=r(t.text,u()),i=JSON.parse(e);this.insertProperties(n,i)}catch(e){b.error(`error while parsing actor properties text`,e)}}insertProperties(e,t){if(e.properties==null)e.properties=t;else for(let n in t)e.properties[n]=t[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,t){let n=this.getActor(e),r=document.getElementById(t.text);try{let e=r.innerHTML,t=JSON.parse(e);t.properties&&this.insertProperties(n,t.properties),t.links&&this.insertLinks(n,t.links)}catch(e){b.error(`error while parsing actor details text`,e)}}getActorProperty(e,t){if(e?.properties!==void 0)return e.properties[t]}apply(e){if(Array.isArray(e))e.forEach(e=>{this.apply(e)});else switch(e.type){case`sequenceIndex`:this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case`addParticipant`:this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case`createParticipant`:if(this.state.records.actors.has(e.actor))throw Error(`It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior`);this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case`destroyParticipant`:this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case`activeStart`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`centralConnection`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`centralConnectionReverse`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`activeEnd`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`addNote`:this.addNote(e.actor,e.placement,e.text);break;case`addLinks`:this.addLinks(e.actor,e.text);break;case`addALink`:this.addALink(e.actor,e.text);break;case`addProperties`:this.addProperties(e.actor,e.text);break;case`addDetails`:this.addDetails(e.actor,e.text);break;case`addMessage`:if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw Error(`The created participant `+this.state.records.lastCreated.name+` does not have an associated creating message after its declaration. Please check the sequence diagram.`);this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw Error(`The destroyed participant `+this.state.records.lastDestroyed.name+` does not have an associated destroying message after its declaration. Please check the sequence diagram.`);this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case`boxStart`:this.addBox(e.boxData);break;case`boxEnd`:this.boxEnd();break;case`loopStart`:this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case`loopEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`rectStart`:this.addSignal(void 0,void 0,e.color,e.signalType);break;case`rectEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`optStart`:this.addSignal(void 0,void 0,e.optText,e.signalType);break;case`optEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`altStart`:this.addSignal(void 0,void 0,e.altText,e.signalType);break;case`else`:this.addSignal(void 0,void 0,e.altText,e.signalType);break;case`altEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`setAccTitle`:o(e.text);break;case`parStart`:this.addSignal(void 0,void 0,e.parText,e.signalType);break;case`and`:this.addSignal(void 0,void 0,e.parText,e.signalType);break;case`parEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`criticalStart`:this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case`option`:this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case`criticalEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`breakStart`:this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case`breakEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break}}getConfig(){return u().sequence}},ne=v(e=>{let t=e.dropShadow??`none`,{look:n}=u();return`.actor {
11
+ stroke: ${e.actorBorder};
12
+ fill: ${e.actorBkg};
13
+ stroke-width: ${e.strokeWidth??1};
14
+ }
15
+
16
+ rect.actor.outer-path[data-look="neo"] {
17
+ filter: ${t};
18
+ }
19
+
20
+ rect.note[data-look="neo"] {
21
+ stroke:${e.noteBorderColor};
22
+ fill:${e.noteBkgColor};
23
+ filter: ${t};
24
+ }
25
+
26
+ text.actor > tspan {
27
+ fill: ${e.actorTextColor};
28
+ stroke: none;
29
+ }
30
+
31
+ .actor-line {
32
+ stroke: ${e.actorLineColor};
33
+ }
34
+
35
+ .innerArc {
36
+ stroke-width: 1.5;
37
+ stroke-dasharray: none;
38
+ }
39
+
40
+ .messageLine0 {
41
+ stroke-width: 1.5;
42
+ stroke-dasharray: none;
43
+ stroke: ${e.signalColor};
44
+ }
45
+
46
+ .messageLine1 {
47
+ stroke-width: 1.5;
48
+ stroke-dasharray: 2, 2;
49
+ stroke: ${e.signalColor};
50
+ }
51
+
52
+ [id$="-arrowhead"] path {
53
+ fill: ${e.signalColor};
54
+ stroke: ${e.signalColor};
55
+ }
56
+
57
+ .sequenceNumber {
58
+ fill: ${e.sequenceNumberColor};
59
+ }
60
+
61
+ [id$="-sequencenumber"] {
62
+ fill: ${e.signalColor};
63
+ }
64
+
65
+ [id$="-crosshead"] path {
66
+ fill: ${e.signalColor};
67
+ stroke: ${e.signalColor};
68
+ }
69
+
70
+ .messageText {
71
+ fill: ${e.signalTextColor};
72
+ stroke: none;
73
+ }
74
+
75
+ .labelBox {
76
+ stroke: ${e.labelBoxBorderColor};
77
+ fill: ${e.labelBoxBkgColor};
78
+ filter: ${n===`neo`?t:`none`};
79
+ }
80
+
81
+ .labelText, .labelText > tspan {
82
+ fill: ${e.labelTextColor};
83
+ stroke: none;
84
+ }
85
+
86
+ .loopText, .loopText > tspan {
87
+ fill: ${e.loopTextColor};
88
+ stroke: none;
89
+ }
90
+
91
+ .loopLine {
92
+ stroke-width: 2px;
93
+ stroke-dasharray: 2, 2;
94
+ stroke: ${e.labelBoxBorderColor};
95
+ fill: ${e.labelBoxBorderColor};
96
+ }
97
+
98
+ .note {
99
+ //stroke: #decc93;
100
+ stroke: ${e.noteBorderColor};
101
+ fill: ${e.noteBkgColor};
102
+ }
103
+
104
+ .noteText, .noteText > tspan {
105
+ fill: ${e.noteTextColor};
106
+ stroke: none;
107
+ ${e.noteFontWeight?`font-weight: ${e.noteFontWeight};`:``}
108
+ }
109
+
110
+ .activation0 {
111
+ fill: ${e.activationBkgColor};
112
+ stroke: ${e.activationBorderColor};
113
+ }
114
+
115
+ .activation1 {
116
+ fill: ${e.activationBkgColor};
117
+ stroke: ${e.activationBorderColor};
118
+ }
119
+
120
+ .activation2 {
121
+ fill: ${e.activationBkgColor};
122
+ stroke: ${e.activationBorderColor};
123
+ }
124
+
125
+ .actorPopupMenu {
126
+ position: absolute;
127
+ }
128
+
129
+ .actorPopupMenuPanel {
130
+ position: absolute;
131
+ fill: ${e.actorBkg};
132
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
133
+ filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
134
+ }
135
+ .actor-man circle, line {
136
+ fill: ${e.actorBkg};
137
+ stroke-width: 2px;
138
+ }
139
+
140
+ g rect.rect {
141
+ filter: ${t};
142
+ stroke: ${e.nodeBorder};
143
+ }
144
+ `},`getStyles`),z=36,B=`actor-top`,V=`actor-bottom`,re=`actor-box`,H=`actor-man`,U=new Set([`redux-color`,`redux-dark-color`]),W=v(function(e,t){let n=E(e,t);return _().look===`neo`&&n.attr(`data-look`,`neo`),n},`drawRect`),ie=v(function(e,t,n,r,i){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};let a=t.links,o=t.actorCnt,s=t.rectData;var c=`none`;i&&(c=`block !important`);let l=e.append(`g`);l.attr(`id`,`actor`+o+`_popup`),l.attr(`class`,`actorPopupMenu`),l.attr(`display`,c);var u=``;s.class!==void 0&&(u=` `+s.class);let d=s.width>n?s.width:n,f=l.append(`rect`);if(f.attr(`class`,`actorPopupMenuPanel`+u),f.attr(`x`,s.x),f.attr(`y`,s.height),f.attr(`fill`,s.fill),f.attr(`stroke`,s.stroke),f.attr(`width`,d),f.attr(`height`,s.height),f.attr(`rx`,s.rx),f.attr(`ry`,s.ry),a!=null){var p=20;for(let e in a){var m=l.append(`a`),h=(0,N.sanitizeUrl)(a[e]);m.attr(`xlink:href`,h),m.attr(`target`,`_blank`),je(r)(e,m,s.x+10,s.height+p,d,20,{class:`actor`},r),p+=30}}return f.attr(`height`,p),{height:s.height+p,width:d}},`drawPopup`),ae=v(function(e){return`var pu = document.getElementById('`+e+`'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }`},`popupMenuToggle`),oe=v(async function(e,t,n=null){let r=e.append(`foreignObject`),a=await i(t.text,_()),o=r.append(`xhtml:div`).attr(`style`,`width: fit-content;`).attr(`xmlns`,`http://www.w3.org/1999/xhtml`).html(a).node().getBoundingClientRect();if(r.attr(`height`,Math.round(o.height)).attr(`width`,Math.round(o.width)),t.class===`noteText`){let n=e.node().firstChild;n.setAttribute(`height`,o.height+2*t.textMargin);let i=n.getBBox();r.attr(`x`,Math.round(i.x+i.width/2-o.width/2)).attr(`y`,Math.round(i.y+i.height/2-o.height/2))}else if(n){let{startx:e,stopx:i,starty:a}=n;if(e>i){let t=e;e=i,i=t}r.attr(`x`,Math.round(e+Math.abs(e-i)/2-o.width/2)),t.class===`loopText`?r.attr(`y`,Math.round(a)):r.attr(`y`,Math.round(a-o.height))}return[r]},`drawKatex`),G=v(function(e,t){let n=0,r=0,i=t.text.split(h.lineBreakRegex),[a,o]=S(t.fontSize),s=[],c=0,l=v(()=>t.y,`yfunc`);if(t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0)switch(t.valign){case`top`:case`start`:l=v(()=>Math.round(t.y+t.textMargin),`yfunc`);break;case`middle`:case`center`:l=v(()=>Math.round(t.y+(n+r+t.textMargin)/2),`yfunc`);break;case`bottom`:case`end`:l=v(()=>Math.round(t.y+(n+r+2*t.textMargin)-t.textMargin),`yfunc`);break}if(t.anchor!==void 0&&t.textMargin!==void 0&&t.width!==void 0)switch(t.anchor){case`left`:case`start`:t.x=Math.round(t.x+t.textMargin),t.anchor=`start`,t.dominantBaseline=`middle`,t.alignmentBaseline=`middle`;break;case`middle`:case`center`:t.x=Math.round(t.x+t.width/2),t.anchor=`middle`,t.dominantBaseline=`middle`,t.alignmentBaseline=`middle`;break;case`right`:case`end`:t.x=Math.round(t.x+t.width-t.textMargin),t.anchor=`end`,t.dominantBaseline=`middle`,t.alignmentBaseline=`middle`;break}for(let[u,d]of i.entries()){t.textMargin!==void 0&&t.textMargin===0&&a!==void 0&&(c=u*a);let i=e.append(`text`);i.attr(`x`,t.x),i.attr(`y`,l()),t.anchor!==void 0&&i.attr(`text-anchor`,t.anchor).attr(`dominant-baseline`,t.dominantBaseline).attr(`alignment-baseline`,t.alignmentBaseline),t.fontFamily!==void 0&&i.style(`font-family`,t.fontFamily),o!==void 0&&i.style(`font-size`,o),t.fontWeight!==void 0&&i.style(`font-weight`,t.fontWeight),t.fill!==void 0&&i.attr(`fill`,t.fill),t.class!==void 0&&i.attr(`class`,t.class),t.dy===void 0?c!==0&&i.attr(`dy`,c):i.attr(`dy`,t.dy);let f=d||`​`;if(t.tspan){let e=i.append(`tspan`);e.attr(`x`,t.x),t.fill!==void 0&&e.attr(`fill`,t.fill),e.text(f)}else i.text(f);t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0&&(r+=(i._groups||i)[0][0].getBBox().height,n=r),s.push(i)}return s},`drawText`),se=v(function(e,t){function n(e,t,n,r,i){return e+`,`+t+` `+(e+n)+`,`+t+` `+(e+n)+`,`+(t+r-i)+` `+(e+n-i*1.2)+`,`+(t+r)+` `+e+`,`+(t+r)}v(n,`genPoints`);let r=e.append(`polygon`);return r.attr(`points`,n(t.x,t.y,t.width,t.height,7)),r.attr(`class`,`labelBox`),t.y+=t.height/2,G(e,t),r},`drawLabel`),K=-1,ce=v((e,t,n,r)=>{e.select&&n.forEach(n=>{let i=t.get(n),a=e.select(`#actor`+i.actorCnt);!r.mirrorActors&&i.stopy?a.attr(`y2`,i.stopy+i.height/2):r.mirrorActors&&a.attr(`y2`,i.stopy)})},`fixLifeLineHeights`),le=v(function(e,t,n,r,i){let a=r?t.stopy:t.starty,o=t.x+t.width/2,s=a+t.height,{look:c,theme:l,themeVariables:u}=n,{bkgColorArray:d,borderColorArray:f}=u,m=e.append(`g`).lower();var h=m;r||(K++,Object.keys(t.links||{}).length&&!n.forceMenus&&h.attr(`onclick`,ae(`actor${K}_popup`)).attr(`cursor`,`pointer`),h.append(`line`).attr(`id`,`actor`+K).attr(`x1`,o).attr(`y1`,s).attr(`x2`,o).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),h=m.append(`g`),t.actorCnt=K,t.links!=null&&h.attr(`id`,`root-`+K),c===`neo`&&h.attr(`data-look`,`neo`));let g=j();var _=`actor`;t.properties?.class?_=t.properties.class:g.fill=`#eaeaea`,r?_+=` ${V}`:_+=` ${B}`,g.x=t.x,g.y=a,g.width=t.width,g.height=t.height,g.class=_,g.rx=3,g.ry=3,g.name=t.name,c===`neo`&&(g.rx=6,g.ry=6);let v=W(h,g),y=i.get(t.name)??0;if(U.has(l)&&(v.style(`stroke`,f[y%f.length]),v.style(`fill`,d[y%f.length])),c===`neo`&&v.attr(`filter`,`url(#drop-shadow)`),t.rectData=g,t.properties?.icon){let e=t.properties.icon.trim();e.charAt(0)===`@`?A(h,g.x+g.width-20,g.y+10,e.substr(1)):O(h,g.x+g.width-20,g.y+10,e)}r||(h.attr(`data-et`,`participant`),h.attr(`data-type`,`participant`),h.attr(`data-id`,t.name)),Y(n,p(t.description))(t.description,h,g.x,g.y,g.width,g.height,{class:`actor ${re}`},n);let b=t.height;if(v.node){let e=v.node().getBBox();t.height=e.height,b=e.height}return b},`drawActorTypeParticipant`),ue=v(function(e,t,n,r,i){let a=r?t.stopy:t.starty,o=t.x+t.width/2,s=a+t.height,{look:c,theme:l,themeVariables:u}=n,{bkgColorArray:d,borderColorArray:f}=u,m=e.append(`g`).lower();var h=m;r||(K++,Object.keys(t.links||{}).length&&!n.forceMenus&&h.attr(`onclick`,ae(`actor${K}_popup`)).attr(`cursor`,`pointer`),h.append(`line`).attr(`id`,`actor`+K).attr(`x1`,o).attr(`y1`,s).attr(`x2`,o).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),h=m.append(`g`),t.actorCnt=K,t.links!=null&&h.attr(`id`,`root-`+K),c===`neo`&&h.attr(`data-look`,`neo`));let g=j();var _=`actor`;t.properties?.class?_=t.properties.class:g.fill=`#eaeaea`,r?_+=` ${V}`:_+=` ${B}`,g.x=t.x,g.y=a,g.width=t.width,g.height=t.height,g.class=_,g.name=t.name;let v={...g,x:g.x+-6,y:g.y+6,class:`actor`},y=W(h,g),b=W(h,v);t.rectData=g,c===`neo`&&h.attr(`filter`,`url(#drop-shadow)`);let x=i.get(t.name)??0;if(U.has(l)&&(y.style(`stroke`,f[x%f.length]),y.style(`fill`,d[x%f.length]),b.style(`stroke`,f[x%f.length]),b.style(`fill`,d[x%f.length])),t.properties?.icon){let e=t.properties.icon.trim();e.charAt(0)===`@`?A(h,g.x+g.width-20,g.y+10,e.substr(1)):O(h,g.x+g.width-20,g.y+10,e)}Y(n,p(t.description))(t.description,h,g.x-6,g.y+6,g.width,g.height,{class:`actor ${re}`},n);let S=t.height;if(y.node){let e=y.node().getBBox();t.height=e.height,S=e.height}return r||(h.attr(`data-et`,`participant`),h.attr(`data-type`,`collections`),h.attr(`data-id`,t.name)),S},`drawActorTypeCollections`),de=v(function(e,t,n,r,i){let a=r?t.stopy:t.starty,o=t.x+t.width/2,s=a+t.height,{look:c,theme:l,themeVariables:u}=n,{bkgColorArray:d,borderColorArray:f}=u,m=e.append(`g`).lower(),h=m;r||(K++,Object.keys(t.links||{}).length&&!n.forceMenus&&h.attr(`onclick`,ae(`actor${K}_popup`)).attr(`cursor`,`pointer`),h.append(`line`).attr(`id`,`actor`+K).attr(`x1`,o).attr(`y1`,s).attr(`x2`,o).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),h=m.append(`g`),t.actorCnt=K,t.links!=null&&h.attr(`id`,`root-`+K),c===`neo`&&h.attr(`data-look`,`neo`));let g=j(),_=`actor`;t.properties?.class?_=t.properties.class:g.fill=`#eaeaea`,r?_+=` ${V}`:_+=` ${B}`,h.attr(`class`,_),g.x=t.x,g.y=a,g.width=t.width,g.height=t.height,g.name=t.name;let v=g.height/2,y=v/(2.5+g.height/50),b=h.append(`g`),x=h.append(`g`),S=`M ${g.x},${g.y+v}
145
+ a ${y},${v} 0 0 0 0,${g.height}
146
+ h ${g.width-2*y}
147
+ a ${y},${v} 0 0 0 0,-${g.height}
148
+ Z
149
+ `;b.append(`path`).attr(`d`,S),x.append(`path`).attr(`d`,`M ${g.x},${g.y+v}
150
+ a ${y},${v} 0 0 0 0,${g.height}`),b.attr(`transform`,`translate(${y}, ${-(g.height/2)})`),x.attr(`transform`,`translate(${g.width-y}, ${-g.height/2})`),t.rectData=g,c===`neo`&&b.attr(`filter`,`url(#drop-shadow)`);let C=i.get(t.name)??0;if(U.has(l)&&(b.style(`stroke`,f[C%f.length]),b.style(`fill`,d[C%f.length]),x.style(`stroke`,f[C%f.length]),x.style(`fill`,d[C%f.length])),t.properties?.icon){let e=t.properties.icon.trim(),n=g.x+g.width-20,r=g.y+10;e.charAt(0)===`@`?A(h,n,r,e.substr(1)):O(h,n,r,e)}Y(n,p(t.description))(t.description,h,g.x,g.y,g.width,g.height,{class:`actor ${re}`},n);let w=t.height,T=b.select(`path:last-child`);if(T.node()){let e=T.node().getBBox();t.height=e.height,w=e.height}return r||(h.attr(`data-et`,`participant`),h.attr(`data-type`,`queue`),h.attr(`data-id`,t.name)),w},`drawActorTypeQueue`),fe=v(function(e,t,n,r,i,a){let o=r?t.stopy:t.starty,s=t.x+t.width/2,c=o+75,{look:l,theme:u,themeVariables:d}=n,{bkgColorArray:f,borderColorArray:m,actorBorder:h,actorBkg:g}=d,_=e.append(`g`).lower();r||(K++,_.append(`line`).attr(`id`,`actor`+K).attr(`x1`,s).attr(`y1`,c).attr(`x2`,s).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),t.actorCnt=K);let v=e.append(`g`),y=H;r?y+=` ${V}`:y+=` ${B}`,v.attr(`class`,y),v.attr(`name`,t.name);let b=j();b.x=t.x,b.y=o,b.fill=`#eaeaea`,b.width=t.width,b.height=t.height,b.class=`actor`;let x=t.x+t.width/2,S=o+32;v.append(`defs`).append(`marker`).attr(`id`,i+`-filled-head-control`).attr(`refX`,11).attr(`refY`,5.8).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`172.5`).attr(`stroke-width`,1.2).append(`path`).attr(`d`,`M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z`),v.append(`circle`).attr(`cx`,x).attr(`cy`,S).attr(`r`,22).attr(`filter`,`${l===`neo`?`url(#drop-shadow)`:``}`),v.append(`line`).attr(`marker-end`,`url(#`+i+`-filled-head-control)`).attr(`transform`,`translate(${x}, ${S-22})`);let C=a.get(t.name)??0;return U.has(u)?(v.style(`stroke`,m[C%m.length]),v.style(`fill`,f[C%m.length])):(v.style(`stroke`,h),v.style(`fill`,g)),t.height=v.node().getBBox().height+2*(n?.sequence?.labelBoxHeight??0),Y(n,p(t.description))(t.description,v,b.x,b.y+22+(r?5:12),b.width,b.height,{class:`actor ${H}`},n),r||(v.attr(`data-et`,`participant`),v.attr(`data-type`,`control`),v.attr(`data-id`,t.name)),t.height},`drawActorTypeControl`),pe=v(function(e,t,n,r,i){let a=r?t.stopy:t.starty,o=t.x+t.width/2,s=a+75,{look:c,theme:l,themeVariables:u}=n,{bkgColorArray:d,borderColorArray:f}=u,m=e.append(`g`).lower(),h=e.append(`g`),g=`actor`;r?g+=` ${V}`:g+=` ${B}`,h.attr(`class`,g),h.attr(`name`,t.name);let _=j();_.x=t.x,_.y=a,_.fill=`#eaeaea`,_.width=t.width,_.height=t.height,_.class=`actor`;let v=t.x+t.width/2,y=a+(r?10:25);h.append(`circle`).attr(`cx`,v).attr(`cy`,y).attr(`r`,22).attr(`width`,t.width).attr(`height`,t.height),h.append(`line`).attr(`x1`,v-22).attr(`x2`,v+22).attr(`y1`,y+22).attr(`y2`,y+22).attr(`stroke-width`,2),c===`neo`&&h.attr(`filter`,`url(#drop-shadow)`);let b=i.get(t.name)??0;return U.has(l)&&(h.style(`stroke`,f[b%f.length]),h.style(`fill`,d[b%f.length])),t.height=h.node().getBBox().height+(n?.sequence?.labelBoxHeight??0),r||(K++,m.append(`line`).attr(`id`,`actor`+K).attr(`x1`,o).attr(`y1`,s).attr(`x2`,o).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),t.actorCnt=K),Y(n,p(t.description))(t.description,h,_.x,_.y+(r?15:30),_.width,_.height,{class:`actor ${H}`},n),r?h.attr(`transform`,`translate(0, 22)`):(h.attr(`transform`,`translate(0, ${22/2-5})`),h.attr(`data-et`,`participant`),h.attr(`data-type`,`entity`),h.attr(`data-id`,t.name)),t.height},`drawActorTypeEntity`),me=v(function(e,t,n,r,i){let a=r?t.stopy:t.starty,o=t.x+t.width/2,s=a+t.height+2*n.boxTextMargin,{theme:c,themeVariables:l,look:u}=n,{bkgColorArray:d,borderColorArray:f,actorBorder:m}=l,h=e.append(`g`).lower(),g=h;r||(K++,Object.keys(t.links||{}).length&&!n.forceMenus&&g.attr(`onclick`,ae(`actor${K}_popup`)).attr(`cursor`,`pointer`),g.append(`line`).attr(`id`,`actor`+K).attr(`x1`,o).attr(`y1`,s).attr(`x2`,o).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),g=h.append(`g`),t.actorCnt=K,t.links!=null&&g.attr(`id`,`root-`+K),u===`neo`&&g.attr(`data-look`,`neo`));let _=j(),v=`actor`;t.properties?.class?v=t.properties.class:_.fill=`#eaeaea`,r?v+=` ${V}`:v+=` ${B}`,_.x=t.x,_.y=a,_.width=t.width,_.height=t.height,_.class=v,_.name=t.name,_.x=t.x,_.y=a;let y=_.width/3,b=_.width/3,x=y/2,S=x/(2.5+y/50),C=g.append(`g`);C.attr(`class`,v);let w=`
151
+ M ${_.x},${_.y+S}
152
+ a ${x},${S} 0 0 0 ${y},0
153
+ a ${x},${S} 0 0 0 -${y},0
154
+ l 0,${b-2*S}
155
+ a ${x},${S} 0 0 0 ${y},0
156
+ l 0,-${b-2*S}
157
+ `;C.append(`path`).attr(`d`,w),u===`neo`&&C.attr(`filter`,`url(#drop-shadow)`);let T=i.get(t.name)??0;U.has(c)?(C.style(`stroke`,f[T%f.length]),C.style(`fill`,d[T%f.length])):C.style(`stroke`,m),C.attr(`transform`,`translate(${y}, ${S})`),t.rectData=_,Y(n,p(t.description))(t.description,g,_.x,_.y+35,_.width,_.height,{class:`actor ${re}`},n);let E=C.select(`path:last-child`);return E.node()&&(t.height=E.node().getBBox().height+(n.sequence.labelBoxHeight??0)),r||(g.attr(`data-et`,`participant`),g.attr(`data-type`,`database`),g.attr(`data-id`,t.name)),t.height},`drawActorTypeDatabase`),he=v(function(e,t,n,r,i){let a=r?t.stopy:t.starty,o=t.x+t.width/2,s=a+80,c=e.append(`g`).lower(),{look:l,theme:u,themeVariables:d}=n,{bkgColorArray:f,borderColorArray:m,actorBorder:h}=d;r||(K++,c.append(`line`).attr(`id`,`actor`+K).attr(`x1`,o).attr(`y1`,s).attr(`x2`,o).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),t.actorCnt=K);let g=e.append(`g`),_=H;r?_+=` ${V}`:_+=` ${B}`,g.attr(`class`,_),g.attr(`name`,t.name);let v=j();v.x=t.x,v.y=a,v.fill=`#eaeaea`,v.width=t.width,v.height=t.height,v.class=`actor`,g.append(`line`).attr(`id`,`actor-man-torso`+K).attr(`x1`,t.x+t.width/2-22*2.5).attr(`y1`,a+12).attr(`x2`,t.x+t.width/2-15).attr(`y2`,a+12),g.append(`line`).attr(`id`,`actor-man-arms`+K).attr(`x1`,t.x+t.width/2-22*2.5).attr(`y1`,a+2).attr(`x2`,t.x+t.width/2-22*2.5).attr(`y2`,a+22),g.append(`circle`).attr(`cx`,t.x+t.width/2).attr(`cy`,a+12).attr(`r`,22),l===`neo`&&g.attr(`filter`,`url(#drop-shadow)`);let y=i.get(t.name)??0;return U.has(u)?(g.style(`stroke`,m[y%m.length]),g.style(`fill`,f[y%m.length])):g.style(`stroke`,h),t.height=g.node().getBBox().height+(n.sequence.labelBoxHeight??0),Y(n,p(t.description))(t.description,g,v.x,v.y+15,v.width,v.height,{class:`actor ${H}`},n),g.attr(`transform`,`translate(0,21)`),r||(g.attr(`data-et`,`participant`),g.attr(`data-type`,`boundary`),g.attr(`data-id`,t.name)),t.height},`drawActorTypeBoundary`),ge=v(function(e,t,n,r,i){let a=r?t.stopy:t.starty,o=t.x+t.width/2,s=a+80,{look:c,theme:l,themeVariables:u}=n,{bkgColorArray:d,borderColorArray:f,actorBorder:m}=u,h=e.append(`g`).lower();r||(K++,h.append(`line`).attr(`id`,`actor`+K).attr(`x1`,o).attr(`y1`,s).attr(`x2`,o).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),t.actorCnt=K);let g=e.append(`g`),_=H;r?_+=` ${V}`:_+=` ${B}`,g.attr(`class`,_),g.attr(`name`,t.name),r||g.attr(`data-et`,`participant`).attr(`data-type`,`actor`).attr(`data-id`,t.name);let v=c===`neo`?.5:1,y=c===`neo`?a+(1-v)*30:a;g.append(`line`).attr(`id`,`actor-man-torso`+K).attr(`x1`,o).attr(`y1`,y+25*v).attr(`x2`,o).attr(`y2`,y+45*v),g.append(`line`).attr(`id`,`actor-man-arms`+K).attr(`x1`,o-z/2*v).attr(`y1`,y+33*v).attr(`x2`,o+z/2*v).attr(`y2`,y+33*v),g.append(`line`).attr(`x1`,o-z/2*v).attr(`y1`,y+60*v).attr(`x2`,o).attr(`y2`,y+45*v),g.append(`line`).attr(`x1`,o).attr(`y1`,y+45*v).attr(`x2`,o+(z/2-2)*v).attr(`y2`,y+60*v);let b=g.append(`circle`);b.attr(`cx`,t.x+t.width/2),b.attr(`cy`,y+10*v),b.attr(`r`,15*v),b.attr(`width`,t.width*v),b.attr(`height`,t.height*v),t.height=g.node().getBBox().height;let x=j();x.x=t.x,x.y=y,x.fill=`#eaeaea`,x.width=t.width,x.height=t.height/v,x.class=`actor`,x.rx=3,x.ry=3;let S=i.get(t.name)??0;return U.has(l)?(g.style(`stroke`,f[S%f.length]),g.style(`fill`,d[S%f.length])):g.style(`stroke`,m),Y(n,p(t.description))(t.description,g,x.x,y+35*v-(c===`neo`?10:0),x.width,x.height,{class:`actor ${H}`},n),t.height},`drawActorTypeActor`),_e=v(async function(e,t,n,r,i,a,o){let s=o??new Map([...a.db.getActors().values()].map((e,t)=>[e.name,t]));switch(t.type){case`actor`:return await ge(e,t,n,r,s);case`participant`:return await le(e,t,n,r,s);case`boundary`:return await he(e,t,n,r,s);case`control`:return await fe(e,t,n,r,i,s);case`entity`:return await pe(e,t,n,r,s);case`database`:return await me(e,t,n,r,s);case`collections`:return await ue(e,t,n,r,s);case`queue`:return await de(e,t,n,r,s)}},`drawActor`),ve=v(function(e,t,n){let r=e.append(`g`);Se(r,t),t.name&&Y(n)(t.name,r,t.x,t.y+n.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:`text`},n),r.lower()},`drawBox`),ye=v(function(e){return e.append(`g`)},`anchorElement`),be=v(function(e,t,n,r,i,a,o){let{theme:s,themeVariables:c}=r,{bkgColorArray:l,borderColorArray:u,mainBkg:d}=c,f=j(),p=t.anchored,m=t.actor;f.x=t.startx,f.y=t.starty,f.class=`activation`+i%3,f.width=t.stopx-t.startx,f.height=n-t.starty;let h=W(p,f),g=(o??new Map([...a.db.getActors().values()].map((e,t)=>[e.name,t]))).get(m)??0;U.has(s)&&(h.style(`stroke`,u[g%u.length]),h.style(`fill`,l[g%u.length]??d))},`drawActivation`),xe=v(async function(e,t,n,r,i){let{boxMargin:a,boxTextMargin:o,labelBoxHeight:s,labelBoxWidth:c,messageFontFamily:l,messageFontSize:u,messageFontWeight:d}=r,f=e.append(`g`).attr(`data-et`,`control-structure`).attr(`data-id`,`i`+i.id),m=v(function(e,t,n,r){return f.append(`line`).attr(`x1`,e).attr(`y1`,t).attr(`x2`,n).attr(`y2`,r).attr(`class`,`loopLine`)},`drawLoopLine`);m(t.startx,t.starty,t.stopx,t.starty),m(t.stopx,t.starty,t.stopx,t.stopy),m(t.startx,t.stopy,t.stopx,t.stopy),m(t.startx,t.starty,t.startx,t.stopy),t.sections!==void 0&&t.sections.forEach(function(e){m(t.startx,e.y,t.stopx,e.y).style(`stroke-dasharray`,`3, 3`)});let h=D();h.text=n,h.x=t.startx,h.y=t.starty,h.fontFamily=l,h.fontSize=u,h.fontWeight=d,h.anchor=`middle`,h.valign=`middle`,h.tspan=!1,h.width=Math.max(c??0,50),h.height=s+(r.look===`neo`?15:0)||20,h.textMargin=o,h.class=`labelText`,se(f,h),h=ke(),h.text=t.title,h.x=t.startx+c/2+(t.stopx-t.startx)/2,h.y=t.starty+a+o,h.anchor=`middle`,h.valign=`middle`,h.textMargin=o,h.class=`loopText`,h.fontFamily=l,h.fontSize=u,h.fontWeight=d,h.wrap=!0;let g=p(h.text)?await oe(f,h,t):G(f,h);if(t.sectionTitles!==void 0){for(let[e,n]of Object.entries(t.sectionTitles))if(n.message){h.text=n.message,h.x=t.startx+(t.stopx-t.startx)/2,h.y=t.sections[e].y+a+o,h.class=`loopText`,h.anchor=`middle`,h.valign=`middle`,h.tspan=!1,h.fontFamily=l,h.fontSize=u,h.fontWeight=d,h.wrap=t.wrap,p(h.text)?(t.starty=t.sections[e].y,await oe(f,h,t)):G(f,h);let r=Math.round(g.map(e=>(e._groups||e)[0][0].getBBox().height).reduce((e,t)=>e+t));t.sections[e].height+=r-(a+o)}}return t.height=Math.round(t.stopy-t.starty),f},`drawLoop`),Se=v(function(e,t){k(e,t)},`drawBackgroundRect`),Ce=v(function(e,t){e.append(`defs`).append(`symbol`).attr(`id`,t+`-database`).attr(`fill-rule`,`evenodd`).attr(`clip-rule`,`evenodd`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z`)},`insertDatabaseIcon`),q=v(function(e,t){e.append(`defs`).append(`symbol`).attr(`id`,t+`-computer`).attr(`width`,`24`).attr(`height`,`24`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z`)},`insertComputerIcon`),J=v(function(e,t){e.append(`defs`).append(`symbol`).attr(`id`,t+`-clock`).attr(`width`,`24`).attr(`height`,`24`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z`)},`insertClockIcon`),we=v(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-arrowhead`).attr(`refX`,7.9).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M -1 0 L 10 5 L 0 10 z`)},`insertArrowHead`),Te=v(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-filled-head`).attr(`refX`,15.5).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`)},`insertArrowFilledHead`),Ee=v(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-sequencenumber`).attr(`refX`,15).attr(`refY`,15).attr(`markerWidth`,60).attr(`markerHeight`,40).attr(`orient`,`auto`).append(`circle`).attr(`cx`,15).attr(`cy`,15).attr(`r`,6)},`insertSequenceNumber`),De=v(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-crosshead`).attr(`markerWidth`,15).attr(`markerHeight`,8).attr(`orient`,`auto`).attr(`refX`,4).attr(`refY`,4.5).append(`path`).attr(`fill`,`none`).attr(`stroke`,`#000000`).style(`stroke-dasharray`,`0, 0`).attr(`stroke-width`,`1pt`).attr(`d`,`M 1,2 L 6,7 M 6,2 L 1,7`)},`insertArrowCrossHead`),Oe=v(function(e,t){let{theme:n}=t;e.append(`defs`).append(`filter`).attr(`id`,`drop-shadow`).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${n===`redux`||n===`redux-color`?`#000000`:`#FFFFFF`}`)},`insertDropShadow`),ke=v(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:`#666`,width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},`getTextObj`),Ae=v(function(){return{x:0,y:0,fill:`#EDF2AE`,stroke:`#666`,width:100,anchor:`start`,height:100,rx:0,ry:0}},`getNoteRect`),Y=(function(){function e(e,t,n,r,i,o,s){a(t.append(`text`).attr(`x`,n+i/2).attr(`y`,r+o/2+5).style(`text-anchor`,`middle`).text(e),s)}v(e,`byText`);function t(e,t,n,r,i,o,s,c){let{actorFontSize:l,actorFontFamily:u,actorFontWeight:d}=c,[f,p]=S(l),m=e.split(h.lineBreakRegex);for(let e=0;e<m.length;e++){let c=e*f-f*(m.length-1)/2,l=t.append(`text`).attr(`x`,n+i/2).attr(`y`,r).style(`text-anchor`,`middle`).style(`font-size`,p).style(`font-weight`,d).style(`font-family`,u);l.append(`tspan`).attr(`x`,n+i/2).attr(`dy`,c).text(m[e]),l.attr(`y`,r+o/2).attr(`dominant-baseline`,`central`).attr(`alignment-baseline`,`central`),a(l,s)}}v(t,`byTspan`);function n(e,n,r,i,o,s,c,l){let u=n.append(`switch`),d=u.append(`foreignObject`).attr(`x`,r).attr(`y`,i).attr(`width`,o).attr(`height`,s).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`);d.append(`div`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).text(e),t(e,u,r,i,o,s,c,l),a(d,c)}v(n,`byFo`);async function r(e,n,r,o,s,c,l,u){let d=await f(e,_()),p=n.append(`switch`),m=p.append(`foreignObject`).attr(`x`,r+s/2-d.width/2).attr(`y`,o+c/2-d.height/2).attr(`width`,d.width).attr(`height`,d.height).append(`xhtml:div`).style(`height`,`100%`).style(`width`,`100%`);m.append(`div`).style(`text-align`,`center`).style(`vertical-align`,`middle`).html(await i(e,_())),t(e,p,r,o,s,c,l,u),a(m,l)}v(r,`byKatex`);function a(e,t){for(let n in t)t.hasOwnProperty(n)&&e.attr(n,t[n])}return v(a,`_setTextAttrs`),function(i,a=!1){return a?r:i.textPlacement===`fo`?n:i.textPlacement===`old`?e:t}})(),je=(function(){function e(e,t,n,i,a,o,s){r(t.append(`text`).attr(`x`,n).attr(`y`,i).style(`text-anchor`,`start`).text(e),s)}v(e,`byText`);function t(e,t,n,i,a,o,s,c){let{actorFontSize:l,actorFontFamily:u,actorFontWeight:d}=c,f=e.split(h.lineBreakRegex);for(let e=0;e<f.length;e++){let a=e*l-l*(f.length-1)/2,c=t.append(`text`).attr(`x`,n).attr(`y`,i).style(`text-anchor`,`start`).style(`font-size`,l).style(`font-weight`,d).style(`font-family`,u);c.append(`tspan`).attr(`x`,n).attr(`dy`,a).text(f[e]),c.attr(`y`,i+o/2).attr(`dominant-baseline`,`central`).attr(`alignment-baseline`,`central`),r(c,s)}}v(t,`byTspan`);function n(e,n,i,a,o,s,c,l){let u=n.append(`switch`),d=u.append(`foreignObject`).attr(`x`,i).attr(`y`,a).attr(`width`,o).attr(`height`,s).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`);d.append(`div`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).text(e),t(e,u,i,a,o,s,c,l),r(d,c)}v(n,`byFo`);function r(e,t){for(let n in t)t.hasOwnProperty(n)&&e.attr(n,t[n])}return v(r,`_setTextAttrs`),function(r){return r.textPlacement===`fo`?n:r.textPlacement===`old`?e:t}})(),X={drawRect:W,drawText:G,drawLabel:se,drawActor:_e,drawBox:ve,drawPopup:ie,anchorElement:ye,drawActivation:be,drawLoop:xe,drawBackgroundRect:Se,insertArrowHead:we,insertArrowFilledHead:Te,insertSequenceNumber:Ee,insertArrowCrossHead:De,insertDatabaseIcon:Ce,insertComputerIcon:q,insertClockIcon:J,getTextObj:ke,getNoteRect:Ae,fixLifeLineHeights:ce,sanitizeUrl:N.sanitizeUrl,insertDropShadow:Oe,insertSolidTopArrowHead:v(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-solidTopArrowHead`).attr(`refX`,7.9).attr(`refY`,7.25).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 0 L 10 8 L 0 8 z`)},`insertSolidTopArrowHead`),insertSolidBottomArrowHead:v(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-solidBottomArrowHead`).attr(`refX`,7.9).attr(`refY`,.75).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 0 L 10 0 L 0 8 z`)},`insertSolidBottomArrowHead`),insertStickTopArrowHead:v(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-stickTopArrowHead`).attr(`refX`,7.5).attr(`refY`,7).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 0 L 7 7`).attr(`stroke`,`black`).attr(`stroke-width`,1.5).attr(`fill`,`none`)},`insertStickTopArrowHead`),insertStickBottomArrowHead:v(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-stickBottomArrowHead`).attr(`refX`,7.5).attr(`refY`,0).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 7 L 7 0`).attr(`stroke`,`black`).attr(`stroke-width`,1.5).attr(`fill`,`none`)},`insertStickBottomArrowHead`)},Z={},Q={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:v(function(){return Math.max.apply(null,this.actors.length===0?[0]:this.actors.map(e=>e.height||0))+(this.loops.length===0?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.messages.length===0?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.notes.length===0?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},`getHeight`),clear:v(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},`clear`),addBox:v(function(e){this.boxes.push(e)},`addBox`),addActor:v(function(e){this.actors.push(e)},`addActor`),addLoop:v(function(e){this.loops.push(e)},`addLoop`),addMessage:v(function(e){this.messages.push(e)},`addMessage`),addNote:v(function(e){this.notes.push(e)},`addNote`),lastActor:v(function(){return this.actors[this.actors.length-1]},`lastActor`),lastLoop:v(function(){return this.loops[this.loops.length-1]},`lastLoop`),lastMessage:v(function(){return this.messages[this.messages.length-1]},`lastMessage`),lastNote:v(function(){return this.notes[this.notes.length-1]},`lastNote`),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:v(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,He(u())},`init`),updateVal:v(function(e,t,n,r){e[t]===void 0?e[t]=n:e[t]=r(n,e[t])},`updateVal`),updateBounds:v(function(e,t,n,r){let i=this,a=0;function o(o){return v(function(s){a++;let c=i.sequenceItems.length-a+1;i.updateVal(s,`starty`,t-c*Z.boxMargin,Math.min),i.updateVal(s,`stopy`,r+c*Z.boxMargin,Math.max),i.updateVal(Q.data,`startx`,e-c*Z.boxMargin,Math.min),i.updateVal(Q.data,`stopx`,n+c*Z.boxMargin,Math.max),o!==`activation`&&(i.updateVal(s,`startx`,e-c*Z.boxMargin,Math.min),i.updateVal(s,`stopx`,n+c*Z.boxMargin,Math.max),i.updateVal(Q.data,`starty`,t-c*Z.boxMargin,Math.min),i.updateVal(Q.data,`stopy`,r+c*Z.boxMargin,Math.max))},`updateItemBounds`)}v(o,`updateFn`),this.sequenceItems.forEach(o()),this.activations.forEach(o(`activation`))},`updateBounds`),insert:v(function(e,t,n,r){let i=h.getMin(e,n),a=h.getMax(e,n),o=h.getMin(t,r),s=h.getMax(t,r);this.updateVal(Q.data,`startx`,i,Math.min),this.updateVal(Q.data,`starty`,o,Math.min),this.updateVal(Q.data,`stopx`,a,Math.max),this.updateVal(Q.data,`stopy`,s,Math.max),this.updateBounds(i,o,a,s)},`insert`),newActivation:v(function(e,t,n){let r=n.get(e.from),i=Ue(e.from).length||0,a=r.x+r.width/2+(i-1)*Z.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+Z.activationWidth,stopy:void 0,actor:e.from,anchored:X.anchorElement(t)})},`newActivation`),endActivation:v(function(e){let t=this.activations.map(function(e){return e.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},`endActivation`),createLoop:v(function(e={message:void 0,wrap:!1,width:void 0},t){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},`createLoop`),newLoop:v(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},`newLoop`),endLoop:v(function(){return this.sequenceItems.pop()},`endLoop`),isLoopOverlap:v(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},`isLoopOverlap`),addSectionToLoop:v(function(e){let t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:Q.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},`addSectionToLoop`),saveVerticalPos:v(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},`saveVerticalPos`),resetVerticalPos:v(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},`resetVerticalPos`),bumpVerticalPos:v(function(e){this.verticalPos+=e,this.data.stopy=h.getMax(this.data.stopy,this.verticalPos)},`bumpVerticalPos`),getVerticalPos:v(function(){return this.verticalPos},`getVerticalPos`),getBounds:v(function(){return{bounds:this.data,models:this.models}},`getBounds`)},Me=v(async function(e,t,n){Q.bumpVerticalPos(Z.boxMargin),t.height=Z.boxMargin,t.starty=Q.getVerticalPos();let r=j();r.x=t.startx,r.y=t.starty,r.width=t.width||Z.width,r.class=`note`;let i=e.append(`g`);i.attr(`data-et`,`note`),i.attr(`data-id`,`i`+n);let a=X.drawRect(i,r),o=D();o.x=t.startx,o.y=t.starty,o.width=r.width,o.dy=`1em`,o.text=t.message,o.class=`noteText`,o.fontFamily=Z.noteFontFamily,o.fontSize=Z.noteFontSize,o.fontWeight=Z.noteFontWeight,o.anchor=Z.noteAlign,o.textMargin=Z.noteMargin,o.valign=`center`;let s=p(o.text)?await oe(i,o):G(i,o),c=Math.round(s.map(e=>(e._groups||e)[0][0].getBBox().height).reduce((e,t)=>e+t));a.attr(`height`,c+2*Z.noteMargin),t.height+=c+2*Z.noteMargin,Q.bumpVerticalPos(c+2*Z.noteMargin),t.stopy=t.starty+c+2*Z.noteMargin,t.stopx=t.startx+r.width,Q.insert(t.startx,t.starty,t.stopx,t.stopy),Q.models.addNote(t)},`drawNote`),Ne=v(function(e,t,n,r,i,a,o){let s=r.db.getActors(),c=s.get(t.from),l=s.get(t.to),u=n.sequenceVisible,d=c.x+c.width/2,f=l.x+l.width/2,p=d<=f,m=tt(t,r),h=e.append(`g`),g=16.5,_=v((e,t)=>{let n=e?g:-g;return t?-n:n},`getCircleOffset`),y=v(e=>{h.append(`circle`).attr(`cx`,e).attr(`cy`,o).attr(`r`,5).attr(`width`,10).attr(`height`,10)},`drawCircle`),{CENTRAL_CONNECTION:b,CENTRAL_CONNECTION_REVERSE:x,CENTRAL_CONNECTION_DUAL:S}=r.db.LINETYPE;if(u)switch(t.centralConnection){case b:m&&(f+=_(p,!0));break;case x:m||(d+=_(p,!1));break;case S:m?f+=_(p,!0):d+=_(p,!1);break}switch(t.centralConnection){case b:y(f);break;case x:y(d);break;case S:y(d),y(f);break}},`drawCentralConnection`),Pe=v(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),`messageFont`),Fe=v(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),`noteFont`),Ie=v(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),`actorFont`);async function Le(e,t){Q.bumpVerticalPos(10);let{startx:n,stopx:r,message:i}=t,a=h.splitBreaks(i).length,o=p(i),s=o?await f(i,u()):C.calculateTextDimensions(i,Pe(Z));if(!o){let e=s.height/a;t.height+=e,Q.bumpVerticalPos(e)}let c,l=s.height-10,d=s.width;if(n===r){c=Q.getVerticalPos()+l,Z.rightAngles||(l+=Z.boxMargin,c=Q.getVerticalPos()+l),l+=30;let e=h.getMax(d/2,Z.width/2);Q.insert(n-e,Q.getVerticalPos()-10+l,r+e,Q.getVerticalPos()+30+l)}else l+=Z.boxMargin,c=Q.getVerticalPos()+l,Q.insert(n,c-10,r,c);return Q.bumpVerticalPos(l),t.height+=l,t.stopy=t.starty+t.height,Q.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),c}v(Le,`boundMessage`);var Re=v(async function(e,t,r,i,a,o){let{startx:s,stopx:c,starty:l,message:u,type:d,sequenceIndex:f,sequenceVisible:m}=t,g=C.calculateTextDimensions(u,Pe(Z)),_=D();_.x=s,_.y=l+10,_.width=c-s,_.class=`messageText`,_.dy=`1em`,_.text=u,_.fontFamily=Z.messageFontFamily,_.fontSize=Z.messageFontSize,_.fontWeight=Z.messageFontWeight,_.anchor=Z.messageAlign,_.valign=`center`,_.textMargin=Z.wrapPadding,_.tspan=!1,p(_.text)?await oe(e,_,{startx:s,stopx:c,starty:r}):G(e,_);let v=g.width,y;if(s===c){let n=m||Z.showSequenceNumbers,o=tt(a,i),l=nt(a,i),u=s+(n&&(o||l)?10:0);y=Z.rightAngles?e.append(`path`).attr(`d`,`M ${u},${r} H ${s+h.getMax(Z.width/2,v/2)} V ${r+25} H ${s}`):e.append(`path`).attr(`d`,`M `+u+`,`+r+` C `+(u+60)+`,`+(r-10)+` `+(s+60)+`,`+(r+30)+` `+s+`,`+(r+20)),$e(a,i)&&Ne(e,a,t,i,s,c,r)}else y=e.append(`line`),y.attr(`x1`,s),y.attr(`y1`,r),y.attr(`x2`,c),y.attr(`y2`,r),$e(a,i)&&Ne(e,a,t,i,s,c,r);d===i.db.LINETYPE.DOTTED||d===i.db.LINETYPE.DOTTED_CROSS||d===i.db.LINETYPE.DOTTED_POINT||d===i.db.LINETYPE.DOTTED_OPEN||d===i.db.LINETYPE.BIDIRECTIONAL_DOTTED||d===i.db.LINETYPE.SOLID_TOP_DOTTED||d===i.db.LINETYPE.SOLID_BOTTOM_DOTTED||d===i.db.LINETYPE.STICK_TOP_DOTTED||d===i.db.LINETYPE.STICK_BOTTOM_DOTTED||d===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||d===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||d===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||d===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(y.style(`stroke-dasharray`,`3, 3`),y.attr(`class`,`messageLine1`)):y.attr(`class`,`messageLine0`),y.attr(`data-et`,`message`),y.attr(`data-id`,`i`+t.id),y.attr(`data-from`,t.from),y.attr(`data-to`,t.to);let b=``;if(Z.arrowMarkerAbsolute&&(b=n(!0)),y.attr(`stroke-width`,2),y.attr(`stroke`,`none`),y.style(`fill`,`none`),(d===i.db.LINETYPE.SOLID_TOP||d===i.db.LINETYPE.SOLID_TOP_DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-solidTopArrowHead)`),(d===i.db.LINETYPE.SOLID_BOTTOM||d===i.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-solidBottomArrowHead)`),(d===i.db.LINETYPE.STICK_TOP||d===i.db.LINETYPE.STICK_TOP_DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-stickTopArrowHead)`),(d===i.db.LINETYPE.STICK_BOTTOM||d===i.db.LINETYPE.STICK_BOTTOM_DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-stickBottomArrowHead)`),(d===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||d===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&y.attr(`marker-start`,`url(`+b+`#`+o+`-solidBottomArrowHead)`),(d===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||d===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr(`marker-start`,`url(`+b+`#`+o+`-solidTopArrowHead)`),(d===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE||d===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&y.attr(`marker-start`,`url(`+b+`#`+o+`-stickBottomArrowHead)`),(d===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||d===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr(`marker-start`,`url(`+b+`#`+o+`-stickTopArrowHead)`),(d===i.db.LINETYPE.SOLID||d===i.db.LINETYPE.DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-arrowhead)`),(d===i.db.LINETYPE.BIDIRECTIONAL_SOLID||d===i.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(y.attr(`marker-start`,`url(`+b+`#`+o+`-arrowhead)`),y.attr(`marker-end`,`url(`+b+`#`+o+`-arrowhead)`)),(d===i.db.LINETYPE.SOLID_POINT||d===i.db.LINETYPE.DOTTED_POINT)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-filled-head)`),(d===i.db.LINETYPE.SOLID_CROSS||d===i.db.LINETYPE.DOTTED_CROSS)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-crosshead)`),m||Z.showSequenceNumbers){let n=d===i.db.LINETYPE.BIDIRECTIONAL_SOLID||d===i.db.LINETYPE.BIDIRECTIONAL_DOTTED,l=d===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||d===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||d===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||d===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||d===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE||d===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||d===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||d===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,u=$e(a,i),p=s,m=c;n?(s<c?p=s+12:(p=s-6+(u?-5:0),p+=a?.centralConnection===i.db.LINETYPE.CENTRAL_CONNECTION_DUAL||a?.centralConnection===i.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),y.attr(`x1`,p)):l?(c>s?m=c-12:(m=c-6,p+=a?.centralConnection===i.db.LINETYPE.CENTRAL_CONNECTION_DUAL||a?.centralConnection===i.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),m+=u?15:0,y.attr(`x2`,m),y.attr(`x1`,p)):y.attr(`x1`,s+6);let h=0,g=s===c,_=s<=c;h=g?t.fromBounds+1:l?_?t.toBounds-1:t.fromBounds+1:_?t.fromBounds+1:t.toBounds-1,e.append(`line`).attr(`x1`,h).attr(`y1`,r).attr(`x2`,h).attr(`y2`,r).attr(`stroke-width`,0).attr(`marker-start`,`url(`+b+`#`+o+`-sequencenumber)`),e.append(`text`).attr(`x`,h).attr(`y`,r+4).attr(`font-family`,`sans-serif`).attr(`font-size`,`12px`).attr(`text-anchor`,`middle`).attr(`class`,`sequenceNumber`).text(f)}},`drawMessage`),ze=v(function(e,t,n,r,i,a,o){let s=0,c=0,l,u=0;for(let e of r){let r=t.get(e),a=r.box;l&&l!=a&&(o||Q.models.addBox(l),c+=Z.boxMargin+l.margin),a&&a!=l&&(o||(a.x=s+c,a.y=i),c+=a.margin),r.width=h.getMax(r.width||Z.width,Z.width),r.height=h.getMax(r.height||Z.height,Z.height),r.margin=r.margin||Z.actorMargin,u=h.getMax(u,r.height),n.get(r.name)&&(c+=r.width/2),r.x=s+c,r.starty=Q.getVerticalPos(),Q.insert(r.x,i,r.x+r.width,r.height),s+=r.width+c,r.box&&(r.box.width=s+a.margin-r.box.x),c=r.margin,l=r.box,Q.models.addActor(r)}l&&!o&&Q.models.addBox(l),Q.bumpVerticalPos(u)},`addActorRenderingData`),Be=v(async function(e,t,n,r,i,a,o){if(r){let r=0;Q.bumpVerticalPos(Z.boxMargin*2);for(let s of n){let n=t.get(s);n.stopy||=Q.getVerticalPos();let c=await X.drawActor(e,n,Z,!0,i,a,o);r=h.getMax(r,c)}Q.bumpVerticalPos(r+Z.boxMargin)}else for(let r of n){let n=t.get(r);await X.drawActor(e,n,Z,!1,i,a,o)}},`drawActors`),Ve=v(function(e,t,n,r){let i=0,a=0;for(let o of n){let n=t.get(o),s=Je(n),c=X.drawPopup(e,n,s,Z,Z.forceMenus,r);c.height>i&&(i=c.height),c.width+n.x>a&&(a=c.width+n.x)}return{maxHeight:i,maxWidth:a}},`drawActorsPopup`),He=v(function(e){m(Z,e),e.fontFamily&&(Z.actorFontFamily=Z.noteFontFamily=Z.messageFontFamily=e.fontFamily),e.fontSize&&(Z.actorFontSize=Z.noteFontSize=Z.messageFontSize=e.fontSize),e.fontWeight&&(Z.actorFontWeight=Z.noteFontWeight=Z.messageFontWeight=e.fontWeight)},`setConf`),Ue=v(function(e){return Q.activations.filter(function(t){return t.actor===e})},`actorActivations`),We=v(function(e,t){let n=t.get(e),r=Ue(e);return[r.reduce(function(e,t){return h.getMin(e,t.startx)},n.x+n.width/2-1),r.reduce(function(e,t){return h.getMax(e,t.stopx)},n.x+n.width/2+1)]},`activationBounds`);function $(e,t,n,r,i){Q.bumpVerticalPos(n);let a=r;if(t.id&&t.message&&e[t.id]){let n=e[t.id].width,i=Pe(Z);t.message=C.wrapLabel(`[${t.message}]`,n-2*Z.wrapPadding,i),t.width=n,t.wrap=!0;let o=C.calculateTextDimensions(t.message,i),s=h.getMax(o.height,Z.labelBoxHeight);a=r+s,b.debug(`${s} - ${t.message}`)}i(t),Q.bumpVerticalPos(a)}v($,`adjustLoopHeightForWrap`);function Ge(e,t,n,r,i,a,o){function s(n,r){n.x<i.get(e.from).x?(Q.insert(t.stopx-r,t.starty,t.startx,t.stopy+n.height/2+Z.noteMargin),t.stopx+=r):(Q.insert(t.startx,t.starty,t.stopx+r,t.stopy+n.height/2+Z.noteMargin),t.stopx-=r)}v(s,`receiverAdjustment`);function c(n,r){n.x<i.get(e.to).x?(Q.insert(t.startx-r,t.starty,t.stopx,t.stopy+n.height/2+Z.noteMargin),t.startx+=r):(Q.insert(t.stopx,t.starty,t.startx+r,t.stopy+n.height/2+Z.noteMargin),t.startx-=r)}v(c,`senderAdjustment`);let l=[R.ACTOR,R.CONTROL,R.ENTITY,R.DATABASE];if(a.get(e.to)==r){let t=i.get(e.to);s(t,l.includes(t.type)?z/2+3:t.width/2+3),t.starty=n-t.height/2,Q.bumpVerticalPos(t.height/2)}else if(o.get(e.from)==r){let t=i.get(e.from);Z.mirrorActors&&c(t,l.includes(t.type)?z/2:t.width/2),t.stopy=n-t.height/2,Q.bumpVerticalPos(t.height/2)}else if(o.get(e.to)==r){let t=i.get(e.to);Z.mirrorActors&&s(t,l.includes(t.type)?z/2+3:t.width/2+3),t.stopy=n-t.height/2,Q.bumpVerticalPos(t.height/2)}}v(Ge,`adjustCreatedDestroyedData`);var Ke=v(async function(e,t,n,r){let{securityLevel:i,sequence:a,look:o}=u();Z=a;let s;i===`sandbox`&&(s=y(`#i`+t));let c=y(i===`sandbox`?s.nodes()[0].contentDocument.body:`body`),l=i===`sandbox`?s.nodes()[0].contentDocument:document;Q.init(),b.debug(r.db);let f=i===`sandbox`?c.select(`[id="${t}"]`):y(`[id="${t}"]`),p=r.db.getActors(),m=r.db.getCreatedActors(),h=r.db.getDestroyedActors(),g=r.db.getBoxes(),_=r.db.getActorKeys(),x=r.db.getMessages(),S=r.db.getDiagramTitle(),C=r.db.hasAtLeastOneBox(),w=r.db.hasAtLeastOneBoxWithTitle(),T=await qe(p,x,r);if(Z.height=await Ye(p,T,g),X.insertComputerIcon(f,t),X.insertDatabaseIcon(f,t),X.insertClockIcon(f,t),C&&(Q.bumpVerticalPos(Z.boxMargin),w&&Q.bumpVerticalPos(g[0].textMaxHeight)),Z.hideUnusedParticipants===!0){let e=new Set;x.forEach(t=>{e.add(t.from),e.add(t.to)}),_=_.filter(t=>e.has(t))}let E=new Map(_.map((e,t)=>[p.get(e)?.name??e,t]));ze(f,p,m,_,0,x,!1);let D=await it(x,p,T,r);X.insertArrowHead(f,t),X.insertArrowCrossHead(f,t),X.insertArrowFilledHead(f,t),X.insertSequenceNumber(f,t),X.insertSolidTopArrowHead(f,t),X.insertSolidBottomArrowHead(f,t),X.insertStickTopArrowHead(f,t),X.insertStickBottomArrowHead(f,t),o===`neo`&&X.insertDropShadow(f,Z);function O(e,t){let n=Q.endActivation(e);n.starty+18>t&&(n.starty=t-6,t+=12),X.drawActivation(f,n,t,Z,Ue(e.from).length,r,E),Q.insert(n.startx,t-10,n.stopx,t)}v(O,`activeEnd`);let k=1,A=1,j=[],M=[],N=0;for(let e of x){let t,n,i;switch(e.type){case r.db.LINETYPE.NOTE:Q.resetVerticalPos(),n=e.noteModel,await Me(f,n,e.id);break;case r.db.LINETYPE.ACTIVE_START:Q.newActivation(e,f,p);break;case r.db.LINETYPE.CENTRAL_CONNECTION:Q.newActivation(e,f,p);break;case r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:Q.newActivation(e,f,p);break;case r.db.LINETYPE.ACTIVE_END:O(e,Q.getVerticalPos());break;case r.db.LINETYPE.LOOP_START:$(D,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case r.db.LINETYPE.LOOP_END:t=Q.endLoop(),await X.drawLoop(f,t,`loop`,Z,e),Q.bumpVerticalPos(t.stopy-Q.getVerticalPos()),Q.models.addLoop(t);break;case r.db.LINETYPE.RECT_START:$(D,e,Z.boxMargin,Z.boxMargin,e=>Q.newLoop(void 0,e.message));break;case r.db.LINETYPE.RECT_END:t=Q.endLoop(),M.push(t),Q.models.addLoop(t),Q.bumpVerticalPos(t.stopy-Q.getVerticalPos());break;case r.db.LINETYPE.OPT_START:$(D,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case r.db.LINETYPE.OPT_END:t=Q.endLoop(),await X.drawLoop(f,t,`opt`,Z,e),Q.bumpVerticalPos(t.stopy-Q.getVerticalPos()),Q.models.addLoop(t);break;case r.db.LINETYPE.ALT_START:$(D,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case r.db.LINETYPE.ALT_ELSE:$(D,e,Z.boxMargin+Z.boxTextMargin,Z.boxMargin,e=>Q.addSectionToLoop(e));break;case r.db.LINETYPE.ALT_END:t=Q.endLoop(),await X.drawLoop(f,t,`alt`,Z,e),Q.bumpVerticalPos(t.stopy-Q.getVerticalPos()),Q.models.addLoop(t);break;case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:$(D,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e)),Q.saveVerticalPos();break;case r.db.LINETYPE.PAR_AND:$(D,e,Z.boxMargin+Z.boxTextMargin,Z.boxMargin,e=>Q.addSectionToLoop(e));break;case r.db.LINETYPE.PAR_END:t=Q.endLoop(),await X.drawLoop(f,t,`par`,Z,e),Q.bumpVerticalPos(t.stopy-Q.getVerticalPos()),Q.models.addLoop(t);break;case r.db.LINETYPE.AUTONUMBER:k=e.message.start||k,A=e.message.step||A,e.message.visible?r.db.enableSequenceNumbers():r.db.disableSequenceNumbers();break;case r.db.LINETYPE.CRITICAL_START:$(D,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case r.db.LINETYPE.CRITICAL_OPTION:$(D,e,Z.boxMargin+Z.boxTextMargin,Z.boxMargin,e=>Q.addSectionToLoop(e));break;case r.db.LINETYPE.CRITICAL_END:t=Q.endLoop(),await X.drawLoop(f,t,`critical`,Z,e),Q.bumpVerticalPos(t.stopy-Q.getVerticalPos()),Q.models.addLoop(t);break;case r.db.LINETYPE.BREAK_START:$(D,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case r.db.LINETYPE.BREAK_END:t=Q.endLoop(),await X.drawLoop(f,t,`break`,Z,e),Q.bumpVerticalPos(t.stopy-Q.getVerticalPos()),Q.models.addLoop(t);break;default:try{i=e.msgModel,i.starty=Q.getVerticalPos(),i.sequenceIndex=k,i.sequenceVisible=r.db.showSequenceNumbers(),i.id=e.id,i.from=e.from,i.to=e.to;let t=await Le(f,i);Ge(e,i,t,N,p,m,h),j.push({messageModel:i,lineStartY:t,msg:e}),Q.models.addMessage(i)}catch(e){b.error(`error while drawing message`,e)}}[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.SOLID_TOP,r.db.LINETYPE.SOLID_BOTTOM,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.SOLID_TOP_DOTTED,r.db.LINETYPE.SOLID_BOTTOM_DOTTED,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT,r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type)&&(k+=A),N++}b.debug(`createdActors`,m),b.debug(`destroyedActors`,h),await Be(f,p,_,!1,t,r,E);for(let e of j)await Re(f,e.messageModel,e.lineStartY,r,e.msg,t);Z.mirrorActors&&await Be(f,p,_,!0,t,r,E),M.forEach(e=>X.drawBackgroundRect(f,e)),ce(f,p,_,Z);for(let e of Q.models.boxes){e.height=Q.getVerticalPos()-e.y,Q.insert(e.x,e.y,e.x+e.width,e.height);let t=Z.boxMargin*2;e.startx=e.x-t,e.starty=e.y-t*.25,e.stopx=e.startx+e.width+2*t,e.stopy=e.starty+e.height+t*.75,e.stroke=`rgb(0,0,0, 0.5)`,X.drawBox(f,e,Z)}C&&Q.bumpVerticalPos(Z.boxMargin);let P=Ve(f,p,_,l),{bounds:F}=Q.getBounds();F.startx===void 0&&(F.startx=0),F.starty===void 0&&(F.starty=0),F.stopx===void 0&&(F.stopx=0),F.stopy===void 0&&(F.stopy=0);let I=F.stopy-F.starty;I<P.maxHeight&&(I=P.maxHeight);let L=I+2*Z.diagramMarginY;Z.mirrorActors&&(L=L-Z.boxMargin+Z.bottomMarginAdj);let ee=F.stopx-F.startx;ee<P.maxWidth&&(ee=P.maxWidth);let R=ee+2*Z.diagramMarginX;S&&f.append(`text`).text(S).attr(`x`,(F.stopx-F.startx)/2-2*Z.diagramMarginX).attr(`y`,-25),d(f,L,R,Z.useMaxWidth);let te=S?40:0,ne=p.size&&o===`neo`?30:0;f.attr(`viewBox`,F.startx-Z.diagramMarginX+` -`+(Z.diagramMarginY+te)+` `+R+` `+(L+te+ne)),b.debug(`models:`,Q.models)},`draw`);async function qe(e,t,n){let r={};for(let i of t)if(e.get(i.to)&&e.get(i.from)){let t=e.get(i.to);if(i.placement===n.db.PLACEMENT.LEFTOF&&!t.prevActor||i.placement===n.db.PLACEMENT.RIGHTOF&&!t.nextActor)continue;let a=i.placement!==void 0,o=!a,s=a?Fe(Z):Pe(Z),c=i.wrap?C.wrapLabel(i.message,Z.width-2*Z.wrapPadding,s):i.message,l=(p(c)?await f(i.message,u()):C.calculateTextDimensions(c,s)).width+2*Z.wrapPadding;o&&i.from===t.nextActor?r[i.to]=h.getMax(r[i.to]||0,l):o&&i.from===t.prevActor?r[i.from]=h.getMax(r[i.from]||0,l):o&&i.from===i.to?(r[i.from]=h.getMax(r[i.from]||0,l/2),r[i.to]=h.getMax(r[i.to]||0,l/2)):i.placement===n.db.PLACEMENT.RIGHTOF?r[i.from]=h.getMax(r[i.from]||0,l):i.placement===n.db.PLACEMENT.LEFTOF?r[t.prevActor]=h.getMax(r[t.prevActor]||0,l):i.placement===n.db.PLACEMENT.OVER&&(t.prevActor&&(r[t.prevActor]=h.getMax(r[t.prevActor]||0,l/2)),t.nextActor&&(r[i.from]=h.getMax(r[i.from]||0,l/2)))}return b.debug(`maxMessageWidthPerActor:`,r),r}v(qe,`getMaxMessageWidthPerActor`);var Je=v(function(e){let t=0,n=Ie(Z);for(let r in e.links){let e=C.calculateTextDimensions(r,n).width+2*Z.wrapPadding+2*Z.boxMargin;t<e&&(t=e)}return t},`getRequiredPopupWidth`);async function Ye(e,t,n){let r=0;for(let t of e.keys()){let n=e.get(t);n.wrap&&(n.description=C.wrapLabel(n.description,Z.width-2*Z.wrapPadding,Ie(Z)));let i=p(n.description)?await f(n.description,u()):C.calculateTextDimensions(n.description,Ie(Z));n.width=n.wrap?Z.width:h.getMax(Z.width,i.width+2*Z.wrapPadding),n.height=n.wrap?h.getMax(i.height,Z.height):Z.height,r=h.getMax(r,n.height)}for(let n in t){let r=e.get(n);if(!r)continue;let i=e.get(r.nextActor);if(!i){let e=t[n]+Z.actorMargin-r.width/2;r.margin=h.getMax(e,Z.actorMargin);continue}let a=t[n]+Z.actorMargin-r.width/2-i.width/2;r.margin=h.getMax(a,Z.actorMargin)}let i=0;return n.forEach(t=>{let n=Pe(Z),r=t.actorKeys.reduce((t,n)=>t+=e.get(n).width+(e.get(n).margin||0),0),a=Z.boxMargin*8;r+=a,r-=2*Z.boxTextMargin,t.wrap&&(t.name=C.wrapLabel(t.name,r-2*Z.wrapPadding,n));let o=C.calculateTextDimensions(t.name,n);i=h.getMax(o.height,i);let s=h.getMax(r,o.width+2*Z.wrapPadding);if(t.margin=Z.boxTextMargin,r<s){let e=(s-r)/2;t.margin+=e}}),n.forEach(e=>e.textMaxHeight=i),h.getMax(r,Z.height)}v(Ye,`calculateActorMargins`);var Xe=v(async function(e,t,n){let r=t.get(e.from),i=t.get(e.to),a=r.x,o=i.x,s=e.wrap&&e.message,c=p(e.message)?await f(e.message,u()):C.calculateTextDimensions(s?C.wrapLabel(e.message,Z.width,Fe(Z)):e.message,Fe(Z)),l={width:s?Z.width:h.getMax(Z.width,c.width+2*Z.noteMargin),height:0,startx:r.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===n.db.PLACEMENT.RIGHTOF?(l.width=s?h.getMax(Z.width,c.width):h.getMax(r.width/2+i.width/2,c.width+2*Z.noteMargin),l.startx=a+(r.width+Z.actorMargin)/2):e.placement===n.db.PLACEMENT.LEFTOF?(l.width=s?h.getMax(Z.width,c.width+2*Z.noteMargin):h.getMax(r.width/2+i.width/2,c.width+2*Z.noteMargin),l.startx=a-l.width+(r.width-Z.actorMargin)/2):e.to===e.from?(c=C.calculateTextDimensions(s?C.wrapLabel(e.message,h.getMax(Z.width,r.width),Fe(Z)):e.message,Fe(Z)),l.width=s?h.getMax(Z.width,r.width):h.getMax(r.width,Z.width,c.width+2*Z.noteMargin),l.startx=a+(r.width-l.width)/2):(l.width=Math.abs(a+r.width/2-(o+i.width/2))+Z.actorMargin,l.startx=a<o?a+r.width/2-Z.actorMargin/2:o+i.width/2-Z.actorMargin/2),s&&(l.message=C.wrapLabel(e.message,l.width-2*Z.wrapPadding,Fe(Z))),b.debug(`NM:[${l.startx},${l.stopx},${l.starty},${l.stopy}:${l.width},${l.height}=${e.message}]`),l},`buildNoteModel`),Ze=4,Qe=6,$e=v(function(e,t){let{CENTRAL_CONNECTION:n,CENTRAL_CONNECTION_REVERSE:r,CENTRAL_CONNECTION_DUAL:i}=t.db.LINETYPE;return[n,r,i].includes(e.centralConnection)},`hasCentralConnection`),et=v(function(e,t,n){let{CENTRAL_CONNECTION_REVERSE:r,CENTRAL_CONNECTION_DUAL:i,BIDIRECTIONAL_SOLID:a,BIDIRECTIONAL_DOTTED:o}=t.db.LINETYPE,s=0;return(e.centralConnection===r||e.centralConnection===i)&&(s+=Ze),(e.centralConnection===r||e.centralConnection===i)&&(e.type===a||e.type===o)&&(s+=n?0:-Qe),s},`calculateCentralConnectionOffset`),tt=v(function(e,t){let{SOLID_ARROW_TOP_REVERSE:n,SOLID_ARROW_TOP_REVERSE_DOTTED:r,SOLID_ARROW_BOTTOM_REVERSE:i,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:a,STICK_ARROW_TOP_REVERSE:o,STICK_ARROW_TOP_REVERSE_DOTTED:s,STICK_ARROW_BOTTOM_REVERSE:c,STICK_ARROW_BOTTOM_REVERSE_DOTTED:l}=t.db.LINETYPE;return[n,r,i,a,o,s,c,l].includes(e.type)},`isReverseArrowType`),nt=v(function(e,t){let{BIDIRECTIONAL_SOLID:n,BIDIRECTIONAL_DOTTED:r}=t.db.LINETYPE;return[n,r].includes(e.type)},`isBidirectionalArrowType`),rt=v(function(e,t,n){let{look:r}=u();if(![n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.SOLID_TOP,n.db.LINETYPE.SOLID_BOTTOM,n.db.LINETYPE.STICK_TOP,n.db.LINETYPE.STICK_BOTTOM,n.db.LINETYPE.SOLID_TOP_DOTTED,n.db.LINETYPE.SOLID_BOTTOM_DOTTED,n.db.LINETYPE.STICK_TOP_DOTTED,n.db.LINETYPE.STICK_BOTTOM_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.DOTTED,n.db.LINETYPE.SOLID_CROSS,n.db.LINETYPE.DOTTED_CROSS,n.db.LINETYPE.SOLID_POINT,n.db.LINETYPE.DOTTED_POINT,n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type))return{};let[i,a]=We(e.from,t),[o,s]=We(e.to,t),c=i<=o,l=c?a:i,d=c?o:s;r===`neo`&&(e.type!==n.db.LINETYPE.SOLID_OPEN&&(d+=c?-3:3),(e.type===n.db.LINETYPE.BIDIRECTIONAL_SOLID||e.type===n.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(l+=c?3:-3)),l+=et(e,n,c);let f=Math.abs(o-s)>2,p=v(e=>c?-e:e,`adjustValue`);e.from===e.to?d=l:(e.activate&&!f&&(d+=p(Z.activationWidth/2-1)),[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.STICK_TOP,n.db.LINETYPE.STICK_BOTTOM,n.db.LINETYPE.STICK_TOP_DOTTED,n.db.LINETYPE.STICK_BOTTOM_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)||(d+=p(3)),[n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)&&(l-=p(3)));let m=[i,a,o,s],g=Math.abs(l-d);e.wrap&&e.message&&(e.message=C.wrapLabel(e.message,h.getMax(g+2*Z.wrapPadding,Z.width),Pe(Z)));let _=C.calculateTextDimensions(e.message,Pe(Z));return{width:h.getMax(e.wrap?0:_.width+2*Z.wrapPadding,g+2*Z.wrapPadding,Z.width),height:0,startx:l,stopx:d,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,m),toBounds:Math.max.apply(null,m)}},`buildMessageModel`),it=v(async function(e,t,n,r){let i={},a=[],o,s,c;for(let n of e){switch(n.type){case r.db.LINETYPE.LOOP_START:case r.db.LINETYPE.ALT_START:case r.db.LINETYPE.OPT_START:case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:case r.db.LINETYPE.CRITICAL_START:case r.db.LINETYPE.BREAK_START:a.push({id:n.id,msg:n.message,from:2**53-1,to:-(2**53-1),width:0});break;case r.db.LINETYPE.ALT_ELSE:case r.db.LINETYPE.PAR_AND:case r.db.LINETYPE.CRITICAL_OPTION:n.message&&(o=a.pop(),i[o.id]=o,i[n.id]=o,a.push(o));break;case r.db.LINETYPE.LOOP_END:case r.db.LINETYPE.ALT_END:case r.db.LINETYPE.OPT_END:case r.db.LINETYPE.PAR_END:case r.db.LINETYPE.CRITICAL_END:case r.db.LINETYPE.BREAK_END:o=a.pop(),i[o.id]=o;break;case r.db.LINETYPE.ACTIVE_START:{let e=t.get(n.from?n.from:n.to.actor),r=Ue(n.from?n.from:n.to.actor).length,i=e.x+e.width/2+(r-1)*Z.activationWidth/2,a={startx:i,stopx:i+Z.activationWidth,actor:n.from,enabled:!0};Q.activations.push(a)}break;case r.db.LINETYPE.ACTIVE_END:{let e=Q.activations.map(e=>e.actor).lastIndexOf(n.from);Q.activations.splice(e,1).splice(0,1)}break}n.placement===void 0?(c=rt(n,t,r),n.msgModel=c,c.startx&&c.stopx&&a.length>0&&a.forEach(e=>{if(o=e,c.startx===c.stopx){let e=t.get(n.from),r=t.get(n.to);o.from=h.getMin(e.x-c.width/2,e.x-e.width/2,o.from),o.to=h.getMax(r.x+c.width/2,r.x+e.width/2,o.to),o.width=h.getMax(o.width,Math.abs(o.to-o.from))-Z.labelBoxWidth}else o.from=h.getMin(c.startx,o.from),o.to=h.getMax(c.stopx,o.to),o.width=h.getMax(o.width,c.width)-Z.labelBoxWidth})):(s=await Xe(n,t,r),n.noteModel=s,a.forEach(e=>{o=e,o.from=h.getMin(o.from,s.startx),o.to=h.getMax(o.to,s.startx+s.width),o.width=h.getMax(o.width,Math.abs(o.from-o.to))-Z.labelBoxWidth}))}return Q.activations=[],b.debug(`Loop type widths:`,i),i},`calculateLoopBounds`),at={parser:F,get db(){return new te},renderer:{bounds:Q,drawActors:Be,drawActorsPopup:Ve,setConf:He,draw:Ke},styles:ne,init:v(e=>{e.sequence||={},e.wrap&&(e.sequence.wrap=e.wrap,a({sequence:{wrap:e.wrap}}))},`init`)};export{at as diagram};
@@ -0,0 +1 @@
1
+ import{o as e,r as t,t as n}from"./chunk-CFjPhJqf.js";var r=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var ee=`$isDayjsObject`,te=function(e){return e instanceof ne||!(!e||!e[ee])},x=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},S=function(e,t){if(te(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new ne(n)},C=v;C.l=x,C.i=te,C.w=function(e,t){return S(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var ne=function(){function g(e){this.$L=x(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[ee]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(C.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return C},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=S(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return S(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<S(e)},_.$g=function(e,t,n){return C.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!C.u(t)||t,u=C.p(e),p=function(e,t){var i=C.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return C.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=C.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[C.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=C.p(u),h=function(e){var t=S(p);return C.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return C.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=C.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return C.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return C.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return C.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return C.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return C.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return C.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return C.s(t.$s,2,`0`);case`SSS`:return C.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=C.p(f),_=S(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return C.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:C.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=x(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return C.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),re=ne.prototype;return S.prototype=re,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){re[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),S.extend=function(e,t){return e.$i||=(e(t,ne,S),!0),S},S.locale=x,S.isDayjs=te,S.unix=function(e){return S(1e3*e)},S.en=b[y],S.Ls=b,S.p={},S}))})),i=e(r(),1),a=Object.defineProperty,o=(e,t)=>a(e,`name`,{value:t,configurable:!0}),s=(e,t)=>{for(var n in t)a(e,n,{get:t[n],enumerable:!0})},c={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},l={trace:o((...e)=>{},`trace`),debug:o((...e)=>{},`debug`),info:o((...e)=>{},`info`),warn:o((...e)=>{},`warn`),error:o((...e)=>{},`error`),fatal:o((...e)=>{},`fatal`)},u=o(function(e=`fatal`){let t=c.fatal;typeof e==`string`?e.toLowerCase()in c&&(t=c[e]):typeof e==`number`&&(t=e),l.trace=()=>{},l.debug=()=>{},l.info=()=>{},l.warn=()=>{},l.error=()=>{},l.fatal=()=>{},t<=c.fatal&&(l.fatal=console.error?console.error.bind(console,d(`FATAL`),`color: orange`):console.log.bind(console,`\x1B[35m`,d(`FATAL`))),t<=c.error&&(l.error=console.error?console.error.bind(console,d(`ERROR`),`color: orange`):console.log.bind(console,`\x1B[31m`,d(`ERROR`))),t<=c.warn&&(l.warn=console.warn?console.warn.bind(console,d(`WARN`),`color: orange`):console.log.bind(console,`\x1B[33m`,d(`WARN`))),t<=c.info&&(l.info=console.info?console.info.bind(console,d(`INFO`),`color: lightblue`):console.log.bind(console,`\x1B[34m`,d(`INFO`))),t<=c.debug&&(l.debug=console.debug?console.debug.bind(console,d(`DEBUG`),`color: lightgreen`):console.log.bind(console,`\x1B[32m`,d(`DEBUG`))),t<=c.trace&&(l.trace=console.debug?console.debug.bind(console,d(`TRACE`),`color: lightgreen`):console.log.bind(console,`\x1B[32m`,d(`TRACE`)))},`setLogLevel`),d=o(e=>`%c${(0,i.default)().format(`ss.SSS`)} : ${e} : `,`format`),f={value:()=>{}};function p(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new m(n)}function m(e){this._=e}function h(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}m.prototype=p.prototype={constructor:m,on:function(e,t){var n=this._,r=h(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=g(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=_(n[i],e.name,t);else if(t==null)for(i in n)n[i]=_(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new m(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function g(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function _(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=f,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var v={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function y(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),v.hasOwnProperty(t)?{space:v[t],local:e}:e}function b(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function ee(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function te(e){var t=y(e);return(t.local?ee:b)(t)}function x(){}function S(e){return e==null?x:function(){return this.querySelector(e)}}function C(e){typeof e!=`function`&&(e=S(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new T(r,this._parents)}function ne(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function re(){return[]}function ie(e){return e==null?re:function(){return this.querySelectorAll(e)}}function ae(e){return function(){return ne(e.apply(this,arguments))}}function oe(e){e=typeof e==`function`?ae(e):ie(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new T(r,i)}function se(e){return function(){return this.matches(e)}}function ce(e){return function(t){return t.matches(e)}}var le=Array.prototype.find;function ue(e){return function(){return le.call(this.children,e)}}function de(){return this.firstElementChild}function fe(e){return this.select(e==null?de:ue(typeof e==`function`?e:ce(e)))}var pe=Array.prototype.filter;function me(){return Array.from(this.children)}function he(e){return function(){return pe.call(this.children,e)}}function ge(e){return this.selectAll(e==null?me:he(typeof e==`function`?e:ce(e)))}function _e(e){typeof e!=`function`&&(e=se(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new T(r,this._parents)}function ve(e){return Array(e.length)}function ye(){return new T(this._enter||this._groups.map(ve),this._parents)}function be(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}be.prototype={constructor:be,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function xe(e){return function(){return e}}function Se(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new be(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function Ce(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new be(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function we(e){return e.__data__}function Te(e,t){if(!arguments.length)return Array.from(this,we);var n=t?Ce:Se,r=this._parents,i=this._groups;typeof e!=`function`&&(e=xe(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=Ee(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new T(o,r),o._enter=s,o._exit=c,o}function Ee(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function De(){return new T(this._exit||this._groups.map(ve),this._parents)}function Oe(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function ke(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new T(s,this._parents)}function Ae(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function je(e){e||=Me;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new T(i,this._parents).order()}function Me(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ne(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Pe(){return Array.from(this)}function Fe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Ie(){let e=0;for(let t of this)++e;return e}function Le(){return!this.node()}function Re(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function ze(e){return function(){this.removeAttribute(e)}}function Be(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ve(e,t){return function(){this.setAttribute(e,t)}}function He(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ue(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function We(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Ge(e,t){var n=y(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Be:ze:typeof t==`function`?n.local?We:Ue:n.local?He:Ve)(n,t))}function Ke(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function qe(e){return function(){this.style.removeProperty(e)}}function Je(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ye(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Xe(e,t,n){return arguments.length>1?this.each((t==null?qe:typeof t==`function`?Ye:Je)(e,t,n??``)):w(this.node(),e)}function w(e,t){return e.style.getPropertyValue(t)||Ke(e).getComputedStyle(e,null).getPropertyValue(t)}function Ze(e){return function(){delete this[e]}}function Qe(e,t){return function(){this[e]=t}}function $e(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function et(e,t){return arguments.length>1?this.each((t==null?Ze:typeof t==`function`?$e:Qe)(e,t)):this.node()[e]}function tt(e){return e.trim().split(/^|\s+/)}function nt(e){return e.classList||new rt(e)}function rt(e){this._node=e,this._names=tt(e.getAttribute(`class`)||``)}rt.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function it(e,t){for(var n=nt(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function at(e,t){for(var n=nt(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function ot(e){return function(){it(this,e)}}function st(e){return function(){at(this,e)}}function ct(e,t){return function(){(t.apply(this,arguments)?it:at)(this,e)}}function lt(e,t){var n=tt(e+``);if(arguments.length<2){for(var r=nt(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?ct:t?ot:st)(n,t))}function ut(){this.textContent=``}function dt(e){return function(){this.textContent=e}}function ft(e){return function(){this.textContent=e.apply(this,arguments)??``}}function pt(e){return arguments.length?this.each(e==null?ut:(typeof e==`function`?ft:dt)(e)):this.node().textContent}function mt(){this.innerHTML=``}function ht(e){return function(){this.innerHTML=e}}function gt(e){return function(){this.innerHTML=e.apply(this,arguments)??``}}function _t(e){return arguments.length?this.each(e==null?mt:(typeof e==`function`?gt:ht)(e)):this.node().innerHTML}function vt(){this.nextSibling&&this.parentNode.appendChild(this)}function yt(){return this.each(vt)}function bt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function xt(){return this.each(bt)}function St(e){var t=typeof e==`function`?e:te(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ct(){return null}function wt(e,t){var n=typeof e==`function`?e:te(e),r=t==null?Ct:typeof t==`function`?t:S(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Tt(){var e=this.parentNode;e&&e.removeChild(this)}function Et(){return this.each(Tt)}function Dt(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ot(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function kt(e){return this.select(e?Ot:Dt)}function At(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function jt(e){return function(t){e.call(this,t,this.__data__)}}function Mt(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function Nt(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function Pt(e,t,n){return function(){var r=this.__on,i,a=jt(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Ft(e,t,n){var r=Mt(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?Pt:Nt,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function It(e,t,n){var r=Ke(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Lt(e,t){return function(){return It(this,e,t)}}function Rt(e,t){return function(){return It(this,e,t.apply(this,arguments))}}function zt(e,t){return this.each((typeof t==`function`?Rt:Lt)(e,t))}function*Bt(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Vt=[null];function T(e,t){this._groups=e,this._parents=t}function E(){return new T([[document.documentElement]],Vt)}function Ht(){return this}T.prototype=E.prototype={constructor:T,select:C,selectAll:oe,selectChild:fe,selectChildren:ge,filter:_e,data:Te,enter:ye,exit:De,join:Oe,merge:ke,selection:Ht,order:Ae,sort:je,call:Ne,nodes:Pe,node:Fe,size:Ie,empty:Le,each:Re,attr:Ge,style:Xe,property:et,classed:lt,text:pt,html:_t,raise:yt,lower:xt,append:St,insert:wt,remove:Et,clone:kt,datum:At,on:Ft,dispatch:zt,[Symbol.iterator]:Bt};function Ut(e){return typeof e==`string`?new T([[document.querySelector(e)]],[document.documentElement]):new T([[e]],Vt)}function D(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Wt(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function O(){}var k=.7,A=1/k,j=`\\s*([+-]?\\d+)\\s*`,M=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,N=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,Gt=/^#([0-9a-f]{3,8})$/,Kt=RegExp(`^rgb\\(${j},${j},${j}\\)$`),qt=RegExp(`^rgb\\(${N},${N},${N}\\)$`),Jt=RegExp(`^rgba\\(${j},${j},${j},${M}\\)$`),Yt=RegExp(`^rgba\\(${N},${N},${N},${M}\\)$`),Xt=RegExp(`^hsl\\(${M},${N},${N}\\)$`),Zt=RegExp(`^hsla\\(${M},${N},${N},${M}\\)$`),Qt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};D(O,P,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:$t,formatHex:$t,formatHex8:en,formatHsl:tn,formatRgb:nn,toString:nn});function $t(){return this.rgb().formatHex()}function en(){return this.rgb().formatHex8()}function tn(){return pn(this).formatHsl()}function nn(){return this.rgb().formatRgb()}function P(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=Gt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?rn(t):n===3?new F(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?an(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?an(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Kt.exec(e))?new F(t[1],t[2],t[3],1):(t=qt.exec(e))?new F(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Jt.exec(e))?an(t[1],t[2],t[3],t[4]):(t=Yt.exec(e))?an(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Xt.exec(e))?fn(t[1],t[2]/100,t[3]/100,1):(t=Zt.exec(e))?fn(t[1],t[2]/100,t[3]/100,t[4]):Qt.hasOwnProperty(e)?rn(Qt[e]):e===`transparent`?new F(NaN,NaN,NaN,0):null}function rn(e){return new F(e>>16&255,e>>8&255,e&255,1)}function an(e,t,n,r){return r<=0&&(e=t=n=NaN),new F(e,t,n,r)}function on(e){return e instanceof O||(e=P(e)),e?(e=e.rgb(),new F(e.r,e.g,e.b,e.opacity)):new F}function sn(e,t,n,r){return arguments.length===1?on(e):new F(e,t,n,r??1)}function F(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}D(F,sn,Wt(O,{brighter(e){return e=e==null?A:A**+e,new F(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?k:k**+e,new F(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new F(I(this.r),I(this.g),I(this.b),dn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:cn,formatHex:cn,formatHex8:ln,formatRgb:un,toString:un}));function cn(){return`#${L(this.r)}${L(this.g)}${L(this.b)}`}function ln(){return`#${L(this.r)}${L(this.g)}${L(this.b)}${L((isNaN(this.opacity)?1:this.opacity)*255)}`}function un(){let e=dn(this.opacity);return`${e===1?`rgb(`:`rgba(`}${I(this.r)}, ${I(this.g)}, ${I(this.b)}${e===1?`)`:`, ${e})`}`}function dn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function I(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function L(e){return e=I(e),(e<16?`0`:``)+e.toString(16)}function fn(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new R(e,t,n,r)}function pn(e){if(e instanceof R)return new R(e.h,e.s,e.l,e.opacity);if(e instanceof O||(e=P(e)),!e)return new R;if(e instanceof R)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new R(o,s,c,e.opacity)}function mn(e,t,n,r){return arguments.length===1?pn(e):new R(e,t,n,r??1)}function R(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}D(R,mn,Wt(O,{brighter(e){return e=e==null?A:A**+e,new R(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?k:k**+e,new R(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new F(_n(e>=240?e-240:e+120,i,r),_n(e,i,r),_n(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new R(hn(this.h),gn(this.s),gn(this.l),dn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=dn(this.opacity);return`${e===1?`hsl(`:`hsla(`}${hn(this.h)}, ${gn(this.s)*100}%, ${gn(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function hn(e){return e=(e||0)%360,e<0?e+360:e}function gn(e){return Math.max(0,Math.min(1,e||0))}function _n(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var vn=Math.PI/180,yn=180/Math.PI,bn=18,xn=.96422,Sn=1,Cn=.82521,wn=4/29,z=6/29,Tn=3*z*z,En=z*z*z;function Dn(e){if(e instanceof B)return new B(e.l,e.a,e.b,e.opacity);if(e instanceof V)return Fn(e);e instanceof F||(e=on(e));var t=Mn(e.r),n=Mn(e.g),r=Mn(e.b),i=kn((.2225045*t+.7168786*n+.0606169*r)/Sn),a,o;return t===n&&n===r?a=o=i:(a=kn((.4360747*t+.3850649*n+.1430804*r)/xn),o=kn((.0139322*t+.0971045*n+.7141733*r)/Cn)),new B(116*i-16,500*(a-i),200*(i-o),e.opacity)}function On(e,t,n,r){return arguments.length===1?Dn(e):new B(e,t,n,r??1)}function B(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}D(B,On,Wt(O,{brighter(e){return new B(this.l+bn*(e??1),this.a,this.b,this.opacity)},darker(e){return new B(this.l-bn*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=xn*An(t),e=Sn*An(e),n=Cn*An(n),new F(jn(3.1338561*t-1.6168667*e-.4906146*n),jn(-.9787684*t+1.9161415*e+.033454*n),jn(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function kn(e){return e>En?e**(1/3):e/Tn+wn}function An(e){return e>z?e*e*e:Tn*(e-wn)}function jn(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function Mn(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function Nn(e){if(e instanceof V)return new V(e.h,e.c,e.l,e.opacity);if(e instanceof B||(e=Dn(e)),e.a===0&&e.b===0)return new V(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*yn;return new V(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Pn(e,t,n,r){return arguments.length===1?Nn(e):new V(e,t,n,r??1)}function V(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Fn(e){if(isNaN(e.h))return new B(e.l,0,0,e.opacity);var t=e.h*vn;return new B(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}D(V,Pn,Wt(O,{brighter(e){return new V(this.h,this.c,this.l+bn*(e??1),this.opacity)},darker(e){return new V(this.h,this.c,this.l-bn*(e??1),this.opacity)},rgb(){return Fn(this).rgb()}}));var In=-.14861,Ln=1.78277,Rn=-.29227,zn=-.90649,H=1.97294,Bn=H*zn,Vn=H*Ln,Hn=Ln*Rn-zn*In;function Un(e){if(e instanceof U)return new U(e.h,e.s,e.l,e.opacity);e instanceof F||(e=on(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(Hn*r+Bn*t-Vn*n)/(Hn+Bn-Vn),a=r-i,o=(H*(n-i)-Rn*a)/zn,s=Math.sqrt(o*o+a*a)/(H*i*(1-i)),c=s?Math.atan2(o,a)*yn-120:NaN;return new U(c<0?c+360:c,s,i,e.opacity)}function Wn(e,t,n,r){return arguments.length===1?Un(e):new U(e,t,n,r??1)}function U(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}D(U,Wn,Wt(O,{brighter(e){return e=e==null?A:A**+e,new U(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?k:k**+e,new U(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*vn,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new F(255*(t+n*(In*r+Ln*i)),255*(t+n*(Rn*r+zn*i)),255*(t+H*r*n),this.opacity)}}));function Gn(e,t,n,r,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*n+(1+3*e+3*a-3*o)*r+o*i)/6}function Kn(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],a=e[r+1],o=r>0?e[r-1]:2*i-a,s=r<t-1?e[r+2]:2*a-i;return Gn((n-r/t)*t,o,i,a,s)}}function qn(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),i=e[(r+t-1)%t],a=e[r%t],o=e[(r+1)%t],s=e[(r+2)%t];return Gn((n-r/t)*t,i,a,o,s)}}var Jn=e=>()=>e;function Yn(e,t){return function(n){return e+n*t}}function Xn(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Zn(e,t){var n=t-e;return n?Yn(e,n>180||n<-180?n-360*Math.round(n/360):n):Jn(isNaN(e)?t:e)}function Qn(e){return(e=+e)==1?W:function(t,n){return n-t?Xn(t,n,e):Jn(isNaN(t)?n:t)}}function W(e,t){var n=t-e;return n?Yn(e,n):Jn(isNaN(e)?t:e)}var $n=(function e(t){var n=Qn(t);function r(e,t){var r=n((e=sn(e)).r,(t=sn(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=W(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function er(e){return function(t){var n=t.length,r=Array(n),i=Array(n),a=Array(n),o,s;for(o=0;o<n;++o)s=sn(t[o]),r[o]=s.r||0,i[o]=s.g||0,a[o]=s.b||0;return r=e(r),i=e(i),a=e(a),s.opacity=1,function(e){return s.r=r(e),s.g=i(e),s.b=a(e),s+``}}}var tr=er(Kn),nr=er(qn);function rr(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function ir(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ar(e,t){return(ir(t)?rr:or)(e,t)}function or(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=mr(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function sr(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function G(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function cr(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=mr(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var lr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ur=new RegExp(lr.source,`g`);function dr(e){return function(){return e}}function fr(e){return function(t){return e(t)+``}}function pr(e,t){var n=lr.lastIndex=ur.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=lr.exec(e))&&(i=ur.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:G(r,i)})),n=ur.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?fr(c[0].x):dr(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function mr(e,t){var n=typeof t,r;return t==null||n===`boolean`?Jn(t):(n===`number`?G:n===`string`?(r=P(t))?(t=r,$n):pr:t instanceof P?$n:t instanceof Date?sr:ir(t)?rr:Array.isArray(t)?or:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?cr:G)(e,t)}function hr(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function gr(e,t){var n=Zn(+e,+t);return function(e){var t=n(e);return t-360*Math.floor(t/360)}}function _r(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var vr=180/Math.PI,yr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function br(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*vr,skewX:Math.atan(c)*vr,scaleX:o,scaleY:s}}var xr;function Sr(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?yr:br(t.a,t.b,t.c,t.d,t.e,t.f)}function Cr(e){return e==null||(xr||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),xr.setAttribute(`transform`,e),!(e=xr.transform.baseVal.consolidate()))?yr:(e=e.matrix,br(e.a,e.b,e.c,e.d,e.e,e.f))}function wr(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:G(e,i)},{i:c-2,x:G(r,a)})}else (i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:G(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:G(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:G(e,n)},{i:s-2,x:G(t,r)})}else (n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var Tr=wr(Sr,`px, `,`px)`,`deg)`),Er=wr(Cr,`, `,`)`,`)`),Dr=1e-12;function Or(e){return((e=Math.exp(e))+1/e)/2}function kr(e){return((e=Math.exp(e))-1/e)/2}function Ar(e){return((e=Math.exp(2*e))-1)/(e+1)}var jr=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<Dr)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=Or(y),c=s/(n*g)*(i*Ar(t*r+y)-kr(y));return[a+c*d,o+c*f,s*i/Or(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4);function Mr(e){return function(t,n){var r=e((t=mn(t)).h,(n=mn(n)).h),i=W(t.s,n.s),a=W(t.l,n.l),o=W(t.opacity,n.opacity);return function(e){return t.h=r(e),t.s=i(e),t.l=a(e),t.opacity=o(e),t+``}}}var Nr=Mr(Zn),Pr=Mr(W);function Fr(e,t){var n=W((e=On(e)).l,(t=On(t)).l),r=W(e.a,t.a),i=W(e.b,t.b),a=W(e.opacity,t.opacity);return function(t){return e.l=n(t),e.a=r(t),e.b=i(t),e.opacity=a(t),e+``}}function Ir(e){return function(t,n){var r=e((t=Pn(t)).h,(n=Pn(n)).h),i=W(t.c,n.c),a=W(t.l,n.l),o=W(t.opacity,n.opacity);return function(e){return t.h=r(e),t.c=i(e),t.l=a(e),t.opacity=o(e),t+``}}}var Lr=Ir(Zn),Rr=Ir(W);function zr(e){return(function t(n){n=+n;function r(t,r){var i=e((t=Wn(t)).h,(r=Wn(r)).h),a=W(t.s,r.s),o=W(t.l,r.l),s=W(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=a(e),t.l=o(e**+n),t.opacity=s(e),t+``}}return r.gamma=t,r})(1)}var Br=zr(Zn),Vr=zr(W);function Hr(e,t){t===void 0&&(t=e,e=mr);for(var n=0,r=t.length-1,i=t[0],a=Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return a[t](e-t)}}function Ur(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var Wr=t({interpolate:()=>mr,interpolateArray:()=>ar,interpolateBasis:()=>Kn,interpolateBasisClosed:()=>qn,interpolateCubehelix:()=>Br,interpolateCubehelixLong:()=>Vr,interpolateDate:()=>sr,interpolateDiscrete:()=>hr,interpolateHcl:()=>Lr,interpolateHclLong:()=>Rr,interpolateHsl:()=>Nr,interpolateHslLong:()=>Pr,interpolateHue:()=>gr,interpolateLab:()=>Fr,interpolateNumber:()=>G,interpolateNumberArray:()=>rr,interpolateObject:()=>cr,interpolateRgb:()=>$n,interpolateRgbBasis:()=>tr,interpolateRgbBasisClosed:()=>nr,interpolateRound:()=>_r,interpolateString:()=>pr,interpolateTransformCss:()=>Tr,interpolateTransformSvg:()=>Er,interpolateZoom:()=>jr,piecewise:()=>Hr,quantize:()=>Ur}),K=0,Gr=0,Kr=0,qr=1e3,Jr,q,Yr=0,J=0,Xr=0,Zr=typeof performance==`object`&&performance.now?performance:Date,Qr=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function $r(){return J||=(Qr(ei),Zr.now()+Xr)}function ei(){J=0}function ti(){this._call=this._time=this._next=null}ti.prototype=ni.prototype={constructor:ti,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?$r():+n)+(t==null?0:+t),!this._next&&q!==this&&(q?q._next=this:Jr=this,q=this),this._call=e,this._time=n,si()},stop:function(){this._call&&(this._call=null,this._time=1/0,si())}};function ni(e,t,n){var r=new ti;return r.restart(e,t,n),r}function ri(){$r(),++K;for(var e=Jr,t;e;)(t=J-e._time)>=0&&e._call.call(void 0,t),e=e._next;--K}function ii(){J=(Yr=Zr.now())+Xr,K=Gr=0;try{ri()}finally{K=0,oi(),J=0}}function ai(){var e=Zr.now(),t=e-Yr;t>qr&&(Xr-=t,Yr=e)}function oi(){for(var e,t=Jr,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Jr=n);q=e,si(r)}function si(e){K||(Gr&&=clearTimeout(Gr),e-J>24?(e<1/0&&(Gr=setTimeout(ii,e-Zr.now()-Xr)),Kr&&=clearInterval(Kr)):(Kr||=(Yr=Zr.now(),setInterval(ai,qr)),K=1,Qr(ii)))}function ci(e,t,n){var r=new ti;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var li=p(`start`,`end`,`cancel`,`interrupt`),ui=[];function di(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;pi(e,n,{name:t,index:r,group:i,on:li,tween:ui,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function fi(e,t){var n=X(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function Y(e,t){var n=X(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function X(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function pi(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=ni(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return ci(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(ci(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function mi(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function hi(e){return this.each(function(){mi(this,e)})}function gi(e,t){var n,r;return function(){var i=Y(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function _i(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=Y(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function vi(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=X(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?gi:_i)(n,e,t))}function yi(e,t,n){var r=e._id;return e.each(function(){var e=Y(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return X(e,r).value[t]}}function bi(e,t){var n;return(typeof t==`number`?G:t instanceof P?$n:(n=P(t))?(t=n,$n):pr)(e,t)}function xi(e){return function(){this.removeAttribute(e)}}function Si(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ci(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function wi(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function Ti(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Ei(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Di(e,t){var n=y(e),r=n===`transform`?Er:bi;return this.attrTween(e,typeof t==`function`?(n.local?Ei:Ti)(n,r,yi(this,`attr.`+e,t)):t==null?(n.local?Si:xi)(n):(n.local?wi:Ci)(n,r,t))}function Oi(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function ki(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Ai(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&ki(e,i)),n}return i._value=t,i}function ji(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Oi(e,i)),n}return i._value=t,i}function Mi(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=y(e);return this.tween(n,(r.local?Ai:ji)(r,t))}function Ni(e,t){return function(){fi(this,e).delay=+t.apply(this,arguments)}}function Pi(e,t){return t=+t,function(){fi(this,e).delay=t}}function Fi(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Ni:Pi)(t,e)):X(this.node(),t).delay}function Ii(e,t){return function(){Y(this,e).duration=+t.apply(this,arguments)}}function Li(e,t){return t=+t,function(){Y(this,e).duration=t}}function Ri(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Ii:Li)(t,e)):X(this.node(),t).duration}function zi(e,t){if(typeof t!=`function`)throw Error();return function(){Y(this,e).ease=t}}function Bi(e){var t=this._id;return arguments.length?this.each(zi(t,e)):X(this.node(),t).ease}function Vi(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();Y(this,e).ease=n}}function Hi(e){if(typeof e!=`function`)throw Error();return this.each(Vi(this._id,e))}function Ui(e){typeof e!=`function`&&(e=se(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Z(r,this._parents,this._name,this._id)}function Wi(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new Z(o,this._parents,this._name,this._id)}function Gi(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function Ki(e,t,n){var r,i,a=Gi(t)?fi:Y;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function qi(e,t){var n=this._id;return arguments.length<2?X(this.node(),n).on.on(e):this.each(Ki(n,e,t))}function Ji(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Yi(){return this.on(`end.remove`,Ji(this._id))}function Xi(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=S(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,di(l[f],t,n,f,l,X(u,n)));return new Z(a,this._parents,t,n)}function Zi(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=ie(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=X(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&di(p,t,n,h,f,m);a.push(f),o.push(u)}return new Z(a,o,t,n)}var Qi=E.prototype.constructor;function $i(){return new Qi(this._groups,this._parents)}function ea(e,t){var n,r,i;return function(){var a=w(this,e),o=(this.style.removeProperty(e),w(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function ta(e){return function(){this.style.removeProperty(e)}}function na(e,t,n){var r,i=n+``,a;return function(){var o=w(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function ra(e,t,n){var r,i,a;return function(){var o=w(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),w(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function ia(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=Y(this,e),l=c.on,u=c.value[a]==null?s||=ta(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function aa(e,t,n){var r=(e+=``)==`transform`?Tr:bi;return t==null?this.styleTween(e,ea(e,r)).on(`end.style.`+e,ta(e)):typeof t==`function`?this.styleTween(e,ra(e,r,yi(this,`style.`+e,t))).each(ia(this._id,e)):this.styleTween(e,na(e,r,t),n).on(`end.style.`+e,null)}function oa(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function sa(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&oa(e,a,n)),r}return a._value=t,a}function ca(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,sa(e,t,n??``))}function la(e){return function(){this.textContent=e}}function ua(e){return function(){this.textContent=e(this)??``}}function da(e){return this.tween(`text`,typeof e==`function`?ua(yi(this,`text`,e)):la(e==null?``:e+``))}function fa(e){return function(t){this.textContent=e.call(this,t)}}function pa(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&fa(r)),t}return r._value=e,r}function ma(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,pa(e))}function ha(){for(var e=this._name,t=this._id,n=ya(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=X(c,t);di(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Z(r,this._parents,e,n)}function ga(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=Y(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var _a=0;function Z(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function va(e){return E().transition(e)}function ya(){return++_a}var Q=E.prototype;Z.prototype=va.prototype={constructor:Z,select:Xi,selectAll:Zi,selectChild:Q.selectChild,selectChildren:Q.selectChildren,filter:Ui,merge:Wi,selection:$i,transition:ha,call:Q.call,nodes:Q.nodes,node:Q.node,size:Q.size,empty:Q.empty,each:Q.each,on:qi,attr:Di,attrTween:Mi,style:aa,styleTween:ca,text:da,textTween:ma,remove:Yi,tween:vi,delay:Fi,duration:Ri,ease:Bi,easeVarying:Hi,end:ga,[Symbol.iterator]:Q[Symbol.iterator]};function ba(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var xa={time:null,delay:0,duration:250,ease:ba};function Sa(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function Ca(e){var t,n;e instanceof Z?(t=e._id,e=e._name):(t=ya(),(n=xa).time=$r(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&di(c,e,t,l,o,n||Sa(c,t));return new Z(r,this._parents,e,t)}E.prototype.interrupt=hi,E.prototype.transition=Ca;var{abs:wa,max:Ta,min:Ea}=Math;[`w`,`e`].map(Da),[`n`,`s`].map(Da),[`n`,`w`,`e`,`s`,`nw`,`ne`,`sw`,`se`].map(Da);function Da(e){return{type:e}}function $(e,t,n){this.k=e,this.x=t,this.y=n}$.prototype={constructor:$,scale:function(e){return e===1?this:new $(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new $(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var Oa=new $(1,0,0);ka.prototype=$.prototype;function ka(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Oa;return e.__zoom}export{o as _,Hr as a,r as b,mr as c,On as d,mn as f,s as g,p as h,Wr as i,G as l,Ut as m,$r as n,Lr as o,sn as p,ni as r,_r as s,ti as t,Pn as u,l as v,u as y};