@zombie-mermaid/svg-renderer 5.15.0 → 5.16.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 +156 -71
- package/dist/index.js +161 -76
- package/dist/shared/index.d.ts +245 -3
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{C4 as e,C4 as t,DEFAULTS as n,LINE_HEIGHT_RATIO as r,MermaidParseError as i,applyThemeVariables as a,buildStyleBlock as o,c4Config as s,c4CylinderCap as c,c4DescriptionHeight as l,c4PersonGeometry as u,c4QueueCap as d,c4ShapeSize as f,c4TextBlockHeight as p,c4TextWidth as m,c4TextWidth as h,checkGraphSize as g,checkLimit as _,checkLineLength as v,collapseFlatRange as y,detectDiagramType as b,dropInvalidColors as x,escapeAttr as S,escapeXml as C,extractAccessibility as w,extractInitConfig as T,f as E,findBackEdgeIndexes as D,findBackEdges as O,formatCssColor as k,groupStyle as A,isMonospaceFont as ee,measureMultilineText as j,measureTextWidth as M,mixSrgb as te,niceTickValues as ne,niceTickValues as re,paletteClass as N,parseCssColor as ie,renderMultilineText as P,renderMultilineTextWithBackground as ae,resolveNodeStyle as oe,safeHref as se,sanitizeClassName as ce,setMonospaceMetrics as le,splitStatements as ue,styleOpenTag as de,subgraphDirectionIsHonored as fe,subgraphFeedbackEdges as pe,svgOpenTag as F,themeStyleDeclarations as me,withDirectionOverride as he,withRootClass as ge,withoutOwnClusterEdges as _e,wrapToWidth as ve}from"@zombie-mermaid/core";import{CHART_ACCENT_FALLBACK as ye,architectureToGraph as be,c4BoundaryTypeLine as xe,c4RelLabelLines as Se,c4TypeLine as Ce,formatClassMember as we,formatD3Time as Te,getSeriesColor as Ee,isExcludedDate as De,mindmapLabelLines as Oe,packGanttSection as ke,parseArchitecture as Ae,parseC4Diagram as je,parseClassDiagram as Me,parseErDiagram as Ne,parseGantt as Pe,parseGitGraph as Fe,parseJourney as Ie,parseKanban as Le,parseMermaid as Re,parseMindmap as ze,parsePacket as Be,parsePieChart as Ve,parseQuadrantChart as He,parseRadar as Ue,parseRequirementDiagram as We,parseSankey as Ge,parseSequenceDiagram as Ke,parseTimeline as qe,parseXYChart as Je,requirementBodyRows as Ye,resolvePacketConfig as Xe,timeTicks as Ze}from"@zombie-mermaid/mermaid-parser";import{decodeXML as Qe}from"entities";var $e;async function et(){if($e)return;let e=await import(`./inter-font-subset-DT2grXy3.js`);$e={family:e.INTER_FONT_FAMILY,faceCss:e.INTER_FONT_FACE_CSS}}function tt(e){if(e.embedFont===`subset`){if(!$e)throw Error("embedFont: 'subset' needs its font data loaded first: use renderMermaidSVGAsync(), or `await loadEmbeddedFont()` before renderMermaidSVG().");return $e}}function nt(e){return E`M ${e.x} ${e.y}`}function rt(e){return nt(e[0])+e.slice(1).map(e=>E` L ${e.x} ${e.y}`).join(``)}function it(e){if(e.length<3)return rt(e);let t=e[e.length-1],n=[nt(e[0])],r=(e,t,n)=>E` C ${(2*e.x+t.x)/3} ${(2*e.y+t.y)/3},`+E` ${(e.x+2*t.x)/3} ${(e.y+2*t.y)/3},`+E` ${(e.x+4*t.x+n.x)/6} ${(e.y+4*t.y+n.y)/6}`;n.push(E` L ${(5*e[0].x+e[1].x)/6}`+E` ${(5*e[0].y+e[1].y)/6}`);for(let t=2;t<e.length;t++)n.push(r(e[t-2],e[t-1],e[t]));return n.push(r(e[e.length-2],t,t)),n.push(E` L ${t.x} ${t.y}`),n.join(``)}function at(e){return st(e,12)}var ot=5*Math.SQRT2;function st(e,t){if(e.length<3)return rt(e);let n=t,r=[nt(e[0])];for(let t=1;t<e.length-1;t++){let i=e[t-1],a=e[t],o=e[t+1],s=Math.hypot(a.x-i.x,a.y-i.y),c=Math.hypot(o.x-a.x,o.y-a.y);if(s===0||c===0){r.push(E` L ${a.x} ${a.y}`);continue}let l=Math.min(n,s/2,c/2),u=a.x-(a.x-i.x)/s*l,d=a.y-(a.y-i.y)/s*l,f=a.x+(o.x-a.x)/c*l,p=a.y+(o.y-a.y)/c*l;r.push(E` L ${u} ${d}`),r.push(E` Q ${a.x} ${a.y}, ${f} ${p}`)}let i=e[e.length-1];return r.push(E` L ${i.x} ${i.y}`),r.join(``)}function ct(e,t){let n=[nt(e[0])],r=e.length-1;for(let i=0;i<r;i++){let a=e[i],o=e[i+1];if(i===r-1){n.push(E` L ${o.x} ${o.y}`);break}if(t===`before`)n.push(E` L ${a.x} ${o.y} L ${o.x} ${o.y}`);else if(t===`after`)n.push(E` L ${o.x} ${a.y} L ${o.x} ${o.y}`);else{let e=(a.y+o.y)/2;n.push(E` L ${a.x} ${e} L ${o.x} ${e} L ${o.x} ${o.y}`)}}return n.join(``)}function lt(e,t=`linear`){if(e.length===0)return``;if(e.length===1)return nt(e[0]);switch(t){case`basis`:return it(e);case`natural`:return at(e);case`step`:return ct(e,`mid`);case`stepBefore`:return ct(e,`before`);case`stepAfter`:return ct(e,`after`);default:return rt(e)}}function ut(e){let t=e?.worker?.worker;return typeof t==`object`&&!!t&&`dispatcher`in t}var dt=null,ft=null,pt=null,mt=class extends Error{constructor(){super("zombie-mermaid: rendering a flowchart, state, class or ER diagram needs the optional peer dependency \"elkjs\". Install it (npm i elkjs) and call registerElk(ELK) once at startup with `import ELK from 'elkjs/lib/elk.bundled.js'`. Sequence, pie, xychart, C4 and ASCII output do not need it. A flowchart can also pass `layout: 'simple'` to skip elkjs."),this.name=`ElkNotRegisteredError`}};function ht(e){dt=e,ft=null,pt=null}function gt(){let e=globalThis.process;if(!e?.versions?.node||typeof e.getBuiltinModule!=`function`)return null;let t=e.getBuiltinModule(`node:module`);if(!t)return null;let n=[`elkjs`,`lib`,`elk.bundled.js`].join(`/`),r=[typeof __filename==`string`?__filename:import.meta.url,new URL(`file://${_t(e)}/`).href];for(let e of r)try{let r=t.createRequire(e)(n),i=typeof r==`function`?r:r.default;if(typeof i==`function`)return i}catch{}return null}function _t(e){let t=e.cwd;return typeof t==`function`?t.call(e):`/`}var vt=20;function yt(e=vt){if(!Number.isInteger(e)||e<1)throw Error(`createLayoutCache: maxSize must be a positive integer, got ${e}`);return{map:new Map,maxSize:e}}function bt(e){if(Array.isArray(e))return`[${e.map(bt).join(`,`)}]`;if(typeof e==`object`&&e){let t=e;return`{${Object.keys(t).sort().map(e=>`${JSON.stringify(e)}:${bt(t[e])}`).join(`,`)}}`}return JSON.stringify(e)}function xt(){if(ft&&pt)return pt;let e=dt??=gt();if(!e)throw new mt;let t=[],n=globalThis.setTimeout;globalThis.setTimeout=(e,r)=>r===0?(t.push(e),0):n(e,r);let r=globalThis,i=Object.getOwnPropertyDescriptor(r,`self`),a=`self`in r&&r.document===void 0&&i?.configurable!==!1,o=a&&r.global===void 0;a&&(Object.defineProperty(r,"self",{value:void 0,configurable:!0,writable:!0}),o&&(r.global=globalThis));let s;try{s=new e}finally{a&&(i?Object.defineProperty(r,"self",i):delete r.self,o&&delete r.global),globalThis.setTimeout=n}if(!ut(s))throw Error(`zombie-mermaid: registerElk() needs the ELK class from 'elkjs/lib/elk.bundled.js' (or 'elkjs/lib/main.js'), whose synchronous worker this renderer drives directly.`);return ft=s,t.forEach(e=>e()),pt=ft.worker.worker,pt}function St(e,t){let n=t,r=n?bt(e):void 0;if(n&&r!==void 0){let e=n.map.get(r);if(e)return n.map.delete(r),n.map.set(r,e),e}let i=xt(),a=e=>{let t,n,r=i.onmessage;return i.onmessage=e=>{e.data.error?n=e.data.error:t=e.data.data},i.dispatcher.saveDispatch({data:{id:0,cmd:`layout`,graph:e}}),i.onmessage=r,{result:t,error:n}},{result:o,error:s}=a(e);if(String(s?.message??s).includes(`Invalid hitboxes`)&&({result:o,error:s}=a({...e,layoutOptions:{...e.layoutOptions,"elk.layered.compaction.postCompaction.strategy":`NONE`}})),s)throw s;if(!o)throw Error(`ELK layout did not return synchronously`);if(n&&r!==void 0&&(n.map.set(r,o),n.map.size>n.maxSize)){let e=n.map.keys().next().value;e!==void 0&&n.map.delete(e)}return o}var Ct=`JetBrains Mono NL`,wt=`@font-face {
|
|
2
2
|
font-family: 'JetBrains Mono NL';
|
|
3
3
|
font-style: normal;
|
|
4
4
|
font-weight: 400;
|
|
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 N(e,t,n){return x(e,t,n)}function ot(e,t){return e.length*t*.6}var st=`'JetBrains Mono'`,ct=`${st}, 'SF Mono', 'Fira Code', ui-monospace, monospace`,lt={nodeLabel:13,edgeLabel:11,groupHeader:12};function ut(e){return{nodeLabel:e?.nodeLabel??lt.nodeLabel,edgeLabel:e?.edgeLabel??lt.edgeLabel,groupHeader:e?.groupHeader??lt.groupHeader}}var P={nodeLabel:500,edgeLabel:400,groupHeader:600},dt=12,ft=12,pt={horizontal:20,vertical:10,diamondExtra:24},F={outerBox:1,innerBox:.75,connector:1},I=`0.35em`,mt={width:8,height:5};function ht(e,t,n,i){return r(e,t?{family:it,faceCss:at}:!1,n,i)}var gt={font:`Inter`,padding:40,nodeSpacing:28,layerSpacing:48,mergeEdges:!1,thoroughness:3,fontSizes:lt},_t=`#087ebf`,vt={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>`},yt={flowchart:`DOWN`,state:`DOWN`,class:`DOWN`,er:`DOWN`,c4:`DOWN`};function bt(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 xt(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 St(e){return{"elk.algorithm":`layered`,"elk.direction":e.direction,"elk.spacing.nodeNode":String(e.nodeSpacing),"elk.layered.spacing.nodeNodeBetweenLayers":String(e.layerSpacing),"elk.padding":xt(e.padding),"elk.edgeRouting":`ORTHOGONAL`}}function Ct(e,t,n){let r={id:e,width:t.width,height:t.height};return n!==void 0&&(r.labels=[{text:n}]),r}var wt={"elk.edgeLabels.inline":`true`,"elk.edgeLabels.placement":`CENTER`};function Tt(e,t){let n=b(e,t.fontSize,P.edgeLabel),r={text:e,width:n.width+8,height:n.height+6};return t.layoutOptions&&(r.layoutOptions={...t.layoutOptions}),r}function Et(e){let t={id:e.id,sources:[e.source],targets:[e.target]};return e.label&&(t.labels=[Tt(e.label,e.labelStyle)]),t}var Dt={"state-start":`FIRST`},Ot={"elk.layered.cycleBreaking.strategy":`MODEL_ORDER`,"elk.layered.compaction.postCompaction.strategy":`NONE`};function kt(e){for(let t of e.nodes.values())if(t.shape===`state-start`||t.shape===`state-end`)return!0;return!1}var At={top:51,left:24,bottom:24,right:24},jt={top:51,left:24,bottom:24,right:24},Mt={top:44,left:16,bottom:16,right:16},Nt={top:16,left:16,bottom:16,right:16};function Pt(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}function Ft(e){return e.subgraphs.length>0&&!kt(e)}function It(e,t,n){if(!(!Ft(e)||t.nodeSpacing!==gt.nodeSpacing||t.layerSpacing!==gt.layerSpacing))return n===`root`?{"spacing.baseValue":`40`}:{"spacing.baseValue":`24`,"elk.spacing.nodeNode":`50`,"elk.layered.spacing.edgeNodeBetweenLayers":`30`,"elk.spacing.edgeEdge":`20`}}var Lt=[`elk.spacing.nodeNode`,`elk.layered.spacing.nodeNodeBetweenLayers`,`elk.spacing.edgeEdge`,`elk.layered.spacing.edgeEdgeBetweenLayers`,`elk.layered.spacing.edgeNodeBetweenLayers`,`elk.contentAlignment`];function Rt(e,t){if(!t)return e;let n={...e};for(let e of Lt)delete n[e];return{...n,...t}}function zt(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 Bt=`[top=12,left=12,bottom=12,right=12]`,Vt=new WeakMap;function Ht(e){let t=Vt.get(e);return t||(t=Zt(e.subgraphs)?new Set:Ft(e)?ie(e):h(e,void 0,ie(e)),Vt.set(e,t)),t}function Ut(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 Wt(e){return bt(e,yt.flowchart)}function Gt(e){return{...St(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 Kt(e){return{fontSize:e.fontSizes.edgeLabel,layoutOptions:wt}}var qt=136,Jt=40;function Yt(e,t,n,r,i,a,o=!1){if(i!==void 0)return{width:80,height:80};let s=b(t,r,P.nodeLabel),c=s.width+pt.horizontal*2,l=s.height+pt.vertical*2;if(n===`diamond`){let e=Math.max(c,l)+pt.diamondExtra;c=e,l=e}if(n===`circle`||n===`doublecircle`){let e=Math.ceil(Math.sqrt(c*c+l*l))+8;c=n===`doublecircle`?e+12:e,l=c}if(n===`hexagon`&&(c+=pt.horizontal),(n===`trapezoid`||n===`trapezoid-alt`||n===`parallelogram`||n===`parallelogram-alt`)&&(c+=pt.horizontal),n===`asymmetric`&&(c+=12),n===`cylinder`&&(l+=14),n===`cloud`){let e=Math.max(c,l*2.5);return{width:e*1.25,height:l+e*.48}}return n===`small-circle`?{width:14,height:14}:n===`fork-bar`?a===`LR`||a===`RL`?{width:10,height:70}:{width:70,height:10}:n===`state-start`||n===`state-end`?{width:14,height:14}:n===`junction`?{width:2,height:2}:t===``&&n===`diamond`?{width:28,height:28}:t===``&&n===`fork-join`?{width:70,height:10}:(c=Math.max(c,o?qt:60),l=Math.max(l,o?Jt:36),{width:c,height:l})}var Xt=` root`;function Zt(e){for(let t of e)if(t.direction!==void 0||Zt(t.children))return!0;return!1}function Qt(e,t){for(let n of e.nodeIds)t.add(n);for(let n of e.children)Qt(n,t)}function $t(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 en(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;return n}function tn(e,t){let n=t,r=new Set,i=new Set;for(let t of e.subgraphs)i.add(t.id),rn(t,r,i);let a=an(e.subgraphs),o=$t(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=Zt(e.subgraphs),d=[],f=[],p={...Rt(Gt({direction:Wt(e.direction),nodeSpacing:n.nodeSpacing,layerSpacing:kt(e)&&n.layerSpacing===gt.layerSpacing?40:n.layerSpacing,padding:n.padding}),It(e,n,`root`)),...Ft(e)?{}:{"elk.layered.thoroughness":String(gt.thoroughness)},"elk.layered.highDegreeNodes.treatment":`false`,"elk.layered.compaction.postCompaction.strategy":e.subgraphs.length===0||Pt(e)||Ft(e)?`NONE`:`LEFT_RIGHT_CONSTRAINT_LOCKING`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,...Ft(e)?{"elk.layered.cycleBreaking.strategy":`DEPTH_FIRST`}:{},...Pt(e)?{"elk.spacing.edgeEdge":Ft(e)?`50`:`40`}:{},...kt(e)?Ot:{},"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=en(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]:Xt,Et({id:`e${e}`,source:o,target:s,label:t.label,labelStyle:Kt(n)}))}for(let[t,a]of e.nodes)if(!r.has(t)&&!i.has(t)){let r=Ct(t,Yt(t,a.label,a.shape,n.fontSizes.nodeLabel,a.icon,e.direction,kt(e)),a.label),i=kt(e)?Dt[a.shape]:void 0;i!==void 0&&(r.layoutOptions={"elk.layered.layering.layerConstraint":i}),d.push(r)}let v=kt(e),y=d.length,b=v?e.subgraphs:[...e.subgraphs].reverse();for(let t of b)d.push(nn(t,e,n,c,m,h,e.direction));if(Ft(e)&&d.unshift(...d.splice(y)),v&&e.subgraphs.length>0){let t=d.map((t,n)=>{if(n<y)return Ut(e,new Set([t.id]));let r=e.subgraphs[n-y],i=Ut(e,new Set([r.id]));if(i!==1/0)return i;let a=new Set;return Qt(r,a),Ut(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=Ht(e),S=Ft(e)&&!u,C=c.get(null);if(S)for(let t of zt(e)){let r=e.edges[t];f.push(Et({id:`e${t}`,source:x.has(t)?r.target:r.source,target:x.has(t)?r.source:r.target,label:r.label,labelStyle:Kt(n)}))}for(let{index:e,edge:t}of S?[]:C)t.source!==t.target&&f.push(Et({id:`e${e}`,source:x.has(e)?t.target:t.source,target:x.has(e)?t.source:t.target,label:t.label,labelStyle:Kt(n)}));if(u)for(let e of h.get(Xt)??[])f.push(e);else for(let{index:e,edge:t}of S?[]:l)f.push(Et({id:`e${e}`,source:x.has(e)?t.target:t.source,target:x.has(e)?t.source:t.target,label:t.label,labelStyle:Kt(n)}));return{id:`root`,layoutOptions:p,children:d,edges:f}}function nn(e,t,n,r,i,a,o){let s=e.direction!==void 0&&re(e,t)?e.direction:o,c=Rt(Gt({direction:Wt(s),nodeSpacing:n.nodeSpacing,layerSpacing:kt(t)&&n.layerSpacing===gt.layerSpacing?24:n.layerSpacing,padding:e.region?Nt:kt(t)?At:Ft(t)?jt:Mt}),It(t,n,`subgraph`));if(Ft(t)&&!e.region){let t=b(e.label,n.fontSizes.groupHeader,P.groupHeader).width+24;c[`elk.nodeSize.constraints`]=`[MINIMUM_SIZE]`,c[`elk.nodeSize.minimum`]=s===`TD`||s===`TB`||s===`BT`?`(0, ${t})`:`(${t}, 0)`}Ft(t)&&(c[`elk.layered.cycleBreaking.strategy`]=`DEPTH_FIRST`,c[`elk.spacing.portsSurrounding`]=Bt);let l,u=i.get(e.id);u&&u.size>0&&(l=[...u].map(e=>({id:e})));let d=[],f=Ft(t),p=f?[...t.nodes.keys()].filter(t=>e.nodeIds.includes(t)):e.nodeIds;for(let e of p){let r=t.nodes.get(e);if(r){let i=Ct(e,Yt(e,r.label,r.shape,n.fontSizes.nodeLabel,r.icon,t.direction,kt(t)),r.label);d.push(i)}}let m=e.children.some(e=>e.region)?e.children:[...e.children].reverse(),h=d.length;for(let e of m)d.push(nn(e,t,n,r,i,a,s));f&&d.unshift(...d.splice(h));let g=[],_=r.get(e.id)??[],v=Ht(t);for(let{index:e,edge:r}of Ft(t)&&!Zt(t.subgraphs)?[]:_)r.source!==r.target&&g.push(Et({id:`e${e}`,source:v.has(e)?r.target:r.source,target:v.has(e)?r.source:r.target,label:r.label,labelStyle:Kt(n)}));for(let t of a.get(e.id)??[])g.push(t);return{id:e.id,layoutOptions:c,labels:e.label?[{text:e.label}]:void 0,ports:l,children:d,edges:g}}function rn(e,t,n){for(let n of e.nodeIds)t.add(n);for(let r of e.children)n.add(r.id),rn(r,t,n)}function an(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 on(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]=sn(e[0],e[1],t);else{let n=e.length-1;r[n]=sn(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 sn(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?ln(t,c,a)??a:ln(t,a,o)??a:t<=r?ln(t,s,c)??s:ln(t,o,s)??s}{let t=e.y;return l>0?t<=i?cn(t,a,c)??c:cn(t,c,s)??c:t<=i?cn(t,a,o)??o:cn(t,o,s)??o}}function cn(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 ln(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 un=12;function dn(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=gt.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&&fn(t,l,r?`x`:`y`)}function fn(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,un-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 pn=.5;function mn(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+pn,r=e.x+e.width-pn,i=e.y+pn,a=e.y+e.height-pn;if(!(t>=r||i>=a)&&o<r&&s>t&&c<a&&l>i)return!1}}return!0}function hn(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(...hn(e,t,i.children)));return r}function gn(e,t,n,r,i){let a=i===`LR`,o=i===`RL`,s=i===`BT`,c=a||o,l=new Set(hn(t,n,r).map(e=>e.id)),u=hn(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 _n=2;function vn(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)<=_n)return!0}return!1}function yn(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(vn(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=gn(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}];mn(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(vn(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=gn(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}];mn(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(vn(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=gn(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}];mn(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(vn(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=gn(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}];mn(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 bn=1.5,xn=.01;function Sn(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)<xn&&Math.abs(i.x-a.x)<xn&&Math.abs(r.y-i.y)<xn&&Math.abs(r.x-i.x)<=bn&&Math.abs(r.x-i.x)>=xn,s=Math.abs(e.y-r.y)<xn&&Math.abs(i.y-a.y)<xn&&Math.abs(r.x-i.x)<xn&&Math.abs(r.y-i.y)<=bn&&Math.abs(r.y-i.y)>=xn;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 Cn(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 wn(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 Tn=20,En=4,Dn=24,On={width:8,height:6};function kn(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-Dn,8)/(2*a+1),u=0;return n.map((t,n)=>{u+=Tn;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-En-e/2,s),_=a-En-e,u+=e+En}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 An(e,t,n,r=lt.edgeLabel){let i=1/0,a=1/0,o=new Map;e.edges.forEach((e,n)=>{e.source!==e.target||!t.has(e.source)||o.set(e.source,[...o.get(e.source)??[],n])});for(let[s,c]of o){let o=kn(t.get(s),e.direction,c.map(t=>{let n=e.edges[t].label;if(!n)return;let i=b(n,r,P.edgeLabel);return{width:i.width+On.width,height:i.height+On.height}}));c.forEach((t,r)=>{let s=e.edges[t],{points:c,labelPosition:l,...u}=o[r];i=Math.min(i,u.minX),a=Math.min(a,u.minY),n.push({source:s.source,target:s.target,label:s.label,style:s.style,hasArrowStart:s.hasArrowStart,hasArrowEnd:s.hasArrowEnd,points:c,labelPosition:s.label?l:void 0,inlineStyle:Wn(t,e),headColor:Un(e),id:s.id,animate:s.animate,startMarker:s.startMarker,endMarker:s.endMarker})})}return{minX:i,minY:a}}function jn(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 Mn(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(...Mn(n.children));return t}function Nn(e,t,n=!1,r){let i=[],a=[],o=[],s=new Set;for(let e of t.subgraphs)Hn(e,s);Pn(e,t,s,i,o,0,0);let c=Mn(o);Ln(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),dn(i,a,t.direction);let l=new Map(i.map(e=>[e.id,e])),u=An(t,l,a,r),d=Math.max(0,gt.padding-u.minX),f=Math.max(0,gt.padding-u.minY);(d>0||f>0)&&jn(i,a,o,d,f),n&&yn(a,i,o,t.direction);for(let e of a){e.points=Sn(e.points);let t=l.get(e.source),n=l.get(e.target);t&&(e.points=on(e.points,t,!0)),n&&(e.points=on(e.points,n,!1))}let p=(e.width??800)+d,m=(e.height??600)+f,h=mt.width,g=gt.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 Pn(e,t,n,r,i,a,o){if(e.children)for(let s of e.children){let e=(s.x??0)+a,c=(s.y??0)+o,l=s.width??0,u=s.height??0;if(n.has(s.id)){let a=[];Pn(s,t,n,r,a,e,c);let o=Vn(t.subgraphs,s.id);i.push({id:s.id,label:o?.label??``,x:e,y:c,width:l,height:u,children:a,...v(s.id,t),...o?.region?{region:!0}:{},...o?.icon?{icon:o.icon}:{}})}else{let a=t.nodes.get(s.id);if(a){let n=k(s.id,t),i=t.classAssignments.get(s.id);r.push({id:s.id,label:a.label,shape:a.icon===void 0?a.shape:`rectangle`,icon:a.icon,x:e,y:c,width:l,height:u,inlineStyle:n,className:i,interaction:t.interactions.get(s.id)})}s.children&&s.children.length>0&&Pn(s,t,n,r,i,e,c)}}}function Fn(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 In(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 Ln(e,t,n,r,i,a){let o=new Map;Rn(e,o,0,0);let s=new Map;Bn(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??In(o));let f=zn(o,a,c);f!==o&&c++,i.label&&f!==o&&f.length>=2&&(d=In(f)),n.push({source:i.source,target:i.target,label:i.label,style:i.style,hasArrowStart:i.hasArrowStart,hasArrowEnd:i.hasArrowEnd,points:Ht(t).has(e)?[...f].reverse():f,labelPosition:d,inlineStyle:Wn(e,t),headColor:Un(t),id:i.id,animate:i.animate,startMarker:i.startMarker,endMarker:i.endMarker})}}function Rn(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;Rn(i,t,n+e,r+a)}}function zn(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 Bn(e,t,n,r,i){if(e.edges)for(let a of e.edges){let e=Fn(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=Cn(a,l,u),f=wn(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)Bn(a,t,n+(a.x??0),r+(a.y??0),i)}function Vn(e,t){for(let n of e){if(n.id===t)return n;let e=Vn(n.children,t);if(e)return e}}function Hn(e,t){t.add(e.id);for(let n of e.children)Hn(n,t)}function Un(e){return Wn(-1,e)?.stroke}function Wn(e,t){let n,r=t.linkStyles.get(`default`);r&&(n={...r});let i=t.linkStyles.get(e);return i&&(n=n?{...n,...i}:{...i}),n&&l(n)}var Gn=e=>e===`TD`||e===`TB`||e===`BT`,Kn=8;function qn(e,t,n,r){let i=Gn(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)<Kn&&f>e[a]&&d<e[a]+e[s]);if(h){let e=h.s+(u[i]>=h.s?Kn:-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 Jn=12,Yn=8,Xn=4;function Zn(e,t,n){let r=e.map(e=>({axis:e.axis,cross:e.cross,before:e.before??0,rank:0,real:!0})),i=e.map(()=>[]),a=e.map(()=>[]),o=t.flatMap((e,t)=>e.from===e.to?[]:[t]),s=g(o.map(e=>({source:String(t[e].from),target:String(t[e].to)})),e.map((e,t)=>String(t))),c=o.map((e,n)=>{let r=t[e];return s.has(n)?{index:e,u:r.to,v:r.from,reversed:!0}:{index:e,u:r.from,v:r.to,reversed:!1}}),l=e.map(()=>[]),u=e.map(()=>0);for(let e of c)l[e.u].push(e.v),u[e.v]++;let d=u.flatMap((e,t)=>e===0?[t]:[]);for(let e=0;e<d.length;e++){let t=d[e];for(let e of l[t])r[e].rank=Math.max(r[e].rank,r[t].rank+2),--u[e]===0&&d.push(e)}let f=c.map(e=>{let n=(r[e.v].rank-r[e.u].rank)/2,o=r[e.u].rank+2*Math.floor(n/2)+1,s=t[e.index].label,c=[e.u];for(let t=r[e.u].rank+1;t<r[e.v].rank;t++){let e=r.length,n=t===o&&s!==void 0;r.push({axis:n?s.axis:0,cross:n?s.cross:0,before:0,rank:t,real:!1}),i.push([]),a.push([]),c.push(e)}c.push(e.v);for(let e=1;e<c.length;e++)a[c[e-1]].push(c[e]),i[c[e]].push(c[e-1]);return{chain:c,labelRank:o}}),p=r.map((e,t)=>t),m=e=>{let t=e;for(;p[t]!==t;)t=p[t]=p[p[t]];return t};for(let{chain:e}of f)for(let t of e)p[m(t)]=m(e[0]);let h=new Map;r.forEach((e,t)=>{let n=m(t);h.set(n,[...h.get(n)??[],t])});let _=r.map(()=>0),v=[],y=[];for(let e of h.values()){let t=Qn(e,r,i,a,n),o=1/0,s=-1/0;for(let n of e)_[n]=t.get(n),o=Math.min(o,_[n]-r[n].cross/2-r[n].before),s=Math.max(s,_[n]+r[n].cross/2);v.push({min:o,max:s}),y.push(e)}let b=0;y.forEach((e,t)=>{let r=b-v[t].min;for(let t of e)_[t]=_[t]+r;b+=v[t].max-v[t].min+n.nodeSep});let x=Math.max(0,b-n.nodeSep),S=r.reduce((e,t)=>Math.max(e,t.rank),0),C=Array(S+1).fill(0);for(let e of r)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]+n.rankSep/2;let T=e=>w[r[e].rank]+C[r[e].rank]/2,E=t.map(()=>[]),D=t.map(()=>void 0);return c.forEach((e,n)=>{let{chain:i,labelRank:a}=f[n],o=i.slice(1,-1),s=o.map(e=>({axis:T(e),cross:_[e]}));if(E[e.index]=e.reversed?s.reverse():s,t[e.index].label){let t=o.find(e=>r[e].rank===a);D[e.index]={axis:T(t),cross:_[t]}}}),{nodes:e.map((e,t)=>({axis:w[r[t].rank]+(C[r[t].rank]-e.axis)/2,cross:_[t]-e.cross/2})),paths:E,labels:D,axisSize:w[S]+C[S],crossSize:x}}function Qn(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<Yn&&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,Jn)),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)),$n(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<Xn;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 $n(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 er=20,tr=4,nr=32;function rr(e,t={}){let n={...gt,...t,fontSizes:ut(t.fontSizes)},r=e.direction===`TB`||e.direction===`TD`||e.direction===`BT`,i=e.direction===`BT`||e.direction===`RL`,a=new Map,o=new Map,s=(e,t)=>{a.set(e.id,e),t!==void 0&&o.set(e.id,t);for(let t of e.nodeIds)o.has(t)||o.set(t,e.id);for(let t of e.children)s(t,e.id)};e.subgraphs.forEach(e=>s(e));let c=[...e.nodes.keys()].filter(e=>!a.has(e)),l=new Map(c.map((e,t)=>[e,t])),u=e=>Math.min(...e.nodeIds.map(e=>l.get(e)??1/0),...e.children.map(u)),d=e=>{let t=a.get(e);return t?u(t):l.get(e)??1/0},f=t=>[...c.filter(e=>o.get(e)===t),...(t===void 0?e.subgraphs:a.get(t).children).map(e=>e.id)].map((e,t)=>({id:e,i:t})).sort((e,t)=>d(e.id)-d(t.id)||e.i-t.i).map(e=>e.id),p=e=>{let t=[e];for(let n=o.get(e);n!==void 0;n=o.get(n))t.unshift(n);return t},m=t=>{let i=e.edges[t].label;if(!i)return;let a=b(i,n.fontSizes.edgeLabel,P.edgeLabel),o=a.width+8,s=a.height+6;return r?{axis:s,cross:o}:{axis:o,cross:s}},h=new Map,g=new Map;e.edges.forEach((e,t)=>{if(e.source===e.target){g.set(e.source,[...g.get(e.source)??[],t]);return}let n=p(e.source),r=p(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];h.set(a,[...h.get(a)??[],{index:t,from:n[i],to:r[i]}])});let _=r?i?{axisStart:Mt.bottom,axisEnd:Mt.top,crossStart:Mt.left,crossEnd:Mt.right}:{axisStart:Mt.top,axisEnd:Mt.bottom,crossStart:Mt.left,crossEnd:Mt.right}:{axisStart:i?Mt.right:Mt.left,axisEnd:i?Mt.left:Mt.right,crossStart:Mt.top,crossEnd:Mt.bottom},y=(e,t)=>r?{aSize:t,cSize:e}:{aSize:e,cSize:t},x=new Map;for(let t of c){let r=e.nodes.get(t),i=Yt(t,r.label,r.shape,n.fontSizes.nodeLabel,r.icon,e.direction,kt(e));x.set(t,y(i.width,i.height))}let S=e=>(g.get(e)??[]).reduce((e,t)=>{let n=m(t)?.cross;return e+er+(n===void 0?0:n+tr)},0),C=e=>{let t=f(e),i=new Map,o=new Map,s=new Map;for(let e of t){let t=a.get(e);if(!t){o.set(e,x.get(e));continue}let c=C(e);i.set(e,c);let l=b(t.label,n.fontSizes.groupHeader,P.groupHeader).width,u=c.axisSize+_.axisStart+_.axisEnd,d=c.crossSize+_.crossStart+_.crossEnd,f=r?0:l+nr,p=r?l+nr:0,m=Math.max(0,f-u),h=Math.max(0,p-d);u+=m,d+=h,o.set(e,{aSize:u,cSize:d}),s.set(e,{axis:_.axisStart+m/2,cross:_.crossStart+h/2})}let c=new Map(t.map((e,t)=>[e,t])),l=h.get(e??``)??[],u=Zn(t.map(e=>({axis:o.get(e).aSize,cross:o.get(e).cSize,before:S(e)})),l.map(e=>({from:c.get(e.from),to:c.get(e.to),label:m(e.index)})),{nodeSep:n.nodeSpacing,rankSep:n.layerSpacing}),d=new Map;return l.forEach((e,t)=>d.set(e.index,{mids:u.paths[t],label:u.labels[t]})),{members:t,at:new Map(t.map((e,t)=>[e,u.nodes[t]])),sizes:o,inset:{axis:0,cross:0},axisSize:u.axisSize,crossSize:u.crossSize,routes:d,inner:new Map([...i].map(([e,t])=>[e,{...t,inset:s.get(e)}]))}},w=C(void 0),T=new Map,E=new Map,D=(t,n,r)=>{for(let[e,i]of t.routes)E.set(e,{mids:i.mids.map(e=>({axis:e.axis+n,cross:e.cross+r})),label:i.label&&{axis:i.label.axis+n,cross:i.label.cross+r}});let i=[];for(let o of t.members){let s=t.at.get(o),c=t.sizes.get(o),l={axis:n+s.axis,cross:r+s.cross,...c};T.set(o,l);let u=t.inner.get(o);if(u){let t=a.get(o),n=D(u,l.axis+u.inset.axis,l.cross+u.inset.cross);i.push({id:o,label:t.label,x:0,y:0,width:0,height:0,children:n,...v(o,e),...t.region?{region:!0}:{},...t.icon?{icon:t.icon}:{}})}}return i},O=D(w,0,0),A=n.padding,ee=w.axisSize,te=e=>{let t=i?ee-e.axis:e.axis;return r?{x:e.cross+A,y:t+A}:{x:t+A,y:e.cross+A}},ne=e=>{let t=i?ee-e.axis-e.aSize:e.axis;return r?{x:e.cross+A,y:t+A,width:e.cSize,height:e.aSize}:{x:t+A,y:e.cross+A,width:e.aSize,height:e.cSize}},j=e=>{for(let t of e)Object.assign(t,ne(T.get(t.id))),j(t.children)};j(O);let re=c.map(t=>{let n=e.nodes.get(t);return{id:t,label:n.label,shape:n.icon===void 0?n.shape:`rectangle`,icon:n.icon,...ne(T.get(t)),inlineStyle:k(t,e),className:e.classAssignments.get(t),interaction:e.interactions.get(t)}}),ie=new Map(re.map(e=>[e.id,e])),M=[];e.edges.forEach((t,n)=>{let r=E.get(n);if(!r)return;let i=T.get(t.source),a=T.get(t.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=Sn(ir(u.map(te)));o&&d.reverse();let f=ie.get(t.source),p=ie.get(t.target);f&&(d=on(d,f,!0)),p&&(d=on(d,p,!1)),M.push({source:t.source,target:t.target,label:t.label,style:t.style,hasArrowStart:t.hasArrowStart,hasArrowEnd:t.hasArrowEnd,points:d,labelPosition:r.label&&te(r.label),inlineStyle:Wn(n,e),headColor:Un(e),id:t.id,animate:t.animate,startMarker:t.startMarker,endMarker:t.endMarker})}),An(e,ie,M,n.fontSizes.edgeLabel);let ae=(r?w.crossSize:w.axisSize)+A*2,oe=(r?w.axisSize:w.crossSize)+A*2;for(let e of M){for(let t of e.points)ae=Math.max(ae,t.x+mt.width+A),oe=Math.max(oe,t.y+mt.width+A);e.labelPosition&&(ae=Math.max(ae,e.labelPosition.x+60+A),oe=Math.max(oe,e.labelPosition.y+20+A))}return{width:ae,height:oe,nodes:re,edges:M,groups:O}}function ir(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 ar(e,t={}){let n={...gt,...t,fontSizes:ut(t.fontSizes)};return Nn(rt(tn(e,n),t.layoutCache),e,n.mergeEdges,n.fontSizes.edgeLabel)}function or(e,t={}){let n=sr(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 sr(e,t){let n=ce(e);if(t.layout===`simple`&&!kt(n))return rr(n,t);if(t.layout!==void 0&&t.layout!==`elk`&&t.layout!==`simple`)throw Error(`zombie-mermaid: unknown layout ${JSON.stringify(t.layout)}; use 'elk' or 'simple'.`);let r=ar(n,t);if(Ft(n)){let e=t=>t.flatMap(t=>[t,...e(t.children)]);qn(r.edges,r.nodes,e(r.groups),n.direction)}return r}function cr(e,t={}){return tn(e,{...gt,...t,fontSizes:ut(t.fontSizes)})}var lr=2;function ur(e){return e.flatMap(e=>[e,...ur(e.children)])}function dr(e,t){let n=t.groupHeader+16;return ur(e).filter(e=>e.label!==``).map(e=>{let r=b(e.label,t.groupHeader,400);return{x:e.x+e.width/2-r.width/2-lr,y:e.y+(e.bandless?n:26)/2-r.height/2-lr,width:r.width+4,height:r.height+4}})}function fr(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 pr(e){return{x:e.x+lr,y:e.y+lr,width:e.width-4,height:e.height-4}}function mr(e,t){let n=e.points,r=t.map(pr);for(let e=0;e+1<n.length;e++)if(r.some(t=>fr(n[e],n[e+1],t)))return!0;return!1}function hr(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 gr(e,t,n){let r=`zm-title-gap-${hr(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
|
|
10
|
-
`)}function
|
|
11
|
-
`)}function
|
|
12
|
-
</marker>`;return s(
|
|
13
|
-
`+s(
|
|
14
|
-
</marker>`;return n(
|
|
15
|
-
`+n(
|
|
16
|
-
`)}if(e.architecture){let r=e.icon&&(
|
|
17
|
-
`)}i.push(
|
|
18
|
-
`)}i.push(
|
|
19
|
-
`)}function
|
|
20
|
-
`)}\n`+`</g>`}function
|
|
21
|
-
`)}var
|
|
22
|
-
`)}function
|
|
23
|
-
`)}function
|
|
24
|
-
`).length,o=e.icon===void 0?e.y+e.height/2:e.y+e.height+zr+(a-1)/2*r.nodeLabel*t,s=u(e.inlineStyle?.color??`var(--_text)`),c=m`text-anchor="middle" font-size="${r.nodeLabel}" font-weight="${P.nodeLabel}" fill="${s}"`,l=e.inlineStyle?.[`font-family`];return l&&(c+=m` style="font-family: ${u(l)};"`),D(e.label,i,o,r.nodeLabel,c)}function Pi(e){return u(e).replace(/\r/g,` `).replace(/\n/g,` `).replace(/\t/g,`	`)}function Fi(e,t){return t===void 0?e:e.replace(`<svg `,m`<svg data-src="${Pi(t)}" `)}var Ii=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=Ui(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 Li(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 Ri(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 zi=`(?<![\\w-])(var|color-mix)\\(`;function Bi(e,t){let[n,...r]=Ri(e),i=(n??``).trim(),a=t.lookup(i);return a===void 0?r.length>0?r.join(`,`).trim():null:a}function Vi(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 Hi(e){let t=Ri(e);if(t.length!==3)return null;let[n,r,i]=t;if(n===void 0||r===void 0||i===void 0||!/^\s*in\s+srgb\s*$/i.test(n))return null;let a=Vi(r),o=Vi(i);if(!a||!o)return null;let s=E(a.color),c=E(o.color);if(!s||!c)return null;let l=S(s,c,a.pct,o.pct);return l?_(l):null}function Ui(e,t){let n=``,r=0,i=new RegExp(zi,`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=Li(e,c);if(l===-1)break;let u=Ui(e.slice(c+1,l),t),d=o===`var`?Bi(u,t):Hi(u);n+=e.slice(r,s),n+=d??`${o}(${u})`,r=l+1,i.lastIndex=r}return n+e.slice(r)}function Wi(e,t){let n=new Ii;for(let[e,r]of Object.entries(t))n.declare(e,r);return Ui(e,n)}var Gi=/(--[\w-]+)\s*:\s*([^;{}]+)/g,Ki=/(\s)([\w:.-]+)(=)("[^"]*"|'[^']*')/g,qi=new Set([`data-src`]);function Ji(e,t){Gi.lastIndex=0;let n;for(;(n=Gi.exec(e))!==null;){let[,e,r]=n;e!==void 0&&r!==void 0&&t.declare(e,r.trim())}}function Yi(e,t){return e.replace(Ki,(e,n,r,i,a)=>{if(qi.has(r))return e;let o=a[0]??`"`;return`${n}${r}${i}${o}${Ui(a.slice(1,-1),t)}${o}`})}function Xi(e,t){let n=new Ii;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&&Ji(e,n)}for(let t of e.matchAll(/\sstyle=("[^"]*"|'[^']*')/g)){let e=t[1];e!==void 0&&Ji(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+=Ui(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:Yi(s,n),i=a+1}return r+e.slice(i)}var Zi=[.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],Qi=[.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 $i(e){return e>=4352?1:.6}function ea(e,t){let n=t?Qi:Zi,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:$i(e)}return i*16}var L={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 ta(e){return`note ${e}`}function na(e){return`${e} link`}function ra(e){return`namespace ${e}`}function ia(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:ra(i),name:a.name,classIds:e})}return r}function aa(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 oa(e){return g(e.relationships.map(e=>({source:e.from,target:e.to})),e.classes.map(e=>e.id))}function sa(e,t,n){let r=new Map,i=new Map,a=ut(t.fontSizes),o=e.layout?.padding??L.mermaidPad,s=o-L.mermaidPad;for(let t of e.classes){if(n.has(t.id)){r.set(t.id,{width:N(t.label,a.nodeLabel,P.edgeLabel)+L.lollipopLabelPadX*2,height:L.lollipopLabelHeight,headerHeight:L.lollipopLabelHeight,attrHeight:0,methodHeight:0});continue}let i=Math.max(0,(t.annotation?L.headerBaseHeight+L.annotationHeight:L.headerBaseHeight)+s*2),c=t.attributes.length+t.methods.length===0,l=c&&e.layout?.hideEmptyMembersBox===!0?0:Math.max(0,(c?L.emptyBareSectionHeight:L.emptySectionHeight)+s*2),u=t.attributes.length>0?t.attributes.length*L.memberRowHeight+Math.max(0,L.sectionPadY+s*2):l,d=t.methods.length>0?t.methods.length*L.memberRowHeight+Math.max(0,L.sectionPadY+s*2):l,f=N(t.label,a.nodeLabel,P.nodeLabel),p=pa(t.attributes),m=pa(t.methods),h=Math.max(fa(t,o),f+L.boxPadX*2,p+L.boxPadX*2,m+L.boxPadX*2),g=i+u+d;r.set(t.id,{width:h,height:g,headerHeight:i,attrHeight:u,methodHeight:d})}let c=ia(e),l=new Map;for(let e of c)for(let t of e.classIds)l.set(t,e.id);let u=new Map,d=[];for(let e of c){let t=N(e.name,L.namespaceTitleFontSize,P.groupHeader)+L.namespacePad*2,n={id:e.id,children:[],layoutOptions:{"elk.padding":xt({top:L.namespaceTitleHeight+L.namespacePad/2,left:L.namespacePad,bottom:L.namespacePad,right:L.namespacePad}),"elk.nodeSize.constraints":`MINIMUM_SIZE`,"elk.nodeSize.minimum":`(${Math.ceil(t)}, 0)`}};u.set(e.id,n),d.push(n)}for(let[e,t]of r){let n=Ct(e,t),r=u.get(l.get(e)??``);r?.children?r.children.push(n):d.push(n)}let f={fontSize:a.edgeLabel},p=oa(e),m=[];for(let[t,n]of e.relationships.entries()){let e=p.has(t);m.push(Et({id:`e${t}`,source:e?n.to:n.from,target:e?n.from:n.to,label:n.label,labelStyle:f}))}let h=new Set(r.keys());for(let[t,n]of e.notes.entries()){let e=ta(t),r=b(n.text,a.edgeLabel,P.edgeLabel),o={width:r.width+L.notePadX*2,height:r.height+L.notePadY*2};i.set(e,o),d.push(Ct(e,o)),n.forClass!==void 0&&h.has(n.forClass)&&m.push(Et({id:na(e),source:e,target:n.forClass,labelStyle:f}))}return{elkGraph:{id:`root`,layoutOptions:{...St({direction:bt(e.direction,yt.class),nodeSpacing:L.nodeSpacing,layerSpacing:L.layerSpacing,padding:L.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:d,edges:m},classSizes:r,noteSizes:i,namespaces:c}}function ca(e,t,n,r,i,a){let o=new Map;for(let e of t.classes)o.set(e.id,e);let s=new Set(i.map(e=>e.id)),c=new Map,l=[];for(let t of e.children??[])if(s.has(t.id)){let e=t.x??0,n=t.y??0;c.set(t.id,{x:e,y:n});for(let r of t.children??[])l.push({...r,x:(r.x??0)+e,y:(r.y??0)+n})}else l.push(t);let u=e=>{let t=e.container;return t&&c.get(t)||{x:0,y:0}},d=[];for(let t of i){let n=(e.children??[]).find(e=>e.id===t.id);n&&d.push({name:t.name,classIds:t.classIds.filter(e=>!a.labels.has(e)),x:n.x??0,y:n.y??0,width:n.width??0,height:n.height??0})}let f=[];for(let e of l){let r=o.get(e.id);if(r){let i=n.get(r.id);if(!i)throw Error(`Missing computed size for class "${r.id}"`);f.push({id:r.id,label:r.label,annotation:r.annotation,attributes:r.attributes,methods:r.methods,x:e.x??0,y:e.y??0,width:e.width??i.width,height:e.height??i.height,headerHeight:i.headerHeight,attrHeight:i.attrHeight,methodHeight:i.methodHeight,interaction:t.interactions.get(r.id),inlineStyle:k(r.id,t),className:t.classAssignments.get(r.id)})}}let p=[],m=oa(a.diagram),h=new Map;for(let e of l)h.set(e.id,e);let g=new Map;for(let[e,t]of a.labels){let n=h.get(e);g.set(e,{text:t,x:n?.x??0,y:n?.y??0,width:n?.width??0,height:n?.height??0})}let _=e.edges??[];for(let[e,n]of t.relationships.entries()){let t=_[e];if(!t)throw Error(`Missing ELK edge for relationship ${e}`);let r=u(t),i=Cn(t,r.x,r.y),o=m.has(e)?i.reverse():i,s=wn(t,r.x,r.y),c=g.get(a.byRelationship.get(e)??``);p.push({from:n.from,to:n.to,type:n.type,markerAt:n.markerAt,...n.dashed?{dashed:!0}:{},label:n.label,fromCardinality:n.fromCardinality,toCardinality:n.toCardinality,points:o,labelPosition:s,...c?{interfaceLabel:c}:{}})}let v=new Map;for(let e of _.slice(t.relationships.length))v.set(e.id,e);let y=[];for(let[e,n]of t.notes.entries()){let t=ta(e),i=h.get(t),a=r.get(t);if(!i||!a)throw Error(`Missing layout for note ${e}`);let o=v.get(na(t));y.push({id:t,text:n.text,...o&&n.forClass!==void 0?{forClass:n.forClass}:{},x:i.x??0,y:i.y??0,width:i.width??a.width,height:i.height??a.height,...o?{linkPoints:Cn(o,u(o).x,u(o).y)}:{}})}return{width:e.width??600,height:e.height??400,classes:f,relationships:p,notes:y,namespaces:d}}function la(e,t={}){if(e.classes.length===0&&e.notes.length===0)return{width:0,height:0,classes:[],relationships:[],notes:[],namespaces:[]};let n=aa(e),{elkGraph:r,classSizes:i,noteSizes:a,namespaces:o}=sa(n.diagram,t,n.labels);return ca(rt(r,t.layoutCache),e,i,a,o,n)}function ua(e){return e.length*Math.ceil(ot(`M`,L.memberFontSize))}function da(e){let t=e.isMethod?`${e.name}(${e.params||``})`:e.name;return`${e.visibility||``}${e.visibilitySpace?` `:``}${t}${e.isMethod&&e.type?` : ${e.type}`:``}`}function fa(e,t=L.mermaidPad){let n=ea(e.label,!0),r=e.annotation?ea(`\u00ab${e.annotation}\u00bb`,!1):0,i=Math.max(0,...[...e.attributes,...e.methods].map(e=>ea(da(e),!1))),a=Math.max(n,r);return a/2+Math.max(a/2,i)+t*2}function pa(e){if(e.length===0)return 0;let t=0;for(let n of e){let e=ua(me(n));e>t&&(t=e)}return t}var ma={memberSize:11,memberWeight:400,annotationSize:10,annotationWeight:500};function ha(e,t,n=`Inter`,r=!1,i=lt,a,o,s,c=!0,l={}){let u=[],d=c&&e.classes.some(e=>!!A(e.interaction?.href));u.push(Fi(M(e.width,e.height,t,r,o,s,d,l.styleAttribute,l.description),a)),u.push(ht(n,!0,l.nonce,l.bodyFont)),u.push(`<defs>`),u.push(_a(e.relationships.some(e=>e.type===`lollipop`))),u.push(`</defs>`);for(let t of e.namespaces)u.push(ga(t));for(let t of e.relationships)u.push(wa(t));for(let t of e.notes)u.push(Ca(t));for(let t of e.classes)u.push(va(t,i,c));for(let t of e.relationships){let e=Ta(t,i);e&&u.push(e)}for(let t of e.notes)u.push(Sa(t,i));for(let t of e.relationships)u.push(Oa(t,i));return u.push(`</svg>`),u.join(`
|
|
25
|
-
`)}function
|
|
26
|
-
`)}function
|
|
8
|
+
}`;function I(e,t,n){return M(e,t,n)}function Tt(e,t){return e.length*t*.6}var Et=`'JetBrains Mono'`,Dt=`${Et}, 'SF Mono', 'Fira Code', ui-monospace, monospace`,Ot={nodeLabel:13,edgeLabel:11,groupHeader:12};function kt(e){return{nodeLabel:e?.nodeLabel??Ot.nodeLabel,edgeLabel:e?.edgeLabel??Ot.edgeLabel,groupHeader:e?.groupHeader??Ot.groupHeader}}var L={nodeLabel:500,edgeLabel:400,groupHeader:600},At=12,jt=12,Mt={horizontal:20,vertical:10,diamondExtra:24},R={outerBox:1,innerBox:.75,connector:1},Nt=`0.35em`,Pt={width:8,height:5};function Ft(e,t,n,r){return o(e,t?{family:Ct,faceCss:wt}:!1,n,r)}var It={font:`Inter`,padding:40,nodeSpacing:28,layerSpacing:48,mergeEdges:!1,thoroughness:3,fontSizes:Ot},Lt=`#087ebf`,Rt={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>`},zt={flowchart:`DOWN`,state:`DOWN`,class:`DOWN`,er:`DOWN`,requirement:`DOWN`,c4:`DOWN`};function Bt(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 Vt(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 Ht(e){return{"elk.algorithm":`layered`,"elk.direction":e.direction,"elk.spacing.nodeNode":String(e.nodeSpacing),"elk.layered.spacing.nodeNodeBetweenLayers":String(e.layerSpacing),"elk.padding":Vt(e.padding),"elk.edgeRouting":`ORTHOGONAL`}}function Ut(e,t,n){let r={id:e,width:t.width,height:t.height};return n!==void 0&&(r.labels=[{text:n}]),r}var Wt={"elk.edgeLabels.inline":`true`,"elk.edgeLabels.placement":`CENTER`};function Gt(e,t){let n=j(e,t.fontSize,L.edgeLabel),r={text:e,width:n.width+8,height:n.height+6};return t.layoutOptions&&(r.layoutOptions={...t.layoutOptions}),r}function Kt(e){let t={id:e.id,sources:[e.source],targets:[e.target]};return e.label&&(t.labels=[Gt(e.label,e.labelStyle)]),t}var qt={"state-start":`FIRST`},Jt={"elk.layered.cycleBreaking.strategy":`MODEL_ORDER`,"elk.layered.compaction.postCompaction.strategy":`NONE`};function Yt(e){for(let t of e.nodes.values())if(t.shape===`state-start`||t.shape===`state-end`)return!0;return!1}var Xt={top:51,left:24,bottom:24,right:24},Zt={top:51,left:24,bottom:24,right:24},Qt={top:44,left:16,bottom:16,right:16},$t={top:16,left:16,bottom:16,right:16};function en(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 tn=new WeakSet;function nn(e){tn.add(e)}function rn(e){return!Yt(e)&&(e.subgraphs.length>0||!tn.has(e))}function an(e,t,n){if(!(!rn(e)||t.nodeSpacing!==It.nodeSpacing||t.layerSpacing!==It.layerSpacing))return n===`root`?{"spacing.baseValue":`40`}:{"spacing.baseValue":`24`,"elk.spacing.nodeNode":`50`,"elk.layered.spacing.edgeNodeBetweenLayers":`30`,"elk.spacing.edgeEdge":`20`}}var on=[`elk.spacing.nodeNode`,`elk.layered.spacing.nodeNodeBetweenLayers`,`elk.spacing.edgeEdge`,`elk.layered.spacing.edgeEdgeBetweenLayers`,`elk.layered.spacing.edgeNodeBetweenLayers`,`elk.contentAlignment`];function sn(e,t){if(!t)return e;let n={...e};for(let e of on)delete n[e];return{...n,...t}}function cn(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 ln=`[top=12,left=12,bottom=12,right=12]`,un=new WeakMap;function dn(e){let t=un.get(e);return t||(t=Sn(e.subgraphs)?new Set:rn(e)?pe(e):D(e,void 0,pe(e)),un.set(e,t)),t}function fn(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 pn(e){return Bt(e,zt.flowchart)}function mn(e){return{...Ht(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 hn(e){return{fontSize:e.fontSizes.edgeLabel,layoutOptions:Wt}}var gn=136,_n=120,vn={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},yn=40;function bn(e,t,n,r,i,a,o=!1,s=!1){if(i!==void 0)return{width:80,height:80};let c=j(t,r,L.nodeLabel),l=!o&&!s;l&&(c.height=c.lines.length*r*1.5);let u=c.width+Mt.horizontal*2,d=c.height+(l?24:Mt.vertical*2);if(n===`diamond`){let e=Math.max(u,d)+Mt.diamondExtra;u=e,d=e}if(n===`circle`||n===`doublecircle`){let e=Math.ceil(Math.sqrt(u*u+d*d))+8;u=n===`doublecircle`?e+12:e,d=u}if(n===`hexagon`&&(u+=Mt.horizontal),(n===`trapezoid`||n===`trapezoid-alt`||n===`parallelogram`||n===`parallelogram-alt`)&&(u+=Mt.horizontal),n===`asymmetric`&&(u+=12),n===`cylinder`&&(d+=14),n===`cloud`){let e=o||s?Math.max(u,d*2.5):Math.max(c.width,_n)+15;return{width:e*1.25,height:d+e*.48}}if(n===`small-circle`)return{width:14,height:14};if(n===`fork-bar`)return a===`LR`||a===`RL`?{width:10,height:70}:{width:70,height:10};if(n===`state-start`||n===`state-end`)return{width:14,height:14};if(n===`junction`)return{width:2,height:2};if(t===``&&n===`diamond`)return{width:28,height:28};if(t===``&&n===`fork-join`)return{width:70,height:10};if(!o&&!s){let e=Math.max(c.width,_n),t=vn[n];t===void 0?n===`tagged-rectangle`?u=e+32+.2*d:(n===`diamond`||n===`triangle`||n===`flipped-triangle`)&&(u=e+c.height+30,d=u):u=e+t}return u=Math.max(u,o?gn:60),d=Math.max(d,o?yn:36),{width:u,height:d}}var xn=` root`;function Sn(e){for(let t of e)if(t.direction!==void 0||Sn(t.children))return!0;return!1}function Cn(e,t){for(let n of e.nodeIds)t.add(n);for(let n of e.children)Cn(n,t)}function wn(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 Tn(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;return n}function En(e,t){let n=t,r=new Set,i=new Set;for(let t of e.subgraphs)i.add(t.id),On(t,r,i);let a=kn(e.subgraphs),o=wn(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=Sn(e.subgraphs),d=[],f=[],p={...sn(mn({direction:pn(e.direction),nodeSpacing:n.nodeSpacing,layerSpacing:Yt(e)&&n.layerSpacing===It.layerSpacing?40:n.layerSpacing,padding:n.padding}),an(e,n,`root`)),...rn(e)?{}:{"elk.layered.thoroughness":String(It.thoroughness)},"elk.layered.highDegreeNodes.treatment":`false`,"elk.layered.compaction.postCompaction.strategy":e.subgraphs.length===0||en(e)||rn(e)?`NONE`:`LEFT_RIGHT_CONSTRAINT_LOCKING`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,...rn(e)?{"elk.layered.cycleBreaking.strategy":`DEPTH_FIRST`}:{},...en(e)&&(rn(e)&&e.subgraphs.length>0||Yt(e)||n.legacyNodeSizes)?{"elk.spacing.edgeEdge":rn(e)?n.legacyNodeSizes?`50`:`70`:`40`}:{},...Yt(e)?Jt:{},"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=Tn(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]:xn,Kt({id:`e${e}`,source:o,target:s,label:t.label,labelStyle:hn(n)}))}for(let[t,a]of e.nodes)if(!r.has(t)&&!i.has(t)){let r=Ut(t,bn(t,a.label,a.shape,n.fontSizes.nodeLabel,a.icon,e.direction,Yt(e),n.legacyNodeSizes),a.label),i=Yt(e)?qt[a.shape]:void 0;i!==void 0&&(r.layoutOptions={"elk.layered.layering.layerConstraint":i}),d.push(r)}let v=Yt(e),y=d.length,b=v?e.subgraphs:[...e.subgraphs].reverse();for(let t of b)d.push(Dn(t,e,n,c,m,h,e.direction));if(rn(e)&&d.unshift(...d.splice(y)),v&&e.subgraphs.length>0){let t=d.map((t,n)=>{if(n<y)return fn(e,new Set([t.id]));let r=e.subgraphs[n-y],i=fn(e,new Set([r.id]));if(i!==1/0)return i;let a=new Set;return Cn(r,a),fn(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=dn(e),S=rn(e)&&!u,C=c.get(null);if(S)for(let t of cn(e)){let r=e.edges[t];f.push(Kt({id:`e${t}`,source:x.has(t)?r.target:r.source,target:x.has(t)?r.source:r.target,label:r.label,labelStyle:hn(n)}))}for(let{index:e,edge:t}of S?[]:C)t.source!==t.target&&f.push(Kt({id:`e${e}`,source:x.has(e)?t.target:t.source,target:x.has(e)?t.source:t.target,label:t.label,labelStyle:hn(n)}));if(u)for(let e of h.get(xn)??[])f.push(e);else for(let{index:e,edge:t}of S?[]:l)f.push(Kt({id:`e${e}`,source:x.has(e)?t.target:t.source,target:x.has(e)?t.source:t.target,label:t.label,labelStyle:hn(n)}));return{id:`root`,layoutOptions:p,children:d,edges:f}}function Dn(e,t,n,r,i,a,o){let s=e.direction!==void 0&&fe(e,t)?e.direction:o,c=sn(mn({direction:pn(s),nodeSpacing:n.nodeSpacing,layerSpacing:Yt(t)&&n.layerSpacing===It.layerSpacing?24:n.layerSpacing,padding:e.region?$t:Yt(t)?Xt:rn(t)?Zt:Qt}),an(t,n,`subgraph`));if(rn(t)&&!e.region){let t=j(e.label,n.fontSizes.groupHeader,L.groupHeader).width+24;c[`elk.nodeSize.constraints`]=`[MINIMUM_SIZE]`,c[`elk.nodeSize.minimum`]=s===`TD`||s===`TB`||s===`BT`?`(0, ${t})`:`(${t}, 0)`}e.children.some(e=>e.region)&&(c[`elk.algorithm`]=`org.eclipse.elk.rectpacking`),rn(t)&&(c[`elk.layered.cycleBreaking.strategy`]=`DEPTH_FIRST`,c[`elk.spacing.portsSurrounding`]=ln);let l,u=i.get(e.id);u&&u.size>0&&(l=[...u].map(e=>({id:e})));let d=[],f=rn(t),p=f?[...t.nodes.keys()].filter(t=>e.nodeIds.includes(t)):e.nodeIds;for(let e of p){let r=t.nodes.get(e);if(r){let i=Ut(e,bn(e,r.label,r.shape,n.fontSizes.nodeLabel,r.icon,t.direction,Yt(t),n.legacyNodeSizes),r.label);d.push(i)}}let m=e.children.some(e=>e.region)?e.children:[...e.children].reverse(),h=d.length;for(let e of m)d.push(Dn(e,t,n,r,i,a,s));f&&d.unshift(...d.splice(h));let g=[],_=r.get(e.id)??[],v=dn(t);for(let{index:e,edge:r}of rn(t)&&!Sn(t.subgraphs)?[]:_)r.source!==r.target&&g.push(Kt({id:`e${e}`,source:v.has(e)?r.target:r.source,target:v.has(e)?r.source:r.target,label:r.label,labelStyle:hn(n)}));for(let t of a.get(e.id)??[])g.push(t);return{id:e.id,layoutOptions:c,labels:e.label?[{text:e.label}]:void 0,ports:l,children:d,edges:g}}function On(e,t,n){for(let n of e.nodeIds)t.add(n);for(let r of e.children)n.add(r.id),On(r,t,n)}function kn(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 An(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]=jn(e[0],e[1],t);else{let n=e.length-1;r[n]=jn(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 jn(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?Nn(t,c,a)??a:Nn(t,a,o)??a:t<=r?Nn(t,s,c)??s:Nn(t,o,s)??s}{let t=e.y;return l>0?t<=i?Mn(t,a,c)??c:Mn(t,c,s)??c:t<=i?Mn(t,a,o)??o:Mn(t,o,s)??o}}function Mn(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 Nn(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 Pn=12;function Fn(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=It.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&&In(t,l,r?`x`:`y`)}function In(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,Pn-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 Ln=.5;function Rn(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+Ln,r=e.x+e.width-Ln,i=e.y+Ln,a=e.y+e.height-Ln;if(!(t>=r||i>=a)&&o<r&&s>t&&c<a&&l>i)return!1}}return!0}function zn(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(...zn(e,t,i.children)));return r}function Bn(e,t,n,r,i){let a=i===`LR`,o=i===`RL`,s=i===`BT`,c=a||o,l=new Set(zn(t,n,r).map(e=>e.id)),u=zn(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 Vn=2;function Hn(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)<=Vn)return!0}return!1}function Un(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(Hn(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=Bn(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}];Rn(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(Hn(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=Bn(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}];Rn(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(Hn(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=Bn(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}];Rn(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(Hn(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=Bn(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}];Rn(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 Wn=1.5,Gn=.01;function Kn(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)<Gn&&Math.abs(i.x-a.x)<Gn&&Math.abs(r.y-i.y)<Gn&&Math.abs(r.x-i.x)<=Wn&&Math.abs(r.x-i.x)>=Gn,s=Math.abs(e.y-r.y)<Gn&&Math.abs(i.y-a.y)<Gn&&Math.abs(r.x-i.x)<Gn&&Math.abs(r.y-i.y)<=Wn&&Math.abs(r.y-i.y)>=Gn;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 qn(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 Jn(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 Yn=20,Xn=4,Zn=24,Qn={width:8,height:6};function $n(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-Zn,8)/(2*a+1),u=0;return n.map((t,n)=>{u+=Yn;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-Xn-e/2,s),_=a-Xn-e,u+=e+Xn}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 er(e,t,n,r=Ot.edgeLabel){let i=1/0,a=1/0,o=new Map;e.edges.forEach((e,n)=>{e.source!==e.target||!t.has(e.source)||o.set(e.source,[...o.get(e.source)??[],n])});for(let[s,c]of o){let o=$n(t.get(s),e.direction,c.map(t=>{let n=e.edges[t].label;if(!n)return;let i=j(n,r,L.edgeLabel);return{width:i.width+Qn.width,height:i.height+Qn.height}}));c.forEach((t,r)=>{let s=e.edges[t],{points:c,labelPosition:l,...u}=o[r];i=Math.min(i,u.minX),a=Math.min(a,u.minY),n.push({source:s.source,target:s.target,label:s.label,style:s.style,hasArrowStart:s.hasArrowStart,hasArrowEnd:s.hasArrowEnd,points:c,labelPosition:s.label?l:void 0,inlineStyle:mr(t,e),headColor:pr(e),id:s.id,animate:s.animate,startMarker:s.startMarker,endMarker:s.endMarker})})}return{minX:i,minY:a}}function tr(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 nr(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(...nr(n.children));return t}function rr(e,t,n=!1,r){let i=[],a=[],o=[],s=new Set;for(let e of t.subgraphs)fr(e,s);ir(e,t,s,i,o,0,0);let c=nr(o);sr(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),Fn(i,a,t.direction);let l=new Map(i.map(e=>[e.id,e])),u=er(t,l,a,r),d=Math.max(0,It.padding-u.minX),f=Math.max(0,It.padding-u.minY);(d>0||f>0)&&tr(i,a,o,d,f),n&&Un(a,i,o,t.direction);for(let e of a){e.points=Kn(e.points);let t=l.get(e.source),n=l.get(e.target);t&&(e.points=An(e.points,t,!0)),n&&(e.points=An(e.points,n,!1))}let p=(e.width??800)+d,m=(e.height??600)+f,h=Pt.width,g=It.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 ir(e,t,n,r,i,a,o){if(e.children)for(let s of e.children){let e=(s.x??0)+a,c=(s.y??0)+o,l=s.width??0,u=s.height??0;if(n.has(s.id)){let a=[];ir(s,t,n,r,a,e,c);let o=dr(t.subgraphs,s.id);i.push({id:s.id,label:o?.label??``,x:e,y:c,width:l,height:u,children:a,...A(s.id,t),...o?.region?{region:!0}:{},...o?.icon?{icon:o.icon}:{}})}else{let a=t.nodes.get(s.id);if(a){let n=oe(s.id,t),i=t.classAssignments.get(s.id);r.push({id:s.id,label:a.label,shape:a.icon===void 0?a.shape:`rectangle`,icon:a.icon,x:e,y:c,width:l,height:u,inlineStyle:n,className:i,interaction:t.interactions.get(s.id)})}s.children&&s.children.length>0&&ir(s,t,n,r,i,e,c)}}}function ar(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 or(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 sr(e,t,n,r,i,a){let o=new Map;cr(e,o,0,0);let s=new Map;ur(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??or(o));let f=lr(o,a,c);f!==o&&c++,i.label&&f!==o&&f.length>=2&&(d=or(f)),n.push({source:i.source,target:i.target,label:i.label,style:i.style,hasArrowStart:i.hasArrowStart,hasArrowEnd:i.hasArrowEnd,points:dn(t).has(e)?[...f].reverse():f,labelPosition:d,inlineStyle:mr(e,t),headColor:pr(t),id:i.id,animate:i.animate,startMarker:i.startMarker,endMarker:i.endMarker})}}function cr(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;cr(i,t,n+e,r+a)}}function lr(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 ur(e,t,n,r,i){if(e.edges)for(let a of e.edges){let e=ar(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=qn(a,l,u),f=Jn(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)ur(a,t,n+(a.x??0),r+(a.y??0),i)}function dr(e,t){for(let n of e){if(n.id===t)return n;let e=dr(n.children,t);if(e)return e}}function fr(e,t){t.add(e.id);for(let n of e.children)fr(n,t)}function pr(e){return mr(-1,e)?.stroke}function mr(e,t){let n,r=t.linkStyles.get(`default`);r&&(n={...r});let i=t.linkStyles.get(e);return i&&(n=n?{...n,...i}:{...i}),n&&x(n)}var hr=e=>e===`TD`||e===`TB`||e===`BT`,gr=8;function _r(e,t,n,r){let i=hr(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)<gr&&f>e[a]&&d<e[a]+e[s]);if(h){let e=h.s+(u[i]>=h.s?gr:-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 vr=12,yr=8,br=4;function xr(e,t,n){let r=e.map(e=>({axis:e.axis,cross:e.cross,before:e.before??0,rank:0,real:!0})),i=e.map(()=>[]),a=e.map(()=>[]),o=t.flatMap((e,t)=>e.from===e.to?[]:[t]),s=O(o.map(e=>({source:String(t[e].from),target:String(t[e].to)})),e.map((e,t)=>String(t))),c=o.map((e,n)=>{let r=t[e];return s.has(n)?{index:e,u:r.to,v:r.from,reversed:!0}:{index:e,u:r.from,v:r.to,reversed:!1}}),l=e.map(()=>[]),u=e.map(()=>0);for(let e of c)l[e.u].push(e.v),u[e.v]++;let d=u.flatMap((e,t)=>e===0?[t]:[]);for(let e=0;e<d.length;e++){let t=d[e];for(let e of l[t])r[e].rank=Math.max(r[e].rank,r[t].rank+2),--u[e]===0&&d.push(e)}let f=c.map(e=>{let n=(r[e.v].rank-r[e.u].rank)/2,o=r[e.u].rank+2*Math.floor(n/2)+1,s=t[e.index].label,c=[e.u];for(let t=r[e.u].rank+1;t<r[e.v].rank;t++){let e=r.length,n=t===o&&s!==void 0;r.push({axis:n?s.axis:0,cross:n?s.cross:0,before:0,rank:t,real:!1}),i.push([]),a.push([]),c.push(e)}c.push(e.v);for(let e=1;e<c.length;e++)a[c[e-1]].push(c[e]),i[c[e]].push(c[e-1]);return{chain:c,labelRank:o}}),p=r.map((e,t)=>t),m=e=>{let t=e;for(;p[t]!==t;)t=p[t]=p[p[t]];return t};for(let{chain:e}of f)for(let t of e)p[m(t)]=m(e[0]);let h=new Map;r.forEach((e,t)=>{let n=m(t);h.set(n,[...h.get(n)??[],t])});let g=r.map(()=>0),_=[],v=[];for(let e of h.values()){let t=Sr(e,r,i,a,n),o=1/0,s=-1/0;for(let n of e)g[n]=t.get(n),o=Math.min(o,g[n]-r[n].cross/2-r[n].before),s=Math.max(s,g[n]+r[n].cross/2);_.push({min:o,max:s}),v.push(e)}let y=0;v.forEach((e,t)=>{let r=y-_[t].min;for(let t of e)g[t]=g[t]+r;y+=_[t].max-_[t].min+n.nodeSep});let b=Math.max(0,y-n.nodeSep),x=r.reduce((e,t)=>Math.max(e,t.rank),0),S=Array(x+1).fill(0);for(let e of r)S[e.rank]=Math.max(S[e.rank],e.axis);let C=Array(x+1).fill(0);for(let e=1;e<=x;e++)C[e]=C[e-1]+S[e-1]+n.rankSep/2;let w=e=>C[r[e].rank]+S[r[e].rank]/2,T=t.map(()=>[]),E=t.map(()=>void 0);return c.forEach((e,n)=>{let{chain:i,labelRank:a}=f[n],o=i.slice(1,-1),s=o.map(e=>({axis:w(e),cross:g[e]}));if(T[e.index]=e.reversed?s.reverse():s,t[e.index].label){let t=o.find(e=>r[e].rank===a);E[e.index]={axis:w(t),cross:g[t]}}}),{nodes:e.map((e,t)=>({axis:C[r[t].rank]+(S[r[t].rank]-e.axis)/2,cross:g[t]-e.cross/2})),paths:T,labels:E,axisSize:C[x]+S[x],crossSize:b}}function Sr(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<yr&&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,vr)),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)),Cr(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<br;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 Cr(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 wr=20,Tr=4,Er=32;function Dr(e,t={}){let n={...It,...t,fontSizes:kt(t.fontSizes)},r=e.direction===`TB`||e.direction===`TD`||e.direction===`BT`,i=e.direction===`BT`||e.direction===`RL`,a=new Map,o=new Map,s=(e,t)=>{a.set(e.id,e),t!==void 0&&o.set(e.id,t);for(let t of e.nodeIds)o.has(t)||o.set(t,e.id);for(let t of e.children)s(t,e.id)};e.subgraphs.forEach(e=>s(e));let c=[...e.nodes.keys()].filter(e=>!a.has(e)),l=new Map(c.map((e,t)=>[e,t])),u=e=>Math.min(...e.nodeIds.map(e=>l.get(e)??1/0),...e.children.map(u)),d=e=>{let t=a.get(e);return t?u(t):l.get(e)??1/0},f=t=>[...c.filter(e=>o.get(e)===t),...(t===void 0?e.subgraphs:a.get(t).children).map(e=>e.id)].map((e,t)=>({id:e,i:t})).sort((e,t)=>d(e.id)-d(t.id)||e.i-t.i).map(e=>e.id),p=e=>{let t=[e];for(let n=o.get(e);n!==void 0;n=o.get(n))t.unshift(n);return t},m=t=>{let i=e.edges[t].label;if(!i)return;let a=j(i,n.fontSizes.edgeLabel,L.edgeLabel),o=a.width+8,s=a.height+6;return r?{axis:s,cross:o}:{axis:o,cross:s}},h=new Map,g=new Map;e.edges.forEach((e,t)=>{if(e.source===e.target){g.set(e.source,[...g.get(e.source)??[],t]);return}let n=p(e.source),r=p(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];h.set(a,[...h.get(a)??[],{index:t,from:n[i],to:r[i]}])});let _=r?i?{axisStart:Qt.bottom,axisEnd:Qt.top,crossStart:Qt.left,crossEnd:Qt.right}:{axisStart:Qt.top,axisEnd:Qt.bottom,crossStart:Qt.left,crossEnd:Qt.right}:{axisStart:i?Qt.right:Qt.left,axisEnd:i?Qt.left:Qt.right,crossStart:Qt.top,crossEnd:Qt.bottom},v=(e,t)=>r?{aSize:t,cSize:e}:{aSize:e,cSize:t},y=new Map;for(let t of c){let r=e.nodes.get(t),i=bn(t,r.label,r.shape,n.fontSizes.nodeLabel,r.icon,e.direction,Yt(e));y.set(t,v(i.width,i.height))}let b=e=>(g.get(e)??[]).reduce((e,t)=>{let n=m(t)?.cross;return e+wr+(n===void 0?0:n+Tr)},0),x=e=>{let t=f(e),i=new Map,o=new Map,s=new Map;for(let e of t){let t=a.get(e);if(!t){o.set(e,y.get(e));continue}let c=x(e);i.set(e,c);let l=j(t.label,n.fontSizes.groupHeader,L.groupHeader).width,u=c.axisSize+_.axisStart+_.axisEnd,d=c.crossSize+_.crossStart+_.crossEnd,f=r?0:l+Er,p=r?l+Er:0,m=Math.max(0,f-u),h=Math.max(0,p-d);u+=m,d+=h,o.set(e,{aSize:u,cSize:d}),s.set(e,{axis:_.axisStart+m/2,cross:_.crossStart+h/2})}let c=new Map(t.map((e,t)=>[e,t])),l=h.get(e??``)??[],u=xr(t.map(e=>({axis:o.get(e).aSize,cross:o.get(e).cSize,before:b(e)})),l.map(e=>({from:c.get(e.from),to:c.get(e.to),label:m(e.index)})),{nodeSep:n.nodeSpacing,rankSep:n.layerSpacing}),d=new Map;return l.forEach((e,t)=>d.set(e.index,{mids:u.paths[t],label:u.labels[t]})),{members:t,at:new Map(t.map((e,t)=>[e,u.nodes[t]])),sizes:o,inset:{axis:0,cross:0},axisSize:u.axisSize,crossSize:u.crossSize,routes:d,inner:new Map([...i].map(([e,t])=>[e,{...t,inset:s.get(e)}]))}},S=x(void 0),C=new Map,w=new Map,T=(t,n,r)=>{for(let[e,i]of t.routes)w.set(e,{mids:i.mids.map(e=>({axis:e.axis+n,cross:e.cross+r})),label:i.label&&{axis:i.label.axis+n,cross:i.label.cross+r}});let i=[];for(let o of t.members){let s=t.at.get(o),c=t.sizes.get(o),l={axis:n+s.axis,cross:r+s.cross,...c};C.set(o,l);let u=t.inner.get(o);if(u){let t=a.get(o),n=T(u,l.axis+u.inset.axis,l.cross+u.inset.cross);i.push({id:o,label:t.label,x:0,y:0,width:0,height:0,children:n,...A(o,e),...t.region?{region:!0}:{},...t.icon?{icon:t.icon}:{}})}}return i},E=T(S,0,0),D=n.padding,O=S.axisSize,k=e=>{let t=i?O-e.axis:e.axis;return r?{x:e.cross+D,y:t+D}:{x:t+D,y:e.cross+D}},ee=e=>{let t=i?O-e.axis-e.aSize:e.axis;return r?{x:e.cross+D,y:t+D,width:e.cSize,height:e.aSize}:{x:t+D,y:e.cross+D,width:e.aSize,height:e.cSize}},M=e=>{for(let t of e)Object.assign(t,ee(C.get(t.id))),M(t.children)};M(E);let te=c.map(t=>{let n=e.nodes.get(t);return{id:t,label:n.label,shape:n.icon===void 0?n.shape:`rectangle`,icon:n.icon,...ee(C.get(t)),inlineStyle:oe(t,e),className:e.classAssignments.get(t),interaction:e.interactions.get(t)}}),ne=new Map(te.map(e=>[e.id,e])),re=[];e.edges.forEach((t,n)=>{let r=w.get(n);if(!r)return;let i=C.get(t.source),a=C.get(t.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=Kn(Or(u.map(k)));o&&d.reverse();let f=ne.get(t.source),p=ne.get(t.target);f&&(d=An(d,f,!0)),p&&(d=An(d,p,!1)),re.push({source:t.source,target:t.target,label:t.label,style:t.style,hasArrowStart:t.hasArrowStart,hasArrowEnd:t.hasArrowEnd,points:d,labelPosition:r.label&&k(r.label),inlineStyle:mr(n,e),headColor:pr(e),id:t.id,animate:t.animate,startMarker:t.startMarker,endMarker:t.endMarker})}),er(e,ne,re,n.fontSizes.edgeLabel);let N=(r?S.crossSize:S.axisSize)+D*2,ie=(r?S.axisSize:S.crossSize)+D*2;for(let e of re){for(let t of e.points)N=Math.max(N,t.x+Pt.width+D),ie=Math.max(ie,t.y+Pt.width+D);e.labelPosition&&(N=Math.max(N,e.labelPosition.x+60+D),ie=Math.max(ie,e.labelPosition.y+20+D))}return{width:N,height:ie,nodes:te,edges:re,groups:E}}function Or(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 kr(e,t={}){let n={...It,...t,fontSizes:kt(t.fontSizes)},r=e=>rr(St(En(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 Ar(e,t={}){let n=jr(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 jr(e,t){let n=_e(e);if(t.legacyNodeSizes&&n.subgraphs.length===0&&(n={...n},nn(n)),t.layout===`simple`&&!Yt(n))return Dr(n,t);if(t.layout!==void 0&&t.layout!==`elk`&&t.layout!==`simple`)throw Error(`zombie-mermaid: unknown layout ${JSON.stringify(t.layout)}; use 'elk' or 'simple'.`);let r=kr(n,t);if(rn(n)){let e=t=>t.flatMap(t=>[t,...e(t.children)]);_r(r.edges,r.nodes,e(r.groups),n.direction)}return r}function Mr(e,t={}){return En(e,{...It,...t,fontSizes:kt(t.fontSizes)})}var Nr=2;function Pr(e){return e.flatMap(e=>[e,...Pr(e.children)])}function Fr(e,t){let n=t.groupHeader+16;return Pr(e).filter(e=>e.label!==``).map(e=>{let r=j(e.label,t.groupHeader,400);return{x:e.x+e.width/2-r.width/2-Nr,y:e.y+(e.bandless?n:26)/2-r.height/2-Nr,width:r.width+4,height:r.height+4}})}function Ir(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 Lr(e){return{x:e.x+Nr,y:e.y+Nr,width:e.width-4,height:e.height-4}}function Rr(e,t){let n=e.points,r=t.map(Lr);for(let e=0;e+1<n.length;e++)if(r.some(t=>Ir(n[e],n[e+1],t)))return!0;return!1}function zr(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 Br(e,t,n){let r=`zm-title-gap-${zr(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 Vr(e,t,n=`Inter`,r=!1,i=Ot,a=`linear`,s,c=!0,l=!0,u,d,f={}){let p=[],m=l&&e.nodes.some(e=>!!se(e.interaction?.href));p.push(aa(F(e.width,e.height,t,r,u,d,m,f.styleAttribute,f.description),s)),p.push(o(n,!1,f.nonce,f.bodyFont)),c&&e.edges.some(e=>e.animate)&&p.push(Hr(f.nonce)),p.push(`<defs>`),p.push(Ur(e.stateDiagram===!0));let h=new Set;for(let t of e.edges){let e=Zr(t);e&&h.add(e)}for(let t of h)p.push(Wr(t,e.stateDiagram===!0));let g=new Set;for(let t of e.edges)t.startMarker&&g.add(t.startMarker),t.endMarker&&g.add(t.endMarker);for(let e of g)p.push(Jr(e));let _=Fr(e.groups,i),v=new Set(e.edges.filter(e=>Rr(e,_))),y;if(v.size>0){let t=Br(_,e.width,e.height);y=t.id,p.push(t.markup)}p.push(`</defs>`);for(let t of e.groups)p.push(ni(t,n,i));for(let t of e.edges)p.push(ri(t,a,c,v.has(t)?y:void 0,e.stateDiagram===!0));for(let t of e.edges)t.label&&p.push(ii(t,n,i));for(let t of e.nodes)p.push(ci(t,n,i,l,e.stateDiagram===!0));return p.push(`</svg>`),p.join(`
|
|
10
|
+
`)}function Hr(e){return[de(e),` @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 Ur(e){return Kr(`var(--_arrow)`,``,e)}function Wr(e,t){return Kr(S(e),E`-${Qr(e)}`,t)}var Gr=3.5;function Kr(e,t,n){if(n)return qr(e,t);let r=10.5,i=12.8,a=E`fill="${e}" stroke="${e}" stroke-width="0.75" stroke-linejoin="round"`,o=E`<polygon points="0 0, ${r} ${i/2}, 0 ${i}" ${a} />`,s=(e,t)=>E` <marker id="${e}" markerWidth="${r}" markerHeight="${i}" refX="${9.5}" refY="${i/2}" markerUnits="userSpaceOnUse" orient="${t}">`+E`\n ${o}`+`
|
|
12
|
+
</marker>`;return s(E`arrowhead${t}`,`auto`)+`
|
|
13
|
+
`+s(E`arrowhead-start${t}`,`auto-start-reverse`)}function qr(e,t){let n=(t,n)=>E` <marker id="${t}" markerWidth="20" markerHeight="14" refX="17" refY="7" markerUnits="userSpaceOnUse" orient="${n}">`+E`\n <path d="M 19,7 L11,14 L13,7 L11,0 Z" fill="${e}" />`+`
|
|
14
|
+
</marker>`;return n(E`arrowhead${t}`,`auto`)+`
|
|
15
|
+
`+n(E`arrowhead-start${t}`,`auto-start-reverse`)}function Jr(e){return e===`circle`?E`<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`<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 Yr=5.5;function Xr(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<=Yr||(r.x+=(i.x-r.x)/a*Yr,r.y+=(i.y-r.y)/a*Yr)};return e.hasArrowEnd&&!e.endMarker&&n(t.length-1,t.length-2),e.hasArrowStart&&!e.startMarker&&n(0,1),t}function Zr(e){return e.headColor??e.inlineStyle?.stroke}function Qr(e){return e.replace(/[^a-zA-Z0-9]/g,e=>e.charCodeAt(0).toString(16))}function $r(e){let t=e?.[`stroke-dasharray`];return t&&/^[\d.\s,]+$/.test(t)?E` stroke-dasharray="${t.trim()}"`:``}var ei=30,ti=12;function ni(e,t,n){let r=n.groupHeader+16,i=[];if(e.region){i.push(E`<g class="subgraph subgraph-region" data-id="${S(e.id)}">`,E` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" `+E`rx="0" ry="0" fill="none" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" stroke-dasharray="6 4" />`);for(let r of e.children)i.push(ni(r,t,n));return i.push(`</g>`),i.join(`
|
|
16
|
+
`)}if(e.architecture){let r=e.iconSize??ei,a=r>0&&e.icon&&(Rt[e.icon]??`<text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;">?</text>`);i.push(E`<g class="subgraph" data-id="${S(e.id)}" data-label="${S(e.label)}">`,E` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" fill="none" stroke="var(--_node-stroke)" stroke-width="${pi}" stroke-dasharray="${mi}" />`),a&&i.push(E` <g transform="translate(${e.x+1} ${e.y+1}) scale(${r/80})"><rect width="${80}" height="${80}" fill="${Lt}" />${a}</g>`),i.push(` `+P(e.label,e.x+(e.icon?r+4:6),e.y+1+ei/2,n.groupHeader,E`font-size="${n.groupHeader}" font-weight="400" fill="var(--_text)"`));for(let r of e.children)i.push(ni(r,t,n));return i.push(`</g>`),i.join(`
|
|
17
|
+
`)}i.push(E`<g class="subgraph" data-id="${S(e.id)}" data-label="${S(e.label)}">`);let a=e.inlineStyle,o=S(a?.stroke??`var(--_node-stroke)`),s=S(a?.[`stroke-width`]??String(R.outerBox)),c=$r(a),l=S(a?.fill??`var(--_group-fill)`),u=S(a?.fill??`var(--_group-hdr)`),d=e.bandless===!0;if(e.titleOnly||i.push(E` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" `+E`rx="${d?0:ui}" ry="${d?0:ui}" fill="${d?l:u}" stroke="${o}" stroke-width="${s}"${c} />`),e.bandless){i.push(` `+P(e.label,e.x+e.width/2,e.titleOnly?e.y+e.height/2+ti:e.y+r/2,n.groupHeader,E`text-anchor="middle" font-size="${n.groupHeader}" font-weight="${400}" fill="${S(a?.color??`var(--_text-sec)`)}"`));for(let r of e.children)i.push(ni(r,t,n));return i.push(`</g>`),i.join(`
|
|
18
|
+
`)}i.push(E` <rect x="${e.x}" y="${e.y+26}" width="${e.width}" height="${Math.max(0,e.height-26-fi)}" `+E`rx="0" ry="0" fill="${l}" stroke="${o}" stroke-width="${s}"${c} />`);let f=e.x+e.width/2;i.push(` `+P(e.label,f,e.y+13,n.groupHeader,E`text-anchor="middle" font-size="${n.groupHeader}" font-weight="${400}" fill="${S(a?.color??`var(--_text-sec)`)}"`));for(let r of e.children)i.push(ni(r,t,n));return i.push(`</g>`),i.join(`
|
|
19
|
+
`)}function ri(e,t,n=!0,r,i=!1){if(e.points.length<2)return``;let a=n&&(e.animate??!1),o=e.style===`invisible`,s=e.style===`dotted`?` stroke-dasharray="2 2"`:``,c=e.style===`thick`?Gr:R.connector,l=o?`none`:S(e.inlineStyle?.stroke??`var(--_line)`),u=S(e.inlineStyle?.[`stroke-width`]??String(c)),d=Zr(e),f=d?E`-${Qr(d)}`:``,p=``;o||(e.hasArrowEnd&&(p+=E` marker-end="url(#${e.endMarker??E`arrowhead${f}`})"`),e.hasArrowStart&&(p+=E` marker-start="url(#${e.startMarker??E`arrowhead-start${f}`})"`));let m=[E`class="edge${a?` edge-animated`:``}"`,E`data-from="${S(e.source)}"`,E`data-to="${S(e.target)}"`,E`data-style="${e.style}"`,E`data-arrow-start="${e.hasArrowStart}"`,E`data-arrow-end="${e.hasArrowEnd}"`];e.label&&m.push(E`data-label="${S(e.label)}"`),e.id&&m.push(E`data-id="${S(e.id)}"`);let h=a&&!s?` stroke-dasharray="8 6"`:``,g=i?Xr(e):e.points,_=t===`linear`?st(g,ot):lt(g,t);return E`<path ${m.join(` `)} d="${_}" `+E`fill="none" stroke="${l}" `+E`stroke-width="${u}"${s}${h}${p}`+(r?E` mask="url(#${r})"`:``)+` />`}function ii(e,t,n){if(!e.label)return``;let r=e.label,i=e.labelPosition??oi(e.points),a=j(r,n.edgeLabel,L.edgeLabel),o=ae(r,i.x,i.y,a.width,a.height,n.edgeLabel,0,E`text-anchor="middle" font-size="${n.edgeLabel}" font-weight="${L.edgeLabel}" fill="var(--_text-sec)"`,`fill="var(--bg)"`);return E`<g class="edge-label" data-from="${S(e.source)}" data-to="${S(e.target)}" data-label="${S(r)}">\n`+E` ${o.replace(/\n/g,`
|
|
20
|
+
`)}\n`+`</g>`}function ai(e,t){let n=e[t];if(!n)throw Error(E`edgeMidpoint: missing point at index ${t}`);return n}function oi(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+=si(ai(e,n-1),ai(e,n));let n=t/2;for(let t=1;t<e.length;t++){let r=ai(e,t-1),i=ai(e,t),a=si(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 si(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function ci(e,t,n,r=!0,i=!1){let a=gi(e,i),o=ra(e,t,n),s=[],c=ce(e.className),l=c?E`node ${c}`:`node`,u=e.interaction,d=[E`class="${l}"`,E`data-id="${S(e.id)}"`,E`data-label="${S(e.label)}"`,E`data-shape="${e.shape}"`];s.push(E`<g ${d.join(` `)}>`);let f=r?se(u?.href):void 0,p=f?` `:` `;if(f){let e=u?.target?E` target="${S(u.target)}"`:``;s.push(E` <a href="${S(f)}"${e}>`)}return r&&u?.tooltip&&s.push(E`${p}<title>${C(u.tooltip)}</title>`),s.push(E`${p}${a.replace(/\n/g,E`\n${p}`)}`),o&&s.push(E`${p}${o.replace(/\n/g,E`\n${p}`)}`),f&&s.push(` </a>`),s.push(`</g>`),s.join(`
|
|
21
|
+
`)}var li=13,ui=5,di=5,fi=4,pi=2,mi=8;function hi(e,t,n,r=80){let i=r===80?E`transform="translate(${e} ${t})"`:E`transform="translate(${e} ${t}) scale(${r/80})"`;if(n===``)return E`<path ${i} d="M0,80 V5 Q0,0 5,0 H75 Q80,0 80,5 V80 Z" fill="none" stroke="var(--_node-stroke)" stroke-width="${pi}" stroke-dasharray="${mi}" />`;let a=Rt[n]??`<text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;">?</text>`;return E`<g ${i}><rect width="${80}" height="${80}" fill="${Lt}" />${a}</g>`}function gi(e,t){let n=_i(e,t),r=e.icon===void 0&&e.shape!==`small-circle`?$r(e.inlineStyle):``;return r&&n?E`<g${r}>${n}</g>`:n}function _i(e,t){let{x:n,y:r,width:i,height:a,shape:o}=e;if(e.icon!==void 0)return hi(n,r,e.icon,e.width);let s=o===`small-circle`?void 0:e.inlineStyle,c=S(s?.fill??`var(--_node-fill)`),l=S(s?.stroke??`var(--_node-stroke)`),u=S(s?.[`stroke-width`]??String(R.innerBox)),d=e=>e&&/^\d+(\.\d+)?(px)?$/.test(e)?parseFloat(e):0,f=d(s?.rx),p={rx:f,ry:s?.ry===void 0?f:d(s.ry)};switch(o){case`diamond`:return Si(n,r,i,a,c,l,u);case`rounded`:return yi(n,r,i,a,c,l,u,t?di:6);case`stadium`:return bi(n,r,i,a,c,l,u);case`circle`:return xi(n,r,i,a,c,l,u);case`subroutine`:return Ci(n,r,i,a,c,l,u);case`doublecircle`:return wi(n,r,i,a,c,l,u);case`hexagon`:return Ti(n,r,i,a,c,l,u);case`cylinder`:return Ei(n,r,i,a,c,l,u);case`asymmetric`:return Di(n,r,i,a,c,l,u);case`trapezoid`:return Oi(n,r,i,a,c,l,u);case`trapezoid-alt`:return ki(n,r,i,a,c,l,u);case`parallelogram`:return Ai(n,r,i,a,c,l,u);case`parallelogram-alt`:return ji(n,r,i,a,c,l,u);case`state-start`:return ta(n,r,i,a);case`state-end`:return na(n,r,i,a);case`document`:return Ni(n,r,i,a,c,l,u);case`stacked-document`:return Pi(n,r,i,a,c,l,u,!0);case`stacked-process`:return Pi(n,r,i,a,c,l,u,!1);case`card`:return Fi(n,r,i,a,c,l,u);case`lined-process`:return Ii(n,r,i,a,c,l,u);case`divided-process`:return Li(n,r,i,a,c,l,u);case`window-pane`:return Ri(n,r,i,a,c,l,u);case`triangle`:return zi(n,r,i,a,c,l,u,!1);case`flipped-triangle`:return zi(n,r,i,a,c,l,u,!0);case`junction`:return``;case`filled-circle`:return Bi(n,r,i,a,l);case`crossed-circle`:return Vi(n,r,i,a,c,l,u);case`fork-join`:return Hi(n,r,i,a,l);case`note`:return qi(n,r,i,a,S(s?.fill??`var(--bg)`),l,u);case`notched-pentagon`:return Ji(n,r,i,a,c,l,u);case`sloped-rectangle`:return Yi(n,r,i,a,c,l,u);case`flag`:return Xi(n,r,i,a,c,l,u);case`bow-tie-rectangle`:return Zi(n,r,i,a,c,l,u);case`half-rounded-rectangle`:return Qi(n,r,i,a,c,l,u);case`brace`:return $i(n,r,i,a,c,l,u,`left`);case`brace-right`:return $i(n,r,i,a,c,l,u,`right`);case`braces`:return $i(n,r,i,a,c,l,u,`both`);case`bolt`:return ea(n,r,i,a,c,l,u);case`cloud`:return Ui(n,r,i,a,c,l,u);case`horizontal-cylinder`:return Wi(n,r,i,a,c,l,u);case`tagged-rectangle`:return Gi(n,r,i,a,c,l,u);case`fork-bar`:return vi(n,r,i,a,c,l,u);case`small-circle`:return Ki(n,r,i,a,c,l,u);case`text`:case`anchor`:return``;default:return vi(n,r,i,a,c,l,u,p)}}function vi(e,t,n,r,i,a,o,s={rx:0,ry:0}){return E`<rect x="${e}" y="${t}" width="${n}" height="${r}" `+E`rx="${s.rx}" ry="${s.ry}" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function yi(e,t,n,r,i,a,o,s){return E`<rect x="${e}" y="${t}" width="${n}" height="${r}" `+E`rx="${s}" ry="${s}" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function bi(e,t,n,r,i,a,o){let s=r/2;return E`<rect x="${e}" y="${t}" width="${n}" height="${r}" `+E`rx="${s}" ry="${s}" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function xi(e,t,n,r,i,a,o){let s=e+n/2,c=t+r/2,l=Math.min(n,r)/2;return E`<circle cx="${s}" cy="${c}" r="${l}" `+E`fill="${i}" stroke="${a}" stroke-width="${o}" />`}function Si(e,t,n,r,i,a,o){let s=e+n/2,c=t+r/2,l=n/2,u=r/2,d=[E`${s},${c-u}`,E`${s+l},${c}`,E`${s},${c+u}`,E`${s-l},${c}`].join(` `);return E`<polygon points="${d}" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function Ci(e,t,n,r,i,a,o){return E`<rect x="${e}" y="${t}" width="${n}" height="${r}" `+E`rx="0" ry="0" fill="${i}" stroke="${a}" stroke-width="${o}" />`+E`\n<line x1="${e+8}" y1="${t}" x2="${e+8}" y2="${t+r}" `+E`stroke="${a}" stroke-width="${o}" />`+E`\n<line x1="${e+n-8}" y1="${t}" x2="${e+n-8}" y2="${t+r}" `+E`stroke="${a}" stroke-width="${o}" />`}function wi(e,t,n,r,i,a,o){let s=e+n/2,c=t+r/2,l=Math.min(n,r)/2,u=l-5;return E`<circle cx="${s}" cy="${c}" r="${l}" `+E`fill="${i}" stroke="${a}" stroke-width="${o}" />`+E`\n<circle cx="${s}" cy="${c}" r="${u}" `+E`fill="${i}" stroke="${a}" stroke-width="${o}" />`}function Ti(e,t,n,r,i,a,o){let s=r/3.5,c=[E`${e+s},${t}`,E`${e+n-s},${t}`,E`${e+n},${t+r/2}`,E`${e+n-s},${t+r}`,E`${e+s},${t+r}`,E`${e},${t+r/2}`].join(` `);return E`<polygon points="${c}" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function Ei(e,t,n,r,i,a,o){let s=e+n/2,c=t+7,l=r-14;return E`<rect x="${e}" y="${c}" width="${n}" height="${l}" `+E`fill="${i}" stroke="none" />`+E`\n<line x1="${e}" y1="${c}" x2="${e}" y2="${c+l}" stroke="${a}" stroke-width="${o}" />`+E`\n<line x1="${e+n}" y1="${c}" x2="${e+n}" y2="${c+l}" stroke="${a}" stroke-width="${o}" />`+E`\n<ellipse cx="${s}" cy="${t+r-7}" rx="${n/2}" ry="${7}" `+E`fill="${i}" stroke="${a}" stroke-width="${o}" />`+E`\n<ellipse cx="${s}" cy="${c}" rx="${n/2}" ry="${7}" `+E`fill="${i}" stroke="${a}" stroke-width="${o}" />`}function Di(e,t,n,r,i,a,o){let s=[E`${e},${t}`,E`${e+n},${t}`,E`${e+n},${t+r}`,E`${e},${t+r}`,E`${e+12},${t+r/2}`].join(` `);return E`<polygon points="${s}" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function Oi(e,t,n,r,i,a,o){let s=n*.15,c=[E`${e+s},${t}`,E`${e+n-s},${t}`,E`${e+n},${t+r}`,E`${e},${t+r}`].join(` `);return E`<polygon points="${c}" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function ki(e,t,n,r,i,a,o){let s=n*.15,c=[E`${e},${t}`,E`${e+n},${t}`,E`${e+n-s},${t+r}`,E`${e+s},${t+r}`].join(` `);return E`<polygon points="${c}" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function Ai(e,t,n,r,i,a,o){let s=n*.15,c=[E`${e+s},${t}`,E`${e+n},${t}`,E`${e+n-s},${t+r}`,E`${e},${t+r}`].join(` `);return E`<polygon points="${c}" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function ji(e,t,n,r,i,a,o){let s=n*.15,c=[E`${e},${t}`,E`${e+n-s},${t}`,E`${e+n},${t+r}`,E`${e+s},${t+r}`].join(` `);return E`<polygon points="${c}" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function Mi(e,t,n){return E`fill="${e}" stroke="${t}" stroke-width="${n}"`}function Ni(e,t,n,r,i,a,o){let s=Math.min(10,r*.16),c=t+r-s,l=E`M ${e} ${t} L ${e+n} ${t} L ${e+n} ${c} `+E`C ${e+n*.75} ${c+s*1.8} ${e+n*.25} ${c-s*.8} ${e} ${c} Z`;return E`<path d="${l}" ${Mi(i,a,o)} />`}function Pi(e,t,n,r,i,a,o,s){let c=n-10,l=r-10,u=[];for(let n=2;n>=1;n--)u.push(E`<rect x="${e+5*n}" y="${t+5*(2-n)}" width="${c}" height="${l}" `+E`${Mi(i,a,o)} />`);return u.push(s?Ni(e,t+10,c,l,i,a,o):E`<rect x="${e}" y="${t+10}" width="${c}" height="${l}" ${Mi(i,a,o)} />`),u.join(`
|
|
22
|
+
`)}function Fi(e,t,n,r,i,a,o){let s=Math.min(14,n*.12,r*.3),c=[E`${e+s},${t}`,E`${e+n},${t}`,E`${e+n},${t+r}`,E`${e},${t+r}`,E`${e},${t+s}`].join(` `);return E`<polygon points="${c}" ${Mi(i,a,o)} />`}function Ii(e,t,n,r,i,a,o){let s=Math.min(12,n*.12);return E`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${Mi(i,a,o)} />\n`+E`<line x1="${e+s}" y1="${t}" x2="${e+s}" y2="${t+r}" stroke="${a}" stroke-width="${o}" />`}function Li(e,t,n,r,i,a,o){let s=t+Math.min(16,r*.3);return E`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${Mi(i,a,o)} />\n`+E`<line x1="${e}" y1="${s}" x2="${e+n}" y2="${s}" stroke="${a}" stroke-width="${o}" />`}function Ri(e,t,n,r,i,a,o){let s=e+Math.min(16,n*.16),c=t+Math.min(14,r*.28);return E`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${Mi(i,a,o)} />\n`+E`<line x1="${s}" y1="${t}" x2="${s}" y2="${t+r}" stroke="${a}" stroke-width="${o}" />\n`+E`<line x1="${e}" y1="${c}" x2="${e+n}" y2="${c}" stroke="${a}" stroke-width="${o}" />`}function zi(e,t,n,r,i,a,o,s){let c=s?[E`${e},${t}`,E`${e+n},${t}`,E`${e+n/2},${t+r}`]:[E`${e+n/2},${t}`,E`${e+n},${t+r}`,E`${e},${t+r}`];return E`<polygon points="${c.join(` `)}" ${Mi(i,a,o)} />`}function Bi(e,t,n,r,i){let a=Math.min(n,r)/2;return E`<circle cx="${e+n/2}" cy="${t+r/2}" r="${a}" fill="${i}" stroke="${i}" />`}function Vi(e,t,n,r,i,a,o){let s=e+n/2,c=t+r/2,l=Math.min(n,r)/2-2,u=l/Math.SQRT2;return E`<circle cx="${s}" cy="${c}" r="${l}" ${Mi(i,a,o)} />\n`+E`<line x1="${s-u}" y1="${c-u}" x2="${s+u}" y2="${c+u}" stroke="${a}" stroke-width="${o}" />\n`+E`<line x1="${s+u}" y1="${c-u}" x2="${s-u}" y2="${c+u}" stroke="${a}" stroke-width="${o}" />`}function Hi(e,t,n,r,i){let a=Math.min(8,r);return E`<rect x="${e}" y="${t+(r-a)/2}" width="${n}" height="${a}" fill="${i}" stroke="${i}" />`}function Ui(e,t,n,r,i,a,o){let s=n/1.25,c=r-.48*s,[l,u,d,f]=[.15*s,.25*s,.35*s,.2*s],p=E`M0 0 a${l},${l} 0 0,1 ${.25*s},${-.1*s} `+E`a${d},${d} 1 0,1 ${.4*s},${-.1*s} `+E`a${u},${u} 1 0,1 ${.35*s},${.2*s} `+E`a${l},${l} 1 0,1 ${.15*s},${.35*c} `+E`a${f},${f} 1 0,1 ${-.15*s},${.65*c} `+E`a${u},${l} 1 0,1 ${-.25*s},${.15*s} `+E`a${d},${d} 1 0,1 ${-.5*s},0 `+E`a${l},${l} 1 0,1 ${-.25*s},${-.15*s} `+E`a${l},${l} 1 0,1 ${-.1*s},${-.35*c} `+E`a${f},${f} 1 0,1 ${.1*s},${-.65*c} H0 V0 Z`;return E`<path transform="translate(${e+.1*s} ${t+.225*s})" d="${p}" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function Wi(e,t,n,r,i,a,o){let s=r/2,c=s/(2.5+r/50),l=n-2*c;return E`<path d="M${e+c},${t+r} a${c},${s} 0,0,1 0,${-r} l${l},0 a${c},${s} 0,0,1 0,${r} `+E`l${-l},0 Z" fill="${i}" stroke="${a}" stroke-width="${o}" />`+E`\n<path d="M${e+c+l},${t} a${c},${s} 0,0,0 0,${r}" fill="none" stroke="${a}" stroke-width="${o}" />`}function Gi(e,t,n,r,i,a,o){let s=.2*r;return vi(e,t,n,r,i,a,o)+E`\n<polygon points="${e+n-s},${t+r} ${e+n},${t+r} ${e+n},${t+r-s}" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function Ki(e,t,n,r,i,a,o){return E`<circle cx="${e+n/2}" cy="${t+r/2}" r="7" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function qi(e,t,n,r,i,a,o){let s=[E`${e},${t}`,E`${e+n-6},${t}`,E`${e+n},${t+6}`,E`${e+n},${t+r}`,E`${e},${t+r}`].join(` `);return E`<polygon points="${s}" fill="${i}" stroke="${a}" stroke-width="${o}" />\n`+E`<polygon points="${e+n-6},${t} ${e+n},${t+6} ${e+n-6},${t+6}" fill="var(--_inner-stroke)" stroke="${a}" stroke-width="${o}" />`}function Ji(e,t,n,r,i,a,o){let s=Math.min(14,n*.12,r*.3),c=[E`${e+s},${t}`,E`${e+n-s},${t}`,E`${e+n},${t+s}`,E`${e+n},${t+r}`,E`${e},${t+r}`,E`${e},${t+s}`].join(` `);return E`<polygon points="${c}" ${Mi(i,a,o)} />`}function Yi(e,t,n,r,i,a,o){let s=Math.min(12,r*.3),c=[E`${e},${t+s}`,E`${e+n},${t}`,E`${e+n},${t+r}`,E`${e},${t+r}`].join(` `);return E`<polygon points="${c}" ${Mi(i,a,o)} />`}function Xi(e,t,n,r,i,a,o){let s=Math.min(8,r*.14),c=E`M ${e} ${t+s} `+E`C ${e+n*.25} ${t-s} ${e+n*.75} ${t+s*2} ${e+n} ${t+s} `+E`L ${e+n} ${t+r-s} `+E`C ${e+n*.75} ${t+r+s} ${e+n*.25} ${t+r-s*2} ${e} ${t+r-s} Z`;return E`<path d="${c}" ${Mi(i,a,o)} />`}function Zi(e,t,n,r,i,a,o){let s=Math.min(14,n*.12),c=E`M ${e+s} ${t} L ${e+n} ${t} `+E`Q ${e+n-s*1.4} ${t+r/2} ${e+n} ${t+r} `+E`L ${e+s} ${t+r} `+E`Q ${e+s*1.4} ${t+r/2} ${e+s} ${t} Z`;return E`<path d="${c}" ${Mi(i,a,o)} />`}function Qi(e,t,n,r,i,a,o){let s=r/2,c=Math.max(0,n-s),l=E`M ${e} ${t} L ${e+c} ${t} `+E`A ${s} ${s} 0 0 1 ${e+c} ${t+r} `+E`L ${e} ${t+r} Z`;return E`<path d="${l}" ${Mi(i,a,o)} />`}function $i(e,t,n,r,i,a,o,s){let c=Math.min(10,n*.12),l=[E`<rect x="${e}" y="${t}" width="${n}" height="${r}" fill="none" stroke="none" />`],u=E`M ${e+c} ${t} Q ${e} ${t} ${e} ${t+r*.25} `+E`Q ${e} ${t+r/2} ${e-c*.4} ${t+r/2} `+E`Q ${e} ${t+r/2} ${e} ${t+r*.75} `+E`Q ${e} ${t+r} ${e+c} ${t+r}`,d=E`M ${e+n-c} ${t} Q ${e+n} ${t} ${e+n} ${t+r*.25} `+E`Q ${e+n} ${t+r/2} ${e+n+c*.4} ${t+r/2} `+E`Q ${e+n} ${t+r/2} ${e+n} ${t+r*.75} `+E`Q ${e+n} ${t+r} ${e+n-c} ${t+r}`;return(s===`left`||s===`both`)&&l.push(E`<path d="${u}" fill="none" stroke="${a}" stroke-width="${o}" />`),(s===`right`||s===`both`)&&l.push(E`<path d="${d}" fill="none" stroke="${a}" stroke-width="${o}" />`),l.join(`
|
|
23
|
+
`)}function ea(e,t,n,r,i,a,o){let s=[E`${e+n*.42},${t}`,E`${e+n},${t}`,E`${e+n*.62},${t+r*.42}`,E`${e+n},${t+r*.42}`,E`${e+n*.3},${t+r}`,E`${e+n*.5},${t+r*.55}`,E`${e},${t+r*.55}`].join(` `);return E`<polygon points="${s}" ${Mi(i,a,o)} />`}function ta(e,t,n,r){let i=e+n/2,a=t+r/2,o=Math.min(n,r)/2;return E`<circle cx="${i}" cy="${a}" r="${o}" fill="var(--_text)" stroke="none" />`}function na(e,t,n,r){let i=e+n/2,a=t+r/2,o=Math.min(n,r)/2,s=o*5/14;return E`<circle cx="${i}" cy="${a}" r="${o}" `+E`fill="none" stroke="var(--_text)" stroke-width="2" />`+E`\n<circle cx="${i}" cy="${a}" r="${s}" fill="var(--_text)" stroke="none" />`}function ra(e,t,n){if((e.shape===`state-start`||e.shape===`state-end`)&&!e.label)return``;let i=e.x+e.width/2+(e.shape===`asymmetric`?6:0),a=e.label.split(`
|
|
24
|
+
`).length,o=e.icon===void 0?e.y+e.height/2:e.y+e.height+li+(a-1)/2*n.nodeLabel*r,s=S(e.inlineStyle?.color??`var(--_text)`),c=E`text-anchor="middle" font-size="${n.nodeLabel}" font-weight="${L.nodeLabel}" fill="${s}"`,l=e.inlineStyle?.[`font-family`];return l&&(c+=E` style="font-family: ${S(l)};"`),P(e.label,i,o,n.nodeLabel,c)}function ia(e){return S(e).replace(/\r/g,` `).replace(/\n/g,` `).replace(/\t/g,`	`)}function aa(e,t){return t===void 0?e:e.replace(`<svg `,E`<svg data-src="${ia(t)}" `)}var oa=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=pa(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 sa(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 ca(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 la=`(?<![\\w-])(var|color-mix)\\(`;function ua(e,t){let[n,...r]=ca(e),i=(n??``).trim(),a=t.lookup(i);return a===void 0?r.length>0?r.join(`,`).trim():null:a}function da(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 fa(e){let t=ca(e);if(t.length!==3)return null;let[n,r,i]=t;if(n===void 0||r===void 0||i===void 0||!/^\s*in\s+srgb\s*$/i.test(n))return null;let a=da(r),o=da(i);if(!a||!o)return null;let s=ie(a.color),c=ie(o.color);if(!s||!c)return null;let l=te(s,c,a.pct,o.pct);return l?k(l):null}function pa(e,t){let n=``,r=0,i=new RegExp(la,`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=sa(e,c);if(l===-1)break;let u=pa(e.slice(c+1,l),t),d=o===`var`?ua(u,t):fa(u);n+=e.slice(r,s),n+=d??`${o}(${u})`,r=l+1,i.lastIndex=r}return n+e.slice(r)}function ma(e,t){let n=new oa;for(let[e,r]of Object.entries(t))n.declare(e,r);return pa(e,n)}var ha=/(--[\w-]+)\s*:\s*([^;{}]+)/g,ga=/(\s)([\w:.-]+)(=)("[^"]*"|'[^']*')/g,_a=new Set([`data-src`]);function va(e,t){ha.lastIndex=0;let n;for(;(n=ha.exec(e))!==null;){let[,e,r]=n;e!==void 0&&r!==void 0&&t.declare(e,r.trim())}}function ya(e,t){return e.replace(ga,(e,n,r,i,a)=>{if(_a.has(r))return e;let o=a[0]??`"`;return`${n}${r}${i}${o}${pa(a.slice(1,-1),t)}${o}`})}function ba(e,t){let n=new oa;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&&va(e,n)}for(let t of e.matchAll(/\sstyle=("[^"]*"|'[^']*')/g)){let e=t[1];e!==void 0&&va(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+=pa(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:ya(s,n),i=a+1}return r+e.slice(i)}var xa=[.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],Sa=[.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 Ca(e){return e>=4352?1:.6}function wa(e,t){let n=t?Sa:xa,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:Ca(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 Ta(e){return`note ${e}`}function Ea(e){return`${e} link`}function Da(e){return`namespace ${e}`}function Oa(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:Da(i),name:a.name,classIds:e})}return r}function ka(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 Aa(e){return O(e.relationships.map(e=>({source:e.from,target:e.to})),e.classes.map(e=>e.id))}function ja(e,t,n){let r=new Map,i=new Map,a=kt(t.fontSizes),o=e.layout?.padding??z.mermaidPad,s=o-z.mermaidPad;for(let t of e.classes){if(n.has(t.id)){r.set(t.id,{width:I(t.label,a.nodeLabel,L.edgeLabel)+z.lollipopLabelPadX*2,height:z.lollipopLabelHeight,headerHeight:z.lollipopLabelHeight,attrHeight:0,methodHeight:0});continue}let i=Math.max(0,(t.annotation?z.headerBaseHeight+z.annotationHeight:z.headerBaseHeight)+s*2),c=t.attributes.length+t.methods.length===0,l=c&&e.layout?.hideEmptyMembersBox===!0?0:Math.max(0,(c?z.emptyBareSectionHeight:z.emptySectionHeight)+s*2),u=t.attributes.length>0?t.attributes.length*z.memberRowHeight+Math.max(0,z.sectionPadY+s*2):l,d=t.methods.length>0?t.methods.length*z.memberRowHeight+Math.max(0,z.sectionPadY+s*2):l,f=I(t.label,a.nodeLabel,L.nodeLabel),p=La(t.attributes),m=La(t.methods),h=Math.max(Ia(t,o),f+z.boxPadX*2,p+z.boxPadX*2,m+z.boxPadX*2),g=i+u+d;r.set(t.id,{width:h,height:g,headerHeight:i,attrHeight:u,methodHeight:d})}let c=Oa(e),l=new Map;for(let e of c)for(let t of e.classIds)l.set(t,e.id);let u=new Map,d=[];for(let e of c){let t=I(e.name,z.namespaceTitleFontSize,L.groupHeader)+z.namespacePad*2,n={id:e.id,children:[],layoutOptions:{"elk.padding":Vt({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)`}};u.set(e.id,n),d.push(n)}for(let[e,t]of r){let n=Ut(e,t),r=u.get(l.get(e)??``);r?.children?r.children.push(n):d.push(n)}let f={fontSize:a.edgeLabel},p=Aa(e),m=[];for(let[t,n]of e.relationships.entries()){let e=p.has(t);m.push(Kt({id:`e${t}`,source:e?n.to:n.from,target:e?n.from:n.to,label:n.label,labelStyle:f}))}let h=new Set(r.keys());for(let[t,n]of e.notes.entries()){let e=Ta(t),r=j(n.text,a.edgeLabel,L.edgeLabel),o={width:r.width+z.notePadX*2,height:r.height+z.notePadY*2};i.set(e,o),d.push(Ut(e,o)),n.forClass!==void 0&&h.has(n.forClass)&&m.push(Kt({id:Ea(e),source:e,target:n.forClass,labelStyle:f}))}return{elkGraph:{id:`root`,layoutOptions:{...Ht({direction:Bt(e.direction,zt.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:d,edges:m},classSizes:r,noteSizes:i,namespaces:c}}function Ma(e,t,n,r,i,a){let o=new Map;for(let e of t.classes)o.set(e.id,e);let s=new Set(i.map(e=>e.id)),c=new Map,l=[];for(let t of e.children??[])if(s.has(t.id)){let e=t.x??0,n=t.y??0;c.set(t.id,{x:e,y:n});for(let r of t.children??[])l.push({...r,x:(r.x??0)+e,y:(r.y??0)+n})}else l.push(t);let u=e=>{let t=e.container;return t&&c.get(t)||{x:0,y:0}},d=[];for(let t of i){let n=(e.children??[]).find(e=>e.id===t.id);n&&d.push({name:t.name,classIds:t.classIds.filter(e=>!a.labels.has(e)),x:n.x??0,y:n.y??0,width:n.width??0,height:n.height??0})}let f=[];for(let e of l){let r=o.get(e.id);if(r){let i=n.get(r.id);if(!i)throw Error(`Missing computed size for class "${r.id}"`);f.push({id:r.id,label:r.label,annotation:r.annotation,attributes:r.attributes,methods:r.methods,x:e.x??0,y:e.y??0,width:e.width??i.width,height:e.height??i.height,headerHeight:i.headerHeight,attrHeight:i.attrHeight,methodHeight:i.methodHeight,interaction:t.interactions.get(r.id),inlineStyle:oe(r.id,t),className:t.classAssignments.get(r.id)})}}let p=[],m=Aa(a.diagram),h=new Map;for(let e of l)h.set(e.id,e);let g=new Map;for(let[e,t]of a.labels){let n=h.get(e);g.set(e,{text:t,x:n?.x??0,y:n?.y??0,width:n?.width??0,height:n?.height??0})}let _=e.edges??[];for(let[e,n]of t.relationships.entries()){let t=_[e];if(!t)throw Error(`Missing ELK edge for relationship ${e}`);let r=u(t),i=qn(t,r.x,r.y),o=m.has(e)?i.reverse():i,s=Jn(t,r.x,r.y),c=g.get(a.byRelationship.get(e)??``);p.push({from:n.from,to:n.to,type:n.type,markerAt:n.markerAt,...n.dashed?{dashed:!0}:{},label:n.label,fromCardinality:n.fromCardinality,toCardinality:n.toCardinality,points:o,labelPosition:s,...c?{interfaceLabel:c}:{}})}let v=new Map;for(let e of _.slice(t.relationships.length))v.set(e.id,e);let y=[];for(let[e,n]of t.notes.entries()){let t=Ta(e),i=h.get(t),a=r.get(t);if(!i||!a)throw Error(`Missing layout for note ${e}`);let o=v.get(Ea(t));y.push({id:t,text:n.text,...o&&n.forClass!==void 0?{forClass:n.forClass}:{},x:i.x??0,y:i.y??0,width:i.width??a.width,height:i.height??a.height,...o?{linkPoints:qn(o,u(o).x,u(o).y)}:{}})}return{width:e.width??600,height:e.height??400,classes:f,relationships:p,notes:y,namespaces:d}}function Na(e,t={}){if(e.classes.length===0&&e.notes.length===0)return{width:0,height:0,classes:[],relationships:[],notes:[],namespaces:[]};let n=ka(e),{elkGraph:r,classSizes:i,noteSizes:a,namespaces:o}=ja(n.diagram,t,n.labels);return Ma(St(r,t.layoutCache),e,i,a,o,n)}function Pa(e){return e.length*Math.ceil(Tt(`M`,z.memberFontSize))}function Fa(e){let t=e.isMethod?`${e.name}(${e.params||``})`:e.name;return`${e.visibility||``}${e.visibilitySpace?` `:``}${t}${e.isMethod&&e.type?` : ${e.type}`:``}`}function Ia(e,t=z.mermaidPad){let n=wa(e.label,!0),r=e.annotation?wa(`\u00ab${e.annotation}\u00bb`,!1):0,i=Math.max(0,...[...e.attributes,...e.methods].map(e=>wa(Fa(e),!1))),a=Math.max(n,r);return a/2+Math.max(a/2,i)+t*2}function La(e){if(e.length===0)return 0;let t=0;for(let n of e){let e=Pa(we(n));e>t&&(t=e)}return t}var Ra={memberSize:11,memberWeight:400,annotationSize:10,annotationWeight:500};function za(e,t,n=`Inter`,r=!1,i=Ot,a,o,s,c=!0,l={}){let u=[],d=c&&e.classes.some(e=>!!se(e.interaction?.href));u.push(aa(F(e.width,e.height,t,r,o,s,d,l.styleAttribute,l.description),a)),u.push(Ft(n,!0,l.nonce,l.bodyFont)),u.push(`<defs>`),u.push(Va(e.relationships.some(e=>e.type===`lollipop`))),u.push(`</defs>`);for(let t of e.namespaces)u.push(Ba(t));for(let t of e.relationships)u.push(Ja(t));for(let t of e.notes)u.push(qa(t));for(let t of e.classes)u.push(Ha(t,i,c));for(let t of e.relationships){let e=Ya(t,i);e&&u.push(e)}for(let t of e.notes)u.push(Ka(t,i));for(let t of e.relationships)u.push(Qa(t,i));return u.push(`</svg>`),u.join(`
|
|
25
|
+
`)}function Ba(e){let{x:t,y:n,width:r,height:i}=e,a=z.namespaceTitleHeight,o=R.outerBox;return[E`<g class="class-namespace" data-id="${S(e.name)}" data-label="${S(e.name)}">`,E` <rect x="${t}" y="${n}" width="${r}" height="${i}" rx="0" ry="0" fill="var(--_group-fill)" stroke="var(--_node-stroke)" stroke-width="${o}" />`,E` <rect x="${t}" y="${n}" width="${r}" height="${a}" rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${o}" />`,E` <text x="${t+z.namespacePad}" y="${n+a/2}" dy="${Nt}" font-size="${z.namespaceTitleFontSize}" font-weight="${L.groupHeader}" fill="var(--_text-sec)">${oo(e.name)}</text>`,`</g>`].join(`
|
|
26
|
+
`)}function Va(e){return` <marker id="cls-inherit" markerWidth="12" markerHeight="10" refX="12" refY="5" orient="auto-start-reverse">
|
|
27
27
|
<polygon points="0 0, 12 5, 0 10" fill="var(--bg)" stroke="var(--_arrow)" stroke-width="1.5" />
|
|
28
28
|
</marker>
|
|
29
29
|
<marker id="cls-composition" markerWidth="18" markerHeight="14" refX="16.5" refY="7" orient="auto-start-reverse">
|
|
@@ -37,37 +37,37 @@ import{DEFAULTS as e,LINE_HEIGHT_RATIO as t,applyThemeVariables as n,buildStyleB
|
|
|
37
37
|
</marker>`+(e?`
|
|
38
38
|
<marker id="cls-lollipop" markerWidth="12" markerHeight="12" refX="11" refY="6" orient="auto-start-reverse">
|
|
39
39
|
<circle cx="6" cy="6" r="5" fill="var(--bg)" stroke="var(--_arrow)" stroke-width="1.5" />
|
|
40
|
-
</marker>`:``)}function
|
|
41
|
-
`)}var
|
|
42
|
-
</g>`}function
|
|
43
|
-
</g>`}function
|
|
44
|
-
`)}function
|
|
45
|
-
`)}function
|
|
46
|
-
`).map(e=>e.trim()).join(` `)]}function
|
|
47
|
-
`)}function
|
|
48
|
-
`))}}return
|
|
49
|
-
`)}function
|
|
50
|
-
`)}function
|
|
51
|
-
`)}function
|
|
52
|
-
`)}function
|
|
53
|
-
`)){let r=``;for(let a of e.split(` `))r&&
|
|
54
|
-
`).slice(1,-1)}function
|
|
55
|
-
`).length-1)*
|
|
40
|
+
</marker>`:``)}function Ha(e,t,n=!0){let{x:r,y:i,width:a,height:o,headerHeight:s,attrHeight:c,inlineStyle:l}=e,u=[],d=e.interaction,f=S(l?.fill??`var(--_node-fill)`),p=S(l?.stroke??`var(--_node-stroke)`),m=S(l?.[`stroke-width`]??String(R.outerBox)),h=l?.fill?f:`var(--_group-hdr)`,g=l?.color?S(l.color):void 0,_=e.annotation?E` data-annotation="${S(e.annotation)}"`:``,v=ce(e.className),y=[E`class="${v?E`class-node ${v}`:`class-node`}"`,E`data-id="${S(e.id)}"`,E`data-label="${S(e.label)}"`];u.push(E`<g ${y.join(` `)}${_}>`);let b=n?se(d?.href):void 0;if(b){let e=d?.target?E` target="${S(d.target)}"`:``;u.push(E` <a href="${S(b)}"${e}>`)}n&&d?.tooltip&&u.push(E` <title>${oo(d.tooltip)}</title>`),u.push(E` <rect x="${r}" y="${i}" width="${a}" height="${o}" `+E`rx="0" ry="0" fill="${f}" stroke="${p}" stroke-width="${m}" />`),u.push(E` <rect x="${r}" y="${i}" width="${a}" height="${s}" `+E`rx="0" ry="0" fill="${h}" stroke="${p}" stroke-width="${m}" />`);let x=i+s/2;if(e.annotation){let t=i+12;u.push(E` <text x="${r+a/2}" y="${t}" text-anchor="middle" dy="${Nt}" `+E`font-size="${Ra.annotationSize}" font-weight="${Ra.annotationWeight}" `+E`font-style="italic" fill="${g??`var(--_text-muted)`}">«${oo(e.annotation)}»</text>`),x=i+s/2+6}u.push(` `+P(e.label,r+a/2,x,t.nodeLabel,E`text-anchor="middle" font-size="${t.nodeLabel}" font-weight="700" fill="${g??`var(--_text)`}"`));let C=i+s;c>0&&u.push(E` <line x1="${r}" y1="${C}" x2="${r+a}" y2="${C}" `+E`stroke="${p}" stroke-width="${R.innerBox}" />`);let w=(c-e.attributes.length*20)/2,T=(o-s-c-e.methods.length*20)/2;for(let t=0;t<e.attributes.length;t++){let n=e.attributes[t],i=C+w+t*20+10;u.push(` `+Wa(n,r+z.boxPadX,i,g))}let D=C+c;o-s-c>0&&u.push(E` <line x1="${r}" y1="${D}" x2="${r+a}" y2="${D}" `+E`stroke="${p}" stroke-width="${R.innerBox}" />`);for(let t=0;t<e.methods.length;t++){let n=e.methods[t],i=D+T+t*20+10;u.push(` `+Wa(n,r+z.boxPadX,i,g))}return b&&u.push(` </a>`),u.push(`</g>`),u.join(`
|
|
41
|
+
`)}var Ua=700;function Wa(e,t,n,r){let i=e.isAbstract?` font-style="italic"`:``,a=e.isStatic?` text-decoration="underline"`:``,o=r??`var(--_text-faint)`,s=r??`var(--_text-sec)`,c=r??`var(--_text-muted)`,l=[];e.visibility&&l.push(E`<tspan fill="${s}" font-weight="${Ua}">${oo(e.visibility)}</tspan>${e.visibilitySpace?E`<tspan fill="${o}"> </tspan>`:``}`);let u=e.isMethod?E`${e.name}(${e.params||``})`:e.name;return l.push(E`<tspan fill="${s}">${oo(u)}</tspan>`),e.type&&(l.push(E`<tspan fill="${o}"> : </tspan>`),l.push(E`<tspan fill="${c}">${oo(e.type)}</tspan>`)),E`<text x="${t}" y="${n}" class="mono" dy="${Nt}" `+E`font-size="${Ra.memberSize}" font-weight="${Ra.memberWeight}"${i}${a}>`+E`${l.join(``)}</text>`}var Ga=6;function Ka(e,t){let{x:n,y:r,width:i,height:a}=e,o=e.forClass===void 0?``:E` data-for="${S(e.forClass)}"`,s=[E`${n},${r}`,E`${n+i-Ga},${r}`,E`${n+i},${r+Ga}`,E`${n+i},${r+a}`,E`${n},${r+a}`].join(` `),c=E`${n+i-Ga},${r} ${n+i},${r+Ga} `+E`${n+i-Ga},${r+Ga}`;return E`<g class="class-note"${o}>`+E`\n <polygon points="${s}" `+E`fill="var(--bg)" stroke="var(--_node-stroke)" stroke-width="${R.innerBox}" />`+E`\n <polygon points="${c}" `+E`fill="var(--_inner-stroke)" stroke="var(--_node-stroke)" stroke-width="${R.innerBox}" />`+E`\n ${P(e.text,n+i/2,r+a/2,t.edgeLabel,E`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`)}`+`
|
|
42
|
+
</g>`}function qa(e){if(!e.linkPoints||e.linkPoints.length<2)return``;let t=e.linkPoints.map(e=>E`${e.x},${e.y}`).join(` `),n=e.forClass===void 0?``:E` data-for="${S(e.forClass)}"`;return E`<polyline class="class-note-link"${n} points="${t}" `+E`fill="none" stroke="var(--_line)" stroke-width="${R.connector}" stroke-dasharray="2 3" />`}function Ja(e){if(e.points.length<2)return``;let t=e.dashed||e.type===`dependency`||e.type===`realization`||e.type===`dashed-link`?` stroke-dasharray="6 4"`:``,n=Xa(e.type,e.markerAt),r=[`class="class-relationship"`,E`data-from="${S(e.from)}"`,E`data-to="${S(e.to)}"`,E`data-type="${e.type}"`,E`data-marker-at="${e.markerAt}"`];return e.label&&r.push(E`data-label="${S(e.label)}"`),e.fromCardinality&&r.push(E`data-from-cardinality="${S(e.fromCardinality)}"`),e.toCardinality&&r.push(E`data-to-cardinality="${S(e.toCardinality)}"`),E`<path ${r.join(` `)} d="${st(e.points,ot)}" fill="none" stroke="var(--_line)" `+E`stroke-width="${R.connector}"${t}${n} />`}function Ya(e,t){let n=e.interfaceLabel;if(!n)return``;let r=e.markerAt===`from`?e.from:e.to;return E`<g class="class-interface" data-id="${S(r)}" data-label="${S(n.text)}">\n `+P(n.text,n.x+n.width/2,n.y+n.height/2,t.nodeLabel,E`text-anchor="middle" font-size="${t.nodeLabel}" font-weight="${L.edgeLabel}" fill="var(--_text)"`)+`
|
|
43
|
+
</g>`}function Xa(e,t){let n=Za(e);return n?(t===`to`?``:E` marker-start="url(#${n})"`)+(t===`from`?``:E` marker-end="url(#${n})"`):``}function Za(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 Qa(e,t){if(!e.label&&!e.fromCardinality&&!e.toCardinality||e.points.length<2)return``;let n=[];if(e.label){let r=$a(e.points,e.labelPosition??eo(e.points)),i=j(e.label,t.edgeLabel,L.edgeLabel);n.push(ae(e.label,r.x,r.y,i.width,i.height,t.edgeLabel,4,E`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`,`class="class-relationship-label-bg" fill="var(--bg)"`))}if(e.fromCardinality&&e.points.length>=2){let r=e.points[0],i=e.points[1],a=to(r,i,`start`,no(e,`from`));n.push(P(e.fromCardinality,r.x+a.x,r.y+a.y,t.edgeLabel,E`font-size="${t.edgeLabel}" text-anchor="${a.anchor}" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`))}if(e.toCardinality&&e.points.length>=2){let r=e.points[e.points.length-1],i=e.points[e.points.length-2],a=to(r,i,`end`,no(e,`to`));n.push(P(e.toCardinality,r.x+a.x,r.y+a.y,t.edgeLabel,E`font-size="${t.edgeLabel}" text-anchor="${a.anchor}" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`))}return n.join(`
|
|
44
|
+
`)}function $a(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 eo(e){return e.length===0?{x:0,y:0}:e[Math.floor(e.length/2)]}function to(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=ro+(r?io:0),c=ao+(r?io: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 no(e,t){return Za(e.type)!==null&&(e.markerAt===t||e.markerAt===`both`)}var ro=12,io=6,ao=5,oo=C,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 so(e,t,n){let r=kt(n.fontSizes).edgeLabel,i=[];for(let[n,a]of e.relationships.entries()){if(a.entity1!==t||a.entity2!==t)continue;let e=i[i.length-1],o=a.label?j(a.label,r,L.edgeLabel).width+8:0;i.push({index:n,nest:i.length,out:e?e.out+B.loopLabelGap+e.labelW+B.loopNestGap:B.loopOut,labelW:o})}return i}function co(e){return e.replace(/<br\s{0,8}\/?>/gi,`
|
|
45
|
+
`)}function lo(e){let t=e.attributes.map(uo);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=>po(t[e])))+B.cellPadX*2}))}function uo(e){return[e.type,e.name,e.keys.join(`,`),co(e.comment??``).split(`
|
|
46
|
+
`).map(e=>e.trim()).join(` `)]}function fo(e){return Math.max(-10,((e.layout?.entityPadding??15)-15)*1.25)}function po(e){return[...e].reduce((e,t)=>e+(t.codePointAt(0)>=11904?2:1),0)*Math.ceil(Tt(`M`,B.attrFontSize))}function mo(e,t){let n=new Map,r=kt(t.fontSizes),i=(e.layout?.diagramPadding??20)-20,a=fo(e),o=e.layout?.minEntityWidth??0;for(let t of e.entities){let e=I(t.label,r.nodeLabel,L.nodeLabel),s=t.attributes.length===0,c=lo(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(Ut(e,t));let c={fontSize:r.edgeLabel},l=[];for(let[t,n]of e.relationships.entries())n.entity1!==n.entity2&&l.push(Kt({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=so(e,n.id,t),i=r[r.length-1];i&&(u=Math.max(u,i.out+i.labelW))}return{elkGraph:{id:`root`,layoutOptions:{...Ht({direction:Bt(e.direction,zt.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 ho(e,t,n,r){let i=fo(t),a=new Map;for(let e of t.entities)a.set(e.id,e);let o=[];for(let r of e.children??[]){let e=a.get(r.id);if(e){let a=n.get(e.id);if(!a)throw Error(`Missing computed size for entity "${e.id}"`);o.push({id:e.id,label:e.label,attributes:e.attributes,x:r.x??0,y:r.y??0,width:r.width??a.width,height:r.height??a.height,headerHeight:e.attributes.length===0?a.height:B.headerHeight+i,rowHeight:B.rowHeight+i,inlineStyle:oe(e.id,t),className:t.classAssignments.get(e.id)})}}let s=new Map((e.edges??[]).map(e=>[e.id,e])),c=[],l=1/0;for(let[e,n]of t.relationships.entries()){let i={entity1:n.entity1,entity2:n.entity2,cardinality1:n.cardinality1,cardinality2:n.cardinality2,label:n.label,identifying:n.identifying};if(n.entity1!==n.entity2){c.push({...i,points:qn(s.get(`e${e}`))});continue}let a=o.find(e=>e.id===n.entity1),u=so(t,n.entity1,r).find(t=>t.index===e),d=a.y+a.height/2,f=Math.max(B.loopHalf,a.height/8)+10*u.nest,p=a.x-u.out;c.push({...i,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-u.labelW/2,y:d}}),l=Math.min(l,p-B.loopLabelGap-u.labelW)}let u=Math.max(0,B.loopMargin-l);if(u>0){for(let e of o)e.x+=u;for(let e of c){for(let t of e.points)t.x+=u;e.labelPoint&&(e.labelPoint.x+=u)}}return{width:(e.width??600)+u,height:e.height??400,entities:o,relationships:c}}function go(e,t={}){if(e.entities.length===0)return{width:0,height:0,entities:[],relationships:[]};let{elkGraph:n,entitySizes:r}=mo(e,t);return ho(St(n,t.layoutCache),e,r,t)}var _o=70,vo={attrSize:11,attrWeight:400};function yo(e,t,n=`Inter`,r=!1,i=Ot,a,o,s,c={}){let l=[];l.push(aa(F(e.width,e.height,t,r,o,s,void 0,c.styleAttribute,c.description),a)),l.push(Ft(n,!0,c.nonce,c.bodyFont)),l.push(`<defs>`),l.push(`</defs>`);for(let t of e.relationships)l.push(So(t));for(let t of e.entities)l.push(bo(t,i));for(let t of e.relationships)l.push(wo(t));for(let t of e.relationships)l.push(Co(t,i));return l.push(`</svg>`),l.join(`
|
|
47
|
+
`)}function bo(e,t){let{id:n,x:r,y:i,width:a,height:o,headerHeight:s,rowHeight:c,label:l,attributes:u,inlineStyle:d}=e,f=[],p=S(d?.fill??`var(--_node-fill)`),m=S(d?.stroke??`var(--_node-stroke)`),h=S(d?.[`stroke-width`]??String(R.outerBox)),g=S(d?.[`stroke-width`]??String(R.innerBox)),_=d?.fill?p:`var(--_group-hdr)`,v=d?.color?S(d.color):void 0,y=ce(e.className);f.push(E`<g class="${y?E`entity ${y}`:`entity`}" data-id="${S(n)}" data-label="${S(l)}">`),f.push(E` <rect x="${r}" y="${i}" width="${a}" height="${o}" `+E`rx="0" ry="0" fill="${p}" stroke="${m}" stroke-width="${h}" />`),f.push(E` <rect x="${r}" y="${i}" width="${a}" height="${s}" `+E`rx="0" ry="0" fill="${_}" stroke="${m}" stroke-width="${h}" />`),f.push(` `+P(l,r+a/2,i+s/2,t.nodeLabel,E`text-anchor="middle" font-size="${t.nodeLabel}" font-weight="700" fill="${v??`var(--_text)`}"`));let b=i+s;if(u.length>0){let t=i+o,n=lo(e),s=(a-n.reduce((e,t)=>e+t.width,0))/n.length,l=[r];for(let e of n)l.push(l[l.length-1]+e.width+s);for(let e=1;!d?.fill&&e<u.length;e+=2)f.push(E` <rect x="${r}" y="${b+e*c}" width="${a}" height="${c}" `+E`fill="var(--_key-badge)" />`);let p=(e,t,n,r)=>E` <line x1="${e}" y1="${t}" x2="${n}" y2="${r}" stroke="${m}" stroke-width="${g}" />`;f.push(p(r,b,r+a,b));for(let e=1;e<u.length;e++){let t=b+e*c;f.push(p(r,t,r+a,t))}for(let e=1;e<n.length;e++)f.push(p(l[e],b,l[e],t));for(let e=0;e<u.length;e++){let t=b+e*c+c/2,r=uo(u[e]);f.push(` `+xo(u[e],n.map((e,t)=>({x:l[t]+B.cellPadX,text:r[e.cell]})),t,v).replace(/\n/g,`
|
|
48
|
+
`))}}return f.push(`</g>`),f.join(`
|
|
49
|
+
`)}function xo(e,t,n,r){let i=[];if(e.comment&&e.comment.length>0){let t=co(e.comment);i.push(E`<g><title>${Do(t)}</title>`)}return t.forEach((e,t)=>{if(!e.text)return;let a=t===1?`--_text-sec`:`--_text-muted`;i.push(E`<text x="${e.x}" y="${n}" class="mono" dy="${Nt}" `+E`font-size="${vo.attrSize}" font-weight="${vo.attrWeight}">`+E`<tspan fill="${r??`var(${a})`}">${Do(e.text)}</tspan></text>`)}),e.comment&&e.comment.length>0&&i.push(`</g>`),i.join(`
|
|
50
|
+
`)}function So(e){if(e.points.length<2)return``;let t=e.points.map(e=>E`${e.x},${e.y}`).join(` `),n=e.identifying?``:` stroke-dasharray="6 4"`,r=e.label?E` data-label="${S(e.label)}"`:``,i=[`class="er-relationship"`,E`data-entity1="${S(e.entity1)}"`,E`data-entity2="${S(e.entity2)}"`,E`data-cardinality1="${e.cardinality1}"`,E`data-cardinality2="${e.cardinality2}"`,E`data-identifying="${e.identifying}"`];return E`<polyline ${i.join(` `)}${r} points="${t}" fill="none" stroke="var(--_line)" `+E`stroke-width="${R.connector}"${n} />`}function Co(e,t){if(!e.label||e.points.length<2)return``;let n=e.labelPoint??Eo(e.points),r=j(e.label,t.edgeLabel,L.edgeLabel),i=r.width+8,a=r.height+6;return E`<rect x="${n.x-i/2}" y="${n.y-a/2}" width="${i}" height="${a}" rx="2" ry="2" `+`fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="0.5" />`+E`\n${P(e.label,n.x,n.y,t.edgeLabel,E`text-anchor="middle" font-size="${t.edgeLabel}" font-weight="${L.edgeLabel}" fill="color-mix(in srgb, var(--fg) ${_o}%, var(--bg))"`)}`}function wo(e){if(e.points.length<2)return``;let t=[],n=e.points[0],r=e.points[1];t.push(To(n,r,e.cardinality1));let i=e.points[e.points.length-1],a=e.points[e.points.length-2];return t.push(To(i,a,e.cardinality2)),t.join(`
|
|
51
|
+
`)}function To(e,t,n){let r=[],i=R.connector+.25,a=e.x-t.x,o=e.y-t.y,s=Math.sqrt(a*a+o*o);if(s===0)return``;let c=a/s,l=o/s,u=-l,d=c,f=e.x-c*4,p=e.y-l*4,m=e.x-c*16,h=e.y-l*16,g=n===`one`||n===`zero-one`,_=n===`many`||n===`zero-many`,v=n===`zero-one`||n===`zero-many`;if(g){r.push(E`<line x1="${f+u*6}" y1="${p+d*6}" `+E`x2="${f-u*6}" y2="${p-d*6}" `+E`stroke="var(--_line)" stroke-width="${i}" />`);let e=f-c*4,t=p-l*4;r.push(E`<line x1="${e+u*6}" y1="${t+d*6}" `+E`x2="${e-u*6}" y2="${t-d*6}" `+E`stroke="var(--_line)" stroke-width="${i}" />`)}if(_){let e=f,t=p;r.push(E`<line x1="${e+u*7}" y1="${t+d*7}" `+E`x2="${m}" y2="${h}" `+E`stroke="var(--_line)" stroke-width="${i}" />`),r.push(E`<line x1="${e}" y1="${t}" `+E`x2="${m}" y2="${h}" `+E`stroke="var(--_line)" stroke-width="${i}" />`),r.push(E`<line x1="${e-u*7}" y1="${t-d*7}" `+E`x2="${m}" y2="${h}" `+E`stroke="var(--_line)" stroke-width="${i}" />`)}if(n===`many`){let t=e.x-c*20,n=e.y-l*20;r.push(E`<line x1="${t+u*6}" y1="${n+d*6}" `+E`x2="${t-u*6}" y2="${n-d*6}" `+E`stroke="var(--_line)" stroke-width="${i}" />`)}if(v){let t=_?20:12,n=e.x-c*t,a=e.y-l*t;r.push(E`<circle cx="${n}" cy="${a}" r="4" `+E`fill="var(--bg)" stroke="var(--_line)" stroke-width="${i}" />`)}return r.join(`
|
|
52
|
+
`)}function Eo(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 Do=C,Oo={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},ko=60,Ao=45,jo=20;function Mo(e){return e+8}var No=14,Po=74;function Fo(e,t){return e.type===`actor`?Math.max(44,t):t}function Io(e){return e.type===`actor`?15:14}var Lo=new Set([`boundary`,`control`,`entity`,`database`]);function Ro(e){return e.type===`actor`||Lo.has(e.participantType)}var zo=4;function Bo(e,t,n,r){return e+j(t,n,r).height/2}function Vo(e,t){let n=(e,t)=>(e??t)-t,r=n(t?.noteMargin,10),i=n(t?.diagramMarginX,50);return{...Oo,padding:Oo.padding+i,paddingY:Oo.paddingY+n(t?.diagramMarginY,10),bottomAdj:Math.max(0,n(t?.bottomMarginAdj,1)),actorMinWidth:Oo.actorMinWidth+n(t?.width,150),actorGap:Oo.actorGap+n(t?.actorMargin,50),activationWidth:Oo.activationWidth+n(t?.activationWidth,10),selfMessageHeight:Oo.selfMessageHeight-(t?.rightAngles?10:0),notePadX:Oo.notePadX+r,notePadY:Oo.notePadY+r,actorHeight:e?.actorHeight??Oo.actorHeight+n(t?.height,65),headerGap:e?.headerGap??Oo.headerGap,messageRowHeight:e?.messageRowHeight??Oo.messageRowHeight+n(t?.boxMargin,10),noteOffsetAfterMessage:e?.noteOffsetAfterMessage??Oo.noteOffsetAfterMessage,noteStackGap:e?.noteStackGap??Oo.noteStackGap}}var Ho=16;function Uo(e,t,n=L.edgeLabel){return j(e,t,n).width}var Wo=.5;function Go(e){return e.blockPadX+1}var Ko=.2,qo=.24;function Jo(e,t,n){let r=18*qo,i=18*Ko;return[[e,t],[e+n,t],[e+n,t+18-i],[e+n-r,t+18],[e,t+18]]}function Yo(e,t){return e.type===`rect`&&e.color!==void 0?0:Uo(e.type,t,L.groupHeader)+16}function Xo(e,t,n){let r=`[${e}]`,i=[];for(let e of r.split(`
|
|
53
|
+
`)){let r=``;for(let a of e.split(` `))if(Uo(`${a} `,n)>t){let e=[...a];i.push(r),r=``,e.forEach((a,o)=>{Uo(r+a,n)>=t?(i.push(o===e.length-1?r+a:`${r+a}-`),r=``):r+=a})}else r&&Uo(r,n)+Uo(`${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 Zo(e,t){return e?(e.split(`
|
|
55
|
+
`).length-1)*t*r:0}function Qo(e){return e.map((t,n)=>e.slice(0,n).flatMap((e,n)=>e.startIndex>=t.startIndex&&e.endIndex<=t.endIndex?[n]:[]))}function $o(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=Uo(t.label,i);e===n?(o(e-1,e,r/2+Ho),o(e,e+1,r/2+Ho)):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,Uo(n.text,i)+r.notePadX*2),c=t[e]/2+r.noteGap+s+Ho;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+Ho),o(e-1,e,s/2+Ho);else{let t=a.get(n.actorIds[n.actorIds.length-1]);o(Math.min(e,t),Math.max(e,t),s-50)}}}function es(e,t,n){let r=e=>I(e,n,L.edgeLabel)<=t;return e.split(`
|
|
56
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
57
|
`)}).join(`
|
|
58
|
-
`)}function
|
|
59
|
-
`).length,s=c.edgeLabel*(1+(a-1)*
|
|
60
|
-
`)}function
|
|
61
|
-
</marker>`+
|
|
62
|
-
</marker>`+
|
|
63
|
-
</marker>`}var
|
|
64
|
-
`)}var
|
|
65
|
-
`)}function
|
|
66
|
-
`)}function
|
|
67
|
-
`);let r=e.label?
|
|
68
|
-
`)}var
|
|
69
|
-
</g>`}var B={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},Qo=.8;function $o(e){return e.min>=0||e.min===e.max}function es(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 ts(e,t,n){let r=s(e.yAxis.range,e.series.flatMap(e=>e.data)),i=w(r.min,r.max),a=fs(i),o=Math.min(n(a)/2,.2*t),c=r.max-r.min;return{range:r,ticks:i,labels:a,pad:o,frac:e=>c>0?(e-r.min)/c:.5}}function ns(e,t,n){let r=e.xAxis.categories?void 0:e.xAxis.range,i=e=>n?B.axisLabelFontSize/2:Qo*Math.max(...e.map(e=>N(e,B.axisLabelFontSize,B.axisLabelFontWeight)))/2,a=e.series.some(e=>e.type===`bar`);if(!r){let n=os(e),r=ss(e,n),{p0:o,pad:s,bar:c}=es(t,n,i(r)),l=a?s:o,u=e=>n<2?t/2:l+e*(t-2*l)/(n-1);return{at:(e,t)=>u(t),ticks:r.map((e,t)=>({label:e,at:u(t)})),bar:c}}let o=w(r.min,r.max),s=fs(o),{p0:c,pad:l,bar:u}=es(t,o.length,i(s)),d=a?l:c,f=r.max-r.min,p=e=>{let i=f>0?(e-r.min)/f:.5;return d+(n?1-i:i)*(t-2*d)};return{at:(e,t)=>p(e<2?r.min:r.min+t*f/(e-1)),ticks:o.map((e,t)=>({label:s[t],at:p(e)})),bar:u}}function rs(e,t={}){return e.horizontal?as(e):is(e)}function is(e){let t=!!e.title,n=!!e.xAxis.title,r=!!e.yAxis.title;if(!e.yAxis.range)throw Error(`XY chart: y-axis range was not set by the parser`);let i=ts(e,B.plotHeight,()=>B.axisLabelHeight),a=i.ticks,o=i.labels,s=Math.max(...o.map(e=>N(e,B.axisLabelFontSize,B.axisLabelFontWeight)),B.yLabelWidth),c=B.padding+(t?B.titleHeight:0),l=B.padding+B.xLabelHeight+(n?B.axisTitlePad:0),u=B.padding+s+B.yLabelGap+(r?B.axisTitlePad:0),d=B.padding,f=B.plotWidth,p=B.plotHeight,m=u+f+d,h=c+p+l,g={x:u,y:c,width:f,height:p},_=os(e),v=ns(e,f,!1),y=(e,t)=>u+v.at(e,t),b=e=>c+p-i.pad-i.frac(e)*(p-2*i.pad),x=c+p,S=v.ticks.map(e=>({label:e.label,x:u+e.at,y:x,tx:u+e.at,ty:x+B.tickLength,labelX:u+e.at,labelY:x+18,textAnchor:`middle`})),C=a.map((e,t)=>({label:o[t],x:u,y:b(e),tx:u-B.tickLength,ty:b(e),labelX:u-B.yLabelGap,labelY:b(e),textAnchor:`end`})),w=a.map(e=>({x1:u,y1:b(e),x2:u+f,y2:b(e)})),T=ss(e,_),E=e.series.map((e,t)=>t),D=us(e,y,b,v.bar,$o(i.range)?c+p:b(0),T,E),O=ds(e,y,b,T,E),k=ms(e,E),A={x1:u,y1:c+p,x2:u+f,y2:c+p},ee={x1:u,y1:c,x2:u,y2:c+p},te={ticks:S,line:A,...e.xAxis.title?{title:{text:e.xAxis.title,x:u+f/2,y:h-B.padding}}:{}},ne={ticks:C,line:ee,...e.yAxis.title?{title:{text:e.yAxis.title,x:B.padding+4,y:c+p/2,rotate:-90}}:{}};return{width:m,height:h,title:e.title?{text:e.title,x:m/2,y:B.padding+B.titleFontSize}:void 0,xAxis:te,yAxis:ne,plotArea:g,bars:D,lines:O,gridLines:w,legend:k}}function as(e){let t=!!e.title,n=!!e.xAxis.title,r=!!e.yAxis.title;if(!e.yAxis.range)throw Error(`XY chart: y-axis range was not set by the parser`);let i=ts(e,B.plotWidth,e=>Qo*Math.max(...e.map(e=>N(e,B.axisLabelFontSize,B.axisLabelFontWeight)))),a=i.ticks,o=i.labels,s=ss(e,os(e)),c=ns(e,B.plotHeight,!0),l=Math.max(...c.ticks.map(({label:e})=>N(e,B.axisLabelFontSize,B.axisLabelFontWeight)),40),u=B.padding+(t?B.titleHeight:0)+(r?B.axisTitlePad:0)+B.xLabelHeight,d=B.padding,f=B.padding+l+B.yLabelGap+(n?B.axisTitlePad:0),p=Math.max(B.padding,N(o[o.length-1],B.axisLabelFontSize,B.axisLabelFontWeight)/2+4),m=B.plotWidth,h=B.plotHeight,g=f+m+p,_=u+h+d,v={x:f,y:u,width:m,height:h},y=e=>f+i.pad+i.frac(e)*(m-2*i.pad),b=(e,t)=>u+c.at(e,t),x=a.map((e,t)=>({label:o[t],x:y(e),y:u,tx:y(e),ty:u-B.tickLength,labelX:y(e),labelY:u-18,textAnchor:`middle`})),S=c.ticks.map(({label:e,at:t})=>({label:e,x:f,y:u+t,tx:f-B.tickLength,ty:u+t,labelX:f-B.yLabelGap,labelY:u+t,textAnchor:`end`})),C=a.map(e=>({x1:y(e),y1:u,x2:y(e),y2:u+h})),w=e.series.map((e,t)=>t),T=e.series.filter(e=>e.type===`bar`).length,E=[];if(T>0){let t=c.bar,n=t,r=0,a=0;for(let o of e.series){if(o.type!==`bar`){a++;continue}for(let e=0;e<o.data.length;e++){let c=b(o.data.length,e)-n/2,l=y(Math.max(o.data[e],i.range.min)),u=$o(i.range)?f:y(0);E.push({x:Math.min(u,l),y:c,width:Math.abs(l-u),height:t,value:o.data[e],label:s[e],seriesIndex:r,colorIndex:w[a]})}r++,a++}}let D=[],O=0,k=0;for(let t of e.series){if(t.type!==`line`){k++;continue}let e=t.data.map((e,n)=>({x:y(e),y:b(t.data.length,n),value:e,label:s[n]}));D.push({points:e,seriesIndex:O,colorIndex:w[k]}),O++,k++}let A={x1:f,y1:u,x2:f+m,y2:u},ee={x1:f,y1:u,x2:f,y2:u+h},te={ticks:x,line:A,...e.yAxis.title?{title:{text:e.yAxis.title,x:f+m/2,y:B.padding+(t?B.titleHeight:0)+B.axisTitlePad/2}}:{}},ne={ticks:S,line:ee,...e.xAxis.title?{title:{text:e.xAxis.title,x:B.padding+4,y:u+h/2,rotate:-90}}:{}};return{width:g,height:_,horizontal:!0,title:e.title?{text:e.title,x:g/2,y:B.padding+B.titleFontSize}:void 0,xAxis:te,yAxis:ne,plotArea:v,bars:E,lines:D,gridLines:C,legend:ms(e,w)}}function os(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 ss(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)=>ps(n+i*t))}return Array.from({length:t},(e,t)=>String(t+1))}var cs=8;function ls(e,t){let n=e.map(e=>N(e,B.axisLabelFontSize,B.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<cs){i=!1;break}if(i)return r}return Math.max(1,e.length)}function us(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 ds(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 fs(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 ps(e){return Number.isInteger(e)?String(e):e.toFixed(+(Math.abs(e)<10))}function ms(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 V={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 hs(e,t,n=`Inter`,i=!1,a=!1,o,s,c,l={}){let u=[],d=Math.max(0,...e.bars.map(e=>e.colorIndex),...e.lines.map(e=>e.colorIndex)),{style:f,defs:p,cls:m}=gs(e,a,t.accent,t.bg,l.nonce),h=Fi(se(M(e.width,e.height,t,i,s,c,void 0,l.styleAttribute,l.description).replace(`<svg `,`<svg data-xychart-colors="${d}" `),m),o);u.push(h),u.push(r(n,!1,l.nonce,l.bodyFont)),u.push(f),p&&u.push(p);let{plotArea:g}=e,_=g.y+g.height;u.push(e.horizontal?`<path d="M${U(g.x)},${U(_)} V${U(g.y)} H${U(g.x+g.width)}" class="xychart-axis"/>`:`<path d="M${U(g.x)},${U(g.y)} V${U(_)} H${U(g.x+g.width)}" class="xychart-axis"/>`);for(let t of[...e.xAxis.ticks,...e.yAxis.ticks])u.push(`<path d="M${U(t.x)},${U(t.y)} L${U(t.tx)},${U(t.ty)}" class="xychart-axis"/>`);let v=[];for(let t of e.bars){let n=` data-value="${t.value}"${t.label?` data-label="${Ss(t.label)}"`:``}`,r=Math.max(t.x,g.x),i=Math.min(t.x+t.width,g.x+g.width),o=Math.max(t.y,g.y),s=Math.min(t.y+t.height,g.y+g.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-${t.colorIndex}"${n}/>`),a){let n=xs(t.value),a=t.label?`${t.label}: ${n}`:n,c=bs((r+i)/2,o,n);v.push({extent:e.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>${Ss(a)}</title>`+c+`</g>`})}}v.sort((e,t)=>t.extent-e.extent);for(let t of e.lines){if(t.points.length===0)continue;let e=_s(t.points);u.push(`<path d="${e}" class="xychart-line-shadow xychart-color-${t.colorIndex}" transform="translate(0,2)"/>`),u.push(`<path d="${e}" class="xychart-line xychart-color-${t.colorIndex}"/>`)}let y=Math.max(...e.lines.map(e=>e.points.length),0),b=y>0&&y<=12,x=[];if(a){let t=new Map;for(let n of e.legend)n.type===`line`&&t.set(n.seriesIndex,n.label);let n=new Map;for(let t of e.lines)for(let e of t.points){let r=U(e.x),i=n.get(r)??[];n.set(r,i),i.push({x:e.x,y:e.y,value:e.value,label:e.label,seriesIndex:t.seriesIndex,colorIndex:t.colorIndex})}for(let e of n.values()){let n=e[0].x,r=e[0].label||``;if(a&&e.length>1){let i=Math.min(...e.map(e=>e.y)),a=Math.max(...e.map(e=>e.y)),o=V.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=e.map(e=>({text:xs(e.value),legendLabel:t.get(e.seriesIndex)||`Line ${e.seriesIndex+1}`})),l=ys(n,i-V.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 t of e){let e=` data-value="${t.value}"${t.label?` data-label="${Ss(t.label)}"`:``}`;f+=`<circle cx="${U(t.x)}" cy="${U(t.y)}" r="${V.dotRadius}" class="xychart-dot xychart-color-${t.colorIndex}"${e}/>`}f+=`<title>${Ss(d)}</title>${l}</g>`,x.push(f)}else if(a){let t=e[0],r=` data-value="${t.value}"${t.label?` data-label="${Ss(t.label)}"`:``}`,i=xs(t.value),a=t.label?`${t.label}: ${i}`:i,o=bs(n,t.y-V.dotRadius,i),s=b?`<circle cx="${U(n)}" cy="${U(t.y)}" r="${V.dotRadius*3}" fill="transparent" class="xychart-hit"/>`:``;x.push(`<g class="xychart-dot-group">${s}<circle cx="${U(t.x)}" cy="${U(t.y)}" r="${V.dotRadius}" class="xychart-dot xychart-color-${t.colorIndex}"${r}/><title>${Ss(a)}</title>${o}</g>`)}}}for(let t of e.xAxis.ticks)t.label!==``&&u.push(`<text x="${t.labelX}" y="${t.labelY}" text-anchor="${t.textAnchor}" font-size="${V.labelSize}" font-weight="${V.labelWeight}" dy="${I}" class="xychart-label">${Ss(t.label)}</text>`);for(let t of e.yAxis.ticks)u.push(`<text x="${t.labelX}" y="${t.labelY}" text-anchor="${t.textAnchor}" font-size="${V.labelSize}" font-weight="${V.labelWeight}" dy="${I}" class="xychart-label">${Ss(t.label)}</text>`);if(e.xAxis.title){let t=e.xAxis.title,n=t.rotate?` transform="rotate(${t.rotate},${t.x},${t.y})"`:``;u.push(`<text x="${t.x}" y="${t.y}" text-anchor="middle"${n} font-size="${V.axisTitleSize}" font-weight="${V.axisTitleWeight}" dy="${I}" class="xychart-axis-title">${Ss(t.text)}</text>`)}if(e.yAxis.title){let t=e.yAxis.title,n=t.rotate?` transform="rotate(${t.rotate},${t.x},${t.y})"`:``;u.push(`<text x="${t.x}" y="${t.y}" text-anchor="middle"${n} font-size="${V.axisTitleSize}" font-weight="${V.axisTitleWeight}" dy="${I}" class="xychart-axis-title">${Ss(t.text)}</text>`)}e.title&&u.push(`<text x="${e.title.x}" y="${e.title.y}" text-anchor="middle" font-size="${V.titleSize}" font-weight="${V.titleWeight}" dy="${I}" class="xychart-title">${Ss(e.title.text)}</text>`);for(let e of v)u.push(e.html);for(let e of x)u.push(e);return u.push(`</svg>`),u.join(`
|
|
70
|
-
`)}function
|
|
58
|
+
`)}function ts(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?es(e.text,a,t):e.text})),messages:e.messages.map(e=>({...e,label:e.wrap??n.wrap?es(e.label,o,t):e.label}))}}function ns(e,t={}){let n=e.layout?.wrap||e.messages.some(e=>e.wrap)||e.notes.some(e=>e.wrap)?ts(e,kt(t.fontSizes).edgeLabel):e;if(n.actors.length===0)return{width:0,height:0,actors:[],lifelines:[],messages:[],activations:[],blocks:[],notes:[],boxes:[],footerActors:[]};let i=Vo(t.sequence,n.layout),a=e=>e===`left`||e===`right`?e:void 0,o=a(n.layout?.noteAlign),s=a(n.layout?.messageAlign),c=kt(t.fontSizes),l=n.actors.map(e=>{let t=I(e.label,c.nodeLabel,L.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-Oo.actorGap)));$o(n,l,u,i,c.edgeLabel);let d=[],f=i.padding+l[0]/2;for(let e=0;e<n.actors.length;e++)f+=u[e],d.push(f);let p=new Map;for(let e=0;e<n.actors.length;e++)p.set(n.actors[e].id,e);let m=n.boxes.filter(e=>e.actorIds.length>0),h=m.some(e=>e.label!==``),g=m.length===0?0:i.boxPad+(h?Mo(c.edgeLabel):0),_=n.title?i.titleBand:0,v=i.paddingY+_,y=v+g,b=n.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:Fo(e,i.actorHeight)})),x=e=>b[e].height,S=Math.max(...n.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=n.actors.map(e=>Ro(e)?Bo(Io(e),e.label,c.nodeLabel,L.nodeLabel):0),E=Math.max(0,...n.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+zo+D:0),k=[],A=new Map,ee=new Map,M=new Map,te=n.blocks.map(e=>{let t=n.messages.slice(e.startIndex,e.endIndex+1).flatMap(e=>[d[p.get(e.from)],d[p.get(e.to)]]),r=t.length?Math.max(...t)-Math.min(...t):d[d.length-1]-d[0],i=Math.max(r-14,60),a=e=>e&&Xo(e,i,c.edgeLabel);return{label:a(e.label),dividers:e.dividers.map(e=>a(e.label))}});n.blocks.forEach((e,t)=>{let r=n.blocks.some((n,r)=>r<t&&n.startIndex===e.startIndex),a=Zo(te[t].label,c.edgeLabel),o=r?0:i.blockHeaderLabelGap;M.set(e.startIndex,(M.get(e.startIndex)??0)+a+o),A.set(e.startIndex,(A.get(e.startIndex)??0)+i.blockHeaderExtra+a+(r?i.blockNestedHeaderGap:o));for(let[r,a]of e.dividers.entries()){let e=n.blocks.some(e=>e.startIndex===a.index);ee.set(a.index,i.dividerExtra+(e?0:i.dividerLabelGap)+Zo(te[t].dividers[r],c.edgeLabel))}});let ne=Qo(n.blocks),re=new Map;n.blocks.forEach((e,t)=>{let n=re.get(e.endIndex)??[];n.push(t),re.set(e.endIndex,n)});let N=[],ie=e=>n.notes.slice(e.noteStartIndex,e.noteEndIndex),P=new Map;for(let e of n.notes){let t=P.get(e.afterIndex)??[];t.push(e),P.set(e.afterIndex,t)}let ae=[],oe=new Map,se=(e,t)=>{let n=Math.max(i.noteWidth,Uo(e.text,c.edgeLabel)+i.notePadX*2),a=e.text.split(`
|
|
59
|
+
`).length,s=c.edgeLabel*(1+(a-1)*r)+i.notePadY*2,u=p.get(e.actorIds[0]??``)??0,f;if(e.position===`left`)f=d[u]-l[u]/2-n-i.noteGap;else if(e.position===`right`)f=d[u]+l[u]/2+i.noteGap;else if(e.actorIds.length>1){let t=p.get(e.actorIds[e.actorIds.length-1]??``)??u,r=d[u],i=d[t];n=Math.max(n,Math.abs(r-i)+50),f=(r+i)/2-n/2}else f=d[u]-n/2;let m={text:e.text,x:f,y:t,width:n,height:s,position:e.position,actors:e.actorIds,...o&&{align:o}};return ae.push(m),oe.set(e,m),t+s+i.noteStackGap},ce=P.get(-1);if(ce&&ce.length>0){let e=O;for(let t of ce)e=se(t,e);O=Math.max(O,e+i.messageRowHeight/2)}let le=new Map,ue=[],de=i.activationWidth/2;function fe(e,t,n=!1){let r=n?t+i.selfMessageHeight+2:t,a=le.get(e)??[];le.set(e,a);let o=a.length;a.push({startY:r,depth:o})}function pe(e,t,n=!1){let r=n?t+i.selfMessageHeight:t,a=le.get(e);if(!a||a.length===0)return;let{startY:o,depth:s}=a.pop(),c=p.get(e)??0,l=s*de;ue.push({actorId:e,x:d[c]-i.activationWidth/2+l,topY:o,bottomY:r,width:i.activationWidth,depth:s})}let F=new Map;for(let e of n.activations){let t=F.get(e.afterIndex)??[];t.push(e),F.set(e.afterIndex,t)}function me(e,t,n=!1){for(let r of F.get(e)??[])r.kind===`start`?fe(r.actorId,t,n):pe(r.actorId,t,n)}me(-1,O);let he=n.mirrorActors!==!1,ge=[];for(let e=0;e<n.messages.length;e++){let t=n.messages[e],r=p.get(t.from)??0,a=p.get(t.to)??0,o=t.from===t.to&&he&&n.actors[r].destroyedAt===e,u=t.from===t.to&&!o;O+=(A.get(e)??0)+(ee.get(e)??0);let f=Zo(t.label,c.edgeLabel);O+=f,ge[e]=f;let m=d[r],h=d[a];o&&(m-=Ro(n.actors[r])?18:l[r]/2);let g=!u&&n.actors[a].createdAt===e;if(g){let e=l[a]/2;h+=m<h?-e:e}if(!o&&he&&r!==a){let t=Math.sign(h-m),i=e=>Ro(n.actors[e])?18:l[e]/2;n.actors[r].destroyedAt===e&&(m+=t*(i(r)+1)),n.actors[a].destroyedAt===e&&(h-=t*(i(a)+8))}k.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&&n.layout?.rightAngles&&{rightAngles:!0},seqNumber:t.seqNumber}),t.activate&&fe(t.to,O,u),t.deactivate&&pe(t.from,O,u),me(e,O,u),O+=u?i.selfMessageHeight+i.messageRowHeight:i.messageRowHeight,g&&(O+=x(a)/2);let _=t=>{let r=k[e].y+(u?20:0)+i.blockPadBottom+12;for(let e of ie(n.blocks[t])){let t=oe.get(e);r=Math.max(r,t.y+t.height+i.blockPadBottom)}for(let e of ne[t])r=Math.max(r,N[e]+i.blockPadBottom);N[t]=r,O=Math.max(O,r+i.messageRowHeight/2)},v=re.get(e)??[],y=P.get(e);if(y&&y.length>0){let t=u?i.selfMessageHeight:0,r=k[e].y+t+i.noteOffsetAfterMessage;for(let e of y){let t=n.notes.indexOf(e);for(let e of v)N[e]===void 0&&n.blocks[e].noteEndIndex<=t&&(_(e),r=Math.max(r,N[e]+i.noteOffsetAfterMessage));r=se(e,r)}O=Math.max(O,r+i.messageRowHeight/2)}for(let e of v)N[e]===void 0&&_(e)}for(let[e,t]of le)for(let{startY:n,depth:r}of t){let t=p.get(e)??0,a=r*de;ue.push({actorId:e,x:d[t]-i.activationWidth/2+a,topY:n,bottomY:O-i.messageRowHeight/2,width:i.activationWidth,depth:r})}ue.sort((e,t)=>e.depth-t.depth);let _e=[];n.blocks.forEach((e,t)=>{let r=ne[t].map(e=>_e[e]),a=(k[e.startIndex]?.y??O)-i.blockPadTop-M.get(e.startIndex)-(ge[e.startIndex]??0);for(let e of r)a=Math.min(a,e.y-i.blockHeaderExtra-i.blockNestedHeaderGap);let o=N[t]??O+i.blockPadBottom+12,s=new Set;for(let t=e.startIndex;t<=e.endIndex;t++){let e=n.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<n.actors.length;e++)s.add(e);let l=Math.min(...s),u=Math.max(...s),f=Go(i),m=d[l]-f,h=d[u]+f;for(let t of n.messages.slice(e.startIndex,e.endIndex+1)){if(t.from!==t.to)continue;let e=d[p.get(t.from)],n=Uo(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 ue){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 ie(e)){let e=oe.get(t);m=Math.min(m,e.x-i.blockPadX),h=Math.max(h,e.x+e.width+i.blockPadX)}for(let e of r)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=r.filter((r,i)=>n.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=k[e.index];return{y:(l?.y??O)-((e.label&&l?.label?40:28)+i.dividerLabelGap+Zo(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=ae,ye=O,be=Math.max(0,...n.actors.map((e,t)=>e.destroyedAt===void 0&&T[t]>0?T[t]+zo: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 k)if(e.isSelf&&(Ce=Math.max(Ce,e.x1+45+8),e.label)){let t=I(e.label,c.edgeLabel,L.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 k)e.x1+=we,e.x2+=we;for(let e of ue)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<n.actors.length;e++){let t=n.actors[e].createdAt;t!==void 0&&(b[e].y=(k[t]?.y??O)-x(e)/2)}let Te=n.actors.map((e,t)=>{let n=e.destroyedAt,r={actorId:e.id,x:d[t],topY:b[t].y+(e.type===`actor`?Math.max(Po,x(t)+T[t]+zo):x(t)+(T[t]>0?T[t]+zo:0)),bottomY:n===void 0?ye:(k[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)=>n.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=n.title?j(n.title,18,L.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:k,activations:ue,blocks:_e,notes:ve,boxes:w,footerActors:Ee,...n.title&&{title:{text:n.title,y:i.paddingY+9}}}}function rs(e,t,n=`Inter`,r=!1,i=Ot,a,s,c,l={}){let u=[];u.push(aa(F(e.width,e.height,t,r,s,c,void 0,l.styleAttribute,l.description),a)),u.push(o(n,!1,l.nonce,l.bodyFont)),u.push(`<defs>`),u.push(is()),u.push(`</defs>`);for(let t of e.boxes)u.push(vs(t,i));for(let t of e.blocks.toReversed())ys(t)&&u.push(bs(t,i));for(let t of e.lifelines)u.push(ps(t));for(let t of e.activations)u.push(ms(t));for(let t of e.blocks)ys(t)||u.push(bs(t,i));for(let t of e.footerActors)u.push(os(t,i,`actor-footer`));for(let t of e.messages)u.push(hs(t,i));for(let t of e.notes)u.push(Cs(t,i));for(let t of e.actors)u.push(os(t,i));return e.title&&u.push(`<g class="title">`+P(e.title.text,e.width/2,e.title.y,18,E`font-size="${18}" text-anchor="middle" font-weight="${L.groupHeader}" fill="var(--_text)"`)+`</g>`),u.push(`</svg>`),u.join(`
|
|
60
|
+
`)}function is(){let e=Pt.width,t=Pt.height;return E` <marker id="seq-arrow" markerWidth="${e}" markerHeight="${t}" refX="${e}" refY="${t/2}" orient="auto-start-reverse">`+E`\n <polygon points="0 0, ${e} ${t/2}, 0 ${t}" fill="var(--_arrow)" />`+`
|
|
61
|
+
</marker>`+E`\n <marker id="seq-arrow-open" markerWidth="${e}" markerHeight="${t}" refX="${e}" refY="${t/2}" orient="auto-start-reverse">`+E`\n <polyline points="0 0, ${e} ${t/2}, 0 ${t}" fill="none" stroke="var(--_arrow)" stroke-width="1" />`+`
|
|
62
|
+
</marker>`+E`\n <marker id="seq-lost" markerWidth="${t*2}" markerHeight="${t*2}" refX="${t}" refY="${t}" orient="auto">`+E`\n <path d="M${t/2} ${t/2} L${t*1.5} ${t*1.5} M${t*1.5} ${t/2} L${t/2} ${t*1.5}" fill="none" stroke="var(--_arrow)" stroke-width="1" />`+`
|
|
63
|
+
</marker>`}var as={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 os(e,t,n=`actor`){let{id:r,x:i,y:a,width:o,height:s,label:c,type:l,participantType:u}=e,d=[],f=E`font-size="${t.nodeLabel}" text-anchor="middle" font-weight="${L.nodeLabel}" fill="var(--_text)"`;if(d.push(E`<g class="${n}" data-id="${S(r)}" data-label="${S(c)}" data-type="${l}">`),l===`actor`){let e=44/65,n=a,r=t=>i+t*e,o=t=>n+t*e,l=E`stroke="var(--_line)" stroke-width="2"`;d.push(E` <circle cx="${i}" cy="${o(15)}" r="${15*e}" fill="var(--_node-fill)" ${l} />`+E`\n <path d="M${i} ${o(30)}V${o(50)}M${r(-18)} ${o(38)}H${r(18)}M${r(-18)} ${o(65)}L${i} ${o(50)}L${r(16)} ${o(65)}" fill="none" ${l} />`),d.push(` `+P(c,i,a+s+15,t.nodeLabel,f))}else if(Ro(e)){let e=s/24*.9,n=R.outerBox/e,r=E`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${n}"`,o=E`fill="none" stroke="var(--_node-stroke)" stroke-width="${n}"`,l=as[u](r,o);d.push(E` <g transform="translate(${i-12*e},${a+(s-24*e)/2}) scale(${e})">${l}\n </g>`),d.push(` `+P(c,i,a+s+14,t.nodeLabel,f))}else{let e=i-o/2,n=E`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}"`,r=i,l=a+s/2;if(u===`queue`){let t=s/2,r=e+8,i=e+o-8;d.push(E` <path d="M${r},${a}H${i}A${8},${t} 0 0 1 ${i},${a+s}H${r}A${8},${t} 0 0 1 ${r},${a}Z" ${n} />`,E` <path d="M${i},${a}A${8},${t} 0 0 0 ${i},${a+s}" fill="none" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`)}else u===`collections`?(d.push(E` <rect x="${e+4}" y="${a}" width="${o-4}" height="${s-4}" rx="4" ry="4" ${n} />`,E` <rect x="${e}" y="${a+4}" width="${o-4}" height="${s-4}" rx="4" ry="4" ${n} />`),r=i-2,l=a+2+(s-4)/2):d.push(E` <rect x="${e}" y="${a}" width="${o}" height="${s}" rx="4" ry="4" ${n} />`);d.push(` `+P(c,r,l,t.nodeLabel,f))}return d.push(`</g>`),d.join(`
|
|
64
|
+
`)}var ss=10;function cs(e,t){return e.y-ss-Zo(e.label,t.edgeLabel)/2}function ls(e,t){return e.y+9+Zo(e.label,t.edgeLabel)/2}function us(e,t){return e.y+14+Zo(e.label,t.edgeLabel)/2}var ds=`2 2`,fs=`3 3`;function ps(e){return E`<line class="lifeline" data-actor="${S(e.actorId)}" `+E`x1="${e.x}" y1="${e.topY}" x2="${e.x}" y2="${e.bottomY}" `+`stroke="var(--_line)" stroke-width="${Wo}" />`}function ms(e){return E`<rect class="activation" data-actor="${S(e.actorId)}" `+E`x="${e.x}" y="${e.topY}" width="${e.width}" height="${e.bottomY-e.topY}" `+E`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${R.innerBox}" />`}function hs(e,t){let n=[],r=e.lineStyle===`dashed`?` stroke-dasharray="6 4"`:``,i=e.isLost?`seq-lost`:e.arrowHead===`filled`?`seq-arrow`:`seq-arrow-open`,a=e.bidirectional?E` marker-start="url(#${i})"`:``;if(n.push(E`<g class="message" data-from="${S(e.from)}" data-to="${S(e.to)}" `+E`data-label="${S(e.label)}" data-line-style="${e.lineStyle}" `+E`data-arrow-head="${e.arrowHead}" data-self="${e.isSelf}" data-bidirectional="${e.bidirectional}"${e.isLost?` data-lost="true"`:``}>`),e.isSelf){let t=e.rightAngles?E`M ${e.x1},${e.y-10} H ${e.x1+75} V ${e.y+15} H ${e.x2}`:E`M ${e.x1},${e.y} C ${e.x1+60},${e.y-10} ${e.x1+60},${e.y+20+10} ${e.x2},${e.y+20}`;n.push(E` <path d="${t}" `+E`fill="none" stroke="var(--_line)" stroke-width="${R.connector}"${r} marker-end="url(#${i})"${a} />`)}else n.push(E` <line x1="${e.x1}" y1="${e.y}" x2="${e.x2}" y2="${e.y}" `+E`stroke="var(--_line)" stroke-width="${R.connector}"${r} marker-end="url(#${i})"${a} />`);return n.push(` `+P(e.label,e.labelAlign===`left`?Math.min(e.x1,e.x2)+Ss:e.labelAlign===`right`?Math.max(e.x1,e.x2)-Ss:(e.x1+e.x2)/2,cs(e,t),t.edgeLabel,E`font-size="${t.edgeLabel}" text-anchor="${e.labelAlign===`left`?`start`:e.labelAlign===`right`?`end`:`middle`}" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`)),e.seqNumber!==void 0&&n.push(` `+gs(e,t)),n.push(`</g>`),n.join(`
|
|
65
|
+
`)}function gs(e,t){let n=Math.max(t.edgeLabel-2,8),r=e.bidirectional?e.x1+Math.sign(e.x2-e.x1)*(8+Pt.width):e.x1;return`<g class="seq-number">`+E`<circle cx="${r}" cy="${e.y}" r="${8}" fill="var(--bg)" stroke="var(--_arrow)" stroke-width="${R.innerBox}" />`+P(String(e.seqNumber),r,e.y,n,E`font-size="${n}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_arrow)"`)+`</g>`}var _s=35;function vs(e,t){let n=e.label?E` data-label="${S(e.label)}"`:``,r=e.color===void 0?``:E` data-color="${S(e.color)}"`,i=e.color===void 0?`none`:E`color-mix(in srgb, ${S(e.color)} ${_s}%, var(--bg))`,a=[E`<g class="participant-box"${n}${r}>`,E` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="4" ry="4" `+E`fill="${i}" stroke="var(--_node-stroke)" stroke-width="${R.innerBox}" />`];return e.label&&a.push(` `+P(e.label,e.x+e.width/2,e.y+Mo(t.edgeLabel)/2,t.edgeLabel,E`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.groupHeader}" fill="var(--_text-sec)"`)),a.push(`</g>`),a.join(`
|
|
66
|
+
`)}function ys(e){return e.type===`rect`&&e.color!==void 0}function bs(e,t){let n=[];if(ys(e))return[E`<g class="block" data-type="rect" data-color="${S(e.color)}">`,E` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" `+E`fill="${S(e.color)}" />`,`</g>`].join(`
|
|
67
|
+
`);let r=e.label?E` data-label="${S(e.label)}"`:``;n.push(E`<g class="block" data-type="${S(e.type)}"${r}>`),n.push(E` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" `+E`rx="0" ry="0" fill="none" stroke="var(--_node-stroke)" stroke-width="${2}" stroke-dasharray="${ds}" />`);let i=Yo(e,t.edgeLabel),{x:a,y:o}=e,s=Jo(a,o,i).map(([e,t])=>E`${e},${t}`).join(` `);n.push(E` <polygon points="${s}" `+E`fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`),n.push(` `+P(e.type,e.x+6,e.y+9,t.edgeLabel,E`font-size="${t.edgeLabel}" font-weight="${L.groupHeader}" fill="var(--_text-sec)"`)),e.label&&n.push(` `+P(E`[${e.label}]`,e.x+(i+e.width)/2,ls(e,t),t.edgeLabel,E`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_text-sec)"`));for(let r of e.dividers)n.push(E` <line x1="${e.x}" y1="${r.y}" x2="${e.x+e.width}" y2="${r.y}" `+`stroke="var(--_line)" stroke-width="2" stroke-dasharray="${fs}" />`),r.label&&n.push(` `+P(E`[${r.label}]`,e.x+e.width/2,us(r,t),t.edgeLabel,E`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`));return n.push(`</g>`),n.join(`
|
|
68
|
+
`)}var xs=10,Ss=10;function Cs(e,t){let{x:n,y:r,width:i,height:a}=e,o=e.actors&&e.actors.length>0?E` data-actors="${e.actors.map(S).join(`,`)}"`:``,s=e.position?E` data-position="${S(e.position)}"`:``;return E`<g class="note"${s}${o}>`+E`\n <rect x="${n}" y="${r}" width="${i}" height="${a}" `+E`fill="var(--bg)" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`+E`\n ${P(e.text,e.align===`left`?n+xs:e.align===`right`?n+i-xs:n+i/2,r+a/2,t.edgeLabel,E`font-size="${t.edgeLabel}" text-anchor="${e.align===`left`?`start`:e.align===`right`?`end`:`middle`}" font-weight="${L.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},ws=.8;function Ts(e){return e.min>=0||e.min===e.max}function Es(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 Ds(e,t,n){let r=y(e.yAxis.range,e.series.flatMap(e=>e.data)),i=re(r.min,r.max),a=Rs(i),o=Math.min(n(a)/2,.2*t),s=r.max-r.min;return{range:r,ticks:i,labels:a,pad:o,frac:e=>s>0?(e-r.min)/s:.5}}function Os(e,t,n){let r=e.xAxis.categories?void 0:e.xAxis.range,i=e=>n?V.axisLabelFontSize/2:ws*Math.max(...e.map(e=>I(e,V.axisLabelFontSize,V.axisLabelFontWeight)))/2,a=e.series.some(e=>e.type===`bar`);if(!r){let n=Ms(e),r=Ns(e,n),{p0:o,pad:s,bar:c}=Es(t,n,i(r)),l=a?s:o,u=e=>n<2?t/2:l+e*(t-2*l)/(n-1);return{at:(e,t)=>u(t),ticks:r.map((e,t)=>({label:e,at:u(t)})),bar:c}}let o=re(r.min,r.max),s=Rs(o),{p0:c,pad:l,bar:u}=Es(t,o.length,i(s)),d=a?l:c,f=r.max-r.min,p=e=>{let i=f>0?(e-r.min)/f:.5;return d+(n?1-i:i)*(t-2*d)};return{at:(e,t)=>p(e<2?r.min:r.min+t*f/(e-1)),ticks:o.map((e,t)=>({label:s[t],at:p(e)})),bar:u}}function ks(e,t={}){let n=e.config?.width??700,r=e.config?.height??500;return e.horizontal?js(e,n,r):As(e,n,r)}function As(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=Ds(e,0,()=>V.axisLabelHeight).labels,s=e.config?.xAxis?.showLabel!==!1,c=e.config?.yAxis?.showLabel!==!1,l=Math.max(...o.map(e=>I(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=Ds(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=Ms(e),T=Os(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,k=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`})),A=_.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)})),j=Ns(e,w),M=e.series.map((e,t)=>t),te=Is(e,E,D,T.bar,Ts(g.range)?u+b:D(0),j,M),ne=Ls(e,E,D,j,M),re=Bs(e,M),N={x1:f,y1:u+b,x2:f+y,y2:u+b},ie={x1:f,y1:u,x2:f,y2:u+b},P={ticks:k,line:N,...e.xAxis.title?{title:{text:e.xAxis.title,x:f+y/2,y:S-V.padding}}:{}},ae={ticks:A,line:ie,...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:P,yAxis:ae,plotArea:C,bars:te,lines:ne,gridLines:ee,legend:re,...e.config&&{config:e.config}}}function js(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=>ws*Math.max(...e.map(e=>I(e,V.axisLabelFontSize,V.axisLabelFontWeight))),s=Ds(e,0,o).labels,c=e.config?.xAxis?.showLabel!==!1,l=e.config?.yAxis?.showLabel!==!1,u=Ns(e,Ms(e)),d=Math.max(...Os(e,0,!0).ticks.map(({label:e})=>I(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,I(s[s.length-1],V.axisLabelFontSize,V.axisLabelFontWeight)/2+4),g=Math.max(50,t-m-h),_=Math.max(50,n-f-p),v=Ds(e,g,o),y=v.ticks,b=Os(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`})),k=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`})),A=y.map(e=>({x1:E(e),y1:f,x2:E(e),y2:f+S})),ee=e.series.map((e,t)=>t),j=e.series.filter(e=>e.type===`bar`).length,M=[];if(j>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=Ts(v.range)?m:E(0);M.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 te=[],ne=0,re=0;for(let t of e.series){if(t.type!==`line`){re++;continue}let e=t.data.map((e,n)=>({x:E(e),y:D(t.data.length,n),value:e,label:u[n]}));te.push({points:e,seriesIndex:ne,colorIndex:ee[re]}),ne++,re++}let N={x1:m,y1:f,x2:m+x,y2:f},ie={x1:m,y1:f,x2:m,y2:f+S},P={ticks:O,line:N,...e.yAxis.title?{title:{text:e.yAxis.title,x:m+x/2,y:V.padding+(r?V.titleHeight:0)+V.axisTitlePad/2}}:{}},ae={ticks:k,line:ie,...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:P,yAxis:ae,plotArea:T,bars:M,lines:te,gridLines:A,legend:Bs(e,ee),...e.config&&{config:e.config}}}function Ms(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 Ns(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)=>zs(n+i*t))}return Array.from({length:t},(e,t)=>String(t+1))}var Ps=8;function Fs(e,t){let n=e.map(e=>I(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<Ps){i=!1;break}if(i)return r}return Math.max(1,e.length)}function Is(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 Ls(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 Rs(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 zs(e){return Number.isInteger(e)?String(e):e.toFixed(+(Math.abs(e)<10))}function Bs(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 Vs={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 Hs(e,t,n=`Inter`,r=!1,i=!1,a,s,c,l={}){let u=[],d=Math.max(0,...e.bars.map(e=>e.colorIndex),...e.lines.map(e=>e.colorIndex)),{style:f,defs:p,cls:m}=Us(e,i,t.accent,t.bg,l.nonce),h=aa(ge(F(e.width,e.height,t,r,s,c,void 0,l.styleAttribute,l.description).replace(`<svg `,`<svg data-xychart-colors="${d}" `),m),a);u.push(h),u.push(o(n,!1,l.nonce,l.bodyFont)),u.push(f),p&&u.push(p);let g=e.config,_=g?.xAxis,v=g?.yAxis,[y,b]=e.horizontal?[_,v]:[v,_],x=y?.showAxisLine!==!1,S=b?.showAxisLine!==!1,{plotArea:C}=e,w=C.y+C.height,T=C.x+C.width,E=e.horizontal?C.y:w,D=x&&S?e.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=e.horizontal?v:_,k=e.horizontal?_:v;for(let t of[...O?.showTick===!1?[]:e.xAxis.ticks,...k?.showTick===!1?[]:e.yAxis.ticks])u.push(`<path d="M${U(t.x)},${U(t.y)} L${U(t.tx)},${U(t.ty)}" class="xychart-axis"/>`);let A=[];for(let t of e.bars){let n=` data-value="${t.value}"${t.label?` data-label="${Ys(t.label)}"`:``}`,r=Math.max(t.x,C.x),a=Math.min(t.x+t.width,C.x+C.width),o=Math.max(t.y,C.y),s=Math.min(t.y+t.height,C.y+C.height);if(a<=r||s<=o)continue;let c=`M${U(r)},${U(o)} H${U(a)} V${U(s)} H${U(r)} Z`;if(u.push(`<path d="${c}" class="xychart-bar xychart-color-${t.colorIndex}"${n}/>`),i){let n=Js(t.value),i=t.label?`${t.label}: ${n}`:n,c=qs((r+a)/2,o,n);A.push({extent:e.horizontal?a-r:s-o,html:`<g class="xychart-bar-group"><rect x="${U(r)}" y="${U(o)}" width="${U(a-r)}" height="${U(s-o)}" fill="transparent"/><title>${Ys(i)}</title>`+c+`</g>`})}}A.sort((e,t)=>t.extent-e.extent);for(let t of e.lines){if(t.points.length===0)continue;let e=Ws(t.points);u.push(`<path d="${e}" class="xychart-line-shadow xychart-color-${t.colorIndex}" transform="translate(0,2)"/>`),u.push(`<path d="${e}" class="xychart-line xychart-color-${t.colorIndex}"/>`)}let ee=Math.max(...e.lines.map(e=>e.points.length),0),j=ee>0&&ee<=12,M=[];if(i){let t=new Map;for(let n of e.legend)n.type===`line`&&t.set(n.seriesIndex,n.label);let n=new Map;for(let t of e.lines)for(let e of t.points){let r=U(e.x),i=n.get(r)??[];n.set(r,i),i.push({x:e.x,y:e.y,value:e.value,label:e.label,seriesIndex:t.seriesIndex,colorIndex:t.colorIndex})}for(let e of n.values()){let n=e[0].x,r=e[0].label||``;if(i&&e.length>1){let i=Math.min(...e.map(e=>e.y)),a=Math.max(...e.map(e=>e.y)),o=Vs.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=e.map(e=>({text:Js(e.value),legendLabel:t.get(e.seriesIndex)||`Line ${e.seriesIndex+1}`})),l=Ks(n,i-Vs.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 t of e){let e=` data-value="${t.value}"${t.label?` data-label="${Ys(t.label)}"`:``}`;f+=`<circle cx="${U(t.x)}" cy="${U(t.y)}" r="${Vs.dotRadius}" class="xychart-dot xychart-color-${t.colorIndex}"${e}/>`}f+=`<title>${Ys(d)}</title>${l}</g>`,M.push(f)}else if(i){let t=e[0],r=` data-value="${t.value}"${t.label?` data-label="${Ys(t.label)}"`:``}`,i=Js(t.value),a=t.label?`${t.label}: ${i}`:i,o=qs(n,t.y-Vs.dotRadius,i),s=j?`<circle cx="${U(n)}" cy="${U(t.y)}" r="${Vs.dotRadius*3}" fill="transparent" class="xychart-hit"/>`:``;M.push(`<g class="xychart-dot-group">${s}<circle cx="${U(t.x)}" cy="${U(t.y)}" r="${Vs.dotRadius}" class="xychart-dot xychart-color-${t.colorIndex}"${r}/><title>${Ys(a)}</title>${o}</g>`)}}}for(let t of O?.showLabel===!1?[]:e.xAxis.ticks)t.label!==``&&u.push(`<text x="${t.labelX}" y="${t.labelY}" text-anchor="${t.textAnchor}" font-size="${Vs.labelSize}" font-weight="${Vs.labelWeight}" dy="${Nt}" class="xychart-label">${Ys(t.label)}</text>`);for(let t of k?.showLabel===!1?[]:e.yAxis.ticks)u.push(`<text x="${t.labelX}" y="${t.labelY}" text-anchor="${t.textAnchor}" font-size="${Vs.labelSize}" font-weight="${Vs.labelWeight}" dy="${Nt}" class="xychart-label">${Ys(t.label)}</text>`);if(e.xAxis.title){let t=e.xAxis.title,n=t.rotate?` transform="rotate(${t.rotate},${t.x},${t.y})"`:``;u.push(`<text x="${t.x}" y="${t.y}" text-anchor="middle"${n} font-size="${Vs.axisTitleSize}" font-weight="${Vs.axisTitleWeight}" dy="${Nt}" class="xychart-axis-title">${Ys(t.text)}</text>`)}if(e.yAxis.title){let t=e.yAxis.title,n=t.rotate?` transform="rotate(${t.rotate},${t.x},${t.y})"`:``;u.push(`<text x="${t.x}" y="${t.y}" text-anchor="middle"${n} font-size="${Vs.axisTitleSize}" font-weight="${Vs.axisTitleWeight}" dy="${Nt}" class="xychart-axis-title">${Ys(t.text)}</text>`)}e.title&&u.push(`<text x="${e.title.x}" y="${e.title.y}" text-anchor="middle" font-size="${Vs.titleSize}" font-weight="${Vs.titleWeight}" dy="${Nt}" class="xychart-title">${Ys(e.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 Us(e,t,n,r,i){let a=n??ye,o=new Set;for(let t of e.bars)o.add(t.colorIndex);for(let t of e.lines)o.add(t.colorIndex);let s=[];for(let e of[...o].sort((e,t)=>e-t)){let t=e===0?`var(--accent, ${ye})`:Ee(e,a,r);s.push(` --xychart-color-${e}: ${t};`),s.push(` --xychart-bar-fill-${e}: color-mix(in srgb, var(--bg) 75%, var(--xychart-color-${e}) 25%);`)}let c=[];for(let e of[...o].sort((e,t)=>e-t)){let t=`var(--xychart-color-${e})`;c.push(` .xychart-bar.xychart-color-${e} { stroke: none; fill: var(--xychart-bar-fill-${e}); }`),c.push(` path.xychart-color-${e}, line.xychart-color-${e} { stroke: ${t}; }`),c.push(` circle.xychart-color-${e} { fill: ${t}; }`)}let l=t?`
|
|
71
71
|
.xychart-dot { opacity: 0; }
|
|
72
72
|
.xychart-dot-group:hover .xychart-dot { opacity: 1; }
|
|
73
73
|
.xychart-tip { opacity: 0; pointer-events: none; }
|
|
@@ -75,10 +75,10 @@ import{DEFAULTS as e,LINE_HEIGHT_RATIO as t,applyThemeVariables as n,buildStyleB
|
|
|
75
75
|
.xychart-tip-text { fill: var(--bg); font-size: ${H.fontSize}px; font-weight: ${H.fontWeight}; }
|
|
76
76
|
.xychart-tip-ptr { fill: var(--_text); }
|
|
77
77
|
.xychart-bar-group:hover .xychart-tip,
|
|
78
|
-
.xychart-dot-group:hover .xychart-tip { opacity: 1; }`:``,u=
|
|
79
|
-
`)}\n }`:``;return{style:`${
|
|
78
|
+
.xychart-dot-group:hover .xychart-tip { opacity: 1; }`:``,u=N(s),d=s.length>0?`\n .${u} {\n${s.join(`
|
|
79
|
+
`)}\n }`:``;return{style:`${de(i)}
|
|
80
80
|
.xychart-axis { fill: none; stroke: var(--_text); stroke-width: 2; }
|
|
81
|
-
.xychart-line { fill: none; stroke-width: ${
|
|
81
|
+
.xychart-line { fill: none; stroke-width: ${Vs.lineWidth}; stroke-linecap: round; stroke-linejoin: round; }
|
|
82
82
|
.xychart-line-shadow { fill: none; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.12; }
|
|
83
83
|
.xychart-dot { stroke: var(--bg); stroke-width: 2; }
|
|
84
84
|
.xychart-label { fill: var(--_text-muted); }
|
|
@@ -86,9 +86,9 @@ import{DEFAULTS as e,LINE_HEIGHT_RATIO as t,applyThemeVariables as n,buildStyleB
|
|
|
86
86
|
.xychart-title { fill: var(--_text); }${d}
|
|
87
87
|
${c.join(`
|
|
88
88
|
`)}${l}
|
|
89
|
-
</style>`,defs:``,cls:u}}function
|
|
90
|
-
.pie-slice.pie-highlight { opacity: 1; }`:``,c=
|
|
91
|
-
`)}\n }`:``;return{css:`${
|
|
89
|
+
</style>`,defs:``,cls:u}}function Ws(e){return e.map((e,t)=>`${t===0?`M`:`L`}${U(e.x)},${U(e.y)}`).join(` `)}function Gs(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 Ks(e,t,n,r){let i=I(n,H.fontSize,600),a=Math.max(...r.map(e=>{let t=I(e.legendLabel,H.fontSize,H.fontWeight),n=I(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="${Nt}" class="xychart-tip xychart-tip-text">${Ys(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="${Nt}" class="xychart-tip xychart-tip-text">${Ys(e.legendLabel)}</text>`,m+=`<text x="${U(_)}" y="${U(h)}" text-anchor="end" font-size="${H.fontSize}" font-weight="${H.fontWeight}" dy="${Nt}" class="xychart-tip xychart-tip-text">${Ys(e.text)}</text>`;return m}function qs(e,t,n){let r=I(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="${Nt}" class="xychart-tip xychart-tip-text">${Ys(n)}</text>`}function Js(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 Ys(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}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},Xs=Math.PI*2;function G(e){return String(Math.round(e*100)/100)}function Zs(e,t,n,r){return{x:e+n*Math.sin(r),y:t-n*Math.cos(r)}}function Qs(e,t,n,r,i,a=0){if(i-r>=Xs-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=Zs(e,t,n,r),s=Zs(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=Zs(e,t,a,i),d=Zs(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 $s(e,t,n){return n?`${e} [${String(t)}]`:e}function ec(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=>$s(t.label,t.value,e.showData)),m=Math.max(0,...p.map(e=>I(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?I(T,W.titleFontSize,W.fontWeight):0,D=a-E/2,O=a+E/2,k=Math.min(0,D),A=Math.max(C,O),ee=w,j=-k,M=a+_+j,te=o+v+-0,ne=[],re=0,N=e.donutHole??0,ie=N>0&&N<=.9?N*i:0,P=i*(e.textPosition??W.textPosition);for(let{slice:t,colorIndex:n}of c){let r=re,a=re+t.value/l*Xs;re=a;let o=Zs(M,te,P,(r+a)/2),c=e.highlightSlice!==void 0&&e.highlightSlice!==`hover`&&e.highlightSlice!==``&&e.highlightSlice===t.label,u=c?W.highlightScale:1;ne.push({label:t.label,value:t.value,colorIndex:n,startAngle:r,endAngle:a,path:Qs(M,te,i*u,r,a,ie*u),percentText:`${(t.value/s*100).toFixed(0)}%`,labelX:o.x,labelY:o.y,...c?{highlighted:c}:{}})}let ae=p.map((e,t)=>{let n=x.x+j,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(A-k),height:Math.ceil(ee-0),cx:M,cy:te,radius:i,outerRadius:i+W.outerStrokeWidth/2,title:T.length>0?{text:T,x:a+j,y:o+-0-(n-50)/2}:void 0,slices:ne,legend:ae,accTitle:e.accTitle,accDescr:e.accDescr,sliceColors:e.sliceColors}}function tc(e){return String(Math.round(e*100)/100)}function nc(e,t,n){return e===0?`var(--accent, ${ye})`:Ee(e,t??ye,n)}function rc(e,t,n){let r=new Set;for(let t of e.slices)r.add(t.colorIndex);for(let t of e.legend)r.add(t.colorIndex);let i=[...r].sort((e,t)=>e-t),a=i.map(n=>` --pie-color-${n}: ${e.sliceColors?.[n]??nc(n,t.accent,t.bg)};`),o=i.map(e=>` .pie-color-${e} { fill: var(--pie-color-${e}); }\n rect.pie-color-${e} { stroke: var(--pie-color-${e}); }`),s=e.slices.some(e=>e.highlighted)?`
|
|
90
|
+
.pie-slice.pie-highlight { opacity: 1; }`:``,c=N(a),l=a.length>0?`\n .${c} {\n${a.join(`
|
|
91
|
+
`)}\n }`:``;return{css:`${de(n)}
|
|
92
92
|
.pie-outer { fill: none; stroke: var(--fg); stroke-width: ${W.outerStrokeWidth}px; }
|
|
93
93
|
.pie-slice { stroke: var(--fg); stroke-width: 2px; opacity: 0.7; }${s}
|
|
94
94
|
.pie-slice-label { fill: var(--_text); font-size: ${W.sectionFontSize}px; font-weight: ${W.fontWeight}; }
|
|
@@ -96,21 +96,21 @@ ${c.join(`
|
|
|
96
96
|
.pie-legend-text { fill: var(--_text); font-size: ${W.legendFontSize}px; font-weight: ${W.fontWeight}; }${l}
|
|
97
97
|
${o.join(`
|
|
98
98
|
`)}
|
|
99
|
-
</style>`,cls:c}}function
|
|
100
|
-
`)}var
|
|
99
|
+
</style>`,cls:c}}function ic(e,t,n=`Inter`,r=!1,i,a,s,c={}){let l=[],{css:u,cls:d}=rc(e,t,c.nonce);l.push(aa(ge(F(e.width,e.height,t,r,a??e.accTitle,s,void 0,c.styleAttribute,e.accDescr),d),i)),l.push(o(n,!1,c.nonce,c.bodyFont)),l.push(u),l.push(`<circle cx="${tc(e.cx)}" cy="${tc(e.cy)}" r="${tc(e.outerRadius)}" class="pie-outer"/>`);for(let t of e.slices)l.push(`<path d="${t.path}" class="pie-slice${t.highlighted?` pie-highlight`:``} pie-color-${t.colorIndex}" data-label="${S(t.label)}" data-value="${t.value}"/>`);for(let t of e.slices)l.push(`<text x="${tc(t.labelX)}" y="${tc(t.labelY)}" text-anchor="middle" class="pie-slice-label">${C(t.percentText)}</text>`);e.title&&l.push(`<text x="${tc(e.title.x)}" y="${tc(e.title.y)}" text-anchor="middle" class="pie-title">${C(e.title.text)}</text>`);for(let t of e.legend)l.push(`<g class="pie-legend"><rect x="${tc(t.x)}" y="${tc(t.y)}" width="${t.size}" height="${t.size}" class="pie-legend-swatch pie-color-${t.colorIndex}"/><text x="${tc(t.textX)}" y="${tc(t.textY)}" class="pie-legend-text">${C(t.text)}</text></g>`);return l.push(`</svg>`),l.join(`
|
|
100
|
+
`)}var ac={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},oc={chartWidth:500,chartHeight:500};function sc(e){return{anchor:`middle`,baseline:`hanging`,rotation:0,...e}}function cc(e){let t={...ac,...oc,...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:sc({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(sc({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,ee=(e,n)=>T.push(sc({text:e,x:k,y:n,fontSize:t.yAxisLabelFontSize,anchor:A?`middle`:`start`,rotation:-90}));i&&e.yAxisBottom&&ee(e.yAxisBottom,h+_-(A?y/2:0)),i&&e.yAxisTop&&ee(e.yAxisTop,h+y-y/2);let j=[...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:sc({text:e.label,x:n,y:r+t.pointTextPadding,fontSize:t.pointLabelFontSize})}});return{width:t.chartWidth,height:t.chartHeight,themeColors:e.themeColors,title:a?sc({text:e.title,x:t.chartWidth/2,y:t.titlePadding,fontSize:t.titleFontSize}):void 0,quadrants:b,lines:w,axisLabels:T,points:j}}function lc(e){return String(Math.round(e*100)/100)}var uc=[14,10,6,3];function dc(e,t){let n=`var(--accent, ${ye})`,r=`color-mix(in srgb, ${n} 35%, var(--bg))`,i=uc.map((e,t)=>` .quadrant-cell-${t} { fill: color-mix(in srgb, ${n} ${e}%, var(--bg)); }`),a=e.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(` `)} }`]:[]}),o=e.themeColors??{},s=[...[1,2,3,4].flatMap(e=>[o[`quadrant${e}Fill`]&&` .quadrant-cell-${e-1} { fill: ${o[`quadrant${e}Fill`]}; }`,o[`quadrant${e}TextFill`]&&` .quadrant:nth-child(${e}) .quadrant-label { fill: ${o[`quadrant${e}TextFill`]}; }`]),o.quadrantPointFill&&` .quadrant-point { fill: ${o.quadrantPointFill}; stroke: ${o.quadrantPointFill}; }`,o.quadrantPointTextFill&&` .quadrant-point-label { fill: ${o.quadrantPointTextFill}; }`,o.quadrantXAxisTextFill&&` .quadrant-axis-label[transform$="rotate(0)"] { fill: ${o.quadrantXAxisTextFill}; }`,o.quadrantYAxisTextFill&&` .quadrant-axis-label[transform$="rotate(-90)"] { fill: ${o.quadrantYAxisTextFill}; }`,o.quadrantTitleFill&&` .quadrant-title { fill: ${o.quadrantTitleFill}; }`,o.quadrantInternalBorderStrokeFill&&` .quadrant-line-internal { stroke: ${o.quadrantInternalBorderStrokeFill}; }`,o.quadrantExternalBorderStrokeFill&&` .quadrant-line-external { stroke: ${o.quadrantExternalBorderStrokeFill}; }`].filter(Boolean);return`${de(t)}
|
|
101
101
|
${i.join(`
|
|
102
102
|
`)}
|
|
103
103
|
.quadrant-line { stroke: ${r}; }
|
|
104
104
|
.quadrant-text { fill: var(--_text); }
|
|
105
105
|
.quadrant-point { fill: var(--fg); stroke: var(--fg); stroke-width: 0px; }${[...s,...a].map(e=>`
|
|
106
106
|
`+e).join(``)}
|
|
107
|
-
</style>`}function
|
|
108
|
-
`)}var Vs=4500,Hs=50,Us=.45,Ws=2500,Gs=300,Ks=Hs/10,qs=100,Js=10,Ys=150/100,Xs=15,Zs=1200,Qs=900,$s=Hs,ec=2*Math.PI,tc=-2147483648,nc=2147483647,rc=e=>e.x+e.width/2,ic=e=>e.y+e.height/2,K=e=>e.x+e.width,q=e=>e.y+e.height,ac=e=>e>0?1:e<0?-1:0,oc=(e,t)=>e.source===t?e.target:e.source;function sc(e){let t=new Set;for(let n of e.edges)t.add(n.source===e?n.target:n.source);return t}function cc(e,t){return!(K(e)<t.x||q(e)<t.y||K(t)<e.x||q(t)<e.y)}function lc(e,t,n){return e>t?n:1+n%4}function uc(e,t,n){let r=rc(e),i=ic(e),a=rc(t),o=ic(t);if(cc(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=q(e),f=K(e),p=e.width/2,m=e.height/2,h=t.x,g=t.y,_=K(t),v=t.x,y=q(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=lc(T,D,4),k=lc(E,D,2)):(O=lc(-T,D,3),k=lc(-E,D,1)):i>o?(O=lc(-T,D,1),k=lc(-E,D,3)):(O=lc(T,D,2),k=lc(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 dc(e,t,n){let r=rc(e)<rc(t)?-1:1,i=ic(e)<ic(t)?-1:1,a=Math.min(K(e),K(t))-Math.max(e.x,t.x),o=Math.min(q(e),q(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&&q(e)>=q(t)?o+=Math.min(t.y-e.y,q(e)-q(t)):t.y<=e.y&&q(t)>=q(e)&&(o+=Math.min(e.y-t.y,q(t)-q(e)));let s=Math.abs((ic(t)-ic(e))/(rc(t)-rc(e)));ic(t)===ic(e)&&rc(t)===rc(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 fc(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=sc(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 sc(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 pc(e,t,n,r,i,a){let o=(r-n+1)/2;o<0&&(o+=180);let s=(o+n)%360*ec/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=oc(o,e);if(s===t)continue;let c=(n+h*m)%360;pc(s,e,c,(c+m)%360,i+a,a),h++}}function mc(e){let t=nc,n=-2147483647,r=nc,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<q(a)&&(i=q(a));return{x:t,y:r,width:n-t,height:i-r}}function hc(e,t,n){let r=nc,i=nc;for(let t of e)r>t.y&&(r=t.y),i>t.x&&(i=t.x);let a=i-Xs,o=r-Xs;for(let r of e)r.x=t+(r.x-a),r.y=n+(r.y-o)}function gc(e){let t=fc(e),n=tc;for(let t of e){let e=Math.sqrt(t.width*t.width+t.height*t.height);e>n&&(n=e)}pc(t,null,0,359,0,Math.max(n,$s));let r=mc(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);hc(e,Zs-i/2,Qs-a/2)}function _c(e,t,n){let r=e[t]?.[n];if(r===void 0)throw Error(`cose-bilkent: grid index out of range`);return r}function vc(e){let t=nc,n=-2147483647,r=nc,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<q(a)&&(i=q(a));let a=t,o=r,s=n-t,c=i-r,l=a-Xs,u=a+s+Xs,d=o-Xs,f=o+c+Xs,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++)_c(g,a,o).push(t),t.startX=e,t.finishX=n,t.startY=r,t.finishY=i}}function yc(e,t){e.overlapping=uc(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=ac(e.lengthX)),Math.abs(e.lengthY)<1&&(e.lengthY=ac(e.lengthY)),e.length=Math.sqrt(e.lengthX*e.lengthX+e.lengthY*e.lengthY))}function bc(e,t){for(let n of e.edges){if(yc(n,t),n.overlapping)continue;let e=n.length;if(e===0)continue;let r=Us*(e-Hs),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 xc(e,t,n){if(cc(e,t)){let n=dc(e,t,Hs/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{uc(e,t,n);let r=n.x1-n.x0,i=n.y1-n.y0;Math.abs(r)<Ks&&(r=ac(r)*Ks),Math.abs(i)<Ks&&(i=ac(i)*Ks);let a=r*r+i*i,o=Math.sqrt(a),s=Vs*1*1/a,c=s*r/o,l=s*i/o;e.repulsionForceX-=c,e.repulsionForceY-=l,t.repulsionForceX+=c,t.repulsionForceY+=l}}function Sc(e,t,n){let r=t%Js===1;r&&vc(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(rc(t)-rc(r))-(t.width/2+r.width/2),a=Math.abs(ic(t)-ic(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)xc(t,e,n);i.add(t)}}var Cc=[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 wc(e,t){return Cc[e-1]??e**+t}function Tc(e,t){let n=0,r=t*Gs;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*ac(e)),Math.abs(a)>r&&(a=r*ac(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 Ec(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=oc(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`);gc([...s]);let u=i.length,d=Math.max(u*5,Ws),f=Ys*u,p=Ws/qs,m=qs/Ws,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%qs===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-wc(v,Math.log(96)/Math.log(p))/100*1,m)}bc(h,g),Sc(h,y,g),b=Tc(i,_)}hc(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 Dc={padding:10,maxNodeWidth:200,fontSize:16,lineHeight:24,sections:11,edgeInset:15,cornerRadius:5},Oc=e=>String(Math.round(e*1e4)/1e4);function kc(e){return N(e.text,Dc.fontSize,e.bold?700:400)}function Ac(e){return e.reduce((e,t)=>e+kc(t),0)}function jc(e,t){let n=e.flatMap(e=>(e.text.match(/\s+|\S+/g)??[]).map(t=>({...e,text:t}))),r=e=>/^\s/.test(e.text),i=[[]],a=0;for(let e=0;e<n.length;){if(r(n[e])){i[i.length-1].push(n[e]),a+=kc(n[e]),e++;continue}let o=[];for(;e<n.length&&!r(n[e]);)o.push(n[e++]);let s=Ac(o),c=i[i.length-1];a+s>t&&c.some(e=>!r(e))&&(i.push([]),a=0),i[i.length-1].push(...o),a+=s}return i}function Mc(e){let t=ve(e),n=Math.max(...t.map(Ac));if(n<Dc.maxNodeWidth)return{lines:t,width:n,height:t.length*Dc.lineHeight};let r=t.flatMap(e=>jc(e,Dc.maxNodeWidth));return{lines:r,width:Dc.maxNodeWidth,height:r.length*Dc.lineHeight}}function Nc(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 ee=Math.atan2(-f*h,d*m),te=Math.atan2(f*m,d*h);for(let e of[ee,ee+Math.PI,te,te+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 Pc(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)Nc(n,r,i,a,o,s,c,n+l,r+u,t),n+=l,r+=u;return t}function Fc(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 Lc(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 Rc(e,t,n){let r=Dc.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:Dc.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])=>`${Oc(t-a/2)},${Oc(n+e/2)}`).join(` `)}}case`cloud`:{let e=t+2*i,r=n+2*i,a=Ic(e,r),o=Pc(a);return{width:o.maxX-o.minX,height:o.maxY-o.minY,boxX:-e/2+o.minX,boxY:-r/2+o.minY,path:zc(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=Lc(a,o),c=Pc(s);return{width:c.maxX-c.minX,height:c.maxY-c.minY,boxX:-a/2+c.minX,boxY:-o/2+c.minY,path:zc(s,-a/2,-o/2)}}default:{let e=Dc.cornerRadius,r=t+8*i,a=n+2*i;return{width:r,height:a,boxX:-r/2,boxY:-a/2,underline:!0,path:`M${Oc(-r/2)} ${Oc(a/2-e)} v${Oc(-a+2*e)} q0,${-e} ${e},${-e} h${Oc(r-2*e)} q${e},0 ${e},${e} v${Oc(a-2*e)} q0,${e} ${-e},${e} h${Oc(-(r-2*e))} q${-e},0 ${-e},${-e} Z`}}}}function zc(e,t,n){return Fc(e).replace(`M0 0`,`M${Oc(t)} ${Oc(n)}`)}function Bc(e){let t=e=>Oc(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 Vc(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%Dc.sections:i))};r(e.root,void 0);let i=t.map(e=>{let t=Mc(e.text),r=Rc(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=Ec(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=Dc.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:Bc([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=Dc.padding;return{originX:s-d,originY:c-d,width:l-s+2*d,height:u-c+2*d,nodes:i,edges:o}}var Hc=e=>String(Math.round(e*100)/100);function Uc(e){return e===void 0?``:e.split(/\s+/).filter(e=>/^[A-Za-z_][\w-]*$/.test(e)).map(e=>` ${e}`).join(``)}function Wc(e,t,n){let r=new Set;for(let t of e.nodes)t.section!==void 0&&r.add(t.section);let i=[...r].sort((e,t)=>e-t),a=i.map(e=>` --mm-color-${e}: ${ks(e,t.accent,t.bg)};`),o=i.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}); }`),s=T(a);return{css:`${j(n)}
|
|
107
|
+
</style>`}function fc(e,t){return`<text x="0" y="0" class="quadrant-text ${t}" font-size="${e.fontSize}" dominant-baseline="${e.baseline}" text-anchor="${e.anchor}" transform="translate(${lc(e.x)}, ${lc(e.y)}) rotate(${e.rotation})">${C(e.text)}</text>`}function pc(e,t,n=`Inter`,r=!1,i,a,s,c={}){let l=[];l.push(aa(F(e.width,e.height,t,r,a,s,void 0,c.styleAttribute,c.description),i)),l.push(o(n,!1,c.nonce,c.bodyFont)),l.push(dc(e,c.nonce)),l.push(`<g class="quadrants">`);for(let t of e.quadrants)l.push(`<g class="quadrant"><rect x="${lc(t.x)}" y="${lc(t.y)}" width="${lc(t.width)}" height="${lc(t.height)}" class="quadrant-cell-${t.index}"/>${fc(t.text,`quadrant-label`)}</g>`);l.push(`</g>`),l.push(`<g class="border">`);for(let t of e.lines)l.push(`<line x1="${lc(t.x1)}" y1="${lc(t.y1)}" x2="${lc(t.x2)}" y2="${lc(t.y2)}" stroke-width="${t.strokeWidth}" class="quadrant-line quadrant-line-${t.kind}"/>`);l.push(`</g>`),l.push(`<g class="data-points">`),e.points.forEach((e,t)=>{let n=e.color||e.strokeColor||e.strokeWidth!==`0px`?` quadrant-point-${t}`:``;l.push(`<g class="data-point"><circle cx="${lc(e.x)}" cy="${lc(e.y)}" r="${e.radius}" class="quadrant-point${n}"/>${fc(e.text,`quadrant-point-label`)}</g>`)}),l.push(`</g>`),l.push(`<g class="labels">`);for(let t of e.axisLabels)l.push(`<g class="label">${fc(t,`quadrant-axis-label`)}</g>`);return l.push(`</g>`),l.push(`<g class="title">`),e.title&&l.push(fc(e.title,`quadrant-title`)),l.push(`</g>`),l.push(`</svg>`),l.join(`
|
|
108
|
+
`)}var mc=4500,hc=50,gc=.45,_c=2500,vc=300,yc=hc/10,bc=100,xc=10,Sc=150/100,Cc=15,wc=1200,Tc=900,Ec=hc,Dc=2*Math.PI,Oc=-2147483648,kc=2147483647,Ac=e=>e.x+e.width/2,jc=e=>e.y+e.height/2,K=e=>e.x+e.width,Mc=e=>e.y+e.height,Nc=e=>e>0?1:e<0?-1:0,Pc=(e,t)=>e.source===t?e.target:e.source;function Fc(e){let t=new Set;for(let n of e.edges)t.add(n.source===e?n.target:n.source);return t}function Ic(e,t){return!(K(e)<t.x||Mc(e)<t.y||K(t)<e.x||Mc(t)<e.y)}function Lc(e,t,n){return e>t?n:1+n%4}function Rc(e,t,n){let r=Ac(e),i=jc(e),a=Ac(t),o=jc(t);if(Ic(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=Mc(e),f=K(e),p=e.width/2,m=e.height/2,h=t.x,g=t.y,_=K(t),v=t.x,y=Mc(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=Lc(T,D,4),k=Lc(E,D,2)):(O=Lc(-T,D,3),k=Lc(-E,D,1)):i>o?(O=Lc(-T,D,1),k=Lc(-E,D,3)):(O=Lc(T,D,2),k=Lc(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 zc(e,t,n){let r=Ac(e)<Ac(t)?-1:1,i=jc(e)<jc(t)?-1:1,a=Math.min(K(e),K(t))-Math.max(e.x,t.x),o=Math.min(Mc(e),Mc(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&&Mc(e)>=Mc(t)?o+=Math.min(t.y-e.y,Mc(e)-Mc(t)):t.y<=e.y&&Mc(t)>=Mc(e)&&(o+=Math.min(e.y-t.y,Mc(t)-Mc(e)));let s=Math.abs((jc(t)-jc(e))/(Ac(t)-Ac(e)));jc(t)===jc(e)&&Ac(t)===Ac(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 Bc(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=Fc(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 Fc(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 Vc(e,t,n,r,i,a){let o=(r-n+1)/2;o<0&&(o+=180);let s=(o+n)%360*Dc/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=Pc(o,e);if(s===t)continue;let c=(n+h*m)%360;Vc(s,e,c,(c+m)%360,i+a,a),h++}}function Hc(e){let t=kc,n=-2147483647,r=kc,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<Mc(a)&&(i=Mc(a));return{x:t,y:r,width:n-t,height:i-r}}function Uc(e,t,n){let r=kc,i=kc;for(let t of e)r>t.y&&(r=t.y),i>t.x&&(i=t.x);let a=i-Cc,o=r-Cc;for(let r of e)r.x=t+(r.x-a),r.y=n+(r.y-o)}function Wc(e){let t=Bc(e),n=Oc;for(let t of e){let e=Math.sqrt(t.width*t.width+t.height*t.height);e>n&&(n=e)}Vc(t,null,0,359,0,Math.max(n,Ec));let r=Hc(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);Uc(e,wc-i/2,Tc-a/2)}function Gc(e,t,n){let r=e[t]?.[n];if(r===void 0)throw Error(`cose-bilkent: grid index out of range`);return r}function Kc(e){let t=kc,n=-2147483647,r=kc,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<Mc(a)&&(i=Mc(a));let a=t,o=r,s=n-t,c=i-r,l=a-Cc,u=a+s+Cc,d=o-Cc,f=o+c+Cc,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++)Gc(g,a,o).push(t),t.startX=e,t.finishX=n,t.startY=r,t.finishY=i}}function qc(e,t){e.overlapping=Rc(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=Nc(e.lengthX)),Math.abs(e.lengthY)<1&&(e.lengthY=Nc(e.lengthY)),e.length=Math.sqrt(e.lengthX*e.lengthX+e.lengthY*e.lengthY))}function Jc(e,t){for(let n of e.edges){if(qc(n,t),n.overlapping)continue;let e=n.length;if(e===0)continue;let r=gc*(e-hc),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 Yc(e,t,n){if(Ic(e,t)){let n=zc(e,t,hc/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{Rc(e,t,n);let r=n.x1-n.x0,i=n.y1-n.y0;Math.abs(r)<yc&&(r=Nc(r)*yc),Math.abs(i)<yc&&(i=Nc(i)*yc);let a=r*r+i*i,o=Math.sqrt(a),s=mc*1*1/a,c=s*r/o,l=s*i/o;e.repulsionForceX-=c,e.repulsionForceY-=l,t.repulsionForceX+=c,t.repulsionForceY+=l}}function Xc(e,t,n){let r=t%xc===1;r&&Kc(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(Ac(t)-Ac(r))-(t.width/2+r.width/2),a=Math.abs(jc(t)-jc(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)Yc(t,e,n);i.add(t)}}var Zc=[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 Qc(e,t){return Zc[e-1]??e**+t}function $c(e,t){let n=0,r=t*vc;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*Nc(e)),Math.abs(a)>r&&(a=r*Nc(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 el(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=Pc(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`);Wc([...s]);let u=i.length,d=Math.max(u*5,_c),f=Sc*u,p=_c/bc,m=bc/_c,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%bc===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-Qc(v,Math.log(96)/Math.log(p))/100*1,m)}Jc(h,g),Xc(h,y,g),b=$c(i,_)}Uc(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 tl={padding:10,maxNodeWidth:200,fontSize:16,lineHeight:24,sections:11,edgeInset:15,cornerRadius:5},nl=e=>String(Math.round(e*1e4)/1e4),rl=e=>I(e.text,tl.fontSize,e.bold?700:400);function il(e,t=rl){return e.reduce((e,n)=>e+t(n),0)}var al=`\\p{Script=Han}\\p{Script=Hiragana}\\p{Script=Katakana}`,ol=RegExp(`(?<=[\\p{L}\\p{N}]-)(?=\\p{L})|(?<=[${al}])(?![,。!?、;:)」』】])(?=\\S)|(?<=\\S)(?<![(「『【])(?=[${al}])`,`gu`);function sl(e){let t=e.map(e=>e.text).join(``),n=new Set([...t.matchAll(ol)].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 cl(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 ll(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?sl(c):[c];l.forEach((c,u)=>{let d=il(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 ul(e,t=tl.maxNodeWidth,n=rl,r=!1){let i=Oe(e),a=Math.max(...i.map(e=>il(e,n)));if(a<t)return{lines:i,width:a,height:i.length*tl.lineHeight};let o=i.flatMap(e=>ll(e,t,n,r)),s=r?Math.max(...o.map(e=>il(cl(e),n))):0;return{lines:o,width:Math.max(t,s),height:o.length*tl.lineHeight}}function dl(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 ee=Math.atan2(-f*h,d*m),j=Math.atan2(f*m,d*h);for(let e of[ee,ee+Math.PI,j,j+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 fl(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)dl(n,r,i,a,o,s,c,n+l,r+u,t),n+=l,r+=u;return t}function pl(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 ml(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 hl(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 gl(e,t,n){let r=tl.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:tl.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])=>`${nl(t-a/2)},${nl(n+e/2)}`).join(` `)}}case`cloud`:{let e=t+2*i,r=n+2*i,a=ml(e,r),o=fl(a);return{width:o.maxX-o.minX,height:o.maxY-o.minY,boxX:-e/2+o.minX,boxY:-r/2+o.minY,path:_l(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=hl(a,o),c=fl(s);return{width:c.maxX-c.minX,height:c.maxY-c.minY,boxX:-a/2+c.minX,boxY:-o/2+c.minY,path:_l(s,-a/2,-o/2)}}default:{let e=tl.cornerRadius,r=t+8*i,a=n+2*i;return{width:r,height:a,boxX:-r/2,boxY:-a/2,underline:!0,path:`M${nl(-r/2)} ${nl(a/2-e)} v${nl(-a+2*e)} q0,${-e} ${e},${-e} h${nl(r-2*e)} q${e},0 ${e},${e} v${nl(a-2*e)} q0,${e} ${-e},${e} h${nl(-(r-2*e))} q${-e},0 ${-e},${-e} Z`}}}}function _l(e,t,n){return pl(e).replace(`M0 0`,`M${nl(t)} ${nl(n)}`)}function vl(e){let t=e=>nl(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 yl(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%tl.sections:i))};r(e.root,void 0);let i=t.map(e=>{let t=ul(e.text),r=gl(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=el(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=tl.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:vl([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=tl.padding;return{originX:s-d,originY:c-d,width:l-s+2*d,height:u-c+2*d,nodes:i,edges:o}}var bl=e=>String(Math.round(e*100)/100);function xl(e){return e===void 0?``:e.split(/\s+/).filter(e=>/^[A-Za-z_][\w-]*$/.test(e)).map(e=>` ${e}`).join(``)}function Sl(e,t,n){let r=new Set;for(let t of e.nodes)t.section!==void 0&&r.add(t.section);let i=[...r].sort((e,t)=>e-t),a=i.map(e=>` --mm-color-${e}: ${nc(e,t.accent,t.bg)};`),o=i.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}); }`),s=N(a);return{css:`${de(n)}
|
|
109
109
|
.mm-edge { fill: none; }
|
|
110
110
|
.mm-shape { stroke: none; }
|
|
111
111
|
.mm-underline { stroke-width: 3px; }
|
|
112
112
|
.mm-root .mm-shape { fill: var(--fg); }
|
|
113
|
-
.mm-label { fill: var(--_text); font-size: ${
|
|
113
|
+
.mm-label { fill: var(--_text); font-size: ${tl.fontSize}px; font-weight: 400; text-anchor: middle; }
|
|
114
114
|
.mm-root .mm-label { fill: var(--bg); }
|
|
115
115
|
.mm-bold { font-weight: 700; }
|
|
116
116
|
.mm-italic { font-style: italic; }
|
|
@@ -120,8 +120,8 @@ ${a.join(`
|
|
|
120
120
|
}
|
|
121
121
|
${o.join(`
|
|
122
122
|
`)}
|
|
123
|
-
</style>`,cls:s}}function
|
|
124
|
-
`)}var
|
|
123
|
+
</style>`,cls:s}}function Cl(e){let t=-e.labelHeight/2;return e.lines.map((e,n)=>{let r=t+tl.lineHeight*(n+.5),i=e.map(e=>{let t=`${e.bold?`mm-bold`:``}${e.bold&&e.italic?` `:``}${e.italic?`mm-italic`:``}`,n=C(e.text);return t===``?n:`<tspan class="${t}">${n}</tspan>`}).join(``);return`<text x="0" y="${bl(r)}" dy="0.35em" class="mm-label" xml:space="preserve">${i.trim()}</text>`}).join(``)}function wl(e){let t=`mm-node ${e.section===void 0?`mm-root`:`mm-s${e.section}`} mm-${e.node.shape}${xl(e.node.className)}`,n=``;if(e.radius!==void 0)n=`<circle class="mm-shape" r="${bl(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="${bl(-t/2)}" y="${bl(-r/2)}" width="${bl(t)}" height="${bl(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="${bl(-t)}" y1="${bl(r)}" x2="${bl(t)}" y2="${bl(r)}"/>`}return`<g class="${t}" data-id="node_${e.node.id}" transform="translate(${bl(e.x)}, ${bl(e.y)})">`+n+Cl(e)+`</g>`}function Tl(e,t,n=`Inter`,r=!1,i,a,s,c={}){let l=[],{css:u,cls:d}=Sl(e,t,c.nonce);l.push(aa(ge(F(e.width,e.height,t,r,a,s,void 0,c.styleAttribute,c.description),d),i)),l.push(o(n,!1,c.nonce,c.bodyFont)),l.push(u),l.push(`<g transform="translate(${bl(-e.originX)}, ${bl(-e.originY)})">`),l.push(`<g class="mm-edges">`);for(let t of e.edges){let e=17-3*(t.depth+1);l.push(`<path d="${t.path}" class="mm-edge ${t.section===void 0?``:`mm-s${t.section}`}" stroke-width="${e>0?e:3}" data-edge="edge_${t.from}_${t.to}"/>`)}l.push(`</g>`),l.push(`<g class="mm-nodes">`);for(let t of e.nodes)l.push(wl(t));return l.push(`</g></g></svg>`),l.join(`
|
|
124
|
+
`)}var El=2048,Dl=[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],Ol=[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 kl(e,t){let n=e.charCodeAt(0)-32;if(!(e.length!==1||n<0||n>=Dl.length))return(t?Ol:Dl)[n]/El}var Al={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 jl(e,t=16,n=!1){let r=0;for(let t of e){let e=kl(t,n);r+=e??((t.codePointAt(0)??0)>=11904?1:.6)}return r*t}function Ml(e,t){let n=e.split(/(\s+|<br>)/),r=[],i=[],a=``;for(let e of n){i.push(e);let n=i.join(` `).trim();jl(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 Nl(e){return e.filter(e=>e!==``).length}function Pl(e,t=Al.padding){return(e===0?0:Al.firstLineHeight+(e-1)*Al.lineHeight)+Al.textPad+t}function Fl(e,t,n=Al.padding){return Pl(Nl(Ml(e,t)),n)}function Il(e){return e!==void 0&&e>=0&&e<=1e5?e:void 0}function Ll(e){return e%Al.colorLimit-1}function Rl(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 zl(e){let{periods:t,sections:n}=e,r={...Al,leftMargin:Il(e.config?.leftMargin)??Al.leftMargin,viewBoxPadding:Il(e.config?.padding)??Al.viewBoxPadding},i=!e.config?.disableMulticolor,a=n.length>0,o=[],s=[],c=0;for(let e of n)c=Math.max(c,Fl(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+=Fl(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=Rl(d,e.x,e.y,e.x+e.width,e.y+e.height);for(let n of e.lines){let r=jl(n);d=Rl(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=Ml(t.label,r.nodeWidth),i=Math.max(Pl(Nl(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:Ll(c),padding:r.padding},r.nodeWidth+2*r.padding);let l=n+200;for(let e of t.events){let t=Ml(e,r.nodeWidth),n=Math.max(Pl(Nl(t)),r.eventFloor);f({kind:`event`,x:o,y:l,width:r.nodeWidth+2*r.padding,height:n,lines:t,colorClass:Ll(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=Rl(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=Ml(n,r.columnWidth*o-50);f({kind:`section`,x:e,y:50,width:r.columnWidth*o-50+2*r.padding,height:Math.max(Pl(Nl(s)),c),lines:s,colorClass:Ll(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 Bl(e,o,s,{x1:r.leftMargin,y1:g,x2:h+3*r.leftMargin,y2:g},h)}function Bl(e,t,n,r,i){let a={...Al,leftMargin:Il(e.config?.leftMargin)??Al.leftMargin,viewBoxPadding:Il(e.config?.padding)??Al.viewBoxPadding},o;for(let e of t){o=Rl(o,e.x,e.y,e.x+e.width,e.y+e.height);for(let t of e.lines){let n=jl(t);o=Rl(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=Rl(o,e.x1,e.y1,e.x2,e.y2);o=Rl(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=jl(e.title,a.titleFontSize,!0);o=Rl(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 Vl(e){let{periods:t,sections:n}=e,r={...Al,leftMargin:Il(e.config?.leftMargin)??Al.leftMargin,viewBoxPadding:Il(e.config?.padding)??Al.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)=>Fl(e,t,q.padding),h=0;for(let e of n)h=Math.max(h,m(e,p));let g=t.length>0?Pl(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=Ml(t.label,q.nodeWidth),n=Math.max(Pl(Nl(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:Ll(s),padding:q.padding});let d=i;for(let e of t.events){let t=Ml(e,q.eventWidth),n=Pl(Nl(t),q.padding),r=f+q.eventAxisGap;a.push({kind:`event`,x:r,y:d,width:l,height:n,lines:t,colorClass:Ll(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=Ml(e,p),o=Math.max(Pl(Nl(i),q.padding),h);a.push({kind:`section`,x:f-u,y:b,width:p+2*q.padding,height:o,lines:i,colorClass:Ll(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=Rl(x,e.x,e.y,e.x+e.width,e.y+e.height);for(let t of e.lines){let n=jl(t);x=Rl(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=Rl(x,e.x1,e.y1,e.x2,e.y2);let S=x?x.x2-x.x1:0,C=x?x.y2:0;return Bl(e,a,o,{x1:f,y1:50-q.axisTopOffset,x2:f,y2:(x?C:0)+q.axisBottomPadding},S)}function Hl(e){return e.direction===`TD`?Vl(e):zl(e)}function J(e){return String(Math.round(e*100)/100)}function Ul(e,t,n){let r=[...new Set(e.nodes.map(e=>e.colorClass))].sort((e,t)=>e-t),i=r.map(e=>` --timeline-color-${e+1}: ${nc(e+1,t.accent,t.bg)};`),a=r.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; }`),o=N(i);return{css:`${de(n)}
|
|
125
125
|
.timeline-node text { fill: var(--_text); font-size: 16px; }
|
|
126
126
|
.timeline-title { fill: var(--_text); font-weight: bold; }
|
|
127
127
|
.lineWrapper line { stroke: var(--fg); }
|
|
@@ -129,16 +129,101 @@ ${o.join(`
|
|
|
129
129
|
`)}\n }`:``}
|
|
130
130
|
${a.join(`
|
|
131
131
|
`)}
|
|
132
|
-
</style>`,cls:o}}function
|
|
133
|
-
`)}var pl=2048,ml=[569,569,727,1139,1139,1821,1366,391,682,682,797,1196,569,682,569,569,1139,1139,1139,1139,1139,1139,1139,1139,1139,1139,569,569,1196,1196,1196,1139,2079,1366,1366,1479,1479,1366,1251,1593,1479,569,1024,1366,1139,1706,1479,1593,1366,1593,1479,1366,1251,1479,1366,1933,1366,1366,1251,569,569,569,961,1139,682,1139,1139,1024,1139,1139,569,1139,1139,455,455,1024,455,1706,1139,1139,1139,1139,682,1024,569,1139,1024,1479,1024,1024,1024,684,532,684,1196],hl=[569,682,971,1139,1139,1821,1479,487,682,682,797,1196,569,682,569,569,1139,1139,1139,1139,1139,1139,1139,1139,1139,1139,682,682,1196,1196,1196,1251,1992,1479,1479,1479,1479,1366,1251,1593,1479,569,1139,1479,1251,1706,1479,1593,1366,1593,1479,1366,1251,1479,1366,1933,1366,1366,1251,682,569,682,1196,1139,682,1139,1251,1139,1251,1139,682,1251,1251,569,569,1139,569,1821,1251,1251,1251,1251,797,1139,682,1251,1139,1593,1139,1139,1024,801,573,801,1196];function gl(e,t){let n=e.codePointAt(0);if(!(n<32||n>126))return(t?hl:ml)[n-32]/pl}var Z={width:216,diagramMarginX:50,diagramMarginY:10,shapeMargin:50,shapePadding:20,shapeInRow:4,boundaryInRow:2,nextLinePaddingX:0,screenWidth:1440,nameSize:14,typeSize:10.5,descrSize:11.5,messageSize:12,boundarySize:14,nameLine:15.35,typeLine:15.72,descrLine:17.1,descrExtraLine:12.48,textScale:.922,boundaryLabelHeight:18,boundaryTypeHeight:16.1,boundaryDescrHeight:14.4,rootHeadingHeight:47,titleExtra:60,cornerRadius:12,strokeWidth:2,personRx:.177,personRxMaxOfHeight:.45,personHeadRatio:.23,personHeadMin:16,personHeadMax:56,personHeadOverlap:.27,dbTrim:3.91,queueExtra:10},_l=Z.width-2*Z.shapePadding;function vl(e,t,n){let r=[];for(let i of e.split(`
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
`)
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
132
|
+
</style>`,cls:o}}function Wl(e,t){let{width:n,height:r}=e,i=`M0 ${J(r-5)} v${J(-r+10)} q0,-5,5,-5 h${J(n-10)} q5,0,5,5 v${J(r-5)} H0 Z`,a=e.lines.map((e,t)=>`<tspan x="0" dy="${t===0?`1em`:`1.1em`}">${C(e)}</tspan>`).join(``);return`<g class="${t}" transform="translate(${J(e.x)}, ${J(e.y)})"><g class="timeline-node section-${e.colorClass}"><g><path class="node-bkg" d="${i}"/><line class="node-line-${e.colorClass}" x1="0" y1="${J(r)}" x2="${J(n)}" y2="${J(r)}"/></g><g transform="translate(${J(n/2)}, ${J(e.padding/2)})"><text dy="1em" alignment-baseline="middle" dominant-baseline="middle" text-anchor="middle">${a}</text></g></g></g>`}function Gl(e,t,n=`Inter`,r=!1,i,a,s,c={}){let l=[],{css:u,cls:d}=Ul(e,t,c.nonce);l.push(aa(ge(F(e.width,e.height,t,r,a,s,void 0,c.styleAttribute,c.description),d),i)),l.push(o(n,!1,c.nonce,c.bodyFont)),l.push(u);let f=e.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 t of e.nodes)l.push(Wl(t,t.kind===`section`?`sectionWrapper`:t.kind===`period`?`taskWrapper`:`eventWrapper`));let p=f?` marker-end="url(#timeline-arrowhead)"`:``;for(let t of e.connectors)l.push(`<g class="lineWrapper"><line x1="${J(t.x1)}" y1="${J(t.y1)}" x2="${J(t.x2)}" y2="${J(t.y2)}" stroke-width="2"${p} stroke-dasharray="5,5"/></g>`);e.title&&l.push(`<text x="${J(e.title.x)}" y="${J(e.title.y)}" font-size="${e.title.fontSize}" font-weight="bold" class="timeline-title">${C(e.title.text)}</text>`);let m=e.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 Kl=10,ql=40,Jl=4,Yl=2,Xl=8,Zl=30;function Ql(e){return Math.round(.939*e)+Math.round(.222*e)}var $l=e=>Math.round(.939*e),eu=e=>Math.round(.222*e);function tu(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(e=>e.trim())}var nu=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)}}},ru=(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)}},iu=(e,t)=>n=>({x:n.x+e,y:n.y+t}),au=(...e)=>t=>e.reduceRight((e,t)=>t(e),t),ou=e=>String(Math.round(e*1e6)/1e6);function su(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 nu,u=0;e.branches.forEach((e,t)=>{let i=Math.max(...tu(e).map(e=>jl(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+ql},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+Kl})}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-ql,n<=r&&(r=n);let i=a.get(e.branch).pos;o.set(e.id,{x:i,y:n-Kl})}}},h=e=>{let n=o.get(e.id)?.y??0;if(e.parents.length===0)return t===`TB`?Zl:t===`BT`?n-ql:0;let r=o.get(d(e.parents));return t===`TB`?r.y+ql:t===`BT`?n-ql:r.x+ql},g=(e,i)=>{let o=t===`BT`&&r.parallelCommits?i:i+Kl,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)%Xl,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=jl(e.id,10),o=Ql(10),s={x:t.posWithOffset-a/2-Yl,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, ${ou(t.x)}, ${ou(t.y)})`,d=ru(-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(${ou(e)}, ${ou(n)}) rotate(-45, ${ou(i)}, ${ou(t.y)})`,d=au(iu(e,n),ru(-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-$l(10),a,o,d),u},x=(e,t,r)=>{if(e.tags.length===0)return[];let i=[...e.tags].reverse(),a=Ql(10),o=i.map(e=>jl(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-Jl/2,f+Yl],[r-s/2-Jl/2,f-Yl],[t.posWithOffset-s/2-Jl,f-c-Yl],[t.posWithOffset+s/2+Jl,f-c-Yl],[t.posWithOffset+s/2+Jl,f+c+Yl],[t.posWithOffset-s/2-Jl,f+c+Yl]].map(([e,t])=>`${ou(e)},${ou(t)}`).join(` `),hole:{cx:r-s/2+Jl/2,cy:f},textPos:{x:t.posWithOffset-o[i]/2,y:t.y-16-d}},m=[{x:r-s/2-Jl/2,y:f+Yl},{x:r-s/2-Jl/2,y:f-Yl},{x:t.posWithOffset-s/2-Jl,y:f-c-Yl},{x:t.posWithOffset+s/2+Jl,y:f-c-Yl},{x:t.posWithOffset+s/2+Jl,y:f+c+Yl},{x:t.posWithOffset-s/2-Jl,y:f+c+Yl}],h={x:p.hole.cx,y:p.hole.cy},g={x:p.textPos.x,y:p.textPos.y-$l(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+Kl,y:e-c-2},{x:n+Kl+s+4,y:e-c-2},{x:n+Kl+s+4,y:e+c+2},{x:n+Kl,y:e+c+2}],p.points=m.map(e=>`${ou(e.x)},${ou(e.y)}`).join(` `),p.polygonTransform=`translate(12,12) rotate(45, ${ou(n)},${ou(r)})`,p.hole={cx:n+Jl/2,cy:e},p.holeTransform=p.polygonTransform,p.textPos={x:n+5,y:e+3},p.textTransform=`translate(14,14) rotate(45, ${ou(n)},${ou(r)})`;let a=ru(45,n,r),l=au(iu(12,12),a),u=au(iu(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-$l(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?Zl: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+ql:s+ql+Kl,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)%Xl}};S(!1);let E=[];r.showBranches&&e.branches.forEach((e,i)=>{let o=i%Xl,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:Zl,x2:u,y2:c}:t===`BT`&&(f={x1:u,y1:c,x2:u,y2:Zl}),s.push(d),l.add(f.x1,f.y1),l.add(f.x2,f.y2);let p=tu(e),m=Math.max(...p.map(e=>jl(e))),h=p.length*Ql(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=jl(e.title,18);O.title={text:e.title,x:t,y:-r.titleTopMargin},l.rect(t-n/2,-r.titleTopMargin-$l(18),n,$l(18)+eu(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 cu=8;function lu(e,t){let n=Array.from({length:cu},(t,n)=>` --git-color-${n}: ${nc(n,e.accent,e.bg)};`),r=Array.from({length:cu},(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}); }`),i=N(n);return{css:`${de(t)}
|
|
134
|
+
.branch-label { fill: var(--bg); font-size: 16px; }
|
|
135
|
+
${r.join(`
|
|
136
|
+
`)}
|
|
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
|
+
.tag-label { font-size: 10px; fill: var(--_text); }
|
|
141
|
+
.tag-label-bkg { fill: var(--_node-fill); stroke: var(--_node-stroke); }
|
|
142
|
+
.tag-hole { fill: var(--fg); }
|
|
143
|
+
.commit-cherry-pick { stroke: var(--_text); fill: var(--_text); }
|
|
144
|
+
circle.commit-cherry-pick[fill] { fill: var(--bg); }
|
|
145
|
+
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; }
|
|
150
|
+
.gitTitleText { text-anchor: middle; font-size: 18px; fill: var(--_text); }
|
|
151
|
+
.branchLabel text, .commit-label, .tag-label { font-family: inherit; }
|
|
152
|
+
.${i} {
|
|
153
|
+
${n.join(`
|
|
154
|
+
`)}
|
|
155
|
+
}
|
|
156
|
+
</style>`,cls:i}}function uu(e){let t=C(e.cls);switch(e.kind){case`circle`:return`<circle cx="${Y(e.cx)}" cy="${Y(e.cy)}" r="${e.r}"${e.fill?` fill="${e.fill}"`:``} class="${t}"/>`;case`rect`:return`<rect x="${Y(e.x)}" y="${Y(e.y)}" width="${e.w}" height="${e.h}" class="${t}"/>`;case`path`:return`<path d="${e.d}" class="${t}"/>`;case`line`:return`<line x1="${Y(e.x1)}" y1="${Y(e.y1)}" x2="${Y(e.x2)}" y2="${Y(e.y2)}"${e.stroke?` stroke="${e.stroke}"`:``} class="${t}"/>`}}function du(e,t,n=`Inter`,r=!1,i,a,s,c={}){let{viewBox:l}=e,{css:u,cls:d}=lu(t,c.nonce),f=[];if(f.push(aa(ge(F(Number(Y(l.width)),Number(Y(l.height)),t,r,a,s,void 0,c.styleAttribute,c.description),d),i)),f.push(o(n,!1,c.nonce,c.bodyFont)),f.push(u),f.push(`<g transform="translate(${Y(-l.x)}, ${Y(-l.y)})">`),e.showBranches){f.push(`<g>`);for(let t of e.branches){let{line:e,bkg:n}=t;f.push(`<line x1="${Y(e.x1)}" y1="${Y(e.y1)}" x2="${Y(e.x2)}" y2="${Y(e.y2)}" class="branch branch${t.colorIndex}"/>`,`<rect class="branchLabelBkg label${t.colorIndex}" rx="4" ry="4" x="${Y(n.x)}" y="${Y(n.y)}" width="${Y(n.w)}" height="${Y(n.h)}"${n.tx===void 0?``:` transform="translate(${Y(n.tx)}, ${Y(n.ty??0)})"`}/>`,`<g class="branchLabel"><g class="label branch-label${t.colorIndex}" transform="translate(${Y(t.label.x)}, ${Y(t.label.y)})"><text>${t.name.split(/\\n|\n|<br\s*\/?>/gi).map(e=>`<tspan xml:space="preserve" dy="1em" x="0" class="row">${C(e.trim())}</tspan>`).join(``)}</text></g></g>`)}f.push(`</g>`)}f.push(`<g class="commit-arrows">`);for(let t of e.arrows)f.push(`<path d="${t.d}" class="arrow arrow${t.colorIndex}"/>`);f.push(`</g>`),f.push(`<g class="commit-bullets">`);for(let t of e.commits)for(let e of t.shapes)f.push(uu(e));f.push(`</g>`),f.push(`<g class="commit-labels">`);for(let t of e.commits){let e=t.label;if(e){let t=e.rotate?` transform="${e.rotate}"`:``,n=`<rect class="commit-label-bkg" x="${Y(e.rect.x)}" y="${Y(e.rect.y)}" width="${Y(e.rect.w)}" height="${Y(e.rect.h)}"${t}/><text x="${Y(e.textPos.x)}" y="${Y(e.textPos.y)}" class="commit-label"${t}>${C(e.text)}</text>`;f.push(e.groupTransform?`<g transform="${e.groupTransform}">${n}</g>`:`<g>${n}</g>`)}for(let e of t.tags)f.push(`<polygon class="tag-label-bkg" points="${e.points}"${e.polygonTransform?` transform="${e.polygonTransform}"`:``}/>`,`<circle cx="${Y(e.hole.cx)}" cy="${Y(e.hole.cy)}" r="1.5" class="tag-hole"${e.holeTransform?` transform="${e.holeTransform}"`:``}/>`,`<text x="${Y(e.textPos.x)}" y="${Y(e.textPos.y)}" class="tag-label"${e.textTransform?` transform="${e.textTransform}"`:``}>${C(e.text)}</text>`)}return f.push(`</g>`),e.title&&f.push(`<text x="${Y(e.title.x)}" y="${Y(e.title.y)}" class="gitTitleText">${C(e.title.text)}</text>`),f.push(`</g>`,`</svg>`),f.join(`
|
|
157
|
+
`)}var fu={labelFontSize:12,byteFontSize:10,titleFontSize:14};function pu(e){let t=Xe(e.config),{rowHeight:n,paddingX:r,paddingY:i,bitWidth:a,bitsPerRow:o,showBits:s}=t,c=t.bitOrder===`descending`,l=n+i,u=l*(e.words.length+1)-(e.title?0:n),d=a*o+2;return{width:d,height:u,rows:e.words.map((e,t)=>{let u=t*l+i;return e.map(e=>{let t=e.end-e.start+1,i=e.start%o,l=(c?o-i-t:i)*a+1,d=t*a-r,f={x:l,y:u,width:d,height:n,label:e.label,labelX:l+d/2,labelY:u+n/2};if(s){let[n,r]=c?[e.end,e.start]:[e.start,e.end],i=t===1;f.bits=[{text:String(n),x:l+(i?d/2:0),y:u-2,anchor:i?`middle`:`start`}],i||f.bits.push({text:String(r),x:l+d,y:u-2,anchor:`end`})}return f})}),...e.title&&{title:{text:e.title,x:d/2,y:u-l/2}}}}function mu(e){return String(Math.round(e*100)/100)}function hu(e,t,n=`Inter`,r=!1,i,a,s,c={}){let l=[aa(F(e.width,e.height,t,r,a,s,void 0,c.styleAttribute,c.description),i),o(n,!1,c.nonce,c.bodyFont),`${de(c.nonce)}
|
|
158
|
+
.packetBlock { fill: var(--_node-fill); stroke: var(--_node-stroke); stroke-width: 1; }
|
|
159
|
+
.packetLabel { fill: var(--_text); font-size: ${fu.labelFontSize}px; }
|
|
160
|
+
.packetByte { fill: var(--_text-muted); font-size: ${fu.byteFontSize}px; }
|
|
161
|
+
.packetTitle { fill: var(--_text); font-size: ${fu.titleFontSize}px; }
|
|
162
|
+
</style>`];for(let t of e.rows){let e=[`<g>`];for(let n of t){e.push(`<rect x="${mu(n.x)}" y="${mu(n.y)}" width="${mu(n.width)}" height="${mu(n.height)}" class="packetBlock"/>`,`<text x="${mu(n.labelX)}" y="${mu(n.labelY)}" class="packetLabel" dominant-baseline="middle" text-anchor="middle">${C(n.label)}</text>`);for(let[t,r]of(n.bits??[]).entries())e.push(`<text x="${mu(r.x)}" y="${mu(r.y)}" class="packetByte ${t===0?`start`:`end`}" dominant-baseline="auto" text-anchor="${r.anchor}">${r.text}</text>`)}e.push(`</g>`),l.push(e.join(``))}return e.title&&l.push(`<text x="${mu(e.title.x)}" y="${mu(e.title.y)}" class="packetTitle" dominant-baseline="middle" text-anchor="middle">${C(e.title.text)}</text>`),l.push(`</svg>`),l.join(`
|
|
163
|
+
`)}var gu={width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17,labelPad:4,legendLineHeight:20},_u=e=>Math.round(e*100)/100+0;function vu(e,t){let n=e.length,r=t=>e[(t%n+n)%n],i=`M${_u(r(0).x)},${_u(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${_u(c.x)},${_u(c.y)} ${_u(l.x)},${_u(l.y)} ${_u(o.x)},${_u(o.y)}`}return`${i} Z`}function yu(e){let t={...gu,...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:_u(r)}:{kind:`polygon`,points:n.map((e,t)=>({x:_u(r*Math.cos(s(t))),y:_u(r*Math.sin(s(t)))}))}}),d=n.map((e,n)=>{let r=Math.cos(s(n)),i=Math.sin(s(n));return{x2:_u(o*t.axisScaleFactor*r),y2:_u(o*t.axisScaleFactor*i),label:e.label,labelX:_u(o*t.axisLabelFactor*r+t.labelPad*r),labelY:_u(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:vu(r,t.curveTension)}:{index:n,kind:`polygon`,points:r.map(e=>({x:_u(e.x),y:_u(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 bu={axisStrokeWidth:2,axisLabelFontSize:12,curveOpacity:.5,curveStrokeWidth:2,graticuleOpacity:.3,graticuleStrokeWidth:1,legendFontSize:12};function xu(e,t,n){let r={...bu,...e.style},i=[...new Set([...e.curves.map(e=>e.index),...e.legend.map(e=>e.index)])].sort((e,t)=>e-t),a=i.map(e=>` --radar-color-${e}: ${nc(e,t.accent,t.bg)};`),o=i.map(e=>` .radarCurve-${e} { fill: var(--radar-color-${e}); fill-opacity: ${r.curveOpacity}; stroke: var(--radar-color-${e}); stroke-width: ${r.curveStrokeWidth}; }\n .radarLegendBox-${e} { fill: var(--radar-color-${e}); fill-opacity: ${r.curveOpacity}; stroke: var(--radar-color-${e}); }`),s=N(a);return{css:`${de(n)}
|
|
164
|
+
.radarTitle { fill: var(--_text); font-size: 16px; dominant-baseline: hanging; text-anchor: middle; }
|
|
165
|
+
.radarAxisLine { stroke: var(--fg); stroke-width: ${r.axisStrokeWidth}; }
|
|
166
|
+
.radarAxisLabel { fill: var(--_text); font-size: ${r.axisLabelFontSize}px; }
|
|
167
|
+
.radarGraticule { fill: var(--_line); fill-opacity: ${r.graticuleOpacity}; stroke: var(--_line); stroke-width: ${r.graticuleStrokeWidth}; }
|
|
168
|
+
.radarLegendText { fill: var(--_text); text-anchor: start; font-size: ${r.legendFontSize}px; dominant-baseline: hanging; }${a.length>0?`\n .${s} {\n${a.join(`
|
|
169
|
+
`)}\n }`:``}
|
|
170
|
+
${o.join(`
|
|
171
|
+
`)}
|
|
172
|
+
</style>`,cls:s}}function Su(e){let t=String(Math.round(e*100)/100);return t===`-0`?`0`:t}var Cu=e=>e.map(e=>`${Su(e.x)},${Su(e.y)}`).join(` `);function wu(e,t,n=`Inter`,r=!1,i,a,s,c={}){let l=[],{css:u,cls:d}=xu(e,t,c.nonce);l.push(aa(ge(F(e.width,e.height,t,r,a,s,void 0,c.styleAttribute,c.description),d),i)),l.push(o(n,!1,c.nonce,c.bodyFont)),l.push(u),l.push(`<g transform="translate(${Su(e.centerX)}, ${Su(e.centerY)})">`);for(let t of e.rings)l.push(t.kind===`circle`?`<circle r="${Su(t.r)}" class="radarGraticule"/>`:`<polygon points="${Cu(t.points)}" class="radarGraticule"/>`);for(let t of e.axes)l.push(`<line x1="0" y1="0" x2="${Su(t.x2)}" y2="${Su(t.y2)}" class="radarAxisLine"/>`,`<text x="${Su(t.labelX)}" y="${Su(t.labelY)}" text-anchor="${t.anchor}" dominant-baseline="${t.baseline}" class="radarAxisLabel">${C(t.label)}</text>`);for(let t of e.curves)l.push(t.kind===`path`?`<path d="${t.d}" class="radarCurve-${t.index}"/>`:`<polygon points="${Cu(t.points??[])}" class="radarCurve-${t.index}"/>`);for(let t of e.legend)l.push(`<g transform="translate(${Su(t.x)}, ${Su(t.y)})"><rect width="12" height="12" class="radarLegendBox-${t.index}"/><text x="16" y="0" class="radarLegendText">${C(t.label)}</text></g>`);return l.push(`<text class="radarTitle" x="${Su(e.title.x)}" y="${Su(e.title.y)}">${C(e.title.text)}</text>`,`</g>`,`</svg>`),l.join(`
|
|
173
|
+
`)}var Tu={sectionWidth:200,padding:10,lineHeight:24,cardPadding:20,minHeading:25,minColumn:50,viewBoxPadding:10,cornerRadius:5},Eu={"Very High":`red`,High:`orange`,Low:`blue`,"Very Low":`lightblue`},Du=16.328125,Ou=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}]/gu,ku=e=>(e.text.match(Ou)?.length??0)*Du+jl(e.text.replace(Ou,``),16,e.bold);function Au(e,t){return e?ul(e.replace(/[ \t]+/g,` `),t,ku,!0):{lines:[],width:0,height:0}}function ju(e,t,n){return{lines:e.lines,x:t,y:n,width:e.width,height:e.height}}function Mu(e,t){return e.ticket&&t?t.replace(`#TICKET#`,e.ticket):void 0}function Nu(e){let t=e.config?.sectionWidth||Tu.sectionWidth,n=Tu.padding,r=t-1.5*n,i=r-10,a=[],o=e.columns.map(e=>Au(e.text,t)),s=Math.max(Tu.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=Au(t.text,i),o=Au(t.ticket,i),s=Au(t.assigned,i),c=Math.max(o.height,s.height)/2,l=a.height+Tu.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=Mu(t,e.config?.ticketBaseUrl);return{cx:f,cy:u,width:r,height:l,title:ju(a,d,u-c-a.height/2),...o.height>0&&{ticket:ju(o,d,m)},...s.height>0&&{assigned:ju(s,f+10+r/2-s.width-20,m)},...h!==void 0&&{ticketUrl:h},...t.priority!==void 0&&{priorityColor:Eu[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,Tu.minColumn)+(s-Tu.minHeading),colorClass:d,label:ju(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=Tu.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 Pu=e=>String(Math.round(e*100)/100);function Fu(e){return e===void 0?``:e.split(/\s+/).filter(e=>/^[A-Za-z_][\w-]*$/.test(e)).map(e=>` ${e}`).join(``)}function Iu(e,t,n){let r=e.columns.map(e=>e.colorClass),i=r.map(e=>` --kb-color-${e}: ${nc(e-1,t.accent,t.bg)};`),a=r.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)); }`),o=N(i);return{css:`${de(n)}
|
|
174
|
+
.kb-label { fill: var(--_text); font-size: 16px; }
|
|
175
|
+
.kb-heading { text-anchor: middle; }
|
|
176
|
+
.kb-bold { font-weight: 700; }
|
|
177
|
+
.kb-italic { font-style: italic; }
|
|
178
|
+
.node rect { fill: var(--_node-fill); stroke: var(--_node-stroke); stroke-width: 1px; }
|
|
179
|
+
.kanban-ticket-link .kb-label { text-decoration: underline; }
|
|
180
|
+
.cluster-label .kb-label { fill: var(--_text); }
|
|
181
|
+
.cluster rect { stroke-width: 1px; }
|
|
182
|
+
.${o} {
|
|
183
|
+
${i.join(`
|
|
184
|
+
`)}
|
|
185
|
+
}
|
|
186
|
+
${a.join(`
|
|
187
|
+
`)}
|
|
188
|
+
</style>`,cls:o}}function Lu(e,t=!1){return e.lines.map((n,r)=>{let i=n.map(e=>{let t=`${e.bold?`kb-bold`:``}${e.bold&&e.italic?` `:``}${e.italic?`kb-italic`:``}`,n=C(e.text);return t===``?n:`<tspan class="${t}">${n}</tspan>`}).join(``),a=e.y+Tu.lineHeight*(r+.5);return`<text ${t?`x="${Pu(e.x+e.width/2)}" class="kb-label kb-heading"`:`x="${Pu(e.x)}" class="kb-label"`} y="${Pu(a)}" dy="0.35em" xml:space="preserve">${i.trim()}</text>`}).join(``)}function Ru(e){let t=e.cx-e.width/2,n=e.cy-e.height/2,r=Tu.cornerRadius,i=`<g class="node${Fu(e.className)}"><rect class="basic label-container" rx="${r}" ry="${r}" x="${Pu(t)}" y="${Pu(n)}" width="${Pu(e.width)}" height="${Pu(e.height)}"/>`+Lu(e.title);if(e.ticket){let t=Lu(e.ticket);i+=e.ticketUrl===void 0?t:`<a class="kanban-ticket-link" href="${C(e.ticketUrl)}" target="_blank" rel="noopener noreferrer">${t}</a>`}if(e.assigned&&(i+=Lu(e.assigned)),e.priorityColor!==void 0){let a=t+2;i+=`<line x1="${Pu(a)}" y1="${Pu(n+Math.floor(r/2))}" x2="${Pu(a)}" y2="${Pu(n+e.height-Math.floor(r/2))}" stroke-width="4"${e.priorityColor===``?``:` stroke="${e.priorityColor}"`}/>`}return i+`</g>`}function zu(e,t,n=`Inter`,r=!1,i,a,s,c={}){let l=[],{css:u,cls:d}=Iu(e,t,c.nonce),f=e.viewBox;l.push(aa(ge(F(f.width,f.height,t,r,a,s,void 0,c.styleAttribute,c.description),d),i)),l.push(o(n,!1,c.nonce,c.bodyFont)),l.push(u),l.push(`<g transform="translate(${Pu(-f.x)}, ${Pu(-f.y)})">`),l.push(`<g class="sections">`);for(let t of e.columns)l.push(`<g class="cluster section-${t.colorClass}${Fu(t.className)}"><rect rx="${Tu.cornerRadius}" ry="${Tu.cornerRadius}" x="${Pu(t.x)}" y="${Pu(t.y)}" width="${Pu(t.width)}" height="${Pu(t.height)}"/><g class="cluster-label">${Lu(t.label,!0)}</g></g>`);l.push(`</g><g class="items">`);for(let t of e.columns)for(let e of t.cards)l.push(Ru(e));return l.push(`</g></g></svg>`),l.join(`
|
|
189
|
+
`)}var Bu={width:600,height:400,nodeWidth:10,nodePadding:12,valuePadding:15,fontSize:14,labelGap:6,ascent:13,descent:3,iterations:6,labelFit:1.12},Vu=e=>e.reduce((e,t)=>e+t.value,0);function Hu(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 Uu(e,t,n){let{x1:r,y1:a,dx:o,how:s}=n,c=n.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 t)e.source.sourceLinks.push(e),e.target.targetLinks.push(e);for(let t of e)t.value=Math.max(Vu(t.sourceLinks),Vu(t.targetLinks));let f=(t,n)=>{let r=new Set(e),a=0;for(;r.size;){let o=new Set;for(let e of r){n(e,a);for(let n of t(e))o.add(n)}if(++a>e.length)throw new i(`circular link`,{diagramType:`sankey`});r=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(...e.map(e=>e.depth))+1,m=(r-0-o)/(p-1),h=Array(p);for(let t of e){let e=Math.max(0,Math.min(p-1,Math.floor(Hu(s,t,p))));t.layer=e,t.x0=0+e*m,t.x1=t.x0+o,h[e]?h[e].push(t):h[e]=[t]}c=Math.min(n.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<Bu.iterations;++e){let t=.99**e,n=Math.max(1-t,(e+1)/Bu.iterations);T(t,n),w(t,n)}for(let t of e){let e=t.y0,n=e;for(let n of t.sourceLinks)n.y0=e+n.width/2,e+=n.width;for(let e of t.targetLinks)e.y1=n+e.width/2,n+=e.width}}function Wu(e){let t=Math.round(e*100)/100;return Number.isFinite(t)?t:e}var Gu=e=>Math.round(e*1e6)/1e6;function Ku(e){let t=e.config??{},n=t.width??Bu.width,r=t.height??Bu.height,i=t.showValues??!0,a=t.labelStyle??`legacy`,o=t.prefix??``,s=t.suffix??``,c=t.nodeWidth??Bu.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}};Uu(u,d,{x1:n,y1:r,dx:c,dy:(t.nodePadding??Bu.nodePadding)+(i?Bu.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}${Wu(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+Bu.labelGap:e.x0-Bu.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=jl(e.label.text,Bu.fontSize)*Bu.labelFit,n=e.label.y+(i?0:.35*Bu.fontSize),r=e.label.anchor===`start`?e.label.x:e.label.x-t;b(r,n-Bu.ascent,r+t,n+Bu.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)=>Gu(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:Gu(v-g),height:Gu(y-_),nodes:m,links:h,options:{linkColor:t.linkColor??`gradient`,labelStyle:a,showValues:i}}}var qu=10;function Ju(e){return String(Math.round(e*100)/100)}function Yu(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 Xu(e,t,n){let r=[...new Set(e.nodes.filter(e=>e.color===void 0).map(e=>e.index%qu))].sort((e,t)=>e-t),i=r.map(e=>` --sankey-color-${e}: ${nc(e,t.accent,t.bg)};`),a=r.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}); }`),o=N(i);return{css:`${de(n)}
|
|
190
|
+
.node-labels { fill: var(--_text); }
|
|
191
|
+
.sankey-label-bg { stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; paint-order: stroke; }
|
|
192
|
+
.sankey-label-fg { fill: var(--_text); }
|
|
193
|
+
.node rect { shape-rendering: crispEdges; }
|
|
194
|
+
.link { fill: none; stroke-opacity: 0.5; mix-blend-mode: multiply; }${i.length>0?`\n .${o} {\n${i.join(`
|
|
195
|
+
`)}\n }`:``}
|
|
196
|
+
${a.join(`
|
|
197
|
+
`)}
|
|
198
|
+
</style>`,cls:o}}function Zu(e,t,n){return e.color===void 0?` class="sk-${t}${e.index%qu}"`:` ${n}="${S(e.color)}"`}function Qu(e,t,n=`Inter`,r=!1,i,a,s,c={}){let l=[],{css:u,cls:d}=Xu(e,t,c.nonce);l.push(aa(ge(F(e.width,e.height,t,r,a,s,void 0,c.styleAttribute,c.description),d),i)),l.push(o(n,!1,c.nonce,c.bodyFont)),l.push(u),l.push(`<g class="nodes">`);for(let t of e.nodes)l.push(`<g class="node" transform="translate(${Ju(t.x0)},${Ju(t.y0)})"><rect height="${Ju(t.y1-t.y0)}" width="${Ju(t.x1-t.x0)}"${Zu(t,`f`,`fill`)}/></g>`);l.push(`</g>`);let f=e.options.showValues?`0`:`0.35`,p=(e,t)=>`<text${t?` class="${t}"`:``} x="${Ju(e.label.x)}" y="${Ju(e.label.y)}" dy="${f}em" text-anchor="${e.label.anchor}">${C(e.label.text)}</text>`;if(l.push(`<g class="node-labels" font-size="14">`),e.options.labelStyle===`outlined`){for(let t of e.nodes)l.push(p(t,`sankey-label-bg`));for(let t of e.nodes)l.push(p(t,`sankey-label-fg`))}else for(let t of e.nodes)l.push(p(t));l.push(`</g>`);let m=e.options.linkColor,h=`sankey-${Yu(JSON.stringify([e.links,e.nodes.map(e=>e.id)]))}`;return l.push(`<g class="links" fill="none" stroke-opacity="0.5">`),e.links.forEach((t,n)=>{let r=e.nodes[t.source],i=e.nodes[t.target],a=Ju((t.x0+t.x1)/2),o=`M${Ju(t.x0)},${Ju(t.y0)}C${a},${Ju(t.y0)},${a},${Ju(t.y1)},${Ju(t.x1)},${Ju(t.y1)}`,s,c=``;if(m===`gradient`){let e=`${h}-link-${n}`;c=`<linearGradient id="${e}" gradientUnits="userSpaceOnUse" x1="${Ju(t.x0)}" x2="${Ju(t.x1)}"><stop offset="0%"${Zu(r,`t`,`stop-color`)}/><stop offset="100%"${Zu(i,`t`,`stop-color`)}/></linearGradient>`,s=` stroke="url(#${e})"`}else s=m===`source`?Zu(r,`s`,`stroke`):m===`target`?Zu(i,`s`,`stroke`):` stroke="${S(m)}"`;l.push(`<g class="link">${c}<path d="${o}"${s} stroke-width="${Ju(Math.max(1,t.width))}"/></g>`)}),l.push(`</g>`),l.push(`</svg>`),l.join(`
|
|
199
|
+
`)}var $u=2048,ed=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 td(e){let t=0,n=[...e];for(let e=1;e<n.length;e++)t+=ed.get(n[e-1]+n[e])??0;return t/$u}function nd(e){return jl(e)+td(e)*16}var rd={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 id(e,t=rd.maxLabelWidth){if(nd(e)<=t)return[e];let n=[],r=``;for(let i of e.split(` `)){let e=r?`${r} ${i}`:i;if(nd(e)>t){if(r&&n.push(r),r=i,nd(i)>t){let e=``;for(let r of i)e+=r,nd(e+`-`)>t&&(n.push(e.slice(0,-1)+`-`),e=r);r=e}}else r=e}return r&&n.push(r),n}function ad(e,t=rd.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&&nd(r)>t?(n.push(e),e=i):e=r}n.push(e)}return n}function od(e){let t={...rd,...e.config},n=t.originY,r=2*t.height+t.diagramMarginY,i=[],a=0,o=t.legendTop;e.actors.forEach((e,r)=>{let s=id(e,t.maxLabelWidth).map((e,r)=>{let i=nd(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:ad(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 sd=`M7.5,0A7.5,7.5,0,1,1,-7.5,0L-6.818,0A6.818,6.818,0,1,0,6.818,0Z`,cd=`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 ld(e,t,n){let r=new Set;for(let t of e.sections)r.add(t.num);for(let t of e.tasks)r.add(t.num);let i=new Set;for(let t of e.legend)i.add(t.pos%6);let a=[...[...r].sort((e,t)=>e-t).map(e=>` --journey-section-${e}: ${nc(e+1,t.accent,t.bg)};`),...[...i].sort((e,t)=>e-t).map(e=>` --journey-actor-${e}: ${nc(e+4,t.accent,t.bg)};`)],o=[...[...r].map(e=>` .section-type-${e} { fill: color-mix(in srgb, var(--journey-section-${e}) 30%, var(--bg)); }`),...[...i].map(e=>` .actor-${e} { fill: var(--journey-actor-${e}); }`)],s=N(a);return{css:`${de(n)}
|
|
200
|
+
.journey-label { fill: var(--_text); font-size: 14px; }
|
|
201
|
+
.legend { fill: var(--_text); font-size: 16px; }
|
|
202
|
+
.journey-title { fill: var(--_text); font-weight: bold; }
|
|
203
|
+
.face { fill: color-mix(in srgb, var(--fg) 8%, var(--bg)); stroke: var(--fg); }
|
|
204
|
+
.mouth { stroke: var(--fg); fill: var(--fg); }
|
|
205
|
+
.mouth-line { stroke: var(--fg); }
|
|
206
|
+
.task-line { stroke: var(--fg); }
|
|
207
|
+
.task, .journey-section { stroke: var(--fg); stroke-opacity: 0.4; }
|
|
208
|
+
.journey-axis { stroke: var(--fg); }
|
|
209
|
+
.journey-arrow { fill: var(--fg); }${a.length>0?`\n .${s} {\n${a.join(`
|
|
210
|
+
`)}\n }`:``}
|
|
211
|
+
${o.join(`
|
|
212
|
+
`)}
|
|
213
|
+
</style>`,cls:s}}function ud(e,t,n){return e.map((r,i)=>{let a=i*14-14*(e.length-1)/2;return`<text x="${X(t)}" y="${X(n)}" dominant-baseline="central" alignment-baseline="central" text-anchor="middle" class="journey-label"><tspan x="${X(t)}" dy="${X(a)}">${C(r)}</tspan></text>`}).join(``)}function dd(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="${sd}" transform="translate(${X(t)},${X(n+2)})"/>`:e.score<3?`<path class="mouth" d="${cd}" 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 fd(e,t,n=`Inter`,r=!1,i,a,s,c={}){let l=[],{css:u,cls:d}=ld(e,t,c.nonce);l.push(aa(ge(F(e.width,e.height,t,r,a,s,void 0,c.styleAttribute,c.description),d),i)),l.push(o(n,!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 t of e.legend){l.push(`<circle cx="${X(t.cx)}" cy="${X(t.cy)}" class="actor-${t.pos%6}" stroke="var(--fg)" r="7"/>`);for(let e of t.lines)l.push(`<text x="40" y="${X(e.y)}" class="legend"><tspan x="${X(e.x)}">${C(e.text)}</tspan></text>`)}for(let t of e.sections)l.push(`<g><rect x="${X(t.x)}" y="${X(t.y)}" width="${X(t.width)}" height="${X(t.height)}" rx="3" ry="3" class="journey-section section-type-${t.num}"/>`+ud(t.text.split(/<br\s*\/?>/i),t.x+t.width/2,t.y+t.height/2)+`</g>`);e.tasks.forEach((e,t)=>{let n=e.x+e.width/2,r=e.dots.map(e=>`<circle cx="${X(e.cx)}" cy="${X(e.cy)}" class="actor-${e.pos}" stroke="var(--fg)" r="7"><title>${C(e.actor)}</title></circle>`).join(``);l.push(`<g><line id="task${t}" x1="${X(n)}" y1="${X(e.y)}" x2="${X(n)}" y2="${X(e.lineEndY)}" class="task-line" stroke-width="1" stroke-dasharray="4 2"/>`+dd(e)+`<rect x="${X(e.x)}" y="${X(e.y)}" width="${X(e.width)}" height="${X(e.height)}" rx="3" ry="3" class="task task-type-${e.num} section-type-${e.num}"/>`+r+ud(e.lines,n,e.y+e.height/2)+`</g>`)}),e.title&&l.push(`<text x="${X(e.title.x)}" y="${X(e.title.y)}" font-size="33.47" font-weight="bold" class="journey-title">${C(e.title.text)}</text>`);let f=e.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 pd=`␣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|`,md=`␣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 hd(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 gd=hd(pd),_d=hd(md);function vd(e,t=!1){let n=t?_d:gd,r=0;for(let t=0;t+1<e.length;t++)r+=n.get(e.slice(t,t+2))??0;return r}function yd(e,t=!1){return jl(e,16,t)+vd(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 bd(e){return`<<${e}>>`}function xd(e,t,n){let r=Math.max(yd(e),yd(t,!0),...n.map(e=>yd(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 Sd(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 Cd(e,t={}){if(e.nodes.length===0)return{width:16,height:16,nodes:[],edges:[]};let n=new Map,r=new Map;for(let t of e.nodes){let e=Ye(t);r.set(t.id,e),n.set(t.id,xd(`<<${t.typeLabel}>>`,t.id,e))}let i=Z.margin,a=e.relationships.flatMap((e,t)=>e.src===e.dst?[]:[{id:`e${t}`,sources:[e.src],targets:[e.dst],labels:[{layoutOptions:Wt,text:bd(e.type),width:yd(bd(e.type)),height:Z.rowHeight}]}]),o=St({id:`root`,layoutOptions:{...Ht({direction:Bt(t.direction??e.direction,zt.requirement),nodeSpacing:Z.nodeSpacing,layerSpacing:Z.layerSpacing,padding:i}),"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:e.nodes.map(e=>Ut(e.id,n.get(e.id))),edges:a},t.layoutCache),s=e.nodes.map(t=>{let i=(o.children??[]).find(e=>e.id===t.id),a=n.get(t.id),s=r.get(t.id),c=i.x??0,l=i.y??0,u=e.classAssignments.get(t.id),d=oe(t.id,e);return{id:t.id,kind:t.kind,typeText:`<<${t.typeLabel}>>`,name:t.id,rows:s,x:c,y:l,width:i.width??a.width,height:i.height??a.height,...s.length>0&&{dividerY:l+Z.rowHeight*2+Z.bodyGap},...d&&{inlineStyle:d},...u&&{className:u}}}),c=new Map(s.map(e=>[e.id,e])),l=new Map((o.edges??[]).map(e=>[e.id,e])),u=e.relationships.map((e,t)=>{let n=bd(e.type),r=yd(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=l.get(`e${t}`),n=qn(e),r=e.labels[0];return{...i,points:n,labelPoint:Sd(n,{x:r.x+r.width/2,y:r.y+r.height/2})}}let a=c.get(e.src),o=a.y+a.height/2,s=a.x-Z.loopOut,u=Math.max(Z.loopHalf,a.height/8);return{...i,points:[{x:a.x,y:o-u},{x:s,y:o-u},{x:s,y:o+u},{x:a.x,y:o+u}],labelPoint:{x:s-Z.loopLabelGap-r/2,y:o}}}),d=1/0,f=1/0,p=-1/0,m=-1/0,h=(e,t,n,r)=>{d=Math.min(d,e),f=Math.min(f,t),p=Math.max(p,n),m=Math.max(m,r)};for(let e of s)h(e.x,e.y,e.x+e.width,e.y+e.height);for(let e of u){for(let t of e.points)h(t.x,t.y,t.x,t.y);h(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 g=i-d,_=i-f;for(let e of s)e.x+=g,e.y+=_,e.dividerY!==void 0&&(e.dividerY+=_);for(let e of u){for(let t of e.points)t.x+=g,t.y+=_;e.labelPoint.x+=g,e.labelPoint.y+=_}return{width:p-d+2*i,height:m-f+2*i,nodes:s,edges:u}}var wd=`10 7`,Td=9,Ed=16,Dd=8;function Od(e,t,n=`Inter`,r=!1,i=Ot,a,o,s,c={}){let l=[];l.push(aa(F(e.width,e.height,t,r,o,s,void 0,c.styleAttribute,c.description),a)),l.push(Ft(n,!0,c.nonce,c.bodyFont));for(let t of e.edges)l.push(jd(t));for(let t of e.nodes)l.push(kd(t,i));for(let t of e.edges)l.push(Md(t,i));return l.push(`</svg>`),l.join(`
|
|
215
|
+
`)}function kd(e,t){let{x:n,y:r,width:i,height:a,inlineStyle:o}=e,s=S(o?.fill??`var(--_node-fill)`),c=S(o?.stroke??`var(--_node-stroke)`),l=S(o?.[`stroke-width`]??String(R.outerBox)),u=o?.color?S(o.color):void 0,d=ce(e.className),f=d?E`requirement-node ${d}`:`requirement-node`,p=[E`<g class="${f}" data-id="${S(e.id)}" data-kind="${e.kind}">`,E` <rect x="${n}" y="${r}" width="${i}" height="${a}" rx="0" ry="0" `+E`fill="${s}" stroke="${c}" stroke-width="${l}" />`],m=n+i/2,h=Z.rowHeight,g=r+Z.textTop,_=(e,n,r,i,a)=>` `+P(e,n,r,t.nodeLabel,E`${i} font-size="${t.nodeLabel}" fill="${u??a}"`);if(p.push(_(e.typeText,m,g+h/2,`text-anchor="middle"`,`var(--_text-sec)`),_(e.name,m,g+h*1.5,E`text-anchor="middle" font-weight="700"`,`var(--_text)`)),e.dividerY!==void 0){p.push(E` <line x1="${n}" y1="${e.dividerY}" x2="${n+i}" y2="${e.dividerY}" `+E`stroke="${c}" stroke-width="${R.innerBox}" />`);for(let[t,r]of e.rows.entries())p.push(_(r,n+Z.rowInset,g+h*2+Z.bodyGap+h*(t+.5),`text-anchor="start"`,`var(--_text-sec)`))}return p.push(`</g>`),p.join(`
|
|
216
|
+
`)}function Ad(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 jd(e){let t=e.points;if(t.length<2)return``;let n=e.type===`contains`,r=R.connector,i=[`class="requirement-relationship"`,E`data-type="${e.type}"`,E`data-src="${S(e.src)}"`,E`data-dst="${S(e.dst)}"`].join(` `),a=E`<polyline ${i} points="${t.map(e=>E`${e.x},${e.y}`).join(` `)}" fill="none" `+E`stroke="var(--_line)" stroke-width="${r}"${n?``:E` stroke-dasharray="${wd}"`} />`;if(n){let e=t[0],n=Ad(e,t[1]),i={x:e.x+n.x*10,y:e.y+n.y*10},o=Td,s=(e,t,n,i)=>E`<line x1="${e}" y1="${t}" x2="${n}" y2="${i}" stroke="var(--_line)" stroke-width="${r}" />`;return[a,E`<circle cx="${i.x}" cy="${i.y}" r="${o}" fill="var(--bg)" stroke="var(--_line)" stroke-width="${r}" />`,s(i.x-o,i.y,i.x+o,i.y),s(i.x,i.y-o,i.x,i.y+o)].join(`
|
|
217
|
+
`)}let o=t[t.length-1],s=Ad(t[t.length-2],o),c={x:o.x-s.x*Ed,y:o.y-s.y*Ed},l={x:c.x-s.y*Dd,y:c.y+s.x*Dd},u={x:c.x+s.y*Dd,y:c.y-s.x*Dd};return[a,E`<polyline points="${l.x},${l.y} ${o.x},${o.y} ${u.x},${u.y}" fill="none" stroke="var(--_line)" stroke-width="${r}" stroke-linejoin="miter" />`].join(`
|
|
218
|
+
`)}function Md(e,t){let{labelPoint:n,labelWidth:r,labelHeight:i}=e;return E`<rect x="${n.x-r/2}" y="${n.y-i/2}" width="${r}" height="${i}" rx="2" ry="2" `+`fill="var(--bg)" stroke="none" />`+E`\n${P(e.label,n.x,n.y,t.edgeLabel,E`text-anchor="middle" font-size="${t.edgeLabel}" font-weight="${L.edgeLabel}" fill="color-mix(in srgb, var(--fg) 70%, var(--bg))"`)}`}function Nd(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 Pd=e.messageSize+5;function Fd(e){return e.labelLines??Se(e)}function Id(t){let n=t.labelPosition;return n?Fd(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*Pd,w:m(r,e.messageSize,400),h:e.messageSize})):[]}function Ld(){return{next:{cnt:0}}}function Rd(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 zd(e,t,n,r){let i=e[t];e[t]=i===void 0?n:r(n,i)}function Bd(e,n,r){e.next.cnt+=1;let i=r.shapeMargin,a=e.next.startx===e.next.stopx?e.next.stopx+i:e.next.stopx+i*2,o=a+n.width,s=e.next.starty+i*2,c=s+n.height;(a>=e.widthLimit||o>=e.widthLimit||e.next.cnt>t.shapeInRow)&&(a=e.next.startx+i+r.nextLinePaddingX,s=e.next.stopy+i*2,e.next.stopx=o=a+n.width,e.next.starty=e.next.stopy,e.next.stopy=c=s+n.height,e.next.cnt=1),n.x=a,n.y=s,zd(e,`startx`,a,Math.min),zd(e,`starty`,s,Math.min),zd(e,`stopx`,o,Math.max),zd(e,`stopy`,c,Math.max),zd(e.next,`startx`,a,Math.min),zd(e.next,`starty`,s,Math.min),zd(e.next,`stopx`,o,Math.max),zd(e.next,`stopy`,c,Math.max)}function Vd(e,n){let r=(e,t)=>n.wrap?ve(e,n.textWidth,t):e.split(`
|
|
219
|
+
`),i=r(e.label,t.nameSize),a=e.description?r(e.description,t.descrSize):[],o=Math.max(...i.map(e=>h(e,t.nameSize,700)),h(Ce(e),t.typeSize,400),...a.map(e=>h(e,t.descrSize,400)));return{el:e,nameLines:i,descriptionLines:a,x:0,y:0,...f(e,i.length,a.length,o,n)}}function Hd(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 Ud(e,n){let r=new Map,i=[],a=n.diagramMarginX,o=n.diagramMarginY,s=(e,t)=>{for(let i of t){let t=Vd(i,n);r.set(i.alias,t),Bd(e,t,n)}e.stopx+=n.shapeMargin,e.stopy+=n.shapeMargin},c=(e,r,l)=>{let u=Ld();u.widthLimit=e.widthLimit/Math.min(t.boundaryInRow,r.length);for(let[d,f]of r.entries()){let r=f.boundary,p=0,m=p+8;p=m+t.boundaryLabelHeight;let h;r&&xe(r)&&(h=p+5,p=h+t.boundaryTypeHeight);let g;if(r?.description&&(g=p+20,p=g+t.boundaryDescrHeight),r||(p=t.rootHeadingHeight),d===0||d%t.boundaryInRow===0){let t=e.startx+n.diagramMarginX,r=e.stopy+n.diagramMarginY+p;Rd(u,t,t,r,r)}else{let e=u.stopx===u.startx?u.startx:u.stopx+n.diagramMarginX;Rd(u,e,e,u.starty,u.starty)}if(f.elements.length>0&&s(u,f.elements),f.children.length>0&&c(u,f.children,l+1),r){let e=u.stopx-u.startx,t=u.stopy-u.starty;e===0&&(e=n.width,u.stopx=u.startx+e),t===0&&(t=p+n.shapeMargin),i.push({alias:r.alias,label:r.label,...r.type?{type:r.type}:{},...r.description?{description:r.description}:{},x:u.startx,y:u.starty,width:e,height:t,depth:l,labelY:m,...h===void 0?{}:{typeY:h},...g===void 0?{}:{descrY:g}})}e.stopy=Math.max(u.stopy+n.shapeMargin,e.stopy),e.stopx=Math.max(u.stopx+n.shapeMargin,e.stopx),a=Math.max(a,e.stopx),o=Math.max(o,e.stopy)}},l=Ld();return Rd(l,n.diagramMarginX,n.diagramMarginX,n.diagramMarginY,n.diagramMarginY),l.widthLimit=t.screenWidth,c(l,[e],-1),{elements:r,boundaries:i,maxX:a,maxY:o}}function Wd(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 Gd(e,t){let n=u(e.width,e.height),r=e.x+e.width/2,i=e.y+e.height/2,a=e.width,o=e.height,s=-o/2+n.headRadius,c=-o/2+n.pillTop,l=n.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,(c-s)/n.headRadius))*180/Math.PI,p=[...d(0,s,n.headRadius,24,180+f,-f),...d(-a/2+l,c+l,l,12,90,0),...d(-a/2+l,o/2-l,l,12,360,270),...d(a/2-l,o/2-l,l,12,270,180),...d(a/2-l,c+l,l,12,180,90)];return qd({x:r,y:i},t,p.map(e=>({x:r+e.x,y:i+e.y})))}function Kd(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 qd(e,t,n){let r,i=1/0;return n.forEach((a,o)=>{let s=Kd(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 Jd=1e-6;function Yd(e,t){let n=Wd(e,t),r=e.x+e.width/2,i=e.y+e.height/2,{rx:a,ry:o}=c(e.width),s=n.x-r,l=Math.abs(s)<e.width/2-Jd||Math.abs(Math.abs(s)-e.width/2)<=Jd&&Math.abs(n.y-i)>e.height/2-o;if(a===0||!l)return n;let u=o*o*(1-s*s/(a*a)),d=o-(u>0?Math.sqrt(u):u);return t.y-i>0&&(d=-d),{x:n.x,y:n.y+d}}function Xd(e,t){let n=Wd(e,t),r=e.x+e.width/2,i=e.y+e.height/2,{rx:a,ry:o}=d(e.height),s=n.y-i,c=Math.abs(s)<e.height/2-Jd||Math.abs(Math.abs(s)-e.height/2)<=Jd&&Math.abs(n.x-r)>e.width/2-a;if(o===0||!c)return n;let l=a*a*(1-s*s/(o*o)),u=a-Math.sqrt(Math.abs(l));return t.x-r>0&&(u=-u),{x:n.x+u,y:n.y}}function Zd(e,t){let n=e.el;return n?.kind===`person`?Gd(e,t):n?.shape===`db`?Yd(e,t):n?.shape===`queue`?Xd(e,t):Wd(e,t)}var Qd=e=>({x:e.x+e.width/2,y:e.y+e.height/2});function $d(e,n,r,i){let a=r.get(e.from),o=r.get(e.to),s=Zd(a,Qd(o)),c=Zd(o,Qd(a)),l=c.x-s.x,u=c.y-s.y,d=e=>({x:e.x,y:e.y+i}),f={...e,points:[d(s),d(c)]};if(n>0&&(f.curve=d({x:s.x+l/2-l/4,y:s.y+u/2})),Se(e).length>0){let n={x:Math.min(s.x,c.x)+Math.abs(l)/2,y:Math.min(s.y,c.y)+Math.abs(u)/2},r=Se(e)[0],i=e.label!==``||e.index!==void 0?h(r??``,t.messageSize,400):0;if(f.labelPosition=d({x:n.x+i/2,y:n.y}),e.technology){let r=h(`[${e.technology}]`,t.messageSize,400);f.technologyX=n.x+Math.max(i,r)/2}}return f}var ef=2,tf=6,nf=2,rf=[0,14,-14,28,-28],af=[.75,.55,.4],of=1e3,sf=100,cf=10,lf=2,uf=5,df=4,ff=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}),pf=(e,t)=>e.x0<t.x1+ef&&e.x1>t.x0-ef&&e.y0<t.y1+ef&&e.y1>t.y0-ef;function mf(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/df));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 hf(e){return e.flatMap(e=>{let n=(e,t,n,r,i)=>({x0:e-i,x1:t+i,y0:n-i,y1:r+i,weight:sf}),r=(t,r,i,a)=>{let o=h(t,i,a),s=e.x+e.width/2;return n(s-o/2,s+o/2,e.y+r-i/2,e.y+r+i/2,uf)},i=xe({...e,elementAliases:[],children:[]});return[n(e.x,e.x+e.width,e.y,e.y,lf),n(e.x,e.x+e.width,e.y+e.height,e.y+e.height,lf),n(e.x,e.x,e.y,e.y+e.height,lf),n(e.x+e.width,e.x+e.width,e.y,e.y+e.height,lf),r(e.label,e.labelY,t.boundarySize+2,700),...i?[r(i,e.typeY,t.boundarySize,400)]:[],...e.description?[r(e.description,e.descrY,t.boundarySize-2,400)]:[]]})}function gf(e,t){return Id({...e,labelLines:t.lines,labelPosition:t.position,...t.technologyX===void 0?{}:{technologyX:t.technologyX}}).map(ff)}function _f(e,n,r,i,a){let o=e.points[0],s=e.points[e.points.length-1],c=e.labelPosition;if(!c||!o||!s)return;let l=s.x-o.x,u=s.y-o.y,d=Math.hypot(l,u),f=Se(e),p=e.label!==``||e.index!==void 0,m=p?h(f[0],t.messageSize,400):0,g=c.x-m/2,_=[{variant:{lines:f,position:c,...e.technologyX===void 0?{}:{technologyX:e.technologyX}},cost:0}];if(p&&a){let n=e.technology?[`[${e.technology}]`]:[],r=new Set([f.join(`
|
|
220
|
+
`)]);af.forEach((e,i)=>{let a=ve(f[0],m*e,t.messageSize),o=[...a,...n].join(`
|
|
221
|
+
`);if(r.has(o))return;r.add(o);let s=Math.max(...a.map(e=>h(e,t.messageSize,400)));_.push({variant:{lines:[...a,...n],position:{x:g+s/2,y:c.y}},cost:25*(i+1)})})}let v=d===0?0:l/d,y=d===0?0:u/d,b=d/2+Math.max(...rf)+ef,x=_.flatMap(t=>gf(e,t.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=[...n,...i].filter(C),T=Math.max(nf,d/200),E=r.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:t,cost:n}of _){let r=gf(e,t);for(let e of rf)if(!k(n+2*Math.abs(e)))for(let i=0;i<=d/2&&!k(n+2*Math.abs(e)+i);i+=T)for(let a of i===0?[1]:[1,-1]){let o=a*i,s={x:o*v-e*y,y:o*y+e*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(pf(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+=cf)}}let d=n+i+2*Math.abs(e);(!O||l<O.penalty||l===O.penalty&&d<O.cost)&&(O={v:t,at:s,penalty:l,cost:d})}}let{v:A,at:ee}=O;e.labelPosition={x:A.position.x+ee.x,y:A.position.y+ee.y},A.lines!==f&&(e.labelLines=A.lines),A.technologyX===void 0?delete e.technologyX:e.technologyX=A.technologyX+ee.x,i.push(...Id(e).map(e=>({...ff(e),weight:sf})))}function vf(e,n={}){let r=s(e.layout);if(e.elements.length===0&&e.boundaries.length===0){let n={variant:e.variant,width:0,height:0,elements:[],boundaries:[],relationships:[]};if(e.title){let i=2*r.diagramMarginY+t.titleExtra;n.title=e.title,n.width=Math.ceil(2*r.diagramMarginX+h(e.title,16,400)),n.height=i,n.titlePosition={x:r.diagramMarginX,y:i/2}}return n}let i=Ud(Hd(e),r),a=e.title?t.titleExtra:0,o=r.diagramMarginY+a,c=e.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}]:[]}),l=[...i.boundaries].sort((e,t)=>e.depth-t.depth).map(e=>({...e,y:e.y+o})),u=new Map;for(let e of i.elements.values())u.set(e.el.alias,e);for(let e of i.boundaries)u.set(e.alias,e);let d=e.relationships.map((e,t)=>$d(e,t,u,o)),f=[...c.map(e=>({x0:e.x-tf,x1:e.x+e.width+tf,y0:e.y-tf,y1:e.y+e.height+tf,weight:of})),...hf(l)],p=d.map(mf),m=[];d.forEach((e,t)=>_f(e,f,p.filter((e,n)=>n!==t),m,r.wrap));let g=i.maxX+r.diagramMarginX,_=i.maxY+r.diagramMarginY+a,v={variant:e.variant,width:g,height:_,elements:c,boundaries:l,relationships:d,...e.layout&&{layout:e.layout}};return e.title&&(v.title=e.title,v.titlePosition={x:(i.maxX-r.diagramMarginX)/2-4*r.diagramMarginX,y:r.diagramMarginY+r.diagramMarginY+o}),v}function yf(e,n,r=`Inter`,i=!1,a=Ot,s,c,l,u={}){let d=[];d.push(aa(F(e.width,e.height,n,i,c??e.title,l,void 0,u.styleAttribute,u.description),s)),d.push(o(r,!1,u.nonce,u.bodyFont)),e.title&&e.titlePosition&&d.push(E`<text class="c4-title" x="${e.titlePosition.x}" y="${e.titlePosition.y}" dy="${Nt}" `+E`font-size="16" fill="var(--_text)">${C(e.title)}</text>`);for(let t of e.boundaries)d.push(xf(t));for(let n of e.elements)d.push(Sf(n,e.layout?.shapePadding??t.shapePadding));for(let t of e.relationships)d.push(Af(t));for(let t of e.relationships)d.push(jf(t));return d.push(`</svg>`),d.filter(Boolean).join(`
|
|
222
|
+
`)}function bf(e,t,n,r,i){return E` <text x="${t}" y="${n}" text-anchor="middle" dy="${Nt}" font-size="${r}" `+E`${i}>${C(e)}</text>`}function xf(e){let n=[];n.push(E`<g class="c4-boundary" data-id="${S(e.alias)}" data-label="${S(e.label)}" data-depth="${e.depth}">`),n.push(E` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="2.5" ry="2.5" `+`fill="none" stroke="var(--_text)" stroke-width="1" stroke-dasharray="7,7" />`);let r=e.x+e.width/2;n.push(bf(e.label,r,e.y+(e.labelY??8),t.boundarySize+2,`font-weight="700" fill="var(--_text)"`));let i=xe({alias:e.alias,label:e.label,...e.type?{type:e.type}:{},elementAliases:[],children:[]});return i&&e.typeY!==void 0&&n.push(bf(i,r,e.y+e.typeY,t.boundarySize,`fill="var(--_text)"`)),e.description&&e.descrY!==void 0&&n.push(bf(e.description,r,e.y+e.descrY,t.boundarySize-2,`fill="var(--_text)"`)),n.push(`</g>`),n.join(`
|
|
223
|
+
`)}function Sf(e,n){let r=Nd(e),{x:i,y:a,width:o,height:s}=e,f=i+o/2,m=p(e.nameLines.length,e.descriptionLines.length),h=[];h.push(E`<g class="c4-element" data-id="${S(e.alias)}" data-kind="${e.kind}" data-shape="${e.shape}" `+E`data-external="${e.external}" data-label="${S(e.label)}">`);let g,_=f;if(e.kind===`person`)h.push(...wf(e,r)),g=a+u(o).pillTop+n;else if(e.shape===`db`){h.push(...Tf(e,r));let{ry:t}=c(o);g=a+(2*t+s)/2-m/2}else if(e.shape===`queue`){h.push(...Ef(e,r));let{rx:t}=d(s);_=f-t,g=a+s/2-m/2}else h.push(E` <rect x="${i}" y="${a}" width="${o}" height="${s}" rx="${t.cornerRadius}" ry="${t.cornerRadius}" `+E`fill="${r.fill}" stroke="${r.stroke}" stroke-width="${t.strokeWidth}" />`),g=a+n;let v=g;for(let n of e.nameLines)h.push(bf(n,_,v+t.nameLine/2,t.nameSize,E`font-weight="700" fill="${r.text}"`)),v+=t.nameLine;return h.push(bf(Ce(e),_,v+t.typeLine/2,t.typeSize,E`fill="${r.text}"`)),v+=t.typeLine,e.descriptionLines.forEach((e,n)=>{h.push(bf(e,_,v+t.descrLine/2+n*t.descrExtraLine,t.descrSize,E`fill="${r.text}"`))}),v+=l(e.descriptionLines.length),h.push(`</g>`),h.join(`
|
|
224
|
+
`)}function Cf(e){let{x:t,y:n,width:r,height:i}=e,{rx:a,headRadius:o,pillTop:s}=u(r,i),c=t+r/2,l=n+s,d=n+i,f=Math.sqrt(Math.max(0,o*o-(l-(n+o))**2));return E`M ${t+a} ${l} H ${c-f} A ${o} ${o} 0 1 1 ${c+f} ${l} `+E`H ${t+r-a} A ${a} ${a} 0 0 1 ${t+r} ${l+a} V ${d-a} `+E`A ${a} ${a} 0 0 1 ${t+r-a} ${d} H ${t+a} `+E`A ${a} ${a} 0 0 1 ${t} ${d-a} V ${l+a} `+E`A ${a} ${a} 0 0 1 ${t+a} ${l} Z`}function wf(e,n){return[E` <path class="c4-person-shape" d="${Cf(e)}" fill="${n.fill}" stroke="${n.stroke}" stroke-width="${t.strokeWidth}" />`]}function Tf(e,n){let{x:r,y:i,width:a,height:o}=e,{rx:s,ry:l}=c(a),u=E`fill="${n.fill}" stroke="${n.stroke}" stroke-width="${t.strokeWidth}"`;return[E` <path d="M ${r} ${i+l} L ${r} ${i+o-l} A ${s} ${l} 0 0 0 ${r+a} ${i+o-l} L ${r+a} ${i+l} Z" ${u} />`,E` <ellipse cx="${r+s}" cy="${i+l}" rx="${s}" ry="${l}" ${u} />`]}function Ef(e,n){let{x:r,y:i,width:a,height:o}=e,{rx:s,ry:c}=d(o),l=E`fill="${n.fill}" stroke="${n.stroke}" stroke-width="${t.strokeWidth}"`;return[E` <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` <ellipse cx="${r+a-s}" cy="${i+c}" rx="${s}" ry="${c}" ${l} />`]}function Df(e,t){let n=e.x-t.x,r=e.y-t.y,i=Math.hypot(n,r);if(i===0)return``;let a=n/i,o=r/i,s=e.x-a*10,c=e.y-o*10;return E`<polygon class="c4-arrowhead" points="${e.x},${e.y} ${s-o*5},${c+a*5} ${s+o*5},${c-a*5}" `+`fill="var(--_text)" />`}var Of=3,kf=1;function Af(e){let[t,n]=[e.points[0],e.points[e.points.length-1]];if(!t||!n||t===n)return``;let r=[`class="c4-relationship"`,E`data-from="${S(e.from)}"`,E`data-to="${S(e.to)}"`];e.label&&r.push(E`data-label="${S(e.label)}"`),e.technology&&r.push(E`data-technology="${S(e.technology)}"`);let i=e.curve?E`M ${t.x},${t.y} Q ${e.curve.x},${e.curve.y} ${n.x},${n.y}`:E`M ${t.x},${t.y} L ${n.x},${n.y}`,a=E`<path ${r.join(` `)} d="${i}" fill="none" stroke="var(--_text)" stroke-width="1" />`,o=e.curve??t,s=e.curve??n,c=Df(n,o),l=Df(t,s);return[a,...e.bidirectional?[c,l]:[e.reversed?l:c]].filter(Boolean).join(`
|
|
225
|
+
`)}function jf(e){let n=Fd(e),r=Id(e);if(r.length===0)return``;let i=[E`<g class="c4-relationship-label" data-from="${S(e.from)}" data-to="${S(e.to)}">`],a=Math.min(...r.map(e=>e.cx-e.w/2))-Of,o=Math.max(...r.map(e=>e.cx+e.w/2))+Of,s=r[0].cy-r[0].h/2-kf,c=r[r.length-1],l=c.cy+c.h/2+kf;return i.push(E` <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=e.technology!==void 0&&o===n.length-1,c=r[o];i.push(bf(a,c.cx,c.cy,t.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},Mf=Q.barHeight+Q.barGap,Nf={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:26298e5};function Pf(e,t={}){let n=t.width??Q.defaultWidth,r=e.tasks,i=r.filter(e=>!e.vert),a=[];for(let e of i)a.includes(e.section)||a.push(e.section);let o=e=>{let t=a.indexOf(e);return(t<0?0:t)%Q.numberSectionStyles},s=new Map,c=new Map,l=2*Q.topPadding;if(e.displayMode===`compact`){let e=0;for(let t of a){let n=i.filter(e=>e.section===t),r=ke(n,e,s)+1;e+=r,l+=r*Mf,c.set(t,r)}}else{for(let e of i)s.set(e,e.order);l+=i.length*Mf;for(let e of a)c.set(e,i.filter(t=>t.section===e).length)}let u=(l-2*Q.topPadding)/Mf,d=e=>e.vert?-1:s.get(e)??e.order,f=n-Q.leftPadding-Q.rightPadding,p=r.length?Math.min(...r.map(e=>e.start)):0,m=r.length?Math.max(...r.map(e=>e.end)):0,h=e=>Math.round(m===p?f/2:(e-p)/(m-p)*f),g=[...r].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=d(e),r=h(e.start),i=h(e.end),a=h(e.renderEnd??e.end),s=r+Q.leftPadding,c=a-r,l=t*Mf+Q.topPadding,f=Q.barHeight;e.milestone?(s=r+Q.leftPadding+.5*(i-r)-.5*Q.barHeight,c=Q.barHeight):e.vert&&(c=.08*Q.barHeight),e.vert&&(l=Q.gridLineStartPadding,f=u*Mf+Q.barHeight*2);let p=r+Q.leftPadding+.5*(i-r),m=t*Mf+Q.topPadding+.5*Q.barHeight,g=I(e.label,Q.fontSize,400),_=r,v=a;e.milestone&&(_+=.5*(i-r)-.5*Q.barHeight,v=_+Q.barHeight);let y,b=`middle`,x=null,S=i;e.milestone&&(S=r+Q.barHeight);let C=g>(e.vert?0:v-_),w=g>S-r;y=e.vert?r+Q.leftPadding:C?v+g+1.5*Q.leftPadding>n?_+Q.leftPadding-5:v+Q.leftPadding+5:(v-_)/2+_+Q.leftPadding,w&&(S+g+1.5*Q.leftPadding>n?(x=`left`,b=`end`):(x=`right`,b=`start`));let T=e.vert?Q.gridLineStartPadding+u*Mf+60:t*Mf+Q.barHeight/2+(Q.fontSize/2-2)+Q.topPadding;return{id:e.id,x:s,y:l,width:c,height:f,originX:p,originY:m,sectionStyle:o(e.section),task:e,text:{text:e.label,x:y,y:T,anchor:b,outside:x}}}),_=new Set,v=[];for(let e of g){if(e.task.vert)continue;let t=d(e.task);_.has(t)||(_.add(t),v.push({y:t*Mf+Q.topPadding-2,width:n-Q.rightPadding/2,height:Mf,sectionStyle:e.sectionStyle}))}let y=[];if((e.excludes.length>0||e.includes.length>0)&&r.length){let t=864e5;if(m-p<=1830*t){let n=t=>De(e,t),r=null;for(let e=p;e<=m;e+=t)n(e)?r?r.end=e:r={start:e,end:e}:r&&=(y.push(b(r)),null)}}function b(e){let t=864e5,n=e=>Math.floor(e/t)*t,r=h(n(e.start)),i=h(n(e.end)+t-1);return{id:Te(e.start,`%Y-%m-%d`),x:r+Q.leftPadding,y:Q.gridLineStartPadding,width:i-r,height:l-Q.topPadding-Q.gridLineStartPadding}}let x=e.axisFormat||(e.dateFormat===`D`?`%d`:`%Y-%m-%d`),S=e.tickInterval;S&&r.length&&Math.ceil((m-p)/(S.every*Nf[S.unit]))>1e4&&(S=void 0);let C=-l+Q.topPadding+Q.gridLineStartPadding,w=t=>({x:Q.leftPadding,y:t===`bottom`?l-50:Q.topPadding,position:t,tickSize:C,rangeEnd:f,ticks:r.length?Ze(p,m,S,e.weekday).map(e=>({x:h(e)+.5,label:Te(e,x)})):[]}),T=[w(`bottom`)];e.topAxis&&T.push(w(`top`));let E=[],D=0;for(let e of a){let t=c.get(e);E.push({lines:e.split(/<br\s*\/?>|\n/i),y:t*Mf/2+D*Mf+Q.topPadding,sectionStyle:o(e)}),D+=t}let O={width:n,height:l,excludeRanges:y,axes:T,rows:v,tasks:g,sectionLabels:E};if(e.title&&(O.title={text:e.title,x:n/2,y:Q.titleTopMargin}),e.todayMarker!==`off`&&r.length){let n=t.now??Date.now(),r=h(n);n>=p&&n<=m&&(O.today={x:r+Q.leftPadding,y1:Q.titleTopMargin,y2:l-Q.titleTopMargin,style:e.todayMarker.replace(/,/g,`;`)})}return O}function $(e){return String(Math.round(e*100)/100)}function Ff(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 If(e,t){let n=`var(--accent, ${ye})`,r=(e,t,n=`var(--bg)`)=>`color-mix(in srgb, ${e} ${t}%, ${n})`,i=r(n,75,`var(--fg)`),a=(e,t)=>` ${[0,1,2,3].map(t=>`.${e}${t}`).join(`,`)} { ${t} }`,o=[`doneText`,`doneCritText`].flatMap(e=>[0,1,2,3].flatMap(t=>[`.${e}${t}.taskTextOutsideLeft`,`.${e}${t}.taskTextOutsideRight`])).join(`,`);return`${de(t)}
|
|
142
227
|
.exclude-range { fill: ${r(`var(--fg)`,8)}; }
|
|
143
228
|
.section { stroke: none; opacity: 0.2; }
|
|
144
229
|
.section0 { fill: ${n}; }
|
|
@@ -173,7 +258,7 @@ ${a(`doneCritText`,`fill: var(--fg) !important;`)}
|
|
|
173
258
|
.vertText { font-size: 15px; text-anchor: middle; fill: ${r(n,60,`var(--fg)`)} !important; }
|
|
174
259
|
${a(`activeCritText`,`fill: var(--fg) !important;`)}
|
|
175
260
|
.titleText { text-anchor: middle; font-size: 18px; fill: var(--_text); }
|
|
176
|
-
</style>`}function
|
|
177
|
-
`)}var
|
|
178
|
-
`)){let e=``;for(let
|
|
179
|
-
`),shape:n.icon===void 0?n.shape:`rectangle`,icon:n.icon,...g,className:e.classAssignments.get(t),interaction:e.interactions.get(t)})}let h=e=>{let t=e.children.map(h),n=(e,t)=>({x:e.x-t,y:e.y-t,width:e.width+t*2,height:e.height+t*2}),r;for(let t of e.nodeIds)r=Vu(r,p.get(t));let i;for(let e of t)i=Vu(i,e);let a=[...r?[n(r,Nu)]:[],...i?[n(i,Pu)]:[]].reduce((e,t)=>Vu(e,t),void 0)??{x:-42.5,y:-42.5,width:Nu*2,height:Nu*2};return m.set(e.id,a),{id:e.id,label:e.label,...a,children:t,...e.icon===void 0?{}:{icon:e.icon},...e.architecture?{architecture:!0}:{}}},g=e.subgraphs.map(h),_=e.edges.map(e=>{let t=m.get(e.source),n=m.get(e.target);return{source:e.source,target:e.target,label:e.label,style:e.style,hasArrowStart:e.hasArrowStart,hasArrowEnd:e.hasArrowEnd,points:qu(t,n),inlineStyle:{"stroke-width":Ru}}}),v=1/0,y=1/0,b=-1/0,x=-1/0;for(let e of p.values())v=Math.min(v,e.x),y=Math.min(y,e.y),b=Math.max(b,e.x+e.width),x=Math.max(x,e.y+e.height);for(let e of f)e.icon!==void 0&&(x=Math.max(x,e.y+e.height+Iu));for(let e of m.values())v=Math.min(v,e.x),y=Math.min(y,e.y),b=Math.max(b,e.x+e.width),x=Math.max(x,e.y+e.height);let S=t-v,C=t-y,w=e=>{e.x+=S,e.y+=C,e.children.forEach(w)};for(let e of f)e.x+=S,e.y+=C;g.forEach(w);for(let e of _)e.points=e.points.map(e=>({x:e.x+S,y:e.y+C}));return{width:b-v+t*2,height:x-y+t*2,nodes:f,edges:_,groups:g}}var Ku=(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 qu(e,t){let n=Ku(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=Ku(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 Ju={type:`xychart`,parse:je,layoutForSvg:rs,renderSvg(e,t,n){let r=n.interactivity===void 0?n.interactive??!1:n.interactivity===`full`;return hs(e,t.colors,t.font,t.transparent,r,t.embedSource,t.title,t.decorative,t.emit)}},Yu={type:`sequence`,parse:ke,layoutForSvg:Ao,renderSvg(e,t){return jo(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}};function Xu(e){return(e.interactivity??`static`)!==`none`}function Zu(e){return(e.interactivity??`static`)===`full`}var Qu={type:`class`,parse(e,t){let n=p(t.split(/\r\n?|\n/)).classLayout;return{...Se(e),...n&&{layout:n}}},layoutForSvg:la,renderSvg(e,t,n){return ha(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,Xu(n),t.emit)}},$u={type:`er`,parse(e,t){let n=p(t.split(/\r\n?|\n/)).erLayout;return{...Ce(e),...n&&{layout:n}}},layoutForSvg(e,t){return Ga(oe(e,t.direction),t)},renderSvg(e,t){return Ja(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}},ed={type:`flowchart`,parse:(e,t)=>Te(t),layoutForSvg(e,t){return{graph:or(oe(e,t.direction),t),curve:t.curve??`linear`}},renderSvg(e,t,n){return _r(e.graph,t.colors,t.font,t.transparent,t.fontSizes,e.curve,t.embedSource,Zu(n),Xu(n),t.title,t.decorative,t.emit)}},td={type:`c4`,parse:xe,layoutForSvg(e,t){return uu(e,t)},renderSvg(e,t){return du(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}},nd={xychart:Ju,er:$u,sequence:Yu,class:Qu,flowchart:ed,architecture:{type:`architecture`,parse:be,layoutForSvg(e,t){return{graph:Gu(oe(ue(e),t.direction),t.padding),curve:`linear`}},renderSvg:ed.renderSvg},c4:td,pie:{type:`pie`,parse:(e,t)=>De(t),layoutForSvg:(e,t)=>Ds(t.honorThemeVariables?e:{...e,sliceColors:void 0},t),renderSvg(e,t){return js(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},quadrant:{type:`quadrant`,parse:(e,t)=>Oe(t),layoutForSvg:(e,t)=>Fs(t.honorThemeVariables?e:{...e,themeColors:void 0}),renderSvg(e,t){return Bs(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},mindmap:{type:`mindmap`,parse:(e,t)=>Ee(t),layoutForSvg:e=>Vc(e),renderSvg(e,t){return qc(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},gantt:{type:`gantt`,parse:(e,t)=>we(t),layoutForSvg:e=>Eu(e),renderSvg(e,t){return ju(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},timeline:{type:`timeline`,parse:(e,t)=>Ae(t),layoutForSvg:e=>ll(e),renderSvg(e,t){return fl(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}}},rd=54,id=18,ad=-25;function od(e,t){let n=/<svg [^>]*>/.exec(e)[0],[,r,i]=/viewBox="0 0 ([\d.]+) ([\d.]+)"/.exec(n),a=Number(r),o=Number(i),s=Math.max(0,Math.ceil((x(t,id,400)-a)/2)),c=a+2*s,l=o+rd,u=n.replace(/viewBox="[^"]*"/,`viewBox="${-s} -54 ${c} ${l}"`).replace(/ width="[^"]*"/,` width="${c}"`).replace(/ height="[^"]*"/,` height="${l}"`),f=`<text x="${a/2}" y="${ad}" text-anchor="middle" font-size="${id}" fill="var(--_text)" class="front-matter-title">${d(t)}</text>`;return e.replace(n,u).replace(/<\/svg>\s*$/,`${f}\n</svg>`)}function sd(t){return{bg:t.bg??e.bg,fg:t.fg??e.fg,line:t.line,accent:t.accent,muted:t.muted??(t.bg||t.fg?void 0:e.muted),surface:t.surface,border:t.border}}function cd(e={}){return ae(sd(e),e.transparent)}function ld(e){return{nonce:e.nonce,styleAttribute:e.styleAttribute,bodyFont:Ie(e)}}function ud(e,t={}){let{svg:n,colors:r}=pd(e,t),i=dd(n);return t.resolveColors?Xi(i,r):i}function dd(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 fd(e){let t=f(Ne(e)).text;nd[c(t)].parse(ne(t),t)}function pd(e,t){a(`maxInputLength`,e.length,t.limits),o(e,t.limits);let r=f(Ne(e)),s=r.text,l=t.font??`Inter`;te(y(l));let u=t.transparent??!1,d=ut(t.fontSizes),p=c(s),m=t.embedSource?e:void 0,h=t.title??r.accTitle,g=t.decorative,_={...ld(t),description:r.accDescr},v=ne(s),b=nd[p],x=b.parse(v,s);p===`c4`&&r.accTitle&&(x.title=r.accTitle.replace(/\s+/g,` `));let S=x;S.nodes instanceof Map&&Array.isArray(S.edges)&&i(S.nodes.size,S.edges.length,t.limits);let C=b.layoutForSvg(x,t),w=sd(t.honorThemeVariables?n(t,x.initConfig):t),T={colors:w,font:l,transparent:u,fontSizes:d,embedSource:m,title:h,decorative:g,emit:_},E=b.renderSvg(C,T,t);return r.frontMatterTitle&&(E=od(E,r.frontMatterTitle)),{svg:E,colors:w}}async function md(e,t={}){return t.embedFont===`subset`&&await Fe(),ud(e,t)}var hd=ud,gd=md;export{so as ACTOR_LABEL_OFFSET,mt as ARROW_HEAD,ft as ASYMMETRIC_NOTCH,L as CLS,yt as ELK_DIRECTION_FALLBACK,Ye as ElkNotRegisteredError,lt as FONT_SIZES,P as FONT_WEIGHTS,dt as GROUP_HEADER_CONTENT_PAD,wt as INLINE_CENTERED_EDGE_LABEL,Dc as MINDMAP,st as MONO_FONT,ct as MONO_FONT_STACK,pt as NODE_PADDING,W as PIE,Ms as QUADRANT,ro as SELF_LOOP_CONTROL,io as SELF_LOOP_EXTENT,ao as SELF_LOOP_HEIGHT,F as STROKE_WIDTHS,I as TEXT_BASELINE_SHIFT,J as TIMELINE,St as baseElkLayoutOptions,oo as boxLabelHeight,Et as buildElkEdge,Tt as buildElkEdgeLabel,Ct as buildElkLeafNode,ht as buildSvgStyleBlock,oa as classBackEdges,ta as classNoteId,on as clipEdgeToShape,cr as convertToElkFormat,et as createLayoutCache,bt as directionToElk,rt as elkLayoutSync,xt as elkPadding,ot as estimateMonoTextWidth,N as estimateTextWidth,Wi as evaluateCssColorValue,wn as extractEdgeLabelPosition,Cn as extractEdgePoints,fs as formatTickLabels,fo as hasLabelBelowIcon,la as layoutClassDiagramSync,Ga as layoutErDiagramSync,or as layoutFlowchartSync,ar as layoutGraphSync,Vc as layoutMindmap,Ds as layoutPieChart,Fs as layoutQuadrantChart,Ao as layoutSequenceDiagram,ll as layoutTimeline,rs as layoutXYChart,Fe as loadEmbeddedFont,C as niceTickValues,ks as pieColorValue,We as pointsToPath,Xe as registerElk,ha as renderClassSvg,Ja as renderErSvg,gd as renderMermaid,ud as renderMermaidSVG,md as renderMermaidSVGAsync,hd as renderMermaidSync,qc as renderMindmapSvg,js as renderPieSvg,Bs as renderQuadrantSvg,jo as renderSequenceSvg,_r as renderSvg,fl as renderTimelineSvg,hs as renderXYChartSvg,Xi as resolveCssColors,ut as resolveFontSizes,vs as smoothCurvePath,_s as straightLinePath,cd as themeCssVariables,Qc as timelineTextWidth,fd as validateMermaid,Fi as withDataSrc,$c as wrapTimelineText,ls as xLabelStep};
|
|
261
|
+
</style>`}function Lf(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 Rf(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 zf(e,t,n=`Inter`,r=!1,i,a,s,c={}){let l=[];l.push(aa(F(e.width,e.height,t,r,a,s,void 0,c.styleAttribute,c.description),i)),l.push(o(n,!1,c.nonce,c.bodyFont)),l.push(If(e.today?Ff(e.today.style):``,c.nonce)),l.push(`<g class="exclude-ranges">`);for(let t of e.excludeRanges)l.push(`<rect data-date="${t.id}" x="${$(t.x)}" y="${$(t.y)}" width="${$(t.width)}" height="${$(t.height)}" class="exclude-range"/>`);l.push(`</g>`);for(let t of e.axes){let e=t.position===`bottom`?1:-1;l.push(`<g class="grid" transform="translate(${t.x}, ${t.y})" fill="none" font-size="10" text-anchor="middle">`,`<path class="domain" stroke="currentColor" d="M0.5,${e*t.tickSize}V0.5H${t.rangeEnd+.5}V${e*t.tickSize}"/>`);for(let n of t.ticks)l.push(`<g class="tick" opacity="1" transform="translate(${$(n.x)},0)"><line stroke="currentColor" y2="${e*t.tickSize}"/><text fill="currentColor" y="${e*3}" dy="${e===1?`1em`:`0em`}" font-size="10" text-anchor="middle">${C(n.label)}</text></g>`);l.push(`</g>`)}l.push(`<g class="rows">`);for(let t of e.rows)l.push(`<rect x="0" y="${$(t.y)}" width="${$(t.width)}" height="${t.height}" class="section section${t.sectionStyle}"/>`);l.push(`</g>`),l.push(`<g class="tasks">`);for(let t of e.tasks)l.push(`<rect data-task="${C(t.id)}" rx="3" ry="3" x="${$(t.x)}" y="${$(t.y)}" width="${$(t.width)}" height="${$(t.height)}" transform-origin="${$(t.originX)}px ${$(t.originY)}px" class="${C(Lf(t.task,t.sectionStyle))}"/>`);for(let t of e.tasks)l.push(`<text data-task="${C(t.id)}" font-size="${Q.fontSize}" x="${$(t.text.x)}" y="${$(t.text.y)}" class="${C(Rf(t))}">${C(t.text.text)}</text>`);l.push(`</g>`),l.push(`<g class="section-titles">`);for(let t of e.sectionLabels){let e=-(t.lines.length-1)/2,n=t.lines.map((e,t)=>`<tspan alignment-baseline="central" x="10"${t>0?` dy="1em"`:``}>${C(e)}</tspan>`).join(``);t.lines.every(e=>e===``)||l.push(`<text dy="${e}em" x="10" y="${$(t.y)}" font-size="${Q.sectionFontSize}" class="sectionTitle sectionTitle${t.sectionStyle}">${n}</text>`)}if(l.push(`</g>`),e.today){let t=e.today,n=Ff(t.style)?` today-custom`:``;l.push(`<g class="today"><line x1="${$(t.x)}" x2="${$(t.x)}" y1="${t.y1}" y2="${$(t.y2)}" class="today${n}"/></g>`)}return e.title&&l.push(`<text x="${$(e.title.x)}" y="${e.title.y}" class="titleText">${C(e.title.text)}</text>`),l.push(`</svg>`),l.join(`
|
|
262
|
+
`)}var Bf=40,Vf=16,Hf=1.5,Uf=`3`;function Wf(e){let t=e?.padding??Bf,n=e?.iconSize??80,r=e?.fontSize??Vf,i=t+2.5,a=t+1.5,o=e?.idealEdgeLengthMultiplier??Hf;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 Gf=(e,t)=>M(e,Ot.nodeLabel*(t/Vf),L.nodeLabel);function Kf(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&&Gf(r,t.fontSize)>t.labelWrap?(n.push(e),e=i):e=r}n.push(e)}return n}var qf=(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 Jf(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 Yf(e,t){for(let n of e){if(n.nodeIds.includes(t))return[n.id];let e=Yf(n.children,t);if(e.length>0)return[...e,n.id]}return[]}function Xf(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 Zf(e,t,n){let r=Wf(n),i=t??n?.padding??It.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])}Jf(e,o);let s=new Map,c=new Map;for(let[t,[n,r]]of o)for(let i of Yf(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=Xf(s,d,Math.max(...l),r),m=Xf(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?[]:Kf(n.label,r),y=Math.max(0,...v.map(e=>Gf(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=qf(i,g.get(t));let a;for(let e of t)a=qf(a,e);let o=[...i?[n(i,r.groupPad)]:[],...a?[n(a,r.nestedPad)]:[]].reduce((e,t)=>qf(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:$f(t,n),inlineStyle:{"stroke-width":Uf}}}),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 Qf=(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 $f(e,t){let n=Qf(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=Qf(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 ep={type:`xychart`,parse:(e,t)=>Je(e,T(t.split(/\r\n?|\n/)).xyChart),layoutForSvg:ks,renderSvg(e,t,n){let r=n.interactivity===void 0?n.interactive??!1:n.interactivity===`full`;return Hs(e,t.colors,t.font,t.transparent,r,t.embedSource,t.title,t.decorative,t.emit)}},tp={type:`sequence`,parse:Ke,layoutForSvg:ns,renderSvg(e,t){return rs(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}};function np(e){return(e.interactivity??`static`)!==`none`}function rp(e){return(e.interactivity??`static`)===`full`}var ip={type:`class`,parse(e,t){let n=T(t.split(/\r\n?|\n/)).classLayout;return{...Me(e),...n&&{layout:n}}},layoutForSvg:Na,renderSvg(e,t,n){return za(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,np(n),t.emit)}},ap={type:`er`,parse(e,t){let n=T(t.split(/\r\n?|\n/)).erLayout;return{...Ne(e),...n&&{layout:n}}},layoutForSvg(e,t){return go(he(e,t.direction),t)},renderSvg(e,t){return yo(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}},op={type:`flowchart`,parse:(e,t)=>Re(t),layoutForSvg(e,t){return{graph:Ar(he(e,t.direction),t),curve:t.curve??`linear`}},renderSvg(e,t,n){return Vr(e.graph,t.colors,t.font,t.transparent,t.fontSizes,e.curve,t.embedSource,rp(n),np(n),t.title,t.decorative,t.emit)}},sp={xychart:ep,er:ap,sequence:tp,class:ip,flowchart:op,architecture:{type:`architecture`,parse(e,t){let n=T(t.split(/\r\n?|\n/)).architectureLayout;return{...Ae(e),...n&&{layout:n}}},layoutForSvg(e,t){return{graph:Zf(be(e),t.padding,e.layout),curve:`linear`}},renderSvg:op.renderSvg},c4:{type:`c4`,parse(e,t){let n=T(t.split(/\r\n?|\n/)).c4Layout;return{...je(e),...n&&{layout:n}}},layoutForSvg(e,t){return vf(e,t)},renderSvg(e,t){return yf(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}},pie:{type:`pie`,parse:(e,t)=>Ve(t),layoutForSvg:(e,t)=>ec(t.honorThemeVariables?e:{...e,sliceColors:void 0},t),renderSvg(e,t){return ic(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},quadrant:{type:`quadrant`,parse:(e,t)=>He(t),layoutForSvg:(e,t)=>cc(t.honorThemeVariables?e:{...e,themeColors:void 0}),renderSvg(e,t){return pc(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},mindmap:{type:`mindmap`,parse:(e,t)=>ze(t),layoutForSvg:e=>yl(e),renderSvg(e,t){return Tl(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},gantt:{type:`gantt`,parse:(e,t)=>Pe(t),layoutForSvg:e=>Pf(e),renderSvg(e,t){return zf(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},timeline:{type:`timeline`,parse:(e,t)=>qe(t),layoutForSvg:e=>Hl(e),renderSvg(e,t){return Gl(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},packet:{type:`packet`,parse:(e,t)=>Be(t),layoutForSvg:e=>pu(e),renderSvg(e,t){return hu(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},radar:{type:`radar`,parse:(e,t)=>Ue(t),layoutForSvg:e=>yu(e),renderSvg(e,t){return wu(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},journey:{type:`journey`,parse:(e,t)=>Ie(t),layoutForSvg:e=>od(e),renderSvg(e,t){return fd(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},kanban:{type:`kanban`,parse:(e,t)=>Le(t),layoutForSvg:e=>Nu(e),renderSvg(e,t){return zu(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},sankey:{type:`sankey`,parse:(e,t)=>Ge(t),layoutForSvg:e=>Ku(e),renderSvg(e,t){return Qu(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},requirement:{type:`requirement`,parse:(e,t)=>We(t),layoutForSvg:(e,t)=>Cd(e,t),renderSvg(e,t){return Od(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}},gitgraph:{type:`gitgraph`,parse:(e,t)=>Fe(t),layoutForSvg:e=>su(e),renderSvg(e,t){return du(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}}},cp=54,lp=18,up=-25;function dp(e,t){let n=/<svg [^>]*>/.exec(e)[0],[,r,i]=/viewBox="0 0 ([\d.]+) ([\d.]+)"/.exec(n),a=Number(r),o=Number(i),s=Math.max(0,Math.ceil((M(t,lp,400)-a)/2)),c=a+2*s,l=o+cp,u=n.replace(/viewBox="[^"]*"/,`viewBox="${-s} -54 ${c} ${l}"`).replace(/ width="[^"]*"/,` width="${c}"`).replace(/ height="[^"]*"/,` height="${l}"`),d=`<text x="${a/2}" y="${up}" text-anchor="middle" font-size="${lp}" fill="var(--_text)" class="front-matter-title">${C(t)}</text>`;return e.replace(n,u).replace(/<\/svg>\s*$/,`${d}\n</svg>`)}function fp(e){return{bg:e.bg??n.bg,fg:e.fg??n.fg,line:e.line,accent:e.accent,muted:e.muted??(e.bg||e.fg?void 0:n.muted),surface:e.surface,border:e.border}}function pp(e={}){return me(fp(e),e.transparent)}function mp(e){return{nonce:e.nonce,styleAttribute:e.styleAttribute,bodyFont:tt(e)}}function hp(e,t={}){let{svg:n,colors:r}=vp(e,t),i=gp(n);return t.resolveColors?ba(i,r):i}function gp(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 _p(e){let t=w(Qe(e)).text;sp[b(t)].parse(ue(t),t)}function vp(e,t){_(`maxInputLength`,e.length,t.limits),v(e,t.limits);let n=w(Qe(e)),r=n.text,i=t.font??`Inter`;le(ee(i));let o=t.transparent??!1,s=kt(t.fontSizes),c=b(r),l=t.embedSource?e:void 0,u=t.title??n.accTitle,d=t.decorative,f={...mp(t),description:n.accDescr},p=ue(r),m=sp[c],h=m.parse(p,r);c===`c4`&&n.accTitle&&(h.title=n.accTitle.replace(/\s+/g,` `));let y=h;y.nodes instanceof Map&&Array.isArray(y.edges)&&g(y.nodes.size,y.edges.length,t.limits);let x=t;c===`flowchart`&&t.fontSizes?.nodeLabel===void 0&&!Yt(h)&&(s=kt({...t.fontSizes,nodeLabel:16}),x={...t,fontSizes:s});let S=m.layoutForSvg(h,x),C=fp(t.honorThemeVariables?a(t,h.initConfig):t),T={colors:C,font:i,transparent:o,fontSizes:s,embedSource:l,title:u,decorative:d,emit:f},E=m.renderSvg(S,T,t);return n.frontMatterTitle&&(E=dp(E,n.frontMatterTitle)),{svg:E,colors:C}}async function yp(e,t={}){return t.embedFont===`subset`&&await et(),hp(e,t)}var bp=hp,xp=yp;export{No as ACTOR_LABEL_OFFSET,Pt as ARROW_HEAD,jt as ASYMMETRIC_NOTCH,z as CLS,zt as ELK_DIRECTION_FALLBACK,mt as ElkNotRegisteredError,Ot as FONT_SIZES,L as FONT_WEIGHTS,At as GROUP_HEADER_CONTENT_PAD,Wt as INLINE_CENTERED_EDGE_LABEL,rd as JOURNEY,Tu as KANBAN,tl as MINDMAP,Et as MONO_FONT,Dt as MONO_FONT_STACK,Mt as NODE_PADDING,fu as PACKET,W as PIE,ac as QUADRANT,gu as RADAR,Z as REQUIREMENT,Bu as SANKEY,ko as SELF_LOOP_CONTROL,Ao as SELF_LOOP_EXTENT,jo as SELF_LOOP_HEIGHT,R as STROKE_WIDTHS,Nt as TEXT_BASELINE_SHIFT,Al as TIMELINE,Ht as baseElkLayoutOptions,Mo as boxLabelHeight,Kt as buildElkEdge,Gt as buildElkEdgeLabel,Ut as buildElkLeafNode,Ft as buildSvgStyleBlock,Aa as classBackEdges,Ta as classNoteId,An as clipEdgeToShape,Mr as convertToElkFormat,yt as createLayoutCache,Bt as directionToElk,St as elkLayoutSync,Vt as elkPadding,Tt as estimateMonoTextWidth,I as estimateTextWidth,ma as evaluateCssColorValue,Jn as extractEdgeLabelPosition,qn as extractEdgePoints,Rs as formatTickLabels,Ro as hasLabelBelowIcon,Na as layoutClassDiagramSync,go as layoutErDiagramSync,Ar as layoutFlowchartSync,su as layoutGitGraph,kr as layoutGraphSync,od as layoutJourney,Nu as layoutKanban,yl as layoutMindmap,pu as layoutPacket,ec as layoutPieChart,cc as layoutQuadrantChart,yu as layoutRadar,Cd as layoutRequirementDiagramSync,Ku as layoutSankey,ns as layoutSequenceDiagram,Hl as layoutTimeline,ks as layoutXYChart,et as loadEmbeddedFont,ne as niceTickValues,nc as pieColorValue,lt as pointsToPath,ht as registerElk,za as renderClassSvg,yo as renderErSvg,du as renderGitGraphSvg,fd as renderJourneySvg,zu as renderKanbanSvg,xp as renderMermaid,hp as renderMermaidSVG,yp as renderMermaidSVGAsync,bp as renderMermaidSync,Tl as renderMindmapSvg,hu as renderPacketSvg,ic as renderPieSvg,pc as renderQuadrantSvg,wu as renderRadarSvg,Od as renderRequirementSvg,Qu as renderSankeySvg,rs as renderSequenceSvg,Vr as renderSvg,Gl as renderTimelineSvg,Hs as renderXYChartSvg,ba as resolveCssColors,kt as resolveFontSizes,Gs as smoothCurvePath,Ws as straightLinePath,pp as themeCssVariables,jl as timelineTextWidth,_p as validateMermaid,aa as withDataSrc,id as wrapLegendLabel,ad as wrapTaskLabel,Ml as wrapTimelineText,Fs as xLabelStep};
|