@zombie-mermaid/svg-renderer 5.16.0 → 5.17.0

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.
package/dist/index.cjs CHANGED
@@ -5,25 +5,27 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require
5
5
  font-display: swap;
6
6
  src: url(data:font/woff2;base64,d09GMgABAAAAABZoAAwAAAAAMiwAABYWAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGjQGYACCfhEICtBIv3MLgmIAATYCJAOFNgQgBYREByAboCdFBDYOABG0i4mo4AwURYmYtNn/ZQI3hkD/MDOMAipCbeSAiA/e0E7k5P52NehVqIa1Ws5wnlXDxHfybGfD5bMhLn7xIYDX23j/Rz5CY5/kwkd/mG/3/6sFK7YCklopc4CZmEawA6YLdIro3fC0zX8HFmsX7m9GgjYleXDcEQeS59FHSSpYlHP+r/7NWDn/XLX7We5Hh/zcflRIYLtfFFHgaQRdxolEHFjGyf5+bqOug4dK5jpHFM9JLar//W2oPbmphNegKjf6hSubuicHd6XOxFTSwetPRm4TfrdSCA2AYZje1KaqotJySXs/aDjvWFNNY64WjJjzP5fan2JuSKqb2ptR+PyMnJA//yfZT3J3zcG6XMtJiXI3Kv9y2iHosZoE+jcCUkRqc3NErkLJGaEGz9fS2XtXZk5GIks1Mp9kfJRGbeib8Gmud13rHnRVHZZBeAZlqsIoJIOwipc5DyJWp2JEaq8NYpKrDGTj3jo1VvT022N4TQ/5qiHx95wgkAcAliRdkD41yC4zyDkbyIUYyKUsSCyLmCMf3l4AHE32rYkX64CRMZkgoM/hwHrSsUT/dwmozlotHaDzx3DzJ+goAC6l1EFTt29eXB04L82iCYlx85Y6bA9xSFnsozV3gNWvoFviuv853gNcm7TfDoedMe+A3faYdsQ2+1xup+0mnHTcCVPOgmRk5RXVrLdBiVJlylWoVK1Bk2YtWrXhaycgJDZrlyucNucGEhglNZyBkYmZjYOTi5tHSERUTI+4AYOSUrJmnLPXKfksSImS0nKqVisrttlGl9hkpQ6mGrXq1TmKhYeNg0ukUTc5KZiCDAKloqel08GK0ImkQQnw8gnyO6ZLv4RefdLCMiDKJSUAjwBoAdwA2YtiB/hDDwA4FV+0osA5WQmaaByUu1TZ7oKozVvRvimvwYFHN3aWx63vcmq+Kx0dIRNrY9cg08wcCxqIZZ3B0HmijHjBDgceRM2UYyWTaUzz2XIxn+3k82XEkroE2jQVAtVw9M5K23rHs/xJGrw7aINDe6oWNAzDrTE60YTmZv361HJAsIPKsOjcKq2qyGsUQhTd67852KOyvD2yzJjXNNMUqLPNZrsl6FKfuBmBklR4x+2lDhW1UQtK5JrkAvk+gXBqcwCCgCbYOTqEV6jTC6FBNbxG9oUb8jBLwiid8LObmCdblBBhTwBreN2c6CkvGOiu4g2Xp1PIKqn+y9fPoNgWVMQUPNTFN9Ubz5YHqdmPIRDe51TYgcCoW8sYulQGBQuok8lVwsNEdcEKLAKJW0jw1lPmti0ZTjSVELsq/GtNVJh8FmWUhF9CC/9+QjxB+A8vX6jWEcUeORZZSC9RO5+L41XEt3/BxhbhbTZ9ENQWWMpqW+n5GOZyFlIFRhwkYv2zdGexrYXUi5GkUiGLRaCIZEHRvZErT6U/mXySxKxm5AgsWTloiKRCF1EP5JzHgEmO0uQ6dWuZni+s7XyKLmydocAXEOwibZJ42fd5PgxS6mTIiYHvk54/J69SH+fLWp9GkN6zjfiws4p+Bwg3PbXFVN2PYDwTzgrGpyTU1gfaF4IrosGwHWAGQmaBhUBYYnVLOyun0CnQKMQoIGKg80bHHiIRsBM4LZIgg434M+YPAPGtsVFL4AK9wTJYIYqOrbyFADqnmtlIBElGhRt/0khQoEPSxSk8A+jZJFVypiRVKODi+wRDJQPRbOWeAOztcWGTTcd3HD5YPQRaUwJc+F8k2rpLnAOkRZAoxPFcph4HgOevdtmm/GKNEdUEwYKRTE8IDwNF3aYiOFxSjbeWIIL16u+38z9DjlJdYODsnRGg6ZZk7mStNGIsvUAd5JHhKuL7CvhSWLmy7Hrjp7YGFniM9XSt+Dcy9ooClHk3JC4SeNGJrZplh7Ka0BvNfAGQWWWrPQnIO0nPyD/WCm+TInDihZEPaCFxoshODj8Uc9XfFYSU4ICjxLenSJaox9rE8sUpx6NIh87YO/nplqsThu5iXoIguRCwjznR7t/0N/inpR4VP/5ZeSJFby5UK+mX3IVHdxMJrqlBJeXesPEtmGuwVuk1Z8YUyXzi9oh+yZvhtxU4d6RdkU912UGAn+jhgzo45YW6gSgDlXmFfa4vyWfsWZoMn8o903SYmPSwQyTz9MP8immCVnfsidOEd3DiFm59sxf81gh9xXTDyxOJJoHctABrJzQZfY9O4yZ9Egc+dL0q72olF1/G9DsorYtULawavt9xqSb3SSunWKnE8jVmos2YYDX9V+9xSvClQ/S6ESC4nDADX+j+pJDtuhPvDsijUnS2trhOVzqu0dWOFGYp+AUOH3FSI9gZqzr/VLITOVtKLWp05cpIeRpZ9vwIEfPATzCcTz0pLez2HSoXuO4PRanZFyL6EZgTM9cuwn+MXhfAPleGW1u/ZQ4IOlqfSUYHOyVJ1rfGK1ZbuyOcoMDxXy4IJlE5tFqYw159Wv7+VUGur2I+8X5QTUo2C9XIRYPUg8oti37ktNJOl6NY1+rS79kitpN1wFgn64L2pZn303lMhwr2mtfPd+vksTFFB/P25X4jmR5Aa3KiOVH3fVL1N7TuH8UWhAd2Y4j6tUcC0LidLnru4hgHTvm5zwvRQYcTFWX4awD1N19HMD37xoKGgPhVqnSk3hv8wO6ofqGIC5Tln0B6gkqmp3XFReoPgjvxNsagXZIYVMTJECgd7mXFcM1o8sjWIyzR6t5sqICgB/+U9bp8FudzrYXtcU2SuKaIX6t1/K4xMj9bVz9ZOs34YGBgjneBf0uFCPapx+6/ijnLc2iRd386TZ4Gd5MrXpitf16w4fK0GPhyr0SSYbcYd++hX41y64xt/nRfZPrKLVKlXCDA5NJh8ahCp5TKdHrFKOAzIpnBkD6kSAQOkgxSCKqEYaUS0SPKFaA6Fcx9R8Brz4vwkmtXFsd5G1HdajJOgi8gRId2HchYN9dgHCHw5h7SxgTioKpWJQ5hFG3IElbqO5S12LhNw8BrIQ0k+vMv/7HP0AciuatJw8UGoiHPQIJA7lbS8bOMlKoBm/Y+GGLgVOEqJHKI/P5u+tm+HCX+WkzlKOJrAuiSw8LD5I4DG6xkxIeHYpQK16GofpxURVRRbOsQ8OYoad85Seh84OGR7huIeCeYyJm79CTQ5aa9cBc8nVNuLm08fzt/aKs5OVjYkX9b2A2o3NYPk5fk6WhE3QnnMfSD5EY6i3kCNDNCqVRCmAhKqHHFRWaQgBGVAcQvVeRQnBKoN0z3yfWh1GDIm1xm04wWCQx30eyJBp1UIv9o78d1z/wjRVjsxsXtfwBv7pvY1mwoRA8mtr9lbD+M6+QIroX3AypHHTmu7OIK3DLPUF/4+Pm841IMFYmVCslxcM1C7Ma8ufzolqCjoaBFzyegkoR12Ucv/AXjHXIUwXUwLAwElbM3FvhyF7Bgu8Cn0Bvinx5CwlcIRoQ7d4lVuBRWacS7AJuRGBsMUXKTGkU6tNKWNvSBgQr1OnMMl/KdPo4c8XMEDgnFUyECAYbwGq5PpCp164gBY9dICiztujR9TT67CzQzYr3J4FpqrUyqkctgjczewFBiEHz/wKJr9Mcn1jiFwrWuJ4Z/8D24CL2ORau4lEPH89YX4BxtaRAzSYX4+vV5D15aanEtpjAml44WF9NRDGeChtdST3f3JN/ZxqL0rG3pd8JPB18b7h79YhvLYGBuG/sSLBW/92zXbPO9r/ttvHhvQ3yiajGwU7pWNXm2+udaSfAPwx72m/iths4mwY3NvUPtvxVTeeiAzRtJBByXuiO0tF3KMShNCpFpviXS0vYkuIOBdfoMeiul6jQ0yqoqHVUWTE/IuCqOVoty2jCLSzv34WCDsapKW2XDLJ1YM8odHtZws6Y9xnpTVaWv/qi5ur8+Yam0tjRPAgMDsciiUJzKUfPQKJQl5Ig12B845w/2J02Sf1Tz6r8lIlSDHEFQTTiD4T5HQsPMQDZKc1J1mFgM4+qjjyK4ChZjklqK5sxGwasDYG8dfLkAnba41OUMMtTvPxcI9lsRQp6FoNF5KkfFoahFVmkSKyiB44MWS/5Wz6v+AU0MdbdIHFWp2kN+oaLlmnOrJL+eR6krDcSwSBvqeeSgmohzTMlH2mdRXNITk2gsqNGCYTKIIqeZQTMjuCXbPdGNT3sQ6+ILfGjI1S7X4FIeyuqiitQZ4m0DKMOUuFyuxDHwzu55cj6Ddep158hzqDRzgbywG8wvkCfZtlYe5KYnTe2wPdjrz/qD/XbYJErSAm6WNdblXlNHd2y8EMHEY2JAaeCNLIdiBlhhDUZdaSqMIEqhGNWgfmAnn5i4jWS8eR8J3AvkKKJWye/KI/2FweFUFARz1NH48Yt9t+ffXxk/+2vvb2C0w2HDv3uYvERR46i6kQQylrmDpl7Jqtt0FRRmsASIWXGl7arq38tKf6u+Wr+6SsvWBV4WFe+6d0jBbC4MZzM94/FMOhIhIz7ew2YKWWAlhh5AQyosVZ0hhINWInW76kgSqW7kfuSxDl3QHr27SsK+m/1ZcesLlb9zZEoVMr5RplTLj2zgvVL3N/AsmLEUsQb7AgYeapFH6Asd/sPZVu64YcolNauzrnTd8HdA37kFPZAeseQHQn2kZc/32h8u89r+hd6I/gWSLCpOixjkqMMbC7Ap9tYhWK5C/WBDoTdCGikWxW3h9TZo0aKjG4blRoUu1OlsISJmhaeM2djSJqmTamfXzaybM0VsXuAtkbd7/XyFwtfW3imCUbeMnjN162QiT4ivlJIcxKiVSrU0qoRoEygxwc0VKjXiEhBWd5qVqjPkmZPUyQtNF1RltNJ5EjQxAqlk0E/5ZQpcJEZx2Y56GeZP9zODw6n5fzno+3MNCbADghE30yyaZNrAGrVAPUkNuiDSXLKNKZnU+5hh5DJ4YA0YN2CXAd7jm+9elui7IfGcqP65kn338sc2JYYWEi/qxN9eunQN4I4F4q0X6cHt1sx7bPZ74a3WQPEioCj+SAu5n5KMaEjQzEjoDEzQFWpXGmU6o9TlOpQHVeCfS1eWla4oHR552Upgkk9LnzrYffWll+26kgQO6890bbOzSabGYTmuQyhaaDgTjm5JhdrFGbX2yZeMJKhiRIeSQUqm0cgGKq/oEizmOx9qIQ/YbrvfXdA94OEFtyTB3Lx+lnFzbMOj9T/eSV0NmDin0CpTaaTPhKdJLvTwlmj/QLR1fKNaGHhCCvdoOLWRz69viyyIqx/lVmJdYmFYicOJHhi3YIRdoxEe7HSrwMP0nSVbqGdftUHToJmhiQukXQqNOYwto+9VuaQSgaOLo0ADPRCRcn0vvQTLukZxP3OPQHObWIUJBBQSi9QLhJGFftSil8kVFHi57BOBJxbE1WfJKoVfLAgrtXA8Dmu0cdo69bNRpZnBfKGW+RJzOJ3aF8BrZ4XcPg0XNJ9sPFpTc7RxMn/DNXchUH28z6m6sWq9EbZgjwS5kPb2clpiGC56b3PxZqOi/OP5j1u7Gbz09o08VI/DsB7HxuxjeKxdHFBK2JRNkA7I0G7C7TE1B/U+9gR/4SPfRH2pubc+f6S/A183Zhtb5+gYi2/ozcBslZKPFvhv3o56H56I7/bS++7bfAewsl5zYqHqhSDWtxHcqfOHpp8N7tp5XmUe6PtL+DcHaAq45TLzp8NXVJ56YeL8iQA9y/m/38obtZw388bWmf8H6WEnuspnPRnm85YcRIjJTuCJwAv9rm5HgXnVVepxLENksHF1Bc8wruxqJVrZUmlVqMdwfUFvYKYODzlh50LA359nJhKXXLVLYm6ol2h2bZAJ2cqtsIvV0pGFKtlbsTFiDH3YGpkWfeYwMHix/+bfiJMrThLgcP/yHfntZjBTTaAEgMOGjw0A3BU2xwqawdqZSV9hogeyU9xbHAXX6UuI3g4i1G0tnJJNkoXhbtBJsZc9/eeorsTSryd7ep1Fk8fuamVjL312d/6xFYUeTksb+tACWPK/PkI88oQxLISTO2v3dpVna2b3zs3VGjgT/okFml9gvltT8y6T9azf5LPfXW2YMzzzw0sVYDtO3Erc8oM/OWBDnYKjDStS28sLBceoW97uBjQUoZXe8WVFJwA0/+OwFpcyN5Vcu+jNFuH2IwvXwpMLAhbrndO226c7B6HMk42SNyfTEHixD9XrVmIrRw09A6TwhX0/Leqr2tgbFbWVWGVtxdyHvXtHkEexhhjEVKgrahauynL0P7aqBqgX7GO4esJl27nvxHh6YiK92myn9B0Opzar1xBoY2CGhtttboIKZ3pskUTaN2CoaWXNNQ+1nGGxzrZkm+fA20WuaMwlIdwBA31BgIu0AadJRLLbbBIXz9zC/I5V/+Tj/1CpyBW3zT0Y7rr8mk1kA5OQpPnY6NkKdoIv4d8I/u+/mboZPLirvLq8oqa8vKZiPf7PZAY076ruNCVkdTX5Rp1AOZWeifTPgMGp+ExwYAZ8PLVnxjozE+40WUygOSDEED6fVHhabisFZWVQaSmkfw/A/+4K28lscUVtBVbRWtxw9yQI0BvcrgfW85vaG9hIbxrcqljXNMj6vwcWw+zBz2wsAAEgBbZoIaAdyN2mueRG7ibN7O4k6y66qr6gL1p1PITcMBC43JLLkCWyRJa4lc5udQ2yWlbLalkt22SbbJNtrpBAcnOZ1h3IXaH55ELuEs3qribrGorXF4Qi/LgLuWAgMAcWXbwMtdQQpCLLjmR3IaBLqnYNrnfdFyU90iM90qMeApeMy7iMy7ibKnMsZfKIDxxpS07tCavnmlmDLnz8UGXcKxf/ZKMyDgCsD3qYl7yOfvc26Y5g58UkIhTtlO148ev1A513AGX/56Wupd8NdpPkO/CoWP/vwvaksloALEB117+hmCQGkTq1AvDYebvRyWDGDoCbeZO0sKeOLhn1BBRct9RYZ/Tnjm0SQ3WFJhVLJ0OWhEtG15AvfeV96FboOVoOXEmbhrL0YgABwKY3lrUQ+wOrZb8VraZ/CQD8fRkb4YXMPf9M/J+k/Re7oCwJbAAGBKAtR5ddN/GSvg0EZo2/S5aibHlU4Ev3sixThIC6rCfF0dayTKBTikwuatWlUBDqKxOJdhV4rKchqsWerYpKvJELJ3gm23HR5ZzFDkEqkEXeTDZq1ZalTkiqPQp7z9tESKXyji3a8pigMCoOBlBIVSo5XmeRl7jABHXUqgHu0wwasHGEvcjYx18KBB0YcSLpdnAIVtHKprIlYMlkFj1zVOK17VC4MssUjTbaaKP/CEAAeITuBQPAAvI+aA3/1QVzvyGPAYAPqK5bxUAkRKuyKazyaxUd6nxVHp6Jqnw2bbYAvg9wKCpLKS0obkCGyaABg8yMWpGiug3pE5TmEJWWEc8eV4XXKslyjIWZzfYbY4KGZA22OFqZVaXBFtxXKbG2PNUWaSUQeUxIo3tnVbdY1a2jaqfjc+opwTewM3BQb6uC3qSR2/m4bj2308YTjUsjrC0heuBb6CWkYT4hKlxDEXtMRpcPSss01myETbJeKXbf1y2emX8zG9ImbO7rx/Y5C/v2xxvRzeq3iuIBCAAA) format('woff2');
7
7
  unicode-range: U+0020-007E, U+00A0, U+00C0-00FF;
8
- }`;function k(t,n,r){return(0,e.measureTextWidth)(t,n,r)}function A(e,t){return e.length*t*.6}var j=`'JetBrains Mono'`,ee=`${j}, 'SF Mono', 'Fira Code', ui-monospace, monospace`,M={nodeLabel:13,edgeLabel:11,groupHeader:12};function N(e){return{nodeLabel:e?.nodeLabel??M.nodeLabel,edgeLabel:e?.edgeLabel??M.edgeLabel,groupHeader:e?.groupHeader??M.groupHeader}}var P={nodeLabel:500,edgeLabel:400,groupHeader:600},te=12,ne=12,F={horizontal:20,vertical:10,diamondExtra:24},I={outerBox:1,innerBox:.75,connector:1},L=`0.35em`,re={width:8,height:5};function ie(t,n,r,i){return(0,e.buildStyleBlock)(t,n?{family:D,faceCss:O}:!1,r,i)}var ae={font:`Inter`,padding:40,nodeSpacing:28,layerSpacing:48,mergeEdges:!1,thoroughness:3,fontSizes:M},oe=`#087ebf`,se={blank:``,database:`<path d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path><path d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path><path d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path><ellipse cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line>`,disk:`<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></rect><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"></path>`,server:`<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></rect><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"></path><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"></path></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"></path><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"></path></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"></path><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"></path></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle></g>`,cloud:`<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path>`,internet:`<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></circle><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line>`},ce={flowchart:`DOWN`,state:`DOWN`,class:`DOWN`,er:`DOWN`,requirement:`DOWN`,c4:`DOWN`};function le(e,t){switch(e){case`LR`:return`RIGHT`;case`RL`:return`LEFT`;case`BT`:return`UP`;case`TD`:case`TB`:return`DOWN`;default:return t}}function ue(e){let t=typeof e==`number`?{top:e,left:e,bottom:e,right:e}:e;return`[top=${t.top},left=${t.left},bottom=${t.bottom},right=${t.right}]`}function de(e){return{"elk.algorithm":`layered`,"elk.direction":e.direction,"elk.spacing.nodeNode":String(e.nodeSpacing),"elk.layered.spacing.nodeNodeBetweenLayers":String(e.layerSpacing),"elk.padding":ue(e.padding),"elk.edgeRouting":`ORTHOGONAL`}}function fe(e,t,n){let r={id:e,width:t.width,height:t.height};return n!==void 0&&(r.labels=[{text:n}]),r}var pe={"elk.edgeLabels.inline":`true`,"elk.edgeLabels.placement":`CENTER`};function me(t,n){let r=(0,e.measureMultilineText)(t,n.fontSize,P.edgeLabel),i={text:t,width:r.width+8,height:r.height+6};return n.layoutOptions&&(i.layoutOptions={...n.layoutOptions}),i}function he(e){let t={id:e.id,sources:[e.source],targets:[e.target]};return e.label&&(t.labels=[me(e.label,e.labelStyle)]),t}var ge={"state-start":`FIRST`},_e={"elk.layered.cycleBreaking.strategy":`MODEL_ORDER`,"elk.layered.compaction.postCompaction.strategy":`NONE`};function ve(e){for(let t of e.nodes.values())if(t.shape===`state-start`||t.shape===`state-end`)return!0;return!1}var ye={top:51,left:24,bottom:24,right:24},be={top:51,left:24,bottom:24,right:24},xe={top:44,left:16,bottom:16,right:16},Se={top:16,left:16,bottom:16,right:16};function Ce(e){let t=new Map;for(let n of e.edges){if(!n.label)continue;let e=`${n.source}\0${n.target}`,r=(t.get(e)??0)+1;if(r>=3)return!0;t.set(e,r)}return!1}var we=new WeakSet;function Te(e){we.add(e)}function Ee(e){return!ve(e)&&(e.subgraphs.length>0||!we.has(e))}function De(e,t,n){if(!(!Ee(e)||t.nodeSpacing!==ae.nodeSpacing||t.layerSpacing!==ae.layerSpacing))return n===`root`?{"spacing.baseValue":`40`}:{"spacing.baseValue":`24`,"elk.spacing.nodeNode":`50`,"elk.layered.spacing.edgeNodeBetweenLayers":`30`,"elk.spacing.edgeEdge":`20`}}var Oe=[`elk.spacing.nodeNode`,`elk.layered.spacing.nodeNodeBetweenLayers`,`elk.spacing.edgeEdge`,`elk.layered.spacing.edgeEdgeBetweenLayers`,`elk.layered.spacing.edgeNodeBetweenLayers`,`elk.contentAlignment`];function ke(e,t){if(!t)return e;let n={...e};for(let e of Oe)delete n[e];return{...n,...t}}function Ae(e){let t=new Map,n=(e,r)=>{for(let i of e){r&&t.set(i.id,r);for(let e of i.nodeIds)t.set(e,i.id);n(i.children,i.id)}};n(e.subgraphs);let r=(e,n)=>{for(let r=t.get(e);r!==void 0;r=t.get(r))if(r===n)return!0;return!1},i=e.edges,a=i.map((e,t)=>t);return i.forEach(({source:e,target:t},n)=>{let o=a.indexOf(n),s=a.findIndex((n,a)=>{let s=i[n];return a<o&&(s.target===t&&r(e,s.source)||s.source===e&&r(t,s.target))});s!==-1&&(a.splice(o,1),a.splice(s,0,n))}),a}var je=`[top=12,left=12,bottom=12,right=12]`,Me=new WeakMap;function Ne(t){let n=Me.get(t);return n||(n=We(t.subgraphs)?new Set:Ee(t)?(0,e.subgraphFeedbackEdges)(t):(0,e.findBackEdgeIndexes)(t,void 0,(0,e.subgraphFeedbackEdges)(t)),Me.set(t,n)),n}function Pe(e,t){for(let n=0;n<e.edges.length;n++){let r=e.edges[n];if(t.has(r.source)||t.has(r.target))return n}return 1/0}function Fe(e){return le(e,ce.flowchart)}function Ie(e){return{...de(e),"elk.spacing.edgeEdge":`12`,"elk.layered.spacing.edgeEdgeBetweenLayers":`12`,"elk.layered.spacing.edgeNodeBetweenLayers":`12`,"elk.layered.nodePlacement.bk.fixedAlignment":`BALANCED`,"elk.contentAlignment":`H_CENTER V_CENTER`}}function Le(e){return{fontSize:e.fontSizes.edgeLabel,layoutOptions:pe}}var Re=136,ze=120,Be={rectangle:32,rounded:30,stadium:52,subroutine:44,cylinder:24,"horizontal-cylinder":28.8,hexagon:85.7,asymmetric:54,parallelogram:69,"parallelogram-alt":69,trapezoid:69,"trapezoid-alt":114,document:32,"stacked-document":52,"stacked-process":52,card:56,"lined-process":40,"divided-process":16,"window-pane":42,flag:32,"bow-tie-rectangle":37.6,"half-rounded-rectangle":38.4,brace:31.8,"brace-right":46,braces:48.5,"notched-pentagon":32,"sloped-rectangle":32,text:15},Ve=40;function He(t,n,r,i,a,o,s=!1,c=!1){if(a!==void 0)return{width:80,height:80};let l=(0,e.measureMultilineText)(n,i,P.nodeLabel),u=!s&&!c;u&&(l.height=l.lines.length*i*1.5);let d=l.width+F.horizontal*2,f=l.height+(u?24:F.vertical*2);if(r===`diamond`){let e=Math.max(d,f)+F.diamondExtra;d=e,f=e}if(r===`circle`||r===`doublecircle`){let e=Math.ceil(Math.sqrt(d*d+f*f))+8;d=r===`doublecircle`?e+12:e,f=d}if(r===`hexagon`&&(d+=F.horizontal),(r===`trapezoid`||r===`trapezoid-alt`||r===`parallelogram`||r===`parallelogram-alt`)&&(d+=F.horizontal),r===`asymmetric`&&(d+=12),r===`cylinder`&&(f+=14),r===`cloud`){let e=s||c?Math.max(d,f*2.5):Math.max(l.width,ze)+15;return{width:e*1.25,height:f+e*.48}}if(r===`small-circle`)return{width:14,height:14};if(r===`fork-bar`)return o===`LR`||o===`RL`?{width:10,height:70}:{width:70,height:10};if(r===`state-start`||r===`state-end`)return{width:14,height:14};if(r===`junction`)return{width:2,height:2};if(n===``&&r===`diamond`)return{width:28,height:28};if(n===``&&r===`fork-join`)return{width:70,height:10};if(!s&&!c){let e=Math.max(l.width,ze),t=Be[r];t===void 0?r===`tagged-rectangle`?d=e+32+.2*f:(r===`diamond`||r===`triangle`||r===`flipped-triangle`)&&(d=e+l.height+30,f=d):d=e+t}return d=Math.max(d,s?Re:60),f=Math.max(f,s?Ve:36),{width:d,height:f}}var Ue=` root`;function We(e){for(let t of e)if(t.direction!==void 0||We(t.children))return!0;return!1}function Ge(e,t){for(let n of e.nodeIds)t.add(n);for(let n of e.children)Ge(n,t)}function Ke(e){let t=new Map;function n(e,r){let i=[...r,e.id];t.set(e.id,i);for(let t of e.children)n(t,i)}for(let t of e)n(t,[]);return t}function qe(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;return n}function Je(e,t){let n=t,r=new Set,i=new Set;for(let t of e.subgraphs)i.add(t.id),Xe(t,r,i);let a=Ze(e.subgraphs),o=Ke(e.subgraphs),s=e=>e?o.get(e)??[]:[],c=new Map;c.set(null,[]);let l=[];for(let t=0;t<e.edges.length;t++){let n=e.edges[t],r=a.get(n.source),i=a.get(n.target);if(r&&r===i){let e=c.get(r)??[];c.set(r,e),e.push({index:t,edge:n})}else!r&&!i?c.get(null).push({index:t,edge:n}):l.push({index:t,edge:n,srcChain:s(r),tgtChain:s(i)})}let u=We(e.subgraphs),d=[],f=[],p={...ke(Ie({direction:Fe(e.direction),nodeSpacing:n.nodeSpacing,layerSpacing:ve(e)&&n.layerSpacing===ae.layerSpacing?40:n.layerSpacing,padding:n.padding}),De(e,n,`root`)),...Ee(e)?{}:{"elk.layered.thoroughness":String(ae.thoroughness)},"elk.layered.highDegreeNodes.treatment":`false`,"elk.layered.compaction.postCompaction.strategy":e.subgraphs.length===0||Ce(e)||Ee(e)?`NONE`:`LEFT_RIGHT_CONSTRAINT_LOCKING`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,...Ee(e)?{"elk.layered.cycleBreaking.strategy":`DEPTH_FIRST`}:{},...Ce(e)&&(Ee(e)&&e.subgraphs.length>0||ve(e)||n.legacyNodeSizes)?{"elk.spacing.edgeEdge":Ee(e)?n.legacyNodeSizes?`50`:`70`:`40`}:{},...ve(e)?_e:{},"elk.layered.wrapping.strategy":`OFF`,"elk.hierarchyHandling":u?`SEPARATE`:`INCLUDE_CHILDREN`},m=new Map,h=new Map;function g(e,t){let n=m.get(e)??new Set;m.set(e,n),n.add(t)}function _(e,t){let n=h.get(e)??[];h.set(e,n),n.push(t)}if(u)for(let{index:e,edge:t,srcChain:r,tgtChain:i}of l){let a=qe(r,i),o=t.source;if(r.length>a){for(let n=r.length-1;n>=a;n--){let i=r[n],a=`${i}_out_${e}`;g(i,a);let o=n===r.length-1?t.source:`${r[n+1]}_out_${e}`;_(i,{id:`e${e}_s${n}`,sources:[o],targets:[a]})}o=`${r[a]}_out_${e}`}let s=t.target;if(i.length>a){for(let n=a;n<=i.length-1;n++){let r=i[n],a=`${r}_in_${e}`;g(r,a);let o=n===i.length-1?t.target:`${i[n+1]}_in_${e}`;_(r,{id:`e${e}_t${n}`,sources:[a],targets:[o]})}s=`${i[a]}_in_${e}`}_(a>0?r[a-1]:Ue,he({id:`e${e}`,source:o,target:s,label:t.label,labelStyle:Le(n)}))}for(let[t,a]of e.nodes)if(!r.has(t)&&!i.has(t)){let r=fe(t,He(t,a.label,a.shape,n.fontSizes.nodeLabel,a.icon,e.direction,ve(e),n.legacyNodeSizes),a.label),i=ve(e)?ge[a.shape]:void 0;i!==void 0&&(r.layoutOptions={"elk.layered.layering.layerConstraint":i}),d.push(r)}let v=ve(e),y=d.length,b=v?e.subgraphs:[...e.subgraphs].reverse();for(let t of b)d.push(Ye(t,e,n,c,m,h,e.direction));if(Ee(e)&&d.unshift(...d.splice(y)),v&&e.subgraphs.length>0){let t=d.map((t,n)=>{if(n<y)return Pe(e,new Set([t.id]));let r=e.subgraphs[n-y],i=Pe(e,new Set([r.id]));if(i!==1/0)return i;let a=new Set;return Ge(r,a),Pe(e,a)}),n=d.map((e,t)=>t).sort((e,n)=>t[e]-t[n]||e-n).map(e=>d[e]);d.splice(0,d.length,...n)}let x=Ne(e),S=Ee(e)&&!u,C=c.get(null);if(S)for(let t of Ae(e)){let r=e.edges[t];f.push(he({id:`e${t}`,source:x.has(t)?r.target:r.source,target:x.has(t)?r.source:r.target,label:r.label,labelStyle:Le(n)}))}for(let{index:e,edge:t}of S?[]:C)t.source!==t.target&&f.push(he({id:`e${e}`,source:x.has(e)?t.target:t.source,target:x.has(e)?t.source:t.target,label:t.label,labelStyle:Le(n)}));if(u)for(let e of h.get(Ue)??[])f.push(e);else for(let{index:e,edge:t}of S?[]:l)f.push(he({id:`e${e}`,source:x.has(e)?t.target:t.source,target:x.has(e)?t.source:t.target,label:t.label,labelStyle:Le(n)}));return{id:`root`,layoutOptions:p,children:d,edges:f}}function Ye(t,n,r,i,a,o,s){let c=t.direction!==void 0&&(0,e.subgraphDirectionIsHonored)(t,n)?t.direction:s,l=ke(Ie({direction:Fe(c),nodeSpacing:r.nodeSpacing,layerSpacing:ve(n)&&r.layerSpacing===ae.layerSpacing?24:r.layerSpacing,padding:t.region?Se:ve(n)?ye:Ee(n)?be:xe}),De(n,r,`subgraph`));if(Ee(n)&&!t.region){let n=(0,e.measureMultilineText)(t.label,r.fontSizes.groupHeader,P.groupHeader).width+24;l[`elk.nodeSize.constraints`]=`[MINIMUM_SIZE]`,l[`elk.nodeSize.minimum`]=c===`TD`||c===`TB`||c===`BT`?`(0, ${n})`:`(${n}, 0)`}t.children.some(e=>e.region)&&(l[`elk.algorithm`]=`org.eclipse.elk.rectpacking`),Ee(n)&&(l[`elk.layered.cycleBreaking.strategy`]=`DEPTH_FIRST`,l[`elk.spacing.portsSurrounding`]=je);let u,d=a.get(t.id);d&&d.size>0&&(u=[...d].map(e=>({id:e})));let f=[],p=Ee(n),m=p?[...n.nodes.keys()].filter(e=>t.nodeIds.includes(e)):t.nodeIds;for(let e of m){let t=n.nodes.get(e);if(t){let i=fe(e,He(e,t.label,t.shape,r.fontSizes.nodeLabel,t.icon,n.direction,ve(n),r.legacyNodeSizes),t.label);f.push(i)}}let h=t.children.some(e=>e.region)?t.children:[...t.children].reverse(),g=f.length;for(let e of h)f.push(Ye(e,n,r,i,a,o,c));p&&f.unshift(...f.splice(g));let _=[],v=i.get(t.id)??[],y=Ne(n);for(let{index:e,edge:t}of Ee(n)&&!We(n.subgraphs)?[]:v)t.source!==t.target&&_.push(he({id:`e${e}`,source:y.has(e)?t.target:t.source,target:y.has(e)?t.source:t.target,label:t.label,labelStyle:Le(r)}));for(let e of o.get(t.id)??[])_.push(e);return{id:t.id,layoutOptions:l,labels:t.label?[{text:t.label}]:void 0,ports:u,children:f,edges:_}}function Xe(e,t,n){for(let n of e.nodeIds)t.add(n);for(let r of e.children)n.add(r.id),Xe(r,t,n)}function Ze(e){let t=new Map;function n(e){for(let n of e.nodeIds)t.set(n,e.id);for(let t of e.children)n(t)}for(let t of e)n(t);return t}function Qe(e,t,n){if(e.length<2||t.shape===`rectangle`||t.shape===`rounded`||t.shape===`stadium`)return e;let r=[...e];if(t.shape===`diamond`){if(n)r[0]=$e(e[0],e[1],t);else{let n=e.length-1;r[n]=$e(e[n],e[n-1],t)}}if(t.shape===`asymmetric`){let i=n?0:e.length-1,a=e[i],o=t.height/2,s=Math.abs(a.y-(t.y+o));Math.abs(a.x-t.x)<.5&&s<o&&(r[i]={x:t.x+12*(1-s/o),y:a.y})}return r}function $e(e,t,n){let r=n.x+n.width/2,i=n.y+n.height/2,a={x:r,y:n.y},o={x:n.x+n.width,y:i},s={x:r,y:n.y+n.height},c={x:n.x,y:i},l=e.x-t.x,u=e.y-t.y;if(Math.abs(l)<Math.abs(u)){let t=e.x;return u>0?t<=r?tt(t,c,a)??a:tt(t,a,o)??a:t<=r?tt(t,s,c)??s:tt(t,o,s)??s}{let t=e.y;return l>0?t<=i?et(t,a,c)??c:et(t,c,s)??c:t<=i?et(t,a,o)??o:et(t,o,s)??o}}function et(e,t,n){let r=n.y-t.y;if(Math.abs(r)<.001)return null;let i=(e-t.y)/r;return i<0||i>1?null:{x:t.x+i*(n.x-t.x),y:e}}function tt(e,t,n){let r=n.x-t.x;if(Math.abs(r)<.001)return null;let i=(e-t.x)/r;return i<0||i>1?null:{x:e,y:t.y+i*(n.y-t.y)}}var nt=12;function rt(e,t,n){if(e.length===0)return;let r=n===`LR`||n===`RL`,i=new Set;for(let e of t)i.add(`${e.source}:${e.target}`),i.add(`${e.target}:${e.source}`);let a=ae.layerSpacing*.6,o=[...e].sort((e,t)=>r?e.x-t.x:e.y-t.y),s=[],c=[o[0]];for(let e=1;e<o.length;e++){let t=(r?o[e].x:o[e].y)-(r?o[e-1].x:o[e-1].y),n=c.some(t=>i.has(`${t.id}:${o[e].id}`));t<=a&&!n?c.push(o[e]):(s.push(c),c=[o[e]])}s.push(c);let l=new Map;for(let e of s){if(e.length<=1)continue;let t=e.map(e=>r?e.x:e.y),n=Math.min(...t),i=Math.max(...t);if(i-n<=1)continue;let a=(n+i)/2;for(let t of e){let e=a-(r?t.x:t.y);Math.abs(e)>.5&&(r?t.x=a:t.y=a,l.set(t.id,e))}}l.size!==0&&it(t,l,r?`x`:`y`)}function it(e,t,n){let r=(e,t,r,i)=>{let a=e[t],o=a[n];a[n]+=i;let[s,c,l]=[1,2,3].map(n=>e[t+n*r]);if(s[n]===o)s[n]+=i;else if(c&&l&&c[n]===s[n]){let e=Math.sign(s[n]-o),t=s[n]+e*Math.max(0,nt-e*(s[n]-a[n]));e*(l[n]-t)>0&&(s[n]=c[n]=t)}};for(let n of e){let{points:e}=n;if(e.length<2)continue;let i=t.get(n.source),a=t.get(n.target);i!=null&&r(e,0,1,i),a!=null&&r(e,e.length-1,-1,a)}}var at=.5;function ot(e,t,n){for(let r=0;r<e.length-1;r++){let i=e[r],a=e[r+1],o=Math.min(i.x,a.x),s=Math.max(i.x,a.x),c=Math.min(i.y,a.y),l=Math.max(i.y,a.y);for(let e of t){if(n.has(e.id))continue;let t=e.x+at,r=e.x+e.width-at,i=e.y+at,a=e.y+e.height-at;if(!(t>=r||i>=a)&&o<r&&s>t&&c<a&&l>i)return!1}}return!0}function st(e,t,n){let r=[];for(let i of n)e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height&&(r.push(i),r.push(...st(e,t,i.children)));return r}function ct(e,t,n,r,i){let a=i===`LR`,o=i===`RL`,s=i===`BT`,c=a||o,l=new Set(st(t,n,r).map(e=>e.id)),u=st(c?e:t,c?n:e,r).find(e=>!l.has(e.id));return u?a?u.x-12:o?u.x+u.width+12:s?u.y+u.height+12:u.y-12:e}var lt=2;function ut(e,t,n,r,i){for(let a of e){if(t.has(a)||a.source===a.target)continue;let e=a.source===n?a.points[0]:a.target===n?a.points[a.points.length-1]:void 0;if(e&&Math.abs((i?e.x:e.y)-r)<=lt)return!0}return!1}function dt(e,t,n,r){let i=new Map(t.map(e=>[e.id,e])),a=new Set,o=new Map,s=e=>`${e.source}\0${e.target}`;for(let t of e)o.set(s(t),(o.get(s(t))??0)+1);let c=e=>o.get(s(e))>1,l=r===`LR`,u=r===`RL`,d=r===`BT`,f=l||u,p=new Map;for(let t of e){if(t.source===t.target||c(t))continue;let e=p.get(t.source)??[];p.set(t.source,e),e.push(t)}for(let[o,s]of p){if(s.length<2)continue;let c=s[0].style;if(s.some(e=>e.label||e.style!==c))continue;let p=i.get(o);if(!p)continue;let m=[];for(let e of s){let t=i.get(e.target);t&&(l?t.x>p.x+p.width:u?t.x+t.width<p.x:d?t.y+t.height<p.y:t.y>p.y+p.height)&&m.push({edge:e,node:t})}if(m.length<2)continue;let h=p.x+p.width/2,g=p.y+p.height/2;if(f){let i=l?p.x+p.width:p.x,s=g;if(ut(e,new Set(m.map(e=>e.edge)),o,i,!0))continue;let c=i+((l?Math.min(...m.map(e=>e.node.x)):Math.max(...m.map(e=>e.node.x+e.node.width)))-i)/2;c=ct(c,h,g,n,r);let u=[];for(let{edge:e,node:n}of m){let r=l?n.x:n.x+n.width,a=n.y+n.height/2,d=[{x:i,y:s},{x:c,y:s},{x:c,y:a},{x:r,y:a}];ot(d,t,new Set([o,n.id]))&&u.push({edge:e,points:d})}if(u.length<2)continue;for(let{edge:e,points:t}of u)e.points=t,a.add(e)}else{let i=h,s=d?p.y:p.y+p.height;if(ut(e,new Set(m.map(e=>e.edge)),o,s,!1))continue;let c=s+((d?Math.max(...m.map(e=>e.node.y+e.node.height)):Math.min(...m.map(e=>e.node.y)))-s)/2;c=ct(c,h,g,n,r);let l=[];for(let{edge:e,node:n}of m){let r=n.x+n.width/2,a=d?n.y+n.height:n.y,u=[{x:i,y:s},{x:i,y:c},{x:r,y:c},{x:r,y:a}];ot(u,t,new Set([o,n.id]))&&l.push({edge:e,points:u})}if(l.length<2)continue;for(let{edge:e,points:t}of l)e.points=t,a.add(e)}}let m=new Map;for(let t of e){if(a.has(t)||t.source===t.target||c(t))continue;let e=m.get(t.target)??[];m.set(t.target,e),e.push(t)}for(let[a,o]of m){if(o.length<2)continue;let s=o[0].style;if(o.some(e=>e.label||e.style!==s))continue;let c=i.get(a);if(!c)continue;let p=[];for(let e of o){let t=i.get(e.source);t&&(l?t.x+t.width<c.x:u?t.x>c.x+c.width:d?t.y>c.y+c.height:t.y+t.height<c.y)&&p.push({edge:e,node:t})}if(p.length<2)continue;let m=c.x+c.width/2,h=c.y+c.height/2;if(f){let i=l?c.x:c.x+c.width,o=h;if(ut(e,new Set(p.map(e=>e.edge)),a,i,!0))continue;let s=l?Math.max(...p.map(e=>e.node.x+e.node.width)):Math.min(...p.map(e=>e.node.x)),u=s+(i-s)/2;u=ct(u,m,h,n,r);let d=[];for(let{edge:e,node:n}of p){let r=l?n.x+n.width:n.x,s=n.y+n.height/2,c=[{x:r,y:s},{x:u,y:s},{x:u,y:o},{x:i,y:o}];ot(c,t,new Set([n.id,a]))&&d.push({edge:e,points:c})}if(d.length<2)continue;for(let{edge:e,points:t}of d)e.points=t}else{let i=m,o=d?c.y+c.height:c.y;if(ut(e,new Set(p.map(e=>e.edge)),a,o,!1))continue;let s=d?Math.min(...p.map(e=>e.node.y)):Math.max(...p.map(e=>e.node.y+e.node.height)),l=s+(o-s)/2;l=ct(l,m,h,n,r);let u=[];for(let{edge:e,node:n}of p){let r=n.x+n.width/2,s=[{x:r,y:d?n.y:n.y+n.height},{x:r,y:l},{x:i,y:l},{x:i,y:o}];ot(s,t,new Set([n.id,a]))&&u.push({edge:e,points:s})}if(u.length<2)continue;for(let{edge:e,points:t}of u)e.points=t}}}var ft=1.5,pt=.01;function mt(e){let t=e.map(e=>({...e})),n=0;for(;n+3<t.length;){let[e,r,i,a]=[t[n],t[n+1],t[n+2],t[n+3]],o=Math.abs(e.x-r.x)<pt&&Math.abs(i.x-a.x)<pt&&Math.abs(r.y-i.y)<pt&&Math.abs(r.x-i.x)<=ft&&Math.abs(r.x-i.x)>=pt,s=Math.abs(e.y-r.y)<pt&&Math.abs(i.y-a.y)<pt&&Math.abs(r.x-i.x)<pt&&Math.abs(r.y-i.y)<=ft&&Math.abs(r.y-i.y)>=pt;if(o){let r=(e.x+a.x)/2;t.splice(n,4,{x:r,y:e.y},{x:r,y:a.y})}else if(s){let r=(e.y+a.y)/2;t.splice(n,4,{x:e.x,y:r},{x:a.x,y:r})}else n++}return t}function ht(e,t=0,n=0){let r=[];if(!e.sections||e.sections.length===0)return r;let i=e.sections[0];if(r.push({x:i.startPoint.x+t,y:i.startPoint.y+n}),i.bendPoints)for(let e of i.bendPoints)r.push({x:e.x+t,y:e.y+n});return r.push({x:i.endPoint.x+t,y:i.endPoint.y+n}),r}function gt(e,t=0,n=0){if(!e.labels||e.labels.length===0)return;let r=e.labels[0];if(r.x!=null&&r.y!=null)return{x:r.x+(r.width??0)/2+t,y:r.y+(r.height??0)/2+n}}var _t=20,vt=4,yt=24,bt={width:8,height:6};function xt(e,t,n){let r=t===`TD`||t===`TB`||t===`BT`,i=t===`BT`||t===`RL`,a=n.length,o=r?e.height:e.width,s=r?e.y+e.height/2:e.x+e.width/2,c=r?e.x:e.y,l=Math.max(o-yt,8)/(2*a+1),u=0;return n.map((t,n)=>{u+=_t;let a=c-u,o=l*(2*n+1)/2,[d,f]=i?[s+o,s-o]:[s-o,s+o],p=(e,t)=>r?{x:e,y:t}:{x:t,y:e},m=e.shape===`diamond`||e.shape===`asymmetric`?c+(r?e.width:e.height)/2:c,h=[p(m,d),p(a,d),p(a,f),p(m,f)],g=p(a,s),_=a;if(t){let e=r?t.width:t.height;g=p(a-vt-e/2,s),_=a-vt-e,u+=e+vt}let v=t?(r?t.height:t.width)/2:0,y=Math.min(d,f,s-v);return{points:h,labelPosition:g,minX:r?_:y,minY:r?y:_}})}function St(t,n,r,i=M.edgeLabel){let a=1/0,o=1/0,s=new Map;t.edges.forEach((e,t)=>{e.source!==e.target||!n.has(e.source)||s.set(e.source,[...s.get(e.source)??[],t])});for(let[c,l]of s){let s=xt(n.get(c),t.direction,l.map(n=>{let r=t.edges[n].label;if(!r)return;let a=(0,e.measureMultilineText)(r,i,P.edgeLabel);return{width:a.width+bt.width,height:a.height+bt.height}}));l.forEach((e,n)=>{let i=t.edges[e],{points:c,labelPosition:l,...u}=s[n];a=Math.min(a,u.minX),o=Math.min(o,u.minY),r.push({source:i.source,target:i.target,label:i.label,style:i.style,hasArrowStart:i.hasArrowStart,hasArrowEnd:i.hasArrowEnd,points:c,labelPosition:i.label?l:void 0,inlineStyle:It(e,t),headColor:Ft(t),id:i.id,animate:i.animate,startMarker:i.startMarker,endMarker:i.endMarker})})}return{minX:a,minY:o}}function Ct(e,t,n,r,i){let a=e=>{e.x+=r,e.y+=i};for(let t of e)a(t);for(let e of t)e.points.forEach(a),e.labelPosition&&a(e.labelPosition);let o=e=>{for(let t of e)a(t),o(t.children)};o(n)}function wt(e){let t=[];for(let n of e)t.push({x:n.x,y:n.y,right:n.x+n.width,bottom:n.y+n.height}),t.push(...wt(n.children));return t}function Tt(e,t,n=!1,r){let i=[],a=[],o=[],s=new Set;for(let e of t.subgraphs)Pt(e,s);Et(e,t,s,i,o,0,0);let c=wt(o);kt(e,t,a,0,0,c.length>0?{leftX:Math.min(...c.map(e=>e.x))-20,rightX:Math.max(...c.map(e=>e.right))+20}:void 0),rt(i,a,t.direction);let l=new Map(i.map(e=>[e.id,e])),u=St(t,l,a,r),d=Math.max(0,ae.padding-u.minX),f=Math.max(0,ae.padding-u.minY);(d>0||f>0)&&Ct(i,a,o,d,f),n&&dt(a,i,o,t.direction);for(let e of a){e.points=mt(e.points);let t=l.get(e.source),n=l.get(e.target);t&&(e.points=Qe(e.points,t,!0)),n&&(e.points=Qe(e.points,n,!1))}let p=(e.width??800)+d,m=(e.height??600)+f,h=re.width,g=ae.padding;for(let e of a){for(let t of e.points)p=Math.max(p,t.x+h+g),m=Math.max(m,t.y+h+g);e.labelPosition&&(p=Math.max(p,e.labelPosition.x+60+g),m=Math.max(m,e.labelPosition.y+20+g))}return{width:p,height:m,nodes:i,edges:a,groups:o}}function Et(t,n,r,i,a,o,s){if(t.children)for(let c of t.children){let t=(c.x??0)+o,l=(c.y??0)+s,u=c.width??0,d=c.height??0;if(r.has(c.id)){let o=[];Et(c,n,r,i,o,t,l);let s=Nt(n.subgraphs,c.id);a.push({id:c.id,label:s?.label??``,x:t,y:l,width:u,height:d,children:o,...(0,e.groupStyle)(c.id,n),...s?.region?{region:!0}:{},...s?.icon?{icon:s.icon}:{}})}else{let o=n.nodes.get(c.id);if(o){let r=(0,e.resolveNodeStyle)(c.id,n),a=n.classAssignments.get(c.id);i.push({id:c.id,label:o.label,shape:o.icon===void 0?o.shape:`rectangle`,icon:o.icon,x:t,y:l,width:u,height:d,inlineStyle:r,className:a,interaction:n.interactions.get(c.id)})}c.children&&c.children.length>0&&Et(c,n,r,i,a,t,l)}}}function Dt(e){let t=/^e(\d+)$/.exec(e);if(t)return{edgeIndex:parseInt(t[1],10),role:`bridge`};let n=/^e(\d+)_([st])(\d+)$/.exec(e);if(n)return{edgeIndex:parseInt(n[1],10),role:n[2]===`s`?`source`:`target`,level:parseInt(n[3],10)}}function Ot(e){if(e.length===0)return{x:0,y:0};if(e.length===1)return e[0];let t=0;for(let n=1;n<e.length;n++){let r=e[n].x-e[n-1].x,i=e[n].y-e[n-1].y;t+=Math.sqrt(r*r+i*i)}let n=t/2;for(let t=1;t<e.length;t++){let r=e[t].x-e[t-1].x,i=e[t].y-e[t-1].y,a=Math.sqrt(r*r+i*i);if(n<=a){let o=n/a;return{x:e[t-1].x+o*r,y:e[t-1].y+o*i}}n-=a}return e[e.length-1]}function kt(e,t,n,r,i,a){let o=new Map;At(e,o,0,0);let s=new Map;Mt(e,s,0,0,o);let c=0;for(let[e,r]of s){let i=t.edges[e];if(!i||i.source===i.target)continue;let o=[],s=e=>{!e||e.points.length===0||(o.length>0?o.push(...e.points.slice(1)):o.push(...e.points))},l=[...r.sourceHops.keys()].sort((e,t)=>t-e);for(let e of l)s(r.sourceHops.get(e));s(r.bridge);let u=[...r.targetHops.keys()].sort((e,t)=>e-t);for(let e of u)s(r.targetHops.get(e));let d;i.label&&o.length>=2&&(d=r.bridge?.labelPosition??Ot(o));let f=jt(o,a,c);f!==o&&c++,i.label&&f!==o&&f.length>=2&&(d=Ot(f)),n.push({source:i.source,target:i.target,label:i.label,style:i.style,hasArrowStart:i.hasArrowStart,hasArrowEnd:i.hasArrowEnd,points:Ne(t).has(e)?[...f].reverse():f,labelPosition:d,inlineStyle:It(e,t),headColor:Ft(t),id:i.id,animate:i.animate,startMarker:i.startMarker,endMarker:i.endMarker})}}function At(e,t,n,r){t.set(e.id,{x:n,y:r});for(let i of e.children??[]){let e=i.x??0,a=i.y??0;At(i,t,n+e,r+a)}}function jt(e,t,n=0){if(e.length<2)return e;let r=!1;for(let t=1;t<e.length;t++){let n=Math.abs(e[t].x-e[t-1].x),i=Math.abs(e[t].y-e[t-1].y);if(n>1&&i>1){r=!0;break}}if(!r)return e;let i=[e[0]];for(let r=1;r<e.length;r++){let a=i[i.length-1],o=e[r],s=Math.abs(o.x-a.x),c=Math.abs(o.y-a.y);if(s>1&&c>1){if(t){let e=n%2==0,r=Math.floor(n/2)*12,s=e?t.rightX+r:t.leftX-r;i.push({x:s,y:a.y}),i.push({x:s,y:o.y})}else{let e=(a.y+o.y)/2;i.push({x:a.x,y:e}),i.push({x:o.x,y:e})}}i.push(o)}return i}function Mt(e,t,n,r,i){if(e.edges)for(let a of e.edges){let e=Dt(a.id);if(!e)continue;let{edgeIndex:o}=e,s=a.container,c=s?i.get(s):void 0,l=c?.x??n,u=c?.y??r,d=ht(a,l,u),f=gt(a,l,u),p=t.get(o)??{sourceHops:new Map,targetHops:new Map};t.set(o,p);let m={edgeIndex:o,points:d,labelPosition:f};e.role===`bridge`?p.bridge=m:e.role===`source`?p.sourceHops.set(e.level,m):p.targetHops.set(e.level,m)}if(e.children)for(let a of e.children)Mt(a,t,n+(a.x??0),r+(a.y??0),i)}function Nt(e,t){for(let n of e){if(n.id===t)return n;let e=Nt(n.children,t);if(e)return e}}function Pt(e,t){t.add(e.id);for(let n of e.children)Pt(n,t)}function Ft(e){return It(-1,e)?.stroke}function It(t,n){let r,i=n.linkStyles.get(`default`);i&&(r={...i});let a=n.linkStyles.get(t);return a&&(r=r?{...r,...a}:{...a}),r&&(0,e.dropInvalidColors)(r)}var Lt=e=>e===`TD`||e===`TB`||e===`BT`,Rt=8;function zt(e,t,n,r){let i=Lt(r)?`y`:`x`,a=i===`x`?`y`:`x`,o=i===`x`?`width`:`height`,s=i===`x`?`height`:`width`;for(let{points:r}of e)for(let e=1;e<r.length-1;){let c=e;for(;c+1<r.length-1&&r[c+1][i]===r[e][i];)c++;let l=r.slice(e,c+1),u=l[0],d=Math.min(...l.map(e=>e[a])),f=Math.max(...l.map(e=>e[a])),p=r[e-1][i],m=r[c+1][i],h=n.flatMap(e=>[e[i],e[i]+e[o]].map(t=>({g:e,s:t}))).find(({g:e,s:t})=>Math.abs(u[i]-t)<Rt&&f>e[a]&&d<e[a]+e[s]);if(h){let e=h.s+(u[i]>=h.s?Rt:-8),n=(e-p)*(m-e)>0,r=t.every(t=>t[i]+t[o]<=e||t[i]>=e||t[a]+t[s]<=d||t[a]>=f);if(n&&r)for(let t of l)t[i]=e}e=c+1}}var Bt=12,Vt=8,Ht=4;function Ut(t,n,r){let i=t.map(e=>({axis:e.axis,cross:e.cross,before:e.before??0,rank:0,real:!0})),a=t.map(()=>[]),o=t.map(()=>[]),s=n.flatMap((e,t)=>e.from===e.to?[]:[t]),c=(0,e.findBackEdges)(s.map(e=>({source:String(n[e].from),target:String(n[e].to)})),t.map((e,t)=>String(t))),l=s.map((e,t)=>{let r=n[e];return c.has(t)?{index:e,u:r.to,v:r.from,reversed:!0}:{index:e,u:r.from,v:r.to,reversed:!1}}),u=t.map(()=>[]),d=t.map(()=>0);for(let e of l)u[e.u].push(e.v),d[e.v]++;let f=d.flatMap((e,t)=>e===0?[t]:[]);for(let e=0;e<f.length;e++){let t=f[e];for(let e of u[t])i[e].rank=Math.max(i[e].rank,i[t].rank+2),--d[e]===0&&f.push(e)}let p=l.map(e=>{let t=(i[e.v].rank-i[e.u].rank)/2,r=i[e.u].rank+2*Math.floor(t/2)+1,s=n[e.index].label,c=[e.u];for(let t=i[e.u].rank+1;t<i[e.v].rank;t++){let e=i.length,n=t===r&&s!==void 0;i.push({axis:n?s.axis:0,cross:n?s.cross:0,before:0,rank:t,real:!1}),a.push([]),o.push([]),c.push(e)}c.push(e.v);for(let e=1;e<c.length;e++)o[c[e-1]].push(c[e]),a[c[e]].push(c[e-1]);return{chain:c,labelRank:r}}),m=i.map((e,t)=>t),h=e=>{let t=e;for(;m[t]!==t;)t=m[t]=m[m[t]];return t};for(let{chain:e}of p)for(let t of e)m[h(t)]=h(e[0]);let g=new Map;i.forEach((e,t)=>{let n=h(t);g.set(n,[...g.get(n)??[],t])});let _=i.map(()=>0),v=[],y=[];for(let e of g.values()){let t=Wt(e,i,a,o,r),n=1/0,s=-1/0;for(let r of e)_[r]=t.get(r),n=Math.min(n,_[r]-i[r].cross/2-i[r].before),s=Math.max(s,_[r]+i[r].cross/2);v.push({min:n,max:s}),y.push(e)}let b=0;y.forEach((e,t)=>{let n=b-v[t].min;for(let t of e)_[t]=_[t]+n;b+=v[t].max-v[t].min+r.nodeSep});let x=Math.max(0,b-r.nodeSep),S=i.reduce((e,t)=>Math.max(e,t.rank),0),C=Array(S+1).fill(0);for(let e of i)C[e.rank]=Math.max(C[e.rank],e.axis);let w=Array(S+1).fill(0);for(let e=1;e<=S;e++)w[e]=w[e-1]+C[e-1]+r.rankSep/2;let T=e=>w[i[e].rank]+C[i[e].rank]/2,E=n.map(()=>[]),D=n.map(()=>void 0);return l.forEach((e,t)=>{let{chain:r,labelRank:a}=p[t],o=r.slice(1,-1),s=o.map(e=>({axis:T(e),cross:_[e]}));if(E[e.index]=e.reversed?s.reverse():s,n[e.index].label){let t=o.find(e=>i[e].rank===a);D[e.index]={axis:T(t),cross:_[t]}}}),{nodes:t.map((e,t)=>({axis:w[i[t].rank]+(C[i[t].rank]-e.axis)/2,cross:_[t]-e.cross/2})),paths:E,labels:D,axisSize:w[S]+C[S],crossSize:x}}function Wt(e,t,n,r,i){let a=[],o=new Set,s=[...e].sort((e,n)=>t[e].rank-t[n].rank||e-n);for(let e of s){if(o.has(e))continue;let n=[{s:e,next:0}];for(o.add(e),(a[t[e].rank]??=[]).push(e);n.length>0;){let e=n[n.length-1],i=r[e.s][e.next++];i===void 0?n.pop():o.has(i)||(o.add(i),(a[t[i].rank]??=[]).push(i),n.push({s:i,next:0}))}}let c=a.filter(e=>e!==void 0),l=new Map,u=()=>c.forEach(e=>e.forEach((e,t)=>l.set(e,t))),d=()=>{let e=0;for(let t=0;t+1<c.length;t++){let n=c[t].flatMap(e=>r[e].map(t=>[l.get(e),l.get(t)]));for(let t=0;t<n.length;t++)for(let r=t+1;r<n.length;r++){let[i,a]=n[t],[o,s]=n[r];(i-o)*(a-s)<0&&e++}}return e};u();let f=c.map(e=>[...e]),p=d();for(let e=0;e<Vt&&p>0;e++){let t=e%2==0,i=c.map((e,t)=>t);t||i.reverse();for(let e of i){let i=t?n:r,a=e=>{let t=i[e];return t.length===0?l.get(e):t.reduce((e,t)=>e+l.get(t),0)/t.length},o=new Map(c[e].map(e=>[e,a(e)]));c[e].sort((e,t)=>o.get(e)-o.get(t)||l.get(e)-l.get(t)),c[e].forEach((e,t)=>l.set(e,t))}let a=d();a<p&&(p=a,f=c.map(e=>[...e]))}f.forEach((e,t)=>c[t]=e);let m=new Map,h=(e,n)=>(t[e].cross+t[n].cross)/2+t[n].before+(t[e].real&&t[n].real?i.nodeSep:Math.min(i.nodeSep,Bt)),g=(e,t)=>{let n=e.slice(1).map((t,n)=>h(e[n],t)),r=[0];n.forEach((e,t)=>r.push(r[t]+e)),Gt(e.map((e,n)=>{let i=(t[e]??[]).filter(e=>m.has(e));return(i.length===0?m.get(e)??0:i.reduce((e,t)=>e+m.get(t),0)/i.length)-r[n]})).forEach((t,n)=>m.set(e[n],t+r[n]))};for(let e of c)g(e,[]);for(let e=0;e<Ht;e++){for(let e=1;e<c.length;e++)g(c[e],n);for(let e=c.length-2;e>=0;e--)g(c[e],r)}return m}function Gt(e){let t=[];for(let n of e)for(t.push({sum:n,count:1});t.length>1;){let e=t[t.length-1],n=t[t.length-2];if(n.sum/n.count<=e.sum/e.count)break;t.splice(-2,2,{sum:n.sum+e.sum,count:n.count+e.count})}return t.flatMap(e=>Array(e.count).fill(e.sum/e.count))}var Kt=20,qt=4,Jt=32;function Yt(t,n={}){let r={...ae,...n,fontSizes:N(n.fontSizes)},i=t.direction===`TB`||t.direction===`TD`||t.direction===`BT`,a=t.direction===`BT`||t.direction===`RL`,o=new Map,s=new Map,c=(e,t)=>{o.set(e.id,e),t!==void 0&&s.set(e.id,t);for(let t of e.nodeIds)s.has(t)||s.set(t,e.id);for(let t of e.children)c(t,e.id)};t.subgraphs.forEach(e=>c(e));let l=[...t.nodes.keys()].filter(e=>!o.has(e)),u=new Map(l.map((e,t)=>[e,t])),d=e=>Math.min(...e.nodeIds.map(e=>u.get(e)??1/0),...e.children.map(d)),f=e=>{let t=o.get(e);return t?d(t):u.get(e)??1/0},p=e=>[...l.filter(t=>s.get(t)===e),...(e===void 0?t.subgraphs:o.get(e).children).map(e=>e.id)].map((e,t)=>({id:e,i:t})).sort((e,t)=>f(e.id)-f(t.id)||e.i-t.i).map(e=>e.id),m=e=>{let t=[e];for(let n=s.get(e);n!==void 0;n=s.get(n))t.unshift(n);return t},h=n=>{let a=t.edges[n].label;if(!a)return;let o=(0,e.measureMultilineText)(a,r.fontSizes.edgeLabel,P.edgeLabel),s=o.width+8,c=o.height+6;return i?{axis:c,cross:s}:{axis:s,cross:c}},g=new Map,_=new Map;t.edges.forEach((e,t)=>{if(e.source===e.target){_.set(e.source,[..._.get(e.source)??[],t]);return}let n=m(e.source),r=m(e.target),i=0;for(;n[i]!==void 0&&n[i]===r[i];)i++;if(i>=n.length||i>=r.length)return;let a=i===0?``:n[i-1];g.set(a,[...g.get(a)??[],{index:t,from:n[i],to:r[i]}])});let v=i?a?{axisStart:xe.bottom,axisEnd:xe.top,crossStart:xe.left,crossEnd:xe.right}:{axisStart:xe.top,axisEnd:xe.bottom,crossStart:xe.left,crossEnd:xe.right}:{axisStart:a?xe.right:xe.left,axisEnd:a?xe.left:xe.right,crossStart:xe.top,crossEnd:xe.bottom},y=(e,t)=>i?{aSize:t,cSize:e}:{aSize:e,cSize:t},b=new Map;for(let e of l){let n=t.nodes.get(e),i=He(e,n.label,n.shape,r.fontSizes.nodeLabel,n.icon,t.direction,ve(t));b.set(e,y(i.width,i.height))}let x=e=>(_.get(e)??[]).reduce((e,t)=>{let n=h(t)?.cross;return e+Kt+(n===void 0?0:n+qt)},0),S=t=>{let n=p(t),a=new Map,s=new Map,c=new Map;for(let t of n){let n=o.get(t);if(!n){s.set(t,b.get(t));continue}let l=S(t);a.set(t,l);let u=(0,e.measureMultilineText)(n.label,r.fontSizes.groupHeader,P.groupHeader).width,d=l.axisSize+v.axisStart+v.axisEnd,f=l.crossSize+v.crossStart+v.crossEnd,p=i?0:u+Jt,m=i?u+Jt:0,h=Math.max(0,p-d),g=Math.max(0,m-f);d+=h,f+=g,s.set(t,{aSize:d,cSize:f}),c.set(t,{axis:v.axisStart+h/2,cross:v.crossStart+g/2})}let l=new Map(n.map((e,t)=>[e,t])),u=g.get(t??``)??[],d=Ut(n.map(e=>({axis:s.get(e).aSize,cross:s.get(e).cSize,before:x(e)})),u.map(e=>({from:l.get(e.from),to:l.get(e.to),label:h(e.index)})),{nodeSep:r.nodeSpacing,rankSep:r.layerSpacing}),f=new Map;return u.forEach((e,t)=>f.set(e.index,{mids:d.paths[t],label:d.labels[t]})),{members:n,at:new Map(n.map((e,t)=>[e,d.nodes[t]])),sizes:s,inset:{axis:0,cross:0},axisSize:d.axisSize,crossSize:d.crossSize,routes:f,inner:new Map([...a].map(([e,t])=>[e,{...t,inset:c.get(e)}]))}},C=S(void 0),w=new Map,T=new Map,E=(n,r,i)=>{for(let[e,t]of n.routes)T.set(e,{mids:t.mids.map(e=>({axis:e.axis+r,cross:e.cross+i})),label:t.label&&{axis:t.label.axis+r,cross:t.label.cross+i}});let a=[];for(let s of n.members){let c=n.at.get(s),l=n.sizes.get(s),u={axis:r+c.axis,cross:i+c.cross,...l};w.set(s,u);let d=n.inner.get(s);if(d){let n=o.get(s),r=E(d,u.axis+d.inset.axis,u.cross+d.inset.cross);a.push({id:s,label:n.label,x:0,y:0,width:0,height:0,children:r,...(0,e.groupStyle)(s,t),...n.region?{region:!0}:{},...n.icon?{icon:n.icon}:{}})}}return a},D=E(C,0,0),O=r.padding,k=C.axisSize,A=e=>{let t=a?k-e.axis:e.axis;return i?{x:e.cross+O,y:t+O}:{x:t+O,y:e.cross+O}},j=e=>{let t=a?k-e.axis-e.aSize:e.axis;return i?{x:e.cross+O,y:t+O,width:e.cSize,height:e.aSize}:{x:t+O,y:e.cross+O,width:e.aSize,height:e.cSize}},ee=e=>{for(let t of e)Object.assign(t,j(w.get(t.id))),ee(t.children)};ee(D);let M=l.map(n=>{let r=t.nodes.get(n);return{id:n,label:r.label,shape:r.icon===void 0?r.shape:`rectangle`,icon:r.icon,...j(w.get(n)),inlineStyle:(0,e.resolveNodeStyle)(n,t),className:t.classAssignments.get(n),interaction:t.interactions.get(n)}}),te=new Map(M.map(e=>[e.id,e])),ne=[];t.edges.forEach((e,n)=>{let r=T.get(n);if(!r)return;let i=w.get(e.source),a=w.get(e.target),o=i.axis>a.axis,[s,c]=o?[a,i]:[i,a],l=[{axis:s.axis+s.aSize,cross:s.cross+s.cSize/2},...o?[...r.mids].reverse():r.mids,{axis:c.axis,cross:c.cross+c.cSize/2}],u=[l[0]];for(let e of l.slice(1)){let t=u[u.length-1];if(t.cross!==e.cross){let n=(t.axis+e.axis)/2;u.push({axis:n,cross:t.cross},{axis:n,cross:e.cross})}u.push(e)}let d=mt(Xt(u.map(A)));o&&d.reverse();let f=te.get(e.source),p=te.get(e.target);f&&(d=Qe(d,f,!0)),p&&(d=Qe(d,p,!1)),ne.push({source:e.source,target:e.target,label:e.label,style:e.style,hasArrowStart:e.hasArrowStart,hasArrowEnd:e.hasArrowEnd,points:d,labelPosition:r.label&&A(r.label),inlineStyle:It(n,t),headColor:Ft(t),id:e.id,animate:e.animate,startMarker:e.startMarker,endMarker:e.endMarker})}),St(t,te,ne,r.fontSizes.edgeLabel);let F=(i?C.crossSize:C.axisSize)+O*2,I=(i?C.axisSize:C.crossSize)+O*2;for(let e of ne){for(let t of e.points)F=Math.max(F,t.x+re.width+O),I=Math.max(I,t.y+re.width+O);e.labelPosition&&(F=Math.max(F,e.labelPosition.x+60+O),I=Math.max(I,e.labelPosition.y+20+O))}return{width:F,height:I,nodes:M,edges:ne,groups:D}}function Xt(e){return e.filter((t,n)=>{let r=e[n-1],i=e[n+1];return!r||!i||!(r.x===t.x&&t.x===i.x||r.y===t.y&&t.y===i.y)})}function Zt(e,t={}){let n={...ae,...t,fontSizes:N(t.fontSizes)},r=e=>Tt(E(Je(e,n),t.layoutCache),e,n.mergeEdges,n.fontSizes.edgeLabel),i=r(e),a=new Map,o=e=>{for(let t of e)t.region&&a.set(t.id,t.width*t.height),o(t.children)};if(o(i.groups),a.size===0)return i;let s=e=>e.map(e=>{let t=s(e.children);return{...e,children:t.some(e=>e.region)?[...t].sort((e,t)=>a.get(e.id)-a.get(t.id)):t}});return r({...e,subgraphs:s(e.subgraphs)})}function Qt(e,t={}){let n=$t(e,t),r=new Set,i=new Set,a=e=>{for(let t of e)t.stateComposite&&r.add(t.id),!t.nodeIds.length&&!t.children.length&&i.add(t.id),a(t.children)};a(e.subgraphs);let o=e=>{for(let t of e)!t.region&&!r.has(t.id)&&(t.bandless=!0),t.bandless&&i.has(t.id)&&!t.architecture&&(t.titleOnly=!0),o(t.children)};return o(n.groups),e.stateDiagram&&(n.stateDiagram=!0),n}function $t(t,n){let r=(0,e.withoutOwnClusterEdges)(t);if(n.legacyNodeSizes&&r.subgraphs.length===0&&(r={...r},Te(r)),n.layout===`simple`&&!ve(r))return Yt(r,n);if(n.layout!==void 0&&n.layout!==`elk`&&n.layout!==`simple`)throw Error(`zombie-mermaid: unknown layout ${JSON.stringify(n.layout)}; use 'elk' or 'simple'.`);let i=Zt(r,n);if(Ee(r)){let e=t=>t.flatMap(t=>[t,...e(t.children)]);zt(i.edges,i.nodes,e(i.groups),r.direction)}return i}function en(e,t={}){return Je(e,{...ae,...t,fontSizes:N(t.fontSizes)})}var tn=2;function nn(e){return e.flatMap(e=>[e,...nn(e.children)])}function rn(t,n){let r=n.groupHeader+16;return nn(t).filter(e=>e.label!==``).map(t=>{let i=(0,e.measureMultilineText)(t.label,n.groupHeader,400);return{x:t.x+t.width/2-i.width/2-tn,y:t.y+(t.bandless?r:26)/2-i.height/2-tn,width:i.width+4,height:i.height+4}})}function an(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=[-r,r,-i,i],o=[e.x-n.x,n.x+n.width-e.x,e.y-n.y,n.y+n.height-e.y],s=0,c=1;for(let e=0;e<4;e++){let t=a[e],n=o[e];if(t===0){if(n<0)return!1}else{let e=n/t;if(t<0?s=Math.max(s,e):c=Math.min(c,e),s>c)return!1}}return!0}function on(e){return{x:e.x+tn,y:e.y+tn,width:e.width-4,height:e.height-4}}function sn(e,t){let n=e.points,r=t.map(on);for(let e=0;e+1<n.length;e++)if(r.some(t=>an(n[e],n[e+1],t)))return!0;return!1}function cn(e){let t=2166136261;for(let n of e.map(e=>`${e.x},${e.y},${e.width},${e.height}`).join(`;`))t=Math.imul(t^n.charCodeAt(0),16777619);return(t>>>0).toString(36)}function ln(e,t,n){let r=`zm-title-gap-${cn(e)}`;return{id:r,markup:` <mask id="${r}" maskUnits="userSpaceOnUse" x="0" y="0" width="${t}" height="${n}">\n <rect x="0" y="0" width="${t}" height="${n}" fill="#fff" />\n${e.map(e=>` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" fill="#000" />`).join(`
9
- `)}\n </mask>`}}function un(t,n,r=`Inter`,i=!1,a=M,o=`linear`,s,c=!0,l=!0,u,d,f={}){let p=[],m=l&&t.nodes.some(t=>!!(0,e.safeHref)(t.interaction?.href));p.push(R((0,e.svgOpenTag)(t.width,t.height,n,i,u,d,m,f.styleAttribute,f.description),s)),p.push((0,e.buildStyleBlock)(r,!1,f.nonce,f.bodyFont)),c&&t.edges.some(e=>e.animate)&&p.push(dn(f.nonce)),p.push(`<defs>`),p.push(fn(t.stateDiagram===!0));let h=new Set;for(let e of t.edges){let t=bn(e);t&&h.add(t)}for(let e of h)p.push(pn(e,t.stateDiagram===!0));let g=new Set;for(let e of t.edges)e.startMarker&&g.add(e.startMarker),e.endMarker&&g.add(e.endMarker);for(let e of g)p.push(_n(e));let _=rn(t.groups,a),v=new Set(t.edges.filter(e=>sn(e,_))),y;if(v.size>0){let e=ln(_,t.width,t.height);y=e.id,p.push(e.markup)}p.push(`</defs>`);for(let e of t.groups)p.push(Tn(e,r,a));for(let e of t.edges)p.push(En(e,o,c,v.has(e)?y:void 0,t.stateDiagram===!0));for(let e of t.edges)e.label&&p.push(Dn(e,r,a));for(let e of t.nodes)p.push(jn(e,r,a,l,t.stateDiagram===!0));return p.push(`</svg>`),p.join(`
10
- `)}function dn(t){return[(0,e.styleOpenTag)(t),` @keyframes zm-edge-dash { to { stroke-dashoffset: -28; } }`,` .edge-animated { animation: zm-edge-dash 1s linear infinite; }`,` @media (prefers-reduced-motion: reduce) {`,` .edge-animated { animation: none; }`,` }`,`</style>`].join(`
11
- `)}function fn(e){return hn(`var(--_arrow)`,``,e)}function pn(t,n){return hn((0,e.escapeAttr)(t),e.f`-${xn(t)}`,n)}var mn=3.5;function hn(t,n,r){if(r)return gn(t,n);let i=10.5,a=12.8,o=e.f`fill="${t}" stroke="${t}" stroke-width="0.75" stroke-linejoin="round"`,s=e.f`<polygon points="0 0, ${i} ${a/2}, 0 ${a}" ${o} />`,c=(t,n)=>e.f` <marker id="${t}" markerWidth="${i}" markerHeight="${a}" refX="${9.5}" refY="${a/2}" markerUnits="userSpaceOnUse" orient="${n}">`+e.f`\n ${s}`+`
8
+ }`;function k(t,n,r){return(0,e.measureTextWidth)(t,n,r)}function A(e,t){return e.length*t*.6}var j=`'JetBrains Mono'`,M=`${j}, 'SF Mono', 'Fira Code', ui-monospace, monospace`,N={nodeLabel:13,edgeLabel:11,groupHeader:12};function P(e){return{nodeLabel:e?.nodeLabel??N.nodeLabel,edgeLabel:e?.edgeLabel??N.edgeLabel,groupHeader:e?.groupHeader??N.groupHeader}}var F={nodeLabel:500,edgeLabel:400,groupHeader:600},ee=12,te=12,ne={horizontal:20,vertical:10,diamondExtra:24},I={outerBox:1,innerBox:.75,connector:1},L=`0.35em`,re={width:8,height:5};function ie(t,n,r,i){return(0,e.buildStyleBlock)(t,n?{family:D,faceCss:O}:!1,r,i)}var ae={font:`Inter`,padding:40,nodeSpacing:28,layerSpacing:48,mergeEdges:!1,thoroughness:3,fontSizes:N},oe=`#087ebf`,se={blank:``,database:`<path d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path><path d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path><path d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path><ellipse cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line>`,disk:`<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></rect><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"></path>`,server:`<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></rect><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"></path><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"></path></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"></path><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"></path></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"></path><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"></path></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle></g>`,cloud:`<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path>`,internet:`<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></circle><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line>`},ce=/<\/?(?:b|strong|i|em|u|s|del)\s*>/gi;function le(t,n,r){let i=t=>(0,e.measureTextWidth)(t.replace(ce,``),n,r),a=!1,o=[];for(let e of t.split(`
9
+ `)){let t=``;for(let n of e.split(` `).filter(Boolean)){let e=t?`${t} ${n}`:n;t&&i(e)>120?(o.push(t),t=n,a=!0):t=e}o.push(t)}return{text:o.join(`
10
+ `),wrapped:a}}var ue={flowchart:`DOWN`,state:`DOWN`,class:`DOWN`,er:`DOWN`,requirement:`DOWN`,c4:`DOWN`};function de(e,t){switch(e){case`LR`:return`RIGHT`;case`RL`:return`LEFT`;case`BT`:return`UP`;case`TD`:case`TB`:return`DOWN`;default:return t}}function fe(e){let t=typeof e==`number`?{top:e,left:e,bottom:e,right:e}:e;return`[top=${t.top},left=${t.left},bottom=${t.bottom},right=${t.right}]`}function pe(e){return{"elk.algorithm":`layered`,"elk.direction":e.direction,"elk.spacing.nodeNode":String(e.nodeSpacing),"elk.layered.spacing.nodeNodeBetweenLayers":String(e.layerSpacing),"elk.padding":fe(e.padding),"elk.edgeRouting":`ORTHOGONAL`}}function me(e,t,n){let r={id:e,width:t.width,height:t.height};return n!==void 0&&(r.labels=[{text:n}]),r}var he={"elk.edgeLabels.inline":`true`,"elk.edgeLabels.placement":`CENTER`};function ge(t,n){let r=(0,e.measureMultilineText)(t,n.fontSize,F.edgeLabel),i={text:t,width:r.width+8,height:n.lineHeight?r.lines.length*n.lineHeight:r.height+6};return n.layoutOptions&&(i.layoutOptions={...n.layoutOptions}),i}function _e(e){let t={id:e.id,sources:[e.source],targets:[e.target]};return e.label?t.labels=[ge(e.label,e.labelStyle)]:e.labelStyle.lineHeight&&(t.labels=[{text:``,width:0,height:0,layoutOptions:{...e.labelStyle.layoutOptions}}]),t}function R(e){for(let t of e.nodes.values())if(t.shape===`state-start`||t.shape===`state-end`)return!0;return!1}var ve={top:51,left:24,bottom:24,right:24},ye={top:51,left:24,bottom:24,right:24},be={top:44,left:16,bottom:16,right:16},xe={top:24,left:24,bottom:24,right:24};function Se(e){let t=new Map;for(let n of e.edges){if(!n.label)continue;let e=`${n.source}\0${n.target}`,r=(t.get(e)??0)+1;if(r>=3)return!0;t.set(e,r)}return!1}var Ce=new WeakSet;function we(e){Ce.add(e)}function Te(e){return R(e)||e.subgraphs.length>0||!Ce.has(e)}var Ee={"spacing.baseValue":`24`,"elk.spacing.nodeNode":`50`,"elk.layered.spacing.edgeNodeBetweenLayers":`30`,"elk.spacing.edgeEdge":`20`};function De(e,t,n){if(!(!Te(e)||t.nodeSpacing!==ae.nodeSpacing||t.layerSpacing!==ae.layerSpacing))return n===`root`?{"spacing.baseValue":`40`}:Ee}var Oe=[`elk.spacing.nodeNode`,`elk.layered.spacing.nodeNodeBetweenLayers`,`elk.spacing.edgeEdge`,`elk.layered.spacing.edgeEdgeBetweenLayers`,`elk.layered.spacing.edgeNodeBetweenLayers`,`elk.contentAlignment`];function ke(e,t){if(!t)return e;let n={...e};for(let e of Oe)delete n[e];return{...n,...t}}function Ae(e){let t=new Map,n=(e,r)=>{for(let i of e){r&&t.set(i.id,r);for(let e of i.nodeIds)t.set(e,i.id);n(i.children,i.id)}};n(e.subgraphs);let r=(e,n)=>{for(let r=t.get(e);r!==void 0;r=t.get(r))if(r===n)return!0;return!1},i=e.edges,a=i.map((e,t)=>t);return i.forEach(({source:e,target:t},n)=>{let o=a.indexOf(n),s=a.findIndex((n,a)=>{let s=i[n];return a<o&&(s.target===t&&r(e,s.source)||s.source===e&&r(t,s.target))});s!==-1&&(a.splice(o,1),a.splice(s,0,n))}),a}var je=`[top=12,left=12,bottom=12,right=12]`,Me=new WeakMap;function Ne(t){let n=Me.get(t);return n||(n=qe(t.subgraphs)?new Set:Te(t)?(0,e.subgraphFeedbackEdges)(t):(0,e.findBackEdgeIndexes)(t,void 0,(0,e.subgraphFeedbackEdges)(t)),Me.set(t,n)),n}function Pe(e,t){for(let n=0;n<e.edges.length;n++){let r=e.edges[n];if(t.has(r.source)||t.has(r.target))return n}return 1/0}function Fe(e){return de(e,ue.flowchart)}function Ie(e){return{...pe(e),"elk.spacing.edgeEdge":`12`,"elk.layered.spacing.edgeEdgeBetweenLayers":`12`,"elk.layered.spacing.edgeNodeBetweenLayers":`12`,"elk.layered.nodePlacement.bk.fixedAlignment":`BALANCED`,"elk.contentAlignment":`H_CENTER V_CENTER`}}function Le(e,t){return{fontSize:e.fontSizes.edgeLabel,...Te(t)&&R(t)?{lineHeight:24}:{},layoutOptions:he}}var Re=136,ze=120,Be={rectangle:32,rounded:30,stadium:52,subroutine:44,cylinder:24,"horizontal-cylinder":28.8,hexagon:85.7,asymmetric:54,parallelogram:69,"parallelogram-alt":69,trapezoid:69,"trapezoid-alt":114,document:32,"stacked-document":52,"stacked-process":52,card:56,"lined-process":40,"divided-process":16,"window-pane":42,flag:32,"bow-tie-rectangle":37.6,"half-rounded-rectangle":38.4,brace:31.8,"brace-right":46,braces:48.5,"notched-pentagon":32,"sloped-rectangle":32,text:15},Ve=40,He=13.7/24,Ue=[52,58.3,72.5,88,104.5,132];function We(t,n,r,i,a,o,s=!1,c=!1){if(a!==void 0)return{width:80,height:80};let l=!s&&!c,u=l?le(n,i,F.nodeLabel):void 0,d=(0,e.measureMultilineText)(u?.text??n,i,F.nodeLabel);l&&(d.height=d.lines.length*i*1.5);let f=d.width+ne.horizontal*2,p=d.height+(l?24:ne.vertical*2);if(r===`diamond`){let e=Math.max(f,p)+ne.diamondExtra;f=e,p=e}if(l&&(r===`circle`||r===`doublecircle`)){let e=u?.wrapped?ze:d.width;return f=Math.hypot(e,d.height)+(r===`circle`?32:56),{width:f,height:f}}if(r===`circle`||r===`doublecircle`){let e=Math.ceil(Math.sqrt(f*f+p*p))+8;f=r===`doublecircle`?e+12:e,p=f}if(r===`hexagon`&&(f+=ne.horizontal),(r===`trapezoid`||r===`trapezoid-alt`||r===`parallelogram`||r===`parallelogram-alt`)&&(f+=ne.horizontal),r===`asymmetric`&&(f+=12),r===`cylinder`&&(p=l?d.height+64.1:p+14),r===`rounded`&&l&&(p=d.height+30),r===`horizontal-cylinder`&&l&&(p=d.height+12),r===`cloud`){l&&(p=d.height+15);let e=s||c?Math.max(f,p*2.5):Math.max(d.width,ze)+15;return{width:e*1.25,height:p+e*.48}}if(s&&r===`note`)return{width:Math.max(d.width,120)+30,height:d.lines.length*24+30};if(r===`small-circle`)return{width:14,height:14};if(r===`fork-bar`)return o===`LR`||o===`RL`?{width:10,height:70}:{width:70,height:10};if(r===`state-start`||r===`state-end`)return{width:14,height:14};if(r===`junction`)return{width:2,height:2};if(n===``&&r===`diamond`)return{width:28,height:28};if(n===``&&r===`fork-join`)return{width:70,height:10};if(!s&&!c){let e=Math.max(d.width,ze),t=Be[r];if(t!==void 0&&(f=e+t),r===`hexagon`&&(f=e+72+He*d.height,p=d.height+70),r===`stadium`){let t=d.lines.length;f=e+(Ue[t-1]??Ue.at(-1)+36*(t-Ue.length))}else r===`tagged-rectangle`?f=e+32+.2*p:(r===`diamond`||r===`triangle`||r===`flipped-triangle`)&&(f=e+d.height+30,p=f)}return f=Math.max(f,s?Re:60),p=Math.max(p,s?Ve:36),{width:f,height:p}}function Ge(t,n,r){let{width:i,lines:a}=(0,e.measureMultilineText)(n,r,F.nodeLabel);return{id:`${t.id}----parent`,layoutOptions:{...Ee,"elk.padding":`[top=24,left=24,bottom=24,right=24]`,"elk.nodeLabels.placement":`[H_CENTER, V_TOP, INSIDE]`,"elk.hierarchyHandling":`INCLUDE_CHILDREN`},labels:[{text:n,width:i,height:a.length*24-2}],children:[t]}}var Ke=` root`;function qe(e){for(let t of e)if(t.direction!==void 0||qe(t.children))return!0;return!1}function Je(e,t){for(let n of e.nodeIds)t.add(n);for(let n of e.children)Je(n,t)}function Ye(e){let t=new Map;function n(e,r){let i=[...r,e.id];t.set(e.id,i);for(let t of e.children)n(t,i)}for(let t of e)n(t,[]);return t}function Xe(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;return n}function Ze(e,t){let n=t,r=new Set,i=new Set;for(let t of e.subgraphs)i.add(t.id),$e(t,r,i);let a=et(e.subgraphs),o=Ye(e.subgraphs),s=e=>e?o.get(e)??[]:[],c=new Map;c.set(null,[]);let l=[];for(let t=0;t<e.edges.length;t++){let n=e.edges[t],r=a.get(n.source),i=a.get(n.target);if(r&&r===i){let e=c.get(r)??[];c.set(r,e),e.push({index:t,edge:n})}else!r&&!i?c.get(null).push({index:t,edge:n}):l.push({index:t,edge:n,srcChain:s(r),tgtChain:s(i)})}let u=qe(e.subgraphs),d=[],f=[],p={...ke(Ie({direction:Fe(e.direction),nodeSpacing:n.nodeSpacing,layerSpacing:R(e)&&n.layerSpacing===ae.layerSpacing?40:n.layerSpacing,padding:n.padding}),De(e,n,`root`)),...Te(e)?{}:{"elk.layered.thoroughness":String(ae.thoroughness)},"elk.layered.highDegreeNodes.treatment":`false`,"elk.layered.compaction.postCompaction.strategy":e.subgraphs.length===0||Se(e)||Te(e)?`NONE`:`LEFT_RIGHT_CONSTRAINT_LOCKING`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,...Te(e)?{"elk.layered.cycleBreaking.strategy":`DEPTH_FIRST`,...R(e)?{"elk.spacing.portsSurrounding":je}:{}}:{},...Se(e)&&(Te(e)&&e.subgraphs.length>0||R(e)||n.legacyNodeSizes)?{"elk.spacing.edgeEdge":Te(e)?n.legacyNodeSizes?`50`:`70`:`40`}:{},"elk.layered.wrapping.strategy":`OFF`,"elk.hierarchyHandling":u?`SEPARATE`:`INCLUDE_CHILDREN`},m=new Map,h=new Map;function g(e,t){let n=m.get(e)??new Set;m.set(e,n),n.add(t)}function _(e,t){let n=h.get(e)??[];h.set(e,n),n.push(t)}if(u)for(let{index:t,edge:r,srcChain:i,tgtChain:a}of l){let o=Xe(i,a),s=r.source;if(i.length>o){for(let e=i.length-1;e>=o;e--){let n=i[e],a=`${n}_out_${t}`;g(n,a);let o=e===i.length-1?r.source:`${i[e+1]}_out_${t}`;_(n,{id:`e${t}_s${e}`,sources:[o],targets:[a]})}s=`${i[o]}_out_${t}`}let c=r.target;if(a.length>o){for(let e=o;e<=a.length-1;e++){let n=a[e],i=`${n}_in_${t}`;g(n,i);let o=e===a.length-1?r.target:`${a[e+1]}_in_${t}`;_(n,{id:`e${t}_t${e}`,sources:[i],targets:[o]})}c=`${a[o]}_in_${t}`}_(o>0?i[o-1]:Ke,_e({id:`e${t}`,source:s,target:c,label:r.label,labelStyle:Le(n,e)}))}for(let[t,a]of e.nodes)if(!r.has(t)&&!i.has(t)){let r=me(t,We(t,a.label,a.shape,n.fontSizes.nodeLabel,a.icon,e.direction,R(e),n.legacyNodeSizes),a.label);d.push(R(e)&&a.shape===`note`?Ge(r,a.label,n.fontSizes.nodeLabel):r)}let v=R(e),y=d.length,b=v?e.subgraphs:[...e.subgraphs].reverse();for(let t of b)d.push(Qe(t,e,n,c,m,h,e.direction));if(Te(e)&&d.unshift(...d.splice(y)),v&&e.subgraphs.length>0){let t=d.map((t,n)=>{if(n<y)return Pe(e,new Set([t.id]));let r=e.subgraphs[n-y],i=Pe(e,new Set([r.id]));if(i!==1/0)return i;let a=new Set;return Je(r,a),Pe(e,a)}),n=d.map((e,t)=>t).sort((e,n)=>t[e]-t[n]||e-n).map(e=>d[e]);d.splice(0,d.length,...n)}let x=Ne(e),S=Te(e)&&!u,C=c.get(null);if(S)for(let t of Ae(e)){let r=e.edges[t];f.push(_e({id:`e${t}`,source:x.has(t)?r.target:r.source,target:x.has(t)?r.source:r.target,label:r.label,labelStyle:Le(n,e)}))}for(let{index:t,edge:r}of S?[]:C)r.source!==r.target&&f.push(_e({id:`e${t}`,source:x.has(t)?r.target:r.source,target:x.has(t)?r.source:r.target,label:r.label,labelStyle:Le(n,e)}));if(u)for(let e of h.get(Ke)??[])f.push(e);else for(let{index:t,edge:r}of S?[]:l)f.push(_e({id:`e${t}`,source:x.has(t)?r.target:r.source,target:x.has(t)?r.source:r.target,label:r.label,labelStyle:Le(n,e)}));return{id:`root`,layoutOptions:p,children:d,edges:f}}function Qe(t,n,r,i,a,o,s){let c=t.direction!==void 0&&(0,e.subgraphDirectionIsHonored)(t,n)?t.direction:s,l=ke(Ie({direction:Fe(c),nodeSpacing:r.nodeSpacing,layerSpacing:R(n)&&r.layerSpacing===ae.layerSpacing?24:r.layerSpacing,padding:t.region?xe:R(n)?ve:Te(n)?ye:be}),De(n,r,`subgraph`));if(Te(n)&&!t.region){let n=(0,e.measureMultilineText)(t.label,r.fontSizes.groupHeader,F.groupHeader).width+24;l[`elk.nodeSize.constraints`]=`[MINIMUM_SIZE]`,l[`elk.nodeSize.minimum`]=c===`TD`||c===`TB`||c===`BT`?`(0, ${n})`:`(${n}, 0)`}if(t.region||t.children.some(e=>e.region)){if(r.nodeSpacing===ae.nodeSpacing&&r.layerSpacing===ae.layerSpacing){for(let e of Oe)delete l[e];Object.assign(l,Ee)}l[`elk.hierarchyHandling`]=`SEPARATE_CHILDREN`}Te(n)&&(l[`elk.layered.cycleBreaking.strategy`]=`DEPTH_FIRST`,l[`elk.spacing.portsSurrounding`]=je);let u,d=a.get(t.id);d&&d.size>0&&(u=[...d].map(e=>({id:e})));let f=[],p=Te(n),m=p?[...n.nodes.keys()].filter(e=>t.nodeIds.includes(e)):t.nodeIds;for(let e of m){let t=n.nodes.get(e);if(t){let i=me(e,We(e,t.label,t.shape,r.fontSizes.nodeLabel,t.icon,n.direction,R(n),r.legacyNodeSizes),t.label);f.push(R(n)&&t.shape===`note`?Ge(i,t.label,r.fontSizes.nodeLabel):i)}}let h=t.children.some(e=>e.region)?t.children:[...t.children].reverse(),g=f.length;for(let e of h)f.push(Qe(e,n,r,i,a,o,c));p&&f.unshift(...f.splice(g));let _=[],v=i.get(t.id)??[],y=Ne(n);for(let{index:e,edge:t}of Te(n)&&!qe(n.subgraphs)?[]:v)t.source!==t.target&&_.push(_e({id:`e${e}`,source:y.has(e)?t.target:t.source,target:y.has(e)?t.source:t.target,label:t.label,labelStyle:Le(r,n)}));for(let e of o.get(t.id)??[])_.push(e);return{id:t.id,layoutOptions:l,labels:t.label?[{text:t.label}]:void 0,ports:u,children:f,edges:_}}function $e(e,t,n){for(let n of e.nodeIds)t.add(n);for(let r of e.children)n.add(r.id),$e(r,t,n)}function et(e){let t=new Map;function n(e){for(let n of e.nodeIds)t.set(n,e.id);for(let t of e.children)n(t)}for(let t of e)n(t);return t}function tt(e,t,n){if(e.length<2||t.shape===`rectangle`||t.shape===`rounded`||t.shape===`stadium`)return e;let r=[...e];if(t.shape===`diamond`){if(n)r[0]=nt(e[0],e[1],t);else{let n=e.length-1;r[n]=nt(e[n],e[n-1],t)}}if(t.shape===`asymmetric`){let i=n?0:e.length-1,a=e[i],o=t.height/2,s=Math.abs(a.y-(t.y+o));Math.abs(a.x-t.x)<.5&&s<o&&(r[i]={x:t.x+12*(1-s/o),y:a.y})}return r}function nt(e,t,n){let r=n.x+n.width/2,i=n.y+n.height/2,a={x:r,y:n.y},o={x:n.x+n.width,y:i},s={x:r,y:n.y+n.height},c={x:n.x,y:i},l=e.x-t.x,u=e.y-t.y;if(Math.abs(l)<Math.abs(u)){let t=e.x;return u>0?t<=r?it(t,c,a)??a:it(t,a,o)??a:t<=r?it(t,s,c)??s:it(t,o,s)??s}{let t=e.y;return l>0?t<=i?rt(t,a,c)??c:rt(t,c,s)??c:t<=i?rt(t,a,o)??o:rt(t,o,s)??o}}function rt(e,t,n){let r=n.y-t.y;if(Math.abs(r)<.001)return null;let i=(e-t.y)/r;return i<0||i>1?null:{x:t.x+i*(n.x-t.x),y:e}}function it(e,t,n){let r=n.x-t.x;if(Math.abs(r)<.001)return null;let i=(e-t.x)/r;return i<0||i>1?null:{x:e,y:t.y+i*(n.y-t.y)}}var at=12;function ot(e,t,n){if(e.length===0)return;let r=n===`LR`||n===`RL`,i=new Set;for(let e of t)i.add(`${e.source}:${e.target}`),i.add(`${e.target}:${e.source}`);let a=ae.layerSpacing*.6,o=[...e].sort((e,t)=>r?e.x-t.x:e.y-t.y),s=[],c=[o[0]];for(let e=1;e<o.length;e++){let t=(r?o[e].x:o[e].y)-(r?o[e-1].x:o[e-1].y),n=c.some(t=>i.has(`${t.id}:${o[e].id}`));t<=a&&!n?c.push(o[e]):(s.push(c),c=[o[e]])}s.push(c);let l=new Map;for(let e of s){if(e.length<=1)continue;let t=e.map(e=>r?e.x:e.y),n=Math.min(...t),i=Math.max(...t);if(i-n<=1)continue;let a=(n+i)/2;for(let t of e){let e=a-(r?t.x:t.y);Math.abs(e)>.5&&(r?t.x=a:t.y=a,l.set(t.id,e))}}l.size!==0&&st(t,l,r?`x`:`y`)}function st(e,t,n){let r=(e,t,r,i)=>{let a=e[t],o=a[n];a[n]+=i;let[s,c,l]=[1,2,3].map(n=>e[t+n*r]);if(s[n]===o)s[n]+=i;else if(c&&l&&c[n]===s[n]){let e=Math.sign(s[n]-o),t=s[n]+e*Math.max(0,at-e*(s[n]-a[n]));e*(l[n]-t)>0&&(s[n]=c[n]=t)}};for(let n of e){let{points:e}=n;if(e.length<2)continue;let i=t.get(n.source),a=t.get(n.target);i!=null&&r(e,0,1,i),a!=null&&r(e,e.length-1,-1,a)}}var ct=.5;function lt(e,t,n){for(let r=0;r<e.length-1;r++){let i=e[r],a=e[r+1],o=Math.min(i.x,a.x),s=Math.max(i.x,a.x),c=Math.min(i.y,a.y),l=Math.max(i.y,a.y);for(let e of t){if(n.has(e.id))continue;let t=e.x+ct,r=e.x+e.width-ct,i=e.y+ct,a=e.y+e.height-ct;if(!(t>=r||i>=a)&&o<r&&s>t&&c<a&&l>i)return!1}}return!0}function ut(e,t,n){let r=[];for(let i of n)e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height&&(r.push(i),r.push(...ut(e,t,i.children)));return r}function dt(e,t,n,r,i){let a=i===`LR`,o=i===`RL`,s=i===`BT`,c=a||o,l=new Set(ut(t,n,r).map(e=>e.id)),u=ut(c?e:t,c?n:e,r).find(e=>!l.has(e.id));return u?a?u.x-12:o?u.x+u.width+12:s?u.y+u.height+12:u.y-12:e}var ft=2;function pt(e,t,n,r,i){for(let a of e){if(t.has(a)||a.source===a.target)continue;let e=a.source===n?a.points[0]:a.target===n?a.points[a.points.length-1]:void 0;if(e&&Math.abs((i?e.x:e.y)-r)<=ft)return!0}return!1}function mt(e,t,n,r){let i=new Map(t.map(e=>[e.id,e])),a=new Set,o=new Map,s=e=>`${e.source}\0${e.target}`;for(let t of e)o.set(s(t),(o.get(s(t))??0)+1);let c=e=>o.get(s(e))>1,l=r===`LR`,u=r===`RL`,d=r===`BT`,f=l||u,p=new Map;for(let t of e){if(t.source===t.target||c(t))continue;let e=p.get(t.source)??[];p.set(t.source,e),e.push(t)}for(let[o,s]of p){if(s.length<2)continue;let c=s[0].style;if(s.some(e=>e.label||e.style!==c))continue;let p=i.get(o);if(!p)continue;let m=[];for(let e of s){let t=i.get(e.target);t&&(l?t.x>p.x+p.width:u?t.x+t.width<p.x:d?t.y+t.height<p.y:t.y>p.y+p.height)&&m.push({edge:e,node:t})}if(m.length<2)continue;let h=p.x+p.width/2,g=p.y+p.height/2;if(f){let i=l?p.x+p.width:p.x,s=g;if(pt(e,new Set(m.map(e=>e.edge)),o,i,!0))continue;let c=i+((l?Math.min(...m.map(e=>e.node.x)):Math.max(...m.map(e=>e.node.x+e.node.width)))-i)/2;c=dt(c,h,g,n,r);let u=[];for(let{edge:e,node:n}of m){let r=l?n.x:n.x+n.width,a=n.y+n.height/2,d=[{x:i,y:s},{x:c,y:s},{x:c,y:a},{x:r,y:a}];lt(d,t,new Set([o,n.id]))&&u.push({edge:e,points:d})}if(u.length<2)continue;for(let{edge:e,points:t}of u)e.points=t,a.add(e)}else{let i=h,s=d?p.y:p.y+p.height;if(pt(e,new Set(m.map(e=>e.edge)),o,s,!1))continue;let c=s+((d?Math.max(...m.map(e=>e.node.y+e.node.height)):Math.min(...m.map(e=>e.node.y)))-s)/2;c=dt(c,h,g,n,r);let l=[];for(let{edge:e,node:n}of m){let r=n.x+n.width/2,a=d?n.y+n.height:n.y,u=[{x:i,y:s},{x:i,y:c},{x:r,y:c},{x:r,y:a}];lt(u,t,new Set([o,n.id]))&&l.push({edge:e,points:u})}if(l.length<2)continue;for(let{edge:e,points:t}of l)e.points=t,a.add(e)}}let m=new Map;for(let t of e){if(a.has(t)||t.source===t.target||c(t))continue;let e=m.get(t.target)??[];m.set(t.target,e),e.push(t)}for(let[a,o]of m){if(o.length<2)continue;let s=o[0].style;if(o.some(e=>e.label||e.style!==s))continue;let c=i.get(a);if(!c)continue;let p=[];for(let e of o){let t=i.get(e.source);t&&(l?t.x+t.width<c.x:u?t.x>c.x+c.width:d?t.y>c.y+c.height:t.y+t.height<c.y)&&p.push({edge:e,node:t})}if(p.length<2)continue;let m=c.x+c.width/2,h=c.y+c.height/2;if(f){let i=l?c.x:c.x+c.width,o=h;if(pt(e,new Set(p.map(e=>e.edge)),a,i,!0))continue;let s=l?Math.max(...p.map(e=>e.node.x+e.node.width)):Math.min(...p.map(e=>e.node.x)),u=s+(i-s)/2;u=dt(u,m,h,n,r);let d=[];for(let{edge:e,node:n}of p){let r=l?n.x+n.width:n.x,s=n.y+n.height/2,c=[{x:r,y:s},{x:u,y:s},{x:u,y:o},{x:i,y:o}];lt(c,t,new Set([n.id,a]))&&d.push({edge:e,points:c})}if(d.length<2)continue;for(let{edge:e,points:t}of d)e.points=t}else{let i=m,o=d?c.y+c.height:c.y;if(pt(e,new Set(p.map(e=>e.edge)),a,o,!1))continue;let s=d?Math.min(...p.map(e=>e.node.y)):Math.max(...p.map(e=>e.node.y+e.node.height)),l=s+(o-s)/2;l=dt(l,m,h,n,r);let u=[];for(let{edge:e,node:n}of p){let r=n.x+n.width/2,s=[{x:r,y:d?n.y:n.y+n.height},{x:r,y:l},{x:i,y:l},{x:i,y:o}];lt(s,t,new Set([n.id,a]))&&u.push({edge:e,points:s})}if(u.length<2)continue;for(let{edge:e,points:t}of u)e.points=t}}}var ht=1.5,gt=.01;function _t(e){let t=e.map(e=>({...e})),n=0;for(;n+3<t.length;){let[e,r,i,a]=[t[n],t[n+1],t[n+2],t[n+3]],o=Math.abs(e.x-r.x)<gt&&Math.abs(i.x-a.x)<gt&&Math.abs(r.y-i.y)<gt&&Math.abs(r.x-i.x)<=ht&&Math.abs(r.x-i.x)>=gt,s=Math.abs(e.y-r.y)<gt&&Math.abs(i.y-a.y)<gt&&Math.abs(r.x-i.x)<gt&&Math.abs(r.y-i.y)<=ht&&Math.abs(r.y-i.y)>=gt;if(o){let r=(e.x+a.x)/2;t.splice(n,4,{x:r,y:e.y},{x:r,y:a.y})}else if(s){let r=(e.y+a.y)/2;t.splice(n,4,{x:e.x,y:r},{x:a.x,y:r})}else n++}return t}function vt(e,t=0,n=0){let r=[];if(!e.sections||e.sections.length===0)return r;let i=e.sections[0];if(r.push({x:i.startPoint.x+t,y:i.startPoint.y+n}),i.bendPoints)for(let e of i.bendPoints)r.push({x:e.x+t,y:e.y+n});return r.push({x:i.endPoint.x+t,y:i.endPoint.y+n}),r}function yt(e,t=0,n=0){if(!e.labels||e.labels.length===0)return;let r=e.labels[0];if(r.x!=null&&r.y!=null)return{x:r.x+(r.width??0)/2+t,y:r.y+(r.height??0)/2+n}}var bt=20,xt=4,St=24,Ct={width:8,height:6};function wt(e,t,n){let r=t===`TD`||t===`TB`||t===`BT`,i=t===`BT`||t===`RL`,a=n.length,o=r?e.height:e.width,s=r?e.y+e.height/2:e.x+e.width/2,c=r?e.x:e.y,l=Math.max(o-St,8)/(2*a+1),u=0;return n.map((t,n)=>{u+=bt;let a=c-u,o=l*(2*n+1)/2,[d,f]=i?[s+o,s-o]:[s-o,s+o],p=(e,t)=>r?{x:e,y:t}:{x:t,y:e},m=e.shape===`diamond`||e.shape===`asymmetric`?c+(r?e.width:e.height)/2:c,h=[p(m,d),p(a,d),p(a,f),p(m,f)],g=p(a,s),_=a;if(t){let e=r?t.width:t.height;g=p(a-xt-e/2,s),_=a-xt-e,u+=e+xt}let v=t?(r?t.height:t.width)/2:0,y=Math.min(d,f,s-v);return{points:h,labelPosition:g,minX:r?_:y,minY:r?y:_}})}function Tt(t,n,r,i=N.edgeLabel){let a=1/0,o=1/0,s=new Map;t.edges.forEach((e,t)=>{e.source!==e.target||!n.has(e.source)||s.set(e.source,[...s.get(e.source)??[],t])});for(let[c,l]of s){let s=wt(n.get(c),t.direction,l.map(n=>{let r=t.edges[n].label;if(!r)return;let a=(0,e.measureMultilineText)(r,i,F.edgeLabel);return{width:a.width+Ct.width,height:a.height+Ct.height}}));l.forEach((e,n)=>{let i=t.edges[e],{points:c,labelPosition:l,...u}=s[n];a=Math.min(a,u.minX),o=Math.min(o,u.minY),r.push({source:i.source,target:i.target,label:i.label,style:i.style,hasArrowStart:i.hasArrowStart,hasArrowEnd:i.hasArrowEnd,points:c,labelPosition:i.label?l:void 0,inlineStyle:Bt(e,t),headColor:zt(t),id:i.id,animate:i.animate,startMarker:i.startMarker,endMarker:i.endMarker})})}return{minX:a,minY:o}}function Et(e,t,n,r,i){let a=e=>{e.x+=r,e.y+=i};for(let t of e)a(t);for(let e of t)e.points.forEach(a),e.labelPosition&&a(e.labelPosition);let o=e=>{for(let t of e)a(t),o(t.children)};o(n)}function Dt(e){let t=[];for(let n of e)t.push({x:n.x,y:n.y,right:n.x+n.width,bottom:n.y+n.height}),t.push(...Dt(n.children));return t}function Ot(e,t,n=!1,r){let i=[],a=[],o=[],s=new Set;for(let e of t.subgraphs)Rt(e,s);At(e,t,s,i,o,0,0);let c=Dt(o);Nt(e,t,a,0,0,c.length>0?{leftX:Math.min(...c.map(e=>e.x))-20,rightX:Math.max(...c.map(e=>e.right))+20}:void 0),R(t)?kt(i,a,t.direction):ot(i,a,t.direction);let l=new Map(i.map(e=>[e.id,e])),u=Tt(t,l,a,r),d=Math.max(0,ae.padding-u.minX),f=Math.max(0,ae.padding-u.minY);(d>0||f>0)&&Et(i,a,o,d,f),n&&mt(a,i,o,t.direction);for(let e of a){e.points=_t(e.points);let t=l.get(e.source),n=l.get(e.target);t&&(e.points=tt(e.points,t,!0)),n&&(e.points=tt(e.points,n,!1))}let p=(e.width??800)+d,m=(e.height??600)+f,h=re.width,g=ae.padding;for(let e of a){for(let t of e.points)p=Math.max(p,t.x+h+g),m=Math.max(m,t.y+h+g);e.labelPosition&&(p=Math.max(p,e.labelPosition.x+60+g),m=Math.max(m,e.labelPosition.y+20+g))}return{width:p,height:m,nodes:i,edges:a,groups:o}}function kt(e,t,n){let r=n===`LR`||n===`RL`,i=new Map(e.map(e=>[e.id,e]));for(let n of e){if(n.shape!==`state-start`&&n.shape!==`state-end`)continue;let e=t.filter(e=>e.source===n.id||e.target===n.id);if(e.length!==1)continue;let a=i.get(e[0].source===n.id?e[0].target:e[0].source);if(!a)continue;let o=r?`y`:`x`,s=r?`height`:`width`,c=a[o]+a[s]/2-(n[o]+n[s]/2);Math.abs(c)<=4&&(n[o]+=c)}}function At(t,n,r,i,a,o,s){if(t.children)for(let c of t.children){let t=(c.x??0)+o,l=(c.y??0)+s,u=c.width??0,d=c.height??0;if(r.has(c.id)){let o=[];At(c,n,r,i,o,t,l);let s=Lt(n.subgraphs,c.id);a.push({id:c.id,label:s?.label??``,x:t,y:l,width:u,height:d,children:o,...(0,e.groupStyle)(c.id,n),...s?.region?{region:!0}:{},...s?.icon?{icon:s.icon}:{}})}else{let o=n.nodes.get(c.id);if(o){let r=(0,e.resolveNodeStyle)(c.id,n),a=n.classAssignments.get(c.id);i.push({id:c.id,label:o.label,shape:o.icon===void 0?o.shape:`rectangle`,icon:o.icon,x:t,y:l,width:u,height:d,inlineStyle:r,className:a,interaction:n.interactions.get(c.id)})}c.children&&c.children.length>0&&At(c,n,r,i,a,t,l)}}}function jt(e){let t=/^e(\d+)$/.exec(e);if(t)return{edgeIndex:parseInt(t[1],10),role:`bridge`};let n=/^e(\d+)_([st])(\d+)$/.exec(e);if(n)return{edgeIndex:parseInt(n[1],10),role:n[2]===`s`?`source`:`target`,level:parseInt(n[3],10)}}function Mt(e){if(e.length===0)return{x:0,y:0};if(e.length===1)return e[0];let t=0;for(let n=1;n<e.length;n++){let r=e[n].x-e[n-1].x,i=e[n].y-e[n-1].y;t+=Math.sqrt(r*r+i*i)}let n=t/2;for(let t=1;t<e.length;t++){let r=e[t].x-e[t-1].x,i=e[t].y-e[t-1].y,a=Math.sqrt(r*r+i*i);if(n<=a){let o=n/a;return{x:e[t-1].x+o*r,y:e[t-1].y+o*i}}n-=a}return e[e.length-1]}function Nt(e,t,n,r,i,a){let o=new Map;Pt(e,o,0,0);let s=new Map;It(e,s,0,0,o);let c=0;for(let[e,r]of s){let i=t.edges[e];if(!i||i.source===i.target)continue;let o=[],s=e=>{!e||e.points.length===0||(o.length>0?o.push(...e.points.slice(1)):o.push(...e.points))},l=[...r.sourceHops.keys()].sort((e,t)=>t-e);for(let e of l)s(r.sourceHops.get(e));s(r.bridge);let u=[...r.targetHops.keys()].sort((e,t)=>e-t);for(let e of u)s(r.targetHops.get(e));let d;i.label&&o.length>=2&&(d=r.bridge?.labelPosition??Mt(o));let f=Ft(o,a,c);f!==o&&c++,i.label&&f!==o&&f.length>=2&&(d=Mt(f)),n.push({source:i.source,target:i.target,label:i.label,style:i.style,hasArrowStart:i.hasArrowStart,hasArrowEnd:i.hasArrowEnd,points:Ne(t).has(e)?[...f].reverse():f,labelPosition:d,inlineStyle:Bt(e,t),headColor:zt(t),id:i.id,animate:i.animate,startMarker:i.startMarker,endMarker:i.endMarker})}}function Pt(e,t,n,r){t.set(e.id,{x:n,y:r});for(let i of e.children??[]){let e=i.x??0,a=i.y??0;Pt(i,t,n+e,r+a)}}function Ft(e,t,n=0){if(e.length<2)return e;let r=!1;for(let t=1;t<e.length;t++){let n=Math.abs(e[t].x-e[t-1].x),i=Math.abs(e[t].y-e[t-1].y);if(n>1&&i>1){r=!0;break}}if(!r)return e;let i=[e[0]];for(let r=1;r<e.length;r++){let a=i[i.length-1],o=e[r],s=Math.abs(o.x-a.x),c=Math.abs(o.y-a.y);if(s>1&&c>1){if(t){let e=n%2==0,r=Math.floor(n/2)*12,s=e?t.rightX+r:t.leftX-r;i.push({x:s,y:a.y}),i.push({x:s,y:o.y})}else{let e=(a.y+o.y)/2;i.push({x:a.x,y:e}),i.push({x:o.x,y:e})}}i.push(o)}return i}function It(e,t,n,r,i){if(e.edges)for(let a of e.edges){let e=jt(a.id);if(!e)continue;let{edgeIndex:o}=e,s=a.container,c=s?i.get(s):void 0,l=c?.x??n,u=c?.y??r,d=vt(a,l,u),f=yt(a,l,u),p=t.get(o)??{sourceHops:new Map,targetHops:new Map};t.set(o,p);let m={edgeIndex:o,points:d,labelPosition:f};e.role===`bridge`?p.bridge=m:e.role===`source`?p.sourceHops.set(e.level,m):p.targetHops.set(e.level,m)}if(e.children)for(let a of e.children)It(a,t,n+(a.x??0),r+(a.y??0),i)}function Lt(e,t){for(let n of e){if(n.id===t)return n;let e=Lt(n.children,t);if(e)return e}}function Rt(e,t){t.add(e.id);for(let n of e.children)Rt(n,t)}function zt(e){return Bt(-1,e)?.stroke}function Bt(t,n){let r,i=n.linkStyles.get(`default`);i&&(r={...i});let a=n.linkStyles.get(t);return a&&(r=r?{...r,...a}:{...a}),r&&(0,e.dropInvalidColors)(r)}var Vt=e=>e===`TD`||e===`TB`||e===`BT`,Ht=8;function Ut(e,t,n,r){let i=Vt(r)?`y`:`x`,a=i===`x`?`y`:`x`,o=i===`x`?`width`:`height`,s=i===`x`?`height`:`width`;for(let{points:r}of e)for(let e=1;e<r.length-1;){let c=e;for(;c+1<r.length-1&&r[c+1][i]===r[e][i];)c++;let l=r.slice(e,c+1),u=l[0],d=Math.min(...l.map(e=>e[a])),f=Math.max(...l.map(e=>e[a])),p=r[e-1][i],m=r[c+1][i],h=n.flatMap(e=>[e[i],e[i]+e[o]].map(t=>({g:e,s:t}))).find(({g:e,s:t})=>Math.abs(u[i]-t)<Ht&&f>e[a]&&d<e[a]+e[s]);if(h){let e=h.s+(u[i]>=h.s?Ht:-8),n=(e-p)*(m-e)>0,r=t.every(t=>t[i]+t[o]<=e||t[i]>=e||t[a]+t[s]<=d||t[a]>=f);if(n&&r)for(let t of l)t[i]=e}e=c+1}}var Wt=12,Gt=8,Kt=4;function qt(t,n,r){let i=t.map(e=>({axis:e.axis,cross:e.cross,before:e.before??0,rank:0,real:!0})),a=t.map(()=>[]),o=t.map(()=>[]),s=n.flatMap((e,t)=>e.from===e.to?[]:[t]),c=(0,e.findBackEdges)(s.map(e=>({source:String(n[e].from),target:String(n[e].to)})),t.map((e,t)=>String(t))),l=s.map((e,t)=>{let r=n[e];return c.has(t)?{index:e,u:r.to,v:r.from,reversed:!0}:{index:e,u:r.from,v:r.to,reversed:!1}}),u=t.map(()=>[]),d=t.map(()=>0);for(let e of l)u[e.u].push(e.v),d[e.v]++;let f=d.flatMap((e,t)=>e===0?[t]:[]);for(let e=0;e<f.length;e++){let t=f[e];for(let e of u[t])i[e].rank=Math.max(i[e].rank,i[t].rank+2),--d[e]===0&&f.push(e)}let p=l.map(e=>{let t=(i[e.v].rank-i[e.u].rank)/2,r=i[e.u].rank+2*Math.floor(t/2)+1,s=n[e.index].label,c=[e.u];for(let t=i[e.u].rank+1;t<i[e.v].rank;t++){let e=i.length,n=t===r&&s!==void 0;i.push({axis:n?s.axis:0,cross:n?s.cross:0,before:0,rank:t,real:!1}),a.push([]),o.push([]),c.push(e)}c.push(e.v);for(let e=1;e<c.length;e++)o[c[e-1]].push(c[e]),a[c[e]].push(c[e-1]);return{chain:c,labelRank:r}}),m=i.map((e,t)=>t),h=e=>{let t=e;for(;m[t]!==t;)t=m[t]=m[m[t]];return t};for(let{chain:e}of p)for(let t of e)m[h(t)]=h(e[0]);let g=new Map;i.forEach((e,t)=>{let n=h(t);g.set(n,[...g.get(n)??[],t])});let _=i.map(()=>0),v=[],y=[];for(let e of g.values()){let t=Jt(e,i,a,o,r),n=1/0,s=-1/0;for(let r of e)_[r]=t.get(r),n=Math.min(n,_[r]-i[r].cross/2-i[r].before),s=Math.max(s,_[r]+i[r].cross/2);v.push({min:n,max:s}),y.push(e)}let b=0;y.forEach((e,t)=>{let n=b-v[t].min;for(let t of e)_[t]=_[t]+n;b+=v[t].max-v[t].min+r.nodeSep});let x=Math.max(0,b-r.nodeSep),S=i.reduce((e,t)=>Math.max(e,t.rank),0),C=Array(S+1).fill(0);for(let e of i)C[e.rank]=Math.max(C[e.rank],e.axis);let w=Array(S+1).fill(0);for(let e=1;e<=S;e++)w[e]=w[e-1]+C[e-1]+r.rankSep/2;let T=e=>w[i[e].rank]+C[i[e].rank]/2,E=n.map(()=>[]),D=n.map(()=>void 0);return l.forEach((e,t)=>{let{chain:r,labelRank:a}=p[t],o=r.slice(1,-1),s=o.map(e=>({axis:T(e),cross:_[e]}));if(E[e.index]=e.reversed?s.reverse():s,n[e.index].label){let t=o.find(e=>i[e].rank===a);D[e.index]={axis:T(t),cross:_[t]}}}),{nodes:t.map((e,t)=>({axis:w[i[t].rank]+(C[i[t].rank]-e.axis)/2,cross:_[t]-e.cross/2})),paths:E,labels:D,axisSize:w[S]+C[S],crossSize:x}}function Jt(e,t,n,r,i){let a=[],o=new Set,s=[...e].sort((e,n)=>t[e].rank-t[n].rank||e-n);for(let e of s){if(o.has(e))continue;let n=[{s:e,next:0}];for(o.add(e),(a[t[e].rank]??=[]).push(e);n.length>0;){let e=n[n.length-1],i=r[e.s][e.next++];i===void 0?n.pop():o.has(i)||(o.add(i),(a[t[i].rank]??=[]).push(i),n.push({s:i,next:0}))}}let c=a.filter(e=>e!==void 0),l=new Map,u=()=>c.forEach(e=>e.forEach((e,t)=>l.set(e,t))),d=()=>{let e=0;for(let t=0;t+1<c.length;t++){let n=c[t].flatMap(e=>r[e].map(t=>[l.get(e),l.get(t)]));for(let t=0;t<n.length;t++)for(let r=t+1;r<n.length;r++){let[i,a]=n[t],[o,s]=n[r];(i-o)*(a-s)<0&&e++}}return e};u();let f=c.map(e=>[...e]),p=d();for(let e=0;e<Gt&&p>0;e++){let t=e%2==0,i=c.map((e,t)=>t);t||i.reverse();for(let e of i){let i=t?n:r,a=e=>{let t=i[e];return t.length===0?l.get(e):t.reduce((e,t)=>e+l.get(t),0)/t.length},o=new Map(c[e].map(e=>[e,a(e)]));c[e].sort((e,t)=>o.get(e)-o.get(t)||l.get(e)-l.get(t)),c[e].forEach((e,t)=>l.set(e,t))}let a=d();a<p&&(p=a,f=c.map(e=>[...e]))}f.forEach((e,t)=>c[t]=e);let m=new Map,h=(e,n)=>(t[e].cross+t[n].cross)/2+t[n].before+(t[e].real&&t[n].real?i.nodeSep:Math.min(i.nodeSep,Wt)),g=(e,t)=>{let n=e.slice(1).map((t,n)=>h(e[n],t)),r=[0];n.forEach((e,t)=>r.push(r[t]+e)),Yt(e.map((e,n)=>{let i=(t[e]??[]).filter(e=>m.has(e));return(i.length===0?m.get(e)??0:i.reduce((e,t)=>e+m.get(t),0)/i.length)-r[n]})).forEach((t,n)=>m.set(e[n],t+r[n]))};for(let e of c)g(e,[]);for(let e=0;e<Kt;e++){for(let e=1;e<c.length;e++)g(c[e],n);for(let e=c.length-2;e>=0;e--)g(c[e],r)}return m}function Yt(e){let t=[];for(let n of e)for(t.push({sum:n,count:1});t.length>1;){let e=t[t.length-1],n=t[t.length-2];if(n.sum/n.count<=e.sum/e.count)break;t.splice(-2,2,{sum:n.sum+e.sum,count:n.count+e.count})}return t.flatMap(e=>Array(e.count).fill(e.sum/e.count))}var Xt=20,Zt=4,Qt=32;function $t(t,n={}){let r={...ae,...n,fontSizes:P(n.fontSizes)},i=t.direction===`TB`||t.direction===`TD`||t.direction===`BT`,a=t.direction===`BT`||t.direction===`RL`,o=new Map,s=new Map,c=(e,t)=>{o.set(e.id,e),t!==void 0&&s.set(e.id,t);for(let t of e.nodeIds)s.has(t)||s.set(t,e.id);for(let t of e.children)c(t,e.id)};t.subgraphs.forEach(e=>c(e));let l=[...t.nodes.keys()].filter(e=>!o.has(e)),u=new Map(l.map((e,t)=>[e,t])),d=e=>Math.min(...e.nodeIds.map(e=>u.get(e)??1/0),...e.children.map(d)),f=e=>{let t=o.get(e);return t?d(t):u.get(e)??1/0},p=e=>[...l.filter(t=>s.get(t)===e),...(e===void 0?t.subgraphs:o.get(e).children).map(e=>e.id)].map((e,t)=>({id:e,i:t})).sort((e,t)=>f(e.id)-f(t.id)||e.i-t.i).map(e=>e.id),m=e=>{let t=[e];for(let n=s.get(e);n!==void 0;n=s.get(n))t.unshift(n);return t},h=n=>{let a=t.edges[n].label;if(!a)return;let o=(0,e.measureMultilineText)(a,r.fontSizes.edgeLabel,F.edgeLabel),s=o.width+8,c=o.height+6;return i?{axis:c,cross:s}:{axis:s,cross:c}},g=new Map,_=new Map;t.edges.forEach((e,t)=>{if(e.source===e.target){_.set(e.source,[..._.get(e.source)??[],t]);return}let n=m(e.source),r=m(e.target),i=0;for(;n[i]!==void 0&&n[i]===r[i];)i++;if(i>=n.length||i>=r.length)return;let a=i===0?``:n[i-1];g.set(a,[...g.get(a)??[],{index:t,from:n[i],to:r[i]}])});let v=i?a?{axisStart:be.bottom,axisEnd:be.top,crossStart:be.left,crossEnd:be.right}:{axisStart:be.top,axisEnd:be.bottom,crossStart:be.left,crossEnd:be.right}:{axisStart:a?be.right:be.left,axisEnd:a?be.left:be.right,crossStart:be.top,crossEnd:be.bottom},y=(e,t)=>i?{aSize:t,cSize:e}:{aSize:e,cSize:t},b=new Map;for(let e of l){let n=t.nodes.get(e),i=We(e,n.label,n.shape,r.fontSizes.nodeLabel,n.icon,t.direction,R(t));b.set(e,y(i.width,i.height))}let x=e=>(_.get(e)??[]).reduce((e,t)=>{let n=h(t)?.cross;return e+Xt+(n===void 0?0:n+Zt)},0),S=t=>{let n=p(t),a=new Map,s=new Map,c=new Map;for(let t of n){let n=o.get(t);if(!n){s.set(t,b.get(t));continue}let l=S(t);a.set(t,l);let u=(0,e.measureMultilineText)(n.label,r.fontSizes.groupHeader,F.groupHeader).width,d=l.axisSize+v.axisStart+v.axisEnd,f=l.crossSize+v.crossStart+v.crossEnd,p=i?0:u+Qt,m=i?u+Qt:0,h=Math.max(0,p-d),g=Math.max(0,m-f);d+=h,f+=g,s.set(t,{aSize:d,cSize:f}),c.set(t,{axis:v.axisStart+h/2,cross:v.crossStart+g/2})}let l=new Map(n.map((e,t)=>[e,t])),u=g.get(t??``)??[],d=qt(n.map(e=>({axis:s.get(e).aSize,cross:s.get(e).cSize,before:x(e)})),u.map(e=>({from:l.get(e.from),to:l.get(e.to),label:h(e.index)})),{nodeSep:r.nodeSpacing,rankSep:r.layerSpacing}),f=new Map;return u.forEach((e,t)=>f.set(e.index,{mids:d.paths[t],label:d.labels[t]})),{members:n,at:new Map(n.map((e,t)=>[e,d.nodes[t]])),sizes:s,inset:{axis:0,cross:0},axisSize:d.axisSize,crossSize:d.crossSize,routes:f,inner:new Map([...a].map(([e,t])=>[e,{...t,inset:c.get(e)}]))}},C=S(void 0),w=new Map,T=new Map,E=(n,r,i)=>{for(let[e,t]of n.routes)T.set(e,{mids:t.mids.map(e=>({axis:e.axis+r,cross:e.cross+i})),label:t.label&&{axis:t.label.axis+r,cross:t.label.cross+i}});let a=[];for(let s of n.members){let c=n.at.get(s),l=n.sizes.get(s),u={axis:r+c.axis,cross:i+c.cross,...l};w.set(s,u);let d=n.inner.get(s);if(d){let n=o.get(s),r=E(d,u.axis+d.inset.axis,u.cross+d.inset.cross);a.push({id:s,label:n.label,x:0,y:0,width:0,height:0,children:r,...(0,e.groupStyle)(s,t),...n.region?{region:!0}:{},...n.icon?{icon:n.icon}:{}})}}return a},D=E(C,0,0),O=r.padding,k=C.axisSize,A=e=>{let t=a?k-e.axis:e.axis;return i?{x:e.cross+O,y:t+O}:{x:t+O,y:e.cross+O}},j=e=>{let t=a?k-e.axis-e.aSize:e.axis;return i?{x:e.cross+O,y:t+O,width:e.cSize,height:e.aSize}:{x:t+O,y:e.cross+O,width:e.aSize,height:e.cSize}},M=e=>{for(let t of e)Object.assign(t,j(w.get(t.id))),M(t.children)};M(D);let N=l.map(n=>{let r=t.nodes.get(n);return{id:n,label:r.label,shape:r.icon===void 0?r.shape:`rectangle`,icon:r.icon,...j(w.get(n)),inlineStyle:(0,e.resolveNodeStyle)(n,t),className:t.classAssignments.get(n),interaction:t.interactions.get(n)}}),ee=new Map(N.map(e=>[e.id,e])),te=[];t.edges.forEach((e,n)=>{let r=T.get(n);if(!r)return;let i=w.get(e.source),a=w.get(e.target),o=i.axis>a.axis,[s,c]=o?[a,i]:[i,a],l=[{axis:s.axis+s.aSize,cross:s.cross+s.cSize/2},...o?[...r.mids].reverse():r.mids,{axis:c.axis,cross:c.cross+c.cSize/2}],u=[l[0]];for(let e of l.slice(1)){let t=u[u.length-1];if(t.cross!==e.cross){let n=(t.axis+e.axis)/2;u.push({axis:n,cross:t.cross},{axis:n,cross:e.cross})}u.push(e)}let d=_t(en(u.map(A)));o&&d.reverse();let f=ee.get(e.source),p=ee.get(e.target);f&&(d=tt(d,f,!0)),p&&(d=tt(d,p,!1)),te.push({source:e.source,target:e.target,label:e.label,style:e.style,hasArrowStart:e.hasArrowStart,hasArrowEnd:e.hasArrowEnd,points:d,labelPosition:r.label&&A(r.label),inlineStyle:Bt(n,t),headColor:zt(t),id:e.id,animate:e.animate,startMarker:e.startMarker,endMarker:e.endMarker})}),Tt(t,ee,te,r.fontSizes.edgeLabel);let ne=(i?C.crossSize:C.axisSize)+O*2,I=(i?C.axisSize:C.crossSize)+O*2;for(let e of te){for(let t of e.points)ne=Math.max(ne,t.x+re.width+O),I=Math.max(I,t.y+re.width+O);e.labelPosition&&(ne=Math.max(ne,e.labelPosition.x+60+O),I=Math.max(I,e.labelPosition.y+20+O))}return{width:ne,height:I,nodes:N,edges:te,groups:D}}function en(e){return e.filter((t,n)=>{let r=e[n-1],i=e[n+1];return!r||!i||!(r.x===t.x&&t.x===i.x||r.y===t.y&&t.y===i.y)})}function tn(e,t={}){let n={...ae,...t,fontSizes:P(t.fontSizes)};return(e=>Ot(E(Ze(e,n),t.layoutCache),e,n.mergeEdges,n.fontSizes.edgeLabel))(e)}function nn(e,t={}){let n=rn(e,t),r=new Set,i=new Set,a=e=>{for(let t of e)t.stateComposite&&r.add(t.id),!t.nodeIds.length&&!t.children.length&&i.add(t.id),a(t.children)};a(e.subgraphs);let o=e=>{for(let t of e)!t.region&&!r.has(t.id)&&(t.bandless=!0),t.bandless&&i.has(t.id)&&!t.architecture&&(t.titleOnly=!0),o(t.children)};return o(n.groups),e.stateDiagram&&(n.stateDiagram=!0),n}function rn(t,n){let r=(0,e.withoutOwnClusterEdges)(t);if(n.legacyNodeSizes&&r.subgraphs.length===0&&(r={...r},we(r)),n.layout===`simple`&&!R(r))return $t(r,n);if(n.layout!==void 0&&n.layout!==`elk`&&n.layout!==`simple`)throw Error(`zombie-mermaid: unknown layout ${JSON.stringify(n.layout)}; use 'elk' or 'simple'.`);let i=tn(r,n);if(Te(r)){let e=t=>t.flatMap(t=>[t,...e(t.children)]);Ut(i.edges,i.nodes,e(i.groups),r.direction)}return i}function an(e,t={}){return Ze(e,{...ae,...t,fontSizes:P(t.fontSizes)})}var on=2;function sn(e){return e.flatMap(e=>[e,...sn(e.children)])}function cn(t,n){let r=n.groupHeader+16;return sn(t).filter(e=>e.label!==``).map(t=>{let i=(0,e.measureMultilineText)(t.label,n.groupHeader,400);return{x:t.x+t.width/2-i.width/2-on,y:t.y+(t.bandless?r:26)/2-i.height/2-on,width:i.width+4,height:i.height+4}})}function ln(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=[-r,r,-i,i],o=[e.x-n.x,n.x+n.width-e.x,e.y-n.y,n.y+n.height-e.y],s=0,c=1;for(let e=0;e<4;e++){let t=a[e],n=o[e];if(t===0){if(n<0)return!1}else{let e=n/t;if(t<0?s=Math.max(s,e):c=Math.min(c,e),s>c)return!1}}return!0}function un(e){return{x:e.x+on,y:e.y+on,width:e.width-4,height:e.height-4}}function dn(e,t){let n=e.points,r=t.map(un);for(let e=0;e+1<n.length;e++)if(r.some(t=>ln(n[e],n[e+1],t)))return!0;return!1}function fn(e){let t=2166136261;for(let n of e.map(e=>`${e.x},${e.y},${e.width},${e.height}`).join(`;`))t=Math.imul(t^n.charCodeAt(0),16777619);return(t>>>0).toString(36)}function pn(e,t,n){let r=`zm-title-gap-${fn(e)}`;return{id:r,markup:` <mask id="${r}" maskUnits="userSpaceOnUse" x="0" y="0" width="${t}" height="${n}">\n <rect x="0" y="0" width="${t}" height="${n}" fill="#fff" />\n${e.map(e=>` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" fill="#000" />`).join(`
11
+ `)}\n </mask>`}}function mn(t,n,r=`Inter`,i=!1,a=N,o=`linear`,s,c=!0,l=!0,u,d,f={}){let p=[],m=l&&t.nodes.some(t=>!!(0,e.safeHref)(t.interaction?.href));p.push(z((0,e.svgOpenTag)(t.width,t.height,n,i,u,d,m,f.styleAttribute,f.description),s)),p.push((0,e.buildStyleBlock)(r,!1,f.nonce,f.bodyFont)),c&&t.edges.some(e=>e.animate)&&p.push(hn(f.nonce)),p.push(`<defs>`),p.push(gn(t.stateDiagram===!0));let h=new Set;for(let e of t.edges){let t=wn(e);t&&h.add(t)}for(let e of h)p.push(_n(e,t.stateDiagram===!0));let g=new Set;for(let e of t.edges)e.startMarker&&g.add(e.startMarker),e.endMarker&&g.add(e.endMarker);for(let e of g)p.push(xn(e));let _=cn(t.groups,a),v=new Set(t.edges.filter(e=>dn(e,_))),y;if(v.size>0){let e=pn(_,t.width,t.height);y=e.id,p.push(e.markup)}p.push(`</defs>`);for(let e of t.groups)p.push(kn(e,r,a));for(let e of t.edges)p.push(An(e,o,c,v.has(e)?y:void 0,t.stateDiagram===!0));for(let e of t.edges)e.label&&p.push(jn(e,r,a));for(let e of t.nodes)p.push(Fn(e,r,a,l,t.stateDiagram===!0));return p.push(`</svg>`),p.join(`
12
+ `)}function hn(t){return[(0,e.styleOpenTag)(t),` @keyframes zm-edge-dash { to { stroke-dashoffset: -28; } }`,` .edge-animated { animation: zm-edge-dash 1s linear infinite; }`,` @media (prefers-reduced-motion: reduce) {`,` .edge-animated { animation: none; }`,` }`,`</style>`].join(`
13
+ `)}function gn(e){return yn(`var(--_arrow)`,``,e)}function _n(t,n){return yn((0,e.escapeAttr)(t),e.f`-${Tn(t)}`,n)}var vn=3.5;function yn(t,n,r){if(r)return bn(t,n);let i=10.5,a=12.8,o=e.f`fill="${t}" stroke="${t}" stroke-width="0.75" stroke-linejoin="round"`,s=e.f`<polygon points="0 0, ${i} ${a/2}, 0 ${a}" ${o} />`,c=(t,n)=>e.f` <marker id="${t}" markerWidth="${i}" markerHeight="${a}" refX="${9.5}" refY="${a/2}" markerUnits="userSpaceOnUse" orient="${n}">`+e.f`\n ${s}`+`
12
14
  </marker>`;return c(e.f`arrowhead${n}`,`auto`)+`
13
- `+c(e.f`arrowhead-start${n}`,`auto-start-reverse`)}function gn(t,n){let r=(n,r)=>e.f` <marker id="${n}" markerWidth="20" markerHeight="14" refX="17" refY="7" markerUnits="userSpaceOnUse" orient="${r}">`+e.f`\n <path d="M 19,7 L11,14 L13,7 L11,0 Z" fill="${t}" />`+`
15
+ `+c(e.f`arrowhead-start${n}`,`auto-start-reverse`)}function bn(t,n){let r=(n,r)=>e.f` <marker id="${n}" markerWidth="20" markerHeight="14" refX="17" refY="7" markerUnits="userSpaceOnUse" orient="${r}">`+e.f`\n <path d="M 19,7 L11,14 L13,7 L11,0 Z" fill="${t}" />`+`
14
16
  </marker>`;return r(e.f`arrowhead${n}`,`auto`)+`
15
- `+r(e.f`arrowhead-start${n}`,`auto-start-reverse`)}function _n(t){return t===`circle`?e.f`<marker id="circle" viewBox="0 0 10 10" refX="12.25" refY="5" markerUnits="userSpaceOnUse" markerWidth="14" markerHeight="14" orient="auto-start-reverse"><circle cx="5" cy="5" r="5" fill="var(--_arrow)"/></marker>`:e.f`<marker id="cross" viewBox="0 0 15 15" refX="17.7" refY="7.5" markerUnits="userSpaceOnUse" markerWidth="12" markerHeight="12" orient="auto-start-reverse"><path d="M1 1L14 14M1 14L14 1" stroke="var(--_arrow)" stroke-width="2.5"/></marker>`}var vn=5.5;function yn(e){let t=e.points.map(e=>({...e})),n=(e,n)=>{let r=t[e],i=t[n],a=Math.hypot(i.x-r.x,i.y-r.y);a<=vn||(r.x+=(i.x-r.x)/a*vn,r.y+=(i.y-r.y)/a*vn)};return e.hasArrowEnd&&!e.endMarker&&n(t.length-1,t.length-2),e.hasArrowStart&&!e.startMarker&&n(0,1),t}function bn(e){return e.headColor??e.inlineStyle?.stroke}function xn(e){return e.replace(/[^a-zA-Z0-9]/g,e=>e.charCodeAt(0).toString(16))}function Sn(t){let n=t?.[`stroke-dasharray`];return n&&/^[\d.\s,]+$/.test(n)?e.f` stroke-dasharray="${n.trim()}"`:``}var Cn=30,wn=12;function Tn(t,n,r){let i=r.groupHeader+16,a=[];if(t.region){a.push(e.f`<g class="subgraph subgraph-region" data-id="${(0,e.escapeAttr)(t.id)}">`,e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" `+e.f`rx="0" ry="0" fill="none" stroke="var(--_node-stroke)" stroke-width="${I.outerBox}" stroke-dasharray="6 4" />`);for(let e of t.children)a.push(Tn(e,n,r));return a.push(`</g>`),a.join(`
16
- `)}if(t.architecture){let i=t.iconSize??Cn,o=i>0&&t.icon&&(se[t.icon]??`<text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;">?</text>`);a.push(e.f`<g class="subgraph" data-id="${(0,e.escapeAttr)(t.id)}" data-label="${(0,e.escapeAttr)(t.label)}">`,e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" fill="none" stroke="var(--_node-stroke)" stroke-width="${In}" stroke-dasharray="${Ln}" />`),o&&a.push(e.f` <g transform="translate(${t.x+1} ${t.y+1}) scale(${i/80})"><rect width="${80}" height="${80}" fill="${oe}" />${o}</g>`),a.push(` `+(0,e.renderMultilineText)(t.label,t.x+(t.icon?i+4:6),t.y+1+Cn/2,r.groupHeader,e.f`font-size="${r.groupHeader}" font-weight="400" fill="var(--_text)"`));for(let e of t.children)a.push(Tn(e,n,r));return a.push(`</g>`),a.join(`
17
- `)}a.push(e.f`<g class="subgraph" data-id="${(0,e.escapeAttr)(t.id)}" data-label="${(0,e.escapeAttr)(t.label)}">`);let o=t.inlineStyle,s=(0,e.escapeAttr)(o?.stroke??`var(--_node-stroke)`),c=(0,e.escapeAttr)(o?.[`stroke-width`]??String(I.outerBox)),l=Sn(o),u=(0,e.escapeAttr)(o?.fill??`var(--_group-fill)`),d=(0,e.escapeAttr)(o?.fill??`var(--_group-hdr)`),f=t.bandless===!0;if(t.titleOnly||a.push(e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" `+e.f`rx="${f?0:Nn}" ry="${f?0:Nn}" fill="${f?u:d}" stroke="${s}" stroke-width="${c}"${l} />`),t.bandless){a.push(` `+(0,e.renderMultilineText)(t.label,t.x+t.width/2,t.titleOnly?t.y+t.height/2+wn:t.y+i/2,r.groupHeader,e.f`text-anchor="middle" font-size="${r.groupHeader}" font-weight="${400}" fill="${(0,e.escapeAttr)(o?.color??`var(--_text-sec)`)}"`));for(let e of t.children)a.push(Tn(e,n,r));return a.push(`</g>`),a.join(`
18
- `)}a.push(e.f` <rect x="${t.x}" y="${t.y+26}" width="${t.width}" height="${Math.max(0,t.height-26-Fn)}" `+e.f`rx="0" ry="0" fill="${u}" stroke="${s}" stroke-width="${c}"${l} />`);let p=t.x+t.width/2;a.push(` `+(0,e.renderMultilineText)(t.label,p,t.y+13,r.groupHeader,e.f`text-anchor="middle" font-size="${r.groupHeader}" font-weight="${400}" fill="${(0,e.escapeAttr)(o?.color??`var(--_text-sec)`)}"`));for(let e of t.children)a.push(Tn(e,n,r));return a.push(`</g>`),a.join(`
19
- `)}function En(t,n,r=!0,i,a=!1){if(t.points.length<2)return``;let o=r&&(t.animate??!1),s=t.style===`invisible`,c=t.style===`dotted`?` stroke-dasharray="2 2"`:``,l=t.style===`thick`?mn:I.connector,f=s?`none`:(0,e.escapeAttr)(t.inlineStyle?.stroke??`var(--_line)`),m=(0,e.escapeAttr)(t.inlineStyle?.[`stroke-width`]??String(l)),h=bn(t),g=h?e.f`-${xn(h)}`:``,_=``;s||(t.hasArrowEnd&&(_+=e.f` marker-end="url(#${t.endMarker??e.f`arrowhead${g}`})"`),t.hasArrowStart&&(_+=e.f` marker-start="url(#${t.startMarker??e.f`arrowhead-start${g}`})"`));let v=[e.f`class="edge${o?` edge-animated`:``}"`,e.f`data-from="${(0,e.escapeAttr)(t.source)}"`,e.f`data-to="${(0,e.escapeAttr)(t.target)}"`,e.f`data-style="${t.style}"`,e.f`data-arrow-start="${t.hasArrowStart}"`,e.f`data-arrow-end="${t.hasArrowEnd}"`];t.label&&v.push(e.f`data-label="${(0,e.escapeAttr)(t.label)}"`),t.id&&v.push(e.f`data-id="${(0,e.escapeAttr)(t.id)}"`);let y=o&&!c?` stroke-dasharray="8 6"`:``,b=a?yn(t):t.points,x=n===`linear`?d(b,u):p(b,n);return e.f`<path ${v.join(` `)} d="${x}" `+e.f`fill="none" stroke="${f}" `+e.f`stroke-width="${m}"${c}${y}${_}`+(i?e.f` mask="url(#${i})"`:``)+` />`}function Dn(t,n,r){if(!t.label)return``;let i=t.label,a=t.labelPosition??kn(t.points),o=(0,e.measureMultilineText)(i,r.edgeLabel,P.edgeLabel),s=(0,e.renderMultilineTextWithBackground)(i,a.x,a.y,o.width,o.height,r.edgeLabel,0,e.f`text-anchor="middle" font-size="${r.edgeLabel}" font-weight="${P.edgeLabel}" fill="var(--_text-sec)"`,`fill="var(--bg)"`);return e.f`<g class="edge-label" data-from="${(0,e.escapeAttr)(t.source)}" data-to="${(0,e.escapeAttr)(t.target)}" data-label="${(0,e.escapeAttr)(i)}">\n`+e.f` ${s.replace(/\n/g,`
20
- `)}\n`+`</g>`}function On(t,n){let r=t[n];if(!r)throw Error(e.f`edgeMidpoint: missing point at index ${n}`);return r}function kn(e){if(e.length===0)return{x:0,y:0};if(e.length===1)return e[0];let t=0;for(let n=1;n<e.length;n++)t+=An(On(e,n-1),On(e,n));let n=t/2;for(let t=1;t<e.length;t++){let r=On(e,t-1),i=On(e,t),a=An(r,i);if(n<=a){let e=n/a;return{x:r.x+e*(i.x-r.x),y:r.y+e*(i.y-r.y)}}n-=a}return e[e.length-1]}function An(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function jn(t,n,r,i=!0,a=!1){let o=zn(t,a),s=Er(t,n,r),c=[],l=(0,e.sanitizeClassName)(t.className),u=l?e.f`node ${l}`:`node`,d=t.interaction,f=[e.f`class="${u}"`,e.f`data-id="${(0,e.escapeAttr)(t.id)}"`,e.f`data-label="${(0,e.escapeAttr)(t.label)}"`,e.f`data-shape="${t.shape}"`];c.push(e.f`<g ${f.join(` `)}>`);let p=i?(0,e.safeHref)(d?.href):void 0,m=p?` `:` `;if(p){let t=d?.target?e.f` target="${(0,e.escapeAttr)(d.target)}"`:``;c.push(e.f` <a href="${(0,e.escapeAttr)(p)}"${t}>`)}return i&&d?.tooltip&&c.push(e.f`${m}<title>${(0,e.escapeXml)(d.tooltip)}</title>`),c.push(e.f`${m}${o.replace(/\n/g,e.f`\n${m}`)}`),s&&c.push(e.f`${m}${s.replace(/\n/g,e.f`\n${m}`)}`),p&&c.push(` </a>`),c.push(`</g>`),c.join(`
21
- `)}var Mn=13,Nn=5,Pn=5,Fn=4,In=2,Ln=8;function Rn(t,n,r,i=80){let a=i===80?e.f`transform="translate(${t} ${n})"`:e.f`transform="translate(${t} ${n}) scale(${i/80})"`;if(r===``)return e.f`<path ${a} d="M0,80 V5 Q0,0 5,0 H75 Q80,0 80,5 V80 Z" fill="none" stroke="var(--_node-stroke)" stroke-width="${In}" stroke-dasharray="${Ln}" />`;let o=se[r]??`<text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;">?</text>`;return e.f`<g ${a}><rect width="${80}" height="${80}" fill="${oe}" />${o}</g>`}function zn(t,n){let r=Bn(t,n),i=t.icon===void 0&&t.shape!==`small-circle`?Sn(t.inlineStyle):``;return i&&r?e.f`<g${i}>${r}</g>`:r}function Bn(t,n){let{x:r,y:i,width:a,height:o,shape:s}=t;if(t.icon!==void 0)return Rn(r,i,t.icon,t.width);let c=s===`small-circle`?void 0:t.inlineStyle,l=(0,e.escapeAttr)(c?.fill??`var(--_node-fill)`),u=(0,e.escapeAttr)(c?.stroke??`var(--_node-stroke)`),d=(0,e.escapeAttr)(c?.[`stroke-width`]??String(I.innerBox)),f=e=>e&&/^\d+(\.\d+)?(px)?$/.test(e)?parseFloat(e):0,p=f(c?.rx),m={rx:p,ry:c?.ry===void 0?p:f(c.ry)};switch(s){case`diamond`:return Gn(r,i,a,o,l,u,d);case`rounded`:return Hn(r,i,a,o,l,u,d,n?Pn:6);case`stadium`:return Un(r,i,a,o,l,u,d);case`circle`:return Wn(r,i,a,o,l,u,d);case`subroutine`:return Kn(r,i,a,o,l,u,d);case`doublecircle`:return qn(r,i,a,o,l,u,d);case`hexagon`:return Jn(r,i,a,o,l,u,d);case`cylinder`:return Yn(r,i,a,o,l,u,d);case`asymmetric`:return Xn(r,i,a,o,l,u,d);case`trapezoid`:return Zn(r,i,a,o,l,u,d);case`trapezoid-alt`:return Qn(r,i,a,o,l,u,d);case`parallelogram`:return $n(r,i,a,o,l,u,d);case`parallelogram-alt`:return er(r,i,a,o,l,u,d);case`state-start`:return wr(r,i,a,o);case`state-end`:return Tr(r,i,a,o);case`document`:return nr(r,i,a,o,l,u,d);case`stacked-document`:return rr(r,i,a,o,l,u,d,!0);case`stacked-process`:return rr(r,i,a,o,l,u,d,!1);case`card`:return ir(r,i,a,o,l,u,d);case`lined-process`:return ar(r,i,a,o,l,u,d);case`divided-process`:return or(r,i,a,o,l,u,d);case`window-pane`:return sr(r,i,a,o,l,u,d);case`triangle`:return cr(r,i,a,o,l,u,d,!1);case`flipped-triangle`:return cr(r,i,a,o,l,u,d,!0);case`junction`:return``;case`filled-circle`:return lr(r,i,a,o,u);case`crossed-circle`:return ur(r,i,a,o,l,u,d);case`fork-join`:return dr(r,i,a,o,u);case`note`:return gr(r,i,a,o,(0,e.escapeAttr)(c?.fill??`var(--bg)`),u,d);case`notched-pentagon`:return _r(r,i,a,o,l,u,d);case`sloped-rectangle`:return vr(r,i,a,o,l,u,d);case`flag`:return yr(r,i,a,o,l,u,d);case`bow-tie-rectangle`:return br(r,i,a,o,l,u,d);case`half-rounded-rectangle`:return xr(r,i,a,o,l,u,d);case`brace`:return Sr(r,i,a,o,l,u,d,`left`);case`brace-right`:return Sr(r,i,a,o,l,u,d,`right`);case`braces`:return Sr(r,i,a,o,l,u,d,`both`);case`bolt`:return Cr(r,i,a,o,l,u,d);case`cloud`:return fr(r,i,a,o,l,u,d);case`horizontal-cylinder`:return pr(r,i,a,o,l,u,d);case`tagged-rectangle`:return mr(r,i,a,o,l,u,d);case`fork-bar`:return Vn(r,i,a,o,l,u,d);case`small-circle`:return hr(r,i,a,o,l,u,d);case`text`:case`anchor`:return``;default:return Vn(r,i,a,o,l,u,d,m)}}function Vn(t,n,r,i,a,o,s,c={rx:0,ry:0}){return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" `+e.f`rx="${c.rx}" ry="${c.ry}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Hn(t,n,r,i,a,o,s,c){return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" `+e.f`rx="${c}" ry="${c}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Un(t,n,r,i,a,o,s){let c=i/2;return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" `+e.f`rx="${c}" ry="${c}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Wn(t,n,r,i,a,o,s){let c=t+r/2,l=n+i/2,u=Math.min(r,i)/2;return e.f`<circle cx="${c}" cy="${l}" r="${u}" `+e.f`fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Gn(t,n,r,i,a,o,s){let c=t+r/2,l=n+i/2,u=r/2,d=i/2,f=[e.f`${c},${l-d}`,e.f`${c+u},${l}`,e.f`${c},${l+d}`,e.f`${c-u},${l}`].join(` `);return e.f`<polygon points="${f}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Kn(t,n,r,i,a,o,s){return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" `+e.f`rx="0" ry="0" fill="${a}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<line x1="${t+8}" y1="${n}" x2="${t+8}" y2="${n+i}" `+e.f`stroke="${o}" stroke-width="${s}" />`+e.f`\n<line x1="${t+r-8}" y1="${n}" x2="${t+r-8}" y2="${n+i}" `+e.f`stroke="${o}" stroke-width="${s}" />`}function qn(t,n,r,i,a,o,s){let c=t+r/2,l=n+i/2,u=Math.min(r,i)/2,d=u-5;return e.f`<circle cx="${c}" cy="${l}" r="${u}" `+e.f`fill="${a}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<circle cx="${c}" cy="${l}" r="${d}" `+e.f`fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Jn(t,n,r,i,a,o,s){let c=i/3.5,l=[e.f`${t+c},${n}`,e.f`${t+r-c},${n}`,e.f`${t+r},${n+i/2}`,e.f`${t+r-c},${n+i}`,e.f`${t+c},${n+i}`,e.f`${t},${n+i/2}`].join(` `);return e.f`<polygon points="${l}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Yn(t,n,r,i,a,o,s){let c=t+r/2,l=n+7,u=i-14;return e.f`<rect x="${t}" y="${l}" width="${r}" height="${u}" `+e.f`fill="${a}" stroke="none" />`+e.f`\n<line x1="${t}" y1="${l}" x2="${t}" y2="${l+u}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<line x1="${t+r}" y1="${l}" x2="${t+r}" y2="${l+u}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<ellipse cx="${c}" cy="${n+i-7}" rx="${r/2}" ry="${7}" `+e.f`fill="${a}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<ellipse cx="${c}" cy="${l}" rx="${r/2}" ry="${7}" `+e.f`fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Xn(t,n,r,i,a,o,s){let c=[e.f`${t},${n}`,e.f`${t+r},${n}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`,e.f`${t+12},${n+i/2}`].join(` `);return e.f`<polygon points="${c}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Zn(t,n,r,i,a,o,s){let c=r*.15,l=[e.f`${t+c},${n}`,e.f`${t+r-c},${n}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`].join(` `);return e.f`<polygon points="${l}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Qn(t,n,r,i,a,o,s){let c=r*.15,l=[e.f`${t},${n}`,e.f`${t+r},${n}`,e.f`${t+r-c},${n+i}`,e.f`${t+c},${n+i}`].join(` `);return e.f`<polygon points="${l}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function $n(t,n,r,i,a,o,s){let c=r*.15,l=[e.f`${t+c},${n}`,e.f`${t+r},${n}`,e.f`${t+r-c},${n+i}`,e.f`${t},${n+i}`].join(` `);return e.f`<polygon points="${l}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function er(t,n,r,i,a,o,s){let c=r*.15,l=[e.f`${t},${n}`,e.f`${t+r-c},${n}`,e.f`${t+r},${n+i}`,e.f`${t+c},${n+i}`].join(` `);return e.f`<polygon points="${l}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function tr(t,n,r){return e.f`fill="${t}" stroke="${n}" stroke-width="${r}"`}function nr(t,n,r,i,a,o,s){let c=Math.min(10,i*.16),l=n+i-c,u=e.f`M ${t} ${n} L ${t+r} ${n} L ${t+r} ${l} `+e.f`C ${t+r*.75} ${l+c*1.8} ${t+r*.25} ${l-c*.8} ${t} ${l} Z`;return e.f`<path d="${u}" ${tr(a,o,s)} />`}function rr(t,n,r,i,a,o,s,c){let l=r-10,u=i-10,d=[];for(let r=2;r>=1;r--)d.push(e.f`<rect x="${t+5*r}" y="${n+5*(2-r)}" width="${l}" height="${u}" `+e.f`${tr(a,o,s)} />`);return d.push(c?nr(t,n+10,l,u,a,o,s):e.f`<rect x="${t}" y="${n+10}" width="${l}" height="${u}" ${tr(a,o,s)} />`),d.join(`
22
- `)}function ir(t,n,r,i,a,o,s){let c=Math.min(14,r*.12,i*.3),l=[e.f`${t+c},${n}`,e.f`${t+r},${n}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`,e.f`${t},${n+c}`].join(` `);return e.f`<polygon points="${l}" ${tr(a,o,s)} />`}function ar(t,n,r,i,a,o,s){let c=Math.min(12,r*.12);return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" ${tr(a,o,s)} />\n`+e.f`<line x1="${t+c}" y1="${n}" x2="${t+c}" y2="${n+i}" stroke="${o}" stroke-width="${s}" />`}function or(t,n,r,i,a,o,s){let c=n+Math.min(16,i*.3);return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" ${tr(a,o,s)} />\n`+e.f`<line x1="${t}" y1="${c}" x2="${t+r}" y2="${c}" stroke="${o}" stroke-width="${s}" />`}function sr(t,n,r,i,a,o,s){let c=t+Math.min(16,r*.16),l=n+Math.min(14,i*.28);return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" ${tr(a,o,s)} />\n`+e.f`<line x1="${c}" y1="${n}" x2="${c}" y2="${n+i}" stroke="${o}" stroke-width="${s}" />\n`+e.f`<line x1="${t}" y1="${l}" x2="${t+r}" y2="${l}" stroke="${o}" stroke-width="${s}" />`}function cr(t,n,r,i,a,o,s,c){let l=c?[e.f`${t},${n}`,e.f`${t+r},${n}`,e.f`${t+r/2},${n+i}`]:[e.f`${t+r/2},${n}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`];return e.f`<polygon points="${l.join(` `)}" ${tr(a,o,s)} />`}function lr(t,n,r,i,a){let o=Math.min(r,i)/2;return e.f`<circle cx="${t+r/2}" cy="${n+i/2}" r="${o}" fill="${a}" stroke="${a}" />`}function ur(t,n,r,i,a,o,s){let c=t+r/2,l=n+i/2,u=Math.min(r,i)/2-2,d=u/Math.SQRT2;return e.f`<circle cx="${c}" cy="${l}" r="${u}" ${tr(a,o,s)} />\n`+e.f`<line x1="${c-d}" y1="${l-d}" x2="${c+d}" y2="${l+d}" stroke="${o}" stroke-width="${s}" />\n`+e.f`<line x1="${c+d}" y1="${l-d}" x2="${c-d}" y2="${l+d}" stroke="${o}" stroke-width="${s}" />`}function dr(t,n,r,i,a){let o=Math.min(8,i);return e.f`<rect x="${t}" y="${n+(i-o)/2}" width="${r}" height="${o}" fill="${a}" stroke="${a}" />`}function fr(t,n,r,i,a,o,s){let c=r/1.25,l=i-.48*c,[u,d,f,p]=[.15*c,.25*c,.35*c,.2*c],m=e.f`M0 0 a${u},${u} 0 0,1 ${.25*c},${-.1*c} `+e.f`a${f},${f} 1 0,1 ${.4*c},${-.1*c} `+e.f`a${d},${d} 1 0,1 ${.35*c},${.2*c} `+e.f`a${u},${u} 1 0,1 ${.15*c},${.35*l} `+e.f`a${p},${p} 1 0,1 ${-.15*c},${.65*l} `+e.f`a${d},${u} 1 0,1 ${-.25*c},${.15*c} `+e.f`a${f},${f} 1 0,1 ${-.5*c},0 `+e.f`a${u},${u} 1 0,1 ${-.25*c},${-.15*c} `+e.f`a${u},${u} 1 0,1 ${-.1*c},${-.35*l} `+e.f`a${p},${p} 1 0,1 ${.1*c},${-.65*l} H0 V0 Z`;return e.f`<path transform="translate(${t+.1*c} ${n+.225*c})" d="${m}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function pr(t,n,r,i,a,o,s){let c=i/2,l=c/(2.5+i/50),u=r-2*l;return e.f`<path d="M${t+l},${n+i} a${l},${c} 0,0,1 0,${-i} l${u},0 a${l},${c} 0,0,1 0,${i} `+e.f`l${-u},0 Z" fill="${a}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<path d="M${t+l+u},${n} a${l},${c} 0,0,0 0,${i}" fill="none" stroke="${o}" stroke-width="${s}" />`}function mr(t,n,r,i,a,o,s){let c=.2*i;return Vn(t,n,r,i,a,o,s)+e.f`\n<polygon points="${t+r-c},${n+i} ${t+r},${n+i} ${t+r},${n+i-c}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function hr(t,n,r,i,a,o,s){return e.f`<circle cx="${t+r/2}" cy="${n+i/2}" r="7" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function gr(t,n,r,i,a,o,s){let c=[e.f`${t},${n}`,e.f`${t+r-6},${n}`,e.f`${t+r},${n+6}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`].join(` `);return e.f`<polygon points="${c}" fill="${a}" stroke="${o}" stroke-width="${s}" />\n`+e.f`<polygon points="${t+r-6},${n} ${t+r},${n+6} ${t+r-6},${n+6}" fill="var(--_inner-stroke)" stroke="${o}" stroke-width="${s}" />`}function _r(t,n,r,i,a,o,s){let c=Math.min(14,r*.12,i*.3),l=[e.f`${t+c},${n}`,e.f`${t+r-c},${n}`,e.f`${t+r},${n+c}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`,e.f`${t},${n+c}`].join(` `);return e.f`<polygon points="${l}" ${tr(a,o,s)} />`}function vr(t,n,r,i,a,o,s){let c=Math.min(12,i*.3),l=[e.f`${t},${n+c}`,e.f`${t+r},${n}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`].join(` `);return e.f`<polygon points="${l}" ${tr(a,o,s)} />`}function yr(t,n,r,i,a,o,s){let c=Math.min(8,i*.14),l=e.f`M ${t} ${n+c} `+e.f`C ${t+r*.25} ${n-c} ${t+r*.75} ${n+c*2} ${t+r} ${n+c} `+e.f`L ${t+r} ${n+i-c} `+e.f`C ${t+r*.75} ${n+i+c} ${t+r*.25} ${n+i-c*2} ${t} ${n+i-c} Z`;return e.f`<path d="${l}" ${tr(a,o,s)} />`}function br(t,n,r,i,a,o,s){let c=Math.min(14,r*.12),l=e.f`M ${t+c} ${n} L ${t+r} ${n} `+e.f`Q ${t+r-c*1.4} ${n+i/2} ${t+r} ${n+i} `+e.f`L ${t+c} ${n+i} `+e.f`Q ${t+c*1.4} ${n+i/2} ${t+c} ${n} Z`;return e.f`<path d="${l}" ${tr(a,o,s)} />`}function xr(t,n,r,i,a,o,s){let c=i/2,l=Math.max(0,r-c),u=e.f`M ${t} ${n} L ${t+l} ${n} `+e.f`A ${c} ${c} 0 0 1 ${t+l} ${n+i} `+e.f`L ${t} ${n+i} Z`;return e.f`<path d="${u}" ${tr(a,o,s)} />`}function Sr(t,n,r,i,a,o,s,c){let l=Math.min(10,r*.12),u=[e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" fill="none" stroke="none" />`],d=e.f`M ${t+l} ${n} Q ${t} ${n} ${t} ${n+i*.25} `+e.f`Q ${t} ${n+i/2} ${t-l*.4} ${n+i/2} `+e.f`Q ${t} ${n+i/2} ${t} ${n+i*.75} `+e.f`Q ${t} ${n+i} ${t+l} ${n+i}`,f=e.f`M ${t+r-l} ${n} Q ${t+r} ${n} ${t+r} ${n+i*.25} `+e.f`Q ${t+r} ${n+i/2} ${t+r+l*.4} ${n+i/2} `+e.f`Q ${t+r} ${n+i/2} ${t+r} ${n+i*.75} `+e.f`Q ${t+r} ${n+i} ${t+r-l} ${n+i}`;return(c===`left`||c===`both`)&&u.push(e.f`<path d="${d}" fill="none" stroke="${o}" stroke-width="${s}" />`),(c===`right`||c===`both`)&&u.push(e.f`<path d="${f}" fill="none" stroke="${o}" stroke-width="${s}" />`),u.join(`
23
- `)}function Cr(t,n,r,i,a,o,s){let c=[e.f`${t+r*.42},${n}`,e.f`${t+r},${n}`,e.f`${t+r*.62},${n+i*.42}`,e.f`${t+r},${n+i*.42}`,e.f`${t+r*.3},${n+i}`,e.f`${t+r*.5},${n+i*.55}`,e.f`${t},${n+i*.55}`].join(` `);return e.f`<polygon points="${c}" ${tr(a,o,s)} />`}function wr(t,n,r,i){let a=t+r/2,o=n+i/2,s=Math.min(r,i)/2;return e.f`<circle cx="${a}" cy="${o}" r="${s}" fill="var(--_text)" stroke="none" />`}function Tr(t,n,r,i){let a=t+r/2,o=n+i/2,s=Math.min(r,i)/2,c=s*5/14;return e.f`<circle cx="${a}" cy="${o}" r="${s}" `+e.f`fill="none" stroke="var(--_text)" stroke-width="2" />`+e.f`\n<circle cx="${a}" cy="${o}" r="${c}" fill="var(--_text)" stroke="none" />`}function Er(t,n,r){if((t.shape===`state-start`||t.shape===`state-end`)&&!t.label)return``;let i=t.x+t.width/2+(t.shape===`asymmetric`?6:0),a=t.label.split(`
24
- `).length,o=t.icon===void 0?t.y+t.height/2:t.y+t.height+Mn+(a-1)/2*r.nodeLabel*e.LINE_HEIGHT_RATIO,s=(0,e.escapeAttr)(t.inlineStyle?.color??`var(--_text)`),c=e.f`text-anchor="middle" font-size="${r.nodeLabel}" font-weight="${P.nodeLabel}" fill="${s}"`,l=t.inlineStyle?.[`font-family`];return l&&(c+=e.f` style="font-family: ${(0,e.escapeAttr)(l)};"`),(0,e.renderMultilineText)(t.label,i,o,r.nodeLabel,c)}function Dr(t){return(0,e.escapeAttr)(t).replace(/\r/g,`&#13;`).replace(/\n/g,`&#10;`).replace(/\t/g,`&#9;`)}function R(t,n){return n===void 0?t:t.replace(`<svg `,e.f`<svg data-src="${Dr(n)}" `)}var Or=class{raw=new Map;resolved=new Map;inProgress=new Set;declare(e,t){this.raw.set(e,t),this.resolved.delete(e)}lookup(e){if(this.resolved.has(e))return this.resolved.get(e);let t=this.raw.get(e);if(t===void 0||this.inProgress.has(e))return;this.inProgress.add(e);let n=Fr(t,this).trim();this.inProgress.delete(e);let r=!/\bvar\(|\bcolor-mix\(/.test(n);return this.resolved.set(e,r?n:void 0),r?n:void 0}};function kr(e,t){let n=0;for(let r=t;r<e.length;r++){let t=e[r];if(t===`(`)n++;else if(t===`)`&&(n--,n===0))return r}return-1}function Ar(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`?n++:a===`)`?n--:a===`,`&&n===0&&(t.push(e.slice(r,i)),r=i+1)}return t.push(e.slice(r)),t}var jr=`(?<![\\w-])(var|color-mix)\\(`;function Mr(e,t){let[n,...r]=Ar(e),i=(n??``).trim(),a=t.lookup(i);return a===void 0?r.length>0?r.join(`,`).trim():null:a}function Nr(e){let t=e.trim().split(/\s+/),n,r;for(let e of t)if(/^[\d.]+%$/.test(e)){if(r!==void 0)return null;r=Number(e.slice(0,-1))}else{if(n!==void 0)return null;n=e}return n===void 0?null:{color:n,pct:r}}function Pr(t){let n=Ar(t);if(n.length!==3)return null;let[r,i,a]=n;if(r===void 0||i===void 0||a===void 0||!/^\s*in\s+srgb\s*$/i.test(r))return null;let o=Nr(i),s=Nr(a);if(!o||!s)return null;let c=(0,e.parseCssColor)(o.color),l=(0,e.parseCssColor)(s.color);if(!c||!l)return null;let u=(0,e.mixSrgb)(c,l,o.pct,s.pct);return u?(0,e.formatCssColor)(u):null}function Fr(e,t){let n=``,r=0,i=new RegExp(jr,`g`),a;for(;(a=i.exec(e))!==null;){let o=a[1];if(o===void 0)continue;let s=a.index,c=s+o.length,l=kr(e,c);if(l===-1)break;let u=Fr(e.slice(c+1,l),t),d=o===`var`?Mr(u,t):Pr(u);n+=e.slice(r,s),n+=d??`${o}(${u})`,r=l+1,i.lastIndex=r}return n+e.slice(r)}function Ir(e,t){let n=new Or;for(let[e,r]of Object.entries(t))n.declare(e,r);return Fr(e,n)}var Lr=/(--[\w-]+)\s*:\s*([^;{}]+)/g,Rr=/(\s)([\w:.-]+)(=)("[^"]*"|'[^']*')/g,zr=new Set([`data-src`]);function Br(e,t){Lr.lastIndex=0;let n;for(;(n=Lr.exec(e))!==null;){let[,e,r]=n;e!==void 0&&r!==void 0&&t.declare(e,r.trim())}}function Vr(e,t){return e.replace(Rr,(e,n,r,i,a)=>{if(zr.has(r))return e;let o=a[0]??`"`;return`${n}${r}${i}${o}${Fr(a.slice(1,-1),t)}${o}`})}function Hr(e,t){let n=new Or;n.declare(`--bg`,t.bg),n.declare(`--fg`,t.fg),t.line&&n.declare(`--line`,t.line),t.accent&&n.declare(`--accent`,t.accent),t.muted&&n.declare(`--muted`,t.muted),t.surface&&n.declare(`--surface`,t.surface),t.border&&n.declare(`--border`,t.border);for(let t of e.matchAll(/<style[^>]*>([\s\S]*?)<\/style>/g)){let e=t[1];e!==void 0&&Br(e,n)}for(let t of e.matchAll(/\sstyle=("[^"]*"|'[^']*')/g)){let e=t[1];e!==void 0&&Br(e.slice(1,-1),n)}let r=``,i=0;for(;i<e.length;){let t=e.indexOf(`<`,i);if(t===-1)break;if(r+=e.slice(i,t),e.startsWith(`<style`,t)){let a=e.indexOf(`>`,t),o=e.indexOf(`</style>`,t);if(a===-1||o===-1)break;r+=e.slice(t,a+1),r+=Fr(e.slice(a+1,o),n),r+=`</style>`,i=o+8;continue}let a=-1,o=null;for(let n=t+1;n<e.length;n++){let t=e[n];if(o!==null)t===o&&(o=null);else if(t===`"`||t===`'`)o=t;else if(t===`>`){a=n;break}}if(a===-1)break;let s=e.slice(t,a+1);r+=s.startsWith(`<!`)||s.startsWith(`<?`)||s.startsWith(`</`)?s:Vr(s,n),i=a+1}return r+e.slice(i)}var Ur=[.3013,.3672,.3247,.5244,.5244,.6001,.7061,.1597,.3672,.3672,.3672,.5244,.3672,.3672,.3672,.5244,.5244,.5244,.5244,.5244,.5244,.5244,.5244,.5244,.5244,.5244,.3672,.3672,.5244,.5244,.5244,.3672,.7705,.5898,.5659,.5981,.6133,.5356,.5249,.6763,.6543,.2783,.4766,.5757,.5063,.7095,.6382,.6738,.5576,.6758,.582,.481,.5806,.6484,.5874,.8521,.5566,.5703,.5503,.3672,.3555,.3672,.5244,.5244,.5244,.5254,.5571,.4951,.5571,.5454,.3696,.502,.5464,.2852,.3667,.5044,.2949,.8301,.5464,.5366,.5571,.5571,.3887,.4048,.3965,.5464,.4897,.7441,.501,.4932,.4746,.3672,.5244,.3672,.5244],Wr=[.3013,.3672,.3667,.5859,.5859,.6841,.7061,.2295,.3672,.3672,.4321,.5859,.3672,.3672,.3672,.3901,.5859,.5859,.5859,.5859,.5859,.5859,.5859,.5859,.5859,.5859,.3672,.3672,.5859,.5859,.5859,.438,.7705,.6333,.5952,.6118,.6426,.5688,.5835,.6714,.6836,.2783,.5327,.6172,.5527,.7451,.6675,.7031,.5869,.709,.6108,.5112,.6118,.6777,.6216,.8838,.6006,.6133,.5601,.4019,.3555,.4019,.5859,.5859,.5859,.5327,.5815,.5117,.5806,.5747,.3696,.502,.5928,.2983,.3667,.5479,.2949,.8594,.5903,.5659,.5825,.584,.4272,.4307,.3965,.5908,.5273,.7837,.5522,.5337,.5283,.4336,.5859,.4336,.5859];function Gr(e){return e>=4352?1:.6}function Kr(e,t){let n=t?Wr:Ur,r=t?.5859:.5244,i=0;for(let t of e){let e=t.codePointAt(0);i+=e>=32&&e<=126?n[e-32]:e===171||e===187?r:Gr(e)}return i*16}var z={padding:40,boxPadX:8,headerBaseHeight:32,annotationHeight:16,memberRowHeight:20,sectionPadY:8,emptySectionHeight:16,emptyBareSectionHeight:12,mermaidPad:12,memberFontSize:11,memberFontWeight:400,nodeSpacing:40,layerSpacing:60,notePadX:10,notePadY:6,namespaceTitleHeight:28,namespacePad:16,namespaceTitleFontSize:12,lollipopLabelHeight:32,lollipopLabelPadX:8};function qr(e){return`note ${e}`}function Jr(e){return`${e} link`}function Yr(e){return`namespace ${e}`}function Xr(e){let t=new Set(e.classes.map(e=>e.id)),n=new Set,r=[];for(let[i,a]of e.namespaces.entries()){let e=[];for(let r of a.classIds)!t.has(r)||n.has(r)||(n.add(r),e.push(r));e.length>0&&r.push({id:Yr(i),name:a.name,classIds:e})}return r}function Zr(e){let t=new Map,n=new Set,r=[],i=new Map,a=e.relationships.map((a,o)=>{if(a.type!==`lollipop`||a.markerAt===`both`)return a;let s=a.markerAt===`from`,c=s?a.from:a.to,l=`lollipop ${r.length}`;return t.set(o,l),i.set(l,s?a.to:a.from),n.add(c),r.push({id:l,label:e.classes.find(e=>e.id===c)?.label??c,attributes:[],methods:[]}),s?{...a,from:l}:{...a,to:l}}),o=new Map(r.map(e=>[e.id,e.label]));if(r.length===0)return{diagram:e,labels:o,byRelationship:t};let s=new Set(a.flatMap(e=>[e.from,e.to]));for(let t of e.notes)t.forClass&&s.add(t.forClass);for(let t of e.namespaces)for(let e of t.classIds)s.add(e);let c=e=>n.has(e.id)&&!s.has(e.id)&&!e.annotation&&e.attributes.length===0&&e.methods.length===0,l=[...e.classes.filter(e=>!c(e)),...r],u=e.namespaces.map(e=>({...e,classIds:[...e.classIds,...r.filter(t=>e.classIds.includes(i.get(t.id)??``)).map(e=>e.id)]}));return{diagram:{...e,classes:l,relationships:a,namespaces:u},labels:o,byRelationship:t}}function Qr(t){return(0,e.findBackEdges)(t.relationships.map(e=>({source:e.from,target:e.to})),t.classes.map(e=>e.id))}function $r(t,n,r){let i=new Map,a=new Map,o=N(n.fontSizes),s=t.layout?.padding??z.mermaidPad,c=s-z.mermaidPad;for(let e of t.classes){if(r.has(e.id)){i.set(e.id,{width:k(e.label,o.nodeLabel,P.edgeLabel)+z.lollipopLabelPadX*2,height:z.lollipopLabelHeight,headerHeight:z.lollipopLabelHeight,attrHeight:0,methodHeight:0});continue}let n=Math.max(0,(e.annotation?z.headerBaseHeight+z.annotationHeight:z.headerBaseHeight)+c*2),a=e.attributes.length+e.methods.length===0,l=a&&t.layout?.hideEmptyMembersBox===!0?0:Math.max(0,(a?z.emptyBareSectionHeight:z.emptySectionHeight)+c*2),u=e.attributes.length>0?e.attributes.length*z.memberRowHeight+Math.max(0,z.sectionPadY+c*2):l,d=e.methods.length>0?e.methods.length*z.memberRowHeight+Math.max(0,z.sectionPadY+c*2):l,f=k(e.label,o.nodeLabel,P.nodeLabel),p=ai(e.attributes),m=ai(e.methods),h=Math.max(ii(e,s),f+z.boxPadX*2,p+z.boxPadX*2,m+z.boxPadX*2),g=n+u+d;i.set(e.id,{width:h,height:g,headerHeight:n,attrHeight:u,methodHeight:d})}let l=Xr(t),u=new Map;for(let e of l)for(let t of e.classIds)u.set(t,e.id);let d=new Map,f=[];for(let e of l){let t=k(e.name,z.namespaceTitleFontSize,P.groupHeader)+z.namespacePad*2,n={id:e.id,children:[],layoutOptions:{"elk.padding":ue({top:z.namespaceTitleHeight+z.namespacePad/2,left:z.namespacePad,bottom:z.namespacePad,right:z.namespacePad}),"elk.nodeSize.constraints":`MINIMUM_SIZE`,"elk.nodeSize.minimum":`(${Math.ceil(t)}, 0)`}};d.set(e.id,n),f.push(n)}for(let[e,t]of i){let n=fe(e,t),r=d.get(u.get(e)??``);r?.children?r.children.push(n):f.push(n)}let p={fontSize:o.edgeLabel},m=Qr(t),h=[];for(let[e,n]of t.relationships.entries()){let t=m.has(e);h.push(he({id:`e${e}`,source:t?n.to:n.from,target:t?n.from:n.to,label:n.label,labelStyle:p}))}let g=new Set(i.keys());for(let[n,r]of t.notes.entries()){let t=qr(n),i=(0,e.measureMultilineText)(r.text,o.edgeLabel,P.edgeLabel),s={width:i.width+z.notePadX*2,height:i.height+z.notePadY*2};a.set(t,s),f.push(fe(t,s)),r.forClass!==void 0&&g.has(r.forClass)&&h.push(he({id:Jr(t),source:t,target:r.forClass,labelStyle:p}))}return{elkGraph:{id:`root`,layoutOptions:{...de({direction:le(t.direction,ce.class),nodeSpacing:z.nodeSpacing,layerSpacing:z.layerSpacing,padding:z.padding}),"elk.edgeLabels.placement":`CENTER`,"elk.hierarchyHandling":`INCLUDE_CHILDREN`,"elk.separateConnectedComponents":`false`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,"elk.layered.nodePlacement.bk.fixedAlignment":`BALANCED`},children:f,edges:h},classSizes:i,noteSizes:a,namespaces:l}}function ei(t,n,r,i,a,o){let s=new Map;for(let e of n.classes)s.set(e.id,e);let c=new Set(a.map(e=>e.id)),l=new Map,u=[];for(let e of t.children??[])if(c.has(e.id)){let t=e.x??0,n=e.y??0;l.set(e.id,{x:t,y:n});for(let r of e.children??[])u.push({...r,x:(r.x??0)+t,y:(r.y??0)+n})}else u.push(e);let d=e=>{let t=e.container;return t&&l.get(t)||{x:0,y:0}},f=[];for(let e of a){let n=(t.children??[]).find(t=>t.id===e.id);n&&f.push({name:e.name,classIds:e.classIds.filter(e=>!o.labels.has(e)),x:n.x??0,y:n.y??0,width:n.width??0,height:n.height??0})}let p=[];for(let t of u){let i=s.get(t.id);if(i){let a=r.get(i.id);if(!a)throw Error(`Missing computed size for class "${i.id}"`);p.push({id:i.id,label:i.label,annotation:i.annotation,attributes:i.attributes,methods:i.methods,x:t.x??0,y:t.y??0,width:t.width??a.width,height:t.height??a.height,headerHeight:a.headerHeight,attrHeight:a.attrHeight,methodHeight:a.methodHeight,interaction:n.interactions.get(i.id),inlineStyle:(0,e.resolveNodeStyle)(i.id,n),className:n.classAssignments.get(i.id)})}}let m=[],h=Qr(o.diagram),g=new Map;for(let e of u)g.set(e.id,e);let _=new Map;for(let[e,t]of o.labels){let n=g.get(e);_.set(e,{text:t,x:n?.x??0,y:n?.y??0,width:n?.width??0,height:n?.height??0})}let v=t.edges??[];for(let[e,t]of n.relationships.entries()){let n=v[e];if(!n)throw Error(`Missing ELK edge for relationship ${e}`);let r=d(n),i=ht(n,r.x,r.y),a=h.has(e)?i.reverse():i,s=gt(n,r.x,r.y),c=_.get(o.byRelationship.get(e)??``);m.push({from:t.from,to:t.to,type:t.type,markerAt:t.markerAt,...t.dashed?{dashed:!0}:{},label:t.label,fromCardinality:t.fromCardinality,toCardinality:t.toCardinality,points:a,labelPosition:s,...c?{interfaceLabel:c}:{}})}let y=new Map;for(let e of v.slice(n.relationships.length))y.set(e.id,e);let b=[];for(let[e,t]of n.notes.entries()){let n=qr(e),r=g.get(n),a=i.get(n);if(!r||!a)throw Error(`Missing layout for note ${e}`);let o=y.get(Jr(n));b.push({id:n,text:t.text,...o&&t.forClass!==void 0?{forClass:t.forClass}:{},x:r.x??0,y:r.y??0,width:r.width??a.width,height:r.height??a.height,...o?{linkPoints:ht(o,d(o).x,d(o).y)}:{}})}return{width:t.width??600,height:t.height??400,classes:p,relationships:m,notes:b,namespaces:f}}function ti(e,t={}){if(e.classes.length===0&&e.notes.length===0)return{width:0,height:0,classes:[],relationships:[],notes:[],namespaces:[]};let n=Zr(e),{elkGraph:r,classSizes:i,noteSizes:a,namespaces:o}=$r(n.diagram,t,n.labels);return ei(E(r,t.layoutCache),e,i,a,o,n)}function ni(e){return e.length*Math.ceil(A(`M`,z.memberFontSize))}function ri(e){let t=e.isMethod?`${e.name}(${e.params||``})`:e.name;return`${e.visibility||``}${e.visibilitySpace?` `:``}${t}${e.isMethod&&e.type?` : ${e.type}`:``}`}function ii(e,t=z.mermaidPad){let n=Kr(e.label,!0),r=e.annotation?Kr(`\u00ab${e.annotation}\u00bb`,!1):0,i=Math.max(0,...[...e.attributes,...e.methods].map(e=>Kr(ri(e),!1))),a=Math.max(n,r);return a/2+Math.max(a/2,i)+t*2}function ai(e){if(e.length===0)return 0;let n=0;for(let r of e){let e=ni((0,t.formatClassMember)(r));e>n&&(n=e)}return n}var oi={memberSize:11,memberWeight:400,annotationSize:10,annotationWeight:500};function si(t,n,r=`Inter`,i=!1,a=M,o,s,c,l=!0,u={}){let d=[],f=l&&t.classes.some(t=>!!(0,e.safeHref)(t.interaction?.href));d.push(R((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,f,u.styleAttribute,u.description),o)),d.push(ie(r,!0,u.nonce,u.bodyFont)),d.push(`<defs>`),d.push(li(t.relationships.some(e=>e.type===`lollipop`))),d.push(`</defs>`);for(let e of t.namespaces)d.push(ci(e));for(let e of t.relationships)d.push(gi(e));for(let e of t.notes)d.push(hi(e));for(let e of t.classes)d.push(ui(e,a,l));for(let e of t.relationships){let t=_i(e,a);t&&d.push(t)}for(let e of t.notes)d.push(mi(e,a));for(let e of t.relationships)d.push(bi(e,a));return d.push(`</svg>`),d.join(`
25
- `)}function ci(t){let{x:n,y:r,width:i,height:a}=t,o=z.namespaceTitleHeight,s=I.outerBox;return[e.f`<g class="class-namespace" data-id="${(0,e.escapeAttr)(t.name)}" data-label="${(0,e.escapeAttr)(t.name)}">`,e.f` <rect x="${n}" y="${r}" width="${i}" height="${a}" rx="0" ry="0" fill="var(--_group-fill)" stroke="var(--_node-stroke)" stroke-width="${s}" />`,e.f` <rect x="${n}" y="${r}" width="${i}" height="${o}" rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${s}" />`,e.f` <text x="${n+z.namespacePad}" y="${r+o/2}" dy="${L}" font-size="${z.namespaceTitleFontSize}" font-weight="${P.groupHeader}" fill="var(--_text-sec)">${Oi(t.name)}</text>`,`</g>`].join(`
26
- `)}function li(e){return` <marker id="cls-inherit" markerWidth="12" markerHeight="10" refX="12" refY="5" orient="auto-start-reverse">
17
+ `+r(e.f`arrowhead-start${n}`,`auto-start-reverse`)}function xn(t){return t===`circle`?e.f`<marker id="circle" viewBox="0 0 10 10" refX="12.25" refY="5" markerUnits="userSpaceOnUse" markerWidth="14" markerHeight="14" orient="auto-start-reverse"><circle cx="5" cy="5" r="5" fill="var(--_arrow)"/></marker>`:e.f`<marker id="cross" viewBox="0 0 15 15" refX="17.7" refY="7.5" markerUnits="userSpaceOnUse" markerWidth="12" markerHeight="12" orient="auto-start-reverse"><path d="M1 1L14 14M1 14L14 1" stroke="var(--_arrow)" stroke-width="2.5"/></marker>`}var Sn=5.5;function Cn(e){let t=e.points.map(e=>({...e})),n=(e,n)=>{let r=t[e],i=t[n],a=Math.hypot(i.x-r.x,i.y-r.y);a<=Sn||(r.x+=(i.x-r.x)/a*Sn,r.y+=(i.y-r.y)/a*Sn)};return e.hasArrowEnd&&!e.endMarker&&n(t.length-1,t.length-2),e.hasArrowStart&&!e.startMarker&&n(0,1),t}function wn(e){return e.headColor??e.inlineStyle?.stroke}function Tn(e){return e.replace(/[^a-zA-Z0-9]/g,e=>e.charCodeAt(0).toString(16))}function En(t){let n=t?.[`stroke-dasharray`];return n&&/^[\d.\s,]+$/.test(n)?e.f` stroke-dasharray="${n.trim()}"`:``}var Dn=30,On=12;function kn(t,n,r){let i=r.groupHeader+16,a=[];if(t.region){a.push(e.f`<g class="subgraph subgraph-region" data-id="${(0,e.escapeAttr)(t.id)}">`,e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" `+e.f`rx="0" ry="0" fill="none" stroke="var(--_node-stroke)" stroke-width="${I.outerBox}" stroke-dasharray="6 4" />`);for(let e of t.children)a.push(kn(e,n,r));return a.push(`</g>`),a.join(`
18
+ `)}if(t.architecture){let i=t.iconSize??Dn,o=i>0&&t.icon&&(se[t.icon]??`<text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;">?</text>`);a.push(e.f`<g class="subgraph" data-id="${(0,e.escapeAttr)(t.id)}" data-label="${(0,e.escapeAttr)(t.label)}">`,e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" fill="none" stroke="var(--_node-stroke)" stroke-width="${Bn}" stroke-dasharray="${Vn}" />`),o&&a.push(e.f` <g transform="translate(${t.x+1} ${t.y+1}) scale(${i/80})"><rect width="${80}" height="${80}" fill="${oe}" />${o}</g>`),a.push(` `+(0,e.renderMultilineText)(t.label,t.x+(t.icon?i+4:6),t.y+1+Dn/2,r.groupHeader,e.f`font-size="${r.groupHeader}" font-weight="400" fill="var(--_text)"`));for(let e of t.children)a.push(kn(e,n,r));return a.push(`</g>`),a.join(`
19
+ `)}a.push(e.f`<g class="subgraph" data-id="${(0,e.escapeAttr)(t.id)}" data-label="${(0,e.escapeAttr)(t.label)}">`);let o=t.inlineStyle,s=(0,e.escapeAttr)(o?.stroke??`var(--_node-stroke)`),c=(0,e.escapeAttr)(o?.[`stroke-width`]??String(I.outerBox)),l=En(o),u=(0,e.escapeAttr)(o?.fill??`var(--_group-fill)`),d=(0,e.escapeAttr)(o?.fill??`var(--_group-hdr)`),f=t.bandless===!0;if(t.titleOnly||a.push(e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" `+e.f`rx="${f?0:Ln}" ry="${f?0:Ln}" fill="${f?u:d}" stroke="${s}" stroke-width="${c}"${l} />`),t.bandless){a.push(` `+(0,e.renderMultilineText)(t.label,t.x+t.width/2,t.titleOnly?t.y+t.height/2+On:t.y+i/2,r.groupHeader,e.f`text-anchor="middle" font-size="${r.groupHeader}" font-weight="${400}" fill="${(0,e.escapeAttr)(o?.color??`var(--_text-sec)`)}"`));for(let e of t.children)a.push(kn(e,n,r));return a.push(`</g>`),a.join(`
20
+ `)}a.push(e.f` <rect x="${t.x}" y="${t.y+26}" width="${t.width}" height="${Math.max(0,t.height-26-zn)}" `+e.f`rx="0" ry="0" fill="${u}" stroke="${s}" stroke-width="${c}"${l} />`);let p=t.x+t.width/2;a.push(` `+(0,e.renderMultilineText)(t.label,p,t.y+13,r.groupHeader,e.f`text-anchor="middle" font-size="${r.groupHeader}" font-weight="${400}" fill="${(0,e.escapeAttr)(o?.color??`var(--_text-sec)`)}"`));for(let e of t.children)a.push(kn(e,n,r));return a.push(`</g>`),a.join(`
21
+ `)}function An(t,n,r=!0,i,a=!1){if(t.points.length<2)return``;let o=r&&(t.animate??!1),s=t.style===`invisible`,c=t.style===`dotted`?` stroke-dasharray="2 2"`:``,l=t.style===`thick`?vn:I.connector,f=s?`none`:(0,e.escapeAttr)(t.inlineStyle?.stroke??`var(--_line)`),m=(0,e.escapeAttr)(t.inlineStyle?.[`stroke-width`]??String(l)),h=wn(t),g=h?e.f`-${Tn(h)}`:``,_=``;s||(t.hasArrowEnd&&(_+=e.f` marker-end="url(#${t.endMarker??e.f`arrowhead${g}`})"`),t.hasArrowStart&&(_+=e.f` marker-start="url(#${t.startMarker??e.f`arrowhead-start${g}`})"`));let v=[e.f`class="edge${o?` edge-animated`:``}"`,e.f`data-from="${(0,e.escapeAttr)(t.source)}"`,e.f`data-to="${(0,e.escapeAttr)(t.target)}"`,e.f`data-style="${t.style}"`,e.f`data-arrow-start="${t.hasArrowStart}"`,e.f`data-arrow-end="${t.hasArrowEnd}"`];t.label&&v.push(e.f`data-label="${(0,e.escapeAttr)(t.label)}"`),t.id&&v.push(e.f`data-id="${(0,e.escapeAttr)(t.id)}"`);let y=o&&!c?` stroke-dasharray="8 6"`:``,b=a?Cn(t):t.points,x=n===`linear`?d(b,u):p(b,n);return e.f`<path ${v.join(` `)} d="${x}" `+e.f`fill="none" stroke="${f}" `+e.f`stroke-width="${m}"${c}${y}${_}`+(i?e.f` mask="url(#${i})"`:``)+` />`}function jn(t,n,r){if(!t.label)return``;let i=t.label,a=t.labelPosition??Nn(t.points),o=(0,e.measureMultilineText)(i,r.edgeLabel,F.edgeLabel),s=(0,e.renderMultilineTextWithBackground)(i,a.x,a.y,o.width,o.height,r.edgeLabel,0,e.f`text-anchor="middle" font-size="${r.edgeLabel}" font-weight="${F.edgeLabel}" fill="var(--_text-sec)"`,`fill="var(--bg)"`);return e.f`<g class="edge-label" data-from="${(0,e.escapeAttr)(t.source)}" data-to="${(0,e.escapeAttr)(t.target)}" data-label="${(0,e.escapeAttr)(i)}">\n`+e.f` ${s.replace(/\n/g,`
22
+ `)}\n`+`</g>`}function Mn(t,n){let r=t[n];if(!r)throw Error(e.f`edgeMidpoint: missing point at index ${n}`);return r}function Nn(e){if(e.length===0)return{x:0,y:0};if(e.length===1)return e[0];let t=0;for(let n=1;n<e.length;n++)t+=Pn(Mn(e,n-1),Mn(e,n));let n=t/2;for(let t=1;t<e.length;t++){let r=Mn(e,t-1),i=Mn(e,t),a=Pn(r,i);if(n<=a){let e=n/a;return{x:r.x+e*(i.x-r.x),y:r.y+e*(i.y-r.y)}}n-=a}return e[e.length-1]}function Pn(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function Fn(t,n,r,i=!0,a=!1){let o=Un(t,a),s=Ar(t,n,r,a),c=[],l=(0,e.sanitizeClassName)(t.className),u=l?e.f`node ${l}`:`node`,d=t.interaction,f=[e.f`class="${u}"`,e.f`data-id="${(0,e.escapeAttr)(t.id)}"`,e.f`data-label="${(0,e.escapeAttr)(t.label)}"`,e.f`data-shape="${t.shape}"`];c.push(e.f`<g ${f.join(` `)}>`);let p=i?(0,e.safeHref)(d?.href):void 0,m=p?` `:` `;if(p){let t=d?.target?e.f` target="${(0,e.escapeAttr)(d.target)}"`:``;c.push(e.f` <a href="${(0,e.escapeAttr)(p)}"${t}>`)}return i&&d?.tooltip&&c.push(e.f`${m}<title>${(0,e.escapeXml)(d.tooltip)}</title>`),c.push(e.f`${m}${o.replace(/\n/g,e.f`\n${m}`)}`),s&&c.push(e.f`${m}${s.replace(/\n/g,e.f`\n${m}`)}`),p&&c.push(` </a>`),c.push(`</g>`),c.join(`
23
+ `)}var In=13,Ln=5,Rn=5,zn=4,Bn=2,Vn=8;function Hn(t,n,r,i=80){let a=i===80?e.f`transform="translate(${t} ${n})"`:e.f`transform="translate(${t} ${n}) scale(${i/80})"`;if(r===``)return e.f`<path ${a} d="M0,80 V5 Q0,0 5,0 H75 Q80,0 80,5 V80 Z" fill="none" stroke="var(--_node-stroke)" stroke-width="${Bn}" stroke-dasharray="${Vn}" />`;let o=se[r]??`<text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;">?</text>`;return e.f`<g ${a}><rect width="${80}" height="${80}" fill="${oe}" />${o}</g>`}function Un(t,n){let r=Wn(t,n),i=t.icon===void 0&&t.shape!==`small-circle`?En(t.inlineStyle):``;return i&&r?e.f`<g${i}>${r}</g>`:r}function Wn(t,n){let{x:r,y:i,width:a,height:o,shape:s}=t;if(t.icon!==void 0)return Hn(r,i,t.icon,t.width);let c=s===`small-circle`?void 0:t.inlineStyle,l=(0,e.escapeAttr)(c?.fill??`var(--_node-fill)`),u=(0,e.escapeAttr)(c?.stroke??`var(--_node-stroke)`),d=(0,e.escapeAttr)(c?.[`stroke-width`]??String(I.innerBox)),f=e=>e&&/^\d+(\.\d+)?(px)?$/.test(e)?parseFloat(e):0,p=f(c?.rx),m={rx:p,ry:c?.ry===void 0?p:f(c.ry)};switch(s){case`diamond`:return Yn(r,i,a,o,l,u,d);case`rounded`:return Kn(r,i,a,o,l,u,d,n?Rn:6);case`stadium`:return qn(r,i,a,o,l,u,d);case`circle`:return Jn(r,i,a,o,l,u,d);case`subroutine`:return Xn(r,i,a,o,l,u,d);case`doublecircle`:return Zn(r,i,a,o,l,u,d);case`hexagon`:return Qn(r,i,a,o,l,u,d);case`cylinder`:return $n(r,i,a,o,l,u,d);case`asymmetric`:return er(r,i,a,o,l,u,d);case`trapezoid`:return tr(r,i,a,o,l,u,d);case`trapezoid-alt`:return nr(r,i,a,o,l,u,d);case`parallelogram`:return rr(r,i,a,o,l,u,d);case`parallelogram-alt`:return ir(r,i,a,o,l,u,d);case`state-start`:return Or(r,i,a,o);case`state-end`:return kr(r,i,a,o);case`document`:return or(r,i,a,o,l,u,d);case`stacked-document`:return sr(r,i,a,o,l,u,d,!0);case`stacked-process`:return sr(r,i,a,o,l,u,d,!1);case`card`:return cr(r,i,a,o,l,u,d);case`lined-process`:return lr(r,i,a,o,l,u,d);case`divided-process`:return ur(r,i,a,o,l,u,d);case`window-pane`:return dr(r,i,a,o,l,u,d);case`triangle`:return fr(r,i,a,o,l,u,d,!1);case`flipped-triangle`:return fr(r,i,a,o,l,u,d,!0);case`junction`:return``;case`filled-circle`:return pr(r,i,a,o,u);case`crossed-circle`:return mr(r,i,a,o,l,u,d);case`fork-join`:return hr(r,i,a,o,u);case`note`:return br(r,i,a,o,(0,e.escapeAttr)(c?.fill??`var(--bg)`),u,d);case`notched-pentagon`:return xr(r,i,a,o,l,u,d);case`sloped-rectangle`:return Sr(r,i,a,o,l,u,d);case`flag`:return Cr(r,i,a,o,l,u,d);case`bow-tie-rectangle`:return wr(r,i,a,o,l,u,d);case`half-rounded-rectangle`:return Tr(r,i,a,o,l,u,d);case`brace`:return Er(r,i,a,o,l,u,d,`left`);case`brace-right`:return Er(r,i,a,o,l,u,d,`right`);case`braces`:return Er(r,i,a,o,l,u,d,`both`);case`bolt`:return Dr(r,i,a,o,l,u,d);case`cloud`:return gr(r,i,a,o,l,u,d);case`horizontal-cylinder`:return _r(r,i,a,o,l,u,d);case`tagged-rectangle`:return vr(r,i,a,o,l,u,d);case`fork-bar`:return Gn(r,i,a,o,l,u,d);case`small-circle`:return yr(r,i,a,o,l,u,d);case`text`:case`anchor`:return``;default:return Gn(r,i,a,o,l,u,d,m)}}function Gn(t,n,r,i,a,o,s,c={rx:0,ry:0}){return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" `+e.f`rx="${c.rx}" ry="${c.ry}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Kn(t,n,r,i,a,o,s,c){return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" `+e.f`rx="${c}" ry="${c}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function qn(t,n,r,i,a,o,s){let c=i/2;return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" `+e.f`rx="${c}" ry="${c}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Jn(t,n,r,i,a,o,s){let c=t+r/2,l=n+i/2,u=Math.min(r,i)/2;return e.f`<circle cx="${c}" cy="${l}" r="${u}" `+e.f`fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Yn(t,n,r,i,a,o,s){let c=t+r/2,l=n+i/2,u=r/2,d=i/2,f=[e.f`${c},${l-d}`,e.f`${c+u},${l}`,e.f`${c},${l+d}`,e.f`${c-u},${l}`].join(` `);return e.f`<polygon points="${f}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Xn(t,n,r,i,a,o,s){return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" `+e.f`rx="0" ry="0" fill="${a}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<line x1="${t+8}" y1="${n}" x2="${t+8}" y2="${n+i}" `+e.f`stroke="${o}" stroke-width="${s}" />`+e.f`\n<line x1="${t+r-8}" y1="${n}" x2="${t+r-8}" y2="${n+i}" `+e.f`stroke="${o}" stroke-width="${s}" />`}function Zn(t,n,r,i,a,o,s){let c=t+r/2,l=n+i/2,u=Math.min(r,i)/2,d=u-5;return e.f`<circle cx="${c}" cy="${l}" r="${u}" `+e.f`fill="${a}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<circle cx="${c}" cy="${l}" r="${d}" `+e.f`fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Qn(t,n,r,i,a,o,s){let c=i/3.5,l=[e.f`${t+c},${n}`,e.f`${t+r-c},${n}`,e.f`${t+r},${n+i/2}`,e.f`${t+r-c},${n+i}`,e.f`${t+c},${n+i}`,e.f`${t},${n+i/2}`].join(` `);return e.f`<polygon points="${l}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function $n(t,n,r,i,a,o,s){let c=t+r/2,l=n+7,u=i-14;return e.f`<rect x="${t}" y="${l}" width="${r}" height="${u}" `+e.f`fill="${a}" stroke="none" />`+e.f`\n<line x1="${t}" y1="${l}" x2="${t}" y2="${l+u}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<line x1="${t+r}" y1="${l}" x2="${t+r}" y2="${l+u}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<ellipse cx="${c}" cy="${n+i-7}" rx="${r/2}" ry="${7}" `+e.f`fill="${a}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<ellipse cx="${c}" cy="${l}" rx="${r/2}" ry="${7}" `+e.f`fill="${a}" stroke="${o}" stroke-width="${s}" />`}function er(t,n,r,i,a,o,s){let c=[e.f`${t},${n}`,e.f`${t+r},${n}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`,e.f`${t+12},${n+i/2}`].join(` `);return e.f`<polygon points="${c}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function tr(t,n,r,i,a,o,s){let c=r*.15,l=[e.f`${t+c},${n}`,e.f`${t+r-c},${n}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`].join(` `);return e.f`<polygon points="${l}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function nr(t,n,r,i,a,o,s){let c=r*.15,l=[e.f`${t},${n}`,e.f`${t+r},${n}`,e.f`${t+r-c},${n+i}`,e.f`${t+c},${n+i}`].join(` `);return e.f`<polygon points="${l}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function rr(t,n,r,i,a,o,s){let c=r*.15,l=[e.f`${t+c},${n}`,e.f`${t+r},${n}`,e.f`${t+r-c},${n+i}`,e.f`${t},${n+i}`].join(` `);return e.f`<polygon points="${l}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function ir(t,n,r,i,a,o,s){let c=r*.15,l=[e.f`${t},${n}`,e.f`${t+r-c},${n}`,e.f`${t+r},${n+i}`,e.f`${t+c},${n+i}`].join(` `);return e.f`<polygon points="${l}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function ar(t,n,r){return e.f`fill="${t}" stroke="${n}" stroke-width="${r}"`}function or(t,n,r,i,a,o,s){let c=Math.min(10,i*.16),l=n+i-c,u=e.f`M ${t} ${n} L ${t+r} ${n} L ${t+r} ${l} `+e.f`C ${t+r*.75} ${l+c*1.8} ${t+r*.25} ${l-c*.8} ${t} ${l} Z`;return e.f`<path d="${u}" ${ar(a,o,s)} />`}function sr(t,n,r,i,a,o,s,c){let l=r-10,u=i-10,d=[];for(let r=2;r>=1;r--)d.push(e.f`<rect x="${t+5*r}" y="${n+5*(2-r)}" width="${l}" height="${u}" `+e.f`${ar(a,o,s)} />`);return d.push(c?or(t,n+10,l,u,a,o,s):e.f`<rect x="${t}" y="${n+10}" width="${l}" height="${u}" ${ar(a,o,s)} />`),d.join(`
24
+ `)}function cr(t,n,r,i,a,o,s){let c=Math.min(14,r*.12,i*.3),l=[e.f`${t+c},${n}`,e.f`${t+r},${n}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`,e.f`${t},${n+c}`].join(` `);return e.f`<polygon points="${l}" ${ar(a,o,s)} />`}function lr(t,n,r,i,a,o,s){let c=Math.min(12,r*.12);return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" ${ar(a,o,s)} />\n`+e.f`<line x1="${t+c}" y1="${n}" x2="${t+c}" y2="${n+i}" stroke="${o}" stroke-width="${s}" />`}function ur(t,n,r,i,a,o,s){let c=n+Math.min(16,i*.3);return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" ${ar(a,o,s)} />\n`+e.f`<line x1="${t}" y1="${c}" x2="${t+r}" y2="${c}" stroke="${o}" stroke-width="${s}" />`}function dr(t,n,r,i,a,o,s){let c=t+Math.min(16,r*.16),l=n+Math.min(14,i*.28);return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" ${ar(a,o,s)} />\n`+e.f`<line x1="${c}" y1="${n}" x2="${c}" y2="${n+i}" stroke="${o}" stroke-width="${s}" />\n`+e.f`<line x1="${t}" y1="${l}" x2="${t+r}" y2="${l}" stroke="${o}" stroke-width="${s}" />`}function fr(t,n,r,i,a,o,s,c){let l=c?[e.f`${t},${n}`,e.f`${t+r},${n}`,e.f`${t+r/2},${n+i}`]:[e.f`${t+r/2},${n}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`];return e.f`<polygon points="${l.join(` `)}" ${ar(a,o,s)} />`}function pr(t,n,r,i,a){let o=Math.min(r,i)/2;return e.f`<circle cx="${t+r/2}" cy="${n+i/2}" r="${o}" fill="${a}" stroke="${a}" />`}function mr(t,n,r,i,a,o,s){let c=t+r/2,l=n+i/2,u=Math.min(r,i)/2-2,d=u/Math.SQRT2;return e.f`<circle cx="${c}" cy="${l}" r="${u}" ${ar(a,o,s)} />\n`+e.f`<line x1="${c-d}" y1="${l-d}" x2="${c+d}" y2="${l+d}" stroke="${o}" stroke-width="${s}" />\n`+e.f`<line x1="${c+d}" y1="${l-d}" x2="${c-d}" y2="${l+d}" stroke="${o}" stroke-width="${s}" />`}function hr(t,n,r,i,a){let o=Math.min(8,i);return e.f`<rect x="${t}" y="${n+(i-o)/2}" width="${r}" height="${o}" fill="${a}" stroke="${a}" />`}function gr(t,n,r,i,a,o,s){let c=r/1.25,l=i-.48*c,[u,d,f,p]=[.15*c,.25*c,.35*c,.2*c],m=e.f`M0 0 a${u},${u} 0 0,1 ${.25*c},${-.1*c} `+e.f`a${f},${f} 1 0,1 ${.4*c},${-.1*c} `+e.f`a${d},${d} 1 0,1 ${.35*c},${.2*c} `+e.f`a${u},${u} 1 0,1 ${.15*c},${.35*l} `+e.f`a${p},${p} 1 0,1 ${-.15*c},${.65*l} `+e.f`a${d},${u} 1 0,1 ${-.25*c},${.15*c} `+e.f`a${f},${f} 1 0,1 ${-.5*c},0 `+e.f`a${u},${u} 1 0,1 ${-.25*c},${-.15*c} `+e.f`a${u},${u} 1 0,1 ${-.1*c},${-.35*l} `+e.f`a${p},${p} 1 0,1 ${.1*c},${-.65*l} H0 V0 Z`;return e.f`<path transform="translate(${t+.1*c} ${n+.225*c})" d="${m}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function _r(t,n,r,i,a,o,s){let c=i/2,l=c/(2.5+i/50),u=r-2*l;return e.f`<path d="M${t+l},${n+i} a${l},${c} 0,0,1 0,${-i} l${u},0 a${l},${c} 0,0,1 0,${i} `+e.f`l${-u},0 Z" fill="${a}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<path d="M${t+l+u},${n} a${l},${c} 0,0,0 0,${i}" fill="none" stroke="${o}" stroke-width="${s}" />`}function vr(t,n,r,i,a,o,s){let c=.2*i;return Gn(t,n,r,i,a,o,s)+e.f`\n<polygon points="${t+r-c},${n+i} ${t+r},${n+i} ${t+r},${n+i-c}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function yr(t,n,r,i,a,o,s){return e.f`<circle cx="${t+r/2}" cy="${n+i/2}" r="7" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function br(t,n,r,i,a,o,s){let c=[e.f`${t},${n}`,e.f`${t+r-6},${n}`,e.f`${t+r},${n+6}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`].join(` `);return e.f`<polygon points="${c}" fill="${a}" stroke="${o}" stroke-width="${s}" />\n`+e.f`<polygon points="${t+r-6},${n} ${t+r},${n+6} ${t+r-6},${n+6}" fill="var(--_inner-stroke)" stroke="${o}" stroke-width="${s}" />`}function xr(t,n,r,i,a,o,s){let c=Math.min(14,r*.12,i*.3),l=[e.f`${t+c},${n}`,e.f`${t+r-c},${n}`,e.f`${t+r},${n+c}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`,e.f`${t},${n+c}`].join(` `);return e.f`<polygon points="${l}" ${ar(a,o,s)} />`}function Sr(t,n,r,i,a,o,s){let c=Math.min(12,i*.3),l=[e.f`${t},${n+c}`,e.f`${t+r},${n}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`].join(` `);return e.f`<polygon points="${l}" ${ar(a,o,s)} />`}function Cr(t,n,r,i,a,o,s){let c=Math.min(8,i*.14),l=e.f`M ${t} ${n+c} `+e.f`C ${t+r*.25} ${n-c} ${t+r*.75} ${n+c*2} ${t+r} ${n+c} `+e.f`L ${t+r} ${n+i-c} `+e.f`C ${t+r*.75} ${n+i+c} ${t+r*.25} ${n+i-c*2} ${t} ${n+i-c} Z`;return e.f`<path d="${l}" ${ar(a,o,s)} />`}function wr(t,n,r,i,a,o,s){let c=Math.min(14,r*.12),l=e.f`M ${t+c} ${n} L ${t+r} ${n} `+e.f`Q ${t+r-c*1.4} ${n+i/2} ${t+r} ${n+i} `+e.f`L ${t+c} ${n+i} `+e.f`Q ${t+c*1.4} ${n+i/2} ${t+c} ${n} Z`;return e.f`<path d="${l}" ${ar(a,o,s)} />`}function Tr(t,n,r,i,a,o,s){let c=i/2,l=Math.max(0,r-c),u=e.f`M ${t} ${n} L ${t+l} ${n} `+e.f`A ${c} ${c} 0 0 1 ${t+l} ${n+i} `+e.f`L ${t} ${n+i} Z`;return e.f`<path d="${u}" ${ar(a,o,s)} />`}function Er(t,n,r,i,a,o,s,c){let l=Math.min(10,r*.12),u=[e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" fill="none" stroke="none" />`],d=e.f`M ${t+l} ${n} Q ${t} ${n} ${t} ${n+i*.25} `+e.f`Q ${t} ${n+i/2} ${t-l*.4} ${n+i/2} `+e.f`Q ${t} ${n+i/2} ${t} ${n+i*.75} `+e.f`Q ${t} ${n+i} ${t+l} ${n+i}`,f=e.f`M ${t+r-l} ${n} Q ${t+r} ${n} ${t+r} ${n+i*.25} `+e.f`Q ${t+r} ${n+i/2} ${t+r+l*.4} ${n+i/2} `+e.f`Q ${t+r} ${n+i/2} ${t+r} ${n+i*.75} `+e.f`Q ${t+r} ${n+i} ${t+r-l} ${n+i}`;return(c===`left`||c===`both`)&&u.push(e.f`<path d="${d}" fill="none" stroke="${o}" stroke-width="${s}" />`),(c===`right`||c===`both`)&&u.push(e.f`<path d="${f}" fill="none" stroke="${o}" stroke-width="${s}" />`),u.join(`
25
+ `)}function Dr(t,n,r,i,a,o,s){let c=[e.f`${t+r*.42},${n}`,e.f`${t+r},${n}`,e.f`${t+r*.62},${n+i*.42}`,e.f`${t+r},${n+i*.42}`,e.f`${t+r*.3},${n+i}`,e.f`${t+r*.5},${n+i*.55}`,e.f`${t},${n+i*.55}`].join(` `);return e.f`<polygon points="${c}" ${ar(a,o,s)} />`}function Or(t,n,r,i){let a=t+r/2,o=n+i/2,s=Math.min(r,i)/2;return e.f`<circle cx="${a}" cy="${o}" r="${s}" fill="var(--_text)" stroke="none" />`}function kr(t,n,r,i){let a=t+r/2,o=n+i/2,s=Math.min(r,i)/2,c=s*5/14;return e.f`<circle cx="${a}" cy="${o}" r="${s}" `+e.f`fill="none" stroke="var(--_text)" stroke-width="2" />`+e.f`\n<circle cx="${a}" cy="${o}" r="${c}" fill="var(--_text)" stroke="none" />`}function Ar(t,n,r,i){if((t.shape===`state-start`||t.shape===`state-end`)&&!t.label)return``;let a=t.x+t.width/2+(t.shape===`asymmetric`?6:0),o=t.label.split(`
26
+ `).length,s=t.icon===void 0?t.y+t.height/2:t.y+t.height+In+(o-1)/2*r.nodeLabel*e.LINE_HEIGHT_RATIO,c=(0,e.escapeAttr)(t.inlineStyle?.color??`var(--_text)`),l=e.f`text-anchor="middle" font-size="${r.nodeLabel}" font-weight="${F.nodeLabel}" fill="${c}"`,u=t.inlineStyle?.[`font-family`];u&&(l+=e.f` style="font-family: ${(0,e.escapeAttr)(u)};"`);let d=i||t.icon!==void 0?t.label:le(t.label,r.nodeLabel,F.nodeLabel).text;return(0,e.renderMultilineText)(d,a,s,r.nodeLabel,l)}function jr(t){return(0,e.escapeAttr)(t).replace(/\r/g,`&#13;`).replace(/\n/g,`&#10;`).replace(/\t/g,`&#9;`)}function z(t,n){return n===void 0?t:t.replace(`<svg `,e.f`<svg data-src="${jr(n)}" `)}var Mr=class{raw=new Map;resolved=new Map;inProgress=new Set;declare(e,t){this.raw.set(e,t),this.resolved.delete(e)}lookup(e){if(this.resolved.has(e))return this.resolved.get(e);let t=this.raw.get(e);if(t===void 0||this.inProgress.has(e))return;this.inProgress.add(e);let n=zr(t,this).trim();this.inProgress.delete(e);let r=!/\bvar\(|\bcolor-mix\(/.test(n);return this.resolved.set(e,r?n:void 0),r?n:void 0}};function Nr(e,t){let n=0;for(let r=t;r<e.length;r++){let t=e[r];if(t===`(`)n++;else if(t===`)`&&(n--,n===0))return r}return-1}function Pr(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`?n++:a===`)`?n--:a===`,`&&n===0&&(t.push(e.slice(r,i)),r=i+1)}return t.push(e.slice(r)),t}var Fr=`(?<![\\w-])(var|color-mix)\\(`;function Ir(e,t){let[n,...r]=Pr(e),i=(n??``).trim(),a=t.lookup(i);return a===void 0?r.length>0?r.join(`,`).trim():null:a}function Lr(e){let t=e.trim().split(/\s+/),n,r;for(let e of t)if(/^[\d.]+%$/.test(e)){if(r!==void 0)return null;r=Number(e.slice(0,-1))}else{if(n!==void 0)return null;n=e}return n===void 0?null:{color:n,pct:r}}function Rr(t){let n=Pr(t);if(n.length!==3)return null;let[r,i,a]=n;if(r===void 0||i===void 0||a===void 0||!/^\s*in\s+srgb\s*$/i.test(r))return null;let o=Lr(i),s=Lr(a);if(!o||!s)return null;let c=(0,e.parseCssColor)(o.color),l=(0,e.parseCssColor)(s.color);if(!c||!l)return null;let u=(0,e.mixSrgb)(c,l,o.pct,s.pct);return u?(0,e.formatCssColor)(u):null}function zr(e,t){let n=``,r=0,i=new RegExp(Fr,`g`),a;for(;(a=i.exec(e))!==null;){let o=a[1];if(o===void 0)continue;let s=a.index,c=s+o.length,l=Nr(e,c);if(l===-1)break;let u=zr(e.slice(c+1,l),t),d=o===`var`?Ir(u,t):Rr(u);n+=e.slice(r,s),n+=d??`${o}(${u})`,r=l+1,i.lastIndex=r}return n+e.slice(r)}function Br(e,t){let n=new Mr;for(let[e,r]of Object.entries(t))n.declare(e,r);return zr(e,n)}var Vr=/(--[\w-]+)\s*:\s*([^;{}]+)/g,Hr=/(\s)([\w:.-]+)(=)("[^"]*"|'[^']*')/g,Ur=new Set([`data-src`]);function Wr(e,t){Vr.lastIndex=0;let n;for(;(n=Vr.exec(e))!==null;){let[,e,r]=n;e!==void 0&&r!==void 0&&t.declare(e,r.trim())}}function Gr(e,t){return e.replace(Hr,(e,n,r,i,a)=>{if(Ur.has(r))return e;let o=a[0]??`"`;return`${n}${r}${i}${o}${zr(a.slice(1,-1),t)}${o}`})}function Kr(e,t){let n=new Mr;n.declare(`--bg`,t.bg),n.declare(`--fg`,t.fg),t.line&&n.declare(`--line`,t.line),t.accent&&n.declare(`--accent`,t.accent),t.muted&&n.declare(`--muted`,t.muted),t.surface&&n.declare(`--surface`,t.surface),t.border&&n.declare(`--border`,t.border);for(let t of e.matchAll(/<style[^>]*>([\s\S]*?)<\/style>/g)){let e=t[1];e!==void 0&&Wr(e,n)}for(let t of e.matchAll(/\sstyle=("[^"]*"|'[^']*')/g)){let e=t[1];e!==void 0&&Wr(e.slice(1,-1),n)}let r=``,i=0;for(;i<e.length;){let t=e.indexOf(`<`,i);if(t===-1)break;if(r+=e.slice(i,t),e.startsWith(`<style`,t)){let a=e.indexOf(`>`,t),o=e.indexOf(`</style>`,t);if(a===-1||o===-1)break;r+=e.slice(t,a+1),r+=zr(e.slice(a+1,o),n),r+=`</style>`,i=o+8;continue}let a=-1,o=null;for(let n=t+1;n<e.length;n++){let t=e[n];if(o!==null)t===o&&(o=null);else if(t===`"`||t===`'`)o=t;else if(t===`>`){a=n;break}}if(a===-1)break;let s=e.slice(t,a+1);r+=s.startsWith(`<!`)||s.startsWith(`<?`)||s.startsWith(`</`)?s:Gr(s,n),i=a+1}return r+e.slice(i)}var qr=[.3013,.3672,.3247,.5244,.5244,.6001,.7061,.1597,.3672,.3672,.3672,.5244,.3672,.3672,.3672,.5244,.5244,.5244,.5244,.5244,.5244,.5244,.5244,.5244,.5244,.5244,.3672,.3672,.5244,.5244,.5244,.3672,.7705,.5898,.5659,.5981,.6133,.5356,.5249,.6763,.6543,.2783,.4766,.5757,.5063,.7095,.6382,.6738,.5576,.6758,.582,.481,.5806,.6484,.5874,.8521,.5566,.5703,.5503,.3672,.3555,.3672,.5244,.5244,.5244,.5254,.5571,.4951,.5571,.5454,.3696,.502,.5464,.2852,.3667,.5044,.2949,.8301,.5464,.5366,.5571,.5571,.3887,.4048,.3965,.5464,.4897,.7441,.501,.4932,.4746,.3672,.5244,.3672,.5244],Jr=[.3013,.3672,.3667,.5859,.5859,.6841,.7061,.2295,.3672,.3672,.4321,.5859,.3672,.3672,.3672,.3901,.5859,.5859,.5859,.5859,.5859,.5859,.5859,.5859,.5859,.5859,.3672,.3672,.5859,.5859,.5859,.438,.7705,.6333,.5952,.6118,.6426,.5688,.5835,.6714,.6836,.2783,.5327,.6172,.5527,.7451,.6675,.7031,.5869,.709,.6108,.5112,.6118,.6777,.6216,.8838,.6006,.6133,.5601,.4019,.3555,.4019,.5859,.5859,.5859,.5327,.5815,.5117,.5806,.5747,.3696,.502,.5928,.2983,.3667,.5479,.2949,.8594,.5903,.5659,.5825,.584,.4272,.4307,.3965,.5908,.5273,.7837,.5522,.5337,.5283,.4336,.5859,.4336,.5859],Yr=`AT-972 AV-879 AW-879 AY-1064 Av-552 Aw-459 Ay-410 F,-1802 F.-1802 FA-1060 Ke-312 Ki-312 Kn-312 Ko-312 Ku-312 Kw-312 LT-1021 LV-1387 LW-1250 LY-1294 Ly-830 P,-1953 P.-1953 PA-1113 Pa-469 Pe-469 Ph-469 Pi-469 Po-469 Pr-469 RT-410 RV-459 RW-640 RY-640 Re-405 Ro-405 Ru-288 T,-1660 T--967 T.-1660 T:-1108 T;-1108 TA-972 TO-552 Ta-1245 Tc-1245 Te-1245 Ti-415 To-1245 Tr-1099 Ts-1201 Tu-1294 Tw-1382 Ty-1152 V,-1465 V--737 V.-1465 V:-601 V;-601 VA-1021 Va-786 Ve-645 Vi-181 Vo-645 Vr-601 Vu-649 Vy-371 W,-923 W--688 W.-923 W:-181 W;-181 WA-879 Wa-557 We-459 Wi-137 Wo-459 Wr-503 Wu-410 Wy-181 Y,-1611 Y--1221 Y.-1611 Y:-874 Y;-874 YA-1064 Ya-928 Ye-1050 Yi-557 Yo-1147 Yp-928 Yq-1196 Yu-737 Yv-596 r,-1426 r.-1333 v,-1343 v.-1343 w,-1060 w.-1060 y,-1221 y.-1221`,Xr=`AT-947 AV-742 AW-542 AY-894 Av-181 Aw-181 Ay-181 F,-1108 F.-1108 FA-552 Fa-469 Fe-469 Fo-469 Fu-469 LT-742 LV-742 LW-742 LY-742 Ly-371 P,-1289 P.-1289 PA-742 Pa-469 Pe-469 Po-469 RT-405 RV-361 RW-435 RY-630 T,-1108 T--776 T.-1108 T:-1108 T;-1108 TA-947 TO-596 Ta-1108 Tc-1108 Te-1108 Ti-371 To-1289 Tr-1025 Ts-1108 Tu-903 Tw-796 Ty-752 V,-1118 V--552 V.-918 V:-371 V;-371 VA-742 Va-742 Ve-552 Vi-181 Vo-674 Vr-493 Vu-532 Vy-371 W,-874 W--181 W.-835 W:-181 W;-181 WA-542 Wa-371 We-181 Wo-181 Wr-181 Wu-181 Wy-88 Y,-1289 Y--918 Y.-1289 Y:-552 Y;-649 YA-894 Ya-742 Ye-918 Yi-371 Yo-918 Yp-742 Yq-918 Yu-552 Yv-552 ka-312 r,-1128 r.-1182 ra-312 v,-1318 v.-1318 vi313 w,-972 w.-972 y,-1108 y.-1108`,Zr=`11-738 AT-737 AV-737 AW-366 AY-737 Av-176 Aw-176 Ay-176 F,-1108 F.-1108 FA-547 LT-737 LV-738 LW-737 LY-738 Ly-367 P,-1289 P.-1289 PA-737 RT-176 RV-176 RW-176 RY-176 T,-1108 T--546 T.-1108 T:-1108 T;-1108 TA-737 TO-175 Ta-1108 Tc-1108 Te-1108 Ti-366 To-1108 Tr-366 Ts-1108 Tu-366 Tw-547 Ty-546 V,-918 V--547 V.-918 V:-366 V;-366 VA-737 Va-738 Ve-547 Vi-176 Vo-547 Vr-366 Vu-367 Vy-366 W,-546 W--175 W.-546 W:-175 W;-175 WA-366 Wa-366 We-176 Wo-176 Wr-175 Wu-176 Wy-87 Y,-1289 Y--918 Y.-1289 Y:-547 Y;-649 YA-737 Ya-738 Ye-919 Yi-367 Yo-919 Yp-738 Yq-919 Yu-547 Yv-547 ff-175 r,-546 r.-546 v,-737 v.-737 w,-547 w.-547 y,-737 y.-737`,Qr=new Map;function $r(e){let t=Qr.get(e);return t||(t=new Map((e===`bold`?Xr:e===`sans`?Zr:Yr).split(` `).map(e=>[e.slice(0,2),Number(e.slice(2))/1e4])),Qr.set(e,t)),t}function ei(e){return e>=4352?1:.6}function ti(e,t){let n=t?Jr:qr,r=t?.5859:.5244,i=0,a=$r(t?`bold`:`regular`);for(let t=1;t<e.length;t++)i+=a.get(e.slice(t-1,t+1))??0;for(let t of e){let e=t.codePointAt(0);i+=e>=32&&e<=126?n[e-32]:e===171||e===187?r:ei(e)}return i*16}var ni=[.2778,.2778,.355,.5562,.5562,.8892,.667,.1909,.333,.333,.3892,.584,.2778,.333,.2778,.2778,.5562,.5562,.5562,.5562,.5562,.5562,.5562,.5562,.5562,.5562,.2778,.2778,.584,.584,.584,.5562,1.0151,.667,.667,.7222,.7222,.667,.6108,.7778,.7222,.2778,.5,.667,.5562,.833,.7222,.7778,.667,.7778,.7222,.667,.6108,.7222,.667,.9438,.667,.667,.6108,.2778,.2778,.2778,.4692,.5562,.333,.5562,.5562,.5,.5562,.5562,.2778,.5562,.5562,.2222,.2222,.5,.2222,.833,.5562,.5562,.5562,.5562,.333,.5,.2778,.5562,.5,.7222,.5,.5,.5,.334,.2598,.334,.584];function ri(e){let t=0,n=$r(`sans`);for(let r=1;r<e.length;r++)t+=n.get(e.slice(r-1,r+1))??0;for(let n of e){let e=n.codePointAt(0);t+=e>=32&&e<=126?ni[e-32]:ei(e)}return Math.round(t*16)}var B={padding:40,boxPadX:8,headerBaseHeight:48,annotationHeight:24,memberRowHeight:24,sectionPadY:24,emptySectionHeight:24,emptyBareSectionHeight:18,methodsAfterEmptyExtra:6,mermaidPad:12,memberFontSize:11,memberFontWeight:400,nodeSpacing:40,layerSpacing:60,notePadX:10,notePadY:6,namespaceTitleHeight:28,namespacePad:16,namespaceTitleFontSize:12,lollipopLabelHeight:32,lollipopLabelPadX:8};function ii(e){return`note ${e}`}function ai(e){return`${e} link`}function oi(e){return`namespace ${e}`}function si(e){let t=new Set(e.classes.map(e=>e.id)),n=new Set,r=[];for(let[i,a]of e.namespaces.entries()){let e=[];for(let r of a.classIds)!t.has(r)||n.has(r)||(n.add(r),e.push(r));e.length>0&&r.push({id:oi(i),name:a.name,classIds:e})}return r}function ci(e){let t=new Map,n=new Set,r=[],i=new Map,a=e.relationships.map((a,o)=>{if(a.type!==`lollipop`||a.markerAt===`both`)return a;let s=a.markerAt===`from`,c=s?a.from:a.to,l=`lollipop ${r.length}`;return t.set(o,l),i.set(l,s?a.to:a.from),n.add(c),r.push({id:l,label:e.classes.find(e=>e.id===c)?.label??c,attributes:[],methods:[]}),s?{...a,from:l}:{...a,to:l}}),o=new Map(r.map(e=>[e.id,e.label]));if(r.length===0)return{diagram:e,labels:o,byRelationship:t};let s=new Set(a.flatMap(e=>[e.from,e.to]));for(let t of e.notes)t.forClass&&s.add(t.forClass);for(let t of e.namespaces)for(let e of t.classIds)s.add(e);let c=e=>n.has(e.id)&&!s.has(e.id)&&!e.annotation&&e.attributes.length===0&&e.methods.length===0,l=[...e.classes.filter(e=>!c(e)),...r],u=e.namespaces.map(e=>({...e,classIds:[...e.classIds,...r.filter(t=>e.classIds.includes(i.get(t.id)??``)).map(e=>e.id)]}));return{diagram:{...e,classes:l,relationships:a,namespaces:u},labels:o,byRelationship:t}}function li(t){return(0,e.findBackEdges)(t.relationships.map(e=>({source:e.from,target:e.to})),t.classes.map(e=>e.id))}function ui(t,n,r){let i=new Map,a=new Map,o=P(n.fontSizes),s=t.layout?.padding??B.mermaidPad,c=s-B.mermaidPad;for(let e of t.classes){if(r.has(e.id)){i.set(e.id,{width:k(e.label,o.nodeLabel,F.edgeLabel)+B.lollipopLabelPadX*2,height:B.lollipopLabelHeight,headerHeight:B.lollipopLabelHeight,attrHeight:0,methodHeight:0});continue}let n=Math.max(0,(e.annotation?B.headerBaseHeight+B.annotationHeight:B.headerBaseHeight)+c*2),a=e.attributes.length+e.methods.length===0,l=a&&t.layout?.hideEmptyMembersBox===!0?0:Math.max(0,(a?B.emptyBareSectionHeight:B.emptySectionHeight)+c*2),u=e.attributes.length>0?e.attributes.length*B.memberRowHeight+Math.max(0,B.sectionPadY+c*2):l,d=e.methods.length>0?e.methods.length*B.memberRowHeight+Math.max(0,B.sectionPadY+c*2)+(e.attributes.length===0?B.methodsAfterEmptyExtra:0):l,f=k(e.label,o.nodeLabel,F.nodeLabel),p=gi(e.attributes),m=gi(e.methods),h=Math.max(hi(e,s),f+B.boxPadX*2,p+B.boxPadX*2,m+B.boxPadX*2),g=n+u+d;i.set(e.id,{width:h,height:g,headerHeight:n,attrHeight:u,methodHeight:d})}let l=si(t),u=new Map;for(let e of l)for(let t of e.classIds)u.set(t,e.id);let d=new Map,f=[];for(let e of l){let t=k(e.name,B.namespaceTitleFontSize,F.groupHeader)+B.namespacePad*2,n={id:e.id,children:[],layoutOptions:{"elk.padding":fe({top:B.namespaceTitleHeight+B.namespacePad/2,left:B.namespacePad,bottom:B.namespacePad,right:B.namespacePad}),"elk.nodeSize.constraints":`MINIMUM_SIZE`,"elk.nodeSize.minimum":`(${Math.ceil(t)}, 0)`}};d.set(e.id,n),f.push(n)}for(let[e,t]of i){let n=me(e,t),r=d.get(u.get(e)??``);r?.children?r.children.push(n):f.push(n)}let p={fontSize:o.edgeLabel},m=li(t),h=[];for(let[e,n]of t.relationships.entries()){let t=m.has(e);h.push(_e({id:`e${e}`,source:t?n.to:n.from,target:t?n.from:n.to,label:n.label,labelStyle:p}))}let g=new Set(i.keys());for(let[n,r]of t.notes.entries()){let t=ii(n),i=(0,e.measureMultilineText)(r.text,o.edgeLabel,F.edgeLabel),s={width:i.width+B.notePadX*2,height:i.height+B.notePadY*2};a.set(t,s),f.push(me(t,s)),r.forClass!==void 0&&g.has(r.forClass)&&h.push(_e({id:ai(t),source:t,target:r.forClass,labelStyle:p}))}return{elkGraph:{id:`root`,layoutOptions:{...pe({direction:de(t.direction,ue.class),nodeSpacing:B.nodeSpacing,layerSpacing:B.layerSpacing,padding:B.padding}),"elk.edgeLabels.placement":`CENTER`,"elk.hierarchyHandling":`INCLUDE_CHILDREN`,"elk.separateConnectedComponents":`false`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,"elk.layered.nodePlacement.bk.fixedAlignment":`BALANCED`},children:f,edges:h},classSizes:i,noteSizes:a,namespaces:l}}function di(t,n,r,i,a,o){let s=new Map;for(let e of n.classes)s.set(e.id,e);let c=new Set(a.map(e=>e.id)),l=new Map,u=[];for(let e of t.children??[])if(c.has(e.id)){let t=e.x??0,n=e.y??0;l.set(e.id,{x:t,y:n});for(let r of e.children??[])u.push({...r,x:(r.x??0)+t,y:(r.y??0)+n})}else u.push(e);let d=e=>{let t=e.container;return t&&l.get(t)||{x:0,y:0}},f=[];for(let e of a){let n=(t.children??[]).find(t=>t.id===e.id);n&&f.push({name:e.name,classIds:e.classIds.filter(e=>!o.labels.has(e)),x:n.x??0,y:n.y??0,width:n.width??0,height:n.height??0})}let p=[];for(let t of u){let i=s.get(t.id);if(i){let a=r.get(i.id);if(!a)throw Error(`Missing computed size for class "${i.id}"`);p.push({id:i.id,label:i.label,annotation:i.annotation,attributes:i.attributes,methods:i.methods,x:t.x??0,y:t.y??0,width:t.width??a.width,height:t.height??a.height,headerHeight:a.headerHeight,attrHeight:a.attrHeight,methodHeight:a.methodHeight,interaction:n.interactions.get(i.id),inlineStyle:(0,e.resolveNodeStyle)(i.id,n),className:n.classAssignments.get(i.id)})}}let m=[],h=li(o.diagram),g=new Map;for(let e of u)g.set(e.id,e);let _=new Map;for(let[e,t]of o.labels){let n=g.get(e);_.set(e,{text:t,x:n?.x??0,y:n?.y??0,width:n?.width??0,height:n?.height??0})}let v=t.edges??[];for(let[e,t]of n.relationships.entries()){let n=v[e];if(!n)throw Error(`Missing ELK edge for relationship ${e}`);let r=d(n),i=vt(n,r.x,r.y),a=h.has(e)?i.reverse():i,s=yt(n,r.x,r.y),c=_.get(o.byRelationship.get(e)??``);m.push({from:t.from,to:t.to,type:t.type,markerAt:t.markerAt,...t.dashed?{dashed:!0}:{},label:t.label,fromCardinality:t.fromCardinality,toCardinality:t.toCardinality,points:a,labelPosition:s,...c?{interfaceLabel:c}:{}})}let y=new Map;for(let e of v.slice(n.relationships.length))y.set(e.id,e);let b=[];for(let[e,t]of n.notes.entries()){let n=ii(e),r=g.get(n),a=i.get(n);if(!r||!a)throw Error(`Missing layout for note ${e}`);let o=y.get(ai(n));b.push({id:n,text:t.text,...o&&t.forClass!==void 0?{forClass:t.forClass}:{},x:r.x??0,y:r.y??0,width:r.width??a.width,height:r.height??a.height,...o?{linkPoints:vt(o,d(o).x,d(o).y)}:{}})}return{width:t.width??600,height:t.height??400,classes:p,relationships:m,notes:b,namespaces:f}}function fi(e,t={}){if(e.classes.length===0&&e.notes.length===0)return{width:0,height:0,classes:[],relationships:[],notes:[],namespaces:[]};let n=ci(e),{elkGraph:r,classSizes:i,noteSizes:a,namespaces:o}=ui(n.diagram,t,n.labels);return di(E(r,t.layoutCache),e,i,a,o,n)}function pi(e){return e.length*Math.ceil(A(`M`,B.memberFontSize))}function mi(e){let t=e.isMethod?`${e.name}(${e.params||``})`:e.name;return`${e.visibility||``}${e.visibilitySpace?` `:``}${t}${e.isMethod&&e.type?` : ${e.type}`:``}`}function hi(e,t=B.mermaidPad){let n=ti(e.label,!0),r=e.annotation?ti(`\u00ab${e.annotation}\u00bb`,!1):0,i=Math.max(0,...[...e.attributes,...e.methods].map(e=>ti(mi(e),!1))),a=Math.max(n,r);return a/2+Math.max(a/2,i)+t*2}function gi(e){if(e.length===0)return 0;let n=0;for(let r of e){let e=pi((0,t.formatClassMember)(r));e>n&&(n=e)}return n}var _i={memberSize:11,memberWeight:400,annotationSize:10,annotationWeight:500};function vi(t,n,r=`Inter`,i=!1,a=N,o,s,c,l=!0,u={}){let d=[],f=l&&t.classes.some(t=>!!(0,e.safeHref)(t.interaction?.href));d.push(z((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,f,u.styleAttribute,u.description),o)),d.push(ie(r,!0,u.nonce,u.bodyFont)),d.push(`<defs>`),d.push(bi(t.relationships.some(e=>e.type===`lollipop`))),d.push(`</defs>`);for(let e of t.namespaces)d.push(yi(e));for(let e of t.relationships)d.push(Di(e));for(let e of t.notes)d.push(Ei(e));for(let e of t.classes)d.push(xi(e,a,l));for(let e of t.relationships){let t=Oi(e,a);t&&d.push(t)}for(let e of t.notes)d.push(Ti(e,a));for(let e of t.relationships)d.push(ji(e,a));return d.push(`</svg>`),d.join(`
27
+ `)}function yi(t){let{x:n,y:r,width:i,height:a}=t,o=B.namespaceTitleHeight,s=I.outerBox;return[e.f`<g class="class-namespace" data-id="${(0,e.escapeAttr)(t.name)}" data-label="${(0,e.escapeAttr)(t.name)}">`,e.f` <rect x="${n}" y="${r}" width="${i}" height="${a}" rx="0" ry="0" fill="var(--_group-fill)" stroke="var(--_node-stroke)" stroke-width="${s}" />`,e.f` <rect x="${n}" y="${r}" width="${i}" height="${o}" rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${s}" />`,e.f` <text x="${n+B.namespacePad}" y="${r+o/2}" dy="${L}" font-size="${B.namespaceTitleFontSize}" font-weight="${F.groupHeader}" fill="var(--_text-sec)">${zi(t.name)}</text>`,`</g>`].join(`
28
+ `)}function bi(e){return` <marker id="cls-inherit" markerWidth="12" markerHeight="10" refX="12" refY="5" orient="auto-start-reverse">
27
29
  <polygon points="0 0, 12 5, 0 10" fill="var(--bg)" stroke="var(--_arrow)" stroke-width="1.5" />
28
30
  </marker>
29
31
  <marker id="cls-composition" markerWidth="18" markerHeight="14" refX="16.5" refY="7" orient="auto-start-reverse">
@@ -37,48 +39,49 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require
37
39
  </marker>`+(e?`
38
40
  <marker id="cls-lollipop" markerWidth="12" markerHeight="12" refX="11" refY="6" orient="auto-start-reverse">
39
41
  <circle cx="6" cy="6" r="5" fill="var(--bg)" stroke="var(--_arrow)" stroke-width="1.5" />
40
- </marker>`:``)}function ui(t,n,r=!0){let{x:i,y:a,width:o,height:s,headerHeight:c,attrHeight:l,inlineStyle:u}=t,d=[],f=t.interaction,p=(0,e.escapeAttr)(u?.fill??`var(--_node-fill)`),m=(0,e.escapeAttr)(u?.stroke??`var(--_node-stroke)`),h=(0,e.escapeAttr)(u?.[`stroke-width`]??String(I.outerBox)),g=u?.fill?p:`var(--_group-hdr)`,_=u?.color?(0,e.escapeAttr)(u.color):void 0,v=t.annotation?e.f` data-annotation="${(0,e.escapeAttr)(t.annotation)}"`:``,y=(0,e.sanitizeClassName)(t.className),b=[e.f`class="${y?e.f`class-node ${y}`:`class-node`}"`,e.f`data-id="${(0,e.escapeAttr)(t.id)}"`,e.f`data-label="${(0,e.escapeAttr)(t.label)}"`];d.push(e.f`<g ${b.join(` `)}${v}>`);let x=r?(0,e.safeHref)(f?.href):void 0;if(x){let t=f?.target?e.f` target="${(0,e.escapeAttr)(f.target)}"`:``;d.push(e.f` <a href="${(0,e.escapeAttr)(x)}"${t}>`)}r&&f?.tooltip&&d.push(e.f` <title>${Oi(f.tooltip)}</title>`),d.push(e.f` <rect x="${i}" y="${a}" width="${o}" height="${s}" `+e.f`rx="0" ry="0" fill="${p}" stroke="${m}" stroke-width="${h}" />`),d.push(e.f` <rect x="${i}" y="${a}" width="${o}" height="${c}" `+e.f`rx="0" ry="0" fill="${g}" stroke="${m}" stroke-width="${h}" />`);let S=a+c/2;if(t.annotation){let n=a+12;d.push(e.f` <text x="${i+o/2}" y="${n}" text-anchor="middle" dy="${L}" `+e.f`font-size="${oi.annotationSize}" font-weight="${oi.annotationWeight}" `+e.f`font-style="italic" fill="${_??`var(--_text-muted)`}">«${Oi(t.annotation)}»</text>`),S=a+c/2+6}d.push(` `+(0,e.renderMultilineText)(t.label,i+o/2,S,n.nodeLabel,e.f`text-anchor="middle" font-size="${n.nodeLabel}" font-weight="700" fill="${_??`var(--_text)`}"`));let C=a+c;l>0&&d.push(e.f` <line x1="${i}" y1="${C}" x2="${i+o}" y2="${C}" `+e.f`stroke="${m}" stroke-width="${I.innerBox}" />`);let w=(l-t.attributes.length*20)/2,T=(s-c-l-t.methods.length*20)/2;for(let e=0;e<t.attributes.length;e++){let n=t.attributes[e],r=C+w+e*20+10;d.push(` `+fi(n,i+z.boxPadX,r,_))}let E=C+l;s-c-l>0&&d.push(e.f` <line x1="${i}" y1="${E}" x2="${i+o}" y2="${E}" `+e.f`stroke="${m}" stroke-width="${I.innerBox}" />`);for(let e=0;e<t.methods.length;e++){let n=t.methods[e],r=E+T+e*20+10;d.push(` `+fi(n,i+z.boxPadX,r,_))}return x&&d.push(` </a>`),d.push(`</g>`),d.join(`
41
- `)}var di=700;function fi(t,n,r,i){let a=t.isAbstract?` font-style="italic"`:``,o=t.isStatic?` text-decoration="underline"`:``,s=i??`var(--_text-faint)`,c=i??`var(--_text-sec)`,l=i??`var(--_text-muted)`,u=[];t.visibility&&u.push(e.f`<tspan fill="${c}" font-weight="${di}">${Oi(t.visibility)}</tspan>${t.visibilitySpace?e.f`<tspan fill="${s}"> </tspan>`:``}`);let d=t.isMethod?e.f`${t.name}(${t.params||``})`:t.name;return u.push(e.f`<tspan fill="${c}">${Oi(d)}</tspan>`),t.type&&(u.push(e.f`<tspan fill="${s}"> : </tspan>`),u.push(e.f`<tspan fill="${l}">${Oi(t.type)}</tspan>`)),e.f`<text x="${n}" y="${r}" class="mono" dy="${L}" `+e.f`font-size="${oi.memberSize}" font-weight="${oi.memberWeight}"${a}${o}>`+e.f`${u.join(``)}</text>`}var pi=6;function mi(t,n){let{x:r,y:i,width:a,height:o}=t,s=t.forClass===void 0?``:e.f` data-for="${(0,e.escapeAttr)(t.forClass)}"`,c=[e.f`${r},${i}`,e.f`${r+a-pi},${i}`,e.f`${r+a},${i+pi}`,e.f`${r+a},${i+o}`,e.f`${r},${i+o}`].join(` `),l=e.f`${r+a-pi},${i} ${r+a},${i+pi} `+e.f`${r+a-pi},${i+pi}`;return e.f`<g class="class-note"${s}>`+e.f`\n <polygon points="${c}" `+e.f`fill="var(--bg)" stroke="var(--_node-stroke)" stroke-width="${I.innerBox}" />`+e.f`\n <polygon points="${l}" `+e.f`fill="var(--_inner-stroke)" stroke="var(--_node-stroke)" stroke-width="${I.innerBox}" />`+e.f`\n ${(0,e.renderMultilineText)(t.text,r+a/2,i+o/2,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${P.edgeLabel}" fill="var(--_text-muted)"`)}`+`
42
- </g>`}function hi(t){if(!t.linkPoints||t.linkPoints.length<2)return``;let n=t.linkPoints.map(t=>e.f`${t.x},${t.y}`).join(` `),r=t.forClass===void 0?``:e.f` data-for="${(0,e.escapeAttr)(t.forClass)}"`;return e.f`<polyline class="class-note-link"${r} points="${n}" `+e.f`fill="none" stroke="var(--_line)" stroke-width="${I.connector}" stroke-dasharray="2 3" />`}function gi(t){if(t.points.length<2)return``;let n=t.dashed||t.type===`dependency`||t.type===`realization`||t.type===`dashed-link`?` stroke-dasharray="6 4"`:``,r=vi(t.type,t.markerAt),i=[`class="class-relationship"`,e.f`data-from="${(0,e.escapeAttr)(t.from)}"`,e.f`data-to="${(0,e.escapeAttr)(t.to)}"`,e.f`data-type="${t.type}"`,e.f`data-marker-at="${t.markerAt}"`];return t.label&&i.push(e.f`data-label="${(0,e.escapeAttr)(t.label)}"`),t.fromCardinality&&i.push(e.f`data-from-cardinality="${(0,e.escapeAttr)(t.fromCardinality)}"`),t.toCardinality&&i.push(e.f`data-to-cardinality="${(0,e.escapeAttr)(t.toCardinality)}"`),e.f`<path ${i.join(` `)} d="${d(t.points,u)}" fill="none" stroke="var(--_line)" `+e.f`stroke-width="${I.connector}"${n}${r} />`}function _i(t,n){let r=t.interfaceLabel;if(!r)return``;let i=t.markerAt===`from`?t.from:t.to;return e.f`<g class="class-interface" data-id="${(0,e.escapeAttr)(i)}" data-label="${(0,e.escapeAttr)(r.text)}">\n `+(0,e.renderMultilineText)(r.text,r.x+r.width/2,r.y+r.height/2,n.nodeLabel,e.f`text-anchor="middle" font-size="${n.nodeLabel}" font-weight="${P.edgeLabel}" fill="var(--_text)"`)+`
43
- </g>`}function vi(t,n){let r=yi(t);return r?(n===`to`?``:e.f` marker-start="url(#${r})"`)+(n===`from`?``:e.f` marker-end="url(#${r})"`):``}function yi(e){switch(e){case`inheritance`:case`realization`:return`cls-inherit`;case`composition`:return`cls-composition`;case`aggregation`:return`cls-aggregation`;case`association`:case`dependency`:return`cls-arrow`;case`lollipop`:return`cls-lollipop`;default:return null}}function bi(t,n){if(!t.label&&!t.fromCardinality&&!t.toCardinality||t.points.length<2)return``;let r=[];if(t.label){let i=xi(t.points,t.labelPosition??Si(t.points)),a=(0,e.measureMultilineText)(t.label,n.edgeLabel,P.edgeLabel);r.push((0,e.renderMultilineTextWithBackground)(t.label,i.x,i.y,a.width,a.height,n.edgeLabel,4,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${P.edgeLabel}" fill="var(--_text-muted)"`,`class="class-relationship-label-bg" fill="var(--bg)"`))}if(t.fromCardinality&&t.points.length>=2){let i=t.points[0],a=t.points[1],o=Ci(i,a,`start`,wi(t,`from`));r.push((0,e.renderMultilineText)(t.fromCardinality,i.x+o.x,i.y+o.y,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="${o.anchor}" font-weight="${P.edgeLabel}" fill="var(--_text-muted)"`))}if(t.toCardinality&&t.points.length>=2){let i=t.points[t.points.length-1],a=t.points[t.points.length-2],o=Ci(i,a,`end`,wi(t,`to`));r.push((0,e.renderMultilineText)(t.toCardinality,i.x+o.x,i.y+o.y,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="${o.anchor}" font-weight="${P.edgeLabel}" fill="var(--_text-muted)"`))}return r.join(`
44
- `)}function xi(e,t){let n=e[0],r=1/0;for(let i=1;i<e.length;i++){let a=e[i-1],o=e[i],s=o.x-a.x,c=o.y-a.y,l=s*s+c*c,u=Math.max(0,Math.min(1,((t.x-a.x)*s+(t.y-a.y)*c)/l)),d={x:a.x+u*s,y:a.y+u*c},f=(d.x-t.x)**2+(d.y-t.y)**2;f<r&&(r=f,n=d)}return n}function Si(e){return e.length===0?{x:0,y:0}:e[Math.floor(e.length/2)]}function Ci(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,o=Math.max(Math.hypot(i,a),1e-6),s=Ti+(r?Ei:0),c=Di+(r?Ei:0),l=i/o,u=a/o,d=n===`start`?1:-1,[f,p]=[l*d,u*d],m=(n===`start`?-p:p)*s,h=(n===`start`?f:-f)*s,g=h+u*s;if(Math.abs(m)>Math.abs(h)){let e=Math.sign(m);return{x:e*c+l*s,y:g,anchor:e>0?`start`:`end`}}return{x:m+l*s,y:g,anchor:`middle`}}function wi(e,t){return yi(e.type)!==null&&(e.markerAt===t||e.markerAt===`both`)}var Ti=12,Ei=6,Di=5,Oi=e.escapeXml,B={padding:40,boxPadX:14,cellPadX:10,headerHeight:34,bareHeight:68,rowHeight:22,minWidth:140,attrFontSize:11,attrFontWeight:400,nodeSpacing:70,layerSpacing:90,loopOut:20,loopHalf:10,loopLabelGap:4,loopNestGap:16,loopMargin:12};function ki(t,n,r){let i=N(r.fontSizes).edgeLabel,a=[];for(let[r,o]of t.relationships.entries()){if(o.entity1!==n||o.entity2!==n)continue;let t=a[a.length-1],s=o.label?(0,e.measureMultilineText)(o.label,i,P.edgeLabel).width+8:0;a.push({index:r,nest:a.length,out:t?t.out+B.loopLabelGap+t.labelW+B.loopNestGap:B.loopOut,labelW:s})}return a}function Ai(e){return e.replace(/<br\s{0,8}\/?>/gi,`
45
- `)}function ji(e){let t=e.attributes.map(Mi);return[0,1,2,3].filter(e=>e<2||t.some(t=>t[e].length>0)).map(e=>({cell:e,width:Math.max(...t.map(t=>Pi(t[e])))+B.cellPadX*2}))}function Mi(e){return[e.type,e.name,e.keys.join(`,`),Ai(e.comment??``).split(`
46
- `).map(e=>e.trim()).join(` `)]}function Ni(e){return Math.max(-10,((e.layout?.entityPadding??15)-15)*1.25)}function Pi(e){return[...e].reduce((e,t)=>e+(t.codePointAt(0)>=11904?2:1),0)*Math.ceil(A(`M`,B.attrFontSize))}function Fi(e,t){let n=new Map,r=N(t.fontSizes),i=(e.layout?.diagramPadding??20)-20,a=Ni(e),o=e.layout?.minEntityWidth??0;for(let t of e.entities){let e=k(t.label,r.nodeLabel,P.nodeLabel),s=t.attributes.length===0,c=ji(t),l=c.reduce((e,t)=>e+t.width,0)+c.length*i*1.25,u=e+B.boxPadX*2+i*2,d=Math.max(o,s?u:Math.max(B.minWidth,u,l)),f=s?Math.max(20,B.bareHeight+i*3):B.headerHeight+a+t.attributes.length*(B.rowHeight+a);n.set(t.id,{width:d,height:f})}let s=[];for(let[e,t]of n)s.push(fe(e,t));let c={fontSize:r.edgeLabel},l=[];for(let[t,n]of e.relationships.entries())n.entity1!==n.entity2&&l.push(he({id:`e${t}`,source:n.entity1,target:n.entity2,label:n.label,labelStyle:c}));let u=0;for(let n of e.entities){let r=ki(e,n.id,t),i=r[r.length-1];i&&(u=Math.max(u,i.out+i.labelW))}return{elkGraph:{id:`root`,layoutOptions:{...de({direction:le(e.direction,ce.er),nodeSpacing:Math.max(B.nodeSpacing,u+20),layerSpacing:Math.max(B.layerSpacing,u+20),padding:B.padding}),"elk.edgeLabels.placement":`CENTER`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,"elk.separateConnectedComponents":`false`,"elk.layered.nodePlacement.bk.fixedAlignment":`BALANCED`},children:s,edges:l},entitySizes:n}}function Ii(t,n,r,i){let a=Ni(n),o=new Map;for(let e of n.entities)o.set(e.id,e);let s=[];for(let i of t.children??[]){let t=o.get(i.id);if(t){let o=r.get(t.id);if(!o)throw Error(`Missing computed size for entity "${t.id}"`);s.push({id:t.id,label:t.label,attributes:t.attributes,x:i.x??0,y:i.y??0,width:i.width??o.width,height:i.height??o.height,headerHeight:t.attributes.length===0?o.height:B.headerHeight+a,rowHeight:B.rowHeight+a,inlineStyle:(0,e.resolveNodeStyle)(t.id,n),className:n.classAssignments.get(t.id)})}}let c=new Map((t.edges??[]).map(e=>[e.id,e])),l=[],u=1/0;for(let[e,t]of n.relationships.entries()){let r={entity1:t.entity1,entity2:t.entity2,cardinality1:t.cardinality1,cardinality2:t.cardinality2,label:t.label,identifying:t.identifying};if(t.entity1!==t.entity2){l.push({...r,points:ht(c.get(`e${e}`))});continue}let a=s.find(e=>e.id===t.entity1),o=ki(n,t.entity1,i).find(t=>t.index===e),d=a.y+a.height/2,f=Math.max(B.loopHalf,a.height/8)+10*o.nest,p=a.x-o.out;l.push({...r,points:[{x:a.x,y:d-f},{x:p,y:d-f},{x:p,y:d+f},{x:a.x,y:d+f}],labelPoint:{x:p-B.loopLabelGap-o.labelW/2,y:d}}),u=Math.min(u,p-B.loopLabelGap-o.labelW)}let d=Math.max(0,B.loopMargin-u);if(d>0){for(let e of s)e.x+=d;for(let e of l){for(let t of e.points)t.x+=d;e.labelPoint&&(e.labelPoint.x+=d)}}return{width:(t.width??600)+d,height:t.height??400,entities:s,relationships:l}}function Li(e,t={}){if(e.entities.length===0)return{width:0,height:0,entities:[],relationships:[]};let{elkGraph:n,entitySizes:r}=Fi(e,t);return Ii(E(n,t.layoutCache),e,r,t)}var Ri=70,zi={attrSize:11,attrWeight:400};function Bi(t,n,r=`Inter`,i=!1,a=M,o,s,c,l={}){let u=[];u.push(R((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,void 0,l.styleAttribute,l.description),o)),u.push(ie(r,!0,l.nonce,l.bodyFont)),u.push(`<defs>`),u.push(`</defs>`);for(let e of t.relationships)u.push(Ui(e));for(let e of t.entities)u.push(Vi(e,a));for(let e of t.relationships)u.push(Gi(e));for(let e of t.relationships)u.push(Wi(e,a));return u.push(`</svg>`),u.join(`
47
- `)}function Vi(t,n){let{id:r,x:i,y:a,width:o,height:s,headerHeight:c,rowHeight:l,label:u,attributes:d,inlineStyle:f}=t,p=[],m=(0,e.escapeAttr)(f?.fill??`var(--_node-fill)`),h=(0,e.escapeAttr)(f?.stroke??`var(--_node-stroke)`),g=(0,e.escapeAttr)(f?.[`stroke-width`]??String(I.outerBox)),_=(0,e.escapeAttr)(f?.[`stroke-width`]??String(I.innerBox)),v=f?.fill?m:`var(--_group-hdr)`,y=f?.color?(0,e.escapeAttr)(f.color):void 0,b=(0,e.sanitizeClassName)(t.className);p.push(e.f`<g class="${b?e.f`entity ${b}`:`entity`}" data-id="${(0,e.escapeAttr)(r)}" data-label="${(0,e.escapeAttr)(u)}">`),p.push(e.f` <rect x="${i}" y="${a}" width="${o}" height="${s}" `+e.f`rx="0" ry="0" fill="${m}" stroke="${h}" stroke-width="${g}" />`),p.push(e.f` <rect x="${i}" y="${a}" width="${o}" height="${c}" `+e.f`rx="0" ry="0" fill="${v}" stroke="${h}" stroke-width="${g}" />`),p.push(` `+(0,e.renderMultilineText)(u,i+o/2,a+c/2,n.nodeLabel,e.f`text-anchor="middle" font-size="${n.nodeLabel}" font-weight="700" fill="${y??`var(--_text)`}"`));let x=a+c;if(d.length>0){let n=a+s,r=ji(t),c=(o-r.reduce((e,t)=>e+t.width,0))/r.length,u=[i];for(let e of r)u.push(u[u.length-1]+e.width+c);for(let t=1;!f?.fill&&t<d.length;t+=2)p.push(e.f` <rect x="${i}" y="${x+t*l}" width="${o}" height="${l}" `+e.f`fill="var(--_key-badge)" />`);let m=(t,n,r,i)=>e.f` <line x1="${t}" y1="${n}" x2="${r}" y2="${i}" stroke="${h}" stroke-width="${_}" />`;p.push(m(i,x,i+o,x));for(let e=1;e<d.length;e++){let t=x+e*l;p.push(m(i,t,i+o,t))}for(let e=1;e<r.length;e++)p.push(m(u[e],x,u[e],n));for(let e=0;e<d.length;e++){let t=x+e*l+l/2,n=Mi(d[e]);p.push(` `+Hi(d[e],r.map((e,t)=>({x:u[t]+B.cellPadX,text:n[e.cell]})),t,y).replace(/\n/g,`
42
+ </marker>`:``)}function xi(t,n,r=!0){let{x:i,y:a,width:o,height:s,headerHeight:c,attrHeight:l,inlineStyle:u}=t,d=[],f=t.interaction,p=(0,e.escapeAttr)(u?.fill??`var(--_node-fill)`),m=(0,e.escapeAttr)(u?.stroke??`var(--_node-stroke)`),h=(0,e.escapeAttr)(u?.[`stroke-width`]??String(I.outerBox)),g=u?.fill?p:`var(--_group-hdr)`,_=u?.color?(0,e.escapeAttr)(u.color):void 0,v=t.annotation?e.f` data-annotation="${(0,e.escapeAttr)(t.annotation)}"`:``,y=(0,e.sanitizeClassName)(t.className),b=[e.f`class="${y?e.f`class-node ${y}`:`class-node`}"`,e.f`data-id="${(0,e.escapeAttr)(t.id)}"`,e.f`data-label="${(0,e.escapeAttr)(t.label)}"`];d.push(e.f`<g ${b.join(` `)}${v}>`);let x=r?(0,e.safeHref)(f?.href):void 0;if(x){let t=f?.target?e.f` target="${(0,e.escapeAttr)(f.target)}"`:``;d.push(e.f` <a href="${(0,e.escapeAttr)(x)}"${t}>`)}r&&f?.tooltip&&d.push(e.f` <title>${zi(f.tooltip)}</title>`),d.push(e.f` <rect x="${i}" y="${a}" width="${o}" height="${s}" `+e.f`rx="0" ry="0" fill="${p}" stroke="${m}" stroke-width="${h}" />`),d.push(e.f` <rect x="${i}" y="${a}" width="${o}" height="${c}" `+e.f`rx="0" ry="0" fill="${g}" stroke="${m}" stroke-width="${h}" />`);let S=(c-24-(t.annotation?24:0))/2,C=a+c-S-12;if(t.annotation){let n=a+S+12;d.push(e.f` <text x="${i+o/2}" y="${n}" text-anchor="middle" dy="${L}" `+e.f`font-size="${_i.annotationSize}" font-weight="${_i.annotationWeight}" `+e.f`font-style="italic" fill="${_??`var(--_text-muted)`}">«${zi(t.annotation)}»</text>`)}d.push(` `+(0,e.renderMultilineText)(t.label,i+o/2,C,n.nodeLabel,e.f`text-anchor="middle" font-size="${n.nodeLabel}" font-weight="700" fill="${_??`var(--_text)`}"`));let w=a+c;l>0&&d.push(e.f` <line x1="${i}" y1="${w}" x2="${i+o}" y2="${w}" `+e.f`stroke="${m}" stroke-width="${I.innerBox}" />`);let T=B.memberRowHeight,E=(l-t.attributes.length*T)/2,D=(s-c-l-t.methods.length*T)/2+(t.attributes.length===0?B.methodsAfterEmptyExtra/2:0);for(let e=0;e<t.attributes.length;e++){let n=t.attributes[e],r=w+E+e*T+T/2;d.push(` `+Ci(n,i+B.boxPadX,r,_))}let O=w+l;s-c-l>0&&d.push(e.f` <line x1="${i}" y1="${O}" x2="${i+o}" y2="${O}" `+e.f`stroke="${m}" stroke-width="${I.innerBox}" />`);for(let e=0;e<t.methods.length;e++){let n=t.methods[e],r=O+D+e*T+T/2;d.push(` `+Ci(n,i+B.boxPadX,r,_))}return x&&d.push(` </a>`),d.push(`</g>`),d.join(`
43
+ `)}var Si=700;function Ci(t,n,r,i){let a=t.isAbstract?` font-style="italic"`:``,o=t.isStatic?` text-decoration="underline"`:``,s=i??`var(--_text-faint)`,c=i??`var(--_text-sec)`,l=i??`var(--_text-muted)`,u=[];t.visibility&&u.push(e.f`<tspan fill="${c}" font-weight="${Si}">${zi(t.visibility)}</tspan>${t.visibilitySpace?e.f`<tspan fill="${s}"> </tspan>`:``}`);let d=t.isMethod?e.f`${t.name}(${t.params||``})`:t.name;return u.push(e.f`<tspan fill="${c}">${zi(d)}</tspan>`),t.type&&(u.push(e.f`<tspan fill="${s}"> : </tspan>`),u.push(e.f`<tspan fill="${l}">${zi(t.type)}</tspan>`)),e.f`<text x="${n}" y="${r}" class="mono" dy="${L}" `+e.f`font-size="${_i.memberSize}" font-weight="${_i.memberWeight}"${a}${o}>`+e.f`${u.join(``)}</text>`}var wi=6;function Ti(t,n){let{x:r,y:i,width:a,height:o}=t,s=t.forClass===void 0?``:e.f` data-for="${(0,e.escapeAttr)(t.forClass)}"`,c=[e.f`${r},${i}`,e.f`${r+a-wi},${i}`,e.f`${r+a},${i+wi}`,e.f`${r+a},${i+o}`,e.f`${r},${i+o}`].join(` `),l=e.f`${r+a-wi},${i} ${r+a},${i+wi} `+e.f`${r+a-wi},${i+wi}`;return e.f`<g class="class-note"${s}>`+e.f`\n <polygon points="${c}" `+e.f`fill="var(--bg)" stroke="var(--_node-stroke)" stroke-width="${I.innerBox}" />`+e.f`\n <polygon points="${l}" `+e.f`fill="var(--_inner-stroke)" stroke="var(--_node-stroke)" stroke-width="${I.innerBox}" />`+e.f`\n ${(0,e.renderMultilineText)(t.text,r+a/2,i+o/2,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${F.edgeLabel}" fill="var(--_text-muted)"`)}`+`
44
+ </g>`}function Ei(t){if(!t.linkPoints||t.linkPoints.length<2)return``;let n=t.linkPoints.map(t=>e.f`${t.x},${t.y}`).join(` `),r=t.forClass===void 0?``:e.f` data-for="${(0,e.escapeAttr)(t.forClass)}"`;return e.f`<polyline class="class-note-link"${r} points="${n}" `+e.f`fill="none" stroke="var(--_line)" stroke-width="${I.connector}" stroke-dasharray="2 3" />`}function Di(t){if(t.points.length<2)return``;let n=t.dashed||t.type===`dependency`||t.type===`realization`||t.type===`dashed-link`?` stroke-dasharray="6 4"`:``,r=ki(t.type,t.markerAt),i=[`class="class-relationship"`,e.f`data-from="${(0,e.escapeAttr)(t.from)}"`,e.f`data-to="${(0,e.escapeAttr)(t.to)}"`,e.f`data-type="${t.type}"`,e.f`data-marker-at="${t.markerAt}"`];return t.label&&i.push(e.f`data-label="${(0,e.escapeAttr)(t.label)}"`),t.fromCardinality&&i.push(e.f`data-from-cardinality="${(0,e.escapeAttr)(t.fromCardinality)}"`),t.toCardinality&&i.push(e.f`data-to-cardinality="${(0,e.escapeAttr)(t.toCardinality)}"`),e.f`<path ${i.join(` `)} d="${d(t.points,u)}" fill="none" stroke="var(--_line)" `+e.f`stroke-width="${I.connector}"${n}${r} />`}function Oi(t,n){let r=t.interfaceLabel;if(!r)return``;let i=t.markerAt===`from`?t.from:t.to;return e.f`<g class="class-interface" data-id="${(0,e.escapeAttr)(i)}" data-label="${(0,e.escapeAttr)(r.text)}">\n `+(0,e.renderMultilineText)(r.text,r.x+r.width/2,r.y+r.height/2,n.nodeLabel,e.f`text-anchor="middle" font-size="${n.nodeLabel}" font-weight="${F.edgeLabel}" fill="var(--_text)"`)+`
45
+ </g>`}function ki(t,n){let r=Ai(t);return r?(n===`to`?``:e.f` marker-start="url(#${r})"`)+(n===`from`?``:e.f` marker-end="url(#${r})"`):``}function Ai(e){switch(e){case`inheritance`:case`realization`:return`cls-inherit`;case`composition`:return`cls-composition`;case`aggregation`:return`cls-aggregation`;case`association`:case`dependency`:return`cls-arrow`;case`lollipop`:return`cls-lollipop`;default:return null}}function ji(t,n){if(!t.label&&!t.fromCardinality&&!t.toCardinality||t.points.length<2)return``;let r=[];if(t.label){let i=Mi(t.points,t.labelPosition??Ni(t.points)),a=(0,e.measureMultilineText)(t.label,n.edgeLabel,F.edgeLabel);r.push((0,e.renderMultilineTextWithBackground)(t.label,i.x,i.y,a.width,a.height,n.edgeLabel,4,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${F.edgeLabel}" fill="var(--_text-muted)"`,`class="class-relationship-label-bg" fill="var(--bg)"`))}if(t.fromCardinality&&t.points.length>=2){let i=t.points[0],a=t.points[1],o=Pi(i,a,`start`,Fi(t,`from`));r.push((0,e.renderMultilineText)(t.fromCardinality,i.x+o.x,i.y+o.y,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="${o.anchor}" font-weight="${F.edgeLabel}" fill="var(--_text-muted)"`))}if(t.toCardinality&&t.points.length>=2){let i=t.points[t.points.length-1],a=t.points[t.points.length-2],o=Pi(i,a,`end`,Fi(t,`to`));r.push((0,e.renderMultilineText)(t.toCardinality,i.x+o.x,i.y+o.y,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="${o.anchor}" font-weight="${F.edgeLabel}" fill="var(--_text-muted)"`))}return r.join(`
46
+ `)}function Mi(e,t){let n=e[0],r=1/0;for(let i=1;i<e.length;i++){let a=e[i-1],o=e[i],s=o.x-a.x,c=o.y-a.y,l=s*s+c*c,u=Math.max(0,Math.min(1,((t.x-a.x)*s+(t.y-a.y)*c)/l)),d={x:a.x+u*s,y:a.y+u*c},f=(d.x-t.x)**2+(d.y-t.y)**2;f<r&&(r=f,n=d)}return n}function Ni(e){return e.length===0?{x:0,y:0}:e[Math.floor(e.length/2)]}function Pi(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,o=Math.max(Math.hypot(i,a),1e-6),s=Ii+(r?Li:0),c=Ri+(r?Li:0),l=i/o,u=a/o,d=n===`start`?1:-1,[f,p]=[l*d,u*d],m=(n===`start`?-p:p)*s,h=(n===`start`?f:-f)*s,g=h+u*s;if(Math.abs(m)>Math.abs(h)){let e=Math.sign(m);return{x:e*c+l*s,y:g,anchor:e>0?`start`:`end`}}return{x:m+l*s,y:g,anchor:`middle`}}function Fi(e,t){return Ai(e.type)!==null&&(e.markerAt===t||e.markerAt===`both`)}var Ii=12,Li=6,Ri=5,zi=e.escapeXml,V={padding:40,boxPadX:20,headerPadX:25,cellPadX:12.5,headerHeight:42.75,bareHeight:84,rowHeight:42.75,textLineHeight:24,drawnLabelMargin:8,minWidth:100,attrFontSize:11,attrFontWeight:400,nodeSpacing:70,layerSpacing:90,loopOut:20,loopHalf:10,loopLabelGap:4,loopNestGap:16,loopMargin:12};function Bi(t,n,r){let i=P(r.fontSizes).edgeLabel,a=[];for(let[r,o]of t.relationships.entries()){if(o.entity1!==n||o.entity2!==n)continue;let t=a[a.length-1],s=o.label?(0,e.measureMultilineText)(o.label,i,F.edgeLabel).width+8:0;a.push({index:r,nest:a.length,out:t?t.out+V.loopLabelGap+t.labelW+V.loopNestGap:V.loopOut,labelW:s})}return a}function Vi(e){return e.replace(/<br\s{0,8}\/?>/gi,`
47
+ `)}function Hi(e){let t=e.attributes.map(Gi);return[0,1,2,3].filter(e=>e<2||t.some(t=>t[e].length>0)).map(e=>({cell:e,width:Math.max(...t.flatMap(t=>t[e].split(`
48
+ `).map(e=>Math.max(ti(e,!1),A(e,V.attrFontSize)))))+V.cellPadX*2}))}function Ui(e){return Math.max(1,...Gi(e).map(e=>e.split(`
49
+ `).length))}function Wi(e,t){return e.map(e=>V.rowHeight+(Ui(e)-1)*V.textLineHeight+t)}function Gi(e){return[e.type,e.name,e.keys.join(`,`),Vi(e.comment??``).split(`
50
+ `).map(e=>e.trim()).join(`
51
+ `)]}function Ki(e){return Math.max(-10,((e.layout?.entityPadding??15)-15)*1.25)}function qi(e,t){let n=new Map,r=P(t.fontSizes),i=(e.layout?.diagramPadding??20)-20,a=Ki(e),o=e.layout?.minEntityWidth??0;for(let t of e.entities){let e=ti(t.label,!1),s=k(t.label,r.nodeLabel,F.nodeLabel)+V.drawnLabelMargin,c=t.attributes.length===0,l=Hi(t),u=l.reduce((e,t)=>e+t.width,0)+l.length*i*1.25,d=Math.max(o,s,c?Math.max(ri(t.label)+V.boxPadX*2+i*2<V.minWidth?V.minWidth:0,e+V.boxPadX*2+i*2):Math.max(e+V.headerPadX*2+i*2,u)),f=c?Math.max(20,V.bareHeight+i*3):V.headerHeight+a+Wi(t.attributes,a).reduce((e,t)=>e+t,0);n.set(t.id,{width:d,height:f})}let s=[];for(let[e,t]of n)s.push(me(e,t));let c={fontSize:r.edgeLabel},l=[];for(let[t,n]of e.relationships.entries())n.entity1!==n.entity2&&l.push(_e({id:`e${t}`,source:n.entity1,target:n.entity2,label:n.label,labelStyle:c}));let u=0;for(let n of e.entities){let r=Bi(e,n.id,t),i=r[r.length-1];i&&(u=Math.max(u,i.out+i.labelW))}return{elkGraph:{id:`root`,layoutOptions:{...pe({direction:de(e.direction,ue.er),nodeSpacing:Math.max(V.nodeSpacing,u+20),layerSpacing:Math.max(V.layerSpacing,u+20),padding:V.padding}),"elk.edgeLabels.placement":`CENTER`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,"elk.separateConnectedComponents":`false`,"elk.layered.nodePlacement.bk.fixedAlignment":`BALANCED`},children:s,edges:l},entitySizes:n}}function Ji(t,n,r,i){let a=Ki(n),o=new Map;for(let e of n.entities)o.set(e.id,e);let s=[];for(let i of t.children??[]){let t=o.get(i.id);if(t){let o=r.get(t.id);if(!o)throw Error(`Missing computed size for entity "${t.id}"`);s.push({id:t.id,label:t.label,attributes:t.attributes,x:i.x??0,y:i.y??0,width:i.width??o.width,height:i.height??o.height,headerHeight:t.attributes.length===0?o.height:V.headerHeight+a,rowHeight:V.rowHeight+a,rowHeights:Wi(t.attributes,a),inlineStyle:(0,e.resolveNodeStyle)(t.id,n),className:n.classAssignments.get(t.id)})}}let c=new Map((t.edges??[]).map(e=>[e.id,e])),l=[],u=1/0;for(let[e,t]of n.relationships.entries()){let r={entity1:t.entity1,entity2:t.entity2,cardinality1:t.cardinality1,cardinality2:t.cardinality2,label:t.label,identifying:t.identifying};if(t.entity1!==t.entity2){l.push({...r,points:vt(c.get(`e${e}`))});continue}let a=s.find(e=>e.id===t.entity1),o=Bi(n,t.entity1,i).find(t=>t.index===e),d=a.y+a.height/2,f=Math.max(V.loopHalf,a.height/8)+10*o.nest,p=a.x-o.out;l.push({...r,points:[{x:a.x,y:d-f},{x:p,y:d-f},{x:p,y:d+f},{x:a.x,y:d+f}],labelPoint:{x:p-V.loopLabelGap-o.labelW/2,y:d}}),u=Math.min(u,p-V.loopLabelGap-o.labelW)}let d=Math.max(0,V.loopMargin-u);if(d>0){for(let e of s)e.x+=d;for(let e of l){for(let t of e.points)t.x+=d;e.labelPoint&&(e.labelPoint.x+=d)}}return{width:(t.width??600)+d,height:t.height??400,entities:s,relationships:l}}function Yi(e,t={}){if(e.entities.length===0)return{width:0,height:0,entities:[],relationships:[]};let{elkGraph:n,entitySizes:r}=qi(e,t);return Ji(E(n,t.layoutCache),e,r,t)}var Xi=70,Zi={attrSize:11,attrWeight:400};function Qi(t,n,r=`Inter`,i=!1,a=N,o,s,c,l={}){let u=[];u.push(z((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,void 0,l.styleAttribute,l.description),o)),u.push(ie(r,!0,l.nonce,l.bodyFont)),u.push(`<defs>`),u.push(`</defs>`);for(let e of t.relationships)u.push(ta(e));for(let e of t.entities)u.push($i(e,a));for(let e of t.relationships)u.push(ra(e));for(let e of t.relationships)u.push(na(e,a));return u.push(`</svg>`),u.join(`
52
+ `)}function $i(t,n){let{id:r,x:i,y:a,width:o,height:s,headerHeight:c,rowHeight:l,label:u,attributes:d,inlineStyle:f}=t,p=[],m=(0,e.escapeAttr)(f?.fill??`var(--_node-fill)`),h=(0,e.escapeAttr)(f?.stroke??`var(--_node-stroke)`),g=(0,e.escapeAttr)(f?.[`stroke-width`]??String(I.outerBox)),_=(0,e.escapeAttr)(f?.[`stroke-width`]??String(I.innerBox)),v=f?.fill?m:`var(--_group-hdr)`,y=f?.color?(0,e.escapeAttr)(f.color):void 0,b=(0,e.sanitizeClassName)(t.className);p.push(e.f`<g class="${b?e.f`entity ${b}`:`entity`}" data-id="${(0,e.escapeAttr)(r)}" data-label="${(0,e.escapeAttr)(u)}">`),p.push(e.f` <rect x="${i}" y="${a}" width="${o}" height="${s}" `+e.f`rx="0" ry="0" fill="${m}" stroke="${h}" stroke-width="${g}" />`),p.push(e.f` <rect x="${i}" y="${a}" width="${o}" height="${c}" `+e.f`rx="0" ry="0" fill="${v}" stroke="${h}" stroke-width="${g}" />`),p.push(` `+(0,e.renderMultilineText)(u,i+o/2,a+c/2,n.nodeLabel,e.f`text-anchor="middle" font-size="${n.nodeLabel}" font-weight="700" fill="${y??`var(--_text)`}"`));let x=a+c;if(d.length>0){let n=a+s,r=Hi(t),c=(o-r.reduce((e,t)=>e+t.width,0))/r.length,u=[i];for(let e of r)u.push(u[u.length-1]+e.width+c);let m=t.rowHeights??d.map(()=>l),g=[],v=x;for(let e of m)g.push(v),v+=e;for(let t=1;!f?.fill&&t<d.length;t+=2)p.push(e.f` <rect x="${i}" y="${g[t]}" width="${o}" height="${m[t]}" `+e.f`fill="var(--_key-badge)" />`);let b=(t,n,r,i)=>e.f` <line x1="${t}" y1="${n}" x2="${r}" y2="${i}" stroke="${h}" stroke-width="${_}" />`;p.push(b(i,x,i+o,x));for(let e=1;e<d.length;e++)p.push(b(i,g[e],i+o,g[e]));for(let e=1;e<r.length;e++)p.push(b(u[e],x,u[e],n));for(let e=0;e<d.length;e++){let t=Ui(d[e]),n=g[e]+(m[e]-t*V.textLineHeight)/2+V.textLineHeight/2,i=Gi(d[e]);p.push(` `+ea(d[e],r.map((e,t)=>({x:u[t]+V.cellPadX,text:i[e.cell]})),n,y).replace(/\n/g,`
48
53
  `))}}return p.push(`</g>`),p.join(`
49
- `)}function Hi(t,n,r,i){let a=[];if(t.comment&&t.comment.length>0){let n=Ai(t.comment);a.push(e.f`<g><title>${Ji(n)}</title>`)}return n.forEach((t,n)=>{if(!t.text)return;let o=n===1?`--_text-sec`:`--_text-muted`;a.push(e.f`<text x="${t.x}" y="${r}" class="mono" dy="${L}" `+e.f`font-size="${zi.attrSize}" font-weight="${zi.attrWeight}">`+e.f`<tspan fill="${i??`var(${o})`}">${Ji(t.text)}</tspan></text>`)}),t.comment&&t.comment.length>0&&a.push(`</g>`),a.join(`
50
- `)}function Ui(t){if(t.points.length<2)return``;let n=t.points.map(t=>e.f`${t.x},${t.y}`).join(` `),r=t.identifying?``:` stroke-dasharray="6 4"`,i=t.label?e.f` data-label="${(0,e.escapeAttr)(t.label)}"`:``,a=[`class="er-relationship"`,e.f`data-entity1="${(0,e.escapeAttr)(t.entity1)}"`,e.f`data-entity2="${(0,e.escapeAttr)(t.entity2)}"`,e.f`data-cardinality1="${t.cardinality1}"`,e.f`data-cardinality2="${t.cardinality2}"`,e.f`data-identifying="${t.identifying}"`];return e.f`<polyline ${a.join(` `)}${i} points="${n}" fill="none" stroke="var(--_line)" `+e.f`stroke-width="${I.connector}"${r} />`}function Wi(t,n){if(!t.label||t.points.length<2)return``;let r=t.labelPoint??qi(t.points),i=(0,e.measureMultilineText)(t.label,n.edgeLabel,P.edgeLabel),a=i.width+8,o=i.height+6;return e.f`<rect x="${r.x-a/2}" y="${r.y-o/2}" width="${a}" height="${o}" rx="2" ry="2" `+`fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="0.5" />`+e.f`\n${(0,e.renderMultilineText)(t.label,r.x,r.y,n.edgeLabel,e.f`text-anchor="middle" font-size="${n.edgeLabel}" font-weight="${P.edgeLabel}" fill="color-mix(in srgb, var(--fg) ${Ri}%, var(--bg))"`)}`}function Gi(e){if(e.points.length<2)return``;let t=[],n=e.points[0],r=e.points[1];t.push(Ki(n,r,e.cardinality1));let i=e.points[e.points.length-1],a=e.points[e.points.length-2];return t.push(Ki(i,a,e.cardinality2)),t.join(`
51
- `)}function Ki(t,n,r){let i=[],a=I.connector+.25,o=t.x-n.x,s=t.y-n.y,c=Math.sqrt(o*o+s*s);if(c===0)return``;let l=o/c,u=s/c,d=-u,f=l,p=t.x-l*4,m=t.y-u*4,h=t.x-l*16,g=t.y-u*16,_=r===`one`||r===`zero-one`,v=r===`many`||r===`zero-many`,y=r===`zero-one`||r===`zero-many`;if(_){i.push(e.f`<line x1="${p+d*6}" y1="${m+f*6}" `+e.f`x2="${p-d*6}" y2="${m-f*6}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`);let t=p-l*4,n=m-u*4;i.push(e.f`<line x1="${t+d*6}" y1="${n+f*6}" `+e.f`x2="${t-d*6}" y2="${n-f*6}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`)}if(v){let t=p,n=m;i.push(e.f`<line x1="${t+d*7}" y1="${n+f*7}" `+e.f`x2="${h}" y2="${g}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`),i.push(e.f`<line x1="${t}" y1="${n}" `+e.f`x2="${h}" y2="${g}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`),i.push(e.f`<line x1="${t-d*7}" y1="${n-f*7}" `+e.f`x2="${h}" y2="${g}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`)}if(r===`many`){let n=t.x-l*20,r=t.y-u*20;i.push(e.f`<line x1="${n+d*6}" y1="${r+f*6}" `+e.f`x2="${n-d*6}" y2="${r-f*6}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`)}if(y){let n=v?20:12,r=t.x-l*n,o=t.y-u*n;i.push(e.f`<circle cx="${r}" cy="${o}" r="4" `+e.f`fill="var(--bg)" stroke="var(--_line)" stroke-width="${a}" />`)}return i.join(`
52
- `)}function qi(e){if(e.length===0)return{x:0,y:0};if(e.length===1)return e[0];let t=0;for(let n=1;n<e.length;n++){let r=e[n].x-e[n-1].x,i=e[n].y-e[n-1].y;t+=Math.sqrt(r*r+i*i)}if(t===0)return e[0];let n=t/2,r=0;for(let t=1;t<e.length;t++){let i=e[t].x-e[t-1].x,a=e[t].y-e[t-1].y,o=Math.sqrt(i*i+a*a);if(r+o>=n){let s=o>0?(n-r)/o:0;return{x:e[t-1].x+i*s,y:e[t-1].y+a*s}}r+=o}return e[e.length-1]}var Ji=e.escapeXml,Yi={padding:30,paddingY:30,bottomAdj:0,actorMinWidth:80,actorGap:140,actorHeight:40,actorPadX:16,headerGap:20,messageRowHeight:40,selfMessageHeight:30,activationWidth:10,blockPadX:10,blockPadTop:40,blockPadBottom:8,blockHeaderExtra:28,blockHeaderLabelGap:26,blockNestedHeaderGap:17,dividerExtra:24,dividerLabelGap:26,noteWidth:60,notePadX:12,notePadY:6,noteGap:10,noteOffsetAfterMessage:8,noteStackGap:4,boxPad:10,titleBand:36},Xi=60,Zi=45,Qi=20;function $i(e){return e+8}var ea=14,ta=74;function na(e,t){return e.type===`actor`?Math.max(44,t):t}function ra(e){return e.type===`actor`?15:14}var ia=new Set([`boundary`,`control`,`entity`,`database`]);function aa(e){return e.type===`actor`||ia.has(e.participantType)}var oa=4;function sa(t,n,r,i){return t+(0,e.measureMultilineText)(n,r,i).height/2}function ca(e,t){let n=(e,t)=>(e??t)-t,r=n(t?.noteMargin,10),i=n(t?.diagramMarginX,50);return{...Yi,padding:Yi.padding+i,paddingY:Yi.paddingY+n(t?.diagramMarginY,10),bottomAdj:Math.max(0,n(t?.bottomMarginAdj,1)),actorMinWidth:Yi.actorMinWidth+n(t?.width,150),actorGap:Yi.actorGap+n(t?.actorMargin,50),activationWidth:Yi.activationWidth+n(t?.activationWidth,10),selfMessageHeight:Yi.selfMessageHeight-(t?.rightAngles?10:0),notePadX:Yi.notePadX+r,notePadY:Yi.notePadY+r,actorHeight:e?.actorHeight??Yi.actorHeight+n(t?.height,65),headerGap:e?.headerGap??Yi.headerGap,messageRowHeight:e?.messageRowHeight??Yi.messageRowHeight+n(t?.boxMargin,10),noteOffsetAfterMessage:e?.noteOffsetAfterMessage??Yi.noteOffsetAfterMessage,noteStackGap:e?.noteStackGap??Yi.noteStackGap}}var la=16;function ua(t,n,r=P.edgeLabel){return(0,e.measureMultilineText)(t,n,r).width}var da=.5;function fa(e){return e.blockPadX+1}var pa=.2,ma=.24;function ha(e,t,n){let r=18*ma,i=18*pa;return[[e,t],[e+n,t],[e+n,t+18-i],[e+n-r,t+18],[e,t+18]]}function ga(e,t){return e.type===`rect`&&e.color!==void 0?0:ua(e.type,t,P.groupHeader)+16}function _a(e,t,n){let r=`[${e}]`,i=[];for(let e of r.split(`
53
- `)){let r=``;for(let a of e.split(` `))if(ua(`${a} `,n)>t){let e=[...a];i.push(r),r=``,e.forEach((a,o)=>{ua(r+a,n)>=t?(i.push(o===e.length-1?r+a:`${r+a}-`),r=``):r+=a})}else r&&ua(r,n)+ua(`${a} `,n)>=t?(i.push(r),r=a):r=r?`${r} ${a}`:a;i.push(r)}return i.filter(Boolean).join(`
54
- `).slice(1,-1)}function va(t,n){return t?(t.split(`
55
- `).length-1)*n*e.LINE_HEIGHT_RATIO:0}function ya(e){return e.map((t,n)=>e.slice(0,n).flatMap((e,n)=>e.startIndex>=t.startIndex&&e.endIndex<=t.endIndex?[n]:[]))}function ba(e,t,n,r,i){let a=new Map(e.actors.map((e,t)=>[e.id,t])),o=(e,t,r)=>{if(e<0||t>=n.length)return;let i=0;for(let r=e+1;r<=t;r++)i+=n[r];if(i>=r)return;let a=(r-i)/(t-e);for(let r=e+1;r<=t;r++)n[r]+=a};for(let t of e.messages){if(!t.label)continue;let e=a.get(t.from),n=a.get(t.to),r=ua(t.label,i);e===n?(o(e-1,e,r/2+la),o(e,e+1,r/2+la)):o(Math.min(e,n),Math.max(e,n),r+32)}for(let n of e.notes){let e=a.get(n.actorIds[0]??``),s=Math.max(r.noteWidth,ua(n.text,i)+r.notePadX*2),c=t[e]/2+r.noteGap+s+la;if(n.position===`right`)o(e,e+1,c);else if(n.position===`left`)o(e-1,e,c);else if(n.actorIds.length===1)o(e,e+1,s/2+la),o(e-1,e,s/2+la);else{let t=a.get(n.actorIds[n.actorIds.length-1]);o(Math.min(e,t),Math.max(e,t),s-50)}}}function xa(e,t,n){let r=e=>k(e,n,P.edgeLabel)<=t;return e.split(`
56
- `).map(e=>{let t=[],n=``;for(let i of e.split(/\s+/).filter(Boolean))n&&!r(`${n} ${i}`)?(t.push(n),n=i):n=n?`${n} ${i}`:i;return t.push(n),t.join(`
57
- `)}).join(`
58
- `)}function Sa(e,t){let n=e.layout??{},r=t/16,i=n.width??150,a=i*r,o=(i+(n.actorMargin??50))*r;return{...e,notes:e.notes.map(e=>({...e,text:e.wrap??n.wrap?xa(e.text,a,t):e.text})),messages:e.messages.map(e=>({...e,label:e.wrap??n.wrap?xa(e.label,o,t):e.label}))}}function Ca(t,n={}){let r=t.layout?.wrap||t.messages.some(e=>e.wrap)||t.notes.some(e=>e.wrap)?Sa(t,N(n.fontSizes).edgeLabel):t;if(r.actors.length===0)return{width:0,height:0,actors:[],lifelines:[],messages:[],activations:[],blocks:[],notes:[],boxes:[],footerActors:[]};let i=ca(n.sequence,r.layout),a=e=>e===`left`||e===`right`?e:void 0,o=a(r.layout?.noteAlign),s=a(r.layout?.messageAlign),c=N(n.fontSizes),l=r.actors.map(e=>{let t=k(e.label,c.nodeLabel,P.nodeLabel);return Math.max(t+i.actorPadX*2,i.actorMinWidth)}),u=l.map((e,t)=>t===0?0:Math.max(i.actorGap,(l[t-1]+e)/2+40+(i.actorGap-Yi.actorGap)));ba(r,l,u,i,c.edgeLabel);let d=[],f=i.padding+l[0]/2;for(let e=0;e<r.actors.length;e++)f+=u[e],d.push(f);let p=new Map;for(let e=0;e<r.actors.length;e++)p.set(r.actors[e].id,e);let m=r.boxes.filter(e=>e.actorIds.length>0),h=m.some(e=>e.label!==``),g=m.length===0?0:i.boxPad+(h?$i(c.edgeLabel):0),_=r.title?i.titleBand:0,v=i.paddingY+_,y=v+g,b=r.actors.map((e,t)=>({id:e.id,label:e.label,type:e.type,...e.participantType!==void 0&&{participantType:e.participantType},x:d[t],y,width:l[t],height:na(e,i.actorHeight)})),x=e=>b[e].height,S=Math.max(...r.actors.map((e,t)=>e.createdAt===void 0?x(t):0),i.actorHeight),C=Math.max(...b.map(e=>e.height),i.actorHeight),w=m.map(e=>{let t=e.actorIds.map(e=>p.get(e)??0),n=Math.min(...t),r=Math.max(...t),a=d[n]-l[n]/2-i.boxPad,o=d[r]+l[r]/2+i.boxPad,s={label:e.label,x:a,y:v,width:o-a,height:0};return e.color!==void 0&&(s.color=e.color),s}),T=r.actors.map(e=>aa(e)?sa(ra(e),e.label,c.nodeLabel,P.nodeLabel):0),E=Math.max(0,...r.actors.map((e,t)=>e.createdAt===void 0?T[t]:0)),D=c.edgeLabel+12,O=y+S+Math.max(i.headerGap,E>0?E+oa+D:0),A=[],j=new Map,ee=new Map,M=new Map,te=r.blocks.map(e=>{let t=r.messages.slice(e.startIndex,e.endIndex+1).flatMap(e=>[d[p.get(e.from)],d[p.get(e.to)]]),n=t.length?Math.max(...t)-Math.min(...t):d[d.length-1]-d[0],i=Math.max(n-14,60),a=e=>e&&_a(e,i,c.edgeLabel);return{label:a(e.label),dividers:e.dividers.map(e=>a(e.label))}});r.blocks.forEach((e,t)=>{let n=r.blocks.some((n,r)=>r<t&&n.startIndex===e.startIndex),a=va(te[t].label,c.edgeLabel),o=n?0:i.blockHeaderLabelGap;M.set(e.startIndex,(M.get(e.startIndex)??0)+a+o),j.set(e.startIndex,(j.get(e.startIndex)??0)+i.blockHeaderExtra+a+(n?i.blockNestedHeaderGap:o));for(let[n,a]of e.dividers.entries()){let e=r.blocks.some(e=>e.startIndex===a.index);ee.set(a.index,i.dividerExtra+(e?0:i.dividerLabelGap)+va(te[t].dividers[n],c.edgeLabel))}});let ne=ya(r.blocks),F=new Map;r.blocks.forEach((e,t)=>{let n=F.get(e.endIndex)??[];n.push(t),F.set(e.endIndex,n)});let I=[],L=e=>r.notes.slice(e.noteStartIndex,e.noteEndIndex),re=new Map;for(let e of r.notes){let t=re.get(e.afterIndex)??[];t.push(e),re.set(e.afterIndex,t)}let ie=[],ae=new Map,oe=(t,n)=>{let r=Math.max(i.noteWidth,ua(t.text,c.edgeLabel)+i.notePadX*2),a=t.text.split(`
59
- `).length,s=c.edgeLabel*(1+(a-1)*e.LINE_HEIGHT_RATIO)+i.notePadY*2,u=p.get(t.actorIds[0]??``)??0,f;if(t.position===`left`)f=d[u]-l[u]/2-r-i.noteGap;else if(t.position===`right`)f=d[u]+l[u]/2+i.noteGap;else if(t.actorIds.length>1){let e=p.get(t.actorIds[t.actorIds.length-1]??``)??u,n=d[u],i=d[e];r=Math.max(r,Math.abs(n-i)+50),f=(n+i)/2-r/2}else f=d[u]-r/2;let m={text:t.text,x:f,y:n,width:r,height:s,position:t.position,actors:t.actorIds,...o&&{align:o}};return ie.push(m),ae.set(t,m),n+s+i.noteStackGap},se=re.get(-1);if(se&&se.length>0){let e=O;for(let t of se)e=oe(t,e);O=Math.max(O,e+i.messageRowHeight/2)}let ce=new Map,le=[],ue=i.activationWidth/2;function de(e,t,n=!1){let r=n?t+i.selfMessageHeight+2:t,a=ce.get(e)??[];ce.set(e,a);let o=a.length;a.push({startY:r,depth:o})}function fe(e,t,n=!1){let r=n?t+i.selfMessageHeight:t,a=ce.get(e);if(!a||a.length===0)return;let{startY:o,depth:s}=a.pop(),c=p.get(e)??0,l=s*ue;le.push({actorId:e,x:d[c]-i.activationWidth/2+l,topY:o,bottomY:r,width:i.activationWidth,depth:s})}let pe=new Map;for(let e of r.activations){let t=pe.get(e.afterIndex)??[];t.push(e),pe.set(e.afterIndex,t)}function me(e,t,n=!1){for(let r of pe.get(e)??[])r.kind===`start`?de(r.actorId,t,n):fe(r.actorId,t,n)}me(-1,O);let he=r.mirrorActors!==!1,ge=[];for(let e=0;e<r.messages.length;e++){let t=r.messages[e],n=p.get(t.from)??0,a=p.get(t.to)??0,o=t.from===t.to&&he&&r.actors[n].destroyedAt===e,u=t.from===t.to&&!o;O+=(j.get(e)??0)+(ee.get(e)??0);let f=va(t.label,c.edgeLabel);O+=f,ge[e]=f;let m=d[n],h=d[a];o&&(m-=aa(r.actors[n])?18:l[n]/2);let g=!u&&r.actors[a].createdAt===e;if(g){let e=l[a]/2;h+=m<h?-e:e}if(!o&&he&&n!==a){let t=Math.sign(h-m),i=e=>aa(r.actors[e])?18:l[e]/2;r.actors[n].destroyedAt===e&&(m+=t*(i(n)+1)),r.actors[a].destroyedAt===e&&(h-=t*(i(a)+8))}A.push({from:t.from,to:t.to,label:t.label,lineStyle:t.lineStyle,arrowHead:t.arrowHead,x1:m,x2:h,y:O,isSelf:u,bidirectional:t.bidirectional??!1,...t.isLost&&{isLost:!0},...s&&{labelAlign:s},...u&&r.layout?.rightAngles&&{rightAngles:!0},seqNumber:t.seqNumber}),t.activate&&de(t.to,O,u),t.deactivate&&fe(t.from,O,u),me(e,O,u),O+=u?i.selfMessageHeight+i.messageRowHeight:i.messageRowHeight,g&&(O+=x(a)/2);let _=t=>{let n=A[e].y+(u?20:0)+i.blockPadBottom+12;for(let e of L(r.blocks[t])){let t=ae.get(e);n=Math.max(n,t.y+t.height+i.blockPadBottom)}for(let e of ne[t])n=Math.max(n,I[e]+i.blockPadBottom);I[t]=n,O=Math.max(O,n+i.messageRowHeight/2)},v=F.get(e)??[],y=re.get(e);if(y&&y.length>0){let t=u?i.selfMessageHeight:0,n=A[e].y+t+i.noteOffsetAfterMessage;for(let e of y){let t=r.notes.indexOf(e);for(let e of v)I[e]===void 0&&r.blocks[e].noteEndIndex<=t&&(_(e),n=Math.max(n,I[e]+i.noteOffsetAfterMessage));n=oe(e,n)}O=Math.max(O,n+i.messageRowHeight/2)}for(let e of v)I[e]===void 0&&_(e)}for(let[e,t]of ce)for(let{startY:n,depth:r}of t){let t=p.get(e)??0,a=r*ue;le.push({actorId:e,x:d[t]-i.activationWidth/2+a,topY:n,bottomY:O-i.messageRowHeight/2,width:i.activationWidth,depth:r})}le.sort((e,t)=>e.depth-t.depth);let _e=[];r.blocks.forEach((e,t)=>{let n=ne[t].map(e=>_e[e]),a=(A[e.startIndex]?.y??O)-i.blockPadTop-M.get(e.startIndex)-(ge[e.startIndex]??0);for(let e of n)a=Math.min(a,e.y-i.blockHeaderExtra-i.blockNestedHeaderGap);let o=I[t]??O+i.blockPadBottom+12,s=new Set;for(let t=e.startIndex;t<=e.endIndex;t++){let e=r.messages[t];e&&(s.add(p.get(e.from)??0),s.add(p.get(e.to)??0))}if(s.size===0)for(let e=0;e<r.actors.length;e++)s.add(e);let l=Math.min(...s),u=Math.max(...s),f=fa(i),m=d[l]-f,h=d[u]+f;for(let t of r.messages.slice(e.startIndex,e.endIndex+1)){if(t.from!==t.to)continue;let e=d[p.get(t.from)],n=ua(t.label,c.edgeLabel)/2;m=Math.min(m,e-n-i.blockPadX),h=Math.max(h,e+Math.max(45,n)+i.blockPadX)}for(let e of le){let t=p.get(e.actorId);t<l||t>u||e.topY>=o||e.bottomY<=a||(h=Math.max(h,e.x+e.width+i.blockPadX))}for(let t of L(e)){let e=ae.get(t);m=Math.min(m,e.x-i.blockPadX),h=Math.max(h,e.x+e.width+i.blockPadX)}for(let e of n)m=Math.min(m,e.x-i.blockPadX),h=Math.max(h,e.x+e.width+i.blockPadX);let g=e.dividers.map((e,a)=>{let o=te[t].dividers[a],s=n.filter((n,i)=>r.blocks[ne[t][i]].startIndex===e.index);if(s.length>0)return{y:Math.min(...s.map(e=>e.y))-i.dividerExtra,label:o};let l=A[e.index];return{y:(l?.y??O)-((e.label&&l?.label?40:28)+i.dividerLabelGap+va(o,c.edgeLabel)+(ge[e.index]??0)),label:o}});_e.push({type:e.type,label:te[t].label,...e.color===void 0?{}:{color:e.color},x:m,y:a,width:h-m,height:o-a,dividers:g})});let ve=ie,ye=O,be=Math.max(0,...r.actors.map((e,t)=>e.destroyedAt===void 0&&T[t]>0?T[t]+oa:0)),xe=ye+(he?C+be:0)+i.paddingY+i.bottomAdj,Se=i.padding,Ce=0;for(let e of b)Se=Math.min(Se,e.x-e.width/2),Ce=Math.max(Ce,e.x+e.width/2);for(let e of _e)Se=Math.min(Se,e.x),Ce=Math.max(Ce,e.x+e.width);for(let e of ve)Se=Math.min(Se,e.x),Ce=Math.max(Ce,e.x+e.width);for(let e of w)Se=Math.min(Se,e.x),Ce=Math.max(Ce,e.x+e.width);for(let e of A)if(e.isSelf&&(Ce=Math.max(Ce,e.x1+45+8),e.label)){let t=k(e.label,c.edgeLabel,P.edgeLabel)/2+8;Ce=Math.max(Ce,e.x1+t),Se=Math.min(Se,e.x1-t)}let we=Se<i.padding?i.padding-Se:0;if(we>0){for(let e of b)e.x+=we;for(let e of A)e.x1+=we,e.x2+=we;for(let e of le)e.x+=we;for(let e of _e)e.x+=we;for(let e of ve)e.x+=we;for(let e of w)e.x+=we;for(let e=0;e<d.length;e++)d[e]+=we}for(let e=0;e<r.actors.length;e++){let t=r.actors[e].createdAt;t!==void 0&&(b[e].y=(A[t]?.y??O)-x(e)/2)}let Te=r.actors.map((e,t)=>{let n=e.destroyedAt,r={actorId:e.id,x:d[t],topY:b[t].y+(e.type===`actor`?Math.max(ta,x(t)+T[t]+oa):x(t)+(T[t]>0?T[t]+oa:0)),bottomY:n===void 0?ye:(A[n]?.y??O)-(he?T[t]>0?31:x(t)/2:0)};return n!==void 0&&(r.destroyed=!0),r}),Ee=b.map((e,t)=>r.actors[t].destroyedAt===void 0?{...e,y:ye+(e.type===`actor`?6:0)}:{...e,y:Te[t].bottomY}).filter(()=>he);for(let e of w)e.height=xe-i.paddingY-i.bottomAdj+i.boxPad-e.y;let De=r.title?(0,e.measureMultilineText)(r.title,18,P.groupHeader).width+2*i.padding:0,Oe=Ce+we+i.padding;return{width:Math.max(Oe,De,200),height:Math.max(xe,100),actors:b,lifelines:Te,messages:A,activations:le,blocks:_e,notes:ve,boxes:w,footerActors:Ee,...r.title&&{title:{text:r.title,y:i.paddingY+9}}}}function wa(t,n,r=`Inter`,i=!1,a=M,o,s,c,l={}){let u=[];u.push(R((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,void 0,l.styleAttribute,l.description),o)),u.push((0,e.buildStyleBlock)(r,!1,l.nonce,l.bodyFont)),u.push(`<defs>`),u.push(Ta()),u.push(`</defs>`);for(let e of t.boxes)u.push(za(e,a));for(let e of t.blocks.toReversed())Ba(e)&&u.push(Va(e,a));for(let e of t.lifelines)u.push(Pa(e));for(let e of t.activations)u.push(Fa(e));for(let e of t.blocks)Ba(e)||u.push(Va(e,a));for(let e of t.footerActors)u.push(Da(e,a,`actor-footer`));for(let e of t.messages)u.push(Ia(e,a));for(let e of t.notes)u.push(Wa(e,a));for(let e of t.actors)u.push(Da(e,a));return t.title&&u.push(`<g class="title">`+(0,e.renderMultilineText)(t.title.text,t.width/2,t.title.y,18,e.f`font-size="${18}" text-anchor="middle" font-weight="${P.groupHeader}" fill="var(--_text)"`)+`</g>`),u.push(`</svg>`),u.join(`
60
- `)}function Ta(){let t=re.width,n=re.height;return e.f` <marker id="seq-arrow" markerWidth="${t}" markerHeight="${n}" refX="${t}" refY="${n/2}" orient="auto-start-reverse">`+e.f`\n <polygon points="0 0, ${t} ${n/2}, 0 ${n}" fill="var(--_arrow)" />`+`
54
+ `)}function ea(t,n,r,i){let a=[];if(t.comment&&t.comment.length>0){let n=Vi(t.comment);a.push(e.f`<g><title>${oa(n)}</title>`)}return n.forEach((t,n)=>{if(!t.text)return;let o=n===1?`--_text-sec`:`--_text-muted`;t.text.split(`
55
+ `).forEach((n,s)=>{a.push(e.f`<text x="${t.x}" y="${r+s*V.textLineHeight}" class="mono" dy="${L}" `+e.f`font-size="${Zi.attrSize}" font-weight="${Zi.attrWeight}">`+e.f`<tspan fill="${i??`var(${o})`}">${oa(n)}</tspan></text>`)})}),t.comment&&t.comment.length>0&&a.push(`</g>`),a.join(`
56
+ `)}function ta(t){if(t.points.length<2)return``;let n=t.points.map(t=>e.f`${t.x},${t.y}`).join(` `),r=t.identifying?``:` stroke-dasharray="6 4"`,i=t.label?e.f` data-label="${(0,e.escapeAttr)(t.label)}"`:``,a=[`class="er-relationship"`,e.f`data-entity1="${(0,e.escapeAttr)(t.entity1)}"`,e.f`data-entity2="${(0,e.escapeAttr)(t.entity2)}"`,e.f`data-cardinality1="${t.cardinality1}"`,e.f`data-cardinality2="${t.cardinality2}"`,e.f`data-identifying="${t.identifying}"`];return e.f`<polyline ${a.join(` `)}${i} points="${n}" fill="none" stroke="var(--_line)" `+e.f`stroke-width="${I.connector}"${r} />`}function na(t,n){if(!t.label||t.points.length<2)return``;let r=t.labelPoint??aa(t.points),i=(0,e.measureMultilineText)(t.label,n.edgeLabel,F.edgeLabel),a=i.width+8,o=i.height+6;return e.f`<rect x="${r.x-a/2}" y="${r.y-o/2}" width="${a}" height="${o}" rx="2" ry="2" `+`fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="0.5" />`+e.f`\n${(0,e.renderMultilineText)(t.label,r.x,r.y,n.edgeLabel,e.f`text-anchor="middle" font-size="${n.edgeLabel}" font-weight="${F.edgeLabel}" fill="color-mix(in srgb, var(--fg) ${Xi}%, var(--bg))"`)}`}function ra(e){if(e.points.length<2)return``;let t=[],n=e.points[0],r=e.points[1];t.push(ia(n,r,e.cardinality1));let i=e.points[e.points.length-1],a=e.points[e.points.length-2];return t.push(ia(i,a,e.cardinality2)),t.join(`
57
+ `)}function ia(t,n,r){let i=[],a=I.connector+.25,o=t.x-n.x,s=t.y-n.y,c=Math.sqrt(o*o+s*s);if(c===0)return``;let l=o/c,u=s/c,d=-u,f=l,p=t.x-l*4,m=t.y-u*4,h=t.x-l*16,g=t.y-u*16,_=r===`one`||r===`zero-one`,v=r===`many`||r===`zero-many`,y=r===`zero-one`||r===`zero-many`;if(_){i.push(e.f`<line x1="${p+d*6}" y1="${m+f*6}" `+e.f`x2="${p-d*6}" y2="${m-f*6}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`);let t=p-l*4,n=m-u*4;i.push(e.f`<line x1="${t+d*6}" y1="${n+f*6}" `+e.f`x2="${t-d*6}" y2="${n-f*6}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`)}if(v){let t=p,n=m;i.push(e.f`<line x1="${t+d*7}" y1="${n+f*7}" `+e.f`x2="${h}" y2="${g}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`),i.push(e.f`<line x1="${t}" y1="${n}" `+e.f`x2="${h}" y2="${g}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`),i.push(e.f`<line x1="${t-d*7}" y1="${n-f*7}" `+e.f`x2="${h}" y2="${g}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`)}if(r===`many`){let n=t.x-l*20,r=t.y-u*20;i.push(e.f`<line x1="${n+d*6}" y1="${r+f*6}" `+e.f`x2="${n-d*6}" y2="${r-f*6}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`)}if(y){let n=v?20:12,r=t.x-l*n,o=t.y-u*n;i.push(e.f`<circle cx="${r}" cy="${o}" r="4" `+e.f`fill="var(--bg)" stroke="var(--_line)" stroke-width="${a}" />`)}return i.join(`
58
+ `)}function aa(e){if(e.length===0)return{x:0,y:0};if(e.length===1)return e[0];let t=0;for(let n=1;n<e.length;n++){let r=e[n].x-e[n-1].x,i=e[n].y-e[n-1].y;t+=Math.sqrt(r*r+i*i)}if(t===0)return e[0];let n=t/2,r=0;for(let t=1;t<e.length;t++){let i=e[t].x-e[t-1].x,a=e[t].y-e[t-1].y,o=Math.sqrt(i*i+a*a);if(r+o>=n){let s=o>0?(n-r)/o:0;return{x:e[t-1].x+i*s,y:e[t-1].y+a*s}}r+=o}return e[e.length-1]}var oa=e.escapeXml,sa={padding:30,paddingY:30,bottomAdj:0,actorMinWidth:80,actorGap:140,actorHeight:40,actorPadX:16,headerGap:20,messageRowHeight:40,selfMessageHeight:30,activationWidth:10,blockPadX:10,blockPadTop:40,blockPadBottom:8,blockHeaderExtra:28,blockHeaderLabelGap:26,blockNestedHeaderGap:17,dividerExtra:24,dividerLabelGap:26,noteWidth:60,notePadX:12,notePadY:6,noteGap:10,noteOffsetAfterMessage:8,noteStackGap:4,boxPad:10,titleBand:36},ca=60,la=45,ua=20;function da(e){return e+8}var fa=14,pa=74;function ma(e,t){return e.type===`actor`?Math.max(44,t):t}function ha(e){return e.type===`actor`?15:14}var ga=new Set([`boundary`,`control`,`entity`,`database`]);function _a(e){return e.type===`actor`||ga.has(e.participantType)}var va=4;function ya(t,n,r,i){return t+(0,e.measureMultilineText)(n,r,i).height/2}function ba(e,t){let n=(e,t)=>(e??t)-t,r=n(t?.noteMargin,10),i=n(t?.diagramMarginX,50);return{...sa,padding:sa.padding+i,paddingY:sa.paddingY+n(t?.diagramMarginY,10),bottomAdj:Math.max(0,n(t?.bottomMarginAdj,1)),actorMinWidth:sa.actorMinWidth+n(t?.width,150),actorGap:sa.actorGap+n(t?.actorMargin,50),activationWidth:sa.activationWidth+n(t?.activationWidth,10),selfMessageHeight:sa.selfMessageHeight-(t?.rightAngles?10:0),notePadX:sa.notePadX+r,notePadY:sa.notePadY+r,actorHeight:e?.actorHeight??sa.actorHeight+n(t?.height,65),headerGap:e?.headerGap??sa.headerGap,messageRowHeight:e?.messageRowHeight??sa.messageRowHeight+n(t?.boxMargin,10),noteOffsetAfterMessage:e?.noteOffsetAfterMessage??sa.noteOffsetAfterMessage,noteStackGap:e?.noteStackGap??sa.noteStackGap}}var xa=16;function Sa(t,n,r=F.edgeLabel){return(0,e.measureMultilineText)(t,n,r).width}var Ca=.5;function wa(e){return e.blockPadX+1}var Ta=.2,Ea=.24;function Da(e,t,n){let r=18*Ea,i=18*Ta;return[[e,t],[e+n,t],[e+n,t+18-i],[e+n-r,t+18],[e,t+18]]}function Oa(e,t){return e.type===`rect`&&e.color!==void 0?0:Sa(e.type,t,F.groupHeader)+16}function ka(e,t,n){return Aa(`[${e}]`,t,e=>Sa(e,n)).slice(1,-1)}function Aa(e,t,n){let r=[];for(let i of e.split(`
59
+ `)){let e=``;for(let a of i.split(` `))if(n(`${a} `)>t){let i=[...a];r.push(e),e=``,i.forEach((a,o)=>{n(e+a)>=t?(r.push(o===i.length-1?e+a:`${e+a}-`),e=``):e+=a})}else e&&n(e)+n(`${a} `)>=t?(r.push(e),e=a):e=e?`${e} ${a}`:a;r.push(e)}return r.filter(Boolean).join(`
60
+ `)}function ja(t,n){return t?(t.split(`
61
+ `).length-1)*n*e.LINE_HEIGHT_RATIO:0}function Ma(e){return e.map((t,n)=>e.slice(0,n).flatMap((e,n)=>e.startIndex>=t.startIndex&&e.endIndex<=t.endIndex?[n]:[]))}function Na(e,t,n,r,i){let a=new Map(e.actors.map((e,t)=>[e.id,t])),o=(e,t,r)=>{if(e<0||t>=n.length)return;let i=0;for(let r=e+1;r<=t;r++)i+=n[r];if(i>=r)return;let a=(r-i)/(t-e);for(let r=e+1;r<=t;r++)n[r]+=a};for(let t of e.messages){if(!t.label)continue;let e=a.get(t.from),n=a.get(t.to),r=Sa(t.label,i);e===n?(o(e-1,e,r/2+xa),o(e,e+1,r/2+xa)):o(Math.min(e,n),Math.max(e,n),r+32)}for(let n of e.notes){let e=a.get(n.actorIds[0]??``),s=Math.max(r.noteWidth,Sa(n.text,i)+r.notePadX*2),c=t[e]/2+r.noteGap+s+xa;if(n.position===`right`)o(e,e+1,c);else if(n.position===`left`)o(e-1,e,c);else if(n.actorIds.length===1)o(e,e+1,s/2+xa),o(e-1,e,s/2+xa);else{let t=a.get(n.actorIds[n.actorIds.length-1]);o(Math.min(e,t),Math.max(e,t),s-50)}}}function Pa(e,t,n){let r=e.layout??{},i=t/16,a=r.width??150,o=a*i,s=e=>Sa(e,t),c=(a+(r.actorMargin??50))*i,l=e=>Sa(e,n,F.nodeLabel);return{...e,actors:e.actors.map(e=>({...e,label:e.wrap??r.wrap?Aa(e.label,n/16*a,l):e.label})),notes:e.notes.map(e=>({...e,text:e.wrap??r.wrap?Aa(e.text,o,s):e.text})),messages:e.messages.map(e=>({...e,label:e.wrap??r.wrap?Aa(e.label,c,s):e.label}))}}function Fa(t,n={}){let r=t.layout?.wrap||t.messages.some(e=>e.wrap)||t.notes.some(e=>e.wrap)||t.actors.some(e=>e.wrap)?Pa(t,P(n.fontSizes).edgeLabel,P(n.fontSizes).nodeLabel):t;if(r.actors.length===0)return{width:0,height:0,actors:[],lifelines:[],messages:[],activations:[],blocks:[],notes:[],boxes:[],footerActors:[]};let i=ba(n.sequence,r.layout),a=e=>e===`left`||e===`right`?e:void 0,o=a(r.layout?.noteAlign),s=a(r.layout?.messageAlign),c=P(n.fontSizes),l=r.actors.map(e=>{let t=Sa(e.label,c.nodeLabel,F.nodeLabel);return Math.max(t+i.actorPadX*2,i.actorMinWidth)}),u=l.map((e,t)=>t===0?0:Math.max(i.actorGap,(l[t-1]+e)/2+40+(i.actorGap-sa.actorGap)));Na(r,l,u,i,c.edgeLabel);let d=[],f=i.padding+l[0]/2;for(let e=0;e<r.actors.length;e++)f+=u[e],d.push(f);let p=new Map;for(let e=0;e<r.actors.length;e++)p.set(r.actors[e].id,e);let m=r.boxes.filter(e=>e.actorIds.length>0),h=m.some(e=>e.label!==``),g=m.length===0?0:i.boxPad+(h?da(c.edgeLabel):0),_=r.title?i.titleBand:0,v=i.paddingY+_,y=v+g,b=r.actors.map((e,t)=>({id:e.id,label:e.label,type:e.type,...e.participantType!==void 0&&{participantType:e.participantType},x:d[t],y,width:l[t],height:ma(e,i.actorHeight)+(_a(e)?0:ja(e.label,c.nodeLabel))})),x=e=>b[e].height,S=Math.max(...r.actors.map((e,t)=>e.createdAt===void 0?x(t):0),i.actorHeight),C=Math.max(...b.map(e=>e.height),i.actorHeight),w=m.map(e=>{let t=e.actorIds.map(e=>p.get(e)??0),n=Math.min(...t),r=Math.max(...t),a=d[n]-l[n]/2-i.boxPad,o=d[r]+l[r]/2+i.boxPad,s={label:e.label,x:a,y:v,width:o-a,height:0};return e.color!==void 0&&(s.color=e.color),s}),T=r.actors.map(e=>_a(e)?ya(ha(e),e.label,c.nodeLabel,F.nodeLabel):0),E=Math.max(0,...r.actors.map((e,t)=>e.createdAt===void 0?T[t]:0)),D=c.edgeLabel+12,O=y+S+Math.max(i.headerGap,E>0?E+va+D:0),A=[],j=new Map,M=new Map,N=new Map,ee=r.blocks.map(e=>{let t=r.messages.slice(e.startIndex,e.endIndex+1).flatMap(e=>[d[p.get(e.from)],d[p.get(e.to)]]),n=t.length?Math.max(...t)-Math.min(...t):d[d.length-1]-d[0],i=Math.max(n-14,60),a=e=>e&&ka(e,i,c.edgeLabel);return{label:a(e.label),dividers:e.dividers.map(e=>a(e.label))}});r.blocks.forEach((e,t)=>{let n=r.blocks.some((n,r)=>r<t&&n.startIndex===e.startIndex),a=ja(ee[t].label,c.edgeLabel),o=n?0:i.blockHeaderLabelGap;N.set(e.startIndex,(N.get(e.startIndex)??0)+a+o),j.set(e.startIndex,(j.get(e.startIndex)??0)+i.blockHeaderExtra+a+(n?i.blockNestedHeaderGap:o));for(let[n,a]of e.dividers.entries()){let e=r.blocks.some(e=>e.startIndex===a.index);M.set(a.index,i.dividerExtra+(e?0:i.dividerLabelGap)+ja(ee[t].dividers[n],c.edgeLabel))}});let te=Ma(r.blocks),ne=new Map;r.blocks.forEach((e,t)=>{let n=ne.get(e.endIndex)??[];n.push(t),ne.set(e.endIndex,n)});let I=[],L=e=>r.notes.slice(e.noteStartIndex,e.noteEndIndex),re=new Map;for(let e of r.notes){let t=re.get(e.afterIndex)??[];t.push(e),re.set(e.afterIndex,t)}let ie=[],ae=new Map,oe=(t,n)=>{let r=Math.max(i.noteWidth,Sa(t.text,c.edgeLabel)+i.notePadX*2),a=t.text.split(`
62
+ `).length,s=c.edgeLabel*(1+(a-1)*e.LINE_HEIGHT_RATIO)+i.notePadY*2,u=p.get(t.actorIds[0]??``)??0,f;if(t.position===`left`)f=d[u]-l[u]/2-r-i.noteGap;else if(t.position===`right`)f=d[u]+l[u]/2+i.noteGap;else if(t.actorIds.length>1){let e=p.get(t.actorIds[t.actorIds.length-1]??``)??u,n=d[u],i=d[e];r=Math.max(r,Math.abs(n-i)+50),f=(n+i)/2-r/2}else f=d[u]-r/2;let m={text:t.text,x:f,y:n,width:r,height:s,position:t.position,actors:t.actorIds,...o&&{align:o}};return ie.push(m),ae.set(t,m),n+s+i.noteStackGap},se=re.get(-1);if(se&&se.length>0){let e=O;for(let t of se)e=oe(t,e);O=Math.max(O,e+i.messageRowHeight/2)}let ce=new Map,le=[],ue=i.activationWidth/2;function de(e,t,n=!1){let r=n?t+i.selfMessageHeight+2:t,a=ce.get(e)??[];ce.set(e,a);let o=a.length;a.push({startY:r,depth:o})}function fe(e,t,n=!1){let r=n?t+i.selfMessageHeight:t,a=ce.get(e);if(!a||a.length===0)return;let{startY:o,depth:s}=a.pop(),c=p.get(e)??0,l=s*ue;le.push({actorId:e,x:d[c]-i.activationWidth/2+l,topY:o,bottomY:r,width:i.activationWidth,depth:s})}let pe=new Map;for(let e of r.activations){let t=pe.get(e.afterIndex)??[];t.push(e),pe.set(e.afterIndex,t)}function me(e,t,n=!1){for(let r of pe.get(e)??[])r.kind===`start`?de(r.actorId,t,n):fe(r.actorId,t,n)}me(-1,O);let he=r.mirrorActors!==!1,ge=[];for(let e=0;e<r.messages.length;e++){let t=r.messages[e],n=p.get(t.from)??0,a=p.get(t.to)??0,o=t.from===t.to&&he&&r.actors[n].destroyedAt===e,u=t.from===t.to&&!o;O+=(j.get(e)??0)+(M.get(e)??0);let f=ja(t.label,c.edgeLabel);O+=f,ge[e]=f;let m=d[n],h=d[a];o&&(m-=_a(r.actors[n])?18:l[n]/2);let g=!u&&r.actors[a].createdAt===e;if(g){let e=l[a]/2;h+=m<h?-e:e}if(!o&&he&&n!==a){let t=Math.sign(h-m),i=e=>_a(r.actors[e])?18:l[e]/2;r.actors[n].destroyedAt===e&&(m+=t*(i(n)+1)),r.actors[a].destroyedAt===e&&(h-=t*(i(a)+8))}A.push({from:t.from,to:t.to,label:t.label,lineStyle:t.lineStyle,arrowHead:t.arrowHead,x1:m,x2:h,y:O,isSelf:u,bidirectional:t.bidirectional??!1,...t.isLost&&{isLost:!0},...s&&{labelAlign:s},...u&&r.layout?.rightAngles&&{rightAngles:!0},seqNumber:t.seqNumber}),t.activate&&de(t.to,O,u),t.deactivate&&fe(t.from,O,u),me(e,O,u),O+=u?i.selfMessageHeight+i.messageRowHeight:i.messageRowHeight,g&&(O+=x(a)/2);let _=t=>{let n=A[e].y+(u?20:0)+i.blockPadBottom+12;for(let e of L(r.blocks[t])){let t=ae.get(e);n=Math.max(n,t.y+t.height+i.blockPadBottom)}for(let e of te[t])n=Math.max(n,I[e]+i.blockPadBottom);I[t]=n,O=Math.max(O,n+i.messageRowHeight/2)},v=ne.get(e)??[],y=re.get(e);if(y&&y.length>0){let t=u?i.selfMessageHeight:0,n=A[e].y+t+i.noteOffsetAfterMessage;for(let e of y){let t=r.notes.indexOf(e);for(let e of v)I[e]===void 0&&r.blocks[e].noteEndIndex<=t&&(_(e),n=Math.max(n,I[e]+i.noteOffsetAfterMessage));n=oe(e,n)}O=Math.max(O,n+i.messageRowHeight/2)}for(let e of v)I[e]===void 0&&_(e)}for(let[e,t]of ce)for(let{startY:n,depth:r}of t){let t=p.get(e)??0,a=r*ue;le.push({actorId:e,x:d[t]-i.activationWidth/2+a,topY:n,bottomY:O-i.messageRowHeight/2,width:i.activationWidth,depth:r})}le.sort((e,t)=>e.depth-t.depth);let _e=[];r.blocks.forEach((e,t)=>{let n=te[t].map(e=>_e[e]),a=(A[e.startIndex]?.y??O)-i.blockPadTop-N.get(e.startIndex)-(ge[e.startIndex]??0);for(let e of n)a=Math.min(a,e.y-i.blockHeaderExtra-i.blockNestedHeaderGap);let o=I[t]??O+i.blockPadBottom+12,s=new Set;for(let t=e.startIndex;t<=e.endIndex;t++){let e=r.messages[t];e&&(s.add(p.get(e.from)??0),s.add(p.get(e.to)??0))}if(s.size===0)for(let e=0;e<r.actors.length;e++)s.add(e);let l=Math.min(...s),u=Math.max(...s),f=wa(i),m=d[l]-f,h=d[u]+f;for(let t of r.messages.slice(e.startIndex,e.endIndex+1)){if(t.from!==t.to)continue;let e=d[p.get(t.from)],n=Sa(t.label,c.edgeLabel)/2;m=Math.min(m,e-n-i.blockPadX),h=Math.max(h,e+Math.max(45,n)+i.blockPadX)}for(let e of le){let t=p.get(e.actorId);t<l||t>u||e.topY>=o||e.bottomY<=a||(h=Math.max(h,e.x+e.width+i.blockPadX))}for(let t of L(e)){let e=ae.get(t);m=Math.min(m,e.x-i.blockPadX),h=Math.max(h,e.x+e.width+i.blockPadX)}for(let e of n)m=Math.min(m,e.x-i.blockPadX),h=Math.max(h,e.x+e.width+i.blockPadX);let g=e.dividers.map((e,a)=>{let o=ee[t].dividers[a],s=n.filter((n,i)=>r.blocks[te[t][i]].startIndex===e.index);if(s.length>0)return{y:Math.min(...s.map(e=>e.y))-i.dividerExtra,label:o};let l=A[e.index];return{y:(l?.y??O)-((e.label&&l?.label?40:28)+i.dividerLabelGap+ja(o,c.edgeLabel)+(ge[e.index]??0)),label:o}});_e.push({type:e.type,label:ee[t].label,...e.color===void 0?{}:{color:e.color},x:m,y:a,width:h-m,height:o-a,dividers:g})});let R=ie,ve=O,ye=Math.max(0,...r.actors.map((e,t)=>e.destroyedAt===void 0&&T[t]>0?T[t]+va:0)),be=ve+(he?C+ye:0)+i.paddingY+i.bottomAdj,xe=i.padding,Se=0;for(let e of b)xe=Math.min(xe,e.x-e.width/2),Se=Math.max(Se,e.x+e.width/2);for(let e of _e)xe=Math.min(xe,e.x),Se=Math.max(Se,e.x+e.width);for(let e of R)xe=Math.min(xe,e.x),Se=Math.max(Se,e.x+e.width);for(let e of w)xe=Math.min(xe,e.x),Se=Math.max(Se,e.x+e.width);for(let e of A)if(e.isSelf&&(Se=Math.max(Se,e.x1+45+8),e.label)){let t=k(e.label,c.edgeLabel,F.edgeLabel)/2+8;Se=Math.max(Se,e.x1+t),xe=Math.min(xe,e.x1-t)}let Ce=xe<i.padding?i.padding-xe:0;if(Ce>0){for(let e of b)e.x+=Ce;for(let e of A)e.x1+=Ce,e.x2+=Ce;for(let e of le)e.x+=Ce;for(let e of _e)e.x+=Ce;for(let e of R)e.x+=Ce;for(let e of w)e.x+=Ce;for(let e=0;e<d.length;e++)d[e]+=Ce}for(let e=0;e<r.actors.length;e++){let t=r.actors[e].createdAt;t!==void 0&&(b[e].y=(A[t]?.y??O)-x(e)/2)}let we=r.actors.map((e,t)=>{let n=e.destroyedAt,r={actorId:e.id,x:d[t],topY:b[t].y+(e.type===`actor`?Math.max(pa,x(t)+T[t]+va):x(t)+(T[t]>0?T[t]+va:0)),bottomY:n===void 0?ve:(A[n]?.y??O)-(he?T[t]>0?31:x(t)/2:0)};return n!==void 0&&(r.destroyed=!0),r}),Te=b.map((e,t)=>r.actors[t].destroyedAt===void 0?{...e,y:ve+(e.type===`actor`?6:0)}:{...e,y:we[t].bottomY}).filter(()=>he);for(let e of w)e.height=be-i.paddingY-i.bottomAdj+i.boxPad-e.y;let Ee=r.title?(0,e.measureMultilineText)(r.title,18,F.groupHeader).width+2*i.padding:0,De=Se+Ce+i.padding;return{width:Math.max(De,Ee,200),height:Math.max(be,100),actors:b,lifelines:we,messages:A,activations:le,blocks:_e,notes:R,boxes:w,footerActors:Te,...r.title&&{title:{text:r.title,y:i.paddingY+9}}}}function Ia(t,n,r=`Inter`,i=!1,a=N,o,s,c,l={}){let u=[];u.push(z((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,void 0,l.styleAttribute,l.description),o)),u.push((0,e.buildStyleBlock)(r,!1,l.nonce,l.bodyFont)),u.push(`<defs>`),u.push(La()),u.push(`</defs>`);for(let e of t.boxes)u.push(Za(e,a));for(let e of t.blocks.toReversed())Qa(e)&&u.push($a(e,a));for(let e of t.lifelines)u.push(Ka(e));for(let e of t.activations)u.push(qa(e));for(let e of t.blocks)Qa(e)||u.push($a(e,a));for(let e of t.footerActors)u.push(za(e,a,`actor-footer`));for(let e of t.messages)u.push(Ja(e,a));for(let e of t.notes)u.push(no(e,a));for(let e of t.actors)u.push(za(e,a));return t.title&&u.push(`<g class="title">`+(0,e.renderMultilineText)(t.title.text,t.width/2,t.title.y,18,e.f`font-size="${18}" text-anchor="middle" font-weight="${F.groupHeader}" fill="var(--_text)"`)+`</g>`),u.push(`</svg>`),u.join(`
63
+ `)}function La(){let t=re.width,n=re.height;return e.f` <marker id="seq-arrow" markerWidth="${t}" markerHeight="${n}" refX="${t}" refY="${n/2}" orient="auto-start-reverse">`+e.f`\n <polygon points="0 0, ${t} ${n/2}, 0 ${n}" fill="var(--_arrow)" />`+`
61
64
  </marker>`+e.f`\n <marker id="seq-arrow-open" markerWidth="${t}" markerHeight="${n}" refX="${t}" refY="${n/2}" orient="auto-start-reverse">`+e.f`\n <polyline points="0 0, ${t} ${n/2}, 0 ${n}" fill="none" stroke="var(--_arrow)" stroke-width="1" />`+`
62
65
  </marker>`+e.f`\n <marker id="seq-lost" markerWidth="${n*2}" markerHeight="${n*2}" refX="${n}" refY="${n}" orient="auto">`+e.f`\n <path d="M${n/2} ${n/2} L${n*1.5} ${n*1.5} M${n*1.5} ${n/2} L${n/2} ${n*1.5}" fill="none" stroke="var(--_arrow)" stroke-width="1" />`+`
63
- </marker>`}var Ea={boundary:(e,t)=>`\n <circle cx="15" cy="12" r="8" ${e} />\n <path d="M1 6V18M1 12H7" ${t} />`,control:(e,t)=>`\n <circle cx="12" cy="13" r="9" ${e} />\n <path d="M13 1L10 4L13 7" ${t} />`,entity:(e,t)=>`\n <circle cx="12" cy="11" r="9" ${e} />\n <path d="M3 22H21" ${t} />`,database:(e,t)=>`\n <path d="M2 5A10 3.5 0 0 1 22 5V19A10 3.5 0 0 1 2 19Z" ${e} />\n <path d="M2 5A10 3.5 0 0 0 22 5" ${t} />`};function Da(t,n,r=`actor`){let{id:i,x:a,y:o,width:s,height:c,label:l,type:u,participantType:d}=t,f=[],p=e.f`font-size="${n.nodeLabel}" text-anchor="middle" font-weight="${P.nodeLabel}" fill="var(--_text)"`;if(f.push(e.f`<g class="${r}" data-id="${(0,e.escapeAttr)(i)}" data-label="${(0,e.escapeAttr)(l)}" data-type="${u}">`),u===`actor`){let t=44/65,r=o,i=e=>a+e*t,s=e=>r+e*t,u=e.f`stroke="var(--_line)" stroke-width="2"`;f.push(e.f` <circle cx="${a}" cy="${s(15)}" r="${15*t}" fill="var(--_node-fill)" ${u} />`+e.f`\n <path d="M${a} ${s(30)}V${s(50)}M${i(-18)} ${s(38)}H${i(18)}M${i(-18)} ${s(65)}L${a} ${s(50)}L${i(16)} ${s(65)}" fill="none" ${u} />`),f.push(` `+(0,e.renderMultilineText)(l,a,o+c+15,n.nodeLabel,p))}else if(aa(t)){let t=c/24*.9,r=I.outerBox/t,i=e.f`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${r}"`,s=e.f`fill="none" stroke="var(--_node-stroke)" stroke-width="${r}"`,u=Ea[d](i,s);f.push(e.f` <g transform="translate(${a-12*t},${o+(c-24*t)/2}) scale(${t})">${u}\n </g>`),f.push(` `+(0,e.renderMultilineText)(l,a,o+c+14,n.nodeLabel,p))}else{let t=a-s/2,r=e.f`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${I.outerBox}"`,i=a,u=o+c/2;if(d===`queue`){let n=c/2,i=t+8,a=t+s-8;f.push(e.f` <path d="M${i},${o}H${a}A${8},${n} 0 0 1 ${a},${o+c}H${i}A${8},${n} 0 0 1 ${i},${o}Z" ${r} />`,e.f` <path d="M${a},${o}A${8},${n} 0 0 0 ${a},${o+c}" fill="none" stroke="var(--_node-stroke)" stroke-width="${I.outerBox}" />`)}else d===`collections`?(f.push(e.f` <rect x="${t+4}" y="${o}" width="${s-4}" height="${c-4}" rx="4" ry="4" ${r} />`,e.f` <rect x="${t}" y="${o+4}" width="${s-4}" height="${c-4}" rx="4" ry="4" ${r} />`),i=a-2,u=o+2+(c-4)/2):f.push(e.f` <rect x="${t}" y="${o}" width="${s}" height="${c}" rx="4" ry="4" ${r} />`);f.push(` `+(0,e.renderMultilineText)(l,i,u,n.nodeLabel,p))}return f.push(`</g>`),f.join(`
64
- `)}var Oa=10;function ka(e,t){return e.y-Oa-va(e.label,t.edgeLabel)/2}function Aa(e,t){return e.y+9+va(e.label,t.edgeLabel)/2}function ja(e,t){return e.y+14+va(e.label,t.edgeLabel)/2}var Ma=`2 2`,Na=`3 3`;function Pa(t){return e.f`<line class="lifeline" data-actor="${(0,e.escapeAttr)(t.actorId)}" `+e.f`x1="${t.x}" y1="${t.topY}" x2="${t.x}" y2="${t.bottomY}" `+`stroke="var(--_line)" stroke-width="${da}" />`}function Fa(t){return e.f`<rect class="activation" data-actor="${(0,e.escapeAttr)(t.actorId)}" `+e.f`x="${t.x}" y="${t.topY}" width="${t.width}" height="${t.bottomY-t.topY}" `+e.f`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${I.innerBox}" />`}function Ia(t,n){let r=[],i=t.lineStyle===`dashed`?` stroke-dasharray="6 4"`:``,a=t.isLost?`seq-lost`:t.arrowHead===`filled`?`seq-arrow`:`seq-arrow-open`,o=t.bidirectional?e.f` marker-start="url(#${a})"`:``;if(r.push(e.f`<g class="message" data-from="${(0,e.escapeAttr)(t.from)}" data-to="${(0,e.escapeAttr)(t.to)}" `+e.f`data-label="${(0,e.escapeAttr)(t.label)}" data-line-style="${t.lineStyle}" `+e.f`data-arrow-head="${t.arrowHead}" data-self="${t.isSelf}" data-bidirectional="${t.bidirectional}"${t.isLost?` data-lost="true"`:``}>`),t.isSelf){let n=t.rightAngles?e.f`M ${t.x1},${t.y-10} H ${t.x1+75} V ${t.y+15} H ${t.x2}`:e.f`M ${t.x1},${t.y} C ${t.x1+60},${t.y-10} ${t.x1+60},${t.y+20+10} ${t.x2},${t.y+20}`;r.push(e.f` <path d="${n}" `+e.f`fill="none" stroke="var(--_line)" stroke-width="${I.connector}"${i} marker-end="url(#${a})"${o} />`)}else r.push(e.f` <line x1="${t.x1}" y1="${t.y}" x2="${t.x2}" y2="${t.y}" `+e.f`stroke="var(--_line)" stroke-width="${I.connector}"${i} marker-end="url(#${a})"${o} />`);return r.push(` `+(0,e.renderMultilineText)(t.label,t.labelAlign===`left`?Math.min(t.x1,t.x2)+Ua:t.labelAlign===`right`?Math.max(t.x1,t.x2)-Ua:(t.x1+t.x2)/2,ka(t,n),n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="${t.labelAlign===`left`?`start`:t.labelAlign===`right`?`end`:`middle`}" font-weight="${P.edgeLabel}" fill="var(--_text-muted)"`)),t.seqNumber!==void 0&&r.push(` `+La(t,n)),r.push(`</g>`),r.join(`
65
- `)}function La(t,n){let r=Math.max(n.edgeLabel-2,8),i=t.bidirectional?t.x1+Math.sign(t.x2-t.x1)*(8+re.width):t.x1;return`<g class="seq-number">`+e.f`<circle cx="${i}" cy="${t.y}" r="${8}" fill="var(--bg)" stroke="var(--_arrow)" stroke-width="${I.innerBox}" />`+(0,e.renderMultilineText)(String(t.seqNumber),i,t.y,r,e.f`font-size="${r}" text-anchor="middle" font-weight="${P.edgeLabel}" fill="var(--_arrow)"`)+`</g>`}var Ra=35;function za(t,n){let r=t.label?e.f` data-label="${(0,e.escapeAttr)(t.label)}"`:``,i=t.color===void 0?``:e.f` data-color="${(0,e.escapeAttr)(t.color)}"`,a=t.color===void 0?`none`:e.f`color-mix(in srgb, ${(0,e.escapeAttr)(t.color)} ${Ra}%, var(--bg))`,o=[e.f`<g class="participant-box"${r}${i}>`,e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" rx="4" ry="4" `+e.f`fill="${a}" stroke="var(--_node-stroke)" stroke-width="${I.innerBox}" />`];return t.label&&o.push(` `+(0,e.renderMultilineText)(t.label,t.x+t.width/2,t.y+$i(n.edgeLabel)/2,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${P.groupHeader}" fill="var(--_text-sec)"`)),o.push(`</g>`),o.join(`
66
- `)}function Ba(e){return e.type===`rect`&&e.color!==void 0}function Va(t,n){let r=[];if(Ba(t))return[e.f`<g class="block" data-type="rect" data-color="${(0,e.escapeAttr)(t.color)}">`,e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" `+e.f`fill="${(0,e.escapeAttr)(t.color)}" />`,`</g>`].join(`
67
- `);let i=t.label?e.f` data-label="${(0,e.escapeAttr)(t.label)}"`:``;r.push(e.f`<g class="block" data-type="${(0,e.escapeAttr)(t.type)}"${i}>`),r.push(e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" `+e.f`rx="0" ry="0" fill="none" stroke="var(--_node-stroke)" stroke-width="${2}" stroke-dasharray="${Ma}" />`);let a=ga(t,n.edgeLabel),{x:o,y:s}=t,c=ha(o,s,a).map(([t,n])=>e.f`${t},${n}`).join(` `);r.push(e.f` <polygon points="${c}" `+e.f`fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${I.outerBox}" />`),r.push(` `+(0,e.renderMultilineText)(t.type,t.x+6,t.y+9,n.edgeLabel,e.f`font-size="${n.edgeLabel}" font-weight="${P.groupHeader}" fill="var(--_text-sec)"`)),t.label&&r.push(` `+(0,e.renderMultilineText)(e.f`[${t.label}]`,t.x+(a+t.width)/2,Aa(t,n),n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${P.edgeLabel}" fill="var(--_text-sec)"`));for(let i of t.dividers)r.push(e.f` <line x1="${t.x}" y1="${i.y}" x2="${t.x+t.width}" y2="${i.y}" `+`stroke="var(--_line)" stroke-width="2" stroke-dasharray="${Na}" />`),i.label&&r.push(` `+(0,e.renderMultilineText)(e.f`[${i.label}]`,t.x+t.width/2,ja(i,n),n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${P.edgeLabel}" fill="var(--_text-muted)"`));return r.push(`</g>`),r.join(`
68
- `)}var Ha=10,Ua=10;function Wa(t,n){let{x:r,y:i,width:a,height:o}=t,s=t.actors&&t.actors.length>0?e.f` data-actors="${t.actors.map(e.escapeAttr).join(`,`)}"`:``,c=t.position?e.f` data-position="${(0,e.escapeAttr)(t.position)}"`:``;return e.f`<g class="note"${c}${s}>`+e.f`\n <rect x="${r}" y="${i}" width="${a}" height="${o}" `+e.f`fill="var(--bg)" stroke="var(--_node-stroke)" stroke-width="${I.outerBox}" />`+e.f`\n ${(0,e.renderMultilineText)(t.text,t.align===`left`?r+Ha:t.align===`right`?r+a-Ha:r+a/2,i+o/2,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="${t.align===`left`?`start`:t.align===`right`?`end`:`middle`}" font-weight="${P.edgeLabel}" fill="var(--_text-muted)"`)}`+`
69
- </g>`}var V={plotWidth:600,plotHeight:340,padding:22,titleFontSize:18,titleFontWeight:600,titleHeight:42,axisLabelFontSize:14,axisLabelHeight:16,axisLabelFontWeight:400,axisTitleFontSize:15,axisTitleFontWeight:500,xLabelHeight:38,yLabelWidth:58,yLabelGap:18,axisTitlePad:30,tickLength:4},Ga=.8;function Ka(e){return e.min>=0||e.min===e.max}function qa(e,t,n){let r=Math.min(n,.2*e),i=(e-2*r)/t,a=.7*i>2*r?Math.floor(.35*i):r;return{p0:r,pad:a,bar:.95*Math.min(2*a,(e-2*a)/t)}}function Ja(t,n,r){let i=(0,e.collapseFlatRange)(t.yAxis.range,t.series.flatMap(e=>e.data)),a=(0,e.niceTickValues)(i.min,i.max),o=ao(a),s=Math.min(r(o)/2,.2*n),c=i.max-i.min;return{range:i,ticks:a,labels:o,pad:s,frac:e=>c>0?(e-i.min)/c:.5}}function Ya(t,n,r){let i=t.xAxis.categories?void 0:t.xAxis.range,a=e=>r?V.axisLabelFontSize/2:Ga*Math.max(...e.map(e=>k(e,V.axisLabelFontSize,V.axisLabelFontWeight)))/2,o=t.series.some(e=>e.type===`bar`);if(!i){let e=$a(t),r=eo(t,e),{p0:i,pad:s,bar:c}=qa(n,e,a(r)),l=o?s:i,u=t=>e<2?n/2:l+t*(n-2*l)/(e-1);return{at:(e,t)=>u(t),ticks:r.map((e,t)=>({label:e,at:u(t)})),bar:c}}let s=(0,e.niceTickValues)(i.min,i.max),c=ao(s),{p0:l,pad:u,bar:d}=qa(n,s.length,a(c)),f=o?u:l,p=i.max-i.min,m=e=>{let t=p>0?(e-i.min)/p:.5;return f+(r?1-t:t)*(n-2*f)};return{at:(e,t)=>m(e<2?i.min:i.min+t*p/(e-1)),ticks:s.map((e,t)=>({label:c[t],at:m(e)})),bar:d}}function Xa(e,t={}){let n=e.config?.width??700,r=e.config?.height??500;return e.horizontal?Qa(e,n,r):Za(e,n,r)}function Za(e,t,n){let r=!!e.title,i=!!e.xAxis.title,a=!!e.yAxis.title;if(!e.yAxis.range)throw Error(`XY chart: y-axis range was not set by the parser`);let o=Ja(e,0,()=>V.axisLabelHeight).labels,s=e.config?.xAxis?.showLabel!==!1,c=e.config?.yAxis?.showLabel!==!1,l=Math.max(...o.map(e=>k(e,V.axisLabelFontSize,V.axisLabelFontWeight)),V.yLabelWidth),u=V.padding+(r?V.titleHeight:0),d=V.padding+(s?V.xLabelHeight:0)+(i?V.axisTitlePad:0),f=V.padding+(c?l+V.yLabelGap:0)+(a?V.axisTitlePad:0),p=V.padding,m=Math.max(50,t-f-p),h=Math.max(50,n-u-d),g=Ja(e,h,()=>V.axisLabelHeight),_=g.ticks,v=g.labels,y=m,b=h,x=f+y+p,S=u+b+d,C={x:f,y:u,width:y,height:b},w=$a(e),T=Ya(e,y,!1),E=(e,t)=>f+T.at(e,t),D=e=>u+b-g.pad-g.frac(e)*(b-2*g.pad),O=u+b,A=T.ticks.map(e=>({label:e.label,x:f+e.at,y:O,tx:f+e.at,ty:O+V.tickLength,labelX:f+e.at,labelY:O+18,textAnchor:`middle`})),j=_.map((e,t)=>({label:v[t],x:f,y:D(e),tx:f-V.tickLength,ty:D(e),labelX:f-V.yLabelGap,labelY:D(e),textAnchor:`end`})),ee=_.map(e=>({x1:f,y1:D(e),x2:f+y,y2:D(e)})),M=eo(e,w),N=e.series.map((e,t)=>t),P=ro(e,E,D,T.bar,Ka(g.range)?u+b:D(0),M,N),te=io(e,E,D,M,N),ne=so(e,N),F={x1:f,y1:u+b,x2:f+y,y2:u+b},I={x1:f,y1:u,x2:f,y2:u+b},L={ticks:A,line:F,...e.xAxis.title?{title:{text:e.xAxis.title,x:f+y/2,y:S-V.padding}}:{}},re={ticks:j,line:I,...e.yAxis.title?{title:{text:e.yAxis.title,x:V.padding+4,y:u+b/2,rotate:-90}}:{}};return{width:x,height:S,title:e.title?{text:e.title,x:x/2,y:V.padding+V.titleFontSize}:void 0,xAxis:L,yAxis:re,plotArea:C,bars:P,lines:te,gridLines:ee,legend:ne,...e.config&&{config:e.config}}}function Qa(e,t,n){let r=!!e.title,i=!!e.xAxis.title,a=!!e.yAxis.title;if(!e.yAxis.range)throw Error(`XY chart: y-axis range was not set by the parser`);let o=e=>Ga*Math.max(...e.map(e=>k(e,V.axisLabelFontSize,V.axisLabelFontWeight))),s=Ja(e,0,o).labels,c=e.config?.xAxis?.showLabel!==!1,l=e.config?.yAxis?.showLabel!==!1,u=eo(e,$a(e)),d=Math.max(...Ya(e,0,!0).ticks.map(({label:e})=>k(e,V.axisLabelFontSize,V.axisLabelFontWeight)),40),f=V.padding+(r?V.titleHeight:0)+(a?V.axisTitlePad:0)+(l?V.xLabelHeight:0),p=V.padding,m=V.padding+(c?d+V.yLabelGap:0)+(i?V.axisTitlePad:0),h=Math.max(V.padding,k(s[s.length-1],V.axisLabelFontSize,V.axisLabelFontWeight)/2+4),g=Math.max(50,t-m-h),_=Math.max(50,n-f-p),v=Ja(e,g,o),y=v.ticks,b=Ya(e,_,!0),x=g,S=_,C=m+x+h,w=f+S+p,T={x:m,y:f,width:x,height:S},E=e=>m+v.pad+v.frac(e)*(x-2*v.pad),D=(e,t)=>f+b.at(e,t),O=y.map((e,t)=>({label:s[t],x:E(e),y:f,tx:E(e),ty:f-V.tickLength,labelX:E(e),labelY:f-18,textAnchor:`middle`})),A=b.ticks.map(({label:e,at:t})=>({label:e,x:m,y:f+t,tx:m-V.tickLength,ty:f+t,labelX:m-V.yLabelGap,labelY:f+t,textAnchor:`end`})),j=y.map(e=>({x1:E(e),y1:f,x2:E(e),y2:f+S})),ee=e.series.map((e,t)=>t),M=e.series.filter(e=>e.type===`bar`).length,N=[];if(M>0){let t=b.bar,n=t,r=0,i=0;for(let a of e.series){if(a.type!==`bar`){i++;continue}for(let e=0;e<a.data.length;e++){let o=D(a.data.length,e)-n/2,s=E(Math.max(a.data[e],v.range.min)),c=Ka(v.range)?m:E(0);N.push({x:Math.min(c,s),y:o,width:Math.abs(s-c),height:t,value:a.data[e],label:u[e],seriesIndex:r,colorIndex:ee[i]})}r++,i++}}let P=[],te=0,ne=0;for(let t of e.series){if(t.type!==`line`){ne++;continue}let e=t.data.map((e,n)=>({x:E(e),y:D(t.data.length,n),value:e,label:u[n]}));P.push({points:e,seriesIndex:te,colorIndex:ee[ne]}),te++,ne++}let F={x1:m,y1:f,x2:m+x,y2:f},I={x1:m,y1:f,x2:m,y2:f+S},L={ticks:O,line:F,...e.yAxis.title?{title:{text:e.yAxis.title,x:m+x/2,y:V.padding+(r?V.titleHeight:0)+V.axisTitlePad/2}}:{}},re={ticks:A,line:I,...e.xAxis.title?{title:{text:e.xAxis.title,x:V.padding+4,y:f+S/2,rotate:-90}}:{}};return{width:C,height:w,horizontal:!0,title:e.title?{text:e.title,x:C/2,y:V.padding+V.titleFontSize}:void 0,xAxis:L,yAxis:re,plotArea:T,bars:N,lines:P,gridLines:j,legend:so(e,ee),...e.config&&{config:e.config}}}function $a(e){if(e.xAxis.categories)return e.xAxis.categories.length;for(let t of e.series)if(t.data.length>0)return t.data.length;return 1}function eo(e,t){if(e.xAxis.categories)return e.xAxis.categories;if(e.xAxis.range){let{min:n,max:r}=e.xAxis.range,i=t>1?(r-n)/(t-1):0;return Array.from({length:t},(e,t)=>oo(n+i*t))}return Array.from({length:t},(e,t)=>String(t+1))}var to=8;function no(e,t){let n=e.map(e=>k(e,V.axisLabelFontSize,V.axisLabelFontWeight));for(let r=1;r<e.length;r++){let i=!0;for(let a=0;a+r<e.length;a+=r)if(r*t-(n[a]+n[a+r])/2<to){i=!1;break}if(i)return r}return Math.max(1,e.length)}function ro(e,t,n,r,i,a,o){if(e.series.filter(e=>e.type===`bar`).length===0)return[];let s=r,c=[],l=0,u=0;for(let d of e.series){if(d.type!==`bar`){u++;continue}for(let e=0;e<d.data.length;e++){let f=t(d.data.length,e)-s/2,p=n(d.data[e]);c.push({x:f,y:Math.min(p,i),width:r,height:Math.abs(i-p),value:d.data[e],label:a[e],seriesIndex:l,colorIndex:o[u]})}l++,u++}return c}function io(e,t,n,r,i){let a=[],o=0,s=0;for(let c of e.series){if(c.type!==`line`){s++;continue}let e=c.data.map((e,i)=>({x:t(c.data.length,i),y:n(e),value:e,label:r[i]}));a.push({points:e,seriesIndex:o,colorIndex:i[s]}),o++,s++}return a}function ao(e){let t=e.length>1?Math.abs(e[1]-e[0]):0,n=t>0&&t<1?Math.ceil(-Math.log10(t)-1e-9):0;return e.map(e=>String(Number.isInteger(e)&&n===0?e:Number(e.toFixed(n))))}function oo(e){return Number.isInteger(e)?String(e):e.toFixed(+(Math.abs(e)<10))}function so(e,t){let n=0,r=0;return e.series.map((e,i)=>{let a=e.type===`bar`?n++:r++;return{label:`${e.type===`bar`?`Bar`:`Line`} ${a+1}`,x:0,y:0,type:e.type,seriesIndex:a,colorIndex:t[i]}})}var co={titleSize:18,titleWeight:600,axisTitleSize:15,axisTitleWeight:500,labelSize:14,labelWeight:400,dotRadius:5,lineWidth:2.5},H={fontSize:15,fontWeight:500,height:32,padX:14,offsetY:12,rx:8,minY:4,pointerSize:6};function lo(t,n,r=`Inter`,i=!1,a=!1,o,s,c,l={}){let u=[],d=Math.max(0,...t.bars.map(e=>e.colorIndex),...t.lines.map(e=>e.colorIndex)),{style:f,defs:p,cls:m}=uo(t,a,n.accent,n.bg,l.nonce),h=R((0,e.withRootClass)((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,void 0,l.styleAttribute,l.description).replace(`<svg `,`<svg data-xychart-colors="${d}" `),m),o);u.push(h),u.push((0,e.buildStyleBlock)(r,!1,l.nonce,l.bodyFont)),u.push(f),p&&u.push(p);let g=t.config,_=g?.xAxis,v=g?.yAxis,[y,b]=t.horizontal?[_,v]:[v,_],x=y?.showAxisLine!==!1,S=b?.showAxisLine!==!1,{plotArea:C}=t,w=C.y+C.height,T=C.x+C.width,E=t.horizontal?C.y:w,D=x&&S?t.horizontal?`M${U(C.x)},${U(w)} V${U(C.y)} H${U(T)}`:`M${U(C.x)},${U(C.y)} V${U(w)} H${U(T)}`:x?`M${U(C.x)},${U(C.y)} V${U(w)}`:S?`M${U(C.x)},${U(E)} H${U(T)}`:``;D&&u.push(`<path d="${D}" class="xychart-axis"/>`);let O=t.horizontal?v:_,k=t.horizontal?_:v;for(let e of[...O?.showTick===!1?[]:t.xAxis.ticks,...k?.showTick===!1?[]:t.yAxis.ticks])u.push(`<path d="M${U(e.x)},${U(e.y)} L${U(e.tx)},${U(e.ty)}" class="xychart-axis"/>`);let A=[];for(let e of t.bars){let n=` data-value="${e.value}"${e.label?` data-label="${_o(e.label)}"`:``}`,r=Math.max(e.x,C.x),i=Math.min(e.x+e.width,C.x+C.width),o=Math.max(e.y,C.y),s=Math.min(e.y+e.height,C.y+C.height);if(i<=r||s<=o)continue;let c=`M${U(r)},${U(o)} H${U(i)} V${U(s)} H${U(r)} Z`;if(u.push(`<path d="${c}" class="xychart-bar xychart-color-${e.colorIndex}"${n}/>`),a){let n=go(e.value),a=e.label?`${e.label}: ${n}`:n,c=ho((r+i)/2,o,n);A.push({extent:t.horizontal?i-r:s-o,html:`<g class="xychart-bar-group"><rect x="${U(r)}" y="${U(o)}" width="${U(i-r)}" height="${U(s-o)}" fill="transparent"/><title>${_o(a)}</title>`+c+`</g>`})}}A.sort((e,t)=>t.extent-e.extent);for(let e of t.lines){if(e.points.length===0)continue;let t=fo(e.points);u.push(`<path d="${t}" class="xychart-line-shadow xychart-color-${e.colorIndex}" transform="translate(0,2)"/>`),u.push(`<path d="${t}" class="xychart-line xychart-color-${e.colorIndex}"/>`)}let j=Math.max(...t.lines.map(e=>e.points.length),0),ee=j>0&&j<=12,M=[];if(a){let e=new Map;for(let n of t.legend)n.type===`line`&&e.set(n.seriesIndex,n.label);let n=new Map;for(let e of t.lines)for(let t of e.points){let r=U(t.x),i=n.get(r)??[];n.set(r,i),i.push({x:t.x,y:t.y,value:t.value,label:t.label,seriesIndex:e.seriesIndex,colorIndex:e.colorIndex})}for(let t of n.values()){let n=t[0].x,r=t[0].label||``;if(a&&t.length>1){let i=Math.min(...t.map(e=>e.y)),a=Math.max(...t.map(e=>e.y)),o=co.dotRadius*3,s=`<rect x="${U(n-o)}" y="${U(i-o)}" width="${U(o*2)}" height="${U(a-i+o*2)}" fill="transparent" class="xychart-hit"/>`,c=t.map(t=>({text:go(t.value),legendLabel:e.get(t.seriesIndex)||`Line ${t.seriesIndex+1}`})),l=mo(n,i-co.dotRadius,r,c),u=c.map(e=>e.text),d=r?`${r}: ${u.join(` · `)}`:u.join(` · `),f=`<g class="xychart-dot-group">${s}`;for(let e of t){let t=` data-value="${e.value}"${e.label?` data-label="${_o(e.label)}"`:``}`;f+=`<circle cx="${U(e.x)}" cy="${U(e.y)}" r="${co.dotRadius}" class="xychart-dot xychart-color-${e.colorIndex}"${t}/>`}f+=`<title>${_o(d)}</title>${l}</g>`,M.push(f)}else if(a){let e=t[0],r=` data-value="${e.value}"${e.label?` data-label="${_o(e.label)}"`:``}`,i=go(e.value),a=e.label?`${e.label}: ${i}`:i,o=ho(n,e.y-co.dotRadius,i),s=ee?`<circle cx="${U(n)}" cy="${U(e.y)}" r="${co.dotRadius*3}" fill="transparent" class="xychart-hit"/>`:``;M.push(`<g class="xychart-dot-group">${s}<circle cx="${U(e.x)}" cy="${U(e.y)}" r="${co.dotRadius}" class="xychart-dot xychart-color-${e.colorIndex}"${r}/><title>${_o(a)}</title>${o}</g>`)}}}for(let e of O?.showLabel===!1?[]:t.xAxis.ticks)e.label!==``&&u.push(`<text x="${e.labelX}" y="${e.labelY}" text-anchor="${e.textAnchor}" font-size="${co.labelSize}" font-weight="${co.labelWeight}" dy="${L}" class="xychart-label">${_o(e.label)}</text>`);for(let e of k?.showLabel===!1?[]:t.yAxis.ticks)u.push(`<text x="${e.labelX}" y="${e.labelY}" text-anchor="${e.textAnchor}" font-size="${co.labelSize}" font-weight="${co.labelWeight}" dy="${L}" class="xychart-label">${_o(e.label)}</text>`);if(t.xAxis.title){let e=t.xAxis.title,n=e.rotate?` transform="rotate(${e.rotate},${e.x},${e.y})"`:``;u.push(`<text x="${e.x}" y="${e.y}" text-anchor="middle"${n} font-size="${co.axisTitleSize}" font-weight="${co.axisTitleWeight}" dy="${L}" class="xychart-axis-title">${_o(e.text)}</text>`)}if(t.yAxis.title){let e=t.yAxis.title,n=e.rotate?` transform="rotate(${e.rotate},${e.x},${e.y})"`:``;u.push(`<text x="${e.x}" y="${e.y}" text-anchor="middle"${n} font-size="${co.axisTitleSize}" font-weight="${co.axisTitleWeight}" dy="${L}" class="xychart-axis-title">${_o(e.text)}</text>`)}t.title&&u.push(`<text x="${t.title.x}" y="${t.title.y}" text-anchor="middle" font-size="${co.titleSize}" font-weight="${co.titleWeight}" dy="${L}" class="xychart-title">${_o(t.title.text)}</text>`);for(let e of A)u.push(e.html);for(let e of M)u.push(e);return u.push(`</svg>`),u.join(`
70
- `)}function uo(n,r,i,a,o){let s=i??t.CHART_ACCENT_FALLBACK,c=new Set;for(let e of n.bars)c.add(e.colorIndex);for(let e of n.lines)c.add(e.colorIndex);let l=[];for(let e of[...c].sort((e,t)=>e-t)){let n=e===0?`var(--accent, ${t.CHART_ACCENT_FALLBACK})`:(0,t.getSeriesColor)(e,s,a);l.push(` --xychart-color-${e}: ${n};`),l.push(` --xychart-bar-fill-${e}: color-mix(in srgb, var(--bg) 75%, var(--xychart-color-${e}) 25%);`)}let u=[];for(let e of[...c].sort((e,t)=>e-t)){let t=`var(--xychart-color-${e})`;u.push(` .xychart-bar.xychart-color-${e} { stroke: none; fill: var(--xychart-bar-fill-${e}); }`),u.push(` path.xychart-color-${e}, line.xychart-color-${e} { stroke: ${t}; }`),u.push(` circle.xychart-color-${e} { fill: ${t}; }`)}let d=r?`
66
+ </marker>`}var Ra={boundary:(e,t)=>`\n <circle cx="15" cy="12" r="8" ${e} />\n <path d="M1 6V18M1 12H7" ${t} />`,control:(e,t)=>`\n <circle cx="12" cy="13" r="9" ${e} />\n <path d="M13 1L10 4L13 7" ${t} />`,entity:(e,t)=>`\n <circle cx="12" cy="11" r="9" ${e} />\n <path d="M3 22H21" ${t} />`,database:(e,t)=>`\n <path d="M2 5A10 3.5 0 0 1 22 5V19A10 3.5 0 0 1 2 19Z" ${e} />\n <path d="M2 5A10 3.5 0 0 0 22 5" ${t} />`};function za(t,n,r=`actor`){let{id:i,x:a,y:o,width:s,height:c,label:l,type:u,participantType:d}=t,f=[],p=e.f`font-size="${n.nodeLabel}" text-anchor="middle" font-weight="${F.nodeLabel}" fill="var(--_text)"`;if(f.push(e.f`<g class="${r}" data-id="${(0,e.escapeAttr)(i)}" data-label="${(0,e.escapeAttr)(l)}" data-type="${u}">`),u===`actor`){let t=44/65,r=o,i=e=>a+e*t,s=e=>r+e*t,u=e.f`stroke="var(--_line)" stroke-width="2"`;f.push(e.f` <circle cx="${a}" cy="${s(15)}" r="${15*t}" fill="var(--_node-fill)" ${u} />`+e.f`\n <path d="M${a} ${s(30)}V${s(50)}M${i(-18)} ${s(38)}H${i(18)}M${i(-18)} ${s(65)}L${a} ${s(50)}L${i(16)} ${s(65)}" fill="none" ${u} />`),f.push(` `+(0,e.renderMultilineText)(l,a,o+c+15,n.nodeLabel,p))}else if(_a(t)){let t=c/24*.9,r=I.outerBox/t,i=e.f`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${r}"`,s=e.f`fill="none" stroke="var(--_node-stroke)" stroke-width="${r}"`,u=Ra[d](i,s);f.push(e.f` <g transform="translate(${a-12*t},${o+(c-24*t)/2}) scale(${t})">${u}\n </g>`),f.push(` `+(0,e.renderMultilineText)(l,a,o+c+14,n.nodeLabel,p))}else{let t=a-s/2,r=e.f`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${I.outerBox}"`,i=a,u=o+c/2;if(d===`queue`){let n=c/2,i=t+8,a=t+s-8;f.push(e.f` <path d="M${i},${o}H${a}A${8},${n} 0 0 1 ${a},${o+c}H${i}A${8},${n} 0 0 1 ${i},${o}Z" ${r} />`,e.f` <path d="M${a},${o}A${8},${n} 0 0 0 ${a},${o+c}" fill="none" stroke="var(--_node-stroke)" stroke-width="${I.outerBox}" />`)}else d===`collections`?(f.push(e.f` <rect x="${t+4}" y="${o}" width="${s-4}" height="${c-4}" rx="4" ry="4" ${r} />`,e.f` <rect x="${t}" y="${o+4}" width="${s-4}" height="${c-4}" rx="4" ry="4" ${r} />`),i=a-2,u=o+2+(c-4)/2):f.push(e.f` <rect x="${t}" y="${o}" width="${s}" height="${c}" rx="4" ry="4" ${r} />`);f.push(` `+(0,e.renderMultilineText)(l,i,u,n.nodeLabel,p))}return f.push(`</g>`),f.join(`
67
+ `)}var Ba=10;function Va(e,t){return e.y-Ba-ja(e.label,t.edgeLabel)/2}function Ha(e,t){return e.y+9+ja(e.label,t.edgeLabel)/2}function Ua(e,t){return e.y+14+ja(e.label,t.edgeLabel)/2}var Wa=`2 2`,Ga=`3 3`;function Ka(t){return e.f`<line class="lifeline" data-actor="${(0,e.escapeAttr)(t.actorId)}" `+e.f`x1="${t.x}" y1="${t.topY}" x2="${t.x}" y2="${t.bottomY}" `+`stroke="var(--_line)" stroke-width="${Ca}" />`}function qa(t){return e.f`<rect class="activation" data-actor="${(0,e.escapeAttr)(t.actorId)}" `+e.f`x="${t.x}" y="${t.topY}" width="${t.width}" height="${t.bottomY-t.topY}" `+e.f`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${I.innerBox}" />`}function Ja(t,n){let r=[],i=t.lineStyle===`dashed`?` stroke-dasharray="6 4"`:``,a=t.isLost?`seq-lost`:t.arrowHead===`filled`?`seq-arrow`:`seq-arrow-open`,o=t.bidirectional?e.f` marker-start="url(#${a})"`:``;if(r.push(e.f`<g class="message" data-from="${(0,e.escapeAttr)(t.from)}" data-to="${(0,e.escapeAttr)(t.to)}" `+e.f`data-label="${(0,e.escapeAttr)(t.label)}" data-line-style="${t.lineStyle}" `+e.f`data-arrow-head="${t.arrowHead}" data-self="${t.isSelf}" data-bidirectional="${t.bidirectional}"${t.isLost?` data-lost="true"`:``}>`),t.isSelf){let n=t.rightAngles?e.f`M ${t.x1},${t.y-10} H ${t.x1+75} V ${t.y+15} H ${t.x2}`:e.f`M ${t.x1},${t.y} C ${t.x1+60},${t.y-10} ${t.x1+60},${t.y+20+10} ${t.x2},${t.y+20}`;r.push(e.f` <path d="${n}" `+e.f`fill="none" stroke="var(--_line)" stroke-width="${I.connector}"${i} marker-end="url(#${a})"${o} />`)}else r.push(e.f` <line x1="${t.x1}" y1="${t.y}" x2="${t.x2}" y2="${t.y}" `+e.f`stroke="var(--_line)" stroke-width="${I.connector}"${i} marker-end="url(#${a})"${o} />`);return r.push(` `+(0,e.renderMultilineText)(t.label,t.labelAlign===`left`?Math.min(t.x1,t.x2)+to:t.labelAlign===`right`?Math.max(t.x1,t.x2)-to:(t.x1+t.x2)/2,Va(t,n),n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="${t.labelAlign===`left`?`start`:t.labelAlign===`right`?`end`:`middle`}" font-weight="${F.edgeLabel}" fill="var(--_text-muted)"`)),t.seqNumber!==void 0&&r.push(` `+Ya(t,n)),r.push(`</g>`),r.join(`
68
+ `)}function Ya(t,n){let r=Math.max(n.edgeLabel-2,8),i=t.bidirectional?t.x1+Math.sign(t.x2-t.x1)*(8+re.width):t.x1;return`<g class="seq-number">`+e.f`<circle cx="${i}" cy="${t.y}" r="${8}" fill="var(--bg)" stroke="var(--_arrow)" stroke-width="${I.innerBox}" />`+(0,e.renderMultilineText)(String(t.seqNumber),i,t.y,r,e.f`font-size="${r}" text-anchor="middle" font-weight="${F.edgeLabel}" fill="var(--_arrow)"`)+`</g>`}var Xa=35;function Za(t,n){let r=t.label?e.f` data-label="${(0,e.escapeAttr)(t.label)}"`:``,i=t.color===void 0?``:e.f` data-color="${(0,e.escapeAttr)(t.color)}"`,a=t.color===void 0?`none`:e.f`color-mix(in srgb, ${(0,e.escapeAttr)(t.color)} ${Xa}%, var(--bg))`,o=[e.f`<g class="participant-box"${r}${i}>`,e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" rx="4" ry="4" `+e.f`fill="${a}" stroke="var(--_node-stroke)" stroke-width="${I.innerBox}" />`];return t.label&&o.push(` `+(0,e.renderMultilineText)(t.label,t.x+t.width/2,t.y+da(n.edgeLabel)/2,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${F.groupHeader}" fill="var(--_text-sec)"`)),o.push(`</g>`),o.join(`
69
+ `)}function Qa(e){return e.type===`rect`&&e.color!==void 0}function $a(t,n){let r=[];if(Qa(t))return[e.f`<g class="block" data-type="rect" data-color="${(0,e.escapeAttr)(t.color)}">`,e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" `+e.f`fill="${(0,e.escapeAttr)(t.color)}" />`,`</g>`].join(`
70
+ `);let i=t.label?e.f` data-label="${(0,e.escapeAttr)(t.label)}"`:``;r.push(e.f`<g class="block" data-type="${(0,e.escapeAttr)(t.type)}"${i}>`),r.push(e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" `+e.f`rx="0" ry="0" fill="none" stroke="var(--_node-stroke)" stroke-width="${2}" stroke-dasharray="${Wa}" />`);let a=Oa(t,n.edgeLabel),{x:o,y:s}=t,c=Da(o,s,a).map(([t,n])=>e.f`${t},${n}`).join(` `);r.push(e.f` <polygon points="${c}" `+e.f`fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${I.outerBox}" />`),r.push(` `+(0,e.renderMultilineText)(t.type,t.x+6,t.y+9,n.edgeLabel,e.f`font-size="${n.edgeLabel}" font-weight="${F.groupHeader}" fill="var(--_text-sec)"`)),t.label&&r.push(` `+(0,e.renderMultilineText)(e.f`[${t.label}]`,t.x+(a+t.width)/2,Ha(t,n),n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${F.edgeLabel}" fill="var(--_text-sec)"`));for(let i of t.dividers)r.push(e.f` <line x1="${t.x}" y1="${i.y}" x2="${t.x+t.width}" y2="${i.y}" `+`stroke="var(--_line)" stroke-width="2" stroke-dasharray="${Ga}" />`),i.label&&r.push(` `+(0,e.renderMultilineText)(e.f`[${i.label}]`,t.x+t.width/2,Ua(i,n),n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${F.edgeLabel}" fill="var(--_text-muted)"`));return r.push(`</g>`),r.join(`
71
+ `)}var eo=10,to=10;function no(t,n){let{x:r,y:i,width:a,height:o}=t,s=t.actors&&t.actors.length>0?e.f` data-actors="${t.actors.map(e.escapeAttr).join(`,`)}"`:``,c=t.position?e.f` data-position="${(0,e.escapeAttr)(t.position)}"`:``;return e.f`<g class="note"${c}${s}>`+e.f`\n <rect x="${r}" y="${i}" width="${a}" height="${o}" `+e.f`fill="var(--bg)" stroke="var(--_node-stroke)" stroke-width="${I.outerBox}" />`+e.f`\n ${(0,e.renderMultilineText)(t.text,t.align===`left`?r+eo:t.align===`right`?r+a-eo:r+a/2,i+o/2,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="${t.align===`left`?`start`:t.align===`right`?`end`:`middle`}" font-weight="${F.edgeLabel}" fill="var(--_text-muted)"`)}`+`
72
+ </g>`}var H={plotWidth:600,plotHeight:340,padding:22,titleFontSize:18,titleFontWeight:600,titleHeight:42,axisLabelFontSize:14,axisLabelHeight:16,axisLabelFontWeight:400,axisTitleFontSize:15,axisTitleFontWeight:500,xLabelHeight:38,yLabelWidth:58,yLabelGap:18,axisTitlePad:30,tickLength:4},ro=.8;function io(e,t,n){let r=Math.min(n,.2*e),i=(e-2*r)/t,a=.7*i>2*r?Math.floor(.35*i):r;return{p0:r,pad:a,bar:.95*Math.min(2*a,(e-2*a)/t)}}function ao(t,n,r){let i=(0,e.collapseFlatRange)(t.yAxis.range,t.series.flatMap(e=>e.data)),a=(0,e.niceTickValues)(i.min,i.max),o=_o(a),s=Math.min(r(o)/2,.2*n),c=i.max-i.min;return{range:i,ticks:a,labels:o,pad:s,frac:e=>c>0?(e-i.min)/c:.5}}function oo(t,n,r){let i=t.xAxis.categories?void 0:t.xAxis.range,a=e=>r?H.axisLabelFontSize/2:ro*Math.max(...e.map(e=>k(e,H.axisLabelFontSize,H.axisLabelFontWeight)))/2,o=t.series.some(e=>e.type===`bar`);if(!i){let e=uo(t),r=fo(t,e),{p0:i,pad:s,bar:c}=io(n,e,a(r)),l=o?s:i,u=t=>e<2?n/2:l+t*(n-2*l)/(e-1);return{at:(e,t)=>u(t),ticks:r.map((e,t)=>({label:e,at:u(t)})),bar:c}}let s=(0,e.niceTickValues)(i.min,i.max),c=_o(s),{p0:l,pad:u,bar:d}=io(n,s.length,a(c)),f=o?u:l,p=i.max-i.min,m=e=>{let t=p>0?(e-i.min)/p:.5;return f+(r?1-t:t)*(n-2*f)};return{at:(e,t)=>m(e<2?i.min:i.min+t*p/(e-1)),ticks:s.map((e,t)=>({label:c[t],at:m(e)})),bar:d}}function so(e,t={}){let n=e.config?.width??700,r=e.config?.height??500;return e.horizontal?lo(e,n,r):co(e,n,r)}function co(e,t,n){let r=!!e.title,i=!!e.xAxis.title,a=!!e.yAxis.title;if(!e.yAxis.range)throw Error(`XY chart: y-axis range was not set by the parser`);let o=ao(e,0,()=>H.axisLabelHeight).labels,s=e.config?.xAxis?.showLabel!==!1,c=e.config?.yAxis?.showLabel!==!1,l=Math.max(...o.map(e=>k(e,H.axisLabelFontSize,H.axisLabelFontWeight)),H.yLabelWidth),u=H.padding+(r?H.titleHeight:0),d=H.padding+(s?H.xLabelHeight:0)+(i?H.axisTitlePad:0),f=H.padding+(c?l+H.yLabelGap:0)+(a?H.axisTitlePad:0),p=H.padding,m=Math.max(50,t-f-p),h=Math.max(50,n-u-d),g=ao(e,h,()=>H.axisLabelHeight),_=g.ticks,v=g.labels,y=m,b=h,x=f+y+p,S=u+b+d,C={x:f,y:u,width:y,height:b},w=uo(e),T=oo(e,y,!1),E=(e,t)=>f+T.at(e,t),D=e=>u+b-g.pad-g.frac(e)*(b-2*g.pad),O=u+b,A=T.ticks.map(e=>({label:e.label,x:f+e.at,y:O,tx:f+e.at,ty:O+H.tickLength,labelX:f+e.at,labelY:O+18,textAnchor:`middle`})),j=_.map((e,t)=>({label:v[t],x:f,y:D(e),tx:f-H.tickLength,ty:D(e),labelX:f-H.yLabelGap,labelY:D(e),textAnchor:`end`})),M=_.map(e=>({x1:f,y1:D(e),x2:f+y,y2:D(e)})),N=fo(e,w),P=e.series.map((e,t)=>t),F=ho(e,E,D,T.bar,u+b,N,P),ee=go(e,E,D,N,P),te=yo(e,P),ne={x1:f,y1:u+b,x2:f+y,y2:u+b},I={x1:f,y1:u,x2:f,y2:u+b},L={ticks:A,line:ne,...e.xAxis.title?{title:{text:e.xAxis.title,x:f+y/2,y:S-H.padding}}:{}},re={ticks:j,line:I,...e.yAxis.title?{title:{text:e.yAxis.title,x:H.padding+4,y:u+b/2,rotate:-90}}:{}};return{width:x,height:S,title:e.title?{text:e.title,x:x/2,y:H.padding+H.titleFontSize}:void 0,xAxis:L,yAxis:re,plotArea:C,bars:F,lines:ee,gridLines:M,legend:te,...e.config&&{config:e.config}}}function lo(e,t,n){let r=!!e.title,i=!!e.xAxis.title,a=!!e.yAxis.title;if(!e.yAxis.range)throw Error(`XY chart: y-axis range was not set by the parser`);let o=e=>ro*Math.max(...e.map(e=>k(e,H.axisLabelFontSize,H.axisLabelFontWeight))),s=ao(e,0,o).labels,c=e.config?.xAxis?.showLabel!==!1,l=e.config?.yAxis?.showLabel!==!1,u=fo(e,uo(e)),d=Math.max(...oo(e,0,!0).ticks.map(({label:e})=>k(e,H.axisLabelFontSize,H.axisLabelFontWeight)),40),f=H.padding+(r?H.titleHeight:0)+(a?H.axisTitlePad:0)+(l?H.xLabelHeight:0),p=H.padding,m=H.padding+(c?d+H.yLabelGap:0)+(i?H.axisTitlePad:0),h=Math.max(H.padding,k(s[s.length-1],H.axisLabelFontSize,H.axisLabelFontWeight)/2+4),g=Math.max(50,t-m-h),_=Math.max(50,n-f-p),v=ao(e,g,o),y=v.ticks,b=oo(e,_,!0),x=g,S=_,C=m+x+h,w=f+S+p,T={x:m,y:f,width:x,height:S},E=e=>m+v.pad+v.frac(e)*(x-2*v.pad),D=(e,t)=>f+b.at(e,t),O=y.map((e,t)=>({label:s[t],x:E(e),y:f,tx:E(e),ty:f-H.tickLength,labelX:E(e),labelY:f-18,textAnchor:`middle`})),A=b.ticks.map(({label:e,at:t})=>({label:e,x:m,y:f+t,tx:m-H.tickLength,ty:f+t,labelX:m-H.yLabelGap,labelY:f+t,textAnchor:`end`})),j=y.map(e=>({x1:E(e),y1:f,x2:E(e),y2:f+S})),M=e.series.map((e,t)=>t),N=e.series.filter(e=>e.type===`bar`).length,P=[];if(N>0){let t=b.bar,n=t,r=0,i=0;for(let a of e.series){if(a.type!==`bar`){i++;continue}for(let e=0;e<a.data.length;e++){let o=D(a.data.length,e)-n/2,s=E(Math.max(a.data[e],v.range.min)),c=m;P.push({x:Math.min(c,s),y:o,width:Math.abs(s-c),height:t,value:a.data[e],label:u[e],seriesIndex:r,colorIndex:M[i]})}r++,i++}}let F=[],ee=0,te=0;for(let t of e.series){if(t.type!==`line`){te++;continue}let e=t.data.map((e,n)=>({x:E(e),y:D(t.data.length,n),value:e,label:u[n]}));F.push({points:e,seriesIndex:ee,colorIndex:M[te]}),ee++,te++}let ne={x1:m,y1:f,x2:m+x,y2:f},I={x1:m,y1:f,x2:m,y2:f+S},L={ticks:O,line:ne,...e.yAxis.title?{title:{text:e.yAxis.title,x:m+x/2,y:H.padding+(r?H.titleHeight:0)+H.axisTitlePad/2}}:{}},re={ticks:A,line:I,...e.xAxis.title?{title:{text:e.xAxis.title,x:H.padding+4,y:f+S/2,rotate:-90}}:{}};return{width:C,height:w,horizontal:!0,title:e.title?{text:e.title,x:C/2,y:H.padding+H.titleFontSize}:void 0,xAxis:L,yAxis:re,plotArea:T,bars:P,lines:F,gridLines:j,legend:yo(e,M),...e.config&&{config:e.config}}}function uo(e){if(e.xAxis.categories)return e.xAxis.categories.length;for(let t of e.series)if(t.data.length>0)return t.data.length;return 1}function fo(e,t){if(e.xAxis.categories)return e.xAxis.categories;if(e.xAxis.range){let{min:n,max:r}=e.xAxis.range,i=t>1?(r-n)/(t-1):0;return Array.from({length:t},(e,t)=>vo(n+i*t))}return Array.from({length:t},(e,t)=>String(t+1))}var po=8;function mo(e,t){let n=e.map(e=>k(e,H.axisLabelFontSize,H.axisLabelFontWeight));for(let r=1;r<e.length;r++){let i=!0;for(let a=0;a+r<e.length;a+=r)if(r*t-(n[a]+n[a+r])/2<po){i=!1;break}if(i)return r}return Math.max(1,e.length)}function ho(e,t,n,r,i,a,o){if(e.series.filter(e=>e.type===`bar`).length===0)return[];let s=r,c=[],l=0,u=0;for(let d of e.series){if(d.type!==`bar`){u++;continue}for(let e=0;e<d.data.length;e++){let f=t(d.data.length,e)-s/2,p=n(d.data[e]);c.push({x:f,y:Math.min(p,i),width:r,height:Math.abs(i-p),value:d.data[e],label:a[e],seriesIndex:l,colorIndex:o[u]})}l++,u++}return c}function go(e,t,n,r,i){let a=[],o=0,s=0;for(let c of e.series){if(c.type!==`line`){s++;continue}let e=c.data.map((e,i)=>({x:t(c.data.length,i),y:n(e),value:e,label:r[i]}));a.push({points:e,seriesIndex:o,colorIndex:i[s]}),o++,s++}return a}function _o(e){let t=e.length>1?Math.abs(e[1]-e[0]):0,n=t>0&&t<1?Math.ceil(-Math.log10(t)-1e-9):0;return e.map(e=>String(Number.isInteger(e)&&n===0?e:Number(e.toFixed(n))))}function vo(e){return Number.isInteger(e)?String(e):e.toFixed(+(Math.abs(e)<10))}function yo(e,t){let n=0,r=0;return e.series.map((e,i)=>{let a=e.type===`bar`?n++:r++;return{label:`${e.type===`bar`?`Bar`:`Line`} ${a+1}`,x:0,y:0,type:e.type,seriesIndex:a,colorIndex:t[i]}})}var bo={titleSize:18,titleWeight:600,axisTitleSize:15,axisTitleWeight:500,labelSize:14,labelWeight:400,dotRadius:5,lineWidth:2.5},U={fontSize:15,fontWeight:500,height:32,padX:14,offsetY:12,rx:8,minY:4,pointerSize:6};function xo(t,n,r=`Inter`,i=!1,a=!1,o,s,c,l={}){let u=[],d=Math.max(0,...t.bars.map(e=>e.colorIndex),...t.lines.map(e=>e.colorIndex)),{style:f,defs:p,cls:m}=So(t,a,n.accent,n.bg,l.nonce),h=z((0,e.withRootClass)((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,void 0,l.styleAttribute,l.description).replace(`<svg `,`<svg data-xychart-colors="${d}" `),m),o);u.push(h),u.push((0,e.buildStyleBlock)(r,!1,l.nonce,l.bodyFont)),u.push(f),p&&u.push(p);let g=t.config,_=g?.xAxis,v=g?.yAxis,[y,b]=t.horizontal?[_,v]:[v,_],x=y?.showAxisLine!==!1,S=b?.showAxisLine!==!1,{plotArea:C}=t,w=C.y+C.height,T=C.x+C.width,E=t.horizontal?C.y:w,D=x&&S?t.horizontal?`M${W(C.x)},${W(w)} V${W(C.y)} H${W(T)}`:`M${W(C.x)},${W(C.y)} V${W(w)} H${W(T)}`:x?`M${W(C.x)},${W(C.y)} V${W(w)}`:S?`M${W(C.x)},${W(E)} H${W(T)}`:``;D&&u.push(`<path d="${D}" class="xychart-axis"/>`);let O=t.horizontal?v:_,k=t.horizontal?_:v;for(let e of[...O?.showTick===!1?[]:t.xAxis.ticks,...k?.showTick===!1?[]:t.yAxis.ticks])u.push(`<path d="M${W(e.x)},${W(e.y)} L${W(e.tx)},${W(e.ty)}" class="xychart-axis"/>`);let A=[];for(let e of t.bars){let n=` data-value="${e.value}"${e.label?` data-label="${Oo(e.label)}"`:``}`,r=Math.max(e.x,C.x),i=Math.min(e.x+e.width,C.x+C.width),o=Math.max(e.y,C.y),s=Math.min(e.y+e.height,C.y+C.height);if(i<=r||s<=o)continue;let c=`M${W(r)},${W(o)} H${W(i)} V${W(s)} H${W(r)} Z`;if(u.push(`<path d="${c}" class="xychart-bar xychart-color-${e.colorIndex}"${n}/>`),a){let n=Do(e.value),a=e.label?`${e.label}: ${n}`:n,c=Eo((r+i)/2,o,n);A.push({extent:t.horizontal?i-r:s-o,html:`<g class="xychart-bar-group"><rect x="${W(r)}" y="${W(o)}" width="${W(i-r)}" height="${W(s-o)}" fill="transparent"/><title>${Oo(a)}</title>`+c+`</g>`})}}A.sort((e,t)=>t.extent-e.extent);for(let e of t.lines){if(e.points.length===0)continue;let t=Co(e.points);u.push(`<path d="${t}" class="xychart-line-shadow xychart-color-${e.colorIndex}" transform="translate(0,2)"/>`),u.push(`<path d="${t}" class="xychart-line xychart-color-${e.colorIndex}"/>`)}let j=Math.max(...t.lines.map(e=>e.points.length),0),M=j>0&&j<=12,N=[];if(a){let e=new Map;for(let n of t.legend)n.type===`line`&&e.set(n.seriesIndex,n.label);let n=new Map;for(let e of t.lines)for(let t of e.points){let r=W(t.x),i=n.get(r)??[];n.set(r,i),i.push({x:t.x,y:t.y,value:t.value,label:t.label,seriesIndex:e.seriesIndex,colorIndex:e.colorIndex})}for(let t of n.values()){let n=t[0].x,r=t[0].label||``;if(a&&t.length>1){let i=Math.min(...t.map(e=>e.y)),a=Math.max(...t.map(e=>e.y)),o=bo.dotRadius*3,s=`<rect x="${W(n-o)}" y="${W(i-o)}" width="${W(o*2)}" height="${W(a-i+o*2)}" fill="transparent" class="xychart-hit"/>`,c=t.map(t=>({text:Do(t.value),legendLabel:e.get(t.seriesIndex)||`Line ${t.seriesIndex+1}`})),l=To(n,i-bo.dotRadius,r,c),u=c.map(e=>e.text),d=r?`${r}: ${u.join(` · `)}`:u.join(` · `),f=`<g class="xychart-dot-group">${s}`;for(let e of t){let t=` data-value="${e.value}"${e.label?` data-label="${Oo(e.label)}"`:``}`;f+=`<circle cx="${W(e.x)}" cy="${W(e.y)}" r="${bo.dotRadius}" class="xychart-dot xychart-color-${e.colorIndex}"${t}/>`}f+=`<title>${Oo(d)}</title>${l}</g>`,N.push(f)}else if(a){let e=t[0],r=` data-value="${e.value}"${e.label?` data-label="${Oo(e.label)}"`:``}`,i=Do(e.value),a=e.label?`${e.label}: ${i}`:i,o=Eo(n,e.y-bo.dotRadius,i),s=M?`<circle cx="${W(n)}" cy="${W(e.y)}" r="${bo.dotRadius*3}" fill="transparent" class="xychart-hit"/>`:``;N.push(`<g class="xychart-dot-group">${s}<circle cx="${W(e.x)}" cy="${W(e.y)}" r="${bo.dotRadius}" class="xychart-dot xychart-color-${e.colorIndex}"${r}/><title>${Oo(a)}</title>${o}</g>`)}}}for(let e of O?.showLabel===!1?[]:t.xAxis.ticks)e.label!==``&&u.push(`<text x="${e.labelX}" y="${e.labelY}" text-anchor="${e.textAnchor}" font-size="${bo.labelSize}" font-weight="${bo.labelWeight}" dy="${L}" class="xychart-label">${Oo(e.label)}</text>`);for(let e of k?.showLabel===!1?[]:t.yAxis.ticks)u.push(`<text x="${e.labelX}" y="${e.labelY}" text-anchor="${e.textAnchor}" font-size="${bo.labelSize}" font-weight="${bo.labelWeight}" dy="${L}" class="xychart-label">${Oo(e.label)}</text>`);if(t.xAxis.title){let e=t.xAxis.title,n=e.rotate?` transform="rotate(${e.rotate},${e.x},${e.y})"`:``;u.push(`<text x="${e.x}" y="${e.y}" text-anchor="middle"${n} font-size="${bo.axisTitleSize}" font-weight="${bo.axisTitleWeight}" dy="${L}" class="xychart-axis-title">${Oo(e.text)}</text>`)}if(t.yAxis.title){let e=t.yAxis.title,n=e.rotate?` transform="rotate(${e.rotate},${e.x},${e.y})"`:``;u.push(`<text x="${e.x}" y="${e.y}" text-anchor="middle"${n} font-size="${bo.axisTitleSize}" font-weight="${bo.axisTitleWeight}" dy="${L}" class="xychart-axis-title">${Oo(e.text)}</text>`)}t.title&&u.push(`<text x="${t.title.x}" y="${t.title.y}" text-anchor="middle" font-size="${bo.titleSize}" font-weight="${bo.titleWeight}" dy="${L}" class="xychart-title">${Oo(t.title.text)}</text>`);for(let e of A)u.push(e.html);for(let e of N)u.push(e);return u.push(`</svg>`),u.join(`
73
+ `)}function So(n,r,i,a,o){let s=i??t.CHART_ACCENT_FALLBACK,c=new Set;for(let e of n.bars)c.add(e.colorIndex);for(let e of n.lines)c.add(e.colorIndex);let l=[];for(let e of[...c].sort((e,t)=>e-t)){let n=e===0?`var(--accent, ${t.CHART_ACCENT_FALLBACK})`:(0,t.getSeriesColor)(e,s,a);l.push(` --xychart-color-${e}: ${n};`),l.push(` --xychart-bar-fill-${e}: color-mix(in srgb, var(--bg) 75%, var(--xychart-color-${e}) 25%);`)}let u=[];for(let e of[...c].sort((e,t)=>e-t)){let t=`var(--xychart-color-${e})`;u.push(` .xychart-bar.xychart-color-${e} { stroke: none; fill: var(--xychart-bar-fill-${e}); }`),u.push(` path.xychart-color-${e}, line.xychart-color-${e} { stroke: ${t}; }`),u.push(` circle.xychart-color-${e} { fill: ${t}; }`)}let d=r?`
71
74
  .xychart-dot { opacity: 0; }
72
75
  .xychart-dot-group:hover .xychart-dot { opacity: 1; }
73
76
  .xychart-tip { opacity: 0; pointer-events: none; }
74
77
  .xychart-tip-bg { fill: var(--_text); filter: drop-shadow(0 1px 3px color-mix(in srgb, var(--fg) 20%, transparent)); }
75
- .xychart-tip-text { fill: var(--bg); font-size: ${H.fontSize}px; font-weight: ${H.fontWeight}; }
78
+ .xychart-tip-text { fill: var(--bg); font-size: ${U.fontSize}px; font-weight: ${U.fontWeight}; }
76
79
  .xychart-tip-ptr { fill: var(--_text); }
77
80
  .xychart-bar-group:hover .xychart-tip,
78
81
  .xychart-dot-group:hover .xychart-tip { opacity: 1; }`:``,f=(0,e.paletteClass)(l),p=l.length>0?`\n .${f} {\n${l.join(`
79
82
  `)}\n }`:``;return{style:`${(0,e.styleOpenTag)(o)}
80
83
  .xychart-axis { fill: none; stroke: var(--_text); stroke-width: 2; }
81
- .xychart-line { fill: none; stroke-width: ${co.lineWidth}; stroke-linecap: round; stroke-linejoin: round; }
84
+ .xychart-line { fill: none; stroke-width: ${bo.lineWidth}; stroke-linecap: round; stroke-linejoin: round; }
82
85
  .xychart-line-shadow { fill: none; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.12; }
83
86
  .xychart-dot { stroke: var(--bg); stroke-width: 2; }
84
87
  .xychart-label { fill: var(--_text-muted); }
@@ -86,31 +89,31 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require
86
89
  .xychart-title { fill: var(--_text); }${p}
87
90
  ${u.join(`
88
91
  `)}${d}
89
- </style>`,defs:``,cls:f}}function fo(e){return e.map((e,t)=>`${t===0?`M`:`L`}${U(e.x)},${U(e.y)}`).join(` `)}function po(e){if(e.length===0)return``;if(e.length===1)return`M${U(e[0].x)},${U(e[0].y)}`;if(e.length===2)return`M${U(e[0].x)},${U(e[0].y)} L${U(e[1].x)},${U(e[1].y)}`;let t=e.length,n=[],r=[];for(let i=0;i<t-1;i++)n.push(e[i+1].x-e[i].x),r.push(n[i]===0?0:(e[i+1].y-e[i].y)/n[i]);let i=Array(t).fill(0);for(let e=1;e<t-1;e++){let t=r[e-1],a=r[e];if(t*a<=0)continue;let o=2*n[e]+n[e-1],s=n[e]+2*n[e-1];i[e]=(o+s)/(o/t+s/a)}let a=(e,t,n,r)=>{let i=((2*e+t)*n-e*r)/(e+t);return i*n<=0?i=0:n*r<=0&&Math.abs(i)>3*Math.abs(n)&&(i=3*n),i};i[0]=a(n[0],n[1],r[0],r[1]),i[t-1]=a(n[t-2],n[t-3],r[t-2],r[t-3]);let o=`M${U(e[0].x)},${U(e[0].y)}`;for(let r=0;r<t-1;r++){let t=n[r]/3,a=e[r].x+t,s=e[r].y+i[r]*t,c=e[r+1].x-t,l=e[r+1].y-i[r+1]*t;o+=` C${U(a)},${U(s)} ${U(c)},${U(l)} ${U(e[r+1].x)},${U(e[r+1].y)}`}return o}function mo(e,t,n,r){let i=k(n,H.fontSize,600),a=Math.max(...r.map(e=>{let t=k(e.legendLabel,H.fontSize,H.fontWeight),n=k(e.text,H.fontSize,H.fontWeight);return t+10+n})),o=Math.max(i,a)+H.padX*2,s=26+r.length*20+6,c=Math.max(H.minY,t-H.offsetY-s-H.pointerSize),l=e-o/2,u=e,d=c+s,f=H.pointerSize,p=`<polygon points="${U(u-f)},${U(d)} ${U(u+f)},${U(d)} ${U(u)},${U(d+f)}" class="xychart-tip xychart-tip-ptr"/>`,m=`<rect x="${U(l)}" y="${U(c)}" width="${U(o)}" height="${s}" rx="${H.rx}" class="xychart-tip xychart-tip-bg"/>`;m+=p;let h=c+6+10;m+=`<text x="${U(e)}" y="${U(h)}" text-anchor="middle" font-weight="600" font-size="${H.fontSize}" dy="${L}" class="xychart-tip xychart-tip-text">${_o(n)}</text>`;let g=l+H.padX,_=l+o-H.padX;for(let e of r)h+=20,m+=`<text x="${U(g)}" y="${U(h)}" text-anchor="start" font-size="${H.fontSize}" font-weight="${H.fontWeight}" dy="${L}" class="xychart-tip xychart-tip-text">${_o(e.legendLabel)}</text>`,m+=`<text x="${U(_)}" y="${U(h)}" text-anchor="end" font-size="${H.fontSize}" font-weight="${H.fontWeight}" dy="${L}" class="xychart-tip xychart-tip-text">${_o(e.text)}</text>`;return m}function ho(e,t,n){let r=k(n,H.fontSize,H.fontWeight)+H.padX*2,i=H.height,a=Math.max(H.minY,t-H.offsetY-i-H.pointerSize),o=e-r/2,s=e,c=a+i/2,l=e,u=a+i,d=H.pointerSize,f=`<polygon points="${U(l-d)},${U(u)} ${U(l+d)},${U(u)} ${U(l)},${U(u+d)}" class="xychart-tip xychart-tip-ptr"/>`;return`<rect x="${U(o)}" y="${U(a)}" width="${U(r)}" height="${i}" rx="${H.rx}" class="xychart-tip xychart-tip-bg"/>`+f+`<text x="${U(s)}" y="${U(c)}" text-anchor="middle" dy="${L}" class="xychart-tip xychart-tip-text">${_o(n)}</text>`}function go(e){return Number.isInteger(e)?e.toLocaleString(`en-US`):e.toFixed(+(Math.abs(e)<10))}function U(e){return String(Math.round(e*10)/10)}function _o(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}var W={height:450,margin:40,legendRectSize:18,legendSpacing:4,textPosition:.75,outerStrokeWidth:2,titleFontSize:25,sectionFontSize:17,legendFontSize:17,fontWeight:400,paletteSize:12,highlightScale:1.05,minPercent:1},vo=Math.PI*2;function G(e){return String(Math.round(e*100)/100)}function yo(e,t,n,r){return{x:e+n*Math.sin(r),y:t-n*Math.cos(r)}}function bo(e,t,n,r,i,a=0){if(i-r>=vo-1e-9){let r=(n,r)=>`M${G(e)},${G(t-n)}A${G(n)},${G(n)},0,1,${r},${G(e)},${G(t+n)}A${G(n)},${G(n)},0,1,${r},${G(e)},${G(t-n)}`;return r(n,1)+(a>0?r(a,0):``)+`Z`}let o=yo(e,t,n,r),s=yo(e,t,n,i),c=+(i-r>Math.PI),l=`M${G(o.x)},${G(o.y)}A${G(n)},${G(n)},0,${c},1,${G(s.x)},${G(s.y)}`;if(a<=0)return`${l}L${G(e)},${G(t)}Z`;let u=yo(e,t,a,i),d=yo(e,t,a,r);return`${l}L${G(u.x)},${G(u.y)}A${G(a)},${G(a)},0,${c},0,${G(d.x)},${G(d.y)}Z`}function xo(e,t,n){return n?`${e} [${String(t)}]`:e}function So(e,t={}){let n=W.height,r=n,i=Math.min(r,n)/2-W.margin,a=r/2,o=n/2,s=e.slices.reduce((e,t)=>e+t.value,0),c=e.slices.map((e,t)=>({slice:e,colorIndex:t%W.paletteSize})).filter(({slice:e})=>e.value/s*100>=W.minPercent),l=c.reduce((e,t)=>e+t.slice.value,0),u=W.legendRectSize+W.legendSpacing,d=e.slices.length,f=d>0?e.legendPosition??`right`:`right`,p=e.slices.map(t=>xo(t.label,t.value,e.showData)),m=Math.max(0,...p.map(e=>k(e,W.legendFontSize,W.fontWeight))),h=W.legendRectSize+W.legendSpacing,g=u*d,_=f===`left`?m+h:0,v=f===`top`?g+u:0,y=a-m/2-h,b=o-g/2,x={right:{x:a+12*W.legendRectSize,y:b},left:{x:a-i-h,y:b},center:{x:y,y:b},top:{x:y,y:o-i},bottom:{x:y,y:o+i+u}}[f],S=h+m,C=d===0?-1/0:f===`left`||f===`right`?r+W.margin+S:r+W.margin,w=f===`top`||f===`bottom`?n+g:n,T=e.title??``,E=T.length>0?k(T,W.titleFontSize,W.fontWeight):0,D=a-E/2,O=a+E/2,A=Math.min(0,D),j=Math.max(C,O),ee=w,M=-A,N=a+_+M,P=o+v+-0,te=[],ne=0,F=e.donutHole??0,I=F>0&&F<=.9?F*i:0,L=i*(e.textPosition??W.textPosition);for(let{slice:t,colorIndex:n}of c){let r=ne,a=ne+t.value/l*vo;ne=a;let o=yo(N,P,L,(r+a)/2),c=e.highlightSlice!==void 0&&e.highlightSlice!==`hover`&&e.highlightSlice!==``&&e.highlightSlice===t.label,u=c?W.highlightScale:1;te.push({label:t.label,value:t.value,colorIndex:n,startAngle:r,endAngle:a,path:bo(N,P,i*u,r,a,I*u),percentText:`${(t.value/s*100).toFixed(0)}%`,labelX:o.x,labelY:o.y,...c?{highlighted:c}:{}})}let re=p.map((e,t)=>{let n=x.x+M,r=x.y+t*u+-0;return{text:e,colorIndex:t%W.paletteSize,x:n,y:r,size:W.legendRectSize,textX:n+W.legendRectSize+W.legendSpacing,textY:r+W.legendRectSize-W.legendSpacing}});return{width:Math.ceil(j-A),height:Math.ceil(ee-0),cx:N,cy:P,radius:i,outerRadius:i+W.outerStrokeWidth/2,title:T.length>0?{text:T,x:a+M,y:o+-0-(n-50)/2}:void 0,slices:te,legend:re,accTitle:e.accTitle,accDescr:e.accDescr,sliceColors:e.sliceColors}}function Co(e){return String(Math.round(e*100)/100)}function wo(e,n,r){return e===0?`var(--accent, ${t.CHART_ACCENT_FALLBACK})`:(0,t.getSeriesColor)(e,n??t.CHART_ACCENT_FALLBACK,r)}function To(t,n,r){let i=new Set;for(let e of t.slices)i.add(e.colorIndex);for(let e of t.legend)i.add(e.colorIndex);let a=[...i].sort((e,t)=>e-t),o=a.map(e=>` --pie-color-${e}: ${t.sliceColors?.[e]??wo(e,n.accent,n.bg)};`),s=a.map(e=>` .pie-color-${e} { fill: var(--pie-color-${e}); }\n rect.pie-color-${e} { stroke: var(--pie-color-${e}); }`),c=t.slices.some(e=>e.highlighted)?`
90
- .pie-slice.pie-highlight { opacity: 1; }`:``,l=(0,e.paletteClass)(o),u=o.length>0?`\n .${l} {\n${o.join(`
91
- `)}\n }`:``;return{css:`${(0,e.styleOpenTag)(r)}
92
- .pie-outer { fill: none; stroke: var(--fg); stroke-width: ${W.outerStrokeWidth}px; }
93
- .pie-slice { stroke: var(--fg); stroke-width: 2px; opacity: 0.7; }${c}
94
- .pie-slice-label { fill: var(--_text); font-size: ${W.sectionFontSize}px; font-weight: ${W.fontWeight}; }
95
- .pie-title { fill: var(--_text); font-size: ${W.titleFontSize}px; font-weight: ${W.fontWeight}; }
96
- .pie-legend-text { fill: var(--_text); font-size: ${W.legendFontSize}px; font-weight: ${W.fontWeight}; }${u}
97
- ${s.join(`
92
+ </style>`,defs:``,cls:f}}function Co(e){return e.map((e,t)=>`${t===0?`M`:`L`}${W(e.x)},${W(e.y)}`).join(` `)}function wo(e){if(e.length===0)return``;if(e.length===1)return`M${W(e[0].x)},${W(e[0].y)}`;if(e.length===2)return`M${W(e[0].x)},${W(e[0].y)} L${W(e[1].x)},${W(e[1].y)}`;let t=e.length,n=[],r=[];for(let i=0;i<t-1;i++)n.push(e[i+1].x-e[i].x),r.push(n[i]===0?0:(e[i+1].y-e[i].y)/n[i]);let i=Array(t).fill(0);for(let e=1;e<t-1;e++){let t=r[e-1],a=r[e];if(t*a<=0)continue;let o=2*n[e]+n[e-1],s=n[e]+2*n[e-1];i[e]=(o+s)/(o/t+s/a)}let a=(e,t,n,r)=>{let i=((2*e+t)*n-e*r)/(e+t);return i*n<=0?i=0:n*r<=0&&Math.abs(i)>3*Math.abs(n)&&(i=3*n),i};i[0]=a(n[0],n[1],r[0],r[1]),i[t-1]=a(n[t-2],n[t-3],r[t-2],r[t-3]);let o=`M${W(e[0].x)},${W(e[0].y)}`;for(let r=0;r<t-1;r++){let t=n[r]/3,a=e[r].x+t,s=e[r].y+i[r]*t,c=e[r+1].x-t,l=e[r+1].y-i[r+1]*t;o+=` C${W(a)},${W(s)} ${W(c)},${W(l)} ${W(e[r+1].x)},${W(e[r+1].y)}`}return o}function To(e,t,n,r){let i=k(n,U.fontSize,600),a=Math.max(...r.map(e=>{let t=k(e.legendLabel,U.fontSize,U.fontWeight),n=k(e.text,U.fontSize,U.fontWeight);return t+10+n})),o=Math.max(i,a)+U.padX*2,s=26+r.length*20+6,c=Math.max(U.minY,t-U.offsetY-s-U.pointerSize),l=e-o/2,u=e,d=c+s,f=U.pointerSize,p=`<polygon points="${W(u-f)},${W(d)} ${W(u+f)},${W(d)} ${W(u)},${W(d+f)}" class="xychart-tip xychart-tip-ptr"/>`,m=`<rect x="${W(l)}" y="${W(c)}" width="${W(o)}" height="${s}" rx="${U.rx}" class="xychart-tip xychart-tip-bg"/>`;m+=p;let h=c+6+10;m+=`<text x="${W(e)}" y="${W(h)}" text-anchor="middle" font-weight="600" font-size="${U.fontSize}" dy="${L}" class="xychart-tip xychart-tip-text">${Oo(n)}</text>`;let g=l+U.padX,_=l+o-U.padX;for(let e of r)h+=20,m+=`<text x="${W(g)}" y="${W(h)}" text-anchor="start" font-size="${U.fontSize}" font-weight="${U.fontWeight}" dy="${L}" class="xychart-tip xychart-tip-text">${Oo(e.legendLabel)}</text>`,m+=`<text x="${W(_)}" y="${W(h)}" text-anchor="end" font-size="${U.fontSize}" font-weight="${U.fontWeight}" dy="${L}" class="xychart-tip xychart-tip-text">${Oo(e.text)}</text>`;return m}function Eo(e,t,n){let r=k(n,U.fontSize,U.fontWeight)+U.padX*2,i=U.height,a=Math.max(U.minY,t-U.offsetY-i-U.pointerSize),o=e-r/2,s=e,c=a+i/2,l=e,u=a+i,d=U.pointerSize,f=`<polygon points="${W(l-d)},${W(u)} ${W(l+d)},${W(u)} ${W(l)},${W(u+d)}" class="xychart-tip xychart-tip-ptr"/>`;return`<rect x="${W(o)}" y="${W(a)}" width="${W(r)}" height="${i}" rx="${U.rx}" class="xychart-tip xychart-tip-bg"/>`+f+`<text x="${W(s)}" y="${W(c)}" text-anchor="middle" dy="${L}" class="xychart-tip xychart-tip-text">${Oo(n)}</text>`}function Do(e){return Number.isInteger(e)?e.toLocaleString(`en-US`):e.toFixed(+(Math.abs(e)<10))}function W(e){return String(Math.round(e*10)/10)}function Oo(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}var ko=32,Ao=[301,367,325,524,524,600,706,160,367,367,367,524,367,367,367,524,524,524,524,524,524,524,524,524,524,524,367,367,524,524,524,367,771,590,566,598,613,536,525,676,654,278,477,576,506,709,638,674,558,676,582,481,581,648,587,852,557,570,550,367,355,367,524,524,524,525,557,495,557,545,370,502,546,285,367,504,295,830,546,537,557,557,389,405,396,546,490,744,501,493,475,367,524,367,524];function jo(e,t){let n=Ao[e.codePointAt(0)-ko];return n===void 0?void 0:n*t/1e3}var G={height:450,margin:40,legendRectSize:18,legendSpacing:4,textPosition:.75,outerStrokeWidth:2,titleFontSize:25,sectionFontSize:17,legendFontSize:17,fontWeight:400,paletteSize:12,highlightScale:1.05,minPercent:1},Mo=`"trebuchet ms", verdana, arial, sans-serif`,No=Math.PI*2;function Po(e,t,n){if(n!==void 0)return k(e,t,G.fontWeight);let r=0;for(let n of e)r+=jo(n,t)??k(n,t,G.fontWeight)-t*.15;return r}function K(e){return String(Math.round(e*100)/100)}function Fo(e,t,n,r){return{x:e+n*Math.sin(r),y:t-n*Math.cos(r)}}function Io(e,t,n,r,i,a=0){if(i-r>=No-1e-9){let r=(n,r)=>`M${K(e)},${K(t-n)}A${K(n)},${K(n)},0,1,${r},${K(e)},${K(t+n)}A${K(n)},${K(n)},0,1,${r},${K(e)},${K(t-n)}`;return r(n,1)+(a>0?r(a,0):``)+`Z`}let o=Fo(e,t,n,r),s=Fo(e,t,n,i),c=+(i-r>Math.PI),l=`M${K(o.x)},${K(o.y)}A${K(n)},${K(n)},0,${c},1,${K(s.x)},${K(s.y)}`;if(a<=0)return`${l}L${K(e)},${K(t)}Z`;let u=Fo(e,t,a,i),d=Fo(e,t,a,r);return`${l}L${K(u.x)},${K(u.y)}A${K(a)},${K(a)},0,${c},0,${K(d.x)},${K(d.y)}Z`}function Lo(e,t,n){return n?`${e} [${String(t)}]`:e}function Ro(e,t={}){let n=G.height,r=n,i=Math.min(r,n)/2-G.margin,a=r/2,o=n/2,s=e.slices.reduce((e,t)=>e+t.value,0),c=e.slices.map((e,t)=>({slice:e,colorIndex:t%G.paletteSize})).filter(({slice:e})=>e.value/s*100>=G.minPercent),l=c.reduce((e,t)=>e+t.slice.value,0),u=G.legendRectSize+G.legendSpacing,d=e.slices.length,f=d>0?e.legendPosition??`right`:`right`,p=e.slices.map(t=>Lo(t.label,t.value,e.showData)),m=Math.max(0,...p.map(e=>Po(e,G.legendFontSize,t.font))),h=G.legendRectSize+G.legendSpacing,g=u*d,_=f===`left`?m+h:0,v=f===`top`?g+u:0,y=a-m/2-h,b=o-g/2,x={right:{x:a+12*G.legendRectSize,y:b},left:{x:a-i-h,y:b},center:{x:y,y:b},top:{x:y,y:o-i},bottom:{x:y,y:o+i+u}}[f],S=h+m,C=d===0?-1/0:f===`left`||f===`right`?r+G.margin+S:r+G.margin,w=f===`top`||f===`bottom`?n+g:n,T=e.title??``,E=T.length>0?Po(T,G.titleFontSize,t.font):0,D=a-E/2,O=a+E/2,k=Math.min(0,D),A=Math.max(C,O),j=w,M=-k,N=a+_+M,P=o+v+-0,F=[],ee=0,te=e.donutHole??0,ne=te>0&&te<=.9?te*i:0,I=i*(e.textPosition??G.textPosition);for(let{slice:t,colorIndex:n}of c){let r=ee,a=ee+t.value/l*No;ee=a;let o=Fo(N,P,I,(r+a)/2),c=e.highlightSlice!==void 0&&e.highlightSlice!==`hover`&&e.highlightSlice!==``&&e.highlightSlice===t.label,u=c?G.highlightScale:1;F.push({label:t.label,value:t.value,colorIndex:n,startAngle:r,endAngle:a,path:Io(N,P,i*u,r,a,ne*u),percentText:`${(t.value/s*100).toFixed(0)}%`,labelX:o.x,labelY:o.y,...c?{highlighted:c}:{}})}let L=p.map((e,t)=>{let n=x.x+M,r=x.y+t*u+-0;return{text:e,colorIndex:t%G.paletteSize,x:n,y:r,size:G.legendRectSize,textX:n+G.legendRectSize+G.legendSpacing,textY:r+G.legendRectSize-G.legendSpacing}});return{width:Math.ceil(A-k),height:Math.ceil(j-0),cx:N,cy:P,radius:i,outerRadius:i+G.outerStrokeWidth/2,title:T.length>0?{text:T,x:a+M,y:o+-0-(n-50)/2}:void 0,slices:F,legend:L,accTitle:e.accTitle,accDescr:e.accDescr,sliceColors:e.sliceColors}}function zo(e){return String(Math.round(e*100)/100)}function Bo(e,n,r){return e===0?`var(--accent, ${t.CHART_ACCENT_FALLBACK})`:(0,t.getSeriesColor)(e,n??t.CHART_ACCENT_FALLBACK,r)}var Vo=[`#ECECFF`,`#ffffde`,`hsl(80, 100%, 56.2745098039%)`,`hsl(240, 100%, 86.2745098039%)`,`hsl(60, 100%, 63.5294117647%)`,`hsl(80, 100%, 76.2745098039%)`,`hsl(300, 100%, 76.2745098039%)`,`hsl(180, 100%, 56.2745098039%)`,`hsl(0, 100%, 56.2745098039%)`,`hsl(300, 100%, 56.2745098039%)`,`hsl(150, 100%, 56.2745098039%)`,`hsl(0, 100%, 66.2745098039%)`];function Ho(e,n){return(0,t.isValidHex)(n.bg)&&(0,t.isDarkBackground)(n.bg)?Bo(e,n.accent,n.bg):Vo[e%Vo.length]}function Uo(t,n,r,i){let a=new Set;for(let e of t.slices)a.add(e.colorIndex);for(let e of t.legend)a.add(e.colorIndex);let o=[...a].sort((e,t)=>e-t),s=o.map(e=>` --pie-color-${e}: ${t.sliceColors?.[e]??Ho(e,n)};`),c=o.map(e=>` .pie-color-${e} { fill: var(--pie-color-${e}); }\n rect.pie-color-${e} { stroke: var(--pie-color-${e}); }`),l=t.slices.some(e=>e.highlighted)?`
93
+ .pie-slice.pie-highlight { opacity: 1; }`:``,u=(0,e.paletteClass)(s),d=s.length>0?`\n .${u} {\n${s.join(`
94
+ `)}\n }`:``,f=i?` font-family: ${i};`:``;return{css:`${(0,e.styleOpenTag)(r)}
95
+ .pie-outer { fill: none; stroke: var(--fg); stroke-width: ${G.outerStrokeWidth}px; }
96
+ .pie-slice { stroke: var(--fg); stroke-width: 2px; opacity: 0.7; }${l}
97
+ .pie-slice-label { fill: var(--_text);${f} font-size: ${G.sectionFontSize}px; font-weight: ${G.fontWeight}; }
98
+ .pie-title { fill: var(--_text);${f} font-size: ${G.titleFontSize}px; font-weight: ${G.fontWeight}; }
99
+ .pie-legend-text { fill: var(--_text);${f} font-size: ${G.legendFontSize}px; font-weight: ${G.fontWeight}; }${d}
100
+ ${c.join(`
98
101
  `)}
99
- </style>`,cls:l}}function Eo(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[],{css:u,cls:d}=To(t,n,c.nonce);l.push(R((0,e.withRootClass)((0,e.svgOpenTag)(t.width,t.height,n,i,o??t.accTitle,s,void 0,c.styleAttribute,t.accDescr),d),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(u),l.push(`<circle cx="${Co(t.cx)}" cy="${Co(t.cy)}" r="${Co(t.outerRadius)}" class="pie-outer"/>`);for(let n of t.slices)l.push(`<path d="${n.path}" class="pie-slice${n.highlighted?` pie-highlight`:``} pie-color-${n.colorIndex}" data-label="${(0,e.escapeAttr)(n.label)}" data-value="${n.value}"/>`);for(let n of t.slices)l.push(`<text x="${Co(n.labelX)}" y="${Co(n.labelY)}" text-anchor="middle" class="pie-slice-label">${(0,e.escapeXml)(n.percentText)}</text>`);t.title&&l.push(`<text x="${Co(t.title.x)}" y="${Co(t.title.y)}" text-anchor="middle" class="pie-title">${(0,e.escapeXml)(t.title.text)}</text>`);for(let n of t.legend)l.push(`<g class="pie-legend"><rect x="${Co(n.x)}" y="${Co(n.y)}" width="${n.size}" height="${n.size}" class="pie-legend-swatch pie-color-${n.colorIndex}"/><text x="${Co(n.textX)}" y="${Co(n.textY)}" class="pie-legend-text">${(0,e.escapeXml)(n.text)}</text></g>`);return l.push(`</svg>`),l.join(`
100
- `)}var Do={titlePadding:10,titleFontSize:20,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2,xAxisPosition:`top`,yAxisPosition:`left`,width:500,height:500,axisLabelPadding:5,axisLabelFontSize:16,internalBorderWidth:1,externalBorderWidth:2},Oo={chartWidth:500,chartHeight:500};function ko(e){return{anchor:`middle`,baseline:`hanging`,rotation:0,...e}}function Ao(e){let t={...Do,...Oo,...e.config},n=e.points.length>0,r=!!(e.xAxisLeft||e.xAxisRight),i=!!(e.yAxisBottom||e.yAxisTop),a=!!e.title,o=t.xAxisLabelPadding*2+t.xAxisLabelFontSize,s=t.yAxisLabelPadding*2+t.yAxisLabelFontSize,c=a?t.titleFontSize+t.titlePadding*2:0,l=!n&&t.xAxisPosition===`top`,u=l&&r?o:0,d=!l&&r?o:0,f=t.yAxisPosition===`left`&&i?s:0,p=t.yAxisPosition===`right`&&i?s:0,m=t.quadrantPadding+f,h=t.quadrantPadding+u+c,g=t.chartWidth-t.quadrantPadding*2-f-p,_=t.chartHeight-t.quadrantPadding*2-u-d-c,v=g/2,y=_/2,b=[[m+v,h],[m,h],[m,h+y],[m+v,h+y]].map(([r,i],a)=>({index:a,x:r,y:i,width:v,height:y,text:ko({text:e.quadrants[a],x:r+v/2,y:n?i+t.quadrantTextTopPadding:i+y/2,fontSize:t.quadrantLabelFontSize,baseline:n?`hanging`:`middle`})})),x=t.quadrantExternalBorderStrokeWidth/2,S=(e,n,r,i)=>({x1:e,y1:n,x2:r,y2:i,strokeWidth:t.quadrantExternalBorderStrokeWidth,kind:`external`}),C=(e,n,r,i)=>({x1:e,y1:n,x2:r,y2:i,strokeWidth:t.quadrantInternalBorderStrokeWidth,kind:`internal`}),w=[S(m-x,h,m+g+x,h),S(m+g,h+x,m+g,h+_-x),S(m-x,h+_,m+g+x,h+_),S(m,h+x,m,h+_-x),C(m+v,h+x,m+v,h+_-x),C(m+x,h+y,m+g-x,h+y)],T=[],E=l?t.xAxisLabelPadding+c:t.xAxisLabelPadding+h+_+t.quadrantPadding,D=!!e.xAxisRight,O=(e,n)=>T.push(ko({text:e,x:n,y:E,fontSize:t.xAxisLabelFontSize,anchor:D?`middle`:`start`}));r&&e.xAxisLeft&&O(e.xAxisLeft,m+(D?v/2:0)),r&&e.xAxisRight&&O(e.xAxisRight,m+v+v/2);let k=t.yAxisPosition===`left`?t.yAxisLabelPadding:t.yAxisLabelPadding+m+g+t.quadrantPadding,A=!!e.yAxisTop,j=(e,n)=>T.push(ko({text:e,x:k,y:n,fontSize:t.yAxisLabelFontSize,anchor:A?`middle`:`start`,rotation:-90}));i&&e.yAxisBottom&&j(e.yAxisBottom,h+_-(A?y/2:0)),i&&e.yAxisTop&&j(e.yAxisTop,h+y-y/2);let ee=[...e.points].reverse().map(e=>{let n=m+e.x*g,r=h+_-e.y*_;return{x:n,y:r,radius:e.radius??t.pointRadius,color:e.color,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth??`0px`,text:ko({text:e.label,x:n,y:r+t.pointTextPadding,fontSize:t.pointLabelFontSize})}});return{width:t.chartWidth,height:t.chartHeight,themeColors:e.themeColors,title:a?ko({text:e.title,x:t.chartWidth/2,y:t.titlePadding,fontSize:t.titleFontSize}):void 0,quadrants:b,lines:w,axisLabels:T,points:ee}}function jo(e){return String(Math.round(e*100)/100)}var Mo=[14,10,6,3];function No(n,r){let i=`var(--accent, ${t.CHART_ACCENT_FALLBACK})`,a=`color-mix(in srgb, ${i} 35%, var(--bg))`,o=Mo.map((e,t)=>` .quadrant-cell-${t} { fill: color-mix(in srgb, ${i} ${e}%, var(--bg)); }`),s=n.points.flatMap((e,t)=>{let n=[e.color&&`fill: ${e.color};`,e.strokeColor&&`stroke: ${e.strokeColor};`,e.strokeWidth!==`0px`&&`stroke-width: ${e.strokeWidth};`].filter(Boolean);return n.length>0?[` .quadrant-point-${t} { ${n.join(` `)} }`]:[]}),c=n.themeColors??{},l=[...[1,2,3,4].flatMap(e=>[c[`quadrant${e}Fill`]&&` .quadrant-cell-${e-1} { fill: ${c[`quadrant${e}Fill`]}; }`,c[`quadrant${e}TextFill`]&&` .quadrant:nth-child(${e}) .quadrant-label { fill: ${c[`quadrant${e}TextFill`]}; }`]),c.quadrantPointFill&&` .quadrant-point { fill: ${c.quadrantPointFill}; stroke: ${c.quadrantPointFill}; }`,c.quadrantPointTextFill&&` .quadrant-point-label { fill: ${c.quadrantPointTextFill}; }`,c.quadrantXAxisTextFill&&` .quadrant-axis-label[transform$="rotate(0)"] { fill: ${c.quadrantXAxisTextFill}; }`,c.quadrantYAxisTextFill&&` .quadrant-axis-label[transform$="rotate(-90)"] { fill: ${c.quadrantYAxisTextFill}; }`,c.quadrantTitleFill&&` .quadrant-title { fill: ${c.quadrantTitleFill}; }`,c.quadrantInternalBorderStrokeFill&&` .quadrant-line-internal { stroke: ${c.quadrantInternalBorderStrokeFill}; }`,c.quadrantExternalBorderStrokeFill&&` .quadrant-line-external { stroke: ${c.quadrantExternalBorderStrokeFill}; }`].filter(Boolean);return`${(0,e.styleOpenTag)(r)}
101
- ${o.join(`
102
+ </style>`,cls:u}}function Wo(t,n,r,i=!1,a,o,s,c={}){let l=[],{css:u,cls:d}=Uo(t,n,c.nonce,r===void 0?Mo:void 0);l.push(z((0,e.withRootClass)((0,e.svgOpenTag)(t.width,t.height,n,i,o??t.accTitle,s,void 0,c.styleAttribute,t.accDescr),d),a)),l.push((0,e.buildStyleBlock)(r??`sans-serif`,!1,c.nonce,c.bodyFont)),l.push(u),l.push(`<circle cx="${zo(t.cx)}" cy="${zo(t.cy)}" r="${zo(t.outerRadius)}" class="pie-outer"/>`);for(let n of t.slices)l.push(`<path d="${n.path}" class="pie-slice${n.highlighted?` pie-highlight`:``} pie-color-${n.colorIndex}" data-label="${(0,e.escapeAttr)(n.label)}" data-value="${n.value}"/>`);for(let n of t.slices)l.push(`<text x="${zo(n.labelX)}" y="${zo(n.labelY)}" text-anchor="middle" class="pie-slice-label">${(0,e.escapeXml)(n.percentText)}</text>`);t.title&&l.push(`<text x="${zo(t.title.x)}" y="${zo(t.title.y)}" text-anchor="middle" class="pie-title">${(0,e.escapeXml)(t.title.text)}</text>`);for(let n of t.legend)l.push(`<g class="pie-legend"><rect x="${zo(n.x)}" y="${zo(n.y)}" width="${n.size}" height="${n.size}" class="pie-legend-swatch pie-color-${n.colorIndex}"/><text x="${zo(n.textX)}" y="${zo(n.textY)}" class="pie-legend-text">${(0,e.escapeXml)(n.text)}</text></g>`);return l.push(`</svg>`),l.join(`
103
+ `)}var Go={titlePadding:10,titleFontSize:20,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2,xAxisPosition:`top`,yAxisPosition:`left`,width:500,height:500,axisLabelPadding:5,axisLabelFontSize:16,internalBorderWidth:1,externalBorderWidth:2},Ko={chartWidth:500,chartHeight:500};function qo(e){return{anchor:`middle`,baseline:`hanging`,rotation:0,...e}}function Jo(e){let t={...Go,...Ko,...e.config},n=e.points.length>0,r=!!(e.xAxisLeft||e.xAxisRight),i=!!(e.yAxisBottom||e.yAxisTop),a=!!e.title,o=t.xAxisLabelPadding*2+t.xAxisLabelFontSize,s=t.yAxisLabelPadding*2+t.yAxisLabelFontSize,c=a?t.titleFontSize+t.titlePadding*2:0,l=!n&&t.xAxisPosition===`top`,u=l&&r?o:0,d=!l&&r?o:0,f=t.yAxisPosition===`left`&&i?s:0,p=t.yAxisPosition===`right`&&i?s:0,m=t.quadrantPadding+f,h=t.quadrantPadding+u+c,g=t.chartWidth-t.quadrantPadding*2-f-p,_=t.chartHeight-t.quadrantPadding*2-u-d-c,v=g/2,y=_/2,b=[[m+v,h],[m,h],[m,h+y],[m+v,h+y]].map(([r,i],a)=>({index:a,x:r,y:i,width:v,height:y,text:qo({text:e.quadrants[a],x:r+v/2,y:n?i+t.quadrantTextTopPadding:i+y/2,fontSize:t.quadrantLabelFontSize,baseline:n?`hanging`:`middle`})})),x=t.quadrantExternalBorderStrokeWidth/2,S=(e,n,r,i)=>({x1:e,y1:n,x2:r,y2:i,strokeWidth:t.quadrantExternalBorderStrokeWidth,kind:`external`}),C=(e,n,r,i)=>({x1:e,y1:n,x2:r,y2:i,strokeWidth:t.quadrantInternalBorderStrokeWidth,kind:`internal`}),w=[S(m-x,h,m+g+x,h),S(m+g,h+x,m+g,h+_-x),S(m-x,h+_,m+g+x,h+_),S(m,h+x,m,h+_-x),C(m+v,h+x,m+v,h+_-x),C(m+x,h+y,m+g-x,h+y)],T=[],E=l?t.xAxisLabelPadding+c:t.xAxisLabelPadding+h+_+t.quadrantPadding,D=!!e.xAxisRight,O=(e,n)=>T.push(qo({text:e,x:n,y:E,fontSize:t.xAxisLabelFontSize,anchor:D?`middle`:`start`}));r&&e.xAxisLeft&&O(e.xAxisLeft,m+(D?v/2:0)),r&&e.xAxisRight&&O(e.xAxisRight,m+v+v/2);let k=t.yAxisPosition===`left`?t.yAxisLabelPadding:t.yAxisLabelPadding+m+g+t.quadrantPadding,A=!!e.yAxisTop,j=(e,n)=>T.push(qo({text:e,x:k,y:n,fontSize:t.yAxisLabelFontSize,anchor:A?`middle`:`start`,rotation:-90}));i&&e.yAxisBottom&&j(e.yAxisBottom,h+_-(A?y/2:0)),i&&e.yAxisTop&&j(e.yAxisTop,h+y-y/2);let M=[...e.points].reverse().map(e=>{let n=m+e.x*g,r=h+_-e.y*_;return{x:n,y:r,radius:e.radius??t.pointRadius,color:e.color,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth??`0px`,text:qo({text:e.label,x:n,y:r+t.pointTextPadding,fontSize:t.pointLabelFontSize})}});return{width:t.chartWidth,height:t.chartHeight,themeColors:e.themeColors,title:a?qo({text:e.title,x:t.chartWidth/2,y:t.titlePadding,fontSize:t.titleFontSize}):void 0,quadrants:b,lines:w,axisLabels:T,points:M}}function Yo(e){return String(Math.round(e*100)/100)}var Xo=[14,10,6,3],Zo=[`#ECECFF`,`#f1f1ff`,`#f6f6ff`,`#fbfbff`],Qo=[`#131300`,`#0e0e00`,`#090900`,`#040400`],$o=`#c7c7f1`;function es(e){let t=/^#([0-9a-f]{6})$/i.exec(e);if(!t)return!0;let n=parseInt(t[1],16);return((n>>16)*299+(n>>8&255)*587+(n&255)*114)/1e3>128}function ts(n,r,i){let a=!r.accent&&es(r.bg),o=`var(--accent, ${t.CHART_ACCENT_FALLBACK})`,s=a?$o:`color-mix(in srgb, ${o} 35%, var(--bg))`,c=Xo.map((e,t)=>` .quadrant-cell-${t} { fill: ${a?Zo[t]:`color-mix(in srgb, ${o} ${e}%, var(--bg))`}; }`+(a?`\n .quadrant:nth-child(${t+1}) .quadrant-label { fill: ${Qo[t]}; }`:``)),l=n.points.flatMap((e,t)=>{let n=[e.color&&`fill: ${e.color};`,e.strokeColor&&`stroke: ${e.strokeColor};`,e.strokeWidth!==`0px`&&`stroke-width: ${e.strokeWidth};`].filter(Boolean);return n.length>0?[` .quadrant-point-${t} { ${n.join(` `)} }`]:[]}),u=n.themeColors??{},d=[...[1,2,3,4].flatMap(e=>[u[`quadrant${e}Fill`]&&` .quadrant-cell-${e-1} { fill: ${u[`quadrant${e}Fill`]}; }`,u[`quadrant${e}TextFill`]&&` .quadrant:nth-child(${e}) .quadrant-label { fill: ${u[`quadrant${e}TextFill`]}; }`]),u.quadrantPointFill&&` .quadrant-point { fill: ${u.quadrantPointFill}; stroke: ${u.quadrantPointFill}; }`,u.quadrantPointTextFill&&` .quadrant-point-label { fill: ${u.quadrantPointTextFill}; }`,u.quadrantXAxisTextFill&&` .quadrant-axis-label[transform$="rotate(0)"] { fill: ${u.quadrantXAxisTextFill}; }`,u.quadrantYAxisTextFill&&` .quadrant-axis-label[transform$="rotate(-90)"] { fill: ${u.quadrantYAxisTextFill}; }`,u.quadrantTitleFill&&` .quadrant-title { fill: ${u.quadrantTitleFill}; }`,u.quadrantInternalBorderStrokeFill&&` .quadrant-line-internal { stroke: ${u.quadrantInternalBorderStrokeFill}; }`,u.quadrantExternalBorderStrokeFill&&` .quadrant-line-external { stroke: ${u.quadrantExternalBorderStrokeFill}; }`].filter(Boolean);return`${(0,e.styleOpenTag)(i)}
104
+ ${c.join(`
102
105
  `)}
103
- .quadrant-line { stroke: ${a}; }
106
+ .quadrant-line { stroke: ${s}; }
104
107
  .quadrant-text { fill: var(--_text); }
105
- .quadrant-point { fill: var(--fg); stroke: var(--fg); stroke-width: 0px; }${[...l,...s].map(e=>`
108
+ .quadrant-point { fill: var(--fg); stroke: var(--fg); stroke-width: 0px; }${[...d,...l].map(e=>`
106
109
  `+e).join(``)}
107
- </style>`}function Po(t,n){return`<text x="0" y="0" class="quadrant-text ${n}" font-size="${t.fontSize}" dominant-baseline="${t.baseline}" text-anchor="${t.anchor}" transform="translate(${jo(t.x)}, ${jo(t.y)}) rotate(${t.rotation})">${(0,e.escapeXml)(t.text)}</text>`}function Fo(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[];l.push(R((0,e.svgOpenTag)(t.width,t.height,n,i,o,s,void 0,c.styleAttribute,c.description),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(No(t,c.nonce)),l.push(`<g class="quadrants">`);for(let e of t.quadrants)l.push(`<g class="quadrant"><rect x="${jo(e.x)}" y="${jo(e.y)}" width="${jo(e.width)}" height="${jo(e.height)}" class="quadrant-cell-${e.index}"/>${Po(e.text,`quadrant-label`)}</g>`);l.push(`</g>`),l.push(`<g class="border">`);for(let e of t.lines)l.push(`<line x1="${jo(e.x1)}" y1="${jo(e.y1)}" x2="${jo(e.x2)}" y2="${jo(e.y2)}" stroke-width="${e.strokeWidth}" class="quadrant-line quadrant-line-${e.kind}"/>`);l.push(`</g>`),l.push(`<g class="data-points">`),t.points.forEach((e,t)=>{let n=e.color||e.strokeColor||e.strokeWidth!==`0px`?` quadrant-point-${t}`:``;l.push(`<g class="data-point"><circle cx="${jo(e.x)}" cy="${jo(e.y)}" r="${e.radius}" class="quadrant-point${n}"/>${Po(e.text,`quadrant-point-label`)}</g>`)}),l.push(`</g>`),l.push(`<g class="labels">`);for(let e of t.axisLabels)l.push(`<g class="label">${Po(e,`quadrant-axis-label`)}</g>`);return l.push(`</g>`),l.push(`<g class="title">`),t.title&&l.push(Po(t.title,`quadrant-title`)),l.push(`</g>`),l.push(`</svg>`),l.join(`
108
- `)}var Io=4500,Lo=50,Ro=.45,zo=2500,Bo=300,Vo=Lo/10,Ho=100,Uo=10,Wo=150/100,Go=15,Ko=1200,qo=900,Jo=Lo,Yo=2*Math.PI,Xo=-2147483648,Zo=2147483647,Qo=e=>e.x+e.width/2,$o=e=>e.y+e.height/2,K=e=>e.x+e.width,es=e=>e.y+e.height,ts=e=>e>0?1:e<0?-1:0,ns=(e,t)=>e.source===t?e.target:e.source;function rs(e){let t=new Set;for(let n of e.edges)t.add(n.source===e?n.target:n.source);return t}function is(e,t){return!(K(e)<t.x||es(e)<t.y||K(t)<e.x||es(t)<e.y)}function as(e,t,n){return e>t?n:1+n%4}function os(e,t,n){let r=Qo(e),i=$o(e),a=Qo(t),o=$o(t);if(is(e,t))return n.x0=r,n.y0=i,n.x1=a,n.y1=o,!0;let s=e.x,c=e.y,l=K(e),u=e.x,d=es(e),f=K(e),p=e.width/2,m=e.height/2,h=t.x,g=t.y,_=K(t),v=t.x,y=es(t),b=K(t),x=t.width/2,S=t.height/2,C=!1,w=!1;if(r===a){if(i>o)return n.x0=r,n.y0=c,n.x1=a,n.y1=y,!1;if(i<o)return n.x0=r,n.y0=d,n.x1=a,n.y1=g,!1}else if(i===o){if(r>a)return n.x0=s,n.y0=i,n.x1=_,n.y1=o,!1;if(r<a)return n.x0=l,n.y0=i,n.x1=h,n.y1=o,!1}else{let T=e.height/e.width,E=t.height/t.width,D=(o-i)/(a-r);if(-T===D?(r>a?(n.x0=u,n.y0=d):(n.x0=l,n.y0=c),C=!0):T===D&&(r>a?(n.x0=s,n.y0=c):(n.x0=f,n.y0=d),C=!0),-E===D?(a>r?(n.x1=v,n.y1=y):(n.x1=_,n.y1=g),w=!0):E===D&&(a>r?(n.x1=h,n.y1=g):(n.x1=b,n.y1=y),w=!0),C&&w)return!1;let O,k;if(r>a?i>o?(O=as(T,D,4),k=as(E,D,2)):(O=as(-T,D,3),k=as(-E,D,1)):i>o?(O=as(-T,D,1),k=as(-E,D,3)):(O=as(T,D,2),k=as(E,D,4)),!C)switch(O){case 1:n.y0=c,n.x0=r+-m/D;break;case 2:n.x0=f,n.y0=i+p*D;break;case 3:n.y0=d,n.x0=r+m/D;break;case 4:n.x0=u,n.y0=i+-p*D}if(!w)switch(k){case 1:n.y1=g,n.x1=a+-S/D;break;case 2:n.x1=b,n.y1=o+x*D;break;case 3:n.y1=y,n.x1=a+S/D;break;case 4:n.x1=v,n.y1=o+-x*D}}return!1}function ss(e,t,n){let r=Qo(e)<Qo(t)?-1:1,i=$o(e)<$o(t)?-1:1,a=Math.min(K(e),K(t))-Math.max(e.x,t.x),o=Math.min(es(e),es(t))-Math.max(e.y,t.y);e.x<=t.x&&K(e)>=K(t)?a+=Math.min(t.x-e.x,K(e)-K(t)):t.x<=e.x&&K(t)>=K(e)&&(a+=Math.min(e.x-t.x,K(t)-K(e))),e.y<=t.y&&es(e)>=es(t)?o+=Math.min(t.y-e.y,es(e)-es(t)):t.y<=e.y&&es(t)>=es(e)&&(o+=Math.min(e.y-t.y,es(t)-es(e)));let s=Math.abs(($o(t)-$o(e))/(Qo(t)-Qo(e)));$o(t)===$o(e)&&Qo(t)===Qo(e)&&(s=1);let c=s*a,l=o/s;return a<l?l=a:c=o,{x:-1*r*(l/2+n),y:-1*i*(c/2+n)}}function cs(e){let t=e.slice(),n=[],r=new Map,i;(t.length===1||t.length===2)&&(i=t[0]);for(let e of t){let t=rs(e).size;r.set(e,t),t===1&&n.push(e)}let a=n.slice();for(;i===void 0;){a=[];for(let e=0;e<t.length;e++){let i=t[e];if(i===void 0)break;let o=t.indexOf(i);o>=0&&t.splice(o,1);for(let e of rs(i))if(n.indexOf(e)<0){let t=(r.get(e)??0)-1;t===1&&a.push(e),r.set(e,t)}}n=n.concat(a),(t.length===1||t.length===2)&&(i=t[0])}return i}function ls(e,t,n,r,i,a){let o=(r-n+1)/2;o<0&&(o+=180);let s=(o+n)%360*Yo/360,c=i*Math.cos(s),l=i*Math.sin(s);e.x=c-e.width/2,e.y=l-e.height/2;let u=e.edges.slice(),d=u.length;t!==null&&d--;let f=u.length,p=0;if(t!==null){let e=u.find(e=>e.source===t||e.target===t);p=e===void 0?0:(u.indexOf(e)+1)%f}let m=Math.abs(r-n)/d,h=0;for(let r=p;h!==d;r=(r+1)%f){let o=u[r];if(o===void 0)break;let s=ns(o,e);if(s===t)continue;let c=(n+h*m)%360;ls(s,e,c,(c+m)%360,i+a,a),h++}}function us(e){let t=Zo,n=-2147483647,r=Zo,i=-2147483647;for(let a of e)t>a.x&&(t=a.x),n<K(a)&&(n=K(a)),r>a.y&&(r=a.y),i<es(a)&&(i=es(a));return{x:t,y:r,width:n-t,height:i-r}}function ds(e,t,n){let r=Zo,i=Zo;for(let t of e)r>t.y&&(r=t.y),i>t.x&&(i=t.x);let a=i-Go,o=r-Go;for(let r of e)r.x=t+(r.x-a),r.y=n+(r.y-o)}function fs(e){let t=cs(e),n=Xo;for(let t of e){let e=Math.sqrt(t.width*t.width+t.height*t.height);e>n&&(n=e)}ls(t,null,0,359,0,Math.max(n,Jo));let r=us(e);for(let t of e)t.x=0+(t.x-r.x),t.y=0+(t.y-r.y);let i=0+(r.x+r.width-r.x),a=0+(r.y+r.height-r.y);ds(e,Ko-i/2,qo-a/2)}function ps(e,t,n){let r=e[t]?.[n];if(r===void 0)throw Error(`cose-bilkent: grid index out of range`);return r}function ms(e){let t=Zo,n=-2147483647,r=Zo,i=-2147483647;for(let a of e.nodes)t>a.x&&(t=a.x),n<K(a)&&(n=K(a)),r>a.y&&(r=a.y),i<es(a)&&(i=es(a));let a=t,o=r,s=n-t,c=i-r,l=a-Go,u=a+s+Go,d=o-Go,f=o+c+Go,p=e.repulsionRange,m=Math.ceil((u-l)/p),h=Math.ceil((f-d)/p),g=[];for(let e=0;e<m;e++){let e=[];for(let t=0;t<h;t++)e.push([]);g.push(e)}e.grid=g;for(let t of e.nodes){let e=Math.floor((t.x-l)/p),n=Math.floor((t.width+t.x-l)/p),r=Math.floor((t.y-d)/p),i=Math.floor((t.height+t.y-d)/p);for(let a=e;a<=n;a++)for(let o=r;o<=i;o++)ps(g,a,o).push(t),t.startX=e,t.finishX=n,t.startY=r,t.finishY=i}}function hs(e,t){e.overlapping=os(e.target,e.source,t),e.overlapping||(e.lengthX=t.x0-t.x1,e.lengthY=t.y0-t.y1,Math.abs(e.lengthX)<1&&(e.lengthX=ts(e.lengthX)),Math.abs(e.lengthY)<1&&(e.lengthY=ts(e.lengthY)),e.length=Math.sqrt(e.lengthX*e.lengthX+e.lengthY*e.lengthY))}function gs(e,t){for(let n of e.edges){if(hs(n,t),n.overlapping)continue;let e=n.length;if(e===0)continue;let r=Ro*(e-Lo),i=r*(n.lengthX/e),a=r*(n.lengthY/e);n.source.springForceX+=i,n.source.springForceY+=a,n.target.springForceX-=i,n.target.springForceY-=a}}function _s(e,t,n){if(is(e,t)){let n=ss(e,t,Lo/2),r=2*n.x,i=2*n.y,a=1/2;e.repulsionForceX-=a*r,e.repulsionForceY-=a*i,t.repulsionForceX+=a*r,t.repulsionForceY+=a*i}else{os(e,t,n);let r=n.x1-n.x0,i=n.y1-n.y0;Math.abs(r)<Vo&&(r=ts(r)*Vo),Math.abs(i)<Vo&&(i=ts(i)*Vo);let a=r*r+i*i,o=Math.sqrt(a),s=Io*1*1/a,c=s*r/o,l=s*i/o;e.repulsionForceX-=c,e.repulsionForceY-=l,t.repulsionForceX+=c,t.repulsionForceY+=l}}function vs(e,t,n){let r=t%Uo===1;r&&ms(e);let i=new Set;for(let t of e.nodes){if(r){let n=new Set,r=e.grid;for(let a=t.startX-1;a<t.finishX+2;a++)for(let o=t.startY-1;o<t.finishY+2;o++){let s=r[a],c=s===void 0?void 0:s[o];if(!(a<0||o<0||c===void 0)){for(let r of c)if(t!==r&&!i.has(r)&&!n.has(r)){let i=Math.abs(Qo(t)-Qo(r))-(t.width/2+r.width/2),a=Math.abs($o(t)-$o(r))-(t.height/2+r.height/2);i<=e.repulsionRange&&a<=e.repulsionRange&&n.add(r)}}}t.surrounding=[...n]}for(let e of t.surrounding)_s(t,e,n);i.add(t)}}var ys=[1,2.6721379557162637,4.74848763464932,7.140321254379494,9.797958971132713,12.688614040795791,15.788627053658772,19.07992343983501,22.548134816417495,26.181498055314396,29.970162105620904,33.905727183844746,37.98092508439659,42.189389618730246,46.52548701922506,50.984187615743544,55.56096674434149,60.25172687355656,65.05273546109957,69.96057469111715,74.9721003323884,80.08440770139889,85.29480323234884,90.60078052411225,96.00000000000003];function bs(e,t){return ys[e-1]??e**+t}function xs(e,t){let n=0,r=t*Bo;for(let i of e){let e=t*(i.springForceX+i.repulsionForceX)/1,a=t*(i.springForceY+i.repulsionForceY)/1;Math.abs(e)>r&&(e=r*ts(e)),Math.abs(a)>r&&(a=r*ts(a)),i.x+=e,i.y+=a,n+=Math.abs(e)+Math.abs(a),i.springForceX=0,i.springForceY=0,i.repulsionForceX=0,i.repulsionForceY=0}return n}function Ss(e,t){let n=new Map;if(e.length===0)return n;let r=new Map,i=e.map(e=>{let t={id:e.id,x:0-e.width/2,y:0-e.height/2,width:e.width,height:e.height,edges:[],springForceX:0,springForceY:0,repulsionForceX:0,repulsionForceY:0,startX:0,finishX:0,startY:0,finishY:0,surrounding:[]};return r.set(e.id,t),t}),a=[];for(let e of t){let t=r.get(e.source),n=r.get(e.target);if(t===void 0||n===void 0)throw Error(`cose-bilkent: edge ${e.source}->${e.target} references an unknown node`);if(t===n||t.edges.some(e=>e.source===n||e.target===n))continue;let i={source:t,target:n,lengthX:0,lengthY:0,length:0,overlapping:!1};t.edges.push(i),n.edges.push(i),a.push(i)}let o=i[0];if(o===void 0)return n;let s=new Set,c=new Map,l=[o];for(;l.length>0;){let e=l.shift();if(e===void 0)break;s.add(e);for(let t of e.edges){let n=ns(t,e);if(c.get(e)!==n){if(s.has(n))throw Error(`cose-bilkent: input graph contains a cycle`);l.push(n),c.set(n,e)}}}if(s.size!==i.length)throw Error(`cose-bilkent: input graph must be a single tree`);fs([...s]);let u=i.length,d=Math.max(u*5,zo),f=Wo*u,p=zo/Ho,m=Ho/zo,h={nodes:i,edges:a,repulsionRange:100,grid:[]},g={x0:0,y0:0,x1:0,y1:0},_=1,v=0,y=0,b=0,x=0;for(;y++,y!==d;){if(y%Ho===0){let e=!1;y>d/3&&(e=Math.abs(b-x)<2);let t=b<f;if(x=b,t||e)break;v++,_=Math.max(1-bs(v,Math.log(96)/Math.log(p))/100*1,m)}gs(h,g),vs(h,y,g),b=xs(i,_)}ds(i,0,0);for(let e of i)n.set(e.id,{x:e.x+e.width/2,y:e.y+e.height/2});return n}var Cs={padding:10,maxNodeWidth:200,fontSize:16,lineHeight:24,sections:11,edgeInset:15,cornerRadius:5},ws=e=>String(Math.round(e*1e4)/1e4),Ts=e=>k(e.text,Cs.fontSize,e.bold?700:400);function Es(e,t=Ts){return e.reduce((e,n)=>e+t(n),0)}var Ds=`\\p{Script=Han}\\p{Script=Hiragana}\\p{Script=Katakana}`,Os=RegExp(`(?<=[\\p{L}\\p{N}]-)(?=\\p{L})|(?<=[${Ds}])(?![,。!?、;:)」』】])(?=\\S)|(?<=\\S)(?<![(「『【])(?=[${Ds}])`,`gu`);function ks(e){let t=e.map(e=>e.text).join(``),n=new Set([...t.matchAll(Os)].map(e=>e.index)),r=[[]],i=0;for(let t of e){let e=0;for(let a=1;a<t.text.length;a++)n.has(i+a)&&(r[r.length-1].push({...t,text:t.text.slice(e,a)}),r.push([]),e=a);r[r.length-1].push({...t,text:t.text.slice(e)}),i+=t.text.length,n.has(i)&&r.push([])}return r.filter(e=>e.length>0)}function As(e){let t=e.map(e=>({...e}));for(;t.length>0&&t[0].text.trimStart()===``;)t.shift();for(;t.length>0&&t.at(-1).text.trimEnd()===``;)t.pop();return t.length>0&&(t[0].text=t[0].text.trimStart(),t.at(-1).text=t.at(-1).text.trimEnd()),t}function js(e,t,n,r){let i=e.flatMap(e=>(e.text.match(/\s+|\S+/g)??[]).map(t=>({...e,text:t}))),a=e=>/^\s/.test(e.text),o=[[]],s=0;for(let e=0;e<i.length;){if(a(i[e])){o[o.length-1].push(i[e]),s+=n(i[e]),e++;continue}let c=[];for(;e<i.length&&!a(i[e]);)c.push(i[e++]);let l=r?ks(c):[c];l.forEach((c,u)=>{let d=Es(c,n),f=u===l.length-1,p=d+(r&&f&&e<i.length?n(i[e]):0),m=o[o.length-1];s+p>t&&m.some(e=>!a(e))&&(o.push([]),s=0),o[o.length-1].push(...c),s+=d})}return o}function Ms(e,n=Cs.maxNodeWidth,r=Ts,i=!1){let a=(0,t.mindmapLabelLines)(e),o=Math.max(...a.map(e=>Es(e,r)));if(o<n)return{lines:a,width:o,height:a.length*Cs.lineHeight};let s=a.flatMap(e=>js(e,n,r,i)),c=i?Math.max(...s.map(e=>Es(As(e),r))):0;return{lines:s,width:Math.max(n,c),height:s.length*Cs.lineHeight}}function Ns(e,t,n,r,i,a,o,s,c,l){let u=(e,t)=>{l.minX=Math.min(l.minX,e),l.maxX=Math.max(l.maxX,e),l.minY=Math.min(l.minY,t),l.maxY=Math.max(l.maxY,t)};u(s,c);let d=Math.abs(n),f=Math.abs(r);if(d===0||f===0||e===s&&t===c)return;let p=i*Math.PI/180,m=Math.cos(p),h=Math.sin(p),g=(e-s)/2,_=(t-c)/2,v=m*g+h*_,y=-h*g+m*_,b=v*v/(d*d)+y*y/(f*f);if(b>1){let e=Math.sqrt(b);d*=e,f*=e}let x=d*d*f*f-d*d*y*y-f*f*v*v,S=d*d*y*y+f*f*v*v,C=(a===o?-1:1)*Math.sqrt(Math.max(0,x/S)),w=C*d*y/f,T=-C*f*v/d,E=m*w-h*T+(e+s)/2,D=h*w+m*T+(t+c)/2,O=(e,t,n,r)=>Math.atan2(e*r-t*n,e*n+t*r),k=O(1,0,(v-w)/d,(y-T)/f),A=O((v-w)/d,(y-T)/f,(-v-w)/d,(-y-T)/f);!o&&A>0?A-=2*Math.PI:o&&A<0&&(A+=2*Math.PI);let j=Math.atan2(-f*h,d*m),ee=Math.atan2(f*m,d*h);for(let e of[j,j+Math.PI,ee,ee+Math.PI]){let t=e,n=Math.min(k,k+A),r=Math.max(k,k+A);for(;t<n;)t+=2*Math.PI;for(;t-2*Math.PI>=n;)t-=2*Math.PI;t>r||u(E+d*Math.cos(t)*m-f*Math.sin(t)*h,D+d*Math.cos(t)*h+f*Math.sin(t)*m)}}function Ps(e){let t={minX:0,minY:0,maxX:0,maxY:0},n=0,r=0;for(let[i,a,o,s,c,l,u]of e)Ns(n,r,i,a,o,s,c,n+l,r+u,t),n+=l,r+=u;return t}function Fs(e){return`M0 0 `+e.map(e=>`a${e[0]},${e[1]} ${e[2]} ${e[3]},${e[4]} ${e[5]},${e[6]}`).join(` `)+` H0 V0 Z`}function Is(e,t){let n=.15*e,r=.25*e,i=.35*e,a=.2*e;return[[n,n,0,0,1,e*.25,-e*.1],[i,i,1,0,1,e*.4,-e*.1],[r,r,1,0,1,e*.35,e*.2],[n,n,1,0,1,e*.15,t*.35],[a,a,1,0,1,-e*.15,t*.65],[r,n,1,0,1,-e*.25,e*.15],[i,i,1,0,1,-e*.5,0],[n,n,1,0,1,-e*.25,-e*.15],[n,n,1,0,1,-e*.1,-t*.35],[a,a,1,0,1,e*.1,-t*.65]]}function Ls(e,t){let n=.15*e,r=n*.8;return[[n,n,1,0,0,e*.25,-t*.1],[n,n,1,0,0,e*.25,0],[n,n,1,0,0,e*.25,0],[n,n,1,0,0,e*.25,t*.1],[n,n,1,0,0,e*.15,t*.33],[r,r,1,0,0,0,t*.34],[n,n,1,0,0,-e*.15,t*.33],[n,n,1,0,0,-e*.25,t*.15],[n,n,1,0,0,-e*.25,0],[n,n,1,0,0,-e*.25,0],[n,n,1,0,0,-e*.25,-t*.15],[n,n,1,0,0,-e*.1,-t*.33],[r,r,1,0,0,0,-t*.34],[n,n,1,0,0,e*.1,-t*.33]]}function Rs(e,t,n){let r=Cs.padding,i=r/2;switch(e){case`circle`:{let e=Math.hypot(t,n)/2+r;return{width:2*e,height:2*e,boxX:-e,boxY:-e,radius:e}}case`rect`:{let e=t+4*r,i=n+2*r;return{width:e,height:i,boxX:-e/2,boxY:-i/2,rect:{width:e,height:i,radius:0}}}case`rounded`:{let e=t+3*r,i=n+3*r;return{width:e,height:i,boxX:-e/2,boxY:-i/2,rect:{width:e,height:i,radius:Cs.cornerRadius}}}case`hexagon`:{let e=n+2*r,i=e/4,a=t+2*i+2*r;return{width:a,height:e,boxX:-a/2,boxY:-e/2,points:[[i,0],[a-i,0],[a,-e/2],[a-i,-e],[i,-e],[0,-e/2]].map(([t,n])=>`${ws(t-a/2)},${ws(n+e/2)}`).join(` `)}}case`cloud`:{let e=t+2*i,r=n+2*i,a=Is(e,r),o=Ps(a);return{width:o.maxX-o.minX,height:o.maxY-o.minY,boxX:-e/2+o.minX,boxY:-r/2+o.minY,path:zs(a,-e/2,-r/2)}}case`bang`:{let e=t+10*i,r=n+8*i,a=Math.max(e,t+20),o=Math.max(r,n+20),s=Ls(a,o),c=Ps(s);return{width:c.maxX-c.minX,height:c.maxY-c.minY,boxX:-a/2+c.minX,boxY:-o/2+c.minY,path:zs(s,-a/2,-o/2)}}default:{let e=Cs.cornerRadius,r=t+8*i,a=n+2*i;return{width:r,height:a,boxX:-r/2,boxY:-a/2,underline:!0,path:`M${ws(-r/2)} ${ws(a/2-e)} v${ws(-a+2*e)} q0,${-e} ${e},${-e} h${ws(r-2*e)} q${e},0 ${e},${e} v${ws(a-2*e)} q0,${e} ${-e},${e} h${ws(-(r-2*e))} q${-e},0 ${-e},${-e} Z`}}}}function zs(e,t,n){return Fs(e).replace(`M0 0`,`M${ws(t)} ${ws(n)}`)}function Bs(e){let t=e=>ws(e),[n,r,i]=e,a=(e,n,r,i,a)=>`${t((r*e[0]+i*n[0])/a)},${t((r*e[1]+i*n[1])/a)}`;return`M${t(n[0])},${t(n[1])}L${a(n,r,5,1,6)}C${a(n,r,2,1,3)},${a(n,r,1,2,3)},${((e,n,r)=>`${t((e[0]+4*n[0]+r[0])/6)},${t((e[1]+4*n[1]+r[1])/6)}`)(n,r,i)}C${a(r,i,2,1,3)},${a(r,i,1,2,3)},${a(r,i,1,5,6)}L${t(i[0])},${t(i[1])}`}function Vs(e){let t=[],n=new Map,r=(e,i)=>{t.push(e),n.set(e.id,i),e.children.forEach((t,n)=>r(t,e.level===0?n%Cs.sections:i))};r(e.root,void 0);let i=t.map(e=>{let t=Ms(e.text),r=Rs(e.shape,t.width,t.height);return{node:e,section:n.get(e.id),x:0,y:0,width:r.width,height:r.height,boxX:r.boxX,boxY:r.boxY,lines:t.lines,labelWidth:t.width,labelHeight:t.height,...r.path===void 0?{}:{path:r.path},...r.points===void 0?{}:{points:r.points},...r.radius===void 0?{}:{radius:r.radius},...r.rect===void 0?{}:{rect:r.rect},...r.underline?{underline:!0}:{}}}),a=Ss(i.map(e=>({id:String(e.node.id),width:e.width,height:e.height})),t.flatMap(e=>e.children.map(t=>({source:String(e.id),target:String(t.id)}))));for(let e of i){let t=a.get(String(e.node.id));e.x=t.x,e.y=t.y}let o=[];for(let e of i)for(let t of e.node.children){let n=i[t.id],r=n.x-e.x,a=n.y-e.y,s=Math.hypot(r,a)||1,c=Cs.edgeInset,l=[e.x+r/s*c,e.y+a/s*c],u=[n.x-r/s*c,n.y-a/s*c];o.push({from:e.node.id,to:t.id,section:n.section,depth:e.node.level+1,path:Bs([l,[(l[0]+u[0])/2,(l[1]+u[1])/2],u])})}let s=1/0,c=1/0,l=-1/0,u=-1/0;for(let e of i)s=Math.min(s,e.x+e.boxX),c=Math.min(c,e.y+e.boxY),l=Math.max(l,e.x+e.boxX+e.width),u=Math.max(u,e.y+e.boxY+e.height);let d=Cs.padding;return{originX:s-d,originY:c-d,width:l-s+2*d,height:u-c+2*d,nodes:i,edges:o}}var Hs=e=>String(Math.round(e*100)/100);function Us(e){return e===void 0?``:e.split(/\s+/).filter(e=>/^[A-Za-z_][\w-]*$/.test(e)).map(e=>` ${e}`).join(``)}function Ws(t,n,r){let i=new Set;for(let e of t.nodes)e.section!==void 0&&i.add(e.section);let a=[...i].sort((e,t)=>e-t),o=a.map(e=>` --mm-color-${e}: ${wo(e,n.accent,n.bg)};`),s=a.map(e=>` .mm-s${e} .mm-shape { fill: color-mix(in srgb, var(--mm-color-${e}) 32%, var(--bg)); }\n .mm-s${e} .mm-underline { stroke: var(--mm-color-${e}); }\n .mm-edge.mm-s${e} { stroke: var(--mm-color-${e}); }`),c=(0,e.paletteClass)(o);return{css:`${(0,e.styleOpenTag)(r)}
110
+ </style>`}function ns(t,n){return`<text x="0" y="0" class="quadrant-text ${n}" font-size="${t.fontSize}" dominant-baseline="${t.baseline}" text-anchor="${t.anchor}" transform="translate(${Yo(t.x)}, ${Yo(t.y)}) rotate(${t.rotation})">${(0,e.escapeXml)(t.text)}</text>`}function rs(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[];l.push(z((0,e.svgOpenTag)(t.width,t.height,n,i,o,s,void 0,c.styleAttribute,c.description),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(ts(t,n,c.nonce)),l.push(`<g class="quadrants">`);for(let e of t.quadrants)l.push(`<g class="quadrant"><rect x="${Yo(e.x)}" y="${Yo(e.y)}" width="${Yo(e.width)}" height="${Yo(e.height)}" class="quadrant-cell-${e.index}"/>${ns(e.text,`quadrant-label`)}</g>`);l.push(`</g>`),l.push(`<g class="border">`);for(let e of t.lines)l.push(`<line x1="${Yo(e.x1)}" y1="${Yo(e.y1)}" x2="${Yo(e.x2)}" y2="${Yo(e.y2)}" stroke-width="${e.strokeWidth}" class="quadrant-line quadrant-line-${e.kind}"/>`);l.push(`</g>`),l.push(`<g class="data-points">`),t.points.forEach((e,t)=>{let n=e.color||e.strokeColor||e.strokeWidth!==`0px`?` quadrant-point-${t}`:``;l.push(`<g class="data-point"><circle cx="${Yo(e.x)}" cy="${Yo(e.y)}" r="${e.radius}" class="quadrant-point${n}"/>${ns(e.text,`quadrant-point-label`)}</g>`)}),l.push(`</g>`),l.push(`<g class="labels">`);for(let e of t.axisLabels)l.push(`<g class="label">${ns(e,`quadrant-axis-label`)}</g>`);return l.push(`</g>`),l.push(`<g class="title">`),t.title&&l.push(ns(t.title,`quadrant-title`)),l.push(`</g>`),l.push(`</svg>`),l.join(`
111
+ `)}var is=4500,as=50,os=.45,ss=2500,cs=300,ls=as/10,us=100,ds=10,fs=150/100,ps=15,ms=1200,hs=900,gs=as,_s=2*Math.PI,vs=-2147483648,ys=2147483647,bs=e=>e.x+e.width/2,xs=e=>e.y+e.height/2,q=e=>e.x+e.width,Ss=e=>e.y+e.height,Cs=e=>e>0?1:e<0?-1:0,ws=(e,t)=>e.source===t?e.target:e.source;function Ts(e){let t=new Set;for(let n of e.edges)t.add(n.source===e?n.target:n.source);return t}function Es(e,t){return!(q(e)<t.x||Ss(e)<t.y||q(t)<e.x||Ss(t)<e.y)}function Ds(e,t,n){return e>t?n:1+n%4}function Os(e,t,n){let r=bs(e),i=xs(e),a=bs(t),o=xs(t);if(Es(e,t))return n.x0=r,n.y0=i,n.x1=a,n.y1=o,!0;let s=e.x,c=e.y,l=q(e),u=e.x,d=Ss(e),f=q(e),p=e.width/2,m=e.height/2,h=t.x,g=t.y,_=q(t),v=t.x,y=Ss(t),b=q(t),x=t.width/2,S=t.height/2,C=!1,w=!1;if(r===a){if(i>o)return n.x0=r,n.y0=c,n.x1=a,n.y1=y,!1;if(i<o)return n.x0=r,n.y0=d,n.x1=a,n.y1=g,!1}else if(i===o){if(r>a)return n.x0=s,n.y0=i,n.x1=_,n.y1=o,!1;if(r<a)return n.x0=l,n.y0=i,n.x1=h,n.y1=o,!1}else{let T=e.height/e.width,E=t.height/t.width,D=(o-i)/(a-r);if(-T===D?(r>a?(n.x0=u,n.y0=d):(n.x0=l,n.y0=c),C=!0):T===D&&(r>a?(n.x0=s,n.y0=c):(n.x0=f,n.y0=d),C=!0),-E===D?(a>r?(n.x1=v,n.y1=y):(n.x1=_,n.y1=g),w=!0):E===D&&(a>r?(n.x1=h,n.y1=g):(n.x1=b,n.y1=y),w=!0),C&&w)return!1;let O,k;if(r>a?i>o?(O=Ds(T,D,4),k=Ds(E,D,2)):(O=Ds(-T,D,3),k=Ds(-E,D,1)):i>o?(O=Ds(-T,D,1),k=Ds(-E,D,3)):(O=Ds(T,D,2),k=Ds(E,D,4)),!C)switch(O){case 1:n.y0=c,n.x0=r+-m/D;break;case 2:n.x0=f,n.y0=i+p*D;break;case 3:n.y0=d,n.x0=r+m/D;break;case 4:n.x0=u,n.y0=i+-p*D}if(!w)switch(k){case 1:n.y1=g,n.x1=a+-S/D;break;case 2:n.x1=b,n.y1=o+x*D;break;case 3:n.y1=y,n.x1=a+S/D;break;case 4:n.x1=v,n.y1=o+-x*D}}return!1}function ks(e,t,n){let r=bs(e)<bs(t)?-1:1,i=xs(e)<xs(t)?-1:1,a=Math.min(q(e),q(t))-Math.max(e.x,t.x),o=Math.min(Ss(e),Ss(t))-Math.max(e.y,t.y);e.x<=t.x&&q(e)>=q(t)?a+=Math.min(t.x-e.x,q(e)-q(t)):t.x<=e.x&&q(t)>=q(e)&&(a+=Math.min(e.x-t.x,q(t)-q(e))),e.y<=t.y&&Ss(e)>=Ss(t)?o+=Math.min(t.y-e.y,Ss(e)-Ss(t)):t.y<=e.y&&Ss(t)>=Ss(e)&&(o+=Math.min(e.y-t.y,Ss(t)-Ss(e)));let s=Math.abs((xs(t)-xs(e))/(bs(t)-bs(e)));xs(t)===xs(e)&&bs(t)===bs(e)&&(s=1);let c=s*a,l=o/s;return a<l?l=a:c=o,{x:-1*r*(l/2+n),y:-1*i*(c/2+n)}}function As(e){let t=e.slice(),n=[],r=new Map,i;(t.length===1||t.length===2)&&(i=t[0]);for(let e of t){let t=Ts(e).size;r.set(e,t),t===1&&n.push(e)}let a=n.slice();for(;i===void 0;){a=[];for(let e=0;e<t.length;e++){let i=t[e];if(i===void 0)break;let o=t.indexOf(i);o>=0&&t.splice(o,1);for(let e of Ts(i))if(n.indexOf(e)<0){let t=(r.get(e)??0)-1;t===1&&a.push(e),r.set(e,t)}}n=n.concat(a),(t.length===1||t.length===2)&&(i=t[0])}return i}function js(e,t,n,r,i,a){let o=(r-n+1)/2;o<0&&(o+=180);let s=(o+n)%360*_s/360,c=i*Math.cos(s),l=i*Math.sin(s);e.x=c-e.width/2,e.y=l-e.height/2;let u=e.edges.slice(),d=u.length;t!==null&&d--;let f=u.length,p=0;if(t!==null){let e=u.find(e=>e.source===t||e.target===t);p=e===void 0?0:(u.indexOf(e)+1)%f}let m=Math.abs(r-n)/d,h=0;for(let r=p;h!==d;r=(r+1)%f){let o=u[r];if(o===void 0)break;let s=ws(o,e);if(s===t)continue;let c=(n+h*m)%360;js(s,e,c,(c+m)%360,i+a,a),h++}}function Ms(e){let t=ys,n=-2147483647,r=ys,i=-2147483647;for(let a of e)t>a.x&&(t=a.x),n<q(a)&&(n=q(a)),r>a.y&&(r=a.y),i<Ss(a)&&(i=Ss(a));return{x:t,y:r,width:n-t,height:i-r}}function Ns(e,t,n){let r=ys,i=ys;for(let t of e)r>t.y&&(r=t.y),i>t.x&&(i=t.x);let a=i-ps,o=r-ps;for(let r of e)r.x=t+(r.x-a),r.y=n+(r.y-o)}function Ps(e){let t=As(e),n=vs;for(let t of e){let e=Math.sqrt(t.width*t.width+t.height*t.height);e>n&&(n=e)}js(t,null,0,359,0,Math.max(n,gs));let r=Ms(e);for(let t of e)t.x=0+(t.x-r.x),t.y=0+(t.y-r.y);let i=0+(r.x+r.width-r.x),a=0+(r.y+r.height-r.y);Ns(e,ms-i/2,hs-a/2)}function Fs(e,t,n){let r=e[t]?.[n];if(r===void 0)throw Error(`cose-bilkent: grid index out of range`);return r}function Is(e){let t=ys,n=-2147483647,r=ys,i=-2147483647;for(let a of e.nodes)t>a.x&&(t=a.x),n<q(a)&&(n=q(a)),r>a.y&&(r=a.y),i<Ss(a)&&(i=Ss(a));let a=t,o=r,s=n-t,c=i-r,l=a-ps,u=a+s+ps,d=o-ps,f=o+c+ps,p=e.repulsionRange,m=Math.ceil((u-l)/p),h=Math.ceil((f-d)/p),g=[];for(let e=0;e<m;e++){let e=[];for(let t=0;t<h;t++)e.push([]);g.push(e)}e.grid=g;for(let t of e.nodes){let e=Math.floor((t.x-l)/p),n=Math.floor((t.width+t.x-l)/p),r=Math.floor((t.y-d)/p),i=Math.floor((t.height+t.y-d)/p);for(let a=e;a<=n;a++)for(let o=r;o<=i;o++)Fs(g,a,o).push(t),t.startX=e,t.finishX=n,t.startY=r,t.finishY=i}}function Ls(e,t){e.overlapping=Os(e.target,e.source,t),e.overlapping||(e.lengthX=t.x0-t.x1,e.lengthY=t.y0-t.y1,Math.abs(e.lengthX)<1&&(e.lengthX=Cs(e.lengthX)),Math.abs(e.lengthY)<1&&(e.lengthY=Cs(e.lengthY)),e.length=Math.sqrt(e.lengthX*e.lengthX+e.lengthY*e.lengthY))}function Rs(e,t){for(let n of e.edges){if(Ls(n,t),n.overlapping)continue;let e=n.length;if(e===0)continue;let r=os*(e-as),i=r*(n.lengthX/e),a=r*(n.lengthY/e);n.source.springForceX+=i,n.source.springForceY+=a,n.target.springForceX-=i,n.target.springForceY-=a}}function zs(e,t,n){if(Es(e,t)){let n=ks(e,t,as/2),r=2*n.x,i=2*n.y,a=1/2;e.repulsionForceX-=a*r,e.repulsionForceY-=a*i,t.repulsionForceX+=a*r,t.repulsionForceY+=a*i}else{Os(e,t,n);let r=n.x1-n.x0,i=n.y1-n.y0;Math.abs(r)<ls&&(r=Cs(r)*ls),Math.abs(i)<ls&&(i=Cs(i)*ls);let a=r*r+i*i,o=Math.sqrt(a),s=is*1*1/a,c=s*r/o,l=s*i/o;e.repulsionForceX-=c,e.repulsionForceY-=l,t.repulsionForceX+=c,t.repulsionForceY+=l}}function Bs(e,t,n){let r=t%ds===1;r&&Is(e);let i=new Set;for(let t of e.nodes){if(r){let n=new Set,r=e.grid;for(let a=t.startX-1;a<t.finishX+2;a++)for(let o=t.startY-1;o<t.finishY+2;o++){let s=r[a],c=s===void 0?void 0:s[o];if(!(a<0||o<0||c===void 0)){for(let r of c)if(t!==r&&!i.has(r)&&!n.has(r)){let i=Math.abs(bs(t)-bs(r))-(t.width/2+r.width/2),a=Math.abs(xs(t)-xs(r))-(t.height/2+r.height/2);i<=e.repulsionRange&&a<=e.repulsionRange&&n.add(r)}}}t.surrounding=[...n]}for(let e of t.surrounding)zs(t,e,n);i.add(t)}}var Vs=[1,2.6721379557162637,4.74848763464932,7.140321254379494,9.797958971132713,12.688614040795791,15.788627053658772,19.07992343983501,22.548134816417495,26.181498055314396,29.970162105620904,33.905727183844746,37.98092508439659,42.189389618730246,46.52548701922506,50.984187615743544,55.56096674434149,60.25172687355656,65.05273546109957,69.96057469111715,74.9721003323884,80.08440770139889,85.29480323234884,90.60078052411225,96.00000000000003];function Hs(e,t){return Vs[e-1]??e**+t}function Us(e,t){let n=0,r=t*cs;for(let i of e){let e=t*(i.springForceX+i.repulsionForceX)/1,a=t*(i.springForceY+i.repulsionForceY)/1;Math.abs(e)>r&&(e=r*Cs(e)),Math.abs(a)>r&&(a=r*Cs(a)),i.x+=e,i.y+=a,n+=Math.abs(e)+Math.abs(a),i.springForceX=0,i.springForceY=0,i.repulsionForceX=0,i.repulsionForceY=0}return n}function Ws(e,t){let n=new Map;if(e.length===0)return n;let r=new Map,i=e.map(e=>{let t={id:e.id,x:0-e.width/2,y:0-e.height/2,width:e.width,height:e.height,edges:[],springForceX:0,springForceY:0,repulsionForceX:0,repulsionForceY:0,startX:0,finishX:0,startY:0,finishY:0,surrounding:[]};return r.set(e.id,t),t}),a=[];for(let e of t){let t=r.get(e.source),n=r.get(e.target);if(t===void 0||n===void 0)throw Error(`cose-bilkent: edge ${e.source}->${e.target} references an unknown node`);if(t===n||t.edges.some(e=>e.source===n||e.target===n))continue;let i={source:t,target:n,lengthX:0,lengthY:0,length:0,overlapping:!1};t.edges.push(i),n.edges.push(i),a.push(i)}let o=i[0];if(o===void 0)return n;let s=new Set,c=new Map,l=[o];for(;l.length>0;){let e=l.shift();if(e===void 0)break;s.add(e);for(let t of e.edges){let n=ws(t,e);if(c.get(e)!==n){if(s.has(n))throw Error(`cose-bilkent: input graph contains a cycle`);l.push(n),c.set(n,e)}}}if(s.size!==i.length)throw Error(`cose-bilkent: input graph must be a single tree`);Ps([...s]);let u=i.length,d=Math.max(u*5,ss),f=fs*u,p=ss/us,m=us/ss,h={nodes:i,edges:a,repulsionRange:100,grid:[]},g={x0:0,y0:0,x1:0,y1:0},_=1,v=0,y=0,b=0,x=0;for(;y++,y!==d;){if(y%us===0){let e=!1;y>d/3&&(e=Math.abs(b-x)<2);let t=b<f;if(x=b,t||e)break;v++,_=Math.max(1-Hs(v,Math.log(96)/Math.log(p))/100*1,m)}Rs(h,g),Bs(h,y,g),b=Us(i,_)}Ns(i,0,0);for(let e of i)n.set(e.id,{x:e.x+e.width/2,y:e.y+e.height/2});return n}var Gs={padding:10,maxNodeWidth:200,fontSize:16,lineHeight:24,sections:11,edgeInset:15,cornerRadius:5},Ks=e=>String(Math.round(e*1e4)/1e4),qs=e=>k(e.text,Gs.fontSize,e.bold?700:400);function Js(e,t=qs){return e.reduce((e,n)=>e+t(n),0)}var Ys=`\\p{Script=Han}\\p{Script=Hiragana}\\p{Script=Katakana}`,Xs=RegExp(`(?<=[\\p{L}\\p{N}]-)(?=\\p{L})|(?<=[${Ys}])(?![,。!?、;:)」』】])(?=\\S)|(?<=\\S)(?<![(「『【])(?=[${Ys}])`,`gu`);function Zs(e){let t=e.map(e=>e.text).join(``),n=new Set([...t.matchAll(Xs)].map(e=>e.index)),r=[[]],i=0;for(let t of e){let e=0;for(let a=1;a<t.text.length;a++)n.has(i+a)&&(r[r.length-1].push({...t,text:t.text.slice(e,a)}),r.push([]),e=a);r[r.length-1].push({...t,text:t.text.slice(e)}),i+=t.text.length,n.has(i)&&r.push([])}return r.filter(e=>e.length>0)}function Qs(e){let t=e.map(e=>({...e}));for(;t.length>0&&t[0].text.trimStart()===``;)t.shift();for(;t.length>0&&t.at(-1).text.trimEnd()===``;)t.pop();return t.length>0&&(t[0].text=t[0].text.trimStart(),t.at(-1).text=t.at(-1).text.trimEnd()),t}function $s(e,t,n,r){let i=e.flatMap(e=>(e.text.match(/\s+|\S+/g)??[]).map(t=>({...e,text:t}))),a=e=>/^\s/.test(e.text),o=[[]],s=0;for(let e=0;e<i.length;){if(a(i[e])){o[o.length-1].push(i[e]),s+=n(i[e]),e++;continue}let c=[];for(;e<i.length&&!a(i[e]);)c.push(i[e++]);let l=r?Zs(c):[c];l.forEach((c,u)=>{let d=Js(c,n),f=u===l.length-1,p=d+(r&&f&&e<i.length?n(i[e]):0),m=o[o.length-1];s+p>t&&m.some(e=>!a(e))&&(o.push([]),s=0),o[o.length-1].push(...c),s+=d})}return o}function ec(e,n=Gs.maxNodeWidth,r=qs,i=!1){let a=(0,t.mindmapLabelLines)(e),o=Math.max(...a.map(e=>Js(e,r)));if(o<n)return{lines:a,width:o,height:a.length*Gs.lineHeight};let s=a.flatMap(e=>$s(e,n,r,i)),c=i?Math.max(...s.map(e=>Js(Qs(e),r))):0;return{lines:s,width:Math.max(n,c),height:s.length*Gs.lineHeight}}function tc(e,t,n,r,i,a,o,s,c,l){let u=(e,t)=>{l.minX=Math.min(l.minX,e),l.maxX=Math.max(l.maxX,e),l.minY=Math.min(l.minY,t),l.maxY=Math.max(l.maxY,t)};u(s,c);let d=Math.abs(n),f=Math.abs(r);if(d===0||f===0||e===s&&t===c)return;let p=i*Math.PI/180,m=Math.cos(p),h=Math.sin(p),g=(e-s)/2,_=(t-c)/2,v=m*g+h*_,y=-h*g+m*_,b=v*v/(d*d)+y*y/(f*f);if(b>1){let e=Math.sqrt(b);d*=e,f*=e}let x=d*d*f*f-d*d*y*y-f*f*v*v,S=d*d*y*y+f*f*v*v,C=(a===o?-1:1)*Math.sqrt(Math.max(0,x/S)),w=C*d*y/f,T=-C*f*v/d,E=m*w-h*T+(e+s)/2,D=h*w+m*T+(t+c)/2,O=(e,t,n,r)=>Math.atan2(e*r-t*n,e*n+t*r),k=O(1,0,(v-w)/d,(y-T)/f),A=O((v-w)/d,(y-T)/f,(-v-w)/d,(-y-T)/f);!o&&A>0?A-=2*Math.PI:o&&A<0&&(A+=2*Math.PI);let j=Math.atan2(-f*h,d*m),M=Math.atan2(f*m,d*h);for(let e of[j,j+Math.PI,M,M+Math.PI]){let t=e,n=Math.min(k,k+A),r=Math.max(k,k+A);for(;t<n;)t+=2*Math.PI;for(;t-2*Math.PI>=n;)t-=2*Math.PI;t>r||u(E+d*Math.cos(t)*m-f*Math.sin(t)*h,D+d*Math.cos(t)*h+f*Math.sin(t)*m)}}function nc(e){let t={minX:0,minY:0,maxX:0,maxY:0},n=0,r=0;for(let[i,a,o,s,c,l,u]of e)tc(n,r,i,a,o,s,c,n+l,r+u,t),n+=l,r+=u;return t}function rc(e){return`M0 0 `+e.map(e=>`a${e[0]},${e[1]} ${e[2]} ${e[3]},${e[4]} ${e[5]},${e[6]}`).join(` `)+` H0 V0 Z`}function ic(e,t){let n=.15*e,r=.25*e,i=.35*e,a=.2*e;return[[n,n,0,0,1,e*.25,-e*.1],[i,i,1,0,1,e*.4,-e*.1],[r,r,1,0,1,e*.35,e*.2],[n,n,1,0,1,e*.15,t*.35],[a,a,1,0,1,-e*.15,t*.65],[r,n,1,0,1,-e*.25,e*.15],[i,i,1,0,1,-e*.5,0],[n,n,1,0,1,-e*.25,-e*.15],[n,n,1,0,1,-e*.1,-t*.35],[a,a,1,0,1,e*.1,-t*.65]]}function ac(e,t){let n=.15*e,r=n*.8;return[[n,n,1,0,0,e*.25,-t*.1],[n,n,1,0,0,e*.25,0],[n,n,1,0,0,e*.25,0],[n,n,1,0,0,e*.25,t*.1],[n,n,1,0,0,e*.15,t*.33],[r,r,1,0,0,0,t*.34],[n,n,1,0,0,-e*.15,t*.33],[n,n,1,0,0,-e*.25,t*.15],[n,n,1,0,0,-e*.25,0],[n,n,1,0,0,-e*.25,0],[n,n,1,0,0,-e*.25,-t*.15],[n,n,1,0,0,-e*.1,-t*.33],[r,r,1,0,0,0,-t*.34],[n,n,1,0,0,e*.1,-t*.33]]}function oc(e,t,n){let r=Gs.padding,i=r/2;switch(e){case`circle`:{let e=Math.hypot(t,n)/2+r;return{width:2*e,height:2*e,boxX:-e,boxY:-e,radius:e}}case`rect`:{let e=t+4*r,i=n+2*r;return{width:e,height:i,boxX:-e/2,boxY:-i/2,rect:{width:e,height:i,radius:0}}}case`rounded`:{let e=t+3*r,i=n+3*r;return{width:e,height:i,boxX:-e/2,boxY:-i/2,rect:{width:e,height:i,radius:Gs.cornerRadius}}}case`hexagon`:{let e=n+2*r,i=e/4,a=t+2*i+2*r;return{width:a,height:e,boxX:-a/2,boxY:-e/2,points:[[i,0],[a-i,0],[a,-e/2],[a-i,-e],[i,-e],[0,-e/2]].map(([t,n])=>`${Ks(t-a/2)},${Ks(n+e/2)}`).join(` `)}}case`cloud`:{let e=t+2*i,r=n+2*i,a=ic(e,r),o=nc(a);return{width:o.maxX-o.minX,height:o.maxY-o.minY,boxX:-e/2+o.minX,boxY:-r/2+o.minY,path:sc(a,-e/2,-r/2)}}case`bang`:{let e=t+10*i,r=n+8*i,a=Math.max(e,t+20),o=Math.max(r,n+20),s=ac(a,o),c=nc(s);return{width:c.maxX-c.minX,height:c.maxY-c.minY,boxX:-a/2+c.minX,boxY:-o/2+c.minY,path:sc(s,-a/2,-o/2)}}default:{let e=Gs.cornerRadius,r=t+8*i,a=n+2*i;return{width:r,height:a,boxX:-r/2,boxY:-a/2,underline:!0,path:`M${Ks(-r/2)} ${Ks(a/2-e)} v${Ks(-a+2*e)} q0,${-e} ${e},${-e} h${Ks(r-2*e)} q${e},0 ${e},${e} v${Ks(a-2*e)} q0,${e} ${-e},${e} h${Ks(-(r-2*e))} q${-e},0 ${-e},${-e} Z`}}}}function sc(e,t,n){return rc(e).replace(`M0 0`,`M${Ks(t)} ${Ks(n)}`)}function cc(e){let t=e=>Ks(e),[n,r,i]=e,a=(e,n,r,i,a)=>`${t((r*e[0]+i*n[0])/a)},${t((r*e[1]+i*n[1])/a)}`;return`M${t(n[0])},${t(n[1])}L${a(n,r,5,1,6)}C${a(n,r,2,1,3)},${a(n,r,1,2,3)},${((e,n,r)=>`${t((e[0]+4*n[0]+r[0])/6)},${t((e[1]+4*n[1]+r[1])/6)}`)(n,r,i)}C${a(r,i,2,1,3)},${a(r,i,1,2,3)},${a(r,i,1,5,6)}L${t(i[0])},${t(i[1])}`}function lc(e){let t=[],n=new Map,r=(e,i)=>{t.push(e),n.set(e.id,i),e.children.forEach((t,n)=>r(t,e.level===0?n%Gs.sections:i))};r(e.root,void 0);let i=t.map(e=>{let t=ec(e.text),r=oc(e.shape,t.width,t.height);return{node:e,section:n.get(e.id),x:0,y:0,width:r.width,height:r.height,boxX:r.boxX,boxY:r.boxY,lines:t.lines,labelWidth:t.width,labelHeight:t.height,...r.path===void 0?{}:{path:r.path},...r.points===void 0?{}:{points:r.points},...r.radius===void 0?{}:{radius:r.radius},...r.rect===void 0?{}:{rect:r.rect},...r.underline?{underline:!0}:{}}}),a=Ws(i.map(e=>({id:String(e.node.id),width:e.width,height:e.height})),t.flatMap(e=>e.children.map(t=>({source:String(e.id),target:String(t.id)}))));for(let e of i){let t=a.get(String(e.node.id));e.x=t.x,e.y=t.y}let o=[];for(let e of i)for(let t of e.node.children){let n=i[t.id],r=n.x-e.x,a=n.y-e.y,s=Math.hypot(r,a)||1,c=Gs.edgeInset,l=[e.x+r/s*c,e.y+a/s*c],u=[n.x-r/s*c,n.y-a/s*c];o.push({from:e.node.id,to:t.id,section:n.section,depth:e.node.level+1,path:cc([l,[(l[0]+u[0])/2,(l[1]+u[1])/2],u])})}let s=1/0,c=1/0,l=-1/0,u=-1/0;for(let e of i)s=Math.min(s,e.x+e.boxX),c=Math.min(c,e.y+e.boxY),l=Math.max(l,e.x+e.boxX+e.width),u=Math.max(u,e.y+e.boxY+e.height);let d=Gs.padding;return{originX:s-d,originY:c-d,width:l-s+2*d,height:u-c+2*d,nodes:i,edges:o}}var uc=e=>String(Math.round(e*100)/100);function dc(e){return e===void 0?``:e.split(/\s+/).filter(e=>/^[A-Za-z_][\w-]*$/.test(e)).map(e=>` ${e}`).join(``)}function fc(t,n,r){let i=new Set;for(let e of t.nodes)e.section!==void 0&&i.add(e.section);let a=[...i].sort((e,t)=>e-t),o=a.map(e=>` --mm-color-${e}: ${Bo(e,n.accent,n.bg)};`),s=a.map(e=>` .mm-s${e} .mm-shape { fill: color-mix(in srgb, var(--mm-color-${e}) 32%, var(--bg)); }\n .mm-s${e} .mm-underline { stroke: var(--mm-color-${e}); }\n .mm-edge.mm-s${e} { stroke: var(--mm-color-${e}); }`),c=(0,e.paletteClass)(o);return{css:`${(0,e.styleOpenTag)(r)}
109
112
  .mm-edge { fill: none; }
110
113
  .mm-shape { stroke: none; }
111
114
  .mm-underline { stroke-width: 3px; }
112
115
  .mm-root .mm-shape { fill: var(--fg); }
113
- .mm-label { fill: var(--_text); font-size: ${Cs.fontSize}px; font-weight: 400; text-anchor: middle; }
116
+ .mm-label { fill: var(--_text); font-size: ${Gs.fontSize}px; font-weight: 400; text-anchor: middle; }
114
117
  .mm-root .mm-label { fill: var(--bg); }
115
118
  .mm-bold { font-weight: 700; }
116
119
  .mm-italic { font-style: italic; }
@@ -120,8 +123,8 @@ ${o.join(`
120
123
  }
121
124
  ${s.join(`
122
125
  `)}
123
- </style>`,cls:c}}function Gs(t){let n=-t.labelHeight/2;return t.lines.map((t,r)=>{let i=n+Cs.lineHeight*(r+.5),a=t.map(t=>{let n=`${t.bold?`mm-bold`:``}${t.bold&&t.italic?` `:``}${t.italic?`mm-italic`:``}`,r=(0,e.escapeXml)(t.text);return n===``?r:`<tspan class="${n}">${r}</tspan>`}).join(``);return`<text x="0" y="${Hs(i)}" dy="0.35em" class="mm-label" xml:space="preserve">${a.trim()}</text>`}).join(``)}function Ks(e){let t=`mm-node ${e.section===void 0?`mm-root`:`mm-s${e.section}`} mm-${e.node.shape}${Us(e.node.className)}`,n=``;if(e.radius!==void 0)n=`<circle class="mm-shape" r="${Hs(e.radius)}" cx="0" cy="0"/>`;else if(e.rect!==void 0){let{width:t,height:r,radius:i}=e.rect;n=`<rect class="mm-shape"${i?` rx="${i}" ry="${i}"`:``} x="${Hs(-t/2)}" y="${Hs(-r/2)}" width="${Hs(t)}" height="${Hs(r)}"/>`}else e.points===void 0?e.path!==void 0&&(n=`<path class="mm-shape" d="${e.path}"/>`):n=`<polygon class="mm-shape" points="${e.points}"/>`;if(e.underline){let t=e.width/2,r=e.height/2;n+=`<line class="mm-underline" x1="${Hs(-t)}" y1="${Hs(r)}" x2="${Hs(t)}" y2="${Hs(r)}"/>`}return`<g class="${t}" data-id="node_${e.node.id}" transform="translate(${Hs(e.x)}, ${Hs(e.y)})">`+n+Gs(e)+`</g>`}function qs(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[],{css:u,cls:d}=Ws(t,n,c.nonce);l.push(R((0,e.withRootClass)((0,e.svgOpenTag)(t.width,t.height,n,i,o,s,void 0,c.styleAttribute,c.description),d),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(u),l.push(`<g transform="translate(${Hs(-t.originX)}, ${Hs(-t.originY)})">`),l.push(`<g class="mm-edges">`);for(let e of t.edges){let t=17-3*(e.depth+1);l.push(`<path d="${e.path}" class="mm-edge ${e.section===void 0?``:`mm-s${e.section}`}" stroke-width="${t>0?t:3}" data-edge="edge_${e.from}_${e.to}"/>`)}l.push(`</g>`),l.push(`<g class="mm-nodes">`);for(let e of t.nodes)l.push(Ks(e));return l.push(`</g></g></svg>`),l.join(`
124
- `)}var Js=2048,Ys=[617,752,665,1074,1074,1229,1446,327,752,752,752,1074,752,752,752,1074,1074,1074,1074,1074,1074,1074,1074,1074,1074,1074,752,752,1074,1074,1074,752,1578,1208,1159,1225,1256,1097,1075,1385,1340,570,976,1179,1037,1453,1307,1380,1142,1384,1192,985,1189,1328,1203,1745,1140,1168,1127,752,728,752,1074,1074,1074,1076,1141,1014,1141,1117,757,1028,1119,584,751,1033,604,1700,1119,1099,1141,1141,796,829,812,1119,1003,1524,1026,1010,972,752,1074,752,1074],Xs=[617,752,751,1200,1200,1401,1446,470,752,752,885,1200,752,752,752,799,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,752,752,1200,1200,1200,897,1578,1297,1219,1253,1316,1165,1195,1375,1400,570,1091,1264,1132,1526,1367,1440,1202,1452,1251,1047,1253,1388,1273,1810,1230,1256,1147,823,728,823,1200,1200,1200,1091,1191,1048,1189,1177,757,1028,1214,611,751,1122,604,1760,1209,1159,1193,1196,875,882,812,1210,1080,1605,1131,1093,1082,888,1200,888,1200];function Zs(e,t){let n=e.charCodeAt(0)-32;if(!(e.length!==1||n<0||n>=Ys.length))return(t?Xs:Ys)[n]/Js}var Qs={fontSize:16,lineHeight:17.6,firstLineHeight:19,textPad:8.8,nodeWidth:150,padding:20,leftMargin:150,columnWidth:200,eventGap:10,periodFloor:67.8,eventFloor:50,titleFontSize:33.4688,titleAscent:31,titleDescent:7,viewBoxPadding:50,colorLimit:12};function $s(e,t=16,n=!1){let r=0;for(let t of e){let e=Zs(t,n);r+=e??((t.codePointAt(0)??0)>=11904?1:.6)}return r*t}function ec(e,t){let n=e.split(/(\s+|<br>)/),r=[],i=[],a=``;for(let e of n){i.push(e);let n=i.join(` `).trim();$s(n.replace(/\s+/g,` `))>t||e===`<br>`?(i.pop(),r.push(i.join(` `).trim()),i=e===`<br>`?[``]:[e],a=e):a=n}return r.push(a),r.map(e=>e.replace(/\s+/g,` `))}function tc(e){return e.filter(e=>e!==``).length}function nc(e,t=Qs.padding){return(e===0?0:Qs.firstLineHeight+(e-1)*Qs.lineHeight)+Qs.textPad+t}function rc(e,t,n=Qs.padding){return nc(tc(ec(e,t)),n)}function ic(e){return e!==void 0&&e>=0&&e<=1e5?e:void 0}function ac(e){return e%Qs.colorLimit-1}function oc(e,t,n,r,i){return e?{x1:Math.min(e.x1,t),y1:Math.min(e.y1,n),x2:Math.max(e.x2,r),y2:Math.max(e.y2,i)}:{x1:t,y1:n,x2:r,y2:i}}function sc(e){let{periods:t,sections:n}=e,r={...Qs,leftMargin:ic(e.config?.leftMargin)??Qs.leftMargin,viewBoxPadding:ic(e.config?.padding)??Qs.viewBoxPadding},i=!e.config?.disableMulticolor,a=n.length>0,o=[],s=[],c=0;for(let e of n)c=Math.max(c,rc(e,r.nodeWidth)+r.padding);let l=t.length>0?r.periodFloor:0,u=0;for(let e of t){let t=0;for(let n of e.events)t+=rc(n,r.nodeWidth);e.events.length>0&&(t+=(e.events.length-1)*r.eventGap),u=Math.max(u,t)}let d,f=(e,t)=>{o.push(e),d=oc(d,e.x,e.y,e.x+e.width,e.y+e.height);for(let n of e.lines){let r=$s(n);d=oc(d,e.x+t/2-r/2,e.y,e.x+t/2+r/2,e.y)}},p=(e,t,n,i,a)=>{let o=t,c=i,p=l;for(let t of e){let e=ec(t.label,r.nodeWidth),i=Math.max(nc(tc(e)),p);p=Math.max(p,i),f({kind:`period`,x:o,y:n,width:r.nodeWidth+2*r.padding,height:i,lines:e,colorClass:ac(c),padding:r.padding},r.nodeWidth+2*r.padding);let l=n+200;for(let e of t.events){let t=ec(e,r.nodeWidth),n=Math.max(nc(tc(t)),r.eventFloor);f({kind:`event`,x:o,y:l,width:r.nodeWidth+2*r.padding,height:n,lines:t,colorClass:ac(c),padding:r.padding},r.nodeWidth+2*r.padding),l+=r.eventGap+n}let m=o+95,h={x1:m,y1:n+p,x2:m,y2:n+p+100+u+100};s.push(h),d=oc(d,h.x1,h.y1,h.x2,h.y2),o+=r.columnWidth,a&&c++}},m=50+r.leftMargin;if(a){let e=m;n.forEach((n,i)=>{let a=t.filter(e=>e.section===n),o=Math.max(a.length,1),s=ec(n,r.columnWidth*o-50);f({kind:`section`,x:e,y:50,width:r.columnWidth*o-50+2*r.padding,height:Math.max(nc(tc(s)),c),lines:s,colorClass:ac(i),padding:r.padding},r.columnWidth*o-50+2*r.padding),p(a,e,100+c,i,!1),e+=r.columnWidth*o})}else p(t,m,50,0,i);let h=d?d.x2-d.x1:0,g=a?c+l+150:l+100;return cc(e,o,s,{x1:r.leftMargin,y1:g,x2:h+3*r.leftMargin,y2:g},h)}function cc(e,t,n,r,i){let a={...Qs,leftMargin:ic(e.config?.leftMargin)??Qs.leftMargin,viewBoxPadding:ic(e.config?.padding)??Qs.viewBoxPadding},o;for(let e of t){o=oc(o,e.x,e.y,e.x+e.width,e.y+e.height);for(let t of e.lines){let n=$s(t);o=oc(o,e.x+e.width/2-n/2,e.y,e.x+e.width/2+n/2,e.y)}}for(let e of n)o=oc(o,e.x1,e.y1,e.x2,e.y2);o=oc(o,r.x1,r.y1,r.x2,r.y2);let s;if(e.title){let t=i/2-a.leftMargin;s={text:e.title,x:t,y:20,fontSize:a.titleFontSize};let n=$s(e.title,a.titleFontSize,!0);o=oc(o,t,20-a.titleAscent,t+n,20+a.titleDescent)}let c=o.x1-a.viewBoxPadding,l=o.y1-a.viewBoxPadding,u=e=>({...e,x:e.x-c,y:e.y-l});return{direction:e.direction,width:o.x2-o.x1+2*a.viewBoxPadding,height:o.y2-o.y1+2*a.viewBoxPadding,...s?{title:u(s)}:{},nodes:t.map(u),connectors:n.map(e=>({x1:e.x1-c,y1:e.y1-l,x2:e.x2-c,y2:e.y2-l})),axis:{x1:r.x1-c,y1:r.y1-l,x2:r.x2-c,y2:r.y2-l}}}var q={nodeWidth:200,padding:5,eventWidth:300,eventGap:10,sectionTaskGap:20,taskAxisGap:20,taskVerticalGap:30,eventAxisGap:50,axisTopOffset:32,axisBottomPadding:28};function lc(e){let{periods:t,sections:n}=e,r={...Qs,leftMargin:ic(e.config?.leftMargin)??Qs.leftMargin,viewBoxPadding:ic(e.config?.padding)??Qs.viewBoxPadding},i=!e.config?.disableMulticolor,a=[],o=[],s=n.length>0,c=q.nodeWidth+2*q.padding,l=q.eventWidth+2*q.padding,u=c+q.taskAxisGap,d=l+q.eventAxisGap,f=50+r.leftMargin+u,p=Math.max(50,u+d-2*q.padding),m=(e,t)=>rc(e,t,q.padding),h=0;for(let e of n)h=Math.max(h,m(e,p));let g=t.length>0?nc(1,q.padding):0,_=0;for(let e of t){let t=0;for(let n of e.events)t+=m(n,q.eventWidth);e.events.length>0&&(t+=(e.events.length-1)*q.eventGap),_=Math.max(_,t)}let v=Math.max(g,_)+q.taskVerticalGap,y=(e,t,n,r)=>{let i=t,s=n,u=g;for(let t of e){let e=ec(t.label,q.nodeWidth),n=Math.max(nc(tc(e),q.padding),u);u=Math.max(u,n),a.push({kind:`period`,x:f-q.taskAxisGap-c,y:i,width:c,height:n,lines:e,colorClass:ac(s),padding:q.padding});let d=i;for(let e of t.events){let t=ec(e,q.eventWidth),n=nc(tc(t),q.padding),r=f+q.eventAxisGap;a.push({kind:`event`,x:r,y:d,width:l,height:n,lines:t,colorClass:ac(s),padding:q.padding}),o.push({x1:f,y1:d+n/2,x2:r,y2:d+n/2}),d+=n+q.eventGap}i+=v,r&&s++}},b=50;s?n.forEach((e,n)=>{let r=t.filter(t=>t.section===e),i=ec(e,p),o=Math.max(nc(tc(i),q.padding),h);a.push({kind:`section`,x:f-u,y:b,width:p+2*q.padding,height:o,lines:i,colorClass:ac(n),padding:q.padding}),y(r,b+o+q.sectionTaskGap,n,!1),b+=o+q.sectionTaskGap+v*Math.max(r.length,1)-(r.length>0?q.taskVerticalGap*2:0)}):y(t,b,0,i);let x;for(let e of a){x=oc(x,e.x,e.y,e.x+e.width,e.y+e.height);for(let t of e.lines){let n=$s(t);x=oc(x,e.x+e.width/2-n/2,e.y,e.x+e.width/2+n/2,e.y)}}for(let e of o)x=oc(x,e.x1,e.y1,e.x2,e.y2);let S=x?x.x2-x.x1:0,C=x?x.y2:0;return cc(e,a,o,{x1:f,y1:50-q.axisTopOffset,x2:f,y2:(x?C:0)+q.axisBottomPadding},S)}function uc(e){return e.direction===`TD`?lc(e):sc(e)}function J(e){return String(Math.round(e*100)/100)}function dc(t,n,r){let i=[...new Set(t.nodes.map(e=>e.colorClass))].sort((e,t)=>e-t),a=i.map(e=>` --timeline-color-${e+1}: ${wo(e+1,n.accent,n.bg)};`),o=i.map(e=>` .section-${e} path { fill: color-mix(in srgb, var(--timeline-color-${e+1}) 30%, var(--bg)); }\n .section-${e} line { stroke: var(--timeline-color-${e+1}); stroke-width: 3; }`),s=(0,e.paletteClass)(a);return{css:`${(0,e.styleOpenTag)(r)}
126
+ </style>`,cls:c}}function pc(t){let n=-t.labelHeight/2;return t.lines.map((t,r)=>{let i=n+Gs.lineHeight*(r+.5),a=t.map(t=>{let n=`${t.bold?`mm-bold`:``}${t.bold&&t.italic?` `:``}${t.italic?`mm-italic`:``}`,r=(0,e.escapeXml)(t.text);return n===``?r:`<tspan class="${n}">${r}</tspan>`}).join(``);return`<text x="0" y="${uc(i)}" dy="0.35em" class="mm-label" xml:space="preserve">${a.trim()}</text>`}).join(``)}function mc(e){let t=`mm-node ${e.section===void 0?`mm-root`:`mm-s${e.section}`} mm-${e.node.shape}${dc(e.node.className)}`,n=``;if(e.radius!==void 0)n=`<circle class="mm-shape" r="${uc(e.radius)}" cx="0" cy="0"/>`;else if(e.rect!==void 0){let{width:t,height:r,radius:i}=e.rect;n=`<rect class="mm-shape"${i?` rx="${i}" ry="${i}"`:``} x="${uc(-t/2)}" y="${uc(-r/2)}" width="${uc(t)}" height="${uc(r)}"/>`}else e.points===void 0?e.path!==void 0&&(n=`<path class="mm-shape" d="${e.path}"/>`):n=`<polygon class="mm-shape" points="${e.points}"/>`;if(e.underline){let t=e.width/2,r=e.height/2;n+=`<line class="mm-underline" x1="${uc(-t)}" y1="${uc(r)}" x2="${uc(t)}" y2="${uc(r)}"/>`}return`<g class="${t}" data-id="node_${e.node.id}" transform="translate(${uc(e.x)}, ${uc(e.y)})">`+n+pc(e)+`</g>`}function hc(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[],{css:u,cls:d}=fc(t,n,c.nonce);l.push(z((0,e.withRootClass)((0,e.svgOpenTag)(t.width,t.height,n,i,o,s,void 0,c.styleAttribute,c.description),d),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(u),l.push(`<g transform="translate(${uc(-t.originX)}, ${uc(-t.originY)})">`),l.push(`<g class="mm-edges">`);for(let e of t.edges){let t=17-3*(e.depth+1);l.push(`<path d="${e.path}" class="mm-edge ${e.section===void 0?``:`mm-s${e.section}`}" stroke-width="${t>0?t:3}" data-edge="edge_${e.from}_${e.to}"/>`)}l.push(`</g>`),l.push(`<g class="mm-nodes">`);for(let e of t.nodes)l.push(mc(e));return l.push(`</g></g></svg>`),l.join(`
127
+ `)}var gc=2048,_c=[617,752,665,1074,1074,1229,1446,327,752,752,752,1074,752,752,752,1074,1074,1074,1074,1074,1074,1074,1074,1074,1074,1074,752,752,1074,1074,1074,752,1578,1208,1159,1225,1256,1097,1075,1385,1340,570,976,1179,1037,1453,1307,1380,1142,1384,1192,985,1189,1328,1203,1745,1140,1168,1127,752,728,752,1074,1074,1074,1076,1141,1014,1141,1117,757,1028,1119,584,751,1033,604,1700,1119,1099,1141,1141,796,829,812,1119,1003,1524,1026,1010,972,752,1074,752,1074],vc=[617,752,751,1200,1200,1401,1446,470,752,752,885,1200,752,752,752,799,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,752,752,1200,1200,1200,897,1578,1297,1219,1253,1316,1165,1195,1375,1400,570,1091,1264,1132,1526,1367,1440,1202,1452,1251,1047,1253,1388,1273,1810,1230,1256,1147,823,728,823,1200,1200,1200,1091,1191,1048,1189,1177,757,1028,1214,611,751,1122,604,1760,1209,1159,1193,1196,875,882,812,1210,1080,1605,1131,1093,1082,888,1200,888,1200];function yc(e,t){let n=e.charCodeAt(0)-32;if(!(e.length!==1||n<0||n>=_c.length))return(t?vc:_c)[n]/gc}var bc={fontSize:16,lineHeight:17.6,firstLineHeight:19,textPad:8.8,nodeWidth:150,padding:20,leftMargin:150,columnWidth:200,eventGap:10,periodFloor:67.8,eventFloor:50,titleFontSize:33.4688,titleAscent:31,titleDescent:7,viewBoxPadding:50,colorLimit:12};function xc(e,t=16,n=!1){let r=0;for(let t of e){let e=yc(t,n);r+=e??((t.codePointAt(0)??0)>=11904?1:.6)}return r*t}function Sc(e,t){let n=e.split(/(\s+|<br>)/),r=[],i=[],a=``;for(let e of n){i.push(e);let n=i.join(` `).trim();xc(n.replace(/\s+/g,` `))>t||e===`<br>`?(i.pop(),r.push(i.join(` `).trim()),i=e===`<br>`?[``]:[e],a=e):a=n}return r.push(a),r.map(e=>e.replace(/\s+/g,` `))}function Cc(e){return e.filter(e=>e!==``).length}function wc(e,t=bc.padding){return(e===0?0:bc.firstLineHeight+(e-1)*bc.lineHeight)+bc.textPad+t}function Tc(e,t,n=bc.padding){return wc(Cc(Sc(e,t)),n)}function Ec(e){return e!==void 0&&e>=0&&e<=1e5?e:void 0}function Dc(e){return e%bc.colorLimit-1}function Oc(e,t,n,r,i){return e?{x1:Math.min(e.x1,t),y1:Math.min(e.y1,n),x2:Math.max(e.x2,r),y2:Math.max(e.y2,i)}:{x1:t,y1:n,x2:r,y2:i}}function kc(e){let{periods:t,sections:n}=e,r={...bc,leftMargin:Ec(e.config?.leftMargin)??bc.leftMargin,viewBoxPadding:Ec(e.config?.padding)??bc.viewBoxPadding},i=!e.config?.disableMulticolor,a=n.length>0,o=[],s=[],c=0;for(let e of n)c=Math.max(c,Tc(e,r.nodeWidth)+r.padding);let l=t.length>0?r.periodFloor:0,u=0;for(let e of t){let t=0;for(let n of e.events)t+=Tc(n,r.nodeWidth);e.events.length>0&&(t+=(e.events.length-1)*r.eventGap),u=Math.max(u,t)}let d,f=(e,t)=>{o.push(e),d=Oc(d,e.x,e.y,e.x+e.width,e.y+e.height);for(let n of e.lines){let r=xc(n);d=Oc(d,e.x+t/2-r/2,e.y,e.x+t/2+r/2,e.y)}},p=(e,t,n,i,a)=>{let o=t,c=i,p=l;for(let t of e){let e=Sc(t.label,r.nodeWidth),i=Math.max(wc(Cc(e)),p);p=Math.max(p,i),f({kind:`period`,x:o,y:n,width:r.nodeWidth+2*r.padding,height:i,lines:e,colorClass:Dc(c),padding:r.padding},r.nodeWidth+2*r.padding);let l=n+200;for(let e of t.events){let t=Sc(e,r.nodeWidth),n=Math.max(wc(Cc(t)),r.eventFloor);f({kind:`event`,x:o,y:l,width:r.nodeWidth+2*r.padding,height:n,lines:t,colorClass:Dc(c),padding:r.padding},r.nodeWidth+2*r.padding),l+=r.eventGap+n}let m=o+95,h={x1:m,y1:n+p,x2:m,y2:n+p+100+u+100};s.push(h),d=Oc(d,h.x1,h.y1,h.x2,h.y2),o+=r.columnWidth,a&&c++}},m=50+r.leftMargin;if(a){let e=m;n.forEach((n,i)=>{let a=t.filter(e=>e.section===n),o=Math.max(a.length,1),s=Sc(n,r.columnWidth*o-50);f({kind:`section`,x:e,y:50,width:r.columnWidth*o-50+2*r.padding,height:Math.max(wc(Cc(s)),c),lines:s,colorClass:Dc(i),padding:r.padding},r.columnWidth*o-50+2*r.padding),p(a,e,100+c,i,!1),e+=r.columnWidth*o})}else p(t,m,50,0,i);let h=d?d.x2-d.x1:0,g=a?c+l+150:l+100;return Ac(e,o,s,{x1:r.leftMargin,y1:g,x2:h+3*r.leftMargin,y2:g},h)}function Ac(e,t,n,r,i){let a={...bc,leftMargin:Ec(e.config?.leftMargin)??bc.leftMargin,viewBoxPadding:Ec(e.config?.padding)??bc.viewBoxPadding},o;for(let e of t){o=Oc(o,e.x,e.y,e.x+e.width,e.y+e.height);for(let t of e.lines){let n=xc(t);o=Oc(o,e.x+e.width/2-n/2,e.y,e.x+e.width/2+n/2,e.y)}}for(let e of n)o=Oc(o,e.x1,e.y1,e.x2,e.y2);o=Oc(o,r.x1,r.y1,r.x2,r.y2);let s;if(e.title){let t=i/2-a.leftMargin;s={text:e.title,x:t,y:20,fontSize:a.titleFontSize};let n=xc(e.title,a.titleFontSize,!0);o=Oc(o,t,20-a.titleAscent,t+n,20+a.titleDescent)}let c=o.x1-a.viewBoxPadding,l=o.y1-a.viewBoxPadding,u=e=>({...e,x:e.x-c,y:e.y-l});return{direction:e.direction,width:o.x2-o.x1+2*a.viewBoxPadding,height:o.y2-o.y1+2*a.viewBoxPadding,...s?{title:u(s)}:{},nodes:t.map(u),connectors:n.map(e=>({x1:e.x1-c,y1:e.y1-l,x2:e.x2-c,y2:e.y2-l})),axis:{x1:r.x1-c,y1:r.y1-l,x2:r.x2-c,y2:r.y2-l}}}var J={nodeWidth:200,padding:5,eventWidth:300,eventGap:10,sectionTaskGap:20,taskAxisGap:20,taskVerticalGap:30,eventAxisGap:50,axisTopOffset:32,axisBottomPadding:28};function jc(e){let{periods:t,sections:n}=e,r={...bc,leftMargin:Ec(e.config?.leftMargin)??bc.leftMargin,viewBoxPadding:Ec(e.config?.padding)??bc.viewBoxPadding},i=!e.config?.disableMulticolor,a=[],o=[],s=n.length>0,c=J.nodeWidth+2*J.padding,l=J.eventWidth+2*J.padding,u=c+J.taskAxisGap,d=l+J.eventAxisGap,f=50+r.leftMargin+u,p=Math.max(50,u+d-2*J.padding),m=(e,t)=>Tc(e,t,J.padding),h=0;for(let e of n)h=Math.max(h,m(e,p));let g=t.length>0?wc(1,J.padding):0,_=0;for(let e of t){let t=0;for(let n of e.events)t+=m(n,J.eventWidth);e.events.length>0&&(t+=(e.events.length-1)*J.eventGap),_=Math.max(_,t)}let v=Math.max(g,_)+J.taskVerticalGap,y=(e,t,n,r)=>{let i=t,s=n,u=g;for(let t of e){let e=Sc(t.label,J.nodeWidth),n=Math.max(wc(Cc(e),J.padding),u);u=Math.max(u,n),a.push({kind:`period`,x:f-J.taskAxisGap-c,y:i,width:c,height:n,lines:e,colorClass:Dc(s),padding:J.padding});let d=i;for(let e of t.events){let t=Sc(e,J.eventWidth),n=wc(Cc(t),J.padding),r=f+J.eventAxisGap;a.push({kind:`event`,x:r,y:d,width:l,height:n,lines:t,colorClass:Dc(s),padding:J.padding}),o.push({x1:f,y1:d+n/2,x2:r,y2:d+n/2}),d+=n+J.eventGap}i+=v,r&&s++}},b=50;s?n.forEach((e,n)=>{let r=t.filter(t=>t.section===e),i=Sc(e,p),o=Math.max(wc(Cc(i),J.padding),h);a.push({kind:`section`,x:f-u,y:b,width:p+2*J.padding,height:o,lines:i,colorClass:Dc(n),padding:J.padding}),y(r,b+o+J.sectionTaskGap,n,!1),b+=o+J.sectionTaskGap+v*Math.max(r.length,1)-(r.length>0?J.taskVerticalGap*2:0)}):y(t,b,0,i);let x;for(let e of a){x=Oc(x,e.x,e.y,e.x+e.width,e.y+e.height);for(let t of e.lines){let n=xc(t);x=Oc(x,e.x+e.width/2-n/2,e.y,e.x+e.width/2+n/2,e.y)}}for(let e of o)x=Oc(x,e.x1,e.y1,e.x2,e.y2);let S=x?x.x2-x.x1:0,C=x?x.y2:0;return Ac(e,a,o,{x1:f,y1:50-J.axisTopOffset,x2:f,y2:(x?C:0)+J.axisBottomPadding},S)}function Mc(e){return e.direction===`TD`?jc(e):kc(e)}function Y(e){return String(Math.round(e*100)/100)}function Nc(t,n,r){let i=[...new Set(t.nodes.map(e=>e.colorClass))].sort((e,t)=>e-t),a=i.map(e=>` --timeline-color-${e+1}: ${Bo(e+1,n.accent,n.bg)};`),o=i.map(e=>` .section-${e} path { fill: color-mix(in srgb, var(--timeline-color-${e+1}) 30%, var(--bg)); }\n .section-${e} line { stroke: var(--timeline-color-${e+1}); stroke-width: 3; }`),s=(0,e.paletteClass)(a);return{css:`${(0,e.styleOpenTag)(r)}
125
128
  .timeline-node text { fill: var(--_text); font-size: 16px; }
126
129
  .timeline-title { fill: var(--_text); font-weight: bold; }
127
130
  .lineWrapper line { stroke: var(--fg); }
@@ -129,38 +132,38 @@ ${s.join(`
129
132
  `)}\n }`:``}
130
133
  ${o.join(`
131
134
  `)}
132
- </style>`,cls:s}}function fc(t,n){let{width:r,height:i}=t,a=`M0 ${J(i-5)} v${J(-i+10)} q0,-5,5,-5 h${J(r-10)} q5,0,5,5 v${J(i-5)} H0 Z`,o=t.lines.map((t,n)=>`<tspan x="0" dy="${n===0?`1em`:`1.1em`}">${(0,e.escapeXml)(t)}</tspan>`).join(``);return`<g class="${n}" transform="translate(${J(t.x)}, ${J(t.y)})"><g class="timeline-node section-${t.colorClass}"><g><path class="node-bkg" d="${a}"/><line class="node-line-${t.colorClass}" x1="0" y1="${J(i)}" x2="${J(r)}" y2="${J(i)}"/></g><g transform="translate(${J(r/2)}, ${J(t.padding/2)})"><text dy="1em" alignment-baseline="middle" dominant-baseline="middle" text-anchor="middle">${o}</text></g></g></g>`}function pc(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[],{css:u,cls:d}=dc(t,n,c.nonce);l.push(R((0,e.withRootClass)((0,e.svgOpenTag)(t.width,t.height,n,i,o,s,void 0,c.styleAttribute,c.description),d),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(u);let f=t.direction===`LR`;f&&l.push(`<defs><marker id="timeline-arrowhead" refX="5" refY="2" markerWidth="6" markerHeight="4" orient="auto"><path class="timeline-arrow" d="M 0,0 V 4 L6,2 Z"/></marker></defs>`);for(let e of t.nodes)l.push(fc(e,e.kind===`section`?`sectionWrapper`:e.kind===`period`?`taskWrapper`:`eventWrapper`));let p=f?` marker-end="url(#timeline-arrowhead)"`:``;for(let e of t.connectors)l.push(`<g class="lineWrapper"><line x1="${J(e.x1)}" y1="${J(e.y1)}" x2="${J(e.x2)}" y2="${J(e.y2)}" stroke-width="2"${p} stroke-dasharray="5,5"/></g>`);t.title&&l.push(`<text x="${J(t.title.x)}" y="${J(t.title.y)}" font-size="${t.title.fontSize}" font-weight="bold" class="timeline-title">${(0,e.escapeXml)(t.title.text)}</text>`);let m=t.axis;return l.push(`<g class="lineWrapper"><line x1="${J(m.x1)}" y1="${J(m.y1)}" x2="${J(m.x2)}" y2="${J(m.y2)}" stroke-width="4"${p}/></g>`),l.push(`</svg>`),l.join(`
133
- `)}var mc=10,hc=40,gc=4,_c=2,vc=8,yc=30;function bc(e){return Math.round(.939*e)+Math.round(.222*e)}var xc=e=>Math.round(.939*e),Sc=e=>Math.round(.222*e);function Cc(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(e=>e.trim())}var wc=class{minX=1/0;minY=1/0;maxX=-1/0;maxY=-1/0;add(e,t){e<this.minX&&(this.minX=e),e>this.maxX&&(this.maxX=e),t<this.minY&&(this.minY=t),t>this.maxY&&(this.maxY=t)}rect(e,t,n,r,i){for(let a of[{x:e,y:t},{x:e+n,y:t},{x:e,y:t+r},{x:e+n,y:t+r}]){let e=i?i(a):a;this.add(e.x,e.y)}}},Tc=(e,t,n)=>r=>{let i=e*Math.PI/180,a=r.x-t,o=r.y-n;return{x:t+a*Math.cos(i)-o*Math.sin(i),y:n+a*Math.sin(i)+o*Math.cos(i)}},Ec=(e,t)=>n=>({x:n.x+e,y:n.y+t}),Dc=(...e)=>t=>e.reduceRight((e,t)=>t(e),t),Oc=e=>String(Math.round(e*1e6)/1e6);function kc(e){let t=e.direction,n=t===`TB`||t===`BT`,r=e.config,i=new Map(e.commits.map(e=>[e.id,e])),a=new Map,o=new Map,s=[],c=0,l=new wc,u=0;e.branches.forEach((e,t)=>{let i=Math.max(...Cc(e).map(e=>$s(e)));a.set(e,{pos:u,index:t}),u+=50+(r.rotateCommitLabel?40:0)+(n?i/2:0)});let d=e=>{let r,i,a;t===`BT`?(a=(e,t)=>e<=t,i=1/0):(a=(e,t)=>e>=t,i=0);for(let t of e){let e=n?o.get(t)?.y:o.get(t)?.x;e!==void 0&&a(e,i)&&(r=t,i=e)}return r},f=e=>{let t=``,n=1/0;for(let r of e){let e=o.get(r).y;e<=n&&(t=r,n=e)}return t||void 0},p=e=>{let t=d(e.parents.filter(e=>e!==null));return o.get(t).y+hc},m=(e,t)=>{let n=t,r=t,s=[];for(let t of e){let e=i.get(t);e.parents.length?(n=p(e),r=Math.max(n,r)):s.push(e);let c=a.get(e.branch);o.set(e.id,{x:c.pos,y:n+mc})}n=r;for(let e of s){let r=a.get(e.branch);o.set(e.id,{x:r.pos,y:n+t})}for(let t of e){let e=i.get(t);if(e.parents.length){let t=f(e.parents);n=o.get(t).y-hc,n<=r&&(r=n);let i=a.get(e.branch).pos;o.set(e.id,{x:i,y:n-mc})}}},h=e=>{let n=o.get(e.id)?.y??0;if(e.parents.length===0)return t===`TB`?yc:t===`BT`?n-hc:0;let r=o.get(d(e.parents));return t===`TB`?r.y+hc:t===`BT`?n-hc:r.x+hc},g=(e,i)=>{let o=t===`BT`&&r.parallelCommits?i:i+mc,s=a.get(e.branch).pos;return{x:n?a.get(e.branch).pos:o,y:n?o:s-2,posWithOffset:o}},_=e=>(a.get(e)?.index??0)%vc,v=e=>{switch(e.customType??e.type){case`REVERSE`:return`commit-reverse`;case`HIGHLIGHT`:return`commit-highlight`;case`MERGE`:return`commit-merge`;case`CHERRY_PICK`:return`commit-cherry-pick`;default:return`commit-normal`}},y=(e,t)=>{let n=e.customType??e.type,r=v(e),i=_(e.branch),a=[];if(n===`HIGHLIGHT`)a.push({kind:`rect`,x:t.x-10,y:t.y-10,w:20,h:20,cls:`commit ${e.id} commit-highlight${i} ${r}-outer`}),a.push({kind:`rect`,x:t.x-6,y:t.y-6,w:12,h:12,cls:`commit ${e.id} commit${i} ${r}-inner`});else if(n===`CHERRY_PICK`){let n=`commit ${e.id} ${r}`;a.push({kind:`circle`,cx:t.x,cy:t.y,r:10,cls:n}),a.push({kind:`circle`,cx:t.x-3,cy:t.y+2,r:2.75,cls:n,fill:`#fff`}),a.push({kind:`circle`,cx:t.x+3,cy:t.y+2,r:2.75,cls:n,fill:`#fff`}),a.push({kind:`line`,x1:t.x+3,y1:t.y+1,x2:t.x,y2:t.y-5,cls:n,stroke:`#fff`}),a.push({kind:`line`,x1:t.x-3,y1:t.y+1,x2:t.x,y2:t.y-5,cls:n,stroke:`#fff`})}else a.push({kind:`circle`,cx:t.x,cy:t.y,r:10,cls:`commit ${e.id} commit${i}`}),n===`MERGE`&&a.push({kind:`circle`,cx:t.x,cy:t.y,r:6,cls:`commit ${r} ${e.id} commit${i}`}),n===`REVERSE`&&a.push({kind:`path`,d:`M ${t.x-5},${t.y-5}L${t.x+5},${t.y+5}M${t.x-5},${t.y+5}L${t.x+5},${t.y-5}`,cls:`commit ${r} ${e.id} commit${i}`});return a},b=(e,t,i)=>{if(!(e.type!==`CHERRY_PICK`&&(e.customId&&e.type===`MERGE`||e.type!==`MERGE`)&&r.showCommitLabel))return;let a=$s(e.id,10),o=bc(10),s={x:t.posWithOffset-a/2-_c,y:t.y+13.5,w:a+4,h:o+4},c={x:i,y:t.y+25},u={text:e.id,rect:s,textPos:c},d;if(n)s={...s,x:t.x-(a+16+5),y:t.y-12},c={x:t.x-(a+16),y:t.y+o-12},u.rect=s,u.textPos=c,r.rotateCommitLabel&&(u.rotate=`rotate(-45, ${Oc(t.x)}, ${Oc(t.y)})`,d=Tc(-45,t.x,t.y));else if(c={x:t.posWithOffset-a/2,y:t.y+25},u.textPos=c,r.rotateCommitLabel){let e=-7.5-(a+10)/25*9.5,n=10+a/25*8.5;u.groupTransform=`translate(${Oc(e)}, ${Oc(n)}) rotate(-45, ${Oc(i)}, ${Oc(t.y)})`,d=Dc(Ec(e,n),Tc(-45,i,t.y))}return l.rect(u.rect.x,u.rect.y,u.rect.w,u.rect.h,d),l.rect(u.textPos.x,u.textPos.y-xc(10),a,o,d),u},x=(e,t,r)=>{if(e.tags.length===0)return[];let i=[...e.tags].reverse(),a=bc(10),o=i.map(e=>$s(e,10)),s=Math.max(...o),c=a/2,u=[];return i.forEach((e,i)=>{let d=i*20,f=t.y-19.2-d,p={text:e,points:[[r-s/2-gc/2,f+_c],[r-s/2-gc/2,f-_c],[t.posWithOffset-s/2-gc,f-c-_c],[t.posWithOffset+s/2+gc,f-c-_c],[t.posWithOffset+s/2+gc,f+c+_c],[t.posWithOffset-s/2-gc,f+c+_c]].map(([e,t])=>`${Oc(e)},${Oc(t)}`).join(` `),hole:{cx:r-s/2+gc/2,cy:f},textPos:{x:t.posWithOffset-o[i]/2,y:t.y-16-d}},m=[{x:r-s/2-gc/2,y:f+_c},{x:r-s/2-gc/2,y:f-_c},{x:t.posWithOffset-s/2-gc,y:f-c-_c},{x:t.posWithOffset+s/2+gc,y:f-c-_c},{x:t.posWithOffset+s/2+gc,y:f+c+_c},{x:t.posWithOffset-s/2-gc,y:f+c+_c}],h={x:p.hole.cx,y:p.hole.cy},g={x:p.textPos.x,y:p.textPos.y-xc(10),w:o[i],t:void 0};if(n){let e=r+d,n=t.x;m=[{x:n,y:e+2},{x:n,y:e-2},{x:n+mc,y:e-c-2},{x:n+mc+s+4,y:e-c-2},{x:n+mc+s+4,y:e+c+2},{x:n+mc,y:e+c+2}],p.points=m.map(e=>`${Oc(e.x)},${Oc(e.y)}`).join(` `),p.polygonTransform=`translate(12,12) rotate(45, ${Oc(n)},${Oc(r)})`,p.hole={cx:n+gc/2,cy:e},p.holeTransform=p.polygonTransform,p.textPos={x:n+5,y:e+3},p.textTransform=`translate(14,14) rotate(45, ${Oc(n)},${Oc(r)})`;let a=Tc(45,n,r),l=Dc(Ec(12,12),a),u=Dc(Ec(14,14),a);m=m.map(l),h=l({x:p.hole.cx,y:p.hole.cy}),g={x:p.textPos.x,y:p.textPos.y-xc(10),w:o[i],t:u}}for(let e of m)l.add(e.x,e.y);l.add(h.x-1.5,h.y-1.5),l.add(h.x+1.5,h.y+1.5),l.rect(g.x,g.y,g.w,a,g.t),u.push(p)}),u},S=e=>{let a=[],s=n?yc:0,u=[...i.keys()].sort((e,t)=>i.get(e).seq-i.get(t).seq);t===`BT`&&(r.parallelCommits&&m(u,s),u=u.reverse());for(let d of u){let u=i.get(d);r.parallelCommits&&(s=h(u));let f=g(u,s);if(e){let e=y(u,f);for(let t of e)t.kind===`circle`?(l.add(t.cx-t.r,t.cy-t.r),l.add(t.cx+t.r,t.cy+t.r)):t.kind===`rect`?l.rect(t.x,t.y,t.w,t.h):t.kind===`path`?(l.add(f.x-5,f.y-5),l.add(f.x+5,f.y+5)):(l.add(t.x1,t.y1),l.add(t.x2,t.y2));let t=b(u,f,s),n=x(u,f,s),r={id:u.id,shapes:e,tags:n};t&&(r.label=t),a.push(r)}n?o.set(u.id,{x:f.x,y:f.posWithOffset}):o.set(u.id,{x:f.posWithOffset,y:f.y}),s=t===`BT`&&r.parallelCommits?s+hc:s+hc+mc,s>c&&(c=s)}return a},C=(e,t,n=0)=>{let r=e+Math.abs(e-t)/2;if(n>5)return r;if(s.every(e=>Math.abs(e-r)>=10))return s.push(r),r;let i=Math.abs(e-t);return C(e,t-i/5,n+1)},w=(e,t,r,a)=>{let o=(n?r.x<a.x:r.y<a.y)?t.branch:e.branch;return[...i.values()].some(n=>n.seq>e.seq&&n.seq<t.seq&&n.branch===o)},T=(e,n)=>{let r=o.get(e.id),i=o.get(n.id),s=w(e,n,r,i),c=``,u=``,d=0,f=0,p=a.get(n.branch)?.index,m=n.type===`MERGE`&&e.id!==n.parents[0];m&&(p=a.get(e.branch)?.index);let h;if(s){c=`A 10 10, 0, 0, 0,`,u=`A 10 10, 0, 0, 1,`,d=10,f=10;let n=r.y<i.y?C(r.y,i.y):C(i.y,r.y),o=r.x<i.x?C(r.x,i.x):C(i.x,r.x);t===`TB`?r.x<i.x?h=`M ${r.x} ${r.y} L ${o-d} ${r.y} ${u} ${o} ${r.y+f} L ${o} ${i.y-d} ${c} ${o+f} ${i.y} L ${i.x} ${i.y}`:(p=a.get(e.branch)?.index,h=`M ${r.x} ${r.y} L ${o+d} ${r.y} ${c} ${o} ${r.y+f} L ${o} ${i.y-d} ${u} ${o-f} ${i.y} L ${i.x} ${i.y}`):t===`BT`?r.x<i.x?h=`M ${r.x} ${r.y} L ${o-d} ${r.y} ${c} ${o} ${r.y-f} L ${o} ${i.y+d} ${u} ${o+f} ${i.y} L ${i.x} ${i.y}`:(p=a.get(e.branch)?.index,h=`M ${r.x} ${r.y} L ${o+d} ${r.y} ${u} ${o} ${r.y-f} L ${o} ${i.y+d} ${c} ${o-f} ${i.y} L ${i.x} ${i.y}`):r.y<i.y?h=`M ${r.x} ${r.y} L ${r.x} ${n-d} ${c} ${r.x+f} ${n} L ${i.x-d} ${n} ${u} ${i.x} ${n+f} L ${i.x} ${i.y}`:(p=a.get(e.branch)?.index,h=`M ${r.x} ${r.y} L ${r.x} ${n+d} ${u} ${r.x+f} ${n} L ${i.x-d} ${n} ${c} ${i.x} ${n-f} L ${i.x} ${i.y}`)}else c=`A 20 20, 0, 0, 0,`,u=`A 20 20, 0, 0, 1,`,d=20,f=20,t===`TB`?(r.x<i.x&&(h=m?`M ${r.x} ${r.y} L ${r.x} ${i.y-d} ${c} ${r.x+f} ${i.y} L ${i.x} ${i.y}`:`M ${r.x} ${r.y} L ${i.x-d} ${r.y} ${u} ${i.x} ${r.y+f} L ${i.x} ${i.y}`),r.x>i.x&&(h=m?`M ${r.x} ${r.y} L ${r.x} ${i.y-d} ${u} ${r.x-f} ${i.y} L ${i.x} ${i.y}`:`M ${r.x} ${r.y} L ${i.x+d} ${r.y} ${c} ${i.x} ${r.y+f} L ${i.x} ${i.y}`),r.x===i.x&&(h=`M ${r.x} ${r.y} L ${i.x} ${i.y}`)):t===`BT`?(r.x<i.x&&(h=m?`M ${r.x} ${r.y} L ${r.x} ${i.y+d} ${u} ${r.x+f} ${i.y} L ${i.x} ${i.y}`:`M ${r.x} ${r.y} L ${i.x-d} ${r.y} ${c} ${i.x} ${r.y-f} L ${i.x} ${i.y}`),r.x>i.x&&(h=m?`M ${r.x} ${r.y} L ${r.x} ${i.y+d} ${c} ${r.x-f} ${i.y} L ${i.x} ${i.y}`:`M ${r.x} ${r.y} L ${i.x+d} ${r.y} ${u} ${i.x} ${r.y-f} L ${i.x} ${i.y}`),r.x===i.x&&(h=`M ${r.x} ${r.y} L ${i.x} ${i.y}`)):(r.y<i.y&&(h=m?`M ${r.x} ${r.y} L ${i.x-d} ${r.y} ${u} ${i.x} ${r.y+f} L ${i.x} ${i.y}`:`M ${r.x} ${r.y} L ${r.x} ${i.y-d} ${c} ${r.x+f} ${i.y} L ${i.x} ${i.y}`),r.y>i.y&&(h=m?`M ${r.x} ${r.y} L ${i.x-d} ${r.y} ${c} ${i.x} ${r.y-f} L ${i.x} ${i.y}`:`M ${r.x} ${r.y} L ${r.x} ${i.y+d} ${u} ${r.x+f} ${i.y} L ${i.x} ${i.y}`),r.y===i.y&&(h=`M ${r.x} ${r.y} L ${i.x} ${i.y}`));if(h===void 0)throw Error(`Line definition not found`);for(let e of h.matchAll(/[ML] (-?[\d.e+-]+) (-?[\d.e+-]+)|, 0, 0, [01], (-?[\d.e+-]+) (-?[\d.e+-]+)/g))l.add(Number(e[1]??e[3]),Number(e[2]??e[4]));return{d:h,colorIndex:(p??0)%vc}};S(!1);let E=[];r.showBranches&&e.branches.forEach((e,i)=>{let o=i%vc,u=a.get(e).pos,d=n?u:u-2,f={x1:0,y1:d,x2:c,y2:d};t===`TB`?f={x1:u,y1:yc,x2:u,y2:c}:t===`BT`&&(f={x1:u,y1:c,x2:u,y2:yc}),s.push(d),l.add(f.x1,f.y1),l.add(f.x2,f.y2);let p=Cc(e),m=Math.max(...p.map(e=>$s(e))),h=p.length*bc(16),g=r.rotateCommitLabel?30:0,_={x:-m-4-g,y:-h/2+10,w:m+18,h:h+4,tx:-19,ty:d-12},v={x:-m-14-g,y:d-h/2-2};t===`TB`?(_={x:u-m/2-10,y:0,w:_.w,h:_.h},v={x:u-m/2-5,y:0}):t===`BT`&&(_={x:u-m/2-10,y:c,w:_.w,h:_.h},v={x:u-m/2-5,y:c}),l.rect(_.x+(_.tx??0),_.y+(_.ty??0),_.w,_.h),l.rect(v.x,v.y+1,m,h),E.push({name:e,colorIndex:o,line:f,bkg:_,label:v})});let D=[];for(let e of i.values())for(let t of e.parents)D.push(T(i.get(t),e));let O={direction:t,viewBox:{x:0,y:0,width:0,height:0},branches:E,arrows:D,commits:S(!0),showBranches:r.showBranches};if(Number.isFinite(l.minX)||l.add(0,0),e.title){let t=l.minX+(l.maxX-l.minX)/2,n=$s(e.title,18);O.title={text:e.title,x:t,y:-r.titleTopMargin},l.rect(t-n/2,-r.titleTopMargin-xc(18),n,xc(18)+Sc(18))}return O.viewBox={x:l.minX-r.diagramPadding,y:l.minY-r.diagramPadding,width:l.maxX-l.minX+2*r.diagramPadding,height:l.maxY-l.minY+2*r.diagramPadding},O}function Y(e){return String(Math.round(e*1e4)/1e4)}var Ac=8;function jc(t,n){let r=Array.from({length:Ac},(e,n)=>` --git-color-${n}: ${wo(n,t.accent,t.bg)};`),i=Array.from({length:Ac},(e,t)=>` .branch-label${t} { fill: var(--bg); }\n .commit${t} { stroke: var(--git-color-${t}); fill: var(--git-color-${t}); }\n .commit-highlight${t} { stroke: var(--fg); fill: var(--fg); }\n .label${t} { fill: var(--git-color-${t}); }\n .arrow${t} { stroke: var(--git-color-${t}); }`),a=(0,e.paletteClass)(r);return{css:`${(0,e.styleOpenTag)(n)}
135
+ </style>`,cls:s}}function Pc(t,n){let{width:r,height:i}=t,a=`M0 ${Y(i-5)} v${Y(-i+10)} q0,-5,5,-5 h${Y(r-10)} q5,0,5,5 v${Y(i-5)} H0 Z`,o=t.lines.map((t,n)=>`<tspan x="0" dy="${n===0?`1em`:`1.1em`}">${(0,e.escapeXml)(t)}</tspan>`).join(``);return`<g class="${n}" transform="translate(${Y(t.x)}, ${Y(t.y)})"><g class="timeline-node section-${t.colorClass}"><g><path class="node-bkg" d="${a}"/><line class="node-line-${t.colorClass}" x1="0" y1="${Y(i)}" x2="${Y(r)}" y2="${Y(i)}"/></g><g transform="translate(${Y(r/2)}, ${Y(t.padding/2)})"><text dy="1em" alignment-baseline="middle" dominant-baseline="middle" text-anchor="middle">${o}</text></g></g></g>`}function Fc(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[],{css:u,cls:d}=Nc(t,n,c.nonce);l.push(z((0,e.withRootClass)((0,e.svgOpenTag)(t.width,t.height,n,i,o,s,void 0,c.styleAttribute,c.description),d),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(u);let f=t.direction===`LR`;f&&l.push(`<defs><marker id="timeline-arrowhead" refX="5" refY="2" markerWidth="6" markerHeight="4" orient="auto"><path class="timeline-arrow" d="M 0,0 V 4 L6,2 Z"/></marker></defs>`);for(let e of t.nodes)l.push(Pc(e,e.kind===`section`?`sectionWrapper`:e.kind===`period`?`taskWrapper`:`eventWrapper`));let p=f?` marker-end="url(#timeline-arrowhead)"`:``;for(let e of t.connectors)l.push(`<g class="lineWrapper"><line x1="${Y(e.x1)}" y1="${Y(e.y1)}" x2="${Y(e.x2)}" y2="${Y(e.y2)}" stroke-width="2"${p} stroke-dasharray="5,5"/></g>`);t.title&&l.push(`<text x="${Y(t.title.x)}" y="${Y(t.title.y)}" font-size="${t.title.fontSize}" font-weight="bold" class="timeline-title">${(0,e.escapeXml)(t.title.text)}</text>`);let m=t.axis;return l.push(`<g class="lineWrapper"><line x1="${Y(m.x1)}" y1="${Y(m.y1)}" x2="${Y(m.x2)}" y2="${Y(m.y2)}" stroke-width="4"${p}/></g>`),l.push(`</svg>`),l.join(`
136
+ `)}var Ic=[.2778,.2778,.355,.5562,.5562,.8892,.667,.1909,.333,.333,.3892,.584,.2778,.333,.2778,.2778,.5562,.5562,.5562,.5562,.5562,.5562,.5562,.5562,.5562,.5562,.2778,.2778,.584,.584,.584,.5562,1.0151,.667,.667,.7222,.7222,.667,.6108,.7778,.7222,.2778,.5,.667,.5562,.833,.7222,.7778,.667,.7778,.7222,.667,.6108,.7222,.667,.9438,.667,.667,.6108,.2778,.2778,.2778,.4692,.5562,.333,.5562,.5562,.5,.5562,.5562,.2778,.5562,.5562,.2222,.2222,.5,.2222,.833,.5562,.5562,.5562,.5562,.333,.5,.2778,.5562,.5,.7222,.5,.5,.5,.334,.2598,.334,.584],Lc=[.2778,.333,.4741,.5562,.5562,.8892,.7222,.2378,.333,.333,.3892,.584,.2778,.333,.2778,.2778,.5562,.5562,.5562,.5562,.5562,.5562,.5562,.5562,.5562,.5562,.333,.333,.584,.584,.584,.6108,.9751,.7222,.7222,.7222,.7222,.667,.6108,.7778,.7222,.2778,.5562,.7222,.6108,.833,.7222,.7778,.667,.7778,.7222,.667,.6108,.7222,.667,.9438,.667,.667,.6108,.333,.2778,.333,.584,.5562,.333,.5562,.6108,.5562,.6108,.5562,.333,.6108,.6108,.2778,.2778,.5562,.2778,.8892,.6108,.6108,.6108,.6108,.3892,.5562,.333,.6108,.5562,.7778,.5562,.5562,.5,.3892,.2798,.3892,.584],Rc=`11-742 AT-742 AV-742 AW-371 AY-742 Av-181 Aw-181 Ay-181 F,-1108 F.-1108 FA-552 LT-742 LV-742 LW-742 LY-742 Ly-371 P,-1289 P.-1289 PA-742 RT-181 RV-181 RW-181 RY-181 T,-1108 T--552 T.-1108 T:-1108 T;-1108 TA-742 TO-181 Ta-1108 Tc-1108 Te-1108 Ti-371 To-1108 Tr-371 Ts-1108 Tu-371 Tw-552 Ty-552 V,-918 V--552 V.-918 V:-371 V;-371 VA-742 Va-742 Ve-552 Vi-181 Vo-552 Vr-371 Vu-371 Vy-371 W,-552 W--181 W.-552 W:-181 W;-181 WA-371 Wa-371 We-181 Wo-181 Wr-181 Wu-181 Wy-88 Y,-1289 Y--918 Y.-1289 Y:-552 Y;-649 YA-742 Ya-742 Ye-918 Yi-371 Yo-918 Yp-742 Yq-918 Yu-552 Yv-552 ff-181 r,-552 r.-552 v,-742 v.-742 w,-552 w.-552 y,-742 y.-742`,zc=`11-552 AT-742 AV-742 AW-552 AY-918 Av-371 Aw-181 Ay-371 F,-1108 F.-1108 FA-552 LT-742 LV-742 LW-552 LY-918 Ly-371 P,-1289 P.-1289 PA-742 RV-181 RW-181 RY-371 T,-1108 T--552 T.-1108 T:-1108 T;-1108 TA-742 TO-181 Ta-742 Tc-742 Te-742 Ti-181 To-742 Tr-552 Ts-742 Tu-742 Tw-742 Ty-742 V,-918 V--552 V.-918 V:-552 V;-552 VA-742 Va-552 Ve-552 Vi-181 Vo-742 Vr-552 Vu-371 Vy-371 W,-552 W--200 W.-552 W:-181 W;-181 WA-552 Wa-371 We-181 Wi-88 Wo-181 Wr-181 Wu-181 Wy-181 Y,-1108 Y--552 Y.-1108 Y:-742 Y;-742 YA-918 Ya-552 Ye-552 Yi-371 Yo-742 Yp-552 Yq-742 Yu-552 Yv-552 r,-552 r.-552 v,-742 v.-742 w,-371 w.-371 y,-742 y.-742`,Bc=new Map;function Vc(e){let t=Bc.get(e);return t||(t=new Map((e?zc:Rc).split(` `).map(e=>[e.slice(0,2),Number(e.slice(2))/1e4])),Bc.set(e,t)),t}function Hc(e,t=16,n=!1){let r=n?Lc:Ic,i=Vc(n),a=0;for(let t=1;t<e.length;t++)a+=i.get(e.slice(t-1,t+1))??0;for(let t of e){let e=t.codePointAt(0);a+=e>=32&&e<=126?r[e-32]:e>=4352?1:.6}return a*t}var Uc=10,Wc=40,Gc=4,Kc=2,qc=8,Jc=30,Yc=12,Xc=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]),Zc=new Set([`redux-color`,`redux-dark-color`]),Qc=new Set([`dark`,`redux-dark`,`redux-dark-color`,`neo-dark`]),$c=new Set([...Xc,`neo`,`neo-dark`]),el={default:`drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))`,forest:`drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))`,neo:`drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));`,"neo-dark":`drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))`},tl=`drop-shadow( 1px 2px 2px rgba(185,185,185,1))`;function nl(e,t){let n=e??`default`,r=Xc.has(n),i=t===`neo`,a={redux:r,colorTheme:Zc.has(n),dark:Qc.has(n),thinBranch:$c.has(n),colorLimit:r?12:qc,neo:i};return i&&(r?a.shadowFlood=a.dark?`#FFFFFF`:`#000000`:a.neoFilter=`filter:${n==="default"||n===`forest`||n===`neo`||n===`neo-dark`?el[n]:tl}`),a}var rl=(e,t,n)=>n&&e>0?(e-1)%(t-1)+1:e%t;function il(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(e=>e.trim())}var al=class{minX=1/0;minY=1/0;maxX=-1/0;maxY=-1/0;add(e,t){e<this.minX&&(this.minX=e),e>this.maxX&&(this.maxX=e),t<this.minY&&(this.minY=t),t>this.maxY&&(this.maxY=t)}rect(e,t,n,r,i){for(let a of[{x:e,y:t},{x:e+n,y:t},{x:e,y:t+r},{x:e+n,y:t+r}]){let e=i?i(a):a;this.add(e.x,e.y)}}},ol=(e,t,n)=>r=>{let i=e*Math.PI/180,a=r.x-t,o=r.y-n;return{x:t+a*Math.cos(i)-o*Math.sin(i),y:n+a*Math.sin(i)+o*Math.cos(i)}},sl=(e,t)=>n=>({x:n.x+e,y:n.y+t}),cl=(...e)=>t=>e.reduceRight((e,t)=>t(e),t),ll=e=>String(Math.round(e*1e6)/1e6);function ul(e){let t=e.direction,n=t===`TB`||t===`BT`,r=e.config,i=nl(r.theme,r.look),a=$c.has(r.theme??``),o=a?14:16,s=e=>Math.round((a?.905:.939)*e),c=e=>Math.round((a?.212:.222)*e),l=e=>s(e)+c(e),u=(e,t=16,n=!1)=>a?Hc(e,t,n):xc(e,t,n),d=i.redux,f=i.redux?7:-2,p=new Map(e.commits.map(e=>[e.id,e])),m=new Map,h=new Map,g=[],_=0,v=new al,y=0;e.branches.forEach((e,t)=>{let i=Math.max(...il(e).map(e=>u(e,o)));m.set(e,{pos:y,index:t}),y+=50+(r.rotateCommitLabel?40:0)+(n?i/2:0)});let b=e=>{let r,i,a;t===`BT`?(a=(e,t)=>e<=t,i=1/0):(a=(e,t)=>e>=t,i=0);for(let t of e){let e=n?h.get(t)?.y:h.get(t)?.x;e!==void 0&&a(e,i)&&(r=t,i=e)}return r},x=e=>{let t=``,n=1/0;for(let r of e){let e=h.get(r).y;e<=n&&(t=r,n=e)}return t||void 0},S=e=>{let t=b(e.parents.filter(e=>e!==null));return h.get(t).y+Wc},C=(e,t)=>{let n=t,r=t,i=[];for(let t of e){let e=p.get(t);e.parents.length?(n=S(e),r=Math.max(n,r)):i.push(e);let a=m.get(e.branch);h.set(e.id,{x:a.pos,y:n+Uc})}n=r;for(let e of i){let r=m.get(e.branch);h.set(e.id,{x:r.pos,y:n+t})}for(let t of e){let e=p.get(t);if(e.parents.length){let t=x(e.parents);n=h.get(t).y-Wc,n<=r&&(r=n);let i=m.get(e.branch).pos;h.set(e.id,{x:i,y:n-Uc})}}},w=e=>{let n=h.get(e.id)?.y??0;if(e.parents.length===0)return t===`TB`?Jc:t===`BT`?n-Wc:0;let r=h.get(b(e.parents));return t===`TB`?r.y+Wc:t===`BT`?n-Wc:r.x+Wc},T=(e,i)=>{let a=t===`BT`&&r.parallelCommits?i:i+Uc,o=m.get(e.branch).pos;return{x:n?m.get(e.branch).pos:a,y:n?a:o+f,posWithOffset:a}},E=e=>rl(m.get(e)?.index??0,qc,i.colorTheme),D=e=>{switch(e.customType??e.type){case`REVERSE`:return`commit-reverse`;case`HIGHLIGHT`:return`commit-highlight`;case`MERGE`:return`commit-merge`;case`CHERRY_PICK`:return`commit-cherry-pick`;default:return`commit-normal`}},O=(e,t)=>{let n=e.customType??e.type,r=D(e),a=E(e.branch),o=[],s=i.redux,c=i.dark?`#000000`:`#fff`;if(n===`HIGHLIGHT`)o.push({kind:`rect`,x:t.x-10+(s?3:0),y:t.y-10+(s?3:0),w:s?14:20,h:s?14:20,cls:`commit ${e.id} commit-highlight${a} ${r}-outer`}),o.push({kind:`rect`,x:t.x-6+(s?2:0),y:t.y-6+(s?2:0),w:s?8:12,h:s?8:12,cls:`commit ${e.id} commit${a} ${r}-inner`});else if(n===`CHERRY_PICK`){let n=`commit ${e.id} ${r}`;o.push({kind:`circle`,cx:t.x,cy:t.y,r:s?7:10,cls:n}),o.push({kind:`circle`,cx:t.x-3,cy:t.y+2,r:s?2.5:2.75,cls:n,fill:c}),o.push({kind:`circle`,cx:t.x+3,cy:t.y+2,r:s?2.5:2.75,cls:n,fill:c}),o.push({kind:`line`,x1:t.x+3,y1:t.y+1,x2:t.x,y2:t.y-5,cls:n,stroke:c}),o.push({kind:`line`,x1:t.x-3,y1:t.y+1,x2:t.x,y2:t.y-5,cls:n,stroke:c})}else if(o.push({kind:`circle`,cx:t.x,cy:t.y,r:s?7:10,cls:`commit ${e.id} commit${a}`}),n===`MERGE`&&o.push({kind:`circle`,cx:t.x,cy:t.y,r:s?5:6,cls:`commit ${r} ${e.id} commit${a}`}),n===`REVERSE`){let n=s?4:5;o.push({kind:`path`,d:`M ${t.x-n},${t.y-n}L${t.x+n},${t.y+n}M${t.x-n},${t.y+n}L${t.x+n},${t.y-n}`,cls:`commit ${r} ${e.id} commit${a}`})}return o},k=(e,t,i)=>{if(!(e.type!==`CHERRY_PICK`&&(e.customId&&e.type===`MERGE`||e.type!==`MERGE`)&&r.showCommitLabel))return;let a=u(e.id,10,d),o=l(10),c={x:t.posWithOffset-a/2-Kc,y:t.y+13.5,w:a+4,h:o+4},f={x:i,y:t.y+25},p={text:e.id,rect:c,textPos:f},m;if(n)c={...c,x:t.x-(a+16+5),y:t.y-12},f={x:t.x-(a+16),y:t.y+o-12},p.rect=c,p.textPos=f,r.rotateCommitLabel&&(p.rotate=`rotate(-45, ${ll(t.x)}, ${ll(t.y)})`,m=ol(-45,t.x,t.y));else if(f={x:t.posWithOffset-a/2,y:t.y+25},p.textPos=f,r.rotateCommitLabel){let e=-7.5-(a+10)/25*9.5,n=10+a/25*8.5;p.groupTransform=`translate(${ll(e)}, ${ll(n)}) rotate(-45, ${ll(i)}, ${ll(t.y)})`,m=cl(sl(e,n),ol(-45,i,t.y))}return v.rect(p.rect.x,p.rect.y,p.rect.w,p.rect.h,m),v.rect(p.textPos.x,p.textPos.y-s(10),a,o,m),p},A=(e,t,r)=>{if(e.tags.length===0)return[];let i=[...e.tags].reverse(),a=l(10),o=i.map(e=>u(e,10)),c=Math.max(...o),d=a/2,f=[];return i.forEach((e,i)=>{let l=i*20,u=t.y-19.2-l,p={text:e,points:[[r-c/2-Gc/2,u+Kc],[r-c/2-Gc/2,u-Kc],[t.posWithOffset-c/2-Gc,u-d-Kc],[t.posWithOffset+c/2+Gc,u-d-Kc],[t.posWithOffset+c/2+Gc,u+d+Kc],[t.posWithOffset-c/2-Gc,u+d+Kc]].map(([e,t])=>`${ll(e)},${ll(t)}`).join(` `),hole:{cx:r-c/2+Gc/2,cy:u},textPos:{x:t.posWithOffset-o[i]/2,y:t.y-16-l}},m=[{x:r-c/2-Gc/2,y:u+Kc},{x:r-c/2-Gc/2,y:u-Kc},{x:t.posWithOffset-c/2-Gc,y:u-d-Kc},{x:t.posWithOffset+c/2+Gc,y:u-d-Kc},{x:t.posWithOffset+c/2+Gc,y:u+d+Kc},{x:t.posWithOffset-c/2-Gc,y:u+d+Kc}],h={x:p.hole.cx,y:p.hole.cy},g={x:p.textPos.x,y:p.textPos.y-s(10),w:o[i],t:void 0};if(n){let e=r+l,n=t.x;m=[{x:n,y:e+2},{x:n,y:e-2},{x:n+Uc,y:e-d-2},{x:n+Uc+c+4,y:e-d-2},{x:n+Uc+c+4,y:e+d+2},{x:n+Uc,y:e+d+2}],p.points=m.map(e=>`${ll(e.x)},${ll(e.y)}`).join(` `),p.polygonTransform=`translate(12,12) rotate(45, ${ll(n)},${ll(r)})`,p.hole={cx:n+Gc/2,cy:e},p.holeTransform=p.polygonTransform,p.textPos={x:n+5,y:e+3},p.textTransform=`translate(14,14) rotate(45, ${ll(n)},${ll(r)})`;let a=ol(45,n,r),u=cl(sl(12,12),a),f=cl(sl(14,14),a);m=m.map(u),h=u({x:p.hole.cx,y:p.hole.cy}),g={x:p.textPos.x,y:p.textPos.y-s(10),w:o[i],t:f}}for(let e of m)v.add(e.x,e.y);v.add(h.x-1.5,h.y-1.5),v.add(h.x+1.5,h.y+1.5),v.rect(g.x,g.y,g.w,a,g.t),f.push(p)}),f},j=e=>{let a=[],o=n?Jc:0,s=[...p.keys()].sort((e,t)=>p.get(e).seq-p.get(t).seq);t===`BT`&&(r.parallelCommits&&C(s,o),s=s.reverse());for(let c of s){let s=p.get(c);r.parallelCommits&&(o=w(s));let l=T(s,o);if(e){let e=O(s,l);for(let t of e)if(t.kind===`circle`)v.add(t.cx-t.r,t.cy-t.r),v.add(t.cx+t.r,t.cy+t.r);else if(t.kind===`rect`)v.rect(t.x,t.y,t.w,t.h);else if(t.kind===`path`){let e=i.redux?4:5;v.add(l.x-e,l.y-e),v.add(l.x+e,l.y+e)}else v.add(t.x1,t.y1),v.add(t.x2,t.y2);let t=k(s,l,o),n=A(s,l,o),r={id:s.id,shapes:e,tags:n};t&&(r.label=t),a.push(r)}n?h.set(s.id,{x:l.x,y:l.posWithOffset}):h.set(s.id,{x:l.posWithOffset,y:l.y}),o=t===`BT`&&r.parallelCommits?o+Wc:o+Wc+Uc,o>_&&(_=o)}return a},M=(e,t,n=0)=>{let r=e+Math.abs(e-t)/2;if(n>5)return r;if(g.every(e=>Math.abs(e-r)>=10))return g.push(r),r;let i=Math.abs(e-t);return M(e,t-i/5,n+1)},N=(e,t,r,i)=>{let a=(n?r.x<i.x:r.y<i.y)?t.branch:e.branch;return[...p.values()].some(n=>n.seq>e.seq&&n.seq<t.seq&&n.branch===a)},P=(e,n)=>{let r=h.get(e.id),a=h.get(n.id),o=N(e,n,r,a),s=``,c=``,l=0,u=0,d=m.get(n.branch)?.index,f=n.type===`MERGE`&&e.id!==n.parents[0];f&&(d=m.get(e.branch)?.index);let p;if(o){s=`A 10 10, 0, 0, 0,`,c=`A 10 10, 0, 0, 1,`,l=10,u=10;let n=r.y<a.y?M(r.y,a.y):M(a.y,r.y),i=r.x<a.x?M(r.x,a.x):M(a.x,r.x);t===`TB`?r.x<a.x?p=`M ${r.x} ${r.y} L ${i-l} ${r.y} ${c} ${i} ${r.y+u} L ${i} ${a.y-l} ${s} ${i+u} ${a.y} L ${a.x} ${a.y}`:(d=m.get(e.branch)?.index,p=`M ${r.x} ${r.y} L ${i+l} ${r.y} ${s} ${i} ${r.y+u} L ${i} ${a.y-l} ${c} ${i-u} ${a.y} L ${a.x} ${a.y}`):t===`BT`?r.x<a.x?p=`M ${r.x} ${r.y} L ${i-l} ${r.y} ${s} ${i} ${r.y-u} L ${i} ${a.y+l} ${c} ${i+u} ${a.y} L ${a.x} ${a.y}`:(d=m.get(e.branch)?.index,p=`M ${r.x} ${r.y} L ${i+l} ${r.y} ${c} ${i} ${r.y-u} L ${i} ${a.y+l} ${s} ${i-u} ${a.y} L ${a.x} ${a.y}`):r.y<a.y?p=`M ${r.x} ${r.y} L ${r.x} ${n-l} ${s} ${r.x+u} ${n} L ${a.x-l} ${n} ${c} ${a.x} ${n+u} L ${a.x} ${a.y}`:(d=m.get(e.branch)?.index,p=`M ${r.x} ${r.y} L ${r.x} ${n+l} ${c} ${r.x+u} ${n} L ${a.x-l} ${n} ${s} ${a.x} ${n-u} L ${a.x} ${a.y}`)}else s=`A 20 20, 0, 0, 0,`,c=`A 20 20, 0, 0, 1,`,l=20,u=20,t===`TB`?(r.x<a.x&&(p=f?`M ${r.x} ${r.y} L ${r.x} ${a.y-l} ${s} ${r.x+u} ${a.y} L ${a.x} ${a.y}`:`M ${r.x} ${r.y} L ${a.x-l} ${r.y} ${c} ${a.x} ${r.y+u} L ${a.x} ${a.y}`),r.x>a.x&&(p=f?`M ${r.x} ${r.y} L ${r.x} ${a.y-l} ${c} ${r.x-u} ${a.y} L ${a.x} ${a.y}`:`M ${r.x} ${r.y} L ${a.x+l} ${r.y} ${s} ${a.x} ${r.y+u} L ${a.x} ${a.y}`),r.x===a.x&&(p=`M ${r.x} ${r.y} L ${a.x} ${a.y}`)):t===`BT`?(r.x<a.x&&(p=f?`M ${r.x} ${r.y} L ${r.x} ${a.y+l} ${c} ${r.x+u} ${a.y} L ${a.x} ${a.y}`:`M ${r.x} ${r.y} L ${a.x-l} ${r.y} ${s} ${a.x} ${r.y-u} L ${a.x} ${a.y}`),r.x>a.x&&(p=f?`M ${r.x} ${r.y} L ${r.x} ${a.y+l} ${s} ${r.x-u} ${a.y} L ${a.x} ${a.y}`:`M ${r.x} ${r.y} L ${a.x+l} ${r.y} ${c} ${a.x} ${r.y-u} L ${a.x} ${a.y}`),r.x===a.x&&(p=`M ${r.x} ${r.y} L ${a.x} ${a.y}`)):(r.y<a.y&&(p=f?`M ${r.x} ${r.y} L ${a.x-l} ${r.y} ${c} ${a.x} ${r.y+u} L ${a.x} ${a.y}`:`M ${r.x} ${r.y} L ${r.x} ${a.y-l} ${s} ${r.x+u} ${a.y} L ${a.x} ${a.y}`),r.y>a.y&&(p=f?`M ${r.x} ${r.y} L ${a.x-l} ${r.y} ${s} ${a.x} ${r.y-u} L ${a.x} ${a.y}`:`M ${r.x} ${r.y} L ${r.x} ${a.y+l} ${c} ${r.x+u} ${a.y} L ${a.x} ${a.y}`),r.y===a.y&&(p=`M ${r.x} ${r.y} L ${a.x} ${a.y}`));if(p===void 0)throw Error(`Line definition not found`);for(let e of p.matchAll(/[ML] (-?[\d.e+-]+) (-?[\d.e+-]+)|, 0, 0, [01], (-?[\d.e+-]+) (-?[\d.e+-]+)/g))v.add(Number(e[1]??e[3]),Number(e[2]??e[4]));return{d:p,colorIndex:rl(d??0,qc,i.colorTheme)}};j(!1);let F=[];r.showBranches&&e.branches.forEach((e,a)=>{let c=rl(a,i.colorLimit,i.colorTheme),p=m.get(e).pos,h=n?p:p+f,y={x1:0,y1:h,x2:_,y2:h};t===`TB`?y={x1:p,y1:Jc,x2:p,y2:_}:t===`BT`&&(y={x1:p,y1:_,x2:p,y2:Jc}),g.push(h),v.add(y.x1,y.y1),v.add(y.x2,y.y2);let b=il(e),x=Math.max(...b.map(e=>u(e,o,d))),S=b.length*l(o),C=r.rotateCommitLabel?30:0,w=i.redux?16:0,T=i.redux?Yc:0,E={x:-x-4-C,y:-S/2+10,w:x+18+w,h:S+4+T,tx:-19,ty:h-12-T/2,radius:i.redux?0:4},D={x:-x-14-C+w/2,y:h-S/2-2};t===`TB`?(E={x:p-x/2-10,y:0,w:E.w,h:E.h,radius:E.radius},D={x:p-x/2-5,y:0},i.redux&&(E.tx=-w/2-3,E.ty=-T-10,D.y=-T*2+7)):t===`BT`&&(E={x:p-x/2-10,y:_,w:E.w,h:E.h,radius:E.radius},D={x:p-x/2-5,y:_},i.redux&&(E.tx=-w/2-3,E.ty=T+10,D.y=_+T*2+4)),v.rect(E.x+(E.tx??0),E.y+(E.ty??0),E.w,E.h),v.rect(D.x,D.y+o-s(o),x,S),F.push({name:e,colorIndex:c,line:y,bkg:E,label:D})});let ee=[];for(let e of p.values())for(let t of e.parents)ee.push(P(p.get(t),e));let te={direction:t,viewBox:{x:0,y:0,width:0,height:0},branches:F,arrows:ee,commits:j(!0),showBranches:r.showBranches,look:i};if(Number.isFinite(v.minX)||v.add(0,0),e.title){let t=v.minX+(v.maxX-v.minX)/2,n=u(e.title,18);te.title={text:e.title,x:t,y:-r.titleTopMargin},v.rect(t-n/2,-r.titleTopMargin-s(18),n,s(18)+c(18))}return te.viewBox={x:v.minX-r.diagramPadding,y:v.minY-r.diagramPadding,width:v.maxX-v.minX+2*r.diagramPadding,height:v.maxY-v.minY+2*r.diagramPadding},te}function X(e){return String(Math.round(e*1e4)/1e4)}var dl=e=>`zm-git-drop-shadow-${e===`#FFFFFF`?`dark`:`light`}`;function fl(t,n,r){let i=n.redux&&!n.colorTheme,a=Array.from({length:n.colorLimit},(e,n)=>` --git-color-${n}: ${i?`var(--fg)`:Bo(n,t.accent,t.bg)};`),o=Array.from({length:n.colorLimit},(e,t)=>(n.redux?` .branch-label${t} { fill: var(--fg); font-weight: 600; }\n`:` .branch-label${t} { fill: var(--bg); }\n`)+` .commit${t} { stroke: var(--git-color-${t}); fill: var(--git-color-${t}); }\n .commit-highlight${t} { stroke: var(--fg); fill: var(--fg); }\n`+(n.redux?` .label${t} { fill: var(--bg); stroke: var(--git-color-${t}); stroke-width: 2; font-weight: 600; }\n`:` .label${t} { fill: var(--git-color-${t}); }\n`)+` .arrow${t} { stroke: var(--git-color-${t}); }`),s=(0,e.paletteClass)(a);return{css:`${(0,e.styleOpenTag)(r)}
134
137
  .branch-label { fill: var(--bg); font-size: 16px; }
135
- ${i.join(`
138
+ ${o.join(`
136
139
  `)}
137
- .branch { stroke-width: 1; stroke: var(--_line); stroke-dasharray: 2; }
138
- .commit-label { font-size: 10px; fill: var(--_text); }
139
- .commit-label-bkg { fill: var(--_node-fill); opacity: 0.5; }
140
+ ${n.thinBranch?` .branch { stroke-width: 2; stroke: var(--_line); stroke-dasharray: 4 2; }`:` .branch { stroke-width: 1; stroke: var(--_line); stroke-dasharray: 2; }`}
141
+ .commit-label { font-size: 10px; fill: var(--_text);${n.redux?` font-weight: 600;`:``} }
142
+ .commit-label-bkg { ${n.redux?`fill: transparent;`:`fill: var(--_node-fill); opacity: 0.5;`} }
140
143
  .tag-label { font-size: 10px; fill: var(--_text); }
141
- .tag-label-bkg { fill: var(--_node-fill); stroke: var(--_node-stroke); }
144
+ .tag-label-bkg { fill: ${n.redux?`var(--bg)`:`var(--_node-fill)`}; stroke: ${n.redux?`var(--fg)`:`var(--_node-stroke)`}; }
142
145
  .tag-hole { fill: var(--fg); }
143
146
  .commit-cherry-pick { stroke: var(--_text); fill: var(--_text); }
144
147
  circle.commit-cherry-pick[fill] { fill: var(--bg); }
145
148
  line.commit-cherry-pick { stroke: var(--bg); }
146
- .commit-merge { stroke: var(--_node-fill); fill: var(--_node-fill); }
147
- .commit-reverse { stroke: var(--_node-fill); fill: var(--_node-fill); stroke-width: 3; }
148
- .commit-highlight-inner { stroke: var(--_node-fill); fill: var(--_node-fill); }
149
- .arrow { stroke-width: 8; stroke-linecap: round; fill: none; }
149
+ .commit-merge { stroke: ${n.redux?`var(--bg)`:`var(--_node-fill)`}; fill: ${n.redux?`var(--bg)`:`var(--_node-fill)`}; }
150
+ .commit-reverse { stroke: ${n.redux?`var(--bg)`:`var(--_node-fill)`}; fill: ${n.redux?`var(--bg)`:`var(--_node-fill)`}; stroke-width: ${n.redux?2:3}; }
151
+ .commit-highlight-inner { stroke: ${n.redux?`var(--bg)`:`var(--_node-fill)`}; fill: ${n.redux?`var(--bg)`:`var(--_node-fill)`}; }
152
+ .arrow { stroke-width: ${n.redux?2:8}; stroke-linecap: round; fill: none; }
150
153
  .gitTitleText { text-anchor: middle; font-size: 18px; fill: var(--_text); }
151
154
  .branchLabel text, .commit-label, .tag-label { font-family: inherit; }
152
- .${a} {
153
- ${r.join(`
155
+ .${s} {
156
+ ${a.join(`
154
157
  `)}
155
158
  }
156
- </style>`,cls:a}}function Mc(t){let n=(0,e.escapeXml)(t.cls);switch(t.kind){case`circle`:return`<circle cx="${Y(t.cx)}" cy="${Y(t.cy)}" r="${t.r}"${t.fill?` fill="${t.fill}"`:``} class="${n}"/>`;case`rect`:return`<rect x="${Y(t.x)}" y="${Y(t.y)}" width="${t.w}" height="${t.h}" class="${n}"/>`;case`path`:return`<path d="${t.d}" class="${n}"/>`;case`line`:return`<line x1="${Y(t.x1)}" y1="${Y(t.y1)}" x2="${Y(t.x2)}" y2="${Y(t.y2)}"${t.stroke?` stroke="${t.stroke}"`:``} class="${n}"/>`}}function Nc(t,n,r=`Inter`,i=!1,a,o,s,c={}){let{viewBox:l}=t,{css:u,cls:d}=jc(n,c.nonce),f=[];if(f.push(R((0,e.withRootClass)((0,e.svgOpenTag)(Number(Y(l.width)),Number(Y(l.height)),n,i,o,s,void 0,c.styleAttribute,c.description),d),a)),f.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),f.push(u),f.push(`<g transform="translate(${Y(-l.x)}, ${Y(-l.y)})">`),t.showBranches){f.push(`<g>`);for(let n of t.branches){let{line:t,bkg:r}=n;f.push(`<line x1="${Y(t.x1)}" y1="${Y(t.y1)}" x2="${Y(t.x2)}" y2="${Y(t.y2)}" class="branch branch${n.colorIndex}"/>`,`<rect class="branchLabelBkg label${n.colorIndex}" rx="4" ry="4" x="${Y(r.x)}" y="${Y(r.y)}" width="${Y(r.w)}" height="${Y(r.h)}"${r.tx===void 0?``:` transform="translate(${Y(r.tx)}, ${Y(r.ty??0)})"`}/>`,`<g class="branchLabel"><g class="label branch-label${n.colorIndex}" transform="translate(${Y(n.label.x)}, ${Y(n.label.y)})"><text>${n.name.split(/\\n|\n|<br\s*\/?>/gi).map(t=>`<tspan xml:space="preserve" dy="1em" x="0" class="row">${(0,e.escapeXml)(t.trim())}</tspan>`).join(``)}</text></g></g>`)}f.push(`</g>`)}f.push(`<g class="commit-arrows">`);for(let e of t.arrows)f.push(`<path d="${e.d}" class="arrow arrow${e.colorIndex}"/>`);f.push(`</g>`),f.push(`<g class="commit-bullets">`);for(let e of t.commits)for(let t of e.shapes)f.push(Mc(t));f.push(`</g>`),f.push(`<g class="commit-labels">`);for(let n of t.commits){let t=n.label;if(t){let n=t.rotate?` transform="${t.rotate}"`:``,r=`<rect class="commit-label-bkg" x="${Y(t.rect.x)}" y="${Y(t.rect.y)}" width="${Y(t.rect.w)}" height="${Y(t.rect.h)}"${n}/><text x="${Y(t.textPos.x)}" y="${Y(t.textPos.y)}" class="commit-label"${n}>${(0,e.escapeXml)(t.text)}</text>`;f.push(t.groupTransform?`<g transform="${t.groupTransform}">${r}</g>`:`<g>${r}</g>`)}for(let t of n.tags)f.push(`<polygon class="tag-label-bkg" points="${t.points}"${t.polygonTransform?` transform="${t.polygonTransform}"`:``}/>`,`<circle cx="${Y(t.hole.cx)}" cy="${Y(t.hole.cy)}" r="1.5" class="tag-hole"${t.holeTransform?` transform="${t.holeTransform}"`:``}/>`,`<text x="${Y(t.textPos.x)}" y="${Y(t.textPos.y)}" class="tag-label"${t.textTransform?` transform="${t.textTransform}"`:``}>${(0,e.escapeXml)(t.text)}</text>`)}return f.push(`</g>`),t.title&&f.push(`<text x="${Y(t.title.x)}" y="${Y(t.title.y)}" class="gitTitleText">${(0,e.escapeXml)(t.title.text)}</text>`),f.push(`</g>`,`</svg>`),f.join(`
157
- `)}var Pc={labelFontSize:12,byteFontSize:10,titleFontSize:14};function Fc(e){let n=(0,t.resolvePacketConfig)(e.config),{rowHeight:r,paddingX:i,paddingY:a,bitWidth:o,bitsPerRow:s,showBits:c}=n,l=n.bitOrder===`descending`,u=r+a,d=u*(e.words.length+1)-(e.title?0:r),f=o*s+2;return{width:f,height:d,rows:e.words.map((e,t)=>{let n=t*u+a;return e.map(e=>{let t=e.end-e.start+1,a=e.start%s,u=(l?s-a-t:a)*o+1,d=t*o-i,f={x:u,y:n,width:d,height:r,label:e.label,labelX:u+d/2,labelY:n+r/2};if(c){let[r,i]=l?[e.end,e.start]:[e.start,e.end],a=t===1;f.bits=[{text:String(r),x:u+(a?d/2:0),y:n-2,anchor:a?`middle`:`start`}],a||f.bits.push({text:String(i),x:u+d,y:n-2,anchor:`end`})}return f})}),...e.title&&{title:{text:e.title,x:f/2,y:d-u/2}}}}function Ic(e){return String(Math.round(e*100)/100)}function Lc(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[R((0,e.svgOpenTag)(t.width,t.height,n,i,o,s,void 0,c.styleAttribute,c.description),a),(0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont),`${(0,e.styleOpenTag)(c.nonce)}
159
+ </style>`,cls:s}}function pl(e){return e.neo?e.shadowFlood?` style="filter:url(#${dl(e.shadowFlood)})"`:` style="${e.neoFilter}"`:``}function ml(t){let n=(0,e.escapeXml)(t.cls);switch(t.kind){case`circle`:return`<circle cx="${X(t.cx)}" cy="${X(t.cy)}" r="${t.r}"${t.fill?` fill="${t.fill}"`:``} class="${n}"/>`;case`rect`:return`<rect x="${X(t.x)}" y="${X(t.y)}" width="${t.w}" height="${t.h}" class="${n}"/>`;case`path`:return`<path d="${t.d}" class="${n}"/>`;case`line`:return`<line x1="${X(t.x1)}" y1="${X(t.y1)}" x2="${X(t.x2)}" y2="${X(t.y2)}"${t.stroke?` stroke="${t.stroke}"`:``} class="${n}"/>`}}function hl(t,n,r=`Inter`,i=!1,a,o,s,c={}){let{viewBox:l}=t,{css:u,cls:d}=fl(n,t.look,c.nonce),f=[];if(f.push(z((0,e.withRootClass)((0,e.svgOpenTag)(Number(X(l.width)),Number(X(l.height)),n,i,o,s,void 0,c.styleAttribute,c.description),d),a)),f.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),f.push(u),t.look.shadowFlood&&f.push(`<defs><filter id="${dl(t.look.shadowFlood)}" height="130%" width="130%"><feDropShadow dx="4" dy="4" stdDeviation="0" flood-opacity="0.06" flood-color="${t.look.shadowFlood}"/></filter></defs>`),f.push(`<g transform="translate(${X(-l.x)}, ${X(-l.y)})">`),t.showBranches){f.push(`<g>`);for(let n of t.branches){let{line:r,bkg:i}=n;f.push(`<line x1="${X(r.x1)}" y1="${X(r.y1)}" x2="${X(r.x2)}" y2="${X(r.y2)}" class="branch branch${n.colorIndex}"/>`,`<rect${t.look.neo?` data-look="neo"`:``} class="branchLabelBkg label${n.colorIndex}"${pl(t.look)} rx="${i.radius}" ry="${i.radius}" x="${X(i.x)}" y="${X(i.y)}" width="${X(i.w)}" height="${X(i.h)}"${i.tx===void 0?``:` transform="translate(${X(i.tx)}, ${X(i.ty??0)})"`}/>`,`<g class="branchLabel"><g class="label branch-label${n.colorIndex}" transform="translate(${X(n.label.x)}, ${X(n.label.y)})"><text>${n.name.split(/\\n|\n|<br\s*\/?>/gi).map(t=>`<tspan xml:space="preserve" dy="1em" x="0" class="row">${(0,e.escapeXml)(t.trim())}</tspan>`).join(``)}</text></g></g>`)}f.push(`</g>`)}f.push(`<g class="commit-arrows">`);for(let e of t.arrows)f.push(`<path d="${e.d}" class="arrow arrow${e.colorIndex}"/>`);f.push(`</g>`),f.push(`<g class="commit-bullets">`);for(let e of t.commits)for(let t of e.shapes)f.push(ml(t));f.push(`</g>`),f.push(`<g class="commit-labels">`);for(let n of t.commits){let t=n.label;if(t){let n=t.rotate?` transform="${t.rotate}"`:``,r=`<rect class="commit-label-bkg" x="${X(t.rect.x)}" y="${X(t.rect.y)}" width="${X(t.rect.w)}" height="${X(t.rect.h)}"${n}/><text x="${X(t.textPos.x)}" y="${X(t.textPos.y)}" class="commit-label"${n}>${(0,e.escapeXml)(t.text)}</text>`;f.push(t.groupTransform?`<g transform="${t.groupTransform}">${r}</g>`:`<g>${r}</g>`)}for(let t of n.tags)f.push(`<polygon class="tag-label-bkg" points="${t.points}"${t.polygonTransform?` transform="${t.polygonTransform}"`:``}/>`,`<circle cx="${X(t.hole.cx)}" cy="${X(t.hole.cy)}" r="1.5" class="tag-hole"${t.holeTransform?` transform="${t.holeTransform}"`:``}/>`,`<text x="${X(t.textPos.x)}" y="${X(t.textPos.y)}" class="tag-label"${t.textTransform?` transform="${t.textTransform}"`:``}>${(0,e.escapeXml)(t.text)}</text>`)}return f.push(`</g>`),t.title&&f.push(`<text x="${X(t.title.x)}" y="${X(t.title.y)}" class="gitTitleText">${(0,e.escapeXml)(t.title.text)}</text>`),f.push(`</g>`,`</svg>`),f.join(`
160
+ `)}var gl={labelFontSize:12,byteFontSize:10,titleFontSize:14};function _l(e){let n=(0,t.resolvePacketConfig)(e.config),{rowHeight:r,paddingX:i,paddingY:a,bitWidth:o,bitsPerRow:s,showBits:c}=n,l=n.bitOrder===`descending`,u=r+a,d=u*(e.words.length+1)-(e.title?0:r),f=o*s+2;return{width:f,height:d,rows:e.words.map((e,t)=>{let n=t*u+a;return e.map(e=>{let t=e.end-e.start+1,a=e.start%s,u=(l?s-a-t:a)*o+1,d=t*o-i,f={x:u,y:n,width:d,height:r,label:e.label,labelX:u+d/2,labelY:n+r/2};if(c){let[r,i]=l?[e.end,e.start]:[e.start,e.end],a=t===1;f.bits=[{text:String(r),x:u+(a?d/2:0),y:n-2,anchor:a?`middle`:`start`}],a||f.bits.push({text:String(i),x:u+d,y:n-2,anchor:`end`})}return f})}),...e.title&&{title:{text:e.title,x:f/2,y:d-u/2}}}}function vl(e){return String(Math.round(e*100)/100)}function yl(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[z((0,e.svgOpenTag)(t.width,t.height,n,i,o,s,void 0,c.styleAttribute,c.description),a),(0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont),`${(0,e.styleOpenTag)(c.nonce)}
158
161
  .packetBlock { fill: var(--_node-fill); stroke: var(--_node-stroke); stroke-width: 1; }
159
- .packetLabel { fill: var(--_text); font-size: ${Pc.labelFontSize}px; }
160
- .packetByte { fill: var(--_text-muted); font-size: ${Pc.byteFontSize}px; }
161
- .packetTitle { fill: var(--_text); font-size: ${Pc.titleFontSize}px; }
162
- </style>`];for(let n of t.rows){let t=[`<g>`];for(let r of n){t.push(`<rect x="${Ic(r.x)}" y="${Ic(r.y)}" width="${Ic(r.width)}" height="${Ic(r.height)}" class="packetBlock"/>`,`<text x="${Ic(r.labelX)}" y="${Ic(r.labelY)}" class="packetLabel" dominant-baseline="middle" text-anchor="middle">${(0,e.escapeXml)(r.label)}</text>`);for(let[e,n]of(r.bits??[]).entries())t.push(`<text x="${Ic(n.x)}" y="${Ic(n.y)}" class="packetByte ${e===0?`start`:`end`}" dominant-baseline="auto" text-anchor="${n.anchor}">${n.text}</text>`)}t.push(`</g>`),l.push(t.join(``))}return t.title&&l.push(`<text x="${Ic(t.title.x)}" y="${Ic(t.title.y)}" class="packetTitle" dominant-baseline="middle" text-anchor="middle">${(0,e.escapeXml)(t.title.text)}</text>`),l.push(`</svg>`),l.join(`
163
- `)}var Rc={width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17,labelPad:4,legendLineHeight:20},zc=e=>Math.round(e*100)/100+0;function Bc(e,t){let n=e.length,r=t=>e[(t%n+n)%n],i=`M${zc(r(0).x)},${zc(r(0).y)}`;for(let e=0;e<n;e++){let n=r(e-1),a=r(e),o=r(e+1),s=r(e+2),c={x:a.x+(o.x-n.x)*t,y:a.y+(o.y-n.y)*t},l={x:o.x-(s.x-a.x)*t,y:o.y-(s.y-a.y)*t};i+=` C${zc(c.x)},${zc(c.y)} ${zc(l.x)},${zc(l.y)} ${zc(o.x)},${zc(o.y)}`}return`${i} Z`}function Vc(e){let t={...Rc,...e.config},{axes:n,curves:r,options:i}=e,a=n.length,o=Math.min(t.width,t.height)/2,s=e=>2*Math.PI*e/a-Math.PI/2,c=i.max??Math.max(...r.map(e=>Math.max(...e.entries))),l=i.min,u=Array.from({length:Math.max(0,Math.ceil(i.ticks))},(e,t)=>{let r=o*(t+1)/i.ticks;return i.graticule===`circle`?{kind:`circle`,r:zc(r)}:{kind:`polygon`,points:n.map((e,t)=>({x:zc(r*Math.cos(s(t))),y:zc(r*Math.sin(s(t)))}))}}),d=n.map((e,n)=>{let r=Math.cos(s(n)),i=Math.sin(s(n));return{x2:zc(o*t.axisScaleFactor*r),y2:zc(o*t.axisScaleFactor*i),label:e.label,labelX:zc(o*t.axisLabelFactor*r+t.labelPad*r),labelY:zc(o*t.axisLabelFactor*i+t.labelPad*i),anchor:r>.01?`start`:r<-.01?`end`:`middle`,baseline:i>.01?`hanging`:i<-.01?`auto`:`central`}}),f=[];r.forEach((e,n)=>{if(e.entries.length!==a)return;let r=e.entries.map((e,t)=>{let n=o*(Math.min(Math.max(e,l),c)-l)/(c-l);return{x:n*Math.cos(s(t)),y:n*Math.sin(s(t))}});f.push(i.graticule===`circle`?{index:n,kind:`path`,d:Bc(r,t.curveTension)}:{index:n,kind:`polygon`,points:r.map(e=>({x:zc(e.x),y:zc(e.y)}))})});let p=(t.width/2+t.marginRight)*3/4,m=-(t.height/2+t.marginTop)*3/4,h=i.showLegend?r.map((e,n)=>({index:n,label:e.label,x:p,y:m+n*t.legendLineHeight})):[];return{width:t.width+t.marginLeft+t.marginRight,height:t.height+t.marginTop+t.marginBottom,centerX:t.marginLeft+t.width/2,centerY:t.marginTop+t.height/2,rings:u,axes:d,curves:f,legend:h,title:{text:e.title??``,x:0,y:-t.height/2-t.marginTop},style:e.style}}var Hc={axisStrokeWidth:2,axisLabelFontSize:12,curveOpacity:.5,curveStrokeWidth:2,graticuleOpacity:.3,graticuleStrokeWidth:1,legendFontSize:12};function Uc(t,n,r){let i={...Hc,...t.style},a=[...new Set([...t.curves.map(e=>e.index),...t.legend.map(e=>e.index)])].sort((e,t)=>e-t),o=a.map(e=>` --radar-color-${e}: ${wo(e,n.accent,n.bg)};`),s=a.map(e=>` .radarCurve-${e} { fill: var(--radar-color-${e}); fill-opacity: ${i.curveOpacity}; stroke: var(--radar-color-${e}); stroke-width: ${i.curveStrokeWidth}; }\n .radarLegendBox-${e} { fill: var(--radar-color-${e}); fill-opacity: ${i.curveOpacity}; stroke: var(--radar-color-${e}); }`),c=(0,e.paletteClass)(o);return{css:`${(0,e.styleOpenTag)(r)}
162
+ .packetLabel { fill: var(--_text); font-size: ${gl.labelFontSize}px; }
163
+ .packetByte { fill: var(--_text-muted); font-size: ${gl.byteFontSize}px; }
164
+ .packetTitle { fill: var(--_text); font-size: ${gl.titleFontSize}px; }
165
+ </style>`];for(let n of t.rows){let t=[`<g>`];for(let r of n){t.push(`<rect x="${vl(r.x)}" y="${vl(r.y)}" width="${vl(r.width)}" height="${vl(r.height)}" class="packetBlock"/>`,`<text x="${vl(r.labelX)}" y="${vl(r.labelY)}" class="packetLabel" dominant-baseline="middle" text-anchor="middle">${(0,e.escapeXml)(r.label)}</text>`);for(let[e,n]of(r.bits??[]).entries())t.push(`<text x="${vl(n.x)}" y="${vl(n.y)}" class="packetByte ${e===0?`start`:`end`}" dominant-baseline="auto" text-anchor="${n.anchor}">${n.text}</text>`)}t.push(`</g>`),l.push(t.join(``))}return t.title&&l.push(`<text x="${vl(t.title.x)}" y="${vl(t.title.y)}" class="packetTitle" dominant-baseline="middle" text-anchor="middle">${(0,e.escapeXml)(t.title.text)}</text>`),l.push(`</svg>`),l.join(`
166
+ `)}var bl={width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17,labelPad:4,legendLineHeight:20},xl=e=>Math.round(e*100)/100+0;function Sl(e,t){let n=e.length,r=t=>e[(t%n+n)%n],i=`M${xl(r(0).x)},${xl(r(0).y)}`;for(let e=0;e<n;e++){let n=r(e-1),a=r(e),o=r(e+1),s=r(e+2),c={x:a.x+(o.x-n.x)*t,y:a.y+(o.y-n.y)*t},l={x:o.x-(s.x-a.x)*t,y:o.y-(s.y-a.y)*t};i+=` C${xl(c.x)},${xl(c.y)} ${xl(l.x)},${xl(l.y)} ${xl(o.x)},${xl(o.y)}`}return`${i} Z`}function Cl(e){let t={...bl,...e.config},{axes:n,curves:r,options:i}=e,a=n.length,o=Math.min(t.width,t.height)/2,s=e=>2*Math.PI*e/a-Math.PI/2,c=i.max??Math.max(...r.map(e=>Math.max(...e.entries))),l=i.min,u=Array.from({length:Math.max(0,Math.ceil(i.ticks))},(e,t)=>{let r=o*(t+1)/i.ticks;return i.graticule===`circle`?{kind:`circle`,r:xl(r)}:{kind:`polygon`,points:n.map((e,t)=>({x:xl(r*Math.cos(s(t))),y:xl(r*Math.sin(s(t)))}))}}),d=n.map((e,n)=>{let r=Math.cos(s(n)),i=Math.sin(s(n));return{x2:xl(o*t.axisScaleFactor*r),y2:xl(o*t.axisScaleFactor*i),label:e.label,labelX:xl(o*t.axisLabelFactor*r+t.labelPad*r),labelY:xl(o*t.axisLabelFactor*i+t.labelPad*i),anchor:r>.01?`start`:r<-.01?`end`:`middle`,baseline:i>.01?`hanging`:i<-.01?`auto`:`central`}}),f=[];r.forEach((e,n)=>{if(e.entries.length!==a)return;let r=e.entries.map((e,t)=>{let n=o*(Math.min(Math.max(e,l),c)-l)/(c-l);return{x:n*Math.cos(s(t)),y:n*Math.sin(s(t))}});f.push(i.graticule===`circle`?{index:n,kind:`path`,d:Sl(r,t.curveTension)}:{index:n,kind:`polygon`,points:r.map(e=>({x:xl(e.x),y:xl(e.y)}))})});let p=(t.width/2+t.marginRight)*3/4,m=-(t.height/2+t.marginTop)*3/4,h=i.showLegend?r.map((e,n)=>({index:n,label:e.label,x:p,y:m+n*t.legendLineHeight})):[];return{width:t.width+t.marginLeft+t.marginRight,height:t.height+t.marginTop+t.marginBottom,centerX:t.marginLeft+t.width/2,centerY:t.marginTop+t.height/2,rings:u,axes:d,curves:f,legend:h,title:{text:e.title??``,x:0,y:-t.height/2-t.marginTop},style:e.style}}var wl={axisStrokeWidth:2,axisLabelFontSize:12,curveOpacity:.5,curveStrokeWidth:2,graticuleOpacity:.3,graticuleStrokeWidth:1,legendFontSize:12};function Tl(t,n,r){let i={...wl,...t.style},a=[...new Set([...t.curves.map(e=>e.index),...t.legend.map(e=>e.index)])].sort((e,t)=>e-t),o=a.map(e=>` --radar-color-${e}: ${Bo(e,n.accent,n.bg)};`),s=a.map(e=>` .radarCurve-${e} { fill: var(--radar-color-${e}); fill-opacity: ${i.curveOpacity}; stroke: var(--radar-color-${e}); stroke-width: ${i.curveStrokeWidth}; }\n .radarLegendBox-${e} { fill: var(--radar-color-${e}); fill-opacity: ${i.curveOpacity}; stroke: var(--radar-color-${e}); }`),c=(0,e.paletteClass)(o);return{css:`${(0,e.styleOpenTag)(r)}
164
167
  .radarTitle { fill: var(--_text); font-size: 16px; dominant-baseline: hanging; text-anchor: middle; }
165
168
  .radarAxisLine { stroke: var(--fg); stroke-width: ${i.axisStrokeWidth}; }
166
169
  .radarAxisLabel { fill: var(--_text); font-size: ${i.axisLabelFontSize}px; }
@@ -169,8 +172,8 @@ ${r.join(`
169
172
  `)}\n }`:``}
170
173
  ${s.join(`
171
174
  `)}
172
- </style>`,cls:c}}function Wc(e){let t=String(Math.round(e*100)/100);return t===`-0`?`0`:t}var Gc=e=>e.map(e=>`${Wc(e.x)},${Wc(e.y)}`).join(` `);function Kc(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[],{css:u,cls:d}=Uc(t,n,c.nonce);l.push(R((0,e.withRootClass)((0,e.svgOpenTag)(t.width,t.height,n,i,o,s,void 0,c.styleAttribute,c.description),d),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(u),l.push(`<g transform="translate(${Wc(t.centerX)}, ${Wc(t.centerY)})">`);for(let e of t.rings)l.push(e.kind===`circle`?`<circle r="${Wc(e.r)}" class="radarGraticule"/>`:`<polygon points="${Gc(e.points)}" class="radarGraticule"/>`);for(let n of t.axes)l.push(`<line x1="0" y1="0" x2="${Wc(n.x2)}" y2="${Wc(n.y2)}" class="radarAxisLine"/>`,`<text x="${Wc(n.labelX)}" y="${Wc(n.labelY)}" text-anchor="${n.anchor}" dominant-baseline="${n.baseline}" class="radarAxisLabel">${(0,e.escapeXml)(n.label)}</text>`);for(let e of t.curves)l.push(e.kind===`path`?`<path d="${e.d}" class="radarCurve-${e.index}"/>`:`<polygon points="${Gc(e.points??[])}" class="radarCurve-${e.index}"/>`);for(let n of t.legend)l.push(`<g transform="translate(${Wc(n.x)}, ${Wc(n.y)})"><rect width="12" height="12" class="radarLegendBox-${n.index}"/><text x="16" y="0" class="radarLegendText">${(0,e.escapeXml)(n.label)}</text></g>`);return l.push(`<text class="radarTitle" x="${Wc(t.title.x)}" y="${Wc(t.title.y)}">${(0,e.escapeXml)(t.title.text)}</text>`,`</g>`,`</svg>`),l.join(`
173
- `)}var qc={sectionWidth:200,padding:10,lineHeight:24,cardPadding:20,minHeading:25,minColumn:50,viewBoxPadding:10,cornerRadius:5},Jc={"Very High":`red`,High:`orange`,Low:`blue`,"Very Low":`lightblue`},Yc=16.328125,Xc=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}]/gu,Zc=e=>(e.text.match(Xc)?.length??0)*Yc+$s(e.text.replace(Xc,``),16,e.bold);function Qc(e,t){return e?Ms(e.replace(/[ \t]+/g,` `),t,Zc,!0):{lines:[],width:0,height:0}}function $c(e,t,n){return{lines:e.lines,x:t,y:n,width:e.width,height:e.height}}function el(e,t){return e.ticket&&t?t.replace(`#TICKET#`,e.ticket):void 0}function tl(e){let t=e.config?.sectionWidth||qc.sectionWidth,n=qc.padding,r=t-1.5*n,i=r-10,a=[],o=e.columns.map(e=>Qc(e.text,t)),s=Math.max(qc.minHeading,...o.map(e=>e.height)),c=-t*3/2+s;e.columns.forEach((l,u)=>{let d=u+1,f=t*d+(d-1)*n/2,p=c,m=l.cards.map(t=>{let a=Qc(t.text,i),o=Qc(t.ticket,i),s=Qc(t.assigned,i),c=Math.max(o.height,s.height)/2,l=a.height+qc.cardPadding+c,u=p+l/2;p=u+l/2+n/2;let d=f-r/2+10,m=u-c+a.height/2,h=el(t,e.config?.ticketBaseUrl);return{cx:f,cy:u,width:r,height:l,title:$c(a,d,u-c-a.height/2),...o.height>0&&{ticket:$c(o,d,m)},...s.height>0&&{assigned:$c(s,f+10+r/2-s.width-20,m)},...h!==void 0&&{ticketUrl:h},...t.priority!==void 0&&{priorityColor:Jc[t.priority]??``},...t.className!==void 0&&{className:t.className}}}),h=o[u];a.push({x:f-t/2,y:-t*3/2,width:t,height:Math.max(p-c+3*n,qc.minColumn)+(s-qc.minHeading),colorClass:d,label:$c(h,f-h.width/2,-t*3/2),...l.className!==void 0&&{className:l.className},cards:m})});let l=a.flatMap(e=>[e.label,...e.cards.flatMap(e=>[e.title,e.ticket,e.assigned])]),u=Math.min(...a.map(e=>e.x),...l.flatMap(e=>e?[e.x]:[])),d=Math.max(...a.map(e=>e.x+e.width),...l.flatMap(e=>e?[e.x+e.width]:[])),f=-t*3/2,p=Math.max(...a.map(e=>e.y+e.height)),m=qc.viewBoxPadding;return{viewBox:a.length===0?{x:0,y:0,width:2*m,height:2*m}:{x:u-m,y:f-m,width:d-u+2*m,height:p-f+2*m},columns:a}}var nl=e=>String(Math.round(e*100)/100);function rl(e){return e===void 0?``:e.split(/\s+/).filter(e=>/^[A-Za-z_][\w-]*$/.test(e)).map(e=>` ${e}`).join(``)}function il(t,n,r){let i=t.columns.map(e=>e.colorClass),a=i.map(e=>` --kb-color-${e}: ${wo(e-1,n.accent,n.bg)};`),o=i.map(e=>` .section-${e} rect { fill: color-mix(in srgb, var(--kb-color-${e}) 32%, var(--bg)); stroke: color-mix(in srgb, var(--kb-color-${e}) 32%, var(--bg)); }`),s=(0,e.paletteClass)(a);return{css:`${(0,e.styleOpenTag)(r)}
175
+ </style>`,cls:c}}function El(e){let t=String(Math.round(e*100)/100);return t===`-0`?`0`:t}var Dl=e=>e.map(e=>`${El(e.x)},${El(e.y)}`).join(` `);function Ol(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[],{css:u,cls:d}=Tl(t,n,c.nonce);l.push(z((0,e.withRootClass)((0,e.svgOpenTag)(t.width,t.height,n,i,o,s,void 0,c.styleAttribute,c.description),d),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(u),l.push(`<g transform="translate(${El(t.centerX)}, ${El(t.centerY)})">`);for(let e of t.rings)l.push(e.kind===`circle`?`<circle r="${El(e.r)}" class="radarGraticule"/>`:`<polygon points="${Dl(e.points)}" class="radarGraticule"/>`);for(let n of t.axes)l.push(`<line x1="0" y1="0" x2="${El(n.x2)}" y2="${El(n.y2)}" class="radarAxisLine"/>`,`<text x="${El(n.labelX)}" y="${El(n.labelY)}" text-anchor="${n.anchor}" dominant-baseline="${n.baseline}" class="radarAxisLabel">${(0,e.escapeXml)(n.label)}</text>`);for(let e of t.curves)l.push(e.kind===`path`?`<path d="${e.d}" class="radarCurve-${e.index}"/>`:`<polygon points="${Dl(e.points??[])}" class="radarCurve-${e.index}"/>`);for(let n of t.legend)l.push(`<g transform="translate(${El(n.x)}, ${El(n.y)})"><rect width="12" height="12" class="radarLegendBox-${n.index}"/><text x="16" y="0" class="radarLegendText">${(0,e.escapeXml)(n.label)}</text></g>`);return l.push(`<text class="radarTitle" x="${El(t.title.x)}" y="${El(t.title.y)}">${(0,e.escapeXml)(t.title.text)}</text>`,`</g>`,`</svg>`),l.join(`
176
+ `)}var kl={sectionWidth:200,padding:10,lineHeight:24,cardPadding:20,minHeading:25,minColumn:50,viewBoxPadding:10,cornerRadius:5},Al={"Very High":`red`,High:`orange`,Low:`blue`,"Very Low":`lightblue`},jl=16.328125,Ml=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}]/gu,Nl=e=>(e.text.match(Ml)?.length??0)*jl+xc(e.text.replace(Ml,``),16,e.bold);function Pl(e,t){return e?ec(e.replace(/[ \t]+/g,` `),t,Nl,!0):{lines:[],width:0,height:0}}function Fl(e,t,n){return{lines:e.lines,x:t,y:n,width:e.width,height:e.height}}function Il(e,t){return e.ticket&&t?t.replace(`#TICKET#`,e.ticket):void 0}function Ll(e){let t=e.config?.sectionWidth||kl.sectionWidth,n=kl.padding,r=t-1.5*n,i=r-10,a=[],o=e.columns.map(e=>Pl(e.text,t)),s=Math.max(kl.minHeading,...o.map(e=>e.height)),c=-t*3/2+s;e.columns.forEach((l,u)=>{let d=u+1,f=t*d+(d-1)*n/2,p=c,m=l.cards.map(t=>{let a=Pl(t.text,i),o=Pl(t.ticket,i),s=Pl(t.assigned,i),c=Math.max(o.height,s.height)/2,l=a.height+kl.cardPadding+c,u=p+l/2;p=u+l/2+n/2;let d=f-r/2+10,m=u-c+a.height/2,h=Il(t,e.config?.ticketBaseUrl);return{cx:f,cy:u,width:r,height:l,title:Fl(a,d,u-c-a.height/2),...o.height>0&&{ticket:Fl(o,d,m)},...s.height>0&&{assigned:Fl(s,f+10+r/2-s.width-20,m)},...h!==void 0&&{ticketUrl:h},...t.priority!==void 0&&{priorityColor:Al[t.priority]??``},...t.className!==void 0&&{className:t.className}}}),h=o[u];a.push({x:f-t/2,y:-t*3/2,width:t,height:Math.max(p-c+3*n,kl.minColumn)+(s-kl.minHeading),colorClass:d,label:Fl(h,f-h.width/2,-t*3/2),...l.className!==void 0&&{className:l.className},cards:m})});let l=a.flatMap(e=>[e.label,...e.cards.flatMap(e=>[e.title,e.ticket,e.assigned])]),u=Math.min(...a.map(e=>e.x),...l.flatMap(e=>e?[e.x]:[])),d=Math.max(...a.map(e=>e.x+e.width),...l.flatMap(e=>e?[e.x+e.width]:[])),f=-t*3/2,p=Math.max(...a.map(e=>e.y+e.height)),m=kl.viewBoxPadding;return{viewBox:a.length===0?{x:0,y:0,width:2*m,height:2*m}:{x:u-m,y:f-m,width:d-u+2*m,height:p-f+2*m},columns:a}}var Rl=e=>String(Math.round(e*100)/100);function zl(e){return e===void 0?``:e.split(/\s+/).filter(e=>/^[A-Za-z_][\w-]*$/.test(e)).map(e=>` ${e}`).join(``)}function Bl(t,n,r){let i=t.columns.map(e=>e.colorClass),a=i.map(e=>` --kb-color-${e}: ${Bo(e-1,n.accent,n.bg)};`),o=i.map(e=>` .section-${e} rect { fill: color-mix(in srgb, var(--kb-color-${e}) 32%, var(--bg)); stroke: color-mix(in srgb, var(--kb-color-${e}) 32%, var(--bg)); }`),s=(0,e.paletteClass)(a);return{css:`${(0,e.styleOpenTag)(r)}
174
177
  .kb-label { fill: var(--_text); font-size: 16px; }
175
178
  .kb-heading { text-anchor: middle; }
176
179
  .kb-bold { font-weight: 700; }
@@ -185,8 +188,8 @@ ${a.join(`
185
188
  }
186
189
  ${o.join(`
187
190
  `)}
188
- </style>`,cls:s}}function al(t,n=!1){return t.lines.map((r,i)=>{let a=r.map(t=>{let n=`${t.bold?`kb-bold`:``}${t.bold&&t.italic?` `:``}${t.italic?`kb-italic`:``}`,r=(0,e.escapeXml)(t.text);return n===``?r:`<tspan class="${n}">${r}</tspan>`}).join(``),o=t.y+qc.lineHeight*(i+.5);return`<text ${n?`x="${nl(t.x+t.width/2)}" class="kb-label kb-heading"`:`x="${nl(t.x)}" class="kb-label"`} y="${nl(o)}" dy="0.35em" xml:space="preserve">${a.trim()}</text>`}).join(``)}function ol(t){let n=t.cx-t.width/2,r=t.cy-t.height/2,i=qc.cornerRadius,a=`<g class="node${rl(t.className)}"><rect class="basic label-container" rx="${i}" ry="${i}" x="${nl(n)}" y="${nl(r)}" width="${nl(t.width)}" height="${nl(t.height)}"/>`+al(t.title);if(t.ticket){let n=al(t.ticket);a+=t.ticketUrl===void 0?n:`<a class="kanban-ticket-link" href="${(0,e.escapeXml)(t.ticketUrl)}" target="_blank" rel="noopener noreferrer">${n}</a>`}if(t.assigned&&(a+=al(t.assigned)),t.priorityColor!==void 0){let e=n+2;a+=`<line x1="${nl(e)}" y1="${nl(r+Math.floor(i/2))}" x2="${nl(e)}" y2="${nl(r+t.height-Math.floor(i/2))}" stroke-width="4"${t.priorityColor===``?``:` stroke="${t.priorityColor}"`}/>`}return a+`</g>`}function sl(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[],{css:u,cls:d}=il(t,n,c.nonce),f=t.viewBox;l.push(R((0,e.withRootClass)((0,e.svgOpenTag)(f.width,f.height,n,i,o,s,void 0,c.styleAttribute,c.description),d),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(u),l.push(`<g transform="translate(${nl(-f.x)}, ${nl(-f.y)})">`),l.push(`<g class="sections">`);for(let e of t.columns)l.push(`<g class="cluster section-${e.colorClass}${rl(e.className)}"><rect rx="${qc.cornerRadius}" ry="${qc.cornerRadius}" x="${nl(e.x)}" y="${nl(e.y)}" width="${nl(e.width)}" height="${nl(e.height)}"/><g class="cluster-label">${al(e.label,!0)}</g></g>`);l.push(`</g><g class="items">`);for(let e of t.columns)for(let t of e.cards)l.push(ol(t));return l.push(`</g></g></svg>`),l.join(`
189
- `)}var cl={width:600,height:400,nodeWidth:10,nodePadding:12,valuePadding:15,fontSize:14,labelGap:6,ascent:13,descent:3,iterations:6,labelFit:1.12},ll=e=>e.reduce((e,t)=>e+t.value,0);function ul(e,t,n){return e===`left`?t.depth:e===`right`?n-1-t.height:e===`justify`?t.sourceLinks.length?t.depth:n-1:t.targetLinks.length?t.depth:t.sourceLinks.length?Math.min(...t.sourceLinks.map(e=>e.target.depth))-1:0}function dl(t,n,r){let{x1:i,y1:a,dx:o,how:s}=r,c=r.dy,l=(e,t)=>e.y0-t.y0,u=(e,t)=>l(e.source,t.source)||e.index-t.index,d=(e,t)=>l(e.target,t.target)||e.index-t.index;for(let e of n)e.source.sourceLinks.push(e),e.target.targetLinks.push(e);for(let e of t)e.value=Math.max(ll(e.sourceLinks),ll(e.targetLinks));let f=(n,r)=>{let i=new Set(t),a=0;for(;i.size;){let o=new Set;for(let e of i){r(e,a);for(let t of n(e))o.add(t)}if(++a>t.length)throw new e.MermaidParseError(`circular link`,{diagramType:`sankey`});i=o}};f(e=>e.sourceLinks.map(e=>e.target),(e,t)=>e.depth=t),f(e=>e.targetLinks.map(e=>e.source),(e,t)=>e.height=t);let p=Math.max(...t.map(e=>e.depth))+1,m=(i-0-o)/(p-1),h=Array(p);for(let e of t){let t=Math.max(0,Math.min(p-1,Math.floor(ul(s,e,p))));e.layer=t,e.x0=0+t*m,e.x1=e.x0+o,h[t]?h[t].push(e):h[t]=[e]}c=Math.min(r.dy,(a-0)/(Math.max(...h.map(e=>e.length))-1));let g=e=>{for(let{sourceLinks:t,targetLinks:n}of e)t.sort(d),n.sort(u)},_=({sourceLinks:e,targetLinks:t})=>{for(let{source:{sourceLinks:e}}of t)e.sort(d);for(let{target:{targetLinks:t}}of e)t.sort(u)},v=Math.min(...h.map(e=>(a-0-(e.length-1)*c)/e.reduce((e,t)=>e+t.value,0)));for(let e of h){let t=0;for(let n of e){n.y0=t,n.y1=t+n.value*v,t=n.y1+c;for(let e of n.sourceLinks)e.width=e.value*v}t=(a-t+c)/(e.length+1);for(let n=0;n<e.length;++n){let r=e[n];r.y0+=t*(n+1),r.y1+=t*(n+1)}g(e)}let y=(e,t)=>{let n=e.y0-(e.sourceLinks.length-1)*c/2;for(let{target:r,width:i}of e.sourceLinks){if(r===t)break;n+=i+c}for(let{source:r,width:i}of t.targetLinks){if(r===e)break;n-=i}return n},b=(e,t)=>{let n=t.y0-(t.targetLinks.length-1)*c/2;for(let{source:r,width:i}of t.targetLinks){if(r===e)break;n+=i+c}for(let{target:r,width:i}of e.sourceLinks){if(r===t)break;n-=i}return n},x=(e,t,n,r)=>{let i=t;for(let t=n;t<e.length;++t){let n=e[t],a=(i-n.y0)*r;a>1e-6&&(n.y0+=a,n.y1+=a),i=n.y1+c}},S=(e,t,n,r)=>{let i=t;for(let t=n;t>=0;--t){let n=e[t],a=(n.y1-i)*r;a>1e-6&&(n.y0-=a,n.y1-=a),i=n.y0-c}},C=(e,t)=>{let n=e.length>>1,r=e[n];S(e,r.y0-c,n-1,t),x(e,r.y1+c,n+1,t),S(e,a,e.length-1,t),x(e,0,0,t)},w=(e,t)=>{for(let n=1;n<h.length;++n){let r=h[n];for(let t of r){let n=0,r=0;for(let{source:e,value:i}of t.targetLinks){let a=i*(t.layer-e.layer);n+=y(e,t)*a,r+=a}if(!(r>0))continue;let i=(n/r-t.y0)*e;t.y0+=i,t.y1+=i,_(t)}r.sort(l),C(r,t)}},T=(e,t)=>{for(let n=h.length-2;n>=0;--n){let r=h[n];for(let t of r){let n=0,r=0;for(let{target:e,value:i}of t.sourceLinks){let a=i*(e.layer-t.layer);n+=b(t,e)*a,r+=a}if(!(r>0))continue;let i=(n/r-t.y0)*e;t.y0+=i,t.y1+=i,_(t)}r.sort(l),C(r,t)}};for(let e=0;e<cl.iterations;++e){let t=.99**e,n=Math.max(1-t,(e+1)/cl.iterations);T(t,n),w(t,n)}for(let e of t){let t=e.y0,n=t;for(let n of e.sourceLinks)n.y0=t+n.width/2,t+=n.width;for(let t of e.targetLinks)t.y1=n+t.width/2,n+=t.width}}function fl(e){let t=Math.round(e*100)/100;return Number.isFinite(t)?t:e}var pl=e=>Math.round(e*1e6)/1e6;function ml(e){let t=e.config??{},n=t.width??cl.width,r=t.height??cl.height,i=t.showValues??!0,a=t.labelStyle??`legacy`,o=t.prefix??``,s=t.suffix??``,c=t.nodeWidth??cl.nodeWidth,l=new Map,u=e.nodes.map((e,t)=>{let n={id:e,index:t,sourceLinks:[],targetLinks:[],value:0,depth:0,height:0,layer:0,x0:0,x1:0,y0:0,y1:0};return l.set(e,n),n}),d=e.links.map((e,t)=>({index:t,source:l.get(e.source),target:l.get(e.target),value:e.value,width:0,y0:0,y1:0}));if(u.length===0||d.length===0)return{width:n,height:r,nodes:[],links:[],options:{linkColor:`gradient`,labelStyle:a,showValues:i}};dl(u,d,{x1:n,y1:r,dx:c,dy:(t.nodePadding??cl.nodePadding)+(i?cl.valuePadding:0),how:t.nodeAlignment??`justify`});let f=0,p=0;for(let e of u)e.value>f&&(f=e.value,p=e.layer);let m=u.map(e=>{let r=a===`outlined`?e.layer>=p:e.x0<n/2,c=i?`${e.id} ${o}${fl(e.value)}${s}`:e.id,l={id:e.id,index:e.index,x0:e.x0,y0:e.y0,x1:e.x1,y1:e.y1,value:e.value,layer:e.layer,label:{text:c,x:r?e.x1+cl.labelGap:e.x0-cl.labelGap,y:(e.y1+e.y0)/2,anchor:r?`start`:`end`}},u=t.nodeColors;return u&&Object.hasOwn(u,e.id)&&(l.color=u[e.id]),l}),h=d.map(e=>({source:e.source.index,target:e.target.index,value:e.value,width:e.width,x0:e.source.x1,y0:e.y0,x1:e.target.x0,y1:e.y1})),g=1/0,_=1/0,v=-1/0,y=-1/0,b=(e,t,n,r)=>{g=Math.min(g,e),_=Math.min(_,t),v=Math.max(v,n),y=Math.max(y,r)};for(let e of m){e.y1>e.y0&&b(e.x0,e.y0,e.x1,e.y1);let t=$s(e.label.text,cl.fontSize)*cl.labelFit,n=e.label.y+(i?0:.35*cl.fontSize),r=e.label.anchor===`start`?e.label.x:e.label.x-t;b(r,n-cl.ascent,r+t,n+cl.descent)}for(let e of h)b(e.x0,Math.min(e.y0,e.y1),e.x1,Math.max(e.y0,e.y1));let x=(e,t)=>pl(e-t);for(let e of m)e.x0=x(e.x0,g),e.x1=x(e.x1,g),e.y0=x(e.y0,_),e.y1=x(e.y1,_),e.label.x=x(e.label.x,g),e.label.y=x(e.label.y,_);for(let e of h)e.x0=x(e.x0,g),e.x1=x(e.x1,g),e.y0=x(e.y0,_),e.y1=x(e.y1,_);return{width:pl(v-g),height:pl(y-_),nodes:m,links:h,options:{linkColor:t.linkColor??`gradient`,labelStyle:a,showValues:i}}}var hl=10;function gl(e){return String(Math.round(e*100)/100)}function _l(e){let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return(t>>>0).toString(36)}function vl(t,n,r){let i=[...new Set(t.nodes.filter(e=>e.color===void 0).map(e=>e.index%hl))].sort((e,t)=>e-t),a=i.map(e=>` --sankey-color-${e}: ${wo(e,n.accent,n.bg)};`),o=i.map(e=>` .sk-f${e} { fill: var(--sankey-color-${e}); }\n .sk-s${e} { stroke: var(--sankey-color-${e}); }\n .sk-t${e} { stop-color: var(--sankey-color-${e}); }`),s=(0,e.paletteClass)(a);return{css:`${(0,e.styleOpenTag)(r)}
191
+ </style>`,cls:s}}function Vl(t,n=!1){return t.lines.map((r,i)=>{let a=r.map(t=>{let n=`${t.bold?`kb-bold`:``}${t.bold&&t.italic?` `:``}${t.italic?`kb-italic`:``}`,r=(0,e.escapeXml)(t.text);return n===``?r:`<tspan class="${n}">${r}</tspan>`}).join(``),o=t.y+kl.lineHeight*(i+.5);return`<text ${n?`x="${Rl(t.x+t.width/2)}" class="kb-label kb-heading"`:`x="${Rl(t.x)}" class="kb-label"`} y="${Rl(o)}" dy="0.35em" xml:space="preserve">${a.trim()}</text>`}).join(``)}function Hl(t){let n=t.cx-t.width/2,r=t.cy-t.height/2,i=kl.cornerRadius,a=`<g class="node${zl(t.className)}"><rect class="basic label-container" rx="${i}" ry="${i}" x="${Rl(n)}" y="${Rl(r)}" width="${Rl(t.width)}" height="${Rl(t.height)}"/>`+Vl(t.title);if(t.ticket){let n=Vl(t.ticket);a+=t.ticketUrl===void 0?n:`<a class="kanban-ticket-link" href="${(0,e.escapeXml)(t.ticketUrl)}" target="_blank" rel="noopener noreferrer">${n}</a>`}if(t.assigned&&(a+=Vl(t.assigned)),t.priorityColor!==void 0){let e=n+2;a+=`<line x1="${Rl(e)}" y1="${Rl(r+Math.floor(i/2))}" x2="${Rl(e)}" y2="${Rl(r+t.height-Math.floor(i/2))}" stroke-width="4"${t.priorityColor===``?``:` stroke="${t.priorityColor}"`}/>`}return a+`</g>`}function Ul(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[],{css:u,cls:d}=Bl(t,n,c.nonce),f=t.viewBox;l.push(z((0,e.withRootClass)((0,e.svgOpenTag)(f.width,f.height,n,i,o,s,t.columns.some(e=>e.cards.some(e=>e.ticketUrl!==void 0)),c.styleAttribute,c.description),d),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(u),l.push(`<g transform="translate(${Rl(-f.x)}, ${Rl(-f.y)})">`),l.push(`<g class="sections">`);for(let e of t.columns)l.push(`<g class="cluster section-${e.colorClass}${zl(e.className)}"><rect rx="${kl.cornerRadius}" ry="${kl.cornerRadius}" x="${Rl(e.x)}" y="${Rl(e.y)}" width="${Rl(e.width)}" height="${Rl(e.height)}"/><g class="cluster-label">${Vl(e.label,!0)}</g></g>`);l.push(`</g><g class="items">`);for(let e of t.columns)for(let t of e.cards)l.push(Hl(t));return l.push(`</g></g></svg>`),l.join(`
192
+ `)}var Wl={width:600,height:400,nodeWidth:10,nodePadding:12,valuePadding:15,fontSize:14,labelGap:6,ascent:13,descent:3,iterations:6},Gl=e=>e.reduce((e,t)=>e+t.value,0);function Kl(e,t,n){return e===`left`?t.depth:e===`right`?n-1-t.height:e===`justify`?t.sourceLinks.length?t.depth:n-1:t.targetLinks.length?t.depth:t.sourceLinks.length?Math.min(...t.sourceLinks.map(e=>e.target.depth))-1:0}function ql(t,n,r){let{x1:i,y1:a,dx:o,how:s}=r,c=r.dy,l=(e,t)=>e.y0-t.y0,u=(e,t)=>l(e.source,t.source)||e.index-t.index,d=(e,t)=>l(e.target,t.target)||e.index-t.index;for(let e of n)e.source.sourceLinks.push(e),e.target.targetLinks.push(e);for(let e of t)e.value=Math.max(Gl(e.sourceLinks),Gl(e.targetLinks));let f=(n,r)=>{let i=new Set(t),a=0;for(;i.size;){let o=new Set;for(let e of i){r(e,a);for(let t of n(e))o.add(t)}if(++a>t.length)throw new e.MermaidParseError(`circular link`,{diagramType:`sankey`});i=o}};f(e=>e.sourceLinks.map(e=>e.target),(e,t)=>e.depth=t),f(e=>e.targetLinks.map(e=>e.source),(e,t)=>e.height=t);let p=Math.max(...t.map(e=>e.depth))+1,m=(i-0-o)/(p-1),h=Array(p);for(let e of t){let t=Math.max(0,Math.min(p-1,Math.floor(Kl(s,e,p))));e.layer=t,e.x0=0+t*m,e.x1=e.x0+o,h[t]?h[t].push(e):h[t]=[e]}c=Math.min(r.dy,(a-0)/(Math.max(...h.map(e=>e.length))-1));let g=e=>{for(let{sourceLinks:t,targetLinks:n}of e)t.sort(d),n.sort(u)},_=({sourceLinks:e,targetLinks:t})=>{for(let{source:{sourceLinks:e}}of t)e.sort(d);for(let{target:{targetLinks:t}}of e)t.sort(u)},v=Math.min(...h.map(e=>(a-0-(e.length-1)*c)/e.reduce((e,t)=>e+t.value,0)));for(let e of h){let t=0;for(let n of e){n.y0=t,n.y1=t+n.value*v,t=n.y1+c;for(let e of n.sourceLinks)e.width=e.value*v}t=(a-t+c)/(e.length+1);for(let n=0;n<e.length;++n){let r=e[n];r.y0+=t*(n+1),r.y1+=t*(n+1)}g(e)}let y=(e,t)=>{let n=e.y0-(e.sourceLinks.length-1)*c/2;for(let{target:r,width:i}of e.sourceLinks){if(r===t)break;n+=i+c}for(let{source:r,width:i}of t.targetLinks){if(r===e)break;n-=i}return n},b=(e,t)=>{let n=t.y0-(t.targetLinks.length-1)*c/2;for(let{source:r,width:i}of t.targetLinks){if(r===e)break;n+=i+c}for(let{target:r,width:i}of e.sourceLinks){if(r===t)break;n-=i}return n},x=(e,t,n,r)=>{let i=t;for(let t=n;t<e.length;++t){let n=e[t],a=(i-n.y0)*r;a>1e-6&&(n.y0+=a,n.y1+=a),i=n.y1+c}},S=(e,t,n,r)=>{let i=t;for(let t=n;t>=0;--t){let n=e[t],a=(n.y1-i)*r;a>1e-6&&(n.y0-=a,n.y1-=a),i=n.y0-c}},C=(e,t)=>{let n=e.length>>1,r=e[n];S(e,r.y0-c,n-1,t),x(e,r.y1+c,n+1,t),S(e,a,e.length-1,t),x(e,0,0,t)},w=(e,t)=>{for(let n=1;n<h.length;++n){let r=h[n];for(let t of r){let n=0,r=0;for(let{source:e,value:i}of t.targetLinks){let a=i*(t.layer-e.layer);n+=y(e,t)*a,r+=a}if(!(r>0))continue;let i=(n/r-t.y0)*e;t.y0+=i,t.y1+=i,_(t)}r.sort(l),C(r,t)}},T=(e,t)=>{for(let n=h.length-2;n>=0;--n){let r=h[n];for(let t of r){let n=0,r=0;for(let{target:e,value:i}of t.sourceLinks){let a=i*(e.layer-t.layer);n+=b(t,e)*a,r+=a}if(!(r>0))continue;let i=(n/r-t.y0)*e;t.y0+=i,t.y1+=i,_(t)}r.sort(l),C(r,t)}};for(let e=0;e<Wl.iterations;++e){let t=.99**e,n=Math.max(1-t,(e+1)/Wl.iterations);T(t,n),w(t,n)}for(let e of t){let t=e.y0,n=t;for(let n of e.sourceLinks)n.y0=t+n.width/2,t+=n.width;for(let t of e.targetLinks)t.y1=n+t.width/2,n+=t.width}}function Jl(e){let t=Math.round(e*100)/100;return Number.isFinite(t)?t:e}var Yl=e=>Math.round(e*1e6)/1e6;function Xl(t){let n=t.config??{},r=n.width??Wl.width,i=n.height??Wl.height,a=n.showValues??!0,o=n.labelStyle??`legacy`,s=n.prefix??``,c=n.suffix??``,l=n.nodeWidth??Wl.nodeWidth,u=new Map,d=t.nodes.map((e,t)=>{let n={id:e,index:t,sourceLinks:[],targetLinks:[],value:0,depth:0,height:0,layer:0,x0:0,x1:0,y0:0,y1:0};return u.set(e,n),n}),f=t.links.map((e,t)=>({index:t,source:u.get(e.source),target:u.get(e.target),value:e.value,width:0,y0:0,y1:0}));if(d.length===0||f.length===0)return{width:r,height:i,nodes:[],links:[],options:{linkColor:`gradient`,labelStyle:o,showValues:a}};ql(d,f,{x1:r,y1:i,dx:l,dy:(n.nodePadding??Wl.nodePadding)+(a?Wl.valuePadding:0),how:n.nodeAlignment??`justify`});let p=0,m=0;for(let e of d)e.value>p&&(p=e.value,m=e.layer);let h=d.map(e=>{let t=o===`outlined`?e.layer>=m:e.x0<r/2,i=a?`${e.id} ${s}${Jl(e.value)}${c}`:e.id,l={id:e.id,index:e.index,x0:e.x0,y0:e.y0,x1:e.x1,y1:e.y1,value:e.value,layer:e.layer,label:{text:i,x:t?e.x1+Wl.labelGap:e.x0-Wl.labelGap,y:(e.y1+e.y0)/2,anchor:t?`start`:`end`}},u=n.nodeColors;return u&&Object.hasOwn(u,e.id)&&(l.color=u[e.id]),l}),g=f.map(e=>({source:e.source.index,target:e.target.index,value:e.value,width:e.width,x0:e.source.x1,y0:e.y0,x1:e.target.x0,y1:e.y1})),_=1/0,v=1/0,y=-1/0,b=-1/0,x=(e,t,n,r)=>{_=Math.min(_,e),v=Math.min(v,t),y=Math.max(y,n),b=Math.max(b,r)};for(let t of h){t.y1>t.y0&&x(t.x0,t.y0,t.x1,t.y1);let n=(0,e.measureTextWidth)(t.label.text,Wl.fontSize,400),r=t.label.y+(a?0:.35*Wl.fontSize),i=t.label.anchor===`start`?t.label.x:t.label.x-n;x(i,r-Wl.ascent,i+n,r+Wl.descent)}for(let e of g)x(e.x0,Math.min(e.y0,e.y1),e.x1,Math.max(e.y0,e.y1));let S=(e,t)=>Yl(e-t);for(let e of h)e.x0=S(e.x0,_),e.x1=S(e.x1,_),e.y0=S(e.y0,v),e.y1=S(e.y1,v),e.label.x=S(e.label.x,_),e.label.y=S(e.label.y,v);for(let e of g)e.x0=S(e.x0,_),e.x1=S(e.x1,_),e.y0=S(e.y0,v),e.y1=S(e.y1,v);return{width:Yl(y-_),height:Yl(b-v),nodes:h,links:g,options:{linkColor:n.linkColor??`gradient`,labelStyle:o,showValues:a}}}var Zl=10;function Ql(e){return String(Math.round(e*100)/100)}function $l(e){let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return(t>>>0).toString(36)}function eu(t,n,r){let i=[...new Set(t.nodes.filter(e=>e.color===void 0).map(e=>e.index%Zl))].sort((e,t)=>e-t),a=i.map(e=>` --sankey-color-${e}: ${Bo(e,n.accent,n.bg)};`),o=i.map(e=>` .sk-f${e} { fill: var(--sankey-color-${e}); }\n .sk-s${e} { stroke: var(--sankey-color-${e}); }\n .sk-t${e} { stop-color: var(--sankey-color-${e}); }`),s=(0,e.paletteClass)(a);return{css:`${(0,e.styleOpenTag)(r)}
190
193
  .node-labels { fill: var(--_text); }
191
194
  .sankey-label-bg { stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; paint-order: stroke; }
192
195
  .sankey-label-fg { fill: var(--_text); }
@@ -195,8 +198,8 @@ ${o.join(`
195
198
  `)}\n }`:``}
196
199
  ${o.join(`
197
200
  `)}
198
- </style>`,cls:s}}function yl(t,n,r){return t.color===void 0?` class="sk-${n}${t.index%hl}"`:` ${r}="${(0,e.escapeAttr)(t.color)}"`}function bl(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[],{css:u,cls:d}=vl(t,n,c.nonce);l.push(R((0,e.withRootClass)((0,e.svgOpenTag)(t.width,t.height,n,i,o,s,void 0,c.styleAttribute,c.description),d),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(u),l.push(`<g class="nodes">`);for(let e of t.nodes)l.push(`<g class="node" transform="translate(${gl(e.x0)},${gl(e.y0)})"><rect height="${gl(e.y1-e.y0)}" width="${gl(e.x1-e.x0)}"${yl(e,`f`,`fill`)}/></g>`);l.push(`</g>`);let f=t.options.showValues?`0`:`0.35`,p=(t,n)=>`<text${n?` class="${n}"`:``} x="${gl(t.label.x)}" y="${gl(t.label.y)}" dy="${f}em" text-anchor="${t.label.anchor}">${(0,e.escapeXml)(t.label.text)}</text>`;if(l.push(`<g class="node-labels" font-size="14">`),t.options.labelStyle===`outlined`){for(let e of t.nodes)l.push(p(e,`sankey-label-bg`));for(let e of t.nodes)l.push(p(e,`sankey-label-fg`))}else for(let e of t.nodes)l.push(p(e));l.push(`</g>`);let m=t.options.linkColor,h=`sankey-${_l(JSON.stringify([t.links,t.nodes.map(e=>e.id)]))}`;return l.push(`<g class="links" fill="none" stroke-opacity="0.5">`),t.links.forEach((n,r)=>{let i=t.nodes[n.source],a=t.nodes[n.target],o=gl((n.x0+n.x1)/2),s=`M${gl(n.x0)},${gl(n.y0)}C${o},${gl(n.y0)},${o},${gl(n.y1)},${gl(n.x1)},${gl(n.y1)}`,c,u=``;if(m===`gradient`){let e=`${h}-link-${r}`;u=`<linearGradient id="${e}" gradientUnits="userSpaceOnUse" x1="${gl(n.x0)}" x2="${gl(n.x1)}"><stop offset="0%"${yl(i,`t`,`stop-color`)}/><stop offset="100%"${yl(a,`t`,`stop-color`)}/></linearGradient>`,c=` stroke="url(#${e})"`}else c=m===`source`?yl(i,`s`,`stroke`):m===`target`?yl(a,`s`,`stroke`):` stroke="${(0,e.escapeAttr)(m)}"`;l.push(`<g class="link">${u}<path d="${s}"${c} stroke-width="${gl(Math.max(1,n.width))}"/></g>`)}),l.push(`</g>`),l.push(`</svg>`),l.join(`
199
- `)}var xl=2048,Sl=new Map([[` A`,-113],[` T`,-37],[` Y`,-37],[`A `,-113],[`AT`,-199],[`AV`,-180],[`AW`,-180],[`AY`,-218],[`Av`,-113],[`Aw`,-94],[`Ay`,-84],[`F,`,-369],[`F.`,-369],[`FA`,-217],[`Ke`,-64],[`Ki`,-64],[`Kn`,-64],[`Ko`,-64],[`Ku`,-64],[`Kw`,-64],[`L `,-76],[`LT`,-209],[`LV`,-284],[`LW`,-256],[`LY`,-265],[`Ly`,-170],[`P `,-37],[`P,`,-400],[`P.`,-400],[`PA`,-228],[`Pa`,-96],[`Pe`,-96],[`Ph`,-96],[`Pi`,-96],[`Po`,-96],[`Pr`,-96],[`RT`,-84],[`RV`,-94],[`RW`,-131],[`RY`,-131],[`Re`,-83],[`Ro`,-83],[`Ru`,-59],[`T `,-37],[`T,`,-340],[`T-`,-198],[`T.`,-340],[`T:`,-227],[`T;`,-227],[`TA`,-199],[`TO`,-113],[`Ta`,-255],[`Tc`,-255],[`Te`,-255],[`Ti`,-85],[`To`,-255],[`Tr`,-225],[`Ts`,-246],[`Tu`,-265],[`Tw`,-283],[`Ty`,-236],[`V,`,-300],[`V-`,-151],[`V.`,-300],[`V:`,-123],[`V;`,-123],[`VA`,-209],[`Va`,-161],[`Ve`,-132],[`Vi`,-37],[`Vo`,-132],[`Vr`,-123],[`Vu`,-133],[`Vy`,-76],[`W,`,-189],[`W-`,-141],[`W.`,-189],[`W:`,-37],[`W;`,-37],[`WA`,-180],[`Wa`,-114],[`We`,-94],[`Wi`,-28],[`Wo`,-94],[`Wr`,-103],[`Wu`,-84],[`Wy`,-37],[`Y `,-37],[`Y,`,-330],[`Y-`,-250],[`Y.`,-330],[`Y:`,-179],[`Y;`,-179],[`YA`,-218],[`Ya`,-190],[`Ye`,-215],[`Yi`,-114],[`Yo`,-235],[`Yp`,-190],[`Yq`,-245],[`Yu`,-151],[`Yv`,-122],[`r,`,-292],[`r.`,-273],[`v,`,-275],[`v.`,-275],[`w,`,-217],[`w.`,-217],[`y,`,-250],[`y.`,-250]]);function Cl(e){let t=0,n=[...e];for(let e=1;e<n.length;e++)t+=Sl.get(n[e-1]+n[e])??0;return t/xl}function wl(e){return $s(e)+Cl(e)*16}var Tl={width:150,height:50,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,taskMargin:50,legendTop:60,sectionY:50,taskTop:110,lineEnd:450,sections:7,actors:6,originY:25};function El(e,t=Tl.maxLabelWidth){if(wl(e)<=t)return[e];let n=[],r=``;for(let i of e.split(` `)){let e=r?`${r} ${i}`:i;if(wl(e)>t){if(r&&n.push(r),r=i,wl(i)>t){let e=``;for(let r of i)e+=r,wl(e+`-`)>t&&(n.push(e.slice(0,-1)+`-`),e=r);r=e}}else r=e}return r&&n.push(r),n}function Dl(e,t=Tl.width){let n=[];for(let r of e.split(/<br\s*\/?>/i)){let e=``;for(let i of r.split(/\s+/).filter(Boolean)){let r=e?`${e} ${i}`:i;e&&wl(r)>t?(n.push(e),e=i):e=r}n.push(e)}return n}function Ol(e){let t={...Tl,...e.config},n=t.originY,r=2*t.height+t.diagramMarginY,i=[],a=0,o=t.legendTop;e.actors.forEach((e,r)=>{let s=El(e,t.maxLabelWidth).map((e,r)=>{let i=wl(e);return i>a&&i>t.leftMargin-i&&(a=i),{text:e,x:50,y:o+7+r*20+n}});i.push({cx:20,cy:o+n,pos:r,lines:s}),o+=Math.max(20,s.length*20)});let s=t.leftMargin+a,c=[],l=[],u=``,d=0,f=0,p=s,m=e.actors.length*50;e.tasks.forEach((i,a)=>{let o=a*t.taskMargin+a*t.width+s;if(u!==i.section){f=d%t.sections;let r=0;for(let t=a;t<e.tasks.length&&e.tasks[t].section===i.section;t++)r++;c.push({x:o,y:t.sectionY+n,width:t.width*r+t.diagramMarginX*(r-1),height:t.height,text:i.section,num:f}),u=i.section,d++}let h=i.actors.map((i,a)=>({cx:o+14+a*10,cy:r+n,actor:i,pos:e.actors.indexOf(i)%t.actors}));l.push({x:o,y:r+n,width:t.width,height:t.height,lines:Dl(i.name,t.width),score:i.score,num:f,faceY:300+(5-i.score)*30+n,lineEndY:t.lineEnd+n,dots:h}),p=Math.max(p,o+t.diagramMarginX+t.taskMargin),m=Math.max(m,t.lineEnd)});let h=m+2*t.diagramMarginY,g=s+p+2*t.diagramMarginX;return{width:g,height:h+(e.title?70:0),title:e.title?{text:e.title,x:s,y:25+n}:void 0,legend:i,sections:c,tasks:l,axis:{x1:s,y1:t.height*4+n,x2:g-s-4,y2:t.height*4+n}}}function X(e){return String(Number.isFinite(e)?Math.round(e*100)/100:0)}var kl=`M7.5,0A7.5,7.5,0,1,1,-7.5,0L-6.818,0A6.818,6.818,0,1,0,6.818,0Z`,Al=`M-7.5,0A7.5,7.5,0,1,1,7.5,0L6.818,0A6.818,6.818,0,1,0,-6.818,0Z`;function jl(t,n,r){let i=new Set;for(let e of t.sections)i.add(e.num);for(let e of t.tasks)i.add(e.num);let a=new Set;for(let e of t.legend)a.add(e.pos%6);let o=[...[...i].sort((e,t)=>e-t).map(e=>` --journey-section-${e}: ${wo(e+1,n.accent,n.bg)};`),...[...a].sort((e,t)=>e-t).map(e=>` --journey-actor-${e}: ${wo(e+4,n.accent,n.bg)};`)],s=[...[...i].map(e=>` .section-type-${e} { fill: color-mix(in srgb, var(--journey-section-${e}) 30%, var(--bg)); }`),...[...a].map(e=>` .actor-${e} { fill: var(--journey-actor-${e}); }`)],c=(0,e.paletteClass)(o);return{css:`${(0,e.styleOpenTag)(r)}
201
+ </style>`,cls:s}}function tu(t,n,r){return t.color===void 0?` class="sk-${n}${t.index%Zl}"`:` ${r}="${(0,e.escapeAttr)(t.color)}"`}function nu(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[],{css:u,cls:d}=eu(t,n,c.nonce);l.push(z((0,e.withRootClass)((0,e.svgOpenTag)(t.width,t.height,n,i,o,s,void 0,c.styleAttribute,c.description),d),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(u),l.push(`<g class="nodes">`);for(let e of t.nodes)l.push(`<g class="node" transform="translate(${Ql(e.x0)},${Ql(e.y0)})"><rect height="${Ql(e.y1-e.y0)}" width="${Ql(e.x1-e.x0)}"${tu(e,`f`,`fill`)}/></g>`);l.push(`</g>`);let f=t.options.showValues?`0`:`0.35`,p=(t,n)=>`<text${n?` class="${n}"`:``} x="${Ql(t.label.x)}" y="${Ql(t.label.y)}" dy="${f}em" text-anchor="${t.label.anchor}">${(0,e.escapeXml)(t.label.text)}</text>`;if(l.push(`<g class="node-labels" font-size="14">`),t.options.labelStyle===`outlined`){for(let e of t.nodes)l.push(p(e,`sankey-label-bg`));for(let e of t.nodes)l.push(p(e,`sankey-label-fg`))}else for(let e of t.nodes)l.push(p(e));l.push(`</g>`);let m=t.options.linkColor,h=`sankey-${$l(JSON.stringify([t.links,t.nodes.map(e=>e.id)]))}`;return l.push(`<g class="links" fill="none" stroke-opacity="0.5">`),t.links.forEach((n,r)=>{let i=t.nodes[n.source],a=t.nodes[n.target],o=Ql((n.x0+n.x1)/2),s=`M${Ql(n.x0)},${Ql(n.y0)}C${o},${Ql(n.y0)},${o},${Ql(n.y1)},${Ql(n.x1)},${Ql(n.y1)}`,c,u=``;if(m===`gradient`){let e=`${h}-link-${r}`;u=`<linearGradient id="${e}" gradientUnits="userSpaceOnUse" x1="${Ql(n.x0)}" x2="${Ql(n.x1)}"><stop offset="0%"${tu(i,`t`,`stop-color`)}/><stop offset="100%"${tu(a,`t`,`stop-color`)}/></linearGradient>`,c=` stroke="url(#${e})"`}else c=m===`source`?tu(i,`s`,`stroke`):m===`target`?tu(a,`s`,`stroke`):` stroke="${(0,e.escapeAttr)(m)}"`;l.push(`<g class="link">${u}<path d="${s}"${c} stroke-width="${Ql(Math.max(1,n.width))}"/></g>`)}),l.push(`</g>`),l.push(`</svg>`),l.join(`
202
+ `)}var ru=2048,iu=new Map([[` A`,-113],[` T`,-37],[` Y`,-37],[`A `,-113],[`AT`,-199],[`AV`,-180],[`AW`,-180],[`AY`,-218],[`Av`,-113],[`Aw`,-94],[`Ay`,-84],[`F,`,-369],[`F.`,-369],[`FA`,-217],[`Ke`,-64],[`Ki`,-64],[`Kn`,-64],[`Ko`,-64],[`Ku`,-64],[`Kw`,-64],[`L `,-76],[`LT`,-209],[`LV`,-284],[`LW`,-256],[`LY`,-265],[`Ly`,-170],[`P `,-37],[`P,`,-400],[`P.`,-400],[`PA`,-228],[`Pa`,-96],[`Pe`,-96],[`Ph`,-96],[`Pi`,-96],[`Po`,-96],[`Pr`,-96],[`RT`,-84],[`RV`,-94],[`RW`,-131],[`RY`,-131],[`Re`,-83],[`Ro`,-83],[`Ru`,-59],[`T `,-37],[`T,`,-340],[`T-`,-198],[`T.`,-340],[`T:`,-227],[`T;`,-227],[`TA`,-199],[`TO`,-113],[`Ta`,-255],[`Tc`,-255],[`Te`,-255],[`Ti`,-85],[`To`,-255],[`Tr`,-225],[`Ts`,-246],[`Tu`,-265],[`Tw`,-283],[`Ty`,-236],[`V,`,-300],[`V-`,-151],[`V.`,-300],[`V:`,-123],[`V;`,-123],[`VA`,-209],[`Va`,-161],[`Ve`,-132],[`Vi`,-37],[`Vo`,-132],[`Vr`,-123],[`Vu`,-133],[`Vy`,-76],[`W,`,-189],[`W-`,-141],[`W.`,-189],[`W:`,-37],[`W;`,-37],[`WA`,-180],[`Wa`,-114],[`We`,-94],[`Wi`,-28],[`Wo`,-94],[`Wr`,-103],[`Wu`,-84],[`Wy`,-37],[`Y `,-37],[`Y,`,-330],[`Y-`,-250],[`Y.`,-330],[`Y:`,-179],[`Y;`,-179],[`YA`,-218],[`Ya`,-190],[`Ye`,-215],[`Yi`,-114],[`Yo`,-235],[`Yp`,-190],[`Yq`,-245],[`Yu`,-151],[`Yv`,-122],[`r,`,-292],[`r.`,-273],[`v,`,-275],[`v.`,-275],[`w,`,-217],[`w.`,-217],[`y,`,-250],[`y.`,-250]]);function au(e){let t=0,n=[...e];for(let e=1;e<n.length;e++)t+=iu.get(n[e-1]+n[e])??0;return t/ru}function ou(e){return xc(e)+au(e)*16}var su={width:150,height:50,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,taskMargin:50,legendTop:60,sectionY:50,taskTop:110,lineEnd:450,sections:7,actors:6,originY:25};function cu(e,t=su.maxLabelWidth){if(ou(e)<=t)return[e];let n=[],r=``;for(let i of e.split(` `)){let e=r?`${r} ${i}`:i;if(ou(e)>t){if(r&&n.push(r),r=i,ou(i)>t){let e=``;for(let r of i)e+=r,ou(e+`-`)>t&&(n.push(e.slice(0,-1)+`-`),e=r);r=e}}else r=e}return r&&n.push(r),n}function lu(e,t=su.width){let n=[];for(let r of e.split(/<br\s*\/?>/i)){let e=``;for(let i of r.split(/\s+/).filter(Boolean)){let r=e?`${e} ${i}`:i;e&&ou(r)>t?(n.push(e),e=i):e=r}n.push(e)}return n}function uu(e){let t={...su,...e.config},n=t.originY,r=2*t.height+t.diagramMarginY,i=[],a=0,o=t.legendTop;e.actors.forEach((e,r)=>{let s=cu(e,t.maxLabelWidth).map((e,r)=>{let i=ou(e);return i>a&&i>t.leftMargin-i&&(a=i),{text:e,x:50,y:o+7+r*20+n}});i.push({cx:20,cy:o+n,pos:r,lines:s}),o+=Math.max(20,s.length*20)});let s=t.leftMargin+a,c=[],l=[],u=``,d=0,f=0,p=s,m=e.actors.length*50;e.tasks.forEach((i,a)=>{let o=a*t.taskMargin+a*t.width+s;if(u!==i.section){f=d%t.sections;let r=0;for(let t=a;t<e.tasks.length&&e.tasks[t].section===i.section;t++)r++;c.push({x:o,y:t.sectionY+n,width:t.width*r+t.diagramMarginX*(r-1),height:t.height,text:i.section,num:f}),u=i.section,d++}let h=i.actors.map((i,a)=>({cx:o+14+a*10,cy:r+n,actor:i,pos:e.actors.indexOf(i)%t.actors}));l.push({x:o,y:r+n,width:t.width,height:t.height,lines:lu(i.name,t.width),score:i.score,num:f,faceY:300+(5-i.score)*30+n,lineEndY:t.lineEnd+n,dots:h}),p=Math.max(p,o+t.diagramMarginX+t.taskMargin),m=Math.max(m,t.lineEnd)});let h=m+2*t.diagramMarginY,g=s+p+2*t.diagramMarginX;return{width:g,height:h+(e.title?70:0),title:e.title?{text:e.title,x:s,y:25+n}:void 0,legend:i,sections:c,tasks:l,axis:{x1:s,y1:t.height*4+n,x2:g-s-4,y2:t.height*4+n}}}function Z(e){return String(Number.isFinite(e)?Math.round(e*100)/100:0)}var du=`M7.5,0A7.5,7.5,0,1,1,-7.5,0L-6.818,0A6.818,6.818,0,1,0,6.818,0Z`,fu=`M-7.5,0A7.5,7.5,0,1,1,7.5,0L6.818,0A6.818,6.818,0,1,0,-6.818,0Z`;function pu(t,n,r){let i=new Set;for(let e of t.sections)i.add(e.num);for(let e of t.tasks)i.add(e.num);let a=new Set;for(let e of t.legend)a.add(e.pos%6);let o=[...[...i].sort((e,t)=>e-t).map(e=>` --journey-section-${e}: ${Bo(e+1,n.accent,n.bg)};`),...[...a].sort((e,t)=>e-t).map(e=>` --journey-actor-${e}: ${Bo(e+4,n.accent,n.bg)};`)],s=[...[...i].map(e=>` .section-type-${e} { fill: color-mix(in srgb, var(--journey-section-${e}) 30%, var(--bg)); }`),...[...a].map(e=>` .actor-${e} { fill: var(--journey-actor-${e}); }`)],c=(0,e.paletteClass)(o);return{css:`${(0,e.styleOpenTag)(r)}
200
203
  .journey-label { fill: var(--_text); font-size: 14px; }
201
204
  .legend { fill: var(--_text); font-size: 16px; }
202
205
  .journey-title { fill: var(--_text); font-weight: bold; }
@@ -210,20 +213,20 @@ ${o.join(`
210
213
  `)}\n }`:``}
211
214
  ${s.join(`
212
215
  `)}
213
- </style>`,cls:c}}function Ml(t,n,r){return t.map((i,a)=>{let o=a*14-14*(t.length-1)/2;return`<text x="${X(n)}" y="${X(r)}" dominant-baseline="central" alignment-baseline="central" text-anchor="middle" class="journey-label"><tspan x="${X(n)}" dy="${X(o)}">${(0,e.escapeXml)(i)}</tspan></text>`}).join(``)}function Nl(e){let t=e.x+e.width/2,n=e.faceY,r=`<circle cx="${X(t-5)}" cy="${X(n-5)}" r="1.5" stroke-width="2" fill="var(--fg)" stroke="var(--fg)"/><circle cx="${X(t+5)}" cy="${X(n-5)}" r="1.5" stroke-width="2" fill="var(--fg)" stroke="var(--fg)"/>`,i;return i=e.score>3?`<path class="mouth" d="${kl}" transform="translate(${X(t)},${X(n+2)})"/>`:e.score<3?`<path class="mouth" d="${Al}" transform="translate(${X(t)},${X(n+7)})"/>`:`<line class="mouth-line" x1="${X(t-5)}" y1="${X(n+7)}" x2="${X(t+5)}" y2="${X(n+7)}" stroke-width="1"/>`,`<circle cx="${X(t)}" cy="${X(n)}" class="face" r="15" stroke-width="2"/><g>${r}${i}</g>`}function Pl(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[],{css:u,cls:d}=jl(t,n,c.nonce);l.push(R((0,e.withRootClass)((0,e.svgOpenTag)(t.width,t.height,n,i,o,s,void 0,c.styleAttribute,c.description),d),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(u),l.push(`<defs><marker id="journey-arrowhead" refX="5" refY="2" markerWidth="6" markerHeight="4" orient="auto"><path class="journey-arrow" d="M 0,0 V 4 L6,2 Z"/></marker></defs>`);for(let n of t.legend){l.push(`<circle cx="${X(n.cx)}" cy="${X(n.cy)}" class="actor-${n.pos%6}" stroke="var(--fg)" r="7"/>`);for(let t of n.lines)l.push(`<text x="40" y="${X(t.y)}" class="legend"><tspan x="${X(t.x)}">${(0,e.escapeXml)(t.text)}</tspan></text>`)}for(let e of t.sections)l.push(`<g><rect x="${X(e.x)}" y="${X(e.y)}" width="${X(e.width)}" height="${X(e.height)}" rx="3" ry="3" class="journey-section section-type-${e.num}"/>`+Ml(e.text.split(/<br\s*\/?>/i),e.x+e.width/2,e.y+e.height/2)+`</g>`);t.tasks.forEach((t,n)=>{let r=t.x+t.width/2,i=t.dots.map(t=>`<circle cx="${X(t.cx)}" cy="${X(t.cy)}" class="actor-${t.pos}" stroke="var(--fg)" r="7"><title>${(0,e.escapeXml)(t.actor)}</title></circle>`).join(``);l.push(`<g><line id="task${n}" x1="${X(r)}" y1="${X(t.y)}" x2="${X(r)}" y2="${X(t.lineEndY)}" class="task-line" stroke-width="1" stroke-dasharray="4 2"/>`+Nl(t)+`<rect x="${X(t.x)}" y="${X(t.y)}" width="${X(t.width)}" height="${X(t.height)}" rx="3" ry="3" class="task task-type-${t.num} section-type-${t.num}"/>`+i+Ml(t.lines,r,t.y+t.height/2)+`</g>`)}),t.title&&l.push(`<text x="${X(t.title.x)}" y="${X(t.title.y)}" font-size="33.47" font-weight="bold" class="journey-title">${(0,e.escapeXml)(t.title.text)}</text>`);let f=t.axis;return l.push(`<line x1="${X(f.x1)}" y1="${X(f.y1)}" x2="${X(f.x2)}" y2="${X(f.y2)}" stroke-width="4" class="journey-axis" marker-end="url(#journey-arrowhead)"/>`),l.push(`</svg>`),l.join(`
214
- `)}var Fl=`␣A-57|␣T-19|␣Y-19|A␣-57|AT-100|AV-90|AW-90|AY-109|Av-57|Aw-47|Ay-42|F,-185|F.-185|FA-109|Ke-33|Ki-32|Kn-33|Ko-33|Ku-33|Kw-32|L␣-39|LT-105|LV-143|LW-129|LY-133|Ly-85|P␣-19|P,-200|P.-200|PA-114|Pa-48|Pe-48|Ph-48|Pi-48|Po-48|Pr-48|RT-42|RV-47|RW-66|RY-65|Re-42|Ro-42|Ru-30|T␣-19|T,-170|T--99|T.-170|T:-114|T;-114|TA-100|TO-57|Ta-128|Tc-128|Te-128|Ti-43|To-128|Tr-113|Ts-124|Tu-133|Tw-142|Ty-118|V,-150|V--76|V.-150|V:-62|V;-62|VA-105|Va-81|Ve-67|Vi-19|Vo-67|Vr-62|Vu-67|Vy-38|W,-95|W--71|W.-95|W:-19|W;-19|WA-90|Wa-57|We-48|Wi-14|Wo-48|Wr-52|Wu-43|Wy-19|Y␣-19|Y,-165|Y--125|Y.-165|Y:-89|Y;-89|YA-109|Ya-95|Ye-108|Yi-57|Yo-118|Yp-95|Yq-123|Yu-76|Yv-61|r,-146|r.-136|v,-138|v.-138|w,-108|w.-108|y,-125|y.-125|`,Il=`␣A-57|␣T-19|␣Y-19|A␣-57|AT-98|AV-77|AW-56|AY-92|Av-19|Aw-19|Ay-19|F,-114|F.-114|FA-57|Fa-49|Fe-49|Fo-49|Fu-48|L␣-38|LT-76|LV-76|LW-76|LY-76|Ly-38|P␣-19|P,-132|P.-132|PA-76|Pa-48|Pe-48|Po-48|RT-42|RV-38|RW-45|RY-65|T␣-19|T,-114|T--80|T.-114|T:-114|T;-114|TA-98|TO-61|Ta-114|Tc-114|Te-114|Ti-39|To-133|Tr-106|Ts-114|Tu-93|Tw-82|Ty-78|V,-115|V--57|V.-94|V:-38|V;-38|VA-77|Va-77|Ve-57|Vi-19|Vo-70|Vr-51|Vu-55|Vy-39|W,-89|W--18|W.-85|W:-18|W;-18|WA-56|Wa-38|We-19|Wo-19|Wr-19|Wu-18|Wy-9|Y␣-19|Y,-132|Y--94|Y.-132|Y:-56|Y;-66|YA-92|Ya-76|Ye-94|Yi-38|Yo-94|Yp-76|Yq-94|Yu-56|Yv-56|ka-32|r,-116|r.-121|ra-33|v,-135|v.-135|vi32|w,-100|w.-100|y,-114|y.-114|`;function Ll(e){let t=new Map;for(let n of e.split(`|`).filter(Boolean))t.set(n.slice(0,2).replace(`␣`,` `),Number(n.slice(2))/64);return t}var Rl=Ll(Fl),zl=Ll(Il);function Bl(e,t=!1){let n=t?zl:Rl,r=0;for(let t=0;t+1<e.length;t++)r+=n.get(e.slice(t,t+2))??0;return r}function Vl(e,t=!1){return $s(e,16,t)+Bl(e,t)}var Z={fontSize:16,rowHeight:24,bodyGap:20,boxPad:20,textTop:8,rowInset:10,margin:8,nodeSpacing:40,layerSpacing:40,loopOut:20,loopLabelGap:4,loopHalf:12};function Hl(e){return`<<${e}>>`}function Ul(e,t,n){let r=Math.max(Vl(e),Vl(t,!0),...n.map(e=>Vl(e))),i=Z.rowHeight*2+(n.length>0?Z.bodyGap+Z.rowHeight*n.length:0);return{width:r+Z.boxPad,height:i+Z.boxPad}}function Wl(e,t){let n=e[0],r=1/0;for(let i=1;i<e.length;i++){let a=e[i-1],o=e[i],s=(o.x-a.x)**2+(o.y-a.y)**2,c=s===0?0:Math.max(0,Math.min(1,((t.x-a.x)*(o.x-a.x)+(t.y-a.y)*(o.y-a.y))/s)),l={x:a.x+(o.x-a.x)*c,y:a.y+(o.y-a.y)*c},u=Math.hypot(l.x-t.x,l.y-t.y);u<r&&(r=u,n=l)}return n}function Gl(n,r={}){if(n.nodes.length===0)return{width:16,height:16,nodes:[],edges:[]};let i=new Map,a=new Map;for(let e of n.nodes){let n=(0,t.requirementBodyRows)(e);a.set(e.id,n),i.set(e.id,Ul(`<<${e.typeLabel}>>`,e.id,n))}let o=Z.margin,s=n.relationships.flatMap((e,t)=>e.src===e.dst?[]:[{id:`e${t}`,sources:[e.src],targets:[e.dst],labels:[{layoutOptions:pe,text:Hl(e.type),width:Vl(Hl(e.type)),height:Z.rowHeight}]}]),c=E({id:`root`,layoutOptions:{...de({direction:le(r.direction??n.direction,ce.requirement),nodeSpacing:Z.nodeSpacing,layerSpacing:Z.layerSpacing,padding:o}),"spacing.baseValue":`40`,"elk.hierarchyHandling":`INCLUDE_CHILDREN`,"elk.layered.cycleBreaking.strategy":`DEPTH_FIRST`,"elk.layered.nodePlacement.bk.fixedAlignment":`BALANCED`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`},children:n.nodes.map(e=>fe(e.id,i.get(e.id))),edges:s},r.layoutCache),l=n.nodes.map(t=>{let r=(c.children??[]).find(e=>e.id===t.id),o=i.get(t.id),s=a.get(t.id),l=r.x??0,u=r.y??0,d=n.classAssignments.get(t.id),f=(0,e.resolveNodeStyle)(t.id,n);return{id:t.id,kind:t.kind,typeText:`<<${t.typeLabel}>>`,name:t.id,rows:s,x:l,y:u,width:r.width??o.width,height:r.height??o.height,...s.length>0&&{dividerY:u+Z.rowHeight*2+Z.bodyGap},...f&&{inlineStyle:f},...d&&{className:d}}}),u=new Map(l.map(e=>[e.id,e])),d=new Map((c.edges??[]).map(e=>[e.id,e])),f=n.relationships.map((e,t)=>{let n=Hl(e.type),r=Vl(n),i={type:e.type,src:e.src,dst:e.dst,label:n,labelWidth:r,labelHeight:Z.rowHeight};if(e.src!==e.dst){let e=d.get(`e${t}`),n=ht(e),r=e.labels[0];return{...i,points:n,labelPoint:Wl(n,{x:r.x+r.width/2,y:r.y+r.height/2})}}let a=u.get(e.src),o=a.y+a.height/2,s=a.x-Z.loopOut,c=Math.max(Z.loopHalf,a.height/8);return{...i,points:[{x:a.x,y:o-c},{x:s,y:o-c},{x:s,y:o+c},{x:a.x,y:o+c}],labelPoint:{x:s-Z.loopLabelGap-r/2,y:o}}}),p=1/0,m=1/0,h=-1/0,g=-1/0,_=(e,t,n,r)=>{p=Math.min(p,e),m=Math.min(m,t),h=Math.max(h,n),g=Math.max(g,r)};for(let e of l)_(e.x,e.y,e.x+e.width,e.y+e.height);for(let e of f){for(let t of e.points)_(t.x,t.y,t.x,t.y);_(e.labelPoint.x-e.labelWidth/2,e.labelPoint.y-e.labelHeight/2,e.labelPoint.x+e.labelWidth/2,e.labelPoint.y+e.labelHeight/2)}let v=o-p,y=o-m;for(let e of l)e.x+=v,e.y+=y,e.dividerY!==void 0&&(e.dividerY+=y);for(let e of f){for(let t of e.points)t.x+=v,t.y+=y;e.labelPoint.x+=v,e.labelPoint.y+=y}return{width:h-p+2*o,height:g-m+2*o,nodes:l,edges:f}}var Kl=`10 7`,ql=9,Jl=16,Yl=8;function Xl(t,n,r=`Inter`,i=!1,a=M,o,s,c,l={}){let u=[];u.push(R((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,void 0,l.styleAttribute,l.description),o)),u.push(ie(r,!0,l.nonce,l.bodyFont));for(let e of t.edges)u.push($l(e));for(let e of t.nodes)u.push(Zl(e,a));for(let e of t.edges)u.push(eu(e,a));return u.push(`</svg>`),u.join(`
215
- `)}function Zl(t,n){let{x:r,y:i,width:a,height:o,inlineStyle:s}=t,c=(0,e.escapeAttr)(s?.fill??`var(--_node-fill)`),l=(0,e.escapeAttr)(s?.stroke??`var(--_node-stroke)`),u=(0,e.escapeAttr)(s?.[`stroke-width`]??String(I.outerBox)),d=s?.color?(0,e.escapeAttr)(s.color):void 0,f=(0,e.sanitizeClassName)(t.className),p=f?e.f`requirement-node ${f}`:`requirement-node`,m=[e.f`<g class="${p}" data-id="${(0,e.escapeAttr)(t.id)}" data-kind="${t.kind}">`,e.f` <rect x="${r}" y="${i}" width="${a}" height="${o}" rx="0" ry="0" `+e.f`fill="${c}" stroke="${l}" stroke-width="${u}" />`],h=r+a/2,g=Z.rowHeight,_=i+Z.textTop,v=(t,r,i,a,o)=>` `+(0,e.renderMultilineText)(t,r,i,n.nodeLabel,e.f`${a} font-size="${n.nodeLabel}" fill="${d??o}"`);if(m.push(v(t.typeText,h,_+g/2,`text-anchor="middle"`,`var(--_text-sec)`),v(t.name,h,_+g*1.5,e.f`text-anchor="middle" font-weight="700"`,`var(--_text)`)),t.dividerY!==void 0){m.push(e.f` <line x1="${r}" y1="${t.dividerY}" x2="${r+a}" y2="${t.dividerY}" `+e.f`stroke="${l}" stroke-width="${I.innerBox}" />`);for(let[e,n]of t.rows.entries())m.push(v(n,r+Z.rowInset,_+g*2+Z.bodyGap+g*(e+.5),`text-anchor="start"`,`var(--_text-sec)`))}return m.push(`</g>`),m.join(`
216
- `)}function Ql(e,t){let n=Math.hypot(t.x-e.x,t.y-e.y);return n===0?{x:0,y:0}:{x:(t.x-e.x)/n,y:(t.y-e.y)/n}}function $l(t){let n=t.points;if(n.length<2)return``;let r=t.type===`contains`,i=I.connector,a=[`class="requirement-relationship"`,e.f`data-type="${t.type}"`,e.f`data-src="${(0,e.escapeAttr)(t.src)}"`,e.f`data-dst="${(0,e.escapeAttr)(t.dst)}"`].join(` `),o=e.f`<polyline ${a} points="${n.map(t=>e.f`${t.x},${t.y}`).join(` `)}" fill="none" `+e.f`stroke="var(--_line)" stroke-width="${i}"${r?``:e.f` stroke-dasharray="${Kl}"`} />`;if(r){let t=n[0],r=Ql(t,n[1]),a={x:t.x+r.x*10,y:t.y+r.y*10},s=ql,c=(t,n,r,a)=>e.f`<line x1="${t}" y1="${n}" x2="${r}" y2="${a}" stroke="var(--_line)" stroke-width="${i}" />`;return[o,e.f`<circle cx="${a.x}" cy="${a.y}" r="${s}" fill="var(--bg)" stroke="var(--_line)" stroke-width="${i}" />`,c(a.x-s,a.y,a.x+s,a.y),c(a.x,a.y-s,a.x,a.y+s)].join(`
217
- `)}let s=n[n.length-1],c=Ql(n[n.length-2],s),l={x:s.x-c.x*Jl,y:s.y-c.y*Jl},u={x:l.x-c.y*Yl,y:l.y+c.x*Yl},d={x:l.x+c.y*Yl,y:l.y-c.x*Yl};return[o,e.f`<polyline points="${u.x},${u.y} ${s.x},${s.y} ${d.x},${d.y}" fill="none" stroke="var(--_line)" stroke-width="${i}" stroke-linejoin="miter" />`].join(`
218
- `)}function eu(t,n){let{labelPoint:r,labelWidth:i,labelHeight:a}=t;return e.f`<rect x="${r.x-i/2}" y="${r.y-a/2}" width="${i}" height="${a}" rx="2" ry="2" `+`fill="var(--bg)" stroke="none" />`+e.f`\n${(0,e.renderMultilineText)(t.label,r.x,r.y,n.edgeLabel,e.f`text-anchor="middle" font-size="${n.edgeLabel}" font-weight="${P.edgeLabel}" fill="color-mix(in srgb, var(--fg) 70%, var(--bg))"`)}`}function tu(e){let t=`#ffffff`;if(e.external)switch(e.kind){case`person`:return{fill:`#686868`,stroke:`#8a8a8a`,text:t};case`system`:return{fill:`#999999`,stroke:`#8a8a8a`,text:t};case`container`:return{fill:`#b3b3b3`,stroke:`#a6a6a6`,text:t};case`component`:return{fill:`#cccccc`,stroke:`#bfbfbf`,text:t}}switch(e.kind){case`person`:return{fill:`#08427b`,stroke:`#073b6f`,text:t};case`system`:return{fill:`#1168bd`,stroke:`#3c7fc0`,text:t};case`container`:return{fill:`#438dd5`,stroke:`#3c7fc0`,text:t};case`component`:return{fill:`#85bbf0`,stroke:`#78a8d8`,text:t}}}var nu=e.C4.messageSize+5;function ru(e){return e.labelLines??(0,t.c4RelLabelLines)(e)}function iu(t){let n=t.labelPosition;return n?ru(t).map((r,i,a)=>({cx:t.technology!==void 0&&i===a.length-1&&t.technologyX!==void 0?t.technologyX:n.x,cy:n.y+i*nu,w:(0,e.c4TextWidth)(r,e.C4.messageSize,400),h:e.C4.messageSize})):[]}function au(){return{next:{cnt:0}}}function ou(e,t,n,r,i){e.next.startx=e.startx=t,e.next.stopx=e.stopx=n,e.next.starty=e.starty=r,e.next.stopy=e.stopy=i}function su(e,t,n,r){let i=e[t];e[t]=i===void 0?n:r(n,i)}function cu(t,n,r){t.next.cnt+=1;let i=r.shapeMargin,a=t.next.startx===t.next.stopx?t.next.stopx+i:t.next.stopx+i*2,o=a+n.width,s=t.next.starty+i*2,c=s+n.height;(a>=t.widthLimit||o>=t.widthLimit||t.next.cnt>e.C4.shapeInRow)&&(a=t.next.startx+i+r.nextLinePaddingX,s=t.next.stopy+i*2,t.next.stopx=o=a+n.width,t.next.starty=t.next.stopy,t.next.stopy=c=s+n.height,t.next.cnt=1),n.x=a,n.y=s,su(t,`startx`,a,Math.min),su(t,`starty`,s,Math.min),su(t,`stopx`,o,Math.max),su(t,`stopy`,c,Math.max),su(t.next,`startx`,a,Math.min),su(t.next,`starty`,s,Math.min),su(t.next,`stopx`,o,Math.max),su(t.next,`stopy`,c,Math.max)}function lu(n,r){let i=(t,n)=>r.wrap?(0,e.wrapToWidth)(t,r.textWidth,n):t.split(`
219
- `),a=i(n.label,e.C4.nameSize),o=n.description?i(n.description,e.C4.descrSize):[],s=Math.max(...a.map(t=>(0,e.c4TextWidth)(t,e.C4.nameSize,700)),(0,e.c4TextWidth)((0,t.c4TypeLine)(n),e.C4.typeSize,400),...o.map(t=>(0,e.c4TextWidth)(t,e.C4.descrSize,400)));return{el:n,nameLines:a,descriptionLines:o,x:0,y:0,...(0,e.c4ShapeSize)(n,a.length,o.length,s,r)}}function uu(e){let t=new Set,n=new Map(e.elements.map(e=>[e.alias,e])),r=e=>{let i=e.elementAliases.flatMap(e=>{t.add(e);let r=n.get(e);return r?[r]:[]});return{alias:e.alias,boundary:e,elements:i,children:e.children.map(r)}},i=e.boundaries.map(r);return{alias:`global`,elements:e.elements.filter(e=>!t.has(e.alias)),children:i}}function du(n,r){let i=new Map,a=[],o=r.diagramMarginX,s=r.diagramMarginY,c=(e,t)=>{for(let n of t){let t=lu(n,r);i.set(n.alias,t),cu(e,t,r)}e.stopx+=r.shapeMargin,e.stopy+=r.shapeMargin},l=(n,i,u)=>{let d=au();d.widthLimit=n.widthLimit/Math.min(e.C4.boundaryInRow,i.length);for(let[f,p]of i.entries()){let i=p.boundary,m=0,h=m+8;m=h+e.C4.boundaryLabelHeight;let g;i&&(0,t.c4BoundaryTypeLine)(i)&&(g=m+5,m=g+e.C4.boundaryTypeHeight);let _;if(i?.description&&(_=m+20,m=_+e.C4.boundaryDescrHeight),i||(m=e.C4.rootHeadingHeight),f===0||f%e.C4.boundaryInRow===0){let e=n.startx+r.diagramMarginX,t=n.stopy+r.diagramMarginY+m;ou(d,e,e,t,t)}else{let e=d.stopx===d.startx?d.startx:d.stopx+r.diagramMarginX;ou(d,e,e,d.starty,d.starty)}if(p.elements.length>0&&c(d,p.elements),p.children.length>0&&l(d,p.children,u+1),i){let e=d.stopx-d.startx,t=d.stopy-d.starty;e===0&&(e=r.width,d.stopx=d.startx+e),t===0&&(t=m+r.shapeMargin),a.push({alias:i.alias,label:i.label,...i.type?{type:i.type}:{},...i.description?{description:i.description}:{},x:d.startx,y:d.starty,width:e,height:t,depth:u,labelY:h,...g===void 0?{}:{typeY:g},..._===void 0?{}:{descrY:_}})}n.stopy=Math.max(d.stopy+r.shapeMargin,n.stopy),n.stopx=Math.max(d.stopx+r.shapeMargin,n.stopx),o=Math.max(o,n.stopx),s=Math.max(s,n.stopy)}},u=au();return ou(u,r.diagramMarginX,r.diagramMarginX,r.diagramMarginY,r.diagramMarginY),u.widthLimit=e.C4.screenWidth,l(u,[n],-1),{elements:i,boundaries:a,maxX:o,maxY:s}}function fu(e,t){let n=e.x+e.width/2,r=e.y+e.height/2,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(i===0&&a===0)return{x:n,y:r};let c,l;if(Math.abs(a)*o>Math.abs(i)*s){let e=a<0?-s:s;c=e*i/a,l=e}else{let e=i<0?-o:o;c=e,l=e*a/i}return{x:n+c,y:r+l}}function pu(t,n){let r=(0,e.c4PersonGeometry)(t.width,t.height),i=t.x+t.width/2,a=t.y+t.height/2,o=t.width,s=t.height,c=-s/2+r.headRadius,l=-s/2+r.pillTop,u=r.rx,d=(e,t,n,r,i,a)=>Array.from({length:r},(o,s)=>{let c=(i+s*(a-i)/(r-1))*Math.PI/180;return{x:e-n*Math.cos(c),y:t-n*Math.sin(c)}}),f=Math.asin(Math.min(1,(l-c)/r.headRadius))*180/Math.PI,p=[...d(0,c,r.headRadius,24,180+f,-f),...d(-o/2+u,l+u,u,12,90,0),...d(-o/2+u,s/2-u,u,12,360,270),...d(o/2-u,s/2-u,u,12,270,180),...d(o/2-u,l+u,u,12,180,90)];return hu({x:i,y:a},n,p.map(e=>({x:i+e.x,y:a+e.y})))}function mu(e,t,n,r){let i=t.y-e.y,a=e.x-t.x,o=t.x*e.y-e.x*t.y,s=i*n.x+a*n.y+o,c=i*r.x+a*r.y+o;if(s!==0&&c!==0&&s*c>0)return;let l=r.y-n.y,u=n.x-r.x,d=r.x*n.y-n.x*r.y,f=l*e.x+u*e.y+d,p=l*t.x+u*t.y+d;if(f!==0&&p!==0&&f*p>0)return;let m=i*u-l*a;if(m===0)return;let h=Math.abs(m/2),g=a*d-u*o,_=g<0?(g-h)/m:(g+h)/m;return g=l*o-i*d,{x:_,y:g<0?(g-h)/m:(g+h)/m}}function hu(e,t,n){let r,i=1/0;return n.forEach((a,o)=>{let s=mu(e,t,a,n[(o+1)%n.length]);if(!s)return;let c=Math.hypot(s.x-t.x,s.y-t.y);c<i&&(r=s,i=c)}),r??e}var gu=1e-6;function _u(t,n){let r=fu(t,n),i=t.x+t.width/2,a=t.y+t.height/2,{rx:o,ry:s}=(0,e.c4CylinderCap)(t.width),c=r.x-i,l=Math.abs(c)<t.width/2-gu||Math.abs(Math.abs(c)-t.width/2)<=gu&&Math.abs(r.y-a)>t.height/2-s;if(o===0||!l)return r;let u=s*s*(1-c*c/(o*o)),d=s-(u>0?Math.sqrt(u):u);return n.y-a>0&&(d=-d),{x:r.x,y:r.y+d}}function vu(t,n){let r=fu(t,n),i=t.x+t.width/2,a=t.y+t.height/2,{rx:o,ry:s}=(0,e.c4QueueCap)(t.height),c=r.y-a,l=Math.abs(c)<t.height/2-gu||Math.abs(Math.abs(c)-t.height/2)<=gu&&Math.abs(r.x-i)>t.width/2-o;if(s===0||!l)return r;let u=o*o*(1-c*c/(s*s)),d=o-Math.sqrt(Math.abs(u));return n.x-i>0&&(d=-d),{x:r.x+d,y:r.y}}function yu(e,t){let n=e.el;return n?.kind===`person`?pu(e,t):n?.shape===`db`?_u(e,t):n?.shape===`queue`?vu(e,t):fu(e,t)}var bu=e=>({x:e.x+e.width/2,y:e.y+e.height/2});function xu(n,r,i,a){let o=i.get(n.from),s=i.get(n.to),c=yu(o,bu(s)),l=yu(s,bu(o)),u=l.x-c.x,d=l.y-c.y,f=e=>({x:e.x,y:e.y+a}),p={...n,points:[f(c),f(l)]};if(r>0&&(p.curve=f({x:c.x+u/2-u/4,y:c.y+d/2})),(0,t.c4RelLabelLines)(n).length>0){let r={x:Math.min(c.x,l.x)+Math.abs(u)/2,y:Math.min(c.y,l.y)+Math.abs(d)/2},i=(0,t.c4RelLabelLines)(n)[0],a=n.label!==``||n.index!==void 0?(0,e.c4TextWidth)(i??``,e.C4.messageSize,400):0;if(p.labelPosition=f({x:r.x+a/2,y:r.y}),n.technology){let t=(0,e.c4TextWidth)(`[${n.technology}]`,e.C4.messageSize,400);p.technologyX=r.x+Math.max(a,t)/2}}return p}var Su=2,Cu=6,wu=2,Tu=[0,14,-14,28,-28],Eu=[.75,.55,.4],Du=1e3,Ou=100,ku=10,Au=2,ju=5,Mu=4,Nu=e=>({x0:e.cx-e.w/2,x1:e.cx+e.w/2,y0:e.cy-e.h/2,y1:e.cy+e.h/2}),Pu=(e,t)=>e.x0<t.x1+Su&&e.x1>t.x0-Su&&e.y0<t.y1+Su&&e.y1>t.y0-Su;function Fu(e){let t=e.points[0],n=e.points[e.points.length-1],r=e.curve,i=Math.hypot(n.x-t.x,n.y-t.y),a=Math.max(1,Math.ceil(i/Mu));return Array.from({length:a+1},(e,i)=>{let o=i/a;if(!r)return{x:t.x+(n.x-t.x)*o,y:t.y+(n.y-t.y)*o};let s=1-o;return{x:s*s*t.x+2*s*o*r.x+o*o*n.x,y:s*s*t.y+2*s*o*r.y+o*o*n.y}})}function Iu(n){return n.flatMap(n=>{let r=(e,t,n,r,i)=>({x0:e-i,x1:t+i,y0:n-i,y1:r+i,weight:Ou}),i=(t,i,a,o)=>{let s=(0,e.c4TextWidth)(t,a,o),c=n.x+n.width/2;return r(c-s/2,c+s/2,n.y+i-a/2,n.y+i+a/2,ju)},a=(0,t.c4BoundaryTypeLine)({...n,elementAliases:[],children:[]});return[r(n.x,n.x+n.width,n.y,n.y,Au),r(n.x,n.x+n.width,n.y+n.height,n.y+n.height,Au),r(n.x,n.x,n.y,n.y+n.height,Au),r(n.x+n.width,n.x+n.width,n.y,n.y+n.height,Au),i(n.label,n.labelY,e.C4.boundarySize+2,700),...a?[i(a,n.typeY,e.C4.boundarySize,400)]:[],...n.description?[i(n.description,n.descrY,e.C4.boundarySize-2,400)]:[]]})}function Lu(e,t){return iu({...e,labelLines:t.lines,labelPosition:t.position,...t.technologyX===void 0?{}:{technologyX:t.technologyX}}).map(Nu)}function Ru(n,r,i,a,o){let s=n.points[0],c=n.points[n.points.length-1],l=n.labelPosition;if(!l||!s||!c)return;let u=c.x-s.x,d=c.y-s.y,f=Math.hypot(u,d),p=(0,t.c4RelLabelLines)(n),m=n.label!==``||n.index!==void 0,h=m?(0,e.c4TextWidth)(p[0],e.C4.messageSize,400):0,g=l.x-h/2,_=[{variant:{lines:p,position:l,...n.technologyX===void 0?{}:{technologyX:n.technologyX}},cost:0}];if(m&&o){let t=n.technology?[`[${n.technology}]`]:[],r=new Set([p.join(`
220
- `)]);Eu.forEach((n,i)=>{let a=(0,e.wrapToWidth)(p[0],h*n,e.C4.messageSize),o=[...a,...t].join(`
221
- `);if(r.has(o))return;r.add(o);let s=Math.max(...a.map(t=>(0,e.c4TextWidth)(t,e.C4.messageSize,400)));_.push({variant:{lines:[...a,...t],position:{x:g+s/2,y:l.y}},cost:25*(i+1)})})}let v=f===0?0:u/f,y=f===0?0:d/f,b=f/2+Math.max(...Tu)+Su,x=_.flatMap(e=>Lu(n,e.variant)),S={x0:Math.min(...x.map(e=>e.x0))-b,x1:Math.max(...x.map(e=>e.x1))+b,y0:Math.min(...x.map(e=>e.y0))-b,y1:Math.max(...x.map(e=>e.y1))+b},C=e=>e.x0<S.x1&&e.x1>S.x0&&e.y0<S.y1&&e.y1>S.y0,w=[...r,...a].filter(C),T=Math.max(wu,f/200),E=i.filter(e=>C({x0:Math.min(...e.map(e=>e.x)),x1:Math.max(...e.map(e=>e.x)),y0:Math.min(...e.map(e=>e.y)),y1:Math.max(...e.map(e=>e.y))})),D=E.map(e=>({x0:Math.min(...e.map(e=>e.x)),x1:Math.max(...e.map(e=>e.x)),y0:Math.min(...e.map(e=>e.y)),y1:Math.max(...e.map(e=>e.y))})),O,k=e=>O?.penalty===0&&e>=O.cost;for(let{variant:e,cost:t}of _){let r=Lu(n,e);for(let n of Tu)if(!k(t+2*Math.abs(n)))for(let i=0;i<=f/2&&!k(t+2*Math.abs(n)+i);i+=T)for(let a of i===0?[1]:[1,-1]){let o=a*i,s={x:o*v-n*y,y:o*y+n*v},c=r.map(e=>({x0:e.x0+s.x,x1:e.x1+s.x,y0:e.y0+s.y,y1:e.y1+s.y})),l=0,u=O?.penalty??1/0;for(let e of c){if(l>u)break;for(let t of w)if(Pu(e,t)&&(l+=t.weight),l>u)break;if(l>u)break;for(let[t,n]of E.entries()){let r=D[t];r.x1<=e.x0||r.x0>=e.x1||r.y1<=e.y0||r.y0>=e.y1||n.some(t=>t.x>e.x0&&t.x<e.x1&&t.y>e.y0&&t.y<e.y1)&&(l+=ku)}}let d=t+i+2*Math.abs(n);(!O||l<O.penalty||l===O.penalty&&d<O.cost)&&(O={v:e,at:s,penalty:l,cost:d})}}let{v:A,at:j}=O;n.labelPosition={x:A.position.x+j.x,y:A.position.y+j.y},A.lines!==p&&(n.labelLines=A.lines),A.technologyX===void 0?delete n.technologyX:n.technologyX=A.technologyX+j.x,a.push(...iu(n).map(e=>({...Nu(e),weight:Ou})))}function zu(t,n={}){let r=(0,e.c4Config)(t.layout);if(t.elements.length===0&&t.boundaries.length===0){let n={variant:t.variant,width:0,height:0,elements:[],boundaries:[],relationships:[]};if(t.title){let i=2*r.diagramMarginY+e.C4.titleExtra;n.title=t.title,n.width=Math.ceil(2*r.diagramMarginX+(0,e.c4TextWidth)(t.title,16,400)),n.height=i,n.titlePosition={x:r.diagramMarginX,y:i/2}}return n}let i=du(uu(t),r),a=t.title?e.C4.titleExtra:0,o=r.diagramMarginY+a,s=t.elements.flatMap(e=>{let t=i.elements.get(e.alias);return t?[{...e,x:t.x,y:t.y+o,width:t.width,height:t.height,nameLines:t.nameLines,descriptionLines:t.descriptionLines}]:[]}),c=[...i.boundaries].sort((e,t)=>e.depth-t.depth).map(e=>({...e,y:e.y+o})),l=new Map;for(let e of i.elements.values())l.set(e.el.alias,e);for(let e of i.boundaries)l.set(e.alias,e);let u=t.relationships.map((e,t)=>xu(e,t,l,o)),d=[...s.map(e=>({x0:e.x-Cu,x1:e.x+e.width+Cu,y0:e.y-Cu,y1:e.y+e.height+Cu,weight:Du})),...Iu(c)],f=u.map(Fu),p=[];u.forEach((e,t)=>Ru(e,d,f.filter((e,n)=>n!==t),p,r.wrap));let m=i.maxX+r.diagramMarginX,h=i.maxY+r.diagramMarginY+a,g={variant:t.variant,width:m,height:h,elements:s,boundaries:c,relationships:u,...t.layout&&{layout:t.layout}};return t.title&&(g.title=t.title,g.titlePosition={x:(i.maxX-r.diagramMarginX)/2-4*r.diagramMarginX,y:r.diagramMarginY+r.diagramMarginY+o}),g}function Bu(t,n,r=`Inter`,i=!1,a=M,o,s,c,l={}){let u=[];u.push(R((0,e.svgOpenTag)(t.width,t.height,n,i,s??t.title,c,void 0,l.styleAttribute,l.description),o)),u.push((0,e.buildStyleBlock)(r,!1,l.nonce,l.bodyFont)),t.title&&t.titlePosition&&u.push(e.f`<text class="c4-title" x="${t.titlePosition.x}" y="${t.titlePosition.y}" dy="${L}" `+e.f`font-size="16" fill="var(--_text)">${(0,e.escapeXml)(t.title)}</text>`);for(let e of t.boundaries)u.push(Hu(e));for(let n of t.elements)u.push(Uu(n,t.layout?.shapePadding??e.C4.shapePadding));for(let e of t.relationships)u.push(Zu(e));for(let e of t.relationships)u.push(Qu(e));return u.push(`</svg>`),u.filter(Boolean).join(`
222
- `)}function Vu(t,n,r,i,a){return e.f` <text x="${n}" y="${r}" text-anchor="middle" dy="${L}" font-size="${i}" `+e.f`${a}>${(0,e.escapeXml)(t)}</text>`}function Hu(n){let r=[];r.push(e.f`<g class="c4-boundary" data-id="${(0,e.escapeAttr)(n.alias)}" data-label="${(0,e.escapeAttr)(n.label)}" data-depth="${n.depth}">`),r.push(e.f` <rect x="${n.x}" y="${n.y}" width="${n.width}" height="${n.height}" rx="2.5" ry="2.5" `+`fill="none" stroke="var(--_text)" stroke-width="1" stroke-dasharray="7,7" />`);let i=n.x+n.width/2;r.push(Vu(n.label,i,n.y+(n.labelY??8),e.C4.boundarySize+2,`font-weight="700" fill="var(--_text)"`));let a=(0,t.c4BoundaryTypeLine)({alias:n.alias,label:n.label,...n.type?{type:n.type}:{},elementAliases:[],children:[]});return a&&n.typeY!==void 0&&r.push(Vu(a,i,n.y+n.typeY,e.C4.boundarySize,`fill="var(--_text)"`)),n.description&&n.descrY!==void 0&&r.push(Vu(n.description,i,n.y+n.descrY,e.C4.boundarySize-2,`fill="var(--_text)"`)),r.push(`</g>`),r.join(`
223
- `)}function Uu(n,r){let i=tu(n),{x:a,y:o,width:s,height:c}=n,l=a+s/2,u=(0,e.c4TextBlockHeight)(n.nameLines.length,n.descriptionLines.length),d=[];d.push(e.f`<g class="c4-element" data-id="${(0,e.escapeAttr)(n.alias)}" data-kind="${n.kind}" data-shape="${n.shape}" `+e.f`data-external="${n.external}" data-label="${(0,e.escapeAttr)(n.label)}">`);let f,p=l;if(n.kind===`person`)d.push(...Gu(n,i)),f=o+(0,e.c4PersonGeometry)(s).pillTop+r;else if(n.shape===`db`){d.push(...Ku(n,i));let{ry:t}=(0,e.c4CylinderCap)(s);f=o+(2*t+c)/2-u/2}else if(n.shape===`queue`){d.push(...qu(n,i));let{rx:t}=(0,e.c4QueueCap)(c);p=l-t,f=o+c/2-u/2}else d.push(e.f` <rect x="${a}" y="${o}" width="${s}" height="${c}" rx="${e.C4.cornerRadius}" ry="${e.C4.cornerRadius}" `+e.f`fill="${i.fill}" stroke="${i.stroke}" stroke-width="${e.C4.strokeWidth}" />`),f=o+r;let m=f;for(let t of n.nameLines)d.push(Vu(t,p,m+e.C4.nameLine/2,e.C4.nameSize,e.f`font-weight="700" fill="${i.text}"`)),m+=e.C4.nameLine;return d.push(Vu((0,t.c4TypeLine)(n),p,m+e.C4.typeLine/2,e.C4.typeSize,e.f`fill="${i.text}"`)),m+=e.C4.typeLine,n.descriptionLines.forEach((t,n)=>{d.push(Vu(t,p,m+e.C4.descrLine/2+n*e.C4.descrExtraLine,e.C4.descrSize,e.f`fill="${i.text}"`))}),m+=(0,e.c4DescriptionHeight)(n.descriptionLines.length),d.push(`</g>`),d.join(`
224
- `)}function Wu(t){let{x:n,y:r,width:i,height:a}=t,{rx:o,headRadius:s,pillTop:c}=(0,e.c4PersonGeometry)(i,a),l=n+i/2,u=r+c,d=r+a,f=Math.sqrt(Math.max(0,s*s-(u-(r+s))**2));return e.f`M ${n+o} ${u} H ${l-f} A ${s} ${s} 0 1 1 ${l+f} ${u} `+e.f`H ${n+i-o} A ${o} ${o} 0 0 1 ${n+i} ${u+o} V ${d-o} `+e.f`A ${o} ${o} 0 0 1 ${n+i-o} ${d} H ${n+o} `+e.f`A ${o} ${o} 0 0 1 ${n} ${d-o} V ${u+o} `+e.f`A ${o} ${o} 0 0 1 ${n+o} ${u} Z`}function Gu(t,n){return[e.f` <path class="c4-person-shape" d="${Wu(t)}" fill="${n.fill}" stroke="${n.stroke}" stroke-width="${e.C4.strokeWidth}" />`]}function Ku(t,n){let{x:r,y:i,width:a,height:o}=t,{rx:s,ry:c}=(0,e.c4CylinderCap)(a),l=e.f`fill="${n.fill}" stroke="${n.stroke}" stroke-width="${e.C4.strokeWidth}"`;return[e.f` <path d="M ${r} ${i+c} L ${r} ${i+o-c} A ${s} ${c} 0 0 0 ${r+a} ${i+o-c} L ${r+a} ${i+c} Z" ${l} />`,e.f` <ellipse cx="${r+s}" cy="${i+c}" rx="${s}" ry="${c}" ${l} />`]}function qu(t,n){let{x:r,y:i,width:a,height:o}=t,{rx:s,ry:c}=(0,e.c4QueueCap)(o),l=e.f`fill="${n.fill}" stroke="${n.stroke}" stroke-width="${e.C4.strokeWidth}"`;return[e.f` <path d="M ${r+a-s} ${i} H ${r+s} A ${s} ${c} 0 0 0 ${r+s} ${i+o} H ${r+a-s} Z" ${l} />`,e.f` <ellipse cx="${r+a-s}" cy="${i+c}" rx="${s}" ry="${c}" ${l} />`]}function Ju(t,n){let r=t.x-n.x,i=t.y-n.y,a=Math.hypot(r,i);if(a===0)return``;let o=r/a,s=i/a,c=t.x-o*10,l=t.y-s*10;return e.f`<polygon class="c4-arrowhead" points="${t.x},${t.y} ${c-s*5},${l+o*5} ${c+s*5},${l-o*5}" `+`fill="var(--_text)" />`}var Yu=3,Xu=1;function Zu(t){let[n,r]=[t.points[0],t.points[t.points.length-1]];if(!n||!r||n===r)return``;let i=[`class="c4-relationship"`,e.f`data-from="${(0,e.escapeAttr)(t.from)}"`,e.f`data-to="${(0,e.escapeAttr)(t.to)}"`];t.label&&i.push(e.f`data-label="${(0,e.escapeAttr)(t.label)}"`),t.technology&&i.push(e.f`data-technology="${(0,e.escapeAttr)(t.technology)}"`);let a=t.curve?e.f`M ${n.x},${n.y} Q ${t.curve.x},${t.curve.y} ${r.x},${r.y}`:e.f`M ${n.x},${n.y} L ${r.x},${r.y}`,o=e.f`<path ${i.join(` `)} d="${a}" fill="none" stroke="var(--_text)" stroke-width="1" />`,s=t.curve??n,c=t.curve??r,l=Ju(r,s),u=Ju(n,c);return[o,...t.bidirectional?[l,u]:[t.reversed?u:l]].filter(Boolean).join(`
225
- `)}function Qu(t){let n=ru(t),r=iu(t);if(r.length===0)return``;let i=[e.f`<g class="c4-relationship-label" data-from="${(0,e.escapeAttr)(t.from)}" data-to="${(0,e.escapeAttr)(t.to)}">`],a=Math.min(...r.map(e=>e.cx-e.w/2))-Yu,o=Math.max(...r.map(e=>e.cx+e.w/2))+Yu,s=r[0].cy-r[0].h/2-Xu,c=r[r.length-1],l=c.cy+c.h/2+Xu;return i.push(e.f` <rect class="c4-label-plate" x="${a}" y="${s}" width="${o-a}" height="${l-s}" rx="2" ry="2" fill="var(--bg)" />`),n.forEach((a,o)=>{let s=t.technology!==void 0&&o===n.length-1,c=r[o];i.push(Vu(a,c.cx,c.cy,e.C4.messageSize,s?`font-style="italic" fill="var(--_text)"`:`fill="var(--_text)"`))}),i.push(`</g>`),i.join(`
226
- `)}var Q={titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,defaultWidth:1200},$u=Q.barHeight+Q.barGap,ed={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:26298e5};function td(e,n={}){let r=n.width??Q.defaultWidth,i=e.tasks,a=i.filter(e=>!e.vert),o=[];for(let e of a)o.includes(e.section)||o.push(e.section);let s=e=>{let t=o.indexOf(e);return(t<0?0:t)%Q.numberSectionStyles},c=new Map,l=new Map,u=2*Q.topPadding;if(e.displayMode===`compact`){let e=0;for(let n of o){let r=a.filter(e=>e.section===n),i=(0,t.packGanttSection)(r,e,c)+1;e+=i,u+=i*$u,l.set(n,i)}}else{for(let e of a)c.set(e,e.order);u+=a.length*$u;for(let e of o)l.set(e,a.filter(t=>t.section===e).length)}let d=(u-2*Q.topPadding)/$u,f=e=>e.vert?-1:c.get(e)??e.order,p=r-Q.leftPadding-Q.rightPadding,m=i.length?Math.min(...i.map(e=>e.start)):0,h=i.length?Math.max(...i.map(e=>e.end)):0,g=e=>Math.round(h===m?p/2:(e-m)/(h-m)*p),_=[...i].sort((e,t)=>e.start>t.start?1:e.start<t.start?-1:0).sort((e,t)=>e.vert===t.vert?0:e.vert?1:-1).map(e=>{let t=f(e),n=g(e.start),i=g(e.end),a=g(e.renderEnd??e.end),o=n+Q.leftPadding,c=a-n,l=t*$u+Q.topPadding,u=Q.barHeight;e.milestone?(o=n+Q.leftPadding+.5*(i-n)-.5*Q.barHeight,c=Q.barHeight):e.vert&&(c=.08*Q.barHeight),e.vert&&(l=Q.gridLineStartPadding,u=d*$u+Q.barHeight*2);let p=n+Q.leftPadding+.5*(i-n),m=t*$u+Q.topPadding+.5*Q.barHeight,h=k(e.label,Q.fontSize,400),_=n,v=a;e.milestone&&(_+=.5*(i-n)-.5*Q.barHeight,v=_+Q.barHeight);let y,b=`middle`,x=null,S=i;e.milestone&&(S=n+Q.barHeight);let C=h>(e.vert?0:v-_),w=h>S-n;y=e.vert?n+Q.leftPadding:C?v+h+1.5*Q.leftPadding>r?_+Q.leftPadding-5:v+Q.leftPadding+5:(v-_)/2+_+Q.leftPadding,w&&(S+h+1.5*Q.leftPadding>r?(x=`left`,b=`end`):(x=`right`,b=`start`));let T=e.vert?Q.gridLineStartPadding+d*$u+60:t*$u+Q.barHeight/2+(Q.fontSize/2-2)+Q.topPadding;return{id:e.id,x:o,y:l,width:c,height:u,originX:p,originY:m,sectionStyle:s(e.section),task:e,text:{text:e.label,x:y,y:T,anchor:b,outside:x}}}),v=new Set,y=[];for(let e of _){if(e.task.vert)continue;let t=f(e.task);v.has(t)||(v.add(t),y.push({y:t*$u+Q.topPadding-2,width:r-Q.rightPadding/2,height:$u,sectionStyle:e.sectionStyle}))}let b=[];if((e.excludes.length>0||e.includes.length>0)&&i.length){let n=864e5;if(h-m<=1830*n){let r=n=>(0,t.isExcludedDate)(e,n),i=null;for(let e=m;e<=h;e+=n)r(e)?i?i.end=e:i={start:e,end:e}:i&&=(b.push(x(i)),null)}}function x(e){let n=864e5,r=e=>Math.floor(e/n)*n,i=g(r(e.start)),a=g(r(e.end)+n-1);return{id:(0,t.formatD3Time)(e.start,`%Y-%m-%d`),x:i+Q.leftPadding,y:Q.gridLineStartPadding,width:a-i,height:u-Q.topPadding-Q.gridLineStartPadding}}let S=e.axisFormat||(e.dateFormat===`D`?`%d`:`%Y-%m-%d`),C=e.tickInterval;C&&i.length&&Math.ceil((h-m)/(C.every*ed[C.unit]))>1e4&&(C=void 0);let w=-u+Q.topPadding+Q.gridLineStartPadding,T=n=>({x:Q.leftPadding,y:n===`bottom`?u-50:Q.topPadding,position:n,tickSize:w,rangeEnd:p,ticks:i.length?(0,t.timeTicks)(m,h,C,e.weekday).map(e=>({x:g(e)+.5,label:(0,t.formatD3Time)(e,S)})):[]}),E=[T(`bottom`)];e.topAxis&&E.push(T(`top`));let D=[],O=0;for(let e of o){let t=l.get(e);D.push({lines:e.split(/<br\s*\/?>|\n/i),y:t*$u/2+O*$u+Q.topPadding,sectionStyle:s(e)}),O+=t}let A={width:r,height:u,excludeRanges:b,axes:E,rows:y,tasks:_,sectionLabels:D};if(e.title&&(A.title={text:e.title,x:r/2,y:Q.titleTopMargin}),e.todayMarker!==`off`&&i.length){let t=n.now??Date.now(),r=g(t);t>=m&&t<=h&&(A.today={x:r+Q.leftPadding,y1:Q.titleTopMargin,y2:u-Q.titleTopMargin,style:e.todayMarker.replace(/,/g,`;`)})}return A}function $(e){return String(Math.round(e*100)/100)}function nd(e){return e.split(`;`).map(e=>e.split(`:`).map(e=>e.trim())).filter(([e,t])=>e!==void 0&&t!==void 0&&/^(?:stroke(?:-width|-dasharray|-opacity|-linecap)?|opacity)$/.test(e)&&/^[\w#.%() -]+$/.test(t)).map(([e,t])=>`${e}: ${t};`).join(` `)}function rd(n,r){let i=`var(--accent, ${t.CHART_ACCENT_FALLBACK})`,a=(e,t,n=`var(--bg)`)=>`color-mix(in srgb, ${e} ${t}%, ${n})`,o=a(i,75,`var(--fg)`),s=(e,t)=>` ${[0,1,2,3].map(t=>`.${e}${t}`).join(`,`)} { ${t} }`,c=[`doneText`,`doneCritText`].flatMap(e=>[0,1,2,3].flatMap(t=>[`.${e}${t}.taskTextOutsideLeft`,`.${e}${t}.taskTextOutsideRight`])).join(`,`);return`${(0,e.styleOpenTag)(r)}
216
+ </style>`,cls:c}}function mu(t,n,r){return t.map((i,a)=>{let o=a*14-14*(t.length-1)/2;return`<text x="${Z(n)}" y="${Z(r)}" dominant-baseline="central" alignment-baseline="central" text-anchor="middle" class="journey-label"><tspan x="${Z(n)}" dy="${Z(o)}">${(0,e.escapeXml)(i)}</tspan></text>`}).join(``)}function hu(e){let t=e.x+e.width/2,n=e.faceY,r=`<circle cx="${Z(t-5)}" cy="${Z(n-5)}" r="1.5" stroke-width="2" fill="var(--fg)" stroke="var(--fg)"/><circle cx="${Z(t+5)}" cy="${Z(n-5)}" r="1.5" stroke-width="2" fill="var(--fg)" stroke="var(--fg)"/>`,i;return i=e.score>3?`<path class="mouth" d="${du}" transform="translate(${Z(t)},${Z(n+2)})"/>`:e.score<3?`<path class="mouth" d="${fu}" transform="translate(${Z(t)},${Z(n+7)})"/>`:`<line class="mouth-line" x1="${Z(t-5)}" y1="${Z(n+7)}" x2="${Z(t+5)}" y2="${Z(n+7)}" stroke-width="1"/>`,`<circle cx="${Z(t)}" cy="${Z(n)}" class="face" r="15" stroke-width="2"/><g>${r}${i}</g>`}function gu(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[],{css:u,cls:d}=pu(t,n,c.nonce);l.push(z((0,e.withRootClass)((0,e.svgOpenTag)(t.width,t.height,n,i,o,s,void 0,c.styleAttribute,c.description),d),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(u),l.push(`<defs><marker id="journey-arrowhead" refX="5" refY="2" markerWidth="6" markerHeight="4" orient="auto"><path class="journey-arrow" d="M 0,0 V 4 L6,2 Z"/></marker></defs>`);for(let n of t.legend){l.push(`<circle cx="${Z(n.cx)}" cy="${Z(n.cy)}" class="actor-${n.pos%6}" stroke="var(--fg)" r="7"/>`);for(let t of n.lines)l.push(`<text x="40" y="${Z(t.y)}" class="legend"><tspan x="${Z(t.x)}">${(0,e.escapeXml)(t.text)}</tspan></text>`)}for(let e of t.sections)l.push(`<g><rect x="${Z(e.x)}" y="${Z(e.y)}" width="${Z(e.width)}" height="${Z(e.height)}" rx="3" ry="3" class="journey-section section-type-${e.num}"/>`+mu(e.text.split(/<br\s*\/?>/i),e.x+e.width/2,e.y+e.height/2)+`</g>`);t.tasks.forEach((t,n)=>{let r=t.x+t.width/2,i=t.dots.map(t=>`<circle cx="${Z(t.cx)}" cy="${Z(t.cy)}" class="actor-${t.pos}" stroke="var(--fg)" r="7"><title>${(0,e.escapeXml)(t.actor)}</title></circle>`).join(``);l.push(`<g><line id="task${n}" x1="${Z(r)}" y1="${Z(t.y)}" x2="${Z(r)}" y2="${Z(t.lineEndY)}" class="task-line" stroke-width="1" stroke-dasharray="4 2"/>`+hu(t)+`<rect x="${Z(t.x)}" y="${Z(t.y)}" width="${Z(t.width)}" height="${Z(t.height)}" rx="3" ry="3" class="task task-type-${t.num} section-type-${t.num}"/>`+i+mu(t.lines,r,t.y+t.height/2)+`</g>`)}),t.title&&l.push(`<text x="${Z(t.title.x)}" y="${Z(t.title.y)}" font-size="33.47" font-weight="bold" class="journey-title">${(0,e.escapeXml)(t.title.text)}</text>`);let f=t.axis;return l.push(`<line x1="${Z(f.x1)}" y1="${Z(f.y1)}" x2="${Z(f.x2)}" y2="${Z(f.y2)}" stroke-width="4" class="journey-axis" marker-end="url(#journey-arrowhead)"/>`),l.push(`</svg>`),l.join(`
217
+ `)}var _u=`␣A-57|␣T-19|␣Y-19|A␣-57|AT-100|AV-90|AW-90|AY-109|Av-57|Aw-47|Ay-42|F,-185|F.-185|FA-109|Ke-33|Ki-32|Kn-33|Ko-33|Ku-33|Kw-32|L␣-39|LT-105|LV-143|LW-129|LY-133|Ly-85|P␣-19|P,-200|P.-200|PA-114|Pa-48|Pe-48|Ph-48|Pi-48|Po-48|Pr-48|RT-42|RV-47|RW-66|RY-65|Re-42|Ro-42|Ru-30|T␣-19|T,-170|T--99|T.-170|T:-114|T;-114|TA-100|TO-57|Ta-128|Tc-128|Te-128|Ti-43|To-128|Tr-113|Ts-124|Tu-133|Tw-142|Ty-118|V,-150|V--76|V.-150|V:-62|V;-62|VA-105|Va-81|Ve-67|Vi-19|Vo-67|Vr-62|Vu-67|Vy-38|W,-95|W--71|W.-95|W:-19|W;-19|WA-90|Wa-57|We-48|Wi-14|Wo-48|Wr-52|Wu-43|Wy-19|Y␣-19|Y,-165|Y--125|Y.-165|Y:-89|Y;-89|YA-109|Ya-95|Ye-108|Yi-57|Yo-118|Yp-95|Yq-123|Yu-76|Yv-61|r,-146|r.-136|v,-138|v.-138|w,-108|w.-108|y,-125|y.-125|`,vu=`␣A-57|␣T-19|␣Y-19|A␣-57|AT-98|AV-77|AW-56|AY-92|Av-19|Aw-19|Ay-19|F,-114|F.-114|FA-57|Fa-49|Fe-49|Fo-49|Fu-48|L␣-38|LT-76|LV-76|LW-76|LY-76|Ly-38|P␣-19|P,-132|P.-132|PA-76|Pa-48|Pe-48|Po-48|RT-42|RV-38|RW-45|RY-65|T␣-19|T,-114|T--80|T.-114|T:-114|T;-114|TA-98|TO-61|Ta-114|Tc-114|Te-114|Ti-39|To-133|Tr-106|Ts-114|Tu-93|Tw-82|Ty-78|V,-115|V--57|V.-94|V:-38|V;-38|VA-77|Va-77|Ve-57|Vi-19|Vo-70|Vr-51|Vu-55|Vy-39|W,-89|W--18|W.-85|W:-18|W;-18|WA-56|Wa-38|We-19|Wo-19|Wr-19|Wu-18|Wy-9|Y␣-19|Y,-132|Y--94|Y.-132|Y:-56|Y;-66|YA-92|Ya-76|Ye-94|Yi-38|Yo-94|Yp-76|Yq-94|Yu-56|Yv-56|ka-32|r,-116|r.-121|ra-33|v,-135|v.-135|vi32|w,-100|w.-100|y,-114|y.-114|`;function yu(e){let t=new Map;for(let n of e.split(`|`).filter(Boolean))t.set(n.slice(0,2).replace(`␣`,` `),Number(n.slice(2))/64);return t}var bu=yu(_u),xu=yu(vu);function Su(e,t=!1){let n=t?xu:bu,r=0;for(let t=0;t+1<e.length;t++)r+=n.get(e.slice(t,t+2))??0;return r}function Cu(e,t=!1){return xc(e,16,t)+Su(e,t)}var Q={fontSize:16,rowHeight:24,bodyGap:20,boxPad:20,textTop:8,rowInset:10,margin:8,nodeSpacing:40,layerSpacing:40,loopOut:20,loopLabelGap:4,loopHalf:12};function wu(e){return`<<${e}>>`}function Tu(e,t,n){let r=Math.max(Cu(e),Cu(t,!0),...n.map(e=>Cu(e))),i=Q.rowHeight*2+(n.length>0?Q.bodyGap+Q.rowHeight*n.length:0);return{width:r+Q.boxPad,height:i+Q.boxPad}}function Eu(e,t){let n=e[0],r=1/0;for(let i=1;i<e.length;i++){let a=e[i-1],o=e[i],s=(o.x-a.x)**2+(o.y-a.y)**2,c=s===0?0:Math.max(0,Math.min(1,((t.x-a.x)*(o.x-a.x)+(t.y-a.y)*(o.y-a.y))/s)),l={x:a.x+(o.x-a.x)*c,y:a.y+(o.y-a.y)*c},u=Math.hypot(l.x-t.x,l.y-t.y);u<r&&(r=u,n=l)}return n}function Du(n,r={}){if(n.nodes.length===0)return{width:16,height:16,nodes:[],edges:[]};let i=new Map,a=new Map;for(let e of n.nodes){let n=(0,t.requirementBodyRows)(e);a.set(e.id,n),i.set(e.id,Tu(`<<${e.typeLabel}>>`,e.id,n))}let o=Q.margin,s=n.relationships.flatMap((e,t)=>e.src===e.dst?[]:[{id:`e${t}`,sources:[e.src],targets:[e.dst],labels:[{layoutOptions:he,text:wu(e.type),width:Cu(wu(e.type)),height:Q.rowHeight}]}]),c=E({id:`root`,layoutOptions:{...pe({direction:de(r.direction??n.direction,ue.requirement),nodeSpacing:Q.nodeSpacing,layerSpacing:Q.layerSpacing,padding:o}),"spacing.baseValue":`40`,"elk.hierarchyHandling":`INCLUDE_CHILDREN`,"elk.layered.cycleBreaking.strategy":`DEPTH_FIRST`,"elk.layered.nodePlacement.bk.fixedAlignment":`BALANCED`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`},children:n.nodes.map(e=>me(e.id,i.get(e.id))),edges:s},r.layoutCache),l=n.nodes.map(t=>{let r=(c.children??[]).find(e=>e.id===t.id),o=i.get(t.id),s=a.get(t.id),l=r.x??0,u=r.y??0,d=n.nodeClasses.get(t.id),f=n.classAssignments.get(t.id),p=[n.classDefs.get(`default`),...n.styleLayers.get(t.id)??[]].reduce((t,n)=>n?{...t,...(0,e.dropInvalidColors)(n)}:t,void 0);return{id:t.id,kind:t.kind,typeText:`<<${t.typeLabel}>>`,name:t.id,rows:s,x:l,y:u,width:r.width??o.width,height:r.height??o.height,...s.length>0&&{dividerY:u+Q.rowHeight*2+Q.bodyGap},...p&&{inlineStyle:p},...f&&{className:f},...d&&{classNames:d}}}),u=new Map(l.map(e=>[e.id,e])),d=new Map((c.edges??[]).map(e=>[e.id,e])),f=n.relationships.map((e,t)=>{let n=wu(e.type),r=Cu(n),i={type:e.type,src:e.src,dst:e.dst,label:n,labelWidth:r,labelHeight:Q.rowHeight};if(e.src!==e.dst){let e=d.get(`e${t}`),n=vt(e),r=e.labels[0];return{...i,points:n,labelPoint:Eu(n,{x:r.x+r.width/2,y:r.y+r.height/2})}}let a=u.get(e.src),o=a.y+a.height/2,s=a.x-Q.loopOut,c=Math.max(Q.loopHalf,a.height/8);return{...i,points:[{x:a.x,y:o-c},{x:s,y:o-c},{x:s,y:o+c},{x:a.x,y:o+c}],labelPoint:{x:s-Q.loopLabelGap-r/2,y:o}}}),p=1/0,m=1/0,h=-1/0,g=-1/0,_=(e,t,n,r)=>{p=Math.min(p,e),m=Math.min(m,t),h=Math.max(h,n),g=Math.max(g,r)};for(let e of l)_(e.x,e.y,e.x+e.width,e.y+e.height);for(let e of f){for(let t of e.points)_(t.x,t.y,t.x,t.y);_(e.labelPoint.x-e.labelWidth/2,e.labelPoint.y-e.labelHeight/2,e.labelPoint.x+e.labelWidth/2,e.labelPoint.y+e.labelHeight/2)}let v=o-p,y=o-m;for(let e of l)e.x+=v,e.y+=y,e.dividerY!==void 0&&(e.dividerY+=y);for(let e of f){for(let t of e.points)t.x+=v,t.y+=y;e.labelPoint.x+=v,e.labelPoint.y+=y}return{width:h-p+2*o,height:g-m+2*o,nodes:l,edges:f}}var Ou=`10 7`,ku=9,Au=16,ju=8;function Mu(t,n,r=`Inter`,i=!1,a=N,o,s,c,l={}){let u=[];u.push(z((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,void 0,l.styleAttribute,l.description),o)),u.push(ie(r,!0,l.nonce,l.bodyFont));for(let e of t.edges)u.push(Lu(e));for(let e of t.nodes)u.push(Nu(e,a));for(let e of t.edges)u.push(Ru(e,a));return u.push(`</svg>`),u.join(`
218
+ `)}function Nu(t,n){let{x:r,y:i,width:a,height:o,inlineStyle:s}=t,c=(0,e.escapeAttr)(s?.fill??`var(--_node-fill)`),l=(0,e.escapeAttr)(s?.stroke??`var(--_node-stroke)`),u=(0,e.escapeAttr)(s?.[`stroke-width`]??String(I.outerBox)),d=s?.color?(0,e.escapeAttr)(s.color):void 0,f=[`requirement-node`,...(t.classNames??[]).flatMap(t=>(0,e.sanitizeClassName)(t)??[])].join(` `),p=[e.f`<g class="${f}" data-id="${(0,e.escapeAttr)(t.id)}" data-kind="${t.kind}">`,e.f` <rect x="${r}" y="${i}" width="${a}" height="${o}" rx="0" ry="0" `+e.f`fill="${c}" stroke="${l}" stroke-width="${u}" />`],m=r+a/2,h=Q.rowHeight,g=i+Q.textTop,_=(t,r,i,a,o)=>` `+(0,e.renderMultilineText)(t,r,i,n.nodeLabel,e.f`${a} font-size="${n.nodeLabel}" fill="${d??o}"`);if(p.push(_(t.typeText,m,g+h/2,`text-anchor="middle"`,`var(--_text-sec)`),_(t.name,m,g+h*1.5,e.f`text-anchor="middle" font-weight="700"`,`var(--_text)`)),t.dividerY!==void 0){p.push(e.f` <line x1="${r}" y1="${t.dividerY}" x2="${r+a}" y2="${t.dividerY}" `+e.f`stroke="${l}" stroke-width="${I.innerBox}" />`);for(let[e,n]of t.rows.entries())p.push(_(n,r+Q.rowInset,g+h*2+Q.bodyGap+h*(e+.5),`text-anchor="start"`,`var(--_text-sec)`))}return p.push(`</g>`),p.join(`
219
+ `)}function Pu(e,t){let n=Math.hypot(t.x-e.x,t.y-e.y);return n===0?{x:0,y:0}:{x:(t.x-e.x)/n,y:(t.y-e.y)/n}}var Fu=5*Math.SQRT2;function Iu(t){let n=t.length-1,r=e.f`M${t[0].x},${t[0].y}`;for(let i=1;i<n;i++){let n=t[i],a=t[i-1],o=t[i+1],s=Pu(n,a),c=Pu(n,o),l=Math.min(Fu,Math.hypot(a.x-n.x,a.y-n.y)/2),u=Math.min(Fu,Math.hypot(o.x-n.x,o.y-n.y)/2);r+=e.f`L${n.x+s.x*l},${n.y+s.y*l}`+e.f`Q${n.x},${n.y} ${n.x+c.x*u},${n.y+c.y*u}`}return r+e.f`L${t[n].x},${t[n].y}`}function Lu(t){let n=t.points;if(n.length<2)return``;let r=t.type===`contains`,i=I.connector,a=[`class="requirement-relationship"`,e.f`data-type="${t.type}"`,e.f`data-src="${(0,e.escapeAttr)(t.src)}"`,e.f`data-dst="${(0,e.escapeAttr)(t.dst)}"`].join(` `),o=e.f`<path ${a} d="${Iu(n)}" fill="none" `+e.f`stroke="var(--_line)" stroke-width="${i}"${r?``:e.f` stroke-dasharray="${Ou}"`} />`;if(r){let t=n[0],r=Pu(t,n[1]),a={x:t.x+r.x*10,y:t.y+r.y*10},s=ku,c=(t,n,r,a)=>e.f`<line x1="${t}" y1="${n}" x2="${r}" y2="${a}" stroke="var(--_line)" stroke-width="${i}" />`;return[o,e.f`<circle cx="${a.x}" cy="${a.y}" r="${s}" fill="var(--bg)" stroke="var(--_line)" stroke-width="${i}" />`,c(a.x-s,a.y,a.x+s,a.y),c(a.x,a.y-s,a.x,a.y+s)].join(`
220
+ `)}let s=n[n.length-1],c=Pu(n[n.length-2],s),l={x:s.x-c.x*Au,y:s.y-c.y*Au},u={x:l.x-c.y*ju,y:l.y+c.x*ju},d={x:l.x+c.y*ju,y:l.y-c.x*ju};return[o,e.f`<polyline points="${u.x},${u.y} ${s.x},${s.y} ${d.x},${d.y}" fill="none" stroke="var(--_line)" stroke-width="${i}" stroke-linejoin="miter" />`].join(`
221
+ `)}function Ru(t,n){let{labelPoint:r,labelWidth:i,labelHeight:a}=t;return e.f`<rect x="${r.x-i/2}" y="${r.y-a/2}" width="${i}" height="${a}" rx="2" ry="2" `+`fill="var(--bg)" stroke="none" />`+e.f`\n${(0,e.renderMultilineText)(t.label,r.x,r.y,n.edgeLabel,e.f`text-anchor="middle" font-size="${n.edgeLabel}" font-weight="${F.edgeLabel}" fill="color-mix(in srgb, var(--fg) 70%, var(--bg))"`)}`}function zu(e){let t=`#ffffff`;if(e.external)switch(e.kind){case`person`:return{fill:`#686868`,stroke:`#8a8a8a`,text:t};case`system`:return{fill:`#999999`,stroke:`#8a8a8a`,text:t};case`container`:return{fill:`#b3b3b3`,stroke:`#a6a6a6`,text:t};case`component`:return{fill:`#cccccc`,stroke:`#bfbfbf`,text:t}}switch(e.kind){case`person`:return{fill:`#08427b`,stroke:`#073b6f`,text:t};case`system`:return{fill:`#1168bd`,stroke:`#3c7fc0`,text:t};case`container`:return{fill:`#438dd5`,stroke:`#3c7fc0`,text:t};case`component`:return{fill:`#85bbf0`,stroke:`#78a8d8`,text:t}}}var Bu=e.C4.messageSize+5;function Vu(e){return e.labelLines??(0,t.c4RelLabelLines)(e)}function Hu(t){let n=t.labelPosition;return n?Vu(t).map((r,i,a)=>({cx:t.technology!==void 0&&i===a.length-1&&t.technologyX!==void 0?t.technologyX:n.x,cy:n.y+i*Bu,w:(0,e.c4TextWidth)(r,e.C4.messageSize,400),h:e.C4.messageSize})):[]}function Uu(){return{next:{cnt:0}}}function Wu(e,t,n,r,i){e.next.startx=e.startx=t,e.next.stopx=e.stopx=n,e.next.starty=e.starty=r,e.next.stopy=e.stopy=i}function Gu(e,t,n,r){let i=e[t];e[t]=i===void 0?n:r(n,i)}function Ku(t,n,r){t.next.cnt+=1;let i=r.shapeMargin,a=t.next.startx===t.next.stopx?t.next.stopx+i:t.next.stopx+i*2,o=a+n.width,s=t.next.starty+i*2,c=s+n.height;(a>=t.widthLimit||o>=t.widthLimit||t.next.cnt>e.C4.shapeInRow)&&(a=t.next.startx+i+r.nextLinePaddingX,s=t.next.stopy+i*2,t.next.stopx=o=a+n.width,t.next.starty=t.next.stopy,t.next.stopy=c=s+n.height,t.next.cnt=1),n.x=a,n.y=s,Gu(t,`startx`,a,Math.min),Gu(t,`starty`,s,Math.min),Gu(t,`stopx`,o,Math.max),Gu(t,`stopy`,c,Math.max),Gu(t.next,`startx`,a,Math.min),Gu(t.next,`starty`,s,Math.min),Gu(t.next,`stopx`,o,Math.max),Gu(t.next,`stopy`,c,Math.max)}function qu(n,r){let i=(t,n)=>r.wrap?(0,e.wrapToWidth)(t,r.textWidth,n):t.split(`
222
+ `),a=i(n.label,e.C4.nameSize),o=n.description?i(n.description,e.C4.descrSize):[],s=Math.max(...a.map(t=>(0,e.c4TextWidth)(t,e.C4.nameSize,700)),(0,e.c4TextWidth)((0,t.c4TypeLine)(n),e.C4.typeSize,400),...o.map(t=>(0,e.c4TextWidth)(t,e.C4.descrSize,400)));return{el:n,nameLines:a,descriptionLines:o,x:0,y:0,...(0,e.c4ShapeSize)(n,a.length,o.length,s,r)}}function Ju(e){let t=new Set,n=new Map(e.elements.map(e=>[e.alias,e])),r=e=>{let i=e.elementAliases.flatMap(e=>{t.add(e);let r=n.get(e);return r?[r]:[]});return{alias:e.alias,boundary:e,elements:i,children:e.children.map(r)}},i=e.boundaries.map(r);return{alias:`global`,elements:e.elements.filter(e=>!t.has(e.alias)),children:i}}function Yu(n,r){let i=new Map,a=[],o=r.diagramMarginX,s=r.diagramMarginY,c=(e,t)=>{for(let n of t){let t=qu(n,r);i.set(n.alias,t),Ku(e,t,r)}e.stopx+=r.shapeMargin,e.stopy+=r.shapeMargin},l=(n,i,u)=>{let d=Uu();d.widthLimit=n.widthLimit/Math.min(e.C4.boundaryInRow,i.length);for(let[f,p]of i.entries()){let i=p.boundary,m=0,h=m+8;m=h+e.C4.boundaryLabelHeight;let g;i&&(0,t.c4BoundaryTypeLine)(i)&&(g=m+5,m=g+e.C4.boundaryTypeHeight);let _;if(i?.description&&(_=m+20,m=_+e.C4.boundaryDescrHeight),i||(m=e.C4.rootHeadingHeight),f===0||f%e.C4.boundaryInRow===0){let e=n.startx+r.diagramMarginX,t=n.stopy+r.diagramMarginY+m;Wu(d,e,e,t,t)}else{let e=d.stopx===d.startx?d.startx:d.stopx+r.diagramMarginX;Wu(d,e,e,d.starty,d.starty)}if(p.elements.length>0&&c(d,p.elements),p.children.length>0&&l(d,p.children,u+1),i){let e=d.stopx-d.startx,t=d.stopy-d.starty;e===0&&(e=r.width,d.stopx=d.startx+e),t===0&&(t=m+r.shapeMargin),a.push({alias:i.alias,label:i.label,...i.type?{type:i.type}:{},...i.description?{description:i.description}:{},x:d.startx,y:d.starty,width:e,height:t,depth:u,labelY:h,...g===void 0?{}:{typeY:g},..._===void 0?{}:{descrY:_}})}n.stopy=Math.max(d.stopy+r.shapeMargin,n.stopy),n.stopx=Math.max(d.stopx+r.shapeMargin,n.stopx),o=Math.max(o,n.stopx),s=Math.max(s,n.stopy)}},u=Uu();return Wu(u,r.diagramMarginX,r.diagramMarginX,r.diagramMarginY,r.diagramMarginY),u.widthLimit=e.C4.screenWidth,l(u,[n],-1),{elements:i,boundaries:a,maxX:o,maxY:s}}function Xu(e,t){let n=e.x+e.width/2,r=e.y+e.height/2,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(i===0&&a===0)return{x:n,y:r};let c,l;if(Math.abs(a)*o>Math.abs(i)*s){let e=a<0?-s:s;c=e*i/a,l=e}else{let e=i<0?-o:o;c=e,l=e*a/i}return{x:n+c,y:r+l}}function Zu(t,n){let r=(0,e.c4PersonGeometry)(t.width,t.height),i=t.x+t.width/2,a=t.y+t.height/2,o=t.width,s=t.height,c=-s/2+r.headRadius,l=-s/2+r.pillTop,u=r.rx,d=(e,t,n,r,i,a)=>Array.from({length:r},(o,s)=>{let c=(i+s*(a-i)/(r-1))*Math.PI/180;return{x:e-n*Math.cos(c),y:t-n*Math.sin(c)}}),f=Math.asin(Math.min(1,(l-c)/r.headRadius))*180/Math.PI,p=[...d(0,c,r.headRadius,24,180+f,-f),...d(-o/2+u,l+u,u,12,90,0),...d(-o/2+u,s/2-u,u,12,360,270),...d(o/2-u,s/2-u,u,12,270,180),...d(o/2-u,l+u,u,12,180,90)];return $u({x:i,y:a},n,p.map(e=>({x:i+e.x,y:a+e.y})))}function Qu(e,t,n,r){let i=t.y-e.y,a=e.x-t.x,o=t.x*e.y-e.x*t.y,s=i*n.x+a*n.y+o,c=i*r.x+a*r.y+o;if(s!==0&&c!==0&&s*c>0)return;let l=r.y-n.y,u=n.x-r.x,d=r.x*n.y-n.x*r.y,f=l*e.x+u*e.y+d,p=l*t.x+u*t.y+d;if(f!==0&&p!==0&&f*p>0)return;let m=i*u-l*a;if(m===0)return;let h=Math.abs(m/2),g=a*d-u*o,_=g<0?(g-h)/m:(g+h)/m;return g=l*o-i*d,{x:_,y:g<0?(g-h)/m:(g+h)/m}}function $u(e,t,n){let r,i=1/0;return n.forEach((a,o)=>{let s=Qu(e,t,a,n[(o+1)%n.length]);if(!s)return;let c=Math.hypot(s.x-t.x,s.y-t.y);c<i&&(r=s,i=c)}),r??e}var ed=1e-6;function td(t,n){let r=Xu(t,n),i=t.x+t.width/2,a=t.y+t.height/2,{rx:o,ry:s}=(0,e.c4CylinderCap)(t.width),c=r.x-i,l=Math.abs(c)<t.width/2-ed||Math.abs(Math.abs(c)-t.width/2)<=ed&&Math.abs(r.y-a)>t.height/2-s;if(o===0||!l)return r;let u=s*s*(1-c*c/(o*o)),d=s-(u>0?Math.sqrt(u):u);return n.y-a>0&&(d=-d),{x:r.x,y:r.y+d}}function nd(t,n){let r=Xu(t,n),i=t.x+t.width/2,a=t.y+t.height/2,{rx:o,ry:s}=(0,e.c4QueueCap)(t.height),c=r.y-a,l=Math.abs(c)<t.height/2-ed||Math.abs(Math.abs(c)-t.height/2)<=ed&&Math.abs(r.x-i)>t.width/2-o;if(s===0||!l)return r;let u=o*o*(1-c*c/(s*s)),d=o-Math.sqrt(Math.abs(u));return n.x-i>0&&(d=-d),{x:r.x+d,y:r.y}}function rd(e,t){let n=e.el;return n?.kind===`person`?Zu(e,t):n?.shape===`db`?td(e,t):n?.shape===`queue`?nd(e,t):Xu(e,t)}var id=e=>({x:e.x+e.width/2,y:e.y+e.height/2});function ad(n,r,i,a){let o=i.get(n.from),s=i.get(n.to),c=rd(o,id(s)),l=rd(s,id(o)),u=l.x-c.x,d=l.y-c.y,f=e=>({x:e.x,y:e.y+a}),p={...n,points:[f(c),f(l)]};if(r>0&&(p.curve=f({x:c.x+u/2-u/4,y:c.y+d/2})),(0,t.c4RelLabelLines)(n).length>0){let r={x:Math.min(c.x,l.x)+Math.abs(u)/2,y:Math.min(c.y,l.y)+Math.abs(d)/2},i=(0,t.c4RelLabelLines)(n)[0],a=n.label!==``||n.index!==void 0?(0,e.c4TextWidth)(i??``,e.C4.messageSize,400):0;if(p.labelPosition=f({x:r.x+a/2,y:r.y}),n.technology){let t=(0,e.c4TextWidth)(`[${n.technology}]`,e.C4.messageSize,400);p.technologyX=r.x+Math.max(a,t)/2}}return p}var od=2,sd=6,cd=2,ld=[0,14,-14,28,-28],ud=[.75,.55,.4],dd=1e3,fd=100,pd=10,md=2,hd=5,gd=4,_d=e=>({x0:e.cx-e.w/2,x1:e.cx+e.w/2,y0:e.cy-e.h/2,y1:e.cy+e.h/2}),vd=(e,t)=>e.x0<t.x1+od&&e.x1>t.x0-od&&e.y0<t.y1+od&&e.y1>t.y0-od;function yd(e){let t=e.points[0],n=e.points[e.points.length-1],r=e.curve,i=Math.hypot(n.x-t.x,n.y-t.y),a=Math.max(1,Math.ceil(i/gd));return Array.from({length:a+1},(e,i)=>{let o=i/a;if(!r)return{x:t.x+(n.x-t.x)*o,y:t.y+(n.y-t.y)*o};let s=1-o;return{x:s*s*t.x+2*s*o*r.x+o*o*n.x,y:s*s*t.y+2*s*o*r.y+o*o*n.y}})}function bd(n){return n.flatMap(n=>{let r=(e,t,n,r,i)=>({x0:e-i,x1:t+i,y0:n-i,y1:r+i,weight:fd}),i=(t,i,a,o)=>{let s=(0,e.c4TextWidth)(t,a,o),c=n.x+n.width/2;return r(c-s/2,c+s/2,n.y+i-a/2,n.y+i+a/2,hd)},a=(0,t.c4BoundaryTypeLine)({...n,elementAliases:[],children:[]});return[r(n.x,n.x+n.width,n.y,n.y,md),r(n.x,n.x+n.width,n.y+n.height,n.y+n.height,md),r(n.x,n.x,n.y,n.y+n.height,md),r(n.x+n.width,n.x+n.width,n.y,n.y+n.height,md),i(n.label,n.labelY,e.C4.boundarySize+2,700),...a?[i(a,n.typeY,e.C4.boundarySize,400)]:[],...n.description?[i(n.description,n.descrY,e.C4.boundarySize-2,400)]:[]]})}function xd(e,t){return Hu({...e,labelLines:t.lines,labelPosition:t.position,...t.technologyX===void 0?{}:{technologyX:t.technologyX}}).map(_d)}function Sd(n,r,i,a,o){let s=n.points[0],c=n.points[n.points.length-1],l=n.labelPosition;if(!l||!s||!c)return;let u=c.x-s.x,d=c.y-s.y,f=Math.hypot(u,d),p=(0,t.c4RelLabelLines)(n),m=n.label!==``||n.index!==void 0,h=m?(0,e.c4TextWidth)(p[0],e.C4.messageSize,400):0,g=l.x-h/2,_=[{variant:{lines:p,position:l,...n.technologyX===void 0?{}:{technologyX:n.technologyX}},cost:0}];if(m&&o){let t=n.technology?[`[${n.technology}]`]:[],r=new Set([p.join(`
223
+ `)]);ud.forEach((n,i)=>{let a=(0,e.wrapToWidth)(p[0],h*n,e.C4.messageSize),o=[...a,...t].join(`
224
+ `);if(r.has(o))return;r.add(o);let s=Math.max(...a.map(t=>(0,e.c4TextWidth)(t,e.C4.messageSize,400)));_.push({variant:{lines:[...a,...t],position:{x:g+s/2,y:l.y}},cost:25*(i+1)})})}let v=f===0?0:u/f,y=f===0?0:d/f,b=f/2+Math.max(...ld)+od,x=_.flatMap(e=>xd(n,e.variant)),S={x0:Math.min(...x.map(e=>e.x0))-b,x1:Math.max(...x.map(e=>e.x1))+b,y0:Math.min(...x.map(e=>e.y0))-b,y1:Math.max(...x.map(e=>e.y1))+b},C=e=>e.x0<S.x1&&e.x1>S.x0&&e.y0<S.y1&&e.y1>S.y0,w=[...r,...a].filter(C),T=Math.max(cd,f/200),E=i.filter(e=>C({x0:Math.min(...e.map(e=>e.x)),x1:Math.max(...e.map(e=>e.x)),y0:Math.min(...e.map(e=>e.y)),y1:Math.max(...e.map(e=>e.y))})),D=E.map(e=>({x0:Math.min(...e.map(e=>e.x)),x1:Math.max(...e.map(e=>e.x)),y0:Math.min(...e.map(e=>e.y)),y1:Math.max(...e.map(e=>e.y))})),O,k=e=>O?.penalty===0&&e>=O.cost;for(let{variant:e,cost:t}of _){let r=xd(n,e);for(let n of ld)if(!k(t+2*Math.abs(n)))for(let i=0;i<=f/2&&!k(t+2*Math.abs(n)+i);i+=T)for(let a of i===0?[1]:[1,-1]){let o=a*i,s={x:o*v-n*y,y:o*y+n*v},c=r.map(e=>({x0:e.x0+s.x,x1:e.x1+s.x,y0:e.y0+s.y,y1:e.y1+s.y})),l=0,u=O?.penalty??1/0;for(let e of c){if(l>u)break;for(let t of w)if(vd(e,t)&&(l+=t.weight),l>u)break;if(l>u)break;for(let[t,n]of E.entries()){let r=D[t];r.x1<=e.x0||r.x0>=e.x1||r.y1<=e.y0||r.y0>=e.y1||n.some(t=>t.x>e.x0&&t.x<e.x1&&t.y>e.y0&&t.y<e.y1)&&(l+=pd)}}let d=t+i+2*Math.abs(n);(!O||l<O.penalty||l===O.penalty&&d<O.cost)&&(O={v:e,at:s,penalty:l,cost:d})}}let{v:A,at:j}=O;n.labelPosition={x:A.position.x+j.x,y:A.position.y+j.y},A.lines!==p&&(n.labelLines=A.lines),A.technologyX===void 0?delete n.technologyX:n.technologyX=A.technologyX+j.x,a.push(...Hu(n).map(e=>({..._d(e),weight:fd})))}function Cd(t,n={}){let r=(0,e.c4Config)(t.layout);if(t.elements.length===0&&t.boundaries.length===0){let n={variant:t.variant,width:0,height:0,elements:[],boundaries:[],relationships:[]};if(t.title){let i=2*r.diagramMarginY+e.C4.titleExtra;n.title=t.title,n.width=Math.ceil(2*r.diagramMarginX+(0,e.c4TextWidth)(t.title,16,400)),n.height=i,n.titlePosition={x:r.diagramMarginX,y:i/2}}return n}let i=Yu(Ju(t),r),a=t.title?e.C4.titleExtra:0,o=r.diagramMarginY+a,s=t.elements.flatMap(e=>{let t=i.elements.get(e.alias);return t?[{...e,x:t.x,y:t.y+o,width:t.width,height:t.height,nameLines:t.nameLines,descriptionLines:t.descriptionLines}]:[]}),c=[...i.boundaries].sort((e,t)=>e.depth-t.depth).map(e=>({...e,y:e.y+o})),l=new Map;for(let e of i.elements.values())l.set(e.el.alias,e);for(let e of i.boundaries)l.set(e.alias,e);let u=t.relationships.map((e,t)=>ad(e,t,l,o)),d=[...s.map(e=>({x0:e.x-sd,x1:e.x+e.width+sd,y0:e.y-sd,y1:e.y+e.height+sd,weight:dd})),...bd(c)],f=u.map(yd),p=[];u.forEach((e,t)=>Sd(e,d,f.filter((e,n)=>n!==t),p,r.wrap));let m=i.maxX+r.diagramMarginX,h=i.maxY+r.diagramMarginY+a,g={variant:t.variant,width:m,height:h,elements:s,boundaries:c,relationships:u,...t.layout&&{layout:t.layout}};return t.title&&(g.title=t.title,g.titlePosition={x:(i.maxX-r.diagramMarginX)/2-4*r.diagramMarginX,y:r.diagramMarginY+r.diagramMarginY+o}),g}function wd(t,n,r=`Inter`,i=!1,a=N,o,s,c,l={}){let u=[];u.push(z((0,e.svgOpenTag)(t.width,t.height,n,i,s??t.title,c,void 0,l.styleAttribute,l.description),o)),u.push((0,e.buildStyleBlock)(r,!1,l.nonce,l.bodyFont)),t.title&&t.titlePosition&&u.push(e.f`<text class="c4-title" x="${t.titlePosition.x}" y="${t.titlePosition.y}" dy="${L}" `+e.f`font-size="16" fill="var(--_text)">${(0,e.escapeXml)(t.title)}</text>`);for(let e of t.boundaries)u.push(Ed(e));for(let n of t.elements)u.push(Dd(n,t.layout?.shapePadding??e.C4.shapePadding));for(let e of t.relationships)u.push(Fd(e));for(let e of t.relationships)u.push(Id(e));return u.push(`</svg>`),u.filter(Boolean).join(`
225
+ `)}function Td(t,n,r,i,a){return e.f` <text x="${n}" y="${r}" text-anchor="middle" dy="${L}" font-size="${i}" `+e.f`${a}>${(0,e.escapeXml)(t)}</text>`}function Ed(n){let r=[];r.push(e.f`<g class="c4-boundary" data-id="${(0,e.escapeAttr)(n.alias)}" data-label="${(0,e.escapeAttr)(n.label)}" data-depth="${n.depth}">`),r.push(e.f` <rect x="${n.x}" y="${n.y}" width="${n.width}" height="${n.height}" rx="2.5" ry="2.5" `+`fill="none" stroke="var(--_text)" stroke-width="1" stroke-dasharray="7,7" />`);let i=n.x+n.width/2;r.push(Td(n.label,i,n.y+(n.labelY??8),e.C4.boundarySize+2,`font-weight="700" fill="var(--_text)"`));let a=(0,t.c4BoundaryTypeLine)({alias:n.alias,label:n.label,...n.type?{type:n.type}:{},elementAliases:[],children:[]});return a&&n.typeY!==void 0&&r.push(Td(a,i,n.y+n.typeY,e.C4.boundarySize,`fill="var(--_text)"`)),n.description&&n.descrY!==void 0&&r.push(Td(n.description,i,n.y+n.descrY,e.C4.boundarySize-2,`fill="var(--_text)"`)),r.push(`</g>`),r.join(`
226
+ `)}function Dd(n,r){let i=zu(n),{x:a,y:o,width:s,height:c}=n,l=a+s/2,u=(0,e.c4TextBlockHeight)(n.nameLines.length,n.descriptionLines.length),d=[];d.push(e.f`<g class="c4-element" data-id="${(0,e.escapeAttr)(n.alias)}" data-kind="${n.kind}" data-shape="${n.shape}" `+e.f`data-external="${n.external}" data-label="${(0,e.escapeAttr)(n.label)}">`);let f,p=l;if(n.kind===`person`)d.push(...kd(n,i)),f=o+(0,e.c4PersonGeometry)(s).pillTop+r;else if(n.shape===`db`){d.push(...Ad(n,i));let{ry:t}=(0,e.c4CylinderCap)(s);f=o+(2*t+c)/2-u/2}else if(n.shape===`queue`){d.push(...jd(n,i));let{rx:t}=(0,e.c4QueueCap)(c);p=l-t,f=o+c/2-u/2}else d.push(e.f` <rect x="${a}" y="${o}" width="${s}" height="${c}" rx="${e.C4.cornerRadius}" ry="${e.C4.cornerRadius}" `+e.f`fill="${i.fill}" stroke="${i.stroke}" stroke-width="${e.C4.strokeWidth}" />`),f=o+r;let m=f;for(let t of n.nameLines)d.push(Td(t,p,m+e.C4.nameLine/2,e.C4.nameSize,e.f`font-weight="700" fill="${i.text}"`)),m+=e.C4.nameLine;return d.push(Td((0,t.c4TypeLine)(n),p,m+e.C4.typeLine/2,e.C4.typeSize,e.f`fill="${i.text}"`)),m+=e.C4.typeLine,n.descriptionLines.forEach((t,n)=>{d.push(Td(t,p,m+e.C4.descrLine/2+n*e.C4.descrExtraLine,e.C4.descrSize,e.f`fill="${i.text}"`))}),m+=(0,e.c4DescriptionHeight)(n.descriptionLines.length),d.push(`</g>`),d.join(`
227
+ `)}function Od(t){let{x:n,y:r,width:i,height:a}=t,{rx:o,headRadius:s,pillTop:c}=(0,e.c4PersonGeometry)(i,a),l=n+i/2,u=r+c,d=r+a,f=Math.sqrt(Math.max(0,s*s-(u-(r+s))**2));return e.f`M ${n+o} ${u} H ${l-f} A ${s} ${s} 0 1 1 ${l+f} ${u} `+e.f`H ${n+i-o} A ${o} ${o} 0 0 1 ${n+i} ${u+o} V ${d-o} `+e.f`A ${o} ${o} 0 0 1 ${n+i-o} ${d} H ${n+o} `+e.f`A ${o} ${o} 0 0 1 ${n} ${d-o} V ${u+o} `+e.f`A ${o} ${o} 0 0 1 ${n+o} ${u} Z`}function kd(t,n){return[e.f` <path class="c4-person-shape" d="${Od(t)}" fill="${n.fill}" stroke="${n.stroke}" stroke-width="${e.C4.strokeWidth}" />`]}function Ad(t,n){let{x:r,y:i,width:a,height:o}=t,{rx:s,ry:c}=(0,e.c4CylinderCap)(a),l=e.f`fill="${n.fill}" stroke="${n.stroke}" stroke-width="${e.C4.strokeWidth}"`;return[e.f` <path d="M ${r} ${i+c} L ${r} ${i+o-c} A ${s} ${c} 0 0 0 ${r+a} ${i+o-c} L ${r+a} ${i+c} Z" ${l} />`,e.f` <ellipse cx="${r+s}" cy="${i+c}" rx="${s}" ry="${c}" ${l} />`]}function jd(t,n){let{x:r,y:i,width:a,height:o}=t,{rx:s,ry:c}=(0,e.c4QueueCap)(o),l=e.f`fill="${n.fill}" stroke="${n.stroke}" stroke-width="${e.C4.strokeWidth}"`;return[e.f` <path d="M ${r+a-s} ${i} H ${r+s} A ${s} ${c} 0 0 0 ${r+s} ${i+o} H ${r+a-s} Z" ${l} />`,e.f` <ellipse cx="${r+a-s}" cy="${i+c}" rx="${s}" ry="${c}" ${l} />`]}function Md(t,n){let r=t.x-n.x,i=t.y-n.y,a=Math.hypot(r,i);if(a===0)return``;let o=r/a,s=i/a,c=t.x-o*10,l=t.y-s*10;return e.f`<polygon class="c4-arrowhead" points="${t.x},${t.y} ${c-s*5},${l+o*5} ${c+s*5},${l-o*5}" `+`fill="var(--_text)" />`}var Nd=3,Pd=1;function Fd(t){let[n,r]=[t.points[0],t.points[t.points.length-1]];if(!n||!r||n===r)return``;let i=[`class="c4-relationship"`,e.f`data-from="${(0,e.escapeAttr)(t.from)}"`,e.f`data-to="${(0,e.escapeAttr)(t.to)}"`];t.label&&i.push(e.f`data-label="${(0,e.escapeAttr)(t.label)}"`),t.technology&&i.push(e.f`data-technology="${(0,e.escapeAttr)(t.technology)}"`);let a=t.curve?e.f`M ${n.x},${n.y} Q ${t.curve.x},${t.curve.y} ${r.x},${r.y}`:e.f`M ${n.x},${n.y} L ${r.x},${r.y}`,o=e.f`<path ${i.join(` `)} d="${a}" fill="none" stroke="var(--_text)" stroke-width="1" />`,s=t.curve??n,c=t.curve??r,l=Md(r,s),u=Md(n,c);return[o,...t.bidirectional?[l,u]:[t.reversed?u:l]].filter(Boolean).join(`
228
+ `)}function Id(t){let n=Vu(t),r=Hu(t);if(r.length===0)return``;let i=[e.f`<g class="c4-relationship-label" data-from="${(0,e.escapeAttr)(t.from)}" data-to="${(0,e.escapeAttr)(t.to)}">`],a=Math.min(...r.map(e=>e.cx-e.w/2))-Nd,o=Math.max(...r.map(e=>e.cx+e.w/2))+Nd,s=r[0].cy-r[0].h/2-Pd,c=r[r.length-1],l=c.cy+c.h/2+Pd;return i.push(e.f` <rect class="c4-label-plate" x="${a}" y="${s}" width="${o-a}" height="${l-s}" rx="2" ry="2" fill="var(--bg)" />`),n.forEach((a,o)=>{let s=t.technology!==void 0&&o===n.length-1,c=r[o];i.push(Td(a,c.cx,c.cy,e.C4.messageSize,s?`font-style="italic" fill="var(--_text)"`:`fill="var(--_text)"`))}),i.push(`</g>`),i.join(`
229
+ `)}var Ld={titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,defaultWidth:1200},Rd={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:26298e5};function zd(e,n={}){let r={...Ld,...e.sizes},i=r.barHeight+r.barGap,a=n.width??r.defaultWidth,o=e.tasks,s=o.filter(e=>!e.vert),c=[];for(let e of s)c.includes(e.section)||c.push(e.section);let l=e=>{let t=c.indexOf(e);return(t<0?0:t)%r.numberSectionStyles},u=new Map,d=new Map,f=2*r.topPadding;if(e.displayMode===`compact`){let e=0;for(let n of c){let r=s.filter(e=>e.section===n),a=(0,t.packGanttSection)(r,e,u)+1;e+=a,f+=a*i,d.set(n,a)}}else{for(let e of s)u.set(e,e.order);f+=s.length*i;for(let e of c)d.set(e,s.filter(t=>t.section===e).length)}let p=(f-2*r.topPadding)/i,m=e=>e.vert?-1:u.get(e)??e.order,h=a-r.leftPadding-r.rightPadding,g=o.length?Math.min(...o.map(e=>e.start)):0,_=o.length?Math.max(...o.map(e=>e.end)):0,v=e=>Math.round(_===g?h/2:(e-g)/(_-g)*h),y=[...o].sort((e,t)=>e.start>t.start?1:e.start<t.start?-1:0).sort((e,t)=>e.vert===t.vert?0:e.vert?1:-1).map(e=>{let t=m(e),n=v(e.start),o=v(e.end),s=v(e.renderEnd??e.end),c=n+r.leftPadding,u=s-n,d=t*i+r.topPadding,f=r.barHeight;e.milestone?(c=n+r.leftPadding+.5*(o-n)-.5*r.barHeight,u=r.barHeight):e.vert&&(u=.08*r.barHeight),e.vert&&(d=r.gridLineStartPadding,f=p*i+r.barHeight*2);let h=n+r.leftPadding+.5*(o-n),g=t*i+r.topPadding+.5*r.barHeight,_=k(e.label,r.fontSize,400),y=n,b=s;e.milestone&&(y+=.5*(o-n)-.5*r.barHeight,b=y+r.barHeight);let x,S=`middle`,C=null,w=o;e.milestone&&(w=n+r.barHeight);let T=_>(e.vert?0:b-y),E=_>w-n;x=e.vert?n+r.leftPadding:T?b+_+1.5*r.leftPadding>a?y+r.leftPadding-5:b+r.leftPadding+5:(b-y)/2+y+r.leftPadding,E&&(w+_+1.5*r.leftPadding>a?(C=`left`,S=`end`):(C=`right`,S=`start`));let D=e.vert?r.gridLineStartPadding+p*i+60:t*i+r.barHeight/2+(r.fontSize/2-2)+r.topPadding;return{id:e.id,x:c,y:d,width:u,height:f,originX:h,originY:g,sectionStyle:l(e.section),task:e,text:{text:e.label,x,y:D,anchor:S,outside:C}}}),b=new Set,x=[];for(let e of y){if(e.task.vert)continue;let t=m(e.task);b.has(t)||(b.add(t),x.push({y:t*i+r.topPadding-2,width:a-r.rightPadding/2,height:i,sectionStyle:e.sectionStyle}))}let S=[];if((e.excludes.length>0||e.includes.length>0)&&o.length){let n=864e5;if(_-g<=1830*n){let r=n=>(0,t.isExcludedDate)(e,n),i=null;for(let e=g;e<=_;e+=n)r(e)?i?i.end=e:i={start:e,end:e}:i&&=(S.push(C(i)),null)}}function C(e){let n=864e5,i=e=>Math.floor(e/n)*n,a=v(i(e.start)),o=v(i(e.end)+n-1);return{id:(0,t.formatD3Time)(e.start,`%Y-%m-%d`),x:a+r.leftPadding,y:r.gridLineStartPadding,width:o-a,height:f-r.topPadding-r.gridLineStartPadding}}let w=e.axisFormat||(e.dateFormat===`D`?`%d`:`%Y-%m-%d`),T=e.tickInterval;T&&o.length&&Math.ceil((_-g)/(T.every*Rd[T.unit]))>1e4&&(T=void 0);let E=-f+r.topPadding+r.gridLineStartPadding,D=n=>({x:r.leftPadding,y:n===`bottom`?f-50:r.topPadding,position:n,tickSize:E,rangeEnd:h,ticks:o.length?(0,t.timeTicks)(g,_,T,e.weekday).map(e=>({x:v(e)+.5,label:(0,t.formatD3Time)(e,w)})):[]}),O=[D(`bottom`)];e.topAxis&&O.push(D(`top`));let A=[],j=0;for(let e of c){let t=d.get(e);A.push({lines:e.split(/<br\s*\/?>|\n/i),y:t*i/2+j*i+r.topPadding,sectionStyle:l(e)}),j+=t}let M={fontSize:r.fontSize,sectionFontSize:r.sectionFontSize,width:a,height:f,excludeRanges:S,axes:O,rows:x,tasks:y,sectionLabels:A};if(e.title&&(M.title={text:e.title,x:a/2,y:r.titleTopMargin}),e.todayMarker!==`off`&&o.length){let t=n.now??Date.now(),i=v(t);t>=g&&t<=_&&(M.today={x:i+r.leftPadding,y1:r.titleTopMargin,y2:f-r.titleTopMargin,style:e.todayMarker.replace(/,/g,`;`)})}return M}function $(e){return String(Math.round(e*100)/100)}function Bd(e){return e.split(`;`).map(e=>e.split(`:`).map(e=>e.trim())).filter(([e,t])=>e!==void 0&&t!==void 0&&/^(?:stroke(?:-width|-dasharray|-opacity|-linecap)?|opacity)$/.test(e)&&/^[\w#.%() -]+$/.test(t)).map(([e,t])=>`${e}: ${t};`).join(` `)}function Vd(n,r){let i=`var(--accent, ${t.CHART_ACCENT_FALLBACK})`,a=(e,t,n=`var(--bg)`)=>`color-mix(in srgb, ${e} ${t}%, ${n})`,o=a(i,75,`var(--fg)`),s=(e,t)=>` ${[0,1,2,3].map(t=>`.${e}${t}`).join(`,`)} { ${t} }`,c=[`doneText`,`doneCritText`].flatMap(e=>[0,1,2,3].flatMap(t=>[`.${e}${t}.taskTextOutsideLeft`,`.${e}${t}.taskTextOutsideRight`])).join(`,`);return`${(0,e.styleOpenTag)(r)}
227
230
  .exclude-range { fill: ${a(`var(--fg)`,8)}; }
228
231
  .section { stroke: none; opacity: 0.2; }
229
232
  .section0 { fill: ${i}; }
@@ -258,7 +261,7 @@ ${s(`doneCritText`,`fill: var(--fg) !important;`)}
258
261
  .vertText { font-size: 15px; text-anchor: middle; fill: ${a(i,60,`var(--fg)`)} !important; }
259
262
  ${s(`activeCritText`,`fill: var(--fg) !important;`)}
260
263
  .titleText { text-anchor: middle; font-size: 18px; fill: var(--_text); }
261
- </style>`}function id(e,t){let n=``;return e.active?n=e.crit?` activeCrit`:` active`:e.done?n=e.crit?` doneCrit`:` done`:e.crit&&(n=` crit`),n.length===0&&(n=` task`),e.milestone&&(n=` milestone ${n}`),e.vert&&(n=` vert ${n}`),`task${n}${t} ${e.classes.join(` `)}`.trimEnd()}function ad(e){let t=e.task,n=e.sectionStyle,r=``;t.active&&(r=t.crit?`activeCritText${n}`:`activeText${n}`),t.done?r+=t.crit?` doneCritText${n}`:` doneText${n}`:t.crit&&(r+=` critText${n}`),t.milestone&&(r+=` milestoneText`),t.vert&&(r+=` vertText`);let i=e.text.outside===`left`?`taskTextOutsideLeft taskTextOutside${n}`:e.text.outside===`right`?`taskTextOutsideRight taskTextOutside${n}`:`taskText taskText${n}`;return[t.classes.join(` `),i,r].join(` `).replace(/\s+/g,` `).trim()}function od(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[];l.push(R((0,e.svgOpenTag)(t.width,t.height,n,i,o,s,void 0,c.styleAttribute,c.description),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(rd(t.today?nd(t.today.style):``,c.nonce)),l.push(`<g class="exclude-ranges">`);for(let e of t.excludeRanges)l.push(`<rect data-date="${e.id}" x="${$(e.x)}" y="${$(e.y)}" width="${$(e.width)}" height="${$(e.height)}" class="exclude-range"/>`);l.push(`</g>`);for(let n of t.axes){let t=n.position===`bottom`?1:-1;l.push(`<g class="grid" transform="translate(${n.x}, ${n.y})" fill="none" font-size="10" text-anchor="middle">`,`<path class="domain" stroke="currentColor" d="M0.5,${t*n.tickSize}V0.5H${n.rangeEnd+.5}V${t*n.tickSize}"/>`);for(let r of n.ticks)l.push(`<g class="tick" opacity="1" transform="translate(${$(r.x)},0)"><line stroke="currentColor" y2="${t*n.tickSize}"/><text fill="currentColor" y="${t*3}" dy="${t===1?`1em`:`0em`}" font-size="10" text-anchor="middle">${(0,e.escapeXml)(r.label)}</text></g>`);l.push(`</g>`)}l.push(`<g class="rows">`);for(let e of t.rows)l.push(`<rect x="0" y="${$(e.y)}" width="${$(e.width)}" height="${e.height}" class="section section${e.sectionStyle}"/>`);l.push(`</g>`),l.push(`<g class="tasks">`);for(let n of t.tasks)l.push(`<rect data-task="${(0,e.escapeXml)(n.id)}" rx="3" ry="3" x="${$(n.x)}" y="${$(n.y)}" width="${$(n.width)}" height="${$(n.height)}" transform-origin="${$(n.originX)}px ${$(n.originY)}px" class="${(0,e.escapeXml)(id(n.task,n.sectionStyle))}"/>`);for(let n of t.tasks)l.push(`<text data-task="${(0,e.escapeXml)(n.id)}" font-size="${Q.fontSize}" x="${$(n.text.x)}" y="${$(n.text.y)}" class="${(0,e.escapeXml)(ad(n))}">${(0,e.escapeXml)(n.text.text)}</text>`);l.push(`</g>`),l.push(`<g class="section-titles">`);for(let n of t.sectionLabels){let t=-(n.lines.length-1)/2,r=n.lines.map((t,n)=>`<tspan alignment-baseline="central" x="10"${n>0?` dy="1em"`:``}>${(0,e.escapeXml)(t)}</tspan>`).join(``);n.lines.every(e=>e===``)||l.push(`<text dy="${t}em" x="10" y="${$(n.y)}" font-size="${Q.sectionFontSize}" class="sectionTitle sectionTitle${n.sectionStyle}">${r}</text>`)}if(l.push(`</g>`),t.today){let e=t.today,n=nd(e.style)?` today-custom`:``;l.push(`<g class="today"><line x1="${$(e.x)}" x2="${$(e.x)}" y1="${e.y1}" y2="${$(e.y2)}" class="today${n}"/></g>`)}return t.title&&l.push(`<text x="${$(t.title.x)}" y="${t.title.y}" class="titleText">${(0,e.escapeXml)(t.title.text)}</text>`),l.push(`</svg>`),l.join(`
262
- `)}var sd=40,cd=16,ld=1.5,ud=`3`;function dd(e){let t=e?.padding??sd,n=e?.iconSize??80,r=e?.fontSize??cd,i=t+2.5,a=t+1.5,o=e?.idealEdgeLengthMultiplier??ld;return{pad:t,tile:n,fontSize:r,groupPad:i,nestedPad:a,pitch:e=>{if(e===0)return n*(1+o);let t=(e===1?77.5:76.5)+.552*(n-80),r=i*Math.min(e,2)+a*Math.max(0,e-2);return Math.max(n+t+r,o*n)},labelDrop:r+1,labelReach:r+8.5,labelWrap:n*1.5}}var fd=(t,n)=>(0,e.measureTextWidth)(t,M.nodeLabel*(n/cd),P.nodeLabel);function pd(e,t){let n=[];for(let r of e.split(`
263
- `)){let e=``;for(let i of r.split(/\s+/).filter(Boolean)){let r=e?`${e} ${i}`:i;e&&fd(r,t.fontSize)>t.labelWrap?(n.push(e),e=i):e=r}n.push(e)}return n}var md=(e,t)=>{if(!e)return t;let n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x+e.width,t.x+t.width)-n,height:Math.max(e.y+e.height,t.y+t.height)-r}};function hd(e,t){let n=new Map([...t.keys()].map(e=>[e,e])),r=e=>{let t=e;for(;n.get(t)!==t;)t=n.get(t);return t};for(let t of e.edges)n.has(t.source)&&n.has(t.target)&&n.set(r(t.source),r(t.target));let i=new Map;for(let e of t.keys()){let t=r(e);i.set(t,[...i.get(t)??[],e])}let a=0;for(let e of i.values()){let n=Math.min(...e.map(e=>t.get(e)[0])),r=Math.max(...e.map(e=>t.get(e)[0]));for(let r of e)t.get(r)[0]+=a-n;a+=r-n+1}}function gd(e,t){for(let n of e){if(n.nodeIds.includes(t))return[n.id];let e=gd(n.children,t);if(e.length>0)return[...e,n.id]}return[]}function _d(e,t,n,r){let i=[0];for(let a=t;a<n;a++){let t=0;for(let[n,r]of e.values())(n<=a!=n<=a+1||r>=a!=r>=a+1)&&t++;i.push(i[i.length-1]+r.pitch(t))}return i}function vd(e,t,n){let r=dd(n),i=t??n?.padding??ae.padding,a=e.direction===`LR`||e.direction===`RL`,o=new Map;for(let[t,n]of e.nodes){let e=n.gridLayer??0,r=n.gridOrder??0;o.set(t,a?[e,r]:[r,e])}hd(e,o);let s=new Map,c=new Map;for(let[t,[n,r]]of o)for(let i of gd(e.subgraphs,t)){let e=s.get(i)??[n,n],t=c.get(i)??[r,r];s.set(i,[Math.min(e[0],n),Math.max(e[1],n)]),c.set(i,[Math.min(t[0],r),Math.max(t[1],r)])}let l=[...o.values()].map(e=>e[0]),u=[...o.values()].map(e=>e[1]),d=Math.min(...l),f=Math.min(...u),p=_d(s,d,Math.max(...l),r),m=_d(c,f,Math.max(...u),r),h=[],g=new Map,_=new Map;for(let[t,n]of e.nodes){let[i,a]=o.get(t),s=n.shape===`junction`?2:r.tile,c=p[i-d]-s/2,l=m[a-f]-s/2,u={x:c,y:l,width:s,height:s};_.set(t,u);let v=n.icon===void 0?[]:pd(n.label,r),y=Math.max(0,...v.map(e=>fd(e,r.fontSize))),b=Math.max(0,(y-s)/2);g.set(t,n.shape===`junction`?{x:c+s/2-r.tile/2,y:l+s/2-r.tile/2,width:r.tile,height:r.tile}:{x:c-b,y:l,width:s+b*2,height:s+r.labelDrop}),h.push({id:t,label:n.icon===void 0?n.label:v.join(`
264
- `),shape:n.icon===void 0?n.shape:`rectangle`,icon:n.icon,...u,className:e.classAssignments.get(t),interaction:e.interactions.get(t)})}let v=e=>{let t=e.children.map(v),n=(e,t)=>({x:e.x-t,y:e.y-t,width:e.width+t*2,height:e.height+t*2}),i;for(let t of e.nodeIds)i=md(i,g.get(t));let a;for(let e of t)a=md(a,e);let o=[...i?[n(i,r.groupPad)]:[],...a?[n(a,r.nestedPad)]:[]].reduce((e,t)=>md(e,t),void 0)??{x:-r.groupPad,y:-r.groupPad,width:r.groupPad*2,height:r.groupPad*2};return _.set(e.id,o),{id:e.id,label:e.label,...o,children:t,...e.icon===void 0?{}:{icon:e.icon},...e.architecture?{architecture:!0,iconSize:r.pad*.75}:{}}},y=e.subgraphs.map(v),b=e.edges.map(e=>{let t=_.get(e.source),n=_.get(e.target);return{source:e.source,target:e.target,label:e.label,style:e.style,hasArrowStart:e.hasArrowStart,hasArrowEnd:e.hasArrowEnd,points:bd(t,n),inlineStyle:{"stroke-width":ud}}}),x=1/0,S=1/0,C=-1/0,w=-1/0;for(let e of g.values())x=Math.min(x,e.x),S=Math.min(S,e.y),C=Math.max(C,e.x+e.width),w=Math.max(w,e.y+e.height);for(let e of h)e.icon!==void 0&&(w=Math.max(w,e.y+e.height+r.labelReach));for(let e of _.values())x=Math.min(x,e.x),S=Math.min(S,e.y),C=Math.max(C,e.x+e.width),w=Math.max(w,e.y+e.height);let T=i-x,E=i-S,D=e=>{e.x+=T,e.y+=E,e.children.forEach(D)};for(let e of h)e.x+=T,e.y+=E;y.forEach(D);for(let e of b)e.points=e.points.map(e=>({x:e.x+T,y:e.y+E}));return{width:C-x+i*2,height:w-S+i*2,nodes:h,edges:b,groups:y}}var yd=(e,t,n,r)=>{let i=Math.max(e,n),a=Math.min(t,r);return i<a||i===a&&e===t?(i+a)/2:void 0};function bd(e,t){let n=yd(e.y,e.y+e.height,t.y,t.y+t.height);if(n!==void 0){let[r,i]=e.x<=t.x?[e,t]:[t,e],a=[{x:r.x+r.width,y:n},{x:i.x,y:n}];return r===e?a:a.reverse()}let r=yd(e.x,e.x+e.width,t.x,t.x+t.width);if(r!==void 0){let[n,i]=e.y<=t.y?[e,t]:[t,e],a=[{x:r,y:n.y+n.height},{x:r,y:i.y}];return n===e?a:a.reverse()}let i=e.y+e.height/2,a=t.x+t.width/2;return[{x:t.x>e.x?e.x+e.width:e.x,y:i},{x:a,y:i},{x:a,y:t.y>e.y?t.y:t.y+t.height}]}var xd={type:`xychart`,parse:(n,r)=>(0,t.parseXYChart)(n,(0,e.extractInitConfig)(r.split(/\r\n?|\n/)).xyChart),layoutForSvg:Xa,renderSvg(e,t,n){let r=n.interactivity===void 0?n.interactive??!1:n.interactivity===`full`;return lo(e,t.colors,t.font,t.transparent,r,t.embedSource,t.title,t.decorative,t.emit)}},Sd={type:`sequence`,parse:t.parseSequenceDiagram,layoutForSvg:Ca,renderSvg(e,t){return wa(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}};function Cd(e){return(e.interactivity??`static`)!==`none`}function wd(e){return(e.interactivity??`static`)===`full`}var Td={type:`class`,parse(n,r){let i=(0,e.extractInitConfig)(r.split(/\r\n?|\n/)).classLayout;return{...(0,t.parseClassDiagram)(n),...i&&{layout:i}}},layoutForSvg:ti,renderSvg(e,t,n){return si(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,Cd(n),t.emit)}},Ed={type:`er`,parse(n,r){let i=(0,e.extractInitConfig)(r.split(/\r\n?|\n/)).erLayout;return{...(0,t.parseErDiagram)(n),...i&&{layout:i}}},layoutForSvg(t,n){return Li((0,e.withDirectionOverride)(t,n.direction),n)},renderSvg(e,t){return Bi(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}},Dd={type:`flowchart`,parse:(e,n)=>(0,t.parseMermaid)(n),layoutForSvg(t,n){return{graph:Qt((0,e.withDirectionOverride)(t,n.direction),n),curve:n.curve??`linear`}},renderSvg(e,t,n){return un(e.graph,t.colors,t.font,t.transparent,t.fontSizes,e.curve,t.embedSource,wd(n),Cd(n),t.title,t.decorative,t.emit)}},Od={xychart:xd,er:Ed,sequence:Sd,class:Td,flowchart:Dd,architecture:{type:`architecture`,parse(n,r){let i=(0,e.extractInitConfig)(r.split(/\r\n?|\n/)).architectureLayout;return{...(0,t.parseArchitecture)(n),...i&&{layout:i}}},layoutForSvg(e,n){return{graph:vd((0,t.architectureToGraph)(e),n.padding,e.layout),curve:`linear`}},renderSvg:Dd.renderSvg},c4:{type:`c4`,parse(n,r){let i=(0,e.extractInitConfig)(r.split(/\r\n?|\n/)).c4Layout;return{...(0,t.parseC4Diagram)(n),...i&&{layout:i}}},layoutForSvg(e,t){return zu(e,t)},renderSvg(e,t){return Bu(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}},pie:{type:`pie`,parse:(e,n)=>(0,t.parsePieChart)(n),layoutForSvg:(e,t)=>So(t.honorThemeVariables?e:{...e,sliceColors:void 0},t),renderSvg(e,t){return Eo(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},quadrant:{type:`quadrant`,parse:(e,n)=>(0,t.parseQuadrantChart)(n),layoutForSvg:(e,t)=>Ao(t.honorThemeVariables?e:{...e,themeColors:void 0}),renderSvg(e,t){return Fo(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},mindmap:{type:`mindmap`,parse:(e,n)=>(0,t.parseMindmap)(n),layoutForSvg:e=>Vs(e),renderSvg(e,t){return qs(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},gantt:{type:`gantt`,parse:(e,n)=>(0,t.parseGantt)(n),layoutForSvg:e=>td(e),renderSvg(e,t){return od(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},timeline:{type:`timeline`,parse:(e,n)=>(0,t.parseTimeline)(n),layoutForSvg:e=>uc(e),renderSvg(e,t){return pc(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},packet:{type:`packet`,parse:(e,n)=>(0,t.parsePacket)(n),layoutForSvg:e=>Fc(e),renderSvg(e,t){return Lc(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},radar:{type:`radar`,parse:(e,n)=>(0,t.parseRadar)(n),layoutForSvg:e=>Vc(e),renderSvg(e,t){return Kc(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},journey:{type:`journey`,parse:(e,n)=>(0,t.parseJourney)(n),layoutForSvg:e=>Ol(e),renderSvg(e,t){return Pl(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},kanban:{type:`kanban`,parse:(e,n)=>(0,t.parseKanban)(n),layoutForSvg:e=>tl(e),renderSvg(e,t){return sl(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},sankey:{type:`sankey`,parse:(e,n)=>(0,t.parseSankey)(n),layoutForSvg:e=>ml(e),renderSvg(e,t){return bl(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},requirement:{type:`requirement`,parse:(e,n)=>(0,t.parseRequirementDiagram)(n),layoutForSvg:(e,t)=>Gl(e,t),renderSvg(e,t){return Xl(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}},gitgraph:{type:`gitgraph`,parse:(e,n)=>(0,t.parseGitGraph)(n),layoutForSvg:e=>kc(e),renderSvg(e,t){return Nc(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}}},kd=54,Ad=18,jd=-25;function Md(t,n){let r=/<svg [^>]*>/.exec(t)[0],[,i,a]=/viewBox="0 0 ([\d.]+) ([\d.]+)"/.exec(r),o=Number(i),s=Number(a),c=Math.max(0,Math.ceil(((0,e.measureTextWidth)(n,Ad,400)-o)/2)),l=o+2*c,u=s+kd,d=r.replace(/viewBox="[^"]*"/,`viewBox="${-c} -54 ${l} ${u}"`).replace(/ width="[^"]*"/,` width="${l}"`).replace(/ height="[^"]*"/,` height="${u}"`),f=`<text x="${o/2}" y="${jd}" text-anchor="middle" font-size="${Ad}" fill="var(--_text)" class="front-matter-title">${(0,e.escapeXml)(n)}</text>`;return t.replace(r,d).replace(/<\/svg>\s*$/,`${f}\n</svg>`)}function Nd(t){return{bg:t.bg??e.DEFAULTS.bg,fg:t.fg??e.DEFAULTS.fg,line:t.line,accent:t.accent,muted:t.muted??(t.bg||t.fg?void 0:e.DEFAULTS.muted),surface:t.surface,border:t.border}}function Pd(t={}){return(0,e.themeStyleDeclarations)(Nd(t),t.transparent)}function Fd(e){return{nonce:e.nonce,styleAttribute:e.styleAttribute,bodyFont:a(e)}}function Id(e,t={}){let{svg:n,colors:r}=zd(e,t),i=Ld(n);return t.resolveColors?Hr(i,r):i}function Ld(e){let t=new Set(Array.from(e.matchAll(/\sid="([^"]+)"/g),e=>e[1]??``));if(t.size===0)return e;let n=2166136261;for(let t=0;t<e.length;t++)n=Math.imul(n^e.charCodeAt(t),16777619);let r=`zm${(n>>>0).toString(36)}-`,i=e=>t.has(e)&&!e.startsWith(`zm-`)?r+e:e;return e.replace(/(\sid=")([^"]+)"/g,(e,t,n)=>`${t}${i(n)}"`).replace(/url\(#([^)]+)\)/g,(e,t)=>`url(#${i(t)})`).replace(/(href=")#([^"]+)"/g,(e,t,n)=>`${t}#${i(n)}"`)}function Rd(t){let r=(0,e.extractAccessibility)((0,n.decodeXML)(t)).text;Od[(0,e.detectDiagramType)(r)].parse((0,e.splitStatements)(r),r)}function zd(t,r){(0,e.checkLimit)(`maxInputLength`,t.length,r.limits),(0,e.checkLineLength)(t,r.limits);let i=(0,e.extractAccessibility)((0,n.decodeXML)(t)),a=i.text,o=r.font??`Inter`;(0,e.setMonospaceMetrics)((0,e.isMonospaceFont)(o));let s=r.transparent??!1,c=N(r.fontSizes),l=(0,e.detectDiagramType)(a),u=r.embedSource?t:void 0,d=r.title??i.accTitle,f=r.decorative,p={...Fd(r),description:i.accDescr},m=(0,e.splitStatements)(a),h=Od[l],g=h.parse(m,a);l===`c4`&&i.accTitle&&(g.title=i.accTitle.replace(/\s+/g,` `));let _=g;_.nodes instanceof Map&&Array.isArray(_.edges)&&(0,e.checkGraphSize)(_.nodes.size,_.edges.length,r.limits);let v=r;l===`flowchart`&&r.fontSizes?.nodeLabel===void 0&&!ve(g)&&(c=N({...r.fontSizes,nodeLabel:16}),v={...r,fontSizes:c});let y=h.layoutForSvg(g,v),b=Nd(r.honorThemeVariables?(0,e.applyThemeVariables)(r,g.initConfig):r),x={colors:b,font:o,transparent:s,fontSizes:c,embedSource:u,title:d,decorative:f,emit:p},S=h.renderSvg(y,x,r);return i.frontMatterTitle&&(S=Md(S,i.frontMatterTitle)),{svg:S,colors:b}}async function Bd(e,t={}){return t.embedFont===`subset`&&await i(),Id(e,t)}var Vd=Id,Hd=Bd;exports.ACTOR_LABEL_OFFSET=ea,exports.ARROW_HEAD=re,exports.ASYMMETRIC_NOTCH=ne,exports.CLS=z,exports.ELK_DIRECTION_FALLBACK=ce,exports.ElkNotRegisteredError=v,exports.FONT_SIZES=M,exports.FONT_WEIGHTS=P,exports.GROUP_HEADER_CONTENT_PAD=te,exports.INLINE_CENTERED_EDGE_LABEL=pe,exports.JOURNEY=Tl,exports.KANBAN=qc,exports.MINDMAP=Cs,exports.MONO_FONT=j,exports.MONO_FONT_STACK=ee,exports.NODE_PADDING=F,exports.PACKET=Pc,exports.PIE=W,exports.QUADRANT=Do,exports.RADAR=Rc,exports.REQUIREMENT=Z,exports.SANKEY=cl,exports.SELF_LOOP_CONTROL=Xi,exports.SELF_LOOP_EXTENT=Zi,exports.SELF_LOOP_HEIGHT=Qi,exports.STROKE_WIDTHS=I,exports.TEXT_BASELINE_SHIFT=L,exports.TIMELINE=Qs,exports.baseElkLayoutOptions=de,exports.boxLabelHeight=$i,exports.buildElkEdge=he,exports.buildElkEdgeLabel=me,exports.buildElkLeafNode=fe,exports.buildSvgStyleBlock=ie,exports.classBackEdges=Qr,exports.classNoteId=qr,exports.clipEdgeToShape=Qe,exports.convertToElkFormat=en,exports.createLayoutCache=C,exports.directionToElk=le,exports.elkLayoutSync=E,exports.elkPadding=ue,exports.estimateMonoTextWidth=A,exports.estimateTextWidth=k,exports.evaluateCssColorValue=Ir,exports.extractEdgeLabelPosition=gt,exports.extractEdgePoints=ht,exports.formatTickLabels=ao,exports.hasLabelBelowIcon=aa,exports.layoutClassDiagramSync=ti,exports.layoutErDiagramSync=Li,exports.layoutFlowchartSync=Qt,exports.layoutGitGraph=kc,exports.layoutGraphSync=Zt,exports.layoutJourney=Ol,exports.layoutKanban=tl,exports.layoutMindmap=Vs,exports.layoutPacket=Fc,exports.layoutPieChart=So,exports.layoutQuadrantChart=Ao,exports.layoutRadar=Vc,exports.layoutRequirementDiagramSync=Gl,exports.layoutSankey=ml,exports.layoutSequenceDiagram=Ca,exports.layoutTimeline=uc,exports.layoutXYChart=Xa,exports.loadEmbeddedFont=i,Object.defineProperty(exports,"niceTickValues",{enumerable:!0,get:function(){return e.niceTickValues}}),exports.pieColorValue=wo,exports.pointsToPath=p,exports.registerElk=y,exports.renderClassSvg=si,exports.renderErSvg=Bi,exports.renderGitGraphSvg=Nc,exports.renderJourneySvg=Pl,exports.renderKanbanSvg=sl,exports.renderMermaid=Hd,exports.renderMermaidSVG=Id,exports.renderMermaidSVGAsync=Bd,exports.renderMermaidSync=Vd,exports.renderMindmapSvg=qs,exports.renderPacketSvg=Lc,exports.renderPieSvg=Eo,exports.renderQuadrantSvg=Fo,exports.renderRadarSvg=Kc,exports.renderRequirementSvg=Xl,exports.renderSankeySvg=bl,exports.renderSequenceSvg=wa,exports.renderSvg=un,exports.renderTimelineSvg=pc,exports.renderXYChartSvg=lo,exports.resolveCssColors=Hr,exports.resolveFontSizes=N,exports.smoothCurvePath=po,exports.straightLinePath=fo,exports.themeCssVariables=Pd,exports.timelineTextWidth=$s,exports.validateMermaid=Rd,exports.withDataSrc=R,exports.wrapLegendLabel=El,exports.wrapTaskLabel=Dl,exports.wrapTimelineText=ec,exports.xLabelStep=no;
264
+ </style>`}function Hd(e,t){let n=``;return e.active?n=e.crit?` activeCrit`:` active`:e.done?n=e.crit?` doneCrit`:` done`:e.crit&&(n=` crit`),n.length===0&&(n=` task`),e.milestone&&(n=` milestone ${n}`),e.vert&&(n=` vert ${n}`),`task${n}${t} ${e.classes.join(` `)}`.trimEnd()}function Ud(e){let t=e.task,n=e.sectionStyle,r=``;t.active&&(r=t.crit?`activeCritText${n}`:`activeText${n}`),t.done?r+=t.crit?` doneCritText${n}`:` doneText${n}`:t.crit&&(r+=` critText${n}`),t.milestone&&(r+=` milestoneText`),t.vert&&(r+=` vertText`);let i=e.text.outside===`left`?`taskTextOutsideLeft taskTextOutside${n}`:e.text.outside===`right`?`taskTextOutsideRight taskTextOutside${n}`:`taskText taskText${n}`;return[t.classes.join(` `),i,r].join(` `).replace(/\s+/g,` `).trim()}function Wd(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[];l.push(z((0,e.svgOpenTag)(t.width,t.height,n,i,o,s,void 0,c.styleAttribute,c.description),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(Vd(t.today?Bd(t.today.style):``,c.nonce)),l.push(`<g class="exclude-ranges">`);for(let e of t.excludeRanges)l.push(`<rect data-date="${e.id}" x="${$(e.x)}" y="${$(e.y)}" width="${$(e.width)}" height="${$(e.height)}" class="exclude-range"/>`);l.push(`</g>`);for(let n of t.axes){let t=n.position===`bottom`?1:-1;l.push(`<g class="grid" transform="translate(${n.x}, ${n.y})" fill="none" font-size="10" text-anchor="middle">`,`<path class="domain" stroke="currentColor" d="M0.5,${t*n.tickSize}V0.5H${n.rangeEnd+.5}V${t*n.tickSize}"/>`);for(let r of n.ticks)l.push(`<g class="tick" opacity="1" transform="translate(${$(r.x)},0)"><line stroke="currentColor" y2="${t*n.tickSize}"/><text fill="currentColor" y="${t*3}" dy="${t===1?`1em`:`0em`}" font-size="10" text-anchor="middle">${(0,e.escapeXml)(r.label)}</text></g>`);l.push(`</g>`)}l.push(`<g class="rows">`);for(let e of t.rows)l.push(`<rect x="0" y="${$(e.y)}" width="${$(e.width)}" height="${e.height}" class="section section${e.sectionStyle}"/>`);l.push(`</g>`),l.push(`<g class="tasks">`);for(let n of t.tasks)l.push(`<rect data-task="${(0,e.escapeXml)(n.id)}" rx="3" ry="3" x="${$(n.x)}" y="${$(n.y)}" width="${$(n.width)}" height="${$(n.height)}" transform-origin="${$(n.originX)}px ${$(n.originY)}px" class="${(0,e.escapeXml)(Hd(n.task,n.sectionStyle))}"/>`);for(let n of t.tasks)l.push(`<text data-task="${(0,e.escapeXml)(n.id)}" font-size="${t.fontSize}" x="${$(n.text.x)}" y="${$(n.text.y)}" class="${(0,e.escapeXml)(Ud(n))}">${(0,e.escapeXml)(n.text.text)}</text>`);l.push(`</g>`),l.push(`<g class="section-titles">`);for(let n of t.sectionLabels){let r=-(n.lines.length-1)/2,i=n.lines.map((t,n)=>`<tspan alignment-baseline="central" x="10"${n>0?` dy="1em"`:``}>${(0,e.escapeXml)(t)}</tspan>`).join(``);n.lines.every(e=>e===``)||l.push(`<text dy="${r}em" x="10" y="${$(n.y)}" font-size="${t.sectionFontSize}" class="sectionTitle sectionTitle${n.sectionStyle}">${i}</text>`)}if(l.push(`</g>`),t.today){let e=t.today,n=Bd(e.style)?` today-custom`:``;l.push(`<g class="today"><line x1="${$(e.x)}" x2="${$(e.x)}" y1="${e.y1}" y2="${$(e.y2)}" class="today${n}"/></g>`)}return t.title&&l.push(`<text x="${$(t.title.x)}" y="${t.title.y}" class="titleText">${(0,e.escapeXml)(t.title.text)}</text>`),l.push(`</svg>`),l.join(`
265
+ `)}var Gd=40,Kd=16,qd=1.5,Jd=`3`;function Yd(e){let t=e?.padding??Gd,n=e?.iconSize??80,r=e?.fontSize??Kd,i=t+2.5,a=t+1.5,o=e?.idealEdgeLengthMultiplier??qd;return{pad:t,tile:n,fontSize:r,groupPad:i,nestedPad:a,pitch:e=>{if(e===0)return n*(1+o);let t=(e===1?77.5:76.5)+.552*(n-80),r=i*Math.min(e,2)+a*Math.max(0,e-2);return Math.max(n+t+r,o*n)},labelDrop:r+1,labelReach:r+8.5,labelWrap:n*1.5}}var Xd=(t,n)=>(0,e.measureTextWidth)(t,N.nodeLabel*(n/Kd),F.nodeLabel);function Zd(e,t){let n=[];for(let r of e.split(`
266
+ `)){let e=``;for(let i of r.split(/\s+/).filter(Boolean)){let r=e?`${e} ${i}`:i;e&&Xd(r,t.fontSize)>t.labelWrap?(n.push(e),e=i):e=r}n.push(e)}return n}var Qd=(e,t)=>{if(!e)return t;let n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x+e.width,t.x+t.width)-n,height:Math.max(e.y+e.height,t.y+t.height)-r}};function $d(e,t){let n=new Map([...t.keys()].map(e=>[e,e])),r=e=>{let t=e;for(;n.get(t)!==t;)t=n.get(t);return t};for(let t of e.edges)n.has(t.source)&&n.has(t.target)&&n.set(r(t.source),r(t.target));let i=new Map;for(let e of t.keys()){let t=r(e);i.set(t,[...i.get(t)??[],e])}let a=0;for(let e of i.values()){let n=Math.min(...e.map(e=>t.get(e)[0])),r=Math.max(...e.map(e=>t.get(e)[0]));for(let r of e)t.get(r)[0]+=a-n;a+=r-n+1}}function ef(e,t){for(let n of e){if(n.nodeIds.includes(t))return[n.id];let e=ef(n.children,t);if(e.length>0)return[...e,n.id]}return[]}function tf(e,t,n,r,i=()=>0){let a=[0];for(let o=t;o<n;o++){let t=0;for(let[n,r]of e.values())(n<=o!=n<=o+1||r>=o!=r>=o+1)&&t++;a.push(a[a.length-1]+r.pitch(t)+i(o))}return a}var nf=[0,15.6,26.2];function rf(e,t,n,r,i){return a=>{let o=0;for(let[i,[s,c]]of n)if(!(c!==a+1||r(i).length>0))for(let[n,[r,i]]of e){let[e,c]=t.get(n);e===a&&c===a&&i-r===1&&s>=r&&s<=i&&o++}return i===80?nf[Math.min(o,2)]:0}}function af(e,t,n){let r=Yd(n),i=t??n?.padding??ae.padding,a=e.direction===`LR`||e.direction===`RL`,o=new Map;for(let[t,n]of e.nodes){let e=n.gridLayer??0,r=n.gridOrder??0;o.set(t,a?[e,r]:[r,e])}$d(e,o);let s=new Map,c=new Map;for(let[t,[n,r]]of o)for(let i of ef(e.subgraphs,t)){let e=s.get(i)??[n,n],t=c.get(i)??[r,r];s.set(i,[Math.min(e[0],n),Math.max(e[1],n)]),c.set(i,[Math.min(t[0],r),Math.max(t[1],r)])}let l=[...o.values()].map(e=>e[0]),u=[...o.values()].map(e=>e[1]),d=Math.min(...l),f=Math.min(...u),p=tf(s,d,Math.max(...l),r),m=tf(c,f,Math.max(...u),r,rf(s,c,o,t=>ef(e.subgraphs,t),r.tile)),h=[],g=new Map,_=new Map;for(let[t,n]of e.nodes){let[i,a]=o.get(t),s=n.shape===`junction`?2:r.tile,c=p[i-d]-s/2,l=m[a-f]-s/2,u={x:c,y:l,width:s,height:s};_.set(t,u);let v=n.icon===void 0?[]:Zd(n.label,r),y=Math.max(0,...v.map(e=>Xd(e,r.fontSize))),b=Math.max(0,(y-s)/2);g.set(t,n.shape===`junction`?{x:c+s/2-r.tile/2,y:l+s/2-r.tile/2,width:r.tile,height:r.tile}:{x:c-b,y:l,width:s+b*2,height:s+r.labelDrop}),h.push({id:t,label:n.icon===void 0?n.label:v.join(`
267
+ `),shape:n.icon===void 0?n.shape:`rectangle`,icon:n.icon,...u,className:e.classAssignments.get(t),interaction:e.interactions.get(t)})}let v=e=>{let t=e.children.map(v),n=(e,t)=>({x:e.x-t,y:e.y-t,width:e.width+t*2,height:e.height+t*2}),i;for(let t of e.nodeIds)i=Qd(i,g.get(t));let a;for(let e of t)a=Qd(a,e);let o=[...i?[n(i,r.groupPad)]:[],...a?[n(a,r.nestedPad)]:[]].reduce((e,t)=>Qd(e,t),void 0)??{x:-r.groupPad,y:-r.groupPad,width:r.groupPad*2,height:r.groupPad*2};return _.set(e.id,o),{id:e.id,label:e.label,...o,children:t,...e.icon===void 0?{}:{icon:e.icon},...e.architecture?{architecture:!0,iconSize:r.pad*.75}:{}}},y=e.subgraphs.map(v),b=e.edges.map(e=>{let t=_.get(e.source),n=_.get(e.target);return{source:e.source,target:e.target,label:e.label,style:e.style,hasArrowStart:e.hasArrowStart,hasArrowEnd:e.hasArrowEnd,points:sf(t,n),inlineStyle:{"stroke-width":Jd}}}),x=1/0,S=1/0,C=-1/0,w=-1/0;for(let e of g.values())x=Math.min(x,e.x),S=Math.min(S,e.y),C=Math.max(C,e.x+e.width),w=Math.max(w,e.y+e.height);for(let e of h)e.icon!==void 0&&(w=Math.max(w,e.y+e.height+r.labelReach));for(let e of _.values())x=Math.min(x,e.x),S=Math.min(S,e.y),C=Math.max(C,e.x+e.width),w=Math.max(w,e.y+e.height);let T=i-x,E=i-S,D=e=>{e.x+=T,e.y+=E,e.children.forEach(D)};for(let e of h)e.x+=T,e.y+=E;y.forEach(D);for(let e of b)e.points=e.points.map(e=>({x:e.x+T,y:e.y+E}));return{width:C-x+i*2,height:w-S+i*2,nodes:h,edges:b,groups:y}}var of=(e,t,n,r)=>{let i=Math.max(e,n),a=Math.min(t,r);return i<a||i===a&&e===t?(i+a)/2:void 0};function sf(e,t){let n=of(e.y,e.y+e.height,t.y,t.y+t.height);if(n!==void 0){let[r,i]=e.x<=t.x?[e,t]:[t,e],a=[{x:r.x+r.width,y:n},{x:i.x,y:n}];return r===e?a:a.reverse()}let r=of(e.x,e.x+e.width,t.x,t.x+t.width);if(r!==void 0){let[n,i]=e.y<=t.y?[e,t]:[t,e],a=[{x:r,y:n.y+n.height},{x:r,y:i.y}];return n===e?a:a.reverse()}let i=e.y+e.height/2,a=t.x+t.width/2;return[{x:t.x>e.x?e.x+e.width:e.x,y:i},{x:a,y:i},{x:a,y:t.y>e.y?t.y:t.y+t.height}]}var cf={type:`xychart`,parse:(n,r)=>(0,t.parseXYChart)(n,(0,e.extractInitConfig)(r.split(/\r\n?|\n/)).xyChart),layoutForSvg:so,renderSvg(e,t,n){let r=n.interactivity===void 0?n.interactive??!1:n.interactivity===`full`;return xo(e,t.colors,t.font,t.transparent,r,t.embedSource,t.title,t.decorative,t.emit)}},lf={type:`sequence`,parse:t.parseSequenceDiagram,layoutForSvg:Fa,renderSvg(e,t){return Ia(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}};function uf(e){return(e.interactivity??`static`)!==`none`}function df(e){return(e.interactivity??`static`)===`full`}var ff={type:`class`,parse(n,r){let i=(0,e.extractInitConfig)(r.split(/\r\n?|\n/)).classLayout;return{...(0,t.parseClassDiagram)(n),...i&&{layout:i}}},layoutForSvg:fi,renderSvg(e,t,n){return vi(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,uf(n),t.emit)}},pf={type:`er`,parse(n,r){let i=(0,e.extractInitConfig)(r.split(/\r\n?|\n/)).erLayout;return{...(0,t.parseErDiagram)(n),...i&&{layout:i}}},layoutForSvg(t,n){return Yi((0,e.withDirectionOverride)(t,n.direction),n)},renderSvg(e,t){return Qi(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}},mf={type:`flowchart`,parse:(e,n)=>(0,t.parseMermaid)(n),layoutForSvg(t,n){return{graph:nn((0,e.withDirectionOverride)(t,n.direction),n),curve:n.curve??`linear`}},renderSvg(e,t,n){return mn(e.graph,t.colors,t.font,t.transparent,t.fontSizes,e.curve,t.embedSource,df(n),uf(n),t.title,t.decorative,t.emit)}},hf={type:`c4`,parse(n,r){let i=(0,e.extractInitConfig)(r.split(/\r\n?|\n/)).c4Layout;return{...(0,t.parseC4Diagram)(n),...i&&{layout:i}}},layoutForSvg(e,t){return Cd(e,t)},renderSvg(e,t){return wd(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}},gf={type:`architecture`,parse(n,r){let i=(0,e.extractInitConfig)(r.split(/\r\n?|\n/)).architectureLayout;return{...(0,t.parseArchitecture)(n),...i&&{layout:i}}},layoutForSvg(e,n){return{graph:af((0,t.architectureToGraph)(e),n.padding,e.layout),curve:`linear`}},renderSvg:mf.renderSvg},_f=e=>e.font??(e.embedFont===`subset`?`Inter`:void 0),vf={xychart:cf,er:pf,sequence:lf,class:ff,flowchart:mf,architecture:gf,c4:hf,pie:{type:`pie`,parse:(e,n)=>(0,t.parsePieChart)(n),layoutForSvg:(e,t)=>Ro(t.honorThemeVariables===!1?{...e,sliceColors:void 0}:e,{font:_f(t)}),renderSvg(e,t,n){return Wo(e,t.colors,_f(n),t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},quadrant:{type:`quadrant`,parse:(e,n)=>(0,t.parseQuadrantChart)(n),layoutForSvg:(e,t)=>Jo(t.honorThemeVariables===!1?{...e,themeColors:void 0}:e),renderSvg(e,t){return rs(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},mindmap:{type:`mindmap`,parse:(e,n)=>(0,t.parseMindmap)(n),layoutForSvg:e=>lc(e),renderSvg(e,t){return hc(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},gantt:{type:`gantt`,parse:(e,n)=>(0,t.parseGantt)(n),layoutForSvg:e=>zd(e),renderSvg(e,t){return Wd(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},timeline:{type:`timeline`,parse:(e,n)=>(0,t.parseTimeline)(n),layoutForSvg:e=>Mc(e),renderSvg(e,t){return Fc(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},packet:{type:`packet`,parse:(e,n)=>(0,t.parsePacket)(n),layoutForSvg:e=>_l(e),renderSvg(e,t){return yl(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},radar:{type:`radar`,parse:(e,n)=>(0,t.parseRadar)(n),layoutForSvg:e=>Cl(e),renderSvg(e,t){return Ol(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},journey:{type:`journey`,parse:(e,n)=>(0,t.parseJourney)(n),layoutForSvg:e=>uu(e),renderSvg(e,t){return gu(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},kanban:{type:`kanban`,parse:(e,n)=>(0,t.parseKanban)(n),layoutForSvg:e=>Ll(e),renderSvg(e,t){return Ul(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},sankey:{type:`sankey`,parse:(e,n)=>(0,t.parseSankey)(n),layoutForSvg:e=>Xl(e),renderSvg(e,t){return nu(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},requirement:{type:`requirement`,parse:(e,n)=>(0,t.parseRequirementDiagram)(n),layoutForSvg:(e,t)=>Du(e,t),renderSvg(e,t){return Mu(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}},gitgraph:{type:`gitgraph`,parse:(e,n)=>(0,t.parseGitGraph)(n),layoutForSvg:e=>ul(e),renderSvg(e,t){return hl(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}}},yf=54,bf=18,xf=-25;function Sf(t,n){let r=/<svg [^>]*>/.exec(t)[0],[,i,a]=/viewBox="0 0 ([\d.]+) ([\d.]+)"/.exec(r),o=Number(i),s=Number(a),c=Math.max(0,Math.ceil(((0,e.measureTextWidth)(n,bf,400)-o)/2)),l=o+2*c,u=s+yf,d=r.replace(/viewBox="[^"]*"/,`viewBox="${-c} -54 ${l} ${u}"`).replace(/ width="[^"]*"/,` width="${l}"`).replace(/ height="[^"]*"/,` height="${u}"`),f=`<text x="${o/2}" y="${xf}" text-anchor="middle" font-size="${bf}" fill="var(--_text)" class="front-matter-title">${(0,e.escapeXml)(n)}</text>`;return t.replace(r,d).replace(/<\/svg>\s*$/,`${f}\n</svg>`)}function Cf(t){return{bg:t.bg??e.DEFAULTS.bg,fg:t.fg??e.DEFAULTS.fg,line:t.line,accent:t.accent,muted:t.muted??(t.bg||t.fg?void 0:e.DEFAULTS.muted),surface:t.surface,border:t.border}}function wf(t={}){return(0,e.themeStyleDeclarations)(Cf(t),t.transparent)}function Tf(e){return{nonce:e.nonce,styleAttribute:e.styleAttribute,bodyFont:a(e)}}function Ef(e,t={}){let{svg:n,colors:r}=jf(e,t),i=Df(n);return t.resolveColors?Kr(i,r):i}function Df(e){let t=new Set(Array.from(e.matchAll(/\sid="([^"]+)"/g),e=>e[1]??``));if(t.size===0)return e;let n=2166136261;for(let t=0;t<e.length;t++)n=Math.imul(n^e.charCodeAt(t),16777619);let r=`zm${(n>>>0).toString(36)}-`,i=e=>t.has(e)&&!e.startsWith(`zm-`)?r+e:e;return e.replace(/(\sid=")([^"]+)"/g,(e,t,n)=>`${t}${i(n)}"`).replace(/url\(#([^)]+)\)/g,(e,t)=>`url(#${i(t)})`).replace(/(href=")#([^"]+)"/g,(e,t,n)=>`${t}#${i(n)}"`)}var Of=new Set([`pie`,`packet`,`gantt`,`timeline`,`xychart`,`sankey`,`radar`,`sequence`]);function kf(t){return Of.has((0,e.detectDiagramType)(t))?t:(0,n.decodeXML)(t)}function Af(t){let n=(0,e.extractAccessibility)(kf(t)).text;vf[(0,e.detectDiagramType)(n)].parse((0,e.splitStatements)(n),n)}function jf(t,n){(0,e.checkLimit)(`maxInputLength`,t.length,n.limits),(0,e.checkLineLength)(t,n.limits);let r=(0,e.extractAccessibility)(kf(t)),i=r.text,a=n.font??`Inter`;(0,e.setMonospaceMetrics)((0,e.isMonospaceFont)(a));let o=n.transparent??!1,s=P(n.fontSizes),c=(0,e.detectDiagramType)(i),l=n.embedSource?t:void 0,u=n.title??r.accTitle,d=n.decorative,f={...Tf(n),description:r.accDescr},p=(0,e.splitStatements)(i),m=vf[c],h=m.parse(p,i);c===`c4`&&r.accTitle&&(h.title=r.accTitle.replace(/\s+/g,` `));let g=h;g.nodes instanceof Map&&Array.isArray(g.edges)&&(0,e.checkGraphSize)(g.nodes.size,g.edges.length,n.limits);let _=n;c===`flowchart`&&n.fontSizes?.nodeLabel===void 0&&!R(h)&&(s=P({...n.fontSizes,nodeLabel:16}),_={...n,fontSizes:s});let v=m.layoutForSvg(h,_),y=Cf(n.honorThemeVariables===!1?n:(0,e.applyThemeVariables)(n,h.initConfig)),b={colors:y,font:a,transparent:o,fontSizes:s,embedSource:l,title:u,decorative:d,emit:f},x=m.renderSvg(v,b,n);return r.frontMatterTitle&&(x=Sf(x,r.frontMatterTitle)),{svg:x,colors:y}}async function Mf(e,t={}){return t.embedFont===`subset`&&await i(),Ef(e,t)}var Nf=Ef,Pf=Mf;exports.ACTOR_LABEL_OFFSET=fa,exports.ARROW_HEAD=re,exports.ASYMMETRIC_NOTCH=te,exports.CLS=B,exports.ELK_DIRECTION_FALLBACK=ue,exports.ElkNotRegisteredError=v,exports.FONT_SIZES=N,exports.FONT_WEIGHTS=F,exports.GROUP_HEADER_CONTENT_PAD=ee,exports.INLINE_CENTERED_EDGE_LABEL=he,exports.JOURNEY=su,exports.KANBAN=kl,exports.MINDMAP=Gs,exports.MONO_FONT=j,exports.MONO_FONT_STACK=M,exports.NODE_PADDING=ne,exports.PACKET=gl,exports.PIE=G,exports.QUADRANT=Go,exports.RADAR=bl,exports.REQUIREMENT=Q,exports.SANKEY=Wl,exports.SELF_LOOP_CONTROL=ca,exports.SELF_LOOP_EXTENT=la,exports.SELF_LOOP_HEIGHT=ua,exports.STROKE_WIDTHS=I,exports.TEXT_BASELINE_SHIFT=L,exports.TIMELINE=bc,exports.baseElkLayoutOptions=pe,exports.boxLabelHeight=da,exports.buildElkEdge=_e,exports.buildElkEdgeLabel=ge,exports.buildElkLeafNode=me,exports.buildSvgStyleBlock=ie,exports.classBackEdges=li,exports.classNoteId=ii,exports.clipEdgeToShape=tt,exports.convertToElkFormat=an,exports.createLayoutCache=C,exports.directionToElk=de,exports.elkLayoutSync=E,exports.elkPadding=fe,exports.estimateMonoTextWidth=A,exports.estimateTextWidth=k,exports.evaluateCssColorValue=Br,exports.extractEdgeLabelPosition=yt,exports.extractEdgePoints=vt,exports.formatTickLabels=_o,exports.hasLabelBelowIcon=_a,exports.layoutClassDiagramSync=fi,exports.layoutErDiagramSync=Yi,exports.layoutFlowchartSync=nn,exports.layoutGitGraph=ul,exports.layoutGraphSync=tn,exports.layoutJourney=uu,exports.layoutKanban=Ll,exports.layoutMindmap=lc,exports.layoutPacket=_l,exports.layoutPieChart=Ro,exports.layoutQuadrantChart=Jo,exports.layoutRadar=Cl,exports.layoutRequirementDiagramSync=Du,exports.layoutSankey=Xl,exports.layoutSequenceDiagram=Fa,exports.layoutTimeline=Mc,exports.layoutXYChart=so,exports.loadEmbeddedFont=i,Object.defineProperty(exports,"niceTickValues",{enumerable:!0,get:function(){return e.niceTickValues}}),exports.pieColorValue=Bo,exports.pointsToPath=p,exports.registerElk=y,exports.renderClassSvg=vi,exports.renderErSvg=Qi,exports.renderGitGraphSvg=hl,exports.renderJourneySvg=gu,exports.renderKanbanSvg=Ul,exports.renderMermaid=Pf,exports.renderMermaidSVG=Ef,exports.renderMermaidSVGAsync=Mf,exports.renderMermaidSync=Nf,exports.renderMindmapSvg=hc,exports.renderPacketSvg=yl,exports.renderPieSvg=Wo,exports.renderQuadrantSvg=rs,exports.renderRadarSvg=Ol,exports.renderRequirementSvg=Mu,exports.renderSankeySvg=nu,exports.renderSequenceSvg=Ia,exports.renderSvg=mn,exports.renderTimelineSvg=Fc,exports.renderXYChartSvg=xo,exports.resolveCssColors=Kr,exports.resolveFontSizes=P,exports.smoothCurvePath=wo,exports.straightLinePath=Co,exports.themeCssVariables=wf,exports.timelineTextWidth=xc,exports.validateMermaid=Af,exports.withDataSrc=z,exports.wrapLegendLabel=cu,exports.wrapTaskLabel=lu,exports.wrapTimelineText=Sc,exports.xLabelStep=mo;