diff --git a/demo/draw-path/index.html b/demo/draw-path/index.html index cab5af0c..d9e5dbad 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 62ccd0f8..6eef741a 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/index.css b/demo/load-and-navigation/assets/index.css index 7ac74962..9455561c 100644 --- a/demo/load-and-navigation/assets/index.css +++ b/demo/load-and-navigation/assets/index.css @@ -1 +1 @@ -*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.16 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;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}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.mb-1{margin-bottom:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mt-0{margin-top:0}.mt-2{margin-top:.5rem}.block{display:block}.flex{display:flex}.hidden{display:none}.h-11{height:2.75rem}.h-auto{height:auto}.h-screen{height:100vh}.w-1\/2{width:50%}.w-1\/3{width:33.333333%}.w-full{width:100%}.flex-1{flex:1 1 0%}.flex-shrink{flex-shrink:1}.flex-grow{flex-grow:1}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.justify-around{justify-content:space-around}.justify-evenly{justify-content:space-evenly}.overflow-hidden{overflow:hidden}.rounded-lg{border-radius:.5rem}.border-b-2{border-bottom-width:2px}.border-b-4{border-bottom-width:4px}.border-gray-800{--tw-border-opacity:1;border-color:rgb(31 41 55/var(--tw-border-opacity,1))}.border-red-600{--tw-border-opacity:1;border-color:rgb(220 38 38/var(--tw-border-opacity,1))}.border-transparent{border-color:transparent}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.from-red-200{--tw-gradient-from:#fecaca var(--tw-gradient-from-position);--tw-gradient-to:hsla(0,96%,89%,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.to-red-100{--tw-gradient-to:#fee2e2 var(--tw-gradient-to-position)}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.py-0{padding-bottom:0;padding-top:0}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.pb-0\.5{padding-bottom:.125rem}.pb-1{padding-bottom:.25rem}.pl-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.text-center{text-align:center}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.text-2xl{font-size:1.5rem;line-height:2rem}.font-bold{font-weight:700}.leading-normal{line-height:1.5}.tracking-normal{letter-spacing:0}.text-blue-900{--tw-text-opacity:1;color:rgb(30 58 138/var(--tw-text-opacity,1))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.text-red-900{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.no-underline{text-decoration-line:none}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\:border-red-900:hover{--tw-border-opacity:1;border-color:rgb(127 29 29/var(--tw-border-opacity,1))}.hover\:text-red-900:hover{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity,1))}@media (min-width:768px){.md\:mb-2{margin-bottom:.5rem}.md\:ml-0{margin-left:0}.md\:ml-4{margin-left:1rem}.md\:ml-auto{margin-left:auto}.md\:mr-3{margin-right:.75rem}.md\:mt-0{margin-top:0}.md\:mt-2{margin-top:.5rem}.md\:mt-3{margin-top:.75rem}.md\:block{display:block}.md\:w-48{width:12rem}.md\:w-full{width:100%}.md\:flex-row{flex-direction:row}.md\:flex-col{flex-direction:column}.md\:justify-start{justify-content:flex-start}.md\:justify-between{justify-content:space-between}.md\:rounded-bl-2xl{border-bottom-left-radius:1rem}.md\:rounded-tl-2xl{border-top-left-radius:1rem}.md\:border-b-2{border-bottom-width:2px}.md\:border-blue-600{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity,1))}.md\:border-purple-500{--tw-border-opacity:1;border-color:rgb(168 85 247/var(--tw-border-opacity,1))}.md\:border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.md\:border-yellow-500{--tw-border-opacity:1;border-color:rgb(234 179 8/var(--tw-border-opacity,1))}.md\:border-b-fuchsia-400{--tw-border-opacity:1;border-bottom-color:rgb(232 121 249/var(--tw-border-opacity,1))}.md\:px-2{padding-left:.5rem;padding-right:.5rem}.md\:py-3{padding-top:.75rem}.md\:pb-3,.md\:py-3{padding-bottom:.75rem}.md\:pb-5{padding-bottom:1.25rem}.md\:pl-0{padding-left:0}.md\:pt-0{padding-top:0}.md\:pt-1{padding-top:.25rem}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}} +/*! 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} diff --git a/demo/load-and-navigation/assets/index.js b/demo/load-and-navigation/assets/index.js index a1a58325..e27c5893 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.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); +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); diff --git a/demo/load-and-navigation/assets/main.js b/demo/load-and-navigation/assets/main.js index 151bca03..966e9ed3 100644 --- a/demo/load-and-navigation/assets/main.js +++ b/demo/load-and-navigation/assets/main.js @@ -1,11 +1,11 @@ -var Mt=Object.defineProperty;var Vt=(n,t,e)=>t in n?Mt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var g=(n,t,e)=>Vt(n,typeof t!="symbol"?t+"":t,e);import{f as Yt}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 J=(n=>(n.None="None",n.HorizontalVertical="HorizontalVertical",n.Horizontal="Horizontal",n.Vertical="Vertical",n.Center="Center",n))(J||{}),Gt=(n=>(n.In="in",n.Out="out",n))(Gt||{});function Dt(n){return n instanceof HTMLElement?n:document.querySelector(`#${n}`)}var h=(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))(h||{}),ee=(n=>(n.CALLING_PROCESS="process",n.CALLING_GLOBAL_TASK="global task",n))(ee||{}),te=(n=>(n.Exclusive="Exclusive",n.None="None",n.Parallel="Parallel",n))(te||{}),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 Ut(n,t){return n===""?t?{}:void 0:n}function m(n,t=!1){return n==null?[]:(Array.isArray(n)?n:[n]).map(e=>Ut(e,t)).filter(Boolean)}function Wt(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 C{static isEvent(t){return ie(De,t)}static eventKinds(){return[...De]}static isBoundaryEvent(t){return h.EVENT_BOUNDARY===t}static isStartEvent(t){return h.EVENT_START===t}static isCatchEvent(t){return h.EVENT_INTERMEDIATE_CATCH===t||h.EVENT_BOUNDARY===t||h.EVENT_START===t}static isIntermediateCatchEvent(t){return h.EVENT_INTERMEDIATE_CATCH===t}static isIntermediateThrowEvent(t){return h.EVENT_INTERMEDIATE_THROW===t}static isCallActivity(t){return h.CALL_ACTIVITY===t}static isSubProcess(t){return h.SUB_PROCESS===t}static canHaveNoneEvent(t){return h.EVENT_INTERMEDIATE_THROW===t||h.EVENT_END===t||h.EVENT_START===t}static isActivity(t){return ie(Se,t)}static activityKinds(){return[...Se]}static isWithDefaultSequenceFlow(t){return Ht.has(t)}static isTask(t){return ie(Ee,t)}static taskKinds(){return[...Ee]}static gatewayKinds(){return[...Ue]}static isGateway(t){return ie(Ue,t)}static flowNodeKinds(){return Object.values(h).filter(t=>!C.isPoolOrLane(t))}static isPoolOrLane(t){return t==h.POOL||t==h.LANE}}function ye(n,t){return Wt(Object.values(h),n,t)}function ie(n,t){return Object.values(n).map(e=>e).includes(t)}const De=ye("Event"),Ue=ye("Gateway"),Ee=ye("Task",{ignoreCase:!0,notStartingWith:"global"}),Se=[...Ee,h.CALL_ACTIVITY,h.SUB_PROCESS],Ht=new Set([...Se,h.GATEWAY_EXCLUSIVE,h.GATEWAY_INCLUSIVE,h.GATEWAY_COMPLEX]),ot=Object.values(y).filter(n=>n!=y.NONE);var X=(n=>(n.NONE="None",n.ONE="One",n.BOTH="Both",n))(X||{}),k=(n=>(n.SEQUENCE_FLOW="sequenceFlow",n.MESSAGE_FLOW="messageFlow",n.ASSOCIATION_FLOW="association",n))(k||{}),ne=(n=>(n.NONE="none",n.INITIATING="initiating",n.NON_INITIATING="non_initiating",n))(ne||{}),V=(n=>(n.NORMAL="normal",n.DEFAULT="default",n.CONDITIONAL_FROM_ACTIVITY="conditional_from_activity",n.CONDITIONAL_FROM_GATEWAY="conditional_from_gateway",n))(V||{});class de{constructor(t,e,s,o,i){this.id=t,this.name=e,this.kind=s,this.sourceReferenceId=o,this.targetReferenceId=i}}class it extends de{constructor(t,e,s,o,i=V.NORMAL){super(t,e,k.SEQUENCE_FLOW,s,o),this.sequenceFlowKind=i}}class rt extends de{constructor(t,e,s,o){super(t,e,k.MESSAGE_FLOW,s,o)}}class lt extends de{constructor(t,e,s,o,i=X.NONE){super(t,e,k.ASSOCIATION_FLOW,s,o),this.associationDirectionKind=i}}const O=Xt(),Kt=O.mxCellRenderer,zt=O.mxClient,c=O.mxConstants,G=O.mxEvent,We=O.mxPerimeter,P=O.mxPoint,Ce=O.mxRectangle,we=O.mxRectangleShape,Re=O.mxSvgCanvas2D,N=O.mxUtils;function Xt(){return window.mxForceIncludes=!1,window.mxLoadResources=!1,window.mxLoadStylesheets=!1,window.mxResourceExtension=".txt",Yt({})}class $t{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 le{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 he extends M{constructor(t,e,s,o,i,r=[]){super(t,e,s,o,i),this.markers=r}}class z extends he{constructor(t,e,s,o,i,r){super(t,e,h.CALL_ACTIVITY,o,void 0,i),this.callActivityKind=s,this.globalTaskKind=r}}class se extends he{constructor(t,e,s,o,i){s==Y.AD_HOC&&!i.includes(_.ADHOC)&&i.push(_.ADHOC),super(t,e,h.SUB_PROCESS,o,void 0,i),this.subProcessKind=s}}class U extends M{constructor(t,e,s,o,i){super(t,e,s,i),this.eventDefinitionKind=o}}class me extends U{constructor(e,s,o,i){super(e,s,h.EVENT_INTERMEDIATE_CATCH,o,i);g(this,"sourceIds",[])}}class Ie extends U{constructor(e,s,o,i){super(e,s,h.EVENT_INTERMEDIATE_THROW,o,i);g(this,"targetId")}}class at extends U{constructor(t,e,s,o,i){super(t,e,h.EVENT_START,s,o),this.isInterrupting=i}}class ct extends U{constructor(t,e,s,o,i=!0){super(t,e,h.EVENT_BOUNDARY,s,o),this.isInterrupting=i}}class ut extends M{constructor(t,e,s,o,i=te.None){super(t,e,h.GATEWAY_EVENT_BASED,s,o),this.gatewayKind=i}}function ae(n,t,e,s){return Math.min(Math.max(n??s,t),e)}function Zt(n){return Math.max(n??0,0)}function qt(n){const t=n??{};return t.debounceDelay=ae(t.debounceDelay,0,100,50),t.throttleDelay=ae(t.throttleDelay,0,100,50),t}function fe(n){return n=="default"?void 0:ae(n,0,100,100)}function jt(n){return n=="default"?void 0:ae(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"},dt={ARROW_DASH:"bpmn.dash"},p={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"},ht=n=>N.getValue(n,I.IS_INSTANTIATING,"false")=="true",ce=n=>n=="default"?void 0:n,Qt=(n,t)=>(t&&(n=b(n,c.STYLE_STROKECOLOR,t.color,ce),n=b(n,c.STYLE_STROKE_OPACITY,t.opacity,fe),n=b(n,c.STYLE_STROKEWIDTH,t.width,jt)),n),b=(n,t,e,s=o=>o)=>e==null?n:N.setStyle(n,t,s(e)),re=(n,t,e,s)=>s==null?n:N.setStyleFlag(n,t,e,s),Jt=(n,t)=>(t&&(n=b(n,c.STYLE_FONTCOLOR,t.color,ce),n=b(n,c.STYLE_FONTSIZE,t.size),n=b(n,c.STYLE_FONTFAMILY,t.family),n=re(n,c.STYLE_FONTSTYLE,c.FONT_BOLD,t.isBold),n=re(n,c.STYLE_FONTSTYLE,c.FONT_ITALIC,t.isItalic),n=re(n,c.STYLE_FONTSTYLE,c.FONT_UNDERLINE,t.isUnderline),n=re(n,c.STYLE_FONTSTYLE,c.FONT_STRIKETHROUGH,t.isStrikeThrough),n=b(n,c.STYLE_TEXT_OPACITY,t.opacity,fe)),n),en=(n,t,e)=>(n==null?void 0:n.split(";").map(s=>s.split("=")).filter(([s])=>s===t).map(([,s])=>s)[0])??e,tn=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}},nn=(n,t)=>{const e=t.color;if(e){const s=on(e),o=s?e.startColor:e;n=b(n,c.STYLE_FILLCOLOR,o,ce),s?(n=N.setStyle(n,c.STYLE_GRADIENTCOLOR,e.endColor),n=N.setStyle(n,c.STYLE_GRADIENT_DIRECTION,tn(e.direction))):e==="default"&&(n=N.setStyle(n,c.STYLE_GRADIENTCOLOR,void 0),n=N.setStyle(n,c.STYLE_GRADIENT_DIRECTION,void 0)),(n.includes(h.POOL)||n.includes(h.LANE))&&(n=b(n,c.STYLE_SWIMLANE_FILLCOLOR,o,ce))}return n=b(n,c.STYLE_FILL_OPACITY,t.opacity,fe),n},sn=n=>n&&typeof n=="object"&&"fill"in n,on=n=>n&&typeof n=="object";class rn{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 le?o=this.computeShapeStyleValues(t):(s.push(...cn(t)),o=this.computeEdgeStyleValues(t));const i=this.computeFontStyleValues(t),r=un(t,e);return s.push(...He([...o,...i,...r])),s.join(";")}computeShapeStyleValues(t){const e=new Map,s=t.bpmnElement;if(s instanceof U?ln(s,e):s instanceof he?an(s,e):C.isPoolOrLane(s.kind)?e.set(c.STYLE_HORIZONTAL,t.isHorizontal?"0":"1"):s instanceof ut&&(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),C.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,dn(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===ne.INITIATING)]),this.ignoreBpmnColors||t.extensions.strokeColor&&e.push([c.STYLE_STROKECOLOR,t.extensions.strokeColor]),He(e).join(";")}}function ln(n,t){t.set(I.EVENT_DEFINITION_KIND,n.eventDefinitionKind),(n instanceof ct||n instanceof at&&n.isInterrupting!==void 0)&&t.set(I.IS_INTERRUPTING,String(n.isInterrupting))}function an(n,t){n instanceof se?t.set(I.SUB_PROCESS_KIND,n.subProcessKind):n.kind===h.TASK_RECEIVE?t.set(I.IS_INSTANTIATING,String(n.instantiate)):n instanceof z&&t.set(I.GLOBAL_TASK_KIND,n.globalTaskKind);const e=n.markers;e.length>0&&t.set(I.MARKERS,e.join(","))}function cn(n){const t=[],e=n.bpmnElement;return e instanceof it&&t.push(e.sequenceFlowKind),e instanceof lt&&t.push(e.associationDirectionKind),t}function un(n,t){const e=new Map,s=n.bpmnElement;return t?(e.set(c.STYLE_VERTICAL_ALIGN,c.ALIGN_TOP),n.bpmnElement.kind!=h.TEXT_ANNOTATION&&e.set(c.STYLE_ALIGN,c.ALIGN_CENTER),n instanceof le&&(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 le&&(s instanceof se||s instanceof z&&s.callActivityKind===ee.CALLING_PROCESS)&&!s.markers.includes(_.EXPAND)&&e.set(c.STYLE_VERTICAL_ALIGN,c.ALIGN_TOP),e}function dn(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 He(n){return n.filter(([,t])=>t&&t!="undefined").map(([t,e])=>`${t}=${e}`)}class hn{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=C.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,d=this.styleComputer.computeStyle(s,a),u=this.graph.insertEdge(i,o.id,o.name,r,l,d);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 T=this.coordinatesTranslator.computeRelativeCoordinates(u.parent,new P(a.x,a.y)),E=T.x+a.width/2-f.x,S=T.y-f.y;u.geometry.offset=new P(E,S)}this.insertMessageFlowIconIfNeeded(s,u)}}insertMessageFlowIconIfNeeded(t,e){if(t.bpmnElement instanceof rt&&t.messageVisibleKind!==ne.NONE){const s=this.graph.insertVertex(e,be(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 d=i.x-o.x,u=i.y-o.y;a.geometry.offset=new P(d,u)}return a}}function fn(n,t){return new hn(n,new $t(n),new rn(t))}function be(n){return`messageFlowIcon_of_${n}`}function ft(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)},d=()=>{l&&a(),E()};let u=null;const f=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,d()},t)},T=()=>{u!==null&&(clearTimeout(u),u=null)},E=()=>{T(),o=void 0,i=null},S=()=>{T(),a()},R=function(...x){if(e!=null&&e.aborted)return;o=this,i=x;const Bt=u==null;f(),r&&Bt&&a()};return R.schedule=f,R.cancel=E,R.flush=S,e==null||e.addEventListener("abort",E,{once:!0}),R}function gn(n,t,{signal:e,edges:s=["leading","trailing"]}={}){let o=null;const i=ft(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 gt extends O.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 Ce(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 Ke extends O.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 Tn(n){return Object.values(k).map(t=>t).includes(n)}function pn(n,t){return En(n.style,t)}function En(n,t){const e=[],s=n.split(";"),i=s[0].replace(/shape=bpmn./g,""),r=new Map;r.set("bpmn-type-activity",C.isActivity(i)),r.set("bpmn-type-container",C.isPoolOrLane(i)),r.set("bpmn-type-event",C.isEvent(i)),r.set("bpmn-type-flow",Tn(i)),r.set("bpmn-type-gateway",C.isGateway(i)),r.set("bpmn-type-task",C.isTask(i));for(const[l]of[...r].filter(([,a])=>a))e.push(l);e.push(Ae(i));for(const[l,a]of s.map(d=>{const u=d.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(Ae(a));break}}return t&&e.push("bpmn-label"),e}function Ae(n){return n?"bpmn-"+n.replace(/([A-Z])/g,t=>"-"+t[0].toLowerCase()):""}const ze=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=pn(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 Sn extends O.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 O.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 gt?l=new Ke(i.label,new Ce(0,0,0,0),i.style):(l=new O.mxImageShape(new Ce(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 Ke&&(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),ze(e),e}createLabel(t,e){super.createLabel(t,e),ze(t.text)}}function Cn(n,t,e,s){let o,i;n.heightE.setIconOriginForIconCentered(),shapeConfig:{x:t,y:e,width:s,height:o,strokeWidth:d},iconStyleConfig:{isFilled:l,fillColor:u,strokeColor:f,strokeWidth:a,margin:T}}}class In{newBpmnCanvas({canvas:t,ratioFromParent:e,setIconOriginFunct:s,shapeConfig:o,iconStyleConfig:i},r){return new mn({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});Te(e),e.fillAndStroke(),Te(e),e.rotateOnIconCenter(60),e.fillAndStroke(),Te(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});An(e),e.translateIconOrigin(14,14),Nn(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 Te(n){n.begin(),n.moveTo(.38,0),n.lineTo(.62,0),n.lineTo(.62,1),n.lineTo(.38,1),n.close()}function An(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(),Ne(n,24.8,39)}function Nn(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;Ne(n,t,e),n.begin(),Ne(n,t,e)}function Ne(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 Tt{static get(){return this.instance}static set(t){this.instance=t}}g(Tt,"instance",new In);const ve=1.25,vn=1/ve;class On extends O.mxGraph{constructor(e){super(e);g(this,"currentZoomLevel",1);this.zoomFactor=ve,this.container&&(this.container.style.cursor="default")}createGraphView(){return new Ln(this)}createCellRenderer(){return new Sn(Tt.get())}batchUpdate(e){this.model.beginUpdate();try{e()}finally{this.model.endUpdate()}}fit(e,s,o,i,r,l,a){const d=super.fit(e,s,o,i,r,l,a);return this.setCurrentZoomLevel(d),d}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==J.None)return;const o=Zt(e==null?void 0:e.margin);if(s==J.Center){const r=this.getGraphBounds(),l=this.container.clientWidth-o,a=this.container.clientHeight-o,d=r.width/this.view.scale,u=r.height/this.view.scale,f=Math.min(3,Math.min(l/d,a/u));this.setCurrentZoomLevel(f),this.view.scaleAndTranslate(f,(o+l-d*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 J.Horizontal:{r=!0;break}case J.Vertical:{i=!0;break}}this.fit(this.border,!1,o,!0,i,r)}}registerMouseWheelZoomListeners(e){e=qt(e),G.addMouseWheelListener(ft(this.createMouseWheelZoomListener(!0),e.debounceDelay),this.container),G.addMouseWheelListener(gn(this.createMouseWheelZoomListener(!1),e.throttleDelay),this.container)}manageMouseWheelZoomEvent(e,s,o){if(o){const[i,r]=this.getEventRelativeCoordinates(s),[l,a,d]=this.getScaleAndTranslationDeltas(i,r);this.view.scaleAndTranslate(l,this.view.translate.x+a,this.view.translate.y+d),G.consume(s)}else this.currentZoomLevel*=e?ve:vn}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 Ln extends O.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 _n{configureMarkers(){this.registerArrowDashMarker()}registerArrowDashMarker(){const t=(e,s,o,i,r,l,a,d,u)=>{const f=r*(a+u+4),T=l*(a+u+4);return function(){e.begin(),e.moveTo(i.x-f/2-T/2,i.y-T/2+f/2),e.lineTo(i.x+T/2-3*f/2,i.y-3*T/2-f/2),e.stroke()}};O.mxMarker.addMarker(dt.ARROW_DASH,t)}}const yn=[_.LOOP,_.MULTI_INSTANCE_PARALLEL,_.MULTI_INSTANCE_SEQUENTIAL,_.COMPENSATION,_.EXPAND,_.ADHOC];function wn(n){const t=yn.filter(e=>n.includes(e));for(const e of n.filter(s=>!t.includes(s)))t.push(e);return t}function Rn(n,t){return n===1?e=>e.setIconOriginForIconBottomCentered():e=>{e.setIconOriginForIconBottomCentered();const s=Math.pow(-1,t)*(p.SHAPE_ACTIVITY_MARKER_ICON_SIZE+p.SHAPE_ACTIVITY_MARKER_ICON_MARGIN)/2;e.translateIconOrigin(s,0)}}class Fe extends we{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(Z({canvas:e,x:s,y:o,width:i,height:r,shape:this,ratioFromParent:0,iconStrokeWidth:1.5}))}paintMarkerIcons(e){var o;const s=N.getValue(this.style,I.MARKERS,void 0);if(s){const i=wn(s.split(","));for(const[r,l]of i.entries())e={...e,setIconOriginFunct:Rn(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 W extends Fe{paintForeground(t,e,s,o,i){super.paintForeground(t,e,s,o,i),this.paintTaskIcon(Z({canvas:t,x:e,y:s,width:o,height:i,shape:this}))}}class bn extends W{paintTaskIcon(t){}}class Fn extends W{paintTaskIcon(t){this.iconPainter.paintGearIcon({...t,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class Pn extends W{paintTaskIcon(t){this.iconPainter.paintPersonIcon({...t,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class kn extends W{paintTaskIcon(t){if(!ht(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 xn extends W{paintTaskIcon(t){this.paintEnvelopeIcon(t,!0)}}class Bn extends W{paintTaskIcon(t){this.iconPainter.paintHandIcon({...t,ratioFromParent:.18,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class Mn extends W{paintTaskIcon(t){this.iconPainter.paintScriptIcon({...t,ratioFromParent:.22,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class Vn extends Fe{paintForeground(t,e,s,o,i){super.paintForeground(t,e,s,o,i);const r=Z({canvas:t,x:e,y:s,width:o,height:i,shape:this});switch(N.getValue(this.style,I.GLOBAL_TASK_KIND,void 0)){case h.GLOBAL_TASK_MANUAL:{this.iconPainter.paintHandIcon({...r,ratioFromParent:.18,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break}case h.GLOBAL_TASK_SCRIPT:{this.iconPainter.paintScriptIcon({...r,ratioFromParent:.22,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break}case h.GLOBAL_TASK_USER:{this.iconPainter.paintPersonIcon({...r,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break}case h.GLOBAL_TASK_BUSINESS_RULE:{this.iconPainter.paintTableIcon({...r,ratioFromParent:.6,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(15)});break}}}}class Yn extends Fe{paintBackground(t,e,s,o,i){const r=N.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=p.SUB_PROCESS_TRANSACTION_INNER_RECT_OFFSET,a=p.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 Gn extends W{paintTaskIcon(t){this.iconPainter.paintTableIcon({...t,ratioFromParent:.6,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(15)})}}class Dn extends O.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(N.getValue(this.style,I.EDGE_START_FILL_COLOR,this.stroke)),s()),o!=null&&(t.setFillColor(N.getValue(this.style,I.EDGE_END_FILL_COLOR,this.stroke)),o())}paintEdgeLine(t,e){const s=Un(t);Xe(t,"stroke"),this.paintLine(t,e,this.isRounded),Xe(t,s)}}function Un(n){return n instanceof Re?n.pointerEventsValue:null}function Xe(n,t){n instanceof Re&&(n.pointerEventsValue=t)}class Pe extends O.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:p.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:p.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=Z({canvas:e,x:s,y:o,width:i,height:r,shape:this,isFilled:this.withFilledIcon});Wn(l,N.getValue(this.style,I.IS_INTERRUPTING,void 0)),this.paintOuterShape(l),Hn(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(N.getValue(this.style,I.EVENT_DEFINITION_KIND,y.NONE));s==null||s(e)}}function Wn(n,t){n.canvas.save(),t==="false"&&(n.canvas.setDashed(!0,!1),n.canvas.setDashPattern("3 2"))}function Hn(n){n.canvas.restore()}class Kn extends Pe{constructor(){super(),this.withFilledIcon=!0}}class Oe extends Pe{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 zn extends Oe{constructor(){super(),this.withFilledIcon=!0}}class Xn extends we{constructor(){super(...arguments);g(this,"iconPainter")}paintVertexShape(e,s,o,i,r){const l=Z({canvas:e,x:s,y:o,width:i,height:r,shape:this,ratioFromParent:1,isFilled:N.getValue(this.style,I.IS_INITIATING,"true")=="false"});this.iconPainter.paintEnvelopeIcon(l)}}class oe extends O.mxRhombus{constructor(){super(...arguments);g(this,"iconPainter")}paintVertexShape(e,s,o,i,r){const l=Z({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 $n extends oe{paintInnerShape(t){this.iconPainter.paintXCrossIcon({...t,iconStyleConfig:{...t.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class Zn extends oe{paintInnerShape(t){this.iconPainter.paintPlusCrossIcon({...t,iconStyleConfig:{...t.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class qn extends oe{paintInnerShape(t){this.iconPainter.paintCircleIcon({...t,ratioFromParent:.62,iconStyleConfig:{...t.iconStyleConfig,isFilled:!1,strokeWidth:p.STROKE_WIDTH_THICK.valueOf()}})}}class jn extends oe{paintInnerShape(t){this.iconPainter.paintAsteriskIcon({...t,iconStyleConfig:{...t.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class Qn extends oe{paintInnerShape(t){t={...t,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1}},this.iconPainter.paintCircleIcon({...t,ratioFromParent:.55}),ht(this.style)||this.iconPainter.paintCircleIcon({...t,ratioFromParent:.45});const e={...t,ratioFromParent:.3};N.getValue(this.style,I.EVENT_BASED_GATEWAY_KIND,te.Exclusive)==te.Parallel?this.iconPainter.paintPlusCrossIcon(e):this.iconPainter.paintPentagon(e)}}class Jn extends we{paintForeground(t,e,s,o,i){t.begin(),t.moveTo(e+p.TEXT_ANNOTATION_BORDER_LENGTH,s),t.lineTo(e,s),t.lineTo(e,s+i),t.lineTo(e+p.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 es=()=>{const n=[[h.EVENT_END,Kn],[h.EVENT_START,Pe],[h.EVENT_INTERMEDIATE_THROW,zn],[h.EVENT_INTERMEDIATE_CATCH,Oe],[h.EVENT_BOUNDARY,Oe],[h.GATEWAY_COMPLEX,jn],[h.GATEWAY_EVENT_BASED,Qn],[h.GATEWAY_EXCLUSIVE,$n],[h.GATEWAY_INCLUSIVE,qn],[h.GATEWAY_PARALLEL,Zn],[h.SUB_PROCESS,Yn],[h.CALL_ACTIVITY,Vn],[h.TASK,bn],[h.TASK_SERVICE,Fn],[h.TASK_USER,Pn],[h.TASK_RECEIVE,kn],[h.TASK_SEND,xn],[h.TASK_MANUAL,Bn],[h.TASK_SCRIPT,Mn],[h.TASK_BUSINESS_RULE,Gn],[h.TEXT_ANNOTATION,Jn],[I.EDGE,Dn],[I.MESSAGE_FLOW_ICON,Xn]];for(const[t,e]of n)Kt.registerShape(t,e)};class ts{configureShapes(){es()}}const pt=12;class ke extends Map{get(t){return super.get(t)??(()=>{})}}const ns=new ke([[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]=p.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]=p.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]=pt}]]),ss=new ke([[V.DEFAULT,n=>{n[c.STYLE_STARTARROW]=dt.ARROW_DASH}],[V.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]=p.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR}]]),os=new ke([[X.NONE,n=>{}],[X.ONE,n=>{n[c.STYLE_ENDARROW]=c.ARROW_OPEN_THIN}],[X.BOTH,n=>{n[c.STYLE_STARTARROW]=c.ARROW_OPEN_THIN,n[c.STYLE_ENDARROW]=c.ARROW_OPEN_THIN}]]);class Et{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();$e(t),t[c.STYLE_ABSOLUTE_ARCSIZE]=!0,t[c.STYLE_ARCSIZE]=p.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]=p.POOL_LABEL_SIZE,t[c.STYLE_FILLCOLOR]=p.POOL_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(h.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]=p.LANE_LABEL_SIZE,t[c.STYLE_FILLCOLOR]=p.LANE_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(h.LANE,t)}configureEventStyles(){for(const t of C.eventKinds()){const e={};e[c.STYLE_SHAPE]=t,e[c.STYLE_PERIMETER]=We.EllipsePerimeter,e[c.STYLE_STROKEWIDTH]=t==h.EVENT_END?p.STROKE_WIDTH_THICK:p.STROKE_WIDTH_THIN,e[c.STYLE_VERTICAL_LABEL_POSITION]=c.ALIGN_BOTTOM,this.putCellStyle(t,e)}}configureTextAnnotationStyle(){const t={};t[c.STYLE_SHAPE]=h.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]=p.TEXT_ANNOTATION_FILL_COLOR,t[c.STYLE_STROKEWIDTH]=p.STROKE_WIDTH_THIN,this.putCellStyle(h.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]=p.STROKE_WIDTH_THIN,t[c.STYLE_FILLCOLOR]=p.GROUP_FILL_COLOR,t[c.STYLE_ALIGN]=c.ALIGN_CENTER,t[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_TOP,this.putCellStyle(h.GROUP,t)}configureActivityStyles(){for(const t of C.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==h.CALL_ACTIVITY?p.STROKE_WIDTH_THICK:p.STROKE_WIDTH_THIN,this.putCellStyle(t,e)}}configureGatewayStyles(){for(const t of C.gatewayKinds()){const e={};e[c.STYLE_SHAPE]=t,e[c.STYLE_PERIMETER]=We.RhombusPerimeter,e[c.STYLE_STROKEWIDTH]=p.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();$e(t),t[c.STYLE_SHAPE]=I.EDGE,t[c.STYLE_ENDSIZE]=pt,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),ns),this.configureEdgeStyles(Object.values(V),ss),this.configureEdgeStyles(Object.values(X),os)}}function $e(n){n[c.STYLE_FONTFAMILY]=p.DEFAULT_FONT_FAMILY,n[c.STYLE_FONTSIZE]=p.DEFAULT_FONT_SIZE,n[c.STYLE_FONTCOLOR]=p.DEFAULT_FONT_COLOR,n[c.STYLE_FILLCOLOR]=p.DEFAULT_FILL_COLOR,n[c.STYLE_STROKECOLOR]=p.DEFAULT_STROKE_COLOR,n[c.STYLE_LABEL_BACKGROUNDCOLOR]=c.NONE,n[c.STYLE_WHITE_SPACE]="wrap"}class is{constructor(t){g(this,"graph");this.graph=new On(t)}configure(t){return this.configureGraph(),this.configureNavigationSupport(t),new Et(this.graph).configureStyles(),new ts().configureShapes(),new _n().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,Ze(this.graph,"grab")),e.addListener(G.PAN_END,Ze(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 Ze(n,t){return()=>{n.container.style.cursor=t}}class rs{constructor(t){this.graph=t}fit(t){this.graph.customFit(t)}zoom(t){t=="in"?this.graph.zoomIn():this.graph.zoomOut()}}class ls{constructor(t){this.convertedElements=t}deserialize(t){const e=m(t.category).flatMap(s=>m(s.categoryValue));for(const s of e)this.convertedElements.registerCategoryValue(s.id,s.value)}}class q{}class as{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 cs extends q{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 us extends q{constructor(t){super(),this.bpmnElementId=t}getMessage(){return{arguments:[this.bpmnElementId],template:"Shape json deserialization: unable to find bpmn element with id %s"}}}class ds extends q{constructor(t){super(),this.bpmnElementId=t}getMessage(){return{arguments:[this.bpmnElementId],template:"Edge json deserialization: unable to find bpmn element with id %s"}}}class hs extends q{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 fs extends q{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 gs extends q{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 Ts{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 St=(n,t,e,s)=>{const o=n.findCategoryValue(e.categoryValueRef);if(o)return new M(e.id,o.value,h.GROUP,s);t.warning(new cs(e.id,e.categoryValueRef))},Ct=(n,t)=>{for(const e of m(t)){const s=e.associationDirection;n.registerAssociationFlow(new lt(e.id,void 0,e.sourceRef,e.targetRef,s))}};class ps{constructor(t,e){this.convertedElements=t,this.parsingMessageCollector=e}deserialize(t){for(const e of m(t))this.parseCollaboration(e)}parseCollaboration(t){this.buildParticipant(t.participant),this.buildMessageFlows(t.messageFlow),Ct(this.convertedElements,t.association),this.buildGroups(t.group),this.buildTextAnnotation(t.textAnnotation)}buildParticipant(t){for(const e of m(t))this.convertedElements.registerPool(new M(e.id,e.name,h.POOL),e.processRef)}buildMessageFlows(t){for(const e of m(t))this.convertedElements.registerMessageFlow(new rt(e.id,e.name,e.sourceRef,e.targetRef))}buildGroups(t){for(const e of m(t)){const s=St(this.convertedElements,this.parsingMessageCollector,e);s&&this.convertedElements.registerFlowNode(s)}}buildTextAnnotation(t){for(const e of m(t))this.convertedElements.registerFlowNode(new M(e.id,e.text,h.TEXT_ANNOTATION))}}class Es{constructor(t,e,s,o){this.x=t,this.y=e,this.width=s,this.height=o}}class Ss{constructor(t,e,s,o,i=ne.NONE){g(this,"extensions",{});this.id=t,this.bpmnElement=e,this.waypoints=s,this.label=o,this.messageVisibleKind=i}}class Cs{constructor(t,e){this.x=t,this.y=e}}class ms{constructor(t,e){g(this,"extensions",{});this.font=t,this.bounds=e}}class Is{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 As{constructor(t,e){g(this,"convertedFonts",new Map);this.convertedElements=t,this.parsingMessageCollector=e}deserialize(t){const e=[],s=[],o=[],i=[],r=m(t)[0];if(r){this.deserializeFonts(r.BPMNLabelStyle);const l=r.BPMNPlane,a=this.deserializeEdges(l.BPMNEdge),d=this.deserializeShapes(l.BPMNShape);e.push(...d.flowNodes),s.push(...d.lanes),o.push(...d.pools),i.push(...a)}return{flowNodes:e,lanes:s,pools:o,edges:i}}deserializeFonts(t){for(const e of m(t))for(const s of m(e.Font))this.convertedFonts.set(e.id,new Is(s.name,s.size,s.isBold,s.isItalic,s.isUnderline,s.isStrikeThrough))}deserializeShapes(t){const e={flowNodes:[],lanes:[],pools:[]};for(const s of m(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 us(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=qe(t);(s instanceof se||s instanceof z&&s.callActivityKind===ee.CALLING_PROCESS)&&!t.isExpanded&&s.markers.push(_.EXPAND);let i;C.isPoolOrLane(s.kind)&&(i=t.isHorizontal??!0);const r=t.BPMNLabel,l=this.deserializeLabel(r,t.id),a=new le(t.id,s,o,l,i);return Ns(a,t),a}}deserializeEdges(t){return m(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 ds(e.bpmnElement));return}const o=this.deserializeWaypoints(e.waypoint),i=this.deserializeLabel(e.BPMNLabel,e.id),r=e.messageVisibleKind?e.messageVisibleKind:ne.NONE,l=new Ss(e.id,s,o,i,r);return vs(l,e),l}).filter(Boolean)}deserializeWaypoints(t){return m(t).map(e=>new Cs(e.x,e.y))}deserializeLabel(t,e){if(t&&typeof t=="object"){const s=this.findFont(t.labelStyle,e),o=qe(t),i=new ms(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 hs(e,t))),s}}function Ns(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 qe(n){const t=n.Bounds;if(t)return new Es(t.x,t.y,t.width,t.height)}function vs(n,t){"border-color"in t?n.extensions.strokeColor=t["border-color"]:"stroke"in t&&(n.extensions.strokeColor=t.stroke)}const Os=n=>"source"in n||"target"in n;class Ls{constructor(t){this.convertedElements=t}deserialize(t){for(const e of ot){const s=t[e+"EventDefinition"];for(const o of m(s,!0))this.convertedElements.registerEventDefinitionsOfDefinition(o.id,{id:o.id,kind:e,...Os(o)?{source:o.source,target:o.target}:{}})}}}class _s{constructor(t){this.convertedElements=t}deserialize(t){this.parseGlobalTasks(t.globalTask,h.GLOBAL_TASK),this.parseGlobalTasks(t.globalBusinessRuleTask,h.GLOBAL_TASK_BUSINESS_RULE),this.parseGlobalTasks(t.globalManualTask,h.GLOBAL_TASK_MANUAL),this.parseGlobalTasks(t.globalScriptTask,h.GLOBAL_TASK_SCRIPT),this.parseGlobalTasks(t.globalUserTask,h.GLOBAL_TASK_USER)}parseGlobalTasks(t,e){for(const s of m(t))this.convertedElements.registerGlobalTask(s.id,e)}}const ys=(n,t)=>{switch(n){case"adHocSubProcess":return Y.AD_HOC;case"transaction":return Y.TRANSACTION;default:return t.triggeredByEvent?Y.EVENT:Y.EMBEDDED}},ws=["adHocSubProcess","transaction",...C.flowNodeKinds().filter(n=>n!==h.EVENT_BOUNDARY),h.EVENT_BOUNDARY];function Rs(n){return["adHocSubProcess","transaction"].includes(n)?h.SUB_PROCESS:n}class bs{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 m(t))this.parseProcess(e);for(const e of m(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 me&&(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,h.POOL),e),this.buildProcessInnerElements(t,s==null?void 0:s.id)}buildProcessInnerElements(t,e){this.elementsWithoutParentByProcessId.set(t.id,[]);for(const s of ws)this.buildFlowNodeBpmnElements(t[s],Rs(s),e,t.id,s);this.buildLaneSetBpmnElements(t.laneSet,e,t.id),this.buildSequenceFlows(t.sequenceFlow),Ct(this.convertedElements,t.association)}buildFlowNodeBpmnElements(t,e,s,o,i){for(const r of m(t)){const l=this.buildFlowNodeBpmnElement(e,r,s,i);"default"in r&&C.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(C.isEvent(t))return this.buildShapeBpmnEvent(e,t,s);if(C.isActivity(t))return this.buildShapeBpmnActivity(e,t,s,o);if(t==h.GATEWAY_EVENT_BASED){const i=e;return new ut(i.id,i.name,s,i.instantiate,te[i.eventGatewayType])}else{if(t==h.GROUP)return St(this.convertedElements,this.parsingMessageCollector,e,s);{const i=t===h.TEXT_ANNOTATION?e.text:e.name;return new M(e.id,i,t,s,e.instantiate)}}}buildShapeBpmnActivity(t,e,s,o){const i=Fs(t);return C.isSubProcess(e)?this.buildShapeBpmnSubProcess(t,s,ys(o,t),i):C.isCallActivity(e)?this.buildShapeBpmnCallActivity(t,s,i):new he(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 z(t.id,t.name,ee.CALLING_PROCESS,e,s);return this.callActivitiesCallingProcess.set(t.calledElement,i),i}return new z(t.id,t.name,ee.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&&C.canHaveNoneEvent(e))return new U(t.id,t.name,e,y.NONE,s);if(i==1){const[r,l]=[...o.entries()][0],a=C.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 C.isBoundaryEvent(e)?this.buildShapeBpmnBoundaryEvent(t,s):C.isStartEvent(e)?new at(t.id,t.name,s,o,t.isInterrupting):new me(t.id,t.name,s,o)}buildShapeBpmnThrowEvent(t,e,s,o){return C.isIntermediateThrowEvent(e)?new Ie(t.id,t.name,s,o):new U(t.id,t.name,e,s,o)}buildShapeBpmnBoundaryEvent(t,e){const s=this.convertedElements.findFlowNode(t.attachedToRef);if(C.isActivity(s==null?void 0:s.kind))return new ct(t.id,t.name,e,t.attachedToRef,t.cancelActivity);this.parsingMessageCollector.warning(new gs(t.id,t.attachedToRef,s==null?void 0:s.kind))}getEventDefinitions(t){const e=new Map;for(const s of ot){const o=t[`${s}EventDefinition`];e.set(s,m(o,!0))}for(const s of m(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 se(t.id,t.name,s,e,o);return this.buildProcessInnerElements(t,t.id),i}buildLaneSetBpmnElements(t,e,s){for(const o of m(t))this.buildLaneBpmnElements(o.lane,e,s)}buildLaneBpmnElements(t,e,s){var o;for(const i of m(t)){const r=new M(i.id,i.name,h.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 m(t.flowNodeRef)){const s=this.convertedElements.findFlowNode(e),o=t.id;s?C.isBoundaryEvent(s.kind)||(s.parentId=o):this.parsingMessageCollector.warning(new fs(o,e))}}buildSequenceFlows(t){for(const e of m(t)){const s=this.getSequenceFlowKind(e);this.convertedElements.registerSequenceFlow(new it(e.id,e.name,e.sourceRef,e.targetRef,s))}}getSequenceFlowKind(t){if(this.defaultSequenceFlowIds.includes(t.id))return V.DEFAULT;{const e=this.convertedElements.findFlowNode(t.sourceRef);if(e&&C.isWithDefaultSequenceFlow(e.kind)&&t.conditionExpression)return C.isActivity(e.kind)?V.CONDITIONAL_FROM_ACTIVITY:V.CONDITIONAL_FROM_GATEWAY}return V.NORMAL}}const Fs=n=>{const t=[],e=n.standardLoopCharacteristics,s=m(n.multiInstanceLoopCharacteristics,!0)[0];return e!==void 0?t.push(_.LOOP):s&&t.push(s.isSequential?_.MULTI_INSTANCE_SEQUENTIAL:_.MULTI_INSTANCE_PARALLEL),t};class Ps{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 ks(n){const t=new Ts;return new Ps(new ls(t),new ps(t,n),new Ls(t),new _s(t),new bs(t,n),new As(t,n))}var xe={},ge={};(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+"]*",o=new RegExp("^"+s+"$"),i=function(l,a){const d=[];let u=a.exec(l);for(;u;){const f=[];f.startIndex=a.lastIndex-u[0].length;const T=u.length;for(let E=0;E"u")};n.isExist=function(l){return typeof l<"u"},n.isEmptyObject=function(l){return Object.keys(l).length===0},n.merge=function(l,a,d){if(a){const u=Object.keys(a),f=u.length;for(let T=0;T"&&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--),!Ws(a)){let f;return a.trim().length===0?f="Invalid space after '<'.":f="Tag '"+a+"' is an invalid name.",L("InvalidTag",f,w(n,i))}const d=Vs(n,i);if(d===!1)return L("InvalidAttr","Attributes for '"+a+"' have open quote.",w(n,i));let u=d.value;if(i=d.index,u[u.length-1]==="/"){const f=i-u.length;u=u.substring(0,u.length-1);const T=et(u,t);if(T===!0)s=!0;else return L(T.err.code,T.err.msg,w(n,f+T.err.line))}else if(l)if(d.tagClosed){if(u.trim().length>0)return L("InvalidTag","Closing tag '"+a+"' can't have attributes or invalid starting.",w(n,r));if(e.length===0)return L("InvalidTag","Closing tag '"+a+"' has not been opened.",w(n,r));{const f=e.pop();if(a!==f.tagName){let T=w(n,f.tagStartPos);return L("InvalidTag","Expected closing tag '"+f.tagName+"' (opened in line "+T.line+", col "+T.col+") instead of closing tag '"+a+"'.",w(n,r))}e.length==0&&(o=!0)}}else return L("InvalidTag","Closing tag '"+a+"' doesn't have proper closing.",w(n,i));else{const f=et(u,t);if(f!==!0)return L(f.err.code,f.err.msg,w(n,i-u.length+f.err.line));if(o===!0)return L("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 L("InvalidXml","Invalid '"+JSON.stringify(e.map(i=>i.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return L("InvalidXml","Start tag expected.",1);return!0};function je(n){return n===" "||n===" "||n===` -`||n==="\r"}function Qe(n,t){const e=t;for(;t5&&s==="xml")return L("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 Vs(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 et(n,t){const e=Be.getAllMatches(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({},mt,n)};Me.buildOptions=Hs;Me.defaultOptions=mt;class Ks{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})}}var zs=Ks;const Xs=ge;function $s(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;{const a=Number(e),d=""+a;return d.search(/[eE]/)!==-1||l?t.eNotation?a:n:e.indexOf(".")!==-1?d==="0"&&r===""||d===r||o&&d==="-"+r?a:n:i?r===d||o+r===d?a:n:e===d||e===o+d?a:n}}else return n}}function lo(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}var ao=ro;function co(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}var It=co;const At=ge,Q=zs,uo=no,ho=ao,fo=It;let go=class{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=To,this.parseXml=mo,this.parseTextData=po,this.resolveNameSpace=Eo,this.buildAttributesMap=Co,this.isItStopNode=vo,this.replaceEntitiesValue=Ao,this.readStopNodeData=Lo,this.saveTextToParentTag=No,this.addChild=Io,this.ignoreAttributesFn=fo(this.options.ignoreAttributes)}};function To(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?_e(n,this.options.parseTagValue,this.options.numberParseOptions):n.trim()===n?_e(n,this.options.parseTagValue,this.options.numberParseOptions):n}}function Eo(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 So=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Co(n,t,e){if(this.options.ignoreAttributes!==!0&&typeof n=="string"){const s=At.getAllMatches(n,So),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 d=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;d&&this.options.unpairedTags.indexOf(d)!==-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=Le(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=K(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=uo(n,i);this.docTypeEntities=l.entities,i=l.i}else if(n.substr(i+1,2)==="!["){const l=K(n,"]]>",i,"CDATA is not closed.")-2,a=n.substring(i+9,l);s=this.saveTextToParentTag(s,e,o);let d=this.parseTextData(a,e.tagname,o,!0,!1,!0,!0);d==null&&(d=""),this.options.cdataPropName?e.add(this.options.cdataPropName,[{[this.options.textNodeName]:a}]):e.add(this.options.textNodeName,d),i=l+2}else{let l=Le(n,i,this.options.removeNSPrefix),a=l.tagName;const d=l.rawTagName;let u=l.tagExp,f=l.attrExpPresent,T=l.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),e&&s&&e.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,e,o,!1));const E=e;if(E&&this.options.unpairedTags.indexOf(E.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 S="";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 x=this.readStopNodeData(n,d,T+1);if(!x)throw new Error(`Unexpected end of ${d}`);i=x.i,S=x.tagContent}const R=new Q(a);a!==u&&f&&(R[":@"]=this.buildAttributesMap(u,o,a)),S&&(S=this.parseTextData(S,a,o,!0,f,!0,!0)),o=o.substr(0,o.lastIndexOf(".")),R.add(this.options.textNodeName,S),this.addChild(e,R,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 S=new Q(a);a!==u&&f&&(S[":@"]=this.buildAttributesMap(u,o,a)),this.addChild(e,S,o),o=o.substr(0,o.lastIndexOf("."))}else{const S=new Q(a);this.tagsNodeStack.push(e),a!==u&&f&&(S[":@"]=this.buildAttributesMap(u,o,a)),this.addChild(e,S,o),e=S}s="",i=T}}else s+=n[i];return t.child};function Io(n,t,e){const s=this.options.updateTag(t.tagname,e,t[":@"]);s===!1||(typeof s=="string"&&(t.tagname=s),n.addChild(t))}const Ao=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 No(n,t,e,s){return n&&(s===void 0&&(s=Object.keys(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 vo(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 Oo(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=K(n,"?>",e+1,"StopNode is not closed.");else if(n.substr(e+1,3)==="!--")e=K(n,"-->",e+3,"StopNode is not closed.");else if(n.substr(e+1,2)==="![")e=K(n,"]]>",e,"StopNode is not closed.")-2;else{const i=Le(n,e,">");i&&((i&&i.tagName)===t&&i.tagExp[i.tagExp.length-1]!=="/"&&o++,e=i.closeIndex)}}function _e(n,t,e){if(t&&typeof n=="string"){const s=n.trim();return s==="true"?!0:s==="false"?!1:ho(n,e)}else return At.isExist(n)?n:""}var _o=go,Nt={};function yo(n,t){return vt(n,t)}function vt(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 wo(n){const t=Object.keys(n);for(let e=0;e0&&(e=Vo),Ot(n,t,"",e)}function Ot(n,t,e,s){let o="",i=!1;for(let r=0;r`,i=!1;continue}else if(a===t.commentPropName){o+=s+``,i=!0;continue}else if(a[0]==="?"){const S=tt(l[":@"],t),R=a==="?xml"?"":s;let x=l[a][0][t.textNodeName];x=x.length!==0?" "+x:"",o+=R+`<${a}${x}${S}?>`,i=!0;continue}let u=s;u!==""&&(u+=t.indentBy);const f=tt(l[":@"],t),T=s+`<${a}${f}`,E=Ot(l[a],t,d,u);t.unpairedTags.indexOf(a)!==-1?t.suppressUnpairedNode?o+=T+">":o+=T+"/>":(!E||E.length===0)&&t.suppressEmptyNode?o+=T+"/>":E&&E.endsWith(">")?o+=T+`>${E}${s}`:(o+=T+">",E&&s!==""&&(E.includes("/>")||E.includes("`),i=!0}return o}function Go(n){const t=Object.keys(n);for(let e=0;e0&&t.processEntities)for(let e=0;e","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function H(n){this.options=Object.assign({},Ko,n),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Ho(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=$o),this.processTextOrObjNode=zo,this.options.format?(this.indentate=Xo,this.tagEndChar=`> +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="")}H.prototype.build=function(n){return this.options.preserveOrder?Wo(n,this.options):(Array.isArray(n)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(n={[this.options.arrayNodeName]:n}),this.j2x(n,0,[]).val)};H.prototype.j2x=function(n,t,e){let s="",o="";const i=e.join(".");for(let r in n)if(Object.prototype.hasOwnProperty.call(n,r))if(typeof n[r]>"u")this.isAttribute(r)&&(o+="");else if(n[r]===null)this.isAttribute(r)?o+="":r[0]==="?"?o+=this.indentate(t)+"<"+r+"?"+this.tagEndChar:o+=this.indentate(t)+"<"+r+"/"+this.tagEndChar;else if(n[r]instanceof Date)o+=this.buildTextValNode(n[r],r,"",t);else if(typeof n[r]!="object"){const l=this.isAttribute(r);if(l&&!this.ignoreAttributesFn(l,i))s+=this.buildAttrPairStr(l,""+n[r]);else if(!l)if(r===this.options.textNodeName){let a=this.options.tagValueProcessor(r,""+n[r]);o+=this.replaceEntitiesValue(a)}else o+=this.buildTextValNode(n[r],r,"",t)}else if(Array.isArray(n[r])){const l=n[r].length;let a="",d="";for(let u=0;u"u"))if(f===null)r[0]==="?"?o+=this.indentate(t)+"<"+r+"?"+this.tagEndChar:o+=this.indentate(t)+"<"+r+"/"+this.tagEndChar;else if(typeof f=="object")if(this.options.oneListGroup){const T=this.j2x(f,t+1,e.concat(r));a+=T.val,this.options.attributesGroupName&&f.hasOwnProperty(this.options.attributesGroupName)&&(d+=T.attrStr)}else a+=this.processTextOrObjNode(f,r,t,e);else if(this.options.oneListGroup){let T=this.options.tagValueProcessor(r,f);T=this.replaceEntitiesValue(T),a+=T}else a+=this.buildTextValNode(f,r,"",t)}this.options.oneListGroup&&(a=this.buildObjectNode(a,r,d,t)),o+=a}else if(this.options.attributesGroupName&&r===this.options.attributesGroupName){const l=Object.keys(n[r]),a=l.length;for(let d=0;d"+n+o:this.options.commentPropName!==!1&&t===this.options.commentPropName&&i.length===0?this.indentate(s)+``+this.newLine:this.indentate(s)+"<"+t+e+i+this.tagEndChar+n+this.indentate(s)+o}};H.prototype.closeTag=function(n){let t="";return this.options.unpairedTags.indexOf(n)!==-1?this.options.suppressUnpairedNode||(t="/"):this.options.suppressEmptyNode?t="/":t=`>`+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(s)+``+this.newLine;if(t[0]==="?")return this.indentate(s)+"<"+t+e+"?"+this.tagEndChar;{let o=this.options.tagValueProcessor(t,n);return o=this.replaceEntitiesValue(o),o===""?this.indentate(s)+"<"+t+e+this.closeTag(t)+this.tagEndChar:this.indentate(s)+"<"+t+e+">"+o+"0&&this.options.processEntities)for(let t=0;t"},{regex:/&(lt|#60|#x3c|#x3C);/g,val:"<"},{regex:/&(quot|#34|#x22);/g,val:'"'}],ti=new Set(["BPMNShape.Bounds","BPMNShape.BPMNLabel.Bounds","BPMNEdge.BPMNLabel.Bounds","BPMNEdge.waypoint"].map(n=>`definitions.BPMNDiagram.BPMNPlane.${n}`)),ni=new Set(["x","y","width","height"]),si=(n,t)=>ti.has(t)&&ni.has(n);class oi{constructor(t){g(this,"x2jOptions",{attributeNamePrefix:"",removeNSPrefix:!0,ignoreAttributes:!1,parseAttributeValue:!0,processEntities:!1,attributeValueProcessor:(t,e,s)=>si(t,s)?Number(e):this.processAttribute(e)});g(this,"xmlParser",new Jo.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 ei)t=t.replace(s.regex,s.val);return(e=this.options)!=null&&e.additionalXmlAttributeProcessor&&(t=this.options.additionalXmlAttributeProcessor(t)),t}}class ii{constructor(t,e){this.jsonParser=t,this.xmlParser=e}parse(t){const e=this.xmlParser.parse(t);return this.jsonParser.parse(e)}}function ri(n){return new ii(ks(new as(n)),new oi(n))}function li(n){return new ai(n)}class ai{constructor(t){this.graph=t}updateAndRefreshCssClassesOfCell(t,e){this.updateAndRefreshCssClassesOfElement(t,e),this.updateAndRefreshCssClassesOfElement(be(t),e)}updateAndRefreshCssClassesOfElement(t,e){const s=this.graph.getModel(),o=s.getCell(t);if(!o)return;let i=o.getStyle();i=b(i,I.EXTRA_CSS_CLASSES,e.join(",")),s.setStyle(o,i)}}function ci(n){return new ui(li(n),new di)}class ui{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 m(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=m(e);for(const i of m(t))this.updateCellIfChanged(s(i,o),i)}updateCellIfChanged(t,e){if(t){const s=this.cssClassesCache.getClassNames(e);this.cssClassesUpdater.updateAndRefreshCssClassesOfCell(e,s)}}}class di{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.sizehi.get(n.position),gi=(n,t)=>{t&&(n.fill.color=t.color??n.fill.color,n.fill.opacity=t.opacity??n.fill.opacity)},Ti=(n,t)=>{t&&(n.stroke.color=t.color??n.stroke.color,n.stroke.width=t.width??n.stroke.width)},pi=(n,t)=>{t&&(n.font.color=t.color??n.font.color,n.font.size=t.size??n.font.size)},Ei=n=>{const t={fill:{color:p.DEFAULT_OVERLAY_FILL_COLOR.valueOf(),opacity:p.DEFAULT_OVERLAY_FILL_OPACITY.valueOf()},stroke:{color:p.DEFAULT_OVERLAY_STROKE_COLOR.valueOf(),width:p.DEFAULT_OVERLAY_STROKE_WIDTH.valueOf()},font:{color:p.DEFAULT_OVERLAY_FONT_COLOR.valueOf(),size:p.DEFAULT_OVERLAY_FONT_SIZE.valueOf()}},e=n.style,s={...t};return e&&(gi(s,e.fill),Ti(s,e.stroke),pi(s,e.font)),s};class Si{convert(t){const e=fi(t),s=Ei(t);return{position:e,style:s}}}function Ci(n){return new mi(n,new Si)}class mi{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 m(e)){const i=new gt(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 Ii(n){return new Ai(Ci(n))}class Ai{constructor(t){this.overlaysUpdater=t}addOverlays(t,e){this.overlaysUpdater.addOverlays(t,e)}removeAllOverlays(t){this.overlaysUpdater.removeAllOverlays(t)}}class Ni{element(t){return`svg > g > g > g[data-bpmn-id="${t}"]`}elementsOfKind(t){return`svg > g > g > g.${t}:not(.bpmn-label)`}}function vi(n){return new Oi(n,new Li(n.getModel()))}const nt=n=>{const t=m(n);return t.push(...t.map(e=>be(e))),t};class Oi{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=nt(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=b(r,c.STYLE_OPACITY,e.opacity,fe),r=Qt(r,e.stroke),r=Jt(r,e.font),sn(e)&&(r=nn(r,e.fill)),s.setStyle(i,r)}})}resetStyle(t){this.graph.batchUpdate(()=>{if(t||t=="")for(const e of nt(t))this.styleManager.resetStyleIfIsStored(e);else this.styleManager.resetAllStyles()})}}const st=I.EXTRA_CSS_CLASSES;class Li{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=en(s.getStyle(),st,""),i=b(e,st,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 _i(n){return new yi(vi(n))}class yi{constructor(t){this.styleUpdater=t}clearCache(){this.styleUpdater.clear()}updateStyle(t,e){this.styleUpdater.updateStyle(t,e)}resetStyle(t){this.styleUpdater.resetStyle(t)}}function wi(n,t){return new Ri(n,new bi(t.container,new Ni),ci(t),Ii(t),_i(t))}class Ri{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 pe(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 pe(t).flatMap(e=>this.htmlElementRegistry.getBpmnHtmlElements(e)).map(e=>this.getRelatedBpmnSemantic(e))}getElementsByKinds(t){return pe(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 bi{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(Ae(t));return[...this.container.querySelectorAll(e)]}}const pe=n=>[...new Set(m(n))];class Fi{filter(t,e){const s=[],o=[];for(const E of m(e==null?void 0:e.pools).filter(S=>S&&Object.keys(S).length>0))E.id?s.push(E.id):E.name&&o.push(E.name);if(s.length===0&&o.length===0)return t;const{filteredPools:i,filteredPoolIds:r}=Pi(t,s,o),l=[...s,...r],{filteredLanes:a,filteredLaneIds:d,filteredFlowNodes:u,filteredFlowNodeIds:f}=_t(t.lanes,t.flowNodes,l),T=xi(t.edges,[...l,...d,...f]);if(i.length===0&&a.length===0&&u.length===0&&T.length===0){let E=s.length>0?` for ids [${s}]`:"";const S=E?" and":"";throw E+=o.length>0?`${S} for names [${o}]`:"",new Error("No matching pools"+E)}return{lanes:a,flowNodes:u,pools:i,edges:T}}}function Pi(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 _t(n,t,e){const{filteredLanes:s,filteredLaneIds:o}=yt(n,e),{filteredLanes:i,filteredLaneIds:r,filteredFlowNodes:l,filteredFlowNodeIds:a}=ki(t,[...e,...o],n);return s.push(...i),o.push(...r),{filteredLanes:s,filteredLaneIds:o,filteredFlowNodes:l,filteredFlowNodeIds:a}}function yt(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}=yt(n,s);e.push(...o),s.push(...i)}return{filteredLanes:e,filteredLaneIds:s}}function ki(n,t,e){const s=n.filter(d=>t.includes(d.bpmnElement.parentId));if(s.length===0)return{filteredLanes:[],filteredLaneIds:[],filteredFlowNodes:[],filteredFlowNodeIds:[]};const o=s.map(d=>d.bpmnElement.id),{filteredLanes:i,filteredLaneIds:r,filteredFlowNodes:l,filteredFlowNodeIds:a}=_t(e,n,o);return s.push(...l),o.push(...a),{filteredLanes:i,filteredLaneIds:r,filteredFlowNodes:s,filteredFlowNodeIds:o}}function xi(n,t){return n.filter(e=>t.includes(e.bpmnElement.sourceReferenceId)&&t.includes(e.bpmnElement.targetReferenceId))}class Bi{constructor(){g(this,"searchableModel");g(this,"onLoadCallback")}load(t,e){var o;const s=new Fi().filter(t,e);return this.searchableModel=new Vi(s),(o=this.onLoadCallback)==null||o.call(this),Mi(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 de?{sourceRefId:s.sourceReferenceId,targetRefId:s.targetReferenceId}:{callActivityGlobalTaskKind:s instanceof z?s.globalTaskKind:void 0,callActivityKind:s instanceof z?s.callActivityKind:void 0,eventDefinitionKind:s instanceof U?s.eventDefinitionKind:void 0,linkEventSourceIds:s instanceof me&&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 se?s.subProcessKind:void 0}}}}function Mi(n){const t=new Set(n.flowNodes.filter(i=>{const r=i.bpmnElement;return C.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;C.isSubProcess(r)?e.push(i):C.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 Vi{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 Yi{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 is(Dt(t==null?void 0:t.container));this.graph=e.configure(t),this.navigation=new rs(this.graph),this.bpmnModelRegistry=new Bi,this.bpmnElementsRegistry=wi(this.bpmnModelRegistry,this.graph),this.parserOptions=t==null?void 0:t.parser}load(t,e){const s=ri(this.parserOptions).parse(t),o=this.bpmnModelRegistry.load(s,e==null?void 0:e.modelFilter);fn(this.graph,this.rendererOptions).render(o,e==null?void 0:e.fit)}}function ar(n){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(n,1):document.addEventListener("DOMContentLoaded",n)}function A(n,...t){Ve("[DEMO]",n,...t)}function Ve(n,t,...e){console.info(`${n} ${t}`,...e)}function F(n,...t){Ve("[DEMO STARTUP]",n,...t)}function wt(n,t){Rt(n),window.alert(n)}function Rt(n){console.error("[DEMO]",n)}function $(n,...t){Ve("[DEMO DOWNLOAD]",n,...t)}async function Gi(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 bt(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 Di(n){$("Start SVG download"),bt("diagram.svg","data:image/svg+xml",n),$("Download completed")}function Ui(n){$("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(),bt("diagram.png","",l),$("Download completed")}),r.src=s.src}),s.src=e}class Wi{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=` +`):(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=` .faded-container { opacity: 1; } @@ -47,7 +47,7 @@ var Mt=Object.defineProperty;var Vt=(n,t,e)=>t in n?Mt(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,o){return function(i){try{const l=i.dataTransfer.files;s(l[0])}catch(r){const l=r instanceof Error?r.message:String(r);wt(l)}finally{e?this.querySelector("#"+o).classList.remove("dragging"):this.classList.remove("dragging"),t.classList.remove("faded")}}}}class Ft{constructor(t){this.graph=t}exportSvg(){return this.doSvgExport(!0)}exportSvgForPng(){const t=zt.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,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` -${N.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=N.createXmlDocument(),d=a.createElementNS(c.NS_SVG,"svg"),u=e/l,f=Math.max(1,Math.ceil(r.width*u)+2*s),T=Math.max(1,Math.ceil(r.height*u)+2*s);d.setAttribute("version","1.1"),d.setAttribute("width",f+"px"),d.setAttribute("height",T+"px"),d.setAttribute("viewBox",(o?"-0.5 -0.5":"0 0")+" "+f+" "+T),a.append(d);const E=a.createElementNS(c.NS_SVG,"g");d.append(E);const S=this.createSvgCanvas(E);S.foEnabled=i,S.foOffset=o?-.5:0,S.textOffset=o?-.5:0,S.imageOffset=o?-.5:0,S.translate(Math.floor((s/e-r.x)/l),Math.floor((s/e-r.y)/l)),S.scale(u);const R=new O.mxImageExport;return R.includeOverlays=!0,R.drawState(this.graph.getView().getState(this.graph.model.root),S),a}createSvgCanvas(t){const e=new Hi(t);return e.pointerEvents=!0,e}}class Hi extends Re{constructor(e){super(e);g(this,"htmlConverter",document.createElement("div"))}getAlternateText(e,s,o,i,r,l,a,d,u,f,T,E,S){return this.computeTruncatedText(l,i)}plainText(e,s,o,i,r,l,a,d,u,f,T,E){r=this.computeTruncatedText(r,o),super.plainText(e,s,o,i,r,l,a,d,u,f,T,E)}computeTruncatedText(e,s){if(e==null||this.state.fontSize<=0)return"";try{this.htmlConverter.innerHTML=e,e=N.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=N.trim(i.join(""))+"...")}catch(o){console.warn("Error while computing txt label",o)}return e}}const Ki=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 zi extends Yi{configureTheme(t){if(t=="default")return new Et(this.graph).configureStyles(),!0;const e=Ki.get(t);if(!e)return!1;const s=this.graph.getStylesheet();for(const u of C.eventKinds()){let f,T;switch(u){case"endEvent":{f=e.endEventFillColor,T=e.endEventStrokeColor;break}case"startEvent":{f=e.startEventFillColor,T=e.startEventStrokeColor;break}case"intermediateCatchEvent":case"intermediateThrowEvent":case"boundaryEvent":{f=e.defaultFillColor,T=e.catchAndThrowEventStrokeColor??e.defaultStrokeColor;break}default:{f=e.defaultFillColor,T=e.defaultStrokeColor;break}}const E=s.styles[u];E.fillColor=f,E.strokeColor=T}for(const u of C.taskKinds()){const f=s.styles[u];f.fillColor=e.taskAndCallActivityFillColor}const o=s.styles[h.CALL_ACTIVITY];o.fillColor=e.taskAndCallActivityFillColor;const i=s.styles[h.TEXT_ANNOTATION];i.fillColor=e.textAnnotationFillColor??p.TEXT_ANNOTATION_FILL_COLOR;const r=s.styles[h.POOL];r.fillColor=e.poolFillColor,r.swimlaneFillColor=e.defaultFillColor;const l=s.styles[h.LANE];l.fillColor=e.laneFillColor;const a=s.getDefaultVertexStyle();a.fontColor=e.defaultFontColor,a.fillColor=e.defaultFillColor,a.strokeColor=e.defaultStrokeColor;const d=s.getDefaultEdgeStyle();return d.fontColor=e.defaultFontColor,d.fillColor=e.defaultFillColor,d.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 v,D={},Ye,Ge,ue,B;function cr(n){A("Updating load options"),D.fit=n,A("Load options updated",D)}function ur(){return{...D}}function dr(){return ue}function hr(n){A("Switching theme from %s to %s",ue,n),v.configureTheme(n)?(v.graph.refresh(),A("Theme switch done"),ue=n):A("Unknown theme, do nothing")}function Pt(n,t=!0){A("Loading bpmn...");try{v.load(n,D),A("BPMN loaded with configuration",D),$i(Ge),document.dispatchEvent(new CustomEvent("diagramLoaded"))}catch(e){if(t)Ye(`Cannot load the BPMN diagram: ${e instanceof Error?e.message:String(e)}`);else throw e}}function fr(n){A("Fitting..."),v.navigation.fit(n),A("Fit done with configuration",n)}function gr(n){A(`Zooming '${n}'...`),v.navigation.zoom(n),A("Zoom done")}function Tr(n){return v.bpmnElementsRegistry.getModelElementsByKinds(n)}function Xi(n){return v.bpmnElementsRegistry.getModelElementsByIds(n)}function kt(n){const t=v.graph.model,e=t.getCell(n);return t.getParent(e)}function pr(n){return n.map(t=>kt(t).getId()).filter((t,e,s)=>s.indexOf(t)===e)}function Er(n){var s;const t=kt(n),e=Xi(t.getId());return e&&((s=e[0])==null?void 0:s.kind)===h.SUB_PROCESS}function Sr(n,t){return v.bpmnElementsRegistry.addCssClasses(n,t)}function Cr(n,t){return v.bpmnElementsRegistry.removeCssClasses(n,t)}function mr(n,t){return v.bpmnElementsRegistry.addOverlays(n,[t])}function Ir(n){return v.bpmnElementsRegistry.removeAllOverlays(n)}function $i(n){if(!Ge)return;A("Updating model, bpmnElement to collapse:",n);const t=v.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 xt(n){n.text().then(t=>{Pt(t)}).catch(t=>{throw t})}function Ar(n){const t=n.target.files;if(t&&t.length>0){const e=t[0];xt(e)}}function Zi(n){Gi(n).catch(t=>{throw new Error(`Unable to fetch ${n}. ${t}`)}).then(t=>(A("BPMN content fetched"),t)).then(t=>{Pt(t,!1),A(`BPMN content loaded from url ${n}`)}).then(()=>{nr()}).catch(t=>{Ye(t.message)})}function Nr(n){wt(n)}function qi(n){Rt(n)}function ji(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 Qi(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=v.graph.container;r.style.backgroundColor=i,F("Bpmn container style updated")}const e=n.get("style.theme");F(`Configuring the '${e}' BPMN theme`),v.configureTheme(e)?(ue=e,F(`'${e}' BPMN theme configured`)):F(`Unknown '${e}' BPMN theme, skipping configuration`),n.get("style.seqFlow.light.colors")=="true"&&v.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 Ji(n){Ge=n.get("bpmn.element.id.collapsed")}function er(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 vr(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}v=new zi(n.globalOptions),t("Initialization completed"),new Wi(window,"drop-container",v.graph.container,xt),t("Drag&Drop support initialized"),Ye=n.statusKoNotifier??qi,t("Configuring Load Options"),D=n.loadOptions??{},D.fit=ji(n,e),D.modelFilter=er(e),Qi(e),Ji(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);Zi(i);return}t("No 'url to fetch BPMN content' provided")}function Or(){$("Trigger SVG Download"),Di(new Ft(v.graph).exportSvg())}function Lr(){$("Trigger PNG Download"),Ui(new Ft(v.graph).exportSvgForPng())}function tr(n,t){A("Applying style using the style API: %O",t),v.bpmnElementsRegistry.updateStyle(n,t),A("New style applied on: %O",n)}function _r(n){A("Resetting styles using the style API!"),v.bpmnElementsRegistry.resetStyle(n),A("Styles reset")}function nr(){if(B){const n=sr();A("Number of elements whose style is to be updated",n.length),tr(n,B)}}function sr(){A("Retrieving ids of all BPMN elements");const n=[...Object.values(h),...Object.values(k)],t=v.bpmnElementsRegistry.getModelElementsByKinds(n).map(e=>e.id);return A("All BPMN elements ids retrieved:",t.length),t}export{J as F,h as S,Gt as Z,hr as a,dr as b,Ir as c,ar as d,Sr as e,fr as f,ur as g,Ar as h,Or as i,Lr as j,Er as k,A as l,zt as m,Tr as n,tr as o,C as p,pr as q,Cr as r,vr as s,_r as t,cr as u,Tn as v,Nr as w,mr as x,gr as z}; +${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}; diff --git a/demo/load-and-navigation/assets/mxgraph.js b/demo/load-and-navigation/assets/mxgraph.js index c47b5b5e..90542533 100644 --- a/demo/load-and-navigation/assets/mxgraph.js +++ b/demo/load-and-navigation/assets/mxgraph.js @@ -1,4 +1,4 @@ -var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var build={exports:{}};(function(module){(function(t,e){module.exports?module.exports=e():t.mxgraph=e()})(commonjsGlobal,function(){return function(opts){for(var name in opts)this[name]=opts[name];var __mxOutput={},mxClient={VERSION:"4.2.2",IS_IE:navigator.userAgent!=null&&navigator.userAgent.indexOf("MSIE")>=0,IS_IE6:navigator.userAgent!=null&&navigator.userAgent.indexOf("MSIE 6")>=0,IS_IE11:navigator.userAgent!=null&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:navigator.userAgent!=null&&!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:navigator.userAgent!=null&&navigator.userAgent.indexOf("MSIE")>=0&&(document.documentMode==null||document.documentMode==5),IS_EM:"spellcheck"in document.createElement("textarea")&&document.documentMode==8,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:navigator.userAgent!=null&&navigator.userAgent.indexOf("Mozilla/")>=0&&navigator.userAgent.indexOf("MSIE")<0&&navigator.userAgent.indexOf("Edge/")<0,IS_OP:navigator.userAgent!=null&&(navigator.userAgent.indexOf("Opera/")>=0||navigator.userAgent.indexOf("OPR/")>=0),IS_OT:navigator.userAgent!=null&&navigator.userAgent.indexOf("Presto/")>=0&&navigator.userAgent.indexOf("Presto/2.4.")<0&&navigator.userAgent.indexOf("Presto/2.3.")<0&&navigator.userAgent.indexOf("Presto/2.2.")<0&&navigator.userAgent.indexOf("Presto/2.1.")<0&&navigator.userAgent.indexOf("Presto/2.0.")<0&&navigator.userAgent.indexOf("Presto/1.")<0,IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:navigator.appVersion.indexOf("Android")>=0,IS_IOS:/iP(hone|od|ad)/.test(navigator.platform),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:window.chrome!=null&&chrome.app!=null&&chrome.app.runtime!=null,IS_FF:typeof InstallTrigger<"u",IS_MT:navigator.userAgent.indexOf("Firefox/")>=0&&navigator.userAgent.indexOf("Firefox/1.")<0&&navigator.userAgent.indexOf("Firefox/2.")<0||navigator.userAgent.indexOf("Iceweasel/")>=0&&navigator.userAgent.indexOf("Iceweasel/1.")<0&&navigator.userAgent.indexOf("Iceweasel/2.")<0||navigator.userAgent.indexOf("SeaMonkey/")>=0&&navigator.userAgent.indexOf("SeaMonkey/1.")<0||navigator.userAgent.indexOf("Iceape/")>=0&&navigator.userAgent.indexOf("Iceape/1.")<0,IS_VML:navigator.appName.toUpperCase()=="MICROSOFT INTERNET EXPLORER",IS_SVG:navigator.appName.toUpperCase()!="MICROSOFT INTERNET EXPLORER",NO_FO:!document.createElementNS||document.createElementNS("http://www.w3.org/2000/svg","foreignObject")!="[object SVGForeignObjectElement]"||navigator.userAgent.indexOf("Opera/")>=0,IS_WIN:navigator.appVersion.indexOf("Win")>0,IS_MAC:navigator.appVersion.indexOf("Mac")>0,IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:window.PointerEvent!=null&&!(navigator.appVersion.indexOf("Mac")>0),IS_LOCAL:document.location.href.indexOf("http://")<0&&document.location.href.indexOf("https://")<0,defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(t,e,i,n){if(i=i||document,mxClient.IS_IE6)i.write('');else{var r=i.createElement("link");r.setAttribute("rel",t),r.setAttribute("href",e),r.setAttribute("charset","UTF-8"),r.setAttribute("type","text/css"),n&&r.setAttribute("id",n);var s=i.getElementsByTagName("head")[0];s.appendChild(r)}},loadResources:function(t,e){var i=mxClient.defaultBundles.length;function n(){--i==0&&t()}for(var r=0;r<\/script>')}};typeof mxLoadResources>"u"&&(mxLoadResources=!0),typeof mxForceIncludes>"u"&&(mxForceIncludes=!1),typeof mxResourceExtension>"u"&&(mxResourceExtension=".txt"),typeof mxLoadStylesheets>"u"&&(mxLoadStylesheets=!0),typeof mxBasePath<"u"&&mxBasePath.length>0?(mxBasePath.substring(mxBasePath.length-1)=="/"&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".",typeof mxImageBasePath<"u"&&mxImageBasePath.length>0?(mxImageBasePath.substring(mxImageBasePath.length-1)=="/"&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images",typeof mxLanguage<"u"&&mxLanguage!=null?mxClient.language=mxLanguage:mxClient.language=mxClient.IS_IE?navigator.userLanguage:navigator.language,typeof mxDefaultLanguage<"u"&&mxDefaultLanguage!=null?mxClient.defaultLanguage=mxDefaultLanguage:mxClient.defaultLanguage="en",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css"),typeof mxLanguages<"u"&&mxLanguages!=null&&(mxClient.languages=mxLanguages),mxClient.IS_VML&&(mxClient.IS_SVG?mxClient.IS_VML=!1:(document.namespaces!=null&&(document.documentMode==8?(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office"))),mxClient.IS_QUIRKS&&document.styleSheets.length>=30?function(){var t=document.createElement("style");t.type="text/css",t.styleSheet.cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",document.getElementsByTagName("head")[0].appendChild(t)}():document.createStyleSheet().cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css"))),(mxForceIncludes||module.exports==null)&&(mxClient.include(mxClient.basePath+"/js/util/mxLog.js"),mxClient.include(mxClient.basePath+"/js/util/mxObjectIdentity.js"),mxClient.include(mxClient.basePath+"/js/util/mxDictionary.js"),mxClient.include(mxClient.basePath+"/js/util/mxResources.js"),mxClient.include(mxClient.basePath+"/js/util/mxPoint.js"),mxClient.include(mxClient.basePath+"/js/util/mxRectangle.js"),mxClient.include(mxClient.basePath+"/js/util/mxEffects.js"),mxClient.include(mxClient.basePath+"/js/util/mxUtils.js"),mxClient.include(mxClient.basePath+"/js/util/mxConstants.js"),mxClient.include(mxClient.basePath+"/js/util/mxEventObject.js"),mxClient.include(mxClient.basePath+"/js/util/mxMouseEvent.js"),mxClient.include(mxClient.basePath+"/js/util/mxEventSource.js"),mxClient.include(mxClient.basePath+"/js/util/mxEvent.js"),mxClient.include(mxClient.basePath+"/js/util/mxXmlRequest.js"),mxClient.include(mxClient.basePath+"/js/util/mxClipboard.js"),mxClient.include(mxClient.basePath+"/js/util/mxWindow.js"),mxClient.include(mxClient.basePath+"/js/util/mxForm.js"),mxClient.include(mxClient.basePath+"/js/util/mxImage.js"),mxClient.include(mxClient.basePath+"/js/util/mxDivResizer.js"),mxClient.include(mxClient.basePath+"/js/util/mxDragSource.js"),mxClient.include(mxClient.basePath+"/js/util/mxToolbar.js"),mxClient.include(mxClient.basePath+"/js/util/mxUndoableEdit.js"),mxClient.include(mxClient.basePath+"/js/util/mxUndoManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxUrlConverter.js"),mxClient.include(mxClient.basePath+"/js/util/mxPanningManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxPopupMenu.js"),mxClient.include(mxClient.basePath+"/js/util/mxAutoSaveManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxAnimation.js"),mxClient.include(mxClient.basePath+"/js/util/mxMorphing.js"),mxClient.include(mxClient.basePath+"/js/util/mxImageBundle.js"),mxClient.include(mxClient.basePath+"/js/util/mxImageExport.js"),mxClient.include(mxClient.basePath+"/js/util/mxAbstractCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxXmlCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxSvgCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxVmlCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxGuide.js"),mxClient.include(mxClient.basePath+"/js/shape/mxShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxStencil.js"),mxClient.include(mxClient.basePath+"/js/shape/mxStencilRegistry.js"),mxClient.include(mxClient.basePath+"/js/shape/mxMarker.js"),mxClient.include(mxClient.basePath+"/js/shape/mxActor.js"),mxClient.include(mxClient.basePath+"/js/shape/mxCloud.js"),mxClient.include(mxClient.basePath+"/js/shape/mxRectangleShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxEllipse.js"),mxClient.include(mxClient.basePath+"/js/shape/mxDoubleEllipse.js"),mxClient.include(mxClient.basePath+"/js/shape/mxRhombus.js"),mxClient.include(mxClient.basePath+"/js/shape/mxPolyline.js"),mxClient.include(mxClient.basePath+"/js/shape/mxArrow.js"),mxClient.include(mxClient.basePath+"/js/shape/mxArrowConnector.js"),mxClient.include(mxClient.basePath+"/js/shape/mxText.js"),mxClient.include(mxClient.basePath+"/js/shape/mxTriangle.js"),mxClient.include(mxClient.basePath+"/js/shape/mxHexagon.js"),mxClient.include(mxClient.basePath+"/js/shape/mxLine.js"),mxClient.include(mxClient.basePath+"/js/shape/mxImageShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxLabel.js"),mxClient.include(mxClient.basePath+"/js/shape/mxCylinder.js"),mxClient.include(mxClient.basePath+"/js/shape/mxConnector.js"),mxClient.include(mxClient.basePath+"/js/shape/mxSwimlane.js"),mxClient.include(mxClient.basePath+"/js/layout/mxGraphLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxStackLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxPartitionLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCompactTreeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxRadialTreeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxFastOrganicLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCircleLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxParallelEdgeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCompositeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxEdgeLabelLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphAbstractHierarchyCell.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyNode.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyEdge.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyModel.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxSwimlaneModel.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxHierarchicalLayoutStage.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxMedianHybridCrossingReduction.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxMinimumCycleRemover.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxCoordinateAssignment.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxSwimlaneOrdering.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/mxHierarchicalLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/mxSwimlaneLayout.js"),mxClient.include(mxClient.basePath+"/js/model/mxGraphModel.js"),mxClient.include(mxClient.basePath+"/js/model/mxCell.js"),mxClient.include(mxClient.basePath+"/js/model/mxGeometry.js"),mxClient.include(mxClient.basePath+"/js/model/mxCellPath.js"),mxClient.include(mxClient.basePath+"/js/view/mxPerimeter.js"),mxClient.include(mxClient.basePath+"/js/view/mxPrintPreview.js"),mxClient.include(mxClient.basePath+"/js/view/mxStylesheet.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellState.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraphSelectionModel.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellEditor.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellRenderer.js"),mxClient.include(mxClient.basePath+"/js/view/mxEdgeStyle.js"),mxClient.include(mxClient.basePath+"/js/view/mxStyleRegistry.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraphView.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraph.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellOverlay.js"),mxClient.include(mxClient.basePath+"/js/view/mxOutline.js"),mxClient.include(mxClient.basePath+"/js/view/mxMultiplicity.js"),mxClient.include(mxClient.basePath+"/js/view/mxLayoutManager.js"),mxClient.include(mxClient.basePath+"/js/view/mxSwimlaneManager.js"),mxClient.include(mxClient.basePath+"/js/view/mxTemporaryCellStates.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellStatePreview.js"),mxClient.include(mxClient.basePath+"/js/view/mxConnectionConstraint.js"),mxClient.include(mxClient.basePath+"/js/handler/mxGraphHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxPanningHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxPopupMenuHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellMarker.js"),mxClient.include(mxClient.basePath+"/js/handler/mxSelectionCellsHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxConnectionHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxConstraintHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxRubberband.js"),mxClient.include(mxClient.basePath+"/js/handler/mxHandle.js"),mxClient.include(mxClient.basePath+"/js/handler/mxVertexHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxEdgeHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxElbowEdgeHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxEdgeSegmentHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxKeyHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxTooltipHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellTracker.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellHighlight.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultKeyHandler.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultPopupMenu.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultToolbar.js"),mxClient.include(mxClient.basePath+"/js/editor/mxEditor.js"),mxClient.include(mxClient.basePath+"/js/io/mxCodecRegistry.js"),mxClient.include(mxClient.basePath+"/js/io/mxCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxObjectCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxCellCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxModelCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxRootChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxChildChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxTerminalChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGenericChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGraphCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGraphViewCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxStylesheetCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultKeyHandlerCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultToolbarCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultPopupMenuCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxEditorCodec.js")),__mxOutput.mxClient=typeof mxClient<"u"?mxClient:void 0;var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(mxLog.window==null&&document.body!=null){var t=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,e=document.createElement("table");e.setAttribute("width","100%"),e.setAttribute("height","100%");var i=document.createElement("tbody"),n=document.createElement("tr"),r=document.createElement("td");r.style.verticalAlign="top",mxLog.textarea=document.createElement("textarea"),mxLog.textarea.setAttribute("wrap","off"),mxLog.textarea.setAttribute("readOnly","true"),mxLog.textarea.style.height="100%",mxLog.textarea.style.resize="none",mxLog.textarea.value=mxLog.buffer,mxClient.IS_NS&&document.compatMode!="BackCompat"?mxLog.textarea.style.width="99%":mxLog.textarea.style.width="100%",r.appendChild(mxLog.textarea),n.appendChild(r),i.appendChild(n),n=document.createElement("tr"),mxLog.td=document.createElement("td"),mxLog.td.style.verticalAlign="top",mxLog.td.setAttribute("height","30px"),n.appendChild(mxLog.td),i.appendChild(n),e.appendChild(i),mxLog.addButton("Info",function(u){mxLog.info()}),mxLog.addButton("DOM",function(u){var p=mxUtils.getInnerHtml(document.body);mxLog.debug(p)}),mxLog.addButton("Trace",function(u){mxLog.TRACE=!mxLog.TRACE,mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")}),mxLog.addButton("Copy",function(u){try{mxUtils.copy(mxLog.textarea.value)}catch(p){mxUtils.alert(p)}}),mxLog.addButton("Show",function(u){try{mxUtils.popup(mxLog.textarea.value)}catch(p){mxUtils.alert(p)}}),mxLog.addButton("Clear",function(u){mxLog.textarea.value=""});var s=0,l=0;if(typeof window.innerWidth=="number"?(s=window.innerHeight,l=window.innerWidth):(s=document.documentElement.clientHeight||document.body.clientHeight,l=document.body.clientWidth),mxLog.window=new mxWindow(t,e,Math.max(0,l-320),Math.max(0,s-210),300,160),mxLog.window.setMaximizable(!0),mxLog.window.setScrollable(!1),mxLog.window.setResizable(!0),mxLog.window.setClosable(!0),mxLog.window.destroyOnClose=!1,(mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&document.compatMode!="BackCompat"||document.documentMode==11){var a=mxLog.window.getElement(),o=function(u,p){mxLog.textarea.style.height=Math.max(0,a.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,o),mxLog.window.addListener(mxEvent.MAXIMIZE,o),mxLog.window.addListener(mxEvent.NORMALIZE,o),mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(t,e){var i=document.createElement("button");mxUtils.write(i,t),mxEvent.addListener(i,"click",e),mxLog.td.appendChild(i)},isVisible:function(){return mxLog.window!=null?mxLog.window.isVisible():!1},show:function(){mxLog.setVisible(!0)},setVisible:function(t){mxLog.window==null&&mxLog.init(),mxLog.window!=null&&mxLog.window.setVisible(t)},enter:function(t){if(mxLog.TRACE)return mxLog.writeln("Entering "+t),new Date().getTime()},leave:function(t,e){if(mxLog.TRACE){var i=e!=0?" ("+(new Date().getTime()-e)+" ms)":"";mxLog.writeln("Leaving "+t+i)}},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var t="",e=0;e=0&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=t},writeln:function(){for(var t="",e=0;e=0,IS_IE6:navigator.userAgent!=null&&navigator.userAgent.indexOf("MSIE 6")>=0,IS_IE11:navigator.userAgent!=null&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:navigator.userAgent!=null&&!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:navigator.userAgent!=null&&navigator.userAgent.indexOf("MSIE")>=0&&(document.documentMode==null||document.documentMode==5),IS_EM:"spellcheck"in document.createElement("textarea")&&document.documentMode==8,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:navigator.userAgent!=null&&navigator.userAgent.indexOf("Mozilla/")>=0&&navigator.userAgent.indexOf("MSIE")<0&&navigator.userAgent.indexOf("Edge/")<0,IS_OP:navigator.userAgent!=null&&(navigator.userAgent.indexOf("Opera/")>=0||navigator.userAgent.indexOf("OPR/")>=0),IS_OT:navigator.userAgent!=null&&navigator.userAgent.indexOf("Presto/")>=0&&navigator.userAgent.indexOf("Presto/2.4.")<0&&navigator.userAgent.indexOf("Presto/2.3.")<0&&navigator.userAgent.indexOf("Presto/2.2.")<0&&navigator.userAgent.indexOf("Presto/2.1.")<0&&navigator.userAgent.indexOf("Presto/2.0.")<0&&navigator.userAgent.indexOf("Presto/1.")<0,IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:navigator.appVersion.indexOf("Android")>=0,IS_IOS:/iP(hone|od|ad)/.test(navigator.platform),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:window.chrome!=null&&chrome.app!=null&&chrome.app.runtime!=null,IS_FF:typeof InstallTrigger<"u",IS_MT:navigator.userAgent.indexOf("Firefox/")>=0&&navigator.userAgent.indexOf("Firefox/1.")<0&&navigator.userAgent.indexOf("Firefox/2.")<0||navigator.userAgent.indexOf("Iceweasel/")>=0&&navigator.userAgent.indexOf("Iceweasel/1.")<0&&navigator.userAgent.indexOf("Iceweasel/2.")<0||navigator.userAgent.indexOf("SeaMonkey/")>=0&&navigator.userAgent.indexOf("SeaMonkey/1.")<0||navigator.userAgent.indexOf("Iceape/")>=0&&navigator.userAgent.indexOf("Iceape/1.")<0,IS_VML:navigator.appName.toUpperCase()=="MICROSOFT INTERNET EXPLORER",IS_SVG:navigator.appName.toUpperCase()!="MICROSOFT INTERNET EXPLORER",NO_FO:!document.createElementNS||document.createElementNS("http://www.w3.org/2000/svg","foreignObject")!="[object SVGForeignObjectElement]"||navigator.userAgent.indexOf("Opera/")>=0,IS_WIN:navigator.appVersion.indexOf("Win")>0,IS_MAC:navigator.appVersion.indexOf("Mac")>0,IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:window.PointerEvent!=null&&!(navigator.appVersion.indexOf("Mac")>0),IS_LOCAL:document.location.href.indexOf("http://")<0&&document.location.href.indexOf("https://")<0,defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(t,e,i,n){if(i=i||document,mxClient.IS_IE6)i.write('');else{var r=i.createElement("link");r.setAttribute("rel",t),r.setAttribute("href",e),r.setAttribute("charset","UTF-8"),r.setAttribute("type","text/css"),n&&r.setAttribute("id",n);var s=i.getElementsByTagName("head")[0];s.appendChild(r)}},loadResources:function(t,e){var i=mxClient.defaultBundles.length;function n(){--i==0&&t()}for(var r=0;r<\/script>')}};typeof mxLoadResources>"u"&&(mxLoadResources=!0),typeof mxForceIncludes>"u"&&(mxForceIncludes=!1),typeof mxResourceExtension>"u"&&(mxResourceExtension=".txt"),typeof mxLoadStylesheets>"u"&&(mxLoadStylesheets=!0),typeof mxBasePath<"u"&&mxBasePath.length>0?(mxBasePath.substring(mxBasePath.length-1)=="/"&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".",typeof mxImageBasePath<"u"&&mxImageBasePath.length>0?(mxImageBasePath.substring(mxImageBasePath.length-1)=="/"&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images",typeof mxLanguage<"u"&&mxLanguage!=null?mxClient.language=mxLanguage:mxClient.language=mxClient.IS_IE?navigator.userLanguage:navigator.language,typeof mxDefaultLanguage<"u"&&mxDefaultLanguage!=null?mxClient.defaultLanguage=mxDefaultLanguage:mxClient.defaultLanguage="en",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css"),typeof mxLanguages<"u"&&mxLanguages!=null&&(mxClient.languages=mxLanguages),mxClient.IS_VML&&(mxClient.IS_SVG?mxClient.IS_VML=!1:(document.namespaces!=null&&(document.documentMode==8?(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office"))),mxClient.IS_QUIRKS&&document.styleSheets.length>=30?function(){var t=document.createElement("style");t.type="text/css",t.styleSheet.cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",document.getElementsByTagName("head")[0].appendChild(t)}():document.createStyleSheet().cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css"))),(mxForceIncludes||module.exports==null)&&(mxClient.include(mxClient.basePath+"/js/util/mxLog.js"),mxClient.include(mxClient.basePath+"/js/util/mxObjectIdentity.js"),mxClient.include(mxClient.basePath+"/js/util/mxDictionary.js"),mxClient.include(mxClient.basePath+"/js/util/mxResources.js"),mxClient.include(mxClient.basePath+"/js/util/mxPoint.js"),mxClient.include(mxClient.basePath+"/js/util/mxRectangle.js"),mxClient.include(mxClient.basePath+"/js/util/mxEffects.js"),mxClient.include(mxClient.basePath+"/js/util/mxUtils.js"),mxClient.include(mxClient.basePath+"/js/util/mxConstants.js"),mxClient.include(mxClient.basePath+"/js/util/mxEventObject.js"),mxClient.include(mxClient.basePath+"/js/util/mxMouseEvent.js"),mxClient.include(mxClient.basePath+"/js/util/mxEventSource.js"),mxClient.include(mxClient.basePath+"/js/util/mxEvent.js"),mxClient.include(mxClient.basePath+"/js/util/mxXmlRequest.js"),mxClient.include(mxClient.basePath+"/js/util/mxClipboard.js"),mxClient.include(mxClient.basePath+"/js/util/mxWindow.js"),mxClient.include(mxClient.basePath+"/js/util/mxForm.js"),mxClient.include(mxClient.basePath+"/js/util/mxImage.js"),mxClient.include(mxClient.basePath+"/js/util/mxDivResizer.js"),mxClient.include(mxClient.basePath+"/js/util/mxDragSource.js"),mxClient.include(mxClient.basePath+"/js/util/mxToolbar.js"),mxClient.include(mxClient.basePath+"/js/util/mxUndoableEdit.js"),mxClient.include(mxClient.basePath+"/js/util/mxUndoManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxUrlConverter.js"),mxClient.include(mxClient.basePath+"/js/util/mxPanningManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxPopupMenu.js"),mxClient.include(mxClient.basePath+"/js/util/mxAutoSaveManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxAnimation.js"),mxClient.include(mxClient.basePath+"/js/util/mxMorphing.js"),mxClient.include(mxClient.basePath+"/js/util/mxImageBundle.js"),mxClient.include(mxClient.basePath+"/js/util/mxImageExport.js"),mxClient.include(mxClient.basePath+"/js/util/mxAbstractCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxXmlCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxSvgCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxVmlCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxGuide.js"),mxClient.include(mxClient.basePath+"/js/shape/mxShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxStencil.js"),mxClient.include(mxClient.basePath+"/js/shape/mxStencilRegistry.js"),mxClient.include(mxClient.basePath+"/js/shape/mxMarker.js"),mxClient.include(mxClient.basePath+"/js/shape/mxActor.js"),mxClient.include(mxClient.basePath+"/js/shape/mxCloud.js"),mxClient.include(mxClient.basePath+"/js/shape/mxRectangleShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxEllipse.js"),mxClient.include(mxClient.basePath+"/js/shape/mxDoubleEllipse.js"),mxClient.include(mxClient.basePath+"/js/shape/mxRhombus.js"),mxClient.include(mxClient.basePath+"/js/shape/mxPolyline.js"),mxClient.include(mxClient.basePath+"/js/shape/mxArrow.js"),mxClient.include(mxClient.basePath+"/js/shape/mxArrowConnector.js"),mxClient.include(mxClient.basePath+"/js/shape/mxText.js"),mxClient.include(mxClient.basePath+"/js/shape/mxTriangle.js"),mxClient.include(mxClient.basePath+"/js/shape/mxHexagon.js"),mxClient.include(mxClient.basePath+"/js/shape/mxLine.js"),mxClient.include(mxClient.basePath+"/js/shape/mxImageShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxLabel.js"),mxClient.include(mxClient.basePath+"/js/shape/mxCylinder.js"),mxClient.include(mxClient.basePath+"/js/shape/mxConnector.js"),mxClient.include(mxClient.basePath+"/js/shape/mxSwimlane.js"),mxClient.include(mxClient.basePath+"/js/layout/mxGraphLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxStackLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxPartitionLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCompactTreeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxRadialTreeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxFastOrganicLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCircleLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxParallelEdgeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCompositeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxEdgeLabelLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphAbstractHierarchyCell.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyNode.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyEdge.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyModel.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxSwimlaneModel.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxHierarchicalLayoutStage.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxMedianHybridCrossingReduction.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxMinimumCycleRemover.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxCoordinateAssignment.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxSwimlaneOrdering.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/mxHierarchicalLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/mxSwimlaneLayout.js"),mxClient.include(mxClient.basePath+"/js/model/mxGraphModel.js"),mxClient.include(mxClient.basePath+"/js/model/mxCell.js"),mxClient.include(mxClient.basePath+"/js/model/mxGeometry.js"),mxClient.include(mxClient.basePath+"/js/model/mxCellPath.js"),mxClient.include(mxClient.basePath+"/js/view/mxPerimeter.js"),mxClient.include(mxClient.basePath+"/js/view/mxPrintPreview.js"),mxClient.include(mxClient.basePath+"/js/view/mxStylesheet.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellState.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraphSelectionModel.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellEditor.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellRenderer.js"),mxClient.include(mxClient.basePath+"/js/view/mxEdgeStyle.js"),mxClient.include(mxClient.basePath+"/js/view/mxStyleRegistry.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraphView.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraph.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellOverlay.js"),mxClient.include(mxClient.basePath+"/js/view/mxOutline.js"),mxClient.include(mxClient.basePath+"/js/view/mxMultiplicity.js"),mxClient.include(mxClient.basePath+"/js/view/mxLayoutManager.js"),mxClient.include(mxClient.basePath+"/js/view/mxSwimlaneManager.js"),mxClient.include(mxClient.basePath+"/js/view/mxTemporaryCellStates.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellStatePreview.js"),mxClient.include(mxClient.basePath+"/js/view/mxConnectionConstraint.js"),mxClient.include(mxClient.basePath+"/js/handler/mxGraphHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxPanningHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxPopupMenuHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellMarker.js"),mxClient.include(mxClient.basePath+"/js/handler/mxSelectionCellsHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxConnectionHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxConstraintHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxRubberband.js"),mxClient.include(mxClient.basePath+"/js/handler/mxHandle.js"),mxClient.include(mxClient.basePath+"/js/handler/mxVertexHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxEdgeHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxElbowEdgeHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxEdgeSegmentHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxKeyHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxTooltipHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellTracker.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellHighlight.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultKeyHandler.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultPopupMenu.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultToolbar.js"),mxClient.include(mxClient.basePath+"/js/editor/mxEditor.js"),mxClient.include(mxClient.basePath+"/js/io/mxCodecRegistry.js"),mxClient.include(mxClient.basePath+"/js/io/mxCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxObjectCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxCellCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxModelCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxRootChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxChildChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxTerminalChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGenericChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGraphCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGraphViewCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxStylesheetCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultKeyHandlerCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultToolbarCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultPopupMenuCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxEditorCodec.js")),__mxOutput.mxClient=typeof mxClient<"u"?mxClient:void 0;var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(mxLog.window==null&&document.body!=null){var t=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,e=document.createElement("table");e.setAttribute("width","100%"),e.setAttribute("height","100%");var i=document.createElement("tbody"),n=document.createElement("tr"),r=document.createElement("td");r.style.verticalAlign="top",mxLog.textarea=document.createElement("textarea"),mxLog.textarea.setAttribute("wrap","off"),mxLog.textarea.setAttribute("readOnly","true"),mxLog.textarea.style.height="100%",mxLog.textarea.style.resize="none",mxLog.textarea.value=mxLog.buffer,mxClient.IS_NS&&document.compatMode!="BackCompat"?mxLog.textarea.style.width="99%":mxLog.textarea.style.width="100%",r.appendChild(mxLog.textarea),n.appendChild(r),i.appendChild(n),n=document.createElement("tr"),mxLog.td=document.createElement("td"),mxLog.td.style.verticalAlign="top",mxLog.td.setAttribute("height","30px"),n.appendChild(mxLog.td),i.appendChild(n),e.appendChild(i),mxLog.addButton("Info",function(u){mxLog.info()}),mxLog.addButton("DOM",function(u){var p=mxUtils.getInnerHtml(document.body);mxLog.debug(p)}),mxLog.addButton("Trace",function(u){mxLog.TRACE=!mxLog.TRACE,mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")}),mxLog.addButton("Copy",function(u){try{mxUtils.copy(mxLog.textarea.value)}catch(p){mxUtils.alert(p)}}),mxLog.addButton("Show",function(u){try{mxUtils.popup(mxLog.textarea.value)}catch(p){mxUtils.alert(p)}}),mxLog.addButton("Clear",function(u){mxLog.textarea.value=""});var s=0,l=0;if(typeof window.innerWidth=="number"?(s=window.innerHeight,l=window.innerWidth):(s=document.documentElement.clientHeight||document.body.clientHeight,l=document.body.clientWidth),mxLog.window=new mxWindow(t,e,Math.max(0,l-320),Math.max(0,s-210),300,160),mxLog.window.setMaximizable(!0),mxLog.window.setScrollable(!1),mxLog.window.setResizable(!0),mxLog.window.setClosable(!0),mxLog.window.destroyOnClose=!1,(mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&document.compatMode!="BackCompat"||document.documentMode==11){var a=mxLog.window.getElement(),o=function(u,p){mxLog.textarea.style.height=Math.max(0,a.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,o),mxLog.window.addListener(mxEvent.MAXIMIZE,o),mxLog.window.addListener(mxEvent.NORMALIZE,o),mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(t,e){var i=document.createElement("button");mxUtils.write(i,t),mxEvent.addListener(i,"click",e),mxLog.td.appendChild(i)},isVisible:function(){return mxLog.window!=null?mxLog.window.isVisible():!1},show:function(){mxLog.setVisible(!0)},setVisible:function(t){mxLog.window==null&&mxLog.init(),mxLog.window!=null&&mxLog.window.setVisible(t)},enter:function(t){if(mxLog.TRACE)return mxLog.writeln("Entering "+t),new Date().getTime()},leave:function(t,e){if(mxLog.TRACE){var i=e!=0?" ("+(new Date().getTime()-e)+" ms)":"";mxLog.writeln("Leaving "+t+i)}},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var t="",e=0;e=0&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=t},writeln:function(){for(var t="",e=0;e=0:!0},getDefaultBundle:function(t,e){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(e)?t+mxResources.extension:null},getSpecialBundle:function(t,e){if(mxClient.languages==null||!this.isLanguageSupported(e)){var i=e.indexOf("-");i>0&&(e=e.substring(0,i))}return mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(e)&&e!=mxClient.defaultLanguage?t+"_"+e+mxResources.extension:null},add:function(t,e,i){if(e=e??(mxClient.language!=null?mxClient.language.toLowerCase():mxConstants.NONE),e!=mxConstants.NONE){var n=mxResources.getDefaultBundle(t,e),r=mxResources.getSpecialBundle(t,e),s=function(){if(r!=null)if(i)mxUtils.get(r,function(o){mxResources.parse(o.getText()),i()},function(){i()});else try{var a=mxUtils.load(r);a.isReady()&&mxResources.parse(a.getText())}catch{}else i!=null&&i()};if(n!=null)if(i)mxUtils.get(n,function(a){mxResources.parse(a.getText()),s()},function(){s()});else try{var l=mxUtils.load(n);l.isReady()&&mxResources.parse(l.getText()),s()}catch{}else s()}},parse:function(t){if(t!=null){for(var e=t.split(` `),i=0;i0){var r=e[i].substring(0,n),s=e[i].length;e[i].charCodeAt(s-1)==13&&s--;var l=e[i].substring(n+1,s);this.resourcesEncoded?(l=l.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[r]=unescape(l)):mxResources.resources[r]=l}}}},get:function(t,e,i){var n=mxResources.resources[t];return n==null&&(n=i),n!=null&&e!=null&&(n=mxResources.replacePlaceholders(n,e)),n},replacePlaceholders:function(t,e){for(var i=[],n=null,r=0;r=0&&n0?window.setTimeout(a,r):(t.style.visibility="hidden",i&&t.parentNode&&t.parentNode.removeChild(t))};window.setTimeout(a,r)}else t.style.visibility="hidden",i&&t.parentNode&&t.parentNode.removeChild(t)}};__mxOutput.mxEffects=typeof mxEffects<"u"?mxEffects:void 0;var mxUtils={errorResource:mxClient.language!="none"?"error":"",closeResource:mxClient.language!="none"?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(t){t.style!=null&&(t.style.cursor="");var e=t.childNodes;if(e!=null)for(var i=e.length,n=0;n=9&&document.documentMode<10&&(t="ms"),function(e,i,n){e[i]=n,t!=null&&i.length>0&&(i=t+i.substring(0,1).toUpperCase()+i.substring(1),e[i]=n)}}(),hasScrollbars:function(t){var e=mxUtils.getCurrentStyle(t);return e!=null&&(e.overflow=="scroll"||e.overflow=="auto")},bind:function(t,e){return function(){return e.apply(t,arguments)}},eval:function(expr){var result=null;if(expr.indexOf("function")>=0)try{eval("var _mxJavaScriptExpression="+expr),result=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(t){mxLog.warn(t.message+" while evaluating "+expr)}else try{result=eval(expr)}catch(t){mxLog.warn(t.message+" while evaluating "+expr)}return result},findNode:function(t,e,i){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var n=t.getAttribute(e);if(n!=null&&n==i)return t}for(t=t.firstChild;t!=null;){var r=mxUtils.findNode(t,e,i);if(r!=null)return r;t=t.nextSibling}return null},getFunctionName:function(t){var e=null;if(t!=null){if(t.name!=null)e=t.name;else if(e=mxUtils.trim(t.toString()),/^function\s/.test(e)){e=mxUtils.ltrim(e.substring(9));var i=e.indexOf("(");i>0&&(e=e.substring(0,i))}}return e},indexOf:function(t,e){if(t!=null&&e!=null){for(var i=0;i=0;)e.splice(n,1),i=t,n=mxUtils.indexOf(e,t);for(var r in e)e[r]==t&&(delete e[r],i=t);return i},isNode:function(t,e,i,n){return t!=null&&!isNaN(t.nodeType)&&(e==null||t.nodeName.toLowerCase()==e.toLowerCase())?i==null||t.getAttribute(i)==n:!1},isAncestorNode:function(t,e){for(var i=e;i!=null;){if(i==t)return!0;i=i.parentNode}return!1},getChildNodes:function(t,e){e=e||mxConstants.NODETYPE_ELEMENT;for(var i=[],n=t.firstChild;n!=null;)n.nodeType==e&&i.push(n),n=n.nextSibling;return i},importNode:function(t,e,i){return mxClient.IS_IE&&(document.documentMode==null||document.documentMode<10)?mxUtils.importNodeImplementation(t,e,i):t.importNode(e,i)},importNodeImplementation:function(t,e,i){switch(e.nodeType){case 1:{var n=t.createElement(e.nodeName);if(e.attributes&&e.attributes.length>0)for(var r=0;r0)for(var r=0;r/g,">"),(e==null||e)&&(t=t.replace(/\n/g," ")),t},isVml:function(t){return t!=null&&t.tagUrn=="urn:schemas-microsoft-com:vml"},getXml:function(t,e){var i="";if(mxClient.IS_IE||mxClient.IS_IE11)i=mxUtils.getPrettyXml(t,"","","");else if(window.XMLSerializer!=null){var n=new XMLSerializer;i=n.serializeToString(t)}else t.xml!=null&&(i=t.xml.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,` `));return e=e||" ",i=i.replace(/\n/g,e),i},getPrettyXml:function(t,e,i,n,r){var s=[];if(t!=null)if(e=e??" ",i=i??"",n=n??` @@ -19,4 +19,4 @@ var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typ `)}return r.length>0?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+` `),this.validNeighbors!=null&&this.typeError!=null&&this.validNeighbors.length>0)){var a=this.checkNeighbors(t,e,i,n);a||(l+=this.typeError+` `)}return l.length>0?l:null},mxMultiplicity.prototype.checkNeighbors=function(t,e,i,n){for(var r=t.model.getValue(i),s=t.model.getValue(n),l=!this.validNeighborsAllowed,a=this.validNeighbors,o=0;o0){var i=this.getGraph().getModel();i.beginUpdate();try{for(var n=null,r=0;r1||r.points!=null&&r.points.length>0||n.getTerminal(i,!0)==null||n.getTerminal(i,!1)==null||this.graph.allowDanglingEdges||this.graph.isCloneEvent(e.getEvent())&&this.graph.isCellsCloneable())?this.start(i,e.getX(),e.getY()):this.delayedSelection&&(this.cell=i),this.cellWasClicked=!0,this.consumeMouseEvent(mxEvent.MOUSE_DOWN,e)}}},mxGraphHandler.prototype.getGuideStates=function(){var t=this.graph.getDefaultParent(),e=this.graph.getModel(),i=mxUtils.bind(this,function(n){return this.graph.view.getState(n)!=null&&e.isVertex(n)&&e.getGeometry(n)!=null&&!e.getGeometry(n).relative});return this.graph.view.getCellStates(e.filterDescendants(i,t))},mxGraphHandler.prototype.getCells=function(t){return!this.delayedSelection&&this.graph.isCellMovable(t)?[t]:this.graph.getMovableCells(this.graph.getSelectionCells())},mxGraphHandler.prototype.getPreviewBounds=function(t){var e=this.getBoundingBox(t);if(e!=null){if(e.width=Math.max(0,e.width-1),e.height=Math.max(0,e.height-1),e.width0){for(var i=this.graph.getModel(),n=0;n=2)&&m!=(this.target||s))})}},mxGraphHandler.prototype.addStates=function(t,e){var i=this.graph.view.getState(t),n=0;if(i!=null&&e.get(t)==null){e.put(t,i),n++;for(var r=this.graph.model.getChildCount(t),s=0;s=this.cellCount&&!this.livePreviewActive&&this.allowLivePreview?(!this.cloning||!this.livePreviewActive)&&(this.livePreviewActive=!0,this.livePreviewUsed=!0):!this.livePreviewUsed&&this.shape==null&&(this.shape=this.createPreviewShape(this.bounds))},mxGraphHandler.prototype.mouseMove=function(t,e){var i=this.graph;if(!e.isConsumed()&&i.isMouseDown&&this.cell!=null&&this.first!=null&&this.bounds!=null&&!this.suspended){if(mxEvent.isMultiTouchEvent(e.getEvent())){this.reset();return}var n=this.getDelta(e),r=i.tolerance;if(this.shape!=null||this.livePreviewActive||Math.abs(n.x)>r||Math.abs(n.y)>r){this.highlight==null&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3));var s=i.isCloneEvent(e.getEvent())&&i.isCellsCloneable()&&this.isCloneEnabled(),l=i.isGridEnabledEvent(e.getEvent()),a=e.getCell(),o=!0,u=null;this.cloning=s,i.isDropEnabled()&&this.highlightEnabled&&(u=i.getDropTarget(this.cells,e.getEvent(),a,s));var p=i.getView().getState(u),m=!1;if(p!=null&&(s||this.isValidDropTarget(u,e)))this.target!=u&&(this.target=u,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),m=!0;else if(this.target=null,this.connectOnDrop&&a!=null&&this.cells.length==1&&i.getModel().isVertex(a)&&i.isCellConnectable(a)&&(p=i.getView().getState(a),p!=null)){var d=i.getEdgeValidationError(null,this.cell,a),x=d==null?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR;this.setHighlightColor(x),m=!0}p!=null&&m?this.highlight.highlight(p):this.highlight.hide(),this.guide!=null&&this.useGuidesForEvent(e)?(n=this.guide.move(this.bounds,n,l,s),o=!1):n=this.graph.snapDelta(n,this.bounds,!l,!1,!1),this.guide!=null&&o&&this.guide.hide(),i.isConstrainedEvent(e.getEvent())&&(Math.abs(n.x)>Math.abs(n.y)?n.y=0:n.x=0),this.checkPreview(),(this.currentDx!=n.x||this.currentDy!=n.y)&&(this.currentDx=n.x,this.currentDy=n.y,this.updatePreview())}this.updateHint(e),this.consumeMouseEvent(mxEvent.MOUSE_MOVE,e),mxEvent.consume(e.getEvent())}else if((this.isMoveEnabled()||this.isCloneEnabled())&&this.updateCursor&&!e.isConsumed()&&(e.getState()!=null||e.sourceState!=null)&&!i.isMouseDown){var f=i.getCursorForMouseEvent(e);f==null&&i.isEnabled()&&i.isCellMovable(e.getCell())&&(i.getModel().isEdge(e.getCell())?f=mxConstants.CURSOR_MOVABLE_EDGE:f=mxConstants.CURSOR_MOVABLE_VERTEX),f!=null&&e.sourceState!=null&&e.sourceState.setCursor(f)}},mxGraphHandler.prototype.updatePreview=function(t){this.livePreviewUsed&&!t?this.cells!=null&&(this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!1),this.updateLivePreview(this.currentDx,this.currentDy)):this.updatePreviewShape()},mxGraphHandler.prototype.updatePreviewShape=function(){this.shape!=null&&this.pBounds!=null&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx),Math.round(this.pBounds.y+this.currentDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())},mxGraphHandler.prototype.updateLivePreview=function(t,e){if(!this.suspended){var i=[];if(this.allCells!=null&&this.allCells.visit(mxUtils.bind(this,function(f,g){var c=this.graph.view.getState(g.cell);if(c!=g&&(g.destroy(),c!=null?this.allCells.put(g.cell,c):this.allCells.remove(g.cell),g=c),g!=null){var v=g.clone();i.push([g,v]),g.shape!=null&&(g.shape.originalPointerEvents==null&&(g.shape.originalPointerEvents=g.shape.pointerEvents),g.shape.pointerEvents=!1,g.text!=null&&(g.text.originalPointerEvents==null&&(g.text.originalPointerEvents=g.text.pointerEvents),g.text.pointerEvents=!1)),this.graph.model.isVertex(g.cell)&&(g.x+=t,g.y+=e,this.cloning?g.text!=null&&(g.text.updateBoundingBox(),g.text.boundingBox!=null&&(g.text.boundingBox.x+=t,g.text.boundingBox.y+=e),g.text.unrotatedBoundingBox!=null&&(g.text.unrotatedBoundingBox.x+=t,g.text.unrotatedBoundingBox.y+=e)):(g.view.graph.cellRenderer.redraw(g,!0),g.view.invalidate(g.cell),g.invalid=!1,g.control!=null&&g.control.node!=null&&(g.control.node.style.visibility="hidden")))}})),i.length==0)this.reset();else{for(var n=this.graph.view.scale,r=0;rthis.graph.tolerance||Math.abs(this.dy)>this.graph.tolerance,!i&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",e))}(this.active||this.panningTrigger)&&e.consume()},mxPanningHandler.prototype.mouseUp=function(t,e){if(this.active){if(this.dx!=null&&this.dy!=null){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){var i=this.graph.getView().scale,n=this.graph.getView().translate;this.graph.panGraph(0,0),this.panGraph(n.x+this.dx/i,n.y+this.dy/i)}e.consume()}this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",e))}this.reset()},mxPanningHandler.prototype.zoomGraph=function(t){var e=Math.round(this.initialScale*t.scale*100)/100;this.minScale!=null&&(e=Math.max(this.minScale,e)),this.maxScale!=null&&(e=Math.min(this.maxScale,e)),this.graph.view.scale!=e&&(this.graph.zoomTo(e),mxEvent.consume(t))},mxPanningHandler.prototype.reset=function(){this.panningTrigger=!1,this.mouseDownEvent=null,this.active=!1,this.dx=null,this.dy=null},mxPanningHandler.prototype.panGraph=function(t,e){this.graph.getView().setTranslate(t,e)},mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.forcePanningHandler),this.graph.removeListener(this.gestureHandler),mxEvent.removeListener(document,"mouseup",this.mouseUpListener)},__mxOutput.mxPanningHandler=typeof mxPanningHandler<"u"?mxPanningHandler:void 0;function mxPopupMenuHandler(t,e){t!=null&&(this.graph=t,this.factoryMethod=e,this.graph.addMouseListener(this),this.gestureHandler=mxUtils.bind(this,function(i,n){this.inTolerance=!1}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),this.init())}mxPopupMenuHandler.prototype=new mxPopupMenu,mxPopupMenuHandler.prototype.constructor=mxPopupMenuHandler,mxPopupMenuHandler.prototype.graph=null,mxPopupMenuHandler.prototype.selectOnPopup=!0,mxPopupMenuHandler.prototype.clearSelectionOnBackground=!0,mxPopupMenuHandler.prototype.triggerX=null,mxPopupMenuHandler.prototype.triggerY=null,mxPopupMenuHandler.prototype.screenX=null,mxPopupMenuHandler.prototype.screenY=null,mxPopupMenuHandler.prototype.init=function(){mxPopupMenu.prototype.init.apply(this),mxEvent.addGestureListeners(this.div,mxUtils.bind(this,function(t){this.graph.tooltipHandler.hide()}))},mxPopupMenuHandler.prototype.isSelectOnPopup=function(t){return this.selectOnPopup},mxPopupMenuHandler.prototype.mouseDown=function(t,e){this.isEnabled()&&!mxEvent.isMultiTouchEvent(e.getEvent())&&(this.hideMenu(),this.triggerX=e.getGraphX(),this.triggerY=e.getGraphY(),this.screenX=mxEvent.getMainEvent(e.getEvent()).screenX,this.screenY=mxEvent.getMainEvent(e.getEvent()).screenY,this.popupTrigger=this.isPopupTrigger(e),this.inTolerance=!0)},mxPopupMenuHandler.prototype.mouseMove=function(t,e){this.inTolerance&&this.screenX!=null&&this.screenY!=null&&(Math.abs(mxEvent.getMainEvent(e.getEvent()).screenX-this.screenX)>this.graph.tolerance||Math.abs(mxEvent.getMainEvent(e.getEvent()).screenY-this.screenY)>this.graph.tolerance)&&(this.inTolerance=!1)},mxPopupMenuHandler.prototype.mouseUp=function(t,e){if(this.popupTrigger&&this.inTolerance&&this.triggerX!=null&&this.triggerY!=null){var i=this.getCellForPopupEvent(e);this.graph.isEnabled()&&this.isSelectOnPopup(e)&&i!=null&&!this.graph.isCellSelected(i)?this.graph.setSelectionCell(i):this.clearSelectionOnBackground&&i==null&&this.graph.clearSelection(),this.graph.tooltipHandler.hide();var n=mxUtils.getScrollOrigin();this.popup(e.getX()+n.x+1,e.getY()+n.y+1,i,e.getEvent()),e.consume()}this.popupTrigger=!1,this.inTolerance=!1},mxPopupMenuHandler.prototype.getCellForPopupEvent=function(t){return t.getCell()},mxPopupMenuHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.gestureHandler),mxPopupMenu.prototype.destroy.apply(this)},__mxOutput.mxPopupMenuHandler=typeof mxPopupMenuHandler<"u"?mxPopupMenuHandler:void 0;function mxCellMarker(t,e,i,n){mxEventSource.call(this),t!=null&&(this.graph=t,this.validColor=e??mxConstants.DEFAULT_VALID_COLOR,this.invalidColor=i??mxConstants.DEFAULT_INVALID_COLOR,this.hotspot=n??mxConstants.DEFAULT_HOTSPOT,this.highlight=new mxCellHighlight(t))}mxUtils.extend(mxCellMarker,mxEventSource),mxCellMarker.prototype.graph=null,mxCellMarker.prototype.enabled=!0,mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT,mxCellMarker.prototype.hotspotEnabled=!1,mxCellMarker.prototype.validColor=null,mxCellMarker.prototype.invalidColor=null,mxCellMarker.prototype.currentColor=null,mxCellMarker.prototype.validState=null,mxCellMarker.prototype.markedState=null,mxCellMarker.prototype.setEnabled=function(t){this.enabled=t},mxCellMarker.prototype.isEnabled=function(){return this.enabled},mxCellMarker.prototype.setHotspot=function(t){this.hotspot=t},mxCellMarker.prototype.getHotspot=function(){return this.hotspot},mxCellMarker.prototype.setHotspotEnabled=function(t){this.hotspotEnabled=t},mxCellMarker.prototype.isHotspotEnabled=function(){return this.hotspotEnabled},mxCellMarker.prototype.hasValidState=function(){return this.validState!=null},mxCellMarker.prototype.getValidState=function(){return this.validState},mxCellMarker.prototype.getMarkedState=function(){return this.markedState},mxCellMarker.prototype.reset=function(){this.validState=null,this.markedState!=null&&(this.markedState=null,this.unmark())},mxCellMarker.prototype.process=function(t){var e=null;return this.isEnabled()&&(e=this.getState(t),this.setCurrentState(e,t)),e},mxCellMarker.prototype.setCurrentState=function(t,e,i){var n=t!=null?this.isValidState(t):!1;i=i??this.getMarkerColor(e.getEvent(),t,n),n?this.validState=t:this.validState=null,(t!=this.markedState||i!=this.currentColor)&&(this.currentColor=i,t!=null&&this.currentColor!=null?(this.markedState=t,this.mark()):this.markedState!=null&&(this.markedState=null,this.unmark()))},mxCellMarker.prototype.markCell=function(t,e){var i=this.graph.getView().getState(t);i!=null&&(this.currentColor=e??this.validColor,this.markedState=i,this.mark())},mxCellMarker.prototype.mark=function(){this.highlight.setHighlightColor(this.currentColor),this.highlight.highlight(this.markedState),this.fireEvent(new mxEventObject(mxEvent.MARK,"state",this.markedState))},mxCellMarker.prototype.unmark=function(){this.mark()},mxCellMarker.prototype.isValidState=function(t){return!0},mxCellMarker.prototype.getMarkerColor=function(t,e,i){return i?this.validColor:this.invalidColor},mxCellMarker.prototype.getState=function(t){var e=this.graph.getView(),i=this.getCell(t),n=this.getStateToMark(e.getState(i));return n!=null&&this.intersects(n,t)?n:null},mxCellMarker.prototype.getCell=function(t){return t.getCell()},mxCellMarker.prototype.getStateToMark=function(t){return t},mxCellMarker.prototype.intersects=function(t,e){return this.hotspotEnabled?mxUtils.intersectsHotspot(t,e.getGraphX(),e.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE):!0},mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),this.highlight.destroy()},__mxOutput.mxCellMarker=typeof mxCellMarker<"u"?mxCellMarker:void 0;function mxSelectionCellsHandler(t){mxEventSource.call(this),this.graph=t,this.handlers=new mxDictionary,this.graph.addMouseListener(this),this.refreshHandler=mxUtils.bind(this,function(e,i){this.isEnabled()&&this.refresh()}),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE,this.refreshHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.DOWN,this.refreshHandler),this.graph.getView().addListener(mxEvent.UP,this.refreshHandler)}mxUtils.extend(mxSelectionCellsHandler,mxEventSource),mxSelectionCellsHandler.prototype.graph=null,mxSelectionCellsHandler.prototype.enabled=!0,mxSelectionCellsHandler.prototype.refreshHandler=null,mxSelectionCellsHandler.prototype.maxHandlers=100,mxSelectionCellsHandler.prototype.handlers=null,mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled},mxSelectionCellsHandler.prototype.setEnabled=function(t){this.enabled=t},mxSelectionCellsHandler.prototype.getHandler=function(t){return this.handlers.get(t)},mxSelectionCellsHandler.prototype.isHandled=function(t){return this.getHandler(t)!=null},mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit(function(t,e){e.reset.apply(e)})},mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){return this.graph.getSelectionCells()},mxSelectionCellsHandler.prototype.refresh=function(){var t=this.handlers;this.handlers=new mxDictionary;for(var e=mxUtils.sortCells(this.getHandledSelectionCells(),!1),i=0;ithis.graph.tolerance||Math.abs(e.getGraphY()-this.first.y)>this.graph.tolerance)&&this.updateCurrentState(e,s),this.first!=null){var l=null,a=s;this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null&&this.constraintHandler.currentPoint!=null?(l=this.constraintHandler.currentConstraint,a=this.constraintHandler.currentPoint.clone()):this.previous!=null&&!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&(Math.abs(this.previous.getCenterX()-s.x)0?this.waypoints[0]:a,x=this.getSourcePerimeterPoint(this.previous,f,e);x!=null&&(o=x)}}if(this.currentState==null&&this.movePreviewAway){var x=o;if(this.edgeState!=null&&this.edgeState.absolutePoints.length>=2){var g=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2];g!=null&&(x=g)}var c=a.x-x.x,v=a.y-x.y,y=Math.sqrt(c*c+v*v);if(y==0)return;this.originalPoint=a.clone(),a.x-=c*4/y,a.y-=v*4/y}else this.originalPoint=null;if(this.shape==null){var c=Math.abs(e.getGraphX()-this.first.x),v=Math.abs(e.getGraphY()-this.first.y);(c>this.graph.tolerance||v>this.graph.tolerance)&&(this.shape=this.createShape(),this.edgeState!=null&&this.shape.apply(this.edgeState),this.updateCurrentState(e,s))}if(this.shape!=null){if(this.edgeState!=null)this.shape.points=this.edgeState.absolutePoints;else{var T=[o];this.waypoints!=null&&(T=T.concat(this.waypoints)),T.push(a),this.shape.points=T}this.drawPreview()}this.cursor!=null&&(this.graph.container.style.cursor=this.cursor),mxEvent.consume(e.getEvent()),e.consume()}else!this.isEnabled()||!this.graph.isEnabled()?this.constraintHandler.reset():this.previous!=this.currentState&&this.edgeState==null?(this.destroyIcons(),this.currentState!=null&&this.error==null&&this.constraintHandler.currentConstraint==null&&(this.icons=this.createIcons(this.currentState),this.icons==null&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),e.consume())),this.previous=this.currentState):this.previous==this.currentState&&this.currentState!=null&&this.icons==null&&!this.graph.isMouseDown&&e.consume();if(!this.graph.isMouseDown&&this.currentState!=null&&this.icons!=null){for(var C=!1,S=e.getSource(),E=0;E0?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY()),l=r(n.getPerimeterBounds(t),this.edgeState,s,!1);l!=null&&(i=l)}else i=new mxPoint(t.getCenterX(),t.getCenterY());return i},mxConnectionHandler.prototype.getSourcePerimeterPoint=function(t,e,i){var n=null,r=t.view,s=r.getPerimeterFunction(t),l=new mxPoint(t.getCenterX(),t.getCenterY());if(s!=null){var a=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),o=-a*(Math.PI/180);a!=0&&(e=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(o),Math.sin(o),l));var u=s(r.getPerimeterBounds(t),t,e,!1);u!=null&&(a!=0&&(u=mxUtils.getRotatedPoint(new mxPoint(u.x,u.y),Math.cos(-o),Math.sin(-o),l)),n=u)}else n=l;return n},mxConnectionHandler.prototype.updateIcons=function(t,e,i){},mxConnectionHandler.prototype.isStopEvent=function(t){return t.getState()!=null},mxConnectionHandler.prototype.addWaypointForEvent=function(t){var e=mxUtils.convertPoint(this.graph.container,t.getX(),t.getY()),i=Math.abs(e.x-this.first.x),n=Math.abs(e.y-this.first.y),r=this.waypoints!=null||this.mouseDownCounter>1&&(i>this.graph.tolerance||n>this.graph.tolerance);if(r){this.waypoints==null&&(this.waypoints=[]);var s=this.graph.view.scale,e=new mxPoint(this.graph.snap(t.getGraphX()/s)*s,this.graph.snap(t.getGraphY()/s)*s);this.waypoints.push(e)}},mxConnectionHandler.prototype.checkConstraints=function(t,e){return t==null||e==null||t.point==null||e.point==null||!t.point.equals(e.point)||t.dx!=e.dx||t.dy!=e.dy||t.perimeter!=e.perimeter},mxConnectionHandler.prototype.mouseUp=function(t,e){if(!e.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(e)){this.addWaypointForEvent(e),e.consume();return}var i=this.sourceConstraint,n=this.constraintHandler.currentConstraint,r=this.previous!=null?this.previous.cell:null,s=null;this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null&&(s=this.constraintHandler.currentFocus.cell),s==null&&this.currentState!=null&&(s=this.currentState.cell),this.error==null&&(r==null||s==null||r!=s||this.checkConstraints(i,n))?this.connect(r,s,e.getEvent(),e.getCell()):(this.previous!=null&&this.marker.validState!=null&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,e.getEvent()),this.error!=null&&this.error.length>0&&this.graph.validationAlert(this.error)),this.destroyIcons(),e.consume()}this.first!=null&&this.reset()},mxConnectionHandler.prototype.reset=function(){this.shape!=null&&(this.shape.destroy(),this.shape=null),this.cursor!=null&&this.graph.container!=null&&(this.graph.container.style.cursor=""),this.destroyIcons(),this.marker.reset(),this.constraintHandler.reset(),this.originalPoint=null,this.currentPoint=null,this.edgeState=null,this.previous=null,this.error=null,this.sourceConstraint=null,this.mouseDownCounter=0,this.first=null,this.fireEvent(new mxEventObject(mxEvent.RESET))},mxConnectionHandler.prototype.drawPreview=function(){this.updatePreview(this.error==null),this.shape.redraw()},mxConnectionHandler.prototype.updatePreview=function(t){this.shape.strokewidth=this.getEdgeWidth(t),this.shape.stroke=this.getEdgeColor(t)},mxConnectionHandler.prototype.getEdgeColor=function(t){return t?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR},mxConnectionHandler.prototype.getEdgeWidth=function(t){return t?3:1},mxConnectionHandler.prototype.connect=function(t,e,i,n){if(e!=null||this.isCreateTarget(i)||this.graph.allowDanglingEdges){var r=this.graph.getModel(),s=!1,l=null;r.beginUpdate();try{if(t!=null&&e==null&&!this.graph.isIgnoreTerminalEvent(i)&&this.isCreateTarget(i)&&(e=this.createTargetVertex(i,t),e!=null)){if(n=this.graph.getDropTarget([e],i,n),s=!0,n==null||!this.graph.getModel().isEdge(n)){var a=this.graph.getView().getState(n);if(a!=null){var o=r.getGeometry(e);o.x-=a.origin.x,o.y-=a.origin.y}}else n=this.graph.getDefaultParent();this.graph.addCell(e,n)}var u=this.graph.getDefaultParent();t!=null&&e!=null&&r.getParent(t)==r.getParent(e)&&r.getParent(r.getParent(t))!=r.getRoot()&&(u=r.getParent(t),t.geometry!=null&&t.geometry.relative&&e.geometry!=null&&e.geometry.relative&&(u=r.getParent(u)));var p=null,m=null;if(this.edgeState!=null&&(p=this.edgeState.cell.value,m=this.edgeState.cell.style),l=this.insertEdge(u,null,p,t,e,m),l!=null){this.graph.setConnectionConstraint(l,t,!0,this.sourceConstraint),this.graph.setConnectionConstraint(l,e,!1,this.constraintHandler.currentConstraint),this.edgeState!=null&&r.setGeometry(l,this.edgeState.cell.geometry);var u=r.getParent(t);if(this.isInsertBefore(l,t,e,i,n)){for(var d=null,o=t;o.parent!=null&&o.geometry!=null&&o.geometry.relative&&o.parent!=l.parent;)o=this.graph.model.getParent(o);o!=null&&o.parent!=null&&o.parent==l.parent&&r.add(u,l,o.parent.getIndex(o))}var x=r.getGeometry(l);if(x==null&&(x=new mxGeometry,x.relative=!0,r.setGeometry(l,x)),this.waypoints!=null&&this.waypoints.length>0){var f=this.graph.view.scale,g=this.graph.view.translate;x.points=[];for(var c=0;c0){var o=this.graph.view.getState(e);if(o!=null){var u=o.x/s-r.x,p=o.y/s-r.y;Math.abs(u-n.x)<=a&&(n.x=Math.round(u)),Math.abs(p-n.y)<=a&&(n.y=Math.round(p))}}}return i},mxConnectionHandler.prototype.getAlignmentTolerance=function(t){return this.graph.isGridEnabled()?this.graph.gridSize/2:this.graph.tolerance},mxConnectionHandler.prototype.createEdge=function(t,e,i,n){var r=null;if(this.factoryMethod!=null&&(r=this.factoryMethod(e,i,n)),r==null){r=new mxCell(t||""),r.setEdge(!0),r.setStyle(n);var s=new mxGeometry;s.relative=!0,r.setGeometry(s)}return r},mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.shape!=null&&(this.shape.destroy(),this.shape=null),this.marker!=null&&(this.marker.destroy(),this.marker=null),this.constraintHandler!=null&&(this.constraintHandler.destroy(),this.constraintHandler=null),this.changeHandler!=null&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null),this.drillHandler!=null&&(this.graph.removeListener(this.drillHandler),this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null),this.escapeHandler!=null&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null)},__mxOutput.mxConnectionHandler=typeof mxConnectionHandler<"u"?mxConnectionHandler:void 0;function mxConstraintHandler(t){this.graph=t,this.resetHandler=mxUtils.bind(this,function(e,i){this.currentFocus!=null&&this.graph.view.getState(this.currentFocus.cell)==null?this.reset():this.redraw()}),this.graph.model.addListener(mxEvent.CHANGE,this.resetHandler),this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.resetHandler),this.graph.view.addListener(mxEvent.TRANSLATE,this.resetHandler),this.graph.view.addListener(mxEvent.SCALE,this.resetHandler),this.graph.addListener(mxEvent.ROOT,this.resetHandler)}mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5),mxConstraintHandler.prototype.graph=null,mxConstraintHandler.prototype.enabled=!0,mxConstraintHandler.prototype.highlightColor=mxConstants.DEFAULT_VALID_COLOR,mxConstraintHandler.prototype.isEnabled=function(){return this.enabled},mxConstraintHandler.prototype.setEnabled=function(t){this.enabled=t},mxConstraintHandler.prototype.reset=function(){if(this.focusIcons!=null){for(var t=0;to||Math.abs(a)>o)&&(this.div==null&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(r,s),e.consume())}},mxRubberband.prototype.createShape=function(){this.sharedDiv==null&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity)),this.graph.container.appendChild(this.sharedDiv);var t=this.sharedDiv;return mxClient.IS_SVG&&(!mxClient.IS_IE||document.documentMode>=10)&&this.fadeOut&&(this.sharedDiv=null),t},mxRubberband.prototype.isActive=function(t,e){return this.div!=null&&this.div.style.display!="none"},mxRubberband.prototype.mouseUp=function(t,e){var i=this.isActive();this.reset(),i&&(this.execute(e.getEvent()),e.consume())},mxRubberband.prototype.execute=function(t){var e=new mxRectangle(this.x,this.y,this.width,this.height);this.graph.selectRegion(e,t)},mxRubberband.prototype.reset=function(){if(this.div!=null)if(mxClient.IS_SVG&&(!mxClient.IS_IE||document.documentMode>=10)&&this.fadeOut){var t=this.div;mxUtils.setPrefixedStyle(t.style,"transition","all 0.2s linear"),t.style.pointerEvents="none",t.style.opacity=0,window.setTimeout(function(){t.parentNode.removeChild(t)},200)}else this.div.parentNode.removeChild(this.div);mxEvent.removeGestureListeners(document,null,this.dragHandler,this.dropHandler),this.dragHandler=null,this.dropHandler=null,this.currentX=0,this.currentY=0,this.first=null,this.div=null},mxRubberband.prototype.update=function(t,e){this.currentX=t,this.currentY=e,this.repaint()},mxRubberband.prototype.repaint=function(){if(this.div!=null){var t=this.currentX-this.graph.panDx,e=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,t),this.y=Math.min(this.first.y,e),this.width=Math.max(this.first.x,t)-this.x,this.height=Math.max(this.first.y,e)-this.y;var i=mxClient.IS_VML?this.graph.panDx:0,n=mxClient.IS_VML?this.graph.panDy:0;this.div.style.left=this.x+i+"px",this.div.style.top=this.y+n+"px",this.div.style.width=Math.max(1,this.width)+"px",this.div.style.height=Math.max(1,this.height)+"px"}},mxRubberband.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.forceRubberbandHandler),this.graph.removeListener(this.panHandler),this.reset(),this.sharedDiv!=null&&(this.sharedDiv=null))},__mxOutput.mxRubberband=typeof mxRubberband<"u"?mxRubberband:void 0;function mxHandle(t,e,i,n){this.graph=t.view.graph,this.state=t,this.cursor=e??this.cursor,this.image=i??this.image,this.shape=n??null,this.init()}mxHandle.prototype.cursor="default",mxHandle.prototype.image=null,mxHandle.prototype.ignoreGrid=!1,mxHandle.prototype.getPosition=function(t){},mxHandle.prototype.setPosition=function(t,e,i){},mxHandle.prototype.execute=function(t){},mxHandle.prototype.copyStyle=function(t){this.graph.setCellStyles(t,this.state.style[t],[this.state.cell])},mxHandle.prototype.processEvent=function(t){var e=this.graph.view.scale,i=this.graph.view.translate,n=new mxPoint(t.getGraphX()/e-i.x,t.getGraphY()/e-i.y);this.shape!=null&&this.shape.bounds!=null&&(n.x-=this.shape.bounds.width/e/4,n.y-=this.shape.bounds.height/e/4);var r=-mxUtils.toRadians(this.getRotation()),s=-mxUtils.toRadians(this.getTotalRotation())-r;n=this.flipPoint(this.rotatePoint(this.snapPoint(this.rotatePoint(n,r),this.ignoreGrid||!this.graph.isGridEnabledEvent(t.getEvent())),s)),this.setPosition(this.state.getPaintBounds(),n,t),this.redraw()},mxHandle.prototype.positionChanged=function(){this.state.text!=null&&this.state.text.apply(this.state),this.state.shape!=null&&this.state.shape.apply(this.state),this.graph.cellRenderer.redraw(this.state,!0)},mxHandle.prototype.getRotation=function(){return this.state.shape!=null?this.state.shape.getRotation():0},mxHandle.prototype.getTotalRotation=function(){return this.state.shape!=null?this.state.shape.getShapeRotation():0},mxHandle.prototype.init=function(){var t=this.isHtmlRequired();this.image!=null?(this.shape=new mxImageShape(new mxRectangle(0,0,this.image.width,this.image.height),this.image.src),this.shape.preserveImageAspect=!1):this.shape==null&&(this.shape=this.createShape(t)),this.initShape(t)},mxHandle.prototype.createShape=function(t){var e=new mxRectangle(0,0,mxConstants.HANDLE_SIZE,mxConstants.HANDLE_SIZE);return new mxRectangleShape(e,mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxHandle.prototype.initShape=function(t){t&&this.shape.isHtmlAllowed()?(this.shape.dialect=mxConstants.DIALECT_STRICTHTML,this.shape.init(this.graph.container)):(this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,this.cursor!=null&&this.shape.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(this.shape.node,this.graph,this.state),this.shape.node.style.cursor=this.cursor},mxHandle.prototype.redraw=function(){if(this.shape!=null&&this.state.shape!=null){var t=this.getPosition(this.state.getPaintBounds());if(t!=null){var e=mxUtils.toRadians(this.getTotalRotation());t=this.rotatePoint(this.flipPoint(t),e);var i=this.graph.view.scale,n=this.graph.view.translate;this.shape.bounds.x=Math.floor((t.x+n.x)*i-this.shape.bounds.width/2),this.shape.bounds.y=Math.floor((t.y+n.y)*i-this.shape.bounds.height/2),this.shape.redraw()}}},mxHandle.prototype.isHtmlRequired=function(){return this.state.text!=null&&this.state.text.node.parentNode==this.graph.container},mxHandle.prototype.rotatePoint=function(t,e){var i=this.state.getCellBounds(),n=new mxPoint(i.getCenterX(),i.getCenterY()),r=Math.cos(e),s=Math.sin(e);return mxUtils.getRotatedPoint(t,r,s,n)},mxHandle.prototype.flipPoint=function(t){if(this.state.shape!=null){var e=this.state.getCellBounds();this.state.shape.flipH&&(t.x=2*e.x+e.width-t.x),this.state.shape.flipV&&(t.y=2*e.y+e.height-t.y)}return t},mxHandle.prototype.snapPoint=function(t,e){return e||(t.x=this.graph.snap(t.x),t.y=this.graph.snap(t.y)),t},mxHandle.prototype.setVisible=function(t){this.shape!=null&&this.shape.node!=null&&(this.shape.node.style.display=t?"":"none")},mxHandle.prototype.reset=function(){this.setVisible(!0),this.state.style=this.graph.getCellStyle(this.state.cell),this.positionChanged()},mxHandle.prototype.destroy=function(){this.shape!=null&&(this.shape.destroy(),this.shape=null)},__mxOutput.mxHandle=typeof mxHandle<"u"?mxHandle:void 0;function mxVertexHandler(t){t!=null&&(this.state=t,this.init(),this.escapeHandler=mxUtils.bind(this,function(e,i){this.livePreview&&this.index!=null&&(this.state.view.graph.cellRenderer.redraw(this.state,!0),this.state.view.invalidate(this.state.cell),this.state.invalid=!1,this.state.view.validate()),this.reset()}),this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}mxVertexHandler.prototype.graph=null,mxVertexHandler.prototype.state=null,mxVertexHandler.prototype.singleSizer=!1,mxVertexHandler.prototype.index=null,mxVertexHandler.prototype.allowHandleBoundsCheck=!0,mxVertexHandler.prototype.handleImage=null,mxVertexHandler.prototype.handlesVisible=!0,mxVertexHandler.prototype.tolerance=0,mxVertexHandler.prototype.rotationEnabled=!1,mxVertexHandler.prototype.parentHighlightEnabled=!1,mxVertexHandler.prototype.rotationRaster=!0,mxVertexHandler.prototype.rotationCursor="crosshair",mxVertexHandler.prototype.livePreview=!1,mxVertexHandler.prototype.movePreviewToFront=!1,mxVertexHandler.prototype.manageSizers=!1,mxVertexHandler.prototype.constrainGroupByChildren=!1,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxVertexHandler.prototype.horizontalOffset=0,mxVertexHandler.prototype.verticalOffset=0,mxVertexHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.selectionBorder=this.createSelectionShape(this.bounds),this.selectionBorder.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.pointerEvents=!1,this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.selectionBorder.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state),this.graph.isCellMovable(this.state.cell)&&this.selectionBorder.setCursor(mxConstants.CURSOR_MOVABLE_VERTEX),mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()=2&&this.state.height>=2){var e=0;t&&(this.singleSizer||(this.sizers.push(this.createSizer("nw-resize",e++)),this.sizers.push(this.createSizer("n-resize",e++)),this.sizers.push(this.createSizer("ne-resize",e++)),this.sizers.push(this.createSizer("w-resize",e++)),this.sizers.push(this.createSizer("e-resize",e++)),this.sizers.push(this.createSizer("sw-resize",e++)),this.sizers.push(this.createSizer("s-resize",e++))),this.sizers.push(this.createSizer("se-resize",e++)));var i=this.graph.model.getGeometry(this.state.cell);i!=null&&!i.relative&&!this.graph.isSwimlane(this.state.cell)&&this.graph.isLabelMovable(this.state.cell)&&(this.labelShape=this.createSizer(mxConstants.CURSOR_LABEL_HANDLE,mxEvent.LABEL_HANDLE,mxConstants.LABEL_HANDLE_SIZE,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}else this.graph.isCellMovable(this.state.cell)&&!this.graph.isCellResizable(this.state.cell)&&this.state.width<2&&this.state.height<2&&(this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX,mxEvent.LABEL_HANDLE,null,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}this.isRotationHandleVisible()&&(this.rotationShape=this.createSizer(this.rotationCursor,mxEvent.ROTATION_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),this.sizers.push(this.rotationShape)),this.customHandles=this.createCustomHandles(),this.redraw(),this.constrainGroupByChildren&&this.updateMinBounds()},mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()0&&(this.minBounds=this.graph.view.getBounds(t),this.minBounds!=null)){var e=this.state.view.scale,i=this.state.view.translate;this.minBounds.x-=this.state.x,this.minBounds.y-=this.state.y,this.minBounds.x/=e,this.minBounds.y/=e,this.minBounds.width/=e,this.minBounds.height/=e,this.x0=this.state.x/e-i.x,this.y0=this.state.y/e-i.y}},mxVertexHandler.prototype.getSelectionBounds=function(t){return new mxRectangle(Math.round(t.x),Math.round(t.y),Math.round(t.width),Math.round(t.height))},mxVertexHandler.prototype.createParentHighlightShape=function(t){return this.createSelectionShape(t)},mxVertexHandler.prototype.createSelectionShape=function(t){var e=new mxRectangleShape(mxRectangle.fromRectangle(t),null,this.getSelectionColor());return e.strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxVertexHandler.prototype.getSelectionColor=function(){return mxConstants.VERTEX_SELECTION_COLOR},mxVertexHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.VERTEX_SELECTION_STROKEWIDTH},mxVertexHandler.prototype.isSelectionDashed=function(){return mxConstants.VERTEX_SELECTION_DASHED},mxVertexHandler.prototype.createSizer=function(t,e,i,n){i=i||mxConstants.HANDLE_SIZE;var r=new mxRectangle(0,0,i,i),s=this.createSizerShape(r,e,n);return s.isHtmlAllowed()&&this.state.text!=null&&this.state.text.node.parentNode==this.graph.container?(s.bounds.height-=1,s.bounds.width-=1,s.dialect=mxConstants.DIALECT_STRICTHTML,s.init(this.graph.container)):(s.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,s.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(s.node,this.graph,this.state),this.graph.isEnabled()&&s.setCursor(t),this.isSizerVisible(e)||(s.visible=!1),s},mxVertexHandler.prototype.isSizerVisible=function(t){return!0},mxVertexHandler.prototype.createSizerShape=function(t,e,i){if(this.handleImage!=null){t=new mxRectangle(t.x,t.y,this.handleImage.width,this.handleImage.height);var n=new mxImageShape(t,this.handleImage.src);return n.preserveImageAspect=!1,n}else return e==mxEvent.ROTATION_HANDLE?new mxEllipse(t,i||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR):new mxRectangleShape(t,i||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxVertexHandler.prototype.moveSizerTo=function(t,e,i){t!=null&&(t.bounds.x=Math.floor(e-t.bounds.width/2),t.bounds.y=Math.floor(i-t.bounds.height/2),t.node!=null&&t.node.style.display!="none"&&t.redraw())},mxVertexHandler.prototype.getHandleForEvent=function(t){var e=mxEvent.isMouseEvent(t.getEvent())?1:this.tolerance,i=this.allowHandleBoundsCheck&&(mxClient.IS_IE||e>0)?new mxRectangle(t.getGraphX()-e,t.getGraphY()-e,2*e,2*e):null,n=mxUtils.bind(this,function(s){var l=s!=null&&s.constructor!=mxImageShape&&this.allowHandleBoundsCheck?s.strokewidth+s.svgStrokeTolerance:null,a=l!=null?new mxRectangle(t.getGraphX()-Math.floor(l/2),t.getGraphY()-Math.floor(l/2),l,l):i;return s!=null&&(t.isSource(s)||a!=null&&mxUtils.intersects(s.bounds,a)&&s.node.style.display!="none"&&s.node.style.visibility!="hidden")});if(n(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(n(this.labelShape))return mxEvent.LABEL_HANDLE;if(this.sizers!=null){for(var r=0;r=0;r--)if(n(this.customHandles[r].shape))return mxEvent.CUSTOM_HANDLE-r}return null},mxVertexHandler.prototype.isCustomHandleEvent=function(t){return!0},mxVertexHandler.prototype.mouseDown=function(t,e){if(!e.isConsumed()&&this.graph.isEnabled()){var i=this.getHandleForEvent(e);i!=null&&(this.start(e.getGraphX(),e.getGraphY(),i),e.consume())}},mxVertexHandler.prototype.isLivePreviewBorder=function(){return this.state.shape!=null&&this.state.shape.fill==null&&this.state.shape.stroke==null},mxVertexHandler.prototype.start=function(t,e,i){if(this.selectionBorder!=null)if(this.livePreviewActive=this.livePreview&&this.graph.model.getChildCount(this.state.cell)==0,this.inTolerance=!0,this.childOffsetX=0,this.childOffsetY=0,this.index=i,this.startX=t,this.startY=e,this.index<=mxEvent.CUSTOM_HANDLE&&this.isGhostPreview())this.ghostPreview=this.createGhostPreview();else{var n=this.state.view.graph.model,r=n.getParent(this.state.cell);if(this.state.view.currentRoot!=r&&(n.isVertex(r)||n.isEdge(r))&&(this.parentState=this.state.view.graph.view.getState(r)),this.selectionBorder.node.style.display=i==mxEvent.ROTATION_HANDLE?"inline":"none",(!this.livePreviewActive||this.isLivePreviewBorder())&&(this.preview=this.createSelectionShape(this.bounds),!(mxClient.IS_SVG&&Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")!=0)&&this.state.text!=null&&this.state.text.node.parentNode==this.graph.container?(this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(this.graph.container)):(this.preview.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.preview.init(this.graph.view.getOverlayPane()))),i==mxEvent.ROTATION_HANDLE){var s=this.getRotationHandlePosition(),l=s.x-this.state.getCenterX(),a=s.y-this.state.getCenterY();this.startAngle=l!=0?Math.atan(a/l)*180/Math.PI+90:0,this.startDist=Math.sqrt(l*l+a*a)}if(this.livePreviewActive){this.hideSizers(),i==mxEvent.ROTATION_HANDLE?this.rotationShape.node.style.display="":i==mxEvent.LABEL_HANDLE?this.labelShape.node.style.display="":this.sizers!=null&&this.sizers[i]!=null?this.sizers[i].node.style.display="":i<=mxEvent.CUSTOM_HANDLE&&this.customHandles!=null&&this.customHandles[mxEvent.CUSTOM_HANDLE-i].setVisible(!0);var o=this.graph.getEdges(this.state.cell);this.edgeHandlers=[];for(var u=0;uthis.graph.tolerance||Math.abs(t.getGraphY()-this.startY)>this.graph.tolerance)&&(this.inTolerance=!1)},mxVertexHandler.prototype.updateHint=function(t){},mxVertexHandler.prototype.removeHint=function(){},mxVertexHandler.prototype.roundAngle=function(t){return Math.round(t*10)/10},mxVertexHandler.prototype.roundLength=function(t){return Math.round(t*100)/100},mxVertexHandler.prototype.mouseMove=function(t,e){!e.isConsumed()&&this.index!=null?(this.checkTolerance(e),this.inTolerance||(this.index<=mxEvent.CUSTOM_HANDLE?this.customHandles!=null&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].active=!0,this.ghostPreview!=null?(this.ghostPreview.apply(this.state),this.ghostPreview.strokewidth=this.getSelectionStrokeWidth()/this.ghostPreview.scale/this.ghostPreview.scale,this.ghostPreview.isDashed=this.isSelectionDashed(),this.ghostPreview.stroke=this.getSelectionColor(),this.ghostPreview.redraw(),this.selectionBounds!=null&&(this.selectionBorder.node.style.display="none")):(this.movePreviewToFront&&this.moveToFront(),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged())):this.index==mxEvent.LABEL_HANDLE?this.moveLabel(e):(this.index==mxEvent.ROTATION_HANDLE?this.rotateVertex(e):this.resizeVertex(e),this.updateHint(e))),e.consume()):!this.graph.isMouseDown&&this.getHandleForEvent(e)!=null&&e.consume(!1)},mxVertexHandler.prototype.isGhostPreview=function(){return this.state.view.graph.model.getChildCount(this.state.cell)>0},mxVertexHandler.prototype.moveLabel=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY()),i=this.graph.view.translate,n=this.graph.view.scale;this.graph.isGridEnabledEvent(t.getEvent())&&(e.x=(this.graph.snap(e.x/n-i.x)+i.x)*n,e.y=(this.graph.snap(e.y/n-i.y)+i.y)*n);var r=this.rotationShape!=null?this.sizers.length-2:this.sizers.length-1;this.moveSizerTo(this.sizers[r],e.x,e.y)},mxVertexHandler.prototype.rotateVertex=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY()),i=this.state.x+this.state.width/2-e.x,n=this.state.y+this.state.height/2-e.y;if(this.currentAlpha=i!=0?Math.atan(n/i)*180/Math.PI+90:n<0?180:0,i>0&&(this.currentAlpha-=180),this.currentAlpha-=this.startAngle,this.rotationRaster&&this.graph.isGridEnabledEvent(t.getEvent())){var i=e.x-this.state.getCenterX(),n=e.y-this.state.getCenterY(),r=Math.sqrt(i*i+n*n);r-this.startDist<2?raster=15:r-this.startDist<25?raster=5:raster=1,this.currentAlpha=Math.round(this.currentAlpha/raster)*raster}else this.currentAlpha=this.roundAngle(this.currentAlpha);this.selectionBorder.rotation=this.currentAlpha,this.selectionBorder.redraw(),this.livePreviewActive&&this.redrawHandles()},mxVertexHandler.prototype.resizeVertex=function(t){var e=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),i=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),n=new mxPoint(t.getGraphX(),t.getGraphY()),r=this.graph.view.translate,s=this.graph.view.scale,l=Math.cos(-i),a=Math.sin(-i),c=n.x-this.startX,v=n.y-this.startY,o=l*c-a*v,u=a*c+l*v;c=o,v=u;var p=this.graph.getCellGeometry(this.state.cell);if(this.unscaledBounds=this.union(p,c/s,v/s,this.index,this.graph.isGridEnabledEvent(t.getEvent()),1,new mxPoint(0,0),this.isConstrainedEvent(t),this.isCenteredEvent(this.state,t)),!p.relative){var m=this.graph.getMaximumGraphBounds();if(m!=null&&this.parentState!=null&&(m=mxRectangle.fromRectangle(m),m.x-=(this.parentState.x-r.x*s)/s,m.y-=(this.parentState.y-r.y*s)/s),this.graph.isConstrainChild(this.state.cell)){var d=this.graph.getCellContainmentArea(this.state.cell);if(d!=null){var x=this.graph.getOverlap(this.state.cell);x>0&&(d=mxRectangle.fromRectangle(d),d.x-=d.width*x,d.y-=d.height*x,d.width+=2*d.width*x,d.height+=2*d.height*x),m==null?m=d:(m=mxRectangle.fromRectangle(m),m.intersect(d))}}m!=null&&(this.unscaledBounds.xm.x+m.width&&(this.unscaledBounds.width-=this.unscaledBounds.x+this.unscaledBounds.width-m.x-m.width),this.unscaledBounds.y+this.unscaledBounds.height>m.y+m.height&&(this.unscaledBounds.height-=this.unscaledBounds.y+this.unscaledBounds.height-m.y-m.height))}var f=this.bounds;this.bounds=new mxRectangle((this.parentState!=null?this.parentState.x:r.x*s)+this.unscaledBounds.x*s,(this.parentState!=null?this.parentState.y:r.y*s)+this.unscaledBounds.y*s,this.unscaledBounds.width*s,this.unscaledBounds.height*s),p.relative&&this.parentState!=null&&(this.bounds.x+=this.state.x-this.parentState.x,this.bounds.y+=this.state.y-this.parentState.y),l=Math.cos(i),a=Math.sin(i);var g=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY()),c=g.x-e.x,v=g.y-e.y,y=l*c-a*v,T=a*c+l*v,C=y-c,S=T-v,E=this.bounds.x-this.state.x,L=this.bounds.y-this.state.y,A=l*E-a*L,M=a*E+l*L;this.bounds.x+=C,this.bounds.y+=S,this.unscaledBounds.x=this.roundLength(this.unscaledBounds.x+C/s),this.unscaledBounds.y=this.roundLength(this.unscaledBounds.y+S/s),this.unscaledBounds.width=this.roundLength(this.unscaledBounds.width),this.unscaledBounds.height=this.roundLength(this.unscaledBounds.height),!this.graph.isCellCollapsed(this.state.cell)&&(C!=0||S!=0)?(this.childOffsetX=this.state.x-this.bounds.x+A,this.childOffsetY=this.state.y-this.bounds.y+M):(this.childOffsetX=0,this.childOffsetY=0),f.equals(this.bounds)||(this.livePreviewActive&&this.updateLivePreview(t),this.preview!=null?this.drawPreview():this.updateParentHighlight())},mxVertexHandler.prototype.updateLivePreview=function(t){var e=this.graph.view.scale,i=this.graph.view.translate,n=this.state.clone();this.state.x=this.bounds.x,this.state.y=this.bounds.y,this.state.origin=new mxPoint(this.state.x/e-i.x,this.state.y/e-i.y),this.state.width=this.bounds.width,this.state.height=this.bounds.height;var r=this.state.absoluteOffset;r=new mxPoint(r.x,r.y),this.state.absoluteOffset.x=0,this.state.absoluteOffset.y=0;var s=this.graph.getCellGeometry(this.state.cell);if(s!=null){var l=s.offset||this.EMPTY_POINT;l!=null&&!s.relative&&(this.state.absoluteOffset.x=this.state.view.scale*l.x,this.state.absoluteOffset.y=this.state.view.scale*l.y),this.state.view.updateVertexLabelOffset(this.state)}this.state.view.graph.cellRenderer.redraw(this.state,!0),this.state.view.invalidate(this.state.cell),this.state.invalid=!1,this.state.view.validate(),this.redrawHandles(),this.movePreviewToFront&&this.moveToFront(),this.state.control!=null&&this.state.control.node!=null&&(this.state.control.node.style.visibility="hidden"),this.state.setState(n)},mxVertexHandler.prototype.moveToFront=function(){(this.state.text!=null&&this.state.text.node!=null&&this.state.text.node.nextSibling!=null||this.state.shape!=null&&this.state.shape.node!=null&&this.state.shape.node.nextSibling!=null&&(this.state.text==null||this.state.shape.node.nextSibling!=this.state.text.node))&&(this.state.shape!=null&&this.state.shape.node!=null&&this.state.shape.node.parentNode.appendChild(this.state.shape.node),this.state.text!=null&&this.state.text.node!=null&&this.state.text.node.parentNode.appendChild(this.state.text.node))},mxVertexHandler.prototype.mouseUp=function(t,e){if(this.index!=null&&this.state!=null){var i=new mxPoint(e.getGraphX(),e.getGraphY()),n=this.index;this.index=null,this.ghostPreview==null&&(this.state.view.invalidate(this.state.cell,!1,!1),this.state.view.validate()),this.graph.getModel().beginUpdate();try{if(n<=mxEvent.CUSTOM_HANDLE){if(this.customHandles!=null){var r=this.state.view.graph.getCellStyle(this.state.cell);this.customHandles[mxEvent.CUSTOM_HANDLE-n].active=!1,this.customHandles[mxEvent.CUSTOM_HANDLE-n].execute(e),this.customHandles!=null&&this.customHandles[mxEvent.CUSTOM_HANDLE-n]!=null&&(this.state.style=r,this.customHandles[mxEvent.CUSTOM_HANDLE-n].positionChanged())}}else if(n==mxEvent.ROTATION_HANDLE)if(this.currentAlpha!=null){var s=this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0);s!=0&&this.rotateCell(this.state.cell,s)}else this.rotateClick();else{var l=this.graph.isGridEnabledEvent(e.getEvent()),a=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),o=Math.cos(-a),u=Math.sin(-a),p=i.x-this.startX,m=i.y-this.startY,d=o*p-u*m,x=u*p+o*m;p=d,m=x;var f=this.graph.view.scale,g=this.isRecursiveResize(this.state,e);this.resizeCell(this.state.cell,this.roundLength(p/f),this.roundLength(m/f),n,l,this.isConstrainedEvent(e),g)}}finally{this.graph.getModel().endUpdate()}e.consume(),this.reset(),this.redrawHandles()}},mxVertexHandler.prototype.isRecursiveResize=function(t,e){return this.graph.isRecursiveResize(this.state)},mxVertexHandler.prototype.rotateClick=function(){},mxVertexHandler.prototype.rotateCell=function(t,e,i){if(e!=0){var n=this.graph.getModel();if(n.isVertex(t)||n.isEdge(t)){if(!n.isEdge(t)){var r=this.graph.getCurrentCellStyle(t),s=(r[mxConstants.STYLE_ROTATION]||0)+e;this.graph.setCellStyles(mxConstants.STYLE_ROTATION,s,[t])}var l=this.graph.getCellGeometry(t);if(l!=null){var a=this.graph.getCellGeometry(i);if(a!=null&&!n.isEdge(i)&&(l=l.clone(),l.rotate(e,new mxPoint(a.width/2,a.height/2)),n.setGeometry(t,l)),n.isVertex(t)&&!l.relative||n.isEdge(t))for(var o=n.getChildCount(t),u=0;u4?(v=v+i,r?v=this.graph.snap(v/s)*s:v=Math.round(v/s)*s):n<3&&(c=c+i,r?c=this.graph.snap(c/s)*s:c=Math.round(c/s)*s),n==0||n==3||n==5?(f+=e,r?f=this.graph.snap(f/s)*s:f=Math.round(f/s)*s):(n==2||n==4||n==7)&&(g+=e,r?g=this.graph.snap(g/s)*s:g=Math.round(g/s)*s);var C=g-f,S=v-c;if(a){var E=this.graph.getCellGeometry(this.state.cell);if(E!=null){var L=E.width/E.height;n==1||n==2||n==7||n==6?C=S*L:S=C/L,n==0&&(f=g-C,c=v-S)}}if(o){C+=C-d,S+=S-x;var A=y-(f+C/2),M=T-(c+S/2);f+=A,c+=M,g+=A,v+=M}C<0&&(f+=C,C=Math.abs(C)),S<0&&(c+=S,S=Math.abs(S));var I=new mxRectangle(f+l.x*s,c+l.y*s,C,S);return this.minBounds!=null&&(I.width=Math.max(I.width,this.minBounds.x*s+this.minBounds.width*s+Math.max(0,this.x0*s-I.x)),I.height=Math.max(I.height,this.minBounds.y*s+this.minBounds.height*s+Math.max(0,this.y0*s-I.y))),I}},mxVertexHandler.prototype.redraw=function(t){this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.drawPreview(),t||this.redrawHandles()},mxVertexHandler.prototype.getHandlePadding=function(){var t=new mxPoint(0,0),e=this.tolerance;return this.sizers!=null&&this.sizers.length>0&&this.sizers[0]!=null&&(this.bounds.width<2*this.sizers[0].bounds.width+2*e||this.bounds.height<2*this.sizers[0].bounds.height+2*e)&&(e/=2,t.x=this.sizers[0].bounds.width+e,t.y=this.sizers[0].bounds.height+e),t},mxVertexHandler.prototype.getSizerBounds=function(){return this.bounds},mxVertexHandler.prototype.redrawHandles=function(){var t=this.getSizerBounds(),e=this.tolerance;if(this.horizontalOffset=0,this.verticalOffset=0,this.customHandles!=null)for(var i=0;i0&&this.sizers[0]!=null){if(this.index==null&&this.manageSizers&&this.sizers.length>=8){var r=this.getHandlePadding();this.horizontalOffset=r.x,this.verticalOffset=r.y,(this.horizontalOffset!=0||this.verticalOffset!=0)&&(t=new mxRectangle(t.x,t.y,t.width,t.height),t.x-=this.horizontalOffset/2,t.width+=this.horizontalOffset,t.y-=this.verticalOffset/2,t.height+=this.verticalOffset),this.sizers.length>=8&&(t.width<2*this.sizers[0].bounds.width+2*e||t.height<2*this.sizers[0].bounds.height+2*e?(this.sizers[0].node.style.display="none",this.sizers[2].node.style.display="none",this.sizers[5].node.style.display="none",this.sizers[7].node.style.display="none"):this.handlesVisible&&(this.sizers[0].node.style.display="",this.sizers[2].node.style.display="",this.sizers[5].node.style.display="",this.sizers[7].node.style.display=""))}var s=t.x+t.width,l=t.y+t.height;if(this.singleSizer)this.moveSizerTo(this.sizers[0],s,l);else{var a=t.x+t.width/2,o=t.y+t.height/2;if(this.sizers.length>=8){var u=["nw-resize","n-resize","ne-resize","e-resize","se-resize","s-resize","sw-resize","w-resize"],p=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),m=Math.cos(p),d=Math.sin(p),x=Math.round(p*4/Math.PI),f=new mxPoint(t.getCenterX(),t.getCenterY()),g=mxUtils.getRotatedPoint(new mxPoint(t.x,t.y),m,d,f);this.moveSizerTo(this.sizers[0],g.x,g.y),this.sizers[0].setCursor(u[mxUtils.mod(0+x,u.length)]),g.x=a,g.y=t.y,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[1],g.x,g.y),this.sizers[1].setCursor(u[mxUtils.mod(1+x,u.length)]),g.x=s,g.y=t.y,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[2],g.x,g.y),this.sizers[2].setCursor(u[mxUtils.mod(2+x,u.length)]),g.x=t.x,g.y=o,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[3],g.x,g.y),this.sizers[3].setCursor(u[mxUtils.mod(7+x,u.length)]),g.x=s,g.y=o,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[4],g.x,g.y),this.sizers[4].setCursor(u[mxUtils.mod(3+x,u.length)]),g.x=t.x,g.y=l,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[5],g.x,g.y),this.sizers[5].setCursor(u[mxUtils.mod(6+x,u.length)]),g.x=a,g.y=l,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[6],g.x,g.y),this.sizers[6].setCursor(u[mxUtils.mod(5+x,u.length)]),g.x=s,g.y=l,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[7],g.x,g.y),this.sizers[7].setCursor(u[mxUtils.mod(4+x,u.length)]),g.x=a+this.state.absoluteOffset.x,g.y=o+this.state.absoluteOffset.y,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[8],g.x,g.y)}else this.state.width>=2&&this.state.height>=2?this.moveSizerTo(this.sizers[0],a+this.state.absoluteOffset.x,o+this.state.absoluteOffset.y):this.moveSizerTo(this.sizers[0],this.state.x,this.state.y)}}if(this.rotationShape!=null){var p=mxUtils.toRadians(this.currentAlpha!=null?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),m=Math.cos(p),d=Math.sin(p),f=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),g=mxUtils.getRotatedPoint(this.getRotationHandlePosition(),m,d,f);this.rotationShape.node!=null&&(this.moveSizerTo(this.rotationShape,g.x,g.y),this.rotationShape.node.style.visibility=this.state.view.graph.isEditing()||!this.handlesVisible?"hidden":"")}if(this.selectionBorder!=null&&(this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")),this.edgeHandlers!=null)for(var i=0;i0)?new mxRectangle(t.getGraphX()-i,t.getGraphY()-i,2*i,2*i):null,r=null;if(this.customHandles!=null&&this.isCustomHandleEvent(t)){for(var s=this.customHandles.length-1;s>=0;s--)if(l(this.customHandles[s].shape))return mxEvent.CUSTOM_HANDLE-s}if((t.isSource(this.state.text)||l(this.labelShape))&&(e=mxEvent.LABEL_HANDLE),this.bends!=null)for(var s=0;smxEvent.VIRTUAL_HANDLE&&this.customHandles!=null)for(var s=0;s0&&this.isSnapToTerminalsEvent(t)){let u=function(m){if(m!=null){var d=m.x;Math.abs(n.x-d)0&&fmxEvent.VIRTUAL_HANDLE&&(n[this.index-1]=r)}else this.graph.resetEdgesOnConnect&&(n=null);return s??n},mxEdgeHandler.prototype.isOutlineConnectEvent=function(t){var e=mxUtils.getOffset(this.graph.container),i=t.getEvent(),n=mxEvent.getClientX(i),r=mxEvent.getClientY(i),s=document.documentElement,l=(window.pageXOffset||s.scrollLeft)-(s.clientLeft||0),a=(window.pageYOffset||s.scrollTop)-(s.clientTop||0),o=this.currentPoint.x-this.graph.container.scrollLeft+e.x-l,u=this.currentPoint.y-this.graph.container.scrollTop+e.y-a;return this.outlineConnect&&!mxEvent.isShiftDown(t.getEvent())&&(t.isSource(this.marker.highlight.shape)||mxEvent.isAltDown(t.getEvent())&&t.getState()!=null||this.marker.highlight.isHighlightAt(n,r)||(o!=n||u!=r)&&t.getState()==null&&this.marker.highlight.isHighlightAt(o,u))},mxEdgeHandler.prototype.updatePreviewState=function(t,e,i,n,r){var s=this.isSource?i:this.state.getVisibleTerminalState(!0),l=this.isTarget?i:this.state.getVisibleTerminalState(!1),a=this.graph.getConnectionConstraint(t,s,!0),o=this.graph.getConnectionConstraint(t,l,!1),u=this.constraintHandler.currentConstraint;if(u==null&&r&&(i!=null?(n.isSource(this.marker.highlight.shape)&&(e=new mxPoint(n.getGraphX(),n.getGraphY())),u=this.graph.getOutlineConstraint(e,i,n),this.constraintHandler.setFocus(n,i,this.isSource),this.constraintHandler.currentConstraint=u,this.constraintHandler.currentPoint=e):u=new mxConnectionConstraint),this.outlineConnect&&this.marker.highlight!=null&&this.marker.highlight.shape!=null){var p=this.graph.view.scale;this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null?(this.marker.highlight.shape.stroke=r?mxConstants.OUTLINE_HIGHLIGHT_COLOR:"transparent",this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/p/p,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.marker.highlight.shape.stroke=this.graph.isCellConnectable(n.getCell())&&this.marker.getValidState()!=n.getState()?"transparent":mxConstants.DEFAULT_VALID_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/p/p,this.marker.highlight.repaint())}this.isSource?a=u:this.isTarget&&(o=u),(this.isSource||this.isTarget)&&(u!=null&&u.point!=null?(t.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X]=u.point.x,t.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]=u.point.y):(delete t.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X],delete t.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y])),t.setVisibleTerminalState(s,!0),t.setVisibleTerminalState(l,!1),(!this.isSource||s!=null)&&t.view.updateFixedTerminalPoint(t,s,!0,a),(!this.isTarget||l!=null)&&t.view.updateFixedTerminalPoint(t,l,!1,o),(this.isSource||this.isTarget)&&i==null&&(t.setAbsoluteTerminalPoint(e,this.isSource),this.marker.getMarkedState()==null&&(this.error=this.graph.allowDanglingEdges?null:"")),t.view.updatePoints(t,this.points,s,l),t.view.updateFloatingTerminalPoints(t,s,l)},mxEdgeHandler.prototype.mouseMove=function(t,e){if(this.index!=null&&this.marker!=null){if(this.currentPoint=this.getPointForEvent(e),this.error=null,!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&this.snapPoint!=null&&(Math.abs(this.snapPoint.x-this.currentPoint.x)mxEvent.VIRTUAL_HANDLE)this.customHandles!=null&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged(),this.shape!=null&&this.shape.node!=null&&(this.shape.node.style.display="none"));else if(this.isLabel)this.label.x=this.currentPoint.x,this.label.y=this.currentPoint.y;else{this.points=this.getPreviewPoints(this.currentPoint,e);var i=this.isSource||this.isTarget?this.getPreviewTerminalState(e):null;if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null&&this.constraintHandler.currentPoint!=null)this.currentPoint=this.constraintHandler.currentPoint.clone();else if(this.outlineConnect){var n=this.isSource||this.isTarget?this.isOutlineConnectEvent(e):!1;n?i=this.marker.highlight.state:i!=null&&i!=e.getState()&&this.graph.isCellConnectable(e.getCell())&&this.marker.highlight.shape!=null&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint(),i=null)}i!=null&&!this.isCellEnabled(i.cell)&&(i=null,this.marker.reset());var r=this.clonePreviewState(this.currentPoint,i!=null?i.cell:null);this.updatePreviewState(r,this.currentPoint,i,e,n);var s=this.error==null?this.marker.validColor:this.marker.invalidColor;this.setPreviewColor(s),this.abspoints=r.absolutePoints,this.active=!0,this.updateHint(e,this.currentPoint)}this.drawPreview(),mxEvent.consume(e.getEvent()),e.consume()}else mxClient.IS_IE&&this.getHandleForEvent(e)!=null&&e.consume(!1)},mxEdgeHandler.prototype.mouseUp=function(t,e){if(this.index!=null&&this.marker!=null){this.shape!=null&&this.shape.node!=null&&(this.shape.node.style.display="");var i=this.state.cell,n=this.index;if(this.index=null,e.getX()!=this.startX||e.getY()!=this.startY){var r=!this.graph.isIgnoreTerminalEvent(e.getEvent())&&this.graph.isCloneEvent(e.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable();if(this.error!=null)this.error.length>0&&this.graph.validationAlert(this.error);else if(n<=mxEvent.CUSTOM_HANDLE&&n>mxEvent.VIRTUAL_HANDLE){if(this.customHandles!=null){var s=this.graph.getModel();s.beginUpdate();try{this.customHandles[mxEvent.CUSTOM_HANDLE-n].execute(e),this.shape!=null&&this.shape.node!=null&&(this.shape.apply(this.state),this.shape.redraw())}finally{s.endUpdate()}}}else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget){var l=null;if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null&&(l=this.constraintHandler.currentFocus.cell),l==null&&this.marker.hasValidState()&&this.marker.highlight!=null&&this.marker.highlight.shape!=null&&this.marker.highlight.shape.stroke!="transparent"&&this.marker.highlight.shape.stroke!="white"&&(l=this.marker.validState.cell),l!=null){var s=this.graph.getModel(),a=s.getParent(i);s.beginUpdate();try{if(r){var o=s.getGeometry(i),r=this.graph.cloneCell(i);s.add(a,r,s.getChildCount(a)),o!=null&&(o=o.clone(),s.setGeometry(r,o));var u=s.getTerminal(i,!this.isSource);this.graph.connectCell(r,u,!this.isSource),i=r}i=this.connect(i,l,this.isSource,r,e)}finally{s.endUpdate()}}else if(this.graph.isAllowDanglingEdges()){var p=this.abspoints[this.isSource?0:this.abspoints.length-1];p.x=this.roundLength(p.x/this.graph.view.scale-this.graph.view.translate.x),p.y=this.roundLength(p.y/this.graph.view.scale-this.graph.view.translate.y);var m=this.graph.getView().getState(this.graph.getModel().getParent(i));m!=null&&(p.x-=m.origin.x,p.y-=m.origin.y),p.x-=this.graph.panDx/this.graph.view.scale,p.y-=this.graph.panDy/this.graph.view.scale,i=this.changeTerminalPoint(i,p,this.isSource,r)}}else this.active?i=this.changePoints(i,this.points,r):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().validate(this.state.cell))}else this.graph.isToggleEvent(e.getEvent())&&this.graph.selectCellForEvent(this.state.cell,e.getEvent());this.marker!=null&&(this.reset(),i!=this.state.cell&&this.graph.setSelectionCell(i)),e.consume()}},mxEdgeHandler.prototype.reset=function(){if(this.active&&this.refresh(),this.error=null,this.index=null,this.label=null,this.points=null,this.snapPoint=null,this.isLabel=!1,this.isSource=!1,this.isTarget=!1,this.active=!1,this.livePreview&&this.sizers!=null)for(var t=0;t0&&e0&&i!=null){this.points==null&&(this.points=[]);for(var n=1;n0&&this.graph.isLabelMovable(t),this.bends!=null&&this.bends.length>0){var n=this.abspoints.length-1,r=this.abspoints[0],s=r.x,l=r.y;e=this.bends[0].bounds,this.bends[0].bounds=new mxRectangle(Math.floor(s-e.width/2),Math.floor(l-e.height/2),e.width,e.height),this.bends[0].fill=this.getHandleFillColor(0),this.bends[0].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[0].bounds);var a=this.abspoints[n],o=a.x,u=a.y,p=this.bends.length-1;e=this.bends[p].bounds,this.bends[p].bounds=new mxRectangle(Math.floor(o-e.width/2),Math.floor(u-e.height/2),e.width,e.height),this.bends[p].fill=this.getHandleFillColor(p),this.bends[p].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[p].bounds),this.redrawInnerBends(r,a)}if(this.abspoints!=null&&this.virtualBends!=null&&this.virtualBends.length>0){for(var m=this.abspoints[0],d=0;d1?(t=n[1],e=n[n.length-2]):i.points!=null&&i.points.length>0&&(r=n[0]),r==null?r=new mxPoint(t.x+(e.x-t.x)/2,t.y+(e.y-t.y)/2):r=new mxPoint(this.graph.getView().scale*(r.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(r.y+this.graph.getView().translate.y+this.state.origin.y));var s=this.bends[1].bounds,l=s.width,a=s.height,o=new mxRectangle(Math.round(r.x-l/2),Math.round(r.y-a/2),l,a);this.manageLabelHandle?this.checkLabelHandle(o):this.handleImage==null&&this.labelShape.visible&&mxUtils.intersects(o,this.labelShape.bounds)&&(l=mxConstants.HANDLE_SIZE+3,a=mxConstants.HANDLE_SIZE+3,o=new mxRectangle(Math.floor(r.x-l/2),Math.floor(r.y-a/2),l,a)),this.bends[1].bounds=o,this.bends[1].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[1].bounds)},__mxOutput.mxElbowEdgeHandler=typeof mxElbowEdgeHandler<"u"?mxElbowEdgeHandler:void 0;function mxEdgeSegmentHandler(t){mxEdgeHandler.call(this,t)}mxUtils.extend(mxEdgeSegmentHandler,mxElbowEdgeHandler),mxEdgeSegmentHandler.prototype.getCurrentPoints=function(){var t=this.state.absolutePoints;if(t!=null){var e=Math.max(1,this.graph.view.scale);if(t.length==2||t.length==3&&(Math.abs(t[0].x-t[1].x)0){var o=this.abspoints,u=o[0],p=o[1];a=[];for(var m=2;m1){var n=!1;if(i.length==4&&Math.round(i[1].x-i[2].x)==0&&Math.round(i[1].y-i[2].y)==0)if(n=!0,Math.round(i[0].y-i[i.length-1].y)==0){var r=i[0].x+(i[i.length-1].x-i[0].x)/2;i[1]=new mxPoint(r,i[1].y),i[2]=new mxPoint(r,i[2].y)}else{var s=i[0].y+(i[i.length-1].y-i[0].y)/2;i[1]=new mxPoint(i[1].x,s),i[2]=new mxPoint(i[2].x,s)}for(var l=0;l0){this.div==null&&this.init();var n=mxUtils.getScrollOrigin();this.div.style.zIndex=this.zIndex,this.div.style.left=e+n.x+"px",this.div.style.top=i+mxConstants.TOOLTIP_VERTICAL_OFFSET+n.y+"px",mxUtils.isNode(t)?(this.div.innerHTML="",this.div.appendChild(t)):this.div.innerHTML=t.replace(/\n/g,"
"),this.div.style.visibility="",mxUtils.fit(this.div)}},mxTooltipHandler.prototype.destroy=function(){this.destroyed||(this.graph.removeMouseListener(this),mxEvent.release(this.div),this.div!=null&&this.div.parentNode!=null&&this.div.parentNode.removeChild(this.div),this.destroyed=!0,this.div=null)},__mxOutput.mxTooltipHandler=typeof mxTooltipHandler<"u"?mxTooltipHandler:void 0;function mxCellTracker(t,e,i){mxCellMarker.call(this,t,e),this.graph.addMouseListener(this),i!=null&&(this.getCell=i),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()}))}mxUtils.extend(mxCellTracker,mxCellMarker),mxCellTracker.prototype.mouseDown=function(t,e){},mxCellTracker.prototype.mouseMove=function(t,e){this.isEnabled()&&this.process(e)},mxCellTracker.prototype.mouseUp=function(t,e){},mxCellTracker.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),mxCellMarker.prototype.destroy.apply(this))},__mxOutput.mxCellTracker=typeof mxCellTracker<"u"?mxCellTracker:void 0;function mxCellHighlight(t,e,i,n){t!=null&&(this.graph=t,this.highlightColor=e??mxConstants.DEFAULT_VALID_COLOR,this.strokeWidth=i??mxConstants.HIGHLIGHT_STROKEWIDTH,this.dashed=n??!1,this.opacity=mxConstants.HIGHLIGHT_OPACITY,this.repaintHandler=mxUtils.bind(this,function(){if(this.state!=null){var r=this.graph.view.getState(this.state.cell);r==null?this.hide():(this.state=r,this.repaint())}}),this.graph.getView().addListener(mxEvent.SCALE,this.repaintHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.repaintHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.repaintHandler),this.resetHandler=mxUtils.bind(this,function(){this.hide()}),this.graph.getView().addListener(mxEvent.DOWN,this.resetHandler),this.graph.getView().addListener(mxEvent.UP,this.resetHandler))}mxCellHighlight.prototype.keepOnTop=!1,mxCellHighlight.prototype.graph=null,mxCellHighlight.prototype.state=null,mxCellHighlight.prototype.spacing=2,mxCellHighlight.prototype.resetHandler=null,mxCellHighlight.prototype.setHighlightColor=function(t){this.highlightColor=t,this.shape!=null&&(this.shape.stroke=t)},mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape(),this.repaint(),!this.keepOnTop&&this.shape.node.parentNode.firstChild!=this.shape.node&&this.shape.node.parentNode.insertBefore(this.shape.node,this.shape.node.parentNode.firstChild)},mxCellHighlight.prototype.createShape=function(){var t=this.graph.cellRenderer.createShape(this.state);return t.svgStrokeTolerance=this.graph.tolerance,t.points=this.state.absolutePoints,t.apply(this.state),t.stroke=this.highlightColor,t.opacity=this.opacity,t.isDashed=this.dashed,t.isShadow=!1,t.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,t.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(t.node,this.graph,this.state),this.graph.dialect!=mxConstants.DIALECT_SVG?t.pointerEvents=!1:t.svgPointerEvents="stroke",t},mxCellHighlight.prototype.getStrokeWidth=function(t){return this.strokeWidth},mxCellHighlight.prototype.repaint=function(){this.state!=null&&this.shape!=null&&(this.shape.scale=this.state.view.scale,this.graph.model.isEdge(this.state.cell)?(this.shape.strokewidth=this.getStrokeWidth(),this.shape.points=this.state.absolutePoints,this.shape.outline=!1):(this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing),this.shape.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.shape.strokewidth=this.getStrokeWidth()/this.state.view.scale,this.shape.outline=!0),this.state.shape!=null&&this.shape.setCursor(this.state.shape.getCursor()),(mxClient.IS_QUIRKS||document.documentMode==8)&&(this.shape.stroke=="transparent"?(this.shape.stroke="white",this.shape.opacity=1):this.shape.opacity=this.opacity),this.shape.redraw())},mxCellHighlight.prototype.hide=function(){this.highlight(null)},mxCellHighlight.prototype.highlight=function(t){this.state!=t&&(this.shape!=null&&(this.shape.destroy(),this.shape=null),this.state=t,this.state!=null&&this.drawHighlight())},mxCellHighlight.prototype.isHighlightAt=function(t,e){var i=!1;if(this.shape!=null&&document.elementFromPoint!=null&&!mxClient.IS_QUIRKS)for(var n=document.elementFromPoint(t,e);n!=null;){if(n==this.shape.node){i=!0;break}n=n.parentNode}return i},mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getView().removeListener(this.repaintHandler),this.graph.getModel().removeListener(this.repaintHandler),this.shape!=null&&(this.shape.destroy(),this.shape=null)},__mxOutput.mxCellHighlight=typeof mxCellHighlight<"u"?mxCellHighlight:void 0;function mxDefaultKeyHandler(t){if(t!=null){this.editor=t,this.handler=new mxKeyHandler(t.graph);var e=this.handler.escape;this.handler.escape=function(i){e.apply(this,arguments),t.hideProperties(),t.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",i))}}}mxDefaultKeyHandler.prototype.editor=null,mxDefaultKeyHandler.prototype.handler=null,mxDefaultKeyHandler.prototype.bindAction=function(t,e,i){var n=mxUtils.bind(this,function(){this.editor.execute(e)});i?this.handler.bindControlKey(t,n):this.handler.bindKey(t,n)},mxDefaultKeyHandler.prototype.destroy=function(){this.handler.destroy(),this.handler=null},__mxOutput.mxDefaultKeyHandler=typeof mxDefaultKeyHandler<"u"?mxDefaultKeyHandler:void 0;function mxDefaultPopupMenu(t){this.config=t}mxDefaultPopupMenu.prototype.imageBasePath=null,mxDefaultPopupMenu.prototype.config=null,mxDefaultPopupMenu.prototype.createMenu=function(t,e,i,n){if(this.config!=null){var r=this.createConditions(t,i,n),s=this.config.firstChild;this.addItems(t,e,i,n,r,s,null)}},mxDefaultPopupMenu.prototype.addItems=function(t,e,i,n,r,s,l){for(var a=!1;s!=null;){if(s.nodeName=="add"){var o=s.getAttribute("if");if(o==null||r[o]){var u=s.getAttribute("as");u=mxResources.get(u)||u;var p=mxUtils.eval(mxUtils.getTextContent(s)),m=s.getAttribute("action"),d=s.getAttribute("icon"),x=s.getAttribute("iconCls"),f=s.getAttribute("enabled-if"),g=f==null||r[f];a&&(e.addSeparator(l),a=!1),d!=null&&this.imageBasePath&&(d=this.imageBasePath+d);var c=this.addAction(e,t,u,d,p,m,i,l,x,g);this.addItems(t,e,i,n,r,s.firstChild,c)}}else s.nodeName=="separator"&&(a=!0);s=s.nextSibling}},mxDefaultPopupMenu.prototype.addAction=function(t,e,i,n,r,s,l,a,o,u){var p=function(m){typeof r=="function"&&r.call(e,e,l,m),s!=null&&e.execute(s,l,m)};return t.addItem(i,n,p,a,o,u)},mxDefaultPopupMenu.prototype.createConditions=function(t,e,i){var n=t.graph.getModel(),r=n.getChildCount(e),s=[];s.nocell=e==null,s.ncells=t.graph.getSelectionCount()>1,s.notRoot=n.getRoot()!=n.getParent(t.graph.getDefaultParent()),s.cell=e!=null;var l=e!=null&&t.graph.getSelectionCount()==1;s.nonEmpty=l&&r>0,s.expandable=l&&t.graph.isCellFoldable(e,!1),s.collapsable=l&&t.graph.isCellFoldable(e,!0),s.validRoot=l&&t.graph.isValidRoot(e),s.emptyValidRoot=s.validRoot&&r==0,s.swimlane=l&&t.graph.isSwimlane(e);for(var a=this.config.getElementsByTagName("condition"),o=0;o0&&this.editor.execute(i)});return this.toolbar.addItem(t,e,r,n)},mxDefaultToolbar.prototype.addSeparator=function(t){t=t||mxClient.imageBasePath+"/separator.gif",this.toolbar.addSeparator(t)},mxDefaultToolbar.prototype.addCombo=function(){return this.toolbar.addCombo()},mxDefaultToolbar.prototype.addActionCombo=function(t){return this.toolbar.addActionCombo(t)},mxDefaultToolbar.prototype.addActionOption=function(t,e,i){var n=mxUtils.bind(this,function(){this.editor.execute(i)});this.addOption(t,e,n)},mxDefaultToolbar.prototype.addOption=function(t,e,i){return this.toolbar.addOption(t,e,i)},mxDefaultToolbar.prototype.addMode=function(t,e,i,n,r){var s=mxUtils.bind(this,function(){this.editor.setMode(i),r!=null&&r(this.editor)});return this.toolbar.addSwitchMode(t,e,s,n)},mxDefaultToolbar.prototype.addPrototype=function(t,e,i,n,r,s){var l=mxUtils.bind(this,function(){return typeof i=="function"?i():i!=null?this.editor.graph.cloneCell(i):null}),a=mxUtils.bind(this,function(p,m){typeof r=="function"?r(this.editor,l(),p,m):this.drop(l(),p,m),this.toolbar.resetMode(),mxEvent.consume(p)}),o=this.toolbar.addMode(t,e,a,n,null,s),u=function(p,m,d){a(m,d)};return this.installDropHandler(o,u),o},mxDefaultToolbar.prototype.drop=function(t,e,i){var n=this.editor.graph,r=n.getModel();if(i==null||r.isEdge(i)||!this.connectOnDrop||!n.isCellConnectable(i)){for(;i!=null&&!n.isValidDropTarget(i,[t],e);)i=r.getParent(i);this.insert(t,e,i)}else this.connect(t,e,i)},mxDefaultToolbar.prototype.insert=function(t,e,i){var n=this.editor.graph;if(n.canImportCell(t)){var r=mxEvent.getClientX(e),s=mxEvent.getClientY(e),l=mxUtils.convertPoint(n.container,r,s);return n.isSplitEnabled()&&n.isSplitTarget(i,[t],e)?n.splitEdge(i,[t],null,l.x,l.y):this.editor.addVertex(i,t,l.x,l.y)}return null},mxDefaultToolbar.prototype.connect=function(t,e,i){var n=this.editor.graph,r=n.getModel();if(i!=null&&n.isCellConnectable(t)&&n.isEdgeValid(null,i,t)){var s=null;r.beginUpdate();try{var l=r.getGeometry(i),a=r.getGeometry(t).clone();a.x=l.x+(l.width-a.width)/2,a.y=l.y+(l.height-a.height)/2;var o=this.spacing*n.gridSize,u=r.getDirectedEdgeCount(i,!0)*20;this.editor.horizontalFlow?a.x+=(a.width+l.width)/2+o+u:a.y+=(a.height+l.height)/2+o+u,t.setGeometry(a);var p=r.getParent(i);if(n.addCell(t,p),n.constrainChild(t),s=this.editor.createEdge(i,t),r.getGeometry(s)==null){var m=new mxGeometry;m.relative=!0,r.setGeometry(s,m)}n.addEdge(s,p,i,t)}finally{r.endUpdate()}n.setSelectionCells([t,s]),n.scrollCellToVisible(t)}},mxDefaultToolbar.prototype.installDropHandler=function(t,e){var i=document.createElement("img");i.setAttribute("src",t.getAttribute("src"));var n=mxUtils.bind(this,function(r){i.style.width=2*t.offsetWidth+"px",i.style.height=2*t.offsetHeight+"px",mxUtils.makeDraggable(t,this.editor.graph,e,i),mxEvent.removeListener(i,"load",n)});mxClient.IS_IE?n():mxEvent.addListener(i,"load",n)},mxDefaultToolbar.prototype.destroy=function(){this.resetHandler!=null&&(this.editor.graph.removeListener("dblclick",this.resetHandler),this.editor.removeListener("escape",this.resetHandler),this.resetHandler=null),this.toolbar!=null&&(this.toolbar.destroy(),this.toolbar=null)},__mxOutput.mxDefaultToolbar=typeof mxDefaultToolbar<"u"?mxDefaultToolbar:void 0;function mxEditor(t){this.actions=[],this.addActions(),document.body!=null&&(this.cycleAttributeValues=[],this.popupHandler=new mxDefaultPopupMenu,this.undoManager=new mxUndoManager,this.graph=this.createGraph(),this.toolbar=this.createToolbar(),this.keyHandler=new mxDefaultKeyHandler(this),this.configure(t),this.graph.swimlaneIndicatorColorAttribute=this.cycleAttributeName,this.onInit!=null&&this.onInit(),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}mxLoadResources?mxResources.add(mxClient.basePath+"/resources/editor"):mxClient.defaultBundles.push(mxClient.basePath+"/resources/editor"),mxEditor.prototype=new mxEventSource,mxEditor.prototype.constructor=mxEditor,mxEditor.prototype.askZoomResource=mxClient.language!="none"?"askZoom":"",mxEditor.prototype.lastSavedResource=mxClient.language!="none"?"lastSaved":"",mxEditor.prototype.currentFileResource=mxClient.language!="none"?"currentFile":"",mxEditor.prototype.propertiesResource=mxClient.language!="none"?"properties":"",mxEditor.prototype.tasksResource=mxClient.language!="none"?"tasks":"",mxEditor.prototype.helpResource=mxClient.language!="none"?"help":"",mxEditor.prototype.outlineResource=mxClient.language!="none"?"outline":"",mxEditor.prototype.outline=null,mxEditor.prototype.graph=null,mxEditor.prototype.graphRenderHint=null,mxEditor.prototype.toolbar=null,mxEditor.prototype.status=null,mxEditor.prototype.popupHandler=null,mxEditor.prototype.undoManager=null,mxEditor.prototype.keyHandler=null,mxEditor.prototype.actions=null,mxEditor.prototype.dblClickAction="edit",mxEditor.prototype.swimlaneRequired=!1,mxEditor.prototype.disableContextMenu=!0,mxEditor.prototype.insertFunction=null,mxEditor.prototype.forcedInserting=!1,mxEditor.prototype.templates=null,mxEditor.prototype.defaultEdge=null,mxEditor.prototype.defaultEdgeStyle=null,mxEditor.prototype.defaultGroup=null,mxEditor.prototype.groupBorderSize=null,mxEditor.prototype.filename=null,mxEditor.prototype.linefeed=" ",mxEditor.prototype.postParameterName="xml",mxEditor.prototype.escapePostData=!0,mxEditor.prototype.urlPost=null,mxEditor.prototype.urlImage=null,mxEditor.prototype.horizontalFlow=!1,mxEditor.prototype.layoutDiagram=!1,mxEditor.prototype.swimlaneSpacing=0,mxEditor.prototype.maintainSwimlanes=!1,mxEditor.prototype.layoutSwimlanes=!1,mxEditor.prototype.cycleAttributeValues=null,mxEditor.prototype.cycleAttributeIndex=0,mxEditor.prototype.cycleAttributeName="fillColor",mxEditor.prototype.tasks=null,mxEditor.prototype.tasksWindowImage=null,mxEditor.prototype.tasksTop=20,mxEditor.prototype.help=null,mxEditor.prototype.helpWindowImage=null,mxEditor.prototype.urlHelp=null,mxEditor.prototype.helpWidth=300,mxEditor.prototype.helpHeight=260,mxEditor.prototype.propertiesWidth=240,mxEditor.prototype.propertiesHeight=null,mxEditor.prototype.movePropertiesDialog=!1,mxEditor.prototype.validating=!1,mxEditor.prototype.modified=!1,mxEditor.prototype.isModified=function(){return this.modified},mxEditor.prototype.setModified=function(t){this.modified=t},mxEditor.prototype.addActions=function(){this.addAction("save",function(t){t.save()}),this.addAction("print",function(t){var e=new mxPrintPreview(t.graph,1);e.open()}),this.addAction("show",function(t){mxUtils.show(t.graph,null,10,10)}),this.addAction("exportImage",function(t){var e=t.getUrlImage();if(e==null||mxClient.IS_LOCAL)t.execute("show");else{var i=mxUtils.getViewXml(t.graph,1),n=mxUtils.getXml(i,` -`);mxUtils.submit(e,t.postParameterName+"="+encodeURIComponent(n),document,"_blank")}}),this.addAction("refresh",function(t){t.graph.refresh()}),this.addAction("cut",function(t){t.graph.isEnabled()&&mxClipboard.cut(t.graph)}),this.addAction("copy",function(t){t.graph.isEnabled()&&mxClipboard.copy(t.graph)}),this.addAction("paste",function(t){t.graph.isEnabled()&&mxClipboard.paste(t.graph)}),this.addAction("delete",function(t){t.graph.isEnabled()&&t.graph.removeCells()}),this.addAction("group",function(t){t.graph.isEnabled()&&t.graph.setSelectionCell(t.groupCells())}),this.addAction("ungroup",function(t){t.graph.isEnabled()&&t.graph.setSelectionCells(t.graph.ungroupCells())}),this.addAction("removeFromParent",function(t){t.graph.isEnabled()&&t.graph.removeCellsFromParent()}),this.addAction("undo",function(t){t.graph.isEnabled()&&t.undo()}),this.addAction("redo",function(t){t.graph.isEnabled()&&t.redo()}),this.addAction("zoomIn",function(t){t.graph.zoomIn()}),this.addAction("zoomOut",function(t){t.graph.zoomOut()}),this.addAction("actualSize",function(t){t.graph.zoomActual()}),this.addAction("fit",function(t){t.graph.fit()}),this.addAction("showProperties",function(t,e){t.showProperties(e)}),this.addAction("selectAll",function(t){t.graph.isEnabled()&&t.graph.selectAll()}),this.addAction("selectNone",function(t){t.graph.isEnabled()&&t.graph.clearSelection()}),this.addAction("selectVertices",function(t){t.graph.isEnabled()&&t.graph.selectVertices()}),this.addAction("selectEdges",function(t){t.graph.isEnabled()&&t.graph.selectEdges()}),this.addAction("edit",function(t,e){t.graph.isEnabled()&&t.graph.isCellEditable(e)&&t.graph.startEditingAtCell(e)}),this.addAction("toBack",function(t,e){t.graph.isEnabled()&&t.graph.orderCells(!0)}),this.addAction("toFront",function(t,e){t.graph.isEnabled()&&t.graph.orderCells(!1)}),this.addAction("enterGroup",function(t,e){t.graph.enterGroup(e)}),this.addAction("exitGroup",function(t){t.graph.exitGroup()}),this.addAction("home",function(t){t.graph.home()}),this.addAction("selectPrevious",function(t){t.graph.isEnabled()&&t.graph.selectPreviousCell()}),this.addAction("selectNext",function(t){t.graph.isEnabled()&&t.graph.selectNextCell()}),this.addAction("selectParent",function(t){t.graph.isEnabled()&&t.graph.selectParentCell()}),this.addAction("selectChild",function(t){t.graph.isEnabled()&&t.graph.selectChildCell()}),this.addAction("collapse",function(t){t.graph.isEnabled()&&t.graph.foldCells(!0)}),this.addAction("collapseAll",function(t){if(t.graph.isEnabled()){var e=t.graph.getChildVertices();t.graph.foldCells(!0,!1,e)}}),this.addAction("expand",function(t){t.graph.isEnabled()&&t.graph.foldCells(!1)}),this.addAction("expandAll",function(t){if(t.graph.isEnabled()){var e=t.graph.getChildVertices();t.graph.foldCells(!1,!1,e)}}),this.addAction("bold",function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_BOLD)}),this.addAction("italic",function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_ITALIC)}),this.addAction("underline",function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_UNDERLINE)}),this.addAction("alignCellsLeft",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_LEFT)}),this.addAction("alignCellsCenter",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_CENTER)}),this.addAction("alignCellsRight",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_RIGHT)}),this.addAction("alignCellsTop",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_TOP)}),this.addAction("alignCellsMiddle",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_MIDDLE)}),this.addAction("alignCellsBottom",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_BOTTOM)}),this.addAction("alignFontLeft",function(t){t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT)}),this.addAction("alignFontCenter",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER)}),this.addAction("alignFontRight",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_RIGHT)}),this.addAction("alignFontTop",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_TOP)}),this.addAction("alignFontMiddle",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)}),this.addAction("alignFontBottom",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_BOTTOM)}),this.addAction("zoom",function(t){var e=t.graph.getView().scale*100,i=parseFloat(mxUtils.prompt(mxResources.get(t.askZoomResource)||t.askZoomResource,e))/100;isNaN(i)||t.graph.getView().setScale(i)}),this.addAction("toggleTasks",function(t){t.tasks!=null?t.tasks.setVisible(!t.tasks.isVisible()):t.showTasks()}),this.addAction("toggleHelp",function(t){t.help!=null?t.help.setVisible(!t.help.isVisible()):t.showHelp()}),this.addAction("toggleOutline",function(t){t.outline==null?t.showOutline():t.outline.setVisible(!t.outline.isVisible())}),this.addAction("toggleConsole",function(t){mxLog.setVisible(!mxLog.isVisible())})},mxEditor.prototype.configure=function(t){if(t!=null){var e=new mxCodec(t.ownerDocument);e.decode(t,this),this.resetHistory()}},mxEditor.prototype.resetFirstTime=function(){document.cookie="mxgraph=seen; expires=Fri, 27 Jul 2001 02:47:11 UTC; path=/"},mxEditor.prototype.resetHistory=function(){this.lastSnapshot=new Date().getTime(),this.undoManager.clear(),this.ignoredChanges=0,this.setModified(!1)},mxEditor.prototype.addAction=function(t,e){this.actions[t]=e},mxEditor.prototype.execute=function(t,e,i){var n=this.actions[t];if(n!=null)try{var r=arguments;r[0]=this,n.apply(this,r)}catch(s){throw mxUtils.error("Cannot execute "+t+": "+s.message,280,!0),s}else mxUtils.error("Cannot find action "+t,280,!0)},mxEditor.prototype.addTemplate=function(t,e){this.templates[t]=e},mxEditor.prototype.getTemplate=function(t){return this.templates[t]},mxEditor.prototype.createGraph=function(){var t=new mxGraph(null,null,this.graphRenderHint);return t.setTooltips(!0),t.setPanning(!0),this.installDblClickHandler(t),this.installUndoHandler(t),this.installDrillHandler(t),this.installChangeHandler(t),this.installInsertHandler(t),t.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(e,i,n){return this.createPopupMenu(e,i,n)}),t.connectionHandler.factoryMethod=mxUtils.bind(this,function(e,i){return this.createEdge(e,i)}),this.createSwimlaneManager(t),this.createLayoutManager(t),t},mxEditor.prototype.createSwimlaneManager=function(t){var e=new mxSwimlaneManager(t,!1);return e.isHorizontal=mxUtils.bind(this,function(){return this.horizontalFlow}),e.isEnabled=mxUtils.bind(this,function(){return this.maintainSwimlanes}),e},mxEditor.prototype.createLayoutManager=function(t){var e=new mxLayoutManager(t),i=this;return e.getLayout=function(n){var r=null,s=i.graph.getModel();return s.getParent(n)!=null&&(i.layoutSwimlanes&&t.isSwimlane(n)?(i.swimlaneLayout==null&&(i.swimlaneLayout=i.createSwimlaneLayout()),r=i.swimlaneLayout):i.layoutDiagram&&(t.isValidRoot(n)||s.getParent(s.getParent(n))==null)&&(i.diagramLayout==null&&(i.diagramLayout=i.createDiagramLayout()),r=i.diagramLayout)),r},e},mxEditor.prototype.setGraphContainer=function(t){this.graph.container==null&&(this.graph.init(t),this.rubberband=new mxRubberband(this.graph),this.disableContextMenu&&mxEvent.disableContextMenu(t),mxClient.IS_QUIRKS&&new mxDivResizer(t))},mxEditor.prototype.installDblClickHandler=function(t){t.addListener(mxEvent.DOUBLE_CLICK,mxUtils.bind(this,function(e,i){var n=i.getProperty("cell");n!=null&&t.isEnabled()&&this.dblClickAction!=null&&(this.execute(this.dblClickAction,n),i.consume())}))},mxEditor.prototype.installUndoHandler=function(t){var e=mxUtils.bind(this,function(n,r){var s=r.getProperty("edit");this.undoManager.undoableEditHappened(s)});t.getModel().addListener(mxEvent.UNDO,e),t.getView().addListener(mxEvent.UNDO,e);var i=function(n,r){var s=r.getProperty("edit").changes;t.setSelectionCells(t.getSelectionCellsForChanges(s))};this.undoManager.addListener(mxEvent.UNDO,i),this.undoManager.addListener(mxEvent.REDO,i)},mxEditor.prototype.installDrillHandler=function(t){var e=mxUtils.bind(this,function(i){this.fireEvent(new mxEventObject(mxEvent.ROOT))});t.getView().addListener(mxEvent.DOWN,e),t.getView().addListener(mxEvent.UP,e)},mxEditor.prototype.installChangeHandler=function(t){var e=mxUtils.bind(this,function(i,n){this.setModified(!0),this.validating==!0&&t.validateGraph();for(var r=n.getProperty("edit").changes,s=0;s "+e.convertValueToString(i)+t),i=e.getModel().getParent(i);var n=this.getRootTitle();return n+t},mxEditor.prototype.getRootTitle=function(){var t=this.graph.getModel().getRoot();return this.graph.convertValueToString(t)},mxEditor.prototype.undo=function(){this.undoManager.undo()},mxEditor.prototype.redo=function(){this.undoManager.redo()},mxEditor.prototype.groupCells=function(){var t=this.groupBorderSize!=null?this.groupBorderSize:this.graph.gridSize;return this.graph.groupCells(this.createGroup(),t)},mxEditor.prototype.createGroup=function(){var t=this.graph.getModel();return t.cloneCell(this.defaultGroup)},mxEditor.prototype.open=function(t){if(t!=null){var e=mxUtils.load(t).getXml();this.readGraphModel(e.documentElement),this.filename=t,this.fireEvent(new mxEventObject(mxEvent.OPEN,"filename",t))}},mxEditor.prototype.readGraphModel=function(t){var e=new mxCodec(t.ownerDocument);e.decode(t,this.graph.getModel()),this.resetHistory()},mxEditor.prototype.save=function(t,e){if(t=t||this.getUrlPost(),t!=null&&t.length>0){var i=this.writeGraphModel(e);this.postDiagram(t,i),this.setModified(!1)}this.fireEvent(new mxEventObject(mxEvent.SAVE,"url",t))},mxEditor.prototype.postDiagram=function(t,e){this.escapePostData&&(e=encodeURIComponent(e)),mxUtils.post(t,this.postParameterName+"="+e,mxUtils.bind(this,function(i){this.fireEvent(new mxEventObject(mxEvent.POST,"request",i,"url",t,"data",e))}))},mxEditor.prototype.writeGraphModel=function(t){t=t??this.linefeed;var e=new mxCodec,i=e.encode(this.graph.getModel());return mxUtils.getXml(i,t)},mxEditor.prototype.getUrlPost=function(){return this.urlPost},mxEditor.prototype.getUrlImage=function(){return this.urlImage},mxEditor.prototype.swapStyles=function(t,e){var i=this.graph.getStylesheet().styles[e];this.graph.getView().getStylesheet().putCellStyle(e,this.graph.getStylesheet().styles[t]),this.graph.getStylesheet().putCellStyle(t,i),this.graph.refresh()},mxEditor.prototype.showProperties=function(t){if(t=t||this.graph.getSelectionCell(),t==null&&(t=this.graph.getCurrentRoot(),t==null&&(t=this.graph.getModel().getRoot())),t!=null){this.graph.stopEditing(!0);var e=mxUtils.getOffset(this.graph.container),i=e.x+10,n=e.y;if(this.properties!=null&&!this.movePropertiesDialog)i=this.properties.getX(),n=this.properties.getY();else{var r=this.graph.getCellBounds(t);r!=null&&(i+=r.x+Math.min(200,r.width),n+=r.y)}this.hideProperties();var s=this.createProperties(t);s!=null&&(this.properties=new mxWindow(mxResources.get(this.propertiesResource)||this.propertiesResource,s,i,n,this.propertiesWidth,this.propertiesHeight,!1),this.properties.setVisible(!0))}},mxEditor.prototype.isPropertiesVisible=function(){return this.properties!=null},mxEditor.prototype.createProperties=function(t){var e=this.graph.getModel(),i=e.getValue(t);if(mxUtils.isNode(i)){var n=new mxForm("properties"),r=n.addText("ID",t.getId());r.setAttribute("readonly","true");var s=null,l=null,a=null,o=null,u=null;e.isVertex(t)&&(s=e.getGeometry(t),s!=null&&(l=n.addText("top",s.y),a=n.addText("left",s.x),o=n.addText("width",s.width),u=n.addText("height",s.height)));for(var p=e.getStyle(t),m=n.addText("Style",p||""),d=i.attributes,x=[],f=0;f0?e.setStyle(t,m.value):e.setStyle(t,null);for(var y=0;y0&&this.graph.isSwimlane(t)?this.cycleAttributeValues[this.cycleAttributeIndex++%this.cycleAttributeValues.length]:null},mxEditor.prototype.cycleAttribute=function(t){if(this.cycleAttributeName!=null){var e=this.consumeCycleAttribute(t);e!=null&&t.setStyle(t.getStyle()+";"+this.cycleAttributeName+"="+e)}},mxEditor.prototype.addVertex=function(t,e,i,n){for(var r=this.graph.getModel();t!=null&&!this.graph.isValidDropTarget(t);)t=r.getParent(t);t=t??this.graph.getSwimlaneAt(i,n);var s=this.graph.getView().scale,l=r.getGeometry(e),a=r.getGeometry(t);if(this.graph.isSwimlane(e)&&!this.graph.swimlaneNesting)t=null;else{if(t==null&&this.swimlaneRequired)return null;if(t!=null&&a!=null){var o=this.graph.getView().getState(t);if(o!=null){if(i-=o.origin.x*s,n-=o.origin.y*s,this.graph.isConstrainedMoving){var u=l.width,p=l.height,m=o.x+o.width;i+u>m&&(i-=i+u-m),m=o.y+o.height,n+p>m&&(n-=n+p-m)}}else a!=null&&(i-=a.x*s,n-=a.y*s)}}l=l.clone(),l.x=this.graph.snap(i/s-this.graph.getView().translate.x-this.graph.gridSize/2),l.y=this.graph.snap(n/s-this.graph.getView().translate.y-this.graph.gridSize/2),e.setGeometry(l),t==null&&(t=this.graph.getDefaultParent()),this.cycleAttribute(e),this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",e,"parent",t)),r.beginUpdate();try{e=this.graph.addCell(e,t),e!=null&&(this.graph.constrainChild(e),this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",e)))}finally{r.endUpdate()}return e!=null&&(this.graph.setSelectionCell(e),this.graph.scrollCellToVisible(e),this.fireEvent(new mxEventObject(mxEvent.AFTER_ADD_VERTEX,"vertex",e))),e},mxEditor.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.tasks!=null&&this.tasks.destroy(),this.outline!=null&&this.outline.destroy(),this.properties!=null&&this.properties.destroy(),this.keyHandler!=null&&this.keyHandler.destroy(),this.rubberband!=null&&this.rubberband.destroy(),this.toolbar!=null&&this.toolbar.destroy(),this.graph!=null&&this.graph.destroy(),this.status=null,this.templates=null)},__mxOutput.mxEditor=typeof mxEditor<"u"?mxEditor:void 0;var mxCodecRegistry={codecs:[],aliases:[],register:function(t){if(t!=null){var e=t.getName();mxCodecRegistry.codecs[e]=t;var i=mxUtils.getFunctionName(t.template.constructor);i!=e&&mxCodecRegistry.addAlias(i,e)}return t},addAlias:function(t,e){mxCodecRegistry.aliases[t]=e},getCodec:function(t){var e=null;if(t!=null){var i=mxUtils.getFunctionName(t),n=mxCodecRegistry.aliases[i];if(n!=null&&(i=n),e=mxCodecRegistry.codecs[i],e==null)try{e=new mxObjectCodec(new t),mxCodecRegistry.register(e)}catch{}}return e}};__mxOutput.mxCodecRegistry=typeof mxCodecRegistry<"u"?mxCodecRegistry:void 0;function mxCodec(t){this.document=t||mxUtils.createXmlDocument(),this.objects=[]}mxCodec.prototype.document=null,mxCodec.prototype.objects=null,mxCodec.prototype.elements=null,mxCodec.prototype.encodeDefaults=!1,mxCodec.prototype.putObject=function(t,e){return this.objects[t]=e,e},mxCodec.prototype.getObject=function(t){var e=null;if(t!=null&&(e=this.objects[t],e==null&&(e=this.lookup(t),e==null))){var i=this.getElementById(t);i!=null&&(e=this.decode(i))}return e},mxCodec.prototype.lookup=function(t){return null},mxCodec.prototype.getElementById=function(t){return this.updateElements(),this.elements[t]},mxCodec.prototype.updateElements=function(){this.elements==null&&(this.elements=new Object,this.document.documentElement!=null&&this.addElement(this.document.documentElement))},mxCodec.prototype.addElement=function(t){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var e=t.getAttribute("id");if(e!=null){if(this.elements[e]==null)this.elements[e]=t;else if(this.elements[e]!=t)throw new Error(e+": Duplicate ID")}}for(t=t.firstChild;t!=null;)this.addElement(t),t=t.nextSibling},mxCodec.prototype.getId=function(t){var e=null;return t!=null&&(e=this.reference(t),e==null&&t instanceof mxCell&&(e=t.getId(),e==null&&(e=mxCellPath.create(t),e.length==0&&(e="root")))),e},mxCodec.prototype.reference=function(t){return null},mxCodec.prototype.encode=function(t){var e=null;if(t!=null&&t.constructor!=null){var i=mxCodecRegistry.getCodec(t.constructor);i!=null?e=i.encode(this,t):mxUtils.isNode(t)?e=mxUtils.importNode(this.document,t,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(t.constructor))}return e},mxCodec.prototype.decode=function(t,e){this.updateElements();var i=null;if(t!=null&&t.nodeType==mxConstants.NODETYPE_ELEMENT){var n=null;try{n=window[t.nodeName]}catch{}var r=mxCodecRegistry.getCodec(n);r!=null?i=r.decode(this,t,e):(i=t.cloneNode(!0),i.removeAttribute("as"))}return i},mxCodec.prototype.encodeCell=function(t,e,i){if(e.appendChild(this.encode(t)),i==null||i)for(var n=t.getChildCount(),r=0;r=0},mxObjectCodec.prototype.isReference=function(t,e,i,n){return mxUtils.indexOf(this.idrefs,e)>=0},mxObjectCodec.prototype.encode=function(t,e){var i=t.document.createElement(this.getName());return e=this.beforeEncode(t,e,i),this.encodeObject(t,e,i),this.afterEncode(t,e,i)},mxObjectCodec.prototype.encodeObject=function(t,e,i){t.setAttribute(i,"id",t.getId(e));for(var n in e){var r=n,s=e[r];s!=null&&!this.isExcluded(e,r,s,!0)&&(mxUtils.isInteger(r)&&(r=null),this.encodeValue(t,e,r,s,i))}},mxObjectCodec.prototype.encodeValue=function(t,e,i,n,r){if(n!=null){if(this.isReference(e,i,n,!0)){var s=t.getId(n);if(s==null){mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+i+"="+n);return}n=s}var l=this.template[i];(i==null||t.encodeDefaults||l!=n)&&(i=this.getAttributeName(i),this.writeAttribute(t,e,i,n,r))}},mxObjectCodec.prototype.writeAttribute=function(t,e,i,n,r){typeof n!="object"?this.writePrimitiveAttribute(t,e,i,n,r):this.writeComplexAttribute(t,e,i,n,r)},mxObjectCodec.prototype.writePrimitiveAttribute=function(t,e,i,n,r){if(n=this.convertAttributeToXml(t,e,i,n,r),i==null){var s=t.document.createElement("add");typeof n=="function"?s.appendChild(t.document.createTextNode(n)):t.setAttribute(s,"value",n),r.appendChild(s)}else typeof n!="function"&&t.setAttribute(r,i,n)},mxObjectCodec.prototype.writeComplexAttribute=function(t,e,i,n,r){var s=t.encode(n);s!=null?(i!=null&&s.setAttribute("as",i),r.appendChild(s)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+i+": "+n)},mxObjectCodec.prototype.convertAttributeToXml=function(t,e,i,n){return this.isBooleanAttribute(t,e,i,n)&&(n=n==!0?"1":"0"),n},mxObjectCodec.prototype.isBooleanAttribute=function(t,e,i,n){return typeof n.length>"u"&&(n==!0||n==!1)},mxObjectCodec.prototype.convertAttributeFromXml=function(t,e,i){var n=e.value;return this.isNumericAttribute(t,e,i)&&(n=parseFloat(n),(isNaN(n)||!isFinite(n))&&(n=0)),n},mxObjectCodec.prototype.isNumericAttribute=function(t,e,i){var n=i.constructor==mxGeometry&&(e.name=="x"||e.name=="y"||e.name=="width"||e.name=="height")||i.constructor==mxPoint&&(e.name=="x"||e.name=="y")||mxUtils.isNumeric(e.value);return n},mxObjectCodec.prototype.beforeEncode=function(t,e,i){return e},mxObjectCodec.prototype.afterEncode=function(t,e,i){return i},mxObjectCodec.prototype.decode=function(t,e,i){var n=e.getAttribute("id"),r=t.objects[n];return r==null&&(r=i||this.cloneTemplate(),n!=null&&t.putObject(n,r)),e=this.beforeDecode(t,e,r),this.decodeNode(t,e,r),this.afterDecode(t,e,r)},mxObjectCodec.prototype.decodeNode=function(t,e,i){e!=null&&(this.decodeAttributes(t,e,i),this.decodeChildren(t,e,i))},mxObjectCodec.prototype.decodeAttributes=function(t,e,i){var n=e.attributes;if(n!=null)for(var r=0;r0&&(n=null),n},mxObjectCodec.prototype.addObjectValue=function(t,e,i,n){i!=null&&i!=n&&(e!=null&&e.length>0?t[e]=i:t.push(i))},mxObjectCodec.prototype.processInclude=function(t,e,i){if(e.nodeName=="include"){var n=e.getAttribute("name");if(n!=null)try{var r=mxUtils.load(n).getDocumentElement();r!=null&&t.decode(r,i)}catch{}return!0}return!1},mxObjectCodec.prototype.beforeDecode=function(t,e,i){return e},mxObjectCodec.prototype.afterDecode=function(t,e,i){return i},__mxOutput.mxObjectCodec=typeof mxObjectCodec<"u"?mxObjectCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);return t.isCellCodec=function(){return!0},t.isNumericAttribute=function(e,i,n){return i.nodeName!=="value"&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)},t.isExcluded=function(e,i,n,r){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||r&&i=="value"&&n.nodeType==mxConstants.NODETYPE_ELEMENT},t.afterEncode=function(e,i,n){if(i.value!=null&&i.value.nodeType==mxConstants.NODETYPE_ELEMENT){var r=n;n=mxUtils.importNode(e.document,i.value,!0),n.appendChild(r);var s=r.getAttribute("id");n.setAttribute("id",s),r.removeAttribute("id")}return n},t.beforeDecode=function(e,i,n){var r=i.cloneNode(!0),s=this.getName();if(i.nodeName!=s){var l=i.getElementsByTagName(s)[0];l!=null&&l.parentNode==i?(mxUtils.removeWhitespace(l,!0),mxUtils.removeWhitespace(l,!1),l.parentNode.removeChild(l),r=l):r=null,n.value=i.cloneNode(!0);var a=n.value.getAttribute("id");a!=null&&(n.setId(a),n.value.removeAttribute("id"))}else n.setId(i.getAttribute("id"));if(r!=null)for(var o=0;o=0},t.isExcluded=function(e,i,n,r){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||r&&n!=null&&(i=="previous"||i=="parent")&&!e.model.contains(n)},t.afterEncode=function(e,i,n){return this.isReference(i,"child",i.child,!0)?n.setAttribute("child",e.getId(i.child)):e.encodeCell(i.child,n),n},t.beforeDecode=function(e,i,n){if(i.firstChild!=null&&i.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){i=i.cloneNode(!0);var r=i.firstChild;n.child=e.decodeCell(r,!1);var s=r.nextSibling;for(r.parentNode.removeChild(r),r=s;r!=null;){if(s=r.nextSibling,r.nodeType==mxConstants.NODETYPE_ELEMENT){var l=r.getAttribute("id");e.lookup(l)==null&&e.decodeCell(r)}r.parentNode.removeChild(r),r=s}}else{var a=i.getAttribute("child");n.child=e.getObject(a)}return i},t.afterDecode=function(e,i,n){return n.child!=null&&(n.child.parent!=null&&n.previous!=null&&n.child.parent!=n.previous&&(n.previous=n.child.parent),n.child.parent=n.previous,n.previous=n.parent,n.previousIndex=n.index),n},t}()),__mxOutput.mxChildChangeCodec=typeof mxChildChangeCodec<"u"?mxChildChangeCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);return t.afterDecode=function(e,i,n){return n.previous=n.terminal,n},t}()),__mxOutput.mxTerminalChangeCodec=typeof mxTerminalChangeCodec<"u"?mxTerminalChangeCodec:void 0;var mxGenericChangeCodec=function(t,e){var i=new mxObjectCodec(t,["model","previous"],["cell"]);return i.afterDecode=function(n,r,s){return mxUtils.isNode(s.cell)&&(s.cell=n.decodeCell(s.cell,!1)),s.previous=s[e],s},i};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value")),mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style")),mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed")),mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value")),__mxOutput.mxGenericChangeCodec=typeof mxGenericChangeCodec<"u"?mxGenericChangeCodec:void 0,mxCodecRegistry.register(function(){return new mxObjectCodec(new mxGraph,["graphListeners","eventListeners","view","container","cellRenderer","editor","selection"])}()),__mxOutput.mxGraphCodec=typeof mxGraphCodec<"u"?mxGraphCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxGraphView);return t.encode=function(e,i){return this.encodeCell(e,i,i.graph.getModel().getRoot())},t.encodeCell=function(e,i,n){var r=i.graph.getModel(),s=i.getState(n),l=r.getParent(n);if(l==null||s!=null){var a=r.getChildCount(n),o=i.graph.getCellGeometry(n),u=null;if(l==r.getRoot()?u="layer":l==null?u="graph":r.isEdge(n)?u="edge":a>0&&o!=null?u="group":r.isVertex(n)&&(u="vertex"),u!=null){var p=e.document.createElement(u),m=i.graph.getLabel(n);if(m!=null&&(p.setAttribute("label",i.graph.getLabel(n)),i.graph.isHtmlLabel(n)&&p.setAttribute("html",!0)),l==null){var d=i.getGraphBounds();d!=null&&(p.setAttribute("x",Math.round(d.x)),p.setAttribute("y",Math.round(d.y)),p.setAttribute("width",Math.round(d.width)),p.setAttribute("height",Math.round(d.height))),p.setAttribute("scale",i.scale)}else if(s!=null&&o!=null){for(var x in s.style){var f=s.style[x];typeof f=="function"&&typeof f=="object"&&(f=mxStyleRegistry.getName(f)),f!=null&&typeof f!="function"&&typeof f!="object"&&p.setAttribute(x,f)}var g=s.absolutePoints;if(g!=null&&g.length>0){for(var c=Math.round(g[0].x)+","+Math.round(g[0].y),x=1;x0&&n.appendChild(l)}}return n},t.getStringValue=function(e,i){var n=typeof i;return n=="function"?i=mxStyleRegistry.getName(i):n=="object"&&(i=null),i},t.decode=function(e,i,n){var r=n||new this.template.constructor,s=i.getAttribute("id");for(s!=null&&(e.objects[s]=r),i=i.firstChild;i!=null;){if(!this.processInclude(e,i,r)&&i.nodeName=="add"){var l=i.getAttribute("as");if(l!=null){var a=i.getAttribute("extend"),o=a!=null?mxUtils.clone(r.styles[a]):null;o==null&&(a!=null&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+a+" not found to extend"),o=new Object);for(var u=i.firstChild;u!=null;){if(u.nodeType==mxConstants.NODETYPE_ELEMENT){var p=u.getAttribute("as");if(u.nodeName=="add"){var m=mxUtils.getTextContent(u),d=null;m!=null&&m.length>0&&mxStylesheetCodec.allowEval?d=mxUtils.eval(m):(d=u.getAttribute("value"),mxUtils.isNumeric(d)&&(d=parseFloat(d))),d!=null&&(o[p]=d)}else u.nodeName=="remove"&&delete o[p]}u=u.nextSibling}r.putCellStyle(l,o)}}i=i.nextSibling}return r},t}());mxStylesheetCodec.allowEval=!0,__mxOutput.mxStylesheetCodec=typeof mxStylesheetCodec<"u"?mxStylesheetCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultKeyHandler);return t.encode=function(e,i){return null},t.decode=function(e,i,n){if(n!=null)for(n.editor,i=i.firstChild;i!=null;){if(!this.processInclude(e,i,n)&&i.nodeName=="add"){var r=i.getAttribute("as"),s=i.getAttribute("action"),l=i.getAttribute("control");n.bindAction(r,s,l)}i=i.nextSibling}return n},t}()),__mxOutput.mxDefaultKeyHandlerCodec=typeof mxDefaultKeyHandlerCodec<"u"?mxDefaultKeyHandlerCodec:void 0;var mxDefaultToolbarCodec=mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultToolbar);return t.encode=function(e,i){return null},t.decode=function(e,i,n){if(n!=null){var r=n.editor;for(i=i.firstChild;i!=null;){if(i.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(e,i,n)){if(i.nodeName=="separator")n.addSeparator();else if(i.nodeName=="br")n.toolbar.addBreak();else if(i.nodeName=="hr")n.toolbar.addLine();else if(i.nodeName=="add"){var s=i.getAttribute("as");s=mxResources.get(s)||s;var l=i.getAttribute("icon"),a=i.getAttribute("pressedIcon"),o=i.getAttribute("action"),u=i.getAttribute("mode"),p=i.getAttribute("template"),m=i.getAttribute("toggle")!="0",d=mxUtils.getTextContent(i),x=null;if(o!=null)x=n.addItem(s,l,o,a);else if(u!=null){var f=mxDefaultToolbarCodec.allowEval?mxUtils.eval(d):null;x=n.addMode(s,l,u,a,f)}else if(p!=null||d!=null&&d.length>0){var g=r.templates[p],c=i.getAttribute("style");g!=null&&c!=null&&(g=r.graph.cloneCell(g),g.setStyle(c));var v=null;d!=null&&d.length>0&&mxDefaultToolbarCodec.allowEval&&(v=mxUtils.eval(d)),x=n.addPrototype(s,l,g,a,v,m)}else{var y=mxUtils.getChildNodes(i);if(y.length>0)if(l==null)for(var T=n.addActionCombo(s),C=0;C0&&x.setAttribute("id",O)}}}i=i.nextSibling}}return n},t}());return mxDefaultToolbarCodec.allowEval=!0,__mxOutput.mxDefaultToolbarCodec=typeof mxDefaultToolbarCodec<"u"?mxDefaultToolbarCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultPopupMenu);return t.encode=function(e,i){return null},t.decode=function(e,i,n){var r=i.getElementsByTagName("include")[0];return r!=null?this.processInclude(e,r,n):n!=null&&(n.config=i),n},t}()),__mxOutput.mxDefaultPopupMenuCodec=typeof mxDefaultPopupMenuCodec<"u"?mxDefaultPopupMenuCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxEditor,["modified","lastSnapshot","ignoredChanges","undoManager","graphContainer","toolbarContainer"]);return t.afterDecode=function(e,i,n){var r=i.getAttribute("defaultEdge");r!=null&&(i.removeAttribute("defaultEdge"),n.defaultEdge=n.templates[r]);var s=i.getAttribute("defaultGroup");return s!=null&&(i.removeAttribute("defaultGroup"),n.defaultGroup=n.templates[s]),n},t.decodeChild=function(e,i,n){if(i.nodeName=="Array"){var r=i.getAttribute("as");if(r=="templates"){this.decodeTemplates(e,i,n);return}}else if(i.nodeName=="ui"){this.decodeUi(e,i,n);return}mxObjectCodec.prototype.decodeChild.apply(this,arguments)},t.decodeUi=function(e,i,n){for(var r=i.firstChild;r!=null;){if(r.nodeName=="add"){var s=r.getAttribute("as"),l=r.getAttribute("element"),a=r.getAttribute("style"),o=null;if(l!=null)o=document.getElementById(l),o!=null&&a!=null&&(o.style.cssText+=";"+a);else{var u=parseInt(r.getAttribute("x")),p=parseInt(r.getAttribute("y")),m=r.getAttribute("width"),d=r.getAttribute("height");o=document.createElement("div"),o.style.cssText=a;var x=new mxWindow(mxResources.get(s)||s,o,u,p,m,d,!1,!0);x.setVisible(!0)}s=="graph"?n.setGraphContainer(o):s=="toolbar"?n.setToolbarContainer(o):s=="title"?n.setTitleContainer(o):s=="status"?n.setStatusContainer(o):s=="map"&&n.setMapContainer(o)}else r.nodeName=="resource"?mxResources.add(r.getAttribute("basename")):r.nodeName=="stylesheet"&&mxClient.link("stylesheet",r.getAttribute("name"));r=r.nextSibling}},t.decodeTemplates=function(e,i,n){n.templates==null&&(n.templates=[]);for(var r=mxUtils.getChildNodes(i),s=0;s "+e.convertValueToString(i)+t),i=e.getModel().getParent(i);var n=this.getRootTitle();return n+t},mxEditor.prototype.getRootTitle=function(){var t=this.graph.getModel().getRoot();return this.graph.convertValueToString(t)},mxEditor.prototype.undo=function(){this.undoManager.undo()},mxEditor.prototype.redo=function(){this.undoManager.redo()},mxEditor.prototype.groupCells=function(){var t=this.groupBorderSize!=null?this.groupBorderSize:this.graph.gridSize;return this.graph.groupCells(this.createGroup(),t)},mxEditor.prototype.createGroup=function(){var t=this.graph.getModel();return t.cloneCell(this.defaultGroup)},mxEditor.prototype.open=function(t){if(t!=null){var e=mxUtils.load(t).getXml();this.readGraphModel(e.documentElement),this.filename=t,this.fireEvent(new mxEventObject(mxEvent.OPEN,"filename",t))}},mxEditor.prototype.readGraphModel=function(t){var e=new mxCodec(t.ownerDocument);e.decode(t,this.graph.getModel()),this.resetHistory()},mxEditor.prototype.save=function(t,e){if(t=t||this.getUrlPost(),t!=null&&t.length>0){var i=this.writeGraphModel(e);this.postDiagram(t,i),this.setModified(!1)}this.fireEvent(new mxEventObject(mxEvent.SAVE,"url",t))},mxEditor.prototype.postDiagram=function(t,e){this.escapePostData&&(e=encodeURIComponent(e)),mxUtils.post(t,this.postParameterName+"="+e,mxUtils.bind(this,function(i){this.fireEvent(new mxEventObject(mxEvent.POST,"request",i,"url",t,"data",e))}))},mxEditor.prototype.writeGraphModel=function(t){t=t??this.linefeed;var e=new mxCodec,i=e.encode(this.graph.getModel());return mxUtils.getXml(i,t)},mxEditor.prototype.getUrlPost=function(){return this.urlPost},mxEditor.prototype.getUrlImage=function(){return this.urlImage},mxEditor.prototype.swapStyles=function(t,e){var i=this.graph.getStylesheet().styles[e];this.graph.getView().getStylesheet().putCellStyle(e,this.graph.getStylesheet().styles[t]),this.graph.getStylesheet().putCellStyle(t,i),this.graph.refresh()},mxEditor.prototype.showProperties=function(t){if(t=t||this.graph.getSelectionCell(),t==null&&(t=this.graph.getCurrentRoot(),t==null&&(t=this.graph.getModel().getRoot())),t!=null){this.graph.stopEditing(!0);var e=mxUtils.getOffset(this.graph.container),i=e.x+10,n=e.y;if(this.properties!=null&&!this.movePropertiesDialog)i=this.properties.getX(),n=this.properties.getY();else{var r=this.graph.getCellBounds(t);r!=null&&(i+=r.x+Math.min(200,r.width),n+=r.y)}this.hideProperties();var s=this.createProperties(t);s!=null&&(this.properties=new mxWindow(mxResources.get(this.propertiesResource)||this.propertiesResource,s,i,n,this.propertiesWidth,this.propertiesHeight,!1),this.properties.setVisible(!0))}},mxEditor.prototype.isPropertiesVisible=function(){return this.properties!=null},mxEditor.prototype.createProperties=function(t){var e=this.graph.getModel(),i=e.getValue(t);if(mxUtils.isNode(i)){var n=new mxForm("properties"),r=n.addText("ID",t.getId());r.setAttribute("readonly","true");var s=null,l=null,a=null,o=null,u=null;e.isVertex(t)&&(s=e.getGeometry(t),s!=null&&(l=n.addText("top",s.y),a=n.addText("left",s.x),o=n.addText("width",s.width),u=n.addText("height",s.height)));for(var p=e.getStyle(t),m=n.addText("Style",p||""),d=i.attributes,x=[],f=0;f0?e.setStyle(t,m.value):e.setStyle(t,null);for(var y=0;y0&&this.graph.isSwimlane(t)?this.cycleAttributeValues[this.cycleAttributeIndex++%this.cycleAttributeValues.length]:null},mxEditor.prototype.cycleAttribute=function(t){if(this.cycleAttributeName!=null){var e=this.consumeCycleAttribute(t);e!=null&&t.setStyle(t.getStyle()+";"+this.cycleAttributeName+"="+e)}},mxEditor.prototype.addVertex=function(t,e,i,n){for(var r=this.graph.getModel();t!=null&&!this.graph.isValidDropTarget(t);)t=r.getParent(t);t=t??this.graph.getSwimlaneAt(i,n);var s=this.graph.getView().scale,l=r.getGeometry(e),a=r.getGeometry(t);if(this.graph.isSwimlane(e)&&!this.graph.swimlaneNesting)t=null;else{if(t==null&&this.swimlaneRequired)return null;if(t!=null&&a!=null){var o=this.graph.getView().getState(t);if(o!=null){if(i-=o.origin.x*s,n-=o.origin.y*s,this.graph.isConstrainedMoving){var u=l.width,p=l.height,m=o.x+o.width;i+u>m&&(i-=i+u-m),m=o.y+o.height,n+p>m&&(n-=n+p-m)}}else a!=null&&(i-=a.x*s,n-=a.y*s)}}l=l.clone(),l.x=this.graph.snap(i/s-this.graph.getView().translate.x-this.graph.gridSize/2),l.y=this.graph.snap(n/s-this.graph.getView().translate.y-this.graph.gridSize/2),e.setGeometry(l),t==null&&(t=this.graph.getDefaultParent()),this.cycleAttribute(e),this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",e,"parent",t)),r.beginUpdate();try{e=this.graph.addCell(e,t),e!=null&&(this.graph.constrainChild(e),this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",e)))}finally{r.endUpdate()}return e!=null&&(this.graph.setSelectionCell(e),this.graph.scrollCellToVisible(e),this.fireEvent(new mxEventObject(mxEvent.AFTER_ADD_VERTEX,"vertex",e))),e},mxEditor.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.tasks!=null&&this.tasks.destroy(),this.outline!=null&&this.outline.destroy(),this.properties!=null&&this.properties.destroy(),this.keyHandler!=null&&this.keyHandler.destroy(),this.rubberband!=null&&this.rubberband.destroy(),this.toolbar!=null&&this.toolbar.destroy(),this.graph!=null&&this.graph.destroy(),this.status=null,this.templates=null)},__mxOutput.mxEditor=typeof mxEditor<"u"?mxEditor:void 0;var mxCodecRegistry={codecs:[],aliases:[],register:function(t){if(t!=null){var e=t.getName();mxCodecRegistry.codecs[e]=t;var i=mxUtils.getFunctionName(t.template.constructor);i!=e&&mxCodecRegistry.addAlias(i,e)}return t},addAlias:function(t,e){mxCodecRegistry.aliases[t]=e},getCodec:function(t){var e=null;if(t!=null){var i=mxUtils.getFunctionName(t),n=mxCodecRegistry.aliases[i];if(n!=null&&(i=n),e=mxCodecRegistry.codecs[i],e==null)try{e=new mxObjectCodec(new t),mxCodecRegistry.register(e)}catch{}}return e}};__mxOutput.mxCodecRegistry=typeof mxCodecRegistry<"u"?mxCodecRegistry:void 0;function mxCodec(t){this.document=t||mxUtils.createXmlDocument(),this.objects=[]}mxCodec.prototype.document=null,mxCodec.prototype.objects=null,mxCodec.prototype.elements=null,mxCodec.prototype.encodeDefaults=!1,mxCodec.prototype.putObject=function(t,e){return this.objects[t]=e,e},mxCodec.prototype.getObject=function(t){var e=null;if(t!=null&&(e=this.objects[t],e==null&&(e=this.lookup(t),e==null))){var i=this.getElementById(t);i!=null&&(e=this.decode(i))}return e},mxCodec.prototype.lookup=function(t){return null},mxCodec.prototype.getElementById=function(t){return this.updateElements(),this.elements[t]},mxCodec.prototype.updateElements=function(){this.elements==null&&(this.elements=new Object,this.document.documentElement!=null&&this.addElement(this.document.documentElement))},mxCodec.prototype.addElement=function(t){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var e=t.getAttribute("id");if(e!=null){if(this.elements[e]==null)this.elements[e]=t;else if(this.elements[e]!=t)throw new Error(e+": Duplicate ID")}}for(t=t.firstChild;t!=null;)this.addElement(t),t=t.nextSibling},mxCodec.prototype.getId=function(t){var e=null;return t!=null&&(e=this.reference(t),e==null&&t instanceof mxCell&&(e=t.getId(),e==null&&(e=mxCellPath.create(t),e.length==0&&(e="root")))),e},mxCodec.prototype.reference=function(t){return null},mxCodec.prototype.encode=function(t){var e=null;if(t!=null&&t.constructor!=null){var i=mxCodecRegistry.getCodec(t.constructor);i!=null?e=i.encode(this,t):mxUtils.isNode(t)?e=mxUtils.importNode(this.document,t,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(t.constructor))}return e},mxCodec.prototype.decode=function(t,e){this.updateElements();var i=null;if(t!=null&&t.nodeType==mxConstants.NODETYPE_ELEMENT){var n=null;try{n=window[t.nodeName]}catch{}var r=mxCodecRegistry.getCodec(n);r!=null?i=r.decode(this,t,e):(i=t.cloneNode(!0),i.removeAttribute("as"))}return i},mxCodec.prototype.encodeCell=function(t,e,i){if(e.appendChild(this.encode(t)),i==null||i)for(var n=t.getChildCount(),r=0;r=0},mxObjectCodec.prototype.isReference=function(t,e,i,n){return mxUtils.indexOf(this.idrefs,e)>=0},mxObjectCodec.prototype.encode=function(t,e){var i=t.document.createElement(this.getName());return e=this.beforeEncode(t,e,i),this.encodeObject(t,e,i),this.afterEncode(t,e,i)},mxObjectCodec.prototype.encodeObject=function(t,e,i){t.setAttribute(i,"id",t.getId(e));for(var n in e){var r=n,s=e[r];s!=null&&!this.isExcluded(e,r,s,!0)&&(mxUtils.isInteger(r)&&(r=null),this.encodeValue(t,e,r,s,i))}},mxObjectCodec.prototype.encodeValue=function(t,e,i,n,r){if(n!=null){if(this.isReference(e,i,n,!0)){var s=t.getId(n);if(s==null){mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+i+"="+n);return}n=s}var l=this.template[i];(i==null||t.encodeDefaults||l!=n)&&(i=this.getAttributeName(i),this.writeAttribute(t,e,i,n,r))}},mxObjectCodec.prototype.writeAttribute=function(t,e,i,n,r){typeof n!="object"?this.writePrimitiveAttribute(t,e,i,n,r):this.writeComplexAttribute(t,e,i,n,r)},mxObjectCodec.prototype.writePrimitiveAttribute=function(t,e,i,n,r){if(n=this.convertAttributeToXml(t,e,i,n,r),i==null){var s=t.document.createElement("add");typeof n=="function"?s.appendChild(t.document.createTextNode(n)):t.setAttribute(s,"value",n),r.appendChild(s)}else typeof n!="function"&&t.setAttribute(r,i,n)},mxObjectCodec.prototype.writeComplexAttribute=function(t,e,i,n,r){var s=t.encode(n);s!=null?(i!=null&&s.setAttribute("as",i),r.appendChild(s)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+i+": "+n)},mxObjectCodec.prototype.convertAttributeToXml=function(t,e,i,n){return this.isBooleanAttribute(t,e,i,n)&&(n=n==!0?"1":"0"),n},mxObjectCodec.prototype.isBooleanAttribute=function(t,e,i,n){return typeof n.length>"u"&&(n==!0||n==!1)},mxObjectCodec.prototype.convertAttributeFromXml=function(t,e,i){var n=e.value;return this.isNumericAttribute(t,e,i)&&(n=parseFloat(n),(isNaN(n)||!isFinite(n))&&(n=0)),n},mxObjectCodec.prototype.isNumericAttribute=function(t,e,i){var n=i.constructor==mxGeometry&&(e.name=="x"||e.name=="y"||e.name=="width"||e.name=="height")||i.constructor==mxPoint&&(e.name=="x"||e.name=="y")||mxUtils.isNumeric(e.value);return n},mxObjectCodec.prototype.beforeEncode=function(t,e,i){return e},mxObjectCodec.prototype.afterEncode=function(t,e,i){return i},mxObjectCodec.prototype.decode=function(t,e,i){var n=e.getAttribute("id"),r=t.objects[n];return r==null&&(r=i||this.cloneTemplate(),n!=null&&t.putObject(n,r)),e=this.beforeDecode(t,e,r),this.decodeNode(t,e,r),this.afterDecode(t,e,r)},mxObjectCodec.prototype.decodeNode=function(t,e,i){e!=null&&(this.decodeAttributes(t,e,i),this.decodeChildren(t,e,i))},mxObjectCodec.prototype.decodeAttributes=function(t,e,i){var n=e.attributes;if(n!=null)for(var r=0;r0&&(n=null),n},mxObjectCodec.prototype.addObjectValue=function(t,e,i,n){i!=null&&i!=n&&(e!=null&&e.length>0?t[e]=i:t.push(i))},mxObjectCodec.prototype.processInclude=function(t,e,i){if(e.nodeName=="include"){var n=e.getAttribute("name");if(n!=null)try{var r=mxUtils.load(n).getDocumentElement();r!=null&&t.decode(r,i)}catch{}return!0}return!1},mxObjectCodec.prototype.beforeDecode=function(t,e,i){return e},mxObjectCodec.prototype.afterDecode=function(t,e,i){return i},__mxOutput.mxObjectCodec=typeof mxObjectCodec<"u"?mxObjectCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);return t.isCellCodec=function(){return!0},t.isNumericAttribute=function(e,i,n){return i.nodeName!=="value"&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)},t.isExcluded=function(e,i,n,r){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||r&&i=="value"&&n.nodeType==mxConstants.NODETYPE_ELEMENT},t.afterEncode=function(e,i,n){if(i.value!=null&&i.value.nodeType==mxConstants.NODETYPE_ELEMENT){var r=n;n=mxUtils.importNode(e.document,i.value,!0),n.appendChild(r);var s=r.getAttribute("id");n.setAttribute("id",s),r.removeAttribute("id")}return n},t.beforeDecode=function(e,i,n){var r=i.cloneNode(!0),s=this.getName();if(i.nodeName!=s){var l=i.getElementsByTagName(s)[0];l!=null&&l.parentNode==i?(mxUtils.removeWhitespace(l,!0),mxUtils.removeWhitespace(l,!1),l.parentNode.removeChild(l),r=l):r=null,n.value=i.cloneNode(!0);var a=n.value.getAttribute("id");a!=null&&(n.setId(a),n.value.removeAttribute("id"))}else n.setId(i.getAttribute("id"));if(r!=null)for(var o=0;o=0},t.isExcluded=function(e,i,n,r){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||r&&n!=null&&(i=="previous"||i=="parent")&&!e.model.contains(n)},t.afterEncode=function(e,i,n){return this.isReference(i,"child",i.child,!0)?n.setAttribute("child",e.getId(i.child)):e.encodeCell(i.child,n),n},t.beforeDecode=function(e,i,n){if(i.firstChild!=null&&i.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){i=i.cloneNode(!0);var r=i.firstChild;n.child=e.decodeCell(r,!1);var s=r.nextSibling;for(r.parentNode.removeChild(r),r=s;r!=null;){if(s=r.nextSibling,r.nodeType==mxConstants.NODETYPE_ELEMENT){var l=r.getAttribute("id");e.lookup(l)==null&&e.decodeCell(r)}r.parentNode.removeChild(r),r=s}}else{var a=i.getAttribute("child");n.child=e.getObject(a)}return i},t.afterDecode=function(e,i,n){return n.child!=null&&(n.child.parent!=null&&n.previous!=null&&n.child.parent!=n.previous&&(n.previous=n.child.parent),n.child.parent=n.previous,n.previous=n.parent,n.previousIndex=n.index),n},t}()),__mxOutput.mxChildChangeCodec=typeof mxChildChangeCodec<"u"?mxChildChangeCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);return t.afterDecode=function(e,i,n){return n.previous=n.terminal,n},t}()),__mxOutput.mxTerminalChangeCodec=typeof mxTerminalChangeCodec<"u"?mxTerminalChangeCodec:void 0;var mxGenericChangeCodec=function(t,e){var i=new mxObjectCodec(t,["model","previous"],["cell"]);return i.afterDecode=function(n,r,s){return mxUtils.isNode(s.cell)&&(s.cell=n.decodeCell(s.cell,!1)),s.previous=s[e],s},i};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value")),mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style")),mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed")),mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value")),__mxOutput.mxGenericChangeCodec=typeof mxGenericChangeCodec<"u"?mxGenericChangeCodec:void 0,mxCodecRegistry.register(function(){return new mxObjectCodec(new mxGraph,["graphListeners","eventListeners","view","container","cellRenderer","editor","selection"])}()),__mxOutput.mxGraphCodec=typeof mxGraphCodec<"u"?mxGraphCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxGraphView);return t.encode=function(e,i){return this.encodeCell(e,i,i.graph.getModel().getRoot())},t.encodeCell=function(e,i,n){var r=i.graph.getModel(),s=i.getState(n),l=r.getParent(n);if(l==null||s!=null){var a=r.getChildCount(n),o=i.graph.getCellGeometry(n),u=null;if(l==r.getRoot()?u="layer":l==null?u="graph":r.isEdge(n)?u="edge":a>0&&o!=null?u="group":r.isVertex(n)&&(u="vertex"),u!=null){var p=e.document.createElement(u),m=i.graph.getLabel(n);if(m!=null&&(p.setAttribute("label",i.graph.getLabel(n)),i.graph.isHtmlLabel(n)&&p.setAttribute("html",!0)),l==null){var d=i.getGraphBounds();d!=null&&(p.setAttribute("x",Math.round(d.x)),p.setAttribute("y",Math.round(d.y)),p.setAttribute("width",Math.round(d.width)),p.setAttribute("height",Math.round(d.height))),p.setAttribute("scale",i.scale)}else if(s!=null&&o!=null){for(var x in s.style){var f=s.style[x];typeof f=="function"&&typeof f=="object"&&(f=mxStyleRegistry.getName(f)),f!=null&&typeof f!="function"&&typeof f!="object"&&p.setAttribute(x,f)}var g=s.absolutePoints;if(g!=null&&g.length>0){for(var c=Math.round(g[0].x)+","+Math.round(g[0].y),x=1;x0&&n.appendChild(l)}}return n},t.getStringValue=function(e,i){var n=typeof i;return n=="function"?i=mxStyleRegistry.getName(i):n=="object"&&(i=null),i},t.decode=function(e,i,n){var r=n||new this.template.constructor,s=i.getAttribute("id");for(s!=null&&(e.objects[s]=r),i=i.firstChild;i!=null;){if(!this.processInclude(e,i,r)&&i.nodeName=="add"){var l=i.getAttribute("as");if(l!=null){var a=i.getAttribute("extend"),o=a!=null?mxUtils.clone(r.styles[a]):null;o==null&&(a!=null&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+a+" not found to extend"),o=new Object);for(var u=i.firstChild;u!=null;){if(u.nodeType==mxConstants.NODETYPE_ELEMENT){var p=u.getAttribute("as");if(u.nodeName=="add"){var m=mxUtils.getTextContent(u),d=null;m!=null&&m.length>0&&mxStylesheetCodec.allowEval?d=mxUtils.eval(m):(d=u.getAttribute("value"),mxUtils.isNumeric(d)&&(d=parseFloat(d))),d!=null&&(o[p]=d)}else u.nodeName=="remove"&&delete o[p]}u=u.nextSibling}r.putCellStyle(l,o)}}i=i.nextSibling}return r},t}());mxStylesheetCodec.allowEval=!0,__mxOutput.mxStylesheetCodec=typeof mxStylesheetCodec<"u"?mxStylesheetCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultKeyHandler);return t.encode=function(e,i){return null},t.decode=function(e,i,n){if(n!=null)for(n.editor,i=i.firstChild;i!=null;){if(!this.processInclude(e,i,n)&&i.nodeName=="add"){var r=i.getAttribute("as"),s=i.getAttribute("action"),l=i.getAttribute("control");n.bindAction(r,s,l)}i=i.nextSibling}return n},t}()),__mxOutput.mxDefaultKeyHandlerCodec=typeof mxDefaultKeyHandlerCodec<"u"?mxDefaultKeyHandlerCodec:void 0;var mxDefaultToolbarCodec=mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultToolbar);return t.encode=function(e,i){return null},t.decode=function(e,i,n){if(n!=null){var r=n.editor;for(i=i.firstChild;i!=null;){if(i.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(e,i,n)){if(i.nodeName=="separator")n.addSeparator();else if(i.nodeName=="br")n.toolbar.addBreak();else if(i.nodeName=="hr")n.toolbar.addLine();else if(i.nodeName=="add"){var s=i.getAttribute("as");s=mxResources.get(s)||s;var l=i.getAttribute("icon"),a=i.getAttribute("pressedIcon"),o=i.getAttribute("action"),u=i.getAttribute("mode"),p=i.getAttribute("template"),m=i.getAttribute("toggle")!="0",d=mxUtils.getTextContent(i),x=null;if(o!=null)x=n.addItem(s,l,o,a);else if(u!=null){var f=mxDefaultToolbarCodec.allowEval?mxUtils.eval(d):null;x=n.addMode(s,l,u,a,f)}else if(p!=null||d!=null&&d.length>0){var g=r.templates[p],c=i.getAttribute("style");g!=null&&c!=null&&(g=r.graph.cloneCell(g),g.setStyle(c));var v=null;d!=null&&d.length>0&&mxDefaultToolbarCodec.allowEval&&(v=mxUtils.eval(d)),x=n.addPrototype(s,l,g,a,v,m)}else{var y=mxUtils.getChildNodes(i);if(y.length>0)if(l==null)for(var T=n.addActionCombo(s),C=0;C0&&x.setAttribute("id",O)}}}i=i.nextSibling}}return n},t}());return mxDefaultToolbarCodec.allowEval=!0,__mxOutput.mxDefaultToolbarCodec=typeof mxDefaultToolbarCodec<"u"?mxDefaultToolbarCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultPopupMenu);return t.encode=function(e,i){return null},t.decode=function(e,i,n){var r=i.getElementsByTagName("include")[0];return r!=null?this.processInclude(e,r,n):n!=null&&(n.config=i),n},t}()),__mxOutput.mxDefaultPopupMenuCodec=typeof mxDefaultPopupMenuCodec<"u"?mxDefaultPopupMenuCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxEditor,["modified","lastSnapshot","ignoredChanges","undoManager","graphContainer","toolbarContainer"]);return t.afterDecode=function(e,i,n){var r=i.getAttribute("defaultEdge");r!=null&&(i.removeAttribute("defaultEdge"),n.defaultEdge=n.templates[r]);var s=i.getAttribute("defaultGroup");return s!=null&&(i.removeAttribute("defaultGroup"),n.defaultGroup=n.templates[s]),n},t.decodeChild=function(e,i,n){if(i.nodeName=="Array"){var r=i.getAttribute("as");if(r=="templates"){this.decodeTemplates(e,i,n);return}}else if(i.nodeName=="ui"){this.decodeUi(e,i,n);return}mxObjectCodec.prototype.decodeChild.apply(this,arguments)},t.decodeUi=function(e,i,n){for(var r=i.firstChild;r!=null;){if(r.nodeName=="add"){var s=r.getAttribute("as"),l=r.getAttribute("element"),a=r.getAttribute("style"),o=null;if(l!=null)o=document.getElementById(l),o!=null&&a!=null&&(o.style.cssText+=";"+a);else{var u=parseInt(r.getAttribute("x")),p=parseInt(r.getAttribute("y")),m=r.getAttribute("width"),d=r.getAttribute("height");o=document.createElement("div"),o.style.cssText=a;var x=new mxWindow(mxResources.get(s)||s,o,u,p,m,d,!1,!0);x.setVisible(!0)}s=="graph"?n.setGraphContainer(o):s=="toolbar"?n.setToolbarContainer(o):s=="title"?n.setTitleContainer(o):s=="status"?n.setStatusContainer(o):s=="map"&&n.setMapContainer(o)}else r.nodeName=="resource"?mxResources.add(r.getAttribute("basename")):r.nodeName=="stylesheet"&&mxClient.link("stylesheet",r.getAttribute("name"));r=r.nextSibling}},t.decodeTemplates=function(e,i,n){n.templates==null&&(n.templates=[]);for(var r=mxUtils.getChildNodes(i),s=0;s -
+
  • -
    +
    @@ -49,7 +49,7 @@
    @@ -78,7 +78,7 @@