From 1e9de1ec866cf2b20f79748f2de760bba134038f Mon Sep 17 00:00:00 2001 From: process-analytics-bot <62586190+process-analytics-bot@users.noreply.github.com> Date: Wed, 12 Mar 2025 18:17:20 +0000 Subject: [PATCH 1/2] chore(deps): bump bpmn-visualization to 0.46.0 --- demo/draw-path/index.html | 2 +- demo/hacktoberfest-custom-themes/index.html | 2 +- .../assets/elements-identification.js | 4 ++-- demo/load-and-navigation/assets/index.css | 2 +- demo/load-and-navigation/assets/index.js | 2 +- demo/load-and-navigation/assets/main.js | 19 ++++++++----------- demo/load-and-navigation/assets/mxgraph.js | 2 +- .../index.html | 2 +- demo/prediction/index.html | 2 +- .../apply-css-classes/index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../growing-sequence-flow/index.html | 2 +- .../javascript-tooltip-and-popover/index.html | 2 +- .../running-dashed-message-flow/index.html | 2 +- .../select-elements-by-bpmn-kind/index.html | 2 +- .../custom-colors/index.html | 2 +- .../custom-edge-marker-colors/index.html | 2 +- .../custom-bpmn-theme/custom-fonts/index.html | 2 +- .../custom-user-task-icon/index.html | 2 +- .../diagram-fit-after-load/index.html | 2 +- .../diagram-fit-on-load/index.html | 2 +- .../diagram-navigation/index.html | 2 +- .../load-local-bpmn-diagrams/index.html | 2 +- .../load-remote-bpmn-diagrams/index.html | 2 +- .../pools-filter-on-load/index.html | 2 +- examples/misc/compare-with-bpmn-js/index.html | 2 +- .../index.html | 2 +- examples/overlays/add-remove/index.html | 2 +- examples/overlays/add-stylized/index.html | 2 +- .../custom-overlay-default-style/index.html | 2 +- .../package.json | 2 +- projects/typescript-angular/package.json | 2 +- projects/typescript-lit-element/package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- projects/typescript-vue/package.json | 2 +- 40 files changed, 48 insertions(+), 51 deletions(-) diff --git a/demo/draw-path/index.html b/demo/draw-path/index.html index d9e5dbad..8b64a3b0 100644 --- a/demo/draw-path/index.html +++ b/demo/draw-path/index.html @@ -26,7 +26,7 @@ - + diff --git a/demo/hacktoberfest-custom-themes/index.html b/demo/hacktoberfest-custom-themes/index.html index 6eef741a..3bae9028 100644 --- a/demo/hacktoberfest-custom-themes/index.html +++ b/demo/hacktoberfest-custom-themes/index.html @@ -35,7 +35,7 @@ - + diff --git a/demo/load-and-navigation/assets/elements-identification.js b/demo/load-and-navigation/assets/elements-identification.js index 92523da7..75a5b8e2 100644 --- a/demo/load-and-navigation/assets/elements-identification.js +++ b/demo/load-and-navigation/assets/elements-identification.js @@ -1,4 +1,4 @@ -import{d as E,s as q,w as I,u as L,F as P,r as p,c as S,l as c,e as w,i as A,j as O,k as x,n as C,S as v,o as u,p as i,q as T,t as g,v as F,x as D}from"./main.js";import"./mxgraph.js";let s=[],f=[],y=[];const a="detection";let d=!0,r=!0;function N(t){const e={font:{},fill:{},stroke:{}};if(F(t)){switch(t){case"messageFlow":case"sequenceFlow":case"association":{e.font.color="Chocolate",e.stroke.color="Chocolate",e.stroke.width=4;break}}return e}if(i.isTask(t))e.font.color="Indigo",e.fill.color="gold",e.font.size=14,e.fill.opacity=20;else if(i.isEvent(t))i.isBoundaryEvent(t)?(e.font.color="inherit",e.fill.color="inherit",e.stroke.color="inherit"):(e.font.color="MediumTurquoise",e.stroke.color="MediumTurquoise");else if(i.isGateway(t))e.font.color="CadetBlue",e.font.opacity=85,e.stroke.color="OrangeRed",e.stroke.width=4;else if(i.isPoolOrLane(t))e.font.color="white !important",e.fill.color="deeppink",e.stroke.opacity=80;else if(i.isCallActivity(t))e.font.color="white",e.font.family="Times New Roman",e.font.isItalic=!0,e.font.isStrikeThrough=!0,e.fill.color={startColor:"LightYellow",endColor:"LimeGreen",direction:"left-to-right"};else if(i.isSubProcess(t))e.font.color="white",e.font.size=14,e.font.family="Dialog",e.font.isBold=!0,e.font.isItalic=!0,e.font.isUnderline=!0,e.font.isStrikeThrough=!0,e.fill.color="MidnightBlue",e.opacity=60;else switch(t){case"group":case"textAnnotation":{e.font.color="Crimson",e.font.size=18,e.font.family="Verdana",e.font.isBold=!0,e.font.isUnderline=!0,e.stroke.color="Chartreuse",e.stroke.width=6;break}}return e}function B(t,e){const o=t.filter(n=>x(n)),l=t.filter(n=>!o.includes(n));o.length>0&&(y=C([v.POOL,v.LANE]).map(n=>n.id),u(y,{opacity:5,font:{color:"blue",opacity:5},fill:{color:"pink"},stroke:{color:"green"}})),u(o,{fill:{color:"swimlane"},stroke:{color:"swimlane"},font:{color:"swimlane"}}),i.isBoundaryEvent(e)&&(f=T(l),u(f,{opacity:5,font:{color:"green",opacity:5},fill:{color:"gold"},stroke:{color:"red"}}));const h=N(e);u(l,h)}function b(t){p(s,a),w(t,a)}function z(t,e){k(),B(t,e)}function k(){g(s),g(f),f=[],g(y),y=[]}function M(t,e){for(const o of s)S(o);if(d)for(const o of t)D(o,G(e));else c("Do not display overlays")}function m(t){c(`Searching for Bpmn elements of '${t}' kind`);const e=C(t);R(e,t);const o=e.map(l=>l.id);r?b(o):z(o,t),M(o,t),s=o}function R(t,e){const o=document.querySelector("#elements-result"),l=`Found ${t.length} ${e}(s)`;c(l);const h=t.map(n=>` - ${n.id}: '${n.name}'`).join(` +import{d as E,s as q,u as I,F as L,r as p,c as S,l as c,e as w,i as P,j as A,k as C,n as g,o as O,p as u,S as i,q as x,t as T,v as F,x as v,w as D}from"./main.js";import"./mxgraph.js";let s=[],f=[],y=[];const a="detection";let d=!0,r=!0;function N(t){const e={font:{},fill:{},stroke:{}};if(F(t)){switch(t){case"messageFlow":case"sequenceFlow":case"association":{e.font.color="Chocolate",e.stroke.color="Chocolate",e.stroke.width=4;break}}return e}if(i.isTask(t))e.font.color="Indigo",e.fill.color="gold",e.font.size=14,e.fill.opacity=20;else if(i.isEvent(t))i.isBoundaryEvent(t)?(e.font.color="inherit",e.fill.color="inherit",e.stroke.color="inherit"):(e.font.color="MediumTurquoise",e.stroke.color="MediumTurquoise");else if(i.isGateway(t))e.font.color="CadetBlue",e.font.opacity=85,e.stroke.color="OrangeRed",e.stroke.width=4;else if(i.isPoolOrLane(t))e.font.color="white !important",e.fill.color="deeppink",e.stroke.opacity=80;else if(i.isCallActivity(t))e.font.color="white",e.font.family="Times New Roman",e.font.isItalic=!0,e.font.isStrikeThrough=!0,e.fill.color={startColor:"LightYellow",endColor:"LimeGreen",direction:"left-to-right"};else if(i.isSubProcess(t))e.font.color="white",e.font.size=14,e.font.family="Dialog",e.font.isBold=!0,e.font.isItalic=!0,e.font.isUnderline=!0,e.font.isStrikeThrough=!0,e.fill.color="MidnightBlue",e.opacity=60;else switch(t){case"group":case"textAnnotation":{e.font.color="Crimson",e.font.size=18,e.font.family="Verdana",e.font.isBold=!0,e.font.isUnderline=!0,e.stroke.color="Chartreuse",e.stroke.width=6;break}}return e}function B(t,e){const o=t.filter(n=>O(n)),l=t.filter(n=>!o.includes(n));o.length>0&&(y=C([v.POOL,v.LANE]).map(n=>n.id),u(y,{opacity:5,font:{color:"blue",opacity:5},fill:{color:"pink"},stroke:{color:"green"}})),u(o,{fill:{color:"swimlane"},stroke:{color:"swimlane"},font:{color:"swimlane"}}),i.isBoundaryEvent(e)&&(f=x(l),u(f,{opacity:5,font:{color:"green",opacity:5},fill:{color:"gold"},stroke:{color:"red"}}));const h=N(e);u(l,h)}function b(t){p(s,a),w(t,a)}function z(t,e){k(),B(t,e)}function k(){g(s),g(f),f=[],g(y),y=[]}function M(t,e){for(const o of s)S(o);if(d)for(const o of t)T(o,G(e));else c("Do not display overlays")}function m(t){c(`Searching for Bpmn elements of '${t}' kind`);const e=C(t);R(e,t);const o=e.map(l=>l.id);r?b(o):z(o,t),M(o,t),s=o}function R(t,e){const o=document.querySelector("#elements-result"),l=`Found ${t.length} ${e}(s)`;c(l);const h=t.map(n=>` - ${n.id}: '${n.name}'`).join(` `);o.value+=[l,h].join(` `)+` -`,o.scrollTop=o.scrollHeight}function U(){const t=document.querySelector("#elements-result");t.value=""}function $(){const t=document.querySelector("#bpmn-kinds-select");t.addEventListener("change",l=>m(l.target.value)),document.addEventListener("diagramLoaded",()=>m(t.value),!1),document.querySelector("#clear-btn").addEventListener("click",function(){U(),r?p(s,a):k();for(const l of s)S(l);s=[]});const e=document.querySelector("#checkbox-display-overlays");e.addEventListener("change",function(){d=this.checked,c("Request overlays display:",d),m(t.value)}),e.checked=d;const o=document.querySelector("#checkbox-css-style");o.addEventListener("change",function(){r=this.checked,c("Request CSS style feature:",r),r?(k(),w(s,a)):(p(s,a),B(s,t.value))}),o.checked=r}function G(t){return i.isActivity(t)?{position:"top-right",label:"30",style:{font:{color:"Chartreuse",size:20},fill:{color:"DimGray"}}}:t.includes("Gateway")?{position:"top-left",label:"3",style:{stroke:{color:"HotPink",width:4}}}:t.includes("Event")?{position:"bottom-left",label:"15"}:t.includes("lane")||t.includes("pool")?{position:"bottom-right",label:"100"}:t.includes("Flow")?{position:"middle",label:"999",style:{fill:{color:"PaleTurquoise",opacity:25}}}:{position:"top-left",label:"40"}}function j(){document.querySelector("#btn-dl-svg").addEventListener("click",A,!1),document.querySelector("#btn-dl-png").addEventListener("click",O,!1)}E(()=>{q({globalOptions:{container:document.querySelector(".bpmn-container"),navigation:{enabled:!0}},statusKoNotifier:I}),L({type:P.Center,margin:20}),$(),j()}); +`,o.scrollTop=o.scrollHeight}function U(){const t=document.querySelector("#elements-result");t.value=""}function $(){const t=document.querySelector("#bpmn-kinds-select");t.addEventListener("change",l=>m(l.target.value)),document.addEventListener("diagramLoaded",()=>m(t.value),!1),document.querySelector("#clear-btn").addEventListener("click",function(){U(),r?p(s,a):k();for(const l of s)S(l);s=[]});const e=document.querySelector("#checkbox-display-overlays");e.addEventListener("change",function(){d=this.checked,c("Request overlays display:",d),m(t.value)}),e.checked=d;const o=document.querySelector("#checkbox-css-style");o.addEventListener("change",function(){r=this.checked,c("Request CSS style feature:",r),r?(k(),w(s,a)):(p(s,a),B(s,t.value))}),o.checked=r}function G(t){return i.isActivity(t)?{position:"top-right",label:"30",style:{font:{color:"Chartreuse",size:20},fill:{color:"DimGray"}}}:t.includes("Gateway")?{position:"top-left",label:"3",style:{stroke:{color:"HotPink",width:4}}}:t.includes("Event")?{position:"bottom-left",label:"15"}:t.includes("lane")||t.includes("pool")?{position:"bottom-right",label:"100"}:t.includes("Flow")?{position:"middle",label:"999",style:{fill:{color:"PaleTurquoise",opacity:25}}}:{position:"top-left",label:"40"}}function j(){document.querySelector("#btn-dl-svg").addEventListener("click",P,!1),document.querySelector("#btn-dl-png").addEventListener("click",A,!1)}E(()=>{q({globalOptions:{container:document.querySelector(".bpmn-container"),navigation:{enabled:!0}},statusKoNotifier:D}),I({type:L.Center,margin:20}),$(),j()}); diff --git a/demo/load-and-navigation/assets/index.css b/demo/load-and-navigation/assets/index.css index 9455561c..2b5d9b91 100644 --- a/demo/load-and-navigation/assets/index.css +++ b/demo/load-and-navigation/assets/index.css @@ -1 +1 @@ -/*! tailwindcss v4.0.0 | MIT License | https://tailwindcss.com */@layer theme{:root{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-serif:ui-serif,Georgia,Cambria,"Times New Roman",Times,serif;--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(.971 .013 17.38);--color-red-100:oklch(.936 .032 17.717);--color-red-200:oklch(.885 .062 18.334);--color-red-300:oklch(.808 .114 19.571);--color-red-400:oklch(.704 .191 22.216);--color-red-500:oklch(.637 .237 25.331);--color-red-600:oklch(.577 .245 27.325);--color-red-700:oklch(.505 .213 27.518);--color-red-800:oklch(.444 .177 26.899);--color-red-900:oklch(.396 .141 25.723);--color-red-950:oklch(.258 .092 26.042);--color-orange-50:oklch(.98 .016 73.684);--color-orange-100:oklch(.954 .038 75.164);--color-orange-200:oklch(.901 .076 70.697);--color-orange-300:oklch(.837 .128 66.29);--color-orange-400:oklch(.75 .183 55.934);--color-orange-500:oklch(.705 .213 47.604);--color-orange-600:oklch(.646 .222 41.116);--color-orange-700:oklch(.553 .195 38.402);--color-orange-800:oklch(.47 .157 37.304);--color-orange-900:oklch(.408 .123 38.172);--color-orange-950:oklch(.266 .079 36.259);--color-amber-50:oklch(.987 .022 95.277);--color-amber-100:oklch(.962 .059 95.617);--color-amber-200:oklch(.924 .12 95.746);--color-amber-300:oklch(.879 .169 91.605);--color-amber-400:oklch(.828 .189 84.429);--color-amber-500:oklch(.769 .188 70.08);--color-amber-600:oklch(.666 .179 58.318);--color-amber-700:oklch(.555 .163 48.998);--color-amber-800:oklch(.473 .137 46.201);--color-amber-900:oklch(.414 .112 45.904);--color-amber-950:oklch(.279 .077 45.635);--color-yellow-50:oklch(.987 .026 102.212);--color-yellow-100:oklch(.973 .071 103.193);--color-yellow-200:oklch(.945 .129 101.54);--color-yellow-300:oklch(.905 .182 98.111);--color-yellow-400:oklch(.852 .199 91.936);--color-yellow-500:oklch(.795 .184 86.047);--color-yellow-600:oklch(.681 .162 75.834);--color-yellow-700:oklch(.554 .135 66.442);--color-yellow-800:oklch(.476 .114 61.907);--color-yellow-900:oklch(.421 .095 57.708);--color-yellow-950:oklch(.286 .066 53.813);--color-lime-50:oklch(.986 .031 120.757);--color-lime-100:oklch(.967 .067 122.328);--color-lime-200:oklch(.938 .127 124.321);--color-lime-300:oklch(.897 .196 126.665);--color-lime-400:oklch(.841 .238 128.85);--color-lime-500:oklch(.768 .233 130.85);--color-lime-600:oklch(.648 .2 131.684);--color-lime-700:oklch(.532 .157 131.589);--color-lime-800:oklch(.453 .124 130.933);--color-lime-900:oklch(.405 .101 131.063);--color-lime-950:oklch(.274 .072 132.109);--color-green-50:oklch(.982 .018 155.826);--color-green-100:oklch(.962 .044 156.743);--color-green-200:oklch(.925 .084 155.995);--color-green-300:oklch(.871 .15 154.449);--color-green-400:oklch(.792 .209 151.711);--color-green-500:oklch(.723 .219 149.579);--color-green-600:oklch(.627 .194 149.214);--color-green-700:oklch(.527 .154 150.069);--color-green-800:oklch(.448 .119 151.328);--color-green-900:oklch(.393 .095 152.535);--color-green-950:oklch(.266 .065 152.934);--color-emerald-50:oklch(.979 .021 166.113);--color-emerald-100:oklch(.95 .052 163.051);--color-emerald-200:oklch(.905 .093 164.15);--color-emerald-300:oklch(.845 .143 164.978);--color-emerald-400:oklch(.765 .177 163.223);--color-emerald-500:oklch(.696 .17 162.48);--color-emerald-600:oklch(.596 .145 163.225);--color-emerald-700:oklch(.508 .118 165.612);--color-emerald-800:oklch(.432 .095 166.913);--color-emerald-900:oklch(.378 .077 168.94);--color-emerald-950:oklch(.262 .051 172.552);--color-teal-50:oklch(.984 .014 180.72);--color-teal-100:oklch(.953 .051 180.801);--color-teal-200:oklch(.91 .096 180.426);--color-teal-300:oklch(.855 .138 181.071);--color-teal-400:oklch(.777 .152 181.912);--color-teal-500:oklch(.704 .14 182.503);--color-teal-600:oklch(.6 .118 184.704);--color-teal-700:oklch(.511 .096 186.391);--color-teal-800:oklch(.437 .078 188.216);--color-teal-900:oklch(.386 .063 188.416);--color-teal-950:oklch(.277 .046 192.524);--color-cyan-50:oklch(.984 .019 200.873);--color-cyan-100:oklch(.956 .045 203.388);--color-cyan-200:oklch(.917 .08 205.041);--color-cyan-300:oklch(.865 .127 207.078);--color-cyan-400:oklch(.789 .154 211.53);--color-cyan-500:oklch(.715 .143 215.221);--color-cyan-600:oklch(.609 .126 221.723);--color-cyan-700:oklch(.52 .105 223.128);--color-cyan-800:oklch(.45 .085 224.283);--color-cyan-900:oklch(.398 .07 227.392);--color-cyan-950:oklch(.302 .056 229.695);--color-sky-50:oklch(.977 .013 236.62);--color-sky-100:oklch(.951 .026 236.824);--color-sky-200:oklch(.901 .058 230.902);--color-sky-300:oklch(.828 .111 230.318);--color-sky-400:oklch(.746 .16 232.661);--color-sky-500:oklch(.685 .169 237.323);--color-sky-600:oklch(.588 .158 241.966);--color-sky-700:oklch(.5 .134 242.749);--color-sky-800:oklch(.443 .11 240.79);--color-sky-900:oklch(.391 .09 240.876);--color-sky-950:oklch(.293 .066 243.157);--color-blue-50:oklch(.97 .014 254.604);--color-blue-100:oklch(.932 .032 255.585);--color-blue-200:oklch(.882 .059 254.128);--color-blue-300:oklch(.809 .105 251.813);--color-blue-400:oklch(.707 .165 254.624);--color-blue-500:oklch(.623 .214 259.815);--color-blue-600:oklch(.546 .245 262.881);--color-blue-700:oklch(.488 .243 264.376);--color-blue-800:oklch(.424 .199 265.638);--color-blue-900:oklch(.379 .146 265.522);--color-blue-950:oklch(.282 .091 267.935);--color-indigo-50:oklch(.962 .018 272.314);--color-indigo-100:oklch(.93 .034 272.788);--color-indigo-200:oklch(.87 .065 274.039);--color-indigo-300:oklch(.785 .115 274.713);--color-indigo-400:oklch(.673 .182 276.935);--color-indigo-500:oklch(.585 .233 277.117);--color-indigo-600:oklch(.511 .262 276.966);--color-indigo-700:oklch(.457 .24 277.023);--color-indigo-800:oklch(.398 .195 277.366);--color-indigo-900:oklch(.359 .144 278.697);--color-indigo-950:oklch(.257 .09 281.288);--color-violet-50:oklch(.969 .016 293.756);--color-violet-100:oklch(.943 .029 294.588);--color-violet-200:oklch(.894 .057 293.283);--color-violet-300:oklch(.811 .111 293.571);--color-violet-400:oklch(.702 .183 293.541);--color-violet-500:oklch(.606 .25 292.717);--color-violet-600:oklch(.541 .281 293.009);--color-violet-700:oklch(.491 .27 292.581);--color-violet-800:oklch(.432 .232 292.759);--color-violet-900:oklch(.38 .189 293.745);--color-violet-950:oklch(.283 .141 291.089);--color-purple-50:oklch(.977 .014 308.299);--color-purple-100:oklch(.946 .033 307.174);--color-purple-200:oklch(.902 .063 306.703);--color-purple-300:oklch(.827 .119 306.383);--color-purple-400:oklch(.714 .203 305.504);--color-purple-500:oklch(.627 .265 303.9);--color-purple-600:oklch(.558 .288 302.321);--color-purple-700:oklch(.496 .265 301.924);--color-purple-800:oklch(.438 .218 303.724);--color-purple-900:oklch(.381 .176 304.987);--color-purple-950:oklch(.291 .149 302.717);--color-fuchsia-50:oklch(.977 .017 320.058);--color-fuchsia-100:oklch(.952 .037 318.852);--color-fuchsia-200:oklch(.903 .076 319.62);--color-fuchsia-300:oklch(.833 .145 321.434);--color-fuchsia-400:oklch(.74 .238 322.16);--color-fuchsia-500:oklch(.667 .295 322.15);--color-fuchsia-600:oklch(.591 .293 322.896);--color-fuchsia-700:oklch(.518 .253 323.949);--color-fuchsia-800:oklch(.452 .211 324.591);--color-fuchsia-900:oklch(.401 .17 325.612);--color-fuchsia-950:oklch(.293 .136 325.661);--color-pink-50:oklch(.971 .014 343.198);--color-pink-100:oklch(.948 .028 342.258);--color-pink-200:oklch(.899 .061 343.231);--color-pink-300:oklch(.823 .12 346.018);--color-pink-400:oklch(.718 .202 349.761);--color-pink-500:oklch(.656 .241 354.308);--color-pink-600:oklch(.592 .249 .584);--color-pink-700:oklch(.525 .223 3.958);--color-pink-800:oklch(.459 .187 3.815);--color-pink-900:oklch(.408 .153 2.432);--color-pink-950:oklch(.284 .109 3.907);--color-rose-50:oklch(.969 .015 12.422);--color-rose-100:oklch(.941 .03 12.58);--color-rose-200:oklch(.892 .058 10.001);--color-rose-300:oklch(.81 .117 11.638);--color-rose-400:oklch(.712 .194 13.428);--color-rose-500:oklch(.645 .246 16.439);--color-rose-600:oklch(.586 .253 17.585);--color-rose-700:oklch(.514 .222 16.935);--color-rose-800:oklch(.455 .188 13.697);--color-rose-900:oklch(.41 .159 10.272);--color-rose-950:oklch(.271 .105 12.094);--color-slate-50:oklch(.984 .003 247.858);--color-slate-100:oklch(.968 .007 247.896);--color-slate-200:oklch(.929 .013 255.508);--color-slate-300:oklch(.869 .022 252.894);--color-slate-400:oklch(.704 .04 256.788);--color-slate-500:oklch(.554 .046 257.417);--color-slate-600:oklch(.446 .043 257.281);--color-slate-700:oklch(.372 .044 257.287);--color-slate-800:oklch(.279 .041 260.031);--color-slate-900:oklch(.208 .042 265.755);--color-slate-950:oklch(.129 .042 264.695);--color-gray-50:oklch(.985 .002 247.839);--color-gray-100:oklch(.967 .003 264.542);--color-gray-200:oklch(.928 .006 264.531);--color-gray-300:oklch(.872 .01 258.338);--color-gray-400:oklch(.707 .022 261.325);--color-gray-500:oklch(.551 .027 264.364);--color-gray-600:oklch(.446 .03 256.802);--color-gray-700:oklch(.373 .034 259.733);--color-gray-800:oklch(.278 .033 256.848);--color-gray-900:oklch(.21 .034 264.665);--color-gray-950:oklch(.13 .028 261.692);--color-zinc-50:oklch(.985 0 0);--color-zinc-100:oklch(.967 .001 286.375);--color-zinc-200:oklch(.92 .004 286.32);--color-zinc-300:oklch(.871 .006 286.286);--color-zinc-400:oklch(.705 .015 286.067);--color-zinc-500:oklch(.552 .016 285.938);--color-zinc-600:oklch(.442 .017 285.786);--color-zinc-700:oklch(.37 .013 285.805);--color-zinc-800:oklch(.274 .006 286.033);--color-zinc-900:oklch(.21 .006 285.885);--color-zinc-950:oklch(.141 .005 285.823);--color-neutral-50:oklch(.985 0 0);--color-neutral-100:oklch(.97 0 0);--color-neutral-200:oklch(.922 0 0);--color-neutral-300:oklch(.87 0 0);--color-neutral-400:oklch(.708 0 0);--color-neutral-500:oklch(.556 0 0);--color-neutral-600:oklch(.439 0 0);--color-neutral-700:oklch(.371 0 0);--color-neutral-800:oklch(.269 0 0);--color-neutral-900:oklch(.205 0 0);--color-neutral-950:oklch(.145 0 0);--color-stone-50:oklch(.985 .001 106.423);--color-stone-100:oklch(.97 .001 106.424);--color-stone-200:oklch(.923 .003 48.717);--color-stone-300:oklch(.869 .005 56.366);--color-stone-400:oklch(.709 .01 56.259);--color-stone-500:oklch(.553 .013 58.071);--color-stone-600:oklch(.444 .011 73.639);--color-stone-700:oklch(.374 .01 67.558);--color-stone-800:oklch(.268 .007 34.298);--color-stone-900:oklch(.216 .006 56.043);--color-stone-950:oklch(.147 .004 49.25);--color-black:#000;--color-white:#fff;--spacing:.25rem;--breakpoint-sm:40rem;--breakpoint-md:48rem;--breakpoint-lg:64rem;--breakpoint-xl:80rem;--breakpoint-2xl:96rem;--container-3xs:16rem;--container-2xs:18rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:1.33333;--text-sm:.875rem;--text-sm--line-height:1.42857;--text-base:1rem;--text-base--line-height:1.5;--text-lg:1.125rem;--text-lg--line-height:1.55556;--text-xl:1.25rem;--text-xl--line-height:1.4;--text-2xl:1.5rem;--text-2xl--line-height:1.33333;--text-3xl:1.875rem;--text-3xl--line-height:1.2;--text-4xl:2.25rem;--text-4xl--line-height:1.11111;--text-5xl:3rem;--text-5xl--line-height:1;--text-6xl:3.75rem;--text-6xl--line-height:1;--text-7xl:4.5rem;--text-7xl--line-height:1;--text-8xl:6rem;--text-8xl--line-height:1;--text-9xl:8rem;--text-9xl--line-height:1;--font-weight-thin:100;--font-weight-extralight:200;--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--font-weight-black:900;--tracking-tighter:-.05em;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--leading-loose:2;--radius-xs:.125rem;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--radius-3xl:1.5rem;--radius-4xl:2rem;--shadow-2xs:0 1px #0000000d;--shadow-xs:0 1px 2px 0 #0000000d;--shadow-sm:0 1px 3px 0 #0000001a,0 1px 2px -1px #0000001a;--shadow-md:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;--shadow-lg:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a;--shadow-xl:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a;--shadow-2xl:0 25px 50px -12px #00000040;--inset-shadow-2xs:inset 0 1px #0000000d;--inset-shadow-xs:inset 0 1px 1px #0000000d;--inset-shadow-sm:inset 0 2px 4px #0000000d;--drop-shadow-xs:0 1px 1px #0000000d;--drop-shadow-sm:0 1px 2px #00000026;--drop-shadow-md:0 3px 3px #0000001f;--drop-shadow-lg:0 4px 4px #00000026;--drop-shadow-xl:0 9px 7px #0000001a;--drop-shadow-2xl:0 25px 25px #00000026;--ease-in:cubic-bezier(.4,0,1,1);--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0,0,.2,1)infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--animate-bounce:bounce 1s infinite;--blur-xs:4px;--blur-sm:8px;--blur-md:12px;--blur-lg:16px;--blur-xl:24px;--blur-2xl:40px;--blur-3xl:64px;--perspective-dramatic:100px;--perspective-near:300px;--perspective-normal:500px;--perspective-midrange:800px;--perspective-distant:1200px;--aspect-video:16/9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-font-feature-settings:var(--font-sans--font-feature-settings);--default-font-variation-settings:var(--font-sans--font-variation-settings);--default-mono-font-family:var(--font-mono);--default-mono-font-feature-settings:var(--font-mono--font-feature-settings);--default-mono-font-variation-settings:var(--font-mono--font-variation-settings)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{border:0 solid;box-sizing:border-box;margin:0;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);line-height:1.5;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}::file-selector-button{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{color:color-mix(in oklab,currentColor 50%,transparent);opacity:1}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,::backdrop,:after,:before{border-color:var(--color-gray-200,currentColor)}::file-selector-button{border-color:var(--color-gray-200,currentColor)}}@layer components;@layer utilities{.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing)*0)}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.mt-0{margin-top:calc(var(--spacing)*0)}.mt-2{margin-top:calc(var(--spacing)*2)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-3{margin-right:calc(var(--spacing)*3)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-3{margin-left:calc(var(--spacing)*3)}.ml-4{margin-left:calc(var(--spacing)*4)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.table{display:table}.h-11{height:calc(var(--spacing)*11)}.h-auto{height:auto}.h-screen{height:100vh}.w-1\/2{width:50%}.w-1\/3{width:33.3333%}.w-full{width:100%}.flex-1{flex:1}.shrink{flex-shrink:1}.flex-grow,.grow{flex-grow:1}.transform{transform:var(--tw-rotate-x)var(--tw-rotate-y)var(--tw-rotate-z)var(--tw-skew-x)var(--tw-skew-y)}.cursor-pointer{cursor:pointer}.resize{resize:both}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.justify-around{justify-content:space-around}.justify-center{justify-content:center}.justify-evenly{justify-content:space-evenly}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-lg{border-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-b-4{border-bottom-style:var(--tw-border-style);border-bottom-width:4px}.border-gray-800{border-color:var(--color-gray-800)}.border-red-600{border-color:var(--color-red-600)}.border-transparent{border-color:#0000}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-800{background-color:var(--color-gray-800)}.bg-white{background-color:var(--color-white)}.bg-linear-to-b{--tw-gradient-position:to bottom in oklab,;background-image:linear-gradient(var(--tw-gradient-stops))}.from-red-200{--tw-gradient-from:var(--color-red-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position,)var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-red-100{--tw-gradient-to:var(--color-red-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position,)var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.p-6{padding:calc(var(--spacing)*6)}.px-1{padding-inline:calc(var(--spacing)*1)}.py-0{padding-block:calc(var(--spacing)*0)}.py-1{padding-block:calc(var(--spacing)*1)}.py-3{padding-block:calc(var(--spacing)*3)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.pb-0\.5{padding-bottom:calc(var(--spacing)*.5)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pl-1{padding-left:calc(var(--spacing)*1)}.text-center{text-align:center}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.text-blue-900{color:var(--color-blue-900)}.text-red-500{color:var(--color-red-500)}.text-red-900{color:var(--color-red-900)}.text-white{color:var(--color-white)}.italic{font-style:italic}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a)}.shadow,.shadow-xl{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.drop-shadow{--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a)drop-shadow(0 1px 1px #0000000f)}.drop-shadow,.invert{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.hover\:border-red-900:hover{border-color:var(--color-red-900)}.hover\:text-red-900:hover{color:var(--color-red-900)}}@media (width>=48rem){.md\:mt-0{margin-top:calc(var(--spacing)*0)}.md\:mt-2{margin-top:calc(var(--spacing)*2)}.md\:mt-3{margin-top:calc(var(--spacing)*3)}.md\:mr-3{margin-right:calc(var(--spacing)*3)}.md\:mb-2{margin-bottom:calc(var(--spacing)*2)}.md\:ml-0{margin-left:calc(var(--spacing)*0)}.md\:ml-4{margin-left:calc(var(--spacing)*4)}.md\:ml-auto{margin-left:auto}.md\:block{display:block}.md\:w-48{width:calc(var(--spacing)*48)}.md\:w-full{width:100%}.md\:flex-col{flex-direction:column}.md\:flex-row{flex-direction:row}.md\:justify-between{justify-content:space-between}.md\:justify-start{justify-content:flex-start}.md\:rounded-tl-2xl{border-top-left-radius:var(--radius-2xl)}.md\:rounded-bl-2xl{border-bottom-left-radius:var(--radius-2xl)}.md\:border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.md\:border-blue-600{border-color:var(--color-blue-600)}.md\:border-purple-500{border-color:var(--color-purple-500)}.md\:border-red-500{border-color:var(--color-red-500)}.md\:border-yellow-500{border-color:var(--color-yellow-500)}.md\:border-b-fuchsia-400{border-bottom-color:var(--color-fuchsia-400)}.md\:px-2{padding-inline:calc(var(--spacing)*2)}.md\:py-3{padding-block:calc(var(--spacing)*3)}.md\:pt-0{padding-top:calc(var(--spacing)*0)}.md\:pt-1{padding-top:calc(var(--spacing)*1)}.md\:pb-3{padding-bottom:calc(var(--spacing)*3)}.md\:pb-5{padding-bottom:calc(var(--spacing)*5)}.md\:pl-0{padding-left:calc(var(--spacing)*0)}.md\:text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}}}@keyframes spin{to{transform:rotate(1turn)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}@property --tw-rotate-x{syntax:"*";inherits:false;initial-value:rotateX(0)}@property --tw-rotate-y{syntax:"*";inherits:false;initial-value:rotateY(0)}@property --tw-rotate-z{syntax:"*";inherits:false;initial-value:rotateZ(0)}@property --tw-skew-x{syntax:"*";inherits:false;initial-value:skewX(0)}@property --tw-skew-y{syntax:"*";inherits:false;initial-value:skewY(0)}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false} +/*! tailwindcss v4.0.12 | MIT License | https://tailwindcss.com */@layer theme{:host,:root{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-100:oklch(.936 .032 17.717);--color-red-200:oklch(.885 .062 18.334);--color-red-500:oklch(.637 .237 25.331);--color-red-600:oklch(.577 .245 27.325);--color-red-900:oklch(.396 .141 25.723);--color-yellow-500:oklch(.795 .184 86.047);--color-blue-600:oklch(.546 .245 262.881);--color-blue-900:oklch(.379 .146 265.522);--color-purple-500:oklch(.627 .265 303.9);--color-fuchsia-400:oklch(.74 .238 322.16);--color-gray-100:oklch(.967 .003 264.542);--color-gray-200:oklch(.928 .006 264.531);--color-gray-800:oklch(.278 .033 256.848);--color-white:#fff;--spacing:.25rem;--text-2xl:1.5rem;--text-2xl--line-height:1.33333;--text-3xl:1.875rem;--text-3xl--line-height:1.2;--font-weight-bold:700;--tracking-normal:0em;--leading-normal:1.5;--radius-lg:.5rem;--radius-2xl:1rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-font-feature-settings:var(--font-sans--font-feature-settings);--default-font-variation-settings:var(--font-sans--font-variation-settings);--default-mono-font-family:var(--font-mono);--default-mono-font-feature-settings:var(--font-mono--font-feature-settings);--default-mono-font-variation-settings:var(--font-mono--font-variation-settings)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{border:0 solid;box-sizing:border-box;margin:0;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);line-height:1.5;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}::file-selector-button{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{color:color-mix(in oklab,currentColor 50%,transparent);opacity:1}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,::backdrop,:after,:before{border-color:var(--color-gray-200,currentColor)}::file-selector-button{border-color:var(--color-gray-200,currentColor)}}@layer components;@layer utilities{.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing)*0)}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.mt-0{margin-top:calc(var(--spacing)*0)}.mt-2{margin-top:calc(var(--spacing)*2)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-3{margin-right:calc(var(--spacing)*3)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-3{margin-left:calc(var(--spacing)*3)}.ml-4{margin-left:calc(var(--spacing)*4)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.table{display:table}.h-11{height:calc(var(--spacing)*11)}.h-auto{height:auto}.h-screen{height:100vh}.w-1\/2{width:50%}.w-1\/3{width:33.3333%}.w-full{width:100%}.flex-1{flex:1}.shrink{flex-shrink:1}.flex-grow,.grow{flex-grow:1}.transform{transform:var(--tw-rotate-x)var(--tw-rotate-y)var(--tw-rotate-z)var(--tw-skew-x)var(--tw-skew-y)}.cursor-pointer{cursor:pointer}.resize{resize:both}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.justify-around{justify-content:space-around}.justify-center{justify-content:center}.justify-evenly{justify-content:space-evenly}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-lg{border-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-b-4{border-bottom-style:var(--tw-border-style);border-bottom-width:4px}.border-gray-800{border-color:var(--color-gray-800)}.border-red-600{border-color:var(--color-red-600)}.border-transparent{border-color:#0000}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-800{background-color:var(--color-gray-800)}.bg-white{background-color:var(--color-white)}.bg-linear-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-red-200{--tw-gradient-from:var(--color-red-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-red-100{--tw-gradient-to:var(--color-red-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.p-6{padding:calc(var(--spacing)*6)}.px-1{padding-inline:calc(var(--spacing)*1)}.py-0{padding-block:calc(var(--spacing)*0)}.py-1{padding-block:calc(var(--spacing)*1)}.py-3{padding-block:calc(var(--spacing)*3)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.pb-0\.5{padding-bottom:calc(var(--spacing)*.5)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pl-1{padding-left:calc(var(--spacing)*1)}.text-center{text-align:center}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.text-blue-900{color:var(--color-blue-900)}.text-red-500{color:var(--color-red-500)}.text-red-900{color:var(--color-red-900)}.text-white{color:var(--color-white)}.italic{font-style:italic}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a)}.shadow,.shadow-xl{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.invert{--tw-invert:invert(100%)}.filter,.invert{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.hover\:border-red-900:hover{border-color:var(--color-red-900)}.hover\:text-red-900:hover{color:var(--color-red-900)}}@media (width>=48rem){.md\:mt-0{margin-top:calc(var(--spacing)*0)}.md\:mt-2{margin-top:calc(var(--spacing)*2)}.md\:mt-3{margin-top:calc(var(--spacing)*3)}.md\:mr-3{margin-right:calc(var(--spacing)*3)}.md\:mb-2{margin-bottom:calc(var(--spacing)*2)}.md\:ml-0{margin-left:calc(var(--spacing)*0)}.md\:ml-4{margin-left:calc(var(--spacing)*4)}.md\:ml-auto{margin-left:auto}.md\:block{display:block}.md\:w-48{width:calc(var(--spacing)*48)}.md\:w-full{width:100%}.md\:flex-col{flex-direction:column}.md\:flex-row{flex-direction:row}.md\:justify-between{justify-content:space-between}.md\:justify-start{justify-content:flex-start}.md\:rounded-tl-2xl{border-top-left-radius:var(--radius-2xl)}.md\:rounded-bl-2xl{border-bottom-left-radius:var(--radius-2xl)}.md\:border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.md\:border-blue-600{border-color:var(--color-blue-600)}.md\:border-purple-500{border-color:var(--color-purple-500)}.md\:border-red-500{border-color:var(--color-red-500)}.md\:border-yellow-500{border-color:var(--color-yellow-500)}.md\:border-b-fuchsia-400{border-bottom-color:var(--color-fuchsia-400)}.md\:px-2{padding-inline:calc(var(--spacing)*2)}.md\:py-3{padding-block:calc(var(--spacing)*3)}.md\:pt-0{padding-top:calc(var(--spacing)*0)}.md\:pt-1{padding-top:calc(var(--spacing)*1)}.md\:pb-3{padding-bottom:calc(var(--spacing)*3)}.md\:pb-5{padding-bottom:calc(var(--spacing)*5)}.md\:pl-0{padding-left:calc(var(--spacing)*0)}.md\:text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}}}@property --tw-rotate-x{syntax:"*";inherits:false;initial-value:rotateX(0)}@property --tw-rotate-y{syntax:"*";inherits:false;initial-value:rotateY(0)}@property --tw-rotate-z{syntax:"*";inherits:false;initial-value:rotateZ(0)}@property --tw-skew-x{syntax:"*";inherits:false;initial-value:skewX(0)}@property --tw-skew-y{syntax:"*";inherits:false;initial-value:skewY(0)}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false} diff --git a/demo/load-and-navigation/assets/index.js b/demo/load-and-navigation/assets/index.js index e27c5893..77b2bdfd 100644 --- a/demo/load-and-navigation/assets/index.js +++ b/demo/load-and-navigation/assets/index.js @@ -1 +1 @@ -import{m,d as f,s as p,w as g,h as v,g as y,l as r,u as s,f as c,Z as h,z as S,a as b,b as E}from"./main.js";import"./mxgraph.js";const L="0.45.1",O=()=>({lib:L,dependencies:new Map([["mxGraph",m.VERSION]])});let o=!0,t={};function C(){const e=document.querySelector("#fitOnLoad");e.addEventListener("change",n=>{o=n.target.checked,r("Fit on load updated!",o),s(o?t:{})}),e.checked=o}function i(e){r("Updating fit config",e),t.margin=e.margin??t.margin,e.type&&(t.type=e.type),r("Fit config updated!",t),o&&s(t)}function T(){const e=document.querySelector("#fitType-selected");e.addEventListener("change",n=>{i({type:n.target.value}),c(t)}),t.type?e.value=t.type:i({type:e.value})}function q(){const e=document.querySelector("#fit-margin");e.addEventListener("change",n=>{i({margin:Number(n.target.value)}),c(t)}),t.margin?e.value=String(t.margin):i({margin:Number(e.value)})}function F(){for(const e of Object.values(h))document.querySelector(`#zoom-${e}`).addEventListener("click",()=>S(e));document.querySelector("#zoom-reset").addEventListener("click",()=>c(t))}function w(){const e=document.querySelector("#theme-selected");e.addEventListener("change",a=>{b(a.target.value)});const n=E();n&&(e.value=n)}function z(){const e=O(),n=`bpmn-visualization@${e.lib}`,a=[...e.dependencies].map(([d,l])=>`${d}@${l}`).join("/"),u=document.querySelector("#footer-content");u.textContent=`${n} with ${a}`}function $(){document.addEventListener("wheel",e=>{e.ctrlKey&&e.preventDefault()},{passive:!1,capture:!0})}function k(){$(),p({globalOptions:{container:"bpmn-container",navigation:{enabled:!0}},statusKoNotifier:g}),document.querySelector("#bpmn-file").addEventListener("change",v,!1),t=y().fit,T(),q(),C(),F(),w(),z()}f(k); +import{m,d as f,s as p,w as g,h as v,g as y,f as c,l as r,u as s,Z as h,z as S,a as b,b as E}from"./main.js";import"./mxgraph.js";const L="0.46.0",O=()=>({lib:L,dependencies:new Map([["mxGraph",m.VERSION]])});let o=!0,t={};function C(){const e=document.querySelector("#fitOnLoad");e.addEventListener("change",n=>{o=n.target.checked,r("Fit on load updated!",o),s(o?t:{})}),e.checked=o}function i(e){r("Updating fit config",e),t.margin=e.margin??t.margin,e.type&&(t.type=e.type),r("Fit config updated!",t),o&&s(t)}function T(){const e=document.querySelector("#fitType-selected");e.addEventListener("change",n=>{i({type:n.target.value}),c(t)}),t.type?e.value=t.type:i({type:e.value})}function q(){const e=document.querySelector("#fit-margin");e.addEventListener("change",n=>{i({margin:Number(n.target.value)}),c(t)}),t.margin?e.value=String(t.margin):i({margin:Number(e.value)})}function F(){for(const e of Object.values(h))document.querySelector(`#zoom-${e}`).addEventListener("click",()=>S(e));document.querySelector("#zoom-reset").addEventListener("click",()=>c(t))}function w(){const e=document.querySelector("#theme-selected");e.addEventListener("change",a=>{b(a.target.value)});const n=E();n&&(e.value=n)}function z(){const e=O(),n=`bpmn-visualization@${e.lib}`,a=[...e.dependencies].map(([d,l])=>`${d}@${l}`).join("/"),u=document.querySelector("#footer-content");u.textContent=`${n} with ${a}`}function $(){document.addEventListener("wheel",e=>{e.ctrlKey&&e.preventDefault()},{passive:!1,capture:!0})}function k(){$(),p({globalOptions:{container:"bpmn-container",navigation:{enabled:!0}},statusKoNotifier:g}),document.querySelector("#bpmn-file").addEventListener("change",v,!1),t=y().fit,T(),q(),C(),F(),w(),z()}f(k); diff --git a/demo/load-and-navigation/assets/main.js b/demo/load-and-navigation/assets/main.js index 966e9ed3..2d6f2d10 100644 --- a/demo/load-and-navigation/assets/main.js +++ b/demo/load-and-navigation/assets/main.js @@ -1,11 +1,8 @@ -var cn=Object.defineProperty;var un=(n,t,e)=>t in n?cn(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var y=(n,t,e)=>un(n,typeof t!="symbol"?t+"":t,e);import{r as dn,g as hn}from"./mxgraph.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function e(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=e(i);fetch(i.href,o)}})();var ue=(n=>(n.None="None",n.HorizontalVertical="HorizontalVertical",n.Horizontal="Horizontal",n.Vertical="Vertical",n.Center="Center",n))(ue||{}),fn=(n=>(n.In="in",n.Out="out",n))(fn||{});function gn(n){return n instanceof HTMLElement?n:document.querySelector(`#${n}`)}var C=(n=>(n.LANE="lane",n.POOL="pool",n.CALL_ACTIVITY="callActivity",n.SUB_PROCESS="subProcess",n.TASK="task",n.TASK_USER="userTask",n.TASK_SERVICE="serviceTask",n.TASK_RECEIVE="receiveTask",n.TASK_SEND="sendTask",n.TASK_MANUAL="manualTask",n.TASK_SCRIPT="scriptTask",n.TASK_BUSINESS_RULE="businessRuleTask",n.GLOBAL_TASK="globalTask",n.GLOBAL_TASK_USER="globalUserTask",n.GLOBAL_TASK_MANUAL="globalManualTask",n.GLOBAL_TASK_SCRIPT="globalScriptTask",n.GLOBAL_TASK_BUSINESS_RULE="globalBusinessRuleTask",n.GROUP="group",n.TEXT_ANNOTATION="textAnnotation",n.GATEWAY_PARALLEL="parallelGateway",n.GATEWAY_EXCLUSIVE="exclusiveGateway",n.GATEWAY_INCLUSIVE="inclusiveGateway",n.GATEWAY_EVENT_BASED="eventBasedGateway",n.GATEWAY_COMPLEX="complexGateway",n.EVENT_START="startEvent",n.EVENT_END="endEvent",n.EVENT_INTERMEDIATE_CATCH="intermediateCatchEvent",n.EVENT_INTERMEDIATE_THROW="intermediateThrowEvent",n.EVENT_BOUNDARY="boundaryEvent",n))(C||{}),de=(n=>(n.CALLING_PROCESS="process",n.CALLING_GLOBAL_TASK="global task",n))(de||{}),he=(n=>(n.Exclusive="Exclusive",n.None="None",n.Parallel="Parallel",n))(he||{}),H=(n=>(n.NONE="none",n.TERMINATE="terminate",n.CANCEL="cancel",n.COMPENSATION="compensate",n.CONDITIONAL="conditional",n.ERROR="error",n.ESCALATION="escalation",n.LINK="link",n.MESSAGE="message",n.SIGNAL="signal",n.TIMER="timer",n))(H||{}),W=(n=>(n.ADHOC="adhoc",n.COMPENSATION="compensation",n.EXPAND="expand",n.LOOP="loop",n.MULTI_INSTANCE_PARALLEL="multi-parallel",n.MULTI_INSTANCE_SEQUENTIAL="multi-sequential",n))(W||{}),ee=(n=>(n.AD_HOC="adhoc",n.EMBEDDED="embedded",n.EVENT="event",n.TRANSACTION="transaction",n))(ee||{});function Tn(n,t){return n===""?t?{}:void 0:n}function P(n,t=!1){return n==null?[]:(Array.isArray(n)?n:[n]).map(e=>Tn(e,t)).filter(Boolean)}function pn(n,t,e){const s=[];e!=null&&e.startingWith?s.push(`^(${e.startingWith}).*`):e!=null&&e.notStartingWith&&s.push(`^(?!(${e.notStartingWith})).*`),s.push(`${t}$`);const i=s.join("");return n.filter(o=>e!=null&&e.ignoreCase?new RegExp(i,"i").test(o):new RegExp(i).test(o))}class F{static isEvent(t){return pe(ut,t)}static eventKinds(){return[...ut]}static isBoundaryEvent(t){return C.EVENT_BOUNDARY===t}static isStartEvent(t){return C.EVENT_START===t}static isCatchEvent(t){return C.EVENT_INTERMEDIATE_CATCH===t||C.EVENT_BOUNDARY===t||C.EVENT_START===t}static isIntermediateCatchEvent(t){return C.EVENT_INTERMEDIATE_CATCH===t}static isIntermediateThrowEvent(t){return C.EVENT_INTERMEDIATE_THROW===t}static isCallActivity(t){return C.CALL_ACTIVITY===t}static isSubProcess(t){return C.SUB_PROCESS===t}static canHaveNoneEvent(t){return C.EVENT_INTERMEDIATE_THROW===t||C.EVENT_END===t||C.EVENT_START===t}static isActivity(t){return pe(We,t)}static activityKinds(){return[...We]}static isWithDefaultSequenceFlow(t){return En.has(t)}static isTask(t){return pe(Ue,t)}static taskKinds(){return[...Ue]}static gatewayKinds(){return[...dt]}static isGateway(t){return pe(dt,t)}static flowNodeKinds(){return Object.values(C).filter(t=>!F.isPoolOrLane(t))}static isPoolOrLane(t){return t==C.POOL||t==C.LANE}}function je(n,t){return pn(Object.values(C),n,t)}function pe(n,t){return Object.values(n).map(e=>e).includes(t)}const ut=je("Event"),dt=je("Gateway"),Ue=je("Task",{ignoreCase:!0,notStartingWith:"global"}),We=[...Ue,C.CALL_ACTIVITY,C.SUB_PROCESS],En=new Set([...We,C.GATEWAY_EXCLUSIVE,C.GATEWAY_INCLUSIVE,C.GATEWAY_COMPLEX]),kt=Object.values(H).filter(n=>n!=H.NONE);var re=(n=>(n.NONE="None",n.ONE="One",n.BOTH="Both",n))(re||{}),Z=(n=>(n.SEQUENCE_FLOW="sequenceFlow",n.MESSAGE_FLOW="messageFlow",n.ASSOCIATION_FLOW="association",n))(Z||{}),fe=(n=>(n.NONE="none",n.INITIATING="initiating",n.NON_INITIATING="non_initiating",n))(fe||{}),Q=(n=>(n.NORMAL="normal",n.DEFAULT="default",n.CONDITIONAL_FROM_ACTIVITY="conditional_from_activity",n.CONDITIONAL_FROM_GATEWAY="conditional_from_gateway",n))(Q||{});class Ne{constructor(t,e,s,i,o){this.id=t,this.name=e,this.kind=s,this.sourceReferenceId=i,this.targetReferenceId=o}}class Bt extends Ne{constructor(t,e,s,i,o=Q.NORMAL){super(t,e,Z.SEQUENCE_FLOW,s,i),this.sequenceFlowKind=o}}class Mt extends Ne{constructor(t,e,s,i){super(t,e,Z.MESSAGE_FLOW,s,i)}}class Vt extends Ne{constructor(t,e,s,i,o=re.NONE){super(t,e,Z.ASSOCIATION_FLOW,s,i),this.associationDirectionKind=o}}var Sn=dn();const mn=hn(Sn),D=An(),Cn=D.mxCellRenderer,In=D.mxClient,u=D.mxConstants,te=D.mxEvent,ht=D.mxPerimeter,$=D.mxPoint,He=D.mxRectangle,Je=D.mxRectangleShape,Qe=D.mxSvgCanvas2D,Y=D.mxUtils;function An(){return window.mxForceIncludes=!1,window.mxLoadResources=!1,window.mxLoadStylesheets=!1,window.mxResourceExtension=".txt",mn({})}class Nn{constructor(t){this.graph=t}computeRelativeCoordinates(t,e){const s=this.getTranslateForRoot(t),i=e.x+s.x,o=e.y+s.y;return new $(i,o)}getTranslateForRoot(t){const e=this.graph.getModel(),s=new $(0,0);for(;t!=null;){const i=e.getGeometry(t);i!=null&&(s.x-=i.x,s.y-=i.y),t=e.getParent(t)}return s}computeEdgeCenter(t){const e=t.geometry.points,s=e[0],i=e.at(-1),o=i.x-s.x,a=i.y-s.y;return new $(s.x+o/2,s.y+a/2)}}class me{constructor(t,e,s,i,o){y(this,"extensions",{});this.id=t,this.bpmnElement=e,this.bounds=s,this.label=i,this.isHorizontal=o}}class J{constructor(t,e,s,i,o=!1){y(this,"incomingIds",[]);y(this,"outgoingIds",[]);this.id=t,this.name=e,this.kind=s,this.parentId=i,this.instantiate=o}}class Oe extends J{constructor(t,e,s,i,o,a=[]){super(t,e,s,i,o),this.markers=a}}class oe extends Oe{constructor(t,e,s,i,o,a){super(t,e,C.CALL_ACTIVITY,i,void 0,o),this.callActivityKind=s,this.globalTaskKind=a}}class ge extends Oe{constructor(t,e,s,i,o){s==ee.AD_HOC&&!o.includes(W.ADHOC)&&o.push(W.ADHOC),super(t,e,C.SUB_PROCESS,i,void 0,o),this.subProcessKind=s}}class se extends J{constructor(t,e,s,i,o){super(t,e,s,o),this.eventDefinitionKind=i}}class Ke extends se{constructor(e,s,i,o){super(e,s,C.EVENT_INTERMEDIATE_CATCH,i,o);y(this,"sourceIds",[])}}class ze extends se{constructor(e,s,i,o){super(e,s,C.EVENT_INTERMEDIATE_THROW,i,o);y(this,"targetId")}}class Yt extends se{constructor(t,e,s,i,o){super(t,e,C.EVENT_START,s,i),this.isInterrupting=o}}class Gt extends se{constructor(t,e,s,i,o=!0){super(t,e,C.EVENT_BOUNDARY,s,i),this.isInterrupting=o}}class Dt extends J{constructor(t,e,s,i,o=he.None){super(t,e,C.GATEWAY_EVENT_BASED,s,i),this.gatewayKind=o}}function Ce(n,t,e,s){return Math.min(Math.max(n??s,t),e)}function On(n){return Math.max(n??0,0)}function Ln(n){const t=n??{};return t.debounceDelay=Ce(t.debounceDelay,0,100,50),t.throttleDelay=Ce(t.throttleDelay,0,100,50),t}function Le(n){return n=="default"?void 0:Ce(n,0,100,100)}function vn(n){return n=="default"?void 0:Ce(n,1,50,1)}const x={EDGE:"bpmn.edge",EDGE_START_FILL_COLOR:"bpmn.edge.startFillColor",EDGE_END_FILL_COLOR:"bpmn.edge.endFillColor",EVENT_BASED_GATEWAY_KIND:"bpmn.gatewayKind",EVENT_DEFINITION_KIND:"bpmn.eventDefinitionKind",GLOBAL_TASK_KIND:"bpmn.globalTaskKind",SUB_PROCESS_KIND:"bpmn.subProcessKind",IS_INITIATING:"bpmn.isInitiating",IS_INSTANTIATING:"bpmn.isInstantiating",IS_INTERRUPTING:"bpmn.isInterrupting",EXTRA_CSS_CLASSES:"bpmn.extra.css.classes",MARKERS:"bpmn.markers",MESSAGE_FLOW_ICON:"bpmn.messageFlowIcon"},Ut={ARROW_DASH:"bpmn.dash"},R={STROKE_WIDTH_THIN:2,STROKE_WIDTH_THICK:5,SHAPE_ACTIVITY_BOTTOM_MARGIN:7,SHAPE_ACTIVITY_TOP_MARGIN:7,SHAPE_ACTIVITY_LEFT_MARGIN:7,SHAPE_ACTIVITY_MARKER_ICON_MARGIN:5,SHAPE_ACTIVITY_MARKER_ICON_SIZE:20,POOL_LABEL_SIZE:30,POOL_LABEL_FILL_COLOR:"none",LANE_LABEL_SIZE:30,LANE_LABEL_FILL_COLOR:"none",SUB_PROCESS_TRANSACTION_INNER_RECT_OFFSET:4,SUB_PROCESS_TRANSACTION_INNER_RECT_ARC_SIZE:6,TEXT_ANNOTATION_BORDER_LENGTH:10,TEXT_ANNOTATION_FILL_COLOR:"none",GROUP_FILL_COLOR:"none",DEFAULT_FILL_COLOR:"White",DEFAULT_STROKE_COLOR:"Black",DEFAULT_FONT_FAMILY:"Arial, Helvetica, sans-serif",DEFAULT_FONT_SIZE:11,DEFAULT_FONT_COLOR:"Black",DEFAULT_MARGIN:0,SHAPE_ARC_SIZE:20,DEFAULT_OVERLAY_FILL_COLOR:"White",DEFAULT_OVERLAY_FILL_OPACITY:100,DEFAULT_OVERLAY_STROKE_COLOR:"Black",DEFAULT_OVERLAY_STROKE_WIDTH:1,DEFAULT_OVERLAY_FONT_SIZE:11,DEFAULT_OVERLAY_FONT_COLOR:"Black",SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR:"White",MESSAGE_FLOW_MARKER_START_FILL_COLOR:"White",MESSAGE_FLOW_MARKER_END_FILL_COLOR:"White"},Wt=n=>Y.getValue(n,x.IS_INSTANTIATING,"false")=="true",Ie=n=>n=="default"?void 0:n,_n=(n,t)=>(t&&(n=K(n,u.STYLE_STROKECOLOR,t.color,Ie),n=K(n,u.STYLE_STROKE_OPACITY,t.opacity,Le),n=K(n,u.STYLE_STROKEWIDTH,t.width,vn)),n),K=(n,t,e,s=i=>i)=>e==null?n:Y.setStyle(n,t,s(e)),Ee=(n,t,e,s)=>s==null?n:Y.setStyleFlag(n,t,e,s),yn=(n,t)=>(t&&(n=K(n,u.STYLE_FONTCOLOR,t.color,Ie),n=K(n,u.STYLE_FONTSIZE,t.size),n=K(n,u.STYLE_FONTFAMILY,t.family),n=Ee(n,u.STYLE_FONTSTYLE,u.FONT_BOLD,t.isBold),n=Ee(n,u.STYLE_FONTSTYLE,u.FONT_ITALIC,t.isItalic),n=Ee(n,u.STYLE_FONTSTYLE,u.FONT_UNDERLINE,t.isUnderline),n=Ee(n,u.STYLE_FONTSTYLE,u.FONT_STRIKETHROUGH,t.isStrikeThrough),n=K(n,u.STYLE_TEXT_OPACITY,t.opacity,Le)),n),wn=(n,t,e)=>(n==null?void 0:n.split(";").map(s=>s.split("=")).filter(([s])=>s===t).map(([,s])=>s)[0])??e,Rn=n=>{switch(n){case"right-to-left":return u.DIRECTION_WEST;case"bottom-to-top":return u.DIRECTION_NORTH;case"top-to-bottom":return u.DIRECTION_SOUTH;default:return u.DIRECTION_EAST}},bn=(n,t)=>{const e=t.color;if(e){const s=Pn(e),i=s?e.startColor:e;n=K(n,u.STYLE_FILLCOLOR,i,Ie),s?(n=Y.setStyle(n,u.STYLE_GRADIENTCOLOR,e.endColor),n=Y.setStyle(n,u.STYLE_GRADIENT_DIRECTION,Rn(e.direction))):e==="default"&&(n=Y.setStyle(n,u.STYLE_GRADIENTCOLOR,void 0),n=Y.setStyle(n,u.STYLE_GRADIENT_DIRECTION,void 0)),(n.includes(C.POOL)||n.includes(C.LANE))&&(n=K(n,u.STYLE_SWIMLANE_FILLCOLOR,i,Ie))}return n=K(n,u.STYLE_FILL_OPACITY,t.opacity,Le),n},Fn=n=>n&&typeof n=="object"&&"fill"in n,Pn=n=>n&&typeof n=="object";class xn{constructor(t){y(this,"ignoreBpmnColors");this.ignoreBpmnColors=(t==null?void 0:t.ignoreBpmnColors)??!0}computeStyle(t,e){const s=[t.bpmnElement.kind];let i;t instanceof me?i=this.computeShapeStyleValues(t):(s.push(...Mn(t)),i=this.computeEdgeStyleValues(t));const o=this.computeFontStyleValues(t),a=Vn(t,e);return s.push(...ft([...i,...o,...a])),s.join(";")}computeShapeStyleValues(t){const e=new Map,s=t.bpmnElement;if(s instanceof se?kn(s,e):s instanceof Oe?Bn(s,e):F.isPoolOrLane(s.kind)?e.set(u.STYLE_HORIZONTAL,t.isHorizontal?"0":"1"):s instanceof Dt&&(e.set(x.IS_INSTANTIATING,String(s.instantiate)),e.set(x.EVENT_BASED_GATEWAY_KIND,String(s.gatewayKind))),!this.ignoreBpmnColors){const i=t.extensions,o=i.fillColor;o&&(e.set(u.STYLE_FILLCOLOR,o),F.isPoolOrLane(s.kind)&&e.set(u.STYLE_SWIMLANE_FILLCOLOR,o)),i.strokeColor&&e.set(u.STYLE_STROKECOLOR,i.strokeColor)}return e}computeEdgeStyleValues(t){const e=new Map;if(!this.ignoreBpmnColors){const s=t.extensions;s.strokeColor&&e.set(u.STYLE_STROKECOLOR,s.strokeColor)}return e}computeFontStyleValues(t){var i,o;const e=new Map,s=(i=t.label)==null?void 0:i.font;if(s&&(e.set(u.STYLE_FONTFAMILY,s.name),e.set(u.STYLE_FONTSIZE,s.size),e.set(u.STYLE_FONTSTYLE,Yn(s))),!this.ignoreBpmnColors){const a=(o=t.label)==null?void 0:o.extensions;a!=null&&a.color&&e.set(u.STYLE_FONTCOLOR,a.color)}return e}computeMessageFlowIconStyle(t){const e=[];return e.push(["shape",x.MESSAGE_FLOW_ICON],[x.IS_INITIATING,String(t.messageVisibleKind===fe.INITIATING)]),this.ignoreBpmnColors||t.extensions.strokeColor&&e.push([u.STYLE_STROKECOLOR,t.extensions.strokeColor]),ft(e).join(";")}}function kn(n,t){t.set(x.EVENT_DEFINITION_KIND,n.eventDefinitionKind),(n instanceof Gt||n instanceof Yt&&n.isInterrupting!==void 0)&&t.set(x.IS_INTERRUPTING,String(n.isInterrupting))}function Bn(n,t){n instanceof ge?t.set(x.SUB_PROCESS_KIND,n.subProcessKind):n.kind===C.TASK_RECEIVE?t.set(x.IS_INSTANTIATING,String(n.instantiate)):n instanceof oe&&t.set(x.GLOBAL_TASK_KIND,n.globalTaskKind);const e=n.markers;e.length>0&&t.set(x.MARKERS,e.join(","))}function Mn(n){const t=[],e=n.bpmnElement;return e instanceof Bt&&t.push(e.sequenceFlowKind),e instanceof Vt&&t.push(e.associationDirectionKind),t}function Vn(n,t){const e=new Map,s=n.bpmnElement;return t?(e.set(u.STYLE_VERTICAL_ALIGN,u.ALIGN_TOP),n.bpmnElement.kind!=C.TEXT_ANNOTATION&&e.set(u.STYLE_ALIGN,u.ALIGN_CENTER),n instanceof me&&(e.set(u.STYLE_LABEL_WIDTH,t.width+1),e.set(u.STYLE_LABEL_POSITION,"ignore"),e.set(u.STYLE_VERTICAL_LABEL_POSITION,u.ALIGN_MIDDLE))):n instanceof me&&(s instanceof ge||s instanceof oe&&s.callActivityKind===de.CALLING_PROCESS)&&!s.markers.includes(W.EXPAND)&&e.set(u.STYLE_VERTICAL_ALIGN,u.ALIGN_TOP),e}function Yn(n){let t=0;return n.isBold&&(t+=u.FONT_BOLD),n.isItalic&&(t+=u.FONT_ITALIC),n.isStrikeThrough&&(t+=u.FONT_STRIKETHROUGH),n.isUnderline&&(t+=u.FONT_UNDERLINE),t}function ft(n){return n.filter(([,t])=>t&&t!="undefined").map(([t,e])=>`${t}=${e}`)}class Gn{constructor(t,e,s){this.graph=t,this.coordinatesTranslator=e,this.styleComputer=s}render(t,e){this.insertShapesAndEdges(t),this.graph.customFit(e)}insertShapesAndEdges({pools:t,lanes:e,subprocesses:s,otherFlowNodes:i,boundaryEvents:o,edges:a}){this.graph.batchUpdate(()=>{this.graph.getModel().clear(),this.insertShapes(t),this.insertShapes(e),this.insertShapes(s),this.insertShapes(i),this.insertShapes(o),this.insertEdges(a)})}insertShapes(t){for(const e of t)this.insertShape(e)}getParent(t){return this.getCell(t.parentId)??this.graph.getDefaultParent()}insertShape(t){var r;const e=t.bpmnElement,s=this.getParent(e),i=t.bounds;let o=(r=t.label)==null?void 0:r.bounds;o=F.isPoolOrLane(e.kind)?void 0:o;const a=this.styleComputer.computeStyle(t,o);this.insertVertex(s,e.id,e.name,i,o,a)}insertEdges(t){var e;for(const s of t){const i=s.bpmnElement,o=this.graph.getDefaultParent(),a=this.getCell(i.sourceReferenceId),r=this.getCell(i.targetReferenceId),l=(e=s.label)==null?void 0:e.bounds,c=this.styleComputer.computeStyle(s,l),f=this.graph.insertEdge(o,i.id,i.name,a,r,c);if(this.insertWaypoints(s.waypoints,f),l){f.geometry.width=l.width,f.geometry.height=l.height;const T=this.coordinatesTranslator.computeEdgeCenter(f);f.geometry.relative=!1;const p=this.coordinatesTranslator.computeRelativeCoordinates(f.parent,new $(l.x,l.y)),S=p.x+l.width/2-T.x,O=p.y-T.y;f.geometry.offset=new $(S,O)}this.insertMessageFlowIconIfNeeded(s,f)}}insertMessageFlowIconIfNeeded(t,e){if(t.bpmnElement instanceof Mt&&t.messageVisibleKind!==fe.NONE){const s=this.graph.insertVertex(e,et(e.id),void 0,0,0,20,14,this.styleComputer.computeMessageFlowIconStyle(t));s.geometry.relative=!0,s.geometry.offset=new $(-10,-7)}}insertWaypoints(t,e){t&&(e.geometry.points=t.map(s=>this.coordinatesTranslator.computeRelativeCoordinates(e.parent,new $(s.x,s.y))))}getCell(t){return this.graph.getModel().getCell(t)}insertVertex(t,e,s,i,o,a){const r=this.coordinatesTranslator.computeRelativeCoordinates(t,new $(i.x,i.y)),l=this.graph.insertVertex(t,e,s,r.x,r.y,i.width,i.height,a);if(o){const c=o.x-i.x,f=o.y-i.y;l.geometry.offset=new $(c,f)}return l}}function Dn(n,t){return new Gn(n,new Nn(n),new xn(t))}function et(n){return`messageFlowIcon_of_${n}`}function Ht(n,t,{signal:e,edges:s}={}){let i,o=null;const a=s!=null&&s.includes("leading"),r=s==null||s.includes("trailing"),l=()=>{o!==null&&(n.apply(i,o),i=void 0,o=null)},c=()=>{r&&l(),S()};let f=null;const T=()=>{f!=null&&clearTimeout(f),f=setTimeout(()=>{f=null,c()},t)},p=()=>{f!==null&&(clearTimeout(f),f=null)},S=()=>{p(),i=void 0,o=null},O=()=>{p(),l()},L=function(...M){if(e!=null&&e.aborted)return;i=this,o=M;const d=f==null;T(),a&&d&&l()};return L.schedule=T,L.cancel=S,L.flush=O,e==null||e.addEventListener("abort",S,{once:!0}),L}function Un(n,t,{signal:e,edges:s=["leading","trailing"]}={}){let i=null;const o=Ht(n,t,{signal:e,edges:s}),a=function(...r){i==null?i=Date.now():Date.now()-i>=t&&(i=Date.now(),o.cancel(),o(...r)),o(...r)};return a.cancel=o.cancel,a.flush=o.flush,a}class Kt extends D.mxCellOverlay{constructor(e,s){super(null,"",s.position.horizontalAlign,s.position.verticalAlign,null,"default");y(this,"style");this.label=e,this.style=s.style}getBounds(e){const s=e.view.graph.getModel().isEdge(e.cell),i=e.view.scale;let o;const a=0,r=0;return s?o=this.computeEdgeBounds(e):(o=new $,this.align==u.ALIGN_LEFT?o.x=e.x:this.align==u.ALIGN_CENTER?o.x=e.x+e.width/2:o.x=e.x+e.width,this.verticalAlign==u.ALIGN_TOP?o.y=e.y:this.verticalAlign==u.ALIGN_MIDDLE?o.y=e.y+e.height/2:o.y=e.y+e.height),new He(Math.round(o.x-(a*this.defaultOverlap-this.offset.x)*i),Math.round(o.y-(r*this.defaultOverlap-this.offset.y)*i),a*i,r*i)}computeEdgeBounds(e){const s=e.absolutePoints;if(this.align==u.ALIGN_LEFT)return s[0];if(this.align==u.ALIGN_CENTER){if(s.length%2==1)return s[Math.floor(s.length/2)];{const i=s.length/2,o=s[i-1],a=s[i];return new $(o.x+(a.x-o.x)/2,o.y+(a.y-o.y)/2)}}else return s.at(-1)}}class gt extends D.mxText{constructor(t,e,s){super(t,e,void 0,void 0,s.font.color,void 0,s.font.size,void 0,void 0,void 0,void 0,void 0,void 0,void 0,s.fill.color,s.stroke.color),this.fillOpacity=s.fill.opacity,this.strokewidth=s.stroke.width}}function Wn(n){return Object.values(Z).map(t=>t).includes(n)}function Hn(n,t){return Kn(n.style,t)}function Kn(n,t){const e=[],s=n.split(";"),o=s[0].replace(/shape=bpmn./g,""),a=new Map;a.set("bpmn-type-activity",F.isActivity(o)),a.set("bpmn-type-container",F.isPoolOrLane(o)),a.set("bpmn-type-event",F.isEvent(o)),a.set("bpmn-type-flow",Wn(o)),a.set("bpmn-type-gateway",F.isGateway(o)),a.set("bpmn-type-task",F.isTask(o));for(const[r]of[...a].filter(([,l])=>l))e.push(r);e.push(Xe(o));for(const[r,l]of s.map(c=>{const f=c.split("=");return[f[0],f[1]]}))switch(r){case x.EVENT_DEFINITION_KIND:{e.push(`bpmn-event-def-${l}`);break}case x.EVENT_BASED_GATEWAY_KIND:{e.push(`bpmn-gateway-kind-${l.toLowerCase()}`);break}case x.IS_INITIATING:{e.push(l=="true"?"bpmn-icon-initiating":"bpmn-icon-non-initiating");break}case x.SUB_PROCESS_KIND:{e.push(`bpmn-sub-process-${l.toLowerCase()}`);break}case x.GLOBAL_TASK_KIND:{e.push(Xe(l));break}}return t&&e.push("bpmn-label"),e}function Xe(n){return n?"bpmn-"+n.replace(/([A-Z])/g,t=>"-"+t[0].toLowerCase()):""}const Tt=function(n){const t=n.createSvgCanvas;n.createSvgCanvas=function(){var i;const e=t.bind(this)(),s=e.getTextCss;if(e.getTextCss=function(){const o=this.pointerEvents;this.pointerEvents=!1;const a=s.bind(this)();return this.pointerEvents=o,a},(i=this.state)!=null&&i.cell){const o=this.state.cell,a=Hn(o,this.dialect===u.DIALECT_STRICTHTML),r=this.state.style[x.EXTRA_CSS_CLASSES];typeof r=="string"&&a.push(...r.split(",")),this.node.setAttribute("class",a.join(" ")),this.node.dataset.bpmnId=this.state.cell.id}return e}};class zn extends D.mxCellRenderer{constructor(t){super(),this.iconPainter=t}createCellOverlays(t){const s=t.view.graph.getCellOverlays(t.cell);let i=null;if(s!=null){i=new D.mxDictionary;for(const o of s){const a=t.overlays==null?null:t.overlays.remove(o);if(a!=null){i.put(o,a);continue}let r;o instanceof Kt?r=new gt(o.label,new He(0,0,0,0),o.style):(r=new D.mxImageShape(new He(0,0,0,0),o.image.src),r.preserveImageAspect=!1),r.dialect=t.view.graph.dialect,r.overlay=o,this.initializeOverlay(t,r),this.installCellOverlayListeners(t,o,r),o.cursor!=null&&(r.node.style.cursor=o.cursor),r instanceof gt&&(r.node.classList.add("overlay-badge"),r.node.dataset.bpmnId=t.cell.id),i.put(o,r)}}t.overlays!=null&&t.overlays.visit(function(o,a){a.destroy()}),t.overlays=i}createShape(t){const e=super.createShape(t);return"iconPainter"in e&&(e.iconPainter=this.iconPainter),Tt(e),e}createLabel(t,e){super.createLabel(t,e),Tt(t.text)}}function Xn(n,t,e,s){let i,o;n.heightS.setIconOriginForIconCentered(),shapeConfig:{x:t,y:e,width:s,height:i,strokeWidth:c},iconStyleConfig:{isFilled:r,fillColor:f,strokeColor:T,strokeWidth:l,margin:p}}}class $n{newBpmnCanvas({canvas:t,ratioFromParent:e,setIconOriginFunct:s,shapeConfig:i,iconStyleConfig:o},a){return new qn({canvas:t,shapeConfig:i,iconConfig:{originalSize:a,styleConfig:o,ratioFromParent:e,setIconOriginFunct:s}})}paintEnvelopeIcon(t){const e={width:485.41,height:321.76},s=this.newBpmnCanvas(t,e),i=e.width,o=e.height;s.rect(0,0,i,o),s.fillAndStroke();const{iconStyleConfig:a}=t;a.isFilled&&s.setStrokeColor(a.fillColor),s.begin(),s.moveTo(0,0),s.lineTo(i*.5,o*.6),s.lineTo(i,0),s.moveTo(0,o),s.lineTo(i/3,o*.45),s.moveTo(i,o),s.lineTo(i*2/3,o*.45),s.stroke()}paintCircleIcon(t){const e={width:t.shapeConfig.width,height:t.shapeConfig.height},s=this.newBpmnCanvas(t,e),i=e.width,o=e.height;i>0&&o>0&&s.ellipse(0,0,i,o),t.iconStyleConfig.isFilled?s.fillAndStroke():s.stroke()}paintClockIcon(t){const e=this.newBpmnCanvas(t,{height:152,width:152});e.begin(),e.moveTo(184,60),e.curveTo(188.4,60,192,56.4,192,52),e.lineTo(192,48),e.curveTo(192,40,188.4,40,184,40),e.curveTo(179.6,40,176,43.6,176,48),e.lineTo(176,52),e.curveTo(176,56.4,179.6,60,184,60),e.close(),e.moveTo(184,308),e.curveTo(179.6,308,176,311.6,176,316),e.lineTo(176,320),e.curveTo(176,324.4,179.6,328,184,328),e.curveTo(188.4,328,192,324.4,192,320),e.lineTo(192,316),e.curveTo(192,311.6,188.4,308,184,308),e.close(),e.moveTo(52,176),e.lineTo(48,176),e.curveTo(43.6,176,40,179.6,40,184),e.curveTo(40,188.4,43.6,192,48,192),e.lineTo(52,192),e.curveTo(56.4,192,69,188.4,60,184),e.curveTo(60,179.6,56.4,176,52,176),e.close(),e.moveTo(320,176),e.lineTo(316,176),e.curveTo(311.6,176,308,179.6,308,184),e.curveTo(308,188.4,311.6,192,316,192),e.lineTo(320,192),e.curveTo(324.4,192,328,188.4,328,184),e.curveTo(328,179.6,324.4,176,320,176),e.moveTo(93.6,82.4),e.curveTo(90.4,79.2,85.6,79.2,82.4,82.4),e.curveTo(79.2,85.6,79.2,90.4,82.4,93.6),e.lineTo(85.2,96.4),e.curveTo(86.8,98,88.8,98.8,90.8,98.8),e.curveTo(92.8,98.8,94.4,98,96.4,96.4),e.curveTo(99.6,93.2,99.6,88.4,96.4,85.2),e.lineTo(93.6,82.4),e.moveTo(85.2,271.6),e.lineTo(82.4,274.4),e.curveTo(79.2,277.6,79.2,282.4,82.4,285.6),e.curveTo(84,287.2,86,288,88,288),e.curveTo(90,288,92,287.2,93.6,285.6),e.lineTo(96.4,282.8),e.curveTo(99.6,279.6,99.6,274.8,96.4,271.6),e.curveTo(93.2,268.4,88.4,268.4,85.2,271.6),e.moveTo(274.4,82.4),e.lineTo(271.6,85.2),e.curveTo(268.4,88.4,268.4,93.2,271.6,96.4),e.curveTo(273.298,98,275.2,98.8,277.2,98.8),e.curveTo(279.2,98.8,281.2,98,282.8,96.4),e.lineTo(285.6,93.6),e.curveTo(288.8,90.4,288.8,85.6,285.6,82.4),e.curveTo(282.4,79.2,277.6,79.2,274.4,82.4),e.moveTo(192,180.8),e.lineTo(192,108),e.curveTo(192,103.6,188.4,100,184,100),e.curveTo(179.6,100,176,103.6,176,108),e.lineTo(176,184),e.curveTo(176,186,176.8,188,178.4,189.6),e.lineTo(266,277.2),e.curveTo(267.6,278.8,269.6,279.6,271.6,279.6),e.curveTo(273.6,279.6,275.6,278.8,277.2,277.2),e.curveTo(280.4,274,280.4,269.2,277.2,266),e.lineTo(192,180.8),e.moveTo(184,0),e.curveTo(82.4,0,0,82.4,0,184),e.curveTo(0,285.6,82.4,368,184,368),e.curveTo(285.6,368,368,285.6,368,184),e.curveTo(368,82.4,285.6,0,184,0),e.moveTo(184,352),e.curveTo(91.2,352,16,276.8,16,184),e.curveTo(16,91.2,91.2,16,184,16),e.curveTo(276.8,16,352,91.2,352,184),e.curveTo(352,276.8,276.8,352,184,352),e.fillAndStroke()}paintTriangleIcon(t){const e=this.newBpmnCanvas(t,{height:735,width:849});e.begin(),e.moveTo(497,55),e.lineTo(817,609),e.curveTo(849,665,808,735,744,735),e.lineTo(105,735),e.curveTo(40,735,0,665,32,609),e.lineTo(352,55),e.curveTo(384,0,465,0,497,55),e.close(),e.fillAndStroke()}paintUpArrowheadIcon(t){const e=this.newBpmnCanvas(t,{height:50,width:40});e.begin(),e.moveTo(0,49.5),e.lineTo(19.5,1),e.curveTo(19.75,.25,20,0,20.25,.25),e.lineTo(40,49.5),e.curveTo(40,49.5,39.75,50,39.6,49.75),e.lineTo(20,30),e.lineTo(.4,49.75),e.curveTo(.4,49.75,.25,50,0,49.5),e.close(),e.fillAndStroke()}paintDoubleLeftArrowheadsIcon(t){const e=this.newBpmnCanvas(t,{height:53.5,width:105});e.begin(),e.moveTo(91.4,0),e.curveTo(91.4,0,91.2,0,91,.2),e.lineTo(50,25),e.curveTo(47.9,25.8,46.7,26.6,46.4,27.3),e.lineTo(46.4,0),e.curveTo(46.4,0,46.2,0,46,.2),e.lineTo(4.9,25),e.curveTo(2,26.2,0,27.3,4.9,28.5),e.lineTo(45.8,53),e.curveTo(46,53.3,46.2,53.5,46.4,53.5),e.lineTo(46.4,27),e.curveTo(46.6,27.3,47.8,28.1,49.9,29.9),e.lineTo(90.8,53.3),e.curveTo(91,53.3,91.2,53.5,91.4,53.5),e.lineTo(91.4,0),e.close(),e.fillAndStroke()}drawCrossIcon(t){const e=this.newBpmnCanvas(t,{height:1,width:1});return e.begin(),e.moveTo(.38,0),e.lineTo(.62,0),e.lineTo(.62,.38),e.lineTo(1,.38),e.lineTo(1,.62),e.lineTo(.62,.62),e.lineTo(.62,1),e.lineTo(.38,1),e.lineTo(.38,.62),e.lineTo(0,.62),e.lineTo(0,.38),e.lineTo(.38,.38),e.close(),e}paintListIcon(t){const e=this.newBpmnCanvas(t,{height:60,width:60});e.begin(),e.moveTo(0,0),e.lineTo(60,0),e.lineTo(60,60),e.lineTo(0,60),e.lineTo(0,0),e.close(),e.moveTo(5,5),e.lineTo(55,5),e.close(),e.moveTo(5,21.6),e.lineTo(55,21.6),e.close(),e.moveTo(5,38.3),e.lineTo(55,38.3),e.close(),e.moveTo(5,55),e.lineTo(55,55),e.close(),e.fillAndStroke()}paintXCrossIcon(t){const e=this.drawCrossIcon(t);e.rotateOnIconCenter(45),e.fillAndStroke()}paintPlusCrossIcon(t){this.drawCrossIcon(t).fillAndStroke()}paintAsteriskIcon(t){const e=this.newBpmnCanvas(t,{height:1,width:1});ye(e),e.fillAndStroke(),ye(e),e.rotateOnIconCenter(60),e.fillAndStroke(),ye(e),e.rotateOnIconCenter(240),e.fillAndStroke()}paintPersonIcon(t){const e=this.newBpmnCanvas({...t,iconStyleConfig:{...t.iconStyleConfig,isFilled:!0}},{height:239.68,width:143.61});e.begin(),e.moveTo(124.31,150.29),e.lineTo(99.66,141.03),e.arcTo(6.43,6.43,0,0,1,95.51,135.03),e.lineTo(95.51,130.66),e.arcTo(47.75,47.75,0,0,0,119.51,89.25),e.lineTo(119.51,71.25),e.arcTo(47.62,47.62,0,0,0,101.18,33.64),e.arcTo(29.35,29.35,0,0,0,101.52,29.14),e.arcTo(29.68,29.68,0,0,0,42.17,29.14),e.arcTo(29.24,29.24,0,0,0,42.53,33.63),e.arcTo(47.65,47.65,0,0,0,24.14,71.23),e.lineTo(24.14,89.23),e.arcTo(47.7,47.7,0,0,0,48.19,130.63),e.lineTo(48.19,135.03),e.arcTo(6.43,6.43,0,0,1,44.03,141.03),e.lineTo(19.31,150.29),e.arcTo(29.81,29.81,0,0,0,.09,178.03),e.lineTo(.09,233.51),e.arcTo(5.63,5.63,0,1,0,11.34,233.51),e.lineTo(11.34,178.03),e.arcTo(18.19,18.19,0,0,1,11.57,175.17),e.lineTo(20.5,184.11),e.arcTo(12.32,12.32,0,0,1,24.14,192.89),e.lineTo(24.14,233.51),e.arcTo(5.63,5.63,0,1,0,35.39,233.51),e.lineTo(35.39,192.93),e.arcTo(23.5,23.5,0,0,0,28.46,176.2),e.lineTo(17.04,164.78),e.arcTo(18.34,18.34,0,0,1,23.29,160.78),e.lineTo(43.65,153.15),e.lineTo(66.22,175.72),e.lineTo(66.22,233.51),e.arcTo(5.63,5.63,0,1,0,77.47,233.51),e.lineTo(77.47,175.76),e.lineTo(100.04,153.19),e.lineTo(120.4,160.82),e.arcTo(18.39,18.39,0,0,1,126.65,164.82),e.lineTo(115.24,176.24),e.arcTo(23.5,23.5,0,0,0,108.31,192.93),e.lineTo(108.31,233.55),e.arcTo(5.63,5.63,0,1,0,119.56,233.55),e.lineTo(119.56,192.93),e.arcTo(12.35,12.35,0,0,1,123.19,184.15),e.lineTo(132.13,175.22),e.arcTo(18,18,0,0,1,132.36,178.08),e.lineTo(132.36,233.56),e.arcTo(5.63,5.63,0,0,0,143.61,233.56),e.lineTo(143.61,178.03),e.arcTo(29.81,29.81,0,0,0,124.31,150.29),e.close(),e.moveTo(71.85,10.72),e.arcTo(18.46,18.46,0,0,1,90.17,27.18),e.arcTo(47.68,47.68,0,0,0,53.53,27.18),e.arcTo(18.44,18.44,0,0,1,71.85,10.72),e.close(),e.moveTo(35.39,71.23),e.arcTo(36.46,36.46,0,0,1,108.31,71.23),e.lineTo(108.31,77.4),e.curveTo(82.12,75.4,56.97,60.55,56.71,60.4),e.arcTo(5.62,5.62,0,0,0,48.78,62.71),e.curveTo(46.24,67.79,40.45,71.89,35.39,74.62),e.close(),e.moveTo(35.39,89.23),e.lineTo(35.39,87.08),e.curveTo(40.55,84.85,49.73,80.08,55.67,72.66),e.curveTo(64.83,77.46,85.92,87.21,108.31,88.66),e.lineTo(108.31,89.24),e.arcTo(36.46,36.46,0,1,1,35.39,89.24),e.close(),e.moveTo(71.85,165.45),e.lineTo(54.06,147.69),e.arcTo(17.7,17.7,0,0,0,59.43,135.32),e.arcTo(47.57,47.57,0,0,0,84.27,135.32),e.arcTo(17.7,17.7,0,0,0,89.64,147.69),e.close(),e.fill()}paintGearIcon(t){const e=this.newBpmnCanvas(t,{height:100,width:100});Zn(e),e.translateIconOrigin(14,14),jn(e)}paintExpandIcon(t){const e={width:16,height:16},s=this.newBpmnCanvas(t,e),i=e.width,o=e.height;s.roundrect(0,0,i,o,2,2),s.stroke(),s.begin(),s.moveTo(i/2,o/4),s.lineTo(i/2,o*3/4),s.close(),s.moveTo(i/4,o/2),s.lineTo(i*3/4,o/2),s.close(),s.fillAndStroke()}paintLoopIcon(t){const{iconStyleConfig:e}=t;e.fillColor=e.strokeColor;const s=this.newBpmnCanvas(t,{width:22.49,height:21.62});s.begin(),s.moveTo(5.5,19.08),s.arcTo(8,8,0,1,1,10.5,21.08),s.stroke(),s.begin(),s.moveTo(7.5,14.08),s.lineTo(5.75,19.08),s.lineTo(0,17.08),s.close(),s.fillAndStroke()}paintSequentialMultiInstanceIcon(t){const e={width:16,height:16},s=this.newBpmnCanvas(t,e),{canvas:i,iconStyleConfig:o}=t;i.setFillColor(o.strokeColor);const a=e.width,r=e.height/5;s.rect(0,0,a,r),s.fill(),s.rect(0,2*r,a,r),s.fill(),s.rect(0,4*r,a,r),s.fill()}paintParallelMultiInstanceIcon(t){const e={width:16,height:16},s=this.newBpmnCanvas(t,e),{canvas:i,iconStyleConfig:o}=t;i.setFillColor(o.strokeColor);const a=e.width/5,r=e.height;s.begin(),s.rect(0,0,a,r),s.fill(),s.rect(2*a,0,a,r),s.fill(),s.rect(4*a,0,a,r),s.fill()}paintRightArrowIcon(t){const e=this.newBpmnCanvas(t,{width:512,height:415.23});e.setRoundLineJoin(),e.begin(),e.moveTo(512,207.61),e.lineTo(304.38,0),e.lineTo(304.38,135.39),e.lineTo(0,135.39),e.lineTo(0,279.84),e.lineTo(304.38,279.84),e.lineTo(304.38,415.23),e.lineTo(512,207.61),e.close(),e.fillAndStroke()}paintErrorIcon(t){const e=this.newBpmnCanvas(t,{width:72.44,height:71.82});e.begin(),e.moveTo(0,53.32),e.lineTo(19.48,0),e.lineTo(19.48,0),e.lineTo(50.85,40.07),e.lineTo(72.44,18.21),e.lineTo(53.12,71.82),e.lineTo(22.5,31.37),e.close(),e.fillAndStroke()}paintHandIcon(t){const e=this.newBpmnCanvas(t,{width:343.65,height:354.12});e.begin(),e.moveTo(231.66,336.39),e.curveTo(240.84,316.9,220.53,306.92,220.53,306.92),e.curveTo(215.2,303.67,188.58,287.43,140.67,258.19),e.lineTo(146.33,248.39),e.curveTo(223.98,269.38,267.12,281.04,275.75,283.38),e.curveTo(275.75,283.38,297.25,288,301.42,267.77),e.curveTo(306.34,245.29,288.32,238.63,288.32,238.63),e.curveTo(279.91,236.44,237.86,225.48,162.18,205.75),e.lineTo(165.2,194.8),e.curveTo(255.88,204.4,306.27,209.73,316.34,210.8),e.curveTo(316.34,210.8,339.89,212.16,341.76,189.55),e.curveTo(343.65,166.93,320.5,164.13,320.5,164.13),e.curveTo(310.43,163.1,260.04,157.99,169.35,148.77),e.lineTo(169.35,138.97),e.curveTo(253.41,132.12,300.11,128.32,309.45,127.56),e.curveTo(309.45,127.56,332.27,122.38,332.27,102.61),e.curveTo(332.27,82.85,305.48,81.87,305.48,81.87),e.curveTo(293.99,82.2,236.54,83.88,133.13,86.9),e.lineTo(127.61,81.87),e.curveTo(145.3,59.39,155.12,46.9,157.09,44.41),e.curveTo(157.09,44.41,171.12,26.8,156.78,12.72),e.curveTo(143.83,0,124.08,14.49,124.08,14.49),e.curveTo(116.45,19.41,78.35,44.06,9.77,88.43),e.lineTo(0,251.94),e.curveTo(122.84,308.79,191.09,340.37,204.74,346.69),e.curveTo(204.74,346.69,222.91,354.12,231.66,336.39),e.fillAndStroke()}paintScriptIcon(t){t.iconStyleConfig.fillColor=t.iconStyleConfig.strokeColor;const e=this.newBpmnCanvas(t,{width:458.75,height:461.64});e.begin(),e.moveTo(67.85,.57),e.curveTo(50.73,0,33.26,8.86,22.35,18.84),e.curveTo(8.11,32.15,0,50.77,0,70.26),e.curveTo(0,73.15,0,87.59,0,113.6),e.curveTo(55.4,113.6,86.18,113.6,92.33,113.6),e.curveTo(94.92,150.46,85.64,180.4,74.22,211.27),e.curveTo(40.16,298.07,30.77,339.83,55.56,410.87),e.curveTo(63.72,438.26,87.59,457.85,114.91,461.09),e.curveTo(216.96,460.85,294.9,461.64,388.41,461.2),e.curveTo(407.2,461.09,425.14,453.55,438.3,440.13),e.curveTo(451.46,426.71,458.75,403.06,458.46,384.26),e.curveTo(458.43,382.23,458.18,365.93,458.15,363.89),e.curveTo(432.12,364.24,406.09,364.04,380.06,364.04),e.curveTo(377.61,347.52,377.24,337.58,378.28,324.48),e.curveTo(380.5,296.47,389.08,273.36,398.59,247.1),e.curveTo(408.11,220.83,418.41,191.47,420.86,154.24),e.curveTo(422.11,135.34,421.4,110.24,417.77,86.75),e.curveTo(417.76,86.71,417.73,86.54,417.69,86.22),e.curveTo(417.64,85.95,417.61,85.79,417.6,85.76),e.curveTo(414.03,68.13,410.49,48.84,399.79,31.47),e.curveTo(389.09,14.11,366.95,.59,341.75,.59),e.curveTo(286.97,.59,122.63,.57,67.85,.57),e.close(),e.moveTo(85.04,72.68),e.curveTo(80.63,72.68,45.33,72.68,40.92,72.68),e.curveTo(40.46,58.4,47.15,51.87,50.27,48.75),e.curveTo(55.8,44.28,59.84,41,73.82,41),e.curveTo(78.45,52.13,82.23,62.71,85.04,72.68),e.close(),e.moveTo(364.94,52.9),e.curveTo(370,61.11,373.9,76.44,377.38,93.51),e.curveTo(380.35,113.1,381.01,136.42,380.02,151.57),e.curveTo(377.97,182.76,369.51,207.12,360.1,233.1),e.curveTo(350.69,259.09,340.27,286.77,337.53,321.27),e.curveTo(336.38,335.86,336.72,346.69,338.87,364.01),e.curveTo(326.35,364.01,263.75,364.01,151.06,364.01),e.curveTo(151.06,382.2,151.06,392.31,151.06,394.33),e.curveTo(147.77,404.8,138.9,418.2,127.43,419.94),e.curveTo(111.49,422.35,97.86,411.8,94.75,399.19),e.curveTo(65.14,321.99,94.93,275.54,112.57,225.47),e.curveTo(130.14,177.95,137.92,117.41,112.71,42.09),e.curveTo(192.88,41.9,274.33,42.21,342.89,41.98),e.curveTo(357.15,42.03,359.83,44.61,364.94,52.9),e.close(),e.moveTo(409.96,399.48),e.curveTo(409.96,408.42,398.54,425.67,392.02,425.67),e.curveTo(325.19,425.79,252.29,425.67,185.23,425.67),e.curveTo(189.88,424.43,194.66,405.64,194.66,399.48),e.curveTo(237.72,399.48,388.43,399.48,409.96,399.48),e.close(),e.fill(),e.begin(),e.moveTo(182.1,131.2),e.lineTo(182.1,151.68),e.lineTo(321.89,151.68),e.lineTo(321.89,131.2),e.lineTo(182.1,131.2),e.close(),e.moveTo(162.25,251.09),e.lineTo(162.25,271.49),e.lineTo(301.96,271.49),e.lineTo(301.96,251.09),e.lineTo(162.25,251.09),e.close(),e.fill()}paintTableIcon(t){const e=this.newBpmnCanvas(t,{width:640,height:640});e.begin(),e.moveTo(.19,.1),e.lineTo(298.78,.1),e.lineTo(298.78,198.88),e.lineTo(.19,198.88),e.lineTo(.19,.1),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(0,0),e.lineTo(298.78,0),e.lineTo(298.78,48.88),e.lineTo(0,48.88),e.lineTo(0,0),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(0,48.88),e.lineTo(98.78,48.88),e.lineTo(98.78,198.88),e.lineTo(0,198.88),e.lineTo(0,48.88),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(1.09,122.69),e.lineTo(298.78,122.69),e.close(),e.fillAndStroke(),e.setFillColor(t.iconStyleConfig.strokeColor),e.begin(),e.moveTo(0,0),e.lineTo(298.78,0),e.lineTo(298.78,48.88),e.lineTo(0,48.88),e.lineTo(0,0),e.close(),e.fillAndStroke()}paintPentagon(t){const e=this.newBpmnCanvas(t,{width:16,height:16});e.begin(),e.moveTo(16,6.5),e.lineTo(8,0),e.lineTo(0,6.5),e.lineTo(3,16),e.lineTo(13,16),e.lineTo(16,6.5),e.lineTo(8,0),e.stroke()}}function ye(n){n.begin(),n.moveTo(.38,0),n.lineTo(.62,0),n.lineTo(.62,1),n.lineTo(.38,1),n.close()}function Zn(n){n.begin(),n.moveTo(2.06,24.62),n.lineTo(10.17,30.95),n.lineTo(9.29,37.73),n.lineTo(0,41.42),n.lineTo(2.95,54.24),n.lineTo(13.41,52.92),n.lineTo(17.39,58.52),n.lineTo(13.56,67.66),n.lineTo(24.47,74.44),n.lineTo(30.81,66.33),n.lineTo(37.88,67.21),n.lineTo(41.57,76.5),n.lineTo(54.24,73.55),n.lineTo(53.06,62.94),n.lineTo(58.52,58.52),n.lineTo(67.21,63.09),n.lineTo(74.58,51.88),n.lineTo(66.03,45.25),n.lineTo(66.92,38.62),n.lineTo(76.5,34.93),n.lineTo(73.7,22.26),n.lineTo(62.64,23.44),n.lineTo(58.81,18.42),n.lineTo(62.79,8.7),n.lineTo(51.74,2.21),n.lineTo(44.81,10.47),n.lineTo(38.03,9.43),n.lineTo(33.75,0),n.lineTo(21.52,3.24),n.lineTo(22.7,13.56),n.lineTo(18.13,17.54),n.lineTo(8.7,13.56),n.close(),qe(n,24.8,39)}function jn(n){n.begin(),n.moveTo(16.46,41.42),n.lineTo(24.57,47.75),n.lineTo(23.69,54.53),n.lineTo(14.4,58.22),n.lineTo(17.35,71.04),n.lineTo(27.81,69.72),n.lineTo(31.79,75.32),n.lineTo(27.96,84.46),n.lineTo(38.87,91.24),n.lineTo(45.21,83.13),n.lineTo(52.28,84.01),n.lineTo(55.97,93.3),n.lineTo(68.64,90.35),n.lineTo(67.46,79.74),n.lineTo(72.92,75.32),n.lineTo(81.61,79.89),n.lineTo(88.98,68.68),n.lineTo(80.43,62.05),n.lineTo(81.32,55.42),n.lineTo(90.9,51.73),n.lineTo(88.1,39.06),n.lineTo(77.04,40.24),n.lineTo(73.21,35.22),n.lineTo(77.19,25.5),n.lineTo(66.14,19.01),n.lineTo(59.21,27.27),n.lineTo(52.43,26.23),n.lineTo(48.15,16.8),n.lineTo(35.92,20.04),n.lineTo(37.1,30.36),n.lineTo(32.53,34.34),n.lineTo(23.1,30.36),n.close();const t=39.2,e=55.8;qe(n,t,e),n.begin(),qe(n,t,e)}function qe(n,t,e){n.moveTo(t,e),n.arcTo(13.5,13.5,0,1,1,t+2*13.5,e),n.arcTo(13.5,13.5,0,0,1,t,e),n.close(),n.fillAndStroke()}class zt{static get(){return this.instance}static set(t){this.instance=t}}y(zt,"instance",new $n);const $e=1.25,Jn=1/$e;class Qn extends D.mxGraph{constructor(e){super(e);y(this,"currentZoomLevel",1);this.zoomFactor=$e,this.container&&(this.container.style.cursor="default")}createGraphView(){return new es(this)}createCellRenderer(){return new zn(zt.get())}batchUpdate(e){this.model.beginUpdate();try{e()}finally{this.model.endUpdate()}}fit(e,s,i,o,a,r,l){const c=super.fit(e,s,i,o,a,r,l);return this.setCurrentZoomLevel(c),c}setCurrentZoomLevel(e){this.currentZoomLevel=e??this.view.scale}zoomActual(){super.zoomActual(),this.setCurrentZoomLevel()}zoomIn(){super.zoomIn(),this.setCurrentZoomLevel()}zoomOut(){super.zoomOut(),this.setCurrentZoomLevel()}customFit(e){this.zoomActual();const s=e==null?void 0:e.type;if(s==null||s==ue.None)return;const i=On(e==null?void 0:e.margin);if(s==ue.Center){const a=this.getGraphBounds(),r=this.container.clientWidth-i,l=this.container.clientHeight-i,c=a.width/this.view.scale,f=a.height/this.view.scale,T=Math.min(3,Math.min(r/c,l/f));this.setCurrentZoomLevel(T),this.view.scaleAndTranslate(T,(i+r-c*T)/(2*T)-a.x/this.view.scale,(i+l-f*T)/(2*T)-a.y/this.view.scale)}else{let o=!1,a=!1;switch(s){case ue.Horizontal:{a=!0;break}case ue.Vertical:{o=!0;break}}this.fit(this.border,!1,i,!0,o,a)}}registerMouseWheelZoomListeners(e){e=Ln(e),te.addMouseWheelListener(Ht(this.createMouseWheelZoomListener(!0),e.debounceDelay),this.container),te.addMouseWheelListener(Un(this.createMouseWheelZoomListener(!1),e.throttleDelay),this.container)}manageMouseWheelZoomEvent(e,s,i){if(i){const[o,a]=this.getEventRelativeCoordinates(s),[r,l,c]=this.getScaleAndTranslationDeltas(o,a);this.view.scaleAndTranslate(r,this.view.translate.x+l,this.view.translate.y+c),te.consume(s)}else this.currentZoomLevel*=e?$e:Jn}createMouseWheelZoomListener(e){return(s,i)=>{if(te.isConsumed(s)||!(s instanceof MouseEvent))return;s.ctrlKey&&!s.altKey&&!s.shiftKey&&!s.metaKey&&this.manageMouseWheelZoomEvent(i,s,e)}}getEventRelativeCoordinates(e){const s=this.container.getBoundingClientRect(),i=e.clientX-s.left,o=e.clientY-s.top;return[i,o]}getScaleAndTranslationDeltas(e,s){const[i,o]=this.calculateFactorAndScale(),[a,r]=this.calculateTranslationDeltas(i,o,e*2,s*2);return[o,a,r]}calculateTranslationDeltas(e,s,i,o){if(e>1){const a=(e-1)/(s*2);i*=-a,o*=-a}else{const a=(1/e-1)/(this.view.scale*2);i*=a,o*=a}return[i,o]}calculateFactorAndScale(){const e=Math.round(this.currentZoomLevel*100)/100;return[e/this.view.scale,e]}}class es extends D.mxGraphView{getFloatingTerminalPoint(t,e,s,i){if(t.absolutePoints.filter(Boolean).length<2)return super.getFloatingTerminalPoint(t,e,s,i);const r=t.absolutePoints;return i?r[1]:r.at(-2)}}class ts{configureMarkers(){this.registerArrowDashMarker()}registerArrowDashMarker(){const t=(e,s,i,o,a,r,l,c,f)=>{const T=a*(l+f+4),p=r*(l+f+4);return function(){e.begin(),e.moveTo(o.x-T/2-p/2,o.y-p/2+T/2),e.lineTo(o.x+p/2-3*T/2,o.y-3*p/2-T/2),e.stroke()}};D.mxMarker.addMarker(Ut.ARROW_DASH,t)}}const ns=[W.LOOP,W.MULTI_INSTANCE_PARALLEL,W.MULTI_INSTANCE_SEQUENTIAL,W.COMPENSATION,W.EXPAND,W.ADHOC];function ss(n){const t=ns.filter(e=>n.includes(e));for(const e of n.filter(s=>!t.includes(s)))t.push(e);return t}function is(n,t){return n===1?e=>e.setIconOriginForIconBottomCentered():e=>{e.setIconOriginForIconBottomCentered();const s=Math.pow(-1,t)*(R.SHAPE_ACTIVITY_MARKER_ICON_SIZE+R.SHAPE_ACTIVITY_MARKER_ICON_MARGIN)/2;e.translateIconOrigin(s,0)}}class tt extends Je{constructor(){super(void 0,void 0,void 0);y(this,"iconPainter");y(this,"markerPainterFunctions",new Map([[W.EXPAND,e=>this.iconPainter.paintExpandIcon(e)],[W.LOOP,e=>this.iconPainter.paintLoopIcon(e)],[W.MULTI_INSTANCE_PARALLEL,e=>this.iconPainter.paintParallelMultiInstanceIcon(e)],[W.MULTI_INSTANCE_SEQUENTIAL,e=>this.iconPainter.paintSequentialMultiInstanceIcon(e)]]))}paintForeground(e,s,i,o,a){super.paintForeground(e,s,i,o,a),this.paintMarkerIcons(ae({canvas:e,x:s,y:i,width:o,height:a,shape:this,ratioFromParent:0,iconStrokeWidth:1.5}))}paintMarkerIcons(e){var i;const s=Y.getValue(this.style,x.MARKERS,void 0);if(s){const o=ss(s.split(","));for(const[a,r]of o.entries())e={...e,setIconOriginFunct:is(o.length,a+1)},e.canvas.save(),(i=this.markerPainterFunctions.get(r))==null||i(e),e.canvas.restore()}}paintEnvelopeIcon(e,s){this.iconPainter.paintEnvelopeIcon({...e,setIconOriginFunct:i=>i.setIconOriginToShapeTopLeft(),ratioFromParent:.2,iconStyleConfig:{...e.iconStyleConfig,isFilled:s}})}}class ie extends tt{paintForeground(t,e,s,i,o){super.paintForeground(t,e,s,i,o),this.paintTaskIcon(ae({canvas:t,x:e,y:s,width:i,height:o,shape:this}))}}class os extends ie{paintTaskIcon(t){}}class rs extends ie{paintTaskIcon(t){this.iconPainter.paintGearIcon({...t,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class ls extends ie{paintTaskIcon(t){this.iconPainter.paintPersonIcon({...t,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class as extends ie{paintTaskIcon(t){if(!Wt(this.style)){this.paintEnvelopeIcon(t,!1);return}const e=4,s=4,i={...t.shapeConfig,width:20,height:20};this.iconPainter.paintCircleIcon({canvas:t.canvas,shapeConfig:i,iconStyleConfig:{...t.iconStyleConfig,isFilled:!1},ratioFromParent:void 0,setIconOriginFunct:o=>o.setIconOriginToShapeTopLeft(s,e)}),i.x+=e,i.y+=s,this.iconPainter.paintEnvelopeIcon({...t,shapeConfig:i,ratioFromParent:.65,setIconOriginFunct:o=>o.setIconOriginForIconCentered()})}}class cs extends ie{paintTaskIcon(t){this.paintEnvelopeIcon(t,!0)}}class us extends ie{paintTaskIcon(t){this.iconPainter.paintHandIcon({...t,ratioFromParent:.18,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class ds extends ie{paintTaskIcon(t){this.iconPainter.paintScriptIcon({...t,ratioFromParent:.22,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class hs extends tt{paintForeground(t,e,s,i,o){super.paintForeground(t,e,s,i,o);const a=ae({canvas:t,x:e,y:s,width:i,height:o,shape:this});switch(Y.getValue(this.style,x.GLOBAL_TASK_KIND,void 0)){case C.GLOBAL_TASK_MANUAL:{this.iconPainter.paintHandIcon({...a,ratioFromParent:.18,setIconOriginFunct:r=>r.setIconOriginToShapeTopLeftProportionally(20)});break}case C.GLOBAL_TASK_SCRIPT:{this.iconPainter.paintScriptIcon({...a,ratioFromParent:.22,setIconOriginFunct:r=>r.setIconOriginToShapeTopLeftProportionally(20)});break}case C.GLOBAL_TASK_USER:{this.iconPainter.paintPersonIcon({...a,setIconOriginFunct:r=>r.setIconOriginToShapeTopLeftProportionally(20)});break}case C.GLOBAL_TASK_BUSINESS_RULE:{this.iconPainter.paintTableIcon({...a,ratioFromParent:.6,setIconOriginFunct:r=>r.setIconOriginToShapeTopLeftProportionally(15)});break}}}}class fs extends tt{paintBackground(t,e,s,i,o){const a=Y.getValue(this.style,x.SUB_PROCESS_KIND,void 0);if(t.save(),a===ee.EVENT&&(t.setDashed(!0,!1),t.setDashPattern("1 2")),super.paintBackground(t,e,s,i,o),a===ee.TRANSACTION){const r=R.SUB_PROCESS_TRANSACTION_INNER_RECT_OFFSET,l=R.SUB_PROCESS_TRANSACTION_INNER_RECT_ARC_SIZE;t.roundrect(e+r,s+r,i-2*r,o-2*r,l,l),t.stroke()}t.restore()}}class gs extends ie{paintTaskIcon(t){this.iconPainter.paintTableIcon({...t,ratioFromParent:.6,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(15)})}}class Ts extends D.mxConnector{paintEdgeShape(t,e){const s=this.createMarker(t,e,!0),i=this.createMarker(t,e,!1);this.paintEdgeLine(t,e),t.setShadow(!1),t.setDashed(!1,!1),s!=null&&(t.setFillColor(Y.getValue(this.style,x.EDGE_START_FILL_COLOR,this.stroke)),s()),i!=null&&(t.setFillColor(Y.getValue(this.style,x.EDGE_END_FILL_COLOR,this.stroke)),i())}paintEdgeLine(t,e){const s=ps(t);pt(t,"stroke"),this.paintLine(t,e,this.isRounded),pt(t,s)}}function ps(n){return n instanceof Qe?n.pointerEventsValue:null}function pt(n,t){n instanceof Qe&&(n.pointerEventsValue=t)}class nt extends D.mxEllipse{constructor(){super(void 0,void 0,void 0);y(this,"iconPainter");y(this,"iconPainters",new Map([[H.MESSAGE,e=>this.iconPainter.paintEnvelopeIcon({...e,ratioFromParent:.5})],[H.TERMINATE,e=>this.iconPainter.paintCircleIcon({...e,ratioFromParent:.6})],[H.TIMER,e=>this.iconPainter.paintClockIcon({...e,setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(5)})],[H.SIGNAL,e=>this.iconPainter.paintTriangleIcon({...e,ratioFromParent:.55,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:R.STROKE_WIDTH_THIN.valueOf()},setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(4)})],[H.LINK,e=>this.iconPainter.paintRightArrowIcon({...e,ratioFromParent:.55,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1.5}})],[H.ERROR,e=>this.iconPainter.paintErrorIcon({...e,ratioFromParent:.55,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1.5}})],[H.COMPENSATION,e=>this.iconPainter.paintDoubleLeftArrowheadsIcon({...e,ratioFromParent:.7,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1.5}})],[H.CANCEL,e=>this.iconPainter.paintXCrossIcon({...e,ratioFromParent:.78})],[H.ESCALATION,e=>this.iconPainter.paintUpArrowheadIcon({...e,ratioFromParent:.55,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:R.STROKE_WIDTH_THIN.valueOf()}})],[H.CONDITIONAL,e=>this.iconPainter.paintListIcon({...e,ratioFromParent:.6,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1.5}})]]));y(this,"withFilledIcon",!1)}paintVertexShape(e,s,i,o,a){const r=ae({canvas:e,x:s,y:i,width:o,height:a,shape:this,isFilled:this.withFilledIcon});Es(r,Y.getValue(this.style,x.IS_INTERRUPTING,void 0)),this.paintOuterShape(r),Ss(r),this.paintInnerShape(r)}paintOuterShape({canvas:e,shapeConfig:{x:s,y:i,width:o,height:a}}){super.paintVertexShape(e,s,i,o,a)}paintInnerShape(e){const s=this.iconPainters.get(Y.getValue(this.style,x.EVENT_DEFINITION_KIND,H.NONE));s==null||s(e)}}function Es(n,t){n.canvas.save(),t==="false"&&(n.canvas.setDashed(!0,!1),n.canvas.setDashPattern("3 2"))}function Ss(n){n.canvas.restore()}class ms extends nt{constructor(){super(),this.withFilledIcon=!0}}class Ze extends nt{paintOuterShape({canvas:t,shapeConfig:{x:e,y:s,width:i,height:o,strokeWidth:a}}){t.ellipse(e,s,i,o),t.fillAndStroke();const r=a*1.5;t.ellipse(i*.02+r+e,o*.02+r+s,i*.96-2*r,o*.96-2*r),t.stroke()}}class Cs extends Ze{constructor(){super(),this.withFilledIcon=!0}}class Is extends Je{constructor(){super(...arguments);y(this,"iconPainter")}paintVertexShape(e,s,i,o,a){const r=ae({canvas:e,x:s,y:i,width:o,height:a,shape:this,ratioFromParent:1,isFilled:Y.getValue(this.style,x.IS_INITIATING,"true")=="false"});this.iconPainter.paintEnvelopeIcon(r)}}class Te extends D.mxRhombus{constructor(){super(...arguments);y(this,"iconPainter")}paintVertexShape(e,s,i,o,a){const r=ae({canvas:e,x:s,y:i,width:o,height:a,shape:this});this.paintOuterShape(r),this.paintInnerShape(r)}paintOuterShape({canvas:e,shapeConfig:{x:s,y:i,width:o,height:a}}){super.paintVertexShape(e,s,i,o,a)}}class As extends Te{paintInnerShape(t){this.iconPainter.paintXCrossIcon({...t,iconStyleConfig:{...t.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class Ns extends Te{paintInnerShape(t){this.iconPainter.paintPlusCrossIcon({...t,iconStyleConfig:{...t.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class Os extends Te{paintInnerShape(t){this.iconPainter.paintCircleIcon({...t,ratioFromParent:.62,iconStyleConfig:{...t.iconStyleConfig,isFilled:!1,strokeWidth:R.STROKE_WIDTH_THICK.valueOf()}})}}class Ls extends Te{paintInnerShape(t){this.iconPainter.paintAsteriskIcon({...t,iconStyleConfig:{...t.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class vs extends Te{paintInnerShape(t){t={...t,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1}},this.iconPainter.paintCircleIcon({...t,ratioFromParent:.55}),Wt(this.style)||this.iconPainter.paintCircleIcon({...t,ratioFromParent:.45});const e={...t,ratioFromParent:.3};Y.getValue(this.style,x.EVENT_BASED_GATEWAY_KIND,he.Exclusive)==he.Parallel?this.iconPainter.paintPlusCrossIcon(e):this.iconPainter.paintPentagon(e)}}class _s extends Je{paintForeground(t,e,s,i,o){t.begin(),t.moveTo(e+R.TEXT_ANNOTATION_BORDER_LENGTH,s),t.lineTo(e,s),t.lineTo(e,s+o),t.lineTo(e+R.TEXT_ANNOTATION_BORDER_LENGTH,s+o),t.stroke()}paintBackground(t,e,s,i,o){t.save(),t.setStrokeColor("none"),super.paintBackground(t,e,s,i,o),t.restore()}}const ys=()=>{const n=[[C.EVENT_END,ms],[C.EVENT_START,nt],[C.EVENT_INTERMEDIATE_THROW,Cs],[C.EVENT_INTERMEDIATE_CATCH,Ze],[C.EVENT_BOUNDARY,Ze],[C.GATEWAY_COMPLEX,Ls],[C.GATEWAY_EVENT_BASED,vs],[C.GATEWAY_EXCLUSIVE,As],[C.GATEWAY_INCLUSIVE,Os],[C.GATEWAY_PARALLEL,Ns],[C.SUB_PROCESS,fs],[C.CALL_ACTIVITY,hs],[C.TASK,os],[C.TASK_SERVICE,rs],[C.TASK_USER,ls],[C.TASK_RECEIVE,as],[C.TASK_SEND,cs],[C.TASK_MANUAL,us],[C.TASK_SCRIPT,ds],[C.TASK_BUSINESS_RULE,gs],[C.TEXT_ANNOTATION,_s],[x.EDGE,Ts],[x.MESSAGE_FLOW_ICON,Is]];for(const[t,e]of n)Cn.registerShape(t,e)};class ws{configureShapes(){ys()}}const Xt=12;class st extends Map{get(t){return super.get(t)??(()=>{})}}const Rs=new st([[Z.SEQUENCE_FLOW,n=>{n[u.STYLE_ENDARROW]=u.ARROW_BLOCK_THIN}],[Z.MESSAGE_FLOW,n=>{n[u.STYLE_DASHED]=!0,n[u.STYLE_DASH_PATTERN]="8 5",n[u.STYLE_STARTARROW]=u.ARROW_OVAL,n[u.STYLE_STARTSIZE]=8,n[u.STYLE_STARTFILL]=!0,n[x.EDGE_START_FILL_COLOR]=R.MESSAGE_FLOW_MARKER_START_FILL_COLOR,n[u.STYLE_ENDARROW]=u.ARROW_BLOCK_THIN,n[u.STYLE_ENDFILL]=!0,n[x.EDGE_END_FILL_COLOR]=R.MESSAGE_FLOW_MARKER_END_FILL_COLOR}],[Z.ASSOCIATION_FLOW,n=>{n[u.STYLE_DASHED]=!0,n[u.STYLE_DASH_PATTERN]="1 2",n[u.STYLE_STARTSIZE]=Xt}]]),bs=new st([[Q.DEFAULT,n=>{n[u.STYLE_STARTARROW]=Ut.ARROW_DASH}],[Q.CONDITIONAL_FROM_ACTIVITY,n=>{n[u.STYLE_STARTARROW]=u.ARROW_DIAMOND_THIN,n[u.STYLE_STARTSIZE]=18,n[u.STYLE_STARTFILL]=!0,n[x.EDGE_START_FILL_COLOR]=R.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR}]]),Fs=new st([[re.NONE,n=>{}],[re.ONE,n=>{n[u.STYLE_ENDARROW]=u.ARROW_OPEN_THIN}],[re.BOTH,n=>{n[u.STYLE_STARTARROW]=u.ARROW_OPEN_THIN,n[u.STYLE_ENDARROW]=u.ARROW_OPEN_THIN}]]);class qt{constructor(t){this.graph=t}configureStyles(){this.configureDefaultVertexStyle(),this.configurePoolStyle(),this.configureLaneStyle(),this.configureTextAnnotationStyle(),this.configureGroupStyle(),this.configureActivityStyles(),this.configureEventStyles(),this.configureGatewayStyles(),this.configureDefaultEdgeStyle(),this.configureFlowStyles()}getStylesheet(){return this.graph.getStylesheet()}putCellStyle(t,e){this.getStylesheet().putCellStyle(t,e)}configureDefaultVertexStyle(){const t=this.getStylesheet().getDefaultVertexStyle();Et(t),t[u.STYLE_ABSOLUTE_ARCSIZE]=!0,t[u.STYLE_ARCSIZE]=R.SHAPE_ARC_SIZE}configurePoolStyle(){const t={};t[u.STYLE_SHAPE]=u.SHAPE_SWIMLANE,t[u.STYLE_VERTICAL_ALIGN]=u.ALIGN_MIDDLE,t[u.STYLE_ALIGN]=u.ALIGN_CENTER,t[u.STYLE_STARTSIZE]=R.POOL_LABEL_SIZE,t[u.STYLE_FILLCOLOR]=R.POOL_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(C.POOL,t)}configureLaneStyle(){const t={};t[u.STYLE_SHAPE]=u.SHAPE_SWIMLANE,t[u.STYLE_VERTICAL_ALIGN]=u.ALIGN_MIDDLE,t[u.STYLE_ALIGN]=u.ALIGN_CENTER,t[u.STYLE_SWIMLANE_LINE]=0,t[u.STYLE_STARTSIZE]=R.LANE_LABEL_SIZE,t[u.STYLE_FILLCOLOR]=R.LANE_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(C.LANE,t)}configureEventStyles(){for(const t of F.eventKinds()){const e={};e[u.STYLE_SHAPE]=t,e[u.STYLE_PERIMETER]=ht.EllipsePerimeter,e[u.STYLE_STROKEWIDTH]=t==C.EVENT_END?R.STROKE_WIDTH_THICK:R.STROKE_WIDTH_THIN,e[u.STYLE_VERTICAL_LABEL_POSITION]=u.ALIGN_BOTTOM,this.putCellStyle(t,e)}}configureTextAnnotationStyle(){const t={};t[u.STYLE_SHAPE]=C.TEXT_ANNOTATION,t[u.STYLE_VERTICAL_ALIGN]=u.ALIGN_MIDDLE,t[u.STYLE_ALIGN]=u.ALIGN_LEFT,t[u.STYLE_SPACING_LEFT]=5,t[u.STYLE_FILLCOLOR]=R.TEXT_ANNOTATION_FILL_COLOR,t[u.STYLE_STROKEWIDTH]=R.STROKE_WIDTH_THIN,this.putCellStyle(C.TEXT_ANNOTATION,t)}configureGroupStyle(){const t={};t[u.STYLE_ROUNDED]=!0,t[u.STYLE_DASHED]=!0,t[u.STYLE_DASH_PATTERN]="7 4 1 4",t[u.STYLE_STROKEWIDTH]=R.STROKE_WIDTH_THIN,t[u.STYLE_FILLCOLOR]=R.GROUP_FILL_COLOR,t[u.STYLE_ALIGN]=u.ALIGN_CENTER,t[u.STYLE_VERTICAL_ALIGN]=u.ALIGN_TOP,this.putCellStyle(C.GROUP,t)}configureActivityStyles(){for(const t of F.activityKinds()){const e={};e[u.STYLE_SHAPE]=t,e[u.STYLE_ROUNDED]=!0,e[u.STYLE_VERTICAL_ALIGN]=u.ALIGN_MIDDLE,e[u.STYLE_STROKEWIDTH]=t==C.CALL_ACTIVITY?R.STROKE_WIDTH_THICK:R.STROKE_WIDTH_THIN,this.putCellStyle(t,e)}}configureGatewayStyles(){for(const t of F.gatewayKinds()){const e={};e[u.STYLE_SHAPE]=t,e[u.STYLE_PERIMETER]=ht.RhombusPerimeter,e[u.STYLE_STROKEWIDTH]=R.STROKE_WIDTH_THIN,e[u.STYLE_VERTICAL_ALIGN]=u.ALIGN_TOP,e[u.STYLE_LABEL_POSITION]=u.ALIGN_LEFT,e[u.STYLE_VERTICAL_LABEL_POSITION]=u.ALIGN_TOP,this.putCellStyle(t,e)}}configureDefaultEdgeStyle(){const t=this.getStylesheet().getDefaultEdgeStyle();Et(t),t[u.STYLE_SHAPE]=x.EDGE,t[u.STYLE_ENDSIZE]=Xt,t[u.STYLE_STROKEWIDTH]=1.5,t[u.STYLE_ROUNDED]=!0,t[u.STYLE_ARCSIZE]=5,t[u.STYLE_VERTICAL_ALIGN]=u.ALIGN_BOTTOM,delete t[u.STYLE_ENDARROW]}configureEdgeStyles(t,e){for(const s of t){const i={};e.get(s)(i),this.graph.getStylesheet().putCellStyle(s.toString(),i)}}configureFlowStyles(){this.configureEdgeStyles(Object.values(Z),Rs),this.configureEdgeStyles(Object.values(Q),bs),this.configureEdgeStyles(Object.values(re),Fs)}}function Et(n){n[u.STYLE_FONTFAMILY]=R.DEFAULT_FONT_FAMILY,n[u.STYLE_FONTSIZE]=R.DEFAULT_FONT_SIZE,n[u.STYLE_FONTCOLOR]=R.DEFAULT_FONT_COLOR,n[u.STYLE_FILLCOLOR]=R.DEFAULT_FILL_COLOR,n[u.STYLE_STROKECOLOR]=R.DEFAULT_STROKE_COLOR,n[u.STYLE_LABEL_BACKGROUNDCOLOR]=u.NONE,n[u.STYLE_WHITE_SPACE]="wrap"}class Ps{constructor(t){y(this,"graph");this.graph=new Qn(t)}configure(t){return this.configureGraph(),this.configureNavigationSupport(t),new qt(this.graph).configureStyles(),new ws().configureShapes(),new ts().configureMarkers(),this.graph}configureGraph(){this.graph.setCellsLocked(!0),this.graph.setCellsSelectable(!1),this.graph.setEdgeLabelsMovable(!1),this.graph.setHtmlLabels(!0),this.graph.setConstrainChildren(!1),this.graph.setExtendParents(!1),this.graph.foldingEnabled=!1}configureNavigationSupport(t){var s;const e=this.graph.panningHandler;(s=t==null?void 0:t.navigation)!=null&&s.enabled?(e.addListener(te.PAN_START,St(this.graph,"grab")),e.addListener(te.PAN_END,St(this.graph,"default")),e.usePopupTrigger=!1,e.isForcePanningEvent=i=>te.isLeftMouseButton(i.getEvent())||te.isMultiTouchEvent(i.getEvent()),this.graph.setPanning(!0),this.graph.registerMouseWheelZoomListeners(t.navigation.zoom)):(this.graph.setPanning(!1),e.setPinchEnabled(!1),e.isForcePanningEvent=i=>!1)}}function St(n,t){return()=>{n.container.style.cursor=t}}class xs{constructor(t){this.graph=t}fit(t){this.graph.customFit(t)}zoom(t){t=="in"?this.graph.zoomIn():this.graph.zoomOut()}}class ks{constructor(t){this.convertedElements=t}deserialize(t){const e=P(t.category).flatMap(s=>P(s.categoryValue));for(const s of e)this.convertedElements.registerCategoryValue(s.id,s.value)}}class ce{}class Bs{constructor(t){this.options=t}warning(t){var s;if((s=this.options)!=null&&s.disableConsoleLog)return;const e=t.getMessage();console.warn(`[bv-parser] ${e.template}`,...e.arguments)}}class Ms extends ce{constructor(t,e){super(),this.groupBpmnElementId=t,this.categoryValueReference=e}getMessage(){return{arguments:[this.categoryValueReference,this.groupBpmnElementId],template:"Group json deserialization: unable to find category value ref %s for bpmn element %s"}}}class Vs extends ce{constructor(t){super(),this.bpmnElementId=t}getMessage(){return{arguments:[this.bpmnElementId],template:"Shape json deserialization: unable to find bpmn element with id %s"}}}class Ys extends ce{constructor(t){super(),this.bpmnElementId=t}getMessage(){return{arguments:[this.bpmnElementId],template:"Edge json deserialization: unable to find bpmn element with id %s"}}}class Gs extends ce{constructor(t,e){super(),this.shapeOrEdgeId=t,this.labelStyleId=e}getMessage(){return{arguments:[this.labelStyleId,this.shapeOrEdgeId],template:"Unable to assign font from style %s to shape/edge %s"}}}class Ds extends ce{constructor(t,e){super(),this.laneId=t,this.flowNodeReference=e}getMessage(){return{arguments:[this.flowNodeReference,this.laneId],template:"Unable to assign lane %s as parent: flow node %s is not found"}}}class Us extends ce{constructor(t,e,s){super(),this.bpmnElementId=t,this.attachedToReference=e,this.attachedToKind=s}getMessage(){return{arguments:[this.bpmnElementId,this.attachedToReference,this.attachedToKind],template:"The boundary event %s must be attached to an activity, and not to %s of kind %s"}}}class Ws{constructor(){y(this,"poolsById",new Map);y(this,"poolsByProcessRef",new Map);y(this,"messageFlows",new Map);y(this,"flowNodes",new Map);y(this,"lanes",new Map);y(this,"sequenceFlows",new Map);y(this,"associationFlows",new Map);y(this,"eventDefinitionsOfDefinitions",new Map);y(this,"globalTasks",new Map);y(this,"categoryValues",new Map)}getFlows(){return[...this.messageFlows.values(),...this.sequenceFlows.values(),...this.associationFlows.values()]}findPoolById(t){return this.poolsById.get(t)}findPoolByProcessRef(t){return this.poolsByProcessRef.get(t)}registerPool(t,e){this.poolsById.set(t.id,t),e&&this.poolsByProcessRef.set(e,t)}findMessageFlow(t){return this.messageFlows.get(t)}registerMessageFlow(t){this.messageFlows.set(t.id,t)}findFlowNode(t){return this.flowNodes.get(t)}registerFlowNode(t){this.flowNodes.set(t.id,t)}findLane(t){return this.lanes.get(t)}registerLane(t){this.lanes.set(t.id,t)}findSequenceFlow(t){return this.sequenceFlows.get(t)}registerSequenceFlow(t){this.sequenceFlows.set(t.id,t)}findAssociationFlow(t){return this.associationFlows.get(t)}registerAssociationFlow(t){this.associationFlows.set(t.id,t)}findEventDefinitionOfDefinition(t){return this.eventDefinitionsOfDefinitions.get(t)}registerEventDefinitionsOfDefinition(t,e){this.eventDefinitionsOfDefinitions.set(t,e)}findGlobalTask(t){return this.globalTasks.get(t)}registerGlobalTask(t,e){this.globalTasks.set(t,e)}findCategoryValue(t){return this.categoryValues.get(t)}registerCategoryValue(t,e){this.categoryValues.set(t,{value:e})}}const $t=(n,t,e,s)=>{const i=n.findCategoryValue(e.categoryValueRef);if(i)return new J(e.id,i.value,C.GROUP,s);t.warning(new Ms(e.id,e.categoryValueRef))},Zt=(n,t)=>{for(const e of P(t)){const s=e.associationDirection;n.registerAssociationFlow(new Vt(e.id,void 0,e.sourceRef,e.targetRef,s))}};class Hs{constructor(t,e){this.convertedElements=t,this.parsingMessageCollector=e}deserialize(t){for(const e of P(t))this.parseCollaboration(e)}parseCollaboration(t){this.buildParticipant(t.participant),this.buildMessageFlows(t.messageFlow),Zt(this.convertedElements,t.association),this.buildGroups(t.group),this.buildTextAnnotation(t.textAnnotation)}buildParticipant(t){for(const e of P(t))this.convertedElements.registerPool(new J(e.id,e.name,C.POOL),e.processRef)}buildMessageFlows(t){for(const e of P(t))this.convertedElements.registerMessageFlow(new Mt(e.id,e.name,e.sourceRef,e.targetRef))}buildGroups(t){for(const e of P(t)){const s=$t(this.convertedElements,this.parsingMessageCollector,e);s&&this.convertedElements.registerFlowNode(s)}}buildTextAnnotation(t){for(const e of P(t))this.convertedElements.registerFlowNode(new J(e.id,e.text,C.TEXT_ANNOTATION))}}class Ks{constructor(t,e,s,i){this.x=t,this.y=e,this.width=s,this.height=i}}class zs{constructor(t,e,s,i,o=fe.NONE){y(this,"extensions",{});this.id=t,this.bpmnElement=e,this.waypoints=s,this.label=i,this.messageVisibleKind=o}}class Xs{constructor(t,e){this.x=t,this.y=e}}class qs{constructor(t,e){y(this,"extensions",{});this.font=t,this.bounds=e}}class $s{constructor(t,e,s,i,o,a){this.name=t,this.size=e,this.isBold=s,this.isItalic=i,this.isUnderline=o,this.isStrikeThrough=a}}class Zs{constructor(t,e){y(this,"convertedFonts",new Map);this.convertedElements=t,this.parsingMessageCollector=e}deserialize(t){const e=[],s=[],i=[],o=[],a=P(t)[0];if(a){this.deserializeFonts(a.BPMNLabelStyle);const r=a.BPMNPlane,l=this.deserializeEdges(r.BPMNEdge),c=this.deserializeShapes(r.BPMNShape);e.push(...c.flowNodes),s.push(...c.lanes),i.push(...c.pools),o.push(...l)}return{flowNodes:e,lanes:s,pools:i,edges:o}}deserializeFonts(t){for(const e of P(t))for(const s of P(e.Font))this.convertedFonts.set(e.id,new $s(s.name,s.size,s.isBold,s.isItalic,s.isUnderline,s.isStrikeThrough))}deserializeShapes(t){const e={flowNodes:[],lanes:[],pools:[]};for(const s of P(t))this.deserializeShapeAndStoreIfFound(s,e.flowNodes,i=>this.convertedElements.findFlowNode(i))||this.deserializeShapeAndStoreIfFound(s,e.lanes,i=>this.convertedElements.findLane(i))||this.deserializeShapeAndStoreIfFound(s,e.pools,i=>this.convertedElements.findPoolById(i))||this.parsingMessageCollector.warning(new Vs(s.bpmnElement));return e}deserializeShapeAndStoreIfFound(t,e,s){const i=this.deserializeShape(t,s);return i?(e.push(i),!0):!1}deserializeShape(t,e){const s=e(t.bpmnElement);if(s){const i=mt(t);(s instanceof ge||s instanceof oe&&s.callActivityKind===de.CALLING_PROCESS)&&!t.isExpanded&&s.markers.push(W.EXPAND);let o;F.isPoolOrLane(s.kind)&&(o=t.isHorizontal??!0);const a=t.BPMNLabel,r=this.deserializeLabel(a,t.id),l=new me(t.id,s,i,r,o);return js(l,t),l}}deserializeEdges(t){return P(t).map(e=>{const s=this.convertedElements.findSequenceFlow(e.bpmnElement)||this.convertedElements.findMessageFlow(e.bpmnElement)||this.convertedElements.findAssociationFlow(e.bpmnElement);if(!s){this.parsingMessageCollector.warning(new Ys(e.bpmnElement));return}const i=this.deserializeWaypoints(e.waypoint),o=this.deserializeLabel(e.BPMNLabel,e.id),a=e.messageVisibleKind?e.messageVisibleKind:fe.NONE,r=new zs(e.id,s,i,o,a);return Js(r,e),r}).filter(Boolean)}deserializeWaypoints(t){return P(t).map(e=>new Xs(e.x,e.y))}deserializeLabel(t,e){if(t&&typeof t=="object"){const s=this.findFont(t.labelStyle,e),i=mt(t),o=new qs(s,i);if("color"in t)return o.extensions.color=t.color,o;if(s||i)return o}}findFont(t,e){let s;return t&&(s=this.convertedFonts.get(t),s||this.parsingMessageCollector.warning(new Gs(e,t))),s}}function js(n,t){"background-color"in t?n.extensions.fillColor=t["background-color"]:"fill"in t&&(n.extensions.fillColor=t.fill),"border-color"in t?n.extensions.strokeColor=t["border-color"]:"stroke"in t&&(n.extensions.strokeColor=t.stroke)}function mt(n){const t=n.Bounds;if(t)return new Ks(t.x,t.y,t.width,t.height)}function Js(n,t){"border-color"in t?n.extensions.strokeColor=t["border-color"]:"stroke"in t&&(n.extensions.strokeColor=t.stroke)}const Qs=n=>"source"in n||"target"in n;class ei{constructor(t){this.convertedElements=t}deserialize(t){for(const e of kt){const s=t[e+"EventDefinition"];for(const i of P(s,!0))this.convertedElements.registerEventDefinitionsOfDefinition(i.id,{id:i.id,kind:e,...Qs(i)?{source:i.source,target:i.target}:{}})}}}class ti{constructor(t){this.convertedElements=t}deserialize(t){this.parseGlobalTasks(t.globalTask,C.GLOBAL_TASK),this.parseGlobalTasks(t.globalBusinessRuleTask,C.GLOBAL_TASK_BUSINESS_RULE),this.parseGlobalTasks(t.globalManualTask,C.GLOBAL_TASK_MANUAL),this.parseGlobalTasks(t.globalScriptTask,C.GLOBAL_TASK_SCRIPT),this.parseGlobalTasks(t.globalUserTask,C.GLOBAL_TASK_USER)}parseGlobalTasks(t,e){for(const s of P(t))this.convertedElements.registerGlobalTask(s.id,e)}}const ni=(n,t)=>{switch(n){case"adHocSubProcess":return ee.AD_HOC;case"transaction":return ee.TRANSACTION;default:return t.triggeredByEvent?ee.EVENT:ee.EMBEDDED}},si=["adHocSubProcess","transaction",...F.flowNodeKinds().filter(n=>n!==C.EVENT_BOUNDARY),C.EVENT_BOUNDARY];function ii(n){return["adHocSubProcess","transaction"].includes(n)?C.SUB_PROCESS:n}class oi{constructor(t,e){y(this,"defaultSequenceFlowIds",[]);y(this,"elementsWithoutParentByProcessId",new Map);y(this,"callActivitiesCallingProcess",new Map);y(this,"eventsByLinkEventDefinition",new Map);this.convertedElements=t,this.parsingMessageCollector=e}deserialize(t){for(const e of P(t))this.parseProcess(e);for(const e of P(t))this.assignParentOfProcessElementsCalledByCallActivity(e.id);this.assignIncomingAndOutgoingIdsFromFlows(),this.assignSourceAndTargetIdsToLinkEvents()}assignParentOfProcessElementsCalledByCallActivity(t){const e=this.callActivitiesCallingProcess.get(t);if(e){const s=this.convertedElements.findPoolByProcessRef(t);s&&(s.parentId=e.id);for(const i of this.elementsWithoutParentByProcessId.get(t))i.parentId=e.id}}assignIncomingAndOutgoingIdsFromFlows(){const t=(e,s,i)=>{const o=this.convertedElements.findFlowNode(e)??this.convertedElements.findLane(e)??this.convertedElements.findPoolById(e);o&&!o[s].includes(i)&&o[s].push(i)};for(const e of this.convertedElements.getFlows())t(e.sourceReferenceId,"outgoingIds",e.id),t(e.targetReferenceId,"incomingIds",e.id)}assignSourceAndTargetIdsToLinkEvents(){var e;const t=[...this.eventsByLinkEventDefinition.entries()].filter(([s])=>s.id);for(const[s,i]of this.eventsByLinkEventDefinition)if(i instanceof ze){const o=t.find(([a])=>s.target===a.id);i.targetId=(e=o==null?void 0:o[1])==null?void 0:e.id}else i instanceof Ke&&(i.sourceIds=t.filter(([o])=>Array.isArray(s.source)?s.source.includes(o.id):s.source===o.id).map(([,o])=>o.id))}parseProcess(t){const e=t.id,s=this.convertedElements.findPoolByProcessRef(e);s&&!s.name&&this.convertedElements.registerPool(new J(s.id,t.name,C.POOL),e),this.buildProcessInnerElements(t,s==null?void 0:s.id)}buildProcessInnerElements(t,e){this.elementsWithoutParentByProcessId.set(t.id,[]);for(const s of si)this.buildFlowNodeBpmnElements(t[s],ii(s),e,t.id,s);this.buildLaneSetBpmnElements(t.laneSet,e,t.id),this.buildSequenceFlows(t.sequenceFlow),Zt(this.convertedElements,t.association)}buildFlowNodeBpmnElements(t,e,s,i,o){for(const a of P(t)){const r=this.buildFlowNodeBpmnElement(e,a,s,o);"default"in a&&F.isWithDefaultSequenceFlow(e)&&this.defaultSequenceFlowIds.push(a.default),r&&(this.convertedElements.registerFlowNode(r),s||this.elementsWithoutParentByProcessId.get(i).push(r))}}buildFlowNodeBpmnElement(t,e,s,i){if(F.isEvent(t))return this.buildShapeBpmnEvent(e,t,s);if(F.isActivity(t))return this.buildShapeBpmnActivity(e,t,s,i);if(t==C.GATEWAY_EVENT_BASED){const o=e;return new Dt(o.id,o.name,s,o.instantiate,he[o.eventGatewayType])}else{if(t==C.GROUP)return $t(this.convertedElements,this.parsingMessageCollector,e,s);{const o=t===C.TEXT_ANNOTATION?e.text:e.name;return new J(e.id,o,t,s,e.instantiate)}}}buildShapeBpmnActivity(t,e,s,i){const o=ri(t);return F.isSubProcess(e)?this.buildShapeBpmnSubProcess(t,s,ni(i,t),o):F.isCallActivity(e)?this.buildShapeBpmnCallActivity(t,s,o):new Oe(t.id,t.name,e,s,t.instantiate,o)}buildShapeBpmnCallActivity(t,e,s){const i=this.convertedElements.findGlobalTask(t.calledElement);if(!i){const o=new oe(t.id,t.name,de.CALLING_PROCESS,e,s);return this.callActivitiesCallingProcess.set(t.calledElement,o),o}return new oe(t.id,t.name,de.CALLING_GLOBAL_TASK,e,s,i)}buildShapeBpmnEvent(t,e,s){const i=this.getEventDefinitions(t),o=[...i.entries()].map(([,a])=>a.length).reduce((a,r)=>a+r,0);if(o==0&&F.canHaveNoneEvent(e))return new se(t.id,t.name,e,H.NONE,s);if(o==1){const[a,r]=[...i.entries()][0],l=F.isCatchEvent(e)?this.buildShapeBpmnCatchEvent(t,e,a,s):this.buildShapeBpmnThrowEvent(t,e,a,s);return a===H.LINK&&(r[0].id||r[0].target||r[0].source)&&this.eventsByLinkEventDefinition.set(r[0],l),l}}buildShapeBpmnCatchEvent(t,e,s,i){return F.isBoundaryEvent(e)?this.buildShapeBpmnBoundaryEvent(t,s):F.isStartEvent(e)?new Yt(t.id,t.name,s,i,t.isInterrupting):new Ke(t.id,t.name,s,i)}buildShapeBpmnThrowEvent(t,e,s,i){return F.isIntermediateThrowEvent(e)?new ze(t.id,t.name,s,i):new se(t.id,t.name,e,s,i)}buildShapeBpmnBoundaryEvent(t,e){const s=this.convertedElements.findFlowNode(t.attachedToRef);if(F.isActivity(s==null?void 0:s.kind))return new Gt(t.id,t.name,e,t.attachedToRef,t.cancelActivity);this.parsingMessageCollector.warning(new Us(t.id,t.attachedToRef,s==null?void 0:s.kind))}getEventDefinitions(t){const e=new Map;for(const s of kt){const i=t[`${s}EventDefinition`];e.set(s,P(i,!0))}for(const s of P(t.eventDefinitionRef)){const i=this.convertedElements.findEventDefinitionOfDefinition(s);i&&e.get(i.kind).push(i)}for(const[s]of[...e.entries()].filter(([,i])=>i.length===0))e.delete(s);return e}buildShapeBpmnSubProcess(t,e,s,i){const o=new ge(t.id,t.name,s,e,i);return this.buildProcessInnerElements(t,t.id),o}buildLaneSetBpmnElements(t,e,s){for(const i of P(t))this.buildLaneBpmnElements(i.lane,e,s)}buildLaneBpmnElements(t,e,s){var i;for(const o of P(t)){const a=new J(o.id,o.name,C.LANE,e);this.convertedElements.registerLane(a),e||this.elementsWithoutParentByProcessId.get(s).push(a),this.assignParentOfLaneFlowNodes(o),(i=o.childLaneSet)!=null&&i.lane&&this.buildLaneBpmnElements(o.childLaneSet.lane,o.id,s)}}assignParentOfLaneFlowNodes(t){for(const e of P(t.flowNodeRef)){const s=this.convertedElements.findFlowNode(e),i=t.id;s?F.isBoundaryEvent(s.kind)||(s.parentId=i):this.parsingMessageCollector.warning(new Ds(i,e))}}buildSequenceFlows(t){for(const e of P(t)){const s=this.getSequenceFlowKind(e);this.convertedElements.registerSequenceFlow(new Bt(e.id,e.name,e.sourceRef,e.targetRef,s))}}getSequenceFlowKind(t){if(this.defaultSequenceFlowIds.includes(t.id))return Q.DEFAULT;{const e=this.convertedElements.findFlowNode(t.sourceRef);if(e&&F.isWithDefaultSequenceFlow(e.kind)&&t.conditionExpression)return F.isActivity(e.kind)?Q.CONDITIONAL_FROM_ACTIVITY:Q.CONDITIONAL_FROM_GATEWAY}return Q.NORMAL}}const ri=n=>{const t=[],e=n.standardLoopCharacteristics,s=P(n.multiInstanceLoopCharacteristics,!0)[0];return e!==void 0?t.push(W.LOOP):s&&t.push(s.isSequential?W.MULTI_INSTANCE_SEQUENTIAL:W.MULTI_INSTANCE_PARALLEL),t};class li{constructor(t,e,s,i,o,a){this.categoryConverter=t,this.collaborationConverter=e,this.eventDefinitionConverter=s,this.globalTaskConverter=i,this.processConverter=o,this.diagramConverter=a}parse(t){const e=t.definitions;return this.categoryConverter.deserialize(e),this.collaborationConverter.deserialize(e.collaboration),this.eventDefinitionConverter.deserialize(e),this.globalTaskConverter.deserialize(e),this.processConverter.deserialize(e.process),this.diagramConverter.deserialize(e.BPMNDiagram)}}function ai(n){const t=new Ws;return new li(new ks(t),new Hs(t,n),new ei(t),new ti(t),new oi(t,n),new Zs(t,n))}var we={},Re={},Ct;function it(){return Ct||(Ct=1,function(n){const t=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",e=t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",s="["+t+"]["+e+"]*",i=new RegExp("^"+s+"$"),o=function(r,l){const c=[];let f=l.exec(r);for(;f;){const T=[];T.startIndex=l.lastIndex-f[0].length;const p=f.length;for(let S=0;S"u")};n.isExist=function(r){return typeof r<"u"},n.isEmptyObject=function(r){return Object.keys(r).length===0},n.merge=function(r,l,c){if(l){const f=Object.keys(l),T=f.length;for(let p=0;p"&&d[g]!==" "&&d[g]!==" "&&d[g]!==` -`&&d[g]!=="\r";g++)I+=d[g];if(I=I.trim(),I[I.length-1]==="/"&&(I=I.substring(0,I.length-1),g--),!O(I)){let _;return I.trim().length===0?_="Invalid space after '<'.":_="Tag '"+I+"' is an invalid name.",p("InvalidTag",_,L(d,g))}const N=r(d,g);if(N===!1)return p("InvalidAttr","Attributes for '"+I+"' have open quote.",L(d,g));let b=N.value;if(g=N.index,b[b.length-1]==="/"){const _=g-b.length;b=b.substring(0,b.length-1);const A=c(b,E);if(A===!0)B=!0;else return p(A.err.code,A.err.msg,L(d,_+A.err.line))}else if(w)if(N.tagClosed){if(b.trim().length>0)return p("InvalidTag","Closing tag '"+I+"' can't have attributes or invalid starting.",L(d,m));if(v.length===0)return p("InvalidTag","Closing tag '"+I+"' has not been opened.",L(d,m));{const _=v.pop();if(I!==_.tagName){let A=L(d,_.tagStartPos);return p("InvalidTag","Expected closing tag '"+_.tagName+"' (opened in line "+A.line+", col "+A.col+") instead of closing tag '"+I+"'.",L(d,m))}v.length==0&&(h=!0)}}else return p("InvalidTag","Closing tag '"+I+"' doesn't have proper closing.",L(d,g));else{const _=c(b,E);if(_!==!0)return p(_.err.code,_.err.msg,L(d,g-b.length+_.err.line));if(h===!0)return p("InvalidXml","Multiple possible root nodes found.",L(d,g));E.unpairedTags.indexOf(I)!==-1||v.push({tagName:I,tagStartPos:m}),B=!0}for(g++;g0)return p("InvalidXml","Invalid '"+JSON.stringify(v.map(g=>g.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return p("InvalidXml","Start tag expected.",1);return!0};function e(d){return d===" "||d===" "||d===` -`||d==="\r"}function s(d,E){const v=E;for(;E5&&B==="xml")return p("InvalidXml","XML declaration allowed only at the start of the document.",L(d,E));if(d[E]=="?"&&d[E+1]==">"){E++;break}else continue}return E}function i(d,E){if(d.length>E+5&&d[E+1]==="-"&&d[E+2]==="-"){for(E+=3;E"){E+=2;break}}else if(d.length>E+8&&d[E+1]==="D"&&d[E+2]==="O"&&d[E+3]==="C"&&d[E+4]==="T"&&d[E+5]==="Y"&&d[E+6]==="P"&&d[E+7]==="E"){let v=1;for(E+=8;E"&&(v--,v===0))break}else if(d.length>E+9&&d[E+1]==="["&&d[E+2]==="C"&&d[E+3]==="D"&&d[E+4]==="A"&&d[E+5]==="T"&&d[E+6]==="A"&&d[E+7]==="["){for(E+=8;E"){E+=2;break}}return E}const o='"',a="'";function r(d,E){let v="",B="",h=!1;for(;E"&&B===""){h=!0;break}v+=d[E]}return B!==""?!1:{value:v,index:E,tagClosed:h}}const l=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function c(d,E){const v=n.getAllMatches(d,l),B={};for(let h=0;h!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,s,i){return e}},t=function(e){return Object.assign({},n,e)};return Se.buildOptions=t,Se.defaultOptions=n,Se}var be,Nt;function ui(){if(Nt)return be;Nt=1;class n{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,s){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:s})}addChild(e){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}}return be=n,be}var Fe,Ot;function di(){if(Ot)return Fe;Ot=1;const n=it();function t(l,c){const f={};if(l[c+3]==="O"&&l[c+4]==="C"&&l[c+5]==="T"&&l[c+6]==="Y"&&l[c+7]==="P"&&l[c+8]==="E"){c=c+9;let T=1,p=!1,S=!1,O="";for(;c"){if(S?l[c-1]==="-"&&l[c-2]==="-"&&(S=!1,T--):T--,T===0)break}else l[c]==="["?p=!0:O+=l[c];if(T!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:f,i:c}}function e(l,c){let f="";for(;c0&&c&&r[2]!==".")return o;if(!a.leadingZeros&&f.length>0&&!c&&r[1]!==".")return o;{const S=Number(r),O=""+S;return O.search(/[eE]/)!==-1||p?a.eNotation?S:o:r.indexOf(".")!==-1?O==="0"&&T===""||O===T||c&&O==="-"+T?S:o:f?T===O||c+T===O?S:o:r===O||r===c+O?S:o}}else return o}}function i(o){return o&&o.indexOf(".")!==-1&&(o=o.replace(/0+$/,""),o==="."?o="0":o[0]==="."?o="0"+o:o[o.length-1]==="."&&(o=o.substr(0,o.length-1))),o}return Pe=s,Pe}var xe,vt;function Jt(){if(vt)return xe;vt=1;function n(t){return typeof t=="function"?t:Array.isArray(t)?e=>{for(const s of t)if(typeof s=="string"&&e===s||s instanceof RegExp&&s.test(e))return!0}:()=>!1}return xe=n,xe}var ke,_t;function fi(){if(_t)return ke;_t=1;const n=it(),t=ui(),e=di(),s=hi(),i=Jt();class o{constructor(g){this.options=g,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(m,w)=>String.fromCharCode(Number.parseInt(w,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(m,w)=>String.fromCharCode(Number.parseInt(w,16))}},this.addExternalEntities=a,this.parseXml=T,this.parseTextData=r,this.resolveNameSpace=l,this.buildAttributesMap=f,this.isItStopNode=L,this.replaceEntitiesValue=S,this.readStopNodeData=v,this.saveTextToParentTag=O,this.addChild=p,this.ignoreAttributesFn=i(this.options.ignoreAttributes)}}function a(h){const g=Object.keys(h);for(let m=0;m0)){b||(h=this.replaceEntitiesValue(h));const _=this.options.tagValueProcessor(g,h,m,I,N);return _==null?h:typeof _!=typeof h||_!==h?_:this.options.trimValues?B(h,this.options.parseTagValue,this.options.numberParseOptions):h.trim()===h?B(h,this.options.parseTagValue,this.options.numberParseOptions):h}}function l(h){if(this.options.removeNSPrefix){const g=h.split(":"),m=h.charAt(0)==="/"?"/":"";if(g[0]==="xmlns")return"";g.length===2&&(h=m+g[1])}return h}const c=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function f(h,g,m){if(this.options.ignoreAttributes!==!0&&typeof h=="string"){const w=n.getAllMatches(h,c),I=w.length,N={};for(let b=0;b",N,"Closing Tag is not closed.");let A=h.substring(N+2,_).trim();if(this.options.removeNSPrefix){const X=A.indexOf(":");X!==-1&&(A=A.substr(X+1))}this.options.transformTagName&&(A=this.options.transformTagName(A)),m&&(w=this.saveTextToParentTag(w,m,I));const U=I.substring(I.lastIndexOf(".")+1);if(A&&this.options.unpairedTags.indexOf(A)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let k=0;U&&this.options.unpairedTags.indexOf(U)!==-1?(k=I.lastIndexOf(".",I.lastIndexOf(".")-1),this.tagsNodeStack.pop()):k=I.lastIndexOf("."),I=I.substring(0,k),m=this.tagsNodeStack.pop(),w="",N=_}else if(h[N+1]==="?"){let _=E(h,N,!1,"?>");if(!_)throw new Error("Pi Tag is not closed.");if(w=this.saveTextToParentTag(w,m,I),!(this.options.ignoreDeclaration&&_.tagName==="?xml"||this.options.ignorePiTags)){const A=new t(_.tagName);A.add(this.options.textNodeName,""),_.tagName!==_.tagExp&&_.attrExpPresent&&(A[":@"]=this.buildAttributesMap(_.tagExp,I,_.tagName)),this.addChild(m,A,I)}N=_.closeIndex+1}else if(h.substr(N+1,3)==="!--"){const _=d(h,"-->",N+4,"Comment is not closed.");if(this.options.commentPropName){const A=h.substring(N+4,_-2);w=this.saveTextToParentTag(w,m,I),m.add(this.options.commentPropName,[{[this.options.textNodeName]:A}])}N=_}else if(h.substr(N+1,2)==="!D"){const _=e(h,N);this.docTypeEntities=_.entities,N=_.i}else if(h.substr(N+1,2)==="!["){const _=d(h,"]]>",N,"CDATA is not closed.")-2,A=h.substring(N+9,_);w=this.saveTextToParentTag(w,m,I);let U=this.parseTextData(A,m.tagname,I,!0,!1,!0,!0);U==null&&(U=""),this.options.cdataPropName?m.add(this.options.cdataPropName,[{[this.options.textNodeName]:A}]):m.add(this.options.textNodeName,U),N=_+2}else{let _=E(h,N,this.options.removeNSPrefix),A=_.tagName;const U=_.rawTagName;let k=_.tagExp,X=_.attrExpPresent,at=_.closeIndex;this.options.transformTagName&&(A=this.options.transformTagName(A)),m&&w&&m.tagname!=="!xml"&&(w=this.saveTextToParentTag(w,m,I,!1));const ct=m;if(ct&&this.options.unpairedTags.indexOf(ct.tagname)!==-1&&(m=this.tagsNodeStack.pop(),I=I.substring(0,I.lastIndexOf("."))),A!==g.tagname&&(I+=I?"."+A:A),this.isItStopNode(this.options.stopNodes,I,A)){let z="";if(k.length>0&&k.lastIndexOf("/")===k.length-1)A[A.length-1]==="/"?(A=A.substr(0,A.length-1),I=I.substr(0,I.length-1),k=A):k=k.substr(0,k.length-1),N=_.closeIndex;else if(this.options.unpairedTags.indexOf(A)!==-1)N=_.closeIndex;else{const _e=this.readStopNodeData(h,U,at+1);if(!_e)throw new Error(`Unexpected end of ${U}`);N=_e.i,z=_e.tagContent}const ve=new t(A);A!==k&&X&&(ve[":@"]=this.buildAttributesMap(k,I,A)),z&&(z=this.parseTextData(z,A,I,!0,X,!0,!0)),I=I.substr(0,I.lastIndexOf(".")),ve.add(this.options.textNodeName,z),this.addChild(m,ve,I)}else{if(k.length>0&&k.lastIndexOf("/")===k.length-1){A[A.length-1]==="/"?(A=A.substr(0,A.length-1),I=I.substr(0,I.length-1),k=A):k=k.substr(0,k.length-1),this.options.transformTagName&&(A=this.options.transformTagName(A));const z=new t(A);A!==k&&X&&(z[":@"]=this.buildAttributesMap(k,I,A)),this.addChild(m,z,I),I=I.substr(0,I.lastIndexOf("."))}else{const z=new t(A);this.tagsNodeStack.push(m),A!==k&&X&&(z[":@"]=this.buildAttributesMap(k,I,A)),this.addChild(m,z,I),m=z}w="",N=at}}else w+=h[N];return g.child};function p(h,g,m){const w=this.options.updateTag(g.tagname,m,g[":@"]);w===!1||(typeof w=="string"&&(g.tagname=w),h.addChild(g))}const S=function(h){if(this.options.processEntities){for(let g in this.docTypeEntities){const m=this.docTypeEntities[g];h=h.replace(m.regx,m.val)}for(let g in this.lastEntities){const m=this.lastEntities[g];h=h.replace(m.regex,m.val)}if(this.options.htmlEntities)for(let g in this.htmlEntities){const m=this.htmlEntities[g];h=h.replace(m.regex,m.val)}h=h.replace(this.ampEntity.regex,this.ampEntity.val)}return h};function O(h,g,m,w){return h&&(w===void 0&&(w=Object.keys(g.child).length===0),h=this.parseTextData(h,g.tagname,m,!1,g[":@"]?Object.keys(g[":@"]).length!==0:!1,w),h!==void 0&&h!==""&&g.add(this.options.textNodeName,h),h=""),h}function L(h,g,m){const w="*."+m;for(const I in h){const N=h[I];if(w===N||g===N)return!0}return!1}function M(h,g,m=">"){let w,I="";for(let N=g;N",m,`${g} is not closed`);if(h.substring(m+2,N).trim()===g&&(I--,I===0))return{tagContent:h.substring(w,m),i:N};m=N}else if(h[m+1]==="?")m=d(h,"?>",m+1,"StopNode is not closed.");else if(h.substr(m+1,3)==="!--")m=d(h,"-->",m+3,"StopNode is not closed.");else if(h.substr(m+1,2)==="![")m=d(h,"]]>",m,"StopNode is not closed.")-2;else{const N=E(h,m,">");N&&((N&&N.tagName)===g&&N.tagExp[N.tagExp.length-1]!=="/"&&I++,m=N.closeIndex)}}function B(h,g,m){if(g&&typeof h=="string"){const w=h.trim();return w==="true"?!0:w==="false"?!1:s(h,m)}else return n.isExist(h)?h:""}return ke=o,ke}var Be={},yt;function gi(){if(yt)return Be;yt=1;function n(o,a){return t(o,a)}function t(o,a,r){let l;const c={};for(let f=0;f0&&(c[a.textNodeName]=l):l!==void 0&&(c[a.textNodeName]=l),c}function e(o){const a=Object.keys(o);for(let r=0;r0&&(c=n),e(r,l,"",c)}function e(r,l,c,f){let T="",p=!1;for(let S=0;S`,p=!1;continue}else if(L===l.commentPropName){T+=f+``,p=!0;continue}else if(L[0]==="?"){const h=i(O[":@"],l),g=L==="?xml"?"":f;let m=O[L][0][l.textNodeName];m=m.length!==0?" "+m:"",T+=g+`<${L}${m}${h}?>`,p=!0;continue}let d=f;d!==""&&(d+=l.indentBy);const E=i(O[":@"],l),v=f+`<${L}${E}`,B=e(O[L],l,M,d);l.unpairedTags.indexOf(L)!==-1?l.suppressUnpairedNode?T+=v+">":T+=v+"/>":(!B||B.length===0)&&l.suppressEmptyNode?T+=v+"/>":B&&B.endsWith(">")?T+=v+`>${B}${f}`:(T+=v+">",B&&f!==""&&(B.includes("/>")||B.includes("`),p=!0}return T}function s(r){const l=Object.keys(r);for(let c=0;c0&&l.processEntities)for(let c=0;c","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function s(r){this.options=Object.assign({},e,r),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=t(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=a),this.processTextOrObjNode=i,this.options.format?(this.indentate=o,this.tagEndChar=`> -`,this.newLine=` -`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}s.prototype.build=function(r){return this.options.preserveOrder?n(r,this.options):(Array.isArray(r)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(r={[this.options.arrayNodeName]:r}),this.j2x(r,0,[]).val)},s.prototype.j2x=function(r,l,c){let f="",T="";const p=c.join(".");for(let S in r)if(Object.prototype.hasOwnProperty.call(r,S))if(typeof r[S]>"u")this.isAttribute(S)&&(T+="");else if(r[S]===null)this.isAttribute(S)?T+="":S[0]==="?"?T+=this.indentate(l)+"<"+S+"?"+this.tagEndChar:T+=this.indentate(l)+"<"+S+"/"+this.tagEndChar;else if(r[S]instanceof Date)T+=this.buildTextValNode(r[S],S,"",l);else if(typeof r[S]!="object"){const O=this.isAttribute(S);if(O&&!this.ignoreAttributesFn(O,p))f+=this.buildAttrPairStr(O,""+r[S]);else if(!O)if(S===this.options.textNodeName){let L=this.options.tagValueProcessor(S,""+r[S]);T+=this.replaceEntitiesValue(L)}else T+=this.buildTextValNode(r[S],S,"",l)}else if(Array.isArray(r[S])){const O=r[S].length;let L="",M="";for(let d=0;d"u"))if(E===null)S[0]==="?"?T+=this.indentate(l)+"<"+S+"?"+this.tagEndChar:T+=this.indentate(l)+"<"+S+"/"+this.tagEndChar;else if(typeof E=="object")if(this.options.oneListGroup){const v=this.j2x(E,l+1,c.concat(S));L+=v.val,this.options.attributesGroupName&&E.hasOwnProperty(this.options.attributesGroupName)&&(M+=v.attrStr)}else L+=this.processTextOrObjNode(E,S,l,c);else if(this.options.oneListGroup){let v=this.options.tagValueProcessor(S,E);v=this.replaceEntitiesValue(v),L+=v}else L+=this.buildTextValNode(E,S,"",l)}this.options.oneListGroup&&(L=this.buildObjectNode(L,S,M,l)),T+=L}else if(this.options.attributesGroupName&&S===this.options.attributesGroupName){const O=Object.keys(r[S]),L=O.length;for(let M=0;M"+r+T:this.options.commentPropName!==!1&&l===this.options.commentPropName&&p.length===0?this.indentate(f)+``+this.newLine:this.indentate(f)+"<"+l+c+p+this.tagEndChar+r+this.indentate(f)+T}},s.prototype.closeTag=function(r){let l="";return this.options.unpairedTags.indexOf(r)!==-1?this.options.suppressUnpairedNode||(l="/"):this.options.suppressEmptyNode?l="/":l=`>`+this.newLine;if(this.options.commentPropName!==!1&&l===this.options.commentPropName)return this.indentate(f)+``+this.newLine;if(l[0]==="?")return this.indentate(f)+"<"+l+c+"?"+this.tagEndChar;{let T=this.options.tagValueProcessor(l,r);return T=this.replaceEntitiesValue(T),T===""?this.indentate(f)+"<"+l+c+this.closeTag(l)+this.tagEndChar:this.indentate(f)+"<"+l+c+">"+T+"0&&this.options.processEntities)for(let l=0;l"},{regex:/&(lt|#60|#x3c|#x3C);/g,val:"<"},{regex:/&(quot|#34|#x22);/g,val:'"'}],Ii=new Set(["BPMNShape.Bounds","BPMNShape.BPMNLabel.Bounds","BPMNEdge.BPMNLabel.Bounds","BPMNEdge.waypoint"].map(n=>`definitions.BPMNDiagram.BPMNPlane.${n}`)),Ai=new Set(["x","y","width","height"]),Ni=(n,t)=>Ii.has(t)&&Ai.has(n);class Oi{constructor(t){y(this,"x2jOptions",{attributeNamePrefix:"",removeNSPrefix:!0,ignoreAttributes:!1,parseAttributeValue:!0,processEntities:!1,attributeValueProcessor:(t,e,s)=>Ni(t,s)?Number(e):this.processAttribute(e)});y(this,"xmlParser",new mi.XMLParser(this.x2jOptions));this.options=t}parse(t){let e;try{e=this.xmlParser.parse(t)}catch{throw new Error("XML parsing failed. Invalid BPMN source.")}if(!e.definitions)throw new Error("XML parsing failed. Unable to retrieve 'definitions' from the BPMN source.");return e}processAttribute(t){var e;for(const s of Ci)t=t.replace(s.regex,s.val);return(e=this.options)!=null&&e.additionalXmlAttributeProcessor&&(t=this.options.additionalXmlAttributeProcessor(t)),t}}class Li{constructor(t,e){this.jsonParser=t,this.xmlParser=e}parse(t){const e=this.xmlParser.parse(t);return this.jsonParser.parse(e)}}function vi(n){return new Li(ai(new Bs(n)),new Oi(n))}function _i(n){return new yi(n)}class yi{constructor(t){this.graph=t}updateAndRefreshCssClassesOfCell(t,e){this.updateAndRefreshCssClassesOfElement(t,e),this.updateAndRefreshCssClassesOfElement(et(t),e)}updateAndRefreshCssClassesOfElement(t,e){const s=this.graph.getModel(),i=s.getCell(t);if(!i)return;let o=i.getStyle();o=K(o,x.EXTRA_CSS_CLASSES,e.join(",")),s.setStyle(i,o)}}function wi(n){return new Ri(_i(n),new bi)}class Ri{constructor(t,e){this.cssClassesUpdater=t,this.cssClassesCache=e}clearCache(){this.cssClassesCache.clear()}addCssClasses(t,e){this.updateCssClasses(t,e,this.cssClassesCache.addClassNames)}removeCssClasses(t,e){this.updateCssClasses(t,e,this.cssClassesCache.removeClassNames)}removeAllCssClasses(t){if(t||t=="")for(const e of P(t)){const s=this.cssClassesCache.removeAllClassNames(e);this.updateCellIfChanged(s,e)}else{const e=this.cssClassesCache.getBpmnIds();this.cssClassesCache.clear();for(const s of e)this.updateCellIfChanged(!0,s)}}toggleCssClasses(t,e){this.updateCssClasses(t,e,this.cssClassesCache.toggleClassNames)}updateCssClasses(t,e,s){const i=P(e);for(const o of P(t))this.updateCellIfChanged(s(o,i),o)}updateCellIfChanged(t,e){if(t){const s=this.cssClassesCache.getClassNames(e);this.cssClassesUpdater.updateAndRefreshCssClassesOfCell(e,s)}}}class bi{constructor(){y(this,"classNamesByBpmnId",new Map);y(this,"clear",()=>{this.classNamesByBpmnId.clear()});y(this,"addClassNames",(t,e)=>this.updateClassNames(t,e,(s,i)=>s.add(i)));y(this,"removeClassNames",(t,e)=>this.updateClassNames(t,e,(s,i)=>s.delete(i)));y(this,"toggleClassNames",(t,e)=>(this.updateClassNames(t,e,(s,i)=>s.has(i)?s.delete(i):s.add(i)),e&&e.length>0))}getClassNames(t){return this.classNamesByBpmnId.has(t)?[...this.classNamesByBpmnId.get(t)]:[]}getBpmnIds(){return[...this.classNamesByBpmnId.keys()]}removeAllClassNames(t){const e=this.getOrInitializeClassNames(t),s=e.size;return e.clear(),e.sizeFi.get(n.position),xi=(n,t)=>{t&&(n.fill.color=t.color??n.fill.color,n.fill.opacity=t.opacity??n.fill.opacity)},ki=(n,t)=>{t&&(n.stroke.color=t.color??n.stroke.color,n.stroke.width=t.width??n.stroke.width)},Bi=(n,t)=>{t&&(n.font.color=t.color??n.font.color,n.font.size=t.size??n.font.size)},Mi=n=>{const t={fill:{color:R.DEFAULT_OVERLAY_FILL_COLOR.valueOf(),opacity:R.DEFAULT_OVERLAY_FILL_OPACITY.valueOf()},stroke:{color:R.DEFAULT_OVERLAY_STROKE_COLOR.valueOf(),width:R.DEFAULT_OVERLAY_STROKE_WIDTH.valueOf()},font:{color:R.DEFAULT_OVERLAY_FONT_COLOR.valueOf(),size:R.DEFAULT_OVERLAY_FONT_SIZE.valueOf()}},e=n.style,s={...t};return e&&(xi(s,e.fill),ki(s,e.stroke),Bi(s,e.font)),s};class Vi{convert(t){const e=Pi(t),s=Mi(t);return{position:e,style:s}}}function Yi(n){return new Gi(n,new Vi)}class Gi{constructor(t,e){this.graph=t,this.overlayConverter=e}addOverlays(t,e){const s=this.graph.getModel().getCell(t);if(s)for(const i of P(e)){const o=new Kt(i.label,this.overlayConverter.convert(i));this.graph.addCellOverlay(s,o)}}removeAllOverlays(t){const e=this.graph.getModel().getCell(t);e&&this.graph.removeCellOverlays(e)}}function Di(n){return new Ui(Yi(n))}class Ui{constructor(t){this.overlaysUpdater=t}addOverlays(t,e){this.overlaysUpdater.addOverlays(t,e)}removeAllOverlays(t){this.overlaysUpdater.removeAllOverlays(t)}}class Wi{element(t){return`svg > g > g > g[data-bpmn-id="${t}"]`}elementsOfKind(t){return`svg > g > g > g.${t}:not(.bpmn-label)`}}function Hi(n){return new Ki(n,new zi(n.getModel()))}const Pt=n=>{const t=P(n);return t.push(...t.map(e=>et(e))),t};class Ki{constructor(t,e){this.graph=t,this.styleManager=e}clear(){this.styleManager.clear()}updateStyle(t,e){if(!e)return;const s=this.graph.getModel(),i=Pt(t).map(o=>s.getCell(o)).filter(Boolean);i.length!==0&&this.graph.batchUpdate(()=>{for(const o of i){this.styleManager.ensureStyleIsStored(o);let a=o.getStyle();a=K(a,u.STYLE_OPACITY,e.opacity,Le),a=_n(a,e.stroke),a=yn(a,e.font),Fn(e)&&(a=bn(a,e.fill)),s.setStyle(o,a)}})}resetStyle(t){this.graph.batchUpdate(()=>{if(t||t=="")for(const e of Pt(t))this.styleManager.resetStyleIfIsStored(e);else this.styleManager.resetAllStyles()})}}const xt=x.EXTRA_CSS_CLASSES;class zi{constructor(t){y(this,"stylesCache",new Map);this.model=t}clear(){this.stylesCache.clear()}resetAllStyles(){for(const t of this.stylesCache.keys())this.resetStyle(t,this.stylesCache.get(t))}resetStyleIfIsStored(t){const e=this.stylesCache.get(t);e&&this.resetStyle(t,e)}resetStyle(t,e){const s=this.model.getCell(t),i=wn(s.getStyle(),xt,""),o=K(e,xt,i);this.model.setStyle(s,o),this.stylesCache.delete(t)}ensureStyleIsStored(t){const e=t.getId();this.stylesCache.has(e)||this.stylesCache.set(e,t.getStyle())}}function Xi(n){return new qi(Hi(n))}class qi{constructor(t){this.styleUpdater=t}clearCache(){this.styleUpdater.clear()}updateStyle(t,e){this.styleUpdater.updateStyle(t,e)}resetStyle(t){this.styleUpdater.resetStyle(t)}}function $i(n,t){return new Zi(n,new ji(t.container,new Wi),wi(t),Di(t),Xi(t))}class Zi{constructor(t,e,s,i,o){this.bpmnModelRegistry=t,this.htmlElementRegistry=e,this.cssClassesRegistry=s,this.overlaysRegistry=i,this.styleRegistry=o,this.bpmnModelRegistry.registerOnLoadCallback(()=>{this.cssClassesRegistry.clearCache(),this.styleRegistry.clearCache()})}getModelElementsByIds(t){return De(t).map(e=>this.bpmnModelRegistry.getBpmnSemantic(e)).filter(Boolean)}getElementsByIds(t){return this.getModelElementsByIds(t).map(e=>({bpmnSemantic:e,htmlElement:this.htmlElementRegistry.getBpmnHtmlElement(e.id)}))}getModelElementsByKinds(t){return De(t).flatMap(e=>this.htmlElementRegistry.getBpmnHtmlElements(e)).map(e=>this.getRelatedBpmnSemantic(e))}getElementsByKinds(t){return De(t).flatMap(e=>this.htmlElementRegistry.getBpmnHtmlElements(e)).map(e=>({htmlElement:e,bpmnSemantic:this.getRelatedBpmnSemantic(e)}))}getRelatedBpmnSemantic(t){return this.bpmnModelRegistry.getBpmnSemantic(t.dataset.bpmnId)}addCssClasses(t,e){this.cssClassesRegistry.addCssClasses(t,e)}removeCssClasses(t,e){this.cssClassesRegistry.removeCssClasses(t,e)}removeAllCssClasses(t){this.cssClassesRegistry.removeAllCssClasses(t)}toggleCssClasses(t,e){this.cssClassesRegistry.toggleCssClasses(t,e)}addOverlays(t,e){this.overlaysRegistry.addOverlays(t,e)}removeAllOverlays(t){this.overlaysRegistry.removeAllOverlays(t)}updateStyle(t,e){this.styleRegistry.updateStyle(t,e)}resetStyle(t){this.styleRegistry.resetStyle(t)}}class ji{constructor(t,e){this.container=t,this.querySelectors=e}getBpmnHtmlElement(t){return this.container.querySelector(this.querySelectors.element(t))}getBpmnHtmlElements(t){const e=this.querySelectors.elementsOfKind(Xe(t));return[...this.container.querySelectorAll(e)]}}const De=n=>[...new Set(P(n))];class Ji{filter(t,e){const s=[],i=[];for(const S of P(e==null?void 0:e.pools).filter(O=>O&&Object.keys(O).length>0))S.id?s.push(S.id):S.name&&i.push(S.name);if(s.length===0&&i.length===0)return t;const{filteredPools:o,filteredPoolIds:a}=Qi(t,s,i),r=[...s,...a],{filteredLanes:l,filteredLaneIds:c,filteredFlowNodes:f,filteredFlowNodeIds:T}=Qt(t.lanes,t.flowNodes,r),p=to(t.edges,[...r,...c,...T]);if(o.length===0&&l.length===0&&f.length===0&&p.length===0){let S=s.length>0?` for ids [${s}]`:"";const O=S?" and":"";throw S+=i.length>0?`${O} for names [${i}]`:"",new Error("No matching pools"+S)}return{lanes:l,flowNodes:f,pools:o,edges:p}}}function Qi(n,t,e){const s=n.pools.filter(o=>t.includes(o.bpmnElement.id)||e.includes(o.bpmnElement.name)),i=s.map(o=>o.bpmnElement.id);return{filteredPools:s,filteredPoolIds:i}}function Qt(n,t,e){const{filteredLanes:s,filteredLaneIds:i}=en(n,e),{filteredLanes:o,filteredLaneIds:a,filteredFlowNodes:r,filteredFlowNodeIds:l}=eo(t,[...e,...i],n);return s.push(...o),i.push(...a),{filteredLanes:s,filteredLaneIds:i,filteredFlowNodes:r,filteredFlowNodeIds:l}}function en(n,t){const e=n.filter(i=>t.includes(i.bpmnElement.parentId)),s=e.map(i=>i.bpmnElement.id);if(e.length>0){const{filteredLanes:i,filteredLaneIds:o}=en(n,s);e.push(...i),s.push(...o)}return{filteredLanes:e,filteredLaneIds:s}}function eo(n,t,e){const s=n.filter(c=>t.includes(c.bpmnElement.parentId));if(s.length===0)return{filteredLanes:[],filteredLaneIds:[],filteredFlowNodes:[],filteredFlowNodeIds:[]};const i=s.map(c=>c.bpmnElement.id),{filteredLanes:o,filteredLaneIds:a,filteredFlowNodes:r,filteredFlowNodeIds:l}=Qt(e,n,i);return s.push(...r),i.push(...l),{filteredLanes:o,filteredLaneIds:a,filteredFlowNodes:s,filteredFlowNodeIds:i}}function to(n,t){return n.filter(e=>t.includes(e.bpmnElement.sourceReferenceId)&&t.includes(e.bpmnElement.targetReferenceId))}class no{constructor(){y(this,"searchableModel");y(this,"onLoadCallback")}load(t,e){var i;const s=new Ji().filter(t,e);return this.searchableModel=new io(s),(i=this.onLoadCallback)==null||i.call(this),so(s)}registerOnLoadCallback(t){this.onLoadCallback=t}getBpmnSemantic(t){var o;const e=(o=this.searchableModel)==null?void 0:o.elementById(t);if(!e)return;const s=e.bpmnElement,i=s instanceof J;return{id:t,isShape:i,kind:s.kind,name:s.name,...s instanceof Ne?{sourceRefId:s.sourceReferenceId,targetRefId:s.targetReferenceId}:{callActivityGlobalTaskKind:s instanceof oe?s.globalTaskKind:void 0,callActivityKind:s instanceof oe?s.callActivityKind:void 0,eventDefinitionKind:s instanceof se?s.eventDefinitionKind:void 0,linkEventSourceIds:s instanceof Ke&&s.eventDefinitionKind==H.LINK?s.sourceIds:void 0,linkEventTargetId:s instanceof ze?s.targetId:void 0,incomingIds:s.incomingIds,outgoingIds:s.outgoingIds,parentId:s.parentId,subProcessKind:s instanceof ge?s.subProcessKind:void 0}}}}function so(n){const t=new Set(n.flowNodes.filter(o=>{const a=o.bpmnElement;return F.isSubProcess(a.kind)&&a.markers.includes(W.EXPAND)}).map(o=>o.bpmnElement.id)),e=[],s=[],i=[];for(const o of n.flowNodes){const a=o.bpmnElement.kind;F.isSubProcess(a)?e.push(o):F.isBoundaryEvent(a)?s.push(o):t.has(o.bpmnElement.parentId)||i.push(o)}return{boundaryEvents:s,edges:n.edges,lanes:n.lanes,otherFlowNodes:i,pools:n.pools,subprocesses:e}}class io{constructor(t){y(this,"elements",new Map);for(const e of[...t.pools,...t.lanes,...t.flowNodes,...t.edges])this.elements.set(e.bpmnElement.id,e)}elementById(t){return this.elements.get(t)}}class oo{constructor(t){y(this,"graph");y(this,"navigation");y(this,"bpmnElementsRegistry");y(this,"bpmnModelRegistry");y(this,"parserOptions");y(this,"rendererOptions");this.rendererOptions=t==null?void 0:t.renderer;const e=new Ps(gn(t==null?void 0:t.container));this.graph=e.configure(t),this.navigation=new xs(this.graph),this.bpmnModelRegistry=new no,this.bpmnElementsRegistry=$i(this.bpmnModelRegistry,this.graph),this.parserOptions=t==null?void 0:t.parser}load(t,e){const s=vi(this.parserOptions).parse(t),i=this.bpmnModelRegistry.load(s,e==null?void 0:e.modelFilter);Dn(this.graph,this.rendererOptions).render(i,e==null?void 0:e.fit)}}function _o(n){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(n,1):document.addEventListener("DOMContentLoaded",n)}function V(n,...t){ot("[DEMO]",n,...t)}function ot(n,t,...e){console.info(`${n} ${t}`,...e)}function q(n,...t){ot("[DEMO STARTUP]",n,...t)}function tn(n,t){nn(n),window.alert(n)}function nn(n){console.error("[DEMO]",n)}function le(n,...t){ot("[DEMO DOWNLOAD]",n,...t)}async function ro(n){V(`Fetching BPMN content from url ${n}`);const t=await fetch(n);if(!t.ok)throw new Error(`HTTP status ${t.status}`);return await t.text()}function sn(n,t,e){const s=document.createElement("a");t.startsWith("data:image/svg+xml")&&(e=encodeURIComponent(e),t+=","),s.setAttribute("href",t+e),s.setAttribute("download",n),s.style.display="none",document.body.append(s),s.click(),s.remove()}function lo(n){le("Start SVG download"),sn("diagram.svg","data:image/svg+xml",n),le("Download completed")}function ao(n){le("Start PNG download");const t=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),e=URL.createObjectURL(t),s=document.createElement("img");s.setAttribute("style","position: absolute; top: -9999px"),s.crossOrigin="anonymous",document.body.append(s);const i=document.createElement("canvas"),o=i.getContext("2d");s.addEventListener("load",function(){const a=new Image;i.width=s.naturalWidth,i.height=s.naturalHeight,a.crossOrigin="Anonymous",a.addEventListener("load",function(){o.drawImage(a,0,0),URL.revokeObjectURL(e);const r=i.toDataURL("image/png");s.remove(),sn("diagram.png","",r),le("Download completed")}),a.src=s.src}),s.src=e}class co{constructor(t,e,s,i){y(this,"document");y(this,"head");this.window=t,this.outerContainerId=e,this.containerToFade=s,this.dropCallback=i,this.document=t.document,this.head=document.head,this.initializeDragAndDrop()}initializeDragAndDrop(){this.containerToFade.classList.add("faded-container"),this.addDomElements(this.containerToFade),this.addStyle();const t=document.querySelector(`#${this.outerContainerId}`);this.preventDefaultsOnEvents(["dragover","drop"],this.window),this.preventDefaultsOnEvents(["dragover","dragleave","drop"],t),this.addEventsOnDropContainer(t,this.containerToFade),this.addEventsOnDocument(this.outerContainerId,this.containerToFade)}preventDefaults(t){t.preventDefault(),t.stopPropagation()}preventDefaultsOnEvents(t,e){for(const s of t)e.addEventListener(s,this.preventDefaults.bind(this),!1)}addDomElements(t){const e=this.document.createElement("p");e.textContent="open BPMN diagram";const s=this.document.createElement("div");s.classList.add("drop-here-text"),s.append(e);const i=this.document.createElement("div");i.id=this.outerContainerId,i.append(s),t.parentNode.prepend(i)}addStyle(){const t=` +var yt=Object.defineProperty;var wt=(n,t,e)=>t in n?yt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var g=(n,t,e)=>wt(n,typeof t!="symbol"?t+"":t,e);import{g as Rt,r as bt}from"./mxgraph.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function e(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(o){if(o.ep)return;o.ep=!0;const i=e(o);fetch(o.href,i)}})();var Q=(n=>(n.None="None",n.HorizontalVertical="HorizontalVertical",n.Horizontal="Horizontal",n.Vertical="Vertical",n.Center="Center",n))(Q||{}),Ft=(n=>(n.In="in",n.Out="out",n))(Ft||{});function Pt(n){return n instanceof HTMLElement?n:document.querySelector(`#${n}`)}var d=(n=>(n.LANE="lane",n.POOL="pool",n.CALL_ACTIVITY="callActivity",n.SUB_PROCESS="subProcess",n.TASK="task",n.TASK_USER="userTask",n.TASK_SERVICE="serviceTask",n.TASK_RECEIVE="receiveTask",n.TASK_SEND="sendTask",n.TASK_MANUAL="manualTask",n.TASK_SCRIPT="scriptTask",n.TASK_BUSINESS_RULE="businessRuleTask",n.GLOBAL_TASK="globalTask",n.GLOBAL_TASK_USER="globalUserTask",n.GLOBAL_TASK_MANUAL="globalManualTask",n.GLOBAL_TASK_SCRIPT="globalScriptTask",n.GLOBAL_TASK_BUSINESS_RULE="globalBusinessRuleTask",n.GROUP="group",n.TEXT_ANNOTATION="textAnnotation",n.GATEWAY_PARALLEL="parallelGateway",n.GATEWAY_EXCLUSIVE="exclusiveGateway",n.GATEWAY_INCLUSIVE="inclusiveGateway",n.GATEWAY_EVENT_BASED="eventBasedGateway",n.GATEWAY_COMPLEX="complexGateway",n.EVENT_START="startEvent",n.EVENT_END="endEvent",n.EVENT_INTERMEDIATE_CATCH="intermediateCatchEvent",n.EVENT_INTERMEDIATE_THROW="intermediateThrowEvent",n.EVENT_BOUNDARY="boundaryEvent",n))(d||{}),J=(n=>(n.CALLING_PROCESS="process",n.CALLING_GLOBAL_TASK="global task",n))(J||{}),ee=(n=>(n.Exclusive="Exclusive",n.None="None",n.Parallel="Parallel",n))(ee||{}),y=(n=>(n.NONE="none",n.TERMINATE="terminate",n.CANCEL="cancel",n.COMPENSATION="compensate",n.CONDITIONAL="conditional",n.ERROR="error",n.ESCALATION="escalation",n.LINK="link",n.MESSAGE="message",n.SIGNAL="signal",n.TIMER="timer",n))(y||{}),_=(n=>(n.ADHOC="adhoc",n.COMPENSATION="compensation",n.EXPAND="expand",n.LOOP="loop",n.MULTI_INSTANCE_PARALLEL="multi-parallel",n.MULTI_INSTANCE_SEQUENTIAL="multi-sequential",n))(_||{}),Y=(n=>(n.AD_HOC="adhoc",n.EMBEDDED="embedded",n.EVENT="event",n.TRANSACTION="transaction",n))(Y||{});function kt(n,t){return n===""?t?{}:void 0:n}function S(n,t=!1){return n==null?[]:(Array.isArray(n)?n:[n]).map(e=>kt(e,t)).filter(Boolean)}function Bt(n,t,e){const s=[];e!=null&&e.startingWith?s.push(`^(${e.startingWith}).*`):e!=null&&e.notStartingWith&&s.push(`^(?!(${e.notStartingWith})).*`),s.push(`${t}$`);const o=s.join("");return n.filter(i=>e!=null&&e.ignoreCase?new RegExp(o,"i").test(i):new RegExp(o).test(i))}class E{static isEvent(t){return oe(xe,t)}static eventKinds(){return[...xe]}static isBoundaryEvent(t){return d.EVENT_BOUNDARY===t}static isStartEvent(t){return d.EVENT_START===t}static isCatchEvent(t){return d.EVENT_INTERMEDIATE_CATCH===t||d.EVENT_BOUNDARY===t||d.EVENT_START===t}static isIntermediateCatchEvent(t){return d.EVENT_INTERMEDIATE_CATCH===t}static isIntermediateThrowEvent(t){return d.EVENT_INTERMEDIATE_THROW===t}static isCallActivity(t){return d.CALL_ACTIVITY===t}static isSubProcess(t){return d.SUB_PROCESS===t}static canHaveNoneEvent(t){return d.EVENT_INTERMEDIATE_THROW===t||d.EVENT_END===t||d.EVENT_START===t}static isActivity(t){return oe(pe,t)}static activityKinds(){return[...pe]}static isWithDefaultSequenceFlow(t){return Mt.has(t)}static isTask(t){return oe(Te,t)}static taskKinds(){return[...Te]}static gatewayKinds(){return[...Ye]}static isGateway(t){return oe(Ye,t)}static flowNodeKinds(){return Object.values(d).filter(t=>!E.isPoolOrLane(t))}static isPoolOrLane(t){return t==d.POOL||t==d.LANE}}function Ne(n,t){return Bt(Object.values(d),n,t)}function oe(n,t){return Object.values(n).map(e=>e).includes(t)}const xe=Ne("Event"),Ye=Ne("Gateway"),Te=Ne("Task",{ignoreCase:!0,notStartingWith:"global"}),pe=[...Te,d.CALL_ACTIVITY,d.SUB_PROCESS],Mt=new Set([...pe,d.GATEWAY_EXCLUSIVE,d.GATEWAY_INCLUSIVE,d.GATEWAY_COMPLEX]),Je=Object.values(y).filter(n=>n!=y.NONE);var K=(n=>(n.NONE="None",n.ONE="One",n.BOTH="Both",n))(K||{}),k=(n=>(n.SEQUENCE_FLOW="sequenceFlow",n.MESSAGE_FLOW="messageFlow",n.ASSOCIATION_FLOW="association",n))(k||{}),te=(n=>(n.NONE="none",n.INITIATING="initiating",n.NON_INITIATING="non_initiating",n))(te||{}),x=(n=>(n.NORMAL="normal",n.DEFAULT="default",n.CONDITIONAL_FROM_ACTIVITY="conditional_from_activity",n.CONDITIONAL_FROM_GATEWAY="conditional_from_gateway",n))(x||{});class ue{constructor(t,e,s,o,i){this.id=t,this.name=e,this.kind=s,this.sourceReferenceId=o,this.targetReferenceId=i}}class et extends ue{constructor(t,e,s,o,i=x.NORMAL){super(t,e,k.SEQUENCE_FLOW,s,o),this.sequenceFlowKind=i}}class tt extends ue{constructor(t,e,s,o){super(t,e,k.MESSAGE_FLOW,s,o)}}class nt extends ue{constructor(t,e,s,o,i=K.NONE){super(t,e,k.ASSOCIATION_FLOW,s,o),this.associationDirectionKind=i}}var xt=bt();const Yt=Rt(xt),L=Dt(),Gt=L.mxCellRenderer,Vt=L.mxClient,c=L.mxConstants,G=L.mxEvent,Ge=L.mxPerimeter,P=L.mxPoint,Ee=L.mxRectangle,_e=L.mxRectangleShape,ye=L.mxSvgCanvas2D,v=L.mxUtils;function Dt(){return window.mxForceIncludes=!1,window.mxLoadResources=!1,window.mxLoadStylesheets=!1,window.mxResourceExtension=".txt",Yt({})}class Ut{constructor(t){this.graph=t}computeRelativeCoordinates(t,e){const s=this.getTranslateForRoot(t),o=e.x+s.x,i=e.y+s.y;return new P(o,i)}getTranslateForRoot(t){const e=this.graph.getModel(),s=new P(0,0);for(;t!=null;){const o=e.getGeometry(t);o!=null&&(s.x-=o.x,s.y-=o.y),t=e.getParent(t)}return s}computeEdgeCenter(t){const e=t.geometry.points,s=e[0],o=e.at(-1),i=o.x-s.x,r=o.y-s.y;return new P(s.x+i/2,s.y+r/2)}}class re{constructor(t,e,s,o,i){g(this,"extensions",{});this.id=t,this.bpmnElement=e,this.bounds=s,this.label=o,this.isHorizontal=i}}class M{constructor(t,e,s,o,i=!1){g(this,"incomingIds",[]);g(this,"outgoingIds",[]);this.id=t,this.name=e,this.kind=s,this.parentId=o,this.instantiate=i}}class de extends M{constructor(t,e,s,o,i,r=[]){super(t,e,s,o,i),this.markers=r}}class H extends de{constructor(t,e,s,o,i,r){super(t,e,d.CALL_ACTIVITY,o,void 0,i),this.callActivityKind=s,this.globalTaskKind=r}}class ne extends de{constructor(t,e,s,o,i){s==Y.AD_HOC&&!i.includes(_.ADHOC)&&i.push(_.ADHOC),super(t,e,d.SUB_PROCESS,o,void 0,i),this.subProcessKind=s}}class D extends M{constructor(t,e,s,o,i){super(t,e,s,i),this.eventDefinitionKind=o}}class Se extends D{constructor(e,s,o,i){super(e,s,d.EVENT_INTERMEDIATE_CATCH,o,i);g(this,"sourceIds",[])}}class Ie extends D{constructor(e,s,o,i){super(e,s,d.EVENT_INTERMEDIATE_THROW,o,i);g(this,"targetId")}}class st extends D{constructor(t,e,s,o,i){super(t,e,d.EVENT_START,s,o),this.isInterrupting=i}}class ot extends D{constructor(t,e,s,o,i=!0){super(t,e,d.EVENT_BOUNDARY,s,o),this.isInterrupting=i}}class it extends M{constructor(t,e,s,o,i=ee.None){super(t,e,d.GATEWAY_EVENT_BASED,s,o),this.gatewayKind=i}}function le(n,t,e,s){return Math.min(Math.max(n??s,t),e)}function Wt(n){return Math.max(n??0,0)}function Ht(n){const t=n??{};return t.debounceDelay=le(t.debounceDelay,0,100,50),t.throttleDelay=le(t.throttleDelay,0,100,50),t}function he(n){return n=="default"?void 0:le(n,0,100,100)}function Kt(n){return n=="default"?void 0:le(n,1,50,1)}const I={EDGE:"bpmn.edge",EDGE_START_FILL_COLOR:"bpmn.edge.startFillColor",EDGE_END_FILL_COLOR:"bpmn.edge.endFillColor",EVENT_BASED_GATEWAY_KIND:"bpmn.gatewayKind",EVENT_DEFINITION_KIND:"bpmn.eventDefinitionKind",GLOBAL_TASK_KIND:"bpmn.globalTaskKind",SUB_PROCESS_KIND:"bpmn.subProcessKind",IS_INITIATING:"bpmn.isInitiating",IS_INSTANTIATING:"bpmn.isInstantiating",IS_INTERRUPTING:"bpmn.isInterrupting",EXTRA_CSS_CLASSES:"bpmn.extra.css.classes",MARKERS:"bpmn.markers",MESSAGE_FLOW_ICON:"bpmn.messageFlowIcon"},rt={ARROW_DASH:"bpmn.dash"},T={STROKE_WIDTH_THIN:2,STROKE_WIDTH_THICK:5,SHAPE_ACTIVITY_BOTTOM_MARGIN:7,SHAPE_ACTIVITY_TOP_MARGIN:7,SHAPE_ACTIVITY_LEFT_MARGIN:7,SHAPE_ACTIVITY_MARKER_ICON_MARGIN:5,SHAPE_ACTIVITY_MARKER_ICON_SIZE:20,POOL_LABEL_SIZE:30,POOL_LABEL_FILL_COLOR:"none",LANE_LABEL_SIZE:30,LANE_LABEL_FILL_COLOR:"none",SUB_PROCESS_TRANSACTION_INNER_RECT_OFFSET:4,SUB_PROCESS_TRANSACTION_INNER_RECT_ARC_SIZE:6,TEXT_ANNOTATION_BORDER_LENGTH:10,TEXT_ANNOTATION_FILL_COLOR:"none",GROUP_FILL_COLOR:"none",DEFAULT_FILL_COLOR:"White",DEFAULT_STROKE_COLOR:"Black",DEFAULT_FONT_FAMILY:"Arial, Helvetica, sans-serif",DEFAULT_FONT_SIZE:11,DEFAULT_FONT_COLOR:"Black",DEFAULT_MARGIN:0,SHAPE_ARC_SIZE:20,DEFAULT_OVERLAY_FILL_COLOR:"White",DEFAULT_OVERLAY_FILL_OPACITY:100,DEFAULT_OVERLAY_STROKE_COLOR:"Black",DEFAULT_OVERLAY_STROKE_WIDTH:1,DEFAULT_OVERLAY_FONT_SIZE:11,DEFAULT_OVERLAY_FONT_COLOR:"Black",SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR:"White",MESSAGE_FLOW_MARKER_START_FILL_COLOR:"White",MESSAGE_FLOW_MARKER_END_FILL_COLOR:"White"},lt=n=>v.getValue(n,I.IS_INSTANTIATING,"false")=="true",ae=n=>n=="default"?void 0:n,zt=(n,t)=>(t&&(n=R(n,c.STYLE_STROKECOLOR,t.color,ae),n=R(n,c.STYLE_STROKE_OPACITY,t.opacity,he),n=R(n,c.STYLE_STROKEWIDTH,t.width,Kt)),n),R=(n,t,e,s=o=>o)=>e==null?n:v.setStyle(n,t,s(e)),ie=(n,t,e,s)=>s==null?n:v.setStyleFlag(n,t,e,s),Xt=(n,t)=>(t&&(n=R(n,c.STYLE_FONTCOLOR,t.color,ae),n=R(n,c.STYLE_FONTSIZE,t.size),n=R(n,c.STYLE_FONTFAMILY,t.family),n=ie(n,c.STYLE_FONTSTYLE,c.FONT_BOLD,t.isBold),n=ie(n,c.STYLE_FONTSTYLE,c.FONT_ITALIC,t.isItalic),n=ie(n,c.STYLE_FONTSTYLE,c.FONT_UNDERLINE,t.isUnderline),n=ie(n,c.STYLE_FONTSTYLE,c.FONT_STRIKETHROUGH,t.isStrikeThrough),n=R(n,c.STYLE_TEXT_OPACITY,t.opacity,he)),n),Zt=(n,t,e)=>(n==null?void 0:n.split(";").map(s=>s.split("=")).filter(([s])=>s===t).map(([,s])=>s)[0])??e,jt=n=>{switch(n){case"right-to-left":return c.DIRECTION_WEST;case"bottom-to-top":return c.DIRECTION_NORTH;case"top-to-bottom":return c.DIRECTION_SOUTH;default:return c.DIRECTION_EAST}},$t=(n,t)=>{const e=t.color;if(e){const s=Qt(e),o=s?e.startColor:e;n=R(n,c.STYLE_FILLCOLOR,o,ae),s?(n=v.setStyle(n,c.STYLE_GRADIENTCOLOR,e.endColor),n=v.setStyle(n,c.STYLE_GRADIENT_DIRECTION,jt(e.direction))):e==="default"&&(n=v.setStyle(n,c.STYLE_GRADIENTCOLOR,void 0),n=v.setStyle(n,c.STYLE_GRADIENT_DIRECTION,void 0)),(n.includes(d.POOL)||n.includes(d.LANE))&&(n=R(n,c.STYLE_SWIMLANE_FILLCOLOR,o,ae))}return n=R(n,c.STYLE_FILL_OPACITY,t.opacity,he),n},qt=n=>n&&typeof n=="object"&&"fill"in n,Qt=n=>n&&typeof n=="object";class Jt{constructor(t){g(this,"ignoreBpmnColors");this.ignoreBpmnColors=(t==null?void 0:t.ignoreBpmnColors)??!0}computeStyle(t,e){const s=[t.bpmnElement.kind];let o;t instanceof re?o=this.computeShapeStyleValues(t):(s.push(...nn(t)),o=this.computeEdgeStyleValues(t));const i=this.computeFontStyleValues(t),r=sn(t,e);return s.push(...Ve([...o,...i,...r])),s.join(";")}computeShapeStyleValues(t){const e=new Map,s=t.bpmnElement;if(s instanceof D?en(s,e):s instanceof de?tn(s,e):E.isPoolOrLane(s.kind)?e.set(c.STYLE_HORIZONTAL,t.isHorizontal?"0":"1"):s instanceof it&&(e.set(I.IS_INSTANTIATING,String(s.instantiate)),e.set(I.EVENT_BASED_GATEWAY_KIND,String(s.gatewayKind))),!this.ignoreBpmnColors){const o=t.extensions,i=o.fillColor;i&&(e.set(c.STYLE_FILLCOLOR,i),E.isPoolOrLane(s.kind)&&e.set(c.STYLE_SWIMLANE_FILLCOLOR,i)),o.strokeColor&&e.set(c.STYLE_STROKECOLOR,o.strokeColor)}return e}computeEdgeStyleValues(t){const e=new Map;if(!this.ignoreBpmnColors){const s=t.extensions;s.strokeColor&&e.set(c.STYLE_STROKECOLOR,s.strokeColor)}return e}computeFontStyleValues(t){var o,i;const e=new Map,s=(o=t.label)==null?void 0:o.font;if(s&&(e.set(c.STYLE_FONTFAMILY,s.name),e.set(c.STYLE_FONTSIZE,s.size),e.set(c.STYLE_FONTSTYLE,on(s))),!this.ignoreBpmnColors){const r=(i=t.label)==null?void 0:i.extensions;r!=null&&r.color&&e.set(c.STYLE_FONTCOLOR,r.color)}return e}computeMessageFlowIconStyle(t){const e=[];return e.push(["shape",I.MESSAGE_FLOW_ICON],[I.IS_INITIATING,String(t.messageVisibleKind===te.INITIATING)]),this.ignoreBpmnColors||t.extensions.strokeColor&&e.push([c.STYLE_STROKECOLOR,t.extensions.strokeColor]),Ve(e).join(";")}}function en(n,t){t.set(I.EVENT_DEFINITION_KIND,n.eventDefinitionKind),(n instanceof ot||n instanceof st&&n.isInterrupting!==void 0)&&t.set(I.IS_INTERRUPTING,String(n.isInterrupting))}function tn(n,t){n instanceof ne?t.set(I.SUB_PROCESS_KIND,n.subProcessKind):n.kind===d.TASK_RECEIVE?t.set(I.IS_INSTANTIATING,String(n.instantiate)):n instanceof H&&t.set(I.GLOBAL_TASK_KIND,n.globalTaskKind);const e=n.markers;e.length>0&&t.set(I.MARKERS,e.join(","))}function nn(n){const t=[],e=n.bpmnElement;return e instanceof et&&t.push(e.sequenceFlowKind),e instanceof nt&&t.push(e.associationDirectionKind),t}function sn(n,t){const e=new Map,s=n.bpmnElement;return t?(e.set(c.STYLE_VERTICAL_ALIGN,c.ALIGN_TOP),n.bpmnElement.kind!=d.TEXT_ANNOTATION&&e.set(c.STYLE_ALIGN,c.ALIGN_CENTER),n instanceof re&&(e.set(c.STYLE_LABEL_WIDTH,t.width+1),e.set(c.STYLE_LABEL_POSITION,"ignore"),e.set(c.STYLE_VERTICAL_LABEL_POSITION,c.ALIGN_MIDDLE))):n instanceof re&&(s instanceof ne||s instanceof H&&s.callActivityKind===J.CALLING_PROCESS)&&!s.markers.includes(_.EXPAND)&&e.set(c.STYLE_VERTICAL_ALIGN,c.ALIGN_TOP),e}function on(n){let t=0;return n.isBold&&(t+=c.FONT_BOLD),n.isItalic&&(t+=c.FONT_ITALIC),n.isStrikeThrough&&(t+=c.FONT_STRIKETHROUGH),n.isUnderline&&(t+=c.FONT_UNDERLINE),t}function Ve(n){return n.filter(([,t])=>t&&t!="undefined").map(([t,e])=>`${t}=${e}`)}class rn{constructor(t,e,s){this.graph=t,this.coordinatesTranslator=e,this.styleComputer=s}render(t,e){this.insertShapesAndEdges(t),this.graph.customFit(e)}insertShapesAndEdges({pools:t,lanes:e,subprocesses:s,otherFlowNodes:o,boundaryEvents:i,edges:r}){this.graph.batchUpdate(()=>{this.graph.getModel().clear(),this.insertShapes(t),this.insertShapes(e),this.insertShapes(s),this.insertShapes(o),this.insertShapes(i),this.insertEdges(r)})}insertShapes(t){for(const e of t)this.insertShape(e)}getParent(t){return this.getCell(t.parentId)??this.graph.getDefaultParent()}insertShape(t){var l;const e=t.bpmnElement,s=this.getParent(e),o=t.bounds;let i=(l=t.label)==null?void 0:l.bounds;i=E.isPoolOrLane(e.kind)?void 0:i;const r=this.styleComputer.computeStyle(t,i);this.insertVertex(s,e.id,e.name,o,i,r)}insertEdges(t){var e;for(const s of t){const o=s.bpmnElement,i=this.graph.getDefaultParent(),r=this.getCell(o.sourceReferenceId),l=this.getCell(o.targetReferenceId),a=(e=s.label)==null?void 0:e.bounds,h=this.styleComputer.computeStyle(s,a),u=this.graph.insertEdge(i,o.id,o.name,r,l,h);if(this.insertWaypoints(s.waypoints,u),a){u.geometry.width=a.width,u.geometry.height=a.height;const f=this.coordinatesTranslator.computeEdgeCenter(u);u.geometry.relative=!1;const p=this.coordinatesTranslator.computeRelativeCoordinates(u.parent,new P(a.x,a.y)),m=p.x+a.width/2-f.x,C=p.y-f.y;u.geometry.offset=new P(m,C)}this.insertMessageFlowIconIfNeeded(s,u)}}insertMessageFlowIconIfNeeded(t,e){if(t.bpmnElement instanceof tt&&t.messageVisibleKind!==te.NONE){const s=this.graph.insertVertex(e,we(e.id),void 0,0,0,20,14,this.styleComputer.computeMessageFlowIconStyle(t));s.geometry.relative=!0,s.geometry.offset=new P(-10,-7)}}insertWaypoints(t,e){t&&(e.geometry.points=t.map(s=>this.coordinatesTranslator.computeRelativeCoordinates(e.parent,new P(s.x,s.y))))}getCell(t){return this.graph.getModel().getCell(t)}insertVertex(t,e,s,o,i,r){const l=this.coordinatesTranslator.computeRelativeCoordinates(t,new P(o.x,o.y)),a=this.graph.insertVertex(t,e,s,l.x,l.y,o.width,o.height,r);if(i){const h=i.x-o.x,u=i.y-o.y;a.geometry.offset=new P(h,u)}return a}}function ln(n,t){return new rn(n,new Ut(n),new Jt(t))}function we(n){return`messageFlowIcon_of_${n}`}function at(n,t,{signal:e,edges:s}={}){let o,i=null;const r=s!=null&&s.includes("leading"),l=s==null||s.includes("trailing"),a=()=>{i!==null&&(n.apply(o,i),o=void 0,i=null)},h=()=>{l&&a(),m()};let u=null;const f=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,h()},t)},p=()=>{u!==null&&(clearTimeout(u),u=null)},m=()=>{p(),o=void 0,i=null},C=()=>{p(),a()},b=function(...j){if(e!=null&&e.aborted)return;o=this,i=j;const _t=u==null;f(),r&&_t&&a()};return b.schedule=f,b.cancel=m,b.flush=C,e==null||e.addEventListener("abort",m,{once:!0}),b}function an(n,t,{signal:e,edges:s=["leading","trailing"]}={}){let o=null;const i=at(n,t,{signal:e,edges:s}),r=function(...l){o==null?o=Date.now():Date.now()-o>=t&&(o=Date.now(),i.cancel(),i(...l)),i(...l)};return r.cancel=i.cancel,r.flush=i.flush,r}class ct extends L.mxCellOverlay{constructor(e,s){super(null,"",s.position.horizontalAlign,s.position.verticalAlign,null,"default");g(this,"style");this.label=e,this.style=s.style}getBounds(e){const s=e.view.graph.getModel().isEdge(e.cell),o=e.view.scale;let i;const r=0,l=0;return s?i=this.computeEdgeBounds(e):(i=new P,this.align==c.ALIGN_LEFT?i.x=e.x:this.align==c.ALIGN_CENTER?i.x=e.x+e.width/2:i.x=e.x+e.width,this.verticalAlign==c.ALIGN_TOP?i.y=e.y:this.verticalAlign==c.ALIGN_MIDDLE?i.y=e.y+e.height/2:i.y=e.y+e.height),new Ee(Math.round(i.x-(r*this.defaultOverlap-this.offset.x)*o),Math.round(i.y-(l*this.defaultOverlap-this.offset.y)*o),r*o,l*o)}computeEdgeBounds(e){const s=e.absolutePoints;if(this.align==c.ALIGN_LEFT)return s[0];if(this.align==c.ALIGN_CENTER){if(s.length%2==1)return s[Math.floor(s.length/2)];{const o=s.length/2,i=s[o-1],r=s[o];return new P(i.x+(r.x-i.x)/2,i.y+(r.y-i.y)/2)}}else return s.at(-1)}}class De extends L.mxText{constructor(t,e,s){super(t,e,void 0,void 0,s.font.color,void 0,s.font.size,void 0,void 0,void 0,void 0,void 0,void 0,void 0,s.fill.color,s.stroke.color),this.fillOpacity=s.fill.opacity,this.strokewidth=s.stroke.width}}function cn(n){return Object.values(k).map(t=>t).includes(n)}function un(n,t){return dn(n.style,t)}function dn(n,t){const e=[],s=n.split(";"),i=s[0].replace(/shape=bpmn./g,""),r=new Map;r.set("bpmn-type-activity",E.isActivity(i)),r.set("bpmn-type-container",E.isPoolOrLane(i)),r.set("bpmn-type-event",E.isEvent(i)),r.set("bpmn-type-flow",cn(i)),r.set("bpmn-type-gateway",E.isGateway(i)),r.set("bpmn-type-task",E.isTask(i));for(const[l]of[...r].filter(([,a])=>a))e.push(l);e.push(Ce(i));for(const[l,a]of s.map(h=>{const u=h.split("=");return[u[0],u[1]]}))switch(l){case I.EVENT_DEFINITION_KIND:{e.push(`bpmn-event-def-${a}`);break}case I.EVENT_BASED_GATEWAY_KIND:{e.push(`bpmn-gateway-kind-${a.toLowerCase()}`);break}case I.IS_INITIATING:{e.push(a=="true"?"bpmn-icon-initiating":"bpmn-icon-non-initiating");break}case I.SUB_PROCESS_KIND:{e.push(`bpmn-sub-process-${a.toLowerCase()}`);break}case I.GLOBAL_TASK_KIND:{e.push(Ce(a));break}}return t&&e.push("bpmn-label"),e}function Ce(n){return n?"bpmn-"+n.replace(/([A-Z])/g,t=>"-"+t[0].toLowerCase()):""}const Ue=function(n){const t=n.createSvgCanvas;n.createSvgCanvas=function(){var o;const e=t.bind(this)(),s=e.getTextCss;if(e.getTextCss=function(){const i=this.pointerEvents;this.pointerEvents=!1;const r=s.bind(this)();return this.pointerEvents=i,r},(o=this.state)!=null&&o.cell){const i=this.state.cell,r=un(i,this.dialect===c.DIALECT_STRICTHTML),l=this.state.style[I.EXTRA_CSS_CLASSES];typeof l=="string"&&r.push(...l.split(",")),this.node.setAttribute("class",r.join(" ")),this.node.dataset.bpmnId=this.state.cell.id}return e}};class hn extends L.mxCellRenderer{constructor(t){super(),this.iconPainter=t}createCellOverlays(t){const s=t.view.graph.getCellOverlays(t.cell);let o=null;if(s!=null){o=new L.mxDictionary;for(const i of s){const r=t.overlays==null?null:t.overlays.remove(i);if(r!=null){o.put(i,r);continue}let l;i instanceof ct?l=new De(i.label,new Ee(0,0,0,0),i.style):(l=new L.mxImageShape(new Ee(0,0,0,0),i.image.src),l.preserveImageAspect=!1),l.dialect=t.view.graph.dialect,l.overlay=i,this.initializeOverlay(t,l),this.installCellOverlayListeners(t,i,l),i.cursor!=null&&(l.node.style.cursor=i.cursor),l instanceof De&&(l.node.classList.add("overlay-badge"),l.node.dataset.bpmnId=t.cell.id),o.put(i,l)}}t.overlays!=null&&t.overlays.visit(function(i,r){r.destroy()}),t.overlays=o}createShape(t){const e=super.createShape(t);return"iconPainter"in e&&(e.iconPainter=this.iconPainter),Ue(e),e}createLabel(t,e){super.createLabel(t,e),Ue(t.text)}}function fn(n,t,e,s){let o,i;n.heightm.setIconOriginForIconCentered(),shapeConfig:{x:t,y:e,width:s,height:o,strokeWidth:h},iconStyleConfig:{isFilled:l,fillColor:u,strokeColor:f,strokeWidth:a,margin:p}}}class Tn{newBpmnCanvas({canvas:t,ratioFromParent:e,setIconOriginFunct:s,shapeConfig:o,iconStyleConfig:i},r){return new gn({canvas:t,shapeConfig:o,iconConfig:{originalSize:r,styleConfig:i,ratioFromParent:e,setIconOriginFunct:s}})}paintEnvelopeIcon(t){const e={width:485.41,height:321.76},s=this.newBpmnCanvas(t,e),o=e.width,i=e.height;s.rect(0,0,o,i),s.fillAndStroke();const{iconStyleConfig:r}=t;r.isFilled&&s.setStrokeColor(r.fillColor),s.begin(),s.moveTo(0,0),s.lineTo(o*.5,i*.6),s.lineTo(o,0),s.moveTo(0,i),s.lineTo(o/3,i*.45),s.moveTo(o,i),s.lineTo(o*2/3,i*.45),s.stroke()}paintCircleIcon(t){const e={width:t.shapeConfig.width,height:t.shapeConfig.height},s=this.newBpmnCanvas(t,e),o=e.width,i=e.height;o>0&&i>0&&s.ellipse(0,0,o,i),t.iconStyleConfig.isFilled?s.fillAndStroke():s.stroke()}paintClockIcon(t){const e=this.newBpmnCanvas(t,{height:152,width:152});e.begin(),e.moveTo(184,60),e.curveTo(188.4,60,192,56.4,192,52),e.lineTo(192,48),e.curveTo(192,40,188.4,40,184,40),e.curveTo(179.6,40,176,43.6,176,48),e.lineTo(176,52),e.curveTo(176,56.4,179.6,60,184,60),e.close(),e.moveTo(184,308),e.curveTo(179.6,308,176,311.6,176,316),e.lineTo(176,320),e.curveTo(176,324.4,179.6,328,184,328),e.curveTo(188.4,328,192,324.4,192,320),e.lineTo(192,316),e.curveTo(192,311.6,188.4,308,184,308),e.close(),e.moveTo(52,176),e.lineTo(48,176),e.curveTo(43.6,176,40,179.6,40,184),e.curveTo(40,188.4,43.6,192,48,192),e.lineTo(52,192),e.curveTo(56.4,192,69,188.4,60,184),e.curveTo(60,179.6,56.4,176,52,176),e.close(),e.moveTo(320,176),e.lineTo(316,176),e.curveTo(311.6,176,308,179.6,308,184),e.curveTo(308,188.4,311.6,192,316,192),e.lineTo(320,192),e.curveTo(324.4,192,328,188.4,328,184),e.curveTo(328,179.6,324.4,176,320,176),e.moveTo(93.6,82.4),e.curveTo(90.4,79.2,85.6,79.2,82.4,82.4),e.curveTo(79.2,85.6,79.2,90.4,82.4,93.6),e.lineTo(85.2,96.4),e.curveTo(86.8,98,88.8,98.8,90.8,98.8),e.curveTo(92.8,98.8,94.4,98,96.4,96.4),e.curveTo(99.6,93.2,99.6,88.4,96.4,85.2),e.lineTo(93.6,82.4),e.moveTo(85.2,271.6),e.lineTo(82.4,274.4),e.curveTo(79.2,277.6,79.2,282.4,82.4,285.6),e.curveTo(84,287.2,86,288,88,288),e.curveTo(90,288,92,287.2,93.6,285.6),e.lineTo(96.4,282.8),e.curveTo(99.6,279.6,99.6,274.8,96.4,271.6),e.curveTo(93.2,268.4,88.4,268.4,85.2,271.6),e.moveTo(274.4,82.4),e.lineTo(271.6,85.2),e.curveTo(268.4,88.4,268.4,93.2,271.6,96.4),e.curveTo(273.298,98,275.2,98.8,277.2,98.8),e.curveTo(279.2,98.8,281.2,98,282.8,96.4),e.lineTo(285.6,93.6),e.curveTo(288.8,90.4,288.8,85.6,285.6,82.4),e.curveTo(282.4,79.2,277.6,79.2,274.4,82.4),e.moveTo(192,180.8),e.lineTo(192,108),e.curveTo(192,103.6,188.4,100,184,100),e.curveTo(179.6,100,176,103.6,176,108),e.lineTo(176,184),e.curveTo(176,186,176.8,188,178.4,189.6),e.lineTo(266,277.2),e.curveTo(267.6,278.8,269.6,279.6,271.6,279.6),e.curveTo(273.6,279.6,275.6,278.8,277.2,277.2),e.curveTo(280.4,274,280.4,269.2,277.2,266),e.lineTo(192,180.8),e.moveTo(184,0),e.curveTo(82.4,0,0,82.4,0,184),e.curveTo(0,285.6,82.4,368,184,368),e.curveTo(285.6,368,368,285.6,368,184),e.curveTo(368,82.4,285.6,0,184,0),e.moveTo(184,352),e.curveTo(91.2,352,16,276.8,16,184),e.curveTo(16,91.2,91.2,16,184,16),e.curveTo(276.8,16,352,91.2,352,184),e.curveTo(352,276.8,276.8,352,184,352),e.fillAndStroke()}paintTriangleIcon(t){const e=this.newBpmnCanvas(t,{height:735,width:849});e.begin(),e.moveTo(497,55),e.lineTo(817,609),e.curveTo(849,665,808,735,744,735),e.lineTo(105,735),e.curveTo(40,735,0,665,32,609),e.lineTo(352,55),e.curveTo(384,0,465,0,497,55),e.close(),e.fillAndStroke()}paintUpArrowheadIcon(t){const e=this.newBpmnCanvas(t,{height:50,width:40});e.begin(),e.moveTo(0,49.5),e.lineTo(19.5,1),e.curveTo(19.75,.25,20,0,20.25,.25),e.lineTo(40,49.5),e.curveTo(40,49.5,39.75,50,39.6,49.75),e.lineTo(20,30),e.lineTo(.4,49.75),e.curveTo(.4,49.75,.25,50,0,49.5),e.close(),e.fillAndStroke()}paintDoubleLeftArrowheadsIcon(t){const e=this.newBpmnCanvas(t,{height:53.5,width:105});e.begin(),e.moveTo(91.4,0),e.curveTo(91.4,0,91.2,0,91,.2),e.lineTo(50,25),e.curveTo(47.9,25.8,46.7,26.6,46.4,27.3),e.lineTo(46.4,0),e.curveTo(46.4,0,46.2,0,46,.2),e.lineTo(4.9,25),e.curveTo(2,26.2,0,27.3,4.9,28.5),e.lineTo(45.8,53),e.curveTo(46,53.3,46.2,53.5,46.4,53.5),e.lineTo(46.4,27),e.curveTo(46.6,27.3,47.8,28.1,49.9,29.9),e.lineTo(90.8,53.3),e.curveTo(91,53.3,91.2,53.5,91.4,53.5),e.lineTo(91.4,0),e.close(),e.fillAndStroke()}drawCrossIcon(t){const e=this.newBpmnCanvas(t,{height:1,width:1});return e.begin(),e.moveTo(.38,0),e.lineTo(.62,0),e.lineTo(.62,.38),e.lineTo(1,.38),e.lineTo(1,.62),e.lineTo(.62,.62),e.lineTo(.62,1),e.lineTo(.38,1),e.lineTo(.38,.62),e.lineTo(0,.62),e.lineTo(0,.38),e.lineTo(.38,.38),e.close(),e}paintListIcon(t){const e=this.newBpmnCanvas(t,{height:60,width:60});e.begin(),e.moveTo(0,0),e.lineTo(60,0),e.lineTo(60,60),e.lineTo(0,60),e.lineTo(0,0),e.close(),e.moveTo(5,5),e.lineTo(55,5),e.close(),e.moveTo(5,21.6),e.lineTo(55,21.6),e.close(),e.moveTo(5,38.3),e.lineTo(55,38.3),e.close(),e.moveTo(5,55),e.lineTo(55,55),e.close(),e.fillAndStroke()}paintXCrossIcon(t){const e=this.drawCrossIcon(t);e.rotateOnIconCenter(45),e.fillAndStroke()}paintPlusCrossIcon(t){this.drawCrossIcon(t).fillAndStroke()}paintAsteriskIcon(t){const e=this.newBpmnCanvas(t,{height:1,width:1});fe(e),e.fillAndStroke(),fe(e),e.rotateOnIconCenter(60),e.fillAndStroke(),fe(e),e.rotateOnIconCenter(240),e.fillAndStroke()}paintPersonIcon(t){const e=this.newBpmnCanvas({...t,iconStyleConfig:{...t.iconStyleConfig,isFilled:!0}},{height:239.68,width:143.61});e.begin(),e.moveTo(124.31,150.29),e.lineTo(99.66,141.03),e.arcTo(6.43,6.43,0,0,1,95.51,135.03),e.lineTo(95.51,130.66),e.arcTo(47.75,47.75,0,0,0,119.51,89.25),e.lineTo(119.51,71.25),e.arcTo(47.62,47.62,0,0,0,101.18,33.64),e.arcTo(29.35,29.35,0,0,0,101.52,29.14),e.arcTo(29.68,29.68,0,0,0,42.17,29.14),e.arcTo(29.24,29.24,0,0,0,42.53,33.63),e.arcTo(47.65,47.65,0,0,0,24.14,71.23),e.lineTo(24.14,89.23),e.arcTo(47.7,47.7,0,0,0,48.19,130.63),e.lineTo(48.19,135.03),e.arcTo(6.43,6.43,0,0,1,44.03,141.03),e.lineTo(19.31,150.29),e.arcTo(29.81,29.81,0,0,0,.09,178.03),e.lineTo(.09,233.51),e.arcTo(5.63,5.63,0,1,0,11.34,233.51),e.lineTo(11.34,178.03),e.arcTo(18.19,18.19,0,0,1,11.57,175.17),e.lineTo(20.5,184.11),e.arcTo(12.32,12.32,0,0,1,24.14,192.89),e.lineTo(24.14,233.51),e.arcTo(5.63,5.63,0,1,0,35.39,233.51),e.lineTo(35.39,192.93),e.arcTo(23.5,23.5,0,0,0,28.46,176.2),e.lineTo(17.04,164.78),e.arcTo(18.34,18.34,0,0,1,23.29,160.78),e.lineTo(43.65,153.15),e.lineTo(66.22,175.72),e.lineTo(66.22,233.51),e.arcTo(5.63,5.63,0,1,0,77.47,233.51),e.lineTo(77.47,175.76),e.lineTo(100.04,153.19),e.lineTo(120.4,160.82),e.arcTo(18.39,18.39,0,0,1,126.65,164.82),e.lineTo(115.24,176.24),e.arcTo(23.5,23.5,0,0,0,108.31,192.93),e.lineTo(108.31,233.55),e.arcTo(5.63,5.63,0,1,0,119.56,233.55),e.lineTo(119.56,192.93),e.arcTo(12.35,12.35,0,0,1,123.19,184.15),e.lineTo(132.13,175.22),e.arcTo(18,18,0,0,1,132.36,178.08),e.lineTo(132.36,233.56),e.arcTo(5.63,5.63,0,0,0,143.61,233.56),e.lineTo(143.61,178.03),e.arcTo(29.81,29.81,0,0,0,124.31,150.29),e.close(),e.moveTo(71.85,10.72),e.arcTo(18.46,18.46,0,0,1,90.17,27.18),e.arcTo(47.68,47.68,0,0,0,53.53,27.18),e.arcTo(18.44,18.44,0,0,1,71.85,10.72),e.close(),e.moveTo(35.39,71.23),e.arcTo(36.46,36.46,0,0,1,108.31,71.23),e.lineTo(108.31,77.4),e.curveTo(82.12,75.4,56.97,60.55,56.71,60.4),e.arcTo(5.62,5.62,0,0,0,48.78,62.71),e.curveTo(46.24,67.79,40.45,71.89,35.39,74.62),e.close(),e.moveTo(35.39,89.23),e.lineTo(35.39,87.08),e.curveTo(40.55,84.85,49.73,80.08,55.67,72.66),e.curveTo(64.83,77.46,85.92,87.21,108.31,88.66),e.lineTo(108.31,89.24),e.arcTo(36.46,36.46,0,1,1,35.39,89.24),e.close(),e.moveTo(71.85,165.45),e.lineTo(54.06,147.69),e.arcTo(17.7,17.7,0,0,0,59.43,135.32),e.arcTo(47.57,47.57,0,0,0,84.27,135.32),e.arcTo(17.7,17.7,0,0,0,89.64,147.69),e.close(),e.fill()}paintGearIcon(t){const e=this.newBpmnCanvas(t,{height:100,width:100});pn(e),e.translateIconOrigin(14,14),En(e)}paintExpandIcon(t){const e={width:16,height:16},s=this.newBpmnCanvas(t,e),o=e.width,i=e.height;s.roundrect(0,0,o,i,2,2),s.stroke(),s.begin(),s.moveTo(o/2,i/4),s.lineTo(o/2,i*3/4),s.close(),s.moveTo(o/4,i/2),s.lineTo(o*3/4,i/2),s.close(),s.fillAndStroke()}paintLoopIcon(t){const{iconStyleConfig:e}=t;e.fillColor=e.strokeColor;const s=this.newBpmnCanvas(t,{width:22.49,height:21.62});s.begin(),s.moveTo(5.5,19.08),s.arcTo(8,8,0,1,1,10.5,21.08),s.stroke(),s.begin(),s.moveTo(7.5,14.08),s.lineTo(5.75,19.08),s.lineTo(0,17.08),s.close(),s.fillAndStroke()}paintSequentialMultiInstanceIcon(t){const e={width:16,height:16},s=this.newBpmnCanvas(t,e),{canvas:o,iconStyleConfig:i}=t;o.setFillColor(i.strokeColor);const r=e.width,l=e.height/5;s.rect(0,0,r,l),s.fill(),s.rect(0,2*l,r,l),s.fill(),s.rect(0,4*l,r,l),s.fill()}paintParallelMultiInstanceIcon(t){const e={width:16,height:16},s=this.newBpmnCanvas(t,e),{canvas:o,iconStyleConfig:i}=t;o.setFillColor(i.strokeColor);const r=e.width/5,l=e.height;s.begin(),s.rect(0,0,r,l),s.fill(),s.rect(2*r,0,r,l),s.fill(),s.rect(4*r,0,r,l),s.fill()}paintRightArrowIcon(t){const e=this.newBpmnCanvas(t,{width:512,height:415.23});e.setRoundLineJoin(),e.begin(),e.moveTo(512,207.61),e.lineTo(304.38,0),e.lineTo(304.38,135.39),e.lineTo(0,135.39),e.lineTo(0,279.84),e.lineTo(304.38,279.84),e.lineTo(304.38,415.23),e.lineTo(512,207.61),e.close(),e.fillAndStroke()}paintErrorIcon(t){const e=this.newBpmnCanvas(t,{width:72.44,height:71.82});e.begin(),e.moveTo(0,53.32),e.lineTo(19.48,0),e.lineTo(19.48,0),e.lineTo(50.85,40.07),e.lineTo(72.44,18.21),e.lineTo(53.12,71.82),e.lineTo(22.5,31.37),e.close(),e.fillAndStroke()}paintHandIcon(t){const e=this.newBpmnCanvas(t,{width:343.65,height:354.12});e.begin(),e.moveTo(231.66,336.39),e.curveTo(240.84,316.9,220.53,306.92,220.53,306.92),e.curveTo(215.2,303.67,188.58,287.43,140.67,258.19),e.lineTo(146.33,248.39),e.curveTo(223.98,269.38,267.12,281.04,275.75,283.38),e.curveTo(275.75,283.38,297.25,288,301.42,267.77),e.curveTo(306.34,245.29,288.32,238.63,288.32,238.63),e.curveTo(279.91,236.44,237.86,225.48,162.18,205.75),e.lineTo(165.2,194.8),e.curveTo(255.88,204.4,306.27,209.73,316.34,210.8),e.curveTo(316.34,210.8,339.89,212.16,341.76,189.55),e.curveTo(343.65,166.93,320.5,164.13,320.5,164.13),e.curveTo(310.43,163.1,260.04,157.99,169.35,148.77),e.lineTo(169.35,138.97),e.curveTo(253.41,132.12,300.11,128.32,309.45,127.56),e.curveTo(309.45,127.56,332.27,122.38,332.27,102.61),e.curveTo(332.27,82.85,305.48,81.87,305.48,81.87),e.curveTo(293.99,82.2,236.54,83.88,133.13,86.9),e.lineTo(127.61,81.87),e.curveTo(145.3,59.39,155.12,46.9,157.09,44.41),e.curveTo(157.09,44.41,171.12,26.8,156.78,12.72),e.curveTo(143.83,0,124.08,14.49,124.08,14.49),e.curveTo(116.45,19.41,78.35,44.06,9.77,88.43),e.lineTo(0,251.94),e.curveTo(122.84,308.79,191.09,340.37,204.74,346.69),e.curveTo(204.74,346.69,222.91,354.12,231.66,336.39),e.fillAndStroke()}paintScriptIcon(t){t.iconStyleConfig.fillColor=t.iconStyleConfig.strokeColor;const e=this.newBpmnCanvas(t,{width:458.75,height:461.64});e.begin(),e.moveTo(67.85,.57),e.curveTo(50.73,0,33.26,8.86,22.35,18.84),e.curveTo(8.11,32.15,0,50.77,0,70.26),e.curveTo(0,73.15,0,87.59,0,113.6),e.curveTo(55.4,113.6,86.18,113.6,92.33,113.6),e.curveTo(94.92,150.46,85.64,180.4,74.22,211.27),e.curveTo(40.16,298.07,30.77,339.83,55.56,410.87),e.curveTo(63.72,438.26,87.59,457.85,114.91,461.09),e.curveTo(216.96,460.85,294.9,461.64,388.41,461.2),e.curveTo(407.2,461.09,425.14,453.55,438.3,440.13),e.curveTo(451.46,426.71,458.75,403.06,458.46,384.26),e.curveTo(458.43,382.23,458.18,365.93,458.15,363.89),e.curveTo(432.12,364.24,406.09,364.04,380.06,364.04),e.curveTo(377.61,347.52,377.24,337.58,378.28,324.48),e.curveTo(380.5,296.47,389.08,273.36,398.59,247.1),e.curveTo(408.11,220.83,418.41,191.47,420.86,154.24),e.curveTo(422.11,135.34,421.4,110.24,417.77,86.75),e.curveTo(417.76,86.71,417.73,86.54,417.69,86.22),e.curveTo(417.64,85.95,417.61,85.79,417.6,85.76),e.curveTo(414.03,68.13,410.49,48.84,399.79,31.47),e.curveTo(389.09,14.11,366.95,.59,341.75,.59),e.curveTo(286.97,.59,122.63,.57,67.85,.57),e.close(),e.moveTo(85.04,72.68),e.curveTo(80.63,72.68,45.33,72.68,40.92,72.68),e.curveTo(40.46,58.4,47.15,51.87,50.27,48.75),e.curveTo(55.8,44.28,59.84,41,73.82,41),e.curveTo(78.45,52.13,82.23,62.71,85.04,72.68),e.close(),e.moveTo(364.94,52.9),e.curveTo(370,61.11,373.9,76.44,377.38,93.51),e.curveTo(380.35,113.1,381.01,136.42,380.02,151.57),e.curveTo(377.97,182.76,369.51,207.12,360.1,233.1),e.curveTo(350.69,259.09,340.27,286.77,337.53,321.27),e.curveTo(336.38,335.86,336.72,346.69,338.87,364.01),e.curveTo(326.35,364.01,263.75,364.01,151.06,364.01),e.curveTo(151.06,382.2,151.06,392.31,151.06,394.33),e.curveTo(147.77,404.8,138.9,418.2,127.43,419.94),e.curveTo(111.49,422.35,97.86,411.8,94.75,399.19),e.curveTo(65.14,321.99,94.93,275.54,112.57,225.47),e.curveTo(130.14,177.95,137.92,117.41,112.71,42.09),e.curveTo(192.88,41.9,274.33,42.21,342.89,41.98),e.curveTo(357.15,42.03,359.83,44.61,364.94,52.9),e.close(),e.moveTo(409.96,399.48),e.curveTo(409.96,408.42,398.54,425.67,392.02,425.67),e.curveTo(325.19,425.79,252.29,425.67,185.23,425.67),e.curveTo(189.88,424.43,194.66,405.64,194.66,399.48),e.curveTo(237.72,399.48,388.43,399.48,409.96,399.48),e.close(),e.fill(),e.begin(),e.moveTo(182.1,131.2),e.lineTo(182.1,151.68),e.lineTo(321.89,151.68),e.lineTo(321.89,131.2),e.lineTo(182.1,131.2),e.close(),e.moveTo(162.25,251.09),e.lineTo(162.25,271.49),e.lineTo(301.96,271.49),e.lineTo(301.96,251.09),e.lineTo(162.25,251.09),e.close(),e.fill()}paintTableIcon(t){const e=this.newBpmnCanvas(t,{width:640,height:640});e.begin(),e.moveTo(.19,.1),e.lineTo(298.78,.1),e.lineTo(298.78,198.88),e.lineTo(.19,198.88),e.lineTo(.19,.1),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(0,0),e.lineTo(298.78,0),e.lineTo(298.78,48.88),e.lineTo(0,48.88),e.lineTo(0,0),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(0,48.88),e.lineTo(98.78,48.88),e.lineTo(98.78,198.88),e.lineTo(0,198.88),e.lineTo(0,48.88),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(1.09,122.69),e.lineTo(298.78,122.69),e.close(),e.fillAndStroke(),e.setFillColor(t.iconStyleConfig.strokeColor),e.begin(),e.moveTo(0,0),e.lineTo(298.78,0),e.lineTo(298.78,48.88),e.lineTo(0,48.88),e.lineTo(0,0),e.close(),e.fillAndStroke()}paintPentagon(t){const e=this.newBpmnCanvas(t,{width:16,height:16});e.begin(),e.moveTo(16,6.5),e.lineTo(8,0),e.lineTo(0,6.5),e.lineTo(3,16),e.lineTo(13,16),e.lineTo(16,6.5),e.lineTo(8,0),e.stroke()}}function fe(n){n.begin(),n.moveTo(.38,0),n.lineTo(.62,0),n.lineTo(.62,1),n.lineTo(.38,1),n.close()}function pn(n){n.begin(),n.moveTo(2.06,24.62),n.lineTo(10.17,30.95),n.lineTo(9.29,37.73),n.lineTo(0,41.42),n.lineTo(2.95,54.24),n.lineTo(13.41,52.92),n.lineTo(17.39,58.52),n.lineTo(13.56,67.66),n.lineTo(24.47,74.44),n.lineTo(30.81,66.33),n.lineTo(37.88,67.21),n.lineTo(41.57,76.5),n.lineTo(54.24,73.55),n.lineTo(53.06,62.94),n.lineTo(58.52,58.52),n.lineTo(67.21,63.09),n.lineTo(74.58,51.88),n.lineTo(66.03,45.25),n.lineTo(66.92,38.62),n.lineTo(76.5,34.93),n.lineTo(73.7,22.26),n.lineTo(62.64,23.44),n.lineTo(58.81,18.42),n.lineTo(62.79,8.7),n.lineTo(51.74,2.21),n.lineTo(44.81,10.47),n.lineTo(38.03,9.43),n.lineTo(33.75,0),n.lineTo(21.52,3.24),n.lineTo(22.7,13.56),n.lineTo(18.13,17.54),n.lineTo(8.7,13.56),n.close(),me(n,24.8,39)}function En(n){n.begin(),n.moveTo(16.46,41.42),n.lineTo(24.57,47.75),n.lineTo(23.69,54.53),n.lineTo(14.4,58.22),n.lineTo(17.35,71.04),n.lineTo(27.81,69.72),n.lineTo(31.79,75.32),n.lineTo(27.96,84.46),n.lineTo(38.87,91.24),n.lineTo(45.21,83.13),n.lineTo(52.28,84.01),n.lineTo(55.97,93.3),n.lineTo(68.64,90.35),n.lineTo(67.46,79.74),n.lineTo(72.92,75.32),n.lineTo(81.61,79.89),n.lineTo(88.98,68.68),n.lineTo(80.43,62.05),n.lineTo(81.32,55.42),n.lineTo(90.9,51.73),n.lineTo(88.1,39.06),n.lineTo(77.04,40.24),n.lineTo(73.21,35.22),n.lineTo(77.19,25.5),n.lineTo(66.14,19.01),n.lineTo(59.21,27.27),n.lineTo(52.43,26.23),n.lineTo(48.15,16.8),n.lineTo(35.92,20.04),n.lineTo(37.1,30.36),n.lineTo(32.53,34.34),n.lineTo(23.1,30.36),n.close();const t=39.2,e=55.8;me(n,t,e),n.begin(),me(n,t,e)}function me(n,t,e){n.moveTo(t,e),n.arcTo(13.5,13.5,0,1,1,t+2*13.5,e),n.arcTo(13.5,13.5,0,0,1,t,e),n.close(),n.fillAndStroke()}class ut{static get(){return this.instance}static set(t){this.instance=t}}g(ut,"instance",new Tn);const Ae=1.25,Sn=1/Ae;class In extends L.mxGraph{constructor(e){super(e);g(this,"currentZoomLevel",1);this.zoomFactor=Ae,this.container&&(this.container.style.cursor="default")}createGraphView(){return new Cn(this)}createCellRenderer(){return new hn(ut.get())}batchUpdate(e){this.model.beginUpdate();try{e()}finally{this.model.endUpdate()}}fit(e,s,o,i,r,l,a){const h=super.fit(e,s,o,i,r,l,a);return this.setCurrentZoomLevel(h),h}setCurrentZoomLevel(e){this.currentZoomLevel=e??this.view.scale}zoomActual(){super.zoomActual(),this.setCurrentZoomLevel()}zoomIn(){super.zoomIn(),this.setCurrentZoomLevel()}zoomOut(){super.zoomOut(),this.setCurrentZoomLevel()}customFit(e){this.zoomActual();const s=e==null?void 0:e.type;if(s==null||s==Q.None)return;const o=Wt(e==null?void 0:e.margin);if(s==Q.Center){const r=this.getGraphBounds(),l=this.container.clientWidth-o,a=this.container.clientHeight-o,h=r.width/this.view.scale,u=r.height/this.view.scale,f=Math.min(3,Math.min(l/h,a/u));this.setCurrentZoomLevel(f),this.view.scaleAndTranslate(f,(o+l-h*f)/(2*f)-r.x/this.view.scale,(o+a-u*f)/(2*f)-r.y/this.view.scale)}else{let i=!1,r=!1;switch(s){case Q.Horizontal:{r=!0;break}case Q.Vertical:{i=!0;break}}this.fit(this.border,!1,o,!0,i,r)}}registerMouseWheelZoomListeners(e){e=Ht(e),G.addMouseWheelListener(at(this.createMouseWheelZoomListener(!0),e.debounceDelay),this.container),G.addMouseWheelListener(an(this.createMouseWheelZoomListener(!1),e.throttleDelay),this.container)}manageMouseWheelZoomEvent(e,s,o){if(o){const[i,r]=this.getEventRelativeCoordinates(s),[l,a,h]=this.getScaleAndTranslationDeltas(i,r);this.view.scaleAndTranslate(l,this.view.translate.x+a,this.view.translate.y+h),G.consume(s)}else this.currentZoomLevel*=e?Ae:Sn}createMouseWheelZoomListener(e){return(s,o)=>{if(G.isConsumed(s)||!(s instanceof MouseEvent))return;s.ctrlKey&&!s.altKey&&!s.shiftKey&&!s.metaKey&&this.manageMouseWheelZoomEvent(o,s,e)}}getEventRelativeCoordinates(e){const s=this.container.getBoundingClientRect(),o=e.clientX-s.left,i=e.clientY-s.top;return[o,i]}getScaleAndTranslationDeltas(e,s){const[o,i]=this.calculateFactorAndScale(),[r,l]=this.calculateTranslationDeltas(o,i,e*2,s*2);return[i,r,l]}calculateTranslationDeltas(e,s,o,i){if(e>1){const r=(e-1)/(s*2);o*=-r,i*=-r}else{const r=(1/e-1)/(this.view.scale*2);o*=r,i*=r}return[o,i]}calculateFactorAndScale(){const e=Math.round(this.currentZoomLevel*100)/100;return[e/this.view.scale,e]}}class Cn extends L.mxGraphView{getFloatingTerminalPoint(t,e,s,o){if(t.absolutePoints.filter(Boolean).length<2)return super.getFloatingTerminalPoint(t,e,s,o);const l=t.absolutePoints;return o?l[1]:l.at(-2)}}class mn{configureMarkers(){this.registerArrowDashMarker()}registerArrowDashMarker(){const t=(e,s,o,i,r,l,a,h,u)=>{const f=r*(a+u+4),p=l*(a+u+4);return function(){e.begin(),e.moveTo(i.x-f/2-p/2,i.y-p/2+f/2),e.lineTo(i.x+p/2-3*f/2,i.y-3*p/2-f/2),e.stroke()}};L.mxMarker.addMarker(rt.ARROW_DASH,t)}}const An=[_.LOOP,_.MULTI_INSTANCE_PARALLEL,_.MULTI_INSTANCE_SEQUENTIAL,_.COMPENSATION,_.EXPAND,_.ADHOC];function vn(n){const t=An.filter(e=>n.includes(e));for(const e of n.filter(s=>!t.includes(s)))t.push(e);return t}function On(n,t){return n===1?e=>e.setIconOriginForIconBottomCentered():e=>{e.setIconOriginForIconBottomCentered();const s=Math.pow(-1,t)*(T.SHAPE_ACTIVITY_MARKER_ICON_SIZE+T.SHAPE_ACTIVITY_MARKER_ICON_MARGIN)/2;e.translateIconOrigin(s,0)}}class Re extends _e{constructor(){super(void 0,void 0,void 0);g(this,"iconPainter");g(this,"markerPainterFunctions",new Map([[_.EXPAND,e=>this.iconPainter.paintExpandIcon(e)],[_.LOOP,e=>this.iconPainter.paintLoopIcon(e)],[_.MULTI_INSTANCE_PARALLEL,e=>this.iconPainter.paintParallelMultiInstanceIcon(e)],[_.MULTI_INSTANCE_SEQUENTIAL,e=>this.iconPainter.paintSequentialMultiInstanceIcon(e)]]))}paintForeground(e,s,o,i,r){super.paintForeground(e,s,o,i,r),this.paintMarkerIcons(X({canvas:e,x:s,y:o,width:i,height:r,shape:this,ratioFromParent:0,iconStrokeWidth:1.5}))}paintMarkerIcons(e){var o;const s=v.getValue(this.style,I.MARKERS,void 0);if(s){const i=vn(s.split(","));for(const[r,l]of i.entries())e={...e,setIconOriginFunct:On(i.length,r+1)},e.canvas.save(),(o=this.markerPainterFunctions.get(l))==null||o(e),e.canvas.restore()}}paintEnvelopeIcon(e,s){this.iconPainter.paintEnvelopeIcon({...e,setIconOriginFunct:o=>o.setIconOriginToShapeTopLeft(),ratioFromParent:.2,iconStyleConfig:{...e.iconStyleConfig,isFilled:s}})}}class U extends Re{paintForeground(t,e,s,o,i){super.paintForeground(t,e,s,o,i),this.paintTaskIcon(X({canvas:t,x:e,y:s,width:o,height:i,shape:this}))}}class Ln extends U{paintTaskIcon(t){}}class Nn extends U{paintTaskIcon(t){this.iconPainter.paintGearIcon({...t,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class _n extends U{paintTaskIcon(t){this.iconPainter.paintPersonIcon({...t,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class yn extends U{paintTaskIcon(t){if(!lt(this.style)){this.paintEnvelopeIcon(t,!1);return}const e=4,s=4,o={...t.shapeConfig,width:20,height:20};this.iconPainter.paintCircleIcon({canvas:t.canvas,shapeConfig:o,iconStyleConfig:{...t.iconStyleConfig,isFilled:!1},ratioFromParent:void 0,setIconOriginFunct:i=>i.setIconOriginToShapeTopLeft(s,e)}),o.x+=e,o.y+=s,this.iconPainter.paintEnvelopeIcon({...t,shapeConfig:o,ratioFromParent:.65,setIconOriginFunct:i=>i.setIconOriginForIconCentered()})}}class wn extends U{paintTaskIcon(t){this.paintEnvelopeIcon(t,!0)}}class Rn extends U{paintTaskIcon(t){this.iconPainter.paintHandIcon({...t,ratioFromParent:.18,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class bn extends U{paintTaskIcon(t){this.iconPainter.paintScriptIcon({...t,ratioFromParent:.22,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class Fn extends Re{paintForeground(t,e,s,o,i){super.paintForeground(t,e,s,o,i);const r=X({canvas:t,x:e,y:s,width:o,height:i,shape:this});switch(v.getValue(this.style,I.GLOBAL_TASK_KIND,void 0)){case d.GLOBAL_TASK_MANUAL:{this.iconPainter.paintHandIcon({...r,ratioFromParent:.18,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break}case d.GLOBAL_TASK_SCRIPT:{this.iconPainter.paintScriptIcon({...r,ratioFromParent:.22,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break}case d.GLOBAL_TASK_USER:{this.iconPainter.paintPersonIcon({...r,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break}case d.GLOBAL_TASK_BUSINESS_RULE:{this.iconPainter.paintTableIcon({...r,ratioFromParent:.6,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(15)});break}}}}class Pn extends Re{paintBackground(t,e,s,o,i){const r=v.getValue(this.style,I.SUB_PROCESS_KIND,void 0);if(t.save(),r===Y.EVENT&&(t.setDashed(!0,!1),t.setDashPattern("1 2")),super.paintBackground(t,e,s,o,i),r===Y.TRANSACTION){const l=T.SUB_PROCESS_TRANSACTION_INNER_RECT_OFFSET,a=T.SUB_PROCESS_TRANSACTION_INNER_RECT_ARC_SIZE;t.roundrect(e+l,s+l,o-2*l,i-2*l,a,a),t.stroke()}t.restore()}}class kn extends U{paintTaskIcon(t){this.iconPainter.paintTableIcon({...t,ratioFromParent:.6,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(15)})}}class Bn extends L.mxConnector{paintEdgeShape(t,e){const s=this.createMarker(t,e,!0),o=this.createMarker(t,e,!1);this.paintEdgeLine(t,e),t.setShadow(!1),t.setDashed(!1,!1),s!=null&&(t.setFillColor(v.getValue(this.style,I.EDGE_START_FILL_COLOR,this.stroke)),s()),o!=null&&(t.setFillColor(v.getValue(this.style,I.EDGE_END_FILL_COLOR,this.stroke)),o())}paintEdgeLine(t,e){const s=Mn(t);We(t,"stroke"),this.paintLine(t,e,this.isRounded),We(t,s)}}function Mn(n){return n instanceof ye?n.pointerEventsValue:null}function We(n,t){n instanceof ye&&(n.pointerEventsValue=t)}class be extends L.mxEllipse{constructor(){super(void 0,void 0,void 0);g(this,"iconPainter");g(this,"iconPainters",new Map([[y.MESSAGE,e=>this.iconPainter.paintEnvelopeIcon({...e,ratioFromParent:.5})],[y.TERMINATE,e=>this.iconPainter.paintCircleIcon({...e,ratioFromParent:.6})],[y.TIMER,e=>this.iconPainter.paintClockIcon({...e,setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(5)})],[y.SIGNAL,e=>this.iconPainter.paintTriangleIcon({...e,ratioFromParent:.55,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:T.STROKE_WIDTH_THIN.valueOf()},setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(4)})],[y.LINK,e=>this.iconPainter.paintRightArrowIcon({...e,ratioFromParent:.55,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1.5}})],[y.ERROR,e=>this.iconPainter.paintErrorIcon({...e,ratioFromParent:.55,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1.5}})],[y.COMPENSATION,e=>this.iconPainter.paintDoubleLeftArrowheadsIcon({...e,ratioFromParent:.7,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1.5}})],[y.CANCEL,e=>this.iconPainter.paintXCrossIcon({...e,ratioFromParent:.78})],[y.ESCALATION,e=>this.iconPainter.paintUpArrowheadIcon({...e,ratioFromParent:.55,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:T.STROKE_WIDTH_THIN.valueOf()}})],[y.CONDITIONAL,e=>this.iconPainter.paintListIcon({...e,ratioFromParent:.6,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1.5}})]]));g(this,"withFilledIcon",!1)}paintVertexShape(e,s,o,i,r){const l=X({canvas:e,x:s,y:o,width:i,height:r,shape:this,isFilled:this.withFilledIcon});xn(l,v.getValue(this.style,I.IS_INTERRUPTING,void 0)),this.paintOuterShape(l),Yn(l),this.paintInnerShape(l)}paintOuterShape({canvas:e,shapeConfig:{x:s,y:o,width:i,height:r}}){super.paintVertexShape(e,s,o,i,r)}paintInnerShape(e){const s=this.iconPainters.get(v.getValue(this.style,I.EVENT_DEFINITION_KIND,y.NONE));s==null||s(e)}}function xn(n,t){n.canvas.save(),t==="false"&&(n.canvas.setDashed(!0,!1),n.canvas.setDashPattern("3 2"))}function Yn(n){n.canvas.restore()}class Gn extends be{constructor(){super(),this.withFilledIcon=!0}}class ve extends be{paintOuterShape({canvas:t,shapeConfig:{x:e,y:s,width:o,height:i,strokeWidth:r}}){t.ellipse(e,s,o,i),t.fillAndStroke();const l=r*1.5;t.ellipse(o*.02+l+e,i*.02+l+s,o*.96-2*l,i*.96-2*l),t.stroke()}}class Vn extends ve{constructor(){super(),this.withFilledIcon=!0}}class Dn extends _e{constructor(){super(...arguments);g(this,"iconPainter")}paintVertexShape(e,s,o,i,r){const l=X({canvas:e,x:s,y:o,width:i,height:r,shape:this,ratioFromParent:1,isFilled:v.getValue(this.style,I.IS_INITIATING,"true")=="false"});this.iconPainter.paintEnvelopeIcon(l)}}class se extends L.mxRhombus{constructor(){super(...arguments);g(this,"iconPainter")}paintVertexShape(e,s,o,i,r){const l=X({canvas:e,x:s,y:o,width:i,height:r,shape:this});this.paintOuterShape(l),this.paintInnerShape(l)}paintOuterShape({canvas:e,shapeConfig:{x:s,y:o,width:i,height:r}}){super.paintVertexShape(e,s,o,i,r)}}class Un extends se{paintInnerShape(t){this.iconPainter.paintXCrossIcon({...t,iconStyleConfig:{...t.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class Wn extends se{paintInnerShape(t){this.iconPainter.paintPlusCrossIcon({...t,iconStyleConfig:{...t.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class Hn extends se{paintInnerShape(t){this.iconPainter.paintCircleIcon({...t,ratioFromParent:.62,iconStyleConfig:{...t.iconStyleConfig,isFilled:!1,strokeWidth:T.STROKE_WIDTH_THICK.valueOf()}})}}class Kn extends se{paintInnerShape(t){this.iconPainter.paintAsteriskIcon({...t,iconStyleConfig:{...t.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class zn extends se{paintInnerShape(t){t={...t,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1}},this.iconPainter.paintCircleIcon({...t,ratioFromParent:.55}),lt(this.style)||this.iconPainter.paintCircleIcon({...t,ratioFromParent:.45});const e={...t,ratioFromParent:.3};v.getValue(this.style,I.EVENT_BASED_GATEWAY_KIND,ee.Exclusive)==ee.Parallel?this.iconPainter.paintPlusCrossIcon(e):this.iconPainter.paintPentagon(e)}}class Xn extends _e{paintForeground(t,e,s,o,i){t.begin(),t.moveTo(e+T.TEXT_ANNOTATION_BORDER_LENGTH,s),t.lineTo(e,s),t.lineTo(e,s+i),t.lineTo(e+T.TEXT_ANNOTATION_BORDER_LENGTH,s+i),t.stroke()}paintBackground(t,e,s,o,i){t.save(),t.setStrokeColor("none"),super.paintBackground(t,e,s,o,i),t.restore()}}const Zn=()=>{const n=[[d.EVENT_END,Gn],[d.EVENT_START,be],[d.EVENT_INTERMEDIATE_THROW,Vn],[d.EVENT_INTERMEDIATE_CATCH,ve],[d.EVENT_BOUNDARY,ve],[d.GATEWAY_COMPLEX,Kn],[d.GATEWAY_EVENT_BASED,zn],[d.GATEWAY_EXCLUSIVE,Un],[d.GATEWAY_INCLUSIVE,Hn],[d.GATEWAY_PARALLEL,Wn],[d.SUB_PROCESS,Pn],[d.CALL_ACTIVITY,Fn],[d.TASK,Ln],[d.TASK_SERVICE,Nn],[d.TASK_USER,_n],[d.TASK_RECEIVE,yn],[d.TASK_SEND,wn],[d.TASK_MANUAL,Rn],[d.TASK_SCRIPT,bn],[d.TASK_BUSINESS_RULE,kn],[d.TEXT_ANNOTATION,Xn],[I.EDGE,Bn],[I.MESSAGE_FLOW_ICON,Dn]];for(const[t,e]of n)Gt.registerShape(t,e)};class jn{configureShapes(){Zn()}}const dt=12;class Fe extends Map{get(t){return super.get(t)??(()=>{})}}const $n=new Fe([[k.SEQUENCE_FLOW,n=>{n[c.STYLE_ENDARROW]=c.ARROW_BLOCK_THIN}],[k.MESSAGE_FLOW,n=>{n[c.STYLE_DASHED]=!0,n[c.STYLE_DASH_PATTERN]="8 5",n[c.STYLE_STARTARROW]=c.ARROW_OVAL,n[c.STYLE_STARTSIZE]=8,n[c.STYLE_STARTFILL]=!0,n[I.EDGE_START_FILL_COLOR]=T.MESSAGE_FLOW_MARKER_START_FILL_COLOR,n[c.STYLE_ENDARROW]=c.ARROW_BLOCK_THIN,n[c.STYLE_ENDFILL]=!0,n[I.EDGE_END_FILL_COLOR]=T.MESSAGE_FLOW_MARKER_END_FILL_COLOR}],[k.ASSOCIATION_FLOW,n=>{n[c.STYLE_DASHED]=!0,n[c.STYLE_DASH_PATTERN]="1 2",n[c.STYLE_STARTSIZE]=dt}]]),qn=new Fe([[x.DEFAULT,n=>{n[c.STYLE_STARTARROW]=rt.ARROW_DASH}],[x.CONDITIONAL_FROM_ACTIVITY,n=>{n[c.STYLE_STARTARROW]=c.ARROW_DIAMOND_THIN,n[c.STYLE_STARTSIZE]=18,n[c.STYLE_STARTFILL]=!0,n[I.EDGE_START_FILL_COLOR]=T.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR}]]),Qn=new Fe([[K.NONE,n=>{}],[K.ONE,n=>{n[c.STYLE_ENDARROW]=c.ARROW_OPEN_THIN}],[K.BOTH,n=>{n[c.STYLE_STARTARROW]=c.ARROW_OPEN_THIN,n[c.STYLE_ENDARROW]=c.ARROW_OPEN_THIN}]]);class ht{constructor(t){this.graph=t}configureStyles(){this.configureDefaultVertexStyle(),this.configurePoolStyle(),this.configureLaneStyle(),this.configureTextAnnotationStyle(),this.configureGroupStyle(),this.configureActivityStyles(),this.configureEventStyles(),this.configureGatewayStyles(),this.configureDefaultEdgeStyle(),this.configureFlowStyles()}getStylesheet(){return this.graph.getStylesheet()}putCellStyle(t,e){this.getStylesheet().putCellStyle(t,e)}configureDefaultVertexStyle(){const t=this.getStylesheet().getDefaultVertexStyle();He(t),t[c.STYLE_ABSOLUTE_ARCSIZE]=!0,t[c.STYLE_ARCSIZE]=T.SHAPE_ARC_SIZE}configurePoolStyle(){const t={};t[c.STYLE_SHAPE]=c.SHAPE_SWIMLANE,t[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,t[c.STYLE_ALIGN]=c.ALIGN_CENTER,t[c.STYLE_STARTSIZE]=T.POOL_LABEL_SIZE,t[c.STYLE_FILLCOLOR]=T.POOL_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(d.POOL,t)}configureLaneStyle(){const t={};t[c.STYLE_SHAPE]=c.SHAPE_SWIMLANE,t[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,t[c.STYLE_ALIGN]=c.ALIGN_CENTER,t[c.STYLE_SWIMLANE_LINE]=0,t[c.STYLE_STARTSIZE]=T.LANE_LABEL_SIZE,t[c.STYLE_FILLCOLOR]=T.LANE_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(d.LANE,t)}configureEventStyles(){for(const t of E.eventKinds()){const e={};e[c.STYLE_SHAPE]=t,e[c.STYLE_PERIMETER]=Ge.EllipsePerimeter,e[c.STYLE_STROKEWIDTH]=t==d.EVENT_END?T.STROKE_WIDTH_THICK:T.STROKE_WIDTH_THIN,e[c.STYLE_VERTICAL_LABEL_POSITION]=c.ALIGN_BOTTOM,this.putCellStyle(t,e)}}configureTextAnnotationStyle(){const t={};t[c.STYLE_SHAPE]=d.TEXT_ANNOTATION,t[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,t[c.STYLE_ALIGN]=c.ALIGN_LEFT,t[c.STYLE_SPACING_LEFT]=5,t[c.STYLE_FILLCOLOR]=T.TEXT_ANNOTATION_FILL_COLOR,t[c.STYLE_STROKEWIDTH]=T.STROKE_WIDTH_THIN,this.putCellStyle(d.TEXT_ANNOTATION,t)}configureGroupStyle(){const t={};t[c.STYLE_ROUNDED]=!0,t[c.STYLE_DASHED]=!0,t[c.STYLE_DASH_PATTERN]="7 4 1 4",t[c.STYLE_STROKEWIDTH]=T.STROKE_WIDTH_THIN,t[c.STYLE_FILLCOLOR]=T.GROUP_FILL_COLOR,t[c.STYLE_ALIGN]=c.ALIGN_CENTER,t[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_TOP,this.putCellStyle(d.GROUP,t)}configureActivityStyles(){for(const t of E.activityKinds()){const e={};e[c.STYLE_SHAPE]=t,e[c.STYLE_ROUNDED]=!0,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,e[c.STYLE_STROKEWIDTH]=t==d.CALL_ACTIVITY?T.STROKE_WIDTH_THICK:T.STROKE_WIDTH_THIN,this.putCellStyle(t,e)}}configureGatewayStyles(){for(const t of E.gatewayKinds()){const e={};e[c.STYLE_SHAPE]=t,e[c.STYLE_PERIMETER]=Ge.RhombusPerimeter,e[c.STYLE_STROKEWIDTH]=T.STROKE_WIDTH_THIN,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_TOP,e[c.STYLE_LABEL_POSITION]=c.ALIGN_LEFT,e[c.STYLE_VERTICAL_LABEL_POSITION]=c.ALIGN_TOP,this.putCellStyle(t,e)}}configureDefaultEdgeStyle(){const t=this.getStylesheet().getDefaultEdgeStyle();He(t),t[c.STYLE_SHAPE]=I.EDGE,t[c.STYLE_ENDSIZE]=dt,t[c.STYLE_STROKEWIDTH]=1.5,t[c.STYLE_ROUNDED]=!0,t[c.STYLE_ARCSIZE]=5,t[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_BOTTOM,delete t[c.STYLE_ENDARROW]}configureEdgeStyles(t,e){for(const s of t){const o={};e.get(s)(o),this.graph.getStylesheet().putCellStyle(s.toString(),o)}}configureFlowStyles(){this.configureEdgeStyles(Object.values(k),$n),this.configureEdgeStyles(Object.values(x),qn),this.configureEdgeStyles(Object.values(K),Qn)}}function He(n){n[c.STYLE_FONTFAMILY]=T.DEFAULT_FONT_FAMILY,n[c.STYLE_FONTSIZE]=T.DEFAULT_FONT_SIZE,n[c.STYLE_FONTCOLOR]=T.DEFAULT_FONT_COLOR,n[c.STYLE_FILLCOLOR]=T.DEFAULT_FILL_COLOR,n[c.STYLE_STROKECOLOR]=T.DEFAULT_STROKE_COLOR,n[c.STYLE_LABEL_BACKGROUNDCOLOR]=c.NONE,n[c.STYLE_WHITE_SPACE]="wrap"}class Jn{constructor(t){g(this,"graph");this.graph=new In(t)}configure(t){return this.configureGraph(),this.configureNavigationSupport(t),new ht(this.graph).configureStyles(),new jn().configureShapes(),new mn().configureMarkers(),this.graph}configureGraph(){this.graph.setCellsLocked(!0),this.graph.setCellsSelectable(!1),this.graph.setEdgeLabelsMovable(!1),this.graph.setHtmlLabels(!0),this.graph.setConstrainChildren(!1),this.graph.setExtendParents(!1),this.graph.foldingEnabled=!1}configureNavigationSupport(t){var s;const e=this.graph.panningHandler;(s=t==null?void 0:t.navigation)!=null&&s.enabled?(e.addListener(G.PAN_START,Ke(this.graph,"grab")),e.addListener(G.PAN_END,Ke(this.graph,"default")),e.usePopupTrigger=!1,e.isForcePanningEvent=o=>G.isLeftMouseButton(o.getEvent())||G.isMultiTouchEvent(o.getEvent()),this.graph.setPanning(!0),this.graph.registerMouseWheelZoomListeners(t.navigation.zoom)):(this.graph.setPanning(!1),e.setPinchEnabled(!1),e.isForcePanningEvent=o=>!1)}}function Ke(n,t){return()=>{n.container.style.cursor=t}}class es{constructor(t){this.graph=t}fit(t){this.graph.customFit(t)}zoom(t){t=="in"?this.graph.zoomIn():this.graph.zoomOut()}}class ts{constructor(t){this.convertedElements=t}deserialize(t){const e=S(t.category).flatMap(s=>S(s.categoryValue));for(const s of e)this.convertedElements.registerCategoryValue(s.id,s.value)}}class Z{}class ns{constructor(t){this.options=t}warning(t){var s;if((s=this.options)!=null&&s.disableConsoleLog)return;const e=t.getMessage();console.warn(`[bv-parser] ${e.template}`,...e.arguments)}}class ss extends Z{constructor(t,e){super(),this.groupBpmnElementId=t,this.categoryValueReference=e}getMessage(){return{arguments:[this.categoryValueReference,this.groupBpmnElementId],template:"Group json deserialization: unable to find category value ref %s for bpmn element %s"}}}class os extends Z{constructor(t){super(),this.bpmnElementId=t}getMessage(){return{arguments:[this.bpmnElementId],template:"Shape json deserialization: unable to find bpmn element with id %s"}}}class is extends Z{constructor(t){super(),this.bpmnElementId=t}getMessage(){return{arguments:[this.bpmnElementId],template:"Edge json deserialization: unable to find bpmn element with id %s"}}}class rs extends Z{constructor(t,e){super(),this.shapeOrEdgeId=t,this.labelStyleId=e}getMessage(){return{arguments:[this.labelStyleId,this.shapeOrEdgeId],template:"Unable to assign font from style %s to shape/edge %s"}}}class ls extends Z{constructor(t,e){super(),this.laneId=t,this.flowNodeReference=e}getMessage(){return{arguments:[this.flowNodeReference,this.laneId],template:"Unable to assign lane %s as parent: flow node %s is not found"}}}class as extends Z{constructor(t,e,s){super(),this.bpmnElementId=t,this.attachedToReference=e,this.attachedToKind=s}getMessage(){return{arguments:[this.bpmnElementId,this.attachedToReference,this.attachedToKind],template:"The boundary event %s must be attached to an activity, and not to %s of kind %s"}}}class cs{constructor(){g(this,"poolsById",new Map);g(this,"poolsByProcessRef",new Map);g(this,"messageFlows",new Map);g(this,"flowNodes",new Map);g(this,"lanes",new Map);g(this,"sequenceFlows",new Map);g(this,"associationFlows",new Map);g(this,"eventDefinitionsOfDefinitions",new Map);g(this,"globalTasks",new Map);g(this,"categoryValues",new Map)}getFlows(){return[...this.messageFlows.values(),...this.sequenceFlows.values(),...this.associationFlows.values()]}findPoolById(t){return this.poolsById.get(t)}findPoolByProcessRef(t){return this.poolsByProcessRef.get(t)}registerPool(t,e){this.poolsById.set(t.id,t),e&&this.poolsByProcessRef.set(e,t)}findMessageFlow(t){return this.messageFlows.get(t)}registerMessageFlow(t){this.messageFlows.set(t.id,t)}findFlowNode(t){return this.flowNodes.get(t)}registerFlowNode(t){this.flowNodes.set(t.id,t)}findLane(t){return this.lanes.get(t)}registerLane(t){this.lanes.set(t.id,t)}findSequenceFlow(t){return this.sequenceFlows.get(t)}registerSequenceFlow(t){this.sequenceFlows.set(t.id,t)}findAssociationFlow(t){return this.associationFlows.get(t)}registerAssociationFlow(t){this.associationFlows.set(t.id,t)}findEventDefinitionOfDefinition(t){return this.eventDefinitionsOfDefinitions.get(t)}registerEventDefinitionsOfDefinition(t,e){this.eventDefinitionsOfDefinitions.set(t,e)}findGlobalTask(t){return this.globalTasks.get(t)}registerGlobalTask(t,e){this.globalTasks.set(t,e)}findCategoryValue(t){return this.categoryValues.get(t)}registerCategoryValue(t,e){this.categoryValues.set(t,{value:e})}}const ft=(n,t,e,s)=>{const o=n.findCategoryValue(e.categoryValueRef);if(o)return new M(e.id,o.value,d.GROUP,s);t.warning(new ss(e.id,e.categoryValueRef))},gt=(n,t)=>{for(const e of S(t)){const s=e.associationDirection;n.registerAssociationFlow(new nt(e.id,void 0,e.sourceRef,e.targetRef,s))}};class us{constructor(t,e){this.convertedElements=t,this.parsingMessageCollector=e}deserialize(t){for(const e of S(t))this.parseCollaboration(e)}parseCollaboration(t){this.buildParticipant(t.participant),this.buildMessageFlows(t.messageFlow),gt(this.convertedElements,t.association),this.buildGroups(t.group),this.buildTextAnnotation(t.textAnnotation)}buildParticipant(t){for(const e of S(t))this.convertedElements.registerPool(new M(e.id,e.name,d.POOL),e.processRef)}buildMessageFlows(t){for(const e of S(t))this.convertedElements.registerMessageFlow(new tt(e.id,e.name,e.sourceRef,e.targetRef))}buildGroups(t){for(const e of S(t)){const s=ft(this.convertedElements,this.parsingMessageCollector,e);s&&this.convertedElements.registerFlowNode(s)}}buildTextAnnotation(t){for(const e of S(t))this.convertedElements.registerFlowNode(new M(e.id,e.text,d.TEXT_ANNOTATION))}}class ds{constructor(t,e,s,o){this.x=t,this.y=e,this.width=s,this.height=o}}class hs{constructor(t,e,s,o,i=te.NONE){g(this,"extensions",{});this.id=t,this.bpmnElement=e,this.waypoints=s,this.label=o,this.messageVisibleKind=i}}class fs{constructor(t,e){this.x=t,this.y=e}}class gs{constructor(t,e){g(this,"extensions",{});this.font=t,this.bounds=e}}class Ts{constructor(t,e,s,o,i,r){this.name=t,this.size=e,this.isBold=s,this.isItalic=o,this.isUnderline=i,this.isStrikeThrough=r}}class ps{constructor(t,e){g(this,"convertedFonts",new Map);this.convertedElements=t,this.parsingMessageCollector=e}deserialize(t){const e=[],s=[],o=[],i=[],r=S(t)[0];if(r){this.deserializeFonts(r.BPMNLabelStyle);const l=r.BPMNPlane,a=this.deserializeEdges(l.BPMNEdge),h=this.deserializeShapes(l.BPMNShape);e.push(...h.flowNodes),s.push(...h.lanes),o.push(...h.pools),i.push(...a)}return{flowNodes:e,lanes:s,pools:o,edges:i}}deserializeFonts(t){for(const e of S(t))for(const s of S(e.Font))this.convertedFonts.set(e.id,new Ts(s.name,s.size,s.isBold,s.isItalic,s.isUnderline,s.isStrikeThrough))}deserializeShapes(t){const e={flowNodes:[],lanes:[],pools:[]};for(const s of S(t))this.deserializeShapeAndStoreIfFound(s,e.flowNodes,o=>this.convertedElements.findFlowNode(o))||this.deserializeShapeAndStoreIfFound(s,e.lanes,o=>this.convertedElements.findLane(o))||this.deserializeShapeAndStoreIfFound(s,e.pools,o=>this.convertedElements.findPoolById(o))||this.parsingMessageCollector.warning(new os(s.bpmnElement));return e}deserializeShapeAndStoreIfFound(t,e,s){const o=this.deserializeShape(t,s);return o?(e.push(o),!0):!1}deserializeShape(t,e){const s=e(t.bpmnElement);if(s){const o=ze(t);(s instanceof ne||s instanceof H&&s.callActivityKind===J.CALLING_PROCESS)&&!t.isExpanded&&s.markers.push(_.EXPAND);let i;E.isPoolOrLane(s.kind)&&(i=t.isHorizontal??!0);const r=t.BPMNLabel,l=this.deserializeLabel(r,t.id),a=new re(t.id,s,o,l,i);return Es(a,t),a}}deserializeEdges(t){return S(t).map(e=>{const s=this.convertedElements.findSequenceFlow(e.bpmnElement)||this.convertedElements.findMessageFlow(e.bpmnElement)||this.convertedElements.findAssociationFlow(e.bpmnElement);if(!s){this.parsingMessageCollector.warning(new is(e.bpmnElement));return}const o=this.deserializeWaypoints(e.waypoint),i=this.deserializeLabel(e.BPMNLabel,e.id),r=e.messageVisibleKind?e.messageVisibleKind:te.NONE,l=new hs(e.id,s,o,i,r);return Ss(l,e),l}).filter(Boolean)}deserializeWaypoints(t){return S(t).map(e=>new fs(e.x,e.y))}deserializeLabel(t,e){if(t&&typeof t=="object"){const s=this.findFont(t.labelStyle,e),o=ze(t),i=new gs(s,o);if("color"in t)return i.extensions.color=t.color,i;if(s||o)return i}}findFont(t,e){let s;return t&&(s=this.convertedFonts.get(t),s||this.parsingMessageCollector.warning(new rs(e,t))),s}}function Es(n,t){"background-color"in t?n.extensions.fillColor=t["background-color"]:"fill"in t&&(n.extensions.fillColor=t.fill),"border-color"in t?n.extensions.strokeColor=t["border-color"]:"stroke"in t&&(n.extensions.strokeColor=t.stroke)}function ze(n){const t=n.Bounds;if(t)return new ds(t.x,t.y,t.width,t.height)}function Ss(n,t){"border-color"in t?n.extensions.strokeColor=t["border-color"]:"stroke"in t&&(n.extensions.strokeColor=t.stroke)}const Is=n=>"source"in n||"target"in n;class Cs{constructor(t){this.convertedElements=t}deserialize(t){for(const e of Je){const s=t[e+"EventDefinition"];for(const o of S(s,!0))this.convertedElements.registerEventDefinitionsOfDefinition(o.id,{id:o.id,kind:e,...Is(o)?{source:o.source,target:o.target}:{}})}}}class ms{constructor(t){this.convertedElements=t}deserialize(t){this.parseGlobalTasks(t.globalTask,d.GLOBAL_TASK),this.parseGlobalTasks(t.globalBusinessRuleTask,d.GLOBAL_TASK_BUSINESS_RULE),this.parseGlobalTasks(t.globalManualTask,d.GLOBAL_TASK_MANUAL),this.parseGlobalTasks(t.globalScriptTask,d.GLOBAL_TASK_SCRIPT),this.parseGlobalTasks(t.globalUserTask,d.GLOBAL_TASK_USER)}parseGlobalTasks(t,e){for(const s of S(t))this.convertedElements.registerGlobalTask(s.id,e)}}const As=(n,t)=>{switch(n){case"adHocSubProcess":return Y.AD_HOC;case"transaction":return Y.TRANSACTION;default:return t.triggeredByEvent?Y.EVENT:Y.EMBEDDED}},vs=["adHocSubProcess","transaction",...E.flowNodeKinds().filter(n=>n!==d.EVENT_BOUNDARY),d.EVENT_BOUNDARY];function Os(n){return["adHocSubProcess","transaction"].includes(n)?d.SUB_PROCESS:n}class Ls{constructor(t,e){g(this,"defaultSequenceFlowIds",[]);g(this,"elementsWithoutParentByProcessId",new Map);g(this,"callActivitiesCallingProcess",new Map);g(this,"eventsByLinkEventDefinition",new Map);this.convertedElements=t,this.parsingMessageCollector=e}deserialize(t){for(const e of S(t))this.parseProcess(e);for(const e of S(t))this.assignParentOfProcessElementsCalledByCallActivity(e.id);this.assignIncomingAndOutgoingIdsFromFlows(),this.assignSourceAndTargetIdsToLinkEvents()}assignParentOfProcessElementsCalledByCallActivity(t){const e=this.callActivitiesCallingProcess.get(t);if(e){const s=this.convertedElements.findPoolByProcessRef(t);s&&(s.parentId=e.id);for(const o of this.elementsWithoutParentByProcessId.get(t))o.parentId=e.id}}assignIncomingAndOutgoingIdsFromFlows(){const t=(e,s,o)=>{const i=this.convertedElements.findFlowNode(e)??this.convertedElements.findLane(e)??this.convertedElements.findPoolById(e);i&&!i[s].includes(o)&&i[s].push(o)};for(const e of this.convertedElements.getFlows())t(e.sourceReferenceId,"outgoingIds",e.id),t(e.targetReferenceId,"incomingIds",e.id)}assignSourceAndTargetIdsToLinkEvents(){var e;const t=[...this.eventsByLinkEventDefinition.entries()].filter(([s])=>s.id);for(const[s,o]of this.eventsByLinkEventDefinition)if(o instanceof Ie){const i=t.find(([r])=>s.target===r.id);o.targetId=(e=i==null?void 0:i[1])==null?void 0:e.id}else o instanceof Se&&(o.sourceIds=t.filter(([i])=>Array.isArray(s.source)?s.source.includes(i.id):s.source===i.id).map(([,i])=>i.id))}parseProcess(t){const e=t.id,s=this.convertedElements.findPoolByProcessRef(e);s&&!s.name&&this.convertedElements.registerPool(new M(s.id,t.name,d.POOL),e),this.buildProcessInnerElements(t,s==null?void 0:s.id)}buildProcessInnerElements(t,e){this.elementsWithoutParentByProcessId.set(t.id,[]);for(const s of vs)this.buildFlowNodeBpmnElements(t[s],Os(s),e,t.id,s);this.buildLaneSetBpmnElements(t.laneSet,e,t.id),this.buildSequenceFlows(t.sequenceFlow),gt(this.convertedElements,t.association)}buildFlowNodeBpmnElements(t,e,s,o,i){for(const r of S(t)){const l=this.buildFlowNodeBpmnElement(e,r,s,i);"default"in r&&E.isWithDefaultSequenceFlow(e)&&this.defaultSequenceFlowIds.push(r.default),l&&(this.convertedElements.registerFlowNode(l),s||this.elementsWithoutParentByProcessId.get(o).push(l))}}buildFlowNodeBpmnElement(t,e,s,o){if(E.isEvent(t))return this.buildShapeBpmnEvent(e,t,s);if(E.isActivity(t))return this.buildShapeBpmnActivity(e,t,s,o);if(t==d.GATEWAY_EVENT_BASED){const i=e;return new it(i.id,i.name,s,i.instantiate,ee[i.eventGatewayType])}else{if(t==d.GROUP)return ft(this.convertedElements,this.parsingMessageCollector,e,s);{const i=t===d.TEXT_ANNOTATION?e.text:e.name;return new M(e.id,i,t,s,e.instantiate)}}}buildShapeBpmnActivity(t,e,s,o){const i=Ns(t);return E.isSubProcess(e)?this.buildShapeBpmnSubProcess(t,s,As(o,t),i):E.isCallActivity(e)?this.buildShapeBpmnCallActivity(t,s,i):new de(t.id,t.name,e,s,t.instantiate,i)}buildShapeBpmnCallActivity(t,e,s){const o=this.convertedElements.findGlobalTask(t.calledElement);if(!o){const i=new H(t.id,t.name,J.CALLING_PROCESS,e,s);return this.callActivitiesCallingProcess.set(t.calledElement,i),i}return new H(t.id,t.name,J.CALLING_GLOBAL_TASK,e,s,o)}buildShapeBpmnEvent(t,e,s){const o=this.getEventDefinitions(t),i=[...o.entries()].map(([,r])=>r.length).reduce((r,l)=>r+l,0);if(i==0&&E.canHaveNoneEvent(e))return new D(t.id,t.name,e,y.NONE,s);if(i==1){const[r,l]=[...o.entries()][0],a=E.isCatchEvent(e)?this.buildShapeBpmnCatchEvent(t,e,r,s):this.buildShapeBpmnThrowEvent(t,e,r,s);return r===y.LINK&&(l[0].id||l[0].target||l[0].source)&&this.eventsByLinkEventDefinition.set(l[0],a),a}}buildShapeBpmnCatchEvent(t,e,s,o){return E.isBoundaryEvent(e)?this.buildShapeBpmnBoundaryEvent(t,s):E.isStartEvent(e)?new st(t.id,t.name,s,o,t.isInterrupting):new Se(t.id,t.name,s,o)}buildShapeBpmnThrowEvent(t,e,s,o){return E.isIntermediateThrowEvent(e)?new Ie(t.id,t.name,s,o):new D(t.id,t.name,e,s,o)}buildShapeBpmnBoundaryEvent(t,e){const s=this.convertedElements.findFlowNode(t.attachedToRef);if(E.isActivity(s==null?void 0:s.kind))return new ot(t.id,t.name,e,t.attachedToRef,t.cancelActivity);this.parsingMessageCollector.warning(new as(t.id,t.attachedToRef,s==null?void 0:s.kind))}getEventDefinitions(t){const e=new Map;for(const s of Je){const o=t[`${s}EventDefinition`];e.set(s,S(o,!0))}for(const s of S(t.eventDefinitionRef)){const o=this.convertedElements.findEventDefinitionOfDefinition(s);o&&e.get(o.kind).push(o)}for(const[s]of[...e.entries()].filter(([,o])=>o.length===0))e.delete(s);return e}buildShapeBpmnSubProcess(t,e,s,o){const i=new ne(t.id,t.name,s,e,o);return this.buildProcessInnerElements(t,t.id),i}buildLaneSetBpmnElements(t,e,s){for(const o of S(t))this.buildLaneBpmnElements(o.lane,e,s)}buildLaneBpmnElements(t,e,s){var o;for(const i of S(t)){const r=new M(i.id,i.name,d.LANE,e);this.convertedElements.registerLane(r),e||this.elementsWithoutParentByProcessId.get(s).push(r),this.assignParentOfLaneFlowNodes(i),(o=i.childLaneSet)!=null&&o.lane&&this.buildLaneBpmnElements(i.childLaneSet.lane,i.id,s)}}assignParentOfLaneFlowNodes(t){for(const e of S(t.flowNodeRef)){const s=this.convertedElements.findFlowNode(e),o=t.id;s?E.isBoundaryEvent(s.kind)||(s.parentId=o):this.parsingMessageCollector.warning(new ls(o,e))}}buildSequenceFlows(t){for(const e of S(t)){const s=this.getSequenceFlowKind(e);this.convertedElements.registerSequenceFlow(new et(e.id,e.name,e.sourceRef,e.targetRef,s))}}getSequenceFlowKind(t){if(this.defaultSequenceFlowIds.includes(t.id))return x.DEFAULT;{const e=this.convertedElements.findFlowNode(t.sourceRef);if(e&&E.isWithDefaultSequenceFlow(e.kind)&&t.conditionExpression)return E.isActivity(e.kind)?x.CONDITIONAL_FROM_ACTIVITY:x.CONDITIONAL_FROM_GATEWAY}return x.NORMAL}}const Ns=n=>{const t=[],e=n.standardLoopCharacteristics,s=S(n.multiInstanceLoopCharacteristics,!0)[0];return e!==void 0?t.push(_.LOOP):s&&t.push(s.isSequential?_.MULTI_INSTANCE_SEQUENTIAL:_.MULTI_INSTANCE_PARALLEL),t};class _s{constructor(t,e,s,o,i,r){this.categoryConverter=t,this.collaborationConverter=e,this.eventDefinitionConverter=s,this.globalTaskConverter=o,this.processConverter=i,this.diagramConverter=r}parse(t){const e=t.definitions;return this.categoryConverter.deserialize(e),this.collaborationConverter.deserialize(e.collaboration),this.eventDefinitionConverter.deserialize(e),this.globalTaskConverter.deserialize(e),this.processConverter.deserialize(e.process),this.diagramConverter.deserialize(e.BPMNDiagram)}}function ys(n){const t=new cs;return new _s(new ts(t),new us(t,n),new Cs(t),new ms(t),new Ls(t,n),new ps(t,n))}const Tt=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ws=Tt+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Rs="["+Tt+"]["+ws+"]*",bs=new RegExp("^"+Rs+"$");function pt(n,t){const e=[];let s=t.exec(n);for(;s;){const o=[];o.startIndex=t.lastIndex-s[0].length;const i=s.length;for(let r=0;r"u")};function Fs(n){return typeof n<"u"}const Ps={allowBooleanAttributes:!1,unpairedTags:[]};function ks(n,t){t=Object.assign({},Ps,t);const e=[];let s=!1,o=!1;n[0]==="\uFEFF"&&(n=n.substr(1));for(let i=0;i"&&n[i]!==" "&&n[i]!==" "&&n[i]!==` +`&&n[i]!=="\r";i++)a+=n[i];if(a=a.trim(),a[a.length-1]==="/"&&(a=a.substring(0,a.length-1),i--),!Us(a)){let f;return a.trim().length===0?f="Invalid space after '<'.":f="Tag '"+a+"' is an invalid name.",N("InvalidTag",f,w(n,i))}const h=xs(n,i);if(h===!1)return N("InvalidAttr","Attributes for '"+a+"' have open quote.",w(n,i));let u=h.value;if(i=h.index,u[u.length-1]==="/"){const f=i-u.length;u=u.substring(0,u.length-1);const p=$e(u,t);if(p===!0)s=!0;else return N(p.err.code,p.err.msg,w(n,f+p.err.line))}else if(l)if(h.tagClosed){if(u.trim().length>0)return N("InvalidTag","Closing tag '"+a+"' can't have attributes or invalid starting.",w(n,r));if(e.length===0)return N("InvalidTag","Closing tag '"+a+"' has not been opened.",w(n,r));{const f=e.pop();if(a!==f.tagName){let p=w(n,f.tagStartPos);return N("InvalidTag","Expected closing tag '"+f.tagName+"' (opened in line "+p.line+", col "+p.col+") instead of closing tag '"+a+"'.",w(n,r))}e.length==0&&(o=!0)}}else return N("InvalidTag","Closing tag '"+a+"' doesn't have proper closing.",w(n,i));else{const f=$e(u,t);if(f!==!0)return N(f.err.code,f.err.msg,w(n,i-u.length+f.err.line));if(o===!0)return N("InvalidXml","Multiple possible root nodes found.",w(n,i));t.unpairedTags.indexOf(a)!==-1||e.push({tagName:a,tagStartPos:r}),s=!0}for(i++;i0)return N("InvalidXml","Invalid '"+JSON.stringify(e.map(i=>i.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return N("InvalidXml","Start tag expected.",1);return!0}function Xe(n){return n===" "||n===" "||n===` +`||n==="\r"}function Ze(n,t){const e=t;for(;t5&&s==="xml")return N("InvalidXml","XML declaration allowed only at the start of the document.",w(n,t));if(n[t]=="?"&&n[t+1]==">"){t++;break}else continue}return t}function je(n,t){if(n.length>t+5&&n[t+1]==="-"&&n[t+2]==="-"){for(t+=3;t"){t+=2;break}}else if(n.length>t+8&&n[t+1]==="D"&&n[t+2]==="O"&&n[t+3]==="C"&&n[t+4]==="T"&&n[t+5]==="Y"&&n[t+6]==="P"&&n[t+7]==="E"){let e=1;for(t+=8;t"&&(e--,e===0))break}else if(n.length>t+9&&n[t+1]==="["&&n[t+2]==="C"&&n[t+3]==="D"&&n[t+4]==="A"&&n[t+5]==="T"&&n[t+6]==="A"&&n[t+7]==="["){for(t+=8;t"){t+=2;break}}return t}const Bs='"',Ms="'";function xs(n,t){let e="",s="",o=!1;for(;t"&&s===""){o=!0;break}e+=n[t]}return s!==""?!1:{value:e,index:t,tagClosed:o}}const Ys=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function $e(n,t){const e=pt(n,Ys),s={};for(let o=0;o!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,t,e){return n}},Hs=function(n){return Object.assign({},Ws,n)};class q{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}function Ks(n,t){const e={};if(n[t+3]==="O"&&n[t+4]==="C"&&n[t+5]==="T"&&n[t+6]==="Y"&&n[t+7]==="P"&&n[t+8]==="E"){t=t+9;let s=1,o=!1,i=!1,r="";for(;t"){if(i?n[t-1]==="-"&&n[t-2]==="-"&&(i=!1,s--):s--,s===0)break}else n[t]==="["?o=!0:r+=n[t];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:e,i:t}}function zs(n,t){let e="";for(;t0&&o&&e[2]!==".")return n;if(!t.leadingZeros&&i.length>0&&!o&&e[1]!==".")return n;if(t.leadingZeros&&i===n)return 0;{const l=Number(e),a=""+l;return a.search(/[eE]/)!==-1?t.eNotation?l:n:e.indexOf(".")!==-1?a==="0"&&r===""||a===r||o&&a==="-"+r?l:n:i?r===a||o+r===a?l:n:e===a||e===o+a?l:n}}else return n}}function so(n){return n&&n.indexOf(".")!==-1&&(n=n.replace(/0+$/,""),n==="."?n="0":n[0]==="."?n="0"+n:n[n.length-1]==="."&&(n=n.substr(0,n.length-1))),n}function oo(n,t){if(parseInt)return parseInt(n,t);if(Number.parseInt)return Number.parseInt(n,t);if(window&&window.parseInt)return window.parseInt(n,t);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function io(n){return typeof n=="function"?n:Array.isArray(n)?t=>{for(const e of n)if(typeof e=="string"&&t===e||e instanceof RegExp&&e.test(t))return!0}:()=>!1}class ro{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,s)=>String.fromCharCode(Number.parseInt(s,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,s)=>String.fromCharCode(Number.parseInt(s,16))}},this.addExternalEntities=lo,this.parseXml=fo,this.parseTextData=ao,this.resolveNameSpace=co,this.buildAttributesMap=ho,this.isItStopNode=Eo,this.replaceEntitiesValue=To,this.readStopNodeData=Io,this.saveTextToParentTag=po,this.addChild=go,this.ignoreAttributesFn=io(this.options.ignoreAttributes)}}function lo(n){const t=Object.keys(n);for(let e=0;e0)){r||(n=this.replaceEntitiesValue(n));const l=this.options.tagValueProcessor(t,n,e,o,i);return l==null?n:typeof l!=typeof n||l!==n?l:this.options.trimValues?Le(n,this.options.parseTagValue,this.options.numberParseOptions):n.trim()===n?Le(n,this.options.parseTagValue,this.options.numberParseOptions):n}}function co(n){if(this.options.removeNSPrefix){const t=n.split(":"),e=n.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(n=e+t[1])}return n}const uo=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function ho(n,t,e){if(this.options.ignoreAttributes!==!0&&typeof n=="string"){const s=pt(n,uo),o=s.length,i={};for(let r=0;r",i,"Closing Tag is not closed.");let a=n.substring(i+2,l).trim();if(this.options.removeNSPrefix){const f=a.indexOf(":");f!==-1&&(a=a.substr(f+1))}this.options.transformTagName&&(a=this.options.transformTagName(a)),e&&(s=this.saveTextToParentTag(s,e,o));const h=o.substring(o.lastIndexOf(".")+1);if(a&&this.options.unpairedTags.indexOf(a)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let u=0;h&&this.options.unpairedTags.indexOf(h)!==-1?(u=o.lastIndexOf(".",o.lastIndexOf(".")-1),this.tagsNodeStack.pop()):u=o.lastIndexOf("."),o=o.substring(0,u),e=this.tagsNodeStack.pop(),s="",i=l}else if(n[i+1]==="?"){let l=Oe(n,i,!1,"?>");if(!l)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,e,o),!(this.options.ignoreDeclaration&&l.tagName==="?xml"||this.options.ignorePiTags)){const a=new q(l.tagName);a.add(this.options.textNodeName,""),l.tagName!==l.tagExp&&l.attrExpPresent&&(a[":@"]=this.buildAttributesMap(l.tagExp,o,l.tagName)),this.addChild(e,a,o)}i=l.closeIndex+1}else if(n.substr(i+1,3)==="!--"){const l=W(n,"-->",i+4,"Comment is not closed.");if(this.options.commentPropName){const a=n.substring(i+4,l-2);s=this.saveTextToParentTag(s,e,o),e.add(this.options.commentPropName,[{[this.options.textNodeName]:a}])}i=l}else if(n.substr(i+1,2)==="!D"){const l=Ks(n,i);this.docTypeEntities=l.entities,i=l.i}else if(n.substr(i+1,2)==="!["){const l=W(n,"]]>",i,"CDATA is not closed.")-2,a=n.substring(i+9,l);s=this.saveTextToParentTag(s,e,o);let h=this.parseTextData(a,e.tagname,o,!0,!1,!0,!0);h==null&&(h=""),this.options.cdataPropName?e.add(this.options.cdataPropName,[{[this.options.textNodeName]:a}]):e.add(this.options.textNodeName,h),i=l+2}else{let l=Oe(n,i,this.options.removeNSPrefix),a=l.tagName;const h=l.rawTagName;let u=l.tagExp,f=l.attrExpPresent,p=l.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),e&&s&&e.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,e,o,!1));const m=e;if(m&&this.options.unpairedTags.indexOf(m.tagname)!==-1&&(e=this.tagsNodeStack.pop(),o=o.substring(0,o.lastIndexOf("."))),a!==t.tagname&&(o+=o?"."+a:a),this.isItStopNode(this.options.stopNodes,o,a)){let C="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)a[a.length-1]==="/"?(a=a.substr(0,a.length-1),o=o.substr(0,o.length-1),u=a):u=u.substr(0,u.length-1),i=l.closeIndex;else if(this.options.unpairedTags.indexOf(a)!==-1)i=l.closeIndex;else{const j=this.readStopNodeData(n,h,p+1);if(!j)throw new Error(`Unexpected end of ${h}`);i=j.i,C=j.tagContent}const b=new q(a);a!==u&&f&&(b[":@"]=this.buildAttributesMap(u,o,a)),C&&(C=this.parseTextData(C,a,o,!0,f,!0,!0)),o=o.substr(0,o.lastIndexOf(".")),b.add(this.options.textNodeName,C),this.addChild(e,b,o)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){a[a.length-1]==="/"?(a=a.substr(0,a.length-1),o=o.substr(0,o.length-1),u=a):u=u.substr(0,u.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const C=new q(a);a!==u&&f&&(C[":@"]=this.buildAttributesMap(u,o,a)),this.addChild(e,C,o),o=o.substr(0,o.lastIndexOf("."))}else{const C=new q(a);this.tagsNodeStack.push(e),a!==u&&f&&(C[":@"]=this.buildAttributesMap(u,o,a)),this.addChild(e,C,o),e=C}s="",i=p}}else s+=n[i];return t.child};function go(n,t,e){const s=this.options.updateTag(t.tagname,e,t[":@"]);s===!1||(typeof s=="string"&&(t.tagname=s),n.addChild(t))}const To=function(n){if(this.options.processEntities){for(let t in this.docTypeEntities){const e=this.docTypeEntities[t];n=n.replace(e.regx,e.val)}for(let t in this.lastEntities){const e=this.lastEntities[t];n=n.replace(e.regex,e.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const e=this.htmlEntities[t];n=n.replace(e.regex,e.val)}n=n.replace(this.ampEntity.regex,this.ampEntity.val)}return n};function po(n,t,e,s){return n&&(s===void 0&&(s=t.child.length===0),n=this.parseTextData(n,t.tagname,e,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,s),n!==void 0&&n!==""&&t.add(this.options.textNodeName,n),n=""),n}function Eo(n,t,e){const s="*."+e;for(const o in n){const i=n[o];if(s===i||t===i)return!0}return!1}function So(n,t,e=">"){let s,o="";for(let i=t;i",e,`${t} is not closed`);if(n.substring(e+2,i).trim()===t&&(o--,o===0))return{tagContent:n.substring(s,e),i};e=i}else if(n[e+1]==="?")e=W(n,"?>",e+1,"StopNode is not closed.");else if(n.substr(e+1,3)==="!--")e=W(n,"-->",e+3,"StopNode is not closed.");else if(n.substr(e+1,2)==="![")e=W(n,"]]>",e,"StopNode is not closed.")-2;else{const i=Oe(n,e,">");i&&((i&&i.tagName)===t&&i.tagExp[i.tagExp.length-1]!=="/"&&o++,e=i.closeIndex)}}function Le(n,t,e){if(t&&typeof n=="string"){const s=n.trim();return s==="true"?!0:s==="false"?!1:no(n,e)}else return Fs(n)?n:""}function Co(n,t){return Et(n,t)}function Et(n,t,e){let s;const o={};for(let i=0;i0&&(o[t.textNodeName]=s):s!==void 0&&(o[t.textNodeName]=s),o}function mo(n){const t=Object.keys(n);for(let e=0;e"},{regex:/&(lt|#60|#x3c|#x3C);/g,val:"<"},{regex:/&(quot|#34|#x22);/g,val:'"'}],No=new Set(["BPMNShape.Bounds","BPMNShape.BPMNLabel.Bounds","BPMNEdge.BPMNLabel.Bounds","BPMNEdge.waypoint"].map(n=>`definitions.BPMNDiagram.BPMNPlane.${n}`)),_o=new Set(["x","y","width","height"]),yo=(n,t)=>No.has(t)&&_o.has(n);class wo{constructor(t){g(this,"x2jOptions",{attributeNamePrefix:"",removeNSPrefix:!0,ignoreAttributes:!1,parseAttributeValue:!0,processEntities:!1,attributeValueProcessor:(t,e,s)=>yo(t,s)?Number(e):this.processAttribute(e)});g(this,"xmlParser",new Oo(this.x2jOptions));this.options=t}parse(t){let e;try{e=this.xmlParser.parse(t)}catch{throw new Error("XML parsing failed. Invalid BPMN source.")}if(!e.definitions)throw new Error("XML parsing failed. Unable to retrieve 'definitions' from the BPMN source.");return e}processAttribute(t){var e;for(const s of Lo)t=t.replace(s.regex,s.val);return(e=this.options)!=null&&e.additionalXmlAttributeProcessor&&(t=this.options.additionalXmlAttributeProcessor(t)),t}}class Ro{constructor(t,e){this.jsonParser=t,this.xmlParser=e}parse(t){const e=this.xmlParser.parse(t);return this.jsonParser.parse(e)}}function bo(n){return new Ro(ys(new ns(n)),new wo(n))}function Fo(n){return new Po(n)}class Po{constructor(t){this.graph=t}updateAndRefreshCssClassesOfCell(t,e){this.updateAndRefreshCssClassesOfElement(t,e),this.updateAndRefreshCssClassesOfElement(we(t),e)}updateAndRefreshCssClassesOfElement(t,e){const s=this.graph.getModel(),o=s.getCell(t);if(!o)return;let i=o.getStyle();i=R(i,I.EXTRA_CSS_CLASSES,e.join(",")),s.setStyle(o,i)}}function ko(n){return new Bo(Fo(n),new Mo)}class Bo{constructor(t,e){this.cssClassesUpdater=t,this.cssClassesCache=e}clearCache(){this.cssClassesCache.clear()}addCssClasses(t,e){this.updateCssClasses(t,e,this.cssClassesCache.addClassNames)}removeCssClasses(t,e){this.updateCssClasses(t,e,this.cssClassesCache.removeClassNames)}removeAllCssClasses(t){if(t||t=="")for(const e of S(t)){const s=this.cssClassesCache.removeAllClassNames(e);this.updateCellIfChanged(s,e)}else{const e=this.cssClassesCache.getBpmnIds();this.cssClassesCache.clear();for(const s of e)this.updateCellIfChanged(!0,s)}}toggleCssClasses(t,e){this.updateCssClasses(t,e,this.cssClassesCache.toggleClassNames)}updateCssClasses(t,e,s){const o=S(e);for(const i of S(t))this.updateCellIfChanged(s(i,o),i)}updateCellIfChanged(t,e){if(t){const s=this.cssClassesCache.getClassNames(e);this.cssClassesUpdater.updateAndRefreshCssClassesOfCell(e,s)}}}class Mo{constructor(){g(this,"classNamesByBpmnId",new Map);g(this,"clear",()=>{this.classNamesByBpmnId.clear()});g(this,"addClassNames",(t,e)=>this.updateClassNames(t,e,(s,o)=>s.add(o)));g(this,"removeClassNames",(t,e)=>this.updateClassNames(t,e,(s,o)=>s.delete(o)));g(this,"toggleClassNames",(t,e)=>(this.updateClassNames(t,e,(s,o)=>s.has(o)?s.delete(o):s.add(o)),e&&e.length>0))}getClassNames(t){return this.classNamesByBpmnId.has(t)?[...this.classNamesByBpmnId.get(t)]:[]}getBpmnIds(){return[...this.classNamesByBpmnId.keys()]}removeAllClassNames(t){const e=this.getOrInitializeClassNames(t),s=e.size;return e.clear(),e.sizexo.get(n.position),Go=(n,t)=>{t&&(n.fill.color=t.color??n.fill.color,n.fill.opacity=t.opacity??n.fill.opacity)},Vo=(n,t)=>{t&&(n.stroke.color=t.color??n.stroke.color,n.stroke.width=t.width??n.stroke.width)},Do=(n,t)=>{t&&(n.font.color=t.color??n.font.color,n.font.size=t.size??n.font.size)},Uo=n=>{const t={fill:{color:T.DEFAULT_OVERLAY_FILL_COLOR.valueOf(),opacity:T.DEFAULT_OVERLAY_FILL_OPACITY.valueOf()},stroke:{color:T.DEFAULT_OVERLAY_STROKE_COLOR.valueOf(),width:T.DEFAULT_OVERLAY_STROKE_WIDTH.valueOf()},font:{color:T.DEFAULT_OVERLAY_FONT_COLOR.valueOf(),size:T.DEFAULT_OVERLAY_FONT_SIZE.valueOf()}},e=n.style,s={...t};return e&&(Go(s,e.fill),Vo(s,e.stroke),Do(s,e.font)),s};class Wo{convert(t){const e=Yo(t),s=Uo(t);return{position:e,style:s}}}function Ho(n){return new Ko(n,new Wo)}class Ko{constructor(t,e){this.graph=t,this.overlayConverter=e}addOverlays(t,e){const s=this.graph.getModel().getCell(t);if(s)for(const o of S(e)){const i=new ct(o.label,this.overlayConverter.convert(o));this.graph.addCellOverlay(s,i)}}removeAllOverlays(t){const e=this.graph.getModel().getCell(t);e&&this.graph.removeCellOverlays(e)}}function zo(n){return new Xo(Ho(n))}class Xo{constructor(t){this.overlaysUpdater=t}addOverlays(t,e){this.overlaysUpdater.addOverlays(t,e)}removeAllOverlays(t){this.overlaysUpdater.removeAllOverlays(t)}}class Zo{element(t){return`svg > g > g > g[data-bpmn-id="${t}"]`}elementsOfKind(t){return`svg > g > g > g.${t}:not(.bpmn-label)`}}function jo(n){return new $o(n,new qo(n.getModel()))}const qe=n=>{const t=S(n);return t.push(...t.map(e=>we(e))),t};class $o{constructor(t,e){this.graph=t,this.styleManager=e}clear(){this.styleManager.clear()}updateStyle(t,e){if(!e)return;const s=this.graph.getModel(),o=qe(t).map(i=>s.getCell(i)).filter(Boolean);o.length!==0&&this.graph.batchUpdate(()=>{for(const i of o){this.styleManager.ensureStyleIsStored(i);let r=i.getStyle();r=R(r,c.STYLE_OPACITY,e.opacity,he),r=zt(r,e.stroke),r=Xt(r,e.font),qt(e)&&(r=$t(r,e.fill)),s.setStyle(i,r)}})}resetStyle(t){this.graph.batchUpdate(()=>{if(t||t=="")for(const e of qe(t))this.styleManager.resetStyleIfIsStored(e);else this.styleManager.resetAllStyles()})}}const Qe=I.EXTRA_CSS_CLASSES;class qo{constructor(t){g(this,"stylesCache",new Map);this.model=t}clear(){this.stylesCache.clear()}resetAllStyles(){for(const t of this.stylesCache.keys())this.resetStyle(t,this.stylesCache.get(t))}resetStyleIfIsStored(t){const e=this.stylesCache.get(t);e&&this.resetStyle(t,e)}resetStyle(t,e){const s=this.model.getCell(t),o=Zt(s.getStyle(),Qe,""),i=R(e,Qe,o);this.model.setStyle(s,i),this.stylesCache.delete(t)}ensureStyleIsStored(t){const e=t.getId();this.stylesCache.has(e)||this.stylesCache.set(e,t.getStyle())}}function Qo(n){return new Jo(jo(n))}class Jo{constructor(t){this.styleUpdater=t}clearCache(){this.styleUpdater.clear()}updateStyle(t,e){this.styleUpdater.updateStyle(t,e)}resetStyle(t){this.styleUpdater.resetStyle(t)}}function ei(n,t){return new ti(n,new ni(t.container,new Zo),ko(t),zo(t),Qo(t))}class ti{constructor(t,e,s,o,i){this.bpmnModelRegistry=t,this.htmlElementRegistry=e,this.cssClassesRegistry=s,this.overlaysRegistry=o,this.styleRegistry=i,this.bpmnModelRegistry.registerOnLoadCallback(()=>{this.cssClassesRegistry.clearCache(),this.styleRegistry.clearCache()})}getModelElementsByIds(t){return ge(t).map(e=>this.bpmnModelRegistry.getBpmnSemantic(e)).filter(Boolean)}getElementsByIds(t){return this.getModelElementsByIds(t).map(e=>({bpmnSemantic:e,htmlElement:this.htmlElementRegistry.getBpmnHtmlElement(e.id)}))}getModelElementsByKinds(t){return ge(t).flatMap(e=>this.htmlElementRegistry.getBpmnHtmlElements(e)).map(e=>this.getRelatedBpmnSemantic(e))}getElementsByKinds(t){return ge(t).flatMap(e=>this.htmlElementRegistry.getBpmnHtmlElements(e)).map(e=>({htmlElement:e,bpmnSemantic:this.getRelatedBpmnSemantic(e)}))}getRelatedBpmnSemantic(t){return this.bpmnModelRegistry.getBpmnSemantic(t.dataset.bpmnId)}addCssClasses(t,e){this.cssClassesRegistry.addCssClasses(t,e)}removeCssClasses(t,e){this.cssClassesRegistry.removeCssClasses(t,e)}removeAllCssClasses(t){this.cssClassesRegistry.removeAllCssClasses(t)}toggleCssClasses(t,e){this.cssClassesRegistry.toggleCssClasses(t,e)}addOverlays(t,e){this.overlaysRegistry.addOverlays(t,e)}removeAllOverlays(t){this.overlaysRegistry.removeAllOverlays(t)}updateStyle(t,e){this.styleRegistry.updateStyle(t,e)}resetStyle(t){this.styleRegistry.resetStyle(t)}}class ni{constructor(t,e){this.container=t,this.querySelectors=e}getBpmnHtmlElement(t){return this.container.querySelector(this.querySelectors.element(t))}getBpmnHtmlElements(t){const e=this.querySelectors.elementsOfKind(Ce(t));return[...this.container.querySelectorAll(e)]}}const ge=n=>[...new Set(S(n))];class si{filter(t,e){const s=[],o=[];for(const m of S(e==null?void 0:e.pools).filter(C=>C&&Object.keys(C).length>0))m.id?s.push(m.id):m.name&&o.push(m.name);if(s.length===0&&o.length===0)return t;const{filteredPools:i,filteredPoolIds:r}=oi(t,s,o),l=[...s,...r],{filteredLanes:a,filteredLaneIds:h,filteredFlowNodes:u,filteredFlowNodeIds:f}=St(t.lanes,t.flowNodes,l),p=ri(t.edges,[...l,...h,...f]);if(i.length===0&&a.length===0&&u.length===0&&p.length===0){let m=s.length>0?` for ids [${s}]`:"";const C=m?" and":"";throw m+=o.length>0?`${C} for names [${o}]`:"",new Error("No matching pools"+m)}return{lanes:a,flowNodes:u,pools:i,edges:p}}}function oi(n,t,e){const s=n.pools.filter(i=>t.includes(i.bpmnElement.id)||e.includes(i.bpmnElement.name)),o=s.map(i=>i.bpmnElement.id);return{filteredPools:s,filteredPoolIds:o}}function St(n,t,e){const{filteredLanes:s,filteredLaneIds:o}=It(n,e),{filteredLanes:i,filteredLaneIds:r,filteredFlowNodes:l,filteredFlowNodeIds:a}=ii(t,[...e,...o],n);return s.push(...i),o.push(...r),{filteredLanes:s,filteredLaneIds:o,filteredFlowNodes:l,filteredFlowNodeIds:a}}function It(n,t){const e=n.filter(o=>t.includes(o.bpmnElement.parentId)),s=e.map(o=>o.bpmnElement.id);if(e.length>0){const{filteredLanes:o,filteredLaneIds:i}=It(n,s);e.push(...o),s.push(...i)}return{filteredLanes:e,filteredLaneIds:s}}function ii(n,t,e){const s=n.filter(h=>t.includes(h.bpmnElement.parentId));if(s.length===0)return{filteredLanes:[],filteredLaneIds:[],filteredFlowNodes:[],filteredFlowNodeIds:[]};const o=s.map(h=>h.bpmnElement.id),{filteredLanes:i,filteredLaneIds:r,filteredFlowNodes:l,filteredFlowNodeIds:a}=St(e,n,o);return s.push(...l),o.push(...a),{filteredLanes:i,filteredLaneIds:r,filteredFlowNodes:s,filteredFlowNodeIds:o}}function ri(n,t){return n.filter(e=>t.includes(e.bpmnElement.sourceReferenceId)&&t.includes(e.bpmnElement.targetReferenceId))}class li{constructor(){g(this,"searchableModel");g(this,"onLoadCallback")}load(t,e){var o;const s=new si().filter(t,e);return this.searchableModel=new ci(s),(o=this.onLoadCallback)==null||o.call(this),ai(s)}registerOnLoadCallback(t){this.onLoadCallback=t}getBpmnSemantic(t){var i;const e=(i=this.searchableModel)==null?void 0:i.elementById(t);if(!e)return;const s=e.bpmnElement,o=s instanceof M;return{id:t,isShape:o,kind:s.kind,name:s.name,...s instanceof ue?{sourceRefId:s.sourceReferenceId,targetRefId:s.targetReferenceId}:{callActivityGlobalTaskKind:s instanceof H?s.globalTaskKind:void 0,callActivityKind:s instanceof H?s.callActivityKind:void 0,eventDefinitionKind:s instanceof D?s.eventDefinitionKind:void 0,linkEventSourceIds:s instanceof Se&&s.eventDefinitionKind==y.LINK?s.sourceIds:void 0,linkEventTargetId:s instanceof Ie?s.targetId:void 0,incomingIds:s.incomingIds,outgoingIds:s.outgoingIds,parentId:s.parentId,subProcessKind:s instanceof ne?s.subProcessKind:void 0}}}}function ai(n){const t=new Set(n.flowNodes.filter(i=>{const r=i.bpmnElement;return E.isSubProcess(r.kind)&&r.markers.includes(_.EXPAND)}).map(i=>i.bpmnElement.id)),e=[],s=[],o=[];for(const i of n.flowNodes){const r=i.bpmnElement.kind;E.isSubProcess(r)?e.push(i):E.isBoundaryEvent(r)?s.push(i):t.has(i.bpmnElement.parentId)||o.push(i)}return{boundaryEvents:s,edges:n.edges,lanes:n.lanes,otherFlowNodes:o,pools:n.pools,subprocesses:e}}class ci{constructor(t){g(this,"elements",new Map);for(const e of[...t.pools,...t.lanes,...t.flowNodes,...t.edges])this.elements.set(e.bpmnElement.id,e)}elementById(t){return this.elements.get(t)}}class ui{constructor(t){g(this,"graph");g(this,"navigation");g(this,"bpmnElementsRegistry");g(this,"bpmnModelRegistry");g(this,"parserOptions");g(this,"rendererOptions");this.rendererOptions=t==null?void 0:t.renderer;const e=new Jn(Pt(t==null?void 0:t.container));this.graph=e.configure(t),this.navigation=new es(this.graph),this.bpmnModelRegistry=new li,this.bpmnElementsRegistry=ei(this.bpmnModelRegistry,this.graph),this.parserOptions=t==null?void 0:t.parser}load(t,e){const s=bo(this.parserOptions).parse(t),o=this.bpmnModelRegistry.load(s,e==null?void 0:e.modelFilter);ln(this.graph,this.rendererOptions).render(o,e==null?void 0:e.fit)}}function bi(n){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(n,1):document.addEventListener("DOMContentLoaded",n)}function A(n,...t){ke("[DEMO]",n,...t)}function ke(n,t,...e){console.info(`${n} ${t}`,...e)}function F(n,...t){ke("[DEMO STARTUP]",n,...t)}function Ct(n,t){mt(n),window.alert(n)}function mt(n){console.error("[DEMO]",n)}function z(n,...t){ke("[DEMO DOWNLOAD]",n,...t)}async function di(n){A(`Fetching BPMN content from url ${n}`);const t=await fetch(n);if(!t.ok)throw new Error(`HTTP status ${t.status}`);return await t.text()}function At(n,t,e){const s=document.createElement("a");t.startsWith("data:image/svg+xml")&&(e=encodeURIComponent(e),t+=","),s.setAttribute("href",t+e),s.setAttribute("download",n),s.style.display="none",document.body.append(s),s.click(),s.remove()}function hi(n){z("Start SVG download"),At("diagram.svg","data:image/svg+xml",n),z("Download completed")}function fi(n){z("Start PNG download");const t=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),e=URL.createObjectURL(t),s=document.createElement("img");s.setAttribute("style","position: absolute; top: -9999px"),s.crossOrigin="anonymous",document.body.append(s);const o=document.createElement("canvas"),i=o.getContext("2d");s.addEventListener("load",function(){const r=new Image;o.width=s.naturalWidth,o.height=s.naturalHeight,r.crossOrigin="Anonymous",r.addEventListener("load",function(){i.drawImage(r,0,0),URL.revokeObjectURL(e);const l=o.toDataURL("image/png");s.remove(),At("diagram.png","",l),z("Download completed")}),r.src=s.src}),s.src=e}class gi{constructor(t,e,s,o){g(this,"document");g(this,"head");this.window=t,this.outerContainerId=e,this.containerToFade=s,this.dropCallback=o,this.document=t.document,this.head=document.head,this.initializeDragAndDrop()}initializeDragAndDrop(){this.containerToFade.classList.add("faded-container"),this.addDomElements(this.containerToFade),this.addStyle();const t=document.querySelector(`#${this.outerContainerId}`);this.preventDefaultsOnEvents(["dragover","drop"],this.window),this.preventDefaultsOnEvents(["dragover","dragleave","drop"],t),this.addEventsOnDropContainer(t,this.containerToFade),this.addEventsOnDocument(this.outerContainerId,this.containerToFade)}preventDefaults(t){t.preventDefault(),t.stopPropagation()}preventDefaultsOnEvents(t,e){for(const s of t)e.addEventListener(s,this.preventDefaults.bind(this),!1)}addDomElements(t){const e=this.document.createElement("p");e.textContent="open BPMN diagram";const s=this.document.createElement("div");s.classList.add("drop-here-text"),s.append(e);const o=this.document.createElement("div");o.id=this.outerContainerId,o.append(s),t.parentNode.prepend(o)}addStyle(){const t=` .faded-container { opacity: 1; } @@ -47,7 +44,7 @@ var cn=Object.defineProperty;var un=(n,t,e)=>t in n?cn(n,t,{enumerable:!0,config align-items: center; border: 2px dashed rgba(0,0,0,.2); border-radius: 7px; -}`,e=document.createElement("style");e.append(document.createTextNode(t)),this.head.append(e)}addEventsOnDropContainer(t,e){t.addEventListener("dragover",this.getAddClassCallback(e,!1),!1),t.addEventListener("mousedown",this.getRemoveClassCallback(e,!1),!1),t.addEventListener("drop",this.getDropCallbackForElement(e,!1,this.dropCallback),!1)}addEventsOnDocument(t,e){this.document.addEventListener("dragover",this.getAddClassCallback(e,!0,t),!1),this.document.addEventListener("dragleave",this.getRemoveClassCallback(e,!0,t),!1),this.document.addEventListener("drop",this.getDropCallbackForElement(e,!0,this.dropCallback,t),!1)}getAddClassCallback(t,e,s){return function(){e?this.querySelector("#"+s).classList.add("dragging"):this.classList.add("dragging"),t.classList.add("faded")}}getRemoveClassCallback(t,e,s){return function(){e?this.querySelector("#"+s).classList.remove("dragging"):this.classList.remove("dragging"),t.classList.remove("faded")}}getDropCallbackForElement(t,e,s,i){return function(o){try{const r=o.dataTransfer.files;s(r[0])}catch(a){const r=a instanceof Error?a.message:String(a);tn(r)}finally{e?this.querySelector("#"+i).classList.remove("dragging"):this.classList.remove("dragging"),t.classList.remove("faded")}}}}class on{constructor(t){this.graph=t}exportSvg(){return this.doSvgExport(!0)}exportSvgForPng(){const t=In.IS_FF;return this.doSvgExport(t)}doSvgExport(t){const e=this.computeSvg({scale:1,border:25,enableForeignObjectForLabel:t});return` +}`,e=document.createElement("style");e.append(document.createTextNode(t)),this.head.append(e)}addEventsOnDropContainer(t,e){t.addEventListener("dragover",this.getAddClassCallback(e,!1),!1),t.addEventListener("mousedown",this.getRemoveClassCallback(e,!1),!1),t.addEventListener("drop",this.getDropCallbackForElement(e,!1,this.dropCallback),!1)}addEventsOnDocument(t,e){this.document.addEventListener("dragover",this.getAddClassCallback(e,!0,t),!1),this.document.addEventListener("dragleave",this.getRemoveClassCallback(e,!0,t),!1),this.document.addEventListener("drop",this.getDropCallbackForElement(e,!0,this.dropCallback,t),!1)}getAddClassCallback(t,e,s){return function(){e?this.querySelector("#"+s).classList.add("dragging"):this.classList.add("dragging"),t.classList.add("faded")}}getRemoveClassCallback(t,e,s){return function(){e?this.querySelector("#"+s).classList.remove("dragging"):this.classList.remove("dragging"),t.classList.remove("faded")}}getDropCallbackForElement(t,e,s,o){return function(i){try{const l=i.dataTransfer.files;s(l[0])}catch(r){const l=r instanceof Error?r.message:String(r);Ct(l)}finally{e?this.querySelector("#"+o).classList.remove("dragging"):this.classList.remove("dragging"),t.classList.remove("faded")}}}}class vt{constructor(t){this.graph=t}exportSvg(){return this.doSvgExport(!0)}exportSvgForPng(){const t=Vt.IS_FF;return this.doSvgExport(t)}doSvgExport(t){const e=this.computeSvg({scale:1,border:25,enableForeignObjectForLabel:t});return` -${Y.getXml(e)} -`}computeSvg(t){const e=t.scale??1,s=t.border??0,i=t.crisp??!0,o=t.enableForeignObjectForLabel??!0,a=this.graph.getGraphBounds(),r=this.graph.view.scale,l=Y.createXmlDocument(),c=l.createElementNS(u.NS_SVG,"svg"),f=e/r,T=Math.max(1,Math.ceil(a.width*f)+2*s),p=Math.max(1,Math.ceil(a.height*f)+2*s);c.setAttribute("version","1.1"),c.setAttribute("width",T+"px"),c.setAttribute("height",p+"px"),c.setAttribute("viewBox",(i?"-0.5 -0.5":"0 0")+" "+T+" "+p),l.append(c);const S=l.createElementNS(u.NS_SVG,"g");c.append(S);const O=this.createSvgCanvas(S);O.foEnabled=o,O.foOffset=i?-.5:0,O.textOffset=i?-.5:0,O.imageOffset=i?-.5:0,O.translate(Math.floor((s/e-a.x)/r),Math.floor((s/e-a.y)/r)),O.scale(f);const L=new D.mxImageExport;return L.includeOverlays=!0,L.drawState(this.graph.getView().getState(this.graph.model.root),O),l}createSvgCanvas(t){const e=new uo(t);return e.pointerEvents=!0,e}}class uo extends Qe{constructor(e){super(e);y(this,"htmlConverter",document.createElement("div"))}getAlternateText(e,s,i,o,a,r,l,c,f,T,p,S,O){return this.computeTruncatedText(r,o)}plainText(e,s,i,o,a,r,l,c,f,T,p,S){a=this.computeTruncatedText(a,i),super.plainText(e,s,i,o,a,r,l,c,f,T,p,S)}computeTruncatedText(e,s){if(e==null||this.state.fontSize<=0)return"";try{this.htmlConverter.innerHTML=e,e=Y.extractTextWithWhitespace(this.htmlConverter.childNodes);const i=Math.ceil(2*s/this.state.fontSize),o=[];let a=0,r=0;for(;(i==0||a0)break}else o.push(e.charAt(r)),l<255&&a++;r++}o.length1&&(e=Y.trim(o.join(""))+"...")}catch(i){console.warn("Error while computing txt label",i)}return e}}const ho=new Map([["dark",{defaultFillColor:"#334352",defaultFontColor:"white",defaultStrokeColor:"#c0ddeb",endEventFillColor:"pink",endEventStrokeColor:"FireBrick",startEventFillColor:"DarkSeaGreen",startEventStrokeColor:"DarkGreen",taskAndCallActivityFillColor:"#5c8599",laneFillColor:"#2b3742",poolFillColor:"#232b33"}],["brown",{defaultFillColor:"#ede7e1",defaultFontColor:"#414666",defaultStrokeColor:"#414666",flowColor:"#666666",catchAndThrowEventStrokeColor:"#377f87",endEventFillColor:"pink",endEventStrokeColor:"FireBrick",startEventFillColor:"DarkSeaGreen",startEventStrokeColor:"DarkGreen",taskAndCallActivityFillColor:"#dadce8",laneFillColor:"#d4c3b2",poolFillColor:"#d1b9a1"}],["light-blue",{defaultFillColor:"#ffffff",defaultFontColor:"#002395",defaultStrokeColor:"#002395",endEventFillColor:"#f9dadc",endEventStrokeColor:"#e20613",startEventFillColor:"#ffffff",startEventStrokeColor:"#05d99e",taskAndCallActivityFillColor:"rgba(132,158,253,0.1)",textAnnotationFillColor:"rgba(237,237,245,0.5)",laneFillColor:"#edeef5",poolFillColor:"#dbefff"}]]);class fo extends oo{configureTheme(t){if(t=="default")return new qt(this.graph).configureStyles(),!0;const e=ho.get(t);if(!e)return!1;const s=this.graph.getStylesheet();for(const f of F.eventKinds()){let T,p;switch(f){case"endEvent":{T=e.endEventFillColor,p=e.endEventStrokeColor;break}case"startEvent":{T=e.startEventFillColor,p=e.startEventStrokeColor;break}case"intermediateCatchEvent":case"intermediateThrowEvent":case"boundaryEvent":{T=e.defaultFillColor,p=e.catchAndThrowEventStrokeColor??e.defaultStrokeColor;break}default:{T=e.defaultFillColor,p=e.defaultStrokeColor;break}}const S=s.styles[f];S.fillColor=T,S.strokeColor=p}for(const f of F.taskKinds()){const T=s.styles[f];T.fillColor=e.taskAndCallActivityFillColor}const i=s.styles[C.CALL_ACTIVITY];i.fillColor=e.taskAndCallActivityFillColor;const o=s.styles[C.TEXT_ANNOTATION];o.fillColor=e.textAnnotationFillColor??R.TEXT_ANNOTATION_FILL_COLOR;const a=s.styles[C.POOL];a.fillColor=e.poolFillColor,a.swimlaneFillColor=e.defaultFillColor;const r=s.styles[C.LANE];r.fillColor=e.laneFillColor;const l=s.getDefaultVertexStyle();l.fontColor=e.defaultFontColor,l.fillColor=e.defaultFillColor,l.strokeColor=e.defaultStrokeColor;const c=s.getDefaultEdgeStyle();return c.fontColor=e.defaultFontColor,c.fillColor=e.defaultFillColor,c.strokeColor=e.flowColor??e.defaultStrokeColor,!0}configureSequenceFlowColor(t){q(`Use dedicated ${t} color for sequence flows`);const s=this.graph.getStylesheet().styles[Z.SEQUENCE_FLOW];s[u.STYLE_STROKECOLOR]=t,s[u.STYLE_FILLCOLOR]=t,q("Sequence flows style updated")}}let G,ne={},rt,lt,Ae,j;function yo(n){V("Updating load options"),ne.fit=n,V("Load options updated",ne)}function wo(){return{...ne}}function Ro(){return Ae}function bo(n){V("Switching theme from %s to %s",Ae,n),G.configureTheme(n)?(G.graph.refresh(),V("Theme switch done"),Ae=n):V("Unknown theme, do nothing")}function rn(n,t=!0){V("Loading bpmn...");try{G.load(n,ne),V("BPMN loaded with configuration",ne),To(lt),document.dispatchEvent(new CustomEvent("diagramLoaded"))}catch(e){if(t)rt(`Cannot load the BPMN diagram: ${e instanceof Error?e.message:String(e)}`);else throw e}}function Fo(n){V("Fitting..."),G.navigation.fit(n),V("Fit done with configuration",n)}function Po(n){V(`Zooming '${n}'...`),G.navigation.zoom(n),V("Zoom done")}function xo(n){return G.bpmnElementsRegistry.getModelElementsByKinds(n)}function go(n){return G.bpmnElementsRegistry.getModelElementsByIds(n)}function ln(n){const t=G.graph.model,e=t.getCell(n);return t.getParent(e)}function ko(n){return n.map(t=>ln(t).getId()).filter((t,e,s)=>s.indexOf(t)===e)}function Bo(n){var s;const t=ln(n),e=go(t.getId());return e&&((s=e[0])==null?void 0:s.kind)===C.SUB_PROCESS}function Mo(n,t){return G.bpmnElementsRegistry.addCssClasses(n,t)}function Vo(n,t){return G.bpmnElementsRegistry.removeCssClasses(n,t)}function Yo(n,t){return G.bpmnElementsRegistry.addOverlays(n,[t])}function Go(n){return G.bpmnElementsRegistry.removeAllOverlays(n)}function To(n){if(!lt)return;V("Updating model, bpmnElement to collapse:",n);const t=G.graph.getModel(),e=t.getCell(n);if(e){t.beginUpdate();try{t.setCollapsed(e,!0)}finally{t.endUpdate()}V("Model updated")}else V("Element not found in the model, do nothing")}function an(n){n.text().then(t=>{rn(t)}).catch(t=>{throw t})}function Do(n){const t=n.target.files;if(t&&t.length>0){const e=t[0];an(e)}}function po(n){ro(n).catch(t=>{throw new Error(`Unable to fetch ${n}. ${t}`)}).then(t=>(V("BPMN content fetched"),t)).then(t=>{rn(t,!1),V(`BPMN content loaded from url ${n}`)}).then(()=>{No()}).catch(t=>{rt(t.message)})}function Uo(n){tn(n)}function Eo(n){nn(n)}function So(n,t){var o;const e=((o=n.loadOptions)==null?void 0:o.fit)??{},s=t.get("fitTypeOnLoad");s&&(e.type=s);const i=t.get("fitMargin");return i&&(e.margin=Number(i)),e}function mo(n){if(n.get("style.container.alternative.background.color")=="true"){const o="yellow";q("Use alternative color for the bpmn container background, color",o);const a=G.graph.container;a.style.backgroundColor=o,q("Bpmn container style updated")}const e=n.get("style.theme");q(`Configuring the '${e}' BPMN theme`),G.configureTheme(e)?(Ae=e,q(`'${e}' BPMN theme configured`)):q(`Unknown '${e}' BPMN theme, skipping configuration`),n.get("style.seqFlow.light.colors")=="true"&&G.configureSequenceFlowColor("#E9E9E9"),q('Configuring the "Update Style" API from query parameters'),[...n.keys()].some(o=>o.startsWith("style.api."))?(j={stroke:{},font:{},fill:{}},n.get("style.api.stroke.color")&&(j.stroke.color=n.get("style.api.stroke.color")),n.get("style.api.font.color")&&(j.font.color=n.get("style.api.font.color")),n.get("style.api.font.opacity")&&(j.font.opacity=Number(n.get("style.api.font.opacity"))),n.get("style.api.fill.color")?j.fill.color=n.get("style.api.fill.color"):n.get("style.api.fill.color.startColor")&&n.get("style.api.fill.color.endColor")&&n.get("style.api.fill.color.direction")&&(j.fill.color={startColor:n.get("style.api.fill.color.startColor"),endColor:n.get("style.api.fill.color.endColor"),direction:n.get("style.api.fill.color.direction")}),n.get("style.api.fill.opacity")&&(j.fill.opacity=Number(n.get("style.api.fill.opacity"))),q('Prepared "Update Style" API object',j)):q('No query parameters, do not set the "Update Style" API object')}function Co(n){lt=n.get("bpmn.element.id.collapsed")}function Io(n){const t=n.get("bpmn.filter.pool.ids");if(!t)return;const e=t.split(",");return V("Configuring load options to only include pool id: ",e),{pools:e.map(s=>({id:s}))}}function Wo(n){const t=q;t("Initializing BpmnVisualization with container:",n.globalOptions.container);const e=new URLSearchParams(window.location.search),s=e.get("renderer.ignore.bpmn.colors");if(s){const o=s==="true";t('Ignore support for "BPMN in Color"?',o),!n.globalOptions.renderer&&(n.globalOptions.renderer={}),n.globalOptions.renderer.ignoreBpmnColors=o}G=new fo(n.globalOptions),t("Initialization completed"),new co(window,"drop-container",G.graph.container,an),t("Drag&Drop support initialized"),rt=n.statusKoNotifier??Eo,t("Configuring Load Options"),ne=n.loadOptions??{},ne.fit=So(n,e),ne.modelFilter=Io(e),mo(e),Co(e),t("Checking if an 'url to fetch BPMN content' is provided as query parameter");const i=e.get("url");if(i){const o=decodeURIComponent(i);po(o);return}t("No 'url to fetch BPMN content' provided")}function Ho(){le("Trigger SVG Download"),lo(new on(G.graph).exportSvg())}function Ko(){le("Trigger PNG Download"),ao(new on(G.graph).exportSvgForPng())}function Ao(n,t){V("Applying style using the style API: %O",t),G.bpmnElementsRegistry.updateStyle(n,t),V("New style applied on: %O",n)}function zo(n){V("Resetting styles using the style API!"),G.bpmnElementsRegistry.resetStyle(n),V("Styles reset")}function No(){if(j){const n=Oo();V("Number of elements whose style is to be updated",n.length),Ao(n,j)}}function Oo(){V("Retrieving ids of all BPMN elements");const n=[...Object.values(C),...Object.values(Z)],t=G.bpmnElementsRegistry.getModelElementsByKinds(n).map(e=>e.id);return V("All BPMN elements ids retrieved:",t.length),t}export{ue as F,C as S,fn as Z,bo as a,Ro as b,Go as c,_o as d,Mo as e,Fo as f,wo as g,Do as h,Ho as i,Ko as j,Bo as k,V as l,In as m,xo as n,Ao as o,F as p,ko as q,Vo as r,Wo as s,zo as t,yo as u,Wn as v,Uo as w,Yo as x,Po as z}; +${v.getXml(e)} +`}computeSvg(t){const e=t.scale??1,s=t.border??0,o=t.crisp??!0,i=t.enableForeignObjectForLabel??!0,r=this.graph.getGraphBounds(),l=this.graph.view.scale,a=v.createXmlDocument(),h=a.createElementNS(c.NS_SVG,"svg"),u=e/l,f=Math.max(1,Math.ceil(r.width*u)+2*s),p=Math.max(1,Math.ceil(r.height*u)+2*s);h.setAttribute("version","1.1"),h.setAttribute("width",f+"px"),h.setAttribute("height",p+"px"),h.setAttribute("viewBox",(o?"-0.5 -0.5":"0 0")+" "+f+" "+p),a.append(h);const m=a.createElementNS(c.NS_SVG,"g");h.append(m);const C=this.createSvgCanvas(m);C.foEnabled=i,C.foOffset=o?-.5:0,C.textOffset=o?-.5:0,C.imageOffset=o?-.5:0,C.translate(Math.floor((s/e-r.x)/l),Math.floor((s/e-r.y)/l)),C.scale(u);const b=new L.mxImageExport;return b.includeOverlays=!0,b.drawState(this.graph.getView().getState(this.graph.model.root),C),a}createSvgCanvas(t){const e=new Ti(t);return e.pointerEvents=!0,e}}class Ti extends ye{constructor(e){super(e);g(this,"htmlConverter",document.createElement("div"))}getAlternateText(e,s,o,i,r,l,a,h,u,f,p,m,C){return this.computeTruncatedText(l,i)}plainText(e,s,o,i,r,l,a,h,u,f,p,m){r=this.computeTruncatedText(r,o),super.plainText(e,s,o,i,r,l,a,h,u,f,p,m)}computeTruncatedText(e,s){if(e==null||this.state.fontSize<=0)return"";try{this.htmlConverter.innerHTML=e,e=v.extractTextWithWhitespace(this.htmlConverter.childNodes);const o=Math.ceil(2*s/this.state.fontSize),i=[];let r=0,l=0;for(;(o==0||r0)break}else i.push(e.charAt(l)),a<255&&r++;l++}i.length1&&(e=v.trim(i.join(""))+"...")}catch(o){console.warn("Error while computing txt label",o)}return e}}const pi=new Map([["dark",{defaultFillColor:"#334352",defaultFontColor:"white",defaultStrokeColor:"#c0ddeb",endEventFillColor:"pink",endEventStrokeColor:"FireBrick",startEventFillColor:"DarkSeaGreen",startEventStrokeColor:"DarkGreen",taskAndCallActivityFillColor:"#5c8599",laneFillColor:"#2b3742",poolFillColor:"#232b33"}],["brown",{defaultFillColor:"#ede7e1",defaultFontColor:"#414666",defaultStrokeColor:"#414666",flowColor:"#666666",catchAndThrowEventStrokeColor:"#377f87",endEventFillColor:"pink",endEventStrokeColor:"FireBrick",startEventFillColor:"DarkSeaGreen",startEventStrokeColor:"DarkGreen",taskAndCallActivityFillColor:"#dadce8",laneFillColor:"#d4c3b2",poolFillColor:"#d1b9a1"}],["light-blue",{defaultFillColor:"#ffffff",defaultFontColor:"#002395",defaultStrokeColor:"#002395",endEventFillColor:"#f9dadc",endEventStrokeColor:"#e20613",startEventFillColor:"#ffffff",startEventStrokeColor:"#05d99e",taskAndCallActivityFillColor:"rgba(132,158,253,0.1)",textAnnotationFillColor:"rgba(237,237,245,0.5)",laneFillColor:"#edeef5",poolFillColor:"#dbefff"}]]);class Ei extends ui{configureTheme(t){if(t=="default")return new ht(this.graph).configureStyles(),!0;const e=pi.get(t);if(!e)return!1;const s=this.graph.getStylesheet();for(const u of E.eventKinds()){let f,p;switch(u){case"endEvent":{f=e.endEventFillColor,p=e.endEventStrokeColor;break}case"startEvent":{f=e.startEventFillColor,p=e.startEventStrokeColor;break}case"intermediateCatchEvent":case"intermediateThrowEvent":case"boundaryEvent":{f=e.defaultFillColor,p=e.catchAndThrowEventStrokeColor??e.defaultStrokeColor;break}default:{f=e.defaultFillColor,p=e.defaultStrokeColor;break}}const m=s.styles[u];m.fillColor=f,m.strokeColor=p}for(const u of E.taskKinds()){const f=s.styles[u];f.fillColor=e.taskAndCallActivityFillColor}const o=s.styles[d.CALL_ACTIVITY];o.fillColor=e.taskAndCallActivityFillColor;const i=s.styles[d.TEXT_ANNOTATION];i.fillColor=e.textAnnotationFillColor??T.TEXT_ANNOTATION_FILL_COLOR;const r=s.styles[d.POOL];r.fillColor=e.poolFillColor,r.swimlaneFillColor=e.defaultFillColor;const l=s.styles[d.LANE];l.fillColor=e.laneFillColor;const a=s.getDefaultVertexStyle();a.fontColor=e.defaultFontColor,a.fillColor=e.defaultFillColor,a.strokeColor=e.defaultStrokeColor;const h=s.getDefaultEdgeStyle();return h.fontColor=e.defaultFontColor,h.fillColor=e.defaultFillColor,h.strokeColor=e.flowColor??e.defaultStrokeColor,!0}configureSequenceFlowColor(t){F(`Use dedicated ${t} color for sequence flows`);const s=this.graph.getStylesheet().styles[k.SEQUENCE_FLOW];s[c.STYLE_STROKECOLOR]=t,s[c.STYLE_FILLCOLOR]=t,F("Sequence flows style updated")}}let O,V={},Be,Me,ce,B;function Fi(n){A("Updating load options"),V.fit=n,A("Load options updated",V)}function Pi(){return{...V}}function ki(){return ce}function Bi(n){A("Switching theme from %s to %s",ce,n),O.configureTheme(n)?(O.graph.refresh(),A("Theme switch done"),ce=n):A("Unknown theme, do nothing")}function Ot(n,t=!0){A("Loading bpmn...");try{O.load(n,V),A("BPMN loaded with configuration",V),Ii(Me),document.dispatchEvent(new CustomEvent("diagramLoaded"))}catch(e){if(t)Be(`Cannot load the BPMN diagram: ${e instanceof Error?e.message:String(e)}`);else throw e}}function Mi(n){A("Fitting..."),O.navigation.fit(n),A("Fit done with configuration",n)}function xi(n){A(`Zooming '${n}'...`),O.navigation.zoom(n),A("Zoom done")}function Yi(n){return O.bpmnElementsRegistry.getModelElementsByKinds(n)}function Si(n){return O.bpmnElementsRegistry.getModelElementsByIds(n)}function Lt(n){const t=O.graph.model,e=t.getCell(n);return t.getParent(e)}function Gi(n){return n.map(t=>Lt(t).getId()).filter((t,e,s)=>s.indexOf(t)===e)}function Vi(n){var s;const t=Lt(n),e=Si(t.getId());return e&&((s=e[0])==null?void 0:s.kind)===d.SUB_PROCESS}function Di(n,t){return O.bpmnElementsRegistry.addCssClasses(n,t)}function Ui(n,t){return O.bpmnElementsRegistry.removeCssClasses(n,t)}function Wi(n,t){return O.bpmnElementsRegistry.addOverlays(n,[t])}function Hi(n){return O.bpmnElementsRegistry.removeAllOverlays(n)}function Ii(n){if(!Me)return;A("Updating model, bpmnElement to collapse:",n);const t=O.graph.getModel(),e=t.getCell(n);if(e){t.beginUpdate();try{t.setCollapsed(e,!0)}finally{t.endUpdate()}A("Model updated")}else A("Element not found in the model, do nothing")}function Nt(n){n.text().then(t=>{Ot(t)}).catch(t=>{throw t})}function Ki(n){const t=n.target.files;if(t&&t.length>0){const e=t[0];Nt(e)}}function Ci(n){di(n).catch(t=>{throw new Error(`Unable to fetch ${n}. ${t}`)}).then(t=>(A("BPMN content fetched"),t)).then(t=>{Ot(t,!1),A(`BPMN content loaded from url ${n}`)}).then(()=>{_i()}).catch(t=>{Be(t.message)})}function zi(n){Ct(n)}function mi(n){mt(n)}function Ai(n,t){var i;const e=((i=n.loadOptions)==null?void 0:i.fit)??{},s=t.get("fitTypeOnLoad");s&&(e.type=s);const o=t.get("fitMargin");return o&&(e.margin=Number(o)),e}function vi(n){if(n.get("style.container.alternative.background.color")=="true"){const i="yellow";F("Use alternative color for the bpmn container background, color",i);const r=O.graph.container;r.style.backgroundColor=i,F("Bpmn container style updated")}const e=n.get("style.theme");F(`Configuring the '${e}' BPMN theme`),O.configureTheme(e)?(ce=e,F(`'${e}' BPMN theme configured`)):F(`Unknown '${e}' BPMN theme, skipping configuration`),n.get("style.seqFlow.light.colors")=="true"&&O.configureSequenceFlowColor("#E9E9E9"),F('Configuring the "Update Style" API from query parameters'),[...n.keys()].some(i=>i.startsWith("style.api."))?(B={stroke:{},font:{},fill:{}},n.get("style.api.stroke.color")&&(B.stroke.color=n.get("style.api.stroke.color")),n.get("style.api.font.color")&&(B.font.color=n.get("style.api.font.color")),n.get("style.api.font.opacity")&&(B.font.opacity=Number(n.get("style.api.font.opacity"))),n.get("style.api.fill.color")?B.fill.color=n.get("style.api.fill.color"):n.get("style.api.fill.color.startColor")&&n.get("style.api.fill.color.endColor")&&n.get("style.api.fill.color.direction")&&(B.fill.color={startColor:n.get("style.api.fill.color.startColor"),endColor:n.get("style.api.fill.color.endColor"),direction:n.get("style.api.fill.color.direction")}),n.get("style.api.fill.opacity")&&(B.fill.opacity=Number(n.get("style.api.fill.opacity"))),F('Prepared "Update Style" API object',B)):F('No query parameters, do not set the "Update Style" API object')}function Oi(n){Me=n.get("bpmn.element.id.collapsed")}function Li(n){const t=n.get("bpmn.filter.pool.ids");if(!t)return;const e=t.split(",");return A("Configuring load options to only include pool id: ",e),{pools:e.map(s=>({id:s}))}}function Xi(n){const t=F;t("Initializing BpmnVisualization with container:",n.globalOptions.container);const e=new URLSearchParams(window.location.search),s=e.get("renderer.ignore.bpmn.colors");if(s){const i=s==="true";t('Ignore support for "BPMN in Color"?',i),!n.globalOptions.renderer&&(n.globalOptions.renderer={}),n.globalOptions.renderer.ignoreBpmnColors=i}O=new Ei(n.globalOptions),t("Initialization completed"),new gi(window,"drop-container",O.graph.container,Nt),t("Drag&Drop support initialized"),Be=n.statusKoNotifier??mi,t("Configuring Load Options"),V=n.loadOptions??{},V.fit=Ai(n,e),V.modelFilter=Li(e),vi(e),Oi(e),t("Checking if an 'url to fetch BPMN content' is provided as query parameter");const o=e.get("url");if(o){const i=decodeURIComponent(o);Ci(i);return}t("No 'url to fetch BPMN content' provided")}function Zi(){z("Trigger SVG Download"),hi(new vt(O.graph).exportSvg())}function ji(){z("Trigger PNG Download"),fi(new vt(O.graph).exportSvgForPng())}function Ni(n,t){A("Applying style using the style API: %O",t),O.bpmnElementsRegistry.updateStyle(n,t),A("New style applied on: %O",n)}function $i(n){A("Resetting styles using the style API!"),O.bpmnElementsRegistry.resetStyle(n),A("Styles reset")}function _i(){if(B){const n=yi();A("Number of elements whose style is to be updated",n.length),Ni(n,B)}}function yi(){A("Retrieving ids of all BPMN elements");const n=[...Object.values(d),...Object.values(k)],t=O.bpmnElementsRegistry.getModelElementsByKinds(n).map(e=>e.id);return A("All BPMN elements ids retrieved:",t.length),t}export{Q as F,E as S,Ft as Z,Bi as a,ki as b,Hi as c,bi as d,Di as e,Mi as f,Pi as g,Ki as h,Zi as i,ji as j,Yi as k,A as l,Vt as m,$i as n,Vi as o,Ni as p,Gi as q,Ui as r,Xi as s,Wi as t,Fi as u,cn as v,zi as w,d as x,xi as z}; diff --git a/demo/load-and-navigation/assets/mxgraph.js b/demo/load-and-navigation/assets/mxgraph.js index 90542533..49713aac 100644 --- a/demo/load-and-navigation/assets/mxgraph.js +++ b/demo/load-and-navigation/assets/mxgraph.js @@ -13,7 +13,7 @@ function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.has `}else e+=i+" = "+t[i]+` `}catch(r){e+=i+"="+r.message}return e},toRadians:function(t){return Math.PI*t/180},toDegree:function(t){return t*180/Math.PI},arcToCurves:function(t,e,i,n,r,s,l,a,o){if(a-=t,o-=e,i===0||n===0)return N;var u=l,p=r;i=Math.abs(i),n=Math.abs(n);var m=-a/2,d=-o/2,x=Math.cos(p*Math.PI/180),f=Math.sin(p*Math.PI/180),g=x*m+f*d,c=-1*f*m+x*d,v=g*g,y=c*c,T=i*i,C=n*n,S=v/T+y/C,E;if(S>1)i=Math.sqrt(S)*i,n=Math.sqrt(S)*n,E=0;else{var L=1;s===u&&(L=-1),E=L*Math.sqrt((T*C-T*y-C*v)/(T*y+C*v))}var A=E*i*c/n,M=-1*E*n*g/i,I=x*A-f*M+a/2,P=f*A+x*M+o/2,R=Math.atan2((c-M)/n,(g-A)/i)-Math.atan2(0,1),O=R>=0?R:2*Math.PI+R;R=Math.atan2((-c-M)/n,(-g-A)/i)-Math.atan2((c-M)/n,(g-A)/i);var _=R>=0?R:2*Math.PI+R;u==0&&_>0?_-=2*Math.PI:u!=0&&_<0&&(_+=2*Math.PI);for(var b=_*2/Math.PI,k=Math.ceil(b<0?-1*b:b),G=_/k,B=8/3*Math.sin(G/4)*Math.sin(G/4)/Math.sin(G/2),j=x*i,H=x*n,W=f*i,X=f*n,V=Math.cos(O),Y=Math.sin(O),et=-B*(j*Y+X*V),q=-B*(W*Y-H*V),K=0,Z=0,N=[],D=0;D45?(u=1,o>=135&&(u=2)):o<-45&&(u=3,o<=-135&&(u=2)),s.indexOf(mxConstants.DIRECTION_NORTH)>=0)switch(u){case 0:l|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:l|=mxConstants.DIRECTION_MASK_EAST;break;case 2:l|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:l|=mxConstants.DIRECTION_MASK_WEST;break}if(s.indexOf(mxConstants.DIRECTION_WEST)>=0)switch(u){case 0:l|=mxConstants.DIRECTION_MASK_WEST;break;case 1:l|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:l|=mxConstants.DIRECTION_MASK_EAST;break;case 3:l|=mxConstants.DIRECTION_MASK_SOUTH;break}if(s.indexOf(mxConstants.DIRECTION_SOUTH)>=0)switch(u){case 0:l|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:l|=mxConstants.DIRECTION_MASK_WEST;break;case 2:l|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:l|=mxConstants.DIRECTION_MASK_EAST;break}if(s.indexOf(mxConstants.DIRECTION_EAST)>=0)switch(u){case 0:l|=mxConstants.DIRECTION_MASK_EAST;break;case 1:l|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:l|=mxConstants.DIRECTION_MASK_WEST;break;case 3:l|=mxConstants.DIRECTION_MASK_NORTH;break}return l},reversePortConstraints:function(t){var e=0;return e=(t&mxConstants.DIRECTION_MASK_WEST)<<3,e|=(t&mxConstants.DIRECTION_MASK_NORTH)<<1,e|=(t&mxConstants.DIRECTION_MASK_SOUTH)>>1,e|=(t&mxConstants.DIRECTION_MASK_EAST)>>3,e},findNearestSegment:function(t,e,i){var n=-1;if(t.absolutePoints.length>0)for(var r=t.absolutePoints[0],s=null,l=1;lo.distSq)&&(n=o)}}return n!=null?n.p:null},rectangleIntersectsSegment:function(t,e,i){var n=t.y,r=t.x,s=n+t.height,l=r+t.width,a=e.x,o=i.x;if(e.x>i.x&&(a=i.x,o=e.x),o>l&&(o=l),ao)return!1;var u=e.y,p=i.y,m=i.x-e.x;if(Math.abs(m)>1e-7){var d=(i.y-e.y)/m,x=e.y-d*e.x;u=d*a+x,p=d*o+x}if(u>p){var f=p;p=u,u=f}return p>s&&(p=s),up)},contains:function(t,e,i){return t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i},intersects:function(t,e){var i=t.width,n=t.height,r=e.width,s=e.height;if(r<=0||s<=0||i<=0||n<=0)return!1;var l=t.x,a=t.y,o=e.x,u=e.y;return r+=o,s+=u,i+=l,n+=a,(rl)&&(sa)&&(io)&&(nu)},intersectsHotspot:function(t,e,i,n,r,s){if(n=n??1,r=r??0,s=s??0,n>0){var l=t.getCenterX(),a=t.getCenterY(),o=t.width,u=t.height,p=mxUtils.getValue(t.style,mxConstants.STYLE_STARTSIZE)*t.view.scale;p>0&&(mxUtils.getValue(t.style,mxConstants.STYLE_HORIZONTAL,!0)?(a=t.y+p/2,u=p):(l=t.x+p/2,o=p)),o=Math.max(r,o*n),u=Math.max(r,u*n),s>0&&(o=Math.min(o,s),u=Math.min(u,s));var m=new mxRectangle(l-o/2,a-u/2,o,u),d=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0);if(d!=0){var x=Math.cos(-d),f=Math.sin(-d),l=new mxPoint(t.getCenterX(),t.getCenterY()),g=mxUtils.getRotatedPoint(new mxPoint(e,i),x,f,l);e=g.x,i=g.y}return mxUtils.contains(m,e,i)}return!0},getOffset:function(t,e){for(var i=0,n=0,r=!1,s=t,l=document.body,a=document.documentElement;s!=null&&s!=l&&s!=a&&!r;){var o=mxUtils.getCurrentStyle(s);o!=null&&(r=r||o.position=="fixed"),s=s.parentNode}if(!e&&!r){var u=mxUtils.getDocumentScrollOrigin(t.ownerDocument);i+=u.x,n+=u.y}var p=t.getBoundingClientRect();return p!=null&&(i+=p.left,n+=p.top),new mxPoint(i,n)},getDocumentScrollOrigin:function(t){if(mxClient.IS_QUIRKS)return new mxPoint(t.body.scrollLeft,t.body.scrollTop);var e=t.defaultView||t.parentWindow,i=e!=null&&window.pageXOffset!==void 0?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,n=e!=null&&window.pageYOffset!==void 0?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;return new mxPoint(i,n)},getScrollOrigin:function(t,e,i){e=e??!1,i=i??!0;for(var n=t!=null?t.ownerDocument:document,r=n.body,s=n.documentElement,l=new mxPoint,a=!1;t!=null&&t!=r&&t!=s;){!isNaN(t.scrollLeft)&&!isNaN(t.scrollTop)&&(l.x+=t.scrollLeft,l.y+=t.scrollTop);var o=mxUtils.getCurrentStyle(t);o!=null&&(a=a||o.position=="fixed"),t=e?t.parentNode:null}if(!a&&i){var u=mxUtils.getDocumentScrollOrigin(n);l.x+=u.x,l.y+=u.y}return l},convertPoint:function(t,e,i){var n=mxUtils.getScrollOrigin(t,!1),r=mxUtils.getOffset(t);return r.x-=n.x,r.y-=n.y,new mxPoint(e-r.x,i-r.y)},ltrim:function(t,e){return e=e||"\\s",t!=null?t.replace(new RegExp("^["+e+"]+","g"),""):null},rtrim:function(t,e){return e=e||"\\s",t!=null?t.replace(new RegExp("["+e+"]+$","g"),""):null},trim:function(t,e){return mxUtils.ltrim(mxUtils.rtrim(t,e),e)},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)&&(typeof t!="string"||t.toLowerCase().indexOf("0x")<0)},isInteger:function(t){return String(parseInt(t))===String(t)},mod:function(t,e){return(t%e+e)%e},intersection:function(t,e,i,n,r,s,l,a){var o=(a-s)*(i-t)-(l-r)*(n-e),u=(l-r)*(e-s)-(a-s)*(t-r),p=(i-t)*(e-s)-(n-e)*(t-r),m=u/o,d=p/o;if(m>=0&&m<=1&&d>=0&&d<=1){var x=t+m*(i-t),f=e+m*(n-e);return new mxPoint(x,f)}return null},ptSegDistSq:function(t,e,i,n,r,s){i-=t,n-=e,r-=t,s-=e;var l=r*i+s*n,a;l<=0?a=0:(r=i-r,s=n-s,l=r*i+s*n,l<=0?a=0:a=l*l/(i*i+n*n));var o=r*r+s*s-a;return o<0&&(o=0),o},ptLineDist:function(t,e,i,n,r,s){return Math.abs((n-e)*r-(i-t)*s+i*e-n*t)/Math.sqrt((n-e)*(n-e)+(i-t)*(i-t))},relativeCcw:function(t,e,i,n,r,s){i-=t,n-=e,r-=t,s-=e;var l=r*n-s*i;return l==0&&(l=r*i+s*n,l>0&&(r-=i,s-=n,l=r*i+s*n,l<0&&(l=0))),l<0?-1:l>0?1:0},animateChanges:function(t,e){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(t,e,i){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(t,e,i,n,r,s){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(t,e){mxUtils.isVml(t)?e>=100?t.style.filter="":t.style.filter="alpha(opacity="+e/5+")":mxClient.IS_IE&&(typeof document.documentMode>"u"||document.documentMode<9)?e>=100?t.style.filter="":t.style.filter="alpha(opacity="+e+")":t.style.opacity=e/100},createImage:function(t){var e=null;return mxClient.IS_IE6&&document.compatMode!="CSS1Compat"?(e=document.createElement(mxClient.VML_PREFIX+":image"),e.setAttribute("src",t),e.style.borderStyle="none"):(e=document.createElement("img"),e.setAttribute("src",t),e.setAttribute("border","0")),e},sortCells:function(t,e){e=e??!0;var i=new mxDictionary;return t.sort(function(n,r){var s=i.get(n);s==null&&(s=mxCellPath.create(n).split(mxCellPath.PATH_SEPARATOR),i.put(n,s));var l=i.get(r);l==null&&(l=mxCellPath.create(r).split(mxCellPath.PATH_SEPARATOR),i.put(r,l));var a=mxCellPath.compare(s,l);return a==0?0:a>0==e?1:-1}),t},getStylename:function(t){if(t!=null){var e=t.split(";"),i=e[0];if(i.indexOf("=")<0)return i}return""},getStylenames:function(t){var e=[];if(t!=null)for(var i=t.split(";"),n=0;n0&&t.charAt(t.length-1)!=";"&&(t+=";"),t+=e),t},removeStylename:function(t,e){var i=[];if(t!=null)for(var n=t.split(";"),r=0;r=0&&e.push(i[n]);return e.join(";")},setCellStyles:function(t,e,i,n){if(e!=null&&e.length>0){t.beginUpdate();try{for(var r=0;r"u"||i.length>0);if(t==null||t.length==0)n&&(t=e+"="+i+";");else if(t.substring(0,e.length+1)==e+"="){var r=t.indexOf(";");n?t=e+"="+i+(r<0?";":t.substring(r)):t=r<0||r==t.length-1?"":t.substring(r+1)}else{var s=t.indexOf(";"+e+"=");if(s<0){if(n){var l=t.charAt(t.length-1)==";"?"":";";t=t+l+e+"="+i+";"}}else{var r=t.indexOf(";",s+1);n?t=t.substring(0,s+1)+e+"="+i+(r<0?";":t.substring(r)):t=t.substring(0,s)+(r<0?";":t.substring(r))}}return t},setCellStyleFlags:function(t,e,i,n,r){if(e!=null&&e.length>0){t.beginUpdate();try{for(var s=0;s=0?t.substring(l):"")}}return t},getAlignmentAsPoint:function(t,e){var i=-.5,n=-.5;return t==mxConstants.ALIGN_LEFT?i=0:t==mxConstants.ALIGN_RIGHT&&(i=-1),e==mxConstants.ALIGN_TOP?n=0:e==mxConstants.ALIGN_BOTTOM&&(n=-1),new mxPoint(i,n)},getSizeForString:function(t,e,i,n,r){e=e??mxConstants.DEFAULT_FONTSIZE,i=i??mxConstants.DEFAULT_FONTFAMILY;var s=document.createElement("div");if(s.style.fontFamily=i,s.style.fontSize=Math.round(e)+"px",s.style.lineHeight=Math.round(e*mxConstants.LINE_HEIGHT)+"px",r!=null){(r&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(s.style.fontWeight="bold"),(r&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(s.style.fontStyle="italic");var l=[];(r&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&l.push("underline"),(r&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&l.push("line-through"),l.length>0&&(s.style.textDecoration=l.join(" "))}s.style.position="absolute",s.style.visibility="hidden",s.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",s.style.zoom="1",n!=null?(s.style.width=n+"px",s.style.whiteSpace="normal"):s.style.whiteSpace="nowrap",s.innerHTML=t,document.body.appendChild(s);var a=new mxRectangle(0,0,s.offsetWidth,s.offsetHeight);return document.body.removeChild(s),a},getViewXml:function(t,e,i,n,r){if(n=n??0,r=r??0,e=e??1,i==null){var s=t.getModel();i=[s.getRoot()]}var l=t.getView(),a=null,o=l.isEventsEnabled();l.setEventsEnabled(!1);var u=l.drawPane,p=l.overlayPane;t.dialect==mxConstants.DIALECT_SVG?(l.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),l.canvas.appendChild(l.drawPane),l.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g"),l.canvas.appendChild(l.overlayPane)):(l.drawPane=l.drawPane.cloneNode(!1),l.canvas.appendChild(l.drawPane),l.overlayPane=l.overlayPane.cloneNode(!1),l.canvas.appendChild(l.overlayPane));var m=l.getTranslate();l.translate=new mxPoint(n,r);var d=new mxTemporaryCellStates(t.getView(),e,i);try{var x=new mxCodec;a=x.encode(t.getView())}finally{d.destroy(),l.translate=m,l.canvas.removeChild(l.drawPane),l.canvas.removeChild(l.overlayPane),l.drawPane=u,l.overlayPane=p,l.setEventsEnabled(o)}return a},getScaleForPageCount:function(t,e,i,n){if(t<1)return 1;i=i??mxConstants.PAGE_FORMAT_A4_PORTRAIT,n=n??0;var r=i.width-n*2,s=i.height-n*2,l=e.getGraphBounds().clone(),a=e.getView().getScale();l.width/=a,l.height/=a;var o=l.width,u=l.height,p=1,m=r/s,d=o/u,x=d/m,f=Math.sqrt(t),g=Math.sqrt(x),c=f*g,v=f/g;if(c<1&&v>t){var y=v/t;v=t,c/=y}if(v<1&&c>t){var y=c/t;c=t,v/=y}for(var T=Math.ceil(c)*Math.ceil(v),C=0;T>t;){var S=Math.floor(c)/c,E=Math.floor(v)/v;S==1&&(S=Math.floor(c-1)/c),E==1&&(E=Math.floor(v-1)/v);var y=1;if(S>E?y=S:y=E,c=c*y,v=v*y,T=Math.ceil(c)*Math.ceil(v),C++,C>10)break}var L=r*c;return p=L/o,p*.99999},show:function(t,e,i,n,r,s){if(i=i??0,n=n??0,e==null){var l=window.open();e=l.document}else e.open();document.documentMode==9&&e.writeln('');var a=t.getGraphBounds(),o=Math.ceil(i-a.x),u=Math.ceil(n-a.y);if(r==null&&(r=Math.ceil(a.width+i)+Math.ceil(Math.ceil(a.x)-a.x)),s==null&&(s=Math.ceil(a.height+n)+Math.ceil(Math.ceil(a.y)-a.y)),mxClient.IS_IE||document.documentMode==11){for(var p="",m=document.getElementsByTagName("base"),d=0;d";for(var d=0;d',p+='
',p+=t.container.innerHTML,p+="
",e.writeln(p),e.close()}else{e.writeln("");for(var m=document.getElementsByTagName("base"),d=0;d'),e.close();var g=e.createElement("div");g.position="absolute",g.overflow="hidden",g.style.width=r+"px",g.style.height=s+"px";var c=e.createElement("div");c.style.position="absolute",c.style.left=o+"px",c.style.top=u+"px";for(var v=t.container.firstChild,y=null;v!=null;){var T=v.cloneNode(!0);v==t.view.drawPane.ownerSVGElement?(g.appendChild(T),y=T):c.appendChild(T),v=v.nextSibling}e.body.appendChild(g),c.firstChild!=null&&e.body.appendChild(c),y!=null&&(y.style.minWidth="",y.style.minHeight="",y.firstChild.setAttribute("transform","translate("+o+","+u+")"))}return mxUtils.removeCursors(e.body),e},printScreen:function(t){var e=window.open();t.getGraphBounds(),mxUtils.show(t,e.document);var i=function(){e.focus(),e.print(),e.close()};mxClient.IS_GC?e.setTimeout(i,500):i()},popup:function(t,e){if(e){var i=document.createElement("div");i.style.overflow="scroll",i.style.width="636px",i.style.height="460px";var n=document.createElement("pre");n.innerHTML=mxUtils.htmlEntities(t,!1).replace(/\n/g,"
").replace(/ /g," "),i.appendChild(n);var r=document.body.clientWidth,s=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight),l=new mxWindow("Popup Window",i,r/2-320,s/2-240,640,480,!1,!0);l.setClosable(!0),l.setVisible(!0)}else if(mxClient.IS_NS){var l=window.open();l.document.writeln("
"+mxUtils.htmlEntities(t)+"").replace(/ /g," "),l.document.body.appendChild(n)}},alert:function(t){alert(t)},prompt:function(t,e){return prompt(t,e??"")},confirm:function(t){return confirm(t)},error:function(t,e,i,n){var r=document.createElement("div");r.style.padding="20px";var s=document.createElement("img");s.setAttribute("src",n||mxUtils.errorImage),s.setAttribute("valign","bottom"),s.style.verticalAlign="middle",r.appendChild(s),r.appendChild(document.createTextNode(" ")),r.appendChild(document.createTextNode(" ")),r.appendChild(document.createTextNode(" ")),mxUtils.write(r,t);var l=document.body.clientWidth,a=document.body.clientHeight||document.documentElement.clientHeight,o=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,r,(l-e)/2,a/4,e,null,!1,!0);if(i){mxUtils.br(r);var u=document.createElement("p"),p=document.createElement("button");mxClient.IS_IE?p.style.cssText="float:right":p.setAttribute("style","float:right"),mxEvent.addListener(p,"click",function(m){o.destroy()}),mxUtils.write(p,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),u.appendChild(p),r.appendChild(u),mxUtils.br(r),o.setClosable(!0)}return o.setVisible(!0),o},makeDraggable:function(t,e,i,n,r,s,l,a,o,u){var p=new mxDragSource(t,i);return p.dragOffset=new mxPoint(r??0,s??mxConstants.TOOLTIP_VERTICAL_OFFSET),p.autoscroll=l,p.setGuidesEnabled(!1),o!=null&&(p.highlightDropTargets=o),u!=null&&(p.getDropTarget=u),p.getGraphForEvent=function(m){return typeof e=="function"?e(m):e},n!=null&&(p.createDragElement=function(){return n.cloneNode(!0)},a&&(p.createPreviewElement=function(m){var d=n.cloneNode(!0),x=parseInt(d.style.width),f=parseInt(d.style.height);return d.style.width=Math.round(x*m.view.scale)+"px",d.style.height=Math.round(f*m.view.scale)+"px",d})),p}};__mxOutput.mxUtils=typeof mxUtils<"u"?mxUtils:void 0;var mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_VML:"vml",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"gray",VML_SHADOWCOLOR:"gray",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",OUTLINE_HIGHLIGHT_COLOR:"#00FF00",OUTLINE_HIGHLIGHT_STROKEWIDTH:5,HIGHLIGHT_STROKEWIDTH:3,HIGHLIGHT_SIZE:2,HIGHLIGHT_OPACITY:100,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_TERMINAL_HANDLE:"pointer",CURSOR_BEND_HANDLE:"crosshair",CURSOR_VIRTUAL_BEND_HANDLE:"crosshair",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,DEFAULT_TEXT_DIRECTION:"",LINE_HEIGHT:1.2,WORD_WRAP:"normal",ABSOLUTE_LINE_HEIGHT:!1,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,827,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_STROKE_OPACITY:"strokeOpacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",STYLE_OVERFLOW:"overflow",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_DX:"exitDx",STYLE_EXIT_DY:"exitDy",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_DX:"entryDx",STYLE_ENTRY_DY:"entryDy",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_POINTER_EVENTS:"pointerEvents",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_MARGIN:"margin",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_WIDTH:"labelWidth",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_ENDFILL:"endFill",STYLE_STARTFILL:"startFill",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_FIX_DASH:"fixDash",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_ABSOLUTE_ARCSIZE:"absoluteArcSize",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ANCHOR_POINT_DIRECTION:"anchorPointDirection",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BACKGROUND_OUTLINE:"backgroundOutline",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_RESIZE_WIDTH:"resizeWidth",STYLE_RESIZE_HEIGHT:"resizeHeight",STYLE_ROTATABLE:"rotatable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_JETTY_SIZE:"jettySize",STYLE_SOURCE_JETTY_SIZE:"sourceJettySize",STYLE_TARGET_JETTY_SIZE:"targetJettySize",STYLE_LOOP:"loopStyle",STYLE_ORTHOGONAL_LOOP:"orthogonalLoop",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_STRIKETHROUGH:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_ARROW_CONNECTOR:"arrowConnector",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_CLASSIC_THIN:"classicThin",ARROW_BLOCK:"block",ARROW_BLOCK_THIN:"blockThin",ARROW_OPEN:"open",ARROW_OPEN_THIN:"openThin",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",TEXT_DIRECTION_DEFAULT:"",TEXT_DIRECTION_AUTO:"auto",TEXT_DIRECTION_LTR:"ltr",TEXT_DIRECTION_RTL:"rtl",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_HEXAGON:"hexagonPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};__mxOutput.mxConstants=typeof mxConstants<"u"?mxConstants:void 0;function mxEventObject(t){this.name=t,this.properties=[];for(var e=1;e0;){var i=e[0];mxEvent.removeListener(t,i.name,i.f)}},addGestureListeners:function(t,e,i,n){e!=null&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),i!=null&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",i),n!=null&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",n),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(e!=null&&mxEvent.addListener(t,"touchstart",e),i!=null&&mxEvent.addListener(t,"touchmove",i),n!=null&&mxEvent.addListener(t,"touchend",n))},removeGestureListeners:function(t,e,i,n){e!=null&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),i!=null&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",i),n!=null&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",n),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(e!=null&&mxEvent.removeListener(t,"touchstart",e),i!=null&&mxEvent.removeListener(t,"touchmove",i),n!=null&&mxEvent.removeListener(t,"touchend",n))},redirectMouseEvents:function(t,e,i,n,r,s,l){var a=function(o){return typeof i=="function"?i(o):i};mxEvent.addGestureListeners(t,function(o){n!=null?n(o):mxEvent.isConsumed(o)||e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(o,a(o)))},function(o){r!=null?r(o):mxEvent.isConsumed(o)||e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(o,a(o)))},function(o){s!=null?s(o):mxEvent.isConsumed(o)||e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(o,a(o)))}),mxEvent.addListener(t,"dblclick",function(o){if(l!=null)l(o);else if(!mxEvent.isConsumed(o)){var u=a(o);e.dblClick(o,u!=null?u.cell:null)}})},release:function(t){try{if(t!=null){mxEvent.removeAllListeners(t);var e=t.childNodes;if(e!=null)for(var i=e.length,n=0;n.5||Math.abs(a.deltaY)>.5)&&t(a,a.deltaY==0?-a.deltaX>0:-a.deltaY>0)};if(e=e??window,mxClient.IS_SF&&!mxClient.IS_TOUCH){var n=1;mxEvent.addListener(e,"gesturestart",function(a){mxEvent.consume(a),n=1}),mxEvent.addListener(e,"gesturechange",function(a){mxEvent.consume(a);var o=n-a.scale;Math.abs(o)>.2&&(t(a,o<0,!0),n=a.scale)}),mxEvent.addListener(e,"gestureend",function(a){mxEvent.consume(a)})}else{var r=[],s=0,l=0;mxEvent.addGestureListeners(e,mxUtils.bind(this,function(a){!mxEvent.isMouseEvent(a)&&a.pointerId!=null&&r.push(a)}),mxUtils.bind(this,function(a){if(!mxEvent.isMouseEvent(a)&&r.length==2){for(var o=0;omxEvent.PINCH_THRESHOLD||d>mxEvent.PINCH_THRESHOLD){var x=r[0].clientX+(r[1].clientX-r[0].clientX)/2,f=r[0].clientY+(r[1].clientY-r[0].clientY)/2;t(r[0],m>d?u>s:p>l,!0,x,f),s=u,l=p}}}),mxUtils.bind(this,function(a){r=[],s=0,l=0}))}mxEvent.addListener(e,"wheel",i)}},disableContextMenu:function(t){mxEvent.addListener(t,"contextmenu",function(e){return e.preventDefault&&e.preventDefault(),!1})},getSource:function(t){return t.srcElement!=null?t.srcElement:t.target},isConsumed:function(t){return t.isConsumed!=null&&t.isConsumed},isTouchEvent:function(t){return t.pointerType!=null?t.pointerType=="touch"||t.pointerType===t.MSPOINTER_TYPE_TOUCH:t.mozInputSource!=null?t.mozInputSource==5:t.type.indexOf("touch")==0},isPenEvent:function(t){return t.pointerType!=null?t.pointerType=="pen"||t.pointerType===t.MSPOINTER_TYPE_PEN:t.mozInputSource!=null?t.mozInputSource==2:t.type.indexOf("pen")==0},isMultiTouchEvent:function(t){return t.type!=null&&t.type.indexOf("touch")==0&&t.touches!=null&&t.touches.length>1},isMouseEvent:function(t){return t.pointerType!=null?t.pointerType=="mouse"||t.pointerType===t.MSPOINTER_TYPE_MOUSE:t.mozInputSource!=null?t.mozInputSource==1:t.type.indexOf("mouse")==0},isLeftMouseButton:function(t){return"buttons"in t&&(t.type=="mousedown"||t.type=="mousemove")?t.buttons==1:"which"in t?t.which===1:t.button===1},isMiddleMouseButton:function(t){return"which"in t?t.which===2:t.button===4},isRightMouseButton:function(t){return"which"in t?t.which===3:t.button===2},isPopupTrigger:function(t){return mxEvent.isRightMouseButton(t)||mxClient.IS_MAC&&mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)&&!mxEvent.isMetaDown(t)&&!mxEvent.isAltDown(t)},isShiftDown:function(t){return t!=null?t.shiftKey:!1},isAltDown:function(t){return t!=null?t.altKey:!1},isControlDown:function(t){return t!=null?t.ctrlKey:!1},isMetaDown:function(t){return t!=null?t.metaKey:!1},getMainEvent:function(t){return(t.type=="touchstart"||t.type=="touchmove")&&t.touches!=null&&t.touches[0]!=null?t=t.touches[0]:t.type=="touchend"&&t.changedTouches!=null&&t.changedTouches[0]!=null&&(t=t.changedTouches[0]),t},getClientX:function(t){return mxEvent.getMainEvent(t).clientX},getClientY:function(t){return mxEvent.getMainEvent(t).clientY},consume:function(t,e,i){e=e??!0,i=i??!0,e&&(t.preventDefault?(i&&t.stopPropagation(),t.preventDefault()):i&&(t.cancelBubble=!0)),t.isConsumed=!0,t.preventDefault||(t.returnValue=!1)},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,CUSTOM_HANDLE:-100,VIRTUAL_HANDLE:-1e5,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",SIZE:"size",SELECT:"select",FIRED:"fired",FIRE_MOUSE_EVENT:"fireMouseEvent",GESTURE:"gesture",TAP_AND_HOLD:"tapAndHold",GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit",END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",LAYOUT_CELLS:"layoutCells",CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled",ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",UNGROUP_CELLS:"ungroupCells",REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",EDITING_STARTED:"editingStarted",EDITING_STOPPED:"editingStopped",ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",DOUBLE_CLICK:"doubleClick",START:"start",RESET:"reset",PINCH_THRESHOLD:10};__mxOutput.mxEvent=typeof mxEvent<"u"?mxEvent:void 0;function mxXmlRequest(t,e,i,n,r,s){this.url=t,this.params=e,this.method=i||"POST",this.async=n??!0,this.username=r,this.password=s}mxXmlRequest.prototype.url=null,mxXmlRequest.prototype.params=null,mxXmlRequest.prototype.method=null,mxXmlRequest.prototype.async=null,mxXmlRequest.prototype.binary=!1,mxXmlRequest.prototype.withCredentials=!1,mxXmlRequest.prototype.username=null,mxXmlRequest.prototype.password=null,mxXmlRequest.prototype.request=null,mxXmlRequest.prototype.decodeSimulateValues=!1,mxXmlRequest.prototype.isBinary=function(){return this.binary},mxXmlRequest.prototype.setBinary=function(t){this.binary=t},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.isReady=function(){return this.request.readyState==4},mxXmlRequest.prototype.getDocumentElement=function(){var t=this.getXml();return t!=null?t.documentElement:null},mxXmlRequest.prototype.getXml=function(){var t=this.request.responseXML;return(document.documentMode>=9||t==null||t.documentElement==null)&&(t=mxUtils.parseXml(this.request.responseText)),t},mxXmlRequest.prototype.getStatus=function(){return this.request!=null?this.request.status:null},mxXmlRequest.prototype.create=function(){if(window.XMLHttpRequest)return function(){var t=new XMLHttpRequest;return this.isBinary()&&t.overrideMimeType&&t.overrideMimeType("text/plain; charset=x-user-defined"),t};if(typeof ActiveXObject<"u")return function(){return new ActiveXObject("Microsoft.XMLHTTP")}}(),mxXmlRequest.prototype.send=function(t,e,i,n){this.request=this.create(),this.request!=null&&(t!=null&&(this.request.onreadystatechange=mxUtils.bind(this,function(){this.isReady()&&(t(this),this.request.onreadystatechange=null)})),this.request.open(this.method,this.url,this.async,this.username,this.password),this.setRequestHeaders(this.request,this.params),window.XMLHttpRequest&&this.withCredentials&&(this.request.withCredentials="true"),!mxClient.IS_QUIRKS&&(document.documentMode==null||document.documentMode>9)&&window.XMLHttpRequest&&i!=null&&n!=null&&(this.request.timeout=i,this.request.ontimeout=n),this.request.send(this.params))},mxXmlRequest.prototype.setRequestHeaders=function(t,e){e!=null&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded")},mxXmlRequest.prototype.simulate=function(t,e){t=t||document;var i=null;t==document&&(i=window.onbeforeunload,window.onbeforeunload=null);var n=t.createElement("form");n.setAttribute("method",this.method),n.setAttribute("action",this.url),e!=null&&n.setAttribute("target",e),n.style.display="none",n.style.visibility="hidden";for(var r=this.params.indexOf("&")>0?this.params.split("&"):this.params.split(),s=0;s0){var a=r[s].substring(0,l),o=r[s].substring(l+1);this.decodeSimulateValues&&(o=decodeURIComponent(o));var u=t.createElement("textarea");u.setAttribute("wrap","off"),u.setAttribute("name",a),mxUtils.write(u,o),n.appendChild(u)}}t.body.appendChild(n),n.submit(),n.parentNode!=null&&n.parentNode.removeChild(n),i!=null&&(window.onbeforeunload=i)},__mxOutput.mxXmlRequest=typeof mxXmlRequest<"u"?mxXmlRequest:void 0;var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,setCells:function(t){mxClipboard.cells=t},getCells:function(){return mxClipboard.cells},isEmpty:function(){return mxClipboard.getCells()==null},cut:function(t,e){return e=mxClipboard.copy(t,e),mxClipboard.insertCount=0,mxClipboard.removeCells(t,e),e},removeCells:function(t,e){t.removeCells(e)},copy:function(t,e){e=e||t.getSelectionCells();var i=t.getExportableCells(t.model.getTopmostCells(e));return mxClipboard.insertCount=1,mxClipboard.setCells(t.cloneCells(i)),i},paste:function(t){var e=null;if(!mxClipboard.isEmpty()){e=t.getImportableCells(mxClipboard.getCells());var i=mxClipboard.insertCount*mxClipboard.STEPSIZE,n=t.getDefaultParent();e=t.importCells(e,i,i,n),mxClipboard.insertCount++,t.setSelectionCells(e)}return e}};__mxOutput.mxClipboard=typeof mxClipboard<"u"?mxClipboard:void 0;function mxWindow(t,e,i,n,r,s,l,a,o,u){e!=null&&(l=l??!0,this.content=e,this.init(i,n,r,s,u),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(l),this.setTitle(t),(a==null||a)&&this.installMoveHandler(),o!=null&&o.parentNode!=null?o.parentNode.replaceChild(this.div,o):document.body.appendChild(this.div))}mxWindow.prototype=new mxEventSource,mxWindow.prototype.constructor=mxWindow,mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif",mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif",mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif",mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif",mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif",mxWindow.prototype.visible=!1,mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40),mxWindow.prototype.destroyOnClose=!0,mxWindow.prototype.contentHeightCorrection=document.documentMode==8||document.documentMode==7?6:2,mxWindow.prototype.title=null,mxWindow.prototype.content=null,mxWindow.prototype.init=function(t,e,i,n,r){r=r??"mxWindow",this.div=document.createElement("div"),this.div.className=r,this.div.style.left=t+"px",this.div.style.top=e+"px",this.table=document.createElement("table"),this.table.className=r,mxClient.IS_POINTER&&(this.div.style.touchAction="none"),i!=null&&(mxClient.IS_QUIRKS||(this.div.style.width=i+"px"),this.table.style.width=i+"px"),n!=null&&(mxClient.IS_QUIRKS||(this.div.style.height=n+"px"),this.table.style.height=n+"px");var s=document.createElement("tbody"),l=document.createElement("tr");this.title=document.createElement("td"),this.title.className=r+"Title",this.buttons=document.createElement("div"),this.buttons.style.position="absolute",this.buttons.style.display="inline-block",this.buttons.style.right="4px",this.buttons.style.top="5px",this.title.appendChild(this.buttons),l.appendChild(this.title),s.appendChild(l),l=document.createElement("tr"),this.td=document.createElement("td"),this.td.className=r+"Pane",document.documentMode==7&&(this.td.style.height="100%"),this.contentWrapper=document.createElement("div"),this.contentWrapper.className=r+"Pane",this.contentWrapper.style.width="100%",this.contentWrapper.appendChild(this.content),(mxClient.IS_QUIRKS||this.content.nodeName.toUpperCase()!="DIV")&&(this.contentWrapper.style.height="100%"),this.td.appendChild(this.contentWrapper),l.appendChild(this.td),s.appendChild(l),this.table.appendChild(s),this.div.appendChild(this.table);var a=mxUtils.bind(this,function(o){this.activate()});mxEvent.addGestureListeners(this.title,a),mxEvent.addGestureListeners(this.table,a),this.hide()},mxWindow.prototype.setTitle=function(t){for(var e=this.title.firstChild;e!=null;){var i=e.nextSibling;e.nodeType==mxConstants.NODETYPE_TEXT&&e.parentNode.removeChild(e),e=i}mxUtils.write(this.title,t||""),this.title.appendChild(this.buttons)},mxWindow.prototype.setScrollable=function(t){(navigator.userAgent==null||navigator.userAgent.indexOf("Presto/2.5")<0)&&(t?this.contentWrapper.style.overflow="auto":this.contentWrapper.style.overflow="hidden")},mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var t=mxUtils.getCurrentStyle(this.getElement()),e=t!=null?t.zIndex:3;if(mxWindow.activeWindow){var i=mxWindow.activeWindow.getElement();i!=null&&i.style!=null&&(i.style.zIndex=e)}var n=mxWindow.activeWindow;this.getElement().style.zIndex=parseInt(e)+1,mxWindow.activeWindow=this,this.fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",n))}},mxWindow.prototype.getElement=function(){return this.div},mxWindow.prototype.fit=function(){mxUtils.fit(this.div)},mxWindow.prototype.isResizable=function(){return this.resize!=null?this.resize.style.display!="none":!1},mxWindow.prototype.setResizable=function(t){if(t)if(this.resize==null){this.resize=document.createElement("img"),this.resize.style.position="absolute",this.resize.style.bottom="2px",this.resize.style.right="2px",this.resize.setAttribute("src",this.resizeImage),this.resize.style.cursor="nw-resize";var e=null,i=null,n=null,r=null,s=mxUtils.bind(this,function(o){this.activate(),e=mxEvent.getClientX(o),i=mxEvent.getClientY(o),n=this.div.offsetWidth,r=this.div.offsetHeight,mxEvent.addGestureListeners(document,null,l,a),this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",o)),mxEvent.consume(o)}),l=mxUtils.bind(this,function(o){if(e!=null&&i!=null){var u=mxEvent.getClientX(o)-e,p=mxEvent.getClientY(o)-i;this.setSize(n+u,r+p),this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",o)),mxEvent.consume(o)}}),a=mxUtils.bind(this,function(o){e!=null&&i!=null&&(e=null,i=null,mxEvent.removeGestureListeners(document,null,l,a),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",o)),mxEvent.consume(o))});mxEvent.addGestureListeners(this.resize,s,l,a),this.div.appendChild(this.resize)}else this.resize.style.display="inline";else this.resize!=null&&(this.resize.style.display="none")},mxWindow.prototype.setSize=function(t,e){t=Math.max(this.minimumSize.width,t),e=Math.max(this.minimumSize.height,e),mxClient.IS_QUIRKS||(this.div.style.width=t+"px",this.div.style.height=e+"px"),this.table.style.width=t+"px",this.table.style.height=e+"px",mxClient.IS_QUIRKS||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px")},mxWindow.prototype.setMinimizable=function(t){this.minimize.style.display=t?"":"none"},mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)},mxWindow.prototype.installMinimizeHandler=function(){this.minimize=document.createElement("img"),this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.minimize.style.cursor="pointer",this.minimize.style.marginLeft="2px",this.minimize.style.display="none",this.buttons.appendChild(this.minimize);var t=!1,e=null,i=null,n=mxUtils.bind(this,function(r){if(this.activate(),t)t=!1,this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.contentWrapper.style.display="",this.maximize.style.display=e,mxClient.IS_QUIRKS||(this.div.style.height=i),this.table.style.height=i,this.resize!=null&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",r));else{t=!0,this.minimize.setAttribute("src",this.normalizeImage),this.minimize.setAttribute("title","Normalize"),this.contentWrapper.style.display="none",e=this.maximize.style.display,this.maximize.style.display="none",i=this.table.style.height;var s=this.getMinimumSize();s.height>0&&(mxClient.IS_QUIRKS||(this.div.style.height=s.height+"px"),this.table.style.height=s.height+"px"),s.width>0&&(mxClient.IS_QUIRKS||(this.div.style.width=s.width+"px"),this.table.style.width=s.width+"px"),this.resize!=null&&(this.resize.style.visibility="hidden"),this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",r))}mxEvent.consume(r)});mxEvent.addGestureListeners(this.minimize,n)},mxWindow.prototype.setMaximizable=function(t){this.maximize.style.display=t?"":"none"},mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img"),this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.maximize.style.cursor="default",this.maximize.style.marginLeft="2px",this.maximize.style.cursor="pointer",this.maximize.style.display="none",this.buttons.appendChild(this.maximize);var t=!1,e=null,i=null,n=null,r=null,s=null,l=mxUtils.bind(this,function(a){if(this.activate(),this.maximize.style.display!="none"){if(t){if(t=!1,this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.contentWrapper.style.display="",this.minimize.style.display=s,this.div.style.left=e+"px",this.div.style.top=i+"px",!mxClient.IS_QUIRKS){this.div.style.height=n,this.div.style.width=r;var u=mxUtils.getCurrentStyle(this.contentWrapper);(u.overflow=="auto"||this.resize!=null)&&(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px")}this.table.style.height=n,this.table.style.width=r,this.resize!=null&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",a))}else{t=!0,this.maximize.setAttribute("src",this.normalizeImage),this.maximize.setAttribute("title","Normalize"),this.contentWrapper.style.display="",s=this.minimize.style.display,this.minimize.style.display="none",e=parseInt(this.div.style.left),i=parseInt(this.div.style.top),n=this.table.style.height,r=this.table.style.width,this.div.style.left="0px",this.div.style.top="0px";var o=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0);if(mxClient.IS_QUIRKS||(this.div.style.width=document.body.clientWidth-2+"px",this.div.style.height=o-2+"px"),this.table.style.width=document.body.clientWidth-2+"px",this.table.style.height=o-2+"px",this.resize!=null&&(this.resize.style.visibility="hidden"),!mxClient.IS_QUIRKS){var u=mxUtils.getCurrentStyle(this.contentWrapper);(u.overflow=="auto"||this.resize!=null)&&(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px")}this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",a))}mxEvent.consume(a)}});mxEvent.addGestureListeners(this.maximize,l),mxEvent.addListener(this.title,"dblclick",l)},mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move",mxEvent.addGestureListeners(this.title,mxUtils.bind(this,function(t){var e=mxEvent.getClientX(t),i=mxEvent.getClientY(t),n=this.getX(),r=this.getY(),s=mxUtils.bind(this,function(a){var o=mxEvent.getClientX(a)-e,u=mxEvent.getClientY(a)-i;this.setLocation(n+o,r+u),this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",a)),mxEvent.consume(a)}),l=mxUtils.bind(this,function(a){mxEvent.removeGestureListeners(document,null,s,l),this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",a)),mxEvent.consume(a)});mxEvent.addGestureListeners(document,null,s,l),this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",t)),mxEvent.consume(t)})),mxClient.IS_POINTER&&(this.title.style.touchAction="none")},mxWindow.prototype.setLocation=function(t,e){this.div.style.left=t+"px",this.div.style.top=e+"px"},mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)},mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)},mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img"),this.closeImg.setAttribute("src",this.closeImage),this.closeImg.setAttribute("title","Close"),this.closeImg.style.marginLeft="2px",this.closeImg.style.cursor="pointer",this.closeImg.style.display="none",this.buttons.appendChild(this.closeImg),mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,function(t){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",t)),this.destroyOnClose?this.destroy():this.setVisible(!1),mxEvent.consume(t)}))},mxWindow.prototype.setImage=function(t){this.image=document.createElement("img"),this.image.setAttribute("src",t),this.image.setAttribute("align","left"),this.image.style.marginRight="4px",this.image.style.marginLeft="0px",this.image.style.marginTop="-2px",this.title.insertBefore(this.image,this.title.firstChild)},mxWindow.prototype.setClosable=function(t){this.closeImg.style.display=t?"":"none"},mxWindow.prototype.isVisible=function(){return this.div!=null?this.div.style.display!="none":!1},mxWindow.prototype.setVisible=function(t){this.div!=null&&this.isVisible()!=t&&(t?this.show():this.hide())},mxWindow.prototype.show=function(){this.div.style.display="",this.activate();var t=mxUtils.getCurrentStyle(this.contentWrapper);!mxClient.IS_QUIRKS&&(t.overflow=="auto"||this.resize!=null)&&this.contentWrapper.style.display!="none"&&(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px"),this.fireEvent(new mxEventObject(mxEvent.SHOW))},mxWindow.prototype.hide=function(){this.div.style.display="none",this.fireEvent(new mxEventObject(mxEvent.HIDE))},mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY)),this.div!=null&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null),this.title=null,this.content=null,this.contentWrapper=null},__mxOutput.mxWindow=typeof mxWindow<"u"?mxWindow:void 0;function mxForm(t){this.table=document.createElement("table"),this.table.className=t,this.body=document.createElement("tbody"),this.table.appendChild(this.body)}mxForm.prototype.table=null,mxForm.prototype.body=!1,mxForm.prototype.getTable=function(){return this.table},mxForm.prototype.addButtons=function(t,e){var i=document.createElement("tr"),n=document.createElement("td");i.appendChild(n),n=document.createElement("td");var r=document.createElement("button");mxUtils.write(r,mxResources.get("ok")||"OK"),n.appendChild(r),mxEvent.addListener(r,"click",function(){t()}),r=document.createElement("button"),mxUtils.write(r,mxResources.get("cancel")||"Cancel"),n.appendChild(r),mxEvent.addListener(r,"click",function(){e()}),i.appendChild(n),this.body.appendChild(i)},mxForm.prototype.addText=function(t,e,i){var n=document.createElement("input");return n.setAttribute("type",i||"text"),n.value=e,this.addField(t,n)},mxForm.prototype.addCheckbox=function(t,e){var i=document.createElement("input");return i.setAttribute("type","checkbox"),this.addField(t,i),e&&(i.checked=!0),i},mxForm.prototype.addTextarea=function(t,e,i){var n=document.createElement("textarea");return mxClient.IS_NS&&i--,n.setAttribute("rows",i||2),n.value=e,this.addField(t,n)},mxForm.prototype.addCombo=function(t,e,i){var n=document.createElement("select");return i!=null&&n.setAttribute("size",i),e&&n.setAttribute("multiple","true"),this.addField(t,n)},mxForm.prototype.addOption=function(t,e,i,n){var r=document.createElement("option");mxUtils.writeln(r,e),r.setAttribute("value",i),n&&r.setAttribute("selected",n),t.appendChild(r)},mxForm.prototype.addField=function(t,e){var i=document.createElement("tr"),n=document.createElement("td");return mxUtils.write(n,t),i.appendChild(n),n=document.createElement("td"),n.appendChild(e),i.appendChild(n),this.body.appendChild(i),e},__mxOutput.mxForm=typeof mxForm<"u"?mxForm:void 0;function mxImage(t,e,i){this.src=t,this.width=e,this.height=i}mxImage.prototype.src=null,mxImage.prototype.width=null,mxImage.prototype.height=null,__mxOutput.mxImage=typeof mxImage<"u"?mxImage:void 0;function mxDivResizer(t,e){if(t.nodeName.toLowerCase()=="div"){e==null&&(e=window),this.div=t;var i=mxUtils.getCurrentStyle(t);i!=null&&(this.resizeWidth=i.width=="auto",this.resizeHeight=i.height=="auto"),mxEvent.addListener(e,"resize",mxUtils.bind(this,function(n){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)})),this.resize()}}mxDivResizer.prototype.resizeWidth=!0,mxDivResizer.prototype.resizeHeight=!0,mxDivResizer.prototype.handlingResize=!1,mxDivResizer.prototype.resize=function(){var t=this.getDocumentWidth(),e=this.getDocumentHeight(),i=parseInt(this.div.style.left),n=parseInt(this.div.style.right),r=parseInt(this.div.style.top),s=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(i)&&!isNaN(n)&&i>=0&&n>=0&&t-n-i>0&&(this.div.style.width=t-n-i+"px"),this.resizeHeight&&!isNaN(r)&&!isNaN(s)&&r>=0&&s>=0&&e-r-s>0&&(this.div.style.height=e-r-s+"px")},mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth},mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight},__mxOutput.mxDivResizer=typeof mxDivResizer<"u"?mxDivResizer:void 0;function mxDragSource(t,e){this.element=t,this.dropHandler=e,mxEvent.addGestureListeners(t,mxUtils.bind(this,function(i){this.mouseDown(i)})),mxEvent.addListener(t,"dragstart",function(i){mxEvent.consume(i)}),this.eventConsumer=function(i,n){var r=n.getProperty("eventName"),s=n.getProperty("event");r!=mxEvent.MOUSE_DOWN&&s.consume()}}mxDragSource.prototype.element=null,mxDragSource.prototype.dropHandler=null,mxDragSource.prototype.dragOffset=null,mxDragSource.prototype.dragElement=null,mxDragSource.prototype.previewElement=null,mxDragSource.prototype.previewOffset=null,mxDragSource.prototype.enabled=!0,mxDragSource.prototype.currentGraph=null,mxDragSource.prototype.currentDropTarget=null,mxDragSource.prototype.currentPoint=null,mxDragSource.prototype.currentGuide=null,mxDragSource.prototype.currentHighlight=null,mxDragSource.prototype.autoscroll=!0,mxDragSource.prototype.guidesEnabled=!0,mxDragSource.prototype.gridEnabled=!0,mxDragSource.prototype.highlightDropTargets=!0,mxDragSource.prototype.dragElementZIndex=100,mxDragSource.prototype.dragElementOpacity=70,mxDragSource.prototype.checkEventSource=!0,mxDragSource.prototype.isEnabled=function(){return this.enabled},mxDragSource.prototype.setEnabled=function(t){this.enabled=t},mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled},mxDragSource.prototype.setGuidesEnabled=function(t){this.guidesEnabled=t},mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled},mxDragSource.prototype.setGridEnabled=function(t){this.gridEnabled=t},mxDragSource.prototype.getGraphForEvent=function(t){return null},mxDragSource.prototype.getDropTarget=function(t,e,i,n){return t.getCellAt(e,i)},mxDragSource.prototype.createDragElement=function(t){return this.element.cloneNode(!0)},mxDragSource.prototype.createPreviewElement=function(t){return null},mxDragSource.prototype.isActive=function(){return this.mouseMoveHandler!=null},mxDragSource.prototype.reset=function(){this.currentGraph!=null&&(this.dragExit(this.currentGraph),this.currentGraph=null),this.removeDragElement(),this.removeListeners(),this.stopDrag()},mxDragSource.prototype.mouseDown=function(t){this.enabled&&!mxEvent.isConsumed(t)&&this.mouseMoveHandler==null&&(this.startDrag(t),this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove),this.mouseUpHandler=mxUtils.bind(this,this.mouseUp),mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),mxClient.IS_TOUCH&&!mxEvent.isMouseEvent(t)&&(this.eventSource=mxEvent.getSource(t),mxEvent.addGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler)))},mxDragSource.prototype.startDrag=function(t){this.dragElement=this.createDragElement(t),this.dragElement.style.position="absolute",this.dragElement.style.zIndex=this.dragElementZIndex,mxUtils.setOpacity(this.dragElement,this.dragElementOpacity),this.checkEventSource&&mxClient.IS_SVG&&(this.dragElement.style.pointerEvents="none")},mxDragSource.prototype.stopDrag=function(){this.removeDragElement()},mxDragSource.prototype.removeDragElement=function(){this.dragElement!=null&&(this.dragElement.parentNode!=null&&this.dragElement.parentNode.removeChild(this.dragElement),this.dragElement=null)},mxDragSource.prototype.getElementForEvent=function(t){return mxEvent.isTouchEvent(t)||mxEvent.isPenEvent(t)?document.elementFromPoint(mxEvent.getClientX(t),mxEvent.getClientY(t)):mxEvent.getSource(t)},mxDragSource.prototype.graphContainsEvent=function(t,e){var i=mxEvent.getClientX(e),n=mxEvent.getClientY(e),r=mxUtils.getOffset(t.container),s=mxUtils.getScrollOrigin(),l=this.getElementForEvent(e);if(this.checkEventSource)for(;l!=null&&l!=t.container;)l=l.parentNode;return l!=null&&i>=r.x-s.x&&n>=r.y-s.y&&i<=r.x-s.x+t.container.offsetWidth&&n<=r.y-s.y+t.container.offsetHeight},mxDragSource.prototype.mouseMove=function(t){var e=this.getGraphForEvent(t);if(e!=null&&!this.graphContainsEvent(e,t)&&(e=null),e!=this.currentGraph&&(this.currentGraph!=null&&this.dragExit(this.currentGraph,t),this.currentGraph=e,this.currentGraph!=null&&this.dragEnter(this.currentGraph,t)),this.currentGraph!=null&&this.dragOver(this.currentGraph,t),this.dragElement!=null&&(this.previewElement==null||this.previewElement.style.visibility!="visible")){var i=mxEvent.getClientX(t),n=mxEvent.getClientY(t);this.dragElement.parentNode==null&&document.body.appendChild(this.dragElement),this.dragElement.style.visibility="visible",this.dragOffset!=null&&(i+=this.dragOffset.x,n+=this.dragOffset.y);var r=mxUtils.getDocumentScrollOrigin(document);this.dragElement.style.left=i+r.x+"px",this.dragElement.style.top=n+r.y+"px"}else this.dragElement!=null&&(this.dragElement.style.visibility="hidden");mxEvent.consume(t)},mxDragSource.prototype.mouseUp=function(t){if(this.currentGraph!=null){if(this.currentPoint!=null&&(this.previewElement==null||this.previewElement.style.visibility!="hidden")){var e=this.currentGraph.view.scale,i=this.currentGraph.view.translate,n=this.currentPoint.x/e-i.x,r=this.currentPoint.y/e-i.y;this.drop(this.currentGraph,t,this.currentDropTarget,n,r)}this.dragExit(this.currentGraph),this.currentGraph=null}this.stopDrag(),this.removeListeners(),mxEvent.consume(t)},mxDragSource.prototype.removeListeners=function(){this.eventSource!=null&&(mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler),this.eventSource=null),mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),this.mouseMoveHandler=null,this.mouseUpHandler=null},mxDragSource.prototype.dragEnter=function(t,e){t.isMouseDown=!0,t.isMouseTrigger=mxEvent.isMouseEvent(e),this.previewElement=this.createPreviewElement(t),this.previewElement!=null&&this.checkEventSource&&mxClient.IS_SVG&&(this.previewElement.style.pointerEvents="none"),this.isGuidesEnabled()&&this.previewElement!=null&&(this.currentGuide=new mxGuide(t,t.graphHandler.getGuideStates())),this.highlightDropTargets&&(this.currentHighlight=new mxCellHighlight(t,mxConstants.DROP_TARGET_COLOR)),t.addListener(mxEvent.FIRE_MOUSE_EVENT,this.eventConsumer)},mxDragSource.prototype.dragExit=function(t,e){this.currentDropTarget=null,this.currentPoint=null,t.isMouseDown=!1,t.removeListener(this.eventConsumer),this.previewElement!=null&&(this.previewElement.parentNode!=null&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null),this.currentGuide!=null&&(this.currentGuide.destroy(),this.currentGuide=null),this.currentHighlight!=null&&(this.currentHighlight.destroy(),this.currentHighlight=null)},mxDragSource.prototype.dragOver=function(t,e){var i=mxUtils.getOffset(t.container),n=mxUtils.getScrollOrigin(t.container),r=mxEvent.getClientX(e)-i.x+n.x-t.panDx,s=mxEvent.getClientY(e)-i.y+n.y-t.panDy;if(t.autoScroll&&(this.autoscroll==null||this.autoscroll)&&t.scrollPointToVisible(r,s,t.autoExtend),this.currentHighlight!=null&&t.isDropEnabled()){this.currentDropTarget=this.getDropTarget(t,r,s,e);var l=t.getView().getState(this.currentDropTarget);this.currentHighlight.highlight(l)}if(this.previewElement!=null){this.previewElement.parentNode==null&&(t.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");var a=this.isGridEnabled()&&t.isGridEnabledEvent(e),o=!0;if(this.currentGuide!=null&&this.currentGuide.isEnabledForEvent(e)){var u=parseInt(this.previewElement.style.width),p=parseInt(this.previewElement.style.height),m=new mxRectangle(0,0,u,p),d=new mxPoint(r,s);d=this.currentGuide.move(m,d,a,!0),o=!1,r=d.x,s=d.y}else if(a){var x=t.view.scale,f=t.view.translate,g=t.gridSize/2;r=(t.snap(r/x-f.x-g)+f.x)*x,s=(t.snap(s/x-f.y-g)+f.y)*x}this.currentGuide!=null&&o&&this.currentGuide.hide(),this.previewOffset!=null&&(r+=this.previewOffset.x,s+=this.previewOffset.y),this.previewElement.style.left=Math.round(r)+"px",this.previewElement.style.top=Math.round(s)+"px",this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(r,s)},mxDragSource.prototype.drop=function(t,e,i,n,r){this.dropHandler.apply(this,arguments),t.container.style.visibility!="hidden"&&t.container.focus()},__mxOutput.mxDragSource=typeof mxDragSource<"u"?mxDragSource:void 0;function mxToolbar(t){this.container=t}mxToolbar.prototype=new mxEventSource,mxToolbar.prototype.constructor=mxToolbar,mxToolbar.prototype.container=null,mxToolbar.prototype.enabled=!0,mxToolbar.prototype.noReset=!1,mxToolbar.prototype.updateDefaultMode=!0,mxToolbar.prototype.addItem=function(t,e,i,n,r,s){var l=document.createElement(e!=null?"img":"button"),a=r||(s!=null?"mxToolbarMode":"mxToolbarItem");l.className=a,l.setAttribute("src",e),t!=null&&(e!=null?l.setAttribute("title",t):mxUtils.write(l,t)),this.container.appendChild(l),i!=null&&(mxEvent.addListener(l,"click",i),mxClient.IS_TOUCH&&mxEvent.addListener(l,"touchend",i));var o=mxUtils.bind(this,function(u){n!=null?l.setAttribute("src",e):l.style.backgroundColor=""});return mxEvent.addGestureListeners(l,mxUtils.bind(this,function(u){if(n!=null?l.setAttribute("src",n):l.style.backgroundColor="gray",s!=null){this.menu==null&&(this.menu=new mxPopupMenu,this.menu.init());var p=this.currentImg;if(this.menu.isMenuShowing()&&this.menu.hideMenu(),p!=l){this.currentImg=l,this.menu.factoryMethod=s;var m=new mxPoint(l.offsetLeft,l.offsetTop+l.offsetHeight);this.menu.popup(m.x,m.y,null,u),this.menu.isMenuShowing()&&(l.className=a+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this),l.className=a,this.currentImg=null})}}}),null,o),mxEvent.addListener(l,"mouseout",o),l},mxToolbar.prototype.addCombo=function(t){var e=document.createElement("div");e.style.display="inline",e.className="mxToolbarComboContainer";var i=document.createElement("select");return i.className=t||"mxToolbarCombo",e.appendChild(i),this.container.appendChild(e),i},mxToolbar.prototype.addActionCombo=function(t,e){var i=document.createElement("select");return i.className=e||"mxToolbarCombo",this.addOption(i,t,null),mxEvent.addListener(i,"change",function(n){var r=i.options[i.selectedIndex];i.selectedIndex=0,r.funct!=null&&r.funct(n)}),this.container.appendChild(i),i},mxToolbar.prototype.addOption=function(t,e,i){var n=document.createElement("option");return mxUtils.writeln(n,e),typeof i=="function"?n.funct=i:n.setAttribute("value",i),t.appendChild(n),n},mxToolbar.prototype.addSwitchMode=function(t,e,i,n,r){var s=document.createElement("img");return s.initialClassName=r||"mxToolbarMode",s.className=s.initialClassName,s.setAttribute("src",e),s.altIcon=n,t!=null&&s.setAttribute("title",t),mxEvent.addListener(s,"click",mxUtils.bind(this,function(l){var a=this.selectedMode.altIcon;a!=null?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",a)):this.selectedMode.className=this.selectedMode.initialClassName,this.updateDefaultMode&&(this.defaultMode=s),this.selectedMode=s;var a=s.altIcon;a!=null?(s.altIcon=s.getAttribute("src"),s.setAttribute("src",a)):s.className=s.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT)),i()})),this.container.appendChild(s),this.defaultMode==null&&(this.defaultMode=s,this.selectMode(s),i()),s},mxToolbar.prototype.addMode=function(t,e,i,n,r,s){s=s??!0;var l=document.createElement(e!=null?"img":"button");return l.initialClassName=r||"mxToolbarMode",l.className=l.initialClassName,l.setAttribute("src",e),l.altIcon=n,t!=null&&l.setAttribute("title",t),this.enabled&&s&&(mxEvent.addListener(l,"click",mxUtils.bind(this,function(a){this.selectMode(l,i),this.noReset=!1})),mxEvent.addListener(l,"dblclick",mxUtils.bind(this,function(a){this.selectMode(l,i),this.noReset=!0})),this.defaultMode==null&&(this.defaultMode=l,this.defaultFunction=i,this.selectMode(l,i))),this.container.appendChild(l),l},mxToolbar.prototype.selectMode=function(t,e){if(this.selectedMode!=t){if(this.selectedMode!=null){var i=this.selectedMode.altIcon;i!=null?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",i)):this.selectedMode.className=this.selectedMode.initialClassName}this.selectedMode=t;var i=this.selectedMode.altIcon;i!=null?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",i)):this.selectedMode.className=this.selectedMode.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",e))}},mxToolbar.prototype.resetMode=function(t){(t||!this.noReset)&&this.selectedMode!=this.defaultMode&&this.selectMode(this.defaultMode,this.defaultFunction)},mxToolbar.prototype.addSeparator=function(t){return this.addItem(null,t,null)},mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)},mxToolbar.prototype.addLine=function(){var t=document.createElement("hr");t.style.marginRight="6px",t.setAttribute("size","1"),this.container.appendChild(t)},mxToolbar.prototype.destroy=function(){mxEvent.release(this.container),this.container=null,this.defaultMode=null,this.defaultFunction=null,this.selectedMode=null,this.menu!=null&&this.menu.destroy()},__mxOutput.mxToolbar=typeof mxToolbar<"u"?mxToolbar:void 0;function mxUndoableEdit(t,e){this.source=t,this.changes=[],this.significant=e??!0}mxUndoableEdit.prototype.source=null,mxUndoableEdit.prototype.changes=null,mxUndoableEdit.prototype.significant=null,mxUndoableEdit.prototype.undone=!1,mxUndoableEdit.prototype.redone=!1,mxUndoableEdit.prototype.isEmpty=function(){return this.changes.length==0},mxUndoableEdit.prototype.isSignificant=function(){return this.significant},mxUndoableEdit.prototype.add=function(t){this.changes.push(t)},mxUndoableEdit.prototype.notify=function(){},mxUndoableEdit.prototype.die=function(){},mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var t=this.changes.length,e=t-1;e>=0;e--){var i=this.changes[e];i.execute!=null?i.execute():i.undo!=null&&i.undo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",i))}this.undone=!0,this.redone=!1,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var t=this.changes.length,e=0;e0},mxUndoManager.prototype.undo=function(){for(;this.indexOfNextAdd>0;){var t=this.history[--this.indexOfNextAdd];if(t.undo(),t.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t));break}}},mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd0&&this.size==this.history.length&&this.history.shift(),this.history.push(t),this.indexOfNextAdd=this.history.length,this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",t))},mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd)for(var t=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),e=0;e0&&(this.baseUrl=this.baseUrl.substring(0,t+1))},mxUrlConverter.prototype.isEnabled=function(){return this.enabled},mxUrlConverter.prototype.setEnabled=function(t){this.enabled=t},mxUrlConverter.prototype.getBaseUrl=function(){return this.baseUrl},mxUrlConverter.prototype.setBaseUrl=function(t){this.baseUrl=t},mxUrlConverter.prototype.getBaseDomain=function(){return this.baseDomain},mxUrlConverter.prototype.setBaseDomain=function(t){this.baseDomain=t},mxUrlConverter.prototype.isRelativeUrl=function(t){return t!=null&&t.substring(0,2)!="//"&&t.substring(0,7)!="http://"&&t.substring(0,8)!="https://"&&t.substring(0,10)!="data:image"&&t.substring(0,7)!="file://"},mxUrlConverter.prototype.convert=function(t){return this.isEnabled()&&this.isRelativeUrl(t)&&(this.getBaseUrl()==null&&this.updateBaseUrl(),t.charAt(0)=="/"?t=this.getBaseDomain()+t:t=this.getBaseUrl()+t),t},__mxOutput.mxUrlConverter=typeof mxUrlConverter<"u"?mxUrlConverter:void 0;function mxPanningManager(t){this.thread=null,this.active=!1,this.tdx=0,this.tdy=0,this.t0x=0,this.t0y=0,this.dx=0,this.dy=0,this.scrollbars=!1,this.scrollLeft=0,this.scrollTop=0,this.mouseListener={mouseDown:function(i,n){},mouseMove:function(i,n){},mouseUp:mxUtils.bind(this,function(i,n){this.active&&this.stop()})},t.addMouseListener(this.mouseListener),this.mouseUpListener=mxUtils.bind(this,function(){this.active&&this.stop()}),mxEvent.addListener(document,"mouseup",this.mouseUpListener);var e=mxUtils.bind(this,function(){return this.scrollbars=mxUtils.hasScrollbars(t.container),this.scrollLeft=t.container.scrollLeft,this.scrollTop=t.container.scrollTop,window.setInterval(mxUtils.bind(this,function(){if(this.tdx-=this.dx,this.tdy-=this.dy,this.scrollbars){var i=-t.container.scrollLeft-Math.ceil(this.dx),n=-t.container.scrollTop-Math.ceil(this.dy);t.panGraph(i,n),t.panDx=this.scrollLeft-t.container.scrollLeft,t.panDy=this.scrollTop-t.container.scrollTop,t.fireEvent(new mxEventObject(mxEvent.PAN))}else t.panGraph(this.getDx(),this.getDy())}),this.delay)});this.isActive=function(){return active},this.getDx=function(){return Math.round(this.tdx)},this.getDy=function(){return Math.round(this.tdy)},this.start=function(){this.t0x=t.view.translate.x,this.t0y=t.view.translate.y,this.active=!0},this.panTo=function(i,n,r,s){this.active||this.start(),this.scrollLeft=t.container.scrollLeft,this.scrollTop=t.container.scrollTop,r=r??0,s=s??0;var l=t.container;this.dx=i+r-l.scrollLeft-l.clientWidth,this.dx<0&&Math.abs(this.dx)0&&this.dx0&&this.dya&&(e.div.style.left=Math.max(0,t.div.offsetLeft-n+(mxClient.IS_IE?6:-6))+"px"),mxUtils.fit(e.div)}},mxPopupMenu.prototype.addSeparator=function(t,e){if(t=t||this,this.smartSeparators&&!e)t.willAddSeparator=!0;else if(t.tbody!=null){t.willAddSeparator=!1;var i=document.createElement("tr"),n=document.createElement("td");n.className="mxPopupMenuIcon",n.style.padding="0 0 0 0px",i.appendChild(n);var r=document.createElement("td");r.style.padding="0 0 0 0px",r.setAttribute("colSpan","2");var s=document.createElement("hr");s.setAttribute("size","1"),r.appendChild(s),i.appendChild(r),t.tbody.appendChild(i)}},mxPopupMenu.prototype.popup=function(t,e,i,n){if(this.div!=null&&this.tbody!=null&&this.factoryMethod!=null){for(this.div.style.left=t+"px",this.div.style.top=e+"px";this.tbody.firstChild!=null;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0,this.factoryMethod(this,i,n),this.itemCount>0&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}},mxPopupMenu.prototype.isMenuShowing=function(){return this.div!=null&&this.div.parentNode==document.body},mxPopupMenu.prototype.showMenu=function(){document.documentMode>=9&&(this.div.style.filter="none"),document.body.appendChild(this.div),mxUtils.fit(this.div)},mxPopupMenu.prototype.hideMenu=function(){this.div!=null&&(this.div.parentNode!=null&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1,this.fireEvent(new mxEventObject(mxEvent.HIDE)))},mxPopupMenu.prototype.hideSubmenu=function(t){t.activeRow!=null&&(this.hideSubmenu(t.activeRow),t.activeRow.div.parentNode!=null&&t.activeRow.div.parentNode.removeChild(t.activeRow.div),t.activeRow=null)},mxPopupMenu.prototype.destroy=function(){this.div!=null&&(mxEvent.release(this.div),this.div.parentNode!=null&&this.div.parentNode.removeChild(this.div),this.div=null)},__mxOutput.mxPopupMenu=typeof mxPopupMenu<"u"?mxPopupMenu:void 0;function mxAutoSaveManager(t){this.changeHandler=mxUtils.bind(this,function(e,i){this.isEnabled()&&this.graphModelChanged(i.getProperty("edit").changes)}),this.setGraph(t)}mxAutoSaveManager.prototype=new mxEventSource,mxAutoSaveManager.prototype.constructor=mxAutoSaveManager,mxAutoSaveManager.prototype.graph=null,mxAutoSaveManager.prototype.autoSaveDelay=10,mxAutoSaveManager.prototype.autoSaveThrottle=2,mxAutoSaveManager.prototype.autoSaveThreshold=5,mxAutoSaveManager.prototype.ignoredChanges=0,mxAutoSaveManager.prototype.lastSnapshot=0,mxAutoSaveManager.prototype.enabled=!0,mxAutoSaveManager.prototype.changeHandler=null,mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled},mxAutoSaveManager.prototype.setEnabled=function(t){this.enabled=t},mxAutoSaveManager.prototype.setGraph=function(t){this.graph!=null&&this.graph.getModel().removeListener(this.changeHandler),this.graph=t,this.graph!=null&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)},mxAutoSaveManager.prototype.save=function(){},mxAutoSaveManager.prototype.graphModelChanged=function(t){var e=new Date().getTime(),i=(e-this.lastSnapshot)/1e3;i>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&i>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++},mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=new Date().getTime(),this.ignoredChanges=0},mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)},__mxOutput.mxAutoSaveManager=typeof mxAutoSaveManager<"u"?mxAutoSaveManager:void 0;function mxAnimation(t){this.delay=t??20}mxAnimation.prototype=new mxEventSource,mxAnimation.prototype.constructor=mxAnimation,mxAnimation.prototype.delay=null,mxAnimation.prototype.thread=null,mxAnimation.prototype.isRunning=function(){return this.thread!=null},mxAnimation.prototype.startAnimation=function(){this.thread==null&&(this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay))},mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))},mxAnimation.prototype.stopAnimation=function(){this.thread!=null&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))},__mxOutput.mxAnimation=typeof mxAnimation<"u"?mxAnimation:void 0;function mxMorphing(t,e,i,n){mxAnimation.call(this,n),this.graph=t,this.steps=e??6,this.ease=i??1.5}mxMorphing.prototype=new mxAnimation,mxMorphing.prototype.constructor=mxMorphing,mxMorphing.prototype.graph=null,mxMorphing.prototype.steps=null,mxMorphing.prototype.step=0,mxMorphing.prototype.ease=null,mxMorphing.prototype.cells=null,mxMorphing.prototype.updateAnimation=function(){mxAnimation.prototype.updateAnimation.apply(this,arguments);var t=new mxCellStatePreview(this.graph);if(this.cells!=null)for(var e=0;e=this.steps)&&this.stopAnimation()},mxMorphing.prototype.show=function(t){t.show()},mxMorphing.prototype.animateCell=function(t,e,i){var n=this.graph.getView().getState(t),r=null;if(n!=null&&(r=this.getDelta(n),this.graph.getModel().isVertex(t)&&(r.x!=0||r.y!=0))){var s=this.graph.view.getTranslate(),l=this.graph.view.getScale();r.x+=s.x*l,r.y+=s.y*l,e.moveState(n,-r.x/this.ease,-r.y/this.ease)}if(i&&!this.stopRecursion(n,r))for(var a=this.graph.getModel().getChildCount(t),o=0;o2))for(var t=this.state,e=2;e0&&(this.state=this.states.pop())},mxAbstractCanvas2D.prototype.setLink=function(t){},mxAbstractCanvas2D.prototype.scale=function(t){this.state.scale*=t,this.state.strokeWidth*=t},mxAbstractCanvas2D.prototype.translate=function(t,e){this.state.dx+=t,this.state.dy+=e},mxAbstractCanvas2D.prototype.rotate=function(t,e,i,n,r){},mxAbstractCanvas2D.prototype.setAlpha=function(t){this.state.alpha=t},mxAbstractCanvas2D.prototype.setFillAlpha=function(t){this.state.fillAlpha=t},mxAbstractCanvas2D.prototype.setStrokeAlpha=function(t){this.state.strokeAlpha=t},mxAbstractCanvas2D.prototype.setFillColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fillColor=t,this.state.gradientColor=null},mxAbstractCanvas2D.prototype.setGradient=function(t,e,i,n,r,s,l,a,o){var u=this.state;u.fillColor=t,u.gradientFillAlpha=a??1,u.gradientColor=e,u.gradientAlpha=o??1,u.gradientDirection=l},mxAbstractCanvas2D.prototype.setStrokeColor=function(t){t==mxConstants.NONE&&(t=null),this.state.strokeColor=t},mxAbstractCanvas2D.prototype.setStrokeWidth=function(t){this.state.strokeWidth=t},mxAbstractCanvas2D.prototype.setDashed=function(t,e){this.state.dashed=t,this.state.fixDash=e},mxAbstractCanvas2D.prototype.setDashPattern=function(t){this.state.dashPattern=t},mxAbstractCanvas2D.prototype.setLineCap=function(t){this.state.lineCap=t},mxAbstractCanvas2D.prototype.setLineJoin=function(t){this.state.lineJoin=t},mxAbstractCanvas2D.prototype.setMiterLimit=function(t){this.state.miterLimit=t},mxAbstractCanvas2D.prototype.setFontColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontColor=t},mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontBackgroundColor=t},mxAbstractCanvas2D.prototype.setFontBorderColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontBorderColor=t},mxAbstractCanvas2D.prototype.setFontSize=function(t){this.state.fontSize=parseFloat(t)},mxAbstractCanvas2D.prototype.setFontFamily=function(t){this.state.fontFamily=t},mxAbstractCanvas2D.prototype.setFontStyle=function(t){t==null&&(t=0),this.state.fontStyle=t},mxAbstractCanvas2D.prototype.setShadow=function(t){this.state.shadow=t},mxAbstractCanvas2D.prototype.setShadowColor=function(t){t==mxConstants.NONE&&(t=null),this.state.shadowColor=t},mxAbstractCanvas2D.prototype.setShadowAlpha=function(t){this.state.shadowAlpha=t},mxAbstractCanvas2D.prototype.setShadowOffset=function(t,e){this.state.shadowDx=t,this.state.shadowDy=e},mxAbstractCanvas2D.prototype.begin=function(){this.lastX=0,this.lastY=0,this.path=[]},mxAbstractCanvas2D.prototype.moveTo=function(t,e){this.addOp(this.moveOp,t,e)},mxAbstractCanvas2D.prototype.lineTo=function(t,e){this.addOp(this.lineOp,t,e)},mxAbstractCanvas2D.prototype.quadTo=function(t,e,i,n){this.addOp(this.quadOp,t,e,i,n)},mxAbstractCanvas2D.prototype.curveTo=function(t,e,i,n,r,s){this.addOp(this.curveOp,t,e,i,n,r,s)},mxAbstractCanvas2D.prototype.arcTo=function(t,e,i,n,r,s,l){var a=mxUtils.arcToCurves(this.lastX,this.lastY,t,e,i,n,r,s,l);if(a!=null)for(var o=0;o0&&(this.defs=i.getElementsByTagName("defs")[0]),this.defs==null&&(this.defs=this.createElement("defs"),i.firstChild!=null?i.insertBefore(this.defs,i.firstChild):i.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle())}}mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D),function(){if(mxSvgCanvas2D.prototype.useDomParser=!mxClient.IS_IE&&typeof DOMParser=="function"&&typeof XMLSerializer=="function",mxSvgCanvas2D.prototype.useDomParser)try{var t=new DOMParser().parseFromString("test text","text/html");mxSvgCanvas2D.prototype.useDomParser=t!=null}catch{mxSvgCanvas2D.prototype.useDomParser=!1}mxSvgCanvas2D.prototype.useAbsoluteIds=!mxClient.IS_CHROMEAPP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&document.getElementsByTagName("base").length>0}(),mxSvgCanvas2D.prototype.node=null,mxSvgCanvas2D.prototype.matchHtmlAlignment=!0,mxSvgCanvas2D.prototype.textEnabled=!0,mxSvgCanvas2D.prototype.foEnabled=!0,mxSvgCanvas2D.prototype.foAltText="[Object]",mxSvgCanvas2D.prototype.foOffset=0,mxSvgCanvas2D.prototype.textOffset=0,mxSvgCanvas2D.prototype.imageOffset=0,mxSvgCanvas2D.prototype.strokeTolerance=0,mxSvgCanvas2D.prototype.minStrokeWidth=1,mxSvgCanvas2D.prototype.refCount=0,mxSvgCanvas2D.prototype.lineHeightCorrection=1,mxSvgCanvas2D.prototype.pointerEventsValue="all",mxSvgCanvas2D.prototype.fontMetricsPadding=10,mxSvgCanvas2D.prototype.cacheOffsetSize=!0,mxSvgCanvas2D.prototype.format=function(t){return parseFloat(parseFloat(t).toFixed(2))},mxSvgCanvas2D.prototype.getBaseUrl=function(){var t=window.location.href,e=t.lastIndexOf("#");return e>0&&(t=t.substring(0,e)),t},mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments),this.gradients=[]},mxSvgCanvas2D.prototype.createStyle=function(t){var e=this.createElement("style");return e.setAttribute("type","text/css"),mxUtils.write(e,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}"),e},mxSvgCanvas2D.prototype.createElement=function(t,e){if(this.root.ownerDocument.createElementNS!=null)return this.root.ownerDocument.createElementNS(e||mxConstants.NS_SVG,t);var i=this.root.ownerDocument.createElement(t);return e!=null&&i.setAttribute("xmlns",e),i},mxSvgCanvas2D.prototype.getAlternateText=function(t,e,i,n,r,s,l,a,o,u,p,m,d){return s!=null?this.foAltText:null},mxSvgCanvas2D.prototype.createAlternateContent=function(t,e,i,n,r,s,l,a,o,u,p,m,d){var x=this.getAlternateText(t,e,i,n,r,s,l,a,o,u,p,m,d),f=this.state;if(x!=null&&f.fontSize>0){var g=a==mxConstants.ALIGN_TOP?1:a==mxConstants.ALIGN_BOTTOM?0:.3,c=l==mxConstants.ALIGN_RIGHT?"end":l==mxConstants.ALIGN_LEFT?"start":"middle",v=this.createElement("text");v.setAttribute("x",Math.round(e+f.dx)),v.setAttribute("y",Math.round(i+f.dy+g*f.fontSize)),v.setAttribute("fill",f.fontColor||"black"),v.setAttribute("font-family",f.fontFamily),v.setAttribute("font-size",Math.round(f.fontSize)+"px"),c!="start"&&v.setAttribute("text-anchor",c),(f.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&v.setAttribute("font-weight","bold"),(f.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&v.setAttribute("font-style","italic");var y=[];return(f.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&y.push("underline"),(f.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&y.push("line-through"),y.length>0&&v.setAttribute("text-decoration",y.join(" ")),mxUtils.write(v,x),v}else return null},mxSvgCanvas2D.prototype.createGradientId=function(t,e,i,n,r){t.charAt(0)=="#"&&(t=t.substring(1)),e.charAt(0)=="#"&&(e=e.substring(1)),t=t.toLowerCase()+"-"+i,e=e.toLowerCase()+"-"+n;var s=null;if(r==null||r==mxConstants.DIRECTION_SOUTH)s="s";else if(r==mxConstants.DIRECTION_EAST)s="e";else{var l=t;t=e,e=l,r==mxConstants.DIRECTION_NORTH?s="s":r==mxConstants.DIRECTION_WEST&&(s="e")}return"mx-gradient-"+t+"-"+e+"-"+s},mxSvgCanvas2D.prototype.getSvgGradient=function(t,e,i,n,r){var s=this.createGradientId(t,e,i,n,r),l=this.gradients[s];if(l==null){var a=this.root.ownerSVGElement,o=0,u=s+"-"+o;if(a!=null)for(l=a.ownerDocument.getElementById(u);l!=null&&l.ownerSVGElement!=a;)u=s+"-"+o++,l=a.ownerDocument.getElementById(u);else u="id"+ ++this.refCount;l==null&&(l=this.createSvgGradient(t,e,i,n,r),l.setAttribute("id",u),this.defs!=null?this.defs.appendChild(l):a.appendChild(l)),this.gradients[s]=l}return l.getAttribute("id")},mxSvgCanvas2D.prototype.createSvgGradient=function(t,e,i,n,r){var s=this.createElement("linearGradient");s.setAttribute("x1","0%"),s.setAttribute("y1","0%"),s.setAttribute("x2","0%"),s.setAttribute("y2","0%"),r==null||r==mxConstants.DIRECTION_SOUTH?s.setAttribute("y2","100%"):r==mxConstants.DIRECTION_EAST?s.setAttribute("x2","100%"):r==mxConstants.DIRECTION_NORTH?s.setAttribute("y1","100%"):r==mxConstants.DIRECTION_WEST&&s.setAttribute("x1","100%");var l=i<1?";stop-opacity:"+i:"",a=this.createElement("stop");return a.setAttribute("offset","0%"),a.setAttribute("style","stop-color:"+t+l),s.appendChild(a),l=n<1?";stop-opacity:"+n:"",a=this.createElement("stop"),a.setAttribute("offset","100%"),a.setAttribute("style","stop-color:"+e+l),s.appendChild(a),s},mxSvgCanvas2D.prototype.addNode=function(t,e){var i=this.node,n=this.state;if(i!=null){if(i.nodeName=="path")if(this.path!=null&&this.path.length>0)i.setAttribute("d",this.path.join(" "));else return;t&&n.fillColor!=null?this.updateFill():this.styleEnabled||(i.nodeName=="ellipse"&&mxClient.IS_FF?i.setAttribute("fill","transparent"):i.setAttribute("fill","none"),t=!1),e&&n.strokeColor!=null?this.updateStroke():this.styleEnabled||i.setAttribute("stroke","none"),n.transform!=null&&n.transform.length>0&&i.setAttribute("transform",n.transform),n.shadow&&this.root.appendChild(this.createShadow(i)),this.strokeTolerance>0&&!t&&this.root.appendChild(this.createTolerance(i)),this.pointerEvents?i.setAttribute("pointer-events",this.pointerEventsValue):!this.pointerEvents&&this.originalRoot==null&&i.setAttribute("pointer-events","none"),(i.nodeName!="rect"&&i.nodeName!="path"&&i.nodeName!="ellipse"||i.getAttribute("fill")!="none"&&i.getAttribute("fill")!="transparent"||i.getAttribute("stroke")!="none"||i.getAttribute("pointer-events")!="none")&&this.root.appendChild(i),this.node=null}},mxSvgCanvas2D.prototype.updateFill=function(){var t=this.state;if((t.alpha<1||t.fillAlpha<1)&&this.node.setAttribute("fill-opacity",t.alpha*t.fillAlpha),t.fillColor!=null)if(t.gradientColor!=null){var e=this.getSvgGradient(String(t.fillColor),String(t.gradientColor),t.gradientFillAlpha,t.gradientAlpha,t.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var i=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");this.node.setAttribute("fill","url("+i+"#"+e+")")}else this.node.setAttribute("fill","url(#"+e+")")}else this.node.setAttribute("fill",String(t.fillColor).toLowerCase())},mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))},mxSvgCanvas2D.prototype.updateStroke=function(){var t=this.state;this.node.setAttribute("stroke",String(t.strokeColor).toLowerCase()),(t.alpha<1||t.strokeAlpha<1)&&this.node.setAttribute("stroke-opacity",t.alpha*t.strokeAlpha);var e=this.getCurrentStrokeWidth();e!=1&&this.node.setAttribute("stroke-width",e),this.node.nodeName=="path"&&this.updateStrokeAttributes(),t.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern((t.fixDash?1:t.strokeWidth)*t.scale))},mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var t=this.state;if(t.lineJoin!=null&&t.lineJoin!="miter"&&this.node.setAttribute("stroke-linejoin",t.lineJoin),t.lineCap!=null){var e=t.lineCap;e=="flat"&&(e="butt"),e!="butt"&&this.node.setAttribute("stroke-linecap",e)}t.miterLimit!=null&&(!this.styleEnabled||t.miterLimit!=10)&&this.node.setAttribute("stroke-miterlimit",t.miterLimit)},mxSvgCanvas2D.prototype.createDashPattern=function(t){var e=[];if(typeof this.state.dashPattern=="string"){var i=this.state.dashPattern.split(" ");if(i.length>0)for(var n=0;n0&&this.node.setAttribute("rx",this.format(r*this.state.scale)),s>0&&this.node.setAttribute("ry",this.format(s*this.state.scale))},mxSvgCanvas2D.prototype.ellipse=function(t,e,i,n){var r=this.state,s=this.createElement("ellipse");s.setAttribute("cx",this.format((t+i/2+r.dx)*r.scale)),s.setAttribute("cy",this.format((e+n/2+r.dy)*r.scale)),s.setAttribute("rx",i/2*r.scale),s.setAttribute("ry",n/2*r.scale),this.node=s},mxSvgCanvas2D.prototype.image=function(t,e,i,n,r,s,l,a){r=this.converter.convert(r),s=s??!0,l=l??!1,a=a??!1;var o=this.state;t+=o.dx,e+=o.dy;var u=this.createElement("image");u.setAttribute("x",this.format(t*o.scale)+this.imageOffset),u.setAttribute("y",this.format(e*o.scale)+this.imageOffset),u.setAttribute("width",this.format(i*o.scale)),u.setAttribute("height",this.format(n*o.scale)),u.setAttributeNS==null?u.setAttribute("xlink:href",r):u.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",r),s||u.setAttribute("preserveAspectRatio","none"),(o.alpha<1||o.fillAlpha<1)&&u.setAttribute("opacity",o.alpha*o.fillAlpha);var p=this.state.transform||"";if(l||a){var m=1,d=1,x=0,f=0;l&&(m=-1,x=-i-2*t),a&&(d=-1,f=-n-2*e),p+="scale("+m+","+d+")translate("+x*o.scale+","+f*o.scale+")"}p.length>0&&u.setAttribute("transform",p),this.pointerEvents||u.setAttribute("pointer-events","none"),this.root.appendChild(u)},mxSvgCanvas2D.prototype.convertHtml=function(t){if(this.useDomParser){var e=new DOMParser().parseFromString(t,"text/html");e!=null&&(t=new XMLSerializer().serializeToString(e.body),t.substring(0,5)=="",5)+1)),t.substring(t.length-7,t.length)==""&&(t=t.substring(0,t.length-7)))}else if(document.implementation!=null&&document.implementation.createDocument!=null){var i=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null),n=i.createElement("body");i.documentElement.appendChild(n);var r=document.createElement("div");r.innerHTML=t;for(var s=r.firstChild;s!=null;){var l=s.nextSibling;n.appendChild(i.adoptNode(s)),s=l}return n.innerHTML}else{var a=document.createElement("textarea");a.innerHTML=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(//g,">"),t=a.value.replace(/&/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/
/g,"
").replace(/
/g,"
").replace(/(]+)>/gm,"$1 />")}return t},mxSvgCanvas2D.prototype.createDiv=function(t){var e=t;if(mxUtils.isNode(e)||(e="
"+this.convertHtml(e)+"
"),!mxClient.IS_IE&&!mxClient.IS_IE11&&document.createElementNS){var i=document.createElementNS("http://www.w3.org/1999/xhtml","div");if(mxUtils.isNode(e)){var n=document.createElement("div"),r=n.cloneNode(!1);this.root.ownerDocument!=document?n.appendChild(e.cloneNode(!0)):n.appendChild(e),r.appendChild(n),i.appendChild(r)}else i.innerHTML=e;return i}else return mxUtils.isNode(e)&&(e="
"+mxUtils.getXml(e)+"
"),e='
'+e+"
",mxUtils.parseXml(e).documentElement},mxSvgCanvas2D.prototype.updateText=function(t,e,i,n,r,s,l,a,o,u,p){p!=null&&p.firstChild!=null&&p.firstChild.firstChild!=null&&this.updateTextNodes(t,e,i,n,r,s,l,a,o,u,p.firstChild)},mxSvgCanvas2D.prototype.addForeignObject=function(t,e,i,n,r,s,l,a,o,u,p,m,d,x,f){var g=this.createElement("g"),c=this.createElement("foreignObject");if(c.setAttribute("style","overflow: visible; text-align: left;"),c.setAttribute("pointer-events","none"),x.ownerDocument!=document&&(x=mxUtils.importNodeImplementation(c.ownerDocument,x,!0)),c.appendChild(x),g.appendChild(c),this.updateTextNodes(t,e,i,n,s,l,a,u,p,m,g),this.root.ownerDocument!=document){var v=this.createAlternateContent(c,t,e,i,n,r,s,l,a,o,u,p,m);if(v!=null){c.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var y=this.createElement("switch");y.appendChild(c),y.appendChild(v),g.appendChild(y)}}f.appendChild(g)},mxSvgCanvas2D.prototype.updateTextNodes=function(t,e,i,n,r,s,l,a,o,u,p){var m=this.state.scale;mxSvgCanvas2D.createCss(i+2,n,r,s,l,a,o,this.state.fontBackgroundColor!=null?this.state.fontBackgroundColor:null,this.state.fontBorderColor!=null?this.state.fontBorderColor:null,"display: flex; align-items: unsafe "+(s==mxConstants.ALIGN_TOP?"flex-start":s==mxConstants.ALIGN_BOTTOM?"flex-end":"center")+"; justify-content: unsafe "+(r==mxConstants.ALIGN_LEFT?"flex-start":r==mxConstants.ALIGN_RIGHT?"flex-end":"center")+"; ",this.getTextCss(),m,mxUtils.bind(this,function(d,x,f,g,c){t+=this.state.dx,e+=this.state.dy;var v=p.firstChild,y=v.firstChild,T=y.firstChild,C=T.firstChild,S=(this.rotateHtml?this.state.rotation:0)+(u??0),E=(this.foOffset!=0?"translate("+this.foOffset+" "+this.foOffset+")":"")+(m!=1?"scale("+m+")":"");C.setAttribute("style",c),T.setAttribute("style",g),v.setAttribute("width",Math.ceil(1/Math.min(1,m)*100)+"%"),v.setAttribute("height",Math.ceil(1/Math.min(1,m)*100)+"%");var L=Math.round(e+x);L<0?v.setAttribute("y",L):(v.removeAttribute("y"),f+="padding-top: "+L+"px; "),y.setAttribute("style",f+"margin-left: "+Math.round(t+d)+"px;"),E+=S!=0?"rotate("+S+" "+t+" "+e+")":"",E!=""?p.setAttribute("transform",E):p.removeAttribute("transform"),this.state.alpha!=1?p.setAttribute("opacity",this.state.alpha):p.removeAttribute("opacity")}))},mxSvgCanvas2D.createCss=function(t,e,i,n,r,s,l,a,o,u,p,m,d){var x="box-sizing: border-box; font-size: 0; text-align: "+(i==mxConstants.ALIGN_LEFT?"left":i==mxConstants.ALIGN_RIGHT?"right":"center")+"; ",f=mxUtils.getAlignmentAsPoint(i,n),g="overflow: hidden; ",c="width: 1px; ",v="height: 1px; ",y=f.x*t,T=f.y*e;l?(c="width: "+Math.round(t)+"px; ",x+="max-height: "+Math.round(e)+"px; ",T=0):s=="fill"?(c="width: "+Math.round(t)+"px; ",v="height: "+Math.round(e)+"px; ",p+="width: 100%; height: 100%; ",x+=c+v):s=="width"?(c="width: "+Math.round(t)+"px; ",p+="width: 100%; ",x+=c,T=0,e>0&&(x+="max-height: "+Math.round(e)+"px; ")):(g="",T=0);var C="";a!=null&&(C+="background-color: "+a+"; "),o!=null&&(C+="border: 1px solid "+o+"; "),g==""||l?p+=C:x+=C,r&&t>0?(p+="white-space: normal; word-wrap: "+mxConstants.WORD_WRAP+"; ",c="width: "+Math.round(t)+"px; ",g!=""&&s!="fill"&&(T=0)):(p+="white-space: nowrap; ",g==""&&(y=0)),d(y,T,u+c+v,x+g,p,g)},mxSvgCanvas2D.prototype.getTextCss=function(){var t=this.state,e=mxConstants.ABSOLUTE_LINE_HEIGHT?t.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*this.lineHeightCorrection,i="display: inline-block; font-size: "+t.fontSize+"px; font-family: "+t.fontFamily+"; color: "+t.fontColor+"; line-height: "+e+"; pointer-events: "+(this.pointerEvents?this.pointerEventsValue:"none")+"; ";(t.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(i+="font-weight: bold; "),(t.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(i+="font-style: italic; ");var n=[];return(t.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.push("underline"),(t.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&n.push("line-through"),n.length>0&&(i+="text-decoration: "+n.join(" ")+"; "),i},mxSvgCanvas2D.prototype.text=function(t,e,i,n,r,s,l,a,o,u,p,m,d){if(this.textEnabled&&r!=null)if(m=m??0,this.foEnabled&&o=="html"){var x=this.createDiv(r);x!=null&&(d!=null&&x.setAttribute("dir",d),this.addForeignObject(t,e,i,n,r,s,l,a,o,u,p,m,d,x,this.root))}else this.plainText(t+this.state.dx,e+this.state.dy,i,n,r,s,l,a,u,p,m,d)},mxSvgCanvas2D.prototype.createClip=function(t,e,i,n){t=Math.round(t),e=Math.round(e),i=Math.round(i),n=Math.round(n);for(var r="mx-clip-"+t+"-"+e+"-"+i+"-"+n,s=0,l=r+"-"+s;document.getElementById(l)!=null;)l=r+"-"+ ++s;clip=this.createElement("clipPath"),clip.setAttribute("id",l);var a=this.createElement("rect");return a.setAttribute("x",t),a.setAttribute("y",e),a.setAttribute("width",i),a.setAttribute("height",n),clip.appendChild(a),clip},mxSvgCanvas2D.prototype.plainText=function(t,e,i,n,r,s,l,a,o,u,p,m){p=p??0;var d=this.state,x=d.fontSize,f=this.createElement("g"),g=d.transform||"";if(this.updateFont(f),!this.pointerEvents&&this.originalRoot==null&&f.setAttribute("pointer-events","none"),p!=0&&(g+="rotate("+p+","+this.format(t*d.scale)+","+this.format(e*d.scale)+")"),m!=null&&f.setAttribute("direction",m),u&&i>0&&n>0){var c=t,L=e;s==mxConstants.ALIGN_CENTER?c-=i/2:s==mxConstants.ALIGN_RIGHT&&(c-=i),o!="fill"&&(l==mxConstants.ALIGN_MIDDLE?L-=n/2:l==mxConstants.ALIGN_BOTTOM&&(L-=n));var v=this.createClip(c*d.scale-2,L*d.scale-2,i*d.scale+4,n*d.scale+4);if(this.defs!=null?this.defs.appendChild(v):this.root.appendChild(v),!mxClient.IS_CHROMEAPP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&this.root.ownerDocument==document){var y=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");f.setAttribute("clip-path","url("+y+"#"+v.getAttribute("id")+")")}else f.setAttribute("clip-path","url(#"+v.getAttribute("id")+")")}var T=s==mxConstants.ALIGN_RIGHT?"end":s==mxConstants.ALIGN_CENTER?"middle":"start";T!="start"&&f.setAttribute("text-anchor",T),(!this.styleEnabled||x!=mxConstants.DEFAULT_FONTSIZE)&&f.setAttribute("font-size",x*d.scale+"px"),g.length>0&&f.setAttribute("transform",g),d.alpha<1&&f.setAttribute("opacity",d.alpha);var C=r.split(` `),S=Math.round(x*mxConstants.LINE_HEIGHT),E=x+(C.length-1)*S,L=e+x-1;if(l==mxConstants.ALIGN_MIDDLE)if(o=="fill")L-=n/2;else{var A=(this.matchHtmlAlignment&&u&&n>0?Math.min(E,n):E)/2;L-=A}else if(l==mxConstants.ALIGN_BOTTOM)if(o=="fill")L-=n;else{var A=this.matchHtmlAlignment&&u&&n>0?Math.min(E,n):E;L-=A+1}for(var M=0;M0&&mxUtils.trim(C[M]).length>0){var I=this.createElement("text");I.setAttribute("x",this.format(t*d.scale)+this.textOffset),I.setAttribute("y",this.format(L*d.scale)+this.textOffset),mxUtils.write(I,C[M]),f.appendChild(I)}L+=S}this.root.appendChild(f),this.addTextBackground(f,r,t,e,i,o=="fill"?n:E,s,l,o)},mxSvgCanvas2D.prototype.updateFont=function(t){var e=this.state;t.setAttribute("fill",e.fontColor),(!this.styleEnabled||e.fontFamily!=mxConstants.DEFAULT_FONTFAMILY)&&t.setAttribute("font-family",e.fontFamily),(e.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&t.setAttribute("font-weight","bold"),(e.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&t.setAttribute("font-style","italic");var i=[];(e.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(e.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&t.setAttribute("text-decoration",i.join(" "))},mxSvgCanvas2D.prototype.addTextBackground=function(t,e,i,n,r,s,l,a,o){var u=this.state;if(u.fontBackgroundColor!=null||u.fontBorderColor!=null){var p=null;if(o=="fill"||o=="width")l==mxConstants.ALIGN_CENTER?i-=r/2:l==mxConstants.ALIGN_RIGHT&&(i-=r),a==mxConstants.ALIGN_MIDDLE?n-=s/2:a==mxConstants.ALIGN_BOTTOM&&(n-=s),p=new mxRectangle((i+1)*u.scale,n*u.scale,(r-2)*u.scale,(s+2)*u.scale);else if(t.getBBox!=null&&this.root.ownerDocument==document)try{p=t.getBBox();var m=mxClient.IS_IE&&mxClient.IS_SVG;p=new mxRectangle(p.x,p.y+(m?0:1),p.width,p.height+(m?1:0))}catch{}if(p==null||p.width==0||p.height==0){var d=document.createElement("div");d.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?u.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,d.style.fontSize=u.fontSize+"px",d.style.fontFamily=u.fontFamily,d.style.whiteSpace="nowrap",d.style.position="absolute",d.style.visibility="hidden",d.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",d.style.zoom="1",(u.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(d.style.fontWeight="bold"),(u.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(d.style.fontStyle="italic"),e=mxUtils.htmlEntities(e,!1),d.innerHTML=e.replace(/\n/g,"
"),document.body.appendChild(d);var r=d.offsetWidth,s=d.offsetHeight;d.parentNode.removeChild(d),l==mxConstants.ALIGN_CENTER?i-=r/2:l==mxConstants.ALIGN_RIGHT&&(i-=r),a==mxConstants.ALIGN_MIDDLE?n-=s/2:a==mxConstants.ALIGN_BOTTOM&&(n-=s),p=new mxRectangle((i+1)*u.scale,(n+2)*u.scale,r*u.scale,(s+1)*u.scale)}if(p!=null){var x=this.createElement("rect");x.setAttribute("fill",u.fontBackgroundColor||"none"),x.setAttribute("stroke",u.fontBorderColor||"none"),x.setAttribute("x",Math.floor(p.x-1)),x.setAttribute("y",Math.floor(p.y-1)),x.setAttribute("width",Math.ceil(p.width+2)),x.setAttribute("height",Math.ceil(p.height));var f=u.fontBorderColor!=null?Math.max(1,this.format(u.scale)):0;x.setAttribute("stroke-width",f),this.root.ownerDocument==document&&mxUtils.mod(f,2)==1&&x.setAttribute("transform","translate(0.5, 0.5)"),t.insertBefore(x,t.firstChild)}}},mxSvgCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxSvgCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},__mxOutput.mxSvgCanvas2D=typeof mxSvgCanvas2D<"u"?mxSvgCanvas2D:void 0;var mxVmlCanvas2D=function(t){mxAbstractCanvas2D.call(this),this.root=t};mxUtils.extend(mxVmlCanvas2D,mxAbstractCanvas2D),mxVmlCanvas2D.prototype.node=null,mxVmlCanvas2D.prototype.textEnabled=!0,mxVmlCanvas2D.prototype.moveOp="m",mxVmlCanvas2D.prototype.lineOp="l",mxVmlCanvas2D.prototype.curveOp="c",mxVmlCanvas2D.prototype.closeOp="x",mxVmlCanvas2D.prototype.rotatedHtmlBackground="",mxVmlCanvas2D.prototype.vmlScale=1,mxVmlCanvas2D.prototype.createElement=function(t){return document.createElement(t)},mxVmlCanvas2D.prototype.createVmlElement=function(t){return this.createElement(mxClient.VML_PREFIX+":"+t)},mxVmlCanvas2D.prototype.addNode=function(t,e){var i=this.node,n=this.state;if(i!=null){if(i.nodeName=="shape")if(this.path!=null&&this.path.length>0)i.path=this.path.join(" ")+" e",i.style.width=this.root.style.width,i.style.height=this.root.style.height,i.coordsize=parseInt(i.style.width)+" "+parseInt(i.style.height);else return;i.strokeweight=this.format(Math.max(1,n.strokeWidth*n.scale/this.vmlScale))+"px",n.shadow&&this.root.appendChild(this.createShadow(i,t&&n.fillColor!=null,e&&n.strokeColor!=null)),e&&n.strokeColor!=null?(i.stroked="true",i.strokecolor=n.strokeColor):i.stroked="false",i.appendChild(this.createStroke()),t&&n.fillColor!=null?i.appendChild(this.createFill()):this.pointerEvents&&(i.nodeName!="shape"||this.path[this.path.length-1]==this.closeOp)?i.appendChild(this.createTransparentFill()):i.filled="false",this.root.appendChild(i)}},mxVmlCanvas2D.prototype.createTransparentFill=function(){var t=this.createVmlElement("fill");return t.src=mxClient.imageBasePath+"/transparent.gif",t.type="tile",t},mxVmlCanvas2D.prototype.createFill=function(){var t=this.state,e=this.createVmlElement("fill");if(e.color=t.fillColor,t.gradientColor!=null){e.type="gradient",e.method="none",e.color2=t.gradientColor;var i=180-t.rotation;t.gradientDirection==mxConstants.DIRECTION_WEST?i-=90+(this.root.style.flip=="x"?180:0):t.gradientDirection==mxConstants.DIRECTION_EAST?i+=90+(this.root.style.flip=="x"?180:0):t.gradientDirection==mxConstants.DIRECTION_NORTH?i-=180+(this.root.style.flip=="y"?-180:0):i+=this.root.style.flip=="y"?-180:0,(this.root.style.flip=="x"||this.root.style.flip=="y")&&(i*=-1),e.angle=mxUtils.mod(i,360),e.opacity=t.alpha*t.gradientFillAlpha*100+"%",e.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",t.alpha*t.gradientAlpha*100+"%")}else(t.alpha<1||t.fillAlpha<1)&&(e.opacity=t.alpha*t.fillAlpha*100+"%");return e},mxVmlCanvas2D.prototype.createStroke=function(){var t=this.state,e=this.createVmlElement("stroke");return e.endcap=t.lineCap||"flat",e.joinstyle=t.lineJoin||"miter",e.miterlimit=t.miterLimit||"10",(t.alpha<1||t.strokeAlpha<1)&&(e.opacity=t.alpha*t.strokeAlpha*100+"%"),t.dashed&&(e.dashstyle=this.getVmlDashStyle()),e},mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var t="dash";if(typeof this.state.dashPattern=="string"){var e=this.state.dashPattern.split(" ");e.length>0&&e[0]==1&&(t="0 2")}return t},mxVmlCanvas2D.prototype.createShadow=function(t,e,i){var n=this.state,r=-n.rotation*(Math.PI/180),s=Math.cos(r),l=Math.sin(r),a=n.shadowDx*n.scale,o=n.shadowDy*n.scale;this.root.style.flip=="x"?a*=-1:this.root.style.flip=="y"&&(o*=-1);var u=t.cloneNode(!0);return u.style.marginLeft=Math.round(a*s-o*l)+"px",u.style.marginTop=Math.round(a*l+o*s)+"px",document.documentMode==8&&(u.strokeweight=t.strokeweight,t.nodeName=="shape"&&(u.path=this.path.join(" ")+" e",u.style.width=this.root.style.width,u.style.height=this.root.style.height,u.coordsize=parseInt(t.style.width)+" "+parseInt(t.style.height))),i?(u.strokecolor=n.shadowColor,u.appendChild(this.createShadowStroke())):u.stroked="false",e?u.appendChild(this.createShadowFill()):u.filled="false",u},mxVmlCanvas2D.prototype.createShadowFill=function(){var t=this.createVmlElement("fill");return t.color=this.state.shadowColor,t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%",t},mxVmlCanvas2D.prototype.createShadowStroke=function(){var t=this.createStroke();return t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%",t},mxVmlCanvas2D.prototype.rotate=function(t,e,i,n,r){e&&i?t+=180:e?this.root.style.flip="x":i&&(this.root.style.flip="y"),(e?!i:i)&&(t*=-1),this.root.style.rotation=t,this.state.rotation=this.state.rotation+t,this.state.rotationCx=n,this.state.rotationCy=r},mxVmlCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=this.createVmlElement("shape"),this.node.style.position="absolute"},mxVmlCanvas2D.prototype.quadTo=function(t,e,i,n){var r=this.state,s=(this.lastX+r.dx)*r.scale,l=(this.lastY+r.dy)*r.scale,a=(t+r.dx)*r.scale,o=(e+r.dy)*r.scale,u=(i+r.dx)*r.scale,p=(n+r.dy)*r.scale,m=s+2/3*(a-s),d=l+2/3*(o-l),x=u+2/3*(a-u),f=p+2/3*(o-p);this.path.push("c "+this.format(m)+" "+this.format(d)+" "+this.format(x)+" "+this.format(f)+" "+this.format(u)+" "+this.format(p)),this.lastX=u/r.scale-r.dx,this.lastY=p/r.scale-r.dy},mxVmlCanvas2D.prototype.createRect=function(t,e,i,n,r){var s=this.state,l=this.createVmlElement(t);return l.style.position="absolute",l.style.left=this.format((e+s.dx)*s.scale)+"px",l.style.top=this.format((i+s.dy)*s.scale)+"px",l.style.width=this.format(n*s.scale)+"px",l.style.height=this.format(r*s.scale)+"px",l},mxVmlCanvas2D.prototype.rect=function(t,e,i,n){this.node=this.createRect("rect",t,e,i,n)},mxVmlCanvas2D.prototype.roundrect=function(t,e,i,n,r,s){this.node=this.createRect("roundrect",t,e,i,n),this.node.setAttribute("arcsize",Math.max(r*100/i,s*100/n)+"%")},mxVmlCanvas2D.prototype.ellipse=function(t,e,i,n){this.node=this.createRect("oval",t,e,i,n)},mxVmlCanvas2D.prototype.image=function(t,e,i,n,r,s,l,a){var o=null;if(!s)o=this.createRect("image",t,e,i,n),o.src=r;else{o=this.createRect("rect",t,e,i,n),o.stroked="false";var u=this.createVmlElement("fill");u.aspect=s?"atmost":"ignore",u.rotate="true",u.type="frame",u.src=r,o.appendChild(u)}l&&a?o.style.rotation="180":l?o.style.flip="x":a&&(o.style.flip="y"),(this.state.alpha<1||this.state.fillAlpha<1)&&(o.style.filter+="alpha(opacity="+this.state.alpha*this.state.fillAlpha*100+")"),this.root.appendChild(o)},mxVmlCanvas2D.prototype.createDiv=function(t,e,i,n){var r=this.createElement("div"),s=this.state,l="";if(s.fontBackgroundColor!=null&&(l+="background-color:"+mxUtils.htmlEntities(s.fontBackgroundColor)+";"),s.fontBorderColor!=null&&(l+="border:1px solid "+mxUtils.htmlEntities(s.fontBorderColor)+";"),mxUtils.isNode(t))r.appendChild(t);else if(n!="fill"&&n!="width"){var a=this.createElement("div");a.style.cssText=l,a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",a.style.textDecoration="inherit",a.innerHTML=t,r.appendChild(a)}else r.style.cssText=l,r.innerHTML=t;var o=r.style;return o.fontSize=s.fontSize/this.vmlScale+"px",o.fontFamily=s.fontFamily,o.color=s.fontColor,o.verticalAlign="top",o.textAlign=e||"left",o.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?s.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale+"px":mxConstants.LINE_HEIGHT,(s.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(o.fontWeight="bold"),(s.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(o.fontStyle="italic"),(s.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(o.textDecoration="underline"),r},mxVmlCanvas2D.prototype.text=function(t,e,i,n,r,s,l,a,o,u,p,m,d){if(this.textEnabled&&r!=null){var x=this.state;if(o=="html"){if(x.rotation!=null){var f=this.rotatePoint(t,e,x.rotation,x.rotationCx,x.rotationCy);t=f.x,e=f.y}document.documentMode==8&&!mxClient.IS_EM?(t+=x.dx,e+=x.dy,u!="fill"&&l==mxConstants.ALIGN_TOP&&(e-=1)):(t*=x.scale,e*=x.scale);var g=document.documentMode==8&&!mxClient.IS_EM?this.createVmlElement("group"):this.createElement("div");g.style.position="absolute",g.style.display="inline",g.style.left=this.format(t)+"px",g.style.top=this.format(e)+"px",g.style.zoom=x.scale;var c=this.createElement("div");c.style.position="relative",c.style.display="inline";var v=mxUtils.getAlignmentAsPoint(s,l),y=v.x,T=v.y,C=this.createDiv(r,s,l,u),S=this.createElement("div");if(d!=null&&C.setAttribute("dir",d),a&&i>0){if(p||(C.style.width=Math.round(i)+"px"),C.style.wordWrap=mxConstants.WORD_WRAP,C.style.whiteSpace="normal",C.style.wordWrap=="break-word"){var E=C;E.firstChild!=null&&E.firstChild.nodeName=="DIV"&&(E.firstChild.style.width="100%")}}else C.style.whiteSpace="nowrap";var L=x.rotation+(m||0);if(this.rotateHtml&&L!=0?(S.style.display="inline",S.style.zoom="1",S.appendChild(C),document.documentMode==8&&!mxClient.IS_EM&&this.root.nodeName!="DIV"?(c.appendChild(S),g.appendChild(c)):g.appendChild(S)):document.documentMode==8&&!mxClient.IS_EM?(c.appendChild(C),g.appendChild(c)):(C.style.display="inline",g.appendChild(C)),this.root.nodeName!="DIV"){var A=this.createVmlElement("rect");A.stroked="false",A.filled="false",A.appendChild(g),this.root.appendChild(A)}else this.root.appendChild(g);if(p?(C.style.overflow="hidden",C.style.width=Math.round(i)+"px",mxClient.IS_QUIRKS||(C.style.maxHeight=Math.round(n)+"px")):u=="fill"?(C.style.overflow="hidden",C.style.width=Math.max(0,i)+1+"px",C.style.height=Math.max(0,n)+1+"px"):u=="width"&&(C.style.overflow="hidden",C.style.width=Math.max(0,i)+1+"px",C.style.maxHeight=Math.max(0,n)+1+"px"),this.rotateHtml&&L!=0){var M=L*(Math.PI/180),I=parseFloat(parseFloat(Math.cos(M)).toFixed(8)),P=parseFloat(parseFloat(Math.sin(-M)).toFixed(8));M%=2*Math.PI,M<0&&(M+=2*Math.PI),M%=Math.PI,M>Math.PI/2&&(M=Math.PI-M);var R=Math.cos(M),O=Math.sin(M);document.documentMode==8&&!mxClient.IS_EM&&(C.style.display="inline-block",S.style.display="inline-block",c.style.display="inline-block"),C.style.visibility="hidden",C.style.position="absolute",document.body.appendChild(C);var _=C;_.firstChild!=null&&_.firstChild.nodeName=="DIV"&&(_=_.firstChild);var E=_.offsetWidth+3,b=_.offsetHeight;p?(i=Math.min(i,E),b=Math.min(b,n)):i=E,a&&(C.style.width=i+"px"),mxClient.IS_QUIRKS&&(p||u=="width")&&b>n&&(b=n,C.style.height=b+"px"),n=b;var k=(n-n*R+i*-O)/2-P*i*(y+.5)+I*n*(T+.5),G=(i-i*R+n*-O)/2+I*i*(y+.5)+P*n*(T+.5);if(g.nodeName=="group"&&this.root.nodeName=="DIV"){var B=this.createElement("div");B.style.display="inline-block",B.style.position="absolute",B.style.left=this.format(t+(G-i/2)*x.scale)+"px",B.style.top=this.format(e+(k-n/2)*x.scale)+"px",g.parentNode.appendChild(B),B.appendChild(g)}else{var j=document.documentMode==8&&!mxClient.IS_EM?1:x.scale;g.style.left=this.format(t+(G-i/2)*j)+"px",g.style.top=this.format(e+(k-n/2)*j)+"px"}S.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+I+", M12="+P+", M21="+-P+", M22="+I+", sizingMethod='auto expand')",S.style.backgroundColor=this.rotatedHtmlBackground,this.state.alpha<1&&(S.style.filter+="alpha(opacity="+this.state.alpha*100+")"),S.appendChild(C),C.style.position="",C.style.visibility=""}else if(document.documentMode!=8||mxClient.IS_EM){C.style.verticalAlign="top",this.state.alpha<1&&(g.style.filter="alpha(opacity="+this.state.alpha*100+")");var H=C.parentNode;C.style.visibility="hidden",document.body.appendChild(C),i=C.offsetWidth;var b=C.offsetHeight;mxClient.IS_QUIRKS&&p&&b>n&&(b=n,C.style.height=b+"px"),n=b,C.style.visibility="",H.appendChild(C),g.style.left=this.format(t+i*y*this.state.scale)+"px",g.style.top=this.format(e+n*T*this.state.scale)+"px"}else this.state.alpha<1&&(C.style.filter="alpha(opacity="+this.state.alpha*100+")"),c.style.left=y*100+"%",c.style.top=T*100+"%"}else this.plainText(t,e,i,n,mxUtils.htmlEntities(r,!1),s,l,a,o,u,p,m,d)}},mxVmlCanvas2D.prototype.plainText=function(t,e,i,n,r,s,l,a,o,u,p,m,d){var x=this.state;t=(t+x.dx)*x.scale,e=(e+x.dy)*x.scale;var f=this.createVmlElement("shape");f.style.width="1px",f.style.height="1px",f.stroked="false";var g=this.createVmlElement("fill");g.color=x.fontColor,g.opacity=x.alpha*100+"%",f.appendChild(g);var c=this.createVmlElement("path");c.textpathok="true",c.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0),f.appendChild(c);var v=this.createVmlElement("textpath");v.style.cssText="v-text-align:"+s,v.style.align=s,v.style.fontFamily=x.fontFamily,v.string=r,v.on="true";var y=x.fontSize*x.scale/this.vmlScale;v.style.fontSize=y+"px",(x.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(v.style.fontWeight="bold"),(x.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(v.style.fontStyle="italic"),(x.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(v.style.textDecoration="underline");var T=r.split(` -`),C=y+(T.length-1)*y*mxConstants.LINE_HEIGHT,S=0,E=0;if(l==mxConstants.ALIGN_BOTTOM?E=-C/2:l!=mxConstants.ALIGN_MIDDLE&&(E=C/2),m!=null){f.style.rotation=m;var L=m*(Math.PI/180);S=Math.sin(L)*E,E=Math.cos(L)*E}f.appendChild(v),f.style.left=this.format(t-S)+"px",f.style.top=this.format(e+E)+"px",this.root.appendChild(f)},mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},__mxOutput.mxVmlCanvas2D=typeof mxVmlCanvas2D<"u"?mxVmlCanvas2D:void 0;function mxGuide(t,e){this.graph=t,this.setStates(e)}mxGuide.prototype.graph=null,mxGuide.prototype.states=null,mxGuide.prototype.horizontal=!0,mxGuide.prototype.vertical=!0,mxGuide.prototype.guideX=null,mxGuide.prototype.guideY=null,mxGuide.prototype.rounded=!1,mxGuide.prototype.tolerance=2,mxGuide.prototype.setStates=function(t){this.states=t},mxGuide.prototype.isEnabledForEvent=function(t){return!0},mxGuide.prototype.getGuideTolerance=function(t){return t&&this.graph.gridEnabled?this.graph.gridSize/2:this.tolerance},mxGuide.prototype.createGuideShape=function(t){var e=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH);return e.isDashed=!0,e},mxGuide.prototype.isStateIgnored=function(t){return!1},mxGuide.prototype.move=function(t,e,i,n){if(this.states!=null&&(this.horizontal||this.vertical)&&t!=null&&e!=null){let R=function(_,b,k){var G=!1;k&&Math.abs(_-v)0&&t[0]!=null){this.bounds=new mxRectangle(Number(t[0].x),Number(t[0].y),1,1);for(var e=1;e0&&this.bounds!=null&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&this.bounds.width>0&&this.bounds.height>0},mxShape.prototype.createVmlGroup=function(){var t=document.createElement(mxClient.VML_PREFIX+":group");return t.style.position="absolute",t.style.width=this.node.style.width,t.style.height=this.node.style.height,t},mxShape.prototype.redrawShape=function(){var t=this.createCanvas();t!=null&&(t.pointerEvents=this.pointerEvents,this.beforePaint(t),this.paint(t),this.afterPaint(t),this.node!=t.root&&this.node.insertAdjacentHTML("beforeend",t.root.outerHTML),this.node.nodeName=="DIV"&&document.documentMode==8&&(this.node.style.filter="",mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(t))},mxShape.prototype.createCanvas=function(){var t=null;return this.node.ownerSVGElement!=null?t=this.createSvgCanvas():mxClient.IS_VML&&(this.updateVmlContainer(),t=this.createVmlCanvas()),t!=null&&this.outline&&(t.setStrokeWidth(this.strokewidth),t.setStrokeColor(this.stroke),this.isDashed!=null&&t.setDashed(this.isDashed),t.setStrokeWidth=function(){},t.setStrokeColor=function(){},t.setFillColor=function(){},t.setGradient=function(){},t.setDashed=function(){},t.text=function(){}),t},mxShape.prototype.createSvgCanvas=function(){var t=new mxSvgCanvas2D(this.node,!1);t.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,t.pointerEventsValue=this.svgPointerEvents;var e=this.getSvgScreenOffset();return e!=0?this.node.setAttribute("transform","translate("+e+","+e+")"):this.node.removeAttribute("transform"),t.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(t.format=function(i){return Math.round(parseFloat(i))}),t},mxShape.prototype.createVmlCanvas=function(){var t=document.documentMode==8&&this.isParseVml()?this.createVmlGroup():this.node,e=new mxVmlCanvas2D(t);if(t.tagUrn!=""){var i=Math.max(1,Math.round(this.bounds.width)),n=Math.max(1,Math.round(this.bounds.height));t.coordsize=i*this.vmlScale+","+n*this.vmlScale,e.scale(this.vmlScale),e.vmlScale=this.vmlScale}var r=this.scale;return e.translate(-Math.round(this.bounds.x/r),-Math.round(this.bounds.y/r)),e},mxShape.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px";var t=Math.max(1,Math.round(this.bounds.width)),e=Math.max(1,Math.round(this.bounds.height));this.node.style.width=t+"px",this.node.style.height=e+"px",this.node.style.overflow="visible"},mxShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node),this.updateHtmlFilters(this.node),this.updateHtmlColors(this.node)},mxShape.prototype.updateHtmlFilters=function(t){var e="";if(this.opacity<100&&(e+="alpha(opacity="+this.opacity+")"),this.isShadow&&(e+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.VML_SHADOWCOLOR+"')"),this.fill!=null&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var i=this.fill,n=this.gradient,r="0",s={east:0,south:1,west:2,north:3},l=this.direction!=null?s[this.direction]:0;if(this.gradientDirection!=null&&(l=mxUtils.mod(l+s[this.gradientDirection]-1,4)),l==1){r="1";var a=i;i=n,n=a}else if(l==2){var a=i;i=n,n=a}else l==3&&(r="1");e+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+i+"', endColorStr='"+n+"', gradientType='"+r+"')"}t.style.filter=e},mxShape.prototype.updateHtmlColors=function(t){var e=this.stroke;e!=null&&e!=mxConstants.NONE?(t.style.borderColor=e,this.isDashed?t.style.borderStyle="dashed":this.strokewidth>0&&(t.style.borderStyle="solid"),t.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):t.style.borderWidth="0px",e=this.outline?null:this.fill,e!=null&&e!=mxConstants.NONE?(t.style.backgroundColor=e,t.style.backgroundImage="none"):this.pointerEvents?t.style.backgroundColor="transparent":document.documentMode==8?mxUtils.addTransparentBackgroundFilter(t):this.setTransparentBackgroundImage(t)},mxShape.prototype.updateHtmlBounds=function(t){var e=document.documentMode>=9?0:Math.ceil(this.strokewidth*this.scale);t.style.borderWidth=Math.max(1,e)+"px",t.style.overflow="hidden",t.style.left=Math.round(this.bounds.x-e/2)+"px",t.style.top=Math.round(this.bounds.y-e/2)+"px",document.compatMode=="CSS1Compat"&&(e=-e),t.style.width=Math.round(Math.max(0,this.bounds.width+e))+"px",t.style.height=Math.round(Math.max(0,this.bounds.height+e))+"px"},mxShape.prototype.destroyCanvas=function(t){if(t instanceof mxSvgCanvas2D){for(var e in t.gradients){var i=t.gradients[e];i!=null&&(i.mxRefCount=(i.mxRefCount||0)+1)}this.releaseSvgGradients(this.oldGradients),this.oldGradients=t.gradients}},mxShape.prototype.beforePaint=function(t){},mxShape.prototype.afterPaint=function(t){},mxShape.prototype.paint=function(t){var e=!1;if(t!=null&&this.outline){var i=t.stroke;t.stroke=function(){e=!0,i.apply(this,arguments)};var n=t.fillAndStroke;t.fillAndStroke=function(){e=!0,n.apply(this,arguments)}}var r=this.scale,s=this.bounds.x/r,l=this.bounds.y/r,a=this.bounds.width/r,o=this.bounds.height/r;if(this.isPaintBoundsInverted()){var u=(a-o)/2;s+=u,l-=u;var p=a;a=o,o=p}this.updateTransform(t,s,l,a,o),this.configureCanvas(t,s,l,a,o);var m=null;if(this.stencil==null&&this.points==null&&this.shapePointerEvents||this.stencil!=null&&this.stencilPointerEvents){var d=this.createBoundingBox();if(this.dialect==mxConstants.DIALECT_SVG)m=this.createTransparentSvgRectangle(d.x,d.y,d.width,d.height),this.node.appendChild(m);else{var x=t.createRect("rect",d.x/r,d.y/r,d.width/r,d.height/r);x.appendChild(t.createTransparentFill()),x.stroked="false",t.root.appendChild(x)}}if(this.stencil!=null)this.stencil.drawShape(t,this,s,l,a,o);else if(t.setStrokeWidth(this.strokewidth),this.points!=null){for(var f=[],g=0;g0){l=l??!0;var a=e[e.length-1];if(r&&i){e=e.slice();var o=e[0],u=new mxPoint(a.x+(o.x-a.x)/2,a.y+(o.y-a.y)/2);e.splice(0,0,u)}var p=e[0],m=1;for(l?t.moveTo(p.x,p.y):t.lineTo(p.x,p.y);m<(r?e.length:e.length-1);){var d=e[mxUtils.mod(m,e.length)],x=p.x-d.x,f=p.y-d.y;if(i&&(x!=0||f!=0)&&(s==null||mxUtils.indexOf(s,m-1)<0)){var g=Math.sqrt(x*x+f*f),c=x*Math.min(n,g/2)/g,v=f*Math.min(n,g/2)/g,y=d.x+c,T=d.y+v;t.lineTo(y,T);for(var C=e[mxUtils.mod(m+1,e.length)];m0&&t.height>0){this.boundingBox=new mxRectangle(t.x,t.y,t.width,t.height),this.boundingBox.grow(this.strokewidth*this.scale/2);return}}catch{}if(this.bounds!=null){var e=this.createBoundingBox();if(e!=null){this.augmentBoundingBox(e);var i=this.getShapeRotation();i!=0&&(e=mxUtils.getBoundingBox(e,i))}this.boundingBox=e}},mxShape.prototype.createBoundingBox=function(){var t=this.bounds.clone();return(this.stencil!=null&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)||this.isPaintBoundsInverted())&&t.rotate90(),t},mxShape.prototype.augmentBoundingBox=function(t){this.isShadow&&(t.width+=Math.ceil(mxConstants.SHADOW_OFFSET_X*this.scale),t.height+=Math.ceil(mxConstants.SHADOW_OFFSET_Y*this.scale)),t.grow(this.strokewidth*this.scale/2)},mxShape.prototype.isPaintBoundsInverted=function(){return this.stencil==null&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)},mxShape.prototype.getRotation=function(){return this.rotation!=null?this.rotation:0},mxShape.prototype.getTextRotation=function(){var t=this.getRotation();return mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)!=1&&(t+=mxText.prototype.verticalTextRotation),t},mxShape.prototype.getShapeRotation=function(){var t=this.getRotation();return this.direction!=null&&(this.direction==mxConstants.DIRECTION_NORTH?t+=270:this.direction==mxConstants.DIRECTION_WEST?t+=180:this.direction==mxConstants.DIRECTION_SOUTH&&(t+=90)),t},mxShape.prototype.createTransparentSvgRectangle=function(t,e,i,n){var r=document.createElementNS(mxConstants.NS_SVG,"rect");return r.setAttribute("x",t),r.setAttribute("y",e),r.setAttribute("width",i),r.setAttribute("height",n),r.setAttribute("fill","none"),r.setAttribute("stroke","none"),r.setAttribute("pointer-events","all"),r},mxShape.prototype.setTransparentBackgroundImage=function(t){t.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"},mxShape.prototype.releaseSvgGradients=function(t){if(t!=null)for(var e in t){var i=t[e];i!=null&&(i.mxRefCount=(i.mxRefCount||0)-1,i.mxRefCount==0&&i.parentNode!=null&&i.parentNode.removeChild(i))}},mxShape.prototype.destroy=function(){this.node!=null&&(mxEvent.release(this.node),this.node.parentNode!=null&&this.node.parentNode.removeChild(this.node),this.node=null),this.releaseSvgGradients(this.oldGradients),this.oldGradients=null},__mxOutput.mxShape=typeof mxShape<"u"?mxShape:void 0;function mxStencil(t){this.desc=t,this.parseDescription(),this.parseConstraints()}mxUtils.extend(mxStencil,mxShape),mxStencil.defaultLocalized=!1,mxStencil.allowEval=!1,mxStencil.prototype.desc=null,mxStencil.prototype.constraints=null,mxStencil.prototype.aspect=null,mxStencil.prototype.w0=null,mxStencil.prototype.h0=null,mxStencil.prototype.bgNode=null,mxStencil.prototype.fgNode=null,mxStencil.prototype.strokewidth=null,mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0],this.bgNode=this.desc.getElementsByTagName("background")[0],this.w0=Number(this.desc.getAttribute("w")||100),this.h0=Number(this.desc.getAttribute("h")||100);var t=this.desc.getAttribute("aspect");this.aspect=t??"variable";var e=this.desc.getAttribute("strokewidth");this.strokewidth=e??"1"},mxStencil.prototype.parseConstraints=function(){var t=this.desc.getElementsByTagName("connections")[0];if(t!=null){var e=mxUtils.getChildNodes(t);if(e!=null&&e.length>0){this.constraints=[];for(var i=0;i0&&s>0)for(var p=l.firstChild;p!=null;)p.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(t,e,p,a,o,u),p=p.nextSibling},mxStencil.prototype.computeAspect=function(t,e,i,n,r,s){var l=e,a=i,o=n/this.w0,u=r/this.h0,p=s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_SOUTH;if(p){u=n/this.h0,o=r/this.w0;var m=(n-r)/2;l+=m,a-=m}return this.aspect=="fixed"&&(u=Math.min(o,u),o=u,p?(l+=(r-this.w0*o)/2,a+=(n-this.h0*u)/2):(l+=(n-this.w0*o)/2,a+=(r-this.h0*u)/2)),new mxRectangle(l,a,o,u)},mxStencil.prototype.drawNode=function(t,e,i,n,r,s){var l=i.nodeName,a=n.x,o=n.y,u=n.width,p=n.height,m=Math.min(u,p);if(l=="save")t.save();else if(l=="restore")t.restore();else if(s){if(l=="path"){t.begin();var d=!0;if(i.getAttribute("rounded")=="1"){d=!1;for(var x=Number(i.getAttribute("arcSize")),f=0,g=[],c=i.firstChild;c!=null;){if(c.nodeType==mxConstants.NODETYPE_ELEMENT){var v=c.nodeName;if(v=="move"||v=="line")(v=="move"||g.length==0)&&g.push([]),g[g.length-1].push(new mxPoint(a+Number(c.getAttribute("x"))*u,o+Number(c.getAttribute("y"))*p)),f++;else{d=!0;break}}c=c.nextSibling}if(!d&&f>0)for(var y=0;y0&&V.push(Number(X[y])*m);W=V.join(" "),t.setDashPattern(W)}}else l=="strokecolor"?t.setStrokeColor(i.getAttribute("color")):l=="linecap"?t.setLineCap(i.getAttribute("cap")):l=="linejoin"?t.setLineJoin(i.getAttribute("join")):l=="miterlimit"?t.setMiterLimit(Number(i.getAttribute("limit"))):l=="fillcolor"?t.setFillColor(i.getAttribute("color")):l=="alpha"||l=="fillalpha"||l=="strokealpha"?t.setAlpha(i.getAttribute("alpha")):l=="fontcolor"?t.setFontColor(i.getAttribute("color")):l=="fontstyle"?t.setFontStyle(i.getAttribute("style")):l=="fontfamily"?t.setFontFamily(i.getAttribute("family")):l=="fontsize"&&t.setFontSize(Number(i.getAttribute("size"))*m);r&&(l=="fillstroke"||l=="fill"||l=="stroke")&&(r=!1,t.setShadow(!1))}},__mxOutput.mxStencil=typeof mxStencil<"u"?mxStencil:void 0;var mxStencilRegistry={stencils:{},addStencil:function(t,e){mxStencilRegistry.stencils[t]=e},getStencil:function(t){return mxStencilRegistry.stencils[t]}};__mxOutput.mxStencilRegistry=typeof mxStencilRegistry<"u"?mxStencilRegistry:void 0;var mxMarker={markers:[],addMarker:function(t,e){mxMarker.markers[t]=e},createMarker:function(t,e,i,n,r,s,l,a,o,u){var p=mxMarker.markers[i];return p!=null?p(t,e,i,n,r,s,l,a,o,u):null}};(function(){function t(n){return n=n??2,function(r,s,l,a,o,u,p,m,d,x){var f=o*d*1.118,g=u*d*1.118;o=o*(p+d),u=u*(p+d);var c=a.clone();c.x-=f,c.y-=g;var v=l!=mxConstants.ARROW_CLASSIC&&l!=mxConstants.ARROW_CLASSIC_THIN?1:3/4;return a.x+=-o*v-f,a.y+=-u*v-g,function(){r.begin(),r.moveTo(c.x,c.y),r.lineTo(c.x-o-u/n,c.y-u+o/n),(l==mxConstants.ARROW_CLASSIC||l==mxConstants.ARROW_CLASSIC_THIN)&&r.lineTo(c.x-o*3/4,c.y-u*3/4),r.lineTo(c.x+u/n-o,c.y-u-o/n),r.close(),x?r.fillAndStroke():r.stroke()}}}mxMarker.addMarker("classic",t(2)),mxMarker.addMarker("classicThin",t(3)),mxMarker.addMarker("block",t(2)),mxMarker.addMarker("blockThin",t(3));function e(n){return n=n??2,function(r,s,l,a,o,u,p,m,d,x){var f=o*d*1.118,g=u*d*1.118;o=o*(p+d),u=u*(p+d);var c=a.clone();return c.x-=f,c.y-=g,a.x+=-f*2,a.y+=-g*2,function(){r.begin(),r.moveTo(c.x-o-u/n,c.y-u+o/n),r.lineTo(c.x,c.y),r.lineTo(c.x+u/n-o,c.y-u-o/n),r.stroke()}}}mxMarker.addMarker("open",e(2)),mxMarker.addMarker("openThin",e(3)),mxMarker.addMarker("oval",function(n,r,s,l,a,o,u,p,m,d){var x=u/2,f=l.clone();return l.x-=a*x,l.y-=o*x,function(){n.ellipse(f.x-x,f.y-x,u,u),d?n.fillAndStroke():n.stroke()}});function i(n,r,s,l,a,o,u,p,m,d){var x=s==mxConstants.ARROW_DIAMOND?.7071:.9862,f=a*m*x,g=o*m*x;a=a*(u+m),o=o*(u+m);var c=l.clone();c.x-=f,c.y-=g,l.x+=-a-f,l.y+=-o-g;var v=s==mxConstants.ARROW_DIAMOND?2:3.4;return function(){n.begin(),n.moveTo(c.x,c.y),n.lineTo(c.x-a/2-o/v,c.y+a/v-o/2),n.lineTo(c.x-a,c.y-o),n.lineTo(c.x-a/2+o/v,c.y-o/2-a/v),n.close(),d?n.fillAndStroke():n.stroke()}}mxMarker.addMarker("diamond",i),mxMarker.addMarker("diamondThin",i)})(),__mxOutput.mxMarker=typeof mxMarker<"u"?mxMarker:void 0;function mxActor(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxActor,mxShape),mxActor.prototype.paintVertexShape=function(t,e,i,n,r){t.translate(e,i),t.begin(),this.redrawPath(t,e,i,n,r),t.fillAndStroke()},mxActor.prototype.redrawPath=function(t,e,i,n,r){var s=n/3;t.moveTo(0,r),t.curveTo(0,3*r/5,0,2*r/5,n/2,2*r/5),t.curveTo(n/2-s,2*r/5,n/2-s,0,n/2,0),t.curveTo(n/2+s,0,n/2+s,2*r/5,n/2,2*r/5),t.curveTo(n,2*r/5,n,3*r/5,n,r),t.close()},__mxOutput.mxActor=typeof mxActor<"u"?mxActor:void 0;function mxCloud(t,e,i,n){mxActor.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxCloud,mxActor),mxCloud.prototype.redrawPath=function(t,e,i,n,r){t.moveTo(.25*n,.25*r),t.curveTo(.05*n,.25*r,0,.5*r,.16*n,.55*r),t.curveTo(0,.66*r,.18*n,.9*r,.31*n,.8*r),t.curveTo(.4*n,r,.7*n,r,.8*n,.8*r),t.curveTo(n,.8*r,n,.6*r,.875*n,.5*r),t.curveTo(n,.3*r,.8*n,.1*r,.625*n,.2*r),t.curveTo(.5*n,.05*r,.3*n,.05*r,.25*n,.25*r),t.close()},__mxOutput.mxCloud=typeof mxCloud<"u"?mxCloud:void 0;function mxRectangleShape(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxRectangleShape,mxShape),mxRectangleShape.prototype.isHtmlAllowed=function(){var t=!0;return this.style!=null&&(t=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")=="1"),!this.isRounded&&!this.glass&&this.rotation==0&&(t||this.fill!=null&&this.fill!=mxConstants.NONE)},mxRectangleShape.prototype.paintBackground=function(t,e,i,n,r){var s=!0;if(this.style!=null&&(s=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")=="1"),s||this.fill!=null&&this.fill!=mxConstants.NONE||this.stroke!=null&&this.stroke!=mxConstants.NONE){if(!s&&(this.fill==null||this.fill==mxConstants.NONE)&&(t.pointerEvents=!1),this.isRounded){var l=0;if(mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)=="1")l=Math.min(n/2,Math.min(r/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else{var a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.RECTANGLE_ROUNDING_FACTOR*100)/100;l=Math.min(n*a,r*a)}t.roundrect(e,i,n,r,l,l)}else t.rect(e,i,n,r);t.fillAndStroke()}},mxRectangleShape.prototype.isRoundable=function(t,e,i,n,r){return!0},mxRectangleShape.prototype.paintForeground=function(t,e,i,n,r){this.glass&&!this.outline&&this.fill!=null&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(t,e,i,n,r,this.getArcSize(n+this.strokewidth,r+this.strokewidth))},__mxOutput.mxRectangleShape=typeof mxRectangleShape<"u"?mxRectangleShape:void 0;function mxEllipse(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxEllipse,mxShape),mxEllipse.prototype.paintVertexShape=function(t,e,i,n,r){t.ellipse(e,i,n,r),t.fillAndStroke()},__mxOutput.mxEllipse=typeof mxEllipse<"u"?mxEllipse:void 0;function mxDoubleEllipse(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxDoubleEllipse,mxShape),mxDoubleEllipse.prototype.vmlScale=10,mxDoubleEllipse.prototype.paintBackground=function(t,e,i,n,r){t.ellipse(e,i,n,r),t.fillAndStroke()},mxDoubleEllipse.prototype.paintForeground=function(t,e,i,n,r){if(!this.outline){var s=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(n/5,r/5)));e+=s,i+=s,n-=2*s,r-=2*s,n>0&&r>0&&t.ellipse(e,i,n,r),t.stroke()}},mxDoubleEllipse.prototype.getLabelBounds=function(t){var e=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(t.width/5/this.scale,t.height/5/this.scale)))*this.scale;return new mxRectangle(t.x+e,t.y+e,t.width-2*e,t.height-2*e)},__mxOutput.mxDoubleEllipse=typeof mxDoubleEllipse<"u"?mxDoubleEllipse:void 0;function mxRhombus(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxRhombus,mxShape),mxRhombus.prototype.isRoundable=function(){return!0},mxRhombus.prototype.paintVertexShape=function(t,e,i,n,r){var s=n/2,l=r/2,a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,[new mxPoint(e+s,i),new mxPoint(e+n,i+l),new mxPoint(e+s,i+r),new mxPoint(e,i+l)],this.isRounded,a,!0),t.fillAndStroke()},__mxOutput.mxRhombus=typeof mxRhombus<"u"?mxRhombus:void 0;function mxPolyline(t,e,i){mxShape.call(this),this.points=t,this.stroke=e,this.strokewidth=i??1}mxUtils.extend(mxPolyline,mxShape),mxPolyline.prototype.getRotation=function(){return 0},mxPolyline.prototype.getShapeRotation=function(){return 0},mxPolyline.prototype.isPaintBoundsInverted=function(){return!1},mxPolyline.prototype.paintEdgeShape=function(t,e){var i=t.pointerEventsValue;t.pointerEventsValue="stroke",this.style==null||this.style[mxConstants.STYLE_CURVED]!=1?this.paintLine(t,e,this.isRounded):this.paintCurvedLine(t,e),t.pointerEventsValue=i},mxPolyline.prototype.paintLine=function(t,e,i){var n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,e,i,n,!1),t.stroke()},mxPolyline.prototype.paintCurvedLine=function(t,e){t.begin();var i=e[0],n=e.length;t.moveTo(i.x,i.y);for(var r=1;r2&&t.setMiterLimit(1.42),t.begin();var P=y,R=S;if(a&&!l)this.paintMarker(t,e[0].x,e[0].y,y,S,p,n,s,u,!0);else{var O=e[0].x+A/2+u*y,_=e[0].y+M/2+u*S,b=e[0].x-A/2+u*y,k=e[0].y-M/2+u*S;l?(t.moveTo(O,_),I.push(function(){t.lineTo(b,k)})):(t.moveTo(b,k),t.lineTo(O,_))}for(var G=0,B=0,j=0,H=0;H=0;H--)I[H]();l?(t.end(),t.stroke()):(t.close(),t.fillAndStroke()),t.setShadow(!1),t.setMiterLimit(4),d&&t.setLineJoin("flat"),e.length>2&&(t.setMiterLimit(4),a&&!l&&(t.begin(),this.paintMarker(t,e[0].x,e[0].y,P,R,p,n,s,u,!0),t.stroke(),t.end()),o&&!l&&(t.begin(),this.paintMarker(t,x.x,x.y,-y,-S,m,r,s,u,!0),t.stroke(),t.end()))}},mxArrowConnector.prototype.paintMarker=function(t,e,i,n,r,s,l,a,o,u){var p=a/l,m=a*r/2,d=-a*n/2,x=(o+s)*n,f=(o+s)*r;u?t.moveTo(e-m+x,i-d+f):t.lineTo(e-m+x,i-d+f),t.lineTo(e-m/p+x,i-d/p+f),t.lineTo(e+o*n,i+o*r),t.lineTo(e+m/p+x,i+d/p+f),t.lineTo(e+m+x,i+d+f)},mxArrowConnector.prototype.isArrowRounded=function(){return this.isRounded},mxArrowConnector.prototype.getStartArrowWidth=function(){return mxConstants.ARROW_WIDTH},mxArrowConnector.prototype.getEndArrowWidth=function(){return mxConstants.ARROW_WIDTH},mxArrowConnector.prototype.getEdgeWidth=function(){return mxConstants.ARROW_WIDTH/3},mxArrowConnector.prototype.isOpenEnded=function(){return!1},mxArrowConnector.prototype.isMarkerStart=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE},mxArrowConnector.prototype.isMarkerEnd=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE},__mxOutput.mxArrowConnector=typeof mxArrowConnector<"u"?mxArrowConnector:void 0;function mxText(t,e,i,n,r,s,l,a,o,u,p,m,d,x,f,g,c,v,y,T,C){mxShape.call(this),this.value=t,this.bounds=e,this.color=r??"black",this.align=i??mxConstants.ALIGN_CENTER,this.valign=n??mxConstants.ALIGN_MIDDLE,this.family=s??mxConstants.DEFAULT_FONTFAMILY,this.size=l??mxConstants.DEFAULT_FONTSIZE,this.fontStyle=a??mxConstants.DEFAULT_FONTSTYLE,this.spacing=parseInt(o||2),this.spacingTop=this.spacing+parseInt(u||0),this.spacingRight=this.spacing+parseInt(p||0),this.spacingBottom=this.spacing+parseInt(m||0),this.spacingLeft=this.spacing+parseInt(d||0),this.horizontal=x??!0,this.background=f,this.border=g,this.wrap=c??!1,this.clipped=v??!1,this.overflow=y??"visible",this.labelPadding=T??0,this.textDirection=C,this.rotation=0,this.updateMargin()}mxUtils.extend(mxText,mxShape),mxText.prototype.baseSpacingTop=0,mxText.prototype.baseSpacingBottom=0,mxText.prototype.baseSpacingLeft=0,mxText.prototype.baseSpacingRight=0,mxText.prototype.replaceLinefeeds=!0,mxText.prototype.verticalTextRotation=-90,mxText.prototype.ignoreClippedStringSize=!0,mxText.prototype.ignoreStringSize=!1,mxText.prototype.textWidthPadding=document.documentMode==8&&!mxClient.IS_EM?4:3,mxText.prototype.lastValue=null,mxText.prototype.cacheEnabled=!0,mxText.prototype.isParseVml=function(){return!1},mxText.prototype.isHtmlAllowed=function(){return document.documentMode!=8||mxClient.IS_EM},mxText.prototype.getSvgScreenOffset=function(){return 0},mxText.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&this.scale>0&&this.bounds!=null&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)},mxText.prototype.paint=function(t,e){var i=this.scale,n=this.bounds.x/i,r=this.bounds.y/i,s=this.bounds.width/i,l=this.bounds.height/i;if(this.updateTransform(t,n,r,s,l),this.configureCanvas(t,n,r,s,l),e)t.updateText(n,r,s,l,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.getTextRotation(),this.node);else{var a=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML,o=a||t instanceof mxVmlCanvas2D?"html":"",u=this.value;!a&&o=="html"&&(u=mxUtils.htmlEntities(u,!1)),o=="html"&&!mxUtils.isNode(this.value)&&(u=mxUtils.replaceTrailingNewlines(u,"

")),u=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&o=="html"?u.replace(/\n/g,"
"):u;var p=this.textDirection;p==mxConstants.TEXT_DIRECTION_AUTO&&!a&&(p=this.getAutoDirection()),p!=mxConstants.TEXT_DIRECTION_LTR&&p!=mxConstants.TEXT_DIRECTION_RTL&&(p=null),t.text(n,r,s,l,u,this.align,this.valign,this.wrap,o,this.overflow,this.clipped,this.getTextRotation(),p)}},mxText.prototype.redraw=function(){if(this.visible&&this.checkBounds()&&this.cacheEnabled&&this.lastValue==this.value&&(mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML))if(this.node.nodeName=="DIV"&&(this.isHtmlAllowed()||!mxClient.IS_VML))mxClient.IS_SVG?this.redrawHtmlShapeWithCss3():(this.updateSize(this.node,this.state==null||this.state.view.textDiv==null),mxClient.IS_IE&&(document.documentMode==null||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()),this.updateBoundingBox();else{var t=this.createCanvas();t!=null&&t.updateText!=null?(t.pointerEvents=this.pointerEvents,this.paint(t,!0),this.destroyCanvas(t),this.updateBoundingBox()):mxShape.prototype.redraw.apply(this,arguments)}else mxShape.prototype.redraw.apply(this,arguments),mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML?this.lastValue=this.value:this.lastValue=null},mxText.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments),this.color="black",this.align=mxConstants.ALIGN_CENTER,this.valign=mxConstants.ALIGN_MIDDLE,this.family=mxConstants.DEFAULT_FONTFAMILY,this.size=mxConstants.DEFAULT_FONTSIZE,this.fontStyle=mxConstants.DEFAULT_FONTSTYLE,this.spacing=2,this.spacingTop=2,this.spacingRight=2,this.spacingBottom=2,this.spacingLeft=2,this.horizontal=!0,delete this.background,delete this.border,this.textDirection=mxConstants.DEFAULT_TEXT_DIRECTION,delete this.margin},mxText.prototype.apply=function(t){var e=this.spacing;mxShape.prototype.apply.apply(this,arguments),this.style!=null&&(this.fontStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,this.fontStyle),this.family=mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,this.family),this.size=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,this.size),this.color=mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,this.color),this.align=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,this.align),this.valign=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,this.valign),this.spacing=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing)),this.spacingTop=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,this.spacingTop-e))+this.spacing,this.spacingRight=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,this.spacingRight-e))+this.spacing,this.spacingBottom=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,this.spacingBottom-e))+this.spacing,this.spacingLeft=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_LEFT,this.spacingLeft-e))+this.spacing,this.horizontal=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,this.horizontal),this.background=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,this.background),this.border=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,this.border),this.textDirection=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_OPACITY,100),this.updateMargin()),this.flipV=null,this.flipH=null},mxText.prototype.getAutoDirection=function(){var t=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(this.value);return t!=null&&t.length>0&&t[0]>"z"?mxConstants.TEXT_DIRECTION_RTL:mxConstants.TEXT_DIRECTION_LTR},mxText.prototype.getContentNode=function(){var t=this.node;return t!=null&&(t.ownerSVGElement==null?t=this.node.firstChild.firstChild:t=t.firstChild.firstChild.firstChild.firstChild.firstChild),t},mxText.prototype.updateBoundingBox=function(){var t=this.node;this.boundingBox=this.bounds.clone();var e=this.getTextRotation(),i=this.style!=null?mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER):null,n=this.style!=null?mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE):null;if(!this.ignoreStringSize&&t!=null&&this.overflow!="fill"&&(!this.clipped||!this.ignoreClippedStringSize||i!=mxConstants.ALIGN_CENTER||n!=mxConstants.ALIGN_MIDDLE)){var r=null,s=null;if(t.ownerSVGElement!=null)if(t.firstChild!=null&&t.firstChild.firstChild!=null&&t.firstChild.firstChild.nodeName=="foreignObject")t=t.firstChild.firstChild.firstChild.firstChild,s=t.offsetHeight*this.scale,this.overflow=="width"?r=this.boundingBox.width:r=t.offsetWidth*this.scale;else try{var l=t.getBBox();typeof this.value=="string"&&mxUtils.trim(this.value)==0?this.boundingBox=null:l.width==0&&l.height==0?this.boundingBox=null:this.boundingBox=new mxRectangle(l.x,l.y,l.width,l.height);return}catch{}else{var a=this.state!=null?this.state.view.textDiv:null;if(this.offsetWidth!=null&&this.offsetHeight!=null)r=this.offsetWidth*this.scale,s=this.offsetHeight*this.scale;else{a!=null&&(this.updateFont(a),this.updateSize(a,!1),this.updateInnerHtml(a),t=a);var o=t;if(document.documentMode==8&&!mxClient.IS_EM){var u=Math.round(this.bounds.width/this.scale);if(this.wrap&&u>0){if(t.style.wordWrap=mxConstants.WORD_WRAP,t.style.whiteSpace="normal",t.style.wordWrap!="break-word"){var p=o.getElementsByTagName("div");p.length>0&&(o=p[p.length-1]),r=o.offsetWidth+2,p=this.node.getElementsByTagName("div"),this.clipped&&(r=Math.min(u,r)),p.length>1&&(p[p.length-2].style.width=r+"px")}}else t.style.whiteSpace="nowrap"}else o.firstChild!=null&&o.firstChild.nodeName=="DIV"&&(o=o.firstChild);this.offsetWidth=o.offsetWidth+this.textWidthPadding,this.offsetHeight=o.offsetHeight,r=this.offsetWidth*this.scale,s=this.offsetHeight*this.scale}}r!=null&&s!=null&&(this.boundingBox=new mxRectangle(this.bounds.x,this.bounds.y,r,s))}if(this.boundingBox!=null)if(e!=0){var m=mxUtils.getBoundingBox(new mxRectangle(this.margin.x*this.boundingBox.width,this.margin.y*this.boundingBox.height,this.boundingBox.width,this.boundingBox.height),e,new mxPoint(0,0));this.unrotatedBoundingBox=mxRectangle.fromRectangle(this.boundingBox),this.unrotatedBoundingBox.x+=this.margin.x*this.unrotatedBoundingBox.width,this.unrotatedBoundingBox.y+=this.margin.y*this.unrotatedBoundingBox.height,this.boundingBox.x+=m.x,this.boundingBox.y+=m.y,this.boundingBox.width=m.width,this.boundingBox.height=m.height}else this.boundingBox.x+=this.margin.x*this.boundingBox.width,this.boundingBox.y+=this.margin.y*this.boundingBox.height,this.unrotatedBoundingBox=null},mxText.prototype.getShapeRotation=function(){return 0},mxText.prototype.getTextRotation=function(){return this.state!=null&&this.state.shape!=null?this.state.shape.getTextRotation():0},mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&this.state!=null&&this.state.view.graph.model.isVertex(this.state.cell)},mxText.prototype.configureCanvas=function(t,e,i,n,r){mxShape.prototype.configureCanvas.apply(this,arguments),t.setFontColor(this.color),t.setFontBackgroundColor(this.background),t.setFontBorderColor(this.border),t.setFontFamily(this.family),t.setFontSize(this.size),t.setFontStyle(this.fontStyle)},mxText.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width="1px",this.node.style.height="1px",this.node.style.overflow="visible"},mxText.prototype.getHtmlValue=function(){var t=this.value;return this.dialect!=mxConstants.DIALECT_STRICTHTML&&(t=mxUtils.htmlEntities(t,!1)),t=mxUtils.replaceTrailingNewlines(t,"

"),t=this.replaceLinefeeds?t.replace(/\n/g,"
"):t,t},mxText.prototype.getTextCss=function(){var t=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,e="display: inline-block; font-size: "+this.size+"px; font-family: "+this.family+"; color: "+this.color+"; line-height: "+t+"; pointer-events: "+(this.pointerEvents?"all":"none")+"; ";(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(e+="font-weight: bold; "),(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(e+="font-style: italic; ");var i=[];return(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&(e+="text-decoration: "+i.join(" ")+"; "),e},mxText.prototype.redrawHtmlShape=function(){if(mxClient.IS_SVG)this.redrawHtmlShapeWithCss3();else{var t=this.node.style;t.whiteSpace="normal",t.overflow="",t.width="",t.height="",this.updateValue(),this.updateFont(this.node),this.updateSize(this.node,this.state==null||this.state.view.textDiv==null),this.offsetWidth=null,this.offsetHeight=null,mxClient.IS_IE&&(document.documentMode==null||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()}},mxText.prototype.redrawHtmlShapeWithCss3=function(){var t=Math.max(0,Math.round(this.bounds.width/this.scale)),e=Math.max(0,Math.round(this.bounds.height/this.scale)),i="position: absolute; left: "+Math.round(this.bounds.x)+"px; top: "+Math.round(this.bounds.y)+"px; pointer-events: none; ",n=this.getTextCss();mxSvgCanvas2D.createCss(t+2,e,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.background!=null?mxUtils.htmlEntities(this.background):null,this.border!=null?mxUtils.htmlEntities(this.border):null,i,n,this.scale,mxUtils.bind(this,function(r,s,l,a,o,u){var p=this.getTextRotation(),m=(this.scale!=1?"scale("+this.scale+") ":"")+(p!=0?"rotate("+p+"deg) ":"")+(this.margin.x!=0||this.margin.y!=0?"translate("+this.margin.x*100+"%,"+this.margin.y*100+"%)":"");m!=""&&(m="transform-origin: 0 0; transform: "+m+"; "),u==""?(l+=a,a="display:inline-block; min-width: 100%; "+m):(a+=m,mxClient.IS_SF&&(a+="-webkit-clip-path: content-box;")),this.opacity<100&&(o+="opacity: "+this.opacity/100+"; "),this.node.setAttribute("style",l);var d=mxUtils.isNode(this.value)?this.value.outerHTML:this.getHtmlValue();this.node.firstChild==null&&(this.node.innerHTML="
"+d+"
"),this.node.firstChild.firstChild.setAttribute("style",o),this.node.firstChild.setAttribute("style",a)}))},mxText.prototype.updateHtmlTransform=function(){var t=this.getTextRotation(),e=this.node.style,i=this.margin.x,n=this.margin.y;t!=0?(mxUtils.setPrefixedStyle(e,"transformOrigin",-i*100+"% "+-n*100+"%"),mxUtils.setPrefixedStyle(e,"transform","translate("+i*100+"%,"+n*100+"%) scale("+this.scale+") rotate("+t+"deg)")):(mxUtils.setPrefixedStyle(e,"transformOrigin","0% 0%"),mxUtils.setPrefixedStyle(e,"transform","scale("+this.scale+") translate("+i*100+"%,"+n*100+"%)")),e.left=Math.round(this.bounds.x-Math.ceil(i*(this.overflow!="fill"&&this.overflow!="width"?3:1)))+"px",e.top=Math.round(this.bounds.y-n*(this.overflow!="fill"?3:1))+"px",this.opacity<100?e.opacity=this.opacity/100:e.opacity=""},mxText.prototype.updateInnerHtml=function(t){if(mxUtils.isNode(this.value))t.innerHTML=this.value.outerHTML;else{var e=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(e=mxUtils.htmlEntities(e,!1)),e=mxUtils.replaceTrailingNewlines(e,"
 
"),e=this.replaceLinefeeds?e.replace(/\n/g,"
"):e,e='
'+e+"
",t.innerHTML=e}},mxText.prototype.updateHtmlFilter=function(){var t=this.node.style,e=this.margin.x,T=this.margin.y,i=this.scale;mxUtils.setOpacity(this.node,this.opacity);var n=0,r=0,s=this.state!=null?this.state.view.textDiv:null,l=this.node;if(s!=null){s.style.overflow="",s.style.height="",s.style.width="",this.updateFont(s),this.updateSize(s,!1),this.updateInnerHtml(s);var a=Math.round(this.bounds.width/this.scale);this.wrap&&a>0?(s.style.whiteSpace="normal",s.style.wordWrap=mxConstants.WORD_WRAP,n=a,this.clipped&&(n=Math.min(n,this.bounds.width)),s.style.width=n+"px"):s.style.whiteSpace="nowrap",l=s,l.firstChild!=null&&l.firstChild.nodeName=="DIV"&&(l=l.firstChild,this.wrap&&s.style.wordWrap=="break-word"&&(l.style.width="100%")),!this.clipped&&this.wrap&&a>0&&(n=l.offsetWidth+this.textWidthPadding,s.style.width=n+"px"),r=l.offsetHeight+2,mxClient.IS_QUIRKS&&this.border!=null&&this.border!=mxConstants.NONE&&(r+=3)}else l.firstChild!=null&&l.firstChild.nodeName=="DIV"&&(l=l.firstChild,r=l.offsetHeight);n=l.offsetWidth+this.textWidthPadding,this.clipped&&(r=Math.min(r,this.bounds.height));var a=this.bounds.width/i,o=this.bounds.height/i;this.overflow=="fill"?(r=o,n=a):this.overflow=="width"&&(r=l.scrollHeight,n=a),this.offsetWidth=n,this.offsetHeight=r,mxClient.IS_QUIRKS&&(this.clipped||this.overflow=="width"&&o>0)?(o=Math.min(o,r),t.height=Math.round(o)+"px"):o=r,this.overflow!="fill"&&this.overflow!="width"&&(this.clipped&&(n=Math.min(a,n)),a=n,(mxClient.IS_QUIRKS&&this.clipped||this.wrap)&&(t.width=Math.round(a)+"px")),o*=i,a*=i;var u=this.getTextRotation()*(Math.PI/180),p=parseFloat(parseFloat(Math.cos(u)).toFixed(8)),m=parseFloat(parseFloat(Math.sin(-u)).toFixed(8));u%=2*Math.PI,u<0&&(u+=2*Math.PI),u%=Math.PI,u>Math.PI/2&&(u=Math.PI-u);var d=Math.cos(u),x=Math.sin(-u),f=a*-(e+.5),g=o*-(T+.5),c=(o-o*d+a*x)/2+m*f-p*g,v=(a-a*d+o*x)/2-p*f-m*g;if(u!=0){var y="progid:DXImageTransform.Microsoft.Matrix(M11="+p+", M12="+m+", M21="+-m+", M22="+p+", sizingMethod='auto expand')";t.filter!=null&&t.filter.length>0?t.filter+=" "+y:t.filter=y}var T=0;this.overflow!="fill"&&mxClient.IS_QUIRKS&&(this.valign==mxConstants.ALIGN_TOP?T-=1:this.valign==mxConstants.ALIGN_BOTTOM?T+=2:T+=1),t.zoom=i,t.left=Math.round(this.bounds.x+v-a/2)+"px",t.top=Math.round(this.bounds.y+c-o/2+T)+"px"},mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var t=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(t=mxUtils.htmlEntities(t,!1)),t=mxUtils.replaceTrailingNewlines(t,"

"),t=this.replaceLinefeeds?t.replace(/\n/g,"
"):t;var e=this.background!=null&&this.background!=mxConstants.NONE?this.background:null,i=this.border!=null&&this.border!=mxConstants.NONE?this.border:null;if(this.overflow=="fill"||this.overflow=="width")e!=null&&(this.node.style.backgroundColor=e),i!=null&&(this.node.style.border="1px solid "+i);else{var n="";e!=null&&(n+="background-color:"+mxUtils.htmlEntities(e)+";"),i!=null&&(n+="border:1px solid "+mxUtils.htmlEntities(i)+";");var r=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT;t='
'+t+"
"}this.node.innerHTML=t;var s=this.node.getElementsByTagName("div");if(s.length>0){var l=this.textDirection;l==mxConstants.TEXT_DIRECTION_AUTO&&this.dialect!=mxConstants.DIALECT_STRICTHTML&&(l=this.getAutoDirection()),l==mxConstants.TEXT_DIRECTION_LTR||l==mxConstants.TEXT_DIRECTION_RTL?s[s.length-1].setAttribute("dir",l):s[s.length-1].removeAttribute("dir")}}},mxText.prototype.updateFont=function(t){var e=t.style;e.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,e.fontSize=this.size+"px",e.fontFamily=this.family,e.verticalAlign="top",e.color=this.color,(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?e.fontWeight="bold":e.fontWeight="",(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?e.fontStyle="italic":e.fontStyle="";var i=[];(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),e.textDecoration=i.join(" "),this.align==mxConstants.ALIGN_CENTER?e.textAlign="center":this.align==mxConstants.ALIGN_RIGHT?e.textAlign="right":e.textAlign="left"},mxText.prototype.updateSize=function(t,e){var i=Math.max(0,Math.round(this.bounds.width/this.scale)),n=Math.max(0,Math.round(this.bounds.height/this.scale)),r=t.style;if(this.clipped?(r.overflow="hidden",mxClient.IS_QUIRKS?r.width=i+"px":(r.maxHeight=n+"px",r.maxWidth=i+"px")):this.overflow=="fill"?(r.width=i+1+"px",r.height=n+1+"px",r.overflow="hidden"):this.overflow=="width"&&(r.width=i+1+"px",r.maxHeight=n+1+"px",r.overflow="hidden"),this.wrap&&i>0){if(r.wordWrap=mxConstants.WORD_WRAP,r.whiteSpace="normal",r.width=i+"px",e&&this.overflow!="fill"&&this.overflow!="width"){var s=t;s.firstChild!=null&&s.firstChild.nodeName=="DIV"&&(s=s.firstChild,t.style.wordWrap=="break-word"&&(s.style.width="100%"));var l=s.offsetWidth;if(l==0){var a=t.parentNode;t.style.visibility="hidden",document.body.appendChild(t),l=s.offsetWidth,t.style.visibility="",a.appendChild(t)}l+=3,this.clipped&&(l=Math.min(l,i)),r.width=l+"px"}}else r.whiteSpace="nowrap"},mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)},mxText.prototype.getSpacing=function(){var t=0,e=0;return this.align==mxConstants.ALIGN_CENTER?t=(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?t=-this.spacingRight-this.baseSpacingRight:t=this.spacingLeft+this.baseSpacingLeft,this.valign==mxConstants.ALIGN_MIDDLE?e=(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?e=-this.spacingBottom-this.baseSpacingBottom:e=this.spacingTop+this.baseSpacingTop,new mxPoint(t,e)},__mxOutput.mxText=typeof mxText<"u"?mxText:void 0;function mxTriangle(){mxActor.call(this)}mxUtils.extend(mxTriangle,mxActor),mxTriangle.prototype.isRoundable=function(){return!0},mxTriangle.prototype.redrawPath=function(t,e,i,n,r){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,0),new mxPoint(n,.5*r),new mxPoint(0,r)],this.isRounded,s,!0)},__mxOutput.mxTriangle=typeof mxTriangle<"u"?mxTriangle:void 0;function mxHexagon(){mxActor.call(this)}mxUtils.extend(mxHexagon,mxActor),mxHexagon.prototype.redrawPath=function(t,e,i,n,r){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(.25*n,0),new mxPoint(.75*n,0),new mxPoint(n,.5*r),new mxPoint(.75*n,r),new mxPoint(.25*n,r),new mxPoint(0,.5*r)],this.isRounded,s,!0)},__mxOutput.mxHexagon=typeof mxHexagon<"u"?mxHexagon:void 0;function mxLine(t,e,i,n){mxShape.call(this),this.bounds=t,this.stroke=e,this.strokewidth=i??1,this.vertical=n??this.vertical}mxUtils.extend(mxLine,mxShape),mxLine.prototype.vertical=!1,mxLine.prototype.paintVertexShape=function(t,e,i,n,r){if(t.begin(),this.vertical){var s=e+n/2;t.moveTo(s,i),t.lineTo(s,i+r)}else{var s=i+r/2;t.moveTo(e,s),t.lineTo(e+n,s)}t.stroke()},__mxOutput.mxLine=typeof mxLine<"u"?mxLine:void 0;function mxImageShape(t,e,i,n,r){mxShape.call(this),this.bounds=t,this.image=e,this.fill=i,this.stroke=n,this.strokewidth=r??1,this.shadow=!1}mxUtils.extend(mxImageShape,mxRectangleShape),mxImageShape.prototype.preserveImageAspect=!0,mxImageShape.prototype.getSvgScreenOffset=function(){return 0},mxImageShape.prototype.apply=function(t){mxShape.prototype.apply.apply(this,arguments),this.fill=null,this.stroke=null,this.gradient=null,this.style!=null&&(this.preserveImageAspect=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1)==1,this.flipH=this.flipH||mxUtils.getValue(this.style,"imageFlipH",0)==1,this.flipV=this.flipV||mxUtils.getValue(this.style,"imageFlipV",0)==1)},mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect},mxImageShape.prototype.createHtml=function(){var t=document.createElement("div");return t.style.position="absolute",t},mxImageShape.prototype.isRoundable=function(t,e,i,n,r){return!1},mxImageShape.prototype.paintVertexShape=function(t,e,i,n,r){if(this.image!=null){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),l=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);s!=null&&(t.setFillColor(s),t.setStrokeColor(l),t.rect(e,i,n,r),t.fillAndStroke()),t.image(e,i,n,r,this.image,this.preserveImageAspect,!1,!1);var l=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);l!=null&&(t.setShadow(!1),t.setStrokeColor(l),t.rect(e,i,n,r),t.stroke())}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)},mxImageShape.prototype.redrawHtmlShape=function(){if(this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px",this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px",this.node.innerHTML="",this.image!=null){var t=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,""),e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,"");this.node.style.backgroundColor=t,this.node.style.borderColor=e;var i=mxClient.IS_IE6||(document.documentMode==null||document.documentMode<=8)&&this.rotation!=0,n=document.createElement(i?mxClient.VML_PREFIX+":image":"img");n.setAttribute("border","0"),n.style.position="absolute",n.src=this.image;var r=this.opacity<100?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=r,this.flipH&&this.flipV?r+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?r+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(r+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"),n.style.filter!=r&&(n.style.filter=r),n.nodeName=="image"?n.style.rotation=this.rotation:this.rotation!=0?mxUtils.setPrefixedStyle(n.style,"transform","rotate("+this.rotation+"deg)"):mxUtils.setPrefixedStyle(n.style,"transform",""),n.style.width=this.node.style.width,n.style.height=this.node.style.height,this.node.style.backgroundImage="",this.node.appendChild(n)}else this.setTransparentBackgroundImage(this.node)},__mxOutput.mxImageShape=typeof mxImageShape<"u"?mxImageShape:void 0;function mxLabel(t,e,i,n){mxRectangleShape.call(this,t,e,i,n)}mxUtils.extend(mxLabel,mxRectangleShape),mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE,mxLabel.prototype.spacing=2,mxLabel.prototype.indicatorSize=10,mxLabel.prototype.indicatorSpacing=2,mxLabel.prototype.init=function(t){mxShape.prototype.init.apply(this,arguments),this.indicatorShape!=null&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.init(this.node))},mxLabel.prototype.redraw=function(){this.indicator!=null&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorStrokeColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection,this.indicator.redraw()),mxShape.prototype.redraw.apply(this,arguments)},mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&this.indicatorColor==null&&this.indicatorShape==null},mxLabel.prototype.paintForeground=function(t,e,i,n,r){this.paintImage(t,e,i,n,r),this.paintIndicator(t,e,i,n,r),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxLabel.prototype.paintImage=function(t,e,i,n,r){if(this.image!=null){var s=this.getImageBounds(e,i,n,r);t.image(s.x,s.y,s.width,s.height,this.image,!1,!1,!1)}},mxLabel.prototype.getImageBounds=function(t,e,i,n){var r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),a=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;return r==mxConstants.ALIGN_CENTER?t+=(i-l)/2:r==mxConstants.ALIGN_RIGHT?t+=i-l-o:t+=o,s==mxConstants.ALIGN_TOP?e+=o:s==mxConstants.ALIGN_BOTTOM?e+=n-a-o:e+=(n-a)/2,new mxRectangle(t,e,l,a)},mxLabel.prototype.paintIndicator=function(t,e,i,n,r){if(this.indicator!=null)this.indicator.bounds=this.getIndicatorBounds(e,i,n,r),this.indicator.paint(t);else if(this.indicatorImage!=null){var s=this.getIndicatorBounds(e,i,n,r);t.image(s.x,s.y,s.width,s.height,this.indicatorImage,!1,!1,!1)}},mxLabel.prototype.getIndicatorBounds=function(t,e,i,n){var r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),a=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),o=this.spacing+5;return r==mxConstants.ALIGN_RIGHT?t+=i-l-o:r==mxConstants.ALIGN_CENTER?t+=(i-l)/2:t+=o,s==mxConstants.ALIGN_BOTTOM?e+=n-a-o:s==mxConstants.ALIGN_TOP?e+=o:e+=(n-a)/2,new mxRectangle(t,e,l,a)},mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(this.image!=null){var t=document.createElement("img");t.style.position="relative",t.setAttribute("border","0");var e=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);e.x-=this.bounds.x,e.y-=this.bounds.y,t.style.left=Math.round(e.x)+"px",t.style.top=Math.round(e.y)+"px",t.style.width=Math.round(e.width)+"px",t.style.height=Math.round(e.height)+"px",t.src=this.image,this.node.appendChild(t)}},__mxOutput.mxLabel=typeof mxLabel<"u"?mxLabel:void 0;function mxCylinder(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxCylinder,mxShape),mxCylinder.prototype.maxHeight=40,mxCylinder.prototype.svgStrokeTolerance=0,mxCylinder.prototype.paintVertexShape=function(t,e,i,n,r){t.translate(e,i),t.begin(),this.redrawPath(t,e,i,n,r,!1),t.fillAndStroke(),(!this.outline||this.style==null||mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)==0)&&(t.setShadow(!1),t.begin(),this.redrawPath(t,e,i,n,r,!0),t.stroke())},mxCylinder.prototype.getCylinderSize=function(t,e,i,n){return Math.min(this.maxHeight,Math.round(n/5))},mxCylinder.prototype.redrawPath=function(t,e,i,n,r,s){var l=this.getCylinderSize(e,i,n,r);(s&&this.fill!=null||!s&&this.fill==null)&&(t.moveTo(0,l),t.curveTo(0,2*l,n,2*l,n,l),s||(t.stroke(),t.begin())),s||(t.moveTo(0,l),t.curveTo(0,-l/3,n,-l/3,n,l),t.lineTo(n,r-l),t.curveTo(n,r+l/3,0,r+l/3,0,r-l),t.close())},__mxOutput.mxCylinder=typeof mxCylinder<"u"?mxCylinder:void 0;function mxConnector(t,e,i){mxPolyline.call(this,t,e,i)}mxUtils.extend(mxConnector,mxPolyline),mxConnector.prototype.updateBoundingBox=function(){this.useSvgBoundingBox=this.style!=null&&this.style[mxConstants.STYLE_CURVED]==1,mxShape.prototype.updateBoundingBox.apply(this,arguments)},mxConnector.prototype.paintEdgeShape=function(t,e){var i=this.createMarker(t,e,!0),n=this.createMarker(t,e,!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments),t.setFillColor(this.stroke),t.setShadow(!1),t.setDashed(!1),i!=null&&i(),n!=null&&n()},mxConnector.prototype.createMarker=function(t,e,i){var n=null,r=e.length,s=mxUtils.getValue(this.style,i?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW),l=i?e[1]:e[r-2],a=i?e[0]:e[r-1];if(s!=null&&l!=null&&a!=null){for(var o=1;o0)for(var a=0;at.weightedValue?-1:e.weightedValueu)break;a=x}}}var f=r.getIndex(t);f=Math.max(0,l-(l>f?1:0)),n.add(r,t,f)}},mxStackLayout.prototype.getParentSize=function(t){var e=this.graph.getModel(),i=e.getGeometry(t);if(this.graph.container!=null&&(i==null&&e.isLayer(t)||t==this.graph.getView().currentRoot)){var n=this.graph.container.offsetWidth-1,r=this.graph.container.offsetHeight-1;i=new mxRectangle(0,0,n,r)}return i},mxStackLayout.prototype.getLayoutCells=function(t){for(var e=this.graph.getModel(),i=e.getChildCount(t),n=[],r=0;ru.x>0?1:-1:o.y==u.y?0:o.y>u.y>0?1:-1})),n},mxStackLayout.prototype.snap=function(t){if(this.gridSize!=null&&this.gridSize>0&&(t=Math.max(t,this.gridSize),t/this.gridSize>1)){var e=t%this.gridSize;t+=e>this.gridSize/2?this.gridSize-e:-e}return t},mxStackLayout.prototype.execute=function(t){if(t!=null){var e=this.getParentSize(t),i=this.isHorizontal(),n=this.graph.getModel(),r=null;e!=null&&(r=i?e.height-this.marginTop-this.marginBottom:e.width-this.marginLeft-this.marginRight),r-=2*this.border;var s=this.x0+this.border+this.marginLeft,l=this.y0+this.border+this.marginTop;if(this.graph.isSwimlane(t)){var a=this.graph.getCellStyle(t),o=mxUtils.getNumber(a,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE),u=mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,!0)==1;e!=null&&(u?o=Math.min(o,e.height):o=Math.min(o,e.width)),i==u&&(r-=o),u?l+=o:s+=o}n.beginUpdate();try{for(var p=0,m=null,d=0,x=null,f=this.getLayoutCells(t),g=0;gthis.wrap||!i&&m.y+m.height+v.height+2*this.spacing>this.wrap)&&(m=null,i?l+=p+this.spacing:s+=p+this.spacing,p=0),p=Math.max(p,i?v.height:v.width);var y=0;if(!this.borderCollapse){var T=this.graph.getCellStyle(c);y=mxUtils.getNumber(T,mxConstants.STYLE_STROKEWIDTH,1)}if(m!=null){var C=d+this.spacing+Math.floor(y/2);i?v.x=this.snap((this.allowGaps?Math.max(C,v.x):C)-this.marginLeft)+this.marginLeft:v.y=this.snap((this.allowGaps?Math.max(C,v.y):C)-this.marginTop)+this.marginTop}else this.keepFirstLocation||(i?v.x=this.allowGaps&&v.x>s?Math.max(this.snap(v.x-this.marginLeft)+this.marginLeft,s):s:v.y=this.allowGaps&&v.y>l?Math.max(this.snap(v.y-this.marginTop)+this.marginTop,l):l);i?v.y=l:v.x=s,this.fill&&r!=null&&(i?v.height=r:v.width=r),i?v.width=this.snap(v.width):v.height=this.snap(v.height),this.setChildGeometry(c,v),x=c,m=v,i?d=m.x+m.width+Math.floor(y/2):d=m.y+m.height+Math.floor(y/2)}}this.resizeParent&&e!=null&&m!=null&&!this.graph.isCellCollapsed(t)?this.updateParentGeometry(t,e,m):this.resizeLast&&e!=null&&m!=null&&x!=null&&(i?m.width=e.width-m.x-this.spacing-this.marginRight-this.marginLeft:m.height=e.height-m.y-this.spacing-this.marginBottom,this.setChildGeometry(x,m))}finally{n.endUpdate()}}},mxStackLayout.prototype.setChildGeometry=function(t,e){var i=this.graph.getCellGeometry(t);(i==null||e.x!=i.x||e.y!=i.y||e.width!=i.width||e.height!=i.height)&&this.graph.getModel().setGeometry(t,e)},mxStackLayout.prototype.updateParentGeometry=function(t,e,i){var n=this.isHorizontal(),r=this.graph.getModel(),s=e.clone();if(n){var l=i.x+i.width+this.marginRight+this.border;this.resizeParentMax?s.width=Math.max(s.width,l):s.width=l}else{var l=i.y+i.height+this.marginBottom+this.border;this.resizeParentMax?s.height=Math.max(s.height,l):s.height=l}(e.x!=s.x||e.y!=s.y||e.width!=s.width||e.height!=s.height)&&r.setGeometry(t,s)},__mxOutput.mxStackLayout=typeof mxStackLayout<"u"?mxStackLayout:void 0;function mxPartitionLayout(t,e,i,n){mxGraphLayout.call(this,t),this.horizontal=e??!0,this.spacing=i||0,this.border=n||0}mxPartitionLayout.prototype=new mxGraphLayout,mxPartitionLayout.prototype.constructor=mxPartitionLayout,mxPartitionLayout.prototype.horizontal=null,mxPartitionLayout.prototype.spacing=null,mxPartitionLayout.prototype.border=null,mxPartitionLayout.prototype.resizeVertices=!0,mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal},mxPartitionLayout.prototype.moveCell=function(t,e,i){var n=this.graph.getModel(),r=n.getParent(t);if(t!=null&&r!=null){var s=0,l=0,a=n.getChildCount(r);for(s=0;se)break;l=p}}var m=r.getIndex(t);m=Math.max(0,s-(s>m?1:0)),n.add(r,t,m)}},mxPartitionLayout.prototype.execute=function(t){var e=this.isHorizontal(),i=this.graph.getModel(),n=i.getGeometry(t);if(this.graph.container!=null&&(n==null&&i.isLayer(t)||t==this.graph.getView().currentRoot)){var r=this.graph.container.offsetWidth-1,s=this.graph.container.offsetHeight-1;n=new mxRectangle(0,0,r,s)}if(n!=null){for(var l=[],a=i.getChildCount(t),o=0;o0){var m=this.border,d=this.border,x=e?n.height:n.width;x-=2*this.border;var f=this.graph.isSwimlane(t)?this.graph.getStartSize(t):new mxRectangle;x-=e?f.height:f.width,m=m+f.width,d=d+f.height;var g=this.border+(p-1)*this.spacing,c=e?(n.width-m-g)/p:(n.height-d-g)/p;if(c>0){i.beginUpdate();try{for(var o=0;o0)this.root=t;else{var n=this.graph.findTreeRoots(t,!0,this.invert);if(n.length>0){for(var r=0;r0){this.root=n[r];break}}}else this.root=e;if(this.root!=null){if(this.resizeParent?this.parentsChanged=new Object:this.parentsChanged=null,this.parentX=null,this.parentY=null,t!=this.root&&i.isVertex(t)!=null&&this.maintainParentLocation){var s=this.graph.getCellGeometry(t);s!=null&&(this.parentX=s.x,this.parentY=s.y)}i.beginUpdate();try{if(this.visited=new Object,this.node=this.dfs(this.root,t),this.alignRanks&&(this.maxRankHeight=[],this.findRankHeights(this.node,0),this.setCellHeights(this.node,0)),this.node!=null){this.layout(this.node);var l=this.graph.gridSize,a=l;if(!this.moveTree){var o=this.getVertexBounds(this.root);o!=null&&(l=o.x,a=o.y)}var u=null;if(this.isHorizontal()?u=this.horizontalLayout(this.node,l,a):u=this.verticalLayout(this.node,null,l,a),u!=null){var p=0,m=0;u.x<0&&(p=Math.abs(l-u.x)),u.y<0&&(m=Math.abs(a-u.y)),(p!=0||m!=0)&&this.moveNode(this.node,p,m),this.resizeParent&&this.adjustParents(),this.edgeRouting&&this.localEdgeProcessing(this.node)}if(this.parentX!=null&&this.parentY!=null){var s=this.graph.getCellGeometry(t);s!=null&&(s=s.clone(),s.x=this.parentX,s.y=this.parentY,i.setGeometry(t,s))}}}finally{i.endUpdate()}}},mxCompactTreeLayout.prototype.moveNode=function(t,e,i){t.x+=e,t.y+=i,this.apply(t);for(var n=t.child;n!=null;)this.moveNode(n,e,i),n=n.next},mxCompactTreeLayout.prototype.sortOutgoingEdges=function(t,e){var i=new mxDictionary;e.sort(function(n,r){var s=n.getTerminal(n.getTerminal(!1)==t),l=i.get(s);l==null&&(l=mxCellPath.create(s).split(mxCellPath.PATH_SEPARATOR),i.put(s,l));var a=r.getTerminal(r.getTerminal(!1)==t),o=i.get(a);return o==null&&(o=mxCellPath.create(a).split(mxCellPath.PATH_SEPARATOR),i.put(a,o)),mxCellPath.compare(l,o)})},mxCompactTreeLayout.prototype.findRankHeights=function(t,e){(this.maxRankHeight[e]==null||this.maxRankHeight[e]t.height&&(t.height=this.maxRankHeight[e]);for(var i=t.child;i!=null;)this.setCellHeights(i,e+1),i=i.next},mxCompactTreeLayout.prototype.dfs=function(t,e){var i=mxCellPath.create(t),n=null;if(t!=null&&this.visited[i]==null&&!this.isVertexIgnored(t)){this.visited[i]=t,n=this.createNode(t);var r=this.graph.getModel(),s=null,l=this.graph.getEdges(t,e,this.invert,!this.invert,!1,!0),a=this.graph.getView();this.sortEdges&&this.sortOutgoingEdges(t,l);for(var o=0;o0)if(t<0){var o=t*n;l=o/i-e}else if(t>0){var o=t*s;l=o/r-e}else l=-e;else if(rt+i){var o=(i+t)*s;l=o/r-(e+n)}else l=s-(e+n);return l>0?l:0},mxCompactTreeLayout.prototype.bridge=function(t,e,i,n,r,s){var l=r+n.dx-e,a=0,o=0;n.dx==0?a=n.dy:(o=l*n.dy,a=o/n.dx);var u=this.createLine(l,a,n.next);return t.next=this.createLine(0,s+n.dy-a-i,u),u},mxCompactTreeLayout.prototype.createNode=function(t){var e=new Object;e.cell=t,e.x=0,e.y=0,e.width=0,e.height=0;var i=this.getVertexBounds(t);return i!=null&&(this.isHorizontal()?(e.width=i.height,e.height=i.width):(e.width=i.width,e.height=i.height)),e.offsetX=0,e.offsetY=0,e.contour=new Object,e},mxCompactTreeLayout.prototype.apply=function(t,e){var i=this.graph.getModel(),n=t.cell,r=i.getGeometry(n);if(n!=null&&r!=null){if(this.isVertexMovable(n)&&(r=this.setVertexLocation(n,t.x,t.y),this.resizeParent)){var s=i.getParent(n),l=mxCellPath.create(s);this.parentsChanged[l]==null&&(this.parentsChanged[l]=s)}e==null?e=new mxRectangle(r.x,r.y,r.width,r.height):e=new mxRectangle(Math.min(e.x,r.x),Math.min(e.y,r.y),Math.max(e.x+e.width,r.x+r.width),Math.max(e.y+e.height,r.y+r.height))}return e},mxCompactTreeLayout.prototype.createLine=function(t,e,i){var n=new Object;return n.dx=t,n.dy=e,n.next=i,n},mxCompactTreeLayout.prototype.adjustParents=function(){var t=[];for(var e in this.parentsChanged)t.push(this.parentsChanged[e]);this.arrangeGroups(mxUtils.sortCells(t,!0),this.groupPadding,this.groupPaddingTop,this.groupPaddingRight,this.groupPaddingBottom,this.groupPaddingLeft)},mxCompactTreeLayout.prototype.localEdgeProcessing=function(t){this.processNodeOutgoing(t);for(var e=t.child;e!=null;)this.localEdgeProcessing(e),e=e.next},mxCompactTreeLayout.prototype.processNodeOutgoing=function(t){for(var e=t.child,i=t.cell,n=0,r=[];e!=null;){n++;var s=e.x;this.horizontal&&(s=e.y),r.push(new WeightedCellSorter(e,s)),e=e.next}r.sort(WeightedCellSorter.prototype.compare);var l=t.width,a=(n+1)*this.prefHozEdgeSep;l>a+2*this.prefHozEdgeSep&&(l-=2*this.prefHozEdgeSep);var o=l/n,u=o/2;l>a+2*this.prefHozEdgeSep&&(u+=this.prefHozEdgeSep);var p=this.minEdgeJetty-this.prefVertEdgeOff,m=this.getVertexBounds(i);e=t.child;for(var d=0;dn/2&&(p-=this.prefVertEdgeOff),u+=o}},__mxOutput.mxCompactTreeLayout=typeof mxCompactTreeLayout<"u"?mxCompactTreeLayout:void 0;function mxRadialTreeLayout(t){mxCompactTreeLayout.call(this,t,!1)}mxUtils.extend(mxRadialTreeLayout,mxCompactTreeLayout),mxRadialTreeLayout.prototype.angleOffset=.5,mxRadialTreeLayout.prototype.rootx=0,mxRadialTreeLayout.prototype.rooty=0,mxRadialTreeLayout.prototype.levelDistance=120,mxRadialTreeLayout.prototype.nodeDistance=10,mxRadialTreeLayout.prototype.autoRadius=!1,mxRadialTreeLayout.prototype.sortEdges=!1,mxRadialTreeLayout.prototype.rowMinX=[],mxRadialTreeLayout.prototype.rowMaxX=[],mxRadialTreeLayout.prototype.rowMinCenX=[],mxRadialTreeLayout.prototype.rowMaxCenX=[],mxRadialTreeLayout.prototype.rowRadi=[],mxRadialTreeLayout.prototype.row=[],mxRadialTreeLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||this.graph.getConnections(t).length==0},mxRadialTreeLayout.prototype.execute=function(t,e){this.parent=t,this.useBoundingBox=!1,this.edgeRouting=!1,mxCompactTreeLayout.prototype.execute.apply(this,arguments);var i=null,n=this.getVertexBounds(this.root);this.centerX=n.x+n.width/2,this.centerY=n.y+n.height/2;for(var r in this.visited){var s=this.getVertexBounds(this.visited[r]);i=i??s.clone(),i.add(s)}this.calcRowDims([this.node],0);for(var l=0,a=0,o=0;o=0;o--)for(var g=this.row[o],f=0;f0){var E=S/C;if(E>c.theta&&f0){var A=g[f-1].theta;c.theta=Math.max(E,A+Math.PI/10)}}}for(var o=0;othis.maxDistanceLimit)continue;l1&&this.layout(r)}}finally{this.graph.model.endUpdate()}},mxParallelEdgeLayout.prototype.findParallels=function(t,e){var i=[],n=mxUtils.bind(this,function(a){if(!this.isEdgeIgnored(a)){var o=this.getEdgeId(a);o!=null&&(i[o]==null&&(i[o]=[]),i[o].push(a))}});if(e!=null)for(var r=0;rn?n+"-"+i:i+"-"+n)+r}return null},mxParallelEdgeLayout.prototype.layout=function(t){var e=t[0],i=this.graph.getView(),n=this.graph.getModel(),r=n.getGeometry(i.getVisibleTerminal(e,!0)),s=n.getGeometry(i.getVisibleTerminal(e,!1));if(r==s)for(var l=r.x+r.width+this.spacing,a=r.y+r.height/2,o=0;o0){var l=u+x/2,a=p+f/2,c=f*this.spacing/g,v=x*this.spacing/g;l+=c*(t.length-1)/2,a-=v*(t.length-1)/2;for(var o=0;o0?this.edges[0]:null},__mxOutput.mxGraphHierarchyEdge=typeof mxGraphHierarchyEdge<"u"?mxGraphHierarchyEdge:void 0;function mxGraphHierarchyModel(t,e,i,n,r){t.getGraph(),this.tightenToSource=r,this.roots=i,this.parent=n,this.vertexMapper=new mxDictionary,this.edgeMapper=new mxDictionary,this.maxRank=0;var s=[];e==null&&(e=this.graph.getChildVertices(n)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(t,e,s);for(var l=0;l0){var m=p[0],d=t.getVisibleTerminal(m,!1),x=this.vertexMapper.get(d);s[l]==x&&(d=t.getVisibleTerminal(m,!0),x=this.vertexMapper.get(d)),x!=null&&s[l]!=x&&(u.target=x,x.connectsAsTarget.length==0&&(x.connectsAsTarget=[]),mxUtils.indexOf(x.connectsAsTarget,u)<0&&x.connectsAsTarget.push(u))}}s[l].temp[0]=1}}mxGraphHierarchyModel.prototype.maxRank=null,mxGraphHierarchyModel.prototype.vertexMapper=null,mxGraphHierarchyModel.prototype.edgeMapper=null,mxGraphHierarchyModel.prototype.ranks=null,mxGraphHierarchyModel.prototype.roots=null,mxGraphHierarchyModel.prototype.parent=null,mxGraphHierarchyModel.prototype.dfsCount=0,mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1e8,mxGraphHierarchyModel.prototype.tightenToSource=!1,mxGraphHierarchyModel.prototype.createInternalCells=function(t,e,i){for(var n=t.getGraph(),r=0;r0&&this.edgeMapper.get(o[0])==null&&u.length*2>=o.length){for(var p=new mxGraphHierarchyEdge(o),m=0;m0;){var i=t[0],s,l;s=i.connectsAsTarget,l=i.connectsAsSource;for(var a=!0,o=this.SOURCESCANSTARTRANK,e=0;e1){o.maxRank=l.maxRank,o.minRank=a.maxRank,o.temp=[],o.x=[],o.y=[];for(var d=o.minRank+1;d0){var m=p[0],d=t.getVisibleTerminal(m,!1),x=this.vertexMapper.get(d);s[l]==x&&(d=t.getVisibleTerminal(m,!0),x=this.vertexMapper.get(d)),x!=null&&s[l]!=x&&(u.target=x,x.connectsAsTarget.length==0&&(x.connectsAsTarget=[]),mxUtils.indexOf(x.connectsAsTarget,u)<0&&x.connectsAsTarget.push(u))}}s[l].temp[0]=1}}mxSwimlaneModel.prototype.maxRank=null,mxSwimlaneModel.prototype.vertexMapper=null,mxSwimlaneModel.prototype.edgeMapper=null,mxSwimlaneModel.prototype.ranks=null,mxSwimlaneModel.prototype.roots=null,mxSwimlaneModel.prototype.parent=null,mxSwimlaneModel.prototype.dfsCount=0,mxSwimlaneModel.prototype.SOURCESCANSTARTRANK=1e8,mxSwimlaneModel.prototype.tightenToSource=!1,mxSwimlaneModel.prototype.ranksPerGroup=null,mxSwimlaneModel.prototype.createInternalCells=function(t,e,i){for(var n=t.getGraph(),r=t.swimlanes,s=0;s0&&this.edgeMapper.get(p[0])==null&&m.length*2>=p.length){for(var d=new mxGraphHierarchyEdge(p),x=0;x=0;i--)i==this.ranksPerGroup.length-1?r[i]=0:r[i]=s[i+1]+1,s[i]=r[i]+this.ranksPerGroup[i];this.maxRank=s[0];for(var l=this.vertexMapper.getValues(),i=0;i0;){var n=t[0],a,o;a=n.connectsAsTarget,o=n.connectsAsSource;for(var u=!0,p=s[0],i=0;is[n.swimlaneIndex]&&(p=s[n.swimlaneIndex]),n.temp[0]=p,o!=null)for(var i=0;i1){o.maxRank=l.maxRank,o.minRank=a.maxRank,o.temp=[],o.x=[],o.y=[];for(var d=o.minRank+1;d0;)T%2&&(i+=v[T+1]),T=T-1>>1,++v[T]}return i},mxMedianHybridCrossingReduction.prototype.transpose=function(t,e){for(var i=!0,n=0,r=10;i&&n++y[M]&&L++,c[E]T[M]&&L++,v[E]=0;n--)this.medianRank(n,i);else for(var n=1;nt.medianValue?-1:e.medianValue0&&u<=o;){var m=e.shift(),d=m.cell,x=m.weightedValue,f=parseInt(m.rankIndex),g=d.getNextLayerConnectedCells(x),c=d.getPreviousLayerConnectedCells(x),v=g.length,y=c.length,T=this.medianXValue(g,x+1),C=this.medianXValue(c,x-1),S=v+y,E=d.getGeneralPurposeVariable(x),L=E;S>0&&(L=(T*v+C*y)/S);var A=!1;if(LE+p){var P=n[x].length;if(f==P-1)d.setGeneralPurposeVariable(x,L),A=!0;else{var R=n[x][f+1],O=R.getGeneralPurposeVariable(x);O=O-R.width/2-this.intraCellSpacing-d.width/2,O>L?(d.setGeneralPurposeVariable(x,L),A=!0):O>d.getGeneralPurposeVariable(x)+p&&(d.setGeneralPurposeVariable(x,O),A=!0)}}if(A){for(var r=0;r0;n--)this.rankMedianPosition(n-1,e,n);else for(var n=0;n0?m=this.medianXValue(o,i):m=p.getGeneralPurposeVariable(t));for(var d=0,x=-1e8,f=r[l].rankIndex-1;f>=0;){var g=s[n[f].id];if(g!=null){var c=g.cell;g.visited?(x=c.getGeneralPurposeVariable(t)+c.width/2+this.intraCellSpacing+d+p.width/2,f=-1):(d+=c.width+this.intraCellSpacing,f--)}}for(var v=0,y=1e8,f=r[l].rankIndex+1;f=x&&m<=y?p.setGeneralPurposeVariable(t,m):my&&(p.setGeneralPurposeVariable(t,y),this.currentXDelta+=m-y),r[l].visited=!0}},mxCoordinateAssignment.prototype.calculatedWeightedValue=function(t,e){for(var i=0,n=0;n=0;i--)i0&&this.rankCoordinates(i,t,e)},mxCoordinateAssignment.prototype.rankCoordinates=function(t,e,i){for(var n=i.ranks[t],r=0,s=this.initialX+(this.widestRankValue-this.rankWidths[t])/2,l=!1,a=0;a=0;r--){for(var s=0,l=e.ranks[r],a=this.initialX,o=!1,u=0;uthis.widestRankValue&&(this.widestRankValue=a,this.widestRank=r),this.rankWidths[r]=a}o==!0&&mxLog.warn("At least one cell has no bounds"),this.rankY[r]=i;var x=s/2+n/2+this.interRankCellSpacing;n=s,this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?i+=x:i-=x;for(var u=0;ur.minRank+1;o--){var g=r.getX(o-1);f==g||this.repositionValid(e,r,o-1,f)?(x[o-r.minRank-2]=f,m++):(x[o-r.minRank-2]=r.getX(o-1),f=g)}if(m>a||p>a){if(m>=p)for(var o=r.maxRank-2;o>r.minRank;o--)r.setX(o,x[o-r.minRank-1]);else if(p>m)for(var o=r.minRank+2;oa){if(s==r.length-1)return!0;var p=r[s+1],m=p.getGeneralPurposeVariable(i);return m=m-p.width/2-this.intraCellSpacing-e.width/2,m>=n}return!0},mxCoordinateAssignment.prototype.setCellLocations=function(t,e){this.rankTopY=[],this.rankBottomY=[];for(var i=0;i-1&&l0){for(var o=[],u=0;uy+2*this.prefHozEdgeSep&&(m+=this.prefHozEdgeSep,d-=this.prefHozEdgeSep);for(var T=d-m,C=T/x,S=m+C/2,E=this.minEdgeJetty-this.prefVertEdgeOff,u=0;ux/2&&(E-=this.prefVertEdgeOff);for(var M=0;M0?e=-e:e=-e+this.parallelEdgeSpacing,r++}t.temp[0]=101207}},mxCoordinateAssignment.prototype.setVertexLocation=function(t){var e=t.cell,i=t.x[0]-t.width/2,n=t.y[0]-t.height/2;this.rankTopY[t.minRank]=Math.min(this.rankTopY[t.minRank],n),this.rankBottomY[t.minRank]=Math.max(this.rankBottomY[t.minRank],n+t.height),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(e,i,n):this.layout.setVertexLocation(e,n,i),this.limitX=Math.max(this.limitX,i+t.width)},mxCoordinateAssignment.prototype.processReversedEdge=function(t,e){},__mxOutput.mxCoordinateAssignment=typeof mxCoordinateAssignment<"u"?mxCoordinateAssignment:void 0;function mxSwimlaneOrdering(t){this.layout=t}mxSwimlaneOrdering.prototype=new mxHierarchicalLayoutStage,mxSwimlaneOrdering.prototype.constructor=mxSwimlaneOrdering,mxSwimlaneOrdering.prototype.layout=null,mxSwimlaneOrdering.prototype.execute=function(t){var e=this.layout.getModel(),i=new Object,n=mxUtils.clone(e.vertexMapper,null,!0),r=null;if(e.roots!=null){var s=e.roots;r=[];for(var l=0;l0&&i.push(a);var x=u-p;x>s&&(s=x,r=a)}}i.length==0&&r!=null&&i.push(r)}return i},mxHierarchicalLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(e!=null)return e;for(var i=this.graph.model,n=[],r=this.graph.isCellCollapsed(t),s=i.getChildCount(t),l=0;l=0&&(r=this.traverse(m,e,o[p],n,r,s,l))}}else if(r[a]==null)for(var p=0;p0&&i.push(a);var f=u-p;f>s&&(s=f,r=a)}}i.length==0&&r!=null&&i.push(r)}return i},mxSwimlaneLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(e!=null)return e;for(var i=this.graph.model,n=[],r=this.graph.isCellCollapsed(t),s=i.getChildCount(t),l=0;l0&&t!=null){for(var n=Object(),r=0;r=this.swimlanes.length||(f>a||(!e||x)&&f==a)&&(r=this.traverse(d,e,u[m],n,r,s,l,f))}}else if(r[o]==null)for(var m=0;m0){var n=t,r=mxCellPath.create(n);if(i.length=0;i--)this.cellRemoved(this.getChildAt(t,i));this.cells!=null&&t.getId()!=null&&delete this.cells[t.getId()]}},mxGraphModel.prototype.parentForCellChanged=function(t,e,i){var n=this.getParent(t);if(e!=null)(e!=n||n.getIndex(t)!=i)&&e.insert(t,i);else if(n!=null){var r=n.getIndex(t);n.remove(r)}var s=this.contains(e),l=this.contains(n);return s&&!l?this.cellAdded(t):l&&!s&&this.cellRemoved(t),n},mxGraphModel.prototype.getChildCount=function(t){return t!=null?t.getChildCount():0},mxGraphModel.prototype.getChildAt=function(t,e){return t!=null?t.getChildAt(e):null},mxGraphModel.prototype.getChildren=function(t){return t!=null?t.children:null},mxGraphModel.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraphModel.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraphModel.prototype.getChildCells=function(t,e,i){e=e??!1,i=i??!1;for(var n=this.getChildCount(t),r=[],s=0;s=0&&(e=this.getChildAt(t),e!=null&&(this.children.splice(t,1),e.setParent(null))),e},mxCell.prototype.removeFromParent=function(){if(this.parent!=null){var t=this.parent.getIndex(this);this.parent.remove(t)}},mxCell.prototype.getEdgeCount=function(){return this.edges==null?0:this.edges.length},mxCell.prototype.getEdgeIndex=function(t){return mxUtils.indexOf(this.edges,t)},mxCell.prototype.getEdgeAt=function(t){return this.edges==null?null:this.edges[t]},mxCell.prototype.insertEdge=function(t,e){return t!=null&&(t.removeFromTerminal(e),t.setTerminal(this,e),(this.edges==null||t.getTerminal(!e)!=this||mxUtils.indexOf(this.edges,t)<0)&&(this.edges==null&&(this.edges=[]),this.edges.push(t))),t},mxCell.prototype.removeEdge=function(t,e){if(t!=null){if(t.getTerminal(!e)!=this&&this.edges!=null){var i=this.getEdgeIndex(t);i>=0&&this.edges.splice(i,1)}t.setTerminal(null,e)}return t},mxCell.prototype.removeFromTerminal=function(t){var e=this.getTerminal(t);e!=null&&e.removeEdge(this,t)},mxCell.prototype.hasAttribute=function(t){var e=this.getValue();return e!=null&&e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.hasAttribute?e.hasAttribute(t):e.getAttribute(t)!=null},mxCell.prototype.getAttribute=function(t,e){var i=this.getValue(),n=i!=null&&i.nodeType==mxConstants.NODETYPE_ELEMENT?i.getAttribute(t):null;return n??e},mxCell.prototype.setAttribute=function(t,e){var i=this.getValue();i!=null&&i.nodeType==mxConstants.NODETYPE_ELEMENT&&i.setAttribute(t,e)},mxCell.prototype.clone=function(){var t=mxUtils.clone(this,this.mxTransient);return t.setValue(this.cloneValue()),t},mxCell.prototype.cloneValue=function(){var t=this.getValue();return t!=null&&(typeof t.clone=="function"?t=t.clone():isNaN(t.nodeType)||(t=t.cloneNode(!0))),t},__mxOutput.mxCell=typeof mxCell<"u"?mxCell:void 0;function mxGeometry(t,e,i,n){mxRectangle.call(this,t,e,i,n)}mxGeometry.prototype=new mxRectangle,mxGeometry.prototype.constructor=mxGeometry,mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0,mxGeometry.prototype.alternateBounds=null,mxGeometry.prototype.sourcePoint=null,mxGeometry.prototype.targetPoint=null,mxGeometry.prototype.points=null,mxGeometry.prototype.offset=null,mxGeometry.prototype.relative=!1,mxGeometry.prototype.swap=function(){if(this.alternateBounds!=null){var t=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x,this.y=this.alternateBounds.y,this.width=this.alternateBounds.width,this.height=this.alternateBounds.height,this.alternateBounds=t}},mxGeometry.prototype.getTerminalPoint=function(t){return t?this.sourcePoint:this.targetPoint},mxGeometry.prototype.setTerminalPoint=function(t,e){return e?this.sourcePoint=t:this.targetPoint=t,t},mxGeometry.prototype.rotate=function(t,e){var i=mxUtils.toRadians(t),n=Math.cos(i),r=Math.sin(i);if(!this.relative){var s=new mxPoint(this.getCenterX(),this.getCenterY()),l=mxUtils.getRotatedPoint(s,n,r,e);this.x=Math.round(l.x-this.width/2),this.y=Math.round(l.y-this.height/2)}if(this.sourcePoint!=null){var l=mxUtils.getRotatedPoint(this.sourcePoint,n,r,e);this.sourcePoint.x=Math.round(l.x),this.sourcePoint.y=Math.round(l.y)}if(this.targetPoint!=null){var l=mxUtils.getRotatedPoint(this.targetPoint,n,r,e);this.targetPoint.x=Math.round(l.x),this.targetPoint.y=Math.round(l.y)}if(this.points!=null){for(var a=0;a1&&(e=e.substring(0,r-1)),e},getParentPath:function(t){if(t!=null){var e=t.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(e>=0)return t.substring(0,e);if(t.length>0)return""}return null},resolve:function(t,e){var i=t;if(e!=null)for(var n=e.split(mxCellPath.PATH_SEPARATOR),r=0;re[r]?1:-1;else{var s=parseInt(t[r]),l=parseInt(e[r]);n=s==l?0:s>l?1:-1}break}if(n==0){var s=t.length,l=e.length;s!=l&&(n=s>l?1:-1)}return n}};__mxOutput.mxCellPath=typeof mxCellPath<"u"?mxCellPath:void 0;var mxPerimeter={RectanglePerimeter:function(t,e,i,n){var r=t.getCenterX(),s=t.getCenterY(),l=i.x-r,a=i.y-s,o=Math.atan2(a,l),u=new mxPoint(0,0),p=Math.PI,m=Math.PI/2,d=m-o,x=Math.atan2(t.height,t.width);return o<-p+x||o>p-x?(u.x=t.x,u.y=s-t.width*Math.tan(o)/2):o<-x?(u.y=t.y,u.x=r-t.height*Math.tan(d)/2):o=t.x&&i.x<=t.x+t.width?u.x=i.x:i.y>=t.y&&i.y<=t.y+t.height&&(u.y=i.y),i.xt.x+t.width&&(u.x=t.x+t.width),i.yt.y+t.height&&(u.y=t.y+t.height)),u},EllipsePerimeter:function(t,e,i,n){var r=t.x,s=t.y,l=t.width/2,a=t.height/2,o=r+l,u=s+a,p=i.x,m=i.y,d=parseInt(p-o),x=parseInt(m-u);if(d==0&&x!=0)return new mxPoint(o,u+a*x/Math.abs(x));if(d==0&&x==0)return new mxPoint(p,m);if(n){if(m>=s&&m<=s+t.height){var f=m-u,g=Math.sqrt(l*l*(1-f*f/(a*a)))||0;return p<=r&&(g=-g),new mxPoint(o+g,m)}if(p>=r&&p<=r+t.width){var g=p-o,f=Math.sqrt(a*a*(1-g*g/(l*l)))||0;return m<=s&&(f=-f),new mxPoint(p,u+f)}}var c=x/d,v=u-c*o,y=l*l*c*c+a*a,T=-2*o*y,C=l*l*c*c*o*o+a*a*o*o-l*l*a*a,S=Math.sqrt(T*T-4*y*C),E=(-T+S)/(2*y),L=(-T-S)/(2*y),A=c*E+v,M=c*L+v,I=Math.sqrt(Math.pow(E-p,2)+Math.pow(A-m,2)),P=Math.sqrt(Math.pow(L-p,2)+Math.pow(M-m,2)),R=0,O=0;return Im?new mxPoint(o,s):new mxPoint(o,s+a);if(u==m)return o>p?new mxPoint(r,u):new mxPoint(r+l,u);var d=o,x=u;return n&&(p>=r&&p<=r+l?d=p:m>=s&&m<=s+a&&(x=m)),p-y&&vMath.PI-y;var C=null;if(T)n&&(s&&i.x>=d.x&&i.x<=f.x||!s&&i.y>=d.y&&i.y<=f.y)?s?C=new mxPoint(i.x,d.y):C=new mxPoint(d.x,i.y):r==mxConstants.DIRECTION_NORTH?C=new mxPoint(l+o/2+u*Math.tan(v)/2,a+u):r==mxConstants.DIRECTION_SOUTH?C=new mxPoint(l+o/2-u*Math.tan(v)/2,a):r==mxConstants.DIRECTION_WEST?C=new mxPoint(l+o,a+u/2+o*Math.tan(v)/2):C=new mxPoint(l,a+u/2-o*Math.tan(v)/2);else{if(n){var S=new mxPoint(p,m);i.y>=a&&i.y<=a+u?(S.x=s?p:r==mxConstants.DIRECTION_WEST?l+o:l,S.y=i.y):i.x>=l&&i.x<=l+o&&(S.x=i.x,S.y=s?r==mxConstants.DIRECTION_NORTH?a+u:a:m),g=i.x-S.x,c=i.y-S.y,p=S.x,m=S.y}s&&i.x<=l+o/2||!s&&i.y<=a+u/2?C=mxUtils.intersection(i.x,i.y,p,m,d.x,d.y,x.x,x.y):C=mxUtils.intersection(i.x,i.y,p,m,x.x,x.y,f.x,f.y)}return C==null&&(C=new mxPoint(p,m)),C},HexagonPerimeter:function(t,e,i,n){var r=t.x,s=t.y,l=t.width,a=t.height,o=t.getCenterX(),u=t.getCenterY(),p=i.x,m=i.y,d=p-o,x=m-u,f=-Math.atan2(x,d),g=Math.PI,c=Math.PI/2,v=new mxPoint(o,u),y=e!=null?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST,T=y==mxConstants.DIRECTION_NORTH||y==mxConstants.DIRECTION_SOUTH,C=new mxPoint,S=new mxPoint;if((ps+a||p>r+l&&mr+l&&m>s+a)&&(n=!1),n){if(T){if(p==o){if(m<=s)return new mxPoint(o,s);if(m>=s+a)return new mxPoint(o,s+a)}else if(pr+l){if(m==s+a/4)return new mxPoint(r+l,s+a/4);if(m==s+3*a/4)return new mxPoint(r+l,s+3*a/4)}else if(p==r){if(mu)return new mxPoint(r,s+3*a/4)}else if(p==r+l){if(mu)return new mxPoint(r+l,s+3*a/4)}if(m==s)return new mxPoint(o,s);if(m==s+a)return new mxPoint(o,s+a);ps+a/4&&ms+3*a/4&&(C=new mxPoint(r-Math.floor(.5*l),s+Math.floor(.5*a)),S=new mxPoint(r+l,s+Math.floor(1.25*a))):p>o&&(m>s+a/4&&ms+3*a/4&&(C=new mxPoint(r+Math.floor(1.5*l),s+Math.floor(.5*a)),S=new mxPoint(r,s+Math.floor(1.25*a))))}else{if(m==u){if(p<=r)return new mxPoint(r,s+a/2);if(p>=r+l)return new mxPoint(r+l,s+a/2)}else if(ms+a){if(p==r+l/4)return new mxPoint(r+l/4,s+a);if(p==r+3*l/4)return new mxPoint(r+3*l/4,s+a)}else if(m==s){if(po)return new mxPoint(r+3*l/4,s)}else if(m==s+a){if(pu)return new mxPoint(r+3*l/4,s+a)}if(p==r)return new mxPoint(r,u);if(p==r+l)return new mxPoint(r+l,u);mr+l/4&&pr+3*l/4&&(C=new mxPoint(r+Math.floor(.5*l),s-Math.floor(.5*a)),S=new mxPoint(r+Math.floor(1.25*l),s+a)):m>u&&(p>r+l/4&&pr+3*l/4&&(C=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a)),S=new mxPoint(r+Math.floor(1.25*l),s)))}var E=o,L=u;p>=r&&p<=r+l?(E=p,m=s&&m<=s+a&&(L=m,p-A?(C=new mxPoint(r+l,s),S=new mxPoint(r+l,s+a)):f>A&&fc&&fg-A&&f<=g||f<-g+A&&f>=-g?(C=new mxPoint(r,s),S=new mxPoint(r,s+a)):f<-A&&f>-c?(C=new mxPoint(r+Math.floor(1.5*l),s+Math.floor(.5*a)),S=new mxPoint(r,s+Math.floor(1.25*a))):f<-c&&f>-g+A&&(C=new mxPoint(r-Math.floor(.5*l),s+Math.floor(.5*a)),S=new mxPoint(r+l,s+Math.floor(1.25*a)))}else{var A=Math.atan2(a/2,l/4);if(f==A)return new mxPoint(r+Math.floor(.75*l),s);if(f==g-A)return new mxPoint(r+Math.floor(.25*l),s);if(f==g||f==-g)return new mxPoint(r,s+Math.floor(.5*a));if(f==0)return new mxPoint(r+l,s+Math.floor(.5*a));if(f==-A)return new mxPoint(r+Math.floor(.75*l),s+a);if(f==-g+A)return new mxPoint(r+Math.floor(.25*l),s+a);f>0&&fA&&fg-A&&f-A?(C=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a)),S=new mxPoint(r+Math.floor(1.25*l),s)):f<-A&&f>-g+A?(C=new mxPoint(r,s+a),S=new mxPoint(r+l,s+a)):f<-g+A&&f>-g&&(C=new mxPoint(r-Math.floor(.25*l),s),S=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a)))}v=mxUtils.intersection(o,u,i.x,i.y,C.x,C.y,S.x,S.y)}return v??new mxPoint(o,u)}};__mxOutput.mxPerimeter=typeof mxPerimeter<"u"?mxPerimeter:void 0;function mxPrintPreview(t,e,i,n,r,s,l,a,o){this.graph=t,this.scale=e??1/t.pageScale,this.border=n??0,this.pageFormat=mxRectangle.fromRectangle(i??t.pageFormat),this.title=a??"Printer-friendly version",this.x0=r??0,this.y0=s??0,this.borderColor=l,this.pageSelector=o??!0}mxPrintPreview.prototype.graph=null,mxPrintPreview.prototype.pageFormat=null,mxPrintPreview.prototype.scale=null,mxPrintPreview.prototype.border=0,mxPrintPreview.prototype.marginTop=0,mxPrintPreview.prototype.marginBottom=0,mxPrintPreview.prototype.x0=0,mxPrintPreview.prototype.y0=0,mxPrintPreview.prototype.autoOrigin=!0,mxPrintPreview.prototype.printOverlays=!1,mxPrintPreview.prototype.printControls=!1,mxPrintPreview.prototype.printBackgroundImage=!1,mxPrintPreview.prototype.backgroundColor="#ffffff",mxPrintPreview.prototype.borderColor=null,mxPrintPreview.prototype.title=null,mxPrintPreview.prototype.pageSelector=null,mxPrintPreview.prototype.wnd=null,mxPrintPreview.prototype.targetWindow=null,mxPrintPreview.prototype.pageCount=0,mxPrintPreview.prototype.clipping=!0,mxPrintPreview.prototype.getWindow=function(){return this.wnd},mxPrintPreview.prototype.getDoctype=function(){var t="";return document.documentMode==5?t='':document.documentMode==8?t='':document.documentMode>8&&(t=''),t},mxPrintPreview.prototype.appendGraph=function(t,e,i,n,r,s){this.graph=t,this.scale=e??1/t.pageScale,this.x0=i,this.y0=n,this.open(null,null,r,s)},mxPrintPreview.prototype.open=function(t,e,i,n){var r=this.graph.cellRenderer.initializeOverlay,s=null;try{this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(P,R){R.init(P.view.getDrawPane())}),this.printControls&&(this.graph.cellRenderer.initControl=function(P,R,O,_){R.dialect=P.view.graph.dialect,R.init(P.view.getDrawPane())}),this.wnd=e??this.wnd;var l=!1;this.wnd==null&&(l=!0,this.wnd=window.open());var a=this.wnd.document;if(l){var o=this.getDoctype();o!=null&&o.length>0&&a.writeln(o),mxClient.IS_VML?a.writeln(''):(document.compatMode==="CSS1Compat"&&a.writeln(""),a.writeln("")),a.writeln(""),this.writeHead(a,t),a.writeln(""),a.writeln('')}var u=this.graph.getGraphBounds().clone(),p=this.graph.getView().getScale(),m=p/this.scale,d=this.graph.getView().getTranslate();this.autoOrigin||(this.x0-=d.x*this.scale,this.y0-=d.y*this.scale,u.width+=u.x,u.height+=u.y,u.x=0,u.y=0,this.border=0);var x=this.pageFormat.width-this.border*2,f=this.pageFormat.height-this.border*2;this.pageFormat.height+=this.marginTop+this.marginBottom,u.width/=m,u.height/=m;var g=Math.max(1,Math.ceil((u.width+this.x0)/x)),c=Math.max(1,Math.ceil((u.height+this.y0)/f));this.pageCount=g*c;var v=mxUtils.bind(this,function(){if(this.pageSelector&&(c>1||g>1)){var P=this.createPageSelector(c,g);if(a.body.appendChild(P),mxClient.IS_IE&&a.documentMode==null||a.documentMode==5||a.documentMode==8||a.documentMode==7){P.style.position="absolute";var R=function(){P.style.top=(a.body.scrollTop||a.documentElement.scrollTop)+10+"px"};mxEvent.addListener(this.wnd,"scroll",function(O){R()}),mxEvent.addListener(this.wnd,"resize",function(O){R()})}}}),y=mxUtils.bind(this,function(P,R){if(this.borderColor!=null&&(P.style.borderColor=this.borderColor,P.style.borderStyle="solid",P.style.borderWidth="1px"),P.style.background=this.backgroundColor,(i||R)&&(P.style.pageBreakAfter="always"),l&&(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE))a.writeln(P.outerHTML),P.parentNode.removeChild(P);else if(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE){var O=a.createElement("div");O.innerHTML=P.outerHTML,O=O.getElementsByTagName("div")[0],a.body.appendChild(O),P.parentNode.removeChild(P)}else P.parentNode.removeChild(P),a.body.appendChild(P);(i||R)&&this.addPageBreak(a)}),T=this.getCoverPages(this.pageFormat.width,this.pageFormat.height);if(T!=null)for(var C=0;C"),t.writeln(""),t.close(),mxEvent.release(t.body)}}catch{}},mxPrintPreview.prototype.writeHead=function(t,e){this.title!=null&&t.writeln(""+this.title+""),mxClient.IS_VML&&t.writeln(''),mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",t),t.writeln('")},mxPrintPreview.prototype.writePostfix=function(t){},mxPrintPreview.prototype.createPageSelector=function(t,e){var i=this.wnd.document,n=i.createElement("table");n.className="mxPageSelector",n.setAttribute("border","0");for(var r=i.createElement("tbody"),s=0;s0&&b.height>0&&!mxUtils.intersects(C,b))return}}v.apply(this,arguments)}}var S=null;try{var E=[this.getRoot()];S=new mxTemporaryCellStates(l,i,E,null,mxUtils.bind(this,function(P){return this.getLinkForCellState(P)}))}finally{if(mxClient.IS_IE)l.overlayPane.innerHTML="",l.canvas.style.overflow="hidden",l.canvas.style.position="relative",l.canvas.style.top=this.marginTop+"px",l.canvas.style.width=s.width+"px",l.canvas.style.height=s.height+"px";else for(var L=r.firstChild;L!=null;){var A=L.nextSibling,M=L.nodeName.toLowerCase();M=="svg"?(L.style.overflow="hidden",L.style.position="relative",L.style.top=this.marginTop+"px",L.setAttribute("width",s.width),L.setAttribute("height",s.height),L.style.width="",L.style.height=""):L.style.cursor!="default"&&M!="div"&&L.parentNode.removeChild(L),L=A}if(this.printBackgroundImage){var I=r.getElementsByTagName("svg");I.length>0&&(I[0].style.position="absolute")}l.overlayPane.parentNode.removeChild(l.overlayPane),this.graph.setEnabled(g),this.graph.container=a,this.graph.cellRenderer.redraw=v,l.canvas=o,l.backgroundPane=u,l.drawPane=p,l.overlayPane=m,l.translate=c,S.destroy(),l.setEventsEnabled(f)}},mxPrintPreview.prototype.getLinkForCellState=function(t){return this.graph.getLinkForCell(t.cell)},mxPrintPreview.prototype.insertBackgroundImage=function(t,e,i){var n=this.graph.backgroundImage;if(n!=null){var r=document.createElement("img");r.style.position="absolute",r.style.marginLeft=Math.round(e*this.scale)+"px",r.style.marginTop=Math.round(i*this.scale)+"px",r.setAttribute("width",Math.round(this.scale*n.width)),r.setAttribute("height",Math.round(this.scale*n.height)),r.src=n.src,t.insertBefore(r,t.firstChild)}},mxPrintPreview.prototype.getCoverPages=function(){return null},mxPrintPreview.prototype.getAppendices=function(){return null},mxPrintPreview.prototype.print=function(t){var e=this.open(t);e!=null&&e.print()},mxPrintPreview.prototype.close=function(){this.wnd!=null&&(this.wnd.close(),this.wnd=null)},__mxOutput.mxPrintPreview=typeof mxPrintPreview<"u"?mxPrintPreview:void 0;function mxStylesheet(){this.styles=new Object,this.putDefaultVertexStyle(this.createDefaultVertexStyle()),this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}mxStylesheet.prototype.styles,mxStylesheet.prototype.createDefaultVertexStyle=function(){var t=new Object;return t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE,t[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_FILLCOLOR]="#C3D9FF",t[mxConstants.STYLE_STROKECOLOR]="#6482B9",t[mxConstants.STYLE_FONTCOLOR]="#774400",t},mxStylesheet.prototype.createDefaultEdgeStyle=function(){var t=new Object;return t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR,t[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_STROKECOLOR]="#6482B9",t[mxConstants.STYLE_FONTCOLOR]="#446299",t},mxStylesheet.prototype.putDefaultVertexStyle=function(t){this.putCellStyle("defaultVertex",t)},mxStylesheet.prototype.putDefaultEdgeStyle=function(t){this.putCellStyle("defaultEdge",t)},mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex},mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge},mxStylesheet.prototype.putCellStyle=function(t,e){this.styles[t]=e},mxStylesheet.prototype.getCellStyle=function(t,e){var i=e;if(t!=null&&t.length>0){var n=t.split(";");i!=null&&t.charAt(0)!=";"?i=mxUtils.clone(i):i=new Object;for(var r=0;r=0){var a=s.substring(0,l),o=s.substring(l+1);o==mxConstants.NONE?delete i[a]:mxUtils.isNumeric(o)?i[a]=parseFloat(o):i[a]=o}else{var u=this.styles[s];if(u!=null)for(var a in u)i[a]=u[a]}}}return i},__mxOutput.mxStylesheet=typeof mxStylesheet<"u"?mxStylesheet:void 0;function mxCellState(t,e,i){this.view=t,this.cell=e,this.style=i??{},this.origin=new mxPoint,this.absoluteOffset=new mxPoint}mxCellState.prototype=new mxRectangle,mxCellState.prototype.constructor=mxCellState,mxCellState.prototype.view=null,mxCellState.prototype.cell=null,mxCellState.prototype.style=null,mxCellState.prototype.invalidStyle=!1,mxCellState.prototype.invalid=!0,mxCellState.prototype.origin=null,mxCellState.prototype.absolutePoints=null,mxCellState.prototype.absoluteOffset=null,mxCellState.prototype.visibleSourceState=null,mxCellState.prototype.visibleTargetState=null,mxCellState.prototype.terminalDistance=0,mxCellState.prototype.length=0,mxCellState.prototype.segments=null,mxCellState.prototype.shape=null,mxCellState.prototype.text=null,mxCellState.prototype.unscaledWidth=null,mxCellState.prototype.unscaledHeight=null,mxCellState.prototype.getPerimeterBounds=function(t,e){if(t=t||0,e=e??new mxRectangle(this.x,this.y,this.width,this.height),this.shape!=null&&this.shape.stencil!=null&&this.shape.stencil.aspect=="fixed"){var i=this.shape.stencil.computeAspect(this.style,e.x,e.y,e.width,e.height);e.x=i.x,e.y=i.y,e.width=this.shape.stencil.w0*i.width,e.height=this.shape.stencil.h0*i.height}return t!=0&&e.grow(t),e},mxCellState.prototype.setAbsoluteTerminalPoint=function(t,e){e?(this.absolutePoints==null&&(this.absolutePoints=[]),this.absolutePoints.length==0?this.absolutePoints.push(t):this.absolutePoints[0]=t):this.absolutePoints==null?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(t)):this.absolutePoints.length==1?this.absolutePoints.push(t):this.absolutePoints[this.absolutePoints.length-1]=t},mxCellState.prototype.setCursor=function(t){this.shape!=null&&this.shape.setCursor(t),this.text!=null&&this.text.setCursor(t)},mxCellState.prototype.getVisibleTerminal=function(t){var e=this.getVisibleTerminalState(t);return e!=null?e.cell:null},mxCellState.prototype.getVisibleTerminalState=function(t){return t?this.visibleSourceState:this.visibleTargetState},mxCellState.prototype.setVisibleTerminalState=function(t,e){e?this.visibleSourceState=t:this.visibleTargetState=t},mxCellState.prototype.getCellBounds=function(){return this.cellBounds},mxCellState.prototype.getPaintBounds=function(){return this.paintBounds},mxCellState.prototype.updateCachedBounds=function(){var t=this.view.translate,e=this.view.scale;this.cellBounds=new mxRectangle(this.x/e-t.x,this.y/e-t.y,this.width/e,this.height/e),this.paintBounds=mxRectangle.fromRectangle(this.cellBounds),this.shape!=null&&this.shape.isPaintBoundsInverted()&&this.paintBounds.rotate90()},mxCellState.prototype.setState=function(t){this.view=t.view,this.cell=t.cell,this.style=t.style,this.absolutePoints=t.absolutePoints,this.origin=t.origin,this.absoluteOffset=t.absoluteOffset,this.boundingBox=t.boundingBox,this.terminalDistance=t.terminalDistance,this.segments=t.segments,this.length=t.length,this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.unscaledWidth=t.unscaledWidth,this.unscaledHeight=t.unscaledHeight},mxCellState.prototype.clone=function(){var t=new mxCellState(this.view,this.cell,this.style);if(this.absolutePoints!=null){t.absolutePoints=[];for(var e=0;e=0:!1},mxGraphSelectionModel.prototype.isEmpty=function(){return this.cells.length==0},mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)},mxGraphSelectionModel.prototype.setCell=function(t){t!=null&&this.setCells([t])},mxGraphSelectionModel.prototype.setCells=function(t){if(t!=null){this.singleSelection&&(t=[this.getFirstSelectableCell(t)]);for(var e=[],i=0;i0&&t[0]!=null||e!=null&&e.length>0&&e[0]!=null){var i=new mxSelectionChange(this,t,e);i.execute();var n=new mxUndoableEdit(this,!1);n.add(i),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",n))}},mxGraphSelectionModel.prototype.cellAdded=function(t){t!=null&&!this.isSelected(t)&&this.cells.push(t)},mxGraphSelectionModel.prototype.cellRemoved=function(t){if(t!=null){var e=mxUtils.indexOf(this.cells,t);e>=0&&this.cells.splice(e,1)}};function mxSelectionChange(t,e,i){this.selectionModel=t,this.added=e!=null?e.slice():null,this.removed=i!=null?i.slice():null}mxSelectionChange.prototype.execute=function(){var t=mxLog.enter("mxSelectionChange.execute");if(window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource,this.removed!=null)for(var e=0;e":"",mxCellEditor.prototype.escapeCancelsEditing=!0,mxCellEditor.prototype.textNode="",mxCellEditor.prototype.zIndex=5,mxCellEditor.prototype.minResize=new mxRectangle(0,20),mxCellEditor.prototype.wordWrapPadding=mxClient.IS_QUIRKS?2:mxClient.IS_IE11?0:1,mxCellEditor.prototype.blurEnabled=!1,mxCellEditor.prototype.initialValue=null,mxCellEditor.prototype.align=null,mxCellEditor.prototype.init=function(){this.textarea=document.createElement("div"),this.textarea.className="mxCellEditor mxPlainTextEditor",this.textarea.contentEditable=!0,mxClient.IS_GC&&(this.textarea.style.minHeight="1em"),this.textarea.style.position=this.isLegacyEditor()?"absolute":"relative",this.installListeners(this.textarea)},mxCellEditor.prototype.applyValue=function(t,e){this.graph.labelChanged(t.cell,e,this.trigger)},mxCellEditor.prototype.setAlign=function(t){this.textarea!=null&&(this.textarea.style.textAlign=t),this.align=t,this.resize()},mxCellEditor.prototype.getInitialValue=function(t,e){var i=mxUtils.htmlEntities(this.graph.getEditingValue(t.cell,e),!1);return!mxClient.IS_QUIRKS&&document.documentMode!=8&&document.documentMode!=9&&document.documentMode!=10&&(i=mxUtils.replaceTrailingNewlines(i,"

")),i.replace(/\n/g,"
")},mxCellEditor.prototype.getCurrentValue=function(t){return mxUtils.extractTextWithWhitespace(this.textarea.childNodes)},mxCellEditor.prototype.isCancelEditingKeyEvent=function(t){return this.escapeCancelsEditing||mxEvent.isShiftDown(t)||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)},mxCellEditor.prototype.installListeners=function(t){mxEvent.addListener(t,"dragstart",mxUtils.bind(this,function(s){this.graph.stopEditing(!1),mxEvent.consume(s)})),mxEvent.addListener(t,"blur",mxUtils.bind(this,function(s){this.blurEnabled&&this.focusLost(s)})),mxEvent.addListener(t,"keydown",mxUtils.bind(this,function(s){mxEvent.isConsumed(s)||(this.isStopEditingEvent(s)?(this.graph.stopEditing(!1),mxEvent.consume(s)):s.keyCode==27&&(this.graph.stopEditing(this.isCancelEditingKeyEvent(s)),mxEvent.consume(s)))}));var e=mxUtils.bind(this,function(s){this.editingCell!=null&&this.clearOnChange&&t.innerHTML==this.getEmptyLabelText()&&(!mxClient.IS_FF||s.keyCode!=8&&s.keyCode!=46)&&(this.clearOnChange=!1,t.innerHTML="")});mxEvent.addListener(t,"keypress",e),mxEvent.addListener(t,"paste",e);var i=mxUtils.bind(this,function(s){this.editingCell!=null&&(this.textarea.innerHTML.length==0||this.textarea.innerHTML=="
"?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=this.textarea.innerHTML.length>0):this.clearOnChange=!1)});mxEvent.addListener(t,!mxClient.IS_IE11&&!mxClient.IS_IE?"input":"keyup",i),mxEvent.addListener(t,"cut",i),mxEvent.addListener(t,"paste",i);var n=!mxClient.IS_IE11&&!mxClient.IS_IE?"input":"keydown",r=mxUtils.bind(this,function(s){this.editingCell!=null&&this.autoSize&&!mxEvent.isConsumed(s)&&(this.resizeThread!=null&&window.clearTimeout(this.resizeThread),this.resizeThread=window.setTimeout(mxUtils.bind(this,function(){this.resizeThread=null,this.resize()}),0))});mxEvent.addListener(t,n,r),mxEvent.addListener(window,"resize",r),document.documentMode>=9?(mxEvent.addListener(t,"DOMNodeRemoved",r),mxEvent.addListener(t,"DOMNodeInserted",r)):(mxEvent.addListener(t,"cut",r),mxEvent.addListener(t,"paste",r))},mxCellEditor.prototype.isStopEditingEvent=function(t){return t.keyCode==113||this.graph.isEnterStopsCellEditing()&&t.keyCode==13&&!mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)},mxCellEditor.prototype.isEventSource=function(t){return mxEvent.getSource(t)==this.textarea},mxCellEditor.prototype.resize=function(){var t=this.graph.getView().getState(this.editingCell);if(t==null)this.stopEditing(!0);else if(this.textarea!=null){var e=this.graph.getModel().isEdge(t.cell),i=this.graph.getView().scale,n=null;if(!this.autoSize||t.style[mxConstants.STYLE_OVERFLOW]=="fill")this.bounds=this.getEditorBounds(t),this.textarea.style.width=Math.round(this.bounds.width/i)+"px",this.textarea.style.height=Math.round(this.bounds.height/i)+"px",document.documentMode==8||mxClient.IS_QUIRKS?(this.textarea.style.left=Math.round(this.bounds.x)+"px",this.textarea.style.top=Math.round(this.bounds.y)+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x+1))+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y+1))+"px"),this.graph.isWrapping(t.cell)&&(this.bounds.width>=2||this.bounds.height>=2)&&this.textarea.innerHTML!=this.getEmptyLabelText()?(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal",t.style[mxConstants.STYLE_OVERFLOW]!="fill"&&(this.textarea.style.width=Math.round(this.bounds.width/i)+this.wordWrapPadding+"px")):(this.textarea.style.whiteSpace="nowrap",t.style[mxConstants.STYLE_OVERFLOW]!="fill"&&(this.textarea.style.width=""));else{var r=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);if(n=t.text!=null&&this.align==null?t.text.margin:null,n==null&&(n=mxUtils.getAlignmentAsPoint(this.align||mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE))),e){if(this.bounds=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y,0,0),r!=null){var s=(parseFloat(r)+2)*i;this.bounds.width=s,this.bounds.x+=n.x*s}}else{var l=mxRectangle.fromRectangle(t),a=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),o=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(l=t.shape!=null&&a==mxConstants.ALIGN_CENTER&&o==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(l):l,r!=null&&(l.width=parseFloat(r)*i),!t.view.graph.cellRenderer.legacySpacing||t.style[mxConstants.STYLE_OVERFLOW]!="width"){var u=parseInt(t.style[mxConstants.STYLE_SPACING]||2)*i,p=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*i+u,m=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*i+u,d=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*i+u,x=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*i+u,a=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),o=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);l=new mxRectangle(l.x+x,l.y+p,l.width-(a==mxConstants.ALIGN_CENTER&&r==null?x+m:0),l.height-(o==mxConstants.ALIGN_MIDDLE?p+d:0))}this.bounds=new mxRectangle(l.x+t.absoluteOffset.x,l.y+t.absoluteOffset.y,l.width,l.height)}if(this.graph.isWrapping(t.cell)&&(this.bounds.width>=2||this.bounds.height>=2)&&this.textarea.innerHTML!=this.getEmptyLabelText()){this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal";var s=Math.round(this.bounds.width/(document.documentMode==8,i))+this.wordWrapPadding;this.textarea.style.position!="relative"?(this.textarea.style.width=s+"px",this.textarea.scrollWidth>s&&(this.textarea.style.width=this.textarea.scrollWidth+"px")):this.textarea.style.maxWidth=s+"px"}else this.textarea.style.whiteSpace="nowrap",this.textarea.style.width="";document.documentMode==8&&(this.textarea.style.zoom="1",this.textarea.style.height="auto");var f=this.textarea.scrollWidth,g=this.textarea.scrollHeight;document.documentMode==8?(this.textarea.style.left=Math.max(0,Math.ceil((this.bounds.x-n.x*(this.bounds.width-(f+1)*i)+f*(i-1)*0+(n.x+.5)*2)/i))+"px",this.textarea.style.top=Math.max(0,Math.ceil((this.bounds.y-n.y*(this.bounds.height-(g+.5)*i)+g*(i-1)*0+Math.abs(n.y+.5)*1)/i))+"px",this.textarea.style.width=Math.round(f*i)+"px",this.textarea.style.height=Math.round(g*i)+"px"):mxClient.IS_QUIRKS?(this.textarea.style.left=Math.max(0,Math.ceil(this.bounds.x-n.x*(this.bounds.width-(f+1)*i)+f*(i-1)*0+(n.x+.5)*2))+"px",this.textarea.style.top=Math.max(0,Math.ceil(this.bounds.y-n.y*(this.bounds.height-(g+.5)*i)+g*(i-1)*0+Math.abs(n.y+.5)*1))+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-n.x*(this.bounds.width-2))+1)+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-n.y*(this.bounds.height-4)+(n.y==-1?3:0))+1)+"px")}mxClient.IS_VML?this.textarea.style.zoom=i:(mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px"),mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+i+","+i+")"+(n==null?"":" translate("+n.x*100+"%,"+n.y*100+"%)")))}},mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())},mxCellEditor.prototype.getBackgroundColor=function(t){return null},mxCellEditor.prototype.isLegacyEditor=function(){if(mxClient.IS_VML)return!0;var t=!1;if(mxClient.IS_SVG){var e=this.graph.view.getDrawPane().ownerSVGElement;if(e!=null){var i=mxUtils.getCurrentStyle(e);i!=null&&(t=i.position=="absolute")}}return!t},mxCellEditor.prototype.startEditing=function(t,e){this.stopEditing(!0),this.align=null,this.textarea==null&&this.init(),this.graph.tooltipHandler!=null&&this.graph.tooltipHandler.hideTooltip();var i=this.graph.getView().getState(t);if(i!=null){this.graph.getView().scale;var n=mxUtils.getValue(i.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),r=mxUtils.getValue(i.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),s=mxUtils.getValue(i.style,mxConstants.STYLE_FONTCOLOR,"black"),l=mxUtils.getValue(i.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),a=(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,o=(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,u=[];(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&u.push("underline"),(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&u.push("line-through"),this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(n*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT,this.textarea.style.backgroundColor=this.getBackgroundColor(i),this.textarea.style.textDecoration=u.join(" "),this.textarea.style.fontWeight=a?"bold":"normal",this.textarea.style.fontStyle=o?"italic":"",this.textarea.style.fontSize=Math.round(n)+"px",this.textarea.style.zIndex=this.zIndex,this.textarea.style.fontFamily=r,this.textarea.style.textAlign=l,this.textarea.style.outline="none",this.textarea.style.color=s;var p=this.textDirection=mxUtils.getValue(i.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);p==mxConstants.TEXT_DIRECTION_AUTO&&i!=null&&i.text!=null&&i.text.dialect!=mxConstants.DIALECT_STRICTHTML&&!mxUtils.isNode(i.text.value)&&(p=i.text.getAutoDirection()),p==mxConstants.TEXT_DIRECTION_LTR||p==mxConstants.TEXT_DIRECTION_RTL?this.textarea.setAttribute("dir",p):this.textarea.removeAttribute("dir"),this.textarea.innerHTML=this.getInitialValue(i,e)||"",this.initialValue=this.textarea.innerHTML,this.textarea.innerHTML.length==0||this.textarea.innerHTML=="
"?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=!0):this.clearOnChange=this.textarea.innerHTML==this.getEmptyLabelText(),this.graph.container.appendChild(this.textarea),this.editingCell=t,this.trigger=e,this.textNode=null,i.text!=null&&this.isHideLabel(i)&&(this.textNode=i.text.node,this.textNode.style.visibility="hidden"),this.autoSize&&(this.graph.model.isEdge(i.cell)||i.style[mxConstants.STYLE_OVERFLOW]!="fill")&&window.setTimeout(mxUtils.bind(this,function(){this.resize()}),0),this.resize();try{this.textarea.focus(),this.isSelectText()&&this.textarea.innerHTML.length>0&&(this.textarea.innerHTML!=this.getEmptyLabelText()||!this.clearOnChange)&&document.execCommand("selectAll",!1,null)}catch{}}},mxCellEditor.prototype.isSelectText=function(){return this.selectText},mxCellEditor.prototype.clearSelection=function(){var t=null;window.getSelection?t=window.getSelection():document.selection&&(t=document.selection),t!=null&&(t.empty?t.empty():t.removeAllRanges&&t.removeAllRanges())},mxCellEditor.prototype.stopEditing=function(t){if(t=t||!1,this.editingCell!=null){this.textNode!=null&&(this.textNode.style.visibility="visible",this.textNode=null);var e=t?null:this.graph.view.getState(this.editingCell),i=this.initialValue;if(this.initialValue=null,this.editingCell=null,this.trigger=null,this.bounds=null,this.textarea.blur(),this.clearSelection(),this.textarea.parentNode!=null&&this.textarea.parentNode.removeChild(this.textarea),this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.textarea.innerHTML="",this.clearOnChange=!1),e!=null&&(this.textarea.innerHTML!=i||this.align!=null)){this.prepareTextarea();var n=this.getCurrentValue(e);this.graph.getModel().beginUpdate();try{n!=null&&this.applyValue(e,n),this.align!=null&&this.graph.setCellStyles(mxConstants.STYLE_ALIGN,this.align,[e.cell])}finally{this.graph.getModel().endUpdate()}}mxEvent.release(this.textarea),this.textarea=null,this.align=null}},mxCellEditor.prototype.prepareTextarea=function(){this.textarea.lastChild!=null&&this.textarea.lastChild.nodeName=="BR"&&this.textarea.removeChild(this.textarea.lastChild)},mxCellEditor.prototype.isHideLabel=function(t){return!0},mxCellEditor.prototype.getMinimumSize=function(t){var e=this.graph.getView().scale;return new mxRectangle(0,0,t.text==null?30:t.text.size*e+20,this.textarea.style.textAlign=="left"?120:40)},mxCellEditor.prototype.getEditorBounds=function(t){var e=this.graph.getModel().isEdge(t.cell),i=this.graph.getView().scale,n=this.getMinimumSize(t),r=n.width,s=n.height,l=null;if(!e&&t.view.graph.cellRenderer.legacySpacing&&t.style[mxConstants.STYLE_OVERFLOW]=="fill")l=t.shape.getLabelBounds(mxRectangle.fromRectangle(t));else{var a=parseInt(t.style[mxConstants.STYLE_SPACING]||0)*i,o=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*i+a,u=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*i+a,p=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*i+a,m=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*i+a;l=new mxRectangle(t.x,t.y,Math.max(r,t.width-m-u),Math.max(s,t.height-o-p));var d=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),x=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(l=t.shape!=null&&d==mxConstants.ALIGN_CENTER&&x==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(l):l,e?(l.x=t.absoluteOffset.x,l.y=t.absoluteOffset.y,t.text!=null&&t.text.boundingBox!=null&&(t.text.boundingBox.x>0&&(l.x=t.text.boundingBox.x),t.text.boundingBox.y>0&&(l.y=t.text.boundingBox.y))):t.text!=null&&t.text.boundingBox!=null&&(l.x=Math.min(l.x,t.text.boundingBox.x),l.y=Math.min(l.y,t.text.boundingBox.y)),l.x+=m,l.y+=o,t.text!=null&&t.text.boundingBox!=null&&(e?(l.width=Math.max(r,t.text.boundingBox.width),l.height=Math.max(s,t.text.boundingBox.height)):(l.width=Math.max(l.width,t.text.boundingBox.width),l.height=Math.max(l.height,t.text.boundingBox.height))),this.graph.getModel().isVertex(t.cell)){var f=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);f==mxConstants.ALIGN_LEFT?l.x-=t.width:f==mxConstants.ALIGN_RIGHT&&(l.x+=t.width);var g=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);g==mxConstants.ALIGN_TOP?l.y-=t.height:g==mxConstants.ALIGN_BOTTOM&&(l.y+=t.height)}}return new mxRectangle(Math.round(l.x),Math.round(l.y),Math.round(l.width),Math.round(l.height))},mxCellEditor.prototype.getEmptyLabelText=function(t){return this.emptyLabelText},mxCellEditor.prototype.getEditingCell=function(){return this.editingCell},mxCellEditor.prototype.destroy=function(){this.textarea!=null&&(mxEvent.release(this.textarea),this.textarea.parentNode!=null&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null),this.changeHandler!=null&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null),this.zoomHandler&&(this.graph.view.removeListener(this.zoomHandler),this.zoomHandler=null)},__mxOutput.mxCellEditor=typeof mxCellEditor<"u"?mxCellEditor:void 0;function mxCellRenderer(){}mxCellRenderer.defaultShapes=new Object,mxCellRenderer.prototype.defaultEdgeShape=mxConnector,mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape,mxCellRenderer.prototype.defaultTextShape=mxText,mxCellRenderer.prototype.legacyControlPosition=!0,mxCellRenderer.prototype.legacySpacing=!0,mxCellRenderer.prototype.antiAlias=!0,mxCellRenderer.prototype.minSvgStrokeWidth=1,mxCellRenderer.prototype.forceControlClickHandler=!1,mxCellRenderer.registerShape=function(t,e){mxCellRenderer.defaultShapes[t]=e},mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape),mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus),mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder),mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor),mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle),mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon),mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud),mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW_CONNECTOR,mxArrowConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane),mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape),mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel),mxCellRenderer.prototype.initializeShape=function(t){t.shape.dialect=t.view.graph.dialect,this.configureShape(t),t.shape.init(t.view.getDrawPane())},mxCellRenderer.prototype.createShape=function(t){var e=null;if(t.style!=null){var i=mxStencilRegistry.getStencil(t.style[mxConstants.STYLE_SHAPE]);if(i!=null)e=new mxShape(i);else{var n=this.getShapeConstructor(t);e=new n}}return e},mxCellRenderer.prototype.createIndicatorShape=function(t){t.shape.indicatorShape=this.getShape(t.view.graph.getIndicatorShape(t))},mxCellRenderer.prototype.getShape=function(t){return t!=null?mxCellRenderer.defaultShapes[t]:null},mxCellRenderer.prototype.getShapeConstructor=function(t){var e=this.getShape(t.style[mxConstants.STYLE_SHAPE]);return e==null&&(e=t.view.graph.getModel().isEdge(t.cell)?this.defaultEdgeShape:this.defaultVertexShape),e},mxCellRenderer.prototype.configureShape=function(t){t.shape.apply(t),t.shape.image=t.view.graph.getImage(t),t.shape.indicatorColor=t.view.graph.getIndicatorColor(t),t.shape.indicatorStrokeColor=t.style[mxConstants.STYLE_INDICATOR_STROKECOLOR],t.shape.indicatorGradientColor=t.view.graph.getIndicatorGradientColor(t),t.shape.indicatorDirection=t.style[mxConstants.STYLE_INDICATOR_DIRECTION],t.shape.indicatorImage=t.view.graph.getIndicatorImage(t),this.postConfigureShape(t)},mxCellRenderer.prototype.postConfigureShape=function(t){t.shape!=null&&(this.resolveColor(t,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(t,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(t,"gradient",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(t,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(t,"fill",mxConstants.STYLE_FILLCOLOR))},mxCellRenderer.prototype.checkPlaceholderStyles=function(t){if(t.style!=null){for(var e=["inherit","swimlane","indicated"],i=[mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.STYLE_FONTCOLOR],n=0;n=0)return!0}return!1},mxCellRenderer.prototype.resolveColor=function(t,e,i){var n=i==mxConstants.STYLE_FONTCOLOR?t.text:t.shape;if(n!=null){var r=t.view.graph,s=n[e],l=null;if(s=="inherit"?l=r.model.getParent(t.cell):s=="swimlane"?(n[e]=i==mxConstants.STYLE_STROKECOLOR||i==mxConstants.STYLE_FONTCOLOR?"#000000":"#ffffff",r.model.getTerminal(t.cell,!1)!=null?l=r.model.getTerminal(t.cell,!1):l=t.cell,l=r.getSwimlane(l),i=r.swimlaneIndicatorColorAttribute):s=="indicated"&&t.shape!=null?n[e]=t.shape.indicatorColor:i!=mxConstants.STYLE_FILLCOLOR&&s==mxConstants.STYLE_FILLCOLOR&&t.shape!=null?n[e]=t.style[mxConstants.STYLE_FILLCOLOR]:i!=mxConstants.STYLE_STROKECOLOR&&s==mxConstants.STYLE_STROKECOLOR&&t.shape!=null&&(n[e]=t.style[mxConstants.STYLE_STROKECOLOR]),l!=null){var a=r.getView().getState(l);if(n[e]=null,a!=null){var o=i==mxConstants.STYLE_FONTCOLOR?a.text:a.shape;o!=null&&e!="indicatorColor"?n[e]=o[e]:n[e]=a.style[i]}}}},mxCellRenderer.prototype.getLabelValue=function(t){return t.view.graph.getLabel(t.cell)},mxCellRenderer.prototype.createLabel=function(t,e){var i=t.view.graph;if(i.getModel().isEdge(t.cell),t.style[mxConstants.STYLE_FONTSIZE]>0||t.style[mxConstants.STYLE_FONTSIZE]==null){var n=i.isHtmlLabel(t.cell)||e!=null&&mxUtils.isNode(e);t.text=new this.defaultTextShape(e,new mxRectangle,t.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,i.getVerticalAlign(t),t.style[mxConstants.STYLE_FONTCOLOR],t.style[mxConstants.STYLE_FONTFAMILY],t.style[mxConstants.STYLE_FONTSIZE],t.style[mxConstants.STYLE_FONTSTYLE],t.style[mxConstants.STYLE_SPACING],t.style[mxConstants.STYLE_SPACING_TOP],t.style[mxConstants.STYLE_SPACING_RIGHT],t.style[mxConstants.STYLE_SPACING_BOTTOM],t.style[mxConstants.STYLE_SPACING_LEFT],t.style[mxConstants.STYLE_HORIZONTAL],t.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],t.style[mxConstants.STYLE_LABEL_BORDERCOLOR],i.isWrapping(t.cell)&&i.isHtmlLabel(t.cell),i.isLabelClipped(t.cell),t.style[mxConstants.STYLE_OVERFLOW],t.style[mxConstants.STYLE_LABEL_PADDING],mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)),t.text.opacity=mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_OPACITY,100),t.text.dialect=n?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect,t.text.style=t.style,t.text.state=t,this.initializeLabel(t,t.text);var r=!1,s=function(l){var a=t;if(mxClient.IS_TOUCH||r){var o=mxEvent.getClientX(l),u=mxEvent.getClientY(l),p=mxUtils.convertPoint(i.container,o,u);a=i.view.getState(i.getCellAt(p.x,p.y))}return a};mxEvent.addGestureListeners(t.text.node,mxUtils.bind(this,function(l){this.isLabelEvent(t,l)&&(i.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(l,t)),r=i.dialect!=mxConstants.DIALECT_SVG&&mxEvent.getSource(l).nodeName=="IMG")}),mxUtils.bind(this,function(l){this.isLabelEvent(t,l)&&i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(l,s(l)))}),mxUtils.bind(this,function(l){this.isLabelEvent(t,l)&&(i.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(l,s(l))),r=!1)})),i.nativeDblClickEnabled&&mxEvent.addListener(t.text.node,"dblclick",mxUtils.bind(this,function(l){this.isLabelEvent(t,l)&&(i.dblClick(l,t.cell),mxEvent.consume(l))}))}},mxCellRenderer.prototype.initializeLabel=function(t,e){mxClient.IS_SVG&&mxClient.NO_FO&&e.dialect!=mxConstants.DIALECT_SVG?e.init(t.view.graph.container):e.init(t.view.getDrawPane())},mxCellRenderer.prototype.createCellOverlays=function(t){var e=t.view.graph,i=e.getCellOverlays(t.cell),n=null;if(i!=null){n=new mxDictionary;for(var r=0;r0)?this.createLabel(t,n):t.text!=null&&(n==null||n.length==0)&&(t.text.destroy(),t.text=null),t.text!=null){e&&(t.text.lastValue!=null&&this.isTextShapeInvalid(t,t.text)&&(t.text.lastValue=null),t.text.resetStyles(),t.text.apply(t),t.text.valign=i.getVerticalAlign(t));var u=this.getLabelBounds(t),p=this.getTextScale(t);if(this.resolveColor(t,"color",mxConstants.STYLE_FONTCOLOR),e||t.text.value!=n||t.text.isWrapping!=r||t.text.overflow!=o||t.text.isClipping!=s||t.text.scale!=p||t.text.dialect!=a||t.text.bounds==null||!t.text.bounds.equals(u)){t.text.dialect=a,t.text.value=n,t.text.bounds=u,t.text.scale=p,t.text.wrap=r,t.text.clipped=s,t.text.overflow=o;var m=t.text.node.style.visibility;this.redrawLabelShape(t.text),t.text.node.style.visibility=m}}},mxCellRenderer.prototype.isTextShapeInvalid=function(t,e){function i(n,r,s){var l=!1;return r=="spacingTop"||r=="spacingRight"||r=="spacingBottom"||r=="spacingLeft"?l=parseFloat(e[n])-parseFloat(e.spacing)!=(t.style[r]||s):l=e[n]!=(t.style[r]||s),l}return i("fontStyle",mxConstants.STYLE_FONTSTYLE,mxConstants.DEFAULT_FONTSTYLE)||i("family",mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)||i("size",mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)||i("color",mxConstants.STYLE_FONTCOLOR,"black")||i("align",mxConstants.STYLE_ALIGN,"")||i("valign",mxConstants.STYLE_VERTICAL_ALIGN,"")||i("spacing",mxConstants.STYLE_SPACING,2)||i("spacingTop",mxConstants.STYLE_SPACING_TOP,0)||i("spacingRight",mxConstants.STYLE_SPACING_RIGHT,0)||i("spacingBottom",mxConstants.STYLE_SPACING_BOTTOM,0)||i("spacingLeft",mxConstants.STYLE_SPACING_LEFT,0)||i("horizontal",mxConstants.STYLE_HORIZONTAL,!0)||i("background",mxConstants.STYLE_LABEL_BACKGROUNDCOLOR)||i("border",mxConstants.STYLE_LABEL_BORDERCOLOR)||i("opacity",mxConstants.STYLE_TEXT_OPACITY,100)||i("textDirection",mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)},mxCellRenderer.prototype.redrawLabelShape=function(t){t.redraw()},mxCellRenderer.prototype.getTextScale=function(t){return t.view.scale},mxCellRenderer.prototype.getLabelBounds=function(t){var e=t.view.graph,i=t.view.scale,n=e.getModel().isEdge(t.cell),r=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y);if(n){var s=t.text.getSpacing();r.x+=s.x*i,r.y+=s.y*i;var l=e.getCellGeometry(t.cell);l!=null&&(r.width=Math.max(0,l.width*i),r.height=Math.max(0,l.height*i))}else{if(t.text.isPaintBoundsInverted()){var a=r.x;r.x=r.y,r.y=a}r.x+=t.x,r.y+=t.y,r.width=Math.max(1,t.width),r.height=Math.max(1,t.height)}if(t.text.isPaintBoundsInverted()){var o=(t.width-t.height)/2;r.x+=o,r.y-=o;var a=r.width;r.width=r.height,r.height=a}if(t.shape!=null){var u=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),p=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);u==mxConstants.ALIGN_CENTER&&p==mxConstants.ALIGN_MIDDLE&&(r=t.shape.getLabelBounds(r))}var m=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);return m!=null&&(r.width=parseFloat(m)*i),n||this.rotateLabelBounds(t,r),r},mxCellRenderer.prototype.rotateLabelBounds=function(t,e){if(e.y-=t.text.margin.y*e.height,e.x-=t.text.margin.x*e.width,!this.legacySpacing||t.style[mxConstants.STYLE_OVERFLOW]!="fill"&&t.style[mxConstants.STYLE_OVERFLOW]!="width"){var i=t.view.scale,n=t.text.getSpacing();e.x+=n.x*i,e.y+=n.y*i;var r=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),s=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),l=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);e.width=Math.max(0,e.width-(r==mxConstants.ALIGN_CENTER&&l==null?t.text.spacingLeft*i+t.text.spacingRight*i:0)),e.height=Math.max(0,e.height-(s==mxConstants.ALIGN_MIDDLE?t.text.spacingTop*i+t.text.spacingBottom*i:0))}var a=t.text.getTextRotation();if(a!=0&&t!=null&&t.view.graph.model.isVertex(t.cell)){var o=t.getCenterX(),u=t.getCenterY();if(e.x!=o||e.y!=u){var p=a*(Math.PI/180),m=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(p),Math.sin(p),new mxPoint(o,u));e.x=m.x,e.y=m.y}}},mxCellRenderer.prototype.redrawCellOverlays=function(t,e){if(this.createCellOverlays(t),t.overlays!=null){var i=mxUtils.mod(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),90),n=mxUtils.toRadians(i),r=Math.cos(n),s=Math.sin(n);t.overlays.visit(function(l,a){var o=a.overlay.getBounds(t);if(!t.view.graph.getModel().isEdge(t.cell)&&t.shape!=null&&i!=0){var u=o.getCenterX(),p=o.getCenterY(),m=mxUtils.getRotatedPoint(new mxPoint(u,p),r,s,new mxPoint(t.getCenterX(),t.getCenterY()));u=m.x,p=m.y,o.x=Math.round(u-o.width/2),o.y=Math.round(p-o.height/2)}(e||a.bounds==null||a.scale!=t.view.scale||!a.bounds.equals(o))&&(a.bounds=o,a.scale=t.view.scale,a.redraw())})}},mxCellRenderer.prototype.redrawControl=function(t,e){var i=t.view.graph.getFoldingImage(t);if(t.control!=null&&i!=null){var n=this.getControlBounds(t,i.width,i.height),r=this.legacyControlPosition?mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0):t.shape.getTextRotation(),s=t.view.scale;(e||t.control.scale!=s||!t.control.bounds.equals(n)||t.control.rotation!=r)&&(t.control.rotation=r,t.control.bounds=n,t.control.scale=s,t.control.redraw())}},mxCellRenderer.prototype.getControlBounds=function(t,e,i){if(t.control!=null){var n=t.view.scale,r=t.getCenterX(),s=t.getCenterY();if(!t.view.graph.getModel().isEdge(t.cell)&&(r=t.x+e*n,s=t.y+i*n,t.shape!=null)){var l=t.shape.getShapeRotation();if(this.legacyControlPosition)l=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0);else if(t.shape.isPaintBoundsInverted()){var a=(t.width-t.height)/2;r+=a,s-=a}if(l!=0){var o=mxUtils.toRadians(l),u=Math.cos(o),p=Math.sin(o),m=mxUtils.getRotatedPoint(new mxPoint(r,s),u,p,new mxPoint(t.getCenterX(),t.getCenterY()));r=m.x,s=m.y}}return t.view.graph.getModel().isEdge(t.cell)?new mxRectangle(Math.round(r-e/2*n),Math.round(s-i/2*n),Math.round(e*n),Math.round(i*n)):new mxRectangle(Math.round(r-e/2*n),Math.round(s-i/2*n),Math.round(e*n),Math.round(i*n))}return null},mxCellRenderer.prototype.insertStateAfter=function(t,e,i){for(var n=this.getShapesForState(t),r=0;r0)for(var o=0;o0?n[0]:null;u!=null&&(u=p.transformControlPoint(t,u),mxUtils.contains(e,u.x,u.y)&&(u=null));var d=0,x=0,f=0,g=0,c=mxUtils.getValue(t.style,mxConstants.STYLE_SEGMENT,m.gridSize)*p.scale,v=mxUtils.getValue(t.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST);v==mxConstants.DIRECTION_NORTH||v==mxConstants.DIRECTION_SOUTH?(d=p.getRoutingCenterX(e),x=c):(f=p.getRoutingCenterY(e),g=c),u==null||u.xe.x+e.width?u!=null?(d=u.x,g=Math.max(Math.abs(f-u.y),g)):v==mxConstants.DIRECTION_NORTH?f=e.y-2*x:v==mxConstants.DIRECTION_SOUTH?f=e.y+e.height+2*x:v==mxConstants.DIRECTION_EAST?d=e.x-2*g:d=e.x+e.width+2*g:u!=null&&(d=p.getRoutingCenterX(e),x=Math.max(Math.abs(d-u.x),g),f=u.y,g=0),r.push(new mxPoint(d-x,f-g)),r.push(new mxPoint(d+x,f+g))}},ElbowConnector:function(t,e,i,n,r){var s=n!=null&&n.length>0?n[0]:null,l=!1,a=!1;if(e!=null&&i!=null)if(s!=null){var o=Math.min(e.x,i.x),u=Math.max(e.x+e.width,i.x+i.width),p=Math.min(e.y,i.y),m=Math.max(e.y+e.height,i.y+i.height);s=t.view.transformControlPoint(t,s),l=s.ym,a=s.xu}else{var o=Math.max(e.x,i.x),u=Math.min(e.x+e.width,i.x+i.width);if(l=o==u,!l){var p=Math.max(e.y,i.y),m=Math.min(e.y+e.height,i.y+i.height);a=p==m}}!a&&(l||t.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL)?mxEdgeStyle.TopToBottom(t,e,i,n,r):mxEdgeStyle.SideToSide(t,e,i,n,r)},SideToSide:function(t,e,i,n,r){var s=t.view,l=n!=null&&n.length>0?n[0]:null,a=t.absolutePoints,o=a[0],u=a[a.length-1];if(l!=null&&(l=s.transformControlPoint(t,l)),o!=null&&(e=new mxCellState,e.x=o.x,e.y=o.y),u!=null&&(i=new mxCellState,i.x=u.x,i.y=u.y),e!=null&&i!=null){var p=Math.max(e.x,i.x),m=Math.min(e.x+e.width,i.x+i.width),d=l!=null?l.x:Math.round(m+(p-m)/2),x=s.getRoutingCenterY(e),f=s.getRoutingCenterY(i);if(l!=null&&(l.y>=e.y&&l.y<=e.y+e.height&&(x=l.y),l.y>=i.y&&l.y<=i.y+i.height&&(f=l.y)),!mxUtils.contains(i,d,x)&&!mxUtils.contains(e,d,x)&&r.push(new mxPoint(d,x)),!mxUtils.contains(i,d,f)&&!mxUtils.contains(e,d,f)&&r.push(new mxPoint(d,f)),r.length==1)if(l!=null)!mxUtils.contains(i,d,l.y)&&!mxUtils.contains(e,d,l.y)&&r.push(new mxPoint(d,l.y));else{var g=Math.max(e.y,i.y),c=Math.min(e.y+e.height,i.y+i.height);r.push(new mxPoint(d,g+(c-g)/2))}}},TopToBottom:function(t,e,i,n,r){var s=t.view,l=n!=null&&n.length>0?n[0]:null,a=t.absolutePoints,o=a[0],u=a[a.length-1];if(l!=null&&(l=s.transformControlPoint(t,l)),o!=null&&(e=new mxCellState,e.x=o.x,e.y=o.y),u!=null&&(i=new mxCellState,i.x=u.x,i.y=u.y),e!=null&&i!=null){var p=Math.max(e.y,i.y),m=Math.min(e.y+e.height,i.y+i.height),d=s.getRoutingCenterX(e);l!=null&&l.x>=e.x&&l.x<=e.x+e.width&&(d=l.x);var x=l!=null?l.y:Math.round(m+(p-m)/2);if(!mxUtils.contains(i,d,x)&&!mxUtils.contains(e,d,x)&&r.push(new mxPoint(d,x)),l!=null&&l.x>=i.x&&l.x<=i.x+i.width?d=l.x:d=s.getRoutingCenterX(i),!mxUtils.contains(i,d,x)&&!mxUtils.contains(e,d,x)&&r.push(new mxPoint(d,x)),r.length==1)if(l!=null&&r.length==1)!mxUtils.contains(i,l.x,x)&&!mxUtils.contains(e,l.x,x)&&r.push(new mxPoint(l.x,x));else{var f=Math.max(e.x,i.x),g=Math.min(e.x+e.width,i.x+i.width);r.push(new mxPoint(f+(g-f)/2,x))}}},SegmentConnector:function(t,e,i,n,r){var s=mxEdgeStyle.scalePointArray(t.absolutePoints,t.view.scale),l=mxEdgeStyle.scaleCellState(e,t.view.scale),a=mxEdgeStyle.scaleCellState(i,t.view.scale),o=1,u=r.length>0?r[0]:null,p=!0,m=null;function d(R){return R.x=Math.round(R.x*t.view.scale*10)/10,R.y=Math.round(R.y*t.view.scale*10)/10,(u==null||Math.abs(u.x-R.x)>=o||Math.abs(u.y-R.y)>=Math.max(1,t.view.scale))&&(r.push(R),u=R),u}var x=s[0];x==null&&l!=null?x=new mxPoint(t.view.getRoutingCenterX(l),t.view.getRoutingCenterY(l)):x!=null&&(x=x.clone());var f=s.length-1;if(n!=null&&n.length>0){for(var g=[],c=0;c=T.y&&L.y<=T.y+T.height,P=T!=null&&L.x>=T.x&&L.x<=T.x+T.width;if(S=M||C==null&&I,E=A||C==null&&P,!(c==0&&(S&&E||A&&M))){if(C!=null&&!M&&!A&&(I||P)){p=!I;break}if(E||S){p=S,c==1&&(p=g.length%2==0?S:E);break}}T=a,C=s[f],C!=null&&(T=null),L=g[g.length-1],A&&M&&(g=g.slice(1))}p&&(s[0]!=null&&s[0].y!=m.y||s[0]==null&&l!=null&&(m.yl.y+l.height))?d(new mxPoint(x.x,m.y)):!p&&(s[0]!=null&&s[0].x!=m.x||s[0]==null&&l!=null&&(m.xl.x+l.width))&&d(new mxPoint(m.x,x.y)),p?x.y=m.y:x.x=m.x;for(var c=0;ca.y+a.height))?d(new mxPoint(x.x,m.y)):!p&&(s[f]!=null&&s[f].x!=m.x||s[f]==null&&a!=null&&(m.xa.x+a.width))&&d(new mxPoint(m.x,x.y))),s[0]==null&&l!=null)for(;r.length>1&&r[1]!=null&&mxUtils.contains(l,r[1].x,r[1].y);)r.splice(1,1);if(s[f]==null&&a!=null)for(;r.length>1&&r[r.length-1]!=null&&mxUtils.contains(a,r[r.length-1].x,r[r.length-1].y);)r.splice(r.length-1,1);y!=null&&r[r.length-1]!=null&&Math.abs(y.x-r[r.length-1].x)<=o&&Math.abs(y.y-r[r.length-1].y)<=o&&(r.splice(r.length-1,1),r[r.length-1]!=null&&(Math.abs(r[r.length-1].x-y.x)0||l||a){mxEdgeStyle.SegmentConnector(t,e,i,n,r);return}var M=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL],I=0;if(u!=null&&(M[0]=mxUtils.getPortConstraints(u,t,!0,mxConstants.DIRECTION_MASK_ALL),I=mxUtils.getValue(u.style,mxConstants.STYLE_ROTATION,0),I!=0)){var P=mxUtils.getBoundingBox(new mxRectangle(x,f,g,c),I);x=P.x,f=P.y,g=P.width,c=P.height}if(p!=null&&(M[1]=mxUtils.getPortConstraints(p,t,!1,mxConstants.DIRECTION_MASK_ALL),I=mxUtils.getValue(p.style,mxConstants.STYLE_ROTATION,0),I!=0)){var P=mxUtils.getBoundingBox(new mxRectangle(v,y,T,C),I);v=P.x,y=P.y,T=P.width,C=P.height}for(var R=[0,0],O=[[x,f,g,c],[v,y,T,C]],_=[S,E],b=0;b<2;b++)mxEdgeStyle.limits[b][1]=O[b][0]-_[b],mxEdgeStyle.limits[b][2]=O[b][1]-_[b],mxEdgeStyle.limits[b][4]=O[b][0]+O[b][2]+_[b],mxEdgeStyle.limits[b][8]=O[b][1]+O[b][3]+_[b];var k=O[0][0]+O[0][2]/2,G=O[0][1]+O[0][3]/2,B=O[1][0]+O[1][2]/2,j=O[1][1]+O[1][3]/2,H=k-B,W=G-j,X=0;H<0?W<0?X=2:X=1:W<=0&&(X=3,H==0&&(X=2));var V=null;u!=null&&(V=m);for(var Y=[[.5,.5],[.5,.5]],b=0;b<2;b++)V!=null&&(Y[b][0]=(V.x-O[b][0])/O[b][2],Math.abs(V.x-O[b][0])<=1?R[b]=mxConstants.DIRECTION_MASK_WEST:Math.abs(V.x-O[b][0]-O[b][2])<=1&&(R[b]=mxConstants.DIRECTION_MASK_EAST),Y[b][1]=(V.y-O[b][1])/O[b][3],Math.abs(V.y-O[b][1])<=1?R[b]=mxConstants.DIRECTION_MASK_NORTH:Math.abs(V.y-O[b][1]-O[b][3])<=1&&(R[b]=mxConstants.DIRECTION_MASK_SOUTH)),V=null,p!=null&&(V=d);var et=O[0][1]-(O[1][1]+O[1][3]),q=O[0][0]-(O[1][0]+O[1][2]),K=O[1][1]-(O[0][1]+O[0][3]),Z=O[1][0]-(O[0][0]+O[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(q-L,0),mxEdgeStyle.vertexSeperations[2]=Math.max(et-L,0),mxEdgeStyle.vertexSeperations[4]=Math.max(K-L,0),mxEdgeStyle.vertexSeperations[3]=Math.max(Z-L,0);var N=[],D=[],F=[];D[0]=q>=Z?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST,F[0]=et>=K?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH,D[1]=mxUtils.reversePortConstraints(D[0]),F[1]=mxUtils.reversePortConstraints(F[0]);for(var st=q>=Z?q:Z,J=et>=K?et:K,U=[[0,0],[0,0]],$=!1,b=0;b<2;b++)R[b]==0&&(D[b]&M[b]||(D[b]=mxUtils.reversePortConstraints(D[b])),F[b]&M[b]||(F[b]=mxUtils.reversePortConstraints(F[b])),U[b][0]=F[b],U[b][1]=D[b]);J>0&&st>0&&((D[0]&M[0])>0&&(F[1]&M[1])>0?(U[0][0]=D[0],U[0][1]=F[0],U[1][0]=F[1],U[1][1]=D[1],$=!0):(F[0]&M[0])>0&&(D[1]&M[1])>0&&(U[0][0]=F[0],U[0][1]=D[0],U[1][0]=D[1],U[1][1]=F[1],$=!0)),J>0&&!$&&(U[0][0]=F[0],U[0][1]=D[0],U[1][0]=F[1],U[1][1]=D[1],$=!0),st>0&&!$&&(U[0][0]=D[0],U[0][1]=F[0],U[1][0]=D[1],U[1][1]=F[1],$=!0);for(var b=0;b<2;b++)R[b]==0&&(U[b][0]&M[b]||(U[b][0]=U[b][1]),N[b]=U[b][0]&M[b],N[b]|=(U[b][1]&M[b])<<8,N[b]|=(U[1-b][b]&M[b])<<16,N[b]|=(U[1-b][1-b]&M[b])<<24,N[b]&15||(N[b]=N[b]<<8),N[b]&3840||(N[b]=N[b]&15|N[b]>>8),N[b]&983040||(N[b]=N[b]&65535|(N[b]&251658240)>>8),R[b]=N[b]&15,(M[b]==mxConstants.DIRECTION_MASK_WEST||M[b]==mxConstants.DIRECTION_MASK_NORTH||M[b]==mxConstants.DIRECTION_MASK_EAST||M[b]==mxConstants.DIRECTION_MASK_SOUTH)&&(R[b]=M[b]));var rt=R[0]==mxConstants.DIRECTION_MASK_EAST?3:R[0],tt=R[1]==mxConstants.DIRECTION_MASK_EAST?3:R[1];rt-=X,tt-=X,rt<1&&(rt+=4),tt<1&&(tt+=4);var Q=mxEdgeStyle.routePatterns[rt-1][tt-1];switch(mxEdgeStyle.wayPoints1[0][0]=O[0][0],mxEdgeStyle.wayPoints1[0][1]=O[0][1],R[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=S,mxEdgeStyle.wayPoints1[0][1]+=Y[0][1]*O[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=Y[0][0]*O[0][2],mxEdgeStyle.wayPoints1[0][1]+=O[0][3]+S;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=O[0][2]+S,mxEdgeStyle.wayPoints1[0][1]+=Y[0][1]*O[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=Y[0][0]*O[0][2],mxEdgeStyle.wayPoints1[0][1]-=S;break}for(var z=0,ut=(R[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1,mt=ut,it=0,b=0;b4&&(lt-=4);var ht=mxEdgeStyle.dirVectors[lt-1];it=lt%2>0?0:1,it!=ut&&(z++,mxEdgeStyle.wayPoints1[z][0]=mxEdgeStyle.wayPoints1[z-1][0],mxEdgeStyle.wayPoints1[z][1]=mxEdgeStyle.wayPoints1[z-1][1]);var vt=(Q[b]&mxEdgeStyle.TARGET_MASK)>0,ft=(Q[b]&mxEdgeStyle.SOURCE_MASK)>0,at=(Q[b]&mxEdgeStyle.SIDE_MASK)>>5;at=at<15&&(at=at>>4);var dt=(Q[b]&mxEdgeStyle.CENTER_MASK)>0;if((ft||vt)&&at<9){var pt=0,ot=ft?0:1;if(dt&&it==0?pt=O[ot][0]+Y[ot][0]*O[ot][2]:dt?pt=O[ot][1]+Y[ot][1]*O[ot][3]:pt=mxEdgeStyle.limits[ot][at],it==0){var yt=mxEdgeStyle.wayPoints1[z][0],gt=(pt-yt)*ht[0];gt>0&&(mxEdgeStyle.wayPoints1[z][0]+=ht[0]*gt)}else{var Ct=mxEdgeStyle.wayPoints1[z][1],ct=(pt-Ct)*ht[1];ct>0&&(mxEdgeStyle.wayPoints1[z][1]+=ht[1]*ct)}}else dt&&(mxEdgeStyle.wayPoints1[z][0]+=ht[0]*Math.abs(mxEdgeStyle.vertexSeperations[lt]/2),mxEdgeStyle.wayPoints1[z][1]+=ht[1]*Math.abs(mxEdgeStyle.vertexSeperations[lt]/2));z>0&&mxEdgeStyle.wayPoints1[z][it]==mxEdgeStyle.wayPoints1[z-1][it]?z--:ut=it}for(var b=0;b<=z;b++){if(b==z){var Et=(R[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1,St=Et==mt?0:1;if(St!=(z+1)%2)break}r.push(new mxPoint(Math.round(mxEdgeStyle.wayPoints1[b][0]*t.view.scale*10)/10,Math.round(mxEdgeStyle.wayPoints1[b][1]*t.view.scale*10)/10))}for(var nt=1;nt0){for(var i=this.graph.getModel(),n=0;n0||l.height>0){r=new mxPoint(e.x,e.y);var a=!1,o=!1;this.graph.model.isVertex(t.cell)&&(a=mxUtils.getValue(t.style,mxConstants.STYLE_FLIPH,0)==1,o=mxUtils.getValue(t.style,mxConstants.STYLE_FLIPV,0)==1,t.shape!=null&&t.shape.stencil!=null&&(a=mxUtils.getValue(t.style,"stencilFlipH",0)==1||a,o=mxUtils.getValue(t.style,"stencilFlipV",0)==1||o),a&&(r.x=2*l.getCenterX()-r.x),o&&(r.y=2*l.getCenterY()-r.y)),r=s(l,t,r,i),r!=null&&(a&&(r.x=2*l.getCenterX()-r.x),o&&(r.y=2*l.getCenterY()-r.y))}}r==null&&(r=this.getPoint(t))}return r},mxGraphView.prototype.getRoutingCenterX=function(t){var e=t.style!=null&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_X])||0;return t.getCenterX()+e*t.width},mxGraphView.prototype.getRoutingCenterY=function(t){var e=t.style!=null&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0;return t.getCenterY()+e*t.height},mxGraphView.prototype.getPerimeterBounds=function(t,e){return e=e??0,t!=null&&(e+=parseFloat(t.style[mxConstants.STYLE_PERIMETER_SPACING]||0)),t.getPerimeterBounds(e*this.scale)},mxGraphView.prototype.getPerimeterFunction=function(t){var e=t.style[mxConstants.STYLE_PERIMETER];if(typeof e=="string"){var i=mxStyleRegistry.getValue(e);i==null&&this.isAllowEval()&&(i=mxUtils.eval(e)),e=i}return typeof e=="function"?e:null},mxGraphView.prototype.getNextPoint=function(t,e,i){var n=t.absolutePoints,r=null;if(n!=null&&n.length>=2){var s=n.length;r=n[i?Math.min(1,s-1):Math.max(0,s-2)]}return r==null&&e!=null&&(r=new mxPoint(e.getCenterX(),e.getCenterY())),r},mxGraphView.prototype.getVisibleTerminal=function(t,e){for(var i=this.graph.getModel(),n=i.getTerminal(t,e),r=n;n!=null&&n!=this.currentRoot;)(!this.graph.isCellVisible(r)||this.isCellCollapsed(n))&&(r=n),n=i.getParent(n);return r!=null&&(!i.contains(r)||i.getParent(r)==i.getRoot()||r==this.currentRoot)&&(r=null),r},mxGraphView.prototype.updateEdgeBounds=function(t){var e=t.absolutePoints,i=e[0],n=e[e.length-1];if(i.x!=n.x||i.y!=n.y){var r=n.x-i.x,s=n.y-i.y;t.terminalDistance=Math.sqrt(r*r+s*s)}else t.terminalDistance=0;var l=0,a=[],o=i;if(o!=null){for(var u=o.x,p=o.y,m=u,d=p,x=1;x=Math.round(o+a)&&u1){for(var l=t.length,a=t.segments,o=t.absolutePoints[0],u=t.absolutePoints[1],p=mxUtils.ptSegDistSq(o.x,o.y,u.x,u.y,e,i),m=0,d=0,x=0,f=2;fc&&(P=c);var R=Math.sqrt(mxUtils.ptSegDistSq(o.x,o.y,u.x,u.y,e,i)),O=mxUtils.relativeCcw(o.x,o.y,u.x,u.y,e,i);return O==-1&&(R=-R),new mxPoint((l/2-x-P)/l*-2,R/this.scale)}}return new mxPoint},mxGraphView.prototype.updateEdgeLabelOffset=function(t){var e=t.absolutePoints;if(t.absoluteOffset.x=t.getCenterX(),t.absoluteOffset.y=t.getCenterY(),e!=null&&e.length>0&&t.segments!=null){var i=this.graph.getCellGeometry(t.cell);if(i.relative){var n=this.getPoint(t,i);n!=null&&(t.absoluteOffset=n)}else{var r=e[0],s=e[e.length-1];if(r!=null&&s!=null){var l=s.x-r.x,a=s.y-r.y,o=0,u=0,p=i.offset;p!=null&&(o=p.x,u=p.y);var m=r.x+l/2+o*this.scale,d=r.y+a/2+u*this.scale;t.absoluteOffset.x=m,t.absoluteOffset.y=d}}}},mxGraphView.prototype.getState=function(t,e){e=e||!1;var i=null;return t!=null&&(i=this.states.get(t),e&&(i==null||this.updateStyle)&&this.graph.isCellVisible(t)&&(i==null?(i=this.createState(t),this.states.put(t,i)):i.style=this.graph.getCellStyle(t))),i},mxGraphView.prototype.isRendering=function(){return this.rendering},mxGraphView.prototype.setRendering=function(t){this.rendering=t},mxGraphView.prototype.isAllowEval=function(){return this.allowEval},mxGraphView.prototype.setAllowEval=function(t){this.allowEval=t},mxGraphView.prototype.getStates=function(){return this.states},mxGraphView.prototype.setStates=function(t){this.states=t},mxGraphView.prototype.getCellStates=function(t){if(t==null)return this.states;for(var e=[],i=0;ir&&i.x>r+2&&i.x<=n)return!0;var s=this.graph.container.offsetHeight,l=this.graph.container.clientHeight;return s>l&&i.y>l+2&&i.y<=s},mxGraphView.prototype.init=function(){this.installListeners();var t=this.graph;t.dialect==mxConstants.DIALECT_SVG?this.createSvg():t.dialect==mxConstants.DIALECT_VML?this.createVml():this.createHtml()},mxGraphView.prototype.installListeners=function(){var t=this.graph,e=t.container;if(e!=null){mxClient.IS_TOUCH&&(mxEvent.addListener(e,"gesturestart",mxUtils.bind(this,function(r){t.fireGestureEvent(r),mxEvent.consume(r)})),mxEvent.addListener(e,"gesturechange",mxUtils.bind(this,function(r){t.fireGestureEvent(r),mxEvent.consume(r)})),mxEvent.addListener(e,"gestureend",mxUtils.bind(this,function(r){t.fireGestureEvent(r),mxEvent.consume(r)})));var i=null;mxEvent.addGestureListeners(e,mxUtils.bind(this,function(r){this.isContainerEvent(r)&&(!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_GC&&!mxClient.IS_OP&&!mxClient.IS_SF||!this.isScrollEvent(r))&&(t.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(r)),i=r.pointerId)}),mxUtils.bind(this,function(r){this.isContainerEvent(r)&&(i==null||r.pointerId==i)&&t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(r))}),mxUtils.bind(this,function(r){this.isContainerEvent(r)&&t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(r)),i=null})),mxEvent.addListener(e,"dblclick",mxUtils.bind(this,function(r){this.isContainerEvent(r)&&t.dblClick(r)}));var n=function(r){var s=null;if(mxClient.IS_TOUCH){var l=mxEvent.getClientX(r),a=mxEvent.getClientY(r),o=mxUtils.convertPoint(e,l,a);s=t.view.getState(t.getCellAt(o.x,o.y))}return s};t.addMouseListener({mouseDown:function(r,s){t.popupMenuHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,function(r){t.tooltipHandler!=null&&t.tooltipHandler.isHideOnHover()&&t.tooltipHandler.hide(),this.captureDocumentGesture&&t.isMouseDown&&t.container!=null&&!this.isContainerEvent(r)&&t.container.style.display!="none"&&t.container.style.visibility!="hidden"&&!mxEvent.isConsumed(r)&&t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(r,n(r)))}),this.endHandler=mxUtils.bind(this,function(r){this.captureDocumentGesture&&t.isMouseDown&&t.container!=null&&!this.isContainerEvent(r)&&t.container.style.display!="none"&&t.container.style.visibility!="hidden"&&t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(r))}),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler)}},mxGraphView.prototype.createHtml=function(){var t=this.graph.container;if(t!=null&&(this.canvas=this.createHtmlPane("100%","100%"),this.canvas.style.overflow="hidden",this.backgroundPane=this.createHtmlPane("1px","1px"),this.drawPane=this.createHtmlPane("1px","1px"),this.overlayPane=this.createHtmlPane("1px","1px"),this.decoratorPane=this.createHtmlPane("1px","1px"),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),this.canvas.appendChild(this.decoratorPane),t.appendChild(this.canvas),this.updateContainerStyle(t),mxClient.IS_QUIRKS)){var e=mxUtils.bind(this,function(i){var n=this.getGraphBounds(),r=n.x+n.width+this.graph.border,s=n.y+n.height+this.graph.border;this.updateHtmlCanvasSize(r,s)});mxEvent.addListener(window,"resize",e)}},mxGraphView.prototype.updateHtmlCanvasSize=function(t,e){if(this.graph.container!=null){var i=this.graph.container.offsetWidth,n=this.graph.container.offsetHeight;i")},mxGraph.prototype.createHandlers=function(){this.tooltipHandler=this.createTooltipHandler(),this.tooltipHandler.setEnabled(!1),this.selectionCellsHandler=this.createSelectionCellsHandler(),this.connectionHandler=this.createConnectionHandler(),this.connectionHandler.setEnabled(!1),this.graphHandler=this.createGraphHandler(),this.panningHandler=this.createPanningHandler(),this.panningHandler.panningEnabled=!1,this.popupMenuHandler=this.createPopupMenuHandler()},mxGraph.prototype.createTooltipHandler=function(){return new mxTooltipHandler(this)},mxGraph.prototype.createSelectionCellsHandler=function(){return new mxSelectionCellsHandler(this)},mxGraph.prototype.createConnectionHandler=function(){return new mxConnectionHandler(this)},mxGraph.prototype.createGraphHandler=function(){return new mxGraphHandler(this)},mxGraph.prototype.createPanningHandler=function(){return new mxPanningHandler(this)},mxGraph.prototype.createPopupMenuHandler=function(){return new mxPopupMenuHandler(this)},mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)},mxGraph.prototype.createStylesheet=function(){return new mxStylesheet},mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)},mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer},mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)},mxGraph.prototype.getModel=function(){return this.model},mxGraph.prototype.getView=function(){return this.view},mxGraph.prototype.getStylesheet=function(){return this.stylesheet},mxGraph.prototype.setStylesheet=function(t){this.stylesheet=t},mxGraph.prototype.getSelectionModel=function(){return this.selectionModel},mxGraph.prototype.setSelectionModel=function(t){this.selectionModel=t},mxGraph.prototype.getSelectionCellsForChanges=function(t,e){for(var i=new mxDictionary,n=[],r=mxUtils.bind(this,function(o){if(!i.get(o)&&this.model.contains(o))if(this.model.isEdge(o)||this.model.isVertex(o))i.put(o,!0),n.push(o);else for(var u=this.model.getChildCount(o),p=0;p=0){t.overlays.splice(i,1),t.overlays.length==0&&(t.overlays=null);var n=this.view.getState(t);n!=null&&this.cellRenderer.redraw(n),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",t,"overlay",e))}else e=null}return e},mxGraph.prototype.removeCellOverlays=function(t){var e=t.overlays;if(e!=null){t.overlays=null;var i=this.view.getState(t);i!=null&&this.cellRenderer.redraw(i);for(var n=0;n0){i=i??this.warningImage;var r=new mxCellOverlay(i,""+e+"");return n&&r.addListener(mxEvent.CLICK,mxUtils.bind(this,function(s,l){this.isEnabled()&&this.setSelectionCell(t)})),this.addCellOverlay(t,r)}else this.removeCellOverlays(t);return null},mxGraph.prototype.startEditing=function(t){this.startEditingAtCell(null,t)},mxGraph.prototype.startEditingAtCell=function(t,e){(e==null||!mxEvent.isMultiTouchEvent(e))&&(t==null&&(t=this.getSelectionCell(),t!=null&&!this.isCellEditable(t)&&(t=null)),t!=null&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",t,"event",e)),this.cellEditor.startEditing(t,e),this.fireEvent(new mxEventObject(mxEvent.EDITING_STARTED,"cell",t,"event",e))))},mxGraph.prototype.getEditingValue=function(t,e){return this.convertValueToString(t)},mxGraph.prototype.stopEditing=function(t){this.cellEditor.stopEditing(t),this.fireEvent(new mxEventObject(mxEvent.EDITING_STOPPED,"cancel",t))},mxGraph.prototype.labelChanged=function(t,e,i){this.model.beginUpdate();try{var n=t.value;this.cellLabelChanged(t,e,this.isAutoSizeCell(t)),this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",t,"value",e,"old",n,"event",i))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellLabelChanged=function(t,e,i){this.model.beginUpdate();try{this.model.setValue(t,e),i&&this.cellSizeUpdated(t,!1)}finally{this.model.endUpdate()}},mxGraph.prototype.escape=function(t){this.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",t))},mxGraph.prototype.click=function(t){var e=t.getEvent(),i=t.getCell(),n=new mxEventObject(mxEvent.CLICK,"event",e,"cell",i);if(t.isConsumed()&&n.consume(),this.fireEvent(n),this.isEnabled()&&!mxEvent.isConsumed(e)&&!n.isConsumed()){if(i!=null){if(this.isTransparentClickEvent(e)){var r=!1,s=this.getCellAt(t.graphX,t.graphY,null,null,null,mxUtils.bind(this,function(p){var m=this.isCellSelected(p.cell);return r=r||m,!r||m||p.cell!=i&&this.model.isAncestor(p.cell,i)}));s!=null&&(i=s)}}else if(this.isSwimlaneSelectionEnabled()&&(i=this.getSwimlaneAt(t.getGraphX(),t.getGraphY()),i!=null&&(!this.isToggleEvent(e)||!mxEvent.isAltDown(e)))){for(var l=i,a=[];l!=null;){l=this.model.getParent(l);var o=this.view.getState(l);this.isSwimlane(l)&&o!=null&&a.push(l)}if(a.length>0){a=a.reverse(),a.splice(0,0,i),a.push(i);for(var u=0;u=r.scrollLeft&&e>=r.scrollTop&&t<=r.scrollLeft+r.clientWidth&&e<=r.scrollTop+r.clientHeight){var s=r.scrollLeft+r.clientWidth-t;if(s0&&p.height>0){e&&p.x!=null&&p.y!=null&&(p=p.clone(),p.width+=p.x,p.height+=p.y,p.x=0,p.y=0);var m=this.view.scale,d=p.width/m,x=p.height/m;this.backgroundImage!=null&&(d=Math.max(d,this.backgroundImage.width-p.x/m),x=Math.max(x,this.backgroundImage.height-p.y/m));var f=(e?t:2*t)+i+1;o-=f,u-=f;var g=r?u/x:s?o/d:Math.min(o/d,u/x);if(this.minFitScale!=null&&(g=Math.max(g,this.minFitScale)),this.maxFitScale!=null&&(g=Math.min(g,this.maxFitScale)),n)if(e)this.view.scale!=g&&this.view.setScale(g);else if(mxUtils.hasScrollbars(this.container)){this.view.setScale(g);var y=this.getGraphBounds();y.x!=null&&(this.container.scrollLeft=y.x),y.y!=null&&(this.container.scrollTop=y.y)}else{var c=p.x!=null?Math.floor(this.view.translate.x-p.x/m+t/g+i/2):t,v=p.y!=null?Math.floor(this.view.translate.y-p.y/m+t/g+i/2):t;this.view.scaleAndTranslate(g,c,v)}else return g}}return this.view.scale},mxGraph.prototype.sizeDidChange=function(){var t=this.getGraphBounds();if(this.container!=null){var e=this.getBorder(),i=Math.max(0,t.x)+t.width+2*e,n=Math.max(0,t.y)+t.height+2*e;if(this.minimumContainerSize!=null&&(i=Math.max(i,this.minimumContainerSize.width),n=Math.max(n,this.minimumContainerSize.height)),this.resizeContainer&&this.doResizeContainer(i,n),this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var r=this.getPreferredPageSize(t,Math.max(1,i),Math.max(1,n));r!=null&&(i=r.width*this.view.scale,n=r.height*this.view.scale)}if(this.minimumGraphSize!=null&&(i=Math.max(i,this.minimumGraphSize.width*this.view.scale),n=Math.max(n,this.minimumGraphSize.height*this.view.scale)),i=Math.ceil(i),n=Math.ceil(n),this.dialect==mxConstants.DIALECT_SVG){var s=this.view.getDrawPane().ownerSVGElement;s!=null&&(s.style.minWidth=Math.max(1,i)+"px",s.style.minHeight=Math.max(1,n)+"px",s.style.width="100%",s.style.height="100%")}else mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,i),Math.max(1,n)):(this.view.canvas.style.minWidth=Math.max(1,i)+"px",this.view.canvas.style.minHeight=Math.max(1,n)+"px");this.updatePageBreaks(this.pageBreaksVisible,i,n)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",t))},mxGraph.prototype.doResizeContainer=function(t,e){this.maximumContainerSize!=null&&(t=Math.min(this.maximumContainerSize.width,t),e=Math.min(this.maximumContainerSize.height,e)),this.container.style.width=Math.ceil(t)+"px",this.container.style.height=Math.ceil(e)+"px"},mxGraph.prototype.updatePageBreaks=function(t,e,i){var n=this.view.scale,r=this.view.translate,s=this.pageFormat,l=n*this.pageScale,a=new mxRectangle(0,0,s.width*l,s.height*l),o=mxRectangle.fromRectangle(this.getGraphBounds());o.width=Math.max(1,o.width),o.height=Math.max(1,o.height),a.x=Math.floor((o.x-r.x*n)/a.width)*a.width+r.x*n,a.y=Math.floor((o.y-r.y*n)/a.height)*a.height+r.y*n,o.width=Math.ceil((o.width+(o.x-a.x))/a.width)*a.width,o.height=Math.ceil((o.height+(o.y-a.y))/a.height)*a.height,t=t&&Math.min(a.width,a.height)>this.minPageBreakDist;var u=t?Math.ceil(o.height/a.height)+1:0,p=t?Math.ceil(o.width/a.width)+1:0,m=(p-1)*a.width,d=(u-1)*a.height;this.horizontalPageBreaks==null&&u>0&&(this.horizontalPageBreaks=[]),this.verticalPageBreaks==null&&p>0&&(this.verticalPageBreaks=[]);var x=mxUtils.bind(this,function(f){if(f!=null){for(var g=f==this.horizontalPageBreaks?u:p,c=0;c<=g;c++){var v=f==this.horizontalPageBreaks?[new mxPoint(Math.round(a.x),Math.round(a.y+c*a.height)),new mxPoint(Math.round(a.x+m),Math.round(a.y+c*a.height))]:[new mxPoint(Math.round(a.x+c*a.width),Math.round(a.y)),new mxPoint(Math.round(a.x+c*a.width),Math.round(a.y+d))];if(f[c]!=null)f[c].points=v,f[c].redraw();else{var y=new mxPolyline(v,this.pageBreakColor);y.dialect=this.dialect,y.pointerEvents=!1,y.isDashed=this.pageBreakDashed,y.init(this.view.backgroundPane),y.redraw(),f[c]=y}}for(var c=g;c0&&i.substring(n-7,n+1)!=";base64,"&&(i=i.substring(0,n)+";base64,"+i.substring(n+1))}t[mxConstants.STYLE_IMAGE]=i}}return t},mxGraph.prototype.setCellStyle=function(t,e){if(e=e||this.getSelectionCells(),e!=null){this.model.beginUpdate();try{for(var i=0;i0){var r=this.getCurrentCellStyle(i[0]);n=mxUtils.getValue(r,t,e)?0:1,this.setCellStyles(t,n,i)}return n},mxGraph.prototype.setCellStyles=function(t,e,i){i=i||this.getSelectionCells(),mxUtils.setCellStyles(this.model,i,t,e)},mxGraph.prototype.toggleCellStyleFlags=function(t,e,i){this.setCellStyleFlags(t,e,null,i)},mxGraph.prototype.setCellStyleFlags=function(t,e,i,n){if(n=n||this.getSelectionCells(),n!=null&&n.length>0){if(i==null){var r=this.getCurrentCellStyle(n[0]),s=parseInt(r[t]||0);i=(s&e)!=e}mxUtils.setCellStyleFlags(this.model,n,t,e,i)}},mxGraph.prototype.alignCells=function(t,e,i){if(e==null&&(e=this.getSelectionCells()),e!=null&&e.length>1){if(i==null)for(var n=0;n1&&n!=null){var r=this.model.getParent(t);r==null&&(r=this.model.getParent(i[0])),this.model.beginUpdate();try{this.getCellGeometry(t)==null&&this.model.setGeometry(t,new mxGeometry);var s=this.model.getChildCount(r);this.cellsAdded([t],r,s,null,null,!1,!1,!1),s=this.model.getChildCount(t),this.cellsAdded(i,t,s,null,null,!1,!1,!1),this.cellsMoved(i,-n.x,-n.y,!1,!1,!1),this.cellsResized([t],[n],!1),this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",t,"border",e,"cells",i))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.getCellsForGroup=function(t){var e=[];if(t!=null&&t.length>0){var i=this.model.getParent(t[0]);e.push(t[0]);for(var n=1;n0){this.model.beginUpdate();try{for(var i=0;i0){n=n.slice();var r=this.model.getParent(t[i]),s=this.model.getChildCount(r);this.cellsAdded(n,r,s,null,null,!0),e=e.concat(n);for(var l=0;l0&&e.push(t[i]);return e},mxGraph.prototype.removeCellsAfterUngroup=function(t){this.cellsRemoved(this.addAllEdges(t))},mxGraph.prototype.removeCellsFromParent=function(t){t==null&&(t=this.getSelectionCells()),this.model.beginUpdate();try{var e=this.getDefaultParent(),i=this.model.getChildCount(e);this.cellsAdded(t,e,i,null,null,!0),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",t))}finally{this.model.endUpdate()}return t},mxGraph.prototype.updateGroupBounds=function(t,e,i,n,r,s,l){t==null&&(t=this.getSelectionCells()),e=e??0,i=i??!1,n=n??0,r=r??0,s=s??0,l=l??0,this.model.beginUpdate();try{for(var a=t.length-1;a>=0;a--){var o=this.getCellGeometry(t[a]);if(o!=null){var u=this.getChildCells(t[a]);if(u!=null&&u.length>0){var p=this.getBoundingBoxFromGeometry(u,!0);if(p!=null&&p.width>0&&p.height>0){var m=this.isSwimlane(t[a])?this.getActualStartSize(t[a],!0):new mxRectangle;o=o.clone(),i&&(o.x=Math.round(o.x+p.x-e-m.x-l),o.y=Math.round(o.y+p.y-e-m.y-n)),o.width=Math.round(p.width+2*e+m.x+l+r+m.width),o.height=Math.round(p.height+2*e+m.y+n+s+m.height),this.model.setGeometry(t[a],o),this.moveCells(u,e+m.x-p.x+l,e+m.y-p.y+n)}}}}}finally{this.model.endUpdate()}return t},mxGraph.prototype.getBoundingBox=function(t){var e=null;if(t!=null&&t.length>0){for(var i=0;i0){var o=this.view.scale,u=this.view.translate;r=this.model.cloneCells(t,!0,i);for(var a=0;athis.model.getChildCount(e)&&i--,this.model.add(e,t[m],i+m),this.autoSizeCellsOnAdd&&this.autoSizeCell(t[m],!0),(a==null||a)&&this.isExtendParentsOnAdd(t[m])&&this.isExtendParent(t[m])&&this.extendParent(t[m]),(l==null||l)&&this.constrainChild(t[m]),n!=null&&this.cellConnected(t[m],n,!0),r!=null&&this.cellConnected(t[m],r,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",t,"parent",e,"index",i,"source",n,"target",r,"absolute",s))}finally{this.model.endUpdate()}}},mxGraph.prototype.autoSizeCell=function(t,e){if(e=e??!0,e)for(var i=this.model.getChildCount(t),n=0;n0){var e=this.view.scale,i=this.view.translate;this.model.beginUpdate();try{for(var n=new mxDictionary,r=0;r0){this.model.beginUpdate();try{for(var i=0;i0){this.model.beginUpdate();try{for(var r=0;r0&&(r.height=Math.max(r.height,l))}}e.alternateBounds=new mxRectangle(0,0,r.width,r.height)}if(e.alternateBounds!=null){e.alternateBounds.x=e.x,e.alternateBounds.y=e.y;var a=mxUtils.toRadians(n[mxConstants.STYLE_ROTATION]||0);if(a!=0){var o=e.alternateBounds.getCenterX()-e.getCenterX(),u=e.alternateBounds.getCenterY()-e.getCenterY(),p=Math.cos(a),m=Math.sin(a),d=p*o-m*u,x=m*o+p*u;e.alternateBounds.x+=d-o,e.alternateBounds.y+=x-u}}}},mxGraph.prototype.addAllEdges=function(t){var e=t.slice();return mxUtils.removeDuplicates(e.concat(this.getAllEdges(t)))},mxGraph.prototype.getAllEdges=function(t){var e=[];if(t!=null)for(var i=0;i0){this.isHtmlLabel(n.cell)||(u=mxUtils.htmlEntities(u,!1)),u=u.replace(/\n/g,"
");var p=mxUtils.getSizeForString(u,s,r[mxConstants.STYLE_FONTFAMILY],e,r[mxConstants.STYLE_FONTSTYLE]),m=p.width+l,d=p.height+a;if(!mxUtils.getValue(r,mxConstants.STYLE_HORIZONTAL,!0)){var x=d;d=m,m=x}this.gridEnabled&&(m=this.snap(m+this.gridSize/2),d=this.snap(d+this.gridSize/2)),i=new mxRectangle(0,0,m,d)}else{var f=4*this.gridSize;i=new mxRectangle(0,0,f,f)}}}return i},mxGraph.prototype.resizeCell=function(t,e,i){return this.resizeCells([t],[e],i)[0]},mxGraph.prototype.resizeCells=function(t,e,i){i=i??this.isRecursiveResize(),this.model.beginUpdate();try{var n=this.cellsResized(t,e,i);this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",t,"bounds",e,"previous",n))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsResized=function(t,e,i){i=i??!1;var n=[];if(t!=null&&e!=null&&t.length==e.length){this.model.beginUpdate();try{for(var r=0;r0&&(l=mxRectangle.fromRectangle(l),l.x-=l.width*a,l.y-=l.height*a,l.width+=2*l.width*a,l.height+=2*l.height*a),r==null?r=l:(r=mxRectangle.fromRectangle(r),r.intersect(l))}}if(r!=null){var o=[t];if(!this.isCellCollapsed(t))for(var u=this.model.getDescendants(t),p=0;pr.width&&(d=i.width-r.width,i.width-=d),m.x+m.width>r.x+r.width&&(d-=m.x+m.width-r.x-r.width-d);var x=0;i.height>r.height&&(x=i.height-r.height,i.height-=x),m.y+m.height>r.y+r.height&&(x-=m.y+m.height-r.y-r.height-x),m.x0&&(e=e.clone(),e.points=[],this.model.setGeometry(t,e)),t},mxGraph.prototype.getOutlineConstraint=function(t,e,i){if(e.shape!=null){var n=this.view.getPerimeterBounds(e),r=e.style[mxConstants.STYLE_DIRECTION];if(r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH){n.x+=n.width/2-n.height/2,n.y+=n.height/2-n.width/2;var s=n.width;n.width=n.height,n.height=s}var l=mxUtils.toRadians(e.shape.getShapeRotation());if(l!=0){var a=Math.cos(-l),o=Math.sin(-l),u=new mxPoint(n.getCenterX(),n.getCenterY());t=mxUtils.getRotatedPoint(t,a,o,u)}var p=1,m=1,d=0,x=0;if(this.getModel().isVertex(e.cell)){var f=e.style[mxConstants.STYLE_FLIPH],g=e.style[mxConstants.STYLE_FLIPV];if(e.shape!=null&&e.shape.stencil!=null&&(f=mxUtils.getValue(e.style,"stencilFlipH",0)==1||f,g=mxUtils.getValue(e.style,"stencilFlipV",0)==1||g),r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH){var s=f;f=g,g=s}f&&(p=-1,d=-n.width),g&&(m=-1,x=-n.height)}t=new mxPoint((t.x-n.x)*p-d+n.x,(t.y-n.y)*m-x+n.y);var c=n.width==0?0:Math.round((t.x-n.x)*1e3/n.width)/1e3,v=n.height==0?0:Math.round((t.y-n.y)*1e3/n.height)/1e3;return new mxConnectionConstraint(new mxPoint(c,v),!1)}return null},mxGraph.prototype.getAllConnectionConstraints=function(t,e){return t!=null&&t.shape!=null&&t.shape.stencil!=null?t.shape.stencil.constraints:null},mxGraph.prototype.getConnectionConstraint=function(t,e,i){var n=null,r=t.style[i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(r!=null){var s=t.style[i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];s!=null&&(n=new mxPoint(parseFloat(r),parseFloat(s)))}var l=!1,a=0,o=0;return n!=null&&(l=mxUtils.getValue(t.style,i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0),a=parseFloat(t.style[i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX]),o=parseFloat(t.style[i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY]),a=isFinite(a)?a:0,o=isFinite(o)?o:0),new mxConnectionConstraint(n,l,null,a,o)},mxGraph.prototype.setConnectionConstraint=function(t,e,i,n){if(n!=null){this.model.beginUpdate();try{n==null||n.point==null?(this.setCellStyles(i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t])):n.point!=null&&(this.setCellStyles(i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,n.point.x,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,n.point.y,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,n.dx,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,n.dy,[t]),n.perimeter?this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t]):this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[t]))}finally{this.model.endUpdate()}}},mxGraph.prototype.getConnectionPoint=function(t,e,i){i=i??!0;var n=null;if(t!=null&&e.point!=null){var r=this.view.getPerimeterBounds(t),s=new mxPoint(r.getCenterX(),r.getCenterY()),l=t.style[mxConstants.STYLE_DIRECTION],a=0;l!=null&&mxUtils.getValue(t.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)==1&&(l==mxConstants.DIRECTION_NORTH?a+=270:l==mxConstants.DIRECTION_WEST?a+=180:l==mxConstants.DIRECTION_SOUTH&&(a+=90),(l==mxConstants.DIRECTION_NORTH||l==mxConstants.DIRECTION_SOUTH)&&r.rotate90());var o=this.view.scale;n=new mxPoint(r.x+e.point.x*r.width+e.dx*o,r.y+e.point.y*r.height+e.dy*o);var u=t.style[mxConstants.STYLE_ROTATION]||0;if(e.perimeter){if(a!=0){var p=0,m=0;a==90?m=1:a==180?p=-1:a==270&&(m=-1),n=mxUtils.getRotatedPoint(n,p,m,s)}n=this.view.getPerimeterPoint(t,n,!1)}else if(u+=a,this.getModel().isVertex(t.cell)){var d=t.style[mxConstants.STYLE_FLIPH]==1,x=t.style[mxConstants.STYLE_FLIPV]==1;if(t.shape!=null&&t.shape.stencil!=null&&(d=mxUtils.getValue(t.style,"stencilFlipH",0)==1||d,x=mxUtils.getValue(t.style,"stencilFlipV",0)==1||x),l==mxConstants.DIRECTION_NORTH||l==mxConstants.DIRECTION_SOUTH){var f=d;d=x,x=f}d&&(n.x=2*r.getCenterX()-n.x),x&&(n.y=2*r.getCenterY()-n.y)}if(u!=0&&n!=null){var g=mxUtils.toRadians(u),p=Math.cos(g),m=Math.sin(g);n=mxUtils.getRotatedPoint(n,p,m,s)}}return i&&n!=null&&(n.x=Math.round(n.x),n.y=Math.round(n.y)),n},mxGraph.prototype.connectCell=function(t,e,i,n){this.model.beginUpdate();try{var r=this.model.getTerminal(t,i);this.cellConnected(t,e,i,n),this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",t,"terminal",e,"source",i,"previous",r))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellConnected=function(t,e,i,n){if(t!=null){this.model.beginUpdate();try{var r=this.model.getTerminal(t,i);if(this.setConnectionConstraint(t,e,i,n),this.isPortsEnabled()){var s=null;this.isPort(e)&&(s=e.getId(),e=this.getTerminalForPort(e,i));var l=i?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT;this.setCellStyles(l,s,[t])}this.model.setTerminal(t,e,i),this.resetEdgesOnConnect&&this.resetEdge(t),this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",t,"terminal",e,"source",i,"previous",r))}finally{this.model.endUpdate()}}},mxGraph.prototype.disconnectGraph=function(t){if(t!=null){this.model.beginUpdate();try{for(var e=this.view.scale,i=this.view.translate,n=new mxDictionary,r=0;r0)for(var o=new mxRectangle(a[0].x,a[0].y,0,0),u=1;u=0&&(s.x+=o.x,s.y+=o.y))}}else if(s=mxRectangle.fromRectangle(r),this.model.isVertex(p)&&mxUtils.indexOf(t,p)>=0){var o=this.getBoundingBoxFromGeometry([p],!1);o!=null&&(s.x+=o.x,s.y+=o.y)}s!=null&&r.offset!=null&&(s.x+=r.offset.x,s.y+=r.offset.y);var m=this.getCurrentCellStyle(t[n]);if(s!=null){var d=mxUtils.getValue(m,mxConstants.STYLE_ROTATION,0);d!=0&&(s=mxUtils.getBoundingBox(s,d))}}s!=null&&(i==null?i=mxRectangle.fromRectangle(s):i.add(s))}}}return i},mxGraph.prototype.refresh=function(t){this.view.clear(t,t==null),this.view.validate(),this.sizeDidChange(),this.fireEvent(new mxEventObject(mxEvent.REFRESH))},mxGraph.prototype.snap=function(t){return this.gridEnabled&&(t=Math.round(t/this.gridSize)*this.gridSize),t},mxGraph.prototype.snapDelta=function(t,e,i,n,r){var s=this.view.translate,l=this.view.scale;if(!i&&this.gridEnabled){var a=this.gridSize*l*.5;if(!n){var o=e.x-(this.snap(e.x/l-s.x)+s.x)*l;Math.abs(t.x-o)l&&(m=0),f>a&&(d=0),this.view.setTranslate(Math.floor(m/2-o.x),Math.floor(d/2-o.y)),this.container.scrollLeft=(x-l)/2,this.container.scrollTop=(f-a)/2}},mxGraph.prototype.zoom=function(t,e){e=e??this.centerZoom;var i=Math.round(this.view.scale*t*100)/100,n=this.view.getState(this.getSelectionCell());if(t=i/this.view.scale,this.keepSelectionVisibleOnZoom&&n!=null){var r=new mxRectangle(n.x*t,n.y*t,n.width*t,n.height*t);this.view.scale=i,this.scrollRectToVisible(r)||(this.view.revalidate(),this.view.setScale(i))}else{var s=mxUtils.hasScrollbars(this.container);if(e&&!s){var l=this.container.offsetWidth,a=this.container.offsetHeight;if(t>1){var o=(t-1)/(i*2);l*=-o,a*=-o}else{var o=(1/t-1)/(this.view.scale*2);l*=o,a*=o}this.view.scaleAndTranslate(i,this.view.translate.x+l,this.view.translate.y+a)}else{var u=this.view.translate.x,p=this.view.translate.y,m=this.container.scrollLeft,d=this.container.scrollTop;if(this.view.setScale(i),s){var l=0,a=0;e&&(l=this.container.offsetWidth*(t-1)/2,a=this.container.offsetHeight*(t-1)/2),this.container.scrollLeft=(this.view.translate.x-u)*this.view.scale+Math.round(m*t+l),this.container.scrollTop=(this.view.translate.y-p)*this.view.scale+Math.round(d*t+a)}}}},mxGraph.prototype.zoomToRect=function(t){var e=this.container.clientWidth/t.width,i=this.container.clientHeight/t.height,n=e/i;t.x=Math.max(0,t.x),t.y=Math.max(0,t.y);var r=Math.min(this.container.scrollWidth,t.x+t.width),s=Math.min(this.container.scrollHeight,t.y+t.height);if(t.width=r-t.x,t.height=s-t.y,n<1){var l=t.height/n,a=(l-t.height)/2;t.height=l;var o=Math.min(t.y,a);t.y=t.y-o,s=Math.min(this.container.scrollHeight,t.y+t.height),t.height=s-t.y}else{var u=t.width*n,p=(u-t.width)/2;t.width=u;var m=Math.min(t.x,p);t.x=t.x-m,r=Math.min(this.container.scrollWidth,t.x+t.width),t.width=r-t.x}var d=this.container.clientWidth/t.width,x=this.view.scale*d;mxUtils.hasScrollbars(this.container)?(this.view.setScale(x),this.container.scrollLeft=Math.round(t.x*d),this.container.scrollTop=Math.round(t.y*d)):this.view.scaleAndTranslate(x,this.view.translate.x-t.x/this.view.scale,this.view.translate.y-t.y/this.view.scale)},mxGraph.prototype.scrollCellToVisible=function(t,e){var i=-this.view.translate.x,n=-this.view.translate.y,r=this.view.getState(t);if(r!=null){var s=new mxRectangle(i+r.x,n+r.y,r.width,r.height);if(e&&this.container!=null){var l=this.container.clientWidth,a=this.container.clientHeight;s.x=s.getCenterX()-l/2,s.width=l,s.y=s.getCenterY()-a/2,s.height=a}var o=new mxPoint(this.view.translate.x,this.view.translate.y);if(this.scrollRectToVisible(s)){var u=new mxPoint(this.view.translate.x,this.view.translate.y);this.view.translate.x=o.x,this.view.translate.y=o.y,this.view.setTranslate(u.x,u.y)}}},mxGraph.prototype.scrollRectToVisible=function(t){var e=!1;if(t!=null){var i=this.container.offsetWidth,n=this.container.offsetHeight,r=Math.min(i,t.width),s=Math.min(n,t.height);if(mxUtils.hasScrollbars(this.container)){var l=this.container;t.x+=this.view.translate.x,t.y+=this.view.translate.y;var a=l.scrollLeft-t.x,o=Math.max(a-l.scrollLeft,0);a>0?l.scrollLeft-=a+2:(a=t.x+r-l.scrollLeft-l.clientWidth,a>0&&(l.scrollLeft+=a+2));var u=l.scrollTop-t.y,p=Math.max(0,u-l.scrollTop);u>0?l.scrollTop-=u+2:(u=t.y+s-l.scrollTop-l.clientHeight,u>0&&(l.scrollTop+=u+2)),!this.useScrollbarsForPanning&&(o!=0||p!=0)&&this.view.setTranslate(o,p)}else{var m=-this.view.translate.x,d=-this.view.translate.y,x=this.view.scale;t.x+r>m+i&&(this.view.translate.x-=(t.x+r-i-m)/x,e=!0),t.y+s>d+n&&(this.view.translate.y-=(t.y+s-n-d)/x,e=!0),t.x1||r.length==1&&r[0]!=t)&&(n+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+` +`),C=y+(T.length-1)*y*mxConstants.LINE_HEIGHT,S=0,E=0;if(l==mxConstants.ALIGN_BOTTOM?E=-C/2:l!=mxConstants.ALIGN_MIDDLE&&(E=C/2),m!=null){f.style.rotation=m;var L=m*(Math.PI/180);S=Math.sin(L)*E,E=Math.cos(L)*E}f.appendChild(v),f.style.left=this.format(t-S)+"px",f.style.top=this.format(e+E)+"px",this.root.appendChild(f)},mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},__mxOutput.mxVmlCanvas2D=typeof mxVmlCanvas2D<"u"?mxVmlCanvas2D:void 0;function mxGuide(t,e){this.graph=t,this.setStates(e)}mxGuide.prototype.graph=null,mxGuide.prototype.states=null,mxGuide.prototype.horizontal=!0,mxGuide.prototype.vertical=!0,mxGuide.prototype.guideX=null,mxGuide.prototype.guideY=null,mxGuide.prototype.rounded=!1,mxGuide.prototype.tolerance=2,mxGuide.prototype.setStates=function(t){this.states=t},mxGuide.prototype.isEnabledForEvent=function(t){return!0},mxGuide.prototype.getGuideTolerance=function(t){return t&&this.graph.gridEnabled?this.graph.gridSize/2:this.tolerance},mxGuide.prototype.createGuideShape=function(t){var e=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH);return e.isDashed=!0,e},mxGuide.prototype.isStateIgnored=function(t){return!1},mxGuide.prototype.move=function(t,e,i,n){if(this.states!=null&&(this.horizontal||this.vertical)&&t!=null&&e!=null){let R=function(_,b,k){var G=!1;k&&Math.abs(_-v)0&&t[0]!=null){this.bounds=new mxRectangle(Number(t[0].x),Number(t[0].y),1,1);for(var e=1;e0&&this.bounds!=null&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&this.bounds.width>0&&this.bounds.height>0},mxShape.prototype.createVmlGroup=function(){var t=document.createElement(mxClient.VML_PREFIX+":group");return t.style.position="absolute",t.style.width=this.node.style.width,t.style.height=this.node.style.height,t},mxShape.prototype.redrawShape=function(){var t=this.createCanvas();t!=null&&(t.pointerEvents=this.pointerEvents,this.beforePaint(t),this.paint(t),this.afterPaint(t),this.node!=t.root&&this.node.insertAdjacentHTML("beforeend",t.root.outerHTML),this.node.nodeName=="DIV"&&document.documentMode==8&&(this.node.style.filter="",mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(t))},mxShape.prototype.createCanvas=function(){var t=null;return this.node.ownerSVGElement!=null?t=this.createSvgCanvas():mxClient.IS_VML&&(this.updateVmlContainer(),t=this.createVmlCanvas()),t!=null&&this.outline&&(t.setStrokeWidth(this.strokewidth),t.setStrokeColor(this.stroke),this.isDashed!=null&&t.setDashed(this.isDashed),t.setStrokeWidth=function(){},t.setStrokeColor=function(){},t.setFillColor=function(){},t.setGradient=function(){},t.setDashed=function(){},t.text=function(){}),t},mxShape.prototype.createSvgCanvas=function(){var t=new mxSvgCanvas2D(this.node,!1);t.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,t.pointerEventsValue=this.svgPointerEvents;var e=this.getSvgScreenOffset();return e!=0?this.node.setAttribute("transform","translate("+e+","+e+")"):this.node.removeAttribute("transform"),t.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(t.format=function(i){return Math.round(parseFloat(i))}),t},mxShape.prototype.createVmlCanvas=function(){var t=document.documentMode==8&&this.isParseVml()?this.createVmlGroup():this.node,e=new mxVmlCanvas2D(t);if(t.tagUrn!=""){var i=Math.max(1,Math.round(this.bounds.width)),n=Math.max(1,Math.round(this.bounds.height));t.coordsize=i*this.vmlScale+","+n*this.vmlScale,e.scale(this.vmlScale),e.vmlScale=this.vmlScale}var r=this.scale;return e.translate(-Math.round(this.bounds.x/r),-Math.round(this.bounds.y/r)),e},mxShape.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px";var t=Math.max(1,Math.round(this.bounds.width)),e=Math.max(1,Math.round(this.bounds.height));this.node.style.width=t+"px",this.node.style.height=e+"px",this.node.style.overflow="visible"},mxShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node),this.updateHtmlFilters(this.node),this.updateHtmlColors(this.node)},mxShape.prototype.updateHtmlFilters=function(t){var e="";if(this.opacity<100&&(e+="alpha(opacity="+this.opacity+")"),this.isShadow&&(e+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.VML_SHADOWCOLOR+"')"),this.fill!=null&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var i=this.fill,n=this.gradient,r="0",s={east:0,south:1,west:2,north:3},l=this.direction!=null?s[this.direction]:0;if(this.gradientDirection!=null&&(l=mxUtils.mod(l+s[this.gradientDirection]-1,4)),l==1){r="1";var a=i;i=n,n=a}else if(l==2){var a=i;i=n,n=a}else l==3&&(r="1");e+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+i+"', endColorStr='"+n+"', gradientType='"+r+"')"}t.style.filter=e},mxShape.prototype.updateHtmlColors=function(t){var e=this.stroke;e!=null&&e!=mxConstants.NONE?(t.style.borderColor=e,this.isDashed?t.style.borderStyle="dashed":this.strokewidth>0&&(t.style.borderStyle="solid"),t.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):t.style.borderWidth="0px",e=this.outline?null:this.fill,e!=null&&e!=mxConstants.NONE?(t.style.backgroundColor=e,t.style.backgroundImage="none"):this.pointerEvents?t.style.backgroundColor="transparent":document.documentMode==8?mxUtils.addTransparentBackgroundFilter(t):this.setTransparentBackgroundImage(t)},mxShape.prototype.updateHtmlBounds=function(t){var e=document.documentMode>=9?0:Math.ceil(this.strokewidth*this.scale);t.style.borderWidth=Math.max(1,e)+"px",t.style.overflow="hidden",t.style.left=Math.round(this.bounds.x-e/2)+"px",t.style.top=Math.round(this.bounds.y-e/2)+"px",document.compatMode=="CSS1Compat"&&(e=-e),t.style.width=Math.round(Math.max(0,this.bounds.width+e))+"px",t.style.height=Math.round(Math.max(0,this.bounds.height+e))+"px"},mxShape.prototype.destroyCanvas=function(t){if(t instanceof mxSvgCanvas2D){for(var e in t.gradients){var i=t.gradients[e];i!=null&&(i.mxRefCount=(i.mxRefCount||0)+1)}this.releaseSvgGradients(this.oldGradients),this.oldGradients=t.gradients}},mxShape.prototype.beforePaint=function(t){},mxShape.prototype.afterPaint=function(t){},mxShape.prototype.paint=function(t){var e=!1;if(t!=null&&this.outline){var i=t.stroke;t.stroke=function(){e=!0,i.apply(this,arguments)};var n=t.fillAndStroke;t.fillAndStroke=function(){e=!0,n.apply(this,arguments)}}var r=this.scale,s=this.bounds.x/r,l=this.bounds.y/r,a=this.bounds.width/r,o=this.bounds.height/r;if(this.isPaintBoundsInverted()){var u=(a-o)/2;s+=u,l-=u;var p=a;a=o,o=p}this.updateTransform(t,s,l,a,o),this.configureCanvas(t,s,l,a,o);var m=null;if(this.stencil==null&&this.points==null&&this.shapePointerEvents||this.stencil!=null&&this.stencilPointerEvents){var d=this.createBoundingBox();if(this.dialect==mxConstants.DIALECT_SVG)m=this.createTransparentSvgRectangle(d.x,d.y,d.width,d.height),this.node.appendChild(m);else{var x=t.createRect("rect",d.x/r,d.y/r,d.width/r,d.height/r);x.appendChild(t.createTransparentFill()),x.stroked="false",t.root.appendChild(x)}}if(this.stencil!=null)this.stencil.drawShape(t,this,s,l,a,o);else if(t.setStrokeWidth(this.strokewidth),this.points!=null){for(var f=[],g=0;g0){l=l??!0;var a=e[e.length-1];if(r&&i){e=e.slice();var o=e[0],u=new mxPoint(a.x+(o.x-a.x)/2,a.y+(o.y-a.y)/2);e.splice(0,0,u)}var p=e[0],m=1;for(l?t.moveTo(p.x,p.y):t.lineTo(p.x,p.y);m<(r?e.length:e.length-1);){var d=e[mxUtils.mod(m,e.length)],x=p.x-d.x,f=p.y-d.y;if(i&&(x!=0||f!=0)&&(s==null||mxUtils.indexOf(s,m-1)<0)){var g=Math.sqrt(x*x+f*f),c=x*Math.min(n,g/2)/g,v=f*Math.min(n,g/2)/g,y=d.x+c,T=d.y+v;t.lineTo(y,T);for(var C=e[mxUtils.mod(m+1,e.length)];m0&&t.height>0){this.boundingBox=new mxRectangle(t.x,t.y,t.width,t.height),this.boundingBox.grow(this.strokewidth*this.scale/2);return}}catch{}if(this.bounds!=null){var e=this.createBoundingBox();if(e!=null){this.augmentBoundingBox(e);var i=this.getShapeRotation();i!=0&&(e=mxUtils.getBoundingBox(e,i))}this.boundingBox=e}},mxShape.prototype.createBoundingBox=function(){var t=this.bounds.clone();return(this.stencil!=null&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)||this.isPaintBoundsInverted())&&t.rotate90(),t},mxShape.prototype.augmentBoundingBox=function(t){this.isShadow&&(t.width+=Math.ceil(mxConstants.SHADOW_OFFSET_X*this.scale),t.height+=Math.ceil(mxConstants.SHADOW_OFFSET_Y*this.scale)),t.grow(this.strokewidth*this.scale/2)},mxShape.prototype.isPaintBoundsInverted=function(){return this.stencil==null&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)},mxShape.prototype.getRotation=function(){return this.rotation!=null?this.rotation:0},mxShape.prototype.getTextRotation=function(){var t=this.getRotation();return mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)!=1&&(t+=mxText.prototype.verticalTextRotation),t},mxShape.prototype.getShapeRotation=function(){var t=this.getRotation();return this.direction!=null&&(this.direction==mxConstants.DIRECTION_NORTH?t+=270:this.direction==mxConstants.DIRECTION_WEST?t+=180:this.direction==mxConstants.DIRECTION_SOUTH&&(t+=90)),t},mxShape.prototype.createTransparentSvgRectangle=function(t,e,i,n){var r=document.createElementNS(mxConstants.NS_SVG,"rect");return r.setAttribute("x",t),r.setAttribute("y",e),r.setAttribute("width",i),r.setAttribute("height",n),r.setAttribute("fill","none"),r.setAttribute("stroke","none"),r.setAttribute("pointer-events","all"),r},mxShape.prototype.setTransparentBackgroundImage=function(t){t.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"},mxShape.prototype.releaseSvgGradients=function(t){if(t!=null)for(var e in t){var i=t[e];i!=null&&(i.mxRefCount=(i.mxRefCount||0)-1,i.mxRefCount==0&&i.parentNode!=null&&i.parentNode.removeChild(i))}},mxShape.prototype.destroy=function(){this.node!=null&&(mxEvent.release(this.node),this.node.parentNode!=null&&this.node.parentNode.removeChild(this.node),this.node=null),this.releaseSvgGradients(this.oldGradients),this.oldGradients=null},__mxOutput.mxShape=typeof mxShape<"u"?mxShape:void 0;function mxStencil(t){this.desc=t,this.parseDescription(),this.parseConstraints()}mxUtils.extend(mxStencil,mxShape),mxStencil.defaultLocalized=!1,mxStencil.allowEval=!1,mxStencil.prototype.desc=null,mxStencil.prototype.constraints=null,mxStencil.prototype.aspect=null,mxStencil.prototype.w0=null,mxStencil.prototype.h0=null,mxStencil.prototype.bgNode=null,mxStencil.prototype.fgNode=null,mxStencil.prototype.strokewidth=null,mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0],this.bgNode=this.desc.getElementsByTagName("background")[0],this.w0=Number(this.desc.getAttribute("w")||100),this.h0=Number(this.desc.getAttribute("h")||100);var t=this.desc.getAttribute("aspect");this.aspect=t??"variable";var e=this.desc.getAttribute("strokewidth");this.strokewidth=e??"1"},mxStencil.prototype.parseConstraints=function(){var t=this.desc.getElementsByTagName("connections")[0];if(t!=null){var e=mxUtils.getChildNodes(t);if(e!=null&&e.length>0){this.constraints=[];for(var i=0;i0&&s>0)for(var p=l.firstChild;p!=null;)p.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(t,e,p,a,o,u),p=p.nextSibling},mxStencil.prototype.computeAspect=function(t,e,i,n,r,s){var l=e,a=i,o=n/this.w0,u=r/this.h0,p=s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_SOUTH;if(p){u=n/this.h0,o=r/this.w0;var m=(n-r)/2;l+=m,a-=m}return this.aspect=="fixed"&&(u=Math.min(o,u),o=u,p?(l+=(r-this.w0*o)/2,a+=(n-this.h0*u)/2):(l+=(n-this.w0*o)/2,a+=(r-this.h0*u)/2)),new mxRectangle(l,a,o,u)},mxStencil.prototype.drawNode=function(t,e,i,n,r,s){var l=i.nodeName,a=n.x,o=n.y,u=n.width,p=n.height,m=Math.min(u,p);if(l=="save")t.save();else if(l=="restore")t.restore();else if(s){if(l=="path"){t.begin();var d=!0;if(i.getAttribute("rounded")=="1"){d=!1;for(var x=Number(i.getAttribute("arcSize")),f=0,g=[],c=i.firstChild;c!=null;){if(c.nodeType==mxConstants.NODETYPE_ELEMENT){var v=c.nodeName;if(v=="move"||v=="line")(v=="move"||g.length==0)&&g.push([]),g[g.length-1].push(new mxPoint(a+Number(c.getAttribute("x"))*u,o+Number(c.getAttribute("y"))*p)),f++;else{d=!0;break}}c=c.nextSibling}if(!d&&f>0)for(var y=0;y0&&V.push(Number(X[y])*m);W=V.join(" "),t.setDashPattern(W)}}else l=="strokecolor"?t.setStrokeColor(i.getAttribute("color")):l=="linecap"?t.setLineCap(i.getAttribute("cap")):l=="linejoin"?t.setLineJoin(i.getAttribute("join")):l=="miterlimit"?t.setMiterLimit(Number(i.getAttribute("limit"))):l=="fillcolor"?t.setFillColor(i.getAttribute("color")):l=="alpha"||l=="fillalpha"||l=="strokealpha"?t.setAlpha(i.getAttribute("alpha")):l=="fontcolor"?t.setFontColor(i.getAttribute("color")):l=="fontstyle"?t.setFontStyle(i.getAttribute("style")):l=="fontfamily"?t.setFontFamily(i.getAttribute("family")):l=="fontsize"&&t.setFontSize(Number(i.getAttribute("size"))*m);r&&(l=="fillstroke"||l=="fill"||l=="stroke")&&(r=!1,t.setShadow(!1))}},__mxOutput.mxStencil=typeof mxStencil<"u"?mxStencil:void 0;var mxStencilRegistry={stencils:{},addStencil:function(t,e){mxStencilRegistry.stencils[t]=e},getStencil:function(t){return mxStencilRegistry.stencils[t]}};__mxOutput.mxStencilRegistry=typeof mxStencilRegistry<"u"?mxStencilRegistry:void 0;var mxMarker={markers:[],addMarker:function(t,e){mxMarker.markers[t]=e},createMarker:function(t,e,i,n,r,s,l,a,o,u){var p=mxMarker.markers[i];return p!=null?p(t,e,i,n,r,s,l,a,o,u):null}};(function(){function t(n){return n=n??2,function(r,s,l,a,o,u,p,m,d,x){var f=o*d*1.118,g=u*d*1.118;o=o*(p+d),u=u*(p+d);var c=a.clone();c.x-=f,c.y-=g;var v=l!=mxConstants.ARROW_CLASSIC&&l!=mxConstants.ARROW_CLASSIC_THIN?1:3/4;return a.x+=-o*v-f,a.y+=-u*v-g,function(){r.begin(),r.moveTo(c.x,c.y),r.lineTo(c.x-o-u/n,c.y-u+o/n),(l==mxConstants.ARROW_CLASSIC||l==mxConstants.ARROW_CLASSIC_THIN)&&r.lineTo(c.x-o*3/4,c.y-u*3/4),r.lineTo(c.x+u/n-o,c.y-u-o/n),r.close(),x?r.fillAndStroke():r.stroke()}}}mxMarker.addMarker("classic",t(2)),mxMarker.addMarker("classicThin",t(3)),mxMarker.addMarker("block",t(2)),mxMarker.addMarker("blockThin",t(3));function e(n){return n=n??2,function(r,s,l,a,o,u,p,m,d,x){var f=o*d*1.118,g=u*d*1.118;o=o*(p+d),u=u*(p+d);var c=a.clone();return c.x-=f,c.y-=g,a.x+=-f*2,a.y+=-g*2,function(){r.begin(),r.moveTo(c.x-o-u/n,c.y-u+o/n),r.lineTo(c.x,c.y),r.lineTo(c.x+u/n-o,c.y-u-o/n),r.stroke()}}}mxMarker.addMarker("open",e(2)),mxMarker.addMarker("openThin",e(3)),mxMarker.addMarker("oval",function(n,r,s,l,a,o,u,p,m,d){var x=u/2,f=l.clone();return l.x-=a*x,l.y-=o*x,function(){n.ellipse(f.x-x,f.y-x,u,u),d?n.fillAndStroke():n.stroke()}});function i(n,r,s,l,a,o,u,p,m,d){var x=s==mxConstants.ARROW_DIAMOND?.7071:.9862,f=a*m*x,g=o*m*x;a=a*(u+m),o=o*(u+m);var c=l.clone();c.x-=f,c.y-=g,l.x+=-a-f,l.y+=-o-g;var v=s==mxConstants.ARROW_DIAMOND?2:3.4;return function(){n.begin(),n.moveTo(c.x,c.y),n.lineTo(c.x-a/2-o/v,c.y+a/v-o/2),n.lineTo(c.x-a,c.y-o),n.lineTo(c.x-a/2+o/v,c.y-o/2-a/v),n.close(),d?n.fillAndStroke():n.stroke()}}mxMarker.addMarker("diamond",i),mxMarker.addMarker("diamondThin",i)})(),__mxOutput.mxMarker=typeof mxMarker<"u"?mxMarker:void 0;function mxActor(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxActor,mxShape),mxActor.prototype.paintVertexShape=function(t,e,i,n,r){t.translate(e,i),t.begin(),this.redrawPath(t,e,i,n,r),t.fillAndStroke()},mxActor.prototype.redrawPath=function(t,e,i,n,r){var s=n/3;t.moveTo(0,r),t.curveTo(0,3*r/5,0,2*r/5,n/2,2*r/5),t.curveTo(n/2-s,2*r/5,n/2-s,0,n/2,0),t.curveTo(n/2+s,0,n/2+s,2*r/5,n/2,2*r/5),t.curveTo(n,2*r/5,n,3*r/5,n,r),t.close()},__mxOutput.mxActor=typeof mxActor<"u"?mxActor:void 0;function mxCloud(t,e,i,n){mxActor.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxCloud,mxActor),mxCloud.prototype.redrawPath=function(t,e,i,n,r){t.moveTo(.25*n,.25*r),t.curveTo(.05*n,.25*r,0,.5*r,.16*n,.55*r),t.curveTo(0,.66*r,.18*n,.9*r,.31*n,.8*r),t.curveTo(.4*n,r,.7*n,r,.8*n,.8*r),t.curveTo(n,.8*r,n,.6*r,.875*n,.5*r),t.curveTo(n,.3*r,.8*n,.1*r,.625*n,.2*r),t.curveTo(.5*n,.05*r,.3*n,.05*r,.25*n,.25*r),t.close()},__mxOutput.mxCloud=typeof mxCloud<"u"?mxCloud:void 0;function mxRectangleShape(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxRectangleShape,mxShape),mxRectangleShape.prototype.isHtmlAllowed=function(){var t=!0;return this.style!=null&&(t=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")=="1"),!this.isRounded&&!this.glass&&this.rotation==0&&(t||this.fill!=null&&this.fill!=mxConstants.NONE)},mxRectangleShape.prototype.paintBackground=function(t,e,i,n,r){var s=!0;if(this.style!=null&&(s=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")=="1"),s||this.fill!=null&&this.fill!=mxConstants.NONE||this.stroke!=null&&this.stroke!=mxConstants.NONE){if(!s&&(this.fill==null||this.fill==mxConstants.NONE)&&(t.pointerEvents=!1),this.isRounded){var l=0;if(mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)=="1")l=Math.min(n/2,Math.min(r/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else{var a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.RECTANGLE_ROUNDING_FACTOR*100)/100;l=Math.min(n*a,r*a)}t.roundrect(e,i,n,r,l,l)}else t.rect(e,i,n,r);t.fillAndStroke()}},mxRectangleShape.prototype.isRoundable=function(t,e,i,n,r){return!0},mxRectangleShape.prototype.paintForeground=function(t,e,i,n,r){this.glass&&!this.outline&&this.fill!=null&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(t,e,i,n,r,this.getArcSize(n+this.strokewidth,r+this.strokewidth))},__mxOutput.mxRectangleShape=typeof mxRectangleShape<"u"?mxRectangleShape:void 0;function mxEllipse(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxEllipse,mxShape),mxEllipse.prototype.paintVertexShape=function(t,e,i,n,r){t.ellipse(e,i,n,r),t.fillAndStroke()},__mxOutput.mxEllipse=typeof mxEllipse<"u"?mxEllipse:void 0;function mxDoubleEllipse(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxDoubleEllipse,mxShape),mxDoubleEllipse.prototype.vmlScale=10,mxDoubleEllipse.prototype.paintBackground=function(t,e,i,n,r){t.ellipse(e,i,n,r),t.fillAndStroke()},mxDoubleEllipse.prototype.paintForeground=function(t,e,i,n,r){if(!this.outline){var s=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(n/5,r/5)));e+=s,i+=s,n-=2*s,r-=2*s,n>0&&r>0&&t.ellipse(e,i,n,r),t.stroke()}},mxDoubleEllipse.prototype.getLabelBounds=function(t){var e=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(t.width/5/this.scale,t.height/5/this.scale)))*this.scale;return new mxRectangle(t.x+e,t.y+e,t.width-2*e,t.height-2*e)},__mxOutput.mxDoubleEllipse=typeof mxDoubleEllipse<"u"?mxDoubleEllipse:void 0;function mxRhombus(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxRhombus,mxShape),mxRhombus.prototype.isRoundable=function(){return!0},mxRhombus.prototype.paintVertexShape=function(t,e,i,n,r){var s=n/2,l=r/2,a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,[new mxPoint(e+s,i),new mxPoint(e+n,i+l),new mxPoint(e+s,i+r),new mxPoint(e,i+l)],this.isRounded,a,!0),t.fillAndStroke()},__mxOutput.mxRhombus=typeof mxRhombus<"u"?mxRhombus:void 0;function mxPolyline(t,e,i){mxShape.call(this),this.points=t,this.stroke=e,this.strokewidth=i??1}mxUtils.extend(mxPolyline,mxShape),mxPolyline.prototype.getRotation=function(){return 0},mxPolyline.prototype.getShapeRotation=function(){return 0},mxPolyline.prototype.isPaintBoundsInverted=function(){return!1},mxPolyline.prototype.paintEdgeShape=function(t,e){var i=t.pointerEventsValue;t.pointerEventsValue="stroke",this.style==null||this.style[mxConstants.STYLE_CURVED]!=1?this.paintLine(t,e,this.isRounded):this.paintCurvedLine(t,e),t.pointerEventsValue=i},mxPolyline.prototype.paintLine=function(t,e,i){var n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,e,i,n,!1),t.stroke()},mxPolyline.prototype.paintCurvedLine=function(t,e){t.begin();var i=e[0],n=e.length;t.moveTo(i.x,i.y);for(var r=1;r2&&t.setMiterLimit(1.42),t.begin();var P=y,R=S;if(a&&!l)this.paintMarker(t,e[0].x,e[0].y,y,S,p,n,s,u,!0);else{var O=e[0].x+A/2+u*y,_=e[0].y+M/2+u*S,b=e[0].x-A/2+u*y,k=e[0].y-M/2+u*S;l?(t.moveTo(O,_),I.push(function(){t.lineTo(b,k)})):(t.moveTo(b,k),t.lineTo(O,_))}for(var G=0,B=0,j=0,H=0;H=0;H--)I[H]();l?(t.end(),t.stroke()):(t.close(),t.fillAndStroke()),t.setShadow(!1),t.setMiterLimit(4),d&&t.setLineJoin("flat"),e.length>2&&(t.setMiterLimit(4),a&&!l&&(t.begin(),this.paintMarker(t,e[0].x,e[0].y,P,R,p,n,s,u,!0),t.stroke(),t.end()),o&&!l&&(t.begin(),this.paintMarker(t,x.x,x.y,-y,-S,m,r,s,u,!0),t.stroke(),t.end()))}},mxArrowConnector.prototype.paintMarker=function(t,e,i,n,r,s,l,a,o,u){var p=a/l,m=a*r/2,d=-a*n/2,x=(o+s)*n,f=(o+s)*r;u?t.moveTo(e-m+x,i-d+f):t.lineTo(e-m+x,i-d+f),t.lineTo(e-m/p+x,i-d/p+f),t.lineTo(e+o*n,i+o*r),t.lineTo(e+m/p+x,i+d/p+f),t.lineTo(e+m+x,i+d+f)},mxArrowConnector.prototype.isArrowRounded=function(){return this.isRounded},mxArrowConnector.prototype.getStartArrowWidth=function(){return mxConstants.ARROW_WIDTH},mxArrowConnector.prototype.getEndArrowWidth=function(){return mxConstants.ARROW_WIDTH},mxArrowConnector.prototype.getEdgeWidth=function(){return mxConstants.ARROW_WIDTH/3},mxArrowConnector.prototype.isOpenEnded=function(){return!1},mxArrowConnector.prototype.isMarkerStart=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE},mxArrowConnector.prototype.isMarkerEnd=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE},__mxOutput.mxArrowConnector=typeof mxArrowConnector<"u"?mxArrowConnector:void 0;function mxText(t,e,i,n,r,s,l,a,o,u,p,m,d,x,f,g,c,v,y,T,C){mxShape.call(this),this.value=t,this.bounds=e,this.color=r??"black",this.align=i??mxConstants.ALIGN_CENTER,this.valign=n??mxConstants.ALIGN_MIDDLE,this.family=s??mxConstants.DEFAULT_FONTFAMILY,this.size=l??mxConstants.DEFAULT_FONTSIZE,this.fontStyle=a??mxConstants.DEFAULT_FONTSTYLE,this.spacing=parseInt(o||2),this.spacingTop=this.spacing+parseInt(u||0),this.spacingRight=this.spacing+parseInt(p||0),this.spacingBottom=this.spacing+parseInt(m||0),this.spacingLeft=this.spacing+parseInt(d||0),this.horizontal=x??!0,this.background=f,this.border=g,this.wrap=c??!1,this.clipped=v??!1,this.overflow=y??"visible",this.labelPadding=T??0,this.textDirection=C,this.rotation=0,this.updateMargin()}mxUtils.extend(mxText,mxShape),mxText.prototype.baseSpacingTop=0,mxText.prototype.baseSpacingBottom=0,mxText.prototype.baseSpacingLeft=0,mxText.prototype.baseSpacingRight=0,mxText.prototype.replaceLinefeeds=!0,mxText.prototype.verticalTextRotation=-90,mxText.prototype.ignoreClippedStringSize=!0,mxText.prototype.ignoreStringSize=!1,mxText.prototype.textWidthPadding=document.documentMode==8&&!mxClient.IS_EM?4:3,mxText.prototype.lastValue=null,mxText.prototype.cacheEnabled=!0,mxText.prototype.isParseVml=function(){return!1},mxText.prototype.isHtmlAllowed=function(){return document.documentMode!=8||mxClient.IS_EM},mxText.prototype.getSvgScreenOffset=function(){return 0},mxText.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&this.scale>0&&this.bounds!=null&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)},mxText.prototype.paint=function(t,e){var i=this.scale,n=this.bounds.x/i,r=this.bounds.y/i,s=this.bounds.width/i,l=this.bounds.height/i;if(this.updateTransform(t,n,r,s,l),this.configureCanvas(t,n,r,s,l),e)t.updateText(n,r,s,l,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.getTextRotation(),this.node);else{var a=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML,o=a||t instanceof mxVmlCanvas2D?"html":"",u=this.value;!a&&o=="html"&&(u=mxUtils.htmlEntities(u,!1)),o=="html"&&!mxUtils.isNode(this.value)&&(u=mxUtils.replaceTrailingNewlines(u,"

")),u=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&o=="html"?u.replace(/\n/g,"
"):u;var p=this.textDirection;p==mxConstants.TEXT_DIRECTION_AUTO&&!a&&(p=this.getAutoDirection()),p!=mxConstants.TEXT_DIRECTION_LTR&&p!=mxConstants.TEXT_DIRECTION_RTL&&(p=null),t.text(n,r,s,l,u,this.align,this.valign,this.wrap,o,this.overflow,this.clipped,this.getTextRotation(),p)}},mxText.prototype.redraw=function(){if(this.visible&&this.checkBounds()&&this.cacheEnabled&&this.lastValue==this.value&&(mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML))if(this.node.nodeName=="DIV"&&(this.isHtmlAllowed()||!mxClient.IS_VML))mxClient.IS_SVG?this.redrawHtmlShapeWithCss3():(this.updateSize(this.node,this.state==null||this.state.view.textDiv==null),mxClient.IS_IE&&(document.documentMode==null||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()),this.updateBoundingBox();else{var t=this.createCanvas();t!=null&&t.updateText!=null?(t.pointerEvents=this.pointerEvents,this.paint(t,!0),this.destroyCanvas(t),this.updateBoundingBox()):mxShape.prototype.redraw.apply(this,arguments)}else mxShape.prototype.redraw.apply(this,arguments),mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML?this.lastValue=this.value:this.lastValue=null},mxText.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments),this.color="black",this.align=mxConstants.ALIGN_CENTER,this.valign=mxConstants.ALIGN_MIDDLE,this.family=mxConstants.DEFAULT_FONTFAMILY,this.size=mxConstants.DEFAULT_FONTSIZE,this.fontStyle=mxConstants.DEFAULT_FONTSTYLE,this.spacing=2,this.spacingTop=2,this.spacingRight=2,this.spacingBottom=2,this.spacingLeft=2,this.horizontal=!0,delete this.background,delete this.border,this.textDirection=mxConstants.DEFAULT_TEXT_DIRECTION,delete this.margin},mxText.prototype.apply=function(t){var e=this.spacing;mxShape.prototype.apply.apply(this,arguments),this.style!=null&&(this.fontStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,this.fontStyle),this.family=mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,this.family),this.size=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,this.size),this.color=mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,this.color),this.align=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,this.align),this.valign=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,this.valign),this.spacing=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing)),this.spacingTop=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,this.spacingTop-e))+this.spacing,this.spacingRight=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,this.spacingRight-e))+this.spacing,this.spacingBottom=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,this.spacingBottom-e))+this.spacing,this.spacingLeft=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_LEFT,this.spacingLeft-e))+this.spacing,this.horizontal=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,this.horizontal),this.background=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,this.background),this.border=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,this.border),this.textDirection=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_OPACITY,100),this.updateMargin()),this.flipV=null,this.flipH=null},mxText.prototype.getAutoDirection=function(){var t=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(this.value);return t!=null&&t.length>0&&t[0]>"z"?mxConstants.TEXT_DIRECTION_RTL:mxConstants.TEXT_DIRECTION_LTR},mxText.prototype.getContentNode=function(){var t=this.node;return t!=null&&(t.ownerSVGElement==null?t=this.node.firstChild.firstChild:t=t.firstChild.firstChild.firstChild.firstChild.firstChild),t},mxText.prototype.updateBoundingBox=function(){var t=this.node;this.boundingBox=this.bounds.clone();var e=this.getTextRotation(),i=this.style!=null?mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER):null,n=this.style!=null?mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE):null;if(!this.ignoreStringSize&&t!=null&&this.overflow!="fill"&&(!this.clipped||!this.ignoreClippedStringSize||i!=mxConstants.ALIGN_CENTER||n!=mxConstants.ALIGN_MIDDLE)){var r=null,s=null;if(t.ownerSVGElement!=null)if(t.firstChild!=null&&t.firstChild.firstChild!=null&&t.firstChild.firstChild.nodeName=="foreignObject")t=t.firstChild.firstChild.firstChild.firstChild,s=t.offsetHeight*this.scale,this.overflow=="width"?r=this.boundingBox.width:r=t.offsetWidth*this.scale;else try{var l=t.getBBox();typeof this.value=="string"&&mxUtils.trim(this.value)==0?this.boundingBox=null:l.width==0&&l.height==0?this.boundingBox=null:this.boundingBox=new mxRectangle(l.x,l.y,l.width,l.height);return}catch{}else{var a=this.state!=null?this.state.view.textDiv:null;if(this.offsetWidth!=null&&this.offsetHeight!=null)r=this.offsetWidth*this.scale,s=this.offsetHeight*this.scale;else{a!=null&&(this.updateFont(a),this.updateSize(a,!1),this.updateInnerHtml(a),t=a);var o=t;if(document.documentMode==8&&!mxClient.IS_EM){var u=Math.round(this.bounds.width/this.scale);if(this.wrap&&u>0){if(t.style.wordWrap=mxConstants.WORD_WRAP,t.style.whiteSpace="normal",t.style.wordWrap!="break-word"){var p=o.getElementsByTagName("div");p.length>0&&(o=p[p.length-1]),r=o.offsetWidth+2,p=this.node.getElementsByTagName("div"),this.clipped&&(r=Math.min(u,r)),p.length>1&&(p[p.length-2].style.width=r+"px")}}else t.style.whiteSpace="nowrap"}else o.firstChild!=null&&o.firstChild.nodeName=="DIV"&&(o=o.firstChild);this.offsetWidth=o.offsetWidth+this.textWidthPadding,this.offsetHeight=o.offsetHeight,r=this.offsetWidth*this.scale,s=this.offsetHeight*this.scale}}r!=null&&s!=null&&(this.boundingBox=new mxRectangle(this.bounds.x,this.bounds.y,r,s))}if(this.boundingBox!=null)if(e!=0){var m=mxUtils.getBoundingBox(new mxRectangle(this.margin.x*this.boundingBox.width,this.margin.y*this.boundingBox.height,this.boundingBox.width,this.boundingBox.height),e,new mxPoint(0,0));this.unrotatedBoundingBox=mxRectangle.fromRectangle(this.boundingBox),this.unrotatedBoundingBox.x+=this.margin.x*this.unrotatedBoundingBox.width,this.unrotatedBoundingBox.y+=this.margin.y*this.unrotatedBoundingBox.height,this.boundingBox.x+=m.x,this.boundingBox.y+=m.y,this.boundingBox.width=m.width,this.boundingBox.height=m.height}else this.boundingBox.x+=this.margin.x*this.boundingBox.width,this.boundingBox.y+=this.margin.y*this.boundingBox.height,this.unrotatedBoundingBox=null},mxText.prototype.getShapeRotation=function(){return 0},mxText.prototype.getTextRotation=function(){return this.state!=null&&this.state.shape!=null?this.state.shape.getTextRotation():0},mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&this.state!=null&&this.state.view.graph.model.isVertex(this.state.cell)},mxText.prototype.configureCanvas=function(t,e,i,n,r){mxShape.prototype.configureCanvas.apply(this,arguments),t.setFontColor(this.color),t.setFontBackgroundColor(this.background),t.setFontBorderColor(this.border),t.setFontFamily(this.family),t.setFontSize(this.size),t.setFontStyle(this.fontStyle)},mxText.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width="1px",this.node.style.height="1px",this.node.style.overflow="visible"},mxText.prototype.getHtmlValue=function(){var t=this.value;return this.dialect!=mxConstants.DIALECT_STRICTHTML&&(t=mxUtils.htmlEntities(t,!1)),t=mxUtils.replaceTrailingNewlines(t,"

"),t=this.replaceLinefeeds?t.replace(/\n/g,"
"):t,t},mxText.prototype.getTextCss=function(){var t=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,e="display: inline-block; font-size: "+this.size+"px; font-family: "+this.family+"; color: "+this.color+"; line-height: "+t+"; pointer-events: "+(this.pointerEvents?"all":"none")+"; ";(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(e+="font-weight: bold; "),(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(e+="font-style: italic; ");var i=[];return(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&(e+="text-decoration: "+i.join(" ")+"; "),e},mxText.prototype.redrawHtmlShape=function(){if(mxClient.IS_SVG)this.redrawHtmlShapeWithCss3();else{var t=this.node.style;t.whiteSpace="normal",t.overflow="",t.width="",t.height="",this.updateValue(),this.updateFont(this.node),this.updateSize(this.node,this.state==null||this.state.view.textDiv==null),this.offsetWidth=null,this.offsetHeight=null,mxClient.IS_IE&&(document.documentMode==null||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()}},mxText.prototype.redrawHtmlShapeWithCss3=function(){var t=Math.max(0,Math.round(this.bounds.width/this.scale)),e=Math.max(0,Math.round(this.bounds.height/this.scale)),i="position: absolute; left: "+Math.round(this.bounds.x)+"px; top: "+Math.round(this.bounds.y)+"px; pointer-events: none; ",n=this.getTextCss();mxSvgCanvas2D.createCss(t+2,e,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.background!=null?mxUtils.htmlEntities(this.background):null,this.border!=null?mxUtils.htmlEntities(this.border):null,i,n,this.scale,mxUtils.bind(this,function(r,s,l,a,o,u){var p=this.getTextRotation(),m=(this.scale!=1?"scale("+this.scale+") ":"")+(p!=0?"rotate("+p+"deg) ":"")+(this.margin.x!=0||this.margin.y!=0?"translate("+this.margin.x*100+"%,"+this.margin.y*100+"%)":"");m!=""&&(m="transform-origin: 0 0; transform: "+m+"; "),u==""?(l+=a,a="display:inline-block; min-width: 100%; "+m):(a+=m,mxClient.IS_SF&&(a+="-webkit-clip-path: content-box;")),this.opacity<100&&(o+="opacity: "+this.opacity/100+"; "),this.node.setAttribute("style",l);var d=mxUtils.isNode(this.value)?this.value.outerHTML:this.getHtmlValue();this.node.firstChild==null&&(this.node.innerHTML="
"+d+"
"),this.node.firstChild.firstChild.setAttribute("style",o),this.node.firstChild.setAttribute("style",a)}))},mxText.prototype.updateHtmlTransform=function(){var t=this.getTextRotation(),e=this.node.style,i=this.margin.x,n=this.margin.y;t!=0?(mxUtils.setPrefixedStyle(e,"transformOrigin",-i*100+"% "+-n*100+"%"),mxUtils.setPrefixedStyle(e,"transform","translate("+i*100+"%,"+n*100+"%) scale("+this.scale+") rotate("+t+"deg)")):(mxUtils.setPrefixedStyle(e,"transformOrigin","0% 0%"),mxUtils.setPrefixedStyle(e,"transform","scale("+this.scale+") translate("+i*100+"%,"+n*100+"%)")),e.left=Math.round(this.bounds.x-Math.ceil(i*(this.overflow!="fill"&&this.overflow!="width"?3:1)))+"px",e.top=Math.round(this.bounds.y-n*(this.overflow!="fill"?3:1))+"px",this.opacity<100?e.opacity=this.opacity/100:e.opacity=""},mxText.prototype.updateInnerHtml=function(t){if(mxUtils.isNode(this.value))t.innerHTML=this.value.outerHTML;else{var e=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(e=mxUtils.htmlEntities(e,!1)),e=mxUtils.replaceTrailingNewlines(e,"
 
"),e=this.replaceLinefeeds?e.replace(/\n/g,"
"):e,e='
'+e+"
",t.innerHTML=e}},mxText.prototype.updateHtmlFilter=function(){var t=this.node.style,e=this.margin.x,T=this.margin.y,i=this.scale;mxUtils.setOpacity(this.node,this.opacity);var n=0,r=0,s=this.state!=null?this.state.view.textDiv:null,l=this.node;if(s!=null){s.style.overflow="",s.style.height="",s.style.width="",this.updateFont(s),this.updateSize(s,!1),this.updateInnerHtml(s);var a=Math.round(this.bounds.width/this.scale);this.wrap&&a>0?(s.style.whiteSpace="normal",s.style.wordWrap=mxConstants.WORD_WRAP,n=a,this.clipped&&(n=Math.min(n,this.bounds.width)),s.style.width=n+"px"):s.style.whiteSpace="nowrap",l=s,l.firstChild!=null&&l.firstChild.nodeName=="DIV"&&(l=l.firstChild,this.wrap&&s.style.wordWrap=="break-word"&&(l.style.width="100%")),!this.clipped&&this.wrap&&a>0&&(n=l.offsetWidth+this.textWidthPadding,s.style.width=n+"px"),r=l.offsetHeight+2,mxClient.IS_QUIRKS&&this.border!=null&&this.border!=mxConstants.NONE&&(r+=3)}else l.firstChild!=null&&l.firstChild.nodeName=="DIV"&&(l=l.firstChild,r=l.offsetHeight);n=l.offsetWidth+this.textWidthPadding,this.clipped&&(r=Math.min(r,this.bounds.height));var a=this.bounds.width/i,o=this.bounds.height/i;this.overflow=="fill"?(r=o,n=a):this.overflow=="width"&&(r=l.scrollHeight,n=a),this.offsetWidth=n,this.offsetHeight=r,mxClient.IS_QUIRKS&&(this.clipped||this.overflow=="width"&&o>0)?(o=Math.min(o,r),t.height=Math.round(o)+"px"):o=r,this.overflow!="fill"&&this.overflow!="width"&&(this.clipped&&(n=Math.min(a,n)),a=n,(mxClient.IS_QUIRKS&&this.clipped||this.wrap)&&(t.width=Math.round(a)+"px")),o*=i,a*=i;var u=this.getTextRotation()*(Math.PI/180),p=parseFloat(parseFloat(Math.cos(u)).toFixed(8)),m=parseFloat(parseFloat(Math.sin(-u)).toFixed(8));u%=2*Math.PI,u<0&&(u+=2*Math.PI),u%=Math.PI,u>Math.PI/2&&(u=Math.PI-u);var d=Math.cos(u),x=Math.sin(-u),f=a*-(e+.5),g=o*-(T+.5),c=(o-o*d+a*x)/2+m*f-p*g,v=(a-a*d+o*x)/2-p*f-m*g;if(u!=0){var y="progid:DXImageTransform.Microsoft.Matrix(M11="+p+", M12="+m+", M21="+-m+", M22="+p+", sizingMethod='auto expand')";t.filter!=null&&t.filter.length>0?t.filter+=" "+y:t.filter=y}var T=0;this.overflow!="fill"&&mxClient.IS_QUIRKS&&(this.valign==mxConstants.ALIGN_TOP?T-=1:this.valign==mxConstants.ALIGN_BOTTOM?T+=2:T+=1),t.zoom=i,t.left=Math.round(this.bounds.x+v-a/2)+"px",t.top=Math.round(this.bounds.y+c-o/2+T)+"px"},mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var t=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(t=mxUtils.htmlEntities(t,!1)),t=mxUtils.replaceTrailingNewlines(t,"

"),t=this.replaceLinefeeds?t.replace(/\n/g,"
"):t;var e=this.background!=null&&this.background!=mxConstants.NONE?this.background:null,i=this.border!=null&&this.border!=mxConstants.NONE?this.border:null;if(this.overflow=="fill"||this.overflow=="width")e!=null&&(this.node.style.backgroundColor=e),i!=null&&(this.node.style.border="1px solid "+i);else{var n="";e!=null&&(n+="background-color:"+mxUtils.htmlEntities(e)+";"),i!=null&&(n+="border:1px solid "+mxUtils.htmlEntities(i)+";");var r=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT;t='
'+t+"
"}this.node.innerHTML=t;var s=this.node.getElementsByTagName("div");if(s.length>0){var l=this.textDirection;l==mxConstants.TEXT_DIRECTION_AUTO&&this.dialect!=mxConstants.DIALECT_STRICTHTML&&(l=this.getAutoDirection()),l==mxConstants.TEXT_DIRECTION_LTR||l==mxConstants.TEXT_DIRECTION_RTL?s[s.length-1].setAttribute("dir",l):s[s.length-1].removeAttribute("dir")}}},mxText.prototype.updateFont=function(t){var e=t.style;e.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,e.fontSize=this.size+"px",e.fontFamily=this.family,e.verticalAlign="top",e.color=this.color,(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?e.fontWeight="bold":e.fontWeight="",(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?e.fontStyle="italic":e.fontStyle="";var i=[];(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),e.textDecoration=i.join(" "),this.align==mxConstants.ALIGN_CENTER?e.textAlign="center":this.align==mxConstants.ALIGN_RIGHT?e.textAlign="right":e.textAlign="left"},mxText.prototype.updateSize=function(t,e){var i=Math.max(0,Math.round(this.bounds.width/this.scale)),n=Math.max(0,Math.round(this.bounds.height/this.scale)),r=t.style;if(this.clipped?(r.overflow="hidden",mxClient.IS_QUIRKS?r.width=i+"px":(r.maxHeight=n+"px",r.maxWidth=i+"px")):this.overflow=="fill"?(r.width=i+1+"px",r.height=n+1+"px",r.overflow="hidden"):this.overflow=="width"&&(r.width=i+1+"px",r.maxHeight=n+1+"px",r.overflow="hidden"),this.wrap&&i>0){if(r.wordWrap=mxConstants.WORD_WRAP,r.whiteSpace="normal",r.width=i+"px",e&&this.overflow!="fill"&&this.overflow!="width"){var s=t;s.firstChild!=null&&s.firstChild.nodeName=="DIV"&&(s=s.firstChild,t.style.wordWrap=="break-word"&&(s.style.width="100%"));var l=s.offsetWidth;if(l==0){var a=t.parentNode;t.style.visibility="hidden",document.body.appendChild(t),l=s.offsetWidth,t.style.visibility="",a.appendChild(t)}l+=3,this.clipped&&(l=Math.min(l,i)),r.width=l+"px"}}else r.whiteSpace="nowrap"},mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)},mxText.prototype.getSpacing=function(){var t=0,e=0;return this.align==mxConstants.ALIGN_CENTER?t=(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?t=-this.spacingRight-this.baseSpacingRight:t=this.spacingLeft+this.baseSpacingLeft,this.valign==mxConstants.ALIGN_MIDDLE?e=(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?e=-this.spacingBottom-this.baseSpacingBottom:e=this.spacingTop+this.baseSpacingTop,new mxPoint(t,e)},__mxOutput.mxText=typeof mxText<"u"?mxText:void 0;function mxTriangle(){mxActor.call(this)}mxUtils.extend(mxTriangle,mxActor),mxTriangle.prototype.isRoundable=function(){return!0},mxTriangle.prototype.redrawPath=function(t,e,i,n,r){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,0),new mxPoint(n,.5*r),new mxPoint(0,r)],this.isRounded,s,!0)},__mxOutput.mxTriangle=typeof mxTriangle<"u"?mxTriangle:void 0;function mxHexagon(){mxActor.call(this)}mxUtils.extend(mxHexagon,mxActor),mxHexagon.prototype.redrawPath=function(t,e,i,n,r){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(.25*n,0),new mxPoint(.75*n,0),new mxPoint(n,.5*r),new mxPoint(.75*n,r),new mxPoint(.25*n,r),new mxPoint(0,.5*r)],this.isRounded,s,!0)},__mxOutput.mxHexagon=typeof mxHexagon<"u"?mxHexagon:void 0;function mxLine(t,e,i,n){mxShape.call(this),this.bounds=t,this.stroke=e,this.strokewidth=i??1,this.vertical=n??this.vertical}mxUtils.extend(mxLine,mxShape),mxLine.prototype.vertical=!1,mxLine.prototype.paintVertexShape=function(t,e,i,n,r){if(t.begin(),this.vertical){var s=e+n/2;t.moveTo(s,i),t.lineTo(s,i+r)}else{var s=i+r/2;t.moveTo(e,s),t.lineTo(e+n,s)}t.stroke()},__mxOutput.mxLine=typeof mxLine<"u"?mxLine:void 0;function mxImageShape(t,e,i,n,r){mxShape.call(this),this.bounds=t,this.image=e,this.fill=i,this.stroke=n,this.strokewidth=r??1,this.shadow=!1}mxUtils.extend(mxImageShape,mxRectangleShape),mxImageShape.prototype.preserveImageAspect=!0,mxImageShape.prototype.getSvgScreenOffset=function(){return 0},mxImageShape.prototype.apply=function(t){mxShape.prototype.apply.apply(this,arguments),this.fill=null,this.stroke=null,this.gradient=null,this.style!=null&&(this.preserveImageAspect=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1)==1,this.flipH=this.flipH||mxUtils.getValue(this.style,"imageFlipH",0)==1,this.flipV=this.flipV||mxUtils.getValue(this.style,"imageFlipV",0)==1)},mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect},mxImageShape.prototype.createHtml=function(){var t=document.createElement("div");return t.style.position="absolute",t},mxImageShape.prototype.isRoundable=function(t,e,i,n,r){return!1},mxImageShape.prototype.paintVertexShape=function(t,e,i,n,r){if(this.image!=null){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),l=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);s!=null&&(t.setFillColor(s),t.setStrokeColor(l),t.rect(e,i,n,r),t.fillAndStroke()),t.image(e,i,n,r,this.image,this.preserveImageAspect,!1,!1);var l=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);l!=null&&(t.setShadow(!1),t.setStrokeColor(l),t.rect(e,i,n,r),t.stroke())}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)},mxImageShape.prototype.redrawHtmlShape=function(){if(this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px",this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px",this.node.innerHTML="",this.image!=null){var t=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,""),e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,"");this.node.style.backgroundColor=t,this.node.style.borderColor=e;var i=mxClient.IS_IE6||(document.documentMode==null||document.documentMode<=8)&&this.rotation!=0,n=document.createElement(i?mxClient.VML_PREFIX+":image":"img");n.setAttribute("border","0"),n.style.position="absolute",n.src=this.image;var r=this.opacity<100?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=r,this.flipH&&this.flipV?r+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?r+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(r+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"),n.style.filter!=r&&(n.style.filter=r),n.nodeName=="image"?n.style.rotation=this.rotation:this.rotation!=0?mxUtils.setPrefixedStyle(n.style,"transform","rotate("+this.rotation+"deg)"):mxUtils.setPrefixedStyle(n.style,"transform",""),n.style.width=this.node.style.width,n.style.height=this.node.style.height,this.node.style.backgroundImage="",this.node.appendChild(n)}else this.setTransparentBackgroundImage(this.node)},__mxOutput.mxImageShape=typeof mxImageShape<"u"?mxImageShape:void 0;function mxLabel(t,e,i,n){mxRectangleShape.call(this,t,e,i,n)}mxUtils.extend(mxLabel,mxRectangleShape),mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE,mxLabel.prototype.spacing=2,mxLabel.prototype.indicatorSize=10,mxLabel.prototype.indicatorSpacing=2,mxLabel.prototype.init=function(t){mxShape.prototype.init.apply(this,arguments),this.indicatorShape!=null&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.init(this.node))},mxLabel.prototype.redraw=function(){this.indicator!=null&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorStrokeColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection,this.indicator.redraw()),mxShape.prototype.redraw.apply(this,arguments)},mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&this.indicatorColor==null&&this.indicatorShape==null},mxLabel.prototype.paintForeground=function(t,e,i,n,r){this.paintImage(t,e,i,n,r),this.paintIndicator(t,e,i,n,r),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxLabel.prototype.paintImage=function(t,e,i,n,r){if(this.image!=null){var s=this.getImageBounds(e,i,n,r);t.image(s.x,s.y,s.width,s.height,this.image,!1,!1,!1)}},mxLabel.prototype.getImageBounds=function(t,e,i,n){var r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),a=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;return r==mxConstants.ALIGN_CENTER?t+=(i-l)/2:r==mxConstants.ALIGN_RIGHT?t+=i-l-o:t+=o,s==mxConstants.ALIGN_TOP?e+=o:s==mxConstants.ALIGN_BOTTOM?e+=n-a-o:e+=(n-a)/2,new mxRectangle(t,e,l,a)},mxLabel.prototype.paintIndicator=function(t,e,i,n,r){if(this.indicator!=null)this.indicator.bounds=this.getIndicatorBounds(e,i,n,r),this.indicator.paint(t);else if(this.indicatorImage!=null){var s=this.getIndicatorBounds(e,i,n,r);t.image(s.x,s.y,s.width,s.height,this.indicatorImage,!1,!1,!1)}},mxLabel.prototype.getIndicatorBounds=function(t,e,i,n){var r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),a=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),o=this.spacing+5;return r==mxConstants.ALIGN_RIGHT?t+=i-l-o:r==mxConstants.ALIGN_CENTER?t+=(i-l)/2:t+=o,s==mxConstants.ALIGN_BOTTOM?e+=n-a-o:s==mxConstants.ALIGN_TOP?e+=o:e+=(n-a)/2,new mxRectangle(t,e,l,a)},mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(this.image!=null){var t=document.createElement("img");t.style.position="relative",t.setAttribute("border","0");var e=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);e.x-=this.bounds.x,e.y-=this.bounds.y,t.style.left=Math.round(e.x)+"px",t.style.top=Math.round(e.y)+"px",t.style.width=Math.round(e.width)+"px",t.style.height=Math.round(e.height)+"px",t.src=this.image,this.node.appendChild(t)}},__mxOutput.mxLabel=typeof mxLabel<"u"?mxLabel:void 0;function mxCylinder(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxCylinder,mxShape),mxCylinder.prototype.maxHeight=40,mxCylinder.prototype.svgStrokeTolerance=0,mxCylinder.prototype.paintVertexShape=function(t,e,i,n,r){t.translate(e,i),t.begin(),this.redrawPath(t,e,i,n,r,!1),t.fillAndStroke(),(!this.outline||this.style==null||mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)==0)&&(t.setShadow(!1),t.begin(),this.redrawPath(t,e,i,n,r,!0),t.stroke())},mxCylinder.prototype.getCylinderSize=function(t,e,i,n){return Math.min(this.maxHeight,Math.round(n/5))},mxCylinder.prototype.redrawPath=function(t,e,i,n,r,s){var l=this.getCylinderSize(e,i,n,r);(s&&this.fill!=null||!s&&this.fill==null)&&(t.moveTo(0,l),t.curveTo(0,2*l,n,2*l,n,l),s||(t.stroke(),t.begin())),s||(t.moveTo(0,l),t.curveTo(0,-l/3,n,-l/3,n,l),t.lineTo(n,r-l),t.curveTo(n,r+l/3,0,r+l/3,0,r-l),t.close())},__mxOutput.mxCylinder=typeof mxCylinder<"u"?mxCylinder:void 0;function mxConnector(t,e,i){mxPolyline.call(this,t,e,i)}mxUtils.extend(mxConnector,mxPolyline),mxConnector.prototype.updateBoundingBox=function(){this.useSvgBoundingBox=this.style!=null&&this.style[mxConstants.STYLE_CURVED]==1,mxShape.prototype.updateBoundingBox.apply(this,arguments)},mxConnector.prototype.paintEdgeShape=function(t,e){var i=this.createMarker(t,e,!0),n=this.createMarker(t,e,!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments),t.setFillColor(this.stroke),t.setShadow(!1),t.setDashed(!1),i!=null&&i(),n!=null&&n()},mxConnector.prototype.createMarker=function(t,e,i){var n=null,r=e.length,s=mxUtils.getValue(this.style,i?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW),l=i?e[1]:e[r-2],a=i?e[0]:e[r-1];if(s!=null&&l!=null&&a!=null){for(var o=1;o0)for(var a=0;at.weightedValue?-1:e.weightedValueu)break;a=x}}}var f=r.getIndex(t);f=Math.max(0,l-(l>f?1:0)),n.add(r,t,f)}},mxStackLayout.prototype.getParentSize=function(t){var e=this.graph.getModel(),i=e.getGeometry(t);if(this.graph.container!=null&&(i==null&&e.isLayer(t)||t==this.graph.getView().currentRoot)){var n=this.graph.container.offsetWidth-1,r=this.graph.container.offsetHeight-1;i=new mxRectangle(0,0,n,r)}return i},mxStackLayout.prototype.getLayoutCells=function(t){for(var e=this.graph.getModel(),i=e.getChildCount(t),n=[],r=0;ru.x>0?1:-1:o.y==u.y?0:o.y>u.y>0?1:-1})),n},mxStackLayout.prototype.snap=function(t){if(this.gridSize!=null&&this.gridSize>0&&(t=Math.max(t,this.gridSize),t/this.gridSize>1)){var e=t%this.gridSize;t+=e>this.gridSize/2?this.gridSize-e:-e}return t},mxStackLayout.prototype.execute=function(t){if(t!=null){var e=this.getParentSize(t),i=this.isHorizontal(),n=this.graph.getModel(),r=null;e!=null&&(r=i?e.height-this.marginTop-this.marginBottom:e.width-this.marginLeft-this.marginRight),r-=2*this.border;var s=this.x0+this.border+this.marginLeft,l=this.y0+this.border+this.marginTop;if(this.graph.isSwimlane(t)){var a=this.graph.getCellStyle(t),o=mxUtils.getNumber(a,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE),u=mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,!0)==1;e!=null&&(u?o=Math.min(o,e.height):o=Math.min(o,e.width)),i==u&&(r-=o),u?l+=o:s+=o}n.beginUpdate();try{for(var p=0,m=null,d=0,x=null,f=this.getLayoutCells(t),g=0;gthis.wrap||!i&&m.y+m.height+v.height+2*this.spacing>this.wrap)&&(m=null,i?l+=p+this.spacing:s+=p+this.spacing,p=0),p=Math.max(p,i?v.height:v.width);var y=0;if(!this.borderCollapse){var T=this.graph.getCellStyle(c);y=mxUtils.getNumber(T,mxConstants.STYLE_STROKEWIDTH,1)}if(m!=null){var C=d+this.spacing+Math.floor(y/2);i?v.x=this.snap((this.allowGaps?Math.max(C,v.x):C)-this.marginLeft)+this.marginLeft:v.y=this.snap((this.allowGaps?Math.max(C,v.y):C)-this.marginTop)+this.marginTop}else this.keepFirstLocation||(i?v.x=this.allowGaps&&v.x>s?Math.max(this.snap(v.x-this.marginLeft)+this.marginLeft,s):s:v.y=this.allowGaps&&v.y>l?Math.max(this.snap(v.y-this.marginTop)+this.marginTop,l):l);i?v.y=l:v.x=s,this.fill&&r!=null&&(i?v.height=r:v.width=r),i?v.width=this.snap(v.width):v.height=this.snap(v.height),this.setChildGeometry(c,v),x=c,m=v,i?d=m.x+m.width+Math.floor(y/2):d=m.y+m.height+Math.floor(y/2)}}this.resizeParent&&e!=null&&m!=null&&!this.graph.isCellCollapsed(t)?this.updateParentGeometry(t,e,m):this.resizeLast&&e!=null&&m!=null&&x!=null&&(i?m.width=e.width-m.x-this.spacing-this.marginRight-this.marginLeft:m.height=e.height-m.y-this.spacing-this.marginBottom,this.setChildGeometry(x,m))}finally{n.endUpdate()}}},mxStackLayout.prototype.setChildGeometry=function(t,e){var i=this.graph.getCellGeometry(t);(i==null||e.x!=i.x||e.y!=i.y||e.width!=i.width||e.height!=i.height)&&this.graph.getModel().setGeometry(t,e)},mxStackLayout.prototype.updateParentGeometry=function(t,e,i){var n=this.isHorizontal(),r=this.graph.getModel(),s=e.clone();if(n){var l=i.x+i.width+this.marginRight+this.border;this.resizeParentMax?s.width=Math.max(s.width,l):s.width=l}else{var l=i.y+i.height+this.marginBottom+this.border;this.resizeParentMax?s.height=Math.max(s.height,l):s.height=l}(e.x!=s.x||e.y!=s.y||e.width!=s.width||e.height!=s.height)&&r.setGeometry(t,s)},__mxOutput.mxStackLayout=typeof mxStackLayout<"u"?mxStackLayout:void 0;function mxPartitionLayout(t,e,i,n){mxGraphLayout.call(this,t),this.horizontal=e??!0,this.spacing=i||0,this.border=n||0}mxPartitionLayout.prototype=new mxGraphLayout,mxPartitionLayout.prototype.constructor=mxPartitionLayout,mxPartitionLayout.prototype.horizontal=null,mxPartitionLayout.prototype.spacing=null,mxPartitionLayout.prototype.border=null,mxPartitionLayout.prototype.resizeVertices=!0,mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal},mxPartitionLayout.prototype.moveCell=function(t,e,i){var n=this.graph.getModel(),r=n.getParent(t);if(t!=null&&r!=null){var s=0,l=0,a=n.getChildCount(r);for(s=0;se)break;l=p}}var m=r.getIndex(t);m=Math.max(0,s-(s>m?1:0)),n.add(r,t,m)}},mxPartitionLayout.prototype.execute=function(t){var e=this.isHorizontal(),i=this.graph.getModel(),n=i.getGeometry(t);if(this.graph.container!=null&&(n==null&&i.isLayer(t)||t==this.graph.getView().currentRoot)){var r=this.graph.container.offsetWidth-1,s=this.graph.container.offsetHeight-1;n=new mxRectangle(0,0,r,s)}if(n!=null){for(var l=[],a=i.getChildCount(t),o=0;o0){var m=this.border,d=this.border,x=e?n.height:n.width;x-=2*this.border;var f=this.graph.isSwimlane(t)?this.graph.getStartSize(t):new mxRectangle;x-=e?f.height:f.width,m=m+f.width,d=d+f.height;var g=this.border+(p-1)*this.spacing,c=e?(n.width-m-g)/p:(n.height-d-g)/p;if(c>0){i.beginUpdate();try{for(var o=0;o0)this.root=t;else{var n=this.graph.findTreeRoots(t,!0,this.invert);if(n.length>0){for(var r=0;r0){this.root=n[r];break}}}else this.root=e;if(this.root!=null){if(this.resizeParent?this.parentsChanged=new Object:this.parentsChanged=null,this.parentX=null,this.parentY=null,t!=this.root&&i.isVertex(t)!=null&&this.maintainParentLocation){var s=this.graph.getCellGeometry(t);s!=null&&(this.parentX=s.x,this.parentY=s.y)}i.beginUpdate();try{if(this.visited=new Object,this.node=this.dfs(this.root,t),this.alignRanks&&(this.maxRankHeight=[],this.findRankHeights(this.node,0),this.setCellHeights(this.node,0)),this.node!=null){this.layout(this.node);var l=this.graph.gridSize,a=l;if(!this.moveTree){var o=this.getVertexBounds(this.root);o!=null&&(l=o.x,a=o.y)}var u=null;if(this.isHorizontal()?u=this.horizontalLayout(this.node,l,a):u=this.verticalLayout(this.node,null,l,a),u!=null){var p=0,m=0;u.x<0&&(p=Math.abs(l-u.x)),u.y<0&&(m=Math.abs(a-u.y)),(p!=0||m!=0)&&this.moveNode(this.node,p,m),this.resizeParent&&this.adjustParents(),this.edgeRouting&&this.localEdgeProcessing(this.node)}if(this.parentX!=null&&this.parentY!=null){var s=this.graph.getCellGeometry(t);s!=null&&(s=s.clone(),s.x=this.parentX,s.y=this.parentY,i.setGeometry(t,s))}}}finally{i.endUpdate()}}},mxCompactTreeLayout.prototype.moveNode=function(t,e,i){t.x+=e,t.y+=i,this.apply(t);for(var n=t.child;n!=null;)this.moveNode(n,e,i),n=n.next},mxCompactTreeLayout.prototype.sortOutgoingEdges=function(t,e){var i=new mxDictionary;e.sort(function(n,r){var s=n.getTerminal(n.getTerminal(!1)==t),l=i.get(s);l==null&&(l=mxCellPath.create(s).split(mxCellPath.PATH_SEPARATOR),i.put(s,l));var a=r.getTerminal(r.getTerminal(!1)==t),o=i.get(a);return o==null&&(o=mxCellPath.create(a).split(mxCellPath.PATH_SEPARATOR),i.put(a,o)),mxCellPath.compare(l,o)})},mxCompactTreeLayout.prototype.findRankHeights=function(t,e){(this.maxRankHeight[e]==null||this.maxRankHeight[e]t.height&&(t.height=this.maxRankHeight[e]);for(var i=t.child;i!=null;)this.setCellHeights(i,e+1),i=i.next},mxCompactTreeLayout.prototype.dfs=function(t,e){var i=mxCellPath.create(t),n=null;if(t!=null&&this.visited[i]==null&&!this.isVertexIgnored(t)){this.visited[i]=t,n=this.createNode(t);var r=this.graph.getModel(),s=null,l=this.graph.getEdges(t,e,this.invert,!this.invert,!1,!0),a=this.graph.getView();this.sortEdges&&this.sortOutgoingEdges(t,l);for(var o=0;o0)if(t<0){var o=t*n;l=o/i-e}else if(t>0){var o=t*s;l=o/r-e}else l=-e;else if(rt+i){var o=(i+t)*s;l=o/r-(e+n)}else l=s-(e+n);return l>0?l:0},mxCompactTreeLayout.prototype.bridge=function(t,e,i,n,r,s){var l=r+n.dx-e,a=0,o=0;n.dx==0?a=n.dy:(o=l*n.dy,a=o/n.dx);var u=this.createLine(l,a,n.next);return t.next=this.createLine(0,s+n.dy-a-i,u),u},mxCompactTreeLayout.prototype.createNode=function(t){var e=new Object;e.cell=t,e.x=0,e.y=0,e.width=0,e.height=0;var i=this.getVertexBounds(t);return i!=null&&(this.isHorizontal()?(e.width=i.height,e.height=i.width):(e.width=i.width,e.height=i.height)),e.offsetX=0,e.offsetY=0,e.contour=new Object,e},mxCompactTreeLayout.prototype.apply=function(t,e){var i=this.graph.getModel(),n=t.cell,r=i.getGeometry(n);if(n!=null&&r!=null){if(this.isVertexMovable(n)&&(r=this.setVertexLocation(n,t.x,t.y),this.resizeParent)){var s=i.getParent(n),l=mxCellPath.create(s);this.parentsChanged[l]==null&&(this.parentsChanged[l]=s)}e==null?e=new mxRectangle(r.x,r.y,r.width,r.height):e=new mxRectangle(Math.min(e.x,r.x),Math.min(e.y,r.y),Math.max(e.x+e.width,r.x+r.width),Math.max(e.y+e.height,r.y+r.height))}return e},mxCompactTreeLayout.prototype.createLine=function(t,e,i){var n=new Object;return n.dx=t,n.dy=e,n.next=i,n},mxCompactTreeLayout.prototype.adjustParents=function(){var t=[];for(var e in this.parentsChanged)t.push(this.parentsChanged[e]);this.arrangeGroups(mxUtils.sortCells(t,!0),this.groupPadding,this.groupPaddingTop,this.groupPaddingRight,this.groupPaddingBottom,this.groupPaddingLeft)},mxCompactTreeLayout.prototype.localEdgeProcessing=function(t){this.processNodeOutgoing(t);for(var e=t.child;e!=null;)this.localEdgeProcessing(e),e=e.next},mxCompactTreeLayout.prototype.processNodeOutgoing=function(t){for(var e=t.child,i=t.cell,n=0,r=[];e!=null;){n++;var s=e.x;this.horizontal&&(s=e.y),r.push(new WeightedCellSorter(e,s)),e=e.next}r.sort(WeightedCellSorter.prototype.compare);var l=t.width,a=(n+1)*this.prefHozEdgeSep;l>a+2*this.prefHozEdgeSep&&(l-=2*this.prefHozEdgeSep);var o=l/n,u=o/2;l>a+2*this.prefHozEdgeSep&&(u+=this.prefHozEdgeSep);var p=this.minEdgeJetty-this.prefVertEdgeOff,m=this.getVertexBounds(i);e=t.child;for(var d=0;dn/2&&(p-=this.prefVertEdgeOff),u+=o}},__mxOutput.mxCompactTreeLayout=typeof mxCompactTreeLayout<"u"?mxCompactTreeLayout:void 0;function mxRadialTreeLayout(t){mxCompactTreeLayout.call(this,t,!1)}mxUtils.extend(mxRadialTreeLayout,mxCompactTreeLayout),mxRadialTreeLayout.prototype.angleOffset=.5,mxRadialTreeLayout.prototype.rootx=0,mxRadialTreeLayout.prototype.rooty=0,mxRadialTreeLayout.prototype.levelDistance=120,mxRadialTreeLayout.prototype.nodeDistance=10,mxRadialTreeLayout.prototype.autoRadius=!1,mxRadialTreeLayout.prototype.sortEdges=!1,mxRadialTreeLayout.prototype.rowMinX=[],mxRadialTreeLayout.prototype.rowMaxX=[],mxRadialTreeLayout.prototype.rowMinCenX=[],mxRadialTreeLayout.prototype.rowMaxCenX=[],mxRadialTreeLayout.prototype.rowRadi=[],mxRadialTreeLayout.prototype.row=[],mxRadialTreeLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||this.graph.getConnections(t).length==0},mxRadialTreeLayout.prototype.execute=function(t,e){this.parent=t,this.useBoundingBox=!1,this.edgeRouting=!1,mxCompactTreeLayout.prototype.execute.apply(this,arguments);var i=null,n=this.getVertexBounds(this.root);this.centerX=n.x+n.width/2,this.centerY=n.y+n.height/2;for(var r in this.visited){var s=this.getVertexBounds(this.visited[r]);i=i??s.clone(),i.add(s)}this.calcRowDims([this.node],0);for(var l=0,a=0,o=0;o=0;o--)for(var g=this.row[o],f=0;f0){var E=S/C;if(E>c.theta&&f0){var A=g[f-1].theta;c.theta=Math.max(E,A+Math.PI/10)}}}for(var o=0;othis.maxDistanceLimit)continue;l1&&this.layout(r)}}finally{this.graph.model.endUpdate()}},mxParallelEdgeLayout.prototype.findParallels=function(t,e){var i=[],n=mxUtils.bind(this,function(a){if(!this.isEdgeIgnored(a)){var o=this.getEdgeId(a);o!=null&&(i[o]==null&&(i[o]=[]),i[o].push(a))}});if(e!=null)for(var r=0;rn?n+"-"+i:i+"-"+n)+r}return null},mxParallelEdgeLayout.prototype.layout=function(t){var e=t[0],i=this.graph.getView(),n=this.graph.getModel(),r=n.getGeometry(i.getVisibleTerminal(e,!0)),s=n.getGeometry(i.getVisibleTerminal(e,!1));if(r==s)for(var l=r.x+r.width+this.spacing,a=r.y+r.height/2,o=0;o0){var l=u+x/2,a=p+f/2,c=f*this.spacing/g,v=x*this.spacing/g;l+=c*(t.length-1)/2,a-=v*(t.length-1)/2;for(var o=0;o0?this.edges[0]:null},__mxOutput.mxGraphHierarchyEdge=typeof mxGraphHierarchyEdge<"u"?mxGraphHierarchyEdge:void 0;function mxGraphHierarchyModel(t,e,i,n,r){t.getGraph(),this.tightenToSource=r,this.roots=i,this.parent=n,this.vertexMapper=new mxDictionary,this.edgeMapper=new mxDictionary,this.maxRank=0;var s=[];e==null&&(e=this.graph.getChildVertices(n)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(t,e,s);for(var l=0;l0){var m=p[0],d=t.getVisibleTerminal(m,!1),x=this.vertexMapper.get(d);s[l]==x&&(d=t.getVisibleTerminal(m,!0),x=this.vertexMapper.get(d)),x!=null&&s[l]!=x&&(u.target=x,x.connectsAsTarget.length==0&&(x.connectsAsTarget=[]),mxUtils.indexOf(x.connectsAsTarget,u)<0&&x.connectsAsTarget.push(u))}}s[l].temp[0]=1}}mxGraphHierarchyModel.prototype.maxRank=null,mxGraphHierarchyModel.prototype.vertexMapper=null,mxGraphHierarchyModel.prototype.edgeMapper=null,mxGraphHierarchyModel.prototype.ranks=null,mxGraphHierarchyModel.prototype.roots=null,mxGraphHierarchyModel.prototype.parent=null,mxGraphHierarchyModel.prototype.dfsCount=0,mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1e8,mxGraphHierarchyModel.prototype.tightenToSource=!1,mxGraphHierarchyModel.prototype.createInternalCells=function(t,e,i){for(var n=t.getGraph(),r=0;r0&&this.edgeMapper.get(o[0])==null&&u.length*2>=o.length){for(var p=new mxGraphHierarchyEdge(o),m=0;m0;){var i=t[0],s,l;s=i.connectsAsTarget,l=i.connectsAsSource;for(var a=!0,o=this.SOURCESCANSTARTRANK,e=0;e1){o.maxRank=l.maxRank,o.minRank=a.maxRank,o.temp=[],o.x=[],o.y=[];for(var d=o.minRank+1;d0){var m=p[0],d=t.getVisibleTerminal(m,!1),x=this.vertexMapper.get(d);s[l]==x&&(d=t.getVisibleTerminal(m,!0),x=this.vertexMapper.get(d)),x!=null&&s[l]!=x&&(u.target=x,x.connectsAsTarget.length==0&&(x.connectsAsTarget=[]),mxUtils.indexOf(x.connectsAsTarget,u)<0&&x.connectsAsTarget.push(u))}}s[l].temp[0]=1}}mxSwimlaneModel.prototype.maxRank=null,mxSwimlaneModel.prototype.vertexMapper=null,mxSwimlaneModel.prototype.edgeMapper=null,mxSwimlaneModel.prototype.ranks=null,mxSwimlaneModel.prototype.roots=null,mxSwimlaneModel.prototype.parent=null,mxSwimlaneModel.prototype.dfsCount=0,mxSwimlaneModel.prototype.SOURCESCANSTARTRANK=1e8,mxSwimlaneModel.prototype.tightenToSource=!1,mxSwimlaneModel.prototype.ranksPerGroup=null,mxSwimlaneModel.prototype.createInternalCells=function(t,e,i){for(var n=t.getGraph(),r=t.swimlanes,s=0;s0&&this.edgeMapper.get(p[0])==null&&m.length*2>=p.length){for(var d=new mxGraphHierarchyEdge(p),x=0;x=0;i--)i==this.ranksPerGroup.length-1?r[i]=0:r[i]=s[i+1]+1,s[i]=r[i]+this.ranksPerGroup[i];this.maxRank=s[0];for(var l=this.vertexMapper.getValues(),i=0;i0;){var n=t[0],a,o;a=n.connectsAsTarget,o=n.connectsAsSource;for(var u=!0,p=s[0],i=0;is[n.swimlaneIndex]&&(p=s[n.swimlaneIndex]),n.temp[0]=p,o!=null)for(var i=0;i1){o.maxRank=l.maxRank,o.minRank=a.maxRank,o.temp=[],o.x=[],o.y=[];for(var d=o.minRank+1;d0;)T%2&&(i+=v[T+1]),T=T-1>>1,++v[T]}return i},mxMedianHybridCrossingReduction.prototype.transpose=function(t,e){for(var i=!0,n=0,r=10;i&&n++y[M]&&L++,c[E]T[M]&&L++,v[E]=0;n--)this.medianRank(n,i);else for(var n=1;nt.medianValue?-1:e.medianValue0&&u<=o;){var m=e.shift(),d=m.cell,x=m.weightedValue,f=parseInt(m.rankIndex),g=d.getNextLayerConnectedCells(x),c=d.getPreviousLayerConnectedCells(x),v=g.length,y=c.length,T=this.medianXValue(g,x+1),C=this.medianXValue(c,x-1),S=v+y,E=d.getGeneralPurposeVariable(x),L=E;S>0&&(L=(T*v+C*y)/S);var A=!1;if(LE+p){var P=n[x].length;if(f==P-1)d.setGeneralPurposeVariable(x,L),A=!0;else{var R=n[x][f+1],O=R.getGeneralPurposeVariable(x);O=O-R.width/2-this.intraCellSpacing-d.width/2,O>L?(d.setGeneralPurposeVariable(x,L),A=!0):O>d.getGeneralPurposeVariable(x)+p&&(d.setGeneralPurposeVariable(x,O),A=!0)}}if(A){for(var r=0;r0;n--)this.rankMedianPosition(n-1,e,n);else for(var n=0;n0?m=this.medianXValue(o,i):m=p.getGeneralPurposeVariable(t));for(var d=0,x=-1e8,f=r[l].rankIndex-1;f>=0;){var g=s[n[f].id];if(g!=null){var c=g.cell;g.visited?(x=c.getGeneralPurposeVariable(t)+c.width/2+this.intraCellSpacing+d+p.width/2,f=-1):(d+=c.width+this.intraCellSpacing,f--)}}for(var v=0,y=1e8,f=r[l].rankIndex+1;f=x&&m<=y?p.setGeneralPurposeVariable(t,m):my&&(p.setGeneralPurposeVariable(t,y),this.currentXDelta+=m-y),r[l].visited=!0}},mxCoordinateAssignment.prototype.calculatedWeightedValue=function(t,e){for(var i=0,n=0;n=0;i--)i0&&this.rankCoordinates(i,t,e)},mxCoordinateAssignment.prototype.rankCoordinates=function(t,e,i){for(var n=i.ranks[t],r=0,s=this.initialX+(this.widestRankValue-this.rankWidths[t])/2,l=!1,a=0;a=0;r--){for(var s=0,l=e.ranks[r],a=this.initialX,o=!1,u=0;uthis.widestRankValue&&(this.widestRankValue=a,this.widestRank=r),this.rankWidths[r]=a}o==!0&&mxLog.warn("At least one cell has no bounds"),this.rankY[r]=i;var x=s/2+n/2+this.interRankCellSpacing;n=s,this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?i+=x:i-=x;for(var u=0;ur.minRank+1;o--){var g=r.getX(o-1);f==g||this.repositionValid(e,r,o-1,f)?(x[o-r.minRank-2]=f,m++):(x[o-r.minRank-2]=r.getX(o-1),f=g)}if(m>a||p>a){if(m>=p)for(var o=r.maxRank-2;o>r.minRank;o--)r.setX(o,x[o-r.minRank-1]);else if(p>m)for(var o=r.minRank+2;oa){if(s==r.length-1)return!0;var p=r[s+1],m=p.getGeneralPurposeVariable(i);return m=m-p.width/2-this.intraCellSpacing-e.width/2,m>=n}return!0},mxCoordinateAssignment.prototype.setCellLocations=function(t,e){this.rankTopY=[],this.rankBottomY=[];for(var i=0;i-1&&l0){for(var o=[],u=0;uy+2*this.prefHozEdgeSep&&(m+=this.prefHozEdgeSep,d-=this.prefHozEdgeSep);for(var T=d-m,C=T/x,S=m+C/2,E=this.minEdgeJetty-this.prefVertEdgeOff,u=0;ux/2&&(E-=this.prefVertEdgeOff);for(var M=0;M0?e=-e:e=-e+this.parallelEdgeSpacing,r++}t.temp[0]=101207}},mxCoordinateAssignment.prototype.setVertexLocation=function(t){var e=t.cell,i=t.x[0]-t.width/2,n=t.y[0]-t.height/2;this.rankTopY[t.minRank]=Math.min(this.rankTopY[t.minRank],n),this.rankBottomY[t.minRank]=Math.max(this.rankBottomY[t.minRank],n+t.height),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(e,i,n):this.layout.setVertexLocation(e,n,i),this.limitX=Math.max(this.limitX,i+t.width)},mxCoordinateAssignment.prototype.processReversedEdge=function(t,e){},__mxOutput.mxCoordinateAssignment=typeof mxCoordinateAssignment<"u"?mxCoordinateAssignment:void 0;function mxSwimlaneOrdering(t){this.layout=t}mxSwimlaneOrdering.prototype=new mxHierarchicalLayoutStage,mxSwimlaneOrdering.prototype.constructor=mxSwimlaneOrdering,mxSwimlaneOrdering.prototype.layout=null,mxSwimlaneOrdering.prototype.execute=function(t){var e=this.layout.getModel(),i=new Object,n=mxUtils.clone(e.vertexMapper,null,!0),r=null;if(e.roots!=null){var s=e.roots;r=[];for(var l=0;l0&&i.push(a);var x=u-p;x>s&&(s=x,r=a)}}i.length==0&&r!=null&&i.push(r)}return i},mxHierarchicalLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(e!=null)return e;for(var i=this.graph.model,n=[],r=this.graph.isCellCollapsed(t),s=i.getChildCount(t),l=0;l=0&&(r=this.traverse(m,e,o[p],n,r,s,l))}}else if(r[a]==null)for(var p=0;p0&&i.push(a);var f=u-p;f>s&&(s=f,r=a)}}i.length==0&&r!=null&&i.push(r)}return i},mxSwimlaneLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(e!=null)return e;for(var i=this.graph.model,n=[],r=this.graph.isCellCollapsed(t),s=i.getChildCount(t),l=0;l0&&t!=null){for(var n=Object(),r=0;r=this.swimlanes.length||(f>a||(!e||x)&&f==a)&&(r=this.traverse(d,e,u[m],n,r,s,l,f))}}else if(r[o]==null)for(var m=0;m0){var n=t,r=mxCellPath.create(n);if(i.length=0;i--)this.cellRemoved(this.getChildAt(t,i));this.cells!=null&&t.getId()!=null&&delete this.cells[t.getId()]}},mxGraphModel.prototype.parentForCellChanged=function(t,e,i){var n=this.getParent(t);if(e!=null)(e!=n||n.getIndex(t)!=i)&&e.insert(t,i);else if(n!=null){var r=n.getIndex(t);n.remove(r)}var s=this.contains(e),l=this.contains(n);return s&&!l?this.cellAdded(t):l&&!s&&this.cellRemoved(t),n},mxGraphModel.prototype.getChildCount=function(t){return t!=null?t.getChildCount():0},mxGraphModel.prototype.getChildAt=function(t,e){return t!=null?t.getChildAt(e):null},mxGraphModel.prototype.getChildren=function(t){return t!=null?t.children:null},mxGraphModel.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraphModel.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraphModel.prototype.getChildCells=function(t,e,i){e=e??!1,i=i??!1;for(var n=this.getChildCount(t),r=[],s=0;s=0&&(e=this.getChildAt(t),e!=null&&(this.children.splice(t,1),e.setParent(null))),e},mxCell.prototype.removeFromParent=function(){if(this.parent!=null){var t=this.parent.getIndex(this);this.parent.remove(t)}},mxCell.prototype.getEdgeCount=function(){return this.edges==null?0:this.edges.length},mxCell.prototype.getEdgeIndex=function(t){return mxUtils.indexOf(this.edges,t)},mxCell.prototype.getEdgeAt=function(t){return this.edges==null?null:this.edges[t]},mxCell.prototype.insertEdge=function(t,e){return t!=null&&(t.removeFromTerminal(e),t.setTerminal(this,e),(this.edges==null||t.getTerminal(!e)!=this||mxUtils.indexOf(this.edges,t)<0)&&(this.edges==null&&(this.edges=[]),this.edges.push(t))),t},mxCell.prototype.removeEdge=function(t,e){if(t!=null){if(t.getTerminal(!e)!=this&&this.edges!=null){var i=this.getEdgeIndex(t);i>=0&&this.edges.splice(i,1)}t.setTerminal(null,e)}return t},mxCell.prototype.removeFromTerminal=function(t){var e=this.getTerminal(t);e!=null&&e.removeEdge(this,t)},mxCell.prototype.hasAttribute=function(t){var e=this.getValue();return e!=null&&e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.hasAttribute?e.hasAttribute(t):e.getAttribute(t)!=null},mxCell.prototype.getAttribute=function(t,e){var i=this.getValue(),n=i!=null&&i.nodeType==mxConstants.NODETYPE_ELEMENT?i.getAttribute(t):null;return n??e},mxCell.prototype.setAttribute=function(t,e){var i=this.getValue();i!=null&&i.nodeType==mxConstants.NODETYPE_ELEMENT&&i.setAttribute(t,e)},mxCell.prototype.clone=function(){var t=mxUtils.clone(this,this.mxTransient);return t.setValue(this.cloneValue()),t},mxCell.prototype.cloneValue=function(){var t=this.getValue();return t!=null&&(typeof t.clone=="function"?t=t.clone():isNaN(t.nodeType)||(t=t.cloneNode(!0))),t},__mxOutput.mxCell=typeof mxCell<"u"?mxCell:void 0;function mxGeometry(t,e,i,n){mxRectangle.call(this,t,e,i,n)}mxGeometry.prototype=new mxRectangle,mxGeometry.prototype.constructor=mxGeometry,mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0,mxGeometry.prototype.alternateBounds=null,mxGeometry.prototype.sourcePoint=null,mxGeometry.prototype.targetPoint=null,mxGeometry.prototype.points=null,mxGeometry.prototype.offset=null,mxGeometry.prototype.relative=!1,mxGeometry.prototype.swap=function(){if(this.alternateBounds!=null){var t=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x,this.y=this.alternateBounds.y,this.width=this.alternateBounds.width,this.height=this.alternateBounds.height,this.alternateBounds=t}},mxGeometry.prototype.getTerminalPoint=function(t){return t?this.sourcePoint:this.targetPoint},mxGeometry.prototype.setTerminalPoint=function(t,e){return e?this.sourcePoint=t:this.targetPoint=t,t},mxGeometry.prototype.rotate=function(t,e){var i=mxUtils.toRadians(t),n=Math.cos(i),r=Math.sin(i);if(!this.relative){var s=new mxPoint(this.getCenterX(),this.getCenterY()),l=mxUtils.getRotatedPoint(s,n,r,e);this.x=Math.round(l.x-this.width/2),this.y=Math.round(l.y-this.height/2)}if(this.sourcePoint!=null){var l=mxUtils.getRotatedPoint(this.sourcePoint,n,r,e);this.sourcePoint.x=Math.round(l.x),this.sourcePoint.y=Math.round(l.y)}if(this.targetPoint!=null){var l=mxUtils.getRotatedPoint(this.targetPoint,n,r,e);this.targetPoint.x=Math.round(l.x),this.targetPoint.y=Math.round(l.y)}if(this.points!=null){for(var a=0;a1&&(e=e.substring(0,r-1)),e},getParentPath:function(t){if(t!=null){var e=t.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(e>=0)return t.substring(0,e);if(t.length>0)return""}return null},resolve:function(t,e){var i=t;if(e!=null)for(var n=e.split(mxCellPath.PATH_SEPARATOR),r=0;re[r]?1:-1;else{var s=parseInt(t[r]),l=parseInt(e[r]);n=s==l?0:s>l?1:-1}break}if(n==0){var s=t.length,l=e.length;s!=l&&(n=s>l?1:-1)}return n}};__mxOutput.mxCellPath=typeof mxCellPath<"u"?mxCellPath:void 0;var mxPerimeter={RectanglePerimeter:function(t,e,i,n){var r=t.getCenterX(),s=t.getCenterY(),l=i.x-r,a=i.y-s,o=Math.atan2(a,l),u=new mxPoint(0,0),p=Math.PI,m=Math.PI/2,d=m-o,x=Math.atan2(t.height,t.width);return o<-p+x||o>p-x?(u.x=t.x,u.y=s-t.width*Math.tan(o)/2):o<-x?(u.y=t.y,u.x=r-t.height*Math.tan(d)/2):o=t.x&&i.x<=t.x+t.width?u.x=i.x:i.y>=t.y&&i.y<=t.y+t.height&&(u.y=i.y),i.xt.x+t.width&&(u.x=t.x+t.width),i.yt.y+t.height&&(u.y=t.y+t.height)),u},EllipsePerimeter:function(t,e,i,n){var r=t.x,s=t.y,l=t.width/2,a=t.height/2,o=r+l,u=s+a,p=i.x,m=i.y,d=parseInt(p-o),x=parseInt(m-u);if(d==0&&x!=0)return new mxPoint(o,u+a*x/Math.abs(x));if(d==0&&x==0)return new mxPoint(p,m);if(n){if(m>=s&&m<=s+t.height){var f=m-u,g=Math.sqrt(l*l*(1-f*f/(a*a)))||0;return p<=r&&(g=-g),new mxPoint(o+g,m)}if(p>=r&&p<=r+t.width){var g=p-o,f=Math.sqrt(a*a*(1-g*g/(l*l)))||0;return m<=s&&(f=-f),new mxPoint(p,u+f)}}var c=x/d,v=u-c*o,y=l*l*c*c+a*a,T=-2*o*y,C=l*l*c*c*o*o+a*a*o*o-l*l*a*a,S=Math.sqrt(T*T-4*y*C),E=(-T+S)/(2*y),L=(-T-S)/(2*y),A=c*E+v,M=c*L+v,I=Math.sqrt(Math.pow(E-p,2)+Math.pow(A-m,2)),P=Math.sqrt(Math.pow(L-p,2)+Math.pow(M-m,2)),R=0,O=0;return Im?new mxPoint(o,s):new mxPoint(o,s+a);if(u==m)return o>p?new mxPoint(r,u):new mxPoint(r+l,u);var d=o,x=u;return n&&(p>=r&&p<=r+l?d=p:m>=s&&m<=s+a&&(x=m)),p-y&&vMath.PI-y;var C=null;if(T)n&&(s&&i.x>=d.x&&i.x<=f.x||!s&&i.y>=d.y&&i.y<=f.y)?s?C=new mxPoint(i.x,d.y):C=new mxPoint(d.x,i.y):r==mxConstants.DIRECTION_NORTH?C=new mxPoint(l+o/2+u*Math.tan(v)/2,a+u):r==mxConstants.DIRECTION_SOUTH?C=new mxPoint(l+o/2-u*Math.tan(v)/2,a):r==mxConstants.DIRECTION_WEST?C=new mxPoint(l+o,a+u/2+o*Math.tan(v)/2):C=new mxPoint(l,a+u/2-o*Math.tan(v)/2);else{if(n){var S=new mxPoint(p,m);i.y>=a&&i.y<=a+u?(S.x=s?p:r==mxConstants.DIRECTION_WEST?l+o:l,S.y=i.y):i.x>=l&&i.x<=l+o&&(S.x=i.x,S.y=s?r==mxConstants.DIRECTION_NORTH?a+u:a:m),g=i.x-S.x,c=i.y-S.y,p=S.x,m=S.y}s&&i.x<=l+o/2||!s&&i.y<=a+u/2?C=mxUtils.intersection(i.x,i.y,p,m,d.x,d.y,x.x,x.y):C=mxUtils.intersection(i.x,i.y,p,m,x.x,x.y,f.x,f.y)}return C==null&&(C=new mxPoint(p,m)),C},HexagonPerimeter:function(t,e,i,n){var r=t.x,s=t.y,l=t.width,a=t.height,o=t.getCenterX(),u=t.getCenterY(),p=i.x,m=i.y,d=p-o,x=m-u,f=-Math.atan2(x,d),g=Math.PI,c=Math.PI/2,v=new mxPoint(o,u),y=e!=null?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST,T=y==mxConstants.DIRECTION_NORTH||y==mxConstants.DIRECTION_SOUTH,C=new mxPoint,S=new mxPoint;if((ps+a||p>r+l&&mr+l&&m>s+a)&&(n=!1),n){if(T){if(p==o){if(m<=s)return new mxPoint(o,s);if(m>=s+a)return new mxPoint(o,s+a)}else if(pr+l){if(m==s+a/4)return new mxPoint(r+l,s+a/4);if(m==s+3*a/4)return new mxPoint(r+l,s+3*a/4)}else if(p==r){if(mu)return new mxPoint(r,s+3*a/4)}else if(p==r+l){if(mu)return new mxPoint(r+l,s+3*a/4)}if(m==s)return new mxPoint(o,s);if(m==s+a)return new mxPoint(o,s+a);ps+a/4&&ms+3*a/4&&(C=new mxPoint(r-Math.floor(.5*l),s+Math.floor(.5*a)),S=new mxPoint(r+l,s+Math.floor(1.25*a))):p>o&&(m>s+a/4&&ms+3*a/4&&(C=new mxPoint(r+Math.floor(1.5*l),s+Math.floor(.5*a)),S=new mxPoint(r,s+Math.floor(1.25*a))))}else{if(m==u){if(p<=r)return new mxPoint(r,s+a/2);if(p>=r+l)return new mxPoint(r+l,s+a/2)}else if(ms+a){if(p==r+l/4)return new mxPoint(r+l/4,s+a);if(p==r+3*l/4)return new mxPoint(r+3*l/4,s+a)}else if(m==s){if(po)return new mxPoint(r+3*l/4,s)}else if(m==s+a){if(pu)return new mxPoint(r+3*l/4,s+a)}if(p==r)return new mxPoint(r,u);if(p==r+l)return new mxPoint(r+l,u);mr+l/4&&pr+3*l/4&&(C=new mxPoint(r+Math.floor(.5*l),s-Math.floor(.5*a)),S=new mxPoint(r+Math.floor(1.25*l),s+a)):m>u&&(p>r+l/4&&pr+3*l/4&&(C=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a)),S=new mxPoint(r+Math.floor(1.25*l),s)))}var E=o,L=u;p>=r&&p<=r+l?(E=p,m=s&&m<=s+a&&(L=m,p-A?(C=new mxPoint(r+l,s),S=new mxPoint(r+l,s+a)):f>A&&fc&&fg-A&&f<=g||f<-g+A&&f>=-g?(C=new mxPoint(r,s),S=new mxPoint(r,s+a)):f<-A&&f>-c?(C=new mxPoint(r+Math.floor(1.5*l),s+Math.floor(.5*a)),S=new mxPoint(r,s+Math.floor(1.25*a))):f<-c&&f>-g+A&&(C=new mxPoint(r-Math.floor(.5*l),s+Math.floor(.5*a)),S=new mxPoint(r+l,s+Math.floor(1.25*a)))}else{var A=Math.atan2(a/2,l/4);if(f==A)return new mxPoint(r+Math.floor(.75*l),s);if(f==g-A)return new mxPoint(r+Math.floor(.25*l),s);if(f==g||f==-g)return new mxPoint(r,s+Math.floor(.5*a));if(f==0)return new mxPoint(r+l,s+Math.floor(.5*a));if(f==-A)return new mxPoint(r+Math.floor(.75*l),s+a);if(f==-g+A)return new mxPoint(r+Math.floor(.25*l),s+a);f>0&&fA&&fg-A&&f-A?(C=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a)),S=new mxPoint(r+Math.floor(1.25*l),s)):f<-A&&f>-g+A?(C=new mxPoint(r,s+a),S=new mxPoint(r+l,s+a)):f<-g+A&&f>-g&&(C=new mxPoint(r-Math.floor(.25*l),s),S=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a)))}v=mxUtils.intersection(o,u,i.x,i.y,C.x,C.y,S.x,S.y)}return v??new mxPoint(o,u)}};__mxOutput.mxPerimeter=typeof mxPerimeter<"u"?mxPerimeter:void 0;function mxPrintPreview(t,e,i,n,r,s,l,a,o){this.graph=t,this.scale=e??1/t.pageScale,this.border=n??0,this.pageFormat=mxRectangle.fromRectangle(i??t.pageFormat),this.title=a??"Printer-friendly version",this.x0=r??0,this.y0=s??0,this.borderColor=l,this.pageSelector=o??!0}mxPrintPreview.prototype.graph=null,mxPrintPreview.prototype.pageFormat=null,mxPrintPreview.prototype.scale=null,mxPrintPreview.prototype.border=0,mxPrintPreview.prototype.marginTop=0,mxPrintPreview.prototype.marginBottom=0,mxPrintPreview.prototype.x0=0,mxPrintPreview.prototype.y0=0,mxPrintPreview.prototype.autoOrigin=!0,mxPrintPreview.prototype.printOverlays=!1,mxPrintPreview.prototype.printControls=!1,mxPrintPreview.prototype.printBackgroundImage=!1,mxPrintPreview.prototype.backgroundColor="#ffffff",mxPrintPreview.prototype.borderColor=null,mxPrintPreview.prototype.title=null,mxPrintPreview.prototype.pageSelector=null,mxPrintPreview.prototype.wnd=null,mxPrintPreview.prototype.targetWindow=null,mxPrintPreview.prototype.pageCount=0,mxPrintPreview.prototype.clipping=!0,mxPrintPreview.prototype.getWindow=function(){return this.wnd},mxPrintPreview.prototype.getDoctype=function(){var t="";return document.documentMode==5?t='':document.documentMode==8?t='':document.documentMode>8&&(t=''),t},mxPrintPreview.prototype.appendGraph=function(t,e,i,n,r,s){this.graph=t,this.scale=e??1/t.pageScale,this.x0=i,this.y0=n,this.open(null,null,r,s)},mxPrintPreview.prototype.open=function(t,e,i,n){var r=this.graph.cellRenderer.initializeOverlay,s=null;try{this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(P,R){R.init(P.view.getDrawPane())}),this.printControls&&(this.graph.cellRenderer.initControl=function(P,R,O,_){R.dialect=P.view.graph.dialect,R.init(P.view.getDrawPane())}),this.wnd=e??this.wnd;var l=!1;this.wnd==null&&(l=!0,this.wnd=window.open());var a=this.wnd.document;if(l){var o=this.getDoctype();o!=null&&o.length>0&&a.writeln(o),mxClient.IS_VML?a.writeln(''):(document.compatMode==="CSS1Compat"&&a.writeln(""),a.writeln("")),a.writeln(""),this.writeHead(a,t),a.writeln(""),a.writeln('')}var u=this.graph.getGraphBounds().clone(),p=this.graph.getView().getScale(),m=p/this.scale,d=this.graph.getView().getTranslate();this.autoOrigin||(this.x0-=d.x*this.scale,this.y0-=d.y*this.scale,u.width+=u.x,u.height+=u.y,u.x=0,u.y=0,this.border=0);var x=this.pageFormat.width-this.border*2,f=this.pageFormat.height-this.border*2;this.pageFormat.height+=this.marginTop+this.marginBottom,u.width/=m,u.height/=m;var g=Math.max(1,Math.ceil((u.width+this.x0)/x)),c=Math.max(1,Math.ceil((u.height+this.y0)/f));this.pageCount=g*c;var v=mxUtils.bind(this,function(){if(this.pageSelector&&(c>1||g>1)){var P=this.createPageSelector(c,g);if(a.body.appendChild(P),mxClient.IS_IE&&a.documentMode==null||a.documentMode==5||a.documentMode==8||a.documentMode==7){P.style.position="absolute";var R=function(){P.style.top=(a.body.scrollTop||a.documentElement.scrollTop)+10+"px"};mxEvent.addListener(this.wnd,"scroll",function(O){R()}),mxEvent.addListener(this.wnd,"resize",function(O){R()})}}}),y=mxUtils.bind(this,function(P,R){if(this.borderColor!=null&&(P.style.borderColor=this.borderColor,P.style.borderStyle="solid",P.style.borderWidth="1px"),P.style.background=this.backgroundColor,(i||R)&&(P.style.pageBreakAfter="always"),l&&(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE))a.writeln(P.outerHTML),P.parentNode.removeChild(P);else if(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE){var O=a.createElement("div");O.innerHTML=P.outerHTML,O=O.getElementsByTagName("div")[0],a.body.appendChild(O),P.parentNode.removeChild(P)}else P.parentNode.removeChild(P),a.body.appendChild(P);(i||R)&&this.addPageBreak(a)}),T=this.getCoverPages(this.pageFormat.width,this.pageFormat.height);if(T!=null)for(var C=0;C"),t.writeln(""),t.close(),mxEvent.release(t.body)}}catch{}},mxPrintPreview.prototype.writeHead=function(t,e){this.title!=null&&t.writeln(""+this.title+""),mxClient.IS_VML&&t.writeln(''),mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",t),t.writeln('")},mxPrintPreview.prototype.writePostfix=function(t){},mxPrintPreview.prototype.createPageSelector=function(t,e){var i=this.wnd.document,n=i.createElement("table");n.className="mxPageSelector",n.setAttribute("border","0");for(var r=i.createElement("tbody"),s=0;s0&&b.height>0&&!mxUtils.intersects(C,b))return}}v.apply(this,arguments)}}var S=null;try{var E=[this.getRoot()];S=new mxTemporaryCellStates(l,i,E,null,mxUtils.bind(this,function(P){return this.getLinkForCellState(P)}))}finally{if(mxClient.IS_IE)l.overlayPane.innerHTML="",l.canvas.style.overflow="hidden",l.canvas.style.position="relative",l.canvas.style.top=this.marginTop+"px",l.canvas.style.width=s.width+"px",l.canvas.style.height=s.height+"px";else for(var L=r.firstChild;L!=null;){var A=L.nextSibling,M=L.nodeName.toLowerCase();M=="svg"?(L.style.overflow="hidden",L.style.position="relative",L.style.top=this.marginTop+"px",L.setAttribute("width",s.width),L.setAttribute("height",s.height),L.style.width="",L.style.height=""):L.style.cursor!="default"&&M!="div"&&L.parentNode.removeChild(L),L=A}if(this.printBackgroundImage){var I=r.getElementsByTagName("svg");I.length>0&&(I[0].style.position="absolute")}l.overlayPane.parentNode.removeChild(l.overlayPane),this.graph.setEnabled(g),this.graph.container=a,this.graph.cellRenderer.redraw=v,l.canvas=o,l.backgroundPane=u,l.drawPane=p,l.overlayPane=m,l.translate=c,S.destroy(),l.setEventsEnabled(f)}},mxPrintPreview.prototype.getLinkForCellState=function(t){return this.graph.getLinkForCell(t.cell)},mxPrintPreview.prototype.insertBackgroundImage=function(t,e,i){var n=this.graph.backgroundImage;if(n!=null){var r=document.createElement("img");r.style.position="absolute",r.style.marginLeft=Math.round(e*this.scale)+"px",r.style.marginTop=Math.round(i*this.scale)+"px",r.setAttribute("width",Math.round(this.scale*n.width)),r.setAttribute("height",Math.round(this.scale*n.height)),r.src=n.src,t.insertBefore(r,t.firstChild)}},mxPrintPreview.prototype.getCoverPages=function(){return null},mxPrintPreview.prototype.getAppendices=function(){return null},mxPrintPreview.prototype.print=function(t){var e=this.open(t);e!=null&&e.print()},mxPrintPreview.prototype.close=function(){this.wnd!=null&&(this.wnd.close(),this.wnd=null)},__mxOutput.mxPrintPreview=typeof mxPrintPreview<"u"?mxPrintPreview:void 0;function mxStylesheet(){this.styles=new Object,this.putDefaultVertexStyle(this.createDefaultVertexStyle()),this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}mxStylesheet.prototype.styles,mxStylesheet.prototype.createDefaultVertexStyle=function(){var t=new Object;return t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE,t[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_FILLCOLOR]="#C3D9FF",t[mxConstants.STYLE_STROKECOLOR]="#6482B9",t[mxConstants.STYLE_FONTCOLOR]="#774400",t},mxStylesheet.prototype.createDefaultEdgeStyle=function(){var t=new Object;return t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR,t[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_STROKECOLOR]="#6482B9",t[mxConstants.STYLE_FONTCOLOR]="#446299",t},mxStylesheet.prototype.putDefaultVertexStyle=function(t){this.putCellStyle("defaultVertex",t)},mxStylesheet.prototype.putDefaultEdgeStyle=function(t){this.putCellStyle("defaultEdge",t)},mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex},mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge},mxStylesheet.prototype.putCellStyle=function(t,e){this.styles[t]=e},mxStylesheet.prototype.getCellStyle=function(t,e){var i=e;if(t!=null&&t.length>0){var n=t.split(";");i!=null&&t.charAt(0)!=";"?i=mxUtils.clone(i):i=new Object;for(var r=0;r=0){var a=s.substring(0,l),o=s.substring(l+1);o==mxConstants.NONE?delete i[a]:mxUtils.isNumeric(o)?i[a]=parseFloat(o):i[a]=o}else{var u=this.styles[s];if(u!=null)for(var a in u)i[a]=u[a]}}}return i},__mxOutput.mxStylesheet=typeof mxStylesheet<"u"?mxStylesheet:void 0;function mxCellState(t,e,i){this.view=t,this.cell=e,this.style=i??{},this.origin=new mxPoint,this.absoluteOffset=new mxPoint}mxCellState.prototype=new mxRectangle,mxCellState.prototype.constructor=mxCellState,mxCellState.prototype.view=null,mxCellState.prototype.cell=null,mxCellState.prototype.style=null,mxCellState.prototype.invalidStyle=!1,mxCellState.prototype.invalid=!0,mxCellState.prototype.origin=null,mxCellState.prototype.absolutePoints=null,mxCellState.prototype.absoluteOffset=null,mxCellState.prototype.visibleSourceState=null,mxCellState.prototype.visibleTargetState=null,mxCellState.prototype.terminalDistance=0,mxCellState.prototype.length=0,mxCellState.prototype.segments=null,mxCellState.prototype.shape=null,mxCellState.prototype.text=null,mxCellState.prototype.unscaledWidth=null,mxCellState.prototype.unscaledHeight=null,mxCellState.prototype.getPerimeterBounds=function(t,e){if(t=t||0,e=e??new mxRectangle(this.x,this.y,this.width,this.height),this.shape!=null&&this.shape.stencil!=null&&this.shape.stencil.aspect=="fixed"){var i=this.shape.stencil.computeAspect(this.style,e.x,e.y,e.width,e.height);e.x=i.x,e.y=i.y,e.width=this.shape.stencil.w0*i.width,e.height=this.shape.stencil.h0*i.height}return t!=0&&e.grow(t),e},mxCellState.prototype.setAbsoluteTerminalPoint=function(t,e){e?(this.absolutePoints==null&&(this.absolutePoints=[]),this.absolutePoints.length==0?this.absolutePoints.push(t):this.absolutePoints[0]=t):this.absolutePoints==null?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(t)):this.absolutePoints.length==1?this.absolutePoints.push(t):this.absolutePoints[this.absolutePoints.length-1]=t},mxCellState.prototype.setCursor=function(t){this.shape!=null&&this.shape.setCursor(t),this.text!=null&&this.text.setCursor(t)},mxCellState.prototype.getVisibleTerminal=function(t){var e=this.getVisibleTerminalState(t);return e!=null?e.cell:null},mxCellState.prototype.getVisibleTerminalState=function(t){return t?this.visibleSourceState:this.visibleTargetState},mxCellState.prototype.setVisibleTerminalState=function(t,e){e?this.visibleSourceState=t:this.visibleTargetState=t},mxCellState.prototype.getCellBounds=function(){return this.cellBounds},mxCellState.prototype.getPaintBounds=function(){return this.paintBounds},mxCellState.prototype.updateCachedBounds=function(){var t=this.view.translate,e=this.view.scale;this.cellBounds=new mxRectangle(this.x/e-t.x,this.y/e-t.y,this.width/e,this.height/e),this.paintBounds=mxRectangle.fromRectangle(this.cellBounds),this.shape!=null&&this.shape.isPaintBoundsInverted()&&this.paintBounds.rotate90()},mxCellState.prototype.setState=function(t){this.view=t.view,this.cell=t.cell,this.style=t.style,this.absolutePoints=t.absolutePoints,this.origin=t.origin,this.absoluteOffset=t.absoluteOffset,this.boundingBox=t.boundingBox,this.terminalDistance=t.terminalDistance,this.segments=t.segments,this.length=t.length,this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.unscaledWidth=t.unscaledWidth,this.unscaledHeight=t.unscaledHeight},mxCellState.prototype.clone=function(){var t=new mxCellState(this.view,this.cell,this.style);if(this.absolutePoints!=null){t.absolutePoints=[];for(var e=0;e=0:!1},mxGraphSelectionModel.prototype.isEmpty=function(){return this.cells.length==0},mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)},mxGraphSelectionModel.prototype.setCell=function(t){t!=null&&this.setCells([t])},mxGraphSelectionModel.prototype.setCells=function(t){if(t!=null){this.singleSelection&&(t=[this.getFirstSelectableCell(t)]);for(var e=[],i=0;i0&&t[0]!=null||e!=null&&e.length>0&&e[0]!=null){var i=new mxSelectionChange(this,t,e);i.execute();var n=new mxUndoableEdit(this,!1);n.add(i),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",n))}},mxGraphSelectionModel.prototype.cellAdded=function(t){t!=null&&!this.isSelected(t)&&this.cells.push(t)},mxGraphSelectionModel.prototype.cellRemoved=function(t){if(t!=null){var e=mxUtils.indexOf(this.cells,t);e>=0&&this.cells.splice(e,1)}};function mxSelectionChange(t,e,i){this.selectionModel=t,this.added=e!=null?e.slice():null,this.removed=i!=null?i.slice():null}mxSelectionChange.prototype.execute=function(){var t=mxLog.enter("mxSelectionChange.execute");if(window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource,this.removed!=null)for(var e=0;e":"",mxCellEditor.prototype.escapeCancelsEditing=!0,mxCellEditor.prototype.textNode="",mxCellEditor.prototype.zIndex=5,mxCellEditor.prototype.minResize=new mxRectangle(0,20),mxCellEditor.prototype.wordWrapPadding=mxClient.IS_QUIRKS?2:mxClient.IS_IE11?0:1,mxCellEditor.prototype.blurEnabled=!1,mxCellEditor.prototype.initialValue=null,mxCellEditor.prototype.align=null,mxCellEditor.prototype.init=function(){this.textarea=document.createElement("div"),this.textarea.className="mxCellEditor mxPlainTextEditor",this.textarea.contentEditable=!0,mxClient.IS_GC&&(this.textarea.style.minHeight="1em"),this.textarea.style.position=this.isLegacyEditor()?"absolute":"relative",this.installListeners(this.textarea)},mxCellEditor.prototype.applyValue=function(t,e){this.graph.labelChanged(t.cell,e,this.trigger)},mxCellEditor.prototype.setAlign=function(t){this.textarea!=null&&(this.textarea.style.textAlign=t),this.align=t,this.resize()},mxCellEditor.prototype.getInitialValue=function(t,e){var i=mxUtils.htmlEntities(this.graph.getEditingValue(t.cell,e),!1);return!mxClient.IS_QUIRKS&&document.documentMode!=8&&document.documentMode!=9&&document.documentMode!=10&&(i=mxUtils.replaceTrailingNewlines(i,"

")),i.replace(/\n/g,"
")},mxCellEditor.prototype.getCurrentValue=function(t){return mxUtils.extractTextWithWhitespace(this.textarea.childNodes)},mxCellEditor.prototype.isCancelEditingKeyEvent=function(t){return this.escapeCancelsEditing||mxEvent.isShiftDown(t)||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)},mxCellEditor.prototype.installListeners=function(t){mxEvent.addListener(t,"dragstart",mxUtils.bind(this,function(s){this.graph.stopEditing(!1),mxEvent.consume(s)})),mxEvent.addListener(t,"blur",mxUtils.bind(this,function(s){this.blurEnabled&&this.focusLost(s)})),mxEvent.addListener(t,"keydown",mxUtils.bind(this,function(s){mxEvent.isConsumed(s)||(this.isStopEditingEvent(s)?(this.graph.stopEditing(!1),mxEvent.consume(s)):s.keyCode==27&&(this.graph.stopEditing(this.isCancelEditingKeyEvent(s)),mxEvent.consume(s)))}));var e=mxUtils.bind(this,function(s){this.editingCell!=null&&this.clearOnChange&&t.innerHTML==this.getEmptyLabelText()&&(!mxClient.IS_FF||s.keyCode!=8&&s.keyCode!=46)&&(this.clearOnChange=!1,t.innerHTML="")});mxEvent.addListener(t,"keypress",e),mxEvent.addListener(t,"paste",e);var i=mxUtils.bind(this,function(s){this.editingCell!=null&&(this.textarea.innerHTML.length==0||this.textarea.innerHTML=="
"?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=this.textarea.innerHTML.length>0):this.clearOnChange=!1)});mxEvent.addListener(t,!mxClient.IS_IE11&&!mxClient.IS_IE?"input":"keyup",i),mxEvent.addListener(t,"cut",i),mxEvent.addListener(t,"paste",i);var n=!mxClient.IS_IE11&&!mxClient.IS_IE?"input":"keydown",r=mxUtils.bind(this,function(s){this.editingCell!=null&&this.autoSize&&!mxEvent.isConsumed(s)&&(this.resizeThread!=null&&window.clearTimeout(this.resizeThread),this.resizeThread=window.setTimeout(mxUtils.bind(this,function(){this.resizeThread=null,this.resize()}),0))});mxEvent.addListener(t,n,r),mxEvent.addListener(window,"resize",r),document.documentMode>=9?(mxEvent.addListener(t,"DOMNodeRemoved",r),mxEvent.addListener(t,"DOMNodeInserted",r)):(mxEvent.addListener(t,"cut",r),mxEvent.addListener(t,"paste",r))},mxCellEditor.prototype.isStopEditingEvent=function(t){return t.keyCode==113||this.graph.isEnterStopsCellEditing()&&t.keyCode==13&&!mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)},mxCellEditor.prototype.isEventSource=function(t){return mxEvent.getSource(t)==this.textarea},mxCellEditor.prototype.resize=function(){var t=this.graph.getView().getState(this.editingCell);if(t==null)this.stopEditing(!0);else if(this.textarea!=null){var e=this.graph.getModel().isEdge(t.cell),i=this.graph.getView().scale,n=null;if(!this.autoSize||t.style[mxConstants.STYLE_OVERFLOW]=="fill")this.bounds=this.getEditorBounds(t),this.textarea.style.width=Math.round(this.bounds.width/i)+"px",this.textarea.style.height=Math.round(this.bounds.height/i)+"px",document.documentMode==8||mxClient.IS_QUIRKS?(this.textarea.style.left=Math.round(this.bounds.x)+"px",this.textarea.style.top=Math.round(this.bounds.y)+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x+1))+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y+1))+"px"),this.graph.isWrapping(t.cell)&&(this.bounds.width>=2||this.bounds.height>=2)&&this.textarea.innerHTML!=this.getEmptyLabelText()?(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal",t.style[mxConstants.STYLE_OVERFLOW]!="fill"&&(this.textarea.style.width=Math.round(this.bounds.width/i)+this.wordWrapPadding+"px")):(this.textarea.style.whiteSpace="nowrap",t.style[mxConstants.STYLE_OVERFLOW]!="fill"&&(this.textarea.style.width=""));else{var r=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);if(n=t.text!=null&&this.align==null?t.text.margin:null,n==null&&(n=mxUtils.getAlignmentAsPoint(this.align||mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE))),e){if(this.bounds=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y,0,0),r!=null){var s=(parseFloat(r)+2)*i;this.bounds.width=s,this.bounds.x+=n.x*s}}else{var l=mxRectangle.fromRectangle(t),a=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),o=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(l=t.shape!=null&&a==mxConstants.ALIGN_CENTER&&o==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(l):l,r!=null&&(l.width=parseFloat(r)*i),!t.view.graph.cellRenderer.legacySpacing||t.style[mxConstants.STYLE_OVERFLOW]!="width"){var u=parseInt(t.style[mxConstants.STYLE_SPACING]||2)*i,p=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*i+u,m=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*i+u,d=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*i+u,x=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*i+u,a=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),o=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);l=new mxRectangle(l.x+x,l.y+p,l.width-(a==mxConstants.ALIGN_CENTER&&r==null?x+m:0),l.height-(o==mxConstants.ALIGN_MIDDLE?p+d:0))}this.bounds=new mxRectangle(l.x+t.absoluteOffset.x,l.y+t.absoluteOffset.y,l.width,l.height)}if(this.graph.isWrapping(t.cell)&&(this.bounds.width>=2||this.bounds.height>=2)&&this.textarea.innerHTML!=this.getEmptyLabelText()){this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal";var s=Math.round(this.bounds.width/(document.documentMode==8,i))+this.wordWrapPadding;this.textarea.style.position!="relative"?(this.textarea.style.width=s+"px",this.textarea.scrollWidth>s&&(this.textarea.style.width=this.textarea.scrollWidth+"px")):this.textarea.style.maxWidth=s+"px"}else this.textarea.style.whiteSpace="nowrap",this.textarea.style.width="";document.documentMode==8&&(this.textarea.style.zoom="1",this.textarea.style.height="auto");var f=this.textarea.scrollWidth,g=this.textarea.scrollHeight;document.documentMode==8?(this.textarea.style.left=Math.max(0,Math.ceil((this.bounds.x-n.x*(this.bounds.width-(f+1)*i)+f*(i-1)*0+(n.x+.5)*2)/i))+"px",this.textarea.style.top=Math.max(0,Math.ceil((this.bounds.y-n.y*(this.bounds.height-(g+.5)*i)+g*(i-1)*0+Math.abs(n.y+.5)*1)/i))+"px",this.textarea.style.width=Math.round(f*i)+"px",this.textarea.style.height=Math.round(g*i)+"px"):mxClient.IS_QUIRKS?(this.textarea.style.left=Math.max(0,Math.ceil(this.bounds.x-n.x*(this.bounds.width-(f+1)*i)+f*(i-1)*0+(n.x+.5)*2))+"px",this.textarea.style.top=Math.max(0,Math.ceil(this.bounds.y-n.y*(this.bounds.height-(g+.5)*i)+g*(i-1)*0+Math.abs(n.y+.5)*1))+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-n.x*(this.bounds.width-2))+1)+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-n.y*(this.bounds.height-4)+(n.y==-1?3:0))+1)+"px")}mxClient.IS_VML?this.textarea.style.zoom=i:(mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px"),mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+i+","+i+")"+(n==null?"":" translate("+n.x*100+"%,"+n.y*100+"%)")))}},mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())},mxCellEditor.prototype.getBackgroundColor=function(t){return null},mxCellEditor.prototype.isLegacyEditor=function(){if(mxClient.IS_VML)return!0;var t=!1;if(mxClient.IS_SVG){var e=this.graph.view.getDrawPane().ownerSVGElement;if(e!=null){var i=mxUtils.getCurrentStyle(e);i!=null&&(t=i.position=="absolute")}}return!t},mxCellEditor.prototype.startEditing=function(t,e){this.stopEditing(!0),this.align=null,this.textarea==null&&this.init(),this.graph.tooltipHandler!=null&&this.graph.tooltipHandler.hideTooltip();var i=this.graph.getView().getState(t);if(i!=null){this.graph.getView().scale;var n=mxUtils.getValue(i.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),r=mxUtils.getValue(i.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),s=mxUtils.getValue(i.style,mxConstants.STYLE_FONTCOLOR,"black"),l=mxUtils.getValue(i.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),a=(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,o=(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,u=[];(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&u.push("underline"),(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&u.push("line-through"),this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(n*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT,this.textarea.style.backgroundColor=this.getBackgroundColor(i),this.textarea.style.textDecoration=u.join(" "),this.textarea.style.fontWeight=a?"bold":"normal",this.textarea.style.fontStyle=o?"italic":"",this.textarea.style.fontSize=Math.round(n)+"px",this.textarea.style.zIndex=this.zIndex,this.textarea.style.fontFamily=r,this.textarea.style.textAlign=l,this.textarea.style.outline="none",this.textarea.style.color=s;var p=this.textDirection=mxUtils.getValue(i.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);p==mxConstants.TEXT_DIRECTION_AUTO&&i!=null&&i.text!=null&&i.text.dialect!=mxConstants.DIALECT_STRICTHTML&&!mxUtils.isNode(i.text.value)&&(p=i.text.getAutoDirection()),p==mxConstants.TEXT_DIRECTION_LTR||p==mxConstants.TEXT_DIRECTION_RTL?this.textarea.setAttribute("dir",p):this.textarea.removeAttribute("dir"),this.textarea.innerHTML=this.getInitialValue(i,e)||"",this.initialValue=this.textarea.innerHTML,this.textarea.innerHTML.length==0||this.textarea.innerHTML=="
"?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=!0):this.clearOnChange=this.textarea.innerHTML==this.getEmptyLabelText(),this.graph.container.appendChild(this.textarea),this.editingCell=t,this.trigger=e,this.textNode=null,i.text!=null&&this.isHideLabel(i)&&(this.textNode=i.text.node,this.textNode.style.visibility="hidden"),this.autoSize&&(this.graph.model.isEdge(i.cell)||i.style[mxConstants.STYLE_OVERFLOW]!="fill")&&window.setTimeout(mxUtils.bind(this,function(){this.resize()}),0),this.resize();try{this.textarea.focus(),this.isSelectText()&&this.textarea.innerHTML.length>0&&(this.textarea.innerHTML!=this.getEmptyLabelText()||!this.clearOnChange)&&document.execCommand("selectAll",!1,null)}catch{}}},mxCellEditor.prototype.isSelectText=function(){return this.selectText},mxCellEditor.prototype.clearSelection=function(){var t=null;window.getSelection?t=window.getSelection():document.selection&&(t=document.selection),t!=null&&(t.empty?t.empty():t.removeAllRanges&&t.removeAllRanges())},mxCellEditor.prototype.stopEditing=function(t){if(t=t||!1,this.editingCell!=null){this.textNode!=null&&(this.textNode.style.visibility="visible",this.textNode=null);var e=t?null:this.graph.view.getState(this.editingCell),i=this.initialValue;if(this.initialValue=null,this.editingCell=null,this.trigger=null,this.bounds=null,this.textarea.blur(),this.clearSelection(),this.textarea.parentNode!=null&&this.textarea.parentNode.removeChild(this.textarea),this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.textarea.innerHTML="",this.clearOnChange=!1),e!=null&&(this.textarea.innerHTML!=i||this.align!=null)){this.prepareTextarea();var n=this.getCurrentValue(e);this.graph.getModel().beginUpdate();try{n!=null&&this.applyValue(e,n),this.align!=null&&this.graph.setCellStyles(mxConstants.STYLE_ALIGN,this.align,[e.cell])}finally{this.graph.getModel().endUpdate()}}mxEvent.release(this.textarea),this.textarea=null,this.align=null}},mxCellEditor.prototype.prepareTextarea=function(){this.textarea.lastChild!=null&&this.textarea.lastChild.nodeName=="BR"&&this.textarea.removeChild(this.textarea.lastChild)},mxCellEditor.prototype.isHideLabel=function(t){return!0},mxCellEditor.prototype.getMinimumSize=function(t){var e=this.graph.getView().scale;return new mxRectangle(0,0,t.text==null?30:t.text.size*e+20,this.textarea.style.textAlign=="left"?120:40)},mxCellEditor.prototype.getEditorBounds=function(t){var e=this.graph.getModel().isEdge(t.cell),i=this.graph.getView().scale,n=this.getMinimumSize(t),r=n.width,s=n.height,l=null;if(!e&&t.view.graph.cellRenderer.legacySpacing&&t.style[mxConstants.STYLE_OVERFLOW]=="fill")l=t.shape.getLabelBounds(mxRectangle.fromRectangle(t));else{var a=parseInt(t.style[mxConstants.STYLE_SPACING]||0)*i,o=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*i+a,u=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*i+a,p=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*i+a,m=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*i+a;l=new mxRectangle(t.x,t.y,Math.max(r,t.width-m-u),Math.max(s,t.height-o-p));var d=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),x=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(l=t.shape!=null&&d==mxConstants.ALIGN_CENTER&&x==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(l):l,e?(l.x=t.absoluteOffset.x,l.y=t.absoluteOffset.y,t.text!=null&&t.text.boundingBox!=null&&(t.text.boundingBox.x>0&&(l.x=t.text.boundingBox.x),t.text.boundingBox.y>0&&(l.y=t.text.boundingBox.y))):t.text!=null&&t.text.boundingBox!=null&&(l.x=Math.min(l.x,t.text.boundingBox.x),l.y=Math.min(l.y,t.text.boundingBox.y)),l.x+=m,l.y+=o,t.text!=null&&t.text.boundingBox!=null&&(e?(l.width=Math.max(r,t.text.boundingBox.width),l.height=Math.max(s,t.text.boundingBox.height)):(l.width=Math.max(l.width,t.text.boundingBox.width),l.height=Math.max(l.height,t.text.boundingBox.height))),this.graph.getModel().isVertex(t.cell)){var f=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);f==mxConstants.ALIGN_LEFT?l.x-=t.width:f==mxConstants.ALIGN_RIGHT&&(l.x+=t.width);var g=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);g==mxConstants.ALIGN_TOP?l.y-=t.height:g==mxConstants.ALIGN_BOTTOM&&(l.y+=t.height)}}return new mxRectangle(Math.round(l.x),Math.round(l.y),Math.round(l.width),Math.round(l.height))},mxCellEditor.prototype.getEmptyLabelText=function(t){return this.emptyLabelText},mxCellEditor.prototype.getEditingCell=function(){return this.editingCell},mxCellEditor.prototype.destroy=function(){this.textarea!=null&&(mxEvent.release(this.textarea),this.textarea.parentNode!=null&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null),this.changeHandler!=null&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null),this.zoomHandler&&(this.graph.view.removeListener(this.zoomHandler),this.zoomHandler=null)},__mxOutput.mxCellEditor=typeof mxCellEditor<"u"?mxCellEditor:void 0;function mxCellRenderer(){}mxCellRenderer.defaultShapes=new Object,mxCellRenderer.prototype.defaultEdgeShape=mxConnector,mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape,mxCellRenderer.prototype.defaultTextShape=mxText,mxCellRenderer.prototype.legacyControlPosition=!0,mxCellRenderer.prototype.legacySpacing=!0,mxCellRenderer.prototype.antiAlias=!0,mxCellRenderer.prototype.minSvgStrokeWidth=1,mxCellRenderer.prototype.forceControlClickHandler=!1,mxCellRenderer.registerShape=function(t,e){mxCellRenderer.defaultShapes[t]=e},mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape),mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus),mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder),mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor),mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle),mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon),mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud),mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW_CONNECTOR,mxArrowConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane),mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape),mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel),mxCellRenderer.prototype.initializeShape=function(t){t.shape.dialect=t.view.graph.dialect,this.configureShape(t),t.shape.init(t.view.getDrawPane())},mxCellRenderer.prototype.createShape=function(t){var e=null;if(t.style!=null){var i=mxStencilRegistry.getStencil(t.style[mxConstants.STYLE_SHAPE]);if(i!=null)e=new mxShape(i);else{var n=this.getShapeConstructor(t);e=new n}}return e},mxCellRenderer.prototype.createIndicatorShape=function(t){t.shape.indicatorShape=this.getShape(t.view.graph.getIndicatorShape(t))},mxCellRenderer.prototype.getShape=function(t){return t!=null?mxCellRenderer.defaultShapes[t]:null},mxCellRenderer.prototype.getShapeConstructor=function(t){var e=this.getShape(t.style[mxConstants.STYLE_SHAPE]);return e==null&&(e=t.view.graph.getModel().isEdge(t.cell)?this.defaultEdgeShape:this.defaultVertexShape),e},mxCellRenderer.prototype.configureShape=function(t){t.shape.apply(t),t.shape.image=t.view.graph.getImage(t),t.shape.indicatorColor=t.view.graph.getIndicatorColor(t),t.shape.indicatorStrokeColor=t.style[mxConstants.STYLE_INDICATOR_STROKECOLOR],t.shape.indicatorGradientColor=t.view.graph.getIndicatorGradientColor(t),t.shape.indicatorDirection=t.style[mxConstants.STYLE_INDICATOR_DIRECTION],t.shape.indicatorImage=t.view.graph.getIndicatorImage(t),this.postConfigureShape(t)},mxCellRenderer.prototype.postConfigureShape=function(t){t.shape!=null&&(this.resolveColor(t,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(t,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(t,"gradient",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(t,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(t,"fill",mxConstants.STYLE_FILLCOLOR))},mxCellRenderer.prototype.checkPlaceholderStyles=function(t){if(t.style!=null){for(var e=["inherit","swimlane","indicated"],i=[mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.STYLE_FONTCOLOR],n=0;n=0)return!0}return!1},mxCellRenderer.prototype.resolveColor=function(t,e,i){var n=i==mxConstants.STYLE_FONTCOLOR?t.text:t.shape;if(n!=null){var r=t.view.graph,s=n[e],l=null;if(s=="inherit"?l=r.model.getParent(t.cell):s=="swimlane"?(n[e]=i==mxConstants.STYLE_STROKECOLOR||i==mxConstants.STYLE_FONTCOLOR?"#000000":"#ffffff",r.model.getTerminal(t.cell,!1)!=null?l=r.model.getTerminal(t.cell,!1):l=t.cell,l=r.getSwimlane(l),i=r.swimlaneIndicatorColorAttribute):s=="indicated"&&t.shape!=null?n[e]=t.shape.indicatorColor:i!=mxConstants.STYLE_FILLCOLOR&&s==mxConstants.STYLE_FILLCOLOR&&t.shape!=null?n[e]=t.style[mxConstants.STYLE_FILLCOLOR]:i!=mxConstants.STYLE_STROKECOLOR&&s==mxConstants.STYLE_STROKECOLOR&&t.shape!=null&&(n[e]=t.style[mxConstants.STYLE_STROKECOLOR]),l!=null){var a=r.getView().getState(l);if(n[e]=null,a!=null){var o=i==mxConstants.STYLE_FONTCOLOR?a.text:a.shape;o!=null&&e!="indicatorColor"?n[e]=o[e]:n[e]=a.style[i]}}}},mxCellRenderer.prototype.getLabelValue=function(t){return t.view.graph.getLabel(t.cell)},mxCellRenderer.prototype.createLabel=function(t,e){var i=t.view.graph;if(i.getModel().isEdge(t.cell),t.style[mxConstants.STYLE_FONTSIZE]>0||t.style[mxConstants.STYLE_FONTSIZE]==null){var n=i.isHtmlLabel(t.cell)||e!=null&&mxUtils.isNode(e);t.text=new this.defaultTextShape(e,new mxRectangle,t.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,i.getVerticalAlign(t),t.style[mxConstants.STYLE_FONTCOLOR],t.style[mxConstants.STYLE_FONTFAMILY],t.style[mxConstants.STYLE_FONTSIZE],t.style[mxConstants.STYLE_FONTSTYLE],t.style[mxConstants.STYLE_SPACING],t.style[mxConstants.STYLE_SPACING_TOP],t.style[mxConstants.STYLE_SPACING_RIGHT],t.style[mxConstants.STYLE_SPACING_BOTTOM],t.style[mxConstants.STYLE_SPACING_LEFT],t.style[mxConstants.STYLE_HORIZONTAL],t.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],t.style[mxConstants.STYLE_LABEL_BORDERCOLOR],i.isWrapping(t.cell)&&i.isHtmlLabel(t.cell),i.isLabelClipped(t.cell),t.style[mxConstants.STYLE_OVERFLOW],t.style[mxConstants.STYLE_LABEL_PADDING],mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)),t.text.opacity=mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_OPACITY,100),t.text.dialect=n?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect,t.text.style=t.style,t.text.state=t,this.initializeLabel(t,t.text);var r=!1,s=function(l){var a=t;if(mxClient.IS_TOUCH||r){var o=mxEvent.getClientX(l),u=mxEvent.getClientY(l),p=mxUtils.convertPoint(i.container,o,u);a=i.view.getState(i.getCellAt(p.x,p.y))}return a};mxEvent.addGestureListeners(t.text.node,mxUtils.bind(this,function(l){this.isLabelEvent(t,l)&&(i.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(l,t)),r=i.dialect!=mxConstants.DIALECT_SVG&&mxEvent.getSource(l).nodeName=="IMG")}),mxUtils.bind(this,function(l){this.isLabelEvent(t,l)&&i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(l,s(l)))}),mxUtils.bind(this,function(l){this.isLabelEvent(t,l)&&(i.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(l,s(l))),r=!1)})),i.nativeDblClickEnabled&&mxEvent.addListener(t.text.node,"dblclick",mxUtils.bind(this,function(l){this.isLabelEvent(t,l)&&(i.dblClick(l,t.cell),mxEvent.consume(l))}))}},mxCellRenderer.prototype.initializeLabel=function(t,e){mxClient.IS_SVG&&mxClient.NO_FO&&e.dialect!=mxConstants.DIALECT_SVG?e.init(t.view.graph.container):e.init(t.view.getDrawPane())},mxCellRenderer.prototype.createCellOverlays=function(t){var e=t.view.graph,i=e.getCellOverlays(t.cell),n=null;if(i!=null){n=new mxDictionary;for(var r=0;r0)?this.createLabel(t,n):t.text!=null&&(n==null||n.length==0)&&(t.text.destroy(),t.text=null),t.text!=null){e&&(t.text.lastValue!=null&&this.isTextShapeInvalid(t,t.text)&&(t.text.lastValue=null),t.text.resetStyles(),t.text.apply(t),t.text.valign=i.getVerticalAlign(t));var u=this.getLabelBounds(t),p=this.getTextScale(t);if(this.resolveColor(t,"color",mxConstants.STYLE_FONTCOLOR),e||t.text.value!=n||t.text.isWrapping!=r||t.text.overflow!=o||t.text.isClipping!=s||t.text.scale!=p||t.text.dialect!=a||t.text.bounds==null||!t.text.bounds.equals(u)){t.text.dialect=a,t.text.value=n,t.text.bounds=u,t.text.scale=p,t.text.wrap=r,t.text.clipped=s,t.text.overflow=o;var m=t.text.node.style.visibility;this.redrawLabelShape(t.text),t.text.node.style.visibility=m}}},mxCellRenderer.prototype.isTextShapeInvalid=function(t,e){function i(n,r,s){var l=!1;return r=="spacingTop"||r=="spacingRight"||r=="spacingBottom"||r=="spacingLeft"?l=parseFloat(e[n])-parseFloat(e.spacing)!=(t.style[r]||s):l=e[n]!=(t.style[r]||s),l}return i("fontStyle",mxConstants.STYLE_FONTSTYLE,mxConstants.DEFAULT_FONTSTYLE)||i("family",mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)||i("size",mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)||i("color",mxConstants.STYLE_FONTCOLOR,"black")||i("align",mxConstants.STYLE_ALIGN,"")||i("valign",mxConstants.STYLE_VERTICAL_ALIGN,"")||i("spacing",mxConstants.STYLE_SPACING,2)||i("spacingTop",mxConstants.STYLE_SPACING_TOP,0)||i("spacingRight",mxConstants.STYLE_SPACING_RIGHT,0)||i("spacingBottom",mxConstants.STYLE_SPACING_BOTTOM,0)||i("spacingLeft",mxConstants.STYLE_SPACING_LEFT,0)||i("horizontal",mxConstants.STYLE_HORIZONTAL,!0)||i("background",mxConstants.STYLE_LABEL_BACKGROUNDCOLOR)||i("border",mxConstants.STYLE_LABEL_BORDERCOLOR)||i("opacity",mxConstants.STYLE_TEXT_OPACITY,100)||i("textDirection",mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)},mxCellRenderer.prototype.redrawLabelShape=function(t){t.redraw()},mxCellRenderer.prototype.getTextScale=function(t){return t.view.scale},mxCellRenderer.prototype.getLabelBounds=function(t){var e=t.view.graph,i=t.view.scale,n=e.getModel().isEdge(t.cell),r=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y);if(n){var s=t.text.getSpacing();r.x+=s.x*i,r.y+=s.y*i;var l=e.getCellGeometry(t.cell);l!=null&&(r.width=Math.max(0,l.width*i),r.height=Math.max(0,l.height*i))}else{if(t.text.isPaintBoundsInverted()){var a=r.x;r.x=r.y,r.y=a}r.x+=t.x,r.y+=t.y,r.width=Math.max(1,t.width),r.height=Math.max(1,t.height)}if(t.text.isPaintBoundsInverted()){var o=(t.width-t.height)/2;r.x+=o,r.y-=o;var a=r.width;r.width=r.height,r.height=a}if(t.shape!=null){var u=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),p=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);u==mxConstants.ALIGN_CENTER&&p==mxConstants.ALIGN_MIDDLE&&(r=t.shape.getLabelBounds(r))}var m=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);return m!=null&&(r.width=parseFloat(m)*i),n||this.rotateLabelBounds(t,r),r},mxCellRenderer.prototype.rotateLabelBounds=function(t,e){if(e.y-=t.text.margin.y*e.height,e.x-=t.text.margin.x*e.width,!this.legacySpacing||t.style[mxConstants.STYLE_OVERFLOW]!="fill"&&t.style[mxConstants.STYLE_OVERFLOW]!="width"){var i=t.view.scale,n=t.text.getSpacing();e.x+=n.x*i,e.y+=n.y*i;var r=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),s=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),l=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);e.width=Math.max(0,e.width-(r==mxConstants.ALIGN_CENTER&&l==null?t.text.spacingLeft*i+t.text.spacingRight*i:0)),e.height=Math.max(0,e.height-(s==mxConstants.ALIGN_MIDDLE?t.text.spacingTop*i+t.text.spacingBottom*i:0))}var a=t.text.getTextRotation();if(a!=0&&t!=null&&t.view.graph.model.isVertex(t.cell)){var o=t.getCenterX(),u=t.getCenterY();if(e.x!=o||e.y!=u){var p=a*(Math.PI/180),m=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(p),Math.sin(p),new mxPoint(o,u));e.x=m.x,e.y=m.y}}},mxCellRenderer.prototype.redrawCellOverlays=function(t,e){if(this.createCellOverlays(t),t.overlays!=null){var i=mxUtils.mod(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),90),n=mxUtils.toRadians(i),r=Math.cos(n),s=Math.sin(n);t.overlays.visit(function(l,a){var o=a.overlay.getBounds(t);if(!t.view.graph.getModel().isEdge(t.cell)&&t.shape!=null&&i!=0){var u=o.getCenterX(),p=o.getCenterY(),m=mxUtils.getRotatedPoint(new mxPoint(u,p),r,s,new mxPoint(t.getCenterX(),t.getCenterY()));u=m.x,p=m.y,o.x=Math.round(u-o.width/2),o.y=Math.round(p-o.height/2)}(e||a.bounds==null||a.scale!=t.view.scale||!a.bounds.equals(o))&&(a.bounds=o,a.scale=t.view.scale,a.redraw())})}},mxCellRenderer.prototype.redrawControl=function(t,e){var i=t.view.graph.getFoldingImage(t);if(t.control!=null&&i!=null){var n=this.getControlBounds(t,i.width,i.height),r=this.legacyControlPosition?mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0):t.shape.getTextRotation(),s=t.view.scale;(e||t.control.scale!=s||!t.control.bounds.equals(n)||t.control.rotation!=r)&&(t.control.rotation=r,t.control.bounds=n,t.control.scale=s,t.control.redraw())}},mxCellRenderer.prototype.getControlBounds=function(t,e,i){if(t.control!=null){var n=t.view.scale,r=t.getCenterX(),s=t.getCenterY();if(!t.view.graph.getModel().isEdge(t.cell)&&(r=t.x+e*n,s=t.y+i*n,t.shape!=null)){var l=t.shape.getShapeRotation();if(this.legacyControlPosition)l=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0);else if(t.shape.isPaintBoundsInverted()){var a=(t.width-t.height)/2;r+=a,s-=a}if(l!=0){var o=mxUtils.toRadians(l),u=Math.cos(o),p=Math.sin(o),m=mxUtils.getRotatedPoint(new mxPoint(r,s),u,p,new mxPoint(t.getCenterX(),t.getCenterY()));r=m.x,s=m.y}}return t.view.graph.getModel().isEdge(t.cell)?new mxRectangle(Math.round(r-e/2*n),Math.round(s-i/2*n),Math.round(e*n),Math.round(i*n)):new mxRectangle(Math.round(r-e/2*n),Math.round(s-i/2*n),Math.round(e*n),Math.round(i*n))}return null},mxCellRenderer.prototype.insertStateAfter=function(t,e,i){for(var n=this.getShapesForState(t),r=0;r0)for(var o=0;o0?n[0]:null;u!=null&&(u=p.transformControlPoint(t,u),mxUtils.contains(e,u.x,u.y)&&(u=null));var d=0,x=0,f=0,g=0,c=mxUtils.getValue(t.style,mxConstants.STYLE_SEGMENT,m.gridSize)*p.scale,v=mxUtils.getValue(t.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST);v==mxConstants.DIRECTION_NORTH||v==mxConstants.DIRECTION_SOUTH?(d=p.getRoutingCenterX(e),x=c):(f=p.getRoutingCenterY(e),g=c),u==null||u.xe.x+e.width?u!=null?(d=u.x,g=Math.max(Math.abs(f-u.y),g)):v==mxConstants.DIRECTION_NORTH?f=e.y-2*x:v==mxConstants.DIRECTION_SOUTH?f=e.y+e.height+2*x:v==mxConstants.DIRECTION_EAST?d=e.x-2*g:d=e.x+e.width+2*g:u!=null&&(d=p.getRoutingCenterX(e),x=Math.max(Math.abs(d-u.x),g),f=u.y,g=0),r.push(new mxPoint(d-x,f-g)),r.push(new mxPoint(d+x,f+g))}},ElbowConnector:function(t,e,i,n,r){var s=n!=null&&n.length>0?n[0]:null,l=!1,a=!1;if(e!=null&&i!=null)if(s!=null){var o=Math.min(e.x,i.x),u=Math.max(e.x+e.width,i.x+i.width),p=Math.min(e.y,i.y),m=Math.max(e.y+e.height,i.y+i.height);s=t.view.transformControlPoint(t,s),l=s.ym,a=s.xu}else{var o=Math.max(e.x,i.x),u=Math.min(e.x+e.width,i.x+i.width);if(l=o==u,!l){var p=Math.max(e.y,i.y),m=Math.min(e.y+e.height,i.y+i.height);a=p==m}}!a&&(l||t.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL)?mxEdgeStyle.TopToBottom(t,e,i,n,r):mxEdgeStyle.SideToSide(t,e,i,n,r)},SideToSide:function(t,e,i,n,r){var s=t.view,l=n!=null&&n.length>0?n[0]:null,a=t.absolutePoints,o=a[0],u=a[a.length-1];if(l!=null&&(l=s.transformControlPoint(t,l)),o!=null&&(e=new mxCellState,e.x=o.x,e.y=o.y),u!=null&&(i=new mxCellState,i.x=u.x,i.y=u.y),e!=null&&i!=null){var p=Math.max(e.x,i.x),m=Math.min(e.x+e.width,i.x+i.width),d=l!=null?l.x:Math.round(m+(p-m)/2),x=s.getRoutingCenterY(e),f=s.getRoutingCenterY(i);if(l!=null&&(l.y>=e.y&&l.y<=e.y+e.height&&(x=l.y),l.y>=i.y&&l.y<=i.y+i.height&&(f=l.y)),!mxUtils.contains(i,d,x)&&!mxUtils.contains(e,d,x)&&r.push(new mxPoint(d,x)),!mxUtils.contains(i,d,f)&&!mxUtils.contains(e,d,f)&&r.push(new mxPoint(d,f)),r.length==1)if(l!=null)!mxUtils.contains(i,d,l.y)&&!mxUtils.contains(e,d,l.y)&&r.push(new mxPoint(d,l.y));else{var g=Math.max(e.y,i.y),c=Math.min(e.y+e.height,i.y+i.height);r.push(new mxPoint(d,g+(c-g)/2))}}},TopToBottom:function(t,e,i,n,r){var s=t.view,l=n!=null&&n.length>0?n[0]:null,a=t.absolutePoints,o=a[0],u=a[a.length-1];if(l!=null&&(l=s.transformControlPoint(t,l)),o!=null&&(e=new mxCellState,e.x=o.x,e.y=o.y),u!=null&&(i=new mxCellState,i.x=u.x,i.y=u.y),e!=null&&i!=null){var p=Math.max(e.y,i.y),m=Math.min(e.y+e.height,i.y+i.height),d=s.getRoutingCenterX(e);l!=null&&l.x>=e.x&&l.x<=e.x+e.width&&(d=l.x);var x=l!=null?l.y:Math.round(m+(p-m)/2);if(!mxUtils.contains(i,d,x)&&!mxUtils.contains(e,d,x)&&r.push(new mxPoint(d,x)),l!=null&&l.x>=i.x&&l.x<=i.x+i.width?d=l.x:d=s.getRoutingCenterX(i),!mxUtils.contains(i,d,x)&&!mxUtils.contains(e,d,x)&&r.push(new mxPoint(d,x)),r.length==1)if(l!=null&&r.length==1)!mxUtils.contains(i,l.x,x)&&!mxUtils.contains(e,l.x,x)&&r.push(new mxPoint(l.x,x));else{var f=Math.max(e.x,i.x),g=Math.min(e.x+e.width,i.x+i.width);r.push(new mxPoint(f+(g-f)/2,x))}}},SegmentConnector:function(t,e,i,n,r){var s=mxEdgeStyle.scalePointArray(t.absolutePoints,t.view.scale),l=mxEdgeStyle.scaleCellState(e,t.view.scale),a=mxEdgeStyle.scaleCellState(i,t.view.scale),o=1,u=r.length>0?r[0]:null,p=!0,m=null;function d(R){return R.x=Math.round(R.x*t.view.scale*10)/10,R.y=Math.round(R.y*t.view.scale*10)/10,(u==null||Math.abs(u.x-R.x)>=o||Math.abs(u.y-R.y)>=Math.max(1,t.view.scale))&&(r.push(R),u=R),u}var x=s[0];x==null&&l!=null?x=new mxPoint(t.view.getRoutingCenterX(l),t.view.getRoutingCenterY(l)):x!=null&&(x=x.clone());var f=s.length-1;if(n!=null&&n.length>0){for(var g=[],c=0;c=T.y&&L.y<=T.y+T.height,P=T!=null&&L.x>=T.x&&L.x<=T.x+T.width;if(S=M||C==null&&I,E=A||C==null&&P,!(c==0&&(S&&E||A&&M))){if(C!=null&&!M&&!A&&(I||P)){p=!I;break}if(E||S){p=S,c==1&&(p=g.length%2==0?S:E);break}}T=a,C=s[f],C!=null&&(T=null),L=g[g.length-1],A&&M&&(g=g.slice(1))}p&&(s[0]!=null&&s[0].y!=m.y||s[0]==null&&l!=null&&(m.yl.y+l.height))?d(new mxPoint(x.x,m.y)):!p&&(s[0]!=null&&s[0].x!=m.x||s[0]==null&&l!=null&&(m.xl.x+l.width))&&d(new mxPoint(m.x,x.y)),p?x.y=m.y:x.x=m.x;for(var c=0;ca.y+a.height))?d(new mxPoint(x.x,m.y)):!p&&(s[f]!=null&&s[f].x!=m.x||s[f]==null&&a!=null&&(m.xa.x+a.width))&&d(new mxPoint(m.x,x.y))),s[0]==null&&l!=null)for(;r.length>1&&r[1]!=null&&mxUtils.contains(l,r[1].x,r[1].y);)r.splice(1,1);if(s[f]==null&&a!=null)for(;r.length>1&&r[r.length-1]!=null&&mxUtils.contains(a,r[r.length-1].x,r[r.length-1].y);)r.splice(r.length-1,1);y!=null&&r[r.length-1]!=null&&Math.abs(y.x-r[r.length-1].x)<=o&&Math.abs(y.y-r[r.length-1].y)<=o&&(r.splice(r.length-1,1),r[r.length-1]!=null&&(Math.abs(r[r.length-1].x-y.x)0||l||a){mxEdgeStyle.SegmentConnector(t,e,i,n,r);return}var M=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL],I=0;if(u!=null&&(M[0]=mxUtils.getPortConstraints(u,t,!0,mxConstants.DIRECTION_MASK_ALL),I=mxUtils.getValue(u.style,mxConstants.STYLE_ROTATION,0),I!=0)){var P=mxUtils.getBoundingBox(new mxRectangle(x,f,g,c),I);x=P.x,f=P.y,g=P.width,c=P.height}if(p!=null&&(M[1]=mxUtils.getPortConstraints(p,t,!1,mxConstants.DIRECTION_MASK_ALL),I=mxUtils.getValue(p.style,mxConstants.STYLE_ROTATION,0),I!=0)){var P=mxUtils.getBoundingBox(new mxRectangle(v,y,T,C),I);v=P.x,y=P.y,T=P.width,C=P.height}for(var R=[0,0],O=[[x,f,g,c],[v,y,T,C]],_=[S,E],b=0;b<2;b++)mxEdgeStyle.limits[b][1]=O[b][0]-_[b],mxEdgeStyle.limits[b][2]=O[b][1]-_[b],mxEdgeStyle.limits[b][4]=O[b][0]+O[b][2]+_[b],mxEdgeStyle.limits[b][8]=O[b][1]+O[b][3]+_[b];var k=O[0][0]+O[0][2]/2,G=O[0][1]+O[0][3]/2,B=O[1][0]+O[1][2]/2,j=O[1][1]+O[1][3]/2,H=k-B,W=G-j,X=0;H<0?W<0?X=2:X=1:W<=0&&(X=3,H==0&&(X=2));var V=null;u!=null&&(V=m);for(var Y=[[.5,.5],[.5,.5]],b=0;b<2;b++)V!=null&&(Y[b][0]=(V.x-O[b][0])/O[b][2],Math.abs(V.x-O[b][0])<=1?R[b]=mxConstants.DIRECTION_MASK_WEST:Math.abs(V.x-O[b][0]-O[b][2])<=1&&(R[b]=mxConstants.DIRECTION_MASK_EAST),Y[b][1]=(V.y-O[b][1])/O[b][3],Math.abs(V.y-O[b][1])<=1?R[b]=mxConstants.DIRECTION_MASK_NORTH:Math.abs(V.y-O[b][1]-O[b][3])<=1&&(R[b]=mxConstants.DIRECTION_MASK_SOUTH)),V=null,p!=null&&(V=d);var et=O[0][1]-(O[1][1]+O[1][3]),q=O[0][0]-(O[1][0]+O[1][2]),K=O[1][1]-(O[0][1]+O[0][3]),Z=O[1][0]-(O[0][0]+O[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(q-L,0),mxEdgeStyle.vertexSeperations[2]=Math.max(et-L,0),mxEdgeStyle.vertexSeperations[4]=Math.max(K-L,0),mxEdgeStyle.vertexSeperations[3]=Math.max(Z-L,0);var N=[],D=[],F=[];D[0]=q>=Z?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST,F[0]=et>=K?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH,D[1]=mxUtils.reversePortConstraints(D[0]),F[1]=mxUtils.reversePortConstraints(F[0]);for(var st=q>=Z?q:Z,J=et>=K?et:K,U=[[0,0],[0,0]],$=!1,b=0;b<2;b++)R[b]==0&&((D[b]&M[b])==0&&(D[b]=mxUtils.reversePortConstraints(D[b])),(F[b]&M[b])==0&&(F[b]=mxUtils.reversePortConstraints(F[b])),U[b][0]=F[b],U[b][1]=D[b]);J>0&&st>0&&((D[0]&M[0])>0&&(F[1]&M[1])>0?(U[0][0]=D[0],U[0][1]=F[0],U[1][0]=F[1],U[1][1]=D[1],$=!0):(F[0]&M[0])>0&&(D[1]&M[1])>0&&(U[0][0]=F[0],U[0][1]=D[0],U[1][0]=D[1],U[1][1]=F[1],$=!0)),J>0&&!$&&(U[0][0]=F[0],U[0][1]=D[0],U[1][0]=F[1],U[1][1]=D[1],$=!0),st>0&&!$&&(U[0][0]=D[0],U[0][1]=F[0],U[1][0]=D[1],U[1][1]=F[1],$=!0);for(var b=0;b<2;b++)R[b]==0&&((U[b][0]&M[b])==0&&(U[b][0]=U[b][1]),N[b]=U[b][0]&M[b],N[b]|=(U[b][1]&M[b])<<8,N[b]|=(U[1-b][b]&M[b])<<16,N[b]|=(U[1-b][1-b]&M[b])<<24,(N[b]&15)==0&&(N[b]=N[b]<<8),(N[b]&3840)==0&&(N[b]=N[b]&15|N[b]>>8),(N[b]&983040)==0&&(N[b]=N[b]&65535|(N[b]&251658240)>>8),R[b]=N[b]&15,(M[b]==mxConstants.DIRECTION_MASK_WEST||M[b]==mxConstants.DIRECTION_MASK_NORTH||M[b]==mxConstants.DIRECTION_MASK_EAST||M[b]==mxConstants.DIRECTION_MASK_SOUTH)&&(R[b]=M[b]));var rt=R[0]==mxConstants.DIRECTION_MASK_EAST?3:R[0],tt=R[1]==mxConstants.DIRECTION_MASK_EAST?3:R[1];rt-=X,tt-=X,rt<1&&(rt+=4),tt<1&&(tt+=4);var Q=mxEdgeStyle.routePatterns[rt-1][tt-1];switch(mxEdgeStyle.wayPoints1[0][0]=O[0][0],mxEdgeStyle.wayPoints1[0][1]=O[0][1],R[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=S,mxEdgeStyle.wayPoints1[0][1]+=Y[0][1]*O[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=Y[0][0]*O[0][2],mxEdgeStyle.wayPoints1[0][1]+=O[0][3]+S;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=O[0][2]+S,mxEdgeStyle.wayPoints1[0][1]+=Y[0][1]*O[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=Y[0][0]*O[0][2],mxEdgeStyle.wayPoints1[0][1]-=S;break}for(var z=0,ut=(R[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1,mt=ut,it=0,b=0;b4&&(lt-=4);var ht=mxEdgeStyle.dirVectors[lt-1];it=lt%2>0?0:1,it!=ut&&(z++,mxEdgeStyle.wayPoints1[z][0]=mxEdgeStyle.wayPoints1[z-1][0],mxEdgeStyle.wayPoints1[z][1]=mxEdgeStyle.wayPoints1[z-1][1]);var vt=(Q[b]&mxEdgeStyle.TARGET_MASK)>0,ft=(Q[b]&mxEdgeStyle.SOURCE_MASK)>0,at=(Q[b]&mxEdgeStyle.SIDE_MASK)>>5;at=at<15&&(at=at>>4);var dt=(Q[b]&mxEdgeStyle.CENTER_MASK)>0;if((ft||vt)&&at<9){var pt=0,ot=ft?0:1;if(dt&&it==0?pt=O[ot][0]+Y[ot][0]*O[ot][2]:dt?pt=O[ot][1]+Y[ot][1]*O[ot][3]:pt=mxEdgeStyle.limits[ot][at],it==0){var yt=mxEdgeStyle.wayPoints1[z][0],gt=(pt-yt)*ht[0];gt>0&&(mxEdgeStyle.wayPoints1[z][0]+=ht[0]*gt)}else{var Ct=mxEdgeStyle.wayPoints1[z][1],ct=(pt-Ct)*ht[1];ct>0&&(mxEdgeStyle.wayPoints1[z][1]+=ht[1]*ct)}}else dt&&(mxEdgeStyle.wayPoints1[z][0]+=ht[0]*Math.abs(mxEdgeStyle.vertexSeperations[lt]/2),mxEdgeStyle.wayPoints1[z][1]+=ht[1]*Math.abs(mxEdgeStyle.vertexSeperations[lt]/2));z>0&&mxEdgeStyle.wayPoints1[z][it]==mxEdgeStyle.wayPoints1[z-1][it]?z--:ut=it}for(var b=0;b<=z;b++){if(b==z){var Et=(R[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1,St=Et==mt?0:1;if(St!=(z+1)%2)break}r.push(new mxPoint(Math.round(mxEdgeStyle.wayPoints1[b][0]*t.view.scale*10)/10,Math.round(mxEdgeStyle.wayPoints1[b][1]*t.view.scale*10)/10))}for(var nt=1;nt0){for(var i=this.graph.getModel(),n=0;n0||l.height>0){r=new mxPoint(e.x,e.y);var a=!1,o=!1;this.graph.model.isVertex(t.cell)&&(a=mxUtils.getValue(t.style,mxConstants.STYLE_FLIPH,0)==1,o=mxUtils.getValue(t.style,mxConstants.STYLE_FLIPV,0)==1,t.shape!=null&&t.shape.stencil!=null&&(a=mxUtils.getValue(t.style,"stencilFlipH",0)==1||a,o=mxUtils.getValue(t.style,"stencilFlipV",0)==1||o),a&&(r.x=2*l.getCenterX()-r.x),o&&(r.y=2*l.getCenterY()-r.y)),r=s(l,t,r,i),r!=null&&(a&&(r.x=2*l.getCenterX()-r.x),o&&(r.y=2*l.getCenterY()-r.y))}}r==null&&(r=this.getPoint(t))}return r},mxGraphView.prototype.getRoutingCenterX=function(t){var e=t.style!=null&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_X])||0;return t.getCenterX()+e*t.width},mxGraphView.prototype.getRoutingCenterY=function(t){var e=t.style!=null&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0;return t.getCenterY()+e*t.height},mxGraphView.prototype.getPerimeterBounds=function(t,e){return e=e??0,t!=null&&(e+=parseFloat(t.style[mxConstants.STYLE_PERIMETER_SPACING]||0)),t.getPerimeterBounds(e*this.scale)},mxGraphView.prototype.getPerimeterFunction=function(t){var e=t.style[mxConstants.STYLE_PERIMETER];if(typeof e=="string"){var i=mxStyleRegistry.getValue(e);i==null&&this.isAllowEval()&&(i=mxUtils.eval(e)),e=i}return typeof e=="function"?e:null},mxGraphView.prototype.getNextPoint=function(t,e,i){var n=t.absolutePoints,r=null;if(n!=null&&n.length>=2){var s=n.length;r=n[i?Math.min(1,s-1):Math.max(0,s-2)]}return r==null&&e!=null&&(r=new mxPoint(e.getCenterX(),e.getCenterY())),r},mxGraphView.prototype.getVisibleTerminal=function(t,e){for(var i=this.graph.getModel(),n=i.getTerminal(t,e),r=n;n!=null&&n!=this.currentRoot;)(!this.graph.isCellVisible(r)||this.isCellCollapsed(n))&&(r=n),n=i.getParent(n);return r!=null&&(!i.contains(r)||i.getParent(r)==i.getRoot()||r==this.currentRoot)&&(r=null),r},mxGraphView.prototype.updateEdgeBounds=function(t){var e=t.absolutePoints,i=e[0],n=e[e.length-1];if(i.x!=n.x||i.y!=n.y){var r=n.x-i.x,s=n.y-i.y;t.terminalDistance=Math.sqrt(r*r+s*s)}else t.terminalDistance=0;var l=0,a=[],o=i;if(o!=null){for(var u=o.x,p=o.y,m=u,d=p,x=1;x=Math.round(o+a)&&u1){for(var l=t.length,a=t.segments,o=t.absolutePoints[0],u=t.absolutePoints[1],p=mxUtils.ptSegDistSq(o.x,o.y,u.x,u.y,e,i),m=0,d=0,x=0,f=2;fc&&(P=c);var R=Math.sqrt(mxUtils.ptSegDistSq(o.x,o.y,u.x,u.y,e,i)),O=mxUtils.relativeCcw(o.x,o.y,u.x,u.y,e,i);return O==-1&&(R=-R),new mxPoint((l/2-x-P)/l*-2,R/this.scale)}}return new mxPoint},mxGraphView.prototype.updateEdgeLabelOffset=function(t){var e=t.absolutePoints;if(t.absoluteOffset.x=t.getCenterX(),t.absoluteOffset.y=t.getCenterY(),e!=null&&e.length>0&&t.segments!=null){var i=this.graph.getCellGeometry(t.cell);if(i.relative){var n=this.getPoint(t,i);n!=null&&(t.absoluteOffset=n)}else{var r=e[0],s=e[e.length-1];if(r!=null&&s!=null){var l=s.x-r.x,a=s.y-r.y,o=0,u=0,p=i.offset;p!=null&&(o=p.x,u=p.y);var m=r.x+l/2+o*this.scale,d=r.y+a/2+u*this.scale;t.absoluteOffset.x=m,t.absoluteOffset.y=d}}}},mxGraphView.prototype.getState=function(t,e){e=e||!1;var i=null;return t!=null&&(i=this.states.get(t),e&&(i==null||this.updateStyle)&&this.graph.isCellVisible(t)&&(i==null?(i=this.createState(t),this.states.put(t,i)):i.style=this.graph.getCellStyle(t))),i},mxGraphView.prototype.isRendering=function(){return this.rendering},mxGraphView.prototype.setRendering=function(t){this.rendering=t},mxGraphView.prototype.isAllowEval=function(){return this.allowEval},mxGraphView.prototype.setAllowEval=function(t){this.allowEval=t},mxGraphView.prototype.getStates=function(){return this.states},mxGraphView.prototype.setStates=function(t){this.states=t},mxGraphView.prototype.getCellStates=function(t){if(t==null)return this.states;for(var e=[],i=0;ir&&i.x>r+2&&i.x<=n)return!0;var s=this.graph.container.offsetHeight,l=this.graph.container.clientHeight;return s>l&&i.y>l+2&&i.y<=s},mxGraphView.prototype.init=function(){this.installListeners();var t=this.graph;t.dialect==mxConstants.DIALECT_SVG?this.createSvg():t.dialect==mxConstants.DIALECT_VML?this.createVml():this.createHtml()},mxGraphView.prototype.installListeners=function(){var t=this.graph,e=t.container;if(e!=null){mxClient.IS_TOUCH&&(mxEvent.addListener(e,"gesturestart",mxUtils.bind(this,function(r){t.fireGestureEvent(r),mxEvent.consume(r)})),mxEvent.addListener(e,"gesturechange",mxUtils.bind(this,function(r){t.fireGestureEvent(r),mxEvent.consume(r)})),mxEvent.addListener(e,"gestureend",mxUtils.bind(this,function(r){t.fireGestureEvent(r),mxEvent.consume(r)})));var i=null;mxEvent.addGestureListeners(e,mxUtils.bind(this,function(r){this.isContainerEvent(r)&&(!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_GC&&!mxClient.IS_OP&&!mxClient.IS_SF||!this.isScrollEvent(r))&&(t.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(r)),i=r.pointerId)}),mxUtils.bind(this,function(r){this.isContainerEvent(r)&&(i==null||r.pointerId==i)&&t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(r))}),mxUtils.bind(this,function(r){this.isContainerEvent(r)&&t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(r)),i=null})),mxEvent.addListener(e,"dblclick",mxUtils.bind(this,function(r){this.isContainerEvent(r)&&t.dblClick(r)}));var n=function(r){var s=null;if(mxClient.IS_TOUCH){var l=mxEvent.getClientX(r),a=mxEvent.getClientY(r),o=mxUtils.convertPoint(e,l,a);s=t.view.getState(t.getCellAt(o.x,o.y))}return s};t.addMouseListener({mouseDown:function(r,s){t.popupMenuHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,function(r){t.tooltipHandler!=null&&t.tooltipHandler.isHideOnHover()&&t.tooltipHandler.hide(),this.captureDocumentGesture&&t.isMouseDown&&t.container!=null&&!this.isContainerEvent(r)&&t.container.style.display!="none"&&t.container.style.visibility!="hidden"&&!mxEvent.isConsumed(r)&&t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(r,n(r)))}),this.endHandler=mxUtils.bind(this,function(r){this.captureDocumentGesture&&t.isMouseDown&&t.container!=null&&!this.isContainerEvent(r)&&t.container.style.display!="none"&&t.container.style.visibility!="hidden"&&t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(r))}),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler)}},mxGraphView.prototype.createHtml=function(){var t=this.graph.container;if(t!=null&&(this.canvas=this.createHtmlPane("100%","100%"),this.canvas.style.overflow="hidden",this.backgroundPane=this.createHtmlPane("1px","1px"),this.drawPane=this.createHtmlPane("1px","1px"),this.overlayPane=this.createHtmlPane("1px","1px"),this.decoratorPane=this.createHtmlPane("1px","1px"),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),this.canvas.appendChild(this.decoratorPane),t.appendChild(this.canvas),this.updateContainerStyle(t),mxClient.IS_QUIRKS)){var e=mxUtils.bind(this,function(i){var n=this.getGraphBounds(),r=n.x+n.width+this.graph.border,s=n.y+n.height+this.graph.border;this.updateHtmlCanvasSize(r,s)});mxEvent.addListener(window,"resize",e)}},mxGraphView.prototype.updateHtmlCanvasSize=function(t,e){if(this.graph.container!=null){var i=this.graph.container.offsetWidth,n=this.graph.container.offsetHeight;i")},mxGraph.prototype.createHandlers=function(){this.tooltipHandler=this.createTooltipHandler(),this.tooltipHandler.setEnabled(!1),this.selectionCellsHandler=this.createSelectionCellsHandler(),this.connectionHandler=this.createConnectionHandler(),this.connectionHandler.setEnabled(!1),this.graphHandler=this.createGraphHandler(),this.panningHandler=this.createPanningHandler(),this.panningHandler.panningEnabled=!1,this.popupMenuHandler=this.createPopupMenuHandler()},mxGraph.prototype.createTooltipHandler=function(){return new mxTooltipHandler(this)},mxGraph.prototype.createSelectionCellsHandler=function(){return new mxSelectionCellsHandler(this)},mxGraph.prototype.createConnectionHandler=function(){return new mxConnectionHandler(this)},mxGraph.prototype.createGraphHandler=function(){return new mxGraphHandler(this)},mxGraph.prototype.createPanningHandler=function(){return new mxPanningHandler(this)},mxGraph.prototype.createPopupMenuHandler=function(){return new mxPopupMenuHandler(this)},mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)},mxGraph.prototype.createStylesheet=function(){return new mxStylesheet},mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)},mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer},mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)},mxGraph.prototype.getModel=function(){return this.model},mxGraph.prototype.getView=function(){return this.view},mxGraph.prototype.getStylesheet=function(){return this.stylesheet},mxGraph.prototype.setStylesheet=function(t){this.stylesheet=t},mxGraph.prototype.getSelectionModel=function(){return this.selectionModel},mxGraph.prototype.setSelectionModel=function(t){this.selectionModel=t},mxGraph.prototype.getSelectionCellsForChanges=function(t,e){for(var i=new mxDictionary,n=[],r=mxUtils.bind(this,function(o){if(!i.get(o)&&this.model.contains(o))if(this.model.isEdge(o)||this.model.isVertex(o))i.put(o,!0),n.push(o);else for(var u=this.model.getChildCount(o),p=0;p=0){t.overlays.splice(i,1),t.overlays.length==0&&(t.overlays=null);var n=this.view.getState(t);n!=null&&this.cellRenderer.redraw(n),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",t,"overlay",e))}else e=null}return e},mxGraph.prototype.removeCellOverlays=function(t){var e=t.overlays;if(e!=null){t.overlays=null;var i=this.view.getState(t);i!=null&&this.cellRenderer.redraw(i);for(var n=0;n0){i=i??this.warningImage;var r=new mxCellOverlay(i,""+e+"");return n&&r.addListener(mxEvent.CLICK,mxUtils.bind(this,function(s,l){this.isEnabled()&&this.setSelectionCell(t)})),this.addCellOverlay(t,r)}else this.removeCellOverlays(t);return null},mxGraph.prototype.startEditing=function(t){this.startEditingAtCell(null,t)},mxGraph.prototype.startEditingAtCell=function(t,e){(e==null||!mxEvent.isMultiTouchEvent(e))&&(t==null&&(t=this.getSelectionCell(),t!=null&&!this.isCellEditable(t)&&(t=null)),t!=null&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",t,"event",e)),this.cellEditor.startEditing(t,e),this.fireEvent(new mxEventObject(mxEvent.EDITING_STARTED,"cell",t,"event",e))))},mxGraph.prototype.getEditingValue=function(t,e){return this.convertValueToString(t)},mxGraph.prototype.stopEditing=function(t){this.cellEditor.stopEditing(t),this.fireEvent(new mxEventObject(mxEvent.EDITING_STOPPED,"cancel",t))},mxGraph.prototype.labelChanged=function(t,e,i){this.model.beginUpdate();try{var n=t.value;this.cellLabelChanged(t,e,this.isAutoSizeCell(t)),this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",t,"value",e,"old",n,"event",i))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellLabelChanged=function(t,e,i){this.model.beginUpdate();try{this.model.setValue(t,e),i&&this.cellSizeUpdated(t,!1)}finally{this.model.endUpdate()}},mxGraph.prototype.escape=function(t){this.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",t))},mxGraph.prototype.click=function(t){var e=t.getEvent(),i=t.getCell(),n=new mxEventObject(mxEvent.CLICK,"event",e,"cell",i);if(t.isConsumed()&&n.consume(),this.fireEvent(n),this.isEnabled()&&!mxEvent.isConsumed(e)&&!n.isConsumed()){if(i!=null){if(this.isTransparentClickEvent(e)){var r=!1,s=this.getCellAt(t.graphX,t.graphY,null,null,null,mxUtils.bind(this,function(p){var m=this.isCellSelected(p.cell);return r=r||m,!r||m||p.cell!=i&&this.model.isAncestor(p.cell,i)}));s!=null&&(i=s)}}else if(this.isSwimlaneSelectionEnabled()&&(i=this.getSwimlaneAt(t.getGraphX(),t.getGraphY()),i!=null&&(!this.isToggleEvent(e)||!mxEvent.isAltDown(e)))){for(var l=i,a=[];l!=null;){l=this.model.getParent(l);var o=this.view.getState(l);this.isSwimlane(l)&&o!=null&&a.push(l)}if(a.length>0){a=a.reverse(),a.splice(0,0,i),a.push(i);for(var u=0;u=r.scrollLeft&&e>=r.scrollTop&&t<=r.scrollLeft+r.clientWidth&&e<=r.scrollTop+r.clientHeight){var s=r.scrollLeft+r.clientWidth-t;if(s0&&p.height>0){e&&p.x!=null&&p.y!=null&&(p=p.clone(),p.width+=p.x,p.height+=p.y,p.x=0,p.y=0);var m=this.view.scale,d=p.width/m,x=p.height/m;this.backgroundImage!=null&&(d=Math.max(d,this.backgroundImage.width-p.x/m),x=Math.max(x,this.backgroundImage.height-p.y/m));var f=(e?t:2*t)+i+1;o-=f,u-=f;var g=r?u/x:s?o/d:Math.min(o/d,u/x);if(this.minFitScale!=null&&(g=Math.max(g,this.minFitScale)),this.maxFitScale!=null&&(g=Math.min(g,this.maxFitScale)),n)if(e)this.view.scale!=g&&this.view.setScale(g);else if(mxUtils.hasScrollbars(this.container)){this.view.setScale(g);var y=this.getGraphBounds();y.x!=null&&(this.container.scrollLeft=y.x),y.y!=null&&(this.container.scrollTop=y.y)}else{var c=p.x!=null?Math.floor(this.view.translate.x-p.x/m+t/g+i/2):t,v=p.y!=null?Math.floor(this.view.translate.y-p.y/m+t/g+i/2):t;this.view.scaleAndTranslate(g,c,v)}else return g}}return this.view.scale},mxGraph.prototype.sizeDidChange=function(){var t=this.getGraphBounds();if(this.container!=null){var e=this.getBorder(),i=Math.max(0,t.x)+t.width+2*e,n=Math.max(0,t.y)+t.height+2*e;if(this.minimumContainerSize!=null&&(i=Math.max(i,this.minimumContainerSize.width),n=Math.max(n,this.minimumContainerSize.height)),this.resizeContainer&&this.doResizeContainer(i,n),this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var r=this.getPreferredPageSize(t,Math.max(1,i),Math.max(1,n));r!=null&&(i=r.width*this.view.scale,n=r.height*this.view.scale)}if(this.minimumGraphSize!=null&&(i=Math.max(i,this.minimumGraphSize.width*this.view.scale),n=Math.max(n,this.minimumGraphSize.height*this.view.scale)),i=Math.ceil(i),n=Math.ceil(n),this.dialect==mxConstants.DIALECT_SVG){var s=this.view.getDrawPane().ownerSVGElement;s!=null&&(s.style.minWidth=Math.max(1,i)+"px",s.style.minHeight=Math.max(1,n)+"px",s.style.width="100%",s.style.height="100%")}else mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,i),Math.max(1,n)):(this.view.canvas.style.minWidth=Math.max(1,i)+"px",this.view.canvas.style.minHeight=Math.max(1,n)+"px");this.updatePageBreaks(this.pageBreaksVisible,i,n)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",t))},mxGraph.prototype.doResizeContainer=function(t,e){this.maximumContainerSize!=null&&(t=Math.min(this.maximumContainerSize.width,t),e=Math.min(this.maximumContainerSize.height,e)),this.container.style.width=Math.ceil(t)+"px",this.container.style.height=Math.ceil(e)+"px"},mxGraph.prototype.updatePageBreaks=function(t,e,i){var n=this.view.scale,r=this.view.translate,s=this.pageFormat,l=n*this.pageScale,a=new mxRectangle(0,0,s.width*l,s.height*l),o=mxRectangle.fromRectangle(this.getGraphBounds());o.width=Math.max(1,o.width),o.height=Math.max(1,o.height),a.x=Math.floor((o.x-r.x*n)/a.width)*a.width+r.x*n,a.y=Math.floor((o.y-r.y*n)/a.height)*a.height+r.y*n,o.width=Math.ceil((o.width+(o.x-a.x))/a.width)*a.width,o.height=Math.ceil((o.height+(o.y-a.y))/a.height)*a.height,t=t&&Math.min(a.width,a.height)>this.minPageBreakDist;var u=t?Math.ceil(o.height/a.height)+1:0,p=t?Math.ceil(o.width/a.width)+1:0,m=(p-1)*a.width,d=(u-1)*a.height;this.horizontalPageBreaks==null&&u>0&&(this.horizontalPageBreaks=[]),this.verticalPageBreaks==null&&p>0&&(this.verticalPageBreaks=[]);var x=mxUtils.bind(this,function(f){if(f!=null){for(var g=f==this.horizontalPageBreaks?u:p,c=0;c<=g;c++){var v=f==this.horizontalPageBreaks?[new mxPoint(Math.round(a.x),Math.round(a.y+c*a.height)),new mxPoint(Math.round(a.x+m),Math.round(a.y+c*a.height))]:[new mxPoint(Math.round(a.x+c*a.width),Math.round(a.y)),new mxPoint(Math.round(a.x+c*a.width),Math.round(a.y+d))];if(f[c]!=null)f[c].points=v,f[c].redraw();else{var y=new mxPolyline(v,this.pageBreakColor);y.dialect=this.dialect,y.pointerEvents=!1,y.isDashed=this.pageBreakDashed,y.init(this.view.backgroundPane),y.redraw(),f[c]=y}}for(var c=g;c0&&i.substring(n-7,n+1)!=";base64,"&&(i=i.substring(0,n)+";base64,"+i.substring(n+1))}t[mxConstants.STYLE_IMAGE]=i}}return t},mxGraph.prototype.setCellStyle=function(t,e){if(e=e||this.getSelectionCells(),e!=null){this.model.beginUpdate();try{for(var i=0;i0){var r=this.getCurrentCellStyle(i[0]);n=mxUtils.getValue(r,t,e)?0:1,this.setCellStyles(t,n,i)}return n},mxGraph.prototype.setCellStyles=function(t,e,i){i=i||this.getSelectionCells(),mxUtils.setCellStyles(this.model,i,t,e)},mxGraph.prototype.toggleCellStyleFlags=function(t,e,i){this.setCellStyleFlags(t,e,null,i)},mxGraph.prototype.setCellStyleFlags=function(t,e,i,n){if(n=n||this.getSelectionCells(),n!=null&&n.length>0){if(i==null){var r=this.getCurrentCellStyle(n[0]),s=parseInt(r[t]||0);i=(s&e)!=e}mxUtils.setCellStyleFlags(this.model,n,t,e,i)}},mxGraph.prototype.alignCells=function(t,e,i){if(e==null&&(e=this.getSelectionCells()),e!=null&&e.length>1){if(i==null)for(var n=0;n1&&n!=null){var r=this.model.getParent(t);r==null&&(r=this.model.getParent(i[0])),this.model.beginUpdate();try{this.getCellGeometry(t)==null&&this.model.setGeometry(t,new mxGeometry);var s=this.model.getChildCount(r);this.cellsAdded([t],r,s,null,null,!1,!1,!1),s=this.model.getChildCount(t),this.cellsAdded(i,t,s,null,null,!1,!1,!1),this.cellsMoved(i,-n.x,-n.y,!1,!1,!1),this.cellsResized([t],[n],!1),this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",t,"border",e,"cells",i))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.getCellsForGroup=function(t){var e=[];if(t!=null&&t.length>0){var i=this.model.getParent(t[0]);e.push(t[0]);for(var n=1;n0){this.model.beginUpdate();try{for(var i=0;i0){n=n.slice();var r=this.model.getParent(t[i]),s=this.model.getChildCount(r);this.cellsAdded(n,r,s,null,null,!0),e=e.concat(n);for(var l=0;l0&&e.push(t[i]);return e},mxGraph.prototype.removeCellsAfterUngroup=function(t){this.cellsRemoved(this.addAllEdges(t))},mxGraph.prototype.removeCellsFromParent=function(t){t==null&&(t=this.getSelectionCells()),this.model.beginUpdate();try{var e=this.getDefaultParent(),i=this.model.getChildCount(e);this.cellsAdded(t,e,i,null,null,!0),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",t))}finally{this.model.endUpdate()}return t},mxGraph.prototype.updateGroupBounds=function(t,e,i,n,r,s,l){t==null&&(t=this.getSelectionCells()),e=e??0,i=i??!1,n=n??0,r=r??0,s=s??0,l=l??0,this.model.beginUpdate();try{for(var a=t.length-1;a>=0;a--){var o=this.getCellGeometry(t[a]);if(o!=null){var u=this.getChildCells(t[a]);if(u!=null&&u.length>0){var p=this.getBoundingBoxFromGeometry(u,!0);if(p!=null&&p.width>0&&p.height>0){var m=this.isSwimlane(t[a])?this.getActualStartSize(t[a],!0):new mxRectangle;o=o.clone(),i&&(o.x=Math.round(o.x+p.x-e-m.x-l),o.y=Math.round(o.y+p.y-e-m.y-n)),o.width=Math.round(p.width+2*e+m.x+l+r+m.width),o.height=Math.round(p.height+2*e+m.y+n+s+m.height),this.model.setGeometry(t[a],o),this.moveCells(u,e+m.x-p.x+l,e+m.y-p.y+n)}}}}}finally{this.model.endUpdate()}return t},mxGraph.prototype.getBoundingBox=function(t){var e=null;if(t!=null&&t.length>0){for(var i=0;i0){var o=this.view.scale,u=this.view.translate;r=this.model.cloneCells(t,!0,i);for(var a=0;athis.model.getChildCount(e)&&i--,this.model.add(e,t[m],i+m),this.autoSizeCellsOnAdd&&this.autoSizeCell(t[m],!0),(a==null||a)&&this.isExtendParentsOnAdd(t[m])&&this.isExtendParent(t[m])&&this.extendParent(t[m]),(l==null||l)&&this.constrainChild(t[m]),n!=null&&this.cellConnected(t[m],n,!0),r!=null&&this.cellConnected(t[m],r,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",t,"parent",e,"index",i,"source",n,"target",r,"absolute",s))}finally{this.model.endUpdate()}}},mxGraph.prototype.autoSizeCell=function(t,e){if(e=e??!0,e)for(var i=this.model.getChildCount(t),n=0;n0){var e=this.view.scale,i=this.view.translate;this.model.beginUpdate();try{for(var n=new mxDictionary,r=0;r0){this.model.beginUpdate();try{for(var i=0;i0){this.model.beginUpdate();try{for(var r=0;r0&&(r.height=Math.max(r.height,l))}}e.alternateBounds=new mxRectangle(0,0,r.width,r.height)}if(e.alternateBounds!=null){e.alternateBounds.x=e.x,e.alternateBounds.y=e.y;var a=mxUtils.toRadians(n[mxConstants.STYLE_ROTATION]||0);if(a!=0){var o=e.alternateBounds.getCenterX()-e.getCenterX(),u=e.alternateBounds.getCenterY()-e.getCenterY(),p=Math.cos(a),m=Math.sin(a),d=p*o-m*u,x=m*o+p*u;e.alternateBounds.x+=d-o,e.alternateBounds.y+=x-u}}}},mxGraph.prototype.addAllEdges=function(t){var e=t.slice();return mxUtils.removeDuplicates(e.concat(this.getAllEdges(t)))},mxGraph.prototype.getAllEdges=function(t){var e=[];if(t!=null)for(var i=0;i0){this.isHtmlLabel(n.cell)||(u=mxUtils.htmlEntities(u,!1)),u=u.replace(/\n/g,"
");var p=mxUtils.getSizeForString(u,s,r[mxConstants.STYLE_FONTFAMILY],e,r[mxConstants.STYLE_FONTSTYLE]),m=p.width+l,d=p.height+a;if(!mxUtils.getValue(r,mxConstants.STYLE_HORIZONTAL,!0)){var x=d;d=m,m=x}this.gridEnabled&&(m=this.snap(m+this.gridSize/2),d=this.snap(d+this.gridSize/2)),i=new mxRectangle(0,0,m,d)}else{var f=4*this.gridSize;i=new mxRectangle(0,0,f,f)}}}return i},mxGraph.prototype.resizeCell=function(t,e,i){return this.resizeCells([t],[e],i)[0]},mxGraph.prototype.resizeCells=function(t,e,i){i=i??this.isRecursiveResize(),this.model.beginUpdate();try{var n=this.cellsResized(t,e,i);this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",t,"bounds",e,"previous",n))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsResized=function(t,e,i){i=i??!1;var n=[];if(t!=null&&e!=null&&t.length==e.length){this.model.beginUpdate();try{for(var r=0;r0&&(l=mxRectangle.fromRectangle(l),l.x-=l.width*a,l.y-=l.height*a,l.width+=2*l.width*a,l.height+=2*l.height*a),r==null?r=l:(r=mxRectangle.fromRectangle(r),r.intersect(l))}}if(r!=null){var o=[t];if(!this.isCellCollapsed(t))for(var u=this.model.getDescendants(t),p=0;pr.width&&(d=i.width-r.width,i.width-=d),m.x+m.width>r.x+r.width&&(d-=m.x+m.width-r.x-r.width-d);var x=0;i.height>r.height&&(x=i.height-r.height,i.height-=x),m.y+m.height>r.y+r.height&&(x-=m.y+m.height-r.y-r.height-x),m.x0&&(e=e.clone(),e.points=[],this.model.setGeometry(t,e)),t},mxGraph.prototype.getOutlineConstraint=function(t,e,i){if(e.shape!=null){var n=this.view.getPerimeterBounds(e),r=e.style[mxConstants.STYLE_DIRECTION];if(r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH){n.x+=n.width/2-n.height/2,n.y+=n.height/2-n.width/2;var s=n.width;n.width=n.height,n.height=s}var l=mxUtils.toRadians(e.shape.getShapeRotation());if(l!=0){var a=Math.cos(-l),o=Math.sin(-l),u=new mxPoint(n.getCenterX(),n.getCenterY());t=mxUtils.getRotatedPoint(t,a,o,u)}var p=1,m=1,d=0,x=0;if(this.getModel().isVertex(e.cell)){var f=e.style[mxConstants.STYLE_FLIPH],g=e.style[mxConstants.STYLE_FLIPV];if(e.shape!=null&&e.shape.stencil!=null&&(f=mxUtils.getValue(e.style,"stencilFlipH",0)==1||f,g=mxUtils.getValue(e.style,"stencilFlipV",0)==1||g),r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH){var s=f;f=g,g=s}f&&(p=-1,d=-n.width),g&&(m=-1,x=-n.height)}t=new mxPoint((t.x-n.x)*p-d+n.x,(t.y-n.y)*m-x+n.y);var c=n.width==0?0:Math.round((t.x-n.x)*1e3/n.width)/1e3,v=n.height==0?0:Math.round((t.y-n.y)*1e3/n.height)/1e3;return new mxConnectionConstraint(new mxPoint(c,v),!1)}return null},mxGraph.prototype.getAllConnectionConstraints=function(t,e){return t!=null&&t.shape!=null&&t.shape.stencil!=null?t.shape.stencil.constraints:null},mxGraph.prototype.getConnectionConstraint=function(t,e,i){var n=null,r=t.style[i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(r!=null){var s=t.style[i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];s!=null&&(n=new mxPoint(parseFloat(r),parseFloat(s)))}var l=!1,a=0,o=0;return n!=null&&(l=mxUtils.getValue(t.style,i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0),a=parseFloat(t.style[i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX]),o=parseFloat(t.style[i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY]),a=isFinite(a)?a:0,o=isFinite(o)?o:0),new mxConnectionConstraint(n,l,null,a,o)},mxGraph.prototype.setConnectionConstraint=function(t,e,i,n){if(n!=null){this.model.beginUpdate();try{n==null||n.point==null?(this.setCellStyles(i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t])):n.point!=null&&(this.setCellStyles(i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,n.point.x,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,n.point.y,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,n.dx,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,n.dy,[t]),n.perimeter?this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t]):this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[t]))}finally{this.model.endUpdate()}}},mxGraph.prototype.getConnectionPoint=function(t,e,i){i=i??!0;var n=null;if(t!=null&&e.point!=null){var r=this.view.getPerimeterBounds(t),s=new mxPoint(r.getCenterX(),r.getCenterY()),l=t.style[mxConstants.STYLE_DIRECTION],a=0;l!=null&&mxUtils.getValue(t.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)==1&&(l==mxConstants.DIRECTION_NORTH?a+=270:l==mxConstants.DIRECTION_WEST?a+=180:l==mxConstants.DIRECTION_SOUTH&&(a+=90),(l==mxConstants.DIRECTION_NORTH||l==mxConstants.DIRECTION_SOUTH)&&r.rotate90());var o=this.view.scale;n=new mxPoint(r.x+e.point.x*r.width+e.dx*o,r.y+e.point.y*r.height+e.dy*o);var u=t.style[mxConstants.STYLE_ROTATION]||0;if(e.perimeter){if(a!=0){var p=0,m=0;a==90?m=1:a==180?p=-1:a==270&&(m=-1),n=mxUtils.getRotatedPoint(n,p,m,s)}n=this.view.getPerimeterPoint(t,n,!1)}else if(u+=a,this.getModel().isVertex(t.cell)){var d=t.style[mxConstants.STYLE_FLIPH]==1,x=t.style[mxConstants.STYLE_FLIPV]==1;if(t.shape!=null&&t.shape.stencil!=null&&(d=mxUtils.getValue(t.style,"stencilFlipH",0)==1||d,x=mxUtils.getValue(t.style,"stencilFlipV",0)==1||x),l==mxConstants.DIRECTION_NORTH||l==mxConstants.DIRECTION_SOUTH){var f=d;d=x,x=f}d&&(n.x=2*r.getCenterX()-n.x),x&&(n.y=2*r.getCenterY()-n.y)}if(u!=0&&n!=null){var g=mxUtils.toRadians(u),p=Math.cos(g),m=Math.sin(g);n=mxUtils.getRotatedPoint(n,p,m,s)}}return i&&n!=null&&(n.x=Math.round(n.x),n.y=Math.round(n.y)),n},mxGraph.prototype.connectCell=function(t,e,i,n){this.model.beginUpdate();try{var r=this.model.getTerminal(t,i);this.cellConnected(t,e,i,n),this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",t,"terminal",e,"source",i,"previous",r))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellConnected=function(t,e,i,n){if(t!=null){this.model.beginUpdate();try{var r=this.model.getTerminal(t,i);if(this.setConnectionConstraint(t,e,i,n),this.isPortsEnabled()){var s=null;this.isPort(e)&&(s=e.getId(),e=this.getTerminalForPort(e,i));var l=i?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT;this.setCellStyles(l,s,[t])}this.model.setTerminal(t,e,i),this.resetEdgesOnConnect&&this.resetEdge(t),this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",t,"terminal",e,"source",i,"previous",r))}finally{this.model.endUpdate()}}},mxGraph.prototype.disconnectGraph=function(t){if(t!=null){this.model.beginUpdate();try{for(var e=this.view.scale,i=this.view.translate,n=new mxDictionary,r=0;r0)for(var o=new mxRectangle(a[0].x,a[0].y,0,0),u=1;u=0&&(s.x+=o.x,s.y+=o.y))}}else if(s=mxRectangle.fromRectangle(r),this.model.isVertex(p)&&mxUtils.indexOf(t,p)>=0){var o=this.getBoundingBoxFromGeometry([p],!1);o!=null&&(s.x+=o.x,s.y+=o.y)}s!=null&&r.offset!=null&&(s.x+=r.offset.x,s.y+=r.offset.y);var m=this.getCurrentCellStyle(t[n]);if(s!=null){var d=mxUtils.getValue(m,mxConstants.STYLE_ROTATION,0);d!=0&&(s=mxUtils.getBoundingBox(s,d))}}s!=null&&(i==null?i=mxRectangle.fromRectangle(s):i.add(s))}}}return i},mxGraph.prototype.refresh=function(t){this.view.clear(t,t==null),this.view.validate(),this.sizeDidChange(),this.fireEvent(new mxEventObject(mxEvent.REFRESH))},mxGraph.prototype.snap=function(t){return this.gridEnabled&&(t=Math.round(t/this.gridSize)*this.gridSize),t},mxGraph.prototype.snapDelta=function(t,e,i,n,r){var s=this.view.translate,l=this.view.scale;if(!i&&this.gridEnabled){var a=this.gridSize*l*.5;if(!n){var o=e.x-(this.snap(e.x/l-s.x)+s.x)*l;Math.abs(t.x-o)l&&(m=0),f>a&&(d=0),this.view.setTranslate(Math.floor(m/2-o.x),Math.floor(d/2-o.y)),this.container.scrollLeft=(x-l)/2,this.container.scrollTop=(f-a)/2}},mxGraph.prototype.zoom=function(t,e){e=e??this.centerZoom;var i=Math.round(this.view.scale*t*100)/100,n=this.view.getState(this.getSelectionCell());if(t=i/this.view.scale,this.keepSelectionVisibleOnZoom&&n!=null){var r=new mxRectangle(n.x*t,n.y*t,n.width*t,n.height*t);this.view.scale=i,this.scrollRectToVisible(r)||(this.view.revalidate(),this.view.setScale(i))}else{var s=mxUtils.hasScrollbars(this.container);if(e&&!s){var l=this.container.offsetWidth,a=this.container.offsetHeight;if(t>1){var o=(t-1)/(i*2);l*=-o,a*=-o}else{var o=(1/t-1)/(this.view.scale*2);l*=o,a*=o}this.view.scaleAndTranslate(i,this.view.translate.x+l,this.view.translate.y+a)}else{var u=this.view.translate.x,p=this.view.translate.y,m=this.container.scrollLeft,d=this.container.scrollTop;if(this.view.setScale(i),s){var l=0,a=0;e&&(l=this.container.offsetWidth*(t-1)/2,a=this.container.offsetHeight*(t-1)/2),this.container.scrollLeft=(this.view.translate.x-u)*this.view.scale+Math.round(m*t+l),this.container.scrollTop=(this.view.translate.y-p)*this.view.scale+Math.round(d*t+a)}}}},mxGraph.prototype.zoomToRect=function(t){var e=this.container.clientWidth/t.width,i=this.container.clientHeight/t.height,n=e/i;t.x=Math.max(0,t.x),t.y=Math.max(0,t.y);var r=Math.min(this.container.scrollWidth,t.x+t.width),s=Math.min(this.container.scrollHeight,t.y+t.height);if(t.width=r-t.x,t.height=s-t.y,n<1){var l=t.height/n,a=(l-t.height)/2;t.height=l;var o=Math.min(t.y,a);t.y=t.y-o,s=Math.min(this.container.scrollHeight,t.y+t.height),t.height=s-t.y}else{var u=t.width*n,p=(u-t.width)/2;t.width=u;var m=Math.min(t.x,p);t.x=t.x-m,r=Math.min(this.container.scrollWidth,t.x+t.width),t.width=r-t.x}var d=this.container.clientWidth/t.width,x=this.view.scale*d;mxUtils.hasScrollbars(this.container)?(this.view.setScale(x),this.container.scrollLeft=Math.round(t.x*d),this.container.scrollTop=Math.round(t.y*d)):this.view.scaleAndTranslate(x,this.view.translate.x-t.x/this.view.scale,this.view.translate.y-t.y/this.view.scale)},mxGraph.prototype.scrollCellToVisible=function(t,e){var i=-this.view.translate.x,n=-this.view.translate.y,r=this.view.getState(t);if(r!=null){var s=new mxRectangle(i+r.x,n+r.y,r.width,r.height);if(e&&this.container!=null){var l=this.container.clientWidth,a=this.container.clientHeight;s.x=s.getCenterX()-l/2,s.width=l,s.y=s.getCenterY()-a/2,s.height=a}var o=new mxPoint(this.view.translate.x,this.view.translate.y);if(this.scrollRectToVisible(s)){var u=new mxPoint(this.view.translate.x,this.view.translate.y);this.view.translate.x=o.x,this.view.translate.y=o.y,this.view.setTranslate(u.x,u.y)}}},mxGraph.prototype.scrollRectToVisible=function(t){var e=!1;if(t!=null){var i=this.container.offsetWidth,n=this.container.offsetHeight,r=Math.min(i,t.width),s=Math.min(n,t.height);if(mxUtils.hasScrollbars(this.container)){var l=this.container;t.x+=this.view.translate.x,t.y+=this.view.translate.y;var a=l.scrollLeft-t.x,o=Math.max(a-l.scrollLeft,0);a>0?l.scrollLeft-=a+2:(a=t.x+r-l.scrollLeft-l.clientWidth,a>0&&(l.scrollLeft+=a+2));var u=l.scrollTop-t.y,p=Math.max(0,u-l.scrollTop);u>0?l.scrollTop-=u+2:(u=t.y+s-l.scrollTop-l.clientHeight,u>0&&(l.scrollTop+=u+2)),!this.useScrollbarsForPanning&&(o!=0||p!=0)&&this.view.setTranslate(o,p)}else{var m=-this.view.translate.x,d=-this.view.translate.y,x=this.view.scale;t.x+r>m+i&&(this.view.translate.x-=(t.x+r-i-m)/x,e=!0),t.y+s>d+n&&(this.view.translate.y-=(t.y+s-n-d)/x,e=!0),t.x1||r.length==1&&r[0]!=t)&&(n+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+` `)}var s=this.model.getDirectedEdgeCount(e,!0,t),l=this.model.getDirectedEdgeCount(i,!1,t);if(this.multiplicities!=null)for(var a=0;a0?n:null}return this.allowDanglingEdges?null:""},mxGraph.prototype.validateEdge=function(t,e,i){return null},mxGraph.prototype.validateGraph=function(t,e){t=t??this.model.getRoot(),e=e??new Object;for(var i=!0,n=this.model.getChildCount(t),r=0;r")):this.setCellWarning(s,null),i=i&&a==null}var o="";this.isCellCollapsed(t)&&!i&&(o+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+` `),this.model.isEdge(t)?o+=this.getEdgeValidationError(t,this.model.getTerminal(t,!0),this.model.getTerminal(t,!1))||"":o+=this.getCellValidationError(t)||"";var u=this.validateCell(t,e);return u!=null&&(o+=u),this.model.getParent(t)==null&&this.view.validate(),o.length>0||!i?o:null},mxGraph.prototype.getCellValidationError=function(t){var e=this.model.getDirectedEdgeCount(t,!0),i=this.model.getDirectedEdgeCount(t,!1),n=this.model.getValue(t),r="";if(this.multiplicities!=null)for(var s=0;sl.max||el.max||i0?r:null},mxGraph.prototype.validateCell=function(t,e){return null},mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage},mxGraph.prototype.setBackgroundImage=function(t){this.backgroundImage=t},mxGraph.prototype.getFoldingImage=function(t){if(t!=null&&this.foldingEnabled&&!this.getModel().isEdge(t.cell)){var e=this.isCellCollapsed(t.cell);if(this.isCellFoldable(t.cell,!e))return e?this.collapsedImage:this.expandedImage}return null},mxGraph.prototype.convertValueToString=function(t){var e=this.model.getValue(t);if(e!=null){if(mxUtils.isNode(e))return e.nodeName;if(typeof e.toString=="function")return e.toString()}return""},mxGraph.prototype.getLabel=function(t){var e="";if(this.labelsVisible&&t!=null){var i=this.getCurrentCellStyle(t);mxUtils.getValue(i,mxConstants.STYLE_NOLABEL,!1)||(e=this.convertValueToString(t))}return e},mxGraph.prototype.isHtmlLabel=function(t){return this.isHtmlLabels()},mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels},mxGraph.prototype.setHtmlLabels=function(t){this.htmlLabels=t},mxGraph.prototype.isWrapping=function(t){return this.getCurrentCellStyle(t)[mxConstants.STYLE_WHITE_SPACE]=="wrap"},mxGraph.prototype.isLabelClipped=function(t){return this.getCurrentCellStyle(t)[mxConstants.STYLE_OVERFLOW]=="hidden"},mxGraph.prototype.getTooltip=function(t,e,i,n){var r=null;if(t!=null){if(t.control!=null&&(e==t.control.node||e.parentNode==t.control.node)&&(r=this.collapseExpandResource,r=mxUtils.htmlEntities(mxResources.get(r)||r).replace(/\\n/g,"
")),r==null&&t.overlays!=null&&t.overlays.visit(function(l,a){r==null&&(e==a.node||e.parentNode==a.node)&&(r=a.overlay.toString())}),r==null){var s=this.selectionCellsHandler.getHandler(t.cell);s!=null&&typeof s.getTooltipForNode=="function"&&(r=s.getTooltipForNode(e))}r==null&&(r=this.getTooltipForCell(t.cell))}return r},mxGraph.prototype.getTooltipForCell=function(t){var e=null;return t!=null&&t.getTooltip!=null?e=t.getTooltip():e=this.convertValueToString(t),e},mxGraph.prototype.getLinkForCell=function(t){return null},mxGraph.prototype.getCursorForMouseEvent=function(t){return this.getCursorForCell(t.getCell())},mxGraph.prototype.getCursorForCell=function(t){return null},mxGraph.prototype.getStartSize=function(t,e){var i=new mxRectangle,n=this.getCurrentCellStyle(t,e),r=parseInt(mxUtils.getValue(n,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return mxUtils.getValue(n,mxConstants.STYLE_HORIZONTAL,!0)?i.height=r:i.width=r,i},mxGraph.prototype.getSwimlaneDirection=function(t){var e=mxUtils.getValue(t,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),i=mxUtils.getValue(t,mxConstants.STYLE_FLIPH,0)==1,n=mxUtils.getValue(t,mxConstants.STYLE_FLIPV,0)==1,r=mxUtils.getValue(t,mxConstants.STYLE_HORIZONTAL,!0),s=r?0:3;e==mxConstants.DIRECTION_NORTH?s--:e==mxConstants.DIRECTION_WEST?s+=2:e==mxConstants.DIRECTION_SOUTH&&(s+=1);var l=mxUtils.mod(s,2);return i&&l==1&&(s+=2),n&&l==0&&(s+=2),[mxConstants.DIRECTION_NORTH,mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST][mxUtils.mod(s,4)]},mxGraph.prototype.getActualStartSize=function(t,e){var i=new mxRectangle;if(this.isSwimlane(t,e)){var n=this.getCurrentCellStyle(t,e),r=parseInt(mxUtils.getValue(n,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),s=this.getSwimlaneDirection(n);s==mxConstants.DIRECTION_NORTH?i.y=r:s==mxConstants.DIRECTION_WEST?i.x=r:s==mxConstants.DIRECTION_SOUTH?i.height=r:i.width=r}return i},mxGraph.prototype.getImage=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_IMAGE]:null},mxGraph.prototype.isTransparentState=function(t){var e=!1;if(t!=null){var i=mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),n=mxUtils.getValue(t.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);e=i==mxConstants.NONE&&n==mxConstants.NONE&&this.getImage(t)==null}return e},mxGraph.prototype.getVerticalAlign=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null},mxGraph.prototype.getIndicatorColor=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_COLOR]:null},mxGraph.prototype.getIndicatorGradientColor=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null},mxGraph.prototype.getIndicatorShape=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_SHAPE]:null},mxGraph.prototype.getIndicatorImage=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_IMAGE]:null},mxGraph.prototype.getBorder=function(){return this.border},mxGraph.prototype.setBorder=function(t){this.border=t},mxGraph.prototype.isSwimlane=function(t,e){return t!=null&&this.model.getParent(t)!=this.model.getRoot()&&!this.model.isEdge(t)?this.getCurrentCellStyle(t,e)[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE:!1},mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer},mxGraph.prototype.setResizeContainer=function(t){this.resizeContainer=t},mxGraph.prototype.isEnabled=function(){return this.enabled},mxGraph.prototype.setEnabled=function(t){this.enabled=t},mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled},mxGraph.prototype.setEscapeEnabled=function(t){this.escapeEnabled=t},mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing},mxGraph.prototype.setInvokesStopCellEditing=function(t){this.invokesStopCellEditing=t},mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing},mxGraph.prototype.setEnterStopsCellEditing=function(t){this.enterStopsCellEditing=t},mxGraph.prototype.isCellLocked=function(t){var e=this.model.getGeometry(t);return this.isCellsLocked()||e!=null&&this.model.isVertex(t)&&e.relative},mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked},mxGraph.prototype.setCellsLocked=function(t){this.cellsLocked=t},mxGraph.prototype.getCloneableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(e){return this.isCellCloneable(e)}))},mxGraph.prototype.isCellCloneable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsCloneable()&&e[mxConstants.STYLE_CLONEABLE]!=0},mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable},mxGraph.prototype.setCellsCloneable=function(t){this.cellsCloneable=t},mxGraph.prototype.getExportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(e){return this.canExportCell(e)}))},mxGraph.prototype.canExportCell=function(t){return this.exportEnabled},mxGraph.prototype.getImportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(e){return this.canImportCell(e)}))},mxGraph.prototype.canImportCell=function(t){return this.importEnabled},mxGraph.prototype.isCellSelectable=function(t){return this.isCellsSelectable()},mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable},mxGraph.prototype.setCellsSelectable=function(t){this.cellsSelectable=t},mxGraph.prototype.getDeletableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(e){return this.isCellDeletable(e)}))},mxGraph.prototype.isCellDeletable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsDeletable()&&e[mxConstants.STYLE_DELETABLE]!=0},mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable},mxGraph.prototype.setCellsDeletable=function(t){this.cellsDeletable=t},mxGraph.prototype.isLabelMovable=function(t){return!this.isCellLocked(t)&&(this.model.isEdge(t)&&this.edgeLabelsMovable||this.model.isVertex(t)&&this.vertexLabelsMovable)},mxGraph.prototype.isCellRotatable=function(t){var e=this.getCurrentCellStyle(t);return e[mxConstants.STYLE_ROTATABLE]!=0},mxGraph.prototype.getMovableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(e){return this.isCellMovable(e)}))},mxGraph.prototype.isCellMovable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsMovable()&&!this.isCellLocked(t)&&e[mxConstants.STYLE_MOVABLE]!=0},mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable},mxGraph.prototype.setCellsMovable=function(t){this.cellsMovable=t},mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled},mxGraph.prototype.setGridEnabled=function(t){this.gridEnabled=t},mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled},mxGraph.prototype.setPortsEnabled=function(t){this.portsEnabled=t},mxGraph.prototype.getGridSize=function(){return this.gridSize},mxGraph.prototype.setGridSize=function(t){this.gridSize=t},mxGraph.prototype.getTolerance=function(){return this.tolerance},mxGraph.prototype.setTolerance=function(t){this.tolerance=t},mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable},mxGraph.prototype.setVertexLabelsMovable=function(t){this.vertexLabelsMovable=t},mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable},mxGraph.prototype.setEdgeLabelsMovable=function(t){this.edgeLabelsMovable=t},mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting},mxGraph.prototype.setSwimlaneNesting=function(t){this.swimlaneNesting=t},mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled},mxGraph.prototype.setSwimlaneSelectionEnabled=function(t){this.swimlaneSelectionEnabled=t},mxGraph.prototype.isMultigraph=function(){return this.multigraph},mxGraph.prototype.setMultigraph=function(t){this.multigraph=t},mxGraph.prototype.isAllowLoops=function(){return this.allowLoops},mxGraph.prototype.setAllowDanglingEdges=function(t){this.allowDanglingEdges=t},mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges},mxGraph.prototype.setConnectableEdges=function(t){this.connectableEdges=t},mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges},mxGraph.prototype.setCloneInvalidEdges=function(t){this.cloneInvalidEdges=t},mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges},mxGraph.prototype.setAllowLoops=function(t){this.allowLoops=t},mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove},mxGraph.prototype.setDisconnectOnMove=function(t){this.disconnectOnMove=t},mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled},mxGraph.prototype.setDropEnabled=function(t){this.dropEnabled=t},mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled},mxGraph.prototype.setSplitEnabled=function(t){this.splitEnabled=t},mxGraph.prototype.isCellResizable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsResizable()&&!this.isCellLocked(t)&&mxUtils.getValue(e,mxConstants.STYLE_RESIZABLE,"1")!="0"},mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable},mxGraph.prototype.setCellsResizable=function(t){this.cellsResizable=t},mxGraph.prototype.isTerminalPointMovable=function(t,e){return!0},mxGraph.prototype.isCellBendable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsBendable()&&!this.isCellLocked(t)&&e[mxConstants.STYLE_BENDABLE]!=0},mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable},mxGraph.prototype.setCellsBendable=function(t){this.cellsBendable=t},mxGraph.prototype.isCellEditable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsEditable()&&!this.isCellLocked(t)&&e[mxConstants.STYLE_EDITABLE]!=0},mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable},mxGraph.prototype.setCellsEditable=function(t){this.cellsEditable=t},mxGraph.prototype.isCellDisconnectable=function(t,e,i){return this.isCellsDisconnectable()&&!this.isCellLocked(t)},mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable},mxGraph.prototype.setCellsDisconnectable=function(t){this.cellsDisconnectable=t},mxGraph.prototype.isValidSource=function(t){return t==null&&this.allowDanglingEdges||t!=null&&(!this.model.isEdge(t)||this.connectableEdges)&&this.isCellConnectable(t)},mxGraph.prototype.isValidTarget=function(t){return this.isValidSource(t)},mxGraph.prototype.isValidConnection=function(t,e){return this.isValidSource(t)&&this.isValidTarget(e)},mxGraph.prototype.setConnectable=function(t){this.connectionHandler.setEnabled(t)},mxGraph.prototype.isConnectable=function(){return this.connectionHandler.isEnabled()},mxGraph.prototype.setTooltips=function(t){this.tooltipHandler.setEnabled(t)},mxGraph.prototype.setPanning=function(t){this.panningHandler.panningEnabled=t},mxGraph.prototype.isEditing=function(t){if(this.cellEditor!=null){var e=this.cellEditor.getEditingCell();return t==null?e!=null:t==e}return!1},mxGraph.prototype.isAutoSizeCell=function(t){var e=this.getCurrentCellStyle(t);return this.isAutoSizeCells()||e[mxConstants.STYLE_AUTOSIZE]==1},mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells},mxGraph.prototype.setAutoSizeCells=function(t){this.autoSizeCells=t},mxGraph.prototype.isExtendParent=function(t){return!this.getModel().isEdge(t)&&this.isExtendParents()},mxGraph.prototype.isExtendParents=function(){return this.extendParents},mxGraph.prototype.setExtendParents=function(t){this.extendParents=t},mxGraph.prototype.isExtendParentsOnAdd=function(t){return this.extendParentsOnAdd},mxGraph.prototype.setExtendParentsOnAdd=function(t){this.extendParentsOnAdd=t},mxGraph.prototype.isExtendParentsOnMove=function(){return this.extendParentsOnMove},mxGraph.prototype.setExtendParentsOnMove=function(t){this.extendParentsOnMove=t},mxGraph.prototype.isRecursiveResize=function(t){return this.recursiveResize},mxGraph.prototype.setRecursiveResize=function(t){this.recursiveResize=t},mxGraph.prototype.isConstrainChild=function(t){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(t))},mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren},mxGraph.prototype.setConstrainChildren=function(t){this.constrainChildren=t},mxGraph.prototype.isConstrainRelativeChildren=function(){return this.constrainRelativeChildren},mxGraph.prototype.setConstrainRelativeChildren=function(t){this.constrainRelativeChildren=t},mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates},mxGraph.prototype.setAllowNegativeCoordinates=function(t){this.allowNegativeCoordinates=t},mxGraph.prototype.getOverlap=function(t){return this.isAllowOverlapParent(t)?this.defaultOverlap:0},mxGraph.prototype.isAllowOverlapParent=function(t){return!1},mxGraph.prototype.getFoldableCells=function(t,e){return this.model.filterCells(t,mxUtils.bind(this,function(i){return this.isCellFoldable(i,e)}))},mxGraph.prototype.isCellFoldable=function(t,e){var i=this.getCurrentCellStyle(t);return this.model.getChildCount(t)>0&&i[mxConstants.STYLE_FOLDABLE]!=0},mxGraph.prototype.isValidDropTarget=function(t,e,i){return t!=null&&(this.isSplitEnabled()&&this.isSplitTarget(t,e,i)||!this.model.isEdge(t)&&(this.isSwimlane(t)||this.model.getChildCount(t)>0&&!this.isCellCollapsed(t)))},mxGraph.prototype.isSplitTarget=function(t,e,i){if(this.model.isEdge(t)&&e!=null&&e.length==1&&this.isCellConnectable(e[0])&&this.getEdgeValidationError(t,this.model.getTerminal(t,!0),e[0])==null){var n=this.model.getTerminal(t,!0),r=this.model.getTerminal(t,!1);return!this.model.isAncestor(e[0],n)&&!this.model.isAncestor(e[0],r)}return!1},mxGraph.prototype.getDropTarget=function(t,e,i,n){if(!this.isSwimlaneNesting()){for(var r=0;r=0;a--){var o=this.model.getChildAt(i,a),u=this.getCellAt(t,e,o,n,r,s);if(u!=null)return u;if(this.isCellVisible(o)&&(r&&this.model.isEdge(o)||n&&this.model.isVertex(o))){var p=this.view.getState(o);if(p!=null&&(s==null||!s(p,t,e))&&this.intersects(p,t,e))return o}}return null},mxGraph.prototype.intersects=function(t,e,i){if(t!=null){var n=t.absolutePoints;if(n!=null)for(var r=this.tolerance*this.tolerance,s=n[0],l=1;l0&&e>0&&e>r.width*s)return!0;if(r.height>0&&i>0&&i>r.height*s)return!0}return!1},mxGraph.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraph.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraph.prototype.getChildCells=function(t,e,i){t=t??this.getDefaultParent(),e=e??!1,i=i??!1;for(var n=this.model.getChildCells(t,e,i),r=[],s=0;s0||n>0||l!=null){var u=this.getModel(),p=t+i,m=e+n;if(r==null&&(r=this.getCurrentRoot(),r==null&&(r=u.getRoot())),r!=null)for(var d=u.getChildCount(r),x=0;x=t&&v.y+v.height<=m&&v.y>=e&&v.x+v.width<=p;y&&s.push(f),(!y||o)&&this.getCells(t,e,i,n,f,s,l,a,o)}}}return s},mxGraph.prototype.getCellsBeyond=function(t,e,i,n,r){var s=[];if((n||r)&&(i==null&&(i=this.getDefaultParent()),i!=null))for(var l=this.model.getChildCount(i),a=0;a=t)&&(!r||u.y>=e)&&s.push(o)}return s},mxGraph.prototype.findTreeRoots=function(t,e,i){e=e??!1,i=i??!1;var n=[];if(t!=null){for(var r=this.getModel(),s=r.getChildCount(t),l=null,a=0,o=0;o0||!i&&d==0&&m>0)&&n.push(u);var g=i?d-m:m-d;g>a&&(a=g,l=u)}}n.length==0&&l!=null&&n.push(l)}return n},mxGraph.prototype.traverse=function(t,e,i,n,r,s){if(i!=null&&t!=null&&(e=e??!0,s=s??!1,r=r||new mxDictionary,!r.get(t))){r.put(t,!0);var l=i(t,n);if(l==null||l){var a=this.model.getEdgeCount(t);if(a>0)for(var o=0;o0?n.cells[0]:null;n.cells.length>1&&n.clear();var s=r!=null?this.model.getParent(r):this.getDefaultParent(),l=this.model.getChildCount(s);if(r==null&&l>0){var a=this.model.getChildAt(s,0);this.setSelectionCell(a)}else if((r==null||e)&&this.view.getState(s)!=null&&this.model.getGeometry(s)!=null)this.getCurrentRoot()!=s&&this.setSelectionCell(s);else if(r!=null&&i){var o=this.model.getChildCount(r);if(o>0){var a=this.model.getChildAt(r,0);this.setSelectionCell(a)}}else if(l>0){var u=s.getIndex(r);if(t){u++;var a=this.model.getChildAt(s,u%l);this.setSelectionCell(a)}else{u--;var p=u<0?l-1:u,a=this.model.getChildAt(s,p);this.setSelectionCell(a)}}},mxGraph.prototype.selectAll=function(t,e){t=t||this.getDefaultParent();var i=e?this.model.filterDescendants(mxUtils.bind(this,function(n){return n!=t&&this.view.getState(n)!=null}),t):this.model.getChildren(t);i!=null&&this.setSelectionCells(i)},mxGraph.prototype.selectVertices=function(t,e){this.selectCells(!0,!1,t,e)},mxGraph.prototype.selectEdges=function(t){this.selectCells(!1,!0,t)},mxGraph.prototype.selectCells=function(t,e,i,n){i=i||this.getDefaultParent();var r=mxUtils.bind(this,function(l){return this.view.getState(l)!=null&&((n||this.model.getChildCount(l)==0)&&this.model.isVertex(l)&&t&&!this.model.isEdge(this.model.getParent(l))||this.model.isEdge(l)&&e)}),s=this.model.filterDescendants(r,i);s!=null&&this.setSelectionCells(s)},mxGraph.prototype.selectCellForEvent=function(t,e){var i=this.isCellSelected(t);this.isToggleEvent(e)?i?this.removeSelectionCell(t):this.addSelectionCell(t):(!i||this.getSelectionCount()!=1)&&this.setSelectionCell(t)},mxGraph.prototype.selectCellsForEvent=function(t,e){this.isToggleEvent(e)?this.addSelectionCells(t):this.setSelectionCells(t)},mxGraph.prototype.createHandler=function(t){var e=null;if(t!=null)if(this.model.isEdge(t.cell)){var i=t.getVisibleTerminalState(!0),n=t.getVisibleTerminalState(!1),r=this.getCellGeometry(t.cell),s=this.view.getEdgeStyle(t,r!=null?r.points:null,i,n);e=this.createEdgeHandler(t,s)}else e=this.createVertexHandler(t);return e},mxGraph.prototype.createVertexHandler=function(t){return new mxVertexHandler(t)},mxGraph.prototype.createEdgeHandler=function(t,e){var i=null;return e==mxEdgeStyle.Loop||e==mxEdgeStyle.ElbowConnector||e==mxEdgeStyle.SideToSide||e==mxEdgeStyle.TopToBottom?i=this.createElbowEdgeHandler(t):e==mxEdgeStyle.SegmentConnector||e==mxEdgeStyle.OrthConnector?i=this.createEdgeSegmentHandler(t):i=new mxEdgeHandler(t),i},mxGraph.prototype.createEdgeSegmentHandler=function(t){return new mxEdgeSegmentHandler(t)},mxGraph.prototype.createElbowEdgeHandler=function(t){return new mxElbowEdgeHandler(t)},mxGraph.prototype.addMouseListener=function(t){this.mouseListeners==null&&(this.mouseListeners=[]),this.mouseListeners.push(t)},mxGraph.prototype.removeMouseListener=function(t){if(this.mouseListeners!=null){for(var e=0;e0){this.outline.getView().scale!=d&&(this.outline.getView().scale=d,t=!0);var x=this.outline.getView();x.currentRoot!=this.source.getView().currentRoot&&x.setCurrentRoot(this.source.getView().currentRoot);var f=this.source.view.translate,g=f.x+this.source.panDx,c=f.y+this.source.panDy,v=this.getOutlineOffset(d);v!=null&&(g+=v.x,c+=v.y),n.x<0&&(g=g-n.x),n.y<0&&(c=c-n.y),(x.translate.x!=g||x.translate.y!=c)&&(x.translate.x=g,x.translate.y=c,t=!0);var y=x.translate;d=this.source.getView().scale;var T=d/x.scale,C=1/x.scale,S=this.source.container;this.bounds=new mxRectangle((y.x-f.x-this.source.panDx)/C,(y.y-f.y-this.source.panDy)/C,S.clientWidth/T,S.clientHeight/T),this.bounds.x+=this.source.container.scrollLeft*x.scale/d,this.bounds.y+=this.source.container.scrollTop*x.scale/d;var E=this.selectionBorder.bounds;(E.x!=this.bounds.x||E.y!=this.bounds.y||E.width!=this.bounds.width||E.height!=this.bounds.height)&&(this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw());var E=this.sizer.bounds,L=new mxRectangle(this.bounds.x+this.bounds.width-E.width/2,this.bounds.y+this.bounds.height-E.height/2,E.width,E.height);(E.x!=L.x||E.y!=L.y||E.width!=L.width||E.height!=L.height)&&(this.sizer.bounds=L,this.sizer.node.style.visibility!="hidden"&&this.sizer.redraw()),t&&this.outline.view.revalidate()}}},mxOutline.prototype.mouseDown=function(t,e){if(this.enabled&&this.showViewport){var i=mxEvent.isMouseEvent(e.getEvent())?0:this.source.tolerance,n=this.source.allowHandleBoundsCheck&&(mxClient.IS_IE||i>0)?new mxRectangle(e.getGraphX()-i,e.getGraphY()-i,2*i,2*i):null;this.zoom=e.isSource(this.sizer)||n!=null&&mxUtils.intersects(shape.bounds,n),this.startX=e.getX(),this.startY=e.getY(),this.active=!0,this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)?(this.dx0=this.source.container.scrollLeft,this.dy0=this.source.container.scrollTop):(this.dx0=0,this.dy0=0)}e.consume()},mxOutline.prototype.mouseMove=function(t,e){if(this.active){this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display;var i=this.getTranslateForEvent(e),n=i.x,r=i.y,s=null;if(this.zoom){var a=this.source.container,o=a.clientWidth/a.clientHeight;r=n/o,s=new mxRectangle(this.bounds.x,this.bounds.y,Math.max(1,this.bounds.width+n),Math.max(1,this.bounds.height+r)),this.selectionBorder.bounds=s,this.selectionBorder.redraw()}else{var l=this.outline.getView().scale;s=new mxRectangle(this.bounds.x+n,this.bounds.y+r,this.bounds.width,this.bounds.height),this.selectionBorder.bounds=s,this.selectionBorder.redraw(),n/=l,n*=this.source.getView().scale,r/=l,r*=this.source.getView().scale,this.source.panGraph(-n-this.dx0,-r-this.dy0)}var u=this.sizer.bounds;this.sizer.bounds=new mxRectangle(s.x+s.width-u.width/2,s.y+s.height-u.height/2,u.width,u.height),this.sizer.node.style.visibility!="hidden"&&this.sizer.redraw(),e.consume()}},mxOutline.prototype.getTranslateForEvent=function(t){return new mxPoint(t.getX()-this.startX,t.getY()-this.startY)},mxOutline.prototype.mouseUp=function(t,e){if(this.active){var i=this.getTranslateForEvent(e),n=i.x,r=i.y;if(Math.abs(n)>0||Math.abs(r)>0){if(this.zoom){var l=this.selectionBorder.bounds.width,a=this.source.getView().scale;this.source.zoomTo(Math.max(this.minScale,a-n*a/l),!1)}else if(!this.source.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.source.container)){this.source.panGraph(0,0),n/=this.outline.getView().scale,r/=this.outline.getView().scale;var s=this.source.getView().translate;this.source.getView().setTranslate(s.x-n,s.y-r)}this.update(),e.consume()}this.index=null,this.active=!1}},mxOutline.prototype.destroy=function(){this.source!=null&&(this.source.removeListener(this.panHandler),this.source.removeListener(this.refreshHandler),this.source.getModel().removeListener(this.updateHandler),this.source.getView().removeListener(this.updateHandler),mxEvent.removeListener(this.source.container,"scroll",this.updateHandler),this.source=null),this.outline!=null&&(this.outline.removeMouseListener(this),this.outline.destroy(),this.outline=null),this.selectionBorder!=null&&(this.selectionBorder.destroy(),this.selectionBorder=null),this.sizer!=null&&(this.sizer.destroy(),this.sizer=null)},__mxOutput.mxOutline=typeof mxOutline<"u"?mxOutline:void 0;function mxMultiplicity(t,e,i,n,r,s,l,a,o,u){this.source=t,this.type=e,this.attr=i,this.value=n,this.min=r??0,this.max=s??"n",this.validNeighbors=l,this.countError=mxResources.get(a)||a,this.typeError=mxResources.get(o)||o,this.validNeighborsAllowed=u??!0}mxMultiplicity.prototype.type=null,mxMultiplicity.prototype.attr=null,mxMultiplicity.prototype.value=null,mxMultiplicity.prototype.source=null,mxMultiplicity.prototype.min=null,mxMultiplicity.prototype.max=null,mxMultiplicity.prototype.validNeighbors=null,mxMultiplicity.prototype.validNeighborsAllowed=!0,mxMultiplicity.prototype.countError=null,mxMultiplicity.prototype.typeError=null,mxMultiplicity.prototype.check=function(t,e,i,n,r,s){var l="";if((this.source&&this.checkTerminal(t,i,e)||!this.source&&this.checkTerminal(t,n,e))&&(this.countError!=null&&(this.source&&(this.max==0||r>=this.max)||!this.source&&(this.max==0||s>=this.max))&&(l+=this.countError+` diff --git a/demo/monitoring-all-process-instances/index.html b/demo/monitoring-all-process-instances/index.html index 3fb3b788..cbdec0fd 100644 --- a/demo/monitoring-all-process-instances/index.html +++ b/demo/monitoring-all-process-instances/index.html @@ -24,7 +24,7 @@ - + diff --git a/demo/prediction/index.html b/demo/prediction/index.html index 2ec8d0ad..0628a2ef 100644 --- a/demo/prediction/index.html +++ b/demo/prediction/index.html @@ -30,7 +30,7 @@ - + diff --git a/examples/custom-behavior/apply-css-classes/index.html b/examples/custom-behavior/apply-css-classes/index.html index 6523b585..81e21e83 100644 --- a/examples/custom-behavior/apply-css-classes/index.html +++ b/examples/custom-behavior/apply-css-classes/index.html @@ -86,7 +86,7 @@ } - + diff --git a/examples/custom-behavior/call-activity-with-modal-on-mouse-over/index.html b/examples/custom-behavior/call-activity-with-modal-on-mouse-over/index.html index 10e87f76..17080a30 100644 --- a/examples/custom-behavior/call-activity-with-modal-on-mouse-over/index.html +++ b/examples/custom-behavior/call-activity-with-modal-on-mouse-over/index.html @@ -34,7 +34,7 @@ - + diff --git a/examples/custom-behavior/call-activity-with-reload-on-dblclick/index.html b/examples/custom-behavior/call-activity-with-reload-on-dblclick/index.html index 529e992c..9e6c73ec 100644 --- a/examples/custom-behavior/call-activity-with-reload-on-dblclick/index.html +++ b/examples/custom-behavior/call-activity-with-reload-on-dblclick/index.html @@ -36,7 +36,7 @@ - + diff --git a/examples/custom-behavior/call-activity-with-tabs-on-click/index.html b/examples/custom-behavior/call-activity-with-tabs-on-click/index.html index 76608958..5943ad02 100644 --- a/examples/custom-behavior/call-activity-with-tabs-on-click/index.html +++ b/examples/custom-behavior/call-activity-with-tabs-on-click/index.html @@ -36,7 +36,7 @@ - + diff --git a/examples/custom-behavior/growing-sequence-flow/index.html b/examples/custom-behavior/growing-sequence-flow/index.html index 63f59c1d..30430d23 100644 --- a/examples/custom-behavior/growing-sequence-flow/index.html +++ b/examples/custom-behavior/growing-sequence-flow/index.html @@ -57,7 +57,7 @@ - + diff --git a/examples/custom-behavior/javascript-tooltip-and-popover/index.html b/examples/custom-behavior/javascript-tooltip-and-popover/index.html index 784578ee..464f4835 100644 --- a/examples/custom-behavior/javascript-tooltip-and-popover/index.html +++ b/examples/custom-behavior/javascript-tooltip-and-popover/index.html @@ -49,7 +49,7 @@ - + diff --git a/examples/custom-behavior/running-dashed-message-flow/index.html b/examples/custom-behavior/running-dashed-message-flow/index.html index 8084a291..6d03d00b 100644 --- a/examples/custom-behavior/running-dashed-message-flow/index.html +++ b/examples/custom-behavior/running-dashed-message-flow/index.html @@ -57,7 +57,7 @@ - + diff --git a/examples/custom-behavior/select-elements-by-bpmn-kind/index.html b/examples/custom-behavior/select-elements-by-bpmn-kind/index.html index 523b9580..d8a04b1c 100644 --- a/examples/custom-behavior/select-elements-by-bpmn-kind/index.html +++ b/examples/custom-behavior/select-elements-by-bpmn-kind/index.html @@ -55,7 +55,7 @@ } - + diff --git a/examples/custom-bpmn-theme/custom-colors/index.html b/examples/custom-bpmn-theme/custom-colors/index.html index 6f21779f..4c2d04d2 100644 --- a/examples/custom-bpmn-theme/custom-colors/index.html +++ b/examples/custom-bpmn-theme/custom-colors/index.html @@ -22,7 +22,7 @@ - + diff --git a/examples/custom-bpmn-theme/custom-edge-marker-colors/index.html b/examples/custom-bpmn-theme/custom-edge-marker-colors/index.html index 123f2241..28f08e42 100644 --- a/examples/custom-bpmn-theme/custom-edge-marker-colors/index.html +++ b/examples/custom-bpmn-theme/custom-edge-marker-colors/index.html @@ -36,7 +36,7 @@ - + diff --git a/examples/custom-bpmn-theme/custom-fonts/index.html b/examples/custom-bpmn-theme/custom-fonts/index.html index cf3f7258..7a20c1f7 100644 --- a/examples/custom-bpmn-theme/custom-fonts/index.html +++ b/examples/custom-bpmn-theme/custom-fonts/index.html @@ -22,7 +22,7 @@ - + diff --git a/examples/custom-bpmn-theme/custom-user-task-icon/index.html b/examples/custom-bpmn-theme/custom-user-task-icon/index.html index 12654c3f..f3b7814a 100644 --- a/examples/custom-bpmn-theme/custom-user-task-icon/index.html +++ b/examples/custom-bpmn-theme/custom-user-task-icon/index.html @@ -22,7 +22,7 @@ - + diff --git a/examples/diagram-navigation/diagram-fit-after-load/index.html b/examples/diagram-navigation/diagram-fit-after-load/index.html index b27d8466..56830bf6 100644 --- a/examples/diagram-navigation/diagram-fit-after-load/index.html +++ b/examples/diagram-navigation/diagram-fit-after-load/index.html @@ -53,7 +53,7 @@ - + diff --git a/examples/diagram-navigation/diagram-fit-on-load/index.html b/examples/diagram-navigation/diagram-fit-on-load/index.html index b5e31d8f..2d4c5329 100644 --- a/examples/diagram-navigation/diagram-fit-on-load/index.html +++ b/examples/diagram-navigation/diagram-fit-on-load/index.html @@ -40,7 +40,7 @@ - + diff --git a/examples/diagram-navigation/diagram-navigation/index.html b/examples/diagram-navigation/diagram-navigation/index.html index ad9b0da2..f5b7d8c6 100644 --- a/examples/diagram-navigation/diagram-navigation/index.html +++ b/examples/diagram-navigation/diagram-navigation/index.html @@ -34,7 +34,7 @@ } - + diff --git a/examples/display-bpmn-diagram/load-local-bpmn-diagrams/index.html b/examples/display-bpmn-diagram/load-local-bpmn-diagrams/index.html index 28630ac6..2a0ae198 100644 --- a/examples/display-bpmn-diagram/load-local-bpmn-diagrams/index.html +++ b/examples/display-bpmn-diagram/load-local-bpmn-diagrams/index.html @@ -50,7 +50,7 @@ - + diff --git a/examples/display-bpmn-diagram/load-remote-bpmn-diagrams/index.html b/examples/display-bpmn-diagram/load-remote-bpmn-diagrams/index.html index 8def052c..e69c5384 100644 --- a/examples/display-bpmn-diagram/load-remote-bpmn-diagrams/index.html +++ b/examples/display-bpmn-diagram/load-remote-bpmn-diagrams/index.html @@ -60,7 +60,7 @@ - + diff --git a/examples/display-bpmn-diagram/pools-filter-on-load/index.html b/examples/display-bpmn-diagram/pools-filter-on-load/index.html index e77eb90d..5e68d313 100644 --- a/examples/display-bpmn-diagram/pools-filter-on-load/index.html +++ b/examples/display-bpmn-diagram/pools-filter-on-load/index.html @@ -34,7 +34,7 @@ - + diff --git a/examples/misc/compare-with-bpmn-js/index.html b/examples/misc/compare-with-bpmn-js/index.html index cf503705..69f4278a 100644 --- a/examples/misc/compare-with-bpmn-js/index.html +++ b/examples/misc/compare-with-bpmn-js/index.html @@ -59,7 +59,7 @@ - + diff --git a/examples/misc/compare-with-kie-editors-standalone/index.html b/examples/misc/compare-with-kie-editors-standalone/index.html index c682b877..9e87668d 100644 --- a/examples/misc/compare-with-kie-editors-standalone/index.html +++ b/examples/misc/compare-with-kie-editors-standalone/index.html @@ -59,7 +59,7 @@ - + diff --git a/examples/overlays/add-remove/index.html b/examples/overlays/add-remove/index.html index 862cc661..03dc404f 100644 --- a/examples/overlays/add-remove/index.html +++ b/examples/overlays/add-remove/index.html @@ -48,7 +48,7 @@ - + diff --git a/examples/overlays/add-stylized/index.html b/examples/overlays/add-stylized/index.html index a7fcc6ed..b6db3a6b 100644 --- a/examples/overlays/add-stylized/index.html +++ b/examples/overlays/add-stylized/index.html @@ -43,7 +43,7 @@ - + diff --git a/examples/overlays/custom-overlay-default-style/index.html b/examples/overlays/custom-overlay-default-style/index.html index 390d7392..108a2143 100644 --- a/examples/overlays/custom-overlay-default-style/index.html +++ b/examples/overlays/custom-overlay-default-style/index.html @@ -29,7 +29,7 @@ - + diff --git a/projects/javascript-vanilla-with-webpack/package.json b/projects/javascript-vanilla-with-webpack/package.json index 716e705a..60421acc 100644 --- a/projects/javascript-vanilla-with-webpack/package.json +++ b/projects/javascript-vanilla-with-webpack/package.json @@ -9,7 +9,7 @@ "serve": "webpack serve" }, "dependencies": { - "bpmn-visualization": "0.45.1" + "bpmn-visualization": "0.46.0" }, "devDependencies": { "html-webpack-plugin": "~5.6.0", diff --git a/projects/typescript-angular/package.json b/projects/typescript-angular/package.json index 9f484bbf..e73dc0d6 100644 --- a/projects/typescript-angular/package.json +++ b/projects/typescript-angular/package.json @@ -19,7 +19,7 @@ "@angular/platform-browser": "~15.2.10", "@angular/platform-browser-dynamic": "~15.2.10", "@angular/router": "~15.2.10", - "bpmn-visualization": "0.45.1", + "bpmn-visualization": "0.46.0", "rxjs": "~7.8.1", "tslib": "~2.5.3", "zone.js": "~0.12.0" diff --git a/projects/typescript-lit-element/package.json b/projects/typescript-lit-element/package.json index bd1b5145..7c2c28ae 100644 --- a/projects/typescript-lit-element/package.json +++ b/projects/typescript-lit-element/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "lit": "~2.7.5", - "bpmn-visualization": "0.45.1" + "bpmn-visualization": "0.46.0" }, "devDependencies": { "patch-package": "~8.0.0", diff --git a/projects/typescript-vanilla-with-parcel/package.json b/projects/typescript-vanilla-with-parcel/package.json index 3c46f383..570a8f92 100644 --- a/projects/typescript-vanilla-with-parcel/package.json +++ b/projects/typescript-vanilla-with-parcel/package.json @@ -8,7 +8,7 @@ "build": "tsc && parcel build --public-url ./ index.html" }, "dependencies": { - "bpmn-visualization": "0.45.1" + "bpmn-visualization": "0.46.0" }, "devDependencies": { "@parcel/core": "~2.12.0", diff --git a/projects/typescript-vanilla-with-rollup/package.json b/projects/typescript-vanilla-with-rollup/package.json index 31206228..7986434b 100644 --- a/projects/typescript-vanilla-with-rollup/package.json +++ b/projects/typescript-vanilla-with-rollup/package.json @@ -10,7 +10,7 @@ "start": "rollup -cw --environment devMode:true" }, "dependencies": { - "bpmn-visualization": "0.45.1" + "bpmn-visualization": "0.46.0" }, "devDependencies": { "@rollup/plugin-commonjs": "~28.0.0", diff --git a/projects/typescript-vanilla-with-rsbuild/package.json b/projects/typescript-vanilla-with-rsbuild/package.json index 914af48d..40627ac5 100644 --- a/projects/typescript-vanilla-with-rsbuild/package.json +++ b/projects/typescript-vanilla-with-rsbuild/package.json @@ -8,7 +8,7 @@ "preview": "rsbuild preview" }, "dependencies": { - "bpmn-visualization": "0.45.1" + "bpmn-visualization": "0.46.0" }, "devDependencies": { "@rsbuild/core": "1.0.5", diff --git a/projects/typescript-vanilla-with-vitejs/package.json b/projects/typescript-vanilla-with-vitejs/package.json index b6c683f7..89ad7467 100644 --- a/projects/typescript-vanilla-with-vitejs/package.json +++ b/projects/typescript-vanilla-with-vitejs/package.json @@ -9,7 +9,7 @@ "preview": "vite preview" }, "dependencies": { - "bpmn-visualization": "0.45.1" + "bpmn-visualization": "0.46.0" }, "devDependencies": { "typescript": "~4.5.5", diff --git a/projects/typescript-vue/package.json b/projects/typescript-vue/package.json index aba7b43b..ca70d2bb 100644 --- a/projects/typescript-vue/package.json +++ b/projects/typescript-vue/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "@process-analytics/bpmn-visualization-addons": "0.8.0", - "bpmn-visualization": "0.45.1", + "bpmn-visualization": "0.46.0", "spectre.css": "~0.5.9", "vue": "~3.5.6" }, From 4660f27c654d19ce97f3a07c7d81aeabb642b0d2 Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Wed, 12 Mar 2025 19:25:19 +0100 Subject: [PATCH 2/2] fast-xml-parser provides ESM files so it is no longer necessary to reference it in allowedCommonJsDependencies --- projects/typescript-angular/angular.json | 1 - 1 file changed, 1 deletion(-) diff --git a/projects/typescript-angular/angular.json b/projects/typescript-angular/angular.json index 100da49d..41e87ba9 100644 --- a/projects/typescript-angular/angular.json +++ b/projects/typescript-angular/angular.json @@ -27,7 +27,6 @@ ], "scripts": [], "allowedCommonJsDependencies": [ - "fast-xml-parser", "mxgraph" ] },