From 6ce736834cc19acbe28926031700026e0c8b4ac6 Mon Sep 17 00:00:00 2001 From: Process Analytics Bot <62586190+process-analytics-bot@users.noreply.github.com> Date: Mon, 2 Sep 2024 13:51:10 +0200 Subject: [PATCH] chore(deps): bump bpmn-visualization to 0.44.0 (#599) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added a workaround for the “parcel” project, which can't use es-toolkit properly otherwise. --------- Co-authored-by: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> --- demo/draw-path/index.html | 2 +- demo/hacktoberfest-custom-themes/index.html | 2 +- demo/load-and-navigation/assets/index.css | 2 +- demo/load-and-navigation/assets/main.js | 20 +++++++++---------- demo/load-and-navigation/index.html | 2 +- .../index.html | 2 +- demo/prediction/index.html | 2 +- .../apply-css-classes/index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../growing-sequence-flow/index.html | 2 +- .../javascript-tooltip-and-popover/index.html | 2 +- .../running-dashed-message-flow/index.html | 2 +- .../select-elements-by-bpmn-kind/index.html | 2 +- .../custom-colors/index.html | 2 +- .../custom-edge-marker-colors/index.html | 2 +- .../custom-bpmn-theme/custom-fonts/index.html | 2 +- .../custom-user-task-icon/index.html | 2 +- .../diagram-fit-after-load/index.html | 2 +- .../diagram-fit-on-load/index.html | 2 +- .../diagram-navigation/index.html | 2 +- .../load-local-bpmn-diagrams/index.html | 2 +- .../load-remote-bpmn-diagrams/index.html | 2 +- .../pools-filter-on-load/index.html | 2 +- examples/misc/compare-with-bpmn-js/index.html | 2 +- .../index.html | 2 +- examples/overlays/add-remove/index.html | 2 +- examples/overlays/add-stylized/index.html | 2 +- .../custom-overlay-default-style/index.html | 2 +- .../package.json | 2 +- projects/typescript-angular/package.json | 2 +- projects/typescript-lit-element/package.json | 2 +- .../typescript-vanilla-with-parcel/README.md | 16 +++++++++++++-- .../package.json | 6 +++++- .../package.json | 2 +- .../package.json | 2 +- projects/typescript-vue/package.json | 2 +- 38 files changed, 64 insertions(+), 48 deletions(-) diff --git a/demo/draw-path/index.html b/demo/draw-path/index.html index 68907122..16f9f989 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 082f666f..9c58fac9 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 5511c3a5..8cf18278 100644 --- a/demo/load-and-navigation/assets/index.css +++ b/demo/load-and-navigation/assets/index.css @@ -1 +1 @@ -/*! tailwindcss v3.4.1 | 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;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-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]{display:none}*,: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: }::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: }.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))}.border-red-600{--tw-border-opacity:1;border-color:rgb(220 38 38/var(--tw-border-opacity))}.border-transparent{border-color:transparent}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.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{padding-bottom:0}.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))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.text-red-900{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.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))}.hover\:text-red-900:hover{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity))}@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))}.md\:border-purple-500{--tw-border-opacity:1;border-color:rgb(168 85 247/var(--tw-border-opacity))}.md\:border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.md\:border-yellow-500{--tw-border-opacity:1;border-color:rgb(234 179 8/var(--tw-border-opacity))}.md\:border-b-fuchsia-400{--tw-border-opacity:1;border-bottom-color:rgb(232 121 249/var(--tw-border-opacity))}.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 v3.4.10 | 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]{display:none}*,: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: }.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))}.border-red-600{--tw-border-opacity:1;border-color:rgb(220 38 38/var(--tw-border-opacity))}.border-transparent{border-color:transparent}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.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))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.text-red-900{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.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))}.hover\:text-red-900:hover{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity))}@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))}.md\:border-purple-500{--tw-border-opacity:1;border-color:rgb(168 85 247/var(--tw-border-opacity))}.md\:border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.md\:border-yellow-500{--tw-border-opacity:1;border-color:rgb(234 179 8/var(--tw-border-opacity))}.md\:border-b-fuchsia-400{--tw-border-opacity:1;border-bottom-color:rgb(232 121 249/var(--tw-border-opacity))}.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}} diff --git a/demo/load-and-navigation/assets/main.js b/demo/load-and-navigation/assets/main.js index 634fc9fa..97ca605a 100644 --- a/demo/load-and-navigation/assets/main.js +++ b/demo/load-and-navigation/assets/main.js @@ -1,11 +1,11 @@ -var nn=Object.defineProperty;var sn=(n,e,t)=>e in n?nn(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var g=(n,e,t)=>(sn(n,typeof e!="symbol"?e+"":e,t),t);import{f as on}from"./mxgraph.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.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 r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function t(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=t(i);fetch(i.href,o)}})();var ce=(n=>(n.None="None",n.HorizontalVertical="HorizontalVertical",n.Horizontal="Horizontal",n.Vertical="Vertical",n.Center="Center",n))(ce||{}),rn=(n=>(n.In="in",n.Out="out",n))(rn||{});function ln(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||{}),ue=(n=>(n.CALLING_PROCESS="process",n.CALLING_GLOBAL_TASK="global task",n))(ue||{}),de=(n=>(n.Exclusive="Exclusive",n.None="None",n.Parallel="Parallel",n))(de||{}),R=(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))(R||{}),w=(n=>(n.ADHOC="adhoc",n.COMPENSATION="compensation",n.EXPAND="expand",n.LOOP="loop",n.MULTI_INSTANCE_PARALLEL="parallel multi instance",n.MULTI_INSTANCE_SEQUENTIAL="sequential multi instance",n))(w||{}),D=(n=>(n.AD_HOC="ad_hoc",n.EMBEDDED="embedded",n.EVENT="event",n.TRANSACTION="transaction",n))(D||{});function an(n,e){return n===""?e?{}:void 0:n}function C(n,e=!1){return n==null?[]:(Array.isArray(n)?n:[n]).map(t=>an(t,e)).filter(Boolean)}function cn(n,e,t){const s=[];t!=null&&t.startingWith?s.push(`^(${t.startingWith}).*`):t!=null&&t.notStartingWith&&s.push(`^(?!(${t.notStartingWith})).*`),s.push(`${e}$`);const i=s.join("");return n.filter(o=>t!=null&&t.ignoreCase?new RegExp(i,"i").test(o):new RegExp(i).test(o))}class I{static isEvent(e){return Ee(st,e)}static eventKinds(){return[...st]}static isBoundaryEvent(e){return h.EVENT_BOUNDARY===e}static isStartEvent(e){return h.EVENT_START===e}static isCatchEvent(e){return h.EVENT_INTERMEDIATE_CATCH===e||h.EVENT_BOUNDARY===e||h.EVENT_START===e}static isIntermediateCatchEvent(e){return h.EVENT_INTERMEDIATE_CATCH===e}static isIntermediateThrowEvent(e){return h.EVENT_INTERMEDIATE_THROW===e}static isCallActivity(e){return h.CALL_ACTIVITY===e}static isSubProcess(e){return h.SUB_PROCESS===e}static canHaveNoneEvent(e){return h.EVENT_INTERMEDIATE_THROW===e||h.EVENT_END===e||h.EVENT_START===e}static isActivity(e){return Ee(xe,e)}static activityKinds(){return[...xe]}static isWithDefaultSequenceFlow(e){return un.has(e)}static isTask(e){return Ee(ke,e)}static taskKinds(){return[...ke]}static gatewayKinds(){return[...it]}static isGateway(e){return Ee(it,e)}static flowNodeKinds(){return Object.values(h).filter(e=>!I.isPoolOrLane(e))}static isPoolOrLane(e){return e==h.POOL||e==h.LANE}}function He(n,e){return cn(Object.values(h),n,e)}function Ee(n,e){return Object.values(n).map(t=>t).includes(e)}const st=He("Event"),it=He("Gateway"),ke=He("Task",{ignoreCase:!0,notStartingWith:"global"}),xe=[...ke,h.CALL_ACTIVITY,h.SUB_PROCESS],un=new Set([...xe,h.GATEWAY_EXCLUSIVE,h.GATEWAY_INCLUSIVE,h.GATEWAY_COMPLEX]),At=Object.values(R).filter(n=>n!=R.NONE);var q=(n=>(n.NONE="None",n.ONE="One",n.BOTH="Both",n))(q||{}),B=(n=>(n.SEQUENCE_FLOW="sequenceFlow",n.MESSAGE_FLOW="messageFlow",n.ASSOCIATION_FLOW="association",n))(B||{}),ge=(n=>(n.NONE="none",n.INITIATING="initiating",n.NON_INITIATING="non_initiating",n))(ge||{}),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 ve{constructor(e,t,s,i,o){this.id=e,this.name=t,this.kind=s,this.sourceReferenceId=i,this.targetReferenceId=o}}class Nt extends ve{constructor(e,t,s,i,o=V.NORMAL){super(e,t,B.SEQUENCE_FLOW,s,i),this.sequenceFlowKind=o}}class Ot extends ve{constructor(e,t,s,i){super(e,t,B.MESSAGE_FLOW,s,i)}}class vt extends ve{constructor(e,t,s,i,o=q.NONE){super(e,t,B.ASSOCIATION_FLOW,s,i),this.associationDirectionKind=o}}const v=dn(),O=v.mxCellRenderer,Lt=v.mxClient,c=v.mxConstants,W=v.mxEvent,ot=v.mxPerimeter,x=v.mxPoint,Be=v.mxRectangle,Ke=v.mxRectangleShape,he=v.mxSvgCanvas2D,N=v.mxUtils;function dn(){return window.mxForceIncludes=!1,window.mxLoadResources=!1,window.mxLoadStylesheets=!1,window.mxResourceExtension=".txt",on({})}class hn{constructor(e){this.graph=e}computeRelativeCoordinates(e,t){const s=this.getTranslateForRoot(e),i=t.x+s.x,o=t.y+s.y;return new x(i,o)}getTranslateForRoot(e){const t=this.graph.getModel(),s=new x(0,0);for(;e!=null;){const i=t.getGeometry(e);i!=null&&(s.x-=i.x,s.y-=i.y),e=t.getParent(e)}return s}computeEdgeCenter(e){const t=e.geometry.points,s=t[0],i=t.at(-1);if(s!=null&&i!=null){const o=i.x-s.x,r=i.y-s.y;return new x(s.x+o/2,s.y+r/2)}}}class Ie{constructor(e,t,s,i,o){g(this,"extensions",{});this.id=e,this.bpmnElement=t,this.bounds=s,this.label=i,this.isHorizontal=o}}class Y{constructor(e,t,s,i,o=!1){g(this,"incomingIds",[]);g(this,"outgoingIds",[]);this.id=e,this.name=t,this.kind=s,this.parentId=i,this.instantiate=o}}class Le extends Y{constructor(e,t,s,i,o,r=[]){super(e,t,s,i,o),this.markers=r}}class j extends Le{constructor(e,t,s,i,o,r){super(e,t,h.CALL_ACTIVITY,i,void 0,o),this.callActivityKind=s,this.globalTaskKind=r}}class fe extends Le{constructor(e,t,s,i,o){s==D.AD_HOC&&!o.includes(w.ADHOC)&&o.push(w.ADHOC),super(e,t,h.SUB_PROCESS,i,void 0,o),this.subProcessKind=s}}class K extends Y{constructor(e,t,s,i,o){super(e,t,s,o),this.eventDefinitionKind=i}}class Me extends K{constructor(t,s,i,o){super(t,s,h.EVENT_INTERMEDIATE_CATCH,i,o);g(this,"sourceIds",[])}}class Ge extends K{constructor(t,s,i,o){super(t,s,h.EVENT_INTERMEDIATE_THROW,i,o);g(this,"targetId")}}class yt extends K{constructor(e,t,s,i,o){super(e,t,h.EVENT_START,s,i),this.isInterrupting=o}}class _t extends K{constructor(e,t,s,i,o=!0){super(e,t,h.EVENT_BOUNDARY,s,i),this.isInterrupting=o}}class wt extends Y{constructor(e,t,s,i,o=de.None){super(e,t,h.GATEWAY_EVENT_BASED,s,i),this.gatewayKind=o}}function me(n,e,t,s){return Math.min(Math.max(n??s,e),t)}function fn(n){return Math.max(n??0,0)}function gn(n){const e=n??{};return e.debounceDelay=me(e.debounceDelay,0,100,50),e.throttleDelay=me(e.throttleDelay,0,100,50),e}function ye(n){return n=="default"?void 0:me(n,0,100,100)}function Tn(n){return n=="default"?void 0:me(n,1,50,1)}const m={EDGE:"bpmn.edge",EDGE_START_FILL_COLOR:"bpmn.edge.startFillColor",EDGE_END_FILL_COLOR:"bpmn.edge.endFillColor",EVENT_BASED_GATEWAY_KIND:"bpmn.gatewayKind",EVENT_DEFINITION_KIND:"bpmn.eventDefinitionKind",GLOBAL_TASK_KIND:"bpmn.globalTaskKind",SUB_PROCESS_KIND:"bpmn.subProcessKind",IS_INITIATING:"bpmn.isInitiating",IS_INSTANTIATING:"bpmn.isInstantiating",IS_INTERRUPTING:"bpmn.isInterrupting",EXTRA_CSS_CLASSES:"bpmn.extra.css.classes",MARKERS:"bpmn.markers",MESSAGE_FLOW_ICON:"bpmn.messageFlowIcon"},Rt={ARROW_DASH:"bpmn.dash"},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_FROM_CENTER_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"},bt=n=>N.getValue(n,m.IS_INSTANTIATING,"false")=="true",Ce=n=>n=="default"?void 0:n,pn=(n,e)=>(e&&(n=F(n,c.STYLE_STROKECOLOR,e.color,Ce),n=F(n,c.STYLE_STROKE_OPACITY,e.opacity,ye),n=F(n,c.STYLE_STROKEWIDTH,e.width,Tn)),n),F=(n,e,t,s=i=>i)=>t==null?n:N.setStyle(n,e,s(t)),Se=(n,e,t,s)=>s==null?n:N.setStyleFlag(n,e,t,s),En=(n,e)=>(e&&(n=F(n,c.STYLE_FONTCOLOR,e.color,Ce),n=F(n,c.STYLE_FONTSIZE,e.size),n=F(n,c.STYLE_FONTFAMILY,e.family),n=Se(n,c.STYLE_FONTSTYLE,c.FONT_BOLD,e.isBold),n=Se(n,c.STYLE_FONTSTYLE,c.FONT_ITALIC,e.isItalic),n=Se(n,c.STYLE_FONTSTYLE,c.FONT_UNDERLINE,e.isUnderline),n=Se(n,c.STYLE_FONTSTYLE,c.FONT_STRIKETHROUGH,e.isStrikeThrough),n=F(n,c.STYLE_TEXT_OPACITY,e.opacity,ye)),n),Sn=(n,e,t)=>(n==null?void 0:n.split(";").map(s=>s.split("=")).filter(([s])=>s===e).map(([,s])=>s)[0])??t,In=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}},mn=(n,e)=>{const t=e.color;if(t){const s=An(t),i=s?t.startColor:t;n=F(n,c.STYLE_FILLCOLOR,i,Ce),s?(n=N.setStyle(n,c.STYLE_GRADIENTCOLOR,t.endColor),n=N.setStyle(n,c.STYLE_GRADIENT_DIRECTION,In(t.direction))):t==="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=F(n,c.STYLE_SWIMLANE_FILLCOLOR,i,Ce))}return n=F(n,c.STYLE_FILL_OPACITY,e.opacity,ye),n},Cn=n=>n&&typeof n=="object"&&"fill"in n,An=n=>n&&typeof n=="object";class Q{constructor(e){g(this,"ignoreBpmnColors");this.ignoreBpmnColors=(e==null?void 0:e.ignoreBpmnColors)??!0}computeStyle(e,t){const s=[e.bpmnElement.kind];let i;e instanceof Ie?i=this.computeShapeStyleValues(e):(s.push(...Q.computeEdgeBaseStyles(e)),i=this.computeEdgeStyleValues(e));const o=this.computeFontStyleValues(e),r=Q.computeLabelStyleValues(e,t);return s.push(...rt([...i,...o,...r])),s.join(";")}computeShapeStyleValues(e){const t=new Map,s=e.bpmnElement;if(s instanceof K?Q.computeEventShapeStyle(s,t):s instanceof Le?Q.computeActivityShapeStyle(s,t):I.isPoolOrLane(s.kind)?t.set(c.STYLE_HORIZONTAL,e.isHorizontal?"0":"1"):s instanceof wt&&(t.set(m.IS_INSTANTIATING,String(s.instantiate)),t.set(m.EVENT_BASED_GATEWAY_KIND,String(s.gatewayKind))),!this.ignoreBpmnColors){const i=e.extensions,o=i.fillColor;o&&(t.set(c.STYLE_FILLCOLOR,o),I.isPoolOrLane(s.kind)&&t.set(c.STYLE_SWIMLANE_FILLCOLOR,o)),i.strokeColor&&t.set(c.STYLE_STROKECOLOR,i.strokeColor)}return t}static computeEventShapeStyle(e,t){t.set(m.EVENT_DEFINITION_KIND,e.eventDefinitionKind),(e instanceof _t||e instanceof yt&&e.isInterrupting!==void 0)&&t.set(m.IS_INTERRUPTING,String(e.isInterrupting))}static computeActivityShapeStyle(e,t){e instanceof fe?t.set(m.SUB_PROCESS_KIND,e.subProcessKind):e.kind===h.TASK_RECEIVE?t.set(m.IS_INSTANTIATING,String(e.instantiate)):e instanceof j&&t.set(m.GLOBAL_TASK_KIND,e.globalTaskKind);const s=e.markers;s.length>0&&t.set(m.MARKERS,s.join(","))}static computeEdgeBaseStyles(e){const t=[],s=e.bpmnElement;return s instanceof Nt&&t.push(s.sequenceFlowKind),s instanceof vt&&t.push(s.associationDirectionKind),t}computeEdgeStyleValues(e){const t=new Map;if(!this.ignoreBpmnColors){const s=e.extensions;s.strokeColor&&t.set(c.STYLE_STROKECOLOR,s.strokeColor)}return t}computeFontStyleValues(e){var i,o;const t=new Map,s=(i=e.label)==null?void 0:i.font;if(s&&(t.set(c.STYLE_FONTFAMILY,s.name),t.set(c.STYLE_FONTSIZE,s.size),t.set(c.STYLE_FONTSTYLE,Nn(s))),!this.ignoreBpmnColors){const r=(o=e.label)==null?void 0:o.extensions;r!=null&&r.color&&t.set(c.STYLE_FONTCOLOR,r.color)}return t}static computeLabelStyleValues(e,t){const s=new Map,i=e.bpmnElement;return t?(s.set(c.STYLE_VERTICAL_ALIGN,c.ALIGN_TOP),e.bpmnElement.kind!=h.TEXT_ANNOTATION&&s.set(c.STYLE_ALIGN,c.ALIGN_CENTER),e instanceof Ie&&(s.set(c.STYLE_LABEL_WIDTH,t.width+1),s.set(c.STYLE_LABEL_POSITION,"ignore"),s.set(c.STYLE_VERTICAL_LABEL_POSITION,c.ALIGN_MIDDLE))):e instanceof Ie&&(i instanceof fe||i instanceof j&&i.callActivityKind===ue.CALLING_PROCESS)&&!i.markers.includes(w.EXPAND)&&s.set(c.STYLE_VERTICAL_ALIGN,c.ALIGN_TOP),s}computeMessageFlowIconStyle(e){const t=[];return t.push(["shape",m.MESSAGE_FLOW_ICON],[m.IS_INITIATING,String(e.messageVisibleKind===ge.INITIATING)]),this.ignoreBpmnColors||e.extensions.strokeColor&&t.push([c.STYLE_STROKECOLOR,e.extensions.strokeColor]),rt(t).join(";")}}function Nn(n){let e=0;return n.isBold&&(e+=c.FONT_BOLD),n.isItalic&&(e+=c.FONT_ITALIC),n.isStrikeThrough&&(e+=c.FONT_STRIKETHROUGH),n.isUnderline&&(e+=c.FONT_UNDERLINE),e}function rt(n){return n.filter(([,e])=>e&&e!="undefined").map(([e,t])=>`${e}=${t}`)}class On{constructor(e,t,s){this.graph=e,this.coordinatesTranslator=t,this.styleComputer=s}render(e,t){this.insertShapesAndEdges(e),this.graph.customFit(t)}insertShapesAndEdges({pools:e,lanes:t,subprocesses:s,otherFlowNodes:i,boundaryEvents:o,edges:r}){this.graph.batchUpdate(()=>{this.graph.getModel().clear(),this.insertShapes(e),this.insertShapes(t),this.insertShapes(s),this.insertShapes(i),this.insertShapes(o),this.insertEdges(r)})}insertShapes(e){for(const t of e)this.insertShape(t)}getParent(e){return this.getCell(e.parentId)??this.graph.getDefaultParent()}insertShape(e){var l;const t=e.bpmnElement,s=this.getParent(t),i=e.bounds;let o=(l=e.label)==null?void 0:l.bounds;o=I.isPoolOrLane(t.kind)?void 0:o;const r=this.styleComputer.computeStyle(e,o);this.insertVertex(s,t.id,t.name,i,o,r)}insertEdges(e){var t;for(const s of e){const i=s.bpmnElement,o=this.graph.getDefaultParent(),r=this.getCell(i.sourceReferenceId),l=this.getCell(i.targetReferenceId),a=(t=s.label)==null?void 0:t.bounds,u=this.styleComputer.computeStyle(s,a),d=this.graph.insertEdge(o,i.id,i.name,r,l,u);if(this.insertWaypoints(s.waypoints,d),a){d.geometry.width=a.width,d.geometry.height=a.height;const f=this.coordinatesTranslator.computeEdgeCenter(d);if(f){d.geometry.relative=!1;const T=this.coordinatesTranslator.computeRelativeCoordinates(d.parent,new x(a.x,a.y)),E=T.x+a.width/2-f.x,S=T.y-f.y;d.geometry.offset=new x(E,S)}}this.insertMessageFlowIconIfNeeded(s,d)}}insertMessageFlowIconIfNeeded(e,t){if(e.bpmnElement instanceof Ot&&e.messageVisibleKind!==ge.NONE){const s=this.graph.insertVertex(t,ze(t.id),void 0,0,0,20,14,this.styleComputer.computeMessageFlowIconStyle(e));s.geometry.relative=!0,s.geometry.offset=new x(-10,-7)}}insertWaypoints(e,t){e&&(t.geometry.points=e.map(s=>this.coordinatesTranslator.computeRelativeCoordinates(t.parent,new x(s.x,s.y))))}getCell(e){return this.graph.getModel().getCell(e)}insertVertex(e,t,s,i,o,r){const l=this.coordinatesTranslator.computeRelativeCoordinates(e,new x(i.x,i.y)),a=this.graph.insertVertex(e,t,s,l.x,l.y,i.width,i.height,r);if(o){const u=o.x-i.x,d=o.y-i.y;a.geometry.offset=new x(u,d)}return a}}function vn(n,e){return new On(n,new hn(n),new Q(e))}function ze(n){return`messageFlowIcon_of_${n}`}var Ln=typeof global=="object"&&global&&global.Object===Object&&global,yn=typeof self=="object"&&self&&self.Object===Object&&self,Ft=Ln||yn||Function("return this")(),Ae=Ft.Symbol,Pt=Object.prototype,_n=Pt.hasOwnProperty,wn=Pt.toString,re=Ae?Ae.toStringTag:void 0;function Rn(n){var e=_n.call(n,re),t=n[re];try{n[re]=void 0;var s=!0}catch{}var i=wn.call(n);return s&&(e?n[re]=t:delete n[re]),i}var bn=Object.prototype,Fn=bn.toString;function Pn(n){return Fn.call(n)}var kn="[object Null]",xn="[object Undefined]",lt=Ae?Ae.toStringTag:void 0;function Bn(n){return n==null?n===void 0?xn:kn:lt&< in Object(n)?Rn(n):Pn(n)}function Mn(n){return n!=null&&typeof n=="object"}var Gn="[object Symbol]";function Vn(n){return typeof n=="symbol"||Mn(n)&&Bn(n)==Gn}var Yn=/\s/;function Un(n){for(var e=n.length;e--&&Yn.test(n.charAt(e)););return e}var Dn=/^\s+/;function Wn(n){return n&&n.slice(0,Un(n)+1).replace(Dn,"")}function Ne(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var at=NaN,Hn=/^[-+]0x[0-9a-f]+$/i,Kn=/^0b[01]+$/i,zn=/^0o[0-7]+$/i,Xn=parseInt;function ct(n){if(typeof n=="number")return n;if(Vn(n))return at;if(Ne(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Ne(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Wn(n);var t=Kn.test(n);return t||zn.test(n)?Xn(n.slice(2),t?2:8):Hn.test(n)?at:+n}var Re=function(){return Ft.Date.now()},$n="Expected a function",Zn=Math.max,jn=Math.min;function kt(n,e,t){var s,i,o,r,l,a,u=0,d=!1,f=!1,T=!0;if(typeof n!="function")throw new TypeError($n);e=ct(e)||0,Ne(t)&&(d=!!t.leading,f="maxWait"in t,o=f?Zn(ct(t.maxWait)||0,e):o,T="trailing"in t?!!t.trailing:T);function E(_){var U=s,oe=i;return s=i=void 0,u=_,r=n.apply(oe,U),r}function S(_){return u=_,l=setTimeout(pe,e),d?E(_):r}function M(_){var U=_-a,oe=_-u,nt=e-U;return f?jn(nt,o-oe):nt}function P(_){var U=_-a,oe=_-u;return a===void 0||U>=e||U<0||f&&oe>=o}function pe(){var _=Re();if(P(_))return tt(_);l=setTimeout(pe,M(_))}function tt(_){return l=void 0,T&&s?E(_):(s=i=void 0,r)}function en(){l!==void 0&&clearTimeout(l),u=0,s=a=i=l=void 0}function tn(){return l===void 0?r:tt(Re())}function we(){var _=Re(),U=P(_);if(s=arguments,i=this,a=_,U){if(l===void 0)return S(a);if(f)return clearTimeout(l),l=setTimeout(pe,e),E(a)}return l===void 0&&(l=setTimeout(pe,e)),r}return we.cancel=en,we.flush=tn,we}var qn="Expected a function";function Qn(n,e,t){var s=!0,i=!0;if(typeof n!="function")throw new TypeError(qn);return Ne(t)&&(s="leading"in t?!!t.leading:s,i="trailing"in t?!!t.trailing:i),kt(n,e,{leading:s,maxWait:e,trailing:i})}class xt extends v.mxCellOverlay{constructor(t,s){super(null,"",s.position.horizontalAlign,s.position.verticalAlign,null,"default");g(this,"style");this.label=t,this.style=s.style}getBounds(t){const s=t.view.graph.getModel().isEdge(t.cell),i=t.view.scale;let o;const r=0,l=0;return s?o=this.computeEdgeBounds(t):(o=new x,this.align==c.ALIGN_LEFT?o.x=t.x:this.align==c.ALIGN_CENTER?o.x=t.x+t.width/2:o.x=t.x+t.width,this.verticalAlign==c.ALIGN_TOP?o.y=t.y:this.verticalAlign==c.ALIGN_MIDDLE?o.y=t.y+t.height/2:o.y=t.y+t.height),new Be(Math.round(o.x-(r*this.defaultOverlap-this.offset.x)*i),Math.round(o.y-(l*this.defaultOverlap-this.offset.y)*i),r*i,l*i)}computeEdgeBounds(t){const s=t.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 i=s.length/2,o=s[i-1],r=s[i];return new x(o.x+(r.x-o.x)/2,o.y+(r.y-o.y)/2)}}else return s.at(-1)}}class ut extends v.mxText{constructor(e,t,s){super(e,t,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}}class Jn extends v.mxCellRenderer{createCellOverlays(e){const s=e.view.graph.getCellOverlays(e.cell);let i=null;if(s!=null){i=new v.mxDictionary;for(const o of s){const r=e.overlays==null?null:e.overlays.remove(o);if(r!=null){i.put(o,r);continue}let l;o instanceof xt?l=new ut(o.label,new Be(0,0,0,0),o.style):(l=new v.mxImageShape(new Be(0,0,0,0),o.image.src),l.preserveImageAspect=!1),l.dialect=e.view.graph.dialect,l.overlay=o,this.initializeOverlay(e,l),this.installCellOverlayListeners(e,o,l),o.cursor!=null&&(l.node.style.cursor=o.cursor),l instanceof ut&&(l.node.classList.add("overlay-badge"),l.node.dataset.bpmnId=e.cell.id),i.put(o,l)}}e.overlays!=null&&e.overlays.visit(function(o,r){r.destroy()}),e.overlays=i}}const Ve=1.25,es=1/Ve;class ts extends v.mxGraph{constructor(t){super(t);g(this,"currentZoomLevel",1);this.zoomFactor=Ve,this.container&&(this.container.style.cursor="default")}createGraphView(){return new ns(this)}createCellRenderer(){return new Jn}batchUpdate(t){this.model.beginUpdate();try{t()}finally{this.model.endUpdate()}}fit(t,s,i,o,r,l,a){const u=super.fit(t,s,i,o,r,l,a);return this.setCurrentZoomLevel(u),u}setCurrentZoomLevel(t){this.currentZoomLevel=t??this.view.scale}zoomActual(){super.zoomActual(),this.setCurrentZoomLevel()}zoomIn(){super.zoomIn(),this.setCurrentZoomLevel()}zoomOut(){super.zoomOut(),this.setCurrentZoomLevel()}customFit(t){this.zoomActual();const s=t==null?void 0:t.type;if(s==null||s==ce.None)return;const i=fn(t==null?void 0:t.margin);if(s==ce.Center){const r=this.getGraphBounds(),l=this.container.clientWidth-i,a=this.container.clientHeight-i,u=r.width/this.view.scale,d=r.height/this.view.scale,f=Math.min(3,Math.min(l/u,a/d));this.setCurrentZoomLevel(f),this.view.scaleAndTranslate(f,(i+l-u*f)/(2*f)-r.x/this.view.scale,(i+a-d*f)/(2*f)-r.y/this.view.scale)}else{let o=!1,r=!1;switch(s){case ce.Horizontal:{r=!0;break}case ce.Vertical:{o=!0;break}}this.fit(this.border,!1,i,!0,o,r)}}registerMouseWheelZoomListeners(t){t=gn(t),W.addMouseWheelListener(kt(this.createMouseWheelZoomListener(!0),t.debounceDelay),this.container),W.addMouseWheelListener(Qn(this.createMouseWheelZoomListener(!1),t.throttleDelay),this.container)}manageMouseWheelZoomEvent(t,s,i){if(i){const[o,r]=this.getEventRelativeCoordinates(s),[l,a,u]=this.getScaleAndTranslationDeltas(o,r);this.view.scaleAndTranslate(l,this.view.translate.x+a,this.view.translate.y+u),W.consume(s)}else this.currentZoomLevel*=t?Ve:es}createMouseWheelZoomListener(t){return(s,i)=>{if(W.isConsumed(s)||!(s instanceof MouseEvent))return;s.ctrlKey&&!s.altKey&&!s.shiftKey&&!s.metaKey&&this.manageMouseWheelZoomEvent(i,s,t)}}getEventRelativeCoordinates(t){const s=this.container.getBoundingClientRect(),i=t.clientX-s.left,o=t.clientY-s.top;return[i,o]}getScaleAndTranslationDeltas(t,s){const[i,o]=this.calculateFactorAndScale(),[r,l]=this.calculateTranslationDeltas(i,o,t*2,s*2);return[o,r,l]}calculateTranslationDeltas(t,s,i,o){if(t>1){const r=(t-1)/(s*2);i*=-r,o*=-r}else{const r=(1/t-1)/(this.view.scale*2);i*=r,o*=r}return[i,o]}calculateFactorAndScale(){const t=Math.round(this.currentZoomLevel*100)/100;return[t/this.view.scale,t]}}class ns extends v.mxGraphView{getFloatingTerminalPoint(e,t,s,i){if(e.absolutePoints.filter(Boolean).length<2)return super.getFloatingTerminalPoint(e,t,s,i);const l=e.absolutePoints;return i?l[1]:l.at(-2)}}class ss{configureMarkers(){this.registerArrowDashMarker()}registerArrowDashMarker(){const e=(t,s,i,o,r,l,a,u,d)=>{const f=r*(a+d+4),T=l*(a+d+4);return function(){t.begin(),t.moveTo(o.x-f/2-T/2,o.y-T/2+f/2),t.lineTo(o.x+T/2-3*f/2,o.y-3*T/2-f/2),t.stroke()}};v.mxMarker.addMarker(Rt.ARROW_DASH,e)}}function is(n){return Object.values(B).map(e=>e).includes(n)}function os(n,e){return rs(n.style,e)}function rs(n,e){const t=[],s=n.split(";"),o=s[0].replace(/shape=bpmn./g,""),r=new Map;r.set("bpmn-type-activity",I.isActivity(o)),r.set("bpmn-type-container",I.isPoolOrLane(o)),r.set("bpmn-type-event",I.isEvent(o)),r.set("bpmn-type-flow",is(o)),r.set("bpmn-type-gateway",I.isGateway(o)),r.set("bpmn-type-task",I.isTask(o));for(const[l]of[...r].filter(([,a])=>a))t.push(l);t.push(Ye(o));for(const[l,a]of s.map(u=>{const d=u.split("=");return[d[0],d[1]]}))switch(l){case m.EVENT_DEFINITION_KIND:{t.push(`bpmn-event-def-${a}`);break}case m.EVENT_BASED_GATEWAY_KIND:{t.push(`bpmn-gateway-kind-${a.toLowerCase()}`);break}case m.IS_INITIATING:{t.push(a=="true"?"bpmn-icon-initiating":"bpmn-icon-non-initiating");break}case m.SUB_PROCESS_KIND:{t.push(`bpmn-sub-process-${a.toLowerCase()}`);break}case m.GLOBAL_TASK_KIND:{t.push(Ye(a));break}}return e&&t.push("bpmn-label"),t}function Ye(n){return n?"bpmn-"+n.replace(/([A-Z])/g,e=>"-"+e[0].toLowerCase()):""}function ls(n,e,t,s){let i,o;n.heightE.setIconOriginForIconCentered(),shapeConfig:{x:e,y:t,width:s,height:i,strokeWidth:u},iconStyleConfig:{isFilled:l,fillColor:d,strokeColor:f,strokeWidth:a,margin:T}}}class ${paintEmptyIcon(){}newBpmnCanvas({canvas:e,ratioFromParent:t,setIconOriginFunct:s,shapeConfig:i,iconStyleConfig:o},r){return new as({canvas:e,shapeConfig:i,iconConfig:{originalSize:r,styleConfig:o,ratioFromParent:t,setIconOriginFunct:s}})}paintEnvelopeIcon(e){const t={width:485.41,height:321.76},s=this.newBpmnCanvas(e,t),i=t.width,o=t.height;s.rect(0,0,i,o),s.fillAndStroke();const{iconStyleConfig:r}=e;r.isFilled&&s.setStrokeColor(r.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(e){const t={width:e.shapeConfig.width,height:e.shapeConfig.height},s=this.newBpmnCanvas(e,t),i=t.width,o=t.height;i>0&&o>0&&s.ellipse(0,0,i,o),e.iconStyleConfig.isFilled?s.fillAndStroke():s.stroke()}paintClockIcon(e){const t=this.newBpmnCanvas(e,{height:152,width:152});t.begin(),t.moveTo(184,60),t.curveTo(188.4,60,192,56.4,192,52),t.lineTo(192,48),t.curveTo(192,40,188.4,40,184,40),t.curveTo(179.6,40,176,43.6,176,48),t.lineTo(176,52),t.curveTo(176,56.4,179.6,60,184,60),t.close(),t.moveTo(184,308),t.curveTo(179.6,308,176,311.6,176,316),t.lineTo(176,320),t.curveTo(176,324.4,179.6,328,184,328),t.curveTo(188.4,328,192,324.4,192,320),t.lineTo(192,316),t.curveTo(192,311.6,188.4,308,184,308),t.close(),t.moveTo(52,176),t.lineTo(48,176),t.curveTo(43.6,176,40,179.6,40,184),t.curveTo(40,188.4,43.6,192,48,192),t.lineTo(52,192),t.curveTo(56.4,192,69,188.4,60,184),t.curveTo(60,179.6,56.4,176,52,176),t.close(),t.moveTo(320,176),t.lineTo(316,176),t.curveTo(311.6,176,308,179.6,308,184),t.curveTo(308,188.4,311.6,192,316,192),t.lineTo(320,192),t.curveTo(324.4,192,328,188.4,328,184),t.curveTo(328,179.6,324.4,176,320,176),t.moveTo(93.6,82.4),t.curveTo(90.4,79.2,85.6,79.2,82.4,82.4),t.curveTo(79.2,85.6,79.2,90.4,82.4,93.6),t.lineTo(85.2,96.4),t.curveTo(86.8,98,88.8,98.8,90.8,98.8),t.curveTo(92.8,98.8,94.4,98,96.4,96.4),t.curveTo(99.6,93.2,99.6,88.4,96.4,85.2),t.lineTo(93.6,82.4),t.moveTo(85.2,271.6),t.lineTo(82.4,274.4),t.curveTo(79.2,277.6,79.2,282.4,82.4,285.6),t.curveTo(84,287.2,86,288,88,288),t.curveTo(90,288,92,287.2,93.6,285.6),t.lineTo(96.4,282.8),t.curveTo(99.6,279.6,99.6,274.8,96.4,271.6),t.curveTo(93.2,268.4,88.4,268.4,85.2,271.6),t.moveTo(274.4,82.4),t.lineTo(271.6,85.2),t.curveTo(268.4,88.4,268.4,93.2,271.6,96.4),t.curveTo(273.298,98,275.2,98.8,277.2,98.8),t.curveTo(279.2,98.8,281.2,98,282.8,96.4),t.lineTo(285.6,93.6),t.curveTo(288.8,90.4,288.8,85.6,285.6,82.4),t.curveTo(282.4,79.2,277.6,79.2,274.4,82.4),t.moveTo(192,180.8),t.lineTo(192,108),t.curveTo(192,103.6,188.4,100,184,100),t.curveTo(179.6,100,176,103.6,176,108),t.lineTo(176,184),t.curveTo(176,186,176.8,188,178.4,189.6),t.lineTo(266,277.2),t.curveTo(267.6,278.8,269.6,279.6,271.6,279.6),t.curveTo(273.6,279.6,275.6,278.8,277.2,277.2),t.curveTo(280.4,274,280.4,269.2,277.2,266),t.lineTo(192,180.8),t.moveTo(184,0),t.curveTo(82.4,0,0,82.4,0,184),t.curveTo(0,285.6,82.4,368,184,368),t.curveTo(285.6,368,368,285.6,368,184),t.curveTo(368,82.4,285.6,0,184,0),t.moveTo(184,352),t.curveTo(91.2,352,16,276.8,16,184),t.curveTo(16,91.2,91.2,16,184,16),t.curveTo(276.8,16,352,91.2,352,184),t.curveTo(352,276.8,276.8,352,184,352),t.fillAndStroke()}paintTriangleIcon(e){const t=this.newBpmnCanvas(e,{height:735,width:849});t.begin(),t.moveTo(497,55),t.lineTo(817,609),t.curveTo(849,665,808,735,744,735),t.lineTo(105,735),t.curveTo(40,735,0,665,32,609),t.lineTo(352,55),t.curveTo(384,0,465,0,497,55),t.close(),t.fillAndStroke()}paintUpArrowheadIcon(e){const t=this.newBpmnCanvas(e,{height:50,width:40});t.begin(),t.moveTo(0,49.5),t.lineTo(19.5,1),t.curveTo(19.75,.25,20,0,20.25,.25),t.lineTo(40,49.5),t.curveTo(40,49.5,39.75,50,39.6,49.75),t.lineTo(20,30),t.lineTo(.4,49.75),t.curveTo(.4,49.75,.25,50,0,49.5),t.close(),t.fillAndStroke()}paintDoubleLeftArrowheadsIcon(e){const t=this.newBpmnCanvas(e,{height:53.5,width:105});t.begin(),t.moveTo(91.4,0),t.curveTo(91.4,0,91.2,0,91,.2),t.lineTo(50,25),t.curveTo(47.9,25.8,46.7,26.6,46.4,27.3),t.lineTo(46.4,0),t.curveTo(46.4,0,46.2,0,46,.2),t.lineTo(4.9,25),t.curveTo(2,26.2,0,27.3,4.9,28.5),t.lineTo(45.8,53),t.curveTo(46,53.3,46.2,53.5,46.4,53.5),t.lineTo(46.4,27),t.curveTo(46.6,27.3,47.8,28.1,49.9,29.9),t.lineTo(90.8,53.3),t.curveTo(91,53.3,91.2,53.5,91.4,53.5),t.lineTo(91.4,0),t.close(),t.fillAndStroke()}drawCrossIcon(e){const t=this.newBpmnCanvas(e,{height:1,width:1});return t.begin(),t.moveTo(.38,0),t.lineTo(.62,0),t.lineTo(.62,.38),t.lineTo(1,.38),t.lineTo(1,.62),t.lineTo(.62,.62),t.lineTo(.62,1),t.lineTo(.38,1),t.lineTo(.38,.62),t.lineTo(0,.62),t.lineTo(0,.38),t.lineTo(.38,.38),t.close(),t}paintListIcon(e){const t=this.newBpmnCanvas(e,{height:60,width:60});t.begin(),t.moveTo(0,0),t.lineTo(60,0),t.lineTo(60,60),t.lineTo(0,60),t.lineTo(0,0),t.close(),t.moveTo(5,5),t.lineTo(55,5),t.close(),t.moveTo(5,21.6),t.lineTo(55,21.6),t.close(),t.moveTo(5,38.3),t.lineTo(55,38.3),t.close(),t.moveTo(5,55),t.lineTo(55,55),t.close(),t.fillAndStroke()}paintXCrossIcon(e){const t=this.drawCrossIcon(e);t.rotateOnIconCenter(45),t.fillAndStroke()}paintPlusCrossIcon(e){this.drawCrossIcon(e).fillAndStroke()}paintAsteriskIcon(e){const t=this.newBpmnCanvas(e,{height:1,width:1});be(e,t),t.fillAndStroke(),be(e,t),t.rotateOnIconCenter(60),t.fillAndStroke(),be(e,t),t.rotateOnIconCenter(240),t.fillAndStroke()}paintPersonIcon(e){const t=this.newBpmnCanvas({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0}},{height:239.68,width:143.61});t.begin(),t.moveTo(124.31,150.29),t.lineTo(99.66,141.03),t.arcTo(6.43,6.43,0,0,1,95.51,135.03),t.lineTo(95.51,130.66),t.arcTo(47.75,47.75,0,0,0,119.51,89.25),t.lineTo(119.51,71.25),t.arcTo(47.62,47.62,0,0,0,101.18,33.64),t.arcTo(29.35,29.35,0,0,0,101.52,29.14),t.arcTo(29.68,29.68,0,0,0,42.17,29.14),t.arcTo(29.24,29.24,0,0,0,42.53,33.63),t.arcTo(47.65,47.65,0,0,0,24.14,71.23),t.lineTo(24.14,89.23),t.arcTo(47.7,47.7,0,0,0,48.19,130.63),t.lineTo(48.19,135.03),t.arcTo(6.43,6.43,0,0,1,44.03,141.03),t.lineTo(19.31,150.29),t.arcTo(29.81,29.81,0,0,0,.09,178.03),t.lineTo(.09,233.51),t.arcTo(5.63,5.63,0,1,0,11.34,233.51),t.lineTo(11.34,178.03),t.arcTo(18.19,18.19,0,0,1,11.57,175.17),t.lineTo(20.5,184.11),t.arcTo(12.32,12.32,0,0,1,24.14,192.89),t.lineTo(24.14,233.51),t.arcTo(5.63,5.63,0,1,0,35.39,233.51),t.lineTo(35.39,192.93),t.arcTo(23.5,23.5,0,0,0,28.46,176.2),t.lineTo(17.04,164.78),t.arcTo(18.34,18.34,0,0,1,23.29,160.78),t.lineTo(43.65,153.15),t.lineTo(66.22,175.72),t.lineTo(66.22,233.51),t.arcTo(5.63,5.63,0,1,0,77.47,233.51),t.lineTo(77.47,175.76),t.lineTo(100.04,153.19),t.lineTo(120.4,160.82),t.arcTo(18.39,18.39,0,0,1,126.65,164.82),t.lineTo(115.24,176.24),t.arcTo(23.5,23.5,0,0,0,108.31,192.93),t.lineTo(108.31,233.55),t.arcTo(5.63,5.63,0,1,0,119.56,233.55),t.lineTo(119.56,192.93),t.arcTo(12.35,12.35,0,0,1,123.19,184.15),t.lineTo(132.13,175.22),t.arcTo(18,18,0,0,1,132.36,178.08),t.lineTo(132.36,233.56),t.arcTo(5.63,5.63,0,0,0,143.61,233.56),t.lineTo(143.61,178.03),t.arcTo(29.81,29.81,0,0,0,124.31,150.29),t.close(),t.moveTo(71.85,10.72),t.arcTo(18.46,18.46,0,0,1,90.17,27.18),t.arcTo(47.68,47.68,0,0,0,53.53,27.18),t.arcTo(18.44,18.44,0,0,1,71.85,10.72),t.close(),t.moveTo(35.39,71.23),t.arcTo(36.46,36.46,0,0,1,108.31,71.23),t.lineTo(108.31,77.4),t.curveTo(82.12,75.4,56.97,60.55,56.71,60.4),t.arcTo(5.62,5.62,0,0,0,48.78,62.71),t.curveTo(46.24,67.79,40.45,71.89,35.39,74.62),t.close(),t.moveTo(35.39,89.23),t.lineTo(35.39,87.08),t.curveTo(40.55,84.85,49.73,80.08,55.67,72.66),t.curveTo(64.83,77.46,85.92,87.21,108.31,88.66),t.lineTo(108.31,89.24),t.arcTo(36.46,36.46,0,1,1,35.39,89.24),t.close(),t.moveTo(71.85,165.45),t.lineTo(54.06,147.69),t.arcTo(17.7,17.7,0,0,0,59.43,135.32),t.arcTo(47.57,47.57,0,0,0,84.27,135.32),t.arcTo(17.7,17.7,0,0,0,89.64,147.69),t.close(),t.fill()}paintGearIcon(e){const t=this.newBpmnCanvas(e,{height:100,width:100});$.paintGearIconBackground(t),t.translateIconOrigin(14,14),$.paintGearIconForeground(t)}static paintGearIconBackground(e){e.begin(),e.moveTo(2.06,24.62),e.lineTo(10.17,30.95),e.lineTo(9.29,37.73),e.lineTo(0,41.42),e.lineTo(2.95,54.24),e.lineTo(13.41,52.92),e.lineTo(17.39,58.52),e.lineTo(13.56,67.66),e.lineTo(24.47,74.44),e.lineTo(30.81,66.33),e.lineTo(37.88,67.21),e.lineTo(41.57,76.5),e.lineTo(54.24,73.55),e.lineTo(53.06,62.94),e.lineTo(58.52,58.52),e.lineTo(67.21,63.09),e.lineTo(74.58,51.88),e.lineTo(66.03,45.25),e.lineTo(66.92,38.62),e.lineTo(76.5,34.93),e.lineTo(73.7,22.26),e.lineTo(62.64,23.44),e.lineTo(58.81,18.42),e.lineTo(62.79,8.7),e.lineTo(51.74,2.21),e.lineTo(44.81,10.47),e.lineTo(38.03,9.43),e.lineTo(33.75,0),e.lineTo(21.52,3.24),e.lineTo(22.7,13.56),e.lineTo(18.13,17.54),e.lineTo(8.7,13.56),e.close();const t=24.8,s=39;$.paintGearInnerCircle(e,t,s)}static paintGearIconForeground(e){e.begin(),e.moveTo(16.46,41.42),e.lineTo(24.57,47.75),e.lineTo(23.69,54.53),e.lineTo(14.4,58.22),e.lineTo(17.35,71.04),e.lineTo(27.81,69.72),e.lineTo(31.79,75.32),e.lineTo(27.96,84.46),e.lineTo(38.87,91.24),e.lineTo(45.21,83.13),e.lineTo(52.28,84.01),e.lineTo(55.97,93.3),e.lineTo(68.64,90.35),e.lineTo(67.46,79.74),e.lineTo(72.92,75.32),e.lineTo(81.61,79.89),e.lineTo(88.98,68.68),e.lineTo(80.43,62.05),e.lineTo(81.32,55.42),e.lineTo(90.9,51.73),e.lineTo(88.1,39.06),e.lineTo(77.04,40.24),e.lineTo(73.21,35.22),e.lineTo(77.19,25.5),e.lineTo(66.14,19.01),e.lineTo(59.21,27.27),e.lineTo(52.43,26.23),e.lineTo(48.15,16.8),e.lineTo(35.92,20.04),e.lineTo(37.1,30.36),e.lineTo(32.53,34.34),e.lineTo(23.1,30.36),e.close();const t=39.2,s=55.8;$.paintGearInnerCircle(e,t,s),e.begin(),$.paintGearInnerCircle(e,t,s)}static paintGearInnerCircle(e,t,s){e.moveTo(t,s),e.arcTo(13.5,13.5,0,1,1,t+2*13.5,s),e.arcTo(13.5,13.5,0,0,1,t,s),e.close(),e.fillAndStroke()}paintExpandIcon(e){const t={width:16,height:16},s=this.newBpmnCanvas(e,t),i=t.width,o=t.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(e){const{iconStyleConfig:t}=e;t.fillColor=t.strokeColor;const s=this.newBpmnCanvas(e,{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(e){const t={width:16,height:16},s=this.newBpmnCanvas(e,t),{canvas:i,iconStyleConfig:o}=e;i.setFillColor(o.strokeColor);const r=t.width,l=t.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(e){const t={width:16,height:16},s=this.newBpmnCanvas(e,t),{canvas:i,iconStyleConfig:o}=e;i.setFillColor(o.strokeColor);const r=t.width/5,l=t.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(e){const t=this.newBpmnCanvas(e,{width:512,height:415.23});t.setRoundLineJoin(),t.begin(),t.moveTo(512,207.61),t.lineTo(304.38,0),t.lineTo(304.38,135.39),t.lineTo(0,135.39),t.lineTo(0,279.84),t.lineTo(304.38,279.84),t.lineTo(304.38,415.23),t.lineTo(512,207.61),t.close(),t.fillAndStroke()}paintErrorIcon(e){const t=this.newBpmnCanvas(e,{width:72.44,height:71.82});t.begin(),t.moveTo(0,53.32),t.lineTo(19.48,0),t.lineTo(19.48,0),t.lineTo(50.85,40.07),t.lineTo(72.44,18.21),t.lineTo(53.12,71.82),t.lineTo(22.5,31.37),t.close(),t.fillAndStroke()}paintHandIcon(e){const t=this.newBpmnCanvas(e,{width:343.65,height:354.12});t.begin(),t.moveTo(231.66,336.39),t.curveTo(240.84,316.9,220.53,306.92,220.53,306.92),t.curveTo(215.2,303.67,188.58,287.43,140.67,258.19),t.lineTo(146.33,248.39),t.curveTo(223.98,269.38,267.12,281.04,275.75,283.38),t.curveTo(275.75,283.38,297.25,288,301.42,267.77),t.curveTo(306.34,245.29,288.32,238.63,288.32,238.63),t.curveTo(279.91,236.44,237.86,225.48,162.18,205.75),t.lineTo(165.2,194.8),t.curveTo(255.88,204.4,306.27,209.73,316.34,210.8),t.curveTo(316.34,210.8,339.89,212.16,341.76,189.55),t.curveTo(343.65,166.93,320.5,164.13,320.5,164.13),t.curveTo(310.43,163.1,260.04,157.99,169.35,148.77),t.lineTo(169.35,138.97),t.curveTo(253.41,132.12,300.11,128.32,309.45,127.56),t.curveTo(309.45,127.56,332.27,122.38,332.27,102.61),t.curveTo(332.27,82.85,305.48,81.87,305.48,81.87),t.curveTo(293.99,82.2,236.54,83.88,133.13,86.9),t.lineTo(127.61,81.87),t.curveTo(145.3,59.39,155.12,46.9,157.09,44.41),t.curveTo(157.09,44.41,171.12,26.8,156.78,12.72),t.curveTo(143.83,0,124.08,14.49,124.08,14.49),t.curveTo(116.45,19.41,78.35,44.06,9.77,88.43),t.lineTo(0,251.94),t.curveTo(122.84,308.79,191.09,340.37,204.74,346.69),t.curveTo(204.74,346.69,222.91,354.12,231.66,336.39),t.fillAndStroke()}paintScriptIcon(e){e.iconStyleConfig.fillColor=e.iconStyleConfig.strokeColor;const t=this.newBpmnCanvas(e,{width:458.75,height:461.64});t.begin(),t.moveTo(67.85,.57),t.curveTo(50.73,0,33.26,8.86,22.35,18.84),t.curveTo(8.11,32.15,0,50.77,0,70.26),t.curveTo(0,73.15,0,87.59,0,113.6),t.curveTo(55.4,113.6,86.18,113.6,92.33,113.6),t.curveTo(94.92,150.46,85.64,180.4,74.22,211.27),t.curveTo(40.16,298.07,30.77,339.83,55.56,410.87),t.curveTo(63.72,438.26,87.59,457.85,114.91,461.09),t.curveTo(216.96,460.85,294.9,461.64,388.41,461.2),t.curveTo(407.2,461.09,425.14,453.55,438.3,440.13),t.curveTo(451.46,426.71,458.75,403.06,458.46,384.26),t.curveTo(458.43,382.23,458.18,365.93,458.15,363.89),t.curveTo(432.12,364.24,406.09,364.04,380.06,364.04),t.curveTo(377.61,347.52,377.24,337.58,378.28,324.48),t.curveTo(380.5,296.47,389.08,273.36,398.59,247.1),t.curveTo(408.11,220.83,418.41,191.47,420.86,154.24),t.curveTo(422.11,135.34,421.4,110.24,417.77,86.75),t.curveTo(417.76,86.71,417.73,86.54,417.69,86.22),t.curveTo(417.64,85.95,417.61,85.79,417.6,85.76),t.curveTo(414.03,68.13,410.49,48.84,399.79,31.47),t.curveTo(389.09,14.11,366.95,.59,341.75,.59),t.curveTo(286.97,.59,122.63,.57,67.85,.57),t.close(),t.moveTo(85.04,72.68),t.curveTo(80.63,72.68,45.33,72.68,40.92,72.68),t.curveTo(40.46,58.4,47.15,51.87,50.27,48.75),t.curveTo(55.8,44.28,59.84,41,73.82,41),t.curveTo(78.45,52.13,82.23,62.71,85.04,72.68),t.close(),t.moveTo(364.94,52.9),t.curveTo(370,61.11,373.9,76.44,377.38,93.51),t.curveTo(380.35,113.1,381.01,136.42,380.02,151.57),t.curveTo(377.97,182.76,369.51,207.12,360.1,233.1),t.curveTo(350.69,259.09,340.27,286.77,337.53,321.27),t.curveTo(336.38,335.86,336.72,346.69,338.87,364.01),t.curveTo(326.35,364.01,263.75,364.01,151.06,364.01),t.curveTo(151.06,382.2,151.06,392.31,151.06,394.33),t.curveTo(147.77,404.8,138.9,418.2,127.43,419.94),t.curveTo(111.49,422.35,97.86,411.8,94.75,399.19),t.curveTo(65.14,321.99,94.93,275.54,112.57,225.47),t.curveTo(130.14,177.95,137.92,117.41,112.71,42.09),t.curveTo(192.88,41.9,274.33,42.21,342.89,41.98),t.curveTo(357.15,42.03,359.83,44.61,364.94,52.9),t.close(),t.moveTo(409.96,399.48),t.curveTo(409.96,408.42,398.54,425.67,392.02,425.67),t.curveTo(325.19,425.79,252.29,425.67,185.23,425.67),t.curveTo(189.88,424.43,194.66,405.64,194.66,399.48),t.curveTo(237.72,399.48,388.43,399.48,409.96,399.48),t.close(),t.fill(),t.begin(),t.moveTo(182.1,131.2),t.lineTo(182.1,151.68),t.lineTo(321.89,151.68),t.lineTo(321.89,131.2),t.lineTo(182.1,131.2),t.close(),t.moveTo(162.25,251.09),t.lineTo(162.25,271.49),t.lineTo(301.96,271.49),t.lineTo(301.96,251.09),t.lineTo(162.25,251.09),t.close(),t.fill()}paintTableIcon(e){const t=this.newBpmnCanvas(e,{width:640,height:640});t.begin(),t.moveTo(.19,.1),t.lineTo(298.78,.1),t.lineTo(298.78,198.88),t.lineTo(.19,198.88),t.lineTo(.19,.1),t.close(),t.fillAndStroke(),t.begin(),t.moveTo(0,0),t.lineTo(298.78,0),t.lineTo(298.78,48.88),t.lineTo(0,48.88),t.lineTo(0,0),t.close(),t.fillAndStroke(),t.begin(),t.moveTo(0,48.88),t.lineTo(98.78,48.88),t.lineTo(98.78,198.88),t.lineTo(0,198.88),t.lineTo(0,48.88),t.close(),t.fillAndStroke(),t.begin(),t.moveTo(1.09,122.69),t.lineTo(298.78,122.69),t.close(),t.fillAndStroke(),t.setFillColor(e.iconStyleConfig.strokeColor),t.begin(),t.moveTo(0,0),t.lineTo(298.78,0),t.lineTo(298.78,48.88),t.lineTo(0,48.88),t.lineTo(0,0),t.close(),t.fillAndStroke()}paintPentagon(e){const t=this.newBpmnCanvas(e,{width:16,height:16});t.begin(),t.moveTo(16,6.5),t.lineTo(8,0),t.lineTo(0,6.5),t.lineTo(3,16),t.lineTo(13,16),t.lineTo(16,6.5),t.lineTo(8,0),t.stroke()}}function be(n,e){e.begin(),e.moveTo(.38,0),e.lineTo(.62,0),e.lineTo(.62,1),e.lineTo(.38,1),e.close()}class se{static get(){return this.instance}static set(e){this.instance=e}}g(se,"instance",new $);const cs=[w.LOOP,w.MULTI_INSTANCE_PARALLEL,w.MULTI_INSTANCE_SEQUENTIAL,w.COMPENSATION,w.EXPAND,w.ADHOC];function us(n){const e=cs.filter(t=>n.includes(t));for(const t of n.filter(s=>!e.includes(s)))e.push(t);return e}function Bt(n,e){se.get().paintEnvelopeIcon({...n,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeft(),ratioFromParent:.2,iconStyleConfig:{...n.iconStyleConfig,isFilled:e}})}class Xe extends Ke{constructor(){super(void 0,void 0,void 0);g(this,"iconPainter",se.get())}paintForeground(t,s,i,o,r){super.paintForeground(t,s,i,o,r),this.paintMarkerIcons(ne({canvas:t,x:s,y:i,width:o,height:r,shape:this,ratioFromParent:0,iconStrokeWidth:1.5}))}paintMarkerIcons(t){const s=N.getValue(this.style,m.MARKERS,void 0);if(s){const i=us(s.split(","));for(const[o,r]of i.entries()){switch(t={...t,setIconOriginFunct:this.getMarkerIconOriginFunction(i.length,o+1)},t.canvas.save(),r){case w.LOOP:{this.iconPainter.paintLoopIcon(t);break}case w.MULTI_INSTANCE_SEQUENTIAL:{this.iconPainter.paintSequentialMultiInstanceIcon(t);break}case w.MULTI_INSTANCE_PARALLEL:{this.iconPainter.paintParallelMultiInstanceIcon(t);break}case w.EXPAND:{this.iconPainter.paintExpandIcon(t);break}}t.canvas.restore()}}}getMarkerIconOriginFunction(t,s){return t===1?i=>i.setIconOriginForIconBottomCentered():i=>{i.setIconOriginForIconBottomCentered();const o=Math.pow(-1,s)*(p.SHAPE_ACTIVITY_MARKER_ICON_SIZE/2+p.SHAPE_ACTIVITY_MARKER_ICON_MARGIN);i.translateIconOrigin(o,0)}}}class z extends Xe{paintForeground(e,t,s,i,o){super.paintForeground(e,t,s,i,o),this.paintTaskIcon(ne({canvas:e,x:t,y:s,width:i,height:o,shape:this}))}}class ds extends z{paintTaskIcon(e){this.iconPainter.paintEmptyIcon()}}class hs extends z{paintTaskIcon(e){this.iconPainter.paintGearIcon({...e,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class fs extends z{paintTaskIcon(e){this.iconPainter.paintPersonIcon({...e,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class gs extends z{paintTaskIcon(e){if(!bt(this.style)){Bt(e,!1);return}const t=4,s=4,i={...e.shapeConfig,width:20,height:20};this.iconPainter.paintCircleIcon({canvas:e.canvas,shapeConfig:i,iconStyleConfig:{...e.iconStyleConfig,isFilled:!1},ratioFromParent:void 0,setIconOriginFunct:o=>o.setIconOriginToShapeTopLeft(s,t)}),i.x+=t,i.y+=s,this.iconPainter.paintEnvelopeIcon({...e,shapeConfig:i,ratioFromParent:.65,setIconOriginFunct:o=>o.setIconOriginForIconCentered()})}}class Ts extends z{paintTaskIcon(e){Bt(e,!0)}}class ps extends z{paintTaskIcon(e){this.iconPainter.paintHandIcon({...e,ratioFromParent:.18,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class Es extends z{paintTaskIcon(e){this.iconPainter.paintScriptIcon({...e,ratioFromParent:.22,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class Ss extends Xe{paintForeground(e,t,s,i,o){super.paintForeground(e,t,s,i,o);const r=ne({canvas:e,x:t,y:s,width:i,height:o,shape:this});switch(N.getValue(this.style,m.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}default:this.iconPainter.paintEmptyIcon()}}}class Is extends Xe{paintBackground(e,t,s,i,o){const r=N.getValue(this.style,m.SUB_PROCESS_KIND,void 0);if(e.save(),r===D.EVENT&&(e.setDashed(!0,!1),e.setDashPattern("1 2")),super.paintBackground(e,t,s,i,o),r===D.TRANSACTION){const l=p.SUB_PROCESS_TRANSACTION_INNER_RECT_OFFSET,a=p.SUB_PROCESS_TRANSACTION_INNER_RECT_ARC_SIZE;e.roundrect(t+l,s+l,i-2*l,o-2*l,a,a),e.stroke()}e.restore()}}class ms extends z{paintTaskIcon(e){this.iconPainter.paintTableIcon({...e,ratioFromParent:.6,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(15)})}}class Cs extends v.mxConnector{paintEdgeShape(e,t){const s=this.createMarker(e,t,!0),i=this.createMarker(e,t,!1);this.paintEdgeLine(e,t),e.setShadow(!1),e.setDashed(!1,!1),s!=null&&(e.setFillColor(N.getValue(this.style,m.EDGE_START_FILL_COLOR,this.stroke)),s()),i!=null&&(e.setFillColor(N.getValue(this.style,m.EDGE_END_FILL_COLOR,this.stroke)),i())}paintEdgeLine(e,t){const s=As(e);dt(e,"stroke"),this.paintLine(e,t,this.isRounded),dt(e,s)}}function As(n){return n instanceof he?n.pointerEventsValue:null}function dt(n,e){n instanceof he&&(n.pointerEventsValue=e)}class ee extends v.mxEllipse{constructor(){super(void 0,void 0,void 0);g(this,"iconPainter",se.get());g(this,"iconPainters",new Map([[R.MESSAGE,t=>this.iconPainter.paintEnvelopeIcon({...t,ratioFromParent:.5})],[R.TERMINATE,t=>this.iconPainter.paintCircleIcon({...t,ratioFromParent:.6})],[R.TIMER,t=>this.iconPainter.paintClockIcon({...t,setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(5)})],[R.SIGNAL,t=>this.iconPainter.paintTriangleIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:p.STROKE_WIDTH_THIN.valueOf()},setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(4)})],[R.LINK,t=>this.iconPainter.paintRightArrowIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[R.ERROR,t=>this.iconPainter.paintErrorIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[R.COMPENSATION,t=>this.iconPainter.paintDoubleLeftArrowheadsIcon({...t,ratioFromParent:.7,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[R.CANCEL,t=>this.iconPainter.paintXCrossIcon({...t,ratioFromParent:.78})],[R.ESCALATION,t=>this.iconPainter.paintUpArrowheadIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:p.STROKE_WIDTH_THIN.valueOf()}})],[R.CONDITIONAL,t=>this.iconPainter.paintListIcon({...t,ratioFromParent:.6,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})]]));g(this,"withFilledIcon",!1)}paintVertexShape(t,s,i,o,r){const l=ne({canvas:t,x:s,y:i,width:o,height:r,shape:this,isFilled:this.withFilledIcon});ee.setDashedOuterShapePattern(l,N.getValue(this.style,m.IS_INTERRUPTING,void 0)),this.paintOuterShape(l),ee.restoreOriginalOuterShapePattern(l),this.paintInnerShape(l)}paintOuterShape({canvas:t,shapeConfig:{x:s,y:i,width:o,height:r}}){super.paintVertexShape(t,s,i,o,r)}paintInnerShape(t){(this.iconPainters.get(N.getValue(this.style,m.EVENT_DEFINITION_KIND,R.NONE))??(()=>this.iconPainter.paintEmptyIcon()))(t)}static setDashedOuterShapePattern(t,s){t.canvas.save(),s==="false"&&(t.canvas.setDashed(!0,!1),t.canvas.setDashPattern("3 2"))}static restoreOriginalOuterShapePattern(t){t.canvas.restore()}}class Ns extends ee{constructor(){super(),this.withFilledIcon=!0}}class Ue extends ee{paintOuterShape({canvas:e,shapeConfig:{x:t,y:s,width:i,height:o,strokeWidth:r}}){e.ellipse(t,s,i,o),e.fillAndStroke();const l=r*1.5;e.ellipse(i*.02+l+t,o*.02+l+s,i*.96-2*l,o*.96-2*l),e.stroke()}}class Os extends Ue{constructor(){super(),this.withFilledIcon=!0}}class vs extends Ke{constructor(){super(...arguments);g(this,"iconPainter",se.get())}paintVertexShape(t,s,i,o,r){const l=ne({canvas:t,x:s,y:i,width:o,height:r,shape:this,ratioFromParent:1,isFilled:N.getValue(this.style,m.IS_INITIATING,"true")=="false"});this.iconPainter.paintEnvelopeIcon(l)}}class Te extends v.mxRhombus{constructor(){super(...arguments);g(this,"iconPainter",se.get())}paintVertexShape(t,s,i,o,r){const l=ne({canvas:t,x:s,y:i,width:o,height:r,shape:this});this.paintOuterShape(l),this.paintInnerShape(l)}paintOuterShape({canvas:t,shapeConfig:{x:s,y:i,width:o,height:r}}){super.paintVertexShape(t,s,i,o,r)}}class Ls extends Te{paintInnerShape(e){this.iconPainter.paintXCrossIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class ys extends Te{paintInnerShape(e){this.iconPainter.paintPlusCrossIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class _s extends Te{paintInnerShape(e){this.iconPainter.paintCircleIcon({...e,ratioFromParent:.62,iconStyleConfig:{...e.iconStyleConfig,isFilled:!1,strokeWidth:p.STROKE_WIDTH_THICK.valueOf()}})}}class ws extends Te{paintInnerShape(e){this.iconPainter.paintAsteriskIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class Rs extends Te{paintInnerShape(e){e={...e,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1}},this.iconPainter.paintCircleIcon({...e,ratioFromParent:.55}),bt(this.style)||this.iconPainter.paintCircleIcon({...e,ratioFromParent:.45});const t={...e,ratioFromParent:.3};N.getValue(this.style,m.EVENT_BASED_GATEWAY_KIND,de.Exclusive)==de.Parallel?this.iconPainter.paintPlusCrossIcon(t):this.iconPainter.paintPentagon(t)}}class bs extends Ke{paintForeground(e,t,s,i,o){e.begin(),e.moveTo(t+p.TEXT_ANNOTATION_BORDER_LENGTH,s),e.lineTo(t,s),e.lineTo(t,s+o),e.lineTo(t+p.TEXT_ANNOTATION_BORDER_LENGTH,s+o),e.stroke()}paintBackground(e,t,s,i,o){e.save(),e.setStrokeColor("none"),super.paintBackground(e,t,s,i,o),e.restore()}}class Fs{configureShapes(){this.initMxSvgCanvasPrototype(),this.initMxShapePrototype(),this.registerShapes()}registerShapes(){O.registerShape(h.EVENT_END,Ns),O.registerShape(h.EVENT_START,ee),O.registerShape(h.EVENT_INTERMEDIATE_THROW,Os),O.registerShape(h.EVENT_INTERMEDIATE_CATCH,Ue),O.registerShape(h.EVENT_BOUNDARY,Ue),O.registerShape(h.GATEWAY_COMPLEX,ws),O.registerShape(h.GATEWAY_EVENT_BASED,Rs),O.registerShape(h.GATEWAY_EXCLUSIVE,Ls),O.registerShape(h.GATEWAY_INCLUSIVE,_s),O.registerShape(h.GATEWAY_PARALLEL,ys),O.registerShape(h.SUB_PROCESS,Is),O.registerShape(h.CALL_ACTIVITY,Ss),O.registerShape(h.TASK,ds),O.registerShape(h.TASK_SERVICE,hs),O.registerShape(h.TASK_USER,fs),O.registerShape(h.TASK_RECEIVE,gs),O.registerShape(h.TASK_SEND,Ts),O.registerShape(h.TASK_MANUAL,ps),O.registerShape(h.TASK_SCRIPT,Es),O.registerShape(h.TASK_BUSINESS_RULE,ms),O.registerShape(h.TEXT_ANNOTATION,bs),O.registerShape(m.EDGE,Cs),O.registerShape(m.MESSAGE_FLOW_ICON,vs)}initMxSvgCanvasPrototype(){he.prototype.getTextCss=function(){const e=this.state,t=c.ABSOLUTE_LINE_HEIGHT?e.fontSize*c.LINE_HEIGHT+"px":c.LINE_HEIGHT*this.lineHeightCorrection;let s="display: inline-block; font-size: "+e.fontSize+"px; font-family: "+e.fontFamily+"; color: "+e.fontColor+"; line-height: "+t+"; pointer-events: none; ";(e.fontStyle&c.FONT_BOLD)==c.FONT_BOLD&&(s+="font-weight: bold; "),(e.fontStyle&c.FONT_ITALIC)==c.FONT_ITALIC&&(s+="font-style: italic; ");const i=[];return(e.fontStyle&c.FONT_UNDERLINE)==c.FONT_UNDERLINE&&i.push("underline"),(e.fontStyle&c.FONT_STRIKETHROUGH)==c.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&(s+="text-decoration: "+i.join(" ")+"; "),s}}initMxShapePrototype(){v.mxShape.prototype.createSvgCanvas=function(){var s;const e=new he(this.node,!1);e.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,e.pointerEventsValue=this.svgPointerEvents;const t=this.getSvgScreenOffset();if(t==0?this.node.removeAttribute("transform"):this.node.setAttribute("transform","translate("+t+","+t+")"),(s=this.state)!=null&&s.cell){const i=this.state.cell,o=os(i,this.dialect===c.DIALECT_STRICTHTML),r=this.state.style[m.EXTRA_CSS_CLASSES];typeof r=="string"&&o.push(...r.split(",")),this.node.setAttribute("class",o.join(" ")),this.node.dataset.bpmnId=this.state.cell.id}return e.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(e.format=function(i){return Math.round(parseFloat(i))}),e}}}const ht=12;class Mt{constructor(e){g(this,"specificFlowStyles",new Fe([[B.SEQUENCE_FLOW,e=>{e[c.STYLE_ENDARROW]=c.ARROW_BLOCK_THIN}],[B.MESSAGE_FLOW,e=>{e[c.STYLE_DASHED]=!0,e[c.STYLE_DASH_PATTERN]="8 5",e[c.STYLE_STARTARROW]=c.ARROW_OVAL,e[c.STYLE_STARTSIZE]=8,e[c.STYLE_STARTFILL]=!0,e[m.EDGE_START_FILL_COLOR]=p.MESSAGE_FLOW_MARKER_START_FILL_COLOR,e[c.STYLE_ENDARROW]=c.ARROW_BLOCK_THIN,e[c.STYLE_ENDFILL]=!0,e[m.EDGE_END_FILL_COLOR]=p.MESSAGE_FLOW_MARKER_END_FILL_COLOR}],[B.ASSOCIATION_FLOW,e=>{e[c.STYLE_DASHED]=!0,e[c.STYLE_DASH_PATTERN]="1 2",e[c.STYLE_STARTSIZE]=ht}]]));g(this,"specificSequenceFlowStyles",new Fe([[V.DEFAULT,e=>{e[c.STYLE_STARTARROW]=Rt.ARROW_DASH}],[V.CONDITIONAL_FROM_ACTIVITY,e=>{e[c.STYLE_STARTARROW]=c.ARROW_DIAMOND_THIN,e[c.STYLE_STARTSIZE]=18,e[c.STYLE_STARTFILL]=!0,e[m.EDGE_START_FILL_COLOR]=p.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR}]]));g(this,"specificAssociationFlowStyles",new Fe([[q.NONE,e=>{}],[q.ONE,e=>{e[c.STYLE_ENDARROW]=c.ARROW_OPEN_THIN}],[q.BOTH,e=>{e[c.STYLE_STARTARROW]=c.ARROW_OPEN_THIN,e[c.STYLE_ENDARROW]=c.ARROW_OPEN_THIN}]]));this.graph=e}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(e,t){this.getStylesheet().putCellStyle(e,t)}configureDefaultVertexStyle(){const e=this.getStylesheet().getDefaultVertexStyle();ft(e),e[c.STYLE_ABSOLUTE_ARCSIZE]=!0,e[c.STYLE_ARCSIZE]=p.SHAPE_ARC_SIZE}configurePoolStyle(){const e={};e[c.STYLE_SHAPE]=c.SHAPE_SWIMLANE,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,e[c.STYLE_ALIGN]=c.ALIGN_CENTER,e[c.STYLE_STARTSIZE]=p.POOL_LABEL_SIZE,e[c.STYLE_FILLCOLOR]=p.POOL_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(h.POOL,e)}configureLaneStyle(){const e={};e[c.STYLE_SHAPE]=c.SHAPE_SWIMLANE,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,e[c.STYLE_ALIGN]=c.ALIGN_CENTER,e[c.STYLE_SWIMLANE_LINE]=0,e[c.STYLE_STARTSIZE]=p.LANE_LABEL_SIZE,e[c.STYLE_FILLCOLOR]=p.LANE_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(h.LANE,e)}configureEventStyles(){for(const e of I.eventKinds()){const t={};t[c.STYLE_SHAPE]=e,t[c.STYLE_PERIMETER]=ot.EllipsePerimeter,t[c.STYLE_STROKEWIDTH]=e==h.EVENT_END?p.STROKE_WIDTH_THICK:p.STROKE_WIDTH_THIN,t[c.STYLE_VERTICAL_LABEL_POSITION]=c.ALIGN_BOTTOM,this.putCellStyle(e,t)}}configureTextAnnotationStyle(){const e={};e[c.STYLE_SHAPE]=h.TEXT_ANNOTATION,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,e[c.STYLE_ALIGN]=c.ALIGN_LEFT,e[c.STYLE_SPACING_LEFT]=5,e[c.STYLE_FILLCOLOR]=p.TEXT_ANNOTATION_FILL_COLOR,e[c.STYLE_STROKEWIDTH]=p.STROKE_WIDTH_THIN,this.putCellStyle(h.TEXT_ANNOTATION,e)}configureGroupStyle(){const e={};e[c.STYLE_ROUNDED]=!0,e[c.STYLE_DASHED]=!0,e[c.STYLE_DASH_PATTERN]="7 4 1 4",e[c.STYLE_STROKEWIDTH]=p.STROKE_WIDTH_THIN,e[c.STYLE_FILLCOLOR]=p.GROUP_FILL_COLOR,e[c.STYLE_ALIGN]=c.ALIGN_CENTER,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_TOP,this.putCellStyle(h.GROUP,e)}configureActivityStyles(){for(const e of I.activityKinds()){const t={};t[c.STYLE_SHAPE]=e,t[c.STYLE_ROUNDED]=!0,t[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,t[c.STYLE_STROKEWIDTH]=e==h.CALL_ACTIVITY?p.STROKE_WIDTH_THICK:p.STROKE_WIDTH_THIN,this.putCellStyle(e,t)}}configureGatewayStyles(){for(const e of I.gatewayKinds()){const t={};t[c.STYLE_SHAPE]=e,t[c.STYLE_PERIMETER]=ot.RhombusPerimeter,t[c.STYLE_STROKEWIDTH]=p.STROKE_WIDTH_THIN,t[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_TOP,t[c.STYLE_LABEL_POSITION]=c.ALIGN_LEFT,t[c.STYLE_VERTICAL_LABEL_POSITION]=c.ALIGN_TOP,this.putCellStyle(e,t)}}configureDefaultEdgeStyle(){const e=this.getStylesheet().getDefaultEdgeStyle();ft(e),e[c.STYLE_SHAPE]=m.EDGE,e[c.STYLE_ENDSIZE]=ht,e[c.STYLE_STROKEWIDTH]=1.5,e[c.STYLE_ROUNDED]=!0,e[c.STYLE_ARCSIZE]=5,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_BOTTOM,delete e[c.STYLE_ENDARROW]}configureEdgeStyles(e,t){for(const s of e){const i={};t.get(s)(i),this.graph.getStylesheet().putCellStyle(s.toString(),i)}}configureFlowStyles(){this.configureEdgeStyles(Object.values(B),this.specificFlowStyles),this.configureEdgeStyles(Object.values(V),this.specificSequenceFlowStyles),this.configureEdgeStyles(Object.values(q),this.specificAssociationFlowStyles)}}function ft(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 Fe extends Map{get(e){return super.get(e)??(()=>{})}}class Ps{constructor(e){g(this,"graph");this.container=e,this.graph=new ts(e)}configure(e){return this.configureGraph(),this.configureNavigationSupport(e),new Mt(this.graph).configureStyles(),new Fs().configureShapes(),new ss().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(e){var s;const t=this.graph.panningHandler;(s=e==null?void 0:e.navigation)!=null&&s.enabled?(t.addListener(W.PAN_START,gt(this.graph,"grab")),t.addListener(W.PAN_END,gt(this.graph,"default")),t.usePopupTrigger=!1,t.isForcePanningEvent=i=>W.isLeftMouseButton(i.getEvent())||W.isMultiTouchEvent(i.getEvent()),this.graph.setPanning(!0),this.graph.registerMouseWheelZoomListeners(e.navigation.zoom)):(this.graph.setPanning(!1),t.setPinchEnabled(!1),t.isForcePanningEvent=i=>!1)}}function gt(n,e){return()=>{n.isEnabled()&&(n.container.style.cursor=e)}}class ks{constructor(e){this.graph=e}fit(e){this.graph.customFit(e)}zoom(e){e=="in"?this.graph.zoomIn():this.graph.zoomOut()}}class xs{constructor(e){this.convertedElements=e}deserialize(e){const t=C(e.category).flatMap(s=>C(s.categoryValue));for(const s of t)this.convertedElements.registerCategoryValue(s.id,s.value)}}class ie{}class Bs{constructor(e){this.options=e}warning(e){var s;if((s=this.options)!=null&&s.disableConsoleLog)return;const t=e.getMessage();console.warn(`[bv-parser] ${t.template}`,...t.arguments)}}class Ms extends ie{constructor(e,t){super(),this.groupBpmnElementId=e,this.categoryValueReference=t}getMessage(){return{arguments:[this.categoryValueReference,this.groupBpmnElementId],template:"Group json deserialization: unable to find category value ref %s for bpmn element %s"}}}class Gs extends ie{constructor(e){super(),this.bpmnElementId=e}getMessage(){return{arguments:[this.bpmnElementId],template:"Shape json deserialization: unable to find bpmn element with id %s"}}}class Vs extends ie{constructor(e){super(),this.bpmnElementId=e}getMessage(){return{arguments:[this.bpmnElementId],template:"Edge json deserialization: unable to find bpmn element with id %s"}}}class Ys extends ie{constructor(e,t){super(),this.shapeOrEdgeId=e,this.labelStyleId=t}getMessage(){return{arguments:[this.labelStyleId,this.shapeOrEdgeId],template:"Unable to assign font from style %s to shape/edge %s"}}}class Us extends ie{constructor(e,t){super(),this.laneId=e,this.flowNodeReference=t}getMessage(){return{arguments:[this.flowNodeReference,this.laneId],template:"Unable to assign lane %s as parent: flow node %s is not found"}}}class Ds extends ie{constructor(e,t,s){super(),this.bpmnElementId=e,this.attachedToReference=t,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(){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(e){return this.poolsById.get(e)}findPoolByProcessRef(e){return this.poolsByProcessRef.get(e)}registerPool(e,t){this.poolsById.set(e.id,e),t&&this.poolsByProcessRef.set(t,e)}findMessageFlow(e){return this.messageFlows.get(e)}registerMessageFlow(e){this.messageFlows.set(e.id,e)}findFlowNode(e){return this.flowNodes.get(e)}registerFlowNode(e){this.flowNodes.set(e.id,e)}findLane(e){return this.lanes.get(e)}registerLane(e){this.lanes.set(e.id,e)}findSequenceFlow(e){return this.sequenceFlows.get(e)}registerSequenceFlow(e){this.sequenceFlows.set(e.id,e)}findAssociationFlow(e){return this.associationFlows.get(e)}registerAssociationFlow(e){this.associationFlows.set(e.id,e)}findEventDefinitionOfDefinition(e){return this.eventDefinitionsOfDefinitions.get(e)}registerEventDefinitionsOfDefinition(e,t){this.eventDefinitionsOfDefinitions.set(e,t)}findGlobalTask(e){return this.globalTasks.get(e)}registerGlobalTask(e,t){this.globalTasks.set(e,t)}findCategoryValue(e){return this.categoryValues.get(e)}registerCategoryValue(e,t){this.categoryValues.set(e,{value:t})}}const Gt=(n,e,t,s)=>{const i=n.findCategoryValue(t.categoryValueRef);if(i)return new Y(t.id,i.value,h.GROUP,s);e.warning(new Ms(t.id,t.categoryValueRef))};class Hs{constructor(e,t){this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){for(const t of C(e))this.parseCollaboration(t)}parseCollaboration(e){this.buildParticipant(e.participant),this.buildMessageFlows(e.messageFlow),this.buildGroups(e.group)}buildParticipant(e){for(const t of C(e))this.convertedElements.registerPool(new Y(t.id,t.name,h.POOL),t.processRef)}buildMessageFlows(e){for(const t of C(e))this.convertedElements.registerMessageFlow(new Ot(t.id,t.name,t.sourceRef,t.targetRef))}buildGroups(e){for(const t of C(e)){const s=Gt(this.convertedElements,this.parsingMessageCollector,t);s&&this.convertedElements.registerFlowNode(s)}}}class Ks{constructor(e,t,s,i){this.x=e,this.y=t,this.width=s,this.height=i}}class zs{constructor(e,t,s,i,o=ge.NONE){g(this,"extensions",{});this.id=e,this.bpmnElement=t,this.waypoints=s,this.label=i,this.messageVisibleKind=o}}class Xs{constructor(e,t){this.x=e,this.y=t}}class $s{constructor(e,t){g(this,"extensions",{});this.font=e,this.bounds=t}}class Zs{constructor(e,t,s,i,o,r){this.name=e,this.size=t,this.isBold=s,this.isItalic=i,this.isUnderline=o,this.isStrikeThrough=r}}class J{constructor(e,t){g(this,"convertedFonts",new Map);this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){const t=[],s=[],i=[],o=[],r=C(e)[0];if(r){this.deserializeFonts(r.BPMNLabelStyle);const l=r.BPMNPlane,a=this.deserializeEdges(l.BPMNEdge),u=this.deserializeShapes(l.BPMNShape);t.push(...u.flowNodes),s.push(...u.lanes),i.push(...u.pools),o.push(...a)}return{flowNodes:t,lanes:s,pools:i,edges:o}}deserializeFonts(e){this.convertedFonts=new Map;for(const t of C(e))for(const s of C(t.Font))this.convertedFonts.set(t.id,new Zs(s.name,s.size,s.isBold,s.isItalic,s.isUnderline,s.isStrikeThrough))}deserializeShapes(e){const t={flowNodes:[],lanes:[],pools:[]};for(const s of C(e))this.deserializeShapeAndStoreIfFound(s,t.flowNodes,i=>this.convertedElements.findFlowNode(i))||this.deserializeShapeAndStoreIfFound(s,t.lanes,i=>this.convertedElements.findLane(i))||this.deserializeShapeAndStoreIfFound(s,t.pools,i=>this.convertedElements.findPoolById(i))||this.parsingMessageCollector.warning(new Gs(s.bpmnElement));return t}deserializeShapeAndStoreIfFound(e,t,s){const i=this.deserializeShape(e,s);return i?(t.push(i),!0):!1}deserializeShape(e,t){const s=t(e.bpmnElement);if(s){const i=J.deserializeBounds(e);(s instanceof fe||s instanceof j&&s.callActivityKind===ue.CALLING_PROCESS)&&!e.isExpanded&&s.markers.push(w.EXPAND);let o;I.isPoolOrLane(s.kind)&&(o=e.isHorizontal??!0);const r=e.BPMNLabel,l=this.deserializeLabel(r,e.id),a=new Ie(e.id,s,i,l,o);return J.setColorExtensionsOnShape(a,e),a}}static setColorExtensionsOnShape(e,t){"background-color"in t?e.extensions.fillColor=t["background-color"]:"fill"in t&&(e.extensions.fillColor=t.fill),"border-color"in t?e.extensions.strokeColor=t["border-color"]:"stroke"in t&&(e.extensions.strokeColor=t.stroke)}static deserializeBounds(e){const t=e.Bounds;if(t)return new Ks(t.x,t.y,t.width,t.height)}deserializeEdges(e){return C(e).map(t=>{const s=this.convertedElements.findSequenceFlow(t.bpmnElement)||this.convertedElements.findMessageFlow(t.bpmnElement)||this.convertedElements.findAssociationFlow(t.bpmnElement);if(!s){this.parsingMessageCollector.warning(new Vs(t.bpmnElement));return}const i=this.deserializeWaypoints(t.waypoint),o=this.deserializeLabel(t.BPMNLabel,t.id),r=t.messageVisibleKind?t.messageVisibleKind:ge.NONE,l=new zs(t.id,s,i,o,r);return J.setColorExtensionsOnEdge(l,t),l}).filter(Boolean)}static setColorExtensionsOnEdge(e,t){"border-color"in t?e.extensions.strokeColor=t["border-color"]:"stroke"in t&&(e.extensions.strokeColor=t.stroke)}deserializeWaypoints(e){return C(e).map(t=>new Xs(t.x,t.y))}deserializeLabel(e,t){if(e&&typeof e=="object"){const s=this.findFont(e.labelStyle,t),i=J.deserializeBounds(e),o=new $s(s,i);if("color"in e)return o.extensions.color=e.color,o;if(s||i)return o}}findFont(e,t){let s;return e&&(s=this.convertedFonts.get(e),s||this.parsingMessageCollector.warning(new Ys(t,e))),s}}const js=n=>"source"in n||"target"in n;class qs{constructor(e){this.convertedElements=e}deserialize(e){for(const t of At){const s=e[t+"EventDefinition"];for(const i of C(s,!0))this.convertedElements.registerEventDefinitionsOfDefinition(i.id,{id:i.id,kind:t,...js(i)?{source:i.source,target:i.target}:{}})}}}class Qs{constructor(e){this.convertedElements=e}deserialize(e){this.parseGlobalTasks(e.globalTask,h.GLOBAL_TASK),this.parseGlobalTasks(e.globalBusinessRuleTask,h.GLOBAL_TASK_BUSINESS_RULE),this.parseGlobalTasks(e.globalManualTask,h.GLOBAL_TASK_MANUAL),this.parseGlobalTasks(e.globalScriptTask,h.GLOBAL_TASK_SCRIPT),this.parseGlobalTasks(e.globalUserTask,h.GLOBAL_TASK_USER)}parseGlobalTasks(e,t){for(const s of C(e))this.convertedElements.registerGlobalTask(s.id,t)}}const Js=(n,e)=>{switch(n){case"adHocSubProcess":return D.AD_HOC;case"transaction":return D.TRANSACTION;default:return e.triggeredByEvent?D.EVENT:D.EMBEDDED}},ei=["adHocSubProcess","transaction",...I.flowNodeKinds().filter(n=>n!==h.EVENT_BOUNDARY),h.EVENT_BOUNDARY];function ti(n){return["adHocSubProcess","transaction"].includes(n)?h.SUB_PROCESS:n}class ni{constructor(e,t){g(this,"defaultSequenceFlowIds",[]);g(this,"elementsWithoutParentByProcessId",new Map);g(this,"callActivitiesCallingProcess",new Map);g(this,"eventsByLinkEventDefinition",new Map);this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){for(const t of C(e))this.parseProcess(t);for(const t of C(e))this.assignParentOfProcessElementsCalledByCallActivity(t.id);this.assignIncomingAndOutgoingIdsFromFlows(),this.assignSourceAndTargetIdsToLinkEvents()}assignParentOfProcessElementsCalledByCallActivity(e){const t=this.callActivitiesCallingProcess.get(e);if(t){const s=this.convertedElements.findPoolByProcessRef(e);s&&(s.parentId=t.id);for(const i of this.elementsWithoutParentByProcessId.get(e))i.parentId=t.id}}assignIncomingAndOutgoingIdsFromFlows(){const e=(t,s,i)=>{const o=this.convertedElements.findFlowNode(t)??this.convertedElements.findLane(t)??this.convertedElements.findPoolById(t);o&&!o[s].includes(i)&&o[s].push(i)};for(const t of this.convertedElements.getFlows())e(t.sourceReferenceId,"outgoingIds",t.id),e(t.targetReferenceId,"incomingIds",t.id)}assignSourceAndTargetIdsToLinkEvents(){var t;const e=[...this.eventsByLinkEventDefinition.entries()].filter(([s])=>s.id);for(const[s,i]of this.eventsByLinkEventDefinition)if(i instanceof Ge){const o=e.find(([r])=>s.target===r.id);i.targetId=(t=o==null?void 0:o[1])==null?void 0:t.id}else i instanceof Me&&(i.sourceIds=e.filter(([o])=>Array.isArray(s.source)?s.source.includes(o.id):s.source===o.id).map(([,o])=>o.id))}parseProcess(e){const t=e.id,s=this.convertedElements.findPoolByProcessRef(t);s&&!s.name&&this.convertedElements.registerPool(new Y(s.id,e.name,h.POOL),t),this.buildProcessInnerElements(e,s==null?void 0:s.id)}buildProcessInnerElements(e,t){this.elementsWithoutParentByProcessId.set(e.id,[]);for(const s of ei)this.buildFlowNodeBpmnElements(e[s],ti(s),t,e.id,s);this.buildLaneSetBpmnElements(e.laneSet,t,e.id),this.buildSequenceFlows(e.sequenceFlow),this.buildAssociationFlows(e.association)}buildFlowNodeBpmnElements(e,t,s,i,o){for(const r of C(e)){const l=this.buildFlowNodeBpmnElement(t,r,s,o);"default"in r&&I.isWithDefaultSequenceFlow(t)&&this.defaultSequenceFlowIds.push(r.default),l&&(this.convertedElements.registerFlowNode(l),s||this.elementsWithoutParentByProcessId.get(i).push(l))}}buildFlowNodeBpmnElement(e,t,s,i){if(I.isEvent(e))return this.buildShapeBpmnEvent(t,e,s);if(I.isActivity(e))return this.buildShapeBpmnActivity(t,e,s,i);if(e==h.GATEWAY_EVENT_BASED){const o=t;return new wt(o.id,o.name,s,o.instantiate,de[o.eventGatewayType])}else{if(e==h.GROUP)return Gt(this.convertedElements,this.parsingMessageCollector,t,s);{const o=e===h.TEXT_ANNOTATION?t.text:t.name;return new Y(t.id,o,e,s,t.instantiate)}}}buildShapeBpmnActivity(e,t,s,i){const o=si(e);return I.isSubProcess(t)?this.buildShapeBpmnSubProcess(e,s,Js(i,e),o):I.isCallActivity(t)?this.buildShapeBpmnCallActivity(e,s,o):new Le(e.id,e.name,t,s,e.instantiate,o)}buildShapeBpmnCallActivity(e,t,s){const i=this.convertedElements.findGlobalTask(e.calledElement);if(!i){const o=new j(e.id,e.name,ue.CALLING_PROCESS,t,s);return this.callActivitiesCallingProcess.set(e.calledElement,o),o}return new j(e.id,e.name,ue.CALLING_GLOBAL_TASK,t,s,i)}buildShapeBpmnEvent(e,t,s){const i=this.getEventDefinitions(e),o=[...i.entries()].map(([,r])=>r.length).reduce((r,l)=>r+l,0);if(o==0&&I.canHaveNoneEvent(t))return new K(e.id,e.name,t,R.NONE,s);if(o==1){const[r,l]=[...i.entries()][0],a=I.isCatchEvent(t)?this.buildShapeBpmnCatchEvent(e,t,r,s):this.buildShapeBpmnThrowEvent(e,t,r,s);return r===R.LINK&&(l[0].id||l[0].target||l[0].source)&&this.eventsByLinkEventDefinition.set(l[0],a),a}}buildShapeBpmnCatchEvent(e,t,s,i){return I.isBoundaryEvent(t)?this.buildShapeBpmnBoundaryEvent(e,s):I.isStartEvent(t)?new yt(e.id,e.name,s,i,e.isInterrupting):new Me(e.id,e.name,s,i)}buildShapeBpmnThrowEvent(e,t,s,i){return I.isIntermediateThrowEvent(t)?new Ge(e.id,e.name,s,i):new K(e.id,e.name,t,s,i)}buildShapeBpmnBoundaryEvent(e,t){const s=this.convertedElements.findFlowNode(e.attachedToRef);if(I.isActivity(s==null?void 0:s.kind))return new _t(e.id,e.name,t,e.attachedToRef,e.cancelActivity);this.parsingMessageCollector.warning(new Ds(e.id,e.attachedToRef,s==null?void 0:s.kind))}getEventDefinitions(e){const t=new Map;for(const s of At){const i=e[`${s}EventDefinition`];t.set(s,C(i,!0))}for(const s of C(e.eventDefinitionRef)){const i=this.convertedElements.findEventDefinitionOfDefinition(s);i&&t.get(i.kind).push(i)}for(const[s]of[...t.entries()].filter(([,i])=>i.length===0))t.delete(s);return t}buildShapeBpmnSubProcess(e,t,s,i){const o=new fe(e.id,e.name,s,t,i);return this.buildProcessInnerElements(e,e.id),o}buildLaneSetBpmnElements(e,t,s){for(const i of C(e))this.buildLaneBpmnElements(i.lane,t,s)}buildLaneBpmnElements(e,t,s){var i;for(const o of C(e)){const r=new Y(o.id,o.name,h.LANE,t);this.convertedElements.registerLane(r),t||this.elementsWithoutParentByProcessId.get(s).push(r),this.assignParentOfLaneFlowNodes(o),(i=o.childLaneSet)!=null&&i.lane&&this.buildLaneBpmnElements(o.childLaneSet.lane,o.id,s)}}assignParentOfLaneFlowNodes(e){for(const t of C(e.flowNodeRef)){const s=this.convertedElements.findFlowNode(t),i=e.id;s?I.isBoundaryEvent(s.kind)||(s.parentId=i):this.parsingMessageCollector.warning(new Us(i,t))}}buildSequenceFlows(e){for(const t of C(e)){const s=this.getSequenceFlowKind(t);this.convertedElements.registerSequenceFlow(new Nt(t.id,t.name,t.sourceRef,t.targetRef,s))}}buildAssociationFlows(e){for(const t of C(e)){const s=t.associationDirection;this.convertedElements.registerAssociationFlow(new vt(t.id,void 0,t.sourceRef,t.targetRef,s))}}getSequenceFlowKind(e){if(this.defaultSequenceFlowIds.includes(e.id))return V.DEFAULT;{const t=this.convertedElements.findFlowNode(e.sourceRef);if(t&&I.isWithDefaultSequenceFlow(t.kind)&&e.conditionExpression)return I.isActivity(t.kind)?V.CONDITIONAL_FROM_ACTIVITY:V.CONDITIONAL_FROM_GATEWAY}return V.NORMAL}}const si=n=>{const e=[],t=n.standardLoopCharacteristics,s=C(n.multiInstanceLoopCharacteristics,!0)[0];return t!==void 0?e.push(w.LOOP):s&&e.push(s.isSequential?w.MULTI_INSTANCE_SEQUENTIAL:w.MULTI_INSTANCE_PARALLEL),e};class ii{constructor(e,t,s,i,o,r){this.categoryConverter=e,this.collaborationConverter=t,this.eventDefinitionConverter=s,this.globalTaskConverter=i,this.processConverter=o,this.diagramConverter=r}parse(e){const t=e.definitions;return this.categoryConverter.deserialize(t),this.collaborationConverter.deserialize(t.collaboration),this.eventDefinitionConverter.deserialize(t),this.globalTaskConverter.deserialize(t),this.processConverter.deserialize(t.process),this.diagramConverter.deserialize(t.BPMNDiagram)}}function oi(n){const e=new Ws;return new ii(new xs(e),new Hs(e,n),new qs(e),new Qs(e),new ni(e,n),new J(e,n))}var $e={},_e={};(function(n){const e=":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",t=e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",s="["+e+"]["+t+"]*",i=new RegExp("^"+s+"$"),o=function(l,a){const u=[];let d=a.exec(l);for(;d;){const f=[];f.startIndex=a.lastIndex-d[0].length;const T=d.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,u){if(a){const d=Object.keys(a),f=d.length;for(let T=0;T"&&n[o]!==" "&&n[o]!==" "&&n[o]!==` -`&&n[o]!=="\r";o++)a+=n[o];if(a=a.trim(),a[a.length-1]==="/"&&(a=a.substring(0,a.length-1),o--),!gi(a)){let f;return a.trim().length===0?f="Invalid space after '<'.":f="Tag '"+a+"' is an invalid name.",y("InvalidTag",f,b(n,o))}const u=ci(n,o);if(u===!1)return y("InvalidAttr","Attributes for '"+a+"' have open quote.",b(n,o));let d=u.value;if(o=u.index,d[d.length-1]==="/"){const f=o-d.length;d=d.substring(0,d.length-1);const T=St(d,e);if(T===!0)s=!0;else return y(T.err.code,T.err.msg,b(n,f+T.err.line))}else if(l)if(u.tagClosed){if(d.trim().length>0)return y("InvalidTag","Closing tag '"+a+"' can't have attributes or invalid starting.",b(n,r));{const f=t.pop();if(a!==f.tagName){let T=b(n,f.tagStartPos);return y("InvalidTag","Expected closing tag '"+f.tagName+"' (opened in line "+T.line+", col "+T.col+") instead of closing tag '"+a+"'.",b(n,r))}t.length==0&&(i=!0)}}else return y("InvalidTag","Closing tag '"+a+"' doesn't have proper closing.",b(n,o));else{const f=St(d,e);if(f!==!0)return y(f.err.code,f.err.msg,b(n,o-d.length+f.err.line));if(i===!0)return y("InvalidXml","Multiple possible root nodes found.",b(n,o));e.unpairedTags.indexOf(a)!==-1||t.push({tagName:a,tagStartPos:r}),s=!0}for(o++;o0)return y("InvalidXml","Invalid '"+JSON.stringify(t.map(o=>o.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return y("InvalidXml","Start tag expected.",1);return!0};function Tt(n){return n===" "||n===" "||n===` -`||n==="\r"}function pt(n,e){const t=e;for(;e5&&s==="xml")return y("InvalidXml","XML declaration allowed only at the start of the document.",b(n,e));if(n[e]=="?"&&n[e+1]==">"){e++;break}else continue}return e}function Et(n,e){if(n.length>e+5&&n[e+1]==="-"&&n[e+2]==="-"){for(e+=3;e"){e+=2;break}}else if(n.length>e+8&&n[e+1]==="D"&&n[e+2]==="O"&&n[e+3]==="C"&&n[e+4]==="T"&&n[e+5]==="Y"&&n[e+6]==="P"&&n[e+7]==="E"){let t=1;for(e+=8;e"&&(t--,t===0))break}else if(n.length>e+9&&n[e+1]==="["&&n[e+2]==="C"&&n[e+3]==="D"&&n[e+4]==="A"&&n[e+5]==="T"&&n[e+6]==="A"&&n[e+7]==="["){for(e+=8;e"){e+=2;break}}return e}const li='"',ai="'";function ci(n,e){let t="",s="",i=!1;for(;e"&&s===""){i=!0;break}t+=n[e]}return s!==""?!1:{value:t,index:e,tagClosed:i}}const ui=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function St(n,e){const t=Ze.getAllMatches(n,ui),s={};for(let i=0;i!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,e,t){return n}},Ti=function(n){return Object.assign({},Vt,n)};je.buildOptions=Ti;je.defaultOptions=Vt;class pi{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}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})}}var Ei=pi;const Si=_e;function Ii(n,e){const t={};if(n[e+3]==="O"&&n[e+4]==="C"&&n[e+5]==="T"&&n[e+6]==="Y"&&n[e+7]==="P"&&n[e+8]==="E"){e=e+9;let s=1,i=!1,o=!1,r="";for(;e"){if(o?n[e-1]==="-"&&n[e-2]==="-"&&(o=!1,s--):s--,s===0)break}else n[e]==="["?i=!0:r+=n[e];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:t,i:e}}function mi(n,e){let t="";for(;e0&&i&&t[2]!==".")return n;if(!e.leadingZeros&&o.length>0&&!i&&t[1]!==".")return n;{const a=Number(t),u=""+a;return u.search(/[eE]/)!==-1||l?e.eNotation?a:n:t.indexOf(".")!==-1?u==="0"&&r===""||u===r||i&&u==="-"+r?a:n:o?r===u||i+r===u?a:n:t===u||t===i+u?a:n}}else return n}}function Fi(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 Pi=bi;const Yt=_e,ae=Ei,ki=yi,xi=Pi;let Bi=class{constructor(e){this.options=e,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:"₹"}},this.addExternalEntities=Mi,this.parseXml=Di,this.parseTextData=Gi,this.resolveNameSpace=Vi,this.buildAttributesMap=Ui,this.isItStopNode=zi,this.replaceEntitiesValue=Hi,this.readStopNodeData=$i,this.saveTextToParentTag=Ki,this.addChild=Wi}};function Mi(n){const e=Object.keys(n);for(let t=0;t0)){r||(n=this.replaceEntitiesValue(n));const l=this.options.tagValueProcessor(e,n,t,i,o);return l==null?n:typeof l!=typeof n||l!==n?l:this.options.trimValues?We(n,this.options.parseTagValue,this.options.numberParseOptions):n.trim()===n?We(n,this.options.parseTagValue,this.options.numberParseOptions):n}}function Vi(n){if(this.options.removeNSPrefix){const e=n.split(":"),t=n.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(n=t+e[1])}return n}const Yi=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Ui(n,e,t){if(!this.options.ignoreAttributes&&typeof n=="string"){const s=Yt.getAllMatches(n,Yi),i=s.length,o={};for(let r=0;r",o,"Closing Tag is not closed.");let a=n.substring(o+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)),t&&(s=this.saveTextToParentTag(s,t,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 d=0;u&&this.options.unpairedTags.indexOf(u)!==-1?(d=i.lastIndexOf(".",i.lastIndexOf(".")-1),this.tagsNodeStack.pop()):d=i.lastIndexOf("."),i=i.substring(0,d),t=this.tagsNodeStack.pop(),s="",o=l}else if(n[o+1]==="?"){let l=De(n,o,!1,"?>");if(!l)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,t,i),!(this.options.ignoreDeclaration&&l.tagName==="?xml"||this.options.ignorePiTags)){const a=new ae(l.tagName);a.add(this.options.textNodeName,""),l.tagName!==l.tagExp&&l.attrExpPresent&&(a[":@"]=this.buildAttributesMap(l.tagExp,i,l.tagName)),this.addChild(t,a,i)}o=l.closeIndex+1}else if(n.substr(o+1,3)==="!--"){const l=Z(n,"-->",o+4,"Comment is not closed.");if(this.options.commentPropName){const a=n.substring(o+4,l-2);s=this.saveTextToParentTag(s,t,i),t.add(this.options.commentPropName,[{[this.options.textNodeName]:a}])}o=l}else if(n.substr(o+1,2)==="!D"){const l=ki(n,o);this.docTypeEntities=l.entities,o=l.i}else if(n.substr(o+1,2)==="!["){const l=Z(n,"]]>",o,"CDATA is not closed.")-2,a=n.substring(o+9,l);s=this.saveTextToParentTag(s,t,i);let u=this.parseTextData(a,t.tagname,i,!0,!1,!0,!0);u==null&&(u=""),this.options.cdataPropName?t.add(this.options.cdataPropName,[{[this.options.textNodeName]:a}]):t.add(this.options.textNodeName,u),o=l+2}else{let l=De(n,o,this.options.removeNSPrefix),a=l.tagName;const u=l.rawTagName;let d=l.tagExp,f=l.attrExpPresent,T=l.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),t&&s&&t.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,t,i,!1));const E=t;if(E&&this.options.unpairedTags.indexOf(E.tagname)!==-1&&(t=this.tagsNodeStack.pop(),i=i.substring(0,i.lastIndexOf("."))),a!==e.tagname&&(i+=i?"."+a:a),this.isItStopNode(this.options.stopNodes,i,a)){let S="";if(d.length>0&&d.lastIndexOf("/")===d.length-1)o=l.closeIndex;else if(this.options.unpairedTags.indexOf(a)!==-1)o=l.closeIndex;else{const P=this.readStopNodeData(n,u,T+1);if(!P)throw new Error(`Unexpected end of ${u}`);o=P.i,S=P.tagContent}const M=new ae(a);a!==d&&f&&(M[":@"]=this.buildAttributesMap(d,i,a)),S&&(S=this.parseTextData(S,a,i,!0,f,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),M.add(this.options.textNodeName,S),this.addChild(t,M,i)}else{if(d.length>0&&d.lastIndexOf("/")===d.length-1){a[a.length-1]==="/"?(a=a.substr(0,a.length-1),i=i.substr(0,i.length-1),d=a):d=d.substr(0,d.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const S=new ae(a);a!==d&&f&&(S[":@"]=this.buildAttributesMap(d,i,a)),this.addChild(t,S,i),i=i.substr(0,i.lastIndexOf("."))}else{const S=new ae(a);this.tagsNodeStack.push(t),a!==d&&f&&(S[":@"]=this.buildAttributesMap(d,i,a)),this.addChild(t,S,i),t=S}s="",o=T}}else s+=n[o];return e.child};function Wi(n,e,t){const s=this.options.updateTag(e.tagname,t,e[":@"]);s===!1||(typeof s=="string"&&(e.tagname=s),n.addChild(e))}const Hi=function(n){if(this.options.processEntities){for(let e in this.docTypeEntities){const t=this.docTypeEntities[e];n=n.replace(t.regx,t.val)}for(let e in this.lastEntities){const t=this.lastEntities[e];n=n.replace(t.regex,t.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const t=this.htmlEntities[e];n=n.replace(t.regex,t.val)}n=n.replace(this.ampEntity.regex,this.ampEntity.val)}return n};function Ki(n,e,t,s){return n&&(s===void 0&&(s=Object.keys(e.child).length===0),n=this.parseTextData(n,e.tagname,t,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,s),n!==void 0&&n!==""&&e.add(this.options.textNodeName,n),n=""),n}function zi(n,e,t){const s="*."+t;for(const i in n){const o=n[i];if(s===o||e===o)return!0}return!1}function Xi(n,e,t=">"){let s,i="";for(let o=e;o",t,`${e} is not closed`);if(n.substring(t+2,o).trim()===e&&(i--,i===0))return{tagContent:n.substring(s,t),i:o};t=o}else if(n[t+1]==="?")t=Z(n,"?>",t+1,"StopNode is not closed.");else if(n.substr(t+1,3)==="!--")t=Z(n,"-->",t+3,"StopNode is not closed.");else if(n.substr(t+1,2)==="![")t=Z(n,"]]>",t,"StopNode is not closed.")-2;else{const o=De(n,t,">");o&&((o&&o.tagName)===e&&o.tagExp[o.tagExp.length-1]!=="/"&&i++,t=o.closeIndex)}}function We(n,e,t){if(e&&typeof n=="string"){const s=n.trim();return s==="true"?!0:s==="false"?!1:xi(n,t)}else return Yt.isExist(n)?n:""}var Zi=Bi,Ut={};function ji(n,e){return Dt(n,e)}function Dt(n,e,t){let s;const i={};for(let o=0;o0&&(i[e.textNodeName]=s):s!==void 0&&(i[e.textNodeName]=s),i}function qi(n){const e=Object.keys(n);for(let t=0;t0&&(t=ro),Wt(n,e,"",t)}function Wt(n,e,t,s){let i="",o=!1;for(let r=0;r`,o=!1;continue}else if(a===e.commentPropName){i+=s+``,o=!0;continue}else if(a[0]==="?"){const S=It(l[":@"],e),M=a==="?xml"?"":s;let P=l[a][0][e.textNodeName];P=P.length!==0?" "+P:"",i+=M+`<${a}${P}${S}?>`,o=!0;continue}let d=s;d!==""&&(d+=e.indentBy);const f=It(l[":@"],e),T=s+`<${a}${f}`,E=Wt(l[a],e,u,d);e.unpairedTags.indexOf(a)!==-1?e.suppressUnpairedNode?i+=T+">":i+=T+"/>":(!E||E.length===0)&&e.suppressEmptyNode?i+=T+"/>":E&&E.endsWith(">")?i+=T+`>${E}${s}`:(i+=T+">",E&&s!==""&&(E.includes("/>")||E.includes("`),o=!0}return i}function ao(n){const e=Object.keys(n);for(let t=0;t0&&e.processEntities)for(let t=0;t","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function X(n){this.options=Object.assign({},fo,n),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=po),this.processTextOrObjNode=go,this.options.format?(this.indentate=To,this.tagEndChar=`> +var kt=Object.defineProperty;var Bt=(n,t,e)=>t in n?kt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var g=(n,t,e)=>Bt(n,typeof t!="symbol"?t+"":t,e);import{f as xt}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||{}),Mt=(n=>(n.In="in",n.Out="out",n))(Mt||{});function Vt(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 Yt(n,t){return n===""?t?{}:void 0:n}function I(n,t=!1){return n==null?[]:(Array.isArray(n)?n:[n]).map(e=>Yt(e,t)).filter(Boolean)}function Gt(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 Dt.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 Gt(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],Dt=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||{}),P=(n=>(n.SEQUENCE_FLOW="sequenceFlow",n.MESSAGE_FLOW="messageFlow",n.ASSOCIATION_FLOW="association",n))(P||{}),ne=(n=>(n.NONE="none",n.INITIATING="initiating",n.NON_INITIATING="non_initiating",n))(ne||{}),B=(n=>(n.NORMAL="normal",n.DEFAULT="default",n.CONDITIONAL_FROM_ACTIVITY="conditional_from_activity",n.CONDITIONAL_FROM_GATEWAY="conditional_from_gateway",n))(B||{});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=B.NORMAL){super(t,e,P.SEQUENCE_FLOW,s,o),this.sequenceFlowKind=i}}class rt extends de{constructor(t,e,s,o){super(t,e,P.MESSAGE_FLOW,s,o)}}class lt extends de{constructor(t,e,s,o,i=X.NONE){super(t,e,P.ASSOCIATION_FLOW,s,o),this.associationDirectionKind=i}}const O=Wt(),Ut=O.mxCellRenderer,at=O.mxClient,c=O.mxConstants,G=O.mxEvent,We=O.mxPerimeter,F=O.mxPoint,Ce=O.mxRectangle,we=O.mxRectangleShape,Re=O.mxSvgCanvas2D,N=O.mxUtils;function Wt(){return window.mxForceIncludes=!1,window.mxLoadResources=!1,window.mxLoadStylesheets=!1,window.mxResourceExtension=".txt",xt({})}class Ht{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 F(o,i)}getTranslateForRoot(t){const e=this.graph.getModel(),s=new F(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 F(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 x{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 x{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 x{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 ct extends U{constructor(t,e,s,o,i){super(t,e,h.EVENT_START,s,o),this.isInterrupting=i}}class ut extends U{constructor(t,e,s,o,i=!0){super(t,e,h.EVENT_BOUNDARY,s,o),this.isInterrupting=i}}class dt extends x{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 Kt(n){return Math.max(n??0,0)}function zt(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 Xt(n){return n=="default"?void 0:ae(n,1,50,1)}const m={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"},ht={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"},ft=n=>N.getValue(n,m.IS_INSTANTIATING,"false")=="true",ce=n=>n=="default"?void 0:n,$t=(n,t)=>(t&&(n=R(n,c.STYLE_STROKECOLOR,t.color,ce),n=R(n,c.STYLE_STROKE_OPACITY,t.opacity,fe),n=R(n,c.STYLE_STROKEWIDTH,t.width,Xt)),n),R=(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),Zt=(n,t)=>(t&&(n=R(n,c.STYLE_FONTCOLOR,t.color,ce),n=R(n,c.STYLE_FONTSIZE,t.size),n=R(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=R(n,c.STYLE_TEXT_OPACITY,t.opacity,fe)),n),qt=(n,t,e)=>(n==null?void 0:n.split(";").map(s=>s.split("=")).filter(([s])=>s===t).map(([,s])=>s)[0])??e,jt=n=>{switch(n){case"right-to-left":return c.DIRECTION_WEST;case"bottom-to-top":return c.DIRECTION_NORTH;case"top-to-bottom":return c.DIRECTION_SOUTH;default:return c.DIRECTION_EAST}},Qt=(n,t)=>{const e=t.color;if(e){const s=en(e),o=s?e.startColor:e;n=R(n,c.STYLE_FILLCOLOR,o,ce),s?(n=N.setStyle(n,c.STYLE_GRADIENTCOLOR,e.endColor),n=N.setStyle(n,c.STYLE_GRADIENT_DIRECTION,jt(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=R(n,c.STYLE_SWIMLANE_FILLCOLOR,o,ce))}return n=R(n,c.STYLE_FILL_OPACITY,t.opacity,fe),n},Jt=n=>n&&typeof n=="object"&&"fill"in n,en=n=>n&&typeof n=="object";class tn{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(...on(t)),o=this.computeEdgeStyleValues(t));const i=this.computeFontStyleValues(t),r=rn(t,e);return s.push(...He([...o,...i,...r])),s.join(";")}computeShapeStyleValues(t){const e=new Map,s=t.bpmnElement;if(s instanceof U?nn(s,e):s instanceof he?sn(s,e):C.isPoolOrLane(s.kind)?e.set(c.STYLE_HORIZONTAL,t.isHorizontal?"0":"1"):s instanceof dt&&(e.set(m.IS_INSTANTIATING,String(s.instantiate)),e.set(m.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,ln(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",m.MESSAGE_FLOW_ICON],[m.IS_INITIATING,String(t.messageVisibleKind===ne.INITIATING)]),this.ignoreBpmnColors||t.extensions.strokeColor&&e.push([c.STYLE_STROKECOLOR,t.extensions.strokeColor]),He(e).join(";")}}function nn(n,t){t.set(m.EVENT_DEFINITION_KIND,n.eventDefinitionKind),(n instanceof ut||n instanceof ct&&n.isInterrupting!==void 0)&&t.set(m.IS_INTERRUPTING,String(n.isInterrupting))}function sn(n,t){n instanceof se?t.set(m.SUB_PROCESS_KIND,n.subProcessKind):n.kind===h.TASK_RECEIVE?t.set(m.IS_INSTANTIATING,String(n.instantiate)):n instanceof z&&t.set(m.GLOBAL_TASK_KIND,n.globalTaskKind);const e=n.markers;e.length>0&&t.set(m.MARKERS,e.join(","))}function on(n){const t=[],e=n.bpmnElement;return e instanceof it&&t.push(e.sequenceFlowKind),e instanceof lt&&t.push(e.associationDirectionKind),t}function rn(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 ln(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 an{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,u=this.styleComputer.computeStyle(s,a),d=this.graph.insertEdge(i,o.id,o.name,r,l,u);if(this.insertWaypoints(s.waypoints,d),a){d.geometry.width=a.width,d.geometry.height=a.height;const f=this.coordinatesTranslator.computeEdgeCenter(d);d.geometry.relative=!1;const T=this.coordinatesTranslator.computeRelativeCoordinates(d.parent,new F(a.x,a.y)),E=T.x+a.width/2-f.x,S=T.y-f.y;d.geometry.offset=new F(E,S)}this.insertMessageFlowIconIfNeeded(s,d)}}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 F(-10,-7)}}insertWaypoints(t,e){t&&(e.geometry.points=t.map(s=>this.coordinatesTranslator.computeRelativeCoordinates(e.parent,new F(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 F(o.x,o.y)),a=this.graph.insertVertex(t,e,s,l.x,l.y,o.width,o.height,r);if(i){const u=i.x-o.x,d=i.y-o.y;a.geometry.offset=new F(u,d)}return a}}function cn(n,t){return new an(n,new Ht(n),new tn(t))}function be(n){return`messageFlowIcon_of_${n}`}function un(n,t,{signal:e}={}){let s=null;const o=function(...r){s!==null&&clearTimeout(s),!(e!=null&&e.aborted)&&(s=setTimeout(()=>{n(...r),s=null},t))},i=function(){o.cancel()};return o.cancel=function(){s!==null&&(clearTimeout(s),s=null)},e==null||e.addEventListener("abort",i,{once:!0}),o}function dn(n,t){let e;return function(...o){const i=Date.now();(e==null||i-e>=t)&&(e=i,n(...o))}}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 F,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 F(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 hn(n){return Object.values(P).map(t=>t).includes(n)}function fn(n,t){return gn(n.style,t)}function gn(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",hn(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(u=>{const d=u.split("=");return[d[0],d[1]]}))switch(l){case m.EVENT_DEFINITION_KIND:{e.push(`bpmn-event-def-${a}`);break}case m.EVENT_BASED_GATEWAY_KIND:{e.push(`bpmn-gateway-kind-${a.toLowerCase()}`);break}case m.IS_INITIATING:{e.push(a=="true"?"bpmn-icon-initiating":"bpmn-icon-non-initiating");break}case m.SUB_PROCESS_KIND:{e.push(`bpmn-sub-process-${a.toLowerCase()}`);break}case m.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=fn(i,this.dialect===c.DIALECT_STRICTHTML),l=this.state.style[m.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 Tn 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 pn(n,t,e,s){let o,i;n.heightE.setIconOriginForIconCentered(),shapeConfig:{x:t,y:e,width:s,height:o,strokeWidth:u},iconStyleConfig:{isFilled:l,fillColor:d,strokeColor:f,strokeWidth:a,margin:T}}}class Sn{newBpmnCanvas({canvas:t,ratioFromParent:e,setIconOriginFunct:s,shapeConfig:o,iconStyleConfig:i},r){return new En({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});Cn(e),e.translateIconOrigin(14,14),mn(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 Cn(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 mn(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 Sn);const ve=1.25,In=1/ve;class An extends O.mxGraph{constructor(e){super(e);g(this,"currentZoomLevel",1);this.zoomFactor=ve,this.container&&(this.container.style.cursor="default")}createGraphView(){return new Nn(this)}createCellRenderer(){return new Tn(Tt.get())}batchUpdate(e){this.model.beginUpdate();try{e()}finally{this.model.endUpdate()}}fit(e,s,o,i,r,l,a){const u=super.fit(e,s,o,i,r,l,a);return this.setCurrentZoomLevel(u),u}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=Kt(e==null?void 0:e.margin);if(s==J.Center){const r=this.getGraphBounds(),l=this.container.clientWidth-o,a=this.container.clientHeight-o,u=r.width/this.view.scale,d=r.height/this.view.scale,f=Math.min(3,Math.min(l/u,a/d));this.setCurrentZoomLevel(f),this.view.scaleAndTranslate(f,(o+l-u*f)/(2*f)-r.x/this.view.scale,(o+a-d*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=zt(e),G.addMouseWheelListener(un(this.createMouseWheelZoomListener(!0),e.debounceDelay),this.container),G.addMouseWheelListener(dn(this.createMouseWheelZoomListener(!1),e.throttleDelay),this.container)}manageMouseWheelZoomEvent(e,s,o){if(o){const[i,r]=this.getEventRelativeCoordinates(s),[l,a,u]=this.getScaleAndTranslationDeltas(i,r);this.view.scaleAndTranslate(l,this.view.translate.x+a,this.view.translate.y+u),G.consume(s)}else this.currentZoomLevel*=e?ve:In}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 Nn 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 vn{configureMarkers(){this.registerArrowDashMarker()}registerArrowDashMarker(){const t=(e,s,o,i,r,l,a,u,d)=>{const f=r*(a+d+4),T=l*(a+d+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(ht.ARROW_DASH,t)}}const On=[_.LOOP,_.MULTI_INSTANCE_PARALLEL,_.MULTI_INSTANCE_SEQUENTIAL,_.COMPENSATION,_.EXPAND,_.ADHOC];function Ln(n){const t=On.filter(e=>n.includes(e));for(const e of n.filter(s=>!t.includes(s)))t.push(e);return t}function _n(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,m.MARKERS,void 0);if(s){const i=Ln(s.split(","));for(const[r,l]of i.entries())e={...e,setIconOriginFunct:_n(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 yn extends W{paintTaskIcon(t){}}class wn extends W{paintTaskIcon(t){this.iconPainter.paintGearIcon({...t,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class Rn extends W{paintTaskIcon(t){this.iconPainter.paintPersonIcon({...t,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class bn extends W{paintTaskIcon(t){if(!ft(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 Fn extends W{paintTaskIcon(t){this.paintEnvelopeIcon(t,!0)}}class Pn extends W{paintTaskIcon(t){this.iconPainter.paintHandIcon({...t,ratioFromParent:.18,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class kn extends W{paintTaskIcon(t){this.iconPainter.paintScriptIcon({...t,ratioFromParent:.22,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class Bn 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,m.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 xn extends Fe{paintBackground(t,e,s,o,i){const r=N.getValue(this.style,m.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 Mn extends W{paintTaskIcon(t){this.iconPainter.paintTableIcon({...t,ratioFromParent:.6,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(15)})}}class Vn 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,m.EDGE_START_FILL_COLOR,this.stroke)),s()),o!=null&&(t.setFillColor(N.getValue(this.style,m.EDGE_END_FILL_COLOR,this.stroke)),o())}paintEdgeLine(t,e){const s=Yn(t);Xe(t,"stroke"),this.paintLine(t,e,this.isRounded),Xe(t,s)}}function Yn(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});Gn(l,N.getValue(this.style,m.IS_INTERRUPTING,void 0)),this.paintOuterShape(l),Dn(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,m.EVENT_DEFINITION_KIND,y.NONE));s==null||s(e)}}function Gn(n,t){n.canvas.save(),t==="false"&&(n.canvas.setDashed(!0,!1),n.canvas.setDashPattern("3 2"))}function Dn(n){n.canvas.restore()}class Un 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 Wn extends Oe{constructor(){super(),this.withFilledIcon=!0}}class Hn 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,m.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 Kn 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 Xn extends oe{paintInnerShape(t){this.iconPainter.paintCircleIcon({...t,ratioFromParent:.62,iconStyleConfig:{...t.iconStyleConfig,isFilled:!1,strokeWidth:p.STROKE_WIDTH_THICK.valueOf()}})}}class $n extends oe{paintInnerShape(t){this.iconPainter.paintAsteriskIcon({...t,iconStyleConfig:{...t.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class Zn extends oe{paintInnerShape(t){t={...t,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1}},this.iconPainter.paintCircleIcon({...t,ratioFromParent:.55}),ft(this.style)||this.iconPainter.paintCircleIcon({...t,ratioFromParent:.45});const e={...t,ratioFromParent:.3};N.getValue(this.style,m.EVENT_BASED_GATEWAY_KIND,te.Exclusive)==te.Parallel?this.iconPainter.paintPlusCrossIcon(e):this.iconPainter.paintPentagon(e)}}class qn 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 jn=()=>{const n=[[h.EVENT_END,Un],[h.EVENT_START,Pe],[h.EVENT_INTERMEDIATE_THROW,Wn],[h.EVENT_INTERMEDIATE_CATCH,Oe],[h.EVENT_BOUNDARY,Oe],[h.GATEWAY_COMPLEX,$n],[h.GATEWAY_EVENT_BASED,Zn],[h.GATEWAY_EXCLUSIVE,Kn],[h.GATEWAY_INCLUSIVE,Xn],[h.GATEWAY_PARALLEL,zn],[h.SUB_PROCESS,xn],[h.CALL_ACTIVITY,Bn],[h.TASK,yn],[h.TASK_SERVICE,wn],[h.TASK_USER,Rn],[h.TASK_RECEIVE,bn],[h.TASK_SEND,Fn],[h.TASK_MANUAL,Pn],[h.TASK_SCRIPT,kn],[h.TASK_BUSINESS_RULE,Mn],[h.TEXT_ANNOTATION,qn],[m.EDGE,Vn],[m.MESSAGE_FLOW_ICON,Hn]];for(const[t,e]of n)Ut.registerShape(t,e)};class Qn{configureShapes(){jn()}}const pt=12;class ke extends Map{get(t){return super.get(t)??(()=>{})}}const Jn=new ke([[P.SEQUENCE_FLOW,n=>{n[c.STYLE_ENDARROW]=c.ARROW_BLOCK_THIN}],[P.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[m.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[m.EDGE_END_FILL_COLOR]=p.MESSAGE_FLOW_MARKER_END_FILL_COLOR}],[P.ASSOCIATION_FLOW,n=>{n[c.STYLE_DASHED]=!0,n[c.STYLE_DASH_PATTERN]="1 2",n[c.STYLE_STARTSIZE]=pt}]]),es=new ke([[B.DEFAULT,n=>{n[c.STYLE_STARTARROW]=ht.ARROW_DASH}],[B.CONDITIONAL_FROM_ACTIVITY,n=>{n[c.STYLE_STARTARROW]=c.ARROW_DIAMOND_THIN,n[c.STYLE_STARTSIZE]=18,n[c.STYLE_STARTFILL]=!0,n[m.EDGE_START_FILL_COLOR]=p.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR}]]),ts=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]=m.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(P),Jn),this.configureEdgeStyles(Object.values(B),es),this.configureEdgeStyles(Object.values(X),ts)}}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 ns{constructor(t){g(this,"graph");this.graph=new An(t)}configure(t){return this.configureGraph(),this.configureNavigationSupport(t),new Et(this.graph).configureStyles(),new Qn().configureShapes(),new vn().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 ss{constructor(t){this.graph=t}fit(t){this.graph.customFit(t)}zoom(t){t=="in"?this.graph.zoomIn():this.graph.zoomOut()}}class os{constructor(t){this.convertedElements=t}deserialize(t){const e=I(t.category).flatMap(s=>I(s.categoryValue));for(const s of e)this.convertedElements.registerCategoryValue(s.id,s.value)}}class q{}class is{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 rs 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 ls 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 as 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 cs 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 us 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 ds 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 hs{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 x(e.id,o.value,h.GROUP,s);t.warning(new rs(e.id,e.categoryValueRef))};class fs{constructor(t,e){this.convertedElements=t,this.parsingMessageCollector=e}deserialize(t){for(const e of I(t))this.parseCollaboration(e)}parseCollaboration(t){this.buildParticipant(t.participant),this.buildMessageFlows(t.messageFlow),this.buildGroups(t.group)}buildParticipant(t){for(const e of I(t))this.convertedElements.registerPool(new x(e.id,e.name,h.POOL),e.processRef)}buildMessageFlows(t){for(const e of I(t))this.convertedElements.registerMessageFlow(new rt(e.id,e.name,e.sourceRef,e.targetRef))}buildGroups(t){for(const e of I(t)){const s=St(this.convertedElements,this.parsingMessageCollector,e);s&&this.convertedElements.registerFlowNode(s)}}}class gs{constructor(t,e,s,o){this.x=t,this.y=e,this.width=s,this.height=o}}class Ts{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 ps{constructor(t,e){this.x=t,this.y=e}}class Es{constructor(t,e){g(this,"extensions",{});this.font=t,this.bounds=e}}class Ss{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 Cs{constructor(t,e){g(this,"convertedFonts",new Map);this.convertedElements=t,this.parsingMessageCollector=e}deserialize(t){const e=[],s=[],o=[],i=[],r=I(t)[0];if(r){this.deserializeFonts(r.BPMNLabelStyle);const l=r.BPMNPlane,a=this.deserializeEdges(l.BPMNEdge),u=this.deserializeShapes(l.BPMNShape);e.push(...u.flowNodes),s.push(...u.lanes),o.push(...u.pools),i.push(...a)}return{flowNodes:e,lanes:s,pools:o,edges:i}}deserializeFonts(t){this.convertedFonts=new Map;for(const e of I(t))for(const s of I(e.Font))this.convertedFonts.set(e.id,new Ss(s.name,s.size,s.isBold,s.isItalic,s.isUnderline,s.isStrikeThrough))}deserializeShapes(t){const e={flowNodes:[],lanes:[],pools:[]};for(const s of I(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 ls(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 ms(a,t),a}}deserializeEdges(t){return I(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 as(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 Ts(e.id,s,o,i,r);return Is(l,e),l}).filter(Boolean)}deserializeWaypoints(t){return I(t).map(e=>new ps(e.x,e.y))}deserializeLabel(t,e){if(t&&typeof t=="object"){const s=this.findFont(t.labelStyle,e),o=qe(t),i=new Es(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 cs(e,t))),s}}function ms(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 gs(t.x,t.y,t.width,t.height)}function Is(n,t){"border-color"in t?n.extensions.strokeColor=t["border-color"]:"stroke"in t&&(n.extensions.strokeColor=t.stroke)}const As=n=>"source"in n||"target"in n;class Ns{constructor(t){this.convertedElements=t}deserialize(t){for(const e of ot){const s=t[e+"EventDefinition"];for(const o of I(s,!0))this.convertedElements.registerEventDefinitionsOfDefinition(o.id,{id:o.id,kind:e,...As(o)?{source:o.source,target:o.target}:{}})}}}class vs{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 I(t))this.convertedElements.registerGlobalTask(s.id,e)}}const Os=(n,t)=>{switch(n){case"adHocSubProcess":return Y.AD_HOC;case"transaction":return Y.TRANSACTION;default:return t.triggeredByEvent?Y.EVENT:Y.EMBEDDED}},Ls=["adHocSubProcess","transaction",...C.flowNodeKinds().filter(n=>n!==h.EVENT_BOUNDARY),h.EVENT_BOUNDARY];function _s(n){return["adHocSubProcess","transaction"].includes(n)?h.SUB_PROCESS:n}class ys{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 I(t))this.parseProcess(e);for(const e of I(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 x(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 Ls)this.buildFlowNodeBpmnElements(t[s],_s(s),e,t.id,s);this.buildLaneSetBpmnElements(t.laneSet,e,t.id),this.buildSequenceFlows(t.sequenceFlow),this.buildAssociationFlows(t.association)}buildFlowNodeBpmnElements(t,e,s,o,i){for(const r of I(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 dt(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 x(e.id,i,t,s,e.instantiate)}}}buildShapeBpmnActivity(t,e,s,o){const i=ws(t);return C.isSubProcess(e)?this.buildShapeBpmnSubProcess(t,s,Os(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 ct(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 ut(t.id,t.name,e,t.attachedToRef,t.cancelActivity);this.parsingMessageCollector.warning(new ds(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,I(o,!0))}for(const s of I(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 I(t))this.buildLaneBpmnElements(o.lane,e,s)}buildLaneBpmnElements(t,e,s){var o;for(const i of I(t)){const r=new x(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 I(t.flowNodeRef)){const s=this.convertedElements.findFlowNode(e),o=t.id;s?C.isBoundaryEvent(s.kind)||(s.parentId=o):this.parsingMessageCollector.warning(new us(o,e))}}buildSequenceFlows(t){for(const e of I(t)){const s=this.getSequenceFlowKind(e);this.convertedElements.registerSequenceFlow(new it(e.id,e.name,e.sourceRef,e.targetRef,s))}}buildAssociationFlows(t){for(const e of I(t)){const s=e.associationDirection;this.convertedElements.registerAssociationFlow(new lt(e.id,void 0,e.sourceRef,e.targetRef,s))}}getSequenceFlowKind(t){if(this.defaultSequenceFlowIds.includes(t.id))return B.DEFAULT;{const e=this.convertedElements.findFlowNode(t.sourceRef);if(e&&C.isWithDefaultSequenceFlow(e.kind)&&t.conditionExpression)return C.isActivity(e.kind)?B.CONDITIONAL_FROM_ACTIVITY:B.CONDITIONAL_FROM_GATEWAY}return B.NORMAL}}const ws=n=>{const t=[],e=n.standardLoopCharacteristics,s=I(n.multiInstanceLoopCharacteristics,!0)[0];return e!==void 0?t.push(_.LOOP):s&&t.push(s.isSequential?_.MULTI_INSTANCE_SEQUENTIAL:_.MULTI_INSTANCE_PARALLEL),t};class Rs{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 bs(n){const t=new hs;return new Rs(new os(t),new fs(t,n),new Ns(t),new vs(t),new ys(t,n),new Cs(t,n))}var Be={},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 u=[];let d=a.exec(l);for(;d;){const f=[];f.startIndex=a.lastIndex-d[0].length;const T=d.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,u){if(a){const d=Object.keys(a),f=d.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--),!Gs(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 u=Bs(n,i);if(u===!1)return L("InvalidAttr","Attributes for '"+a+"' have open quote.",w(n,i));let d=u.value;if(i=u.index,d[d.length-1]==="/"){const f=i-d.length;d=d.substring(0,d.length-1);const T=et(d,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(u.tagClosed){if(d.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(d,t);if(f!==!0)return L(f.err.code,f.err.msg,w(n,i-d.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 Ps='"',ks="'";function Bs(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 xs=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function et(n,t){const e=xe.getAllMatches(n,xs),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}},Ds=function(n){return Object.assign({},Ct,n)};Me.buildOptions=Ds;Me.defaultOptions=Ct;class Us{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 Ws=Us;const Hs=ge;function Ks(n,t){const e={};if(n[t+3]==="O"&&n[t+4]==="C"&&n[t+5]==="T"&&n[t+6]==="Y"&&n[t+7]==="P"&&n[t+8]==="E"){t=t+9;let s=1,o=!1,i=!1,r="";for(;t"){if(i?n[t-1]==="-"&&n[t-2]==="-"&&(i=!1,s--):s--,s===0)break}else n[t]==="["?o=!0:r+=n[t];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:e,i:t}}function zs(n,t){let e="";for(;t0&&o&&e[2]!==".")return n;if(!t.leadingZeros&&i.length>0&&!o&&e[1]!==".")return n;{const a=Number(e),u=""+a;return u.search(/[eE]/)!==-1||l?t.eNotation?a:n:e.indexOf(".")!==-1?u==="0"&&r===""||u===r||o&&u==="-"+r?a:n:i?r===u||o+r===u?a:n:e===u||e===o+u?a:n}}else return n}}function oo(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 io=so;const mt=ge,Q=Ws,ro=Js,lo=io;let ao=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=co,this.parseXml=To,this.parseTextData=uo,this.resolveNameSpace=ho,this.buildAttributesMap=go,this.isItStopNode=Co,this.replaceEntitiesValue=Eo,this.readStopNodeData=Io,this.saveTextToParentTag=So,this.addChild=po}};function co(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 ho(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 fo=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function go(n,t,e){if(!this.options.ignoreAttributes&&typeof n=="string"){const s=mt.getAllMatches(n,fo),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 u=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 d=0;u&&this.options.unpairedTags.indexOf(u)!==-1?(d=o.lastIndexOf(".",o.lastIndexOf(".")-1),this.tagsNodeStack.pop()):d=o.lastIndexOf("."),o=o.substring(0,d),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=ro(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 u=this.parseTextData(a,e.tagname,o,!0,!1,!0,!0);u==null&&(u=""),this.options.cdataPropName?e.add(this.options.cdataPropName,[{[this.options.textNodeName]:a}]):e.add(this.options.textNodeName,u),i=l+2}else{let l=Le(n,i,this.options.removeNSPrefix),a=l.tagName;const u=l.rawTagName;let d=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(d.length>0&&d.lastIndexOf("/")===d.length-1)a[a.length-1]==="/"?(a=a.substr(0,a.length-1),o=o.substr(0,o.length-1),d=a):d=d.substr(0,d.length-1),i=l.closeIndex;else if(this.options.unpairedTags.indexOf(a)!==-1)i=l.closeIndex;else{const V=this.readStopNodeData(n,u,T+1);if(!V)throw new Error(`Unexpected end of ${u}`);i=V.i,S=V.tagContent}const M=new Q(a);a!==d&&f&&(M[":@"]=this.buildAttributesMap(d,o,a)),S&&(S=this.parseTextData(S,a,o,!0,f,!0,!0)),o=o.substr(0,o.lastIndexOf(".")),M.add(this.options.textNodeName,S),this.addChild(e,M,o)}else{if(d.length>0&&d.lastIndexOf("/")===d.length-1){a[a.length-1]==="/"?(a=a.substr(0,a.length-1),o=o.substr(0,o.length-1),d=a):d=d.substr(0,d.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const S=new Q(a);a!==d&&f&&(S[":@"]=this.buildAttributesMap(d,o,a)),this.addChild(e,S,o),o=o.substr(0,o.lastIndexOf("."))}else{const S=new Q(a);this.tagsNodeStack.push(e),a!==d&&f&&(S[":@"]=this.buildAttributesMap(d,o,a)),this.addChild(e,S,o),e=S}s="",i=T}}else s+=n[i];return t.child};function po(n,t,e){const s=this.options.updateTag(t.tagname,e,t[":@"]);s===!1||(typeof s=="string"&&(t.tagname=s),n.addChild(t))}const Eo=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 So(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 Co(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 mo(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:lo(n,e)}else return mt.isExist(n)?n:""}var Ao=ao,It={};function No(n,t){return At(n,t)}function At(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 vo(n){const t=Object.keys(n);for(let e=0;e0&&(e=Po),Nt(n,t,"",e)}function Nt(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),M=a==="?xml"?"":s;let V=l[a][0][t.textNodeName];V=V.length!==0?" "+V:"",o+=M+`<${a}${V}${S}?>`,i=!0;continue}let d=s;d!==""&&(d+=t.indentBy);const f=tt(l[":@"],t),T=s+`<${a}${f}`,E=Nt(l[a],t,u,d);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 Bo(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({},Yo,n),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Uo),this.processTextOrObjNode=Go,this.options.format?(this.indentate=Do,this.tagEndChar=`> `,this.newLine=` -`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}X.prototype.build=function(n){return this.options.preserveOrder?ho(n,this.options):(Array.isArray(n)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(n={[this.options.arrayNodeName]:n}),this.j2x(n,0).val)};X.prototype.j2x=function(n,e){let t="",s="";for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i))if(typeof n[i]>"u")this.isAttribute(i)&&(s+="");else if(n[i]===null)this.isAttribute(i)?s+="":i[0]==="?"?s+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(n[i]instanceof Date)s+=this.buildTextValNode(n[i],i,"",e);else if(typeof n[i]!="object"){const o=this.isAttribute(i);if(o)t+=this.buildAttrPairStr(o,""+n[i]);else if(i===this.options.textNodeName){let r=this.options.tagValueProcessor(i,""+n[i]);s+=this.replaceEntitiesValue(r)}else s+=this.buildTextValNode(n[i],i,"",e)}else if(Array.isArray(n[i])){const o=n[i].length;let r="";for(let l=0;l"u"||(a===null?i[0]==="?"?s+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+i+"/"+this.tagEndChar:typeof a=="object"?this.options.oneListGroup?r+=this.j2x(a,e+1).val:r+=this.processTextOrObjNode(a,i,e):r+=this.buildTextValNode(a,i,"",e))}this.options.oneListGroup&&(r=this.buildObjectNode(r,i,"",e)),s+=r}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName){const o=Object.keys(n[i]),r=o.length;for(let l=0;l"+n+i:this.options.commentPropName!==!1&&e===this.options.commentPropName&&o.length===0?this.indentate(s)+``+this.newLine:this.indentate(s)+"<"+e+t+o+this.tagEndChar+n+this.indentate(s)+i}};X.prototype.closeTag=function(n){let e="";return this.options.unpairedTags.indexOf(n)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(s)+``+this.newLine;if(e[0]==="?")return this.indentate(s)+"<"+e+t+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(e,n);return i=this.replaceEntitiesValue(i),i===""?this.indentate(s)+"<"+e+t+this.closeTag(e)+this.tagEndChar:this.indentate(s)+"<"+e+t+">"+i+"0&&this.options.processEntities)for(let e=0;e"},{regex:/&(lt|#60|#x3c|#x3C);/g,val:"<"},{regex:/&(quot|#34|#x22);/g,val:'"'}],No=new Set(["BPMNShape.Bounds","BPMNShape.BPMNLabel.Bounds","BPMNEdge.BPMNLabel.Bounds","BPMNEdge.waypoint"].map(n=>`definitions.BPMNDiagram.BPMNPlane.${n}`)),Oo=new Set(["x","y","width","height"]),vo=(n,e)=>No.has(e)&&Oo.has(n);class Lo{constructor(e){g(this,"x2jOptions",{attributeNamePrefix:"",removeNSPrefix:!0,ignoreAttributes:!1,parseAttributeValue:!0,processEntities:!1,attributeValueProcessor:(e,t,s)=>vo(e,s)?Number(t):this.processAttribute(t)});g(this,"xmlParser",new Co.XMLParser(this.x2jOptions));this.options=e}parse(e){let t;try{t=this.xmlParser.parse(e)}catch{throw new Error("XML parsing failed. Invalid BPMN source.")}if(!t.definitions)throw new Error("XML parsing failed. Unable to retrieve 'definitions' from the BPMN source.");return t}processAttribute(e){var t;for(const s of Ao)e=e.replace(s.regex,s.val);return(t=this.options)!=null&&t.additionalXmlAttributeProcessor&&(e=this.options.additionalXmlAttributeProcessor(e)),e}}class yo{constructor(e,t){this.jsonParser=e,this.xmlParser=t}parse(e){const t=this.xmlParser.parse(e);return this.jsonParser.parse(t)}}function _o(n){return new yo(oi(new Bs(n)),new Lo(n))}function wo(n){return new Ro(n)}class Ro{constructor(e){this.graph=e}updateAndRefreshCssClassesOfCell(e,t){this.updateAndRefreshCssClassesOfElement(e,t),this.updateAndRefreshCssClassesOfElement(ze(e),t)}updateAndRefreshCssClassesOfElement(e,t){const s=this.graph.getModel(),i=s.getCell(e);if(!i)return;let o=i.getStyle();o=F(o,m.EXTRA_CSS_CLASSES,t.join(",")),s.setStyle(i,o)}}function bo(n){return new Fo(wo(n),new Po)}class Fo{constructor(e,t){this.cssClassesUpdater=e,this.cssClassesCache=t}clearCache(){this.cssClassesCache.clear()}addCssClasses(e,t){this.updateCssClasses(e,t,this.cssClassesCache.addClassNames)}removeCssClasses(e,t){this.updateCssClasses(e,t,this.cssClassesCache.removeClassNames)}removeAllCssClasses(e){if(e||e=="")for(const t of C(e)){const s=this.cssClassesCache.removeAllClassNames(t);this.updateCellIfChanged(s,t)}else{const t=this.cssClassesCache.getBpmnIds();this.cssClassesCache.clear();for(const s of t)this.updateCellIfChanged(!0,s)}}toggleCssClasses(e,t){this.updateCssClasses(e,t,this.cssClassesCache.toggleClassNames)}updateCssClasses(e,t,s){const i=C(t);for(const o of C(e))this.updateCellIfChanged(s(o,i),o)}updateCellIfChanged(e,t){if(e){const s=this.cssClassesCache.getClassNames(t);this.cssClassesUpdater.updateAndRefreshCssClassesOfCell(t,s)}}}class Po{constructor(){g(this,"classNamesByBpmnId",new Map);g(this,"clear",()=>{this.classNamesByBpmnId.clear()});g(this,"addClassNames",(e,t)=>this.updateClassNames(e,t,(s,i)=>s.add(i)));g(this,"removeClassNames",(e,t)=>this.updateClassNames(e,t,(s,i)=>s.delete(i)));g(this,"toggleClassNames",(e,t)=>(this.updateClassNames(e,t,(s,i)=>s.has(i)?s.delete(i):s.add(i)),t&&t.length>0))}getClassNames(e){return this.classNamesByBpmnId.has(e)?[...this.classNamesByBpmnId.get(e)]:[]}getBpmnIds(){return[...this.classNamesByBpmnId.keys()]}removeAllClassNames(e){const t=this.getOrInitializeClassNames(e),s=t.size;return t.clear(),t.size g > g > g[data-bpmn-id="${e}"]`}elementsOfKind(e){return`svg > g > g > g.${e}:not(.bpmn-label)`}}function Vo(n){return new Yo(n,new Uo(n.getModel()))}const mt=n=>{const e=C(n);return e.push(...e.map(t=>ze(t))),e};class Yo{constructor(e,t){this.graph=e,this.styleManager=t}clear(){this.styleManager.clear()}updateStyle(e,t){if(!t)return;const s=this.graph.getModel(),i=mt(e).map(o=>s.getCell(o)).filter(Boolean);i.length!==0&&this.graph.batchUpdate(()=>{for(const o of i){this.styleManager.ensureStyleIsStored(o);let r=o.getStyle();r=F(r,c.STYLE_OPACITY,t.opacity,ye),r=pn(r,t.stroke),r=En(r,t.font),Cn(t)&&(r=mn(r,t.fill)),s.setStyle(o,r)}})}resetStyle(e){this.graph.batchUpdate(()=>{if(e||e=="")for(const t of mt(e))this.styleManager.resetStyleIfIsStored(t);else this.styleManager.resetAllStyles()})}}const Ct=m.EXTRA_CSS_CLASSES;class Uo{constructor(e){g(this,"stylesCache",new Map);this.model=e}clear(){this.stylesCache.clear()}resetAllStyles(){for(const e of this.stylesCache.keys())this.resetStyle(e,this.stylesCache.get(e))}resetStyleIfIsStored(e){const t=this.stylesCache.get(e);t&&this.resetStyle(e,t)}resetStyle(e,t){const s=this.model.getCell(e),i=Sn(s.getStyle(),Ct,""),o=F(t,Ct,i);this.model.setStyle(s,o),this.stylesCache.delete(e)}ensureStyleIsStored(e){const t=e.getId();this.stylesCache.has(t)||this.stylesCache.set(t,e.getStyle())}}function Do(n){return new Wo(Vo(n))}class Wo{constructor(e){this.styleUpdater=e}clearCache(){this.styleUpdater.clear()}updateStyle(e,t){this.styleUpdater.updateStyle(e,t)}resetStyle(e){this.styleUpdater.resetStyle(e)}}function Ho(n,e){return new Ko(n,new zo(e.container,new Go),bo(e),Bo(e),Do(e))}class Ko{constructor(e,t,s,i,o){this.bpmnModelRegistry=e,this.htmlElementRegistry=t,this.cssClassesRegistry=s,this.overlaysRegistry=i,this.styleRegistry=o,this.bpmnModelRegistry.registerOnLoadCallback(()=>{this.cssClassesRegistry.clearCache(),this.styleRegistry.clearCache()})}getModelElementsByIds(e){return Pe(e).map(t=>this.bpmnModelRegistry.getBpmnSemantic(t)).filter(Boolean)}getElementsByIds(e){return this.getModelElementsByIds(e).map(t=>({bpmnSemantic:t,htmlElement:this.htmlElementRegistry.getBpmnHtmlElement(t.id)}))}getModelElementsByKinds(e){return Pe(e).flatMap(t=>this.htmlElementRegistry.getBpmnHtmlElements(t)).map(t=>this.getRelatedBpmnSemantic(t))}getElementsByKinds(e){return Pe(e).flatMap(t=>this.htmlElementRegistry.getBpmnHtmlElements(t)).map(t=>({htmlElement:t,bpmnSemantic:this.getRelatedBpmnSemantic(t)}))}getRelatedBpmnSemantic(e){return this.bpmnModelRegistry.getBpmnSemantic(e.dataset.bpmnId)}addCssClasses(e,t){this.cssClassesRegistry.addCssClasses(e,t)}removeCssClasses(e,t){this.cssClassesRegistry.removeCssClasses(e,t)}removeAllCssClasses(e){this.cssClassesRegistry.removeAllCssClasses(e)}toggleCssClasses(e,t){this.cssClassesRegistry.toggleCssClasses(e,t)}addOverlays(e,t){this.overlaysRegistry.addOverlays(e,t)}removeAllOverlays(e){this.overlaysRegistry.removeAllOverlays(e)}updateStyle(e,t){this.styleRegistry.updateStyle(e,t)}resetStyle(e){this.styleRegistry.resetStyle(e)}}class zo{constructor(e,t){this.container=e,this.querySelectors=t}getBpmnHtmlElement(e){return this.container.querySelector(this.querySelectors.element(e))}getBpmnHtmlElements(e){const t=this.querySelectors.elementsOfKind(Ye(e));return[...this.container.querySelectorAll(t)]}}const Pe=n=>[...new Set(C(n))];class Xo{filter(e,t){const s=[],i=[];for(const E of C(t==null?void 0:t.pools).filter(S=>S&&Object.keys(S).length>0))E.id?s.push(E.id):E.name&&i.push(E.name);if(s.length===0&&i.length===0)return e;const{filteredPools:o,filteredPoolIds:r}=$o(e,s,i),l=[...s,...r],{filteredLanes:a,filteredLaneIds:u,filteredFlowNodes:d,filteredFlowNodeIds:f}=Kt(e.lanes,e.flowNodes,l),T=jo(e.edges,[...l,...u,...f]);if(o.length===0&&a.length===0&&d.length===0&&T.length===0){let E=s.length>0?` for ids [${s}]`:"";const S=E?" and":"";throw E+=i.length>0?`${S} for names [${i}]`:"",new Error("No matching pools"+E)}return{lanes:a,flowNodes:d,pools:o,edges:T}}}function $o(n,e,t){const s=n.pools.filter(o=>e.includes(o.bpmnElement.id)||t.includes(o.bpmnElement.name)),i=s.map(o=>o.bpmnElement.id);return{filteredPools:s,filteredPoolIds:i}}function Kt(n,e,t){const{filteredLanes:s,filteredLaneIds:i}=zt(n,t),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:l,filteredFlowNodeIds:a}=Zo(e,[...t,...i],n);return s.push(...o),i.push(...r),{filteredLanes:s,filteredLaneIds:i,filteredFlowNodes:l,filteredFlowNodeIds:a}}function zt(n,e){const t=n.filter(i=>e.includes(i.bpmnElement.parentId)),s=t.map(i=>i.bpmnElement.id);if(t.length>0){const{filteredLanes:i,filteredLaneIds:o}=zt(n,s);t.push(...i),s.push(...o)}return{filteredLanes:t,filteredLaneIds:s}}function Zo(n,e,t){const s=n.filter(u=>e.includes(u.bpmnElement.parentId));if(s.length===0)return{filteredLanes:[],filteredLaneIds:[],filteredFlowNodes:[],filteredFlowNodeIds:[]};const i=s.map(u=>u.bpmnElement.id),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:l,filteredFlowNodeIds:a}=Kt(t,n,i);return s.push(...l),i.push(...a),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:s,filteredFlowNodeIds:i}}function jo(n,e){return n.filter(t=>e.includes(t.bpmnElement.sourceReferenceId)&&e.includes(t.bpmnElement.targetReferenceId))}class qo{constructor(){g(this,"searchableModel");g(this,"onLoadCallback")}load(e,t){var i;const s=new Xo().filter(e,t);return this.searchableModel=new Jo(s),(i=this.onLoadCallback)==null||i.call(this),Qo(s)}registerOnLoadCallback(e){this.onLoadCallback=e}getBpmnSemantic(e){var o;const t=(o=this.searchableModel)==null?void 0:o.elementById(e);if(!t)return;const s=t.bpmnElement,i=s instanceof Y;return{id:e,isShape:i,kind:s.kind,name:s.name,...s instanceof ve?{sourceRefId:s.sourceReferenceId,targetRefId:s.targetReferenceId}:{callActivityGlobalTaskKind:s instanceof j?s.globalTaskKind:void 0,callActivityKind:s instanceof j?s.callActivityKind:void 0,eventDefinitionKind:s instanceof K?s.eventDefinitionKind:void 0,linkEventSourceIds:s instanceof Me&&s.eventDefinitionKind==R.LINK?s.sourceIds:void 0,linkEventTargetId:s instanceof Ge?s.targetId:void 0,incomingIds:s.incomingIds,outgoingIds:s.outgoingIds,parentId:s.parentId,subProcessKind:s instanceof fe?s.subProcessKind:void 0}}}}function Qo(n){const e=new Set(n.flowNodes.filter(o=>{const r=o.bpmnElement;return I.isSubProcess(r.kind)&&r.markers.includes(w.EXPAND)}).map(o=>o.bpmnElement.id)),t=[],s=[],i=[];for(const o of n.flowNodes){const r=o.bpmnElement.kind;I.isSubProcess(r)?t.push(o):I.isBoundaryEvent(r)?s.push(o):e.has(o.bpmnElement.parentId)||i.push(o)}return{boundaryEvents:s,edges:n.edges,lanes:n.lanes,otherFlowNodes:i,pools:n.pools,subprocesses:t}}class Jo{constructor(e){g(this,"elements",new Map);for(const t of[...e.pools,...e.lanes,...e.flowNodes,...e.edges])this.elements.set(t.bpmnElement.id,t)}elementById(e){return this.elements.get(e)}}const er="0.43.0",tr=()=>({lib:er,dependencies:new Map([["mxGraph",Lt.VERSION]])});class nr{constructor(e){g(this,"graph");g(this,"navigation");g(this,"bpmnElementsRegistry");g(this,"bpmnModelRegistry");g(this,"parserOptions");g(this,"rendererOptions");this.rendererOptions=e==null?void 0:e.renderer;const t=new Ps(ln(e==null?void 0:e.container));this.graph=t.configure(e),this.navigation=new ks(this.graph),this.bpmnModelRegistry=new qo,this.bpmnElementsRegistry=Ho(this.bpmnModelRegistry,this.graph),this.parserOptions=e==null?void 0:e.parser}load(e,t){const s=_o(this.parserOptions).parse(e),i=this.bpmnModelRegistry.load(s,t==null?void 0:t.modelFilter);vn(this.graph,this.rendererOptions).render(i,t==null?void 0:t.fit)}getVersion(){return tr()}}function vr(n){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(n,1):document.addEventListener("DOMContentLoaded",n)}function A(n,...e){Qe("[DEMO]",n,...e)}function Qe(n,e,...t){console.info(`${n} ${e}`,...t)}function k(n,...e){Qe("[DEMO STARTUP]",n,...e)}function Xt(n,e){$t(n),window.alert(e??n)}function $t(n){console.error("[DEMO]",n)}function te(n,...e){Qe("[DEMO DOWNLOAD]",n,...e)}async function sr(n){A(`Fetching BPMN content from url ${n}`);const e=await fetch(n);if(!e.ok)throw new Error(`HTTP status ${e.status}`);return await e.text()}function Zt(n,e,t){const s=document.createElement("a");e.startsWith("data:image/svg+xml")&&(t=encodeURIComponent(t),e+=","),s.setAttribute("href",e+t),s.setAttribute("download",n),s.style.display="none",document.body.append(s),s.click(),s.remove()}function ir(n){te("Start SVG download"),Zt("diagram.svg","data:image/svg+xml",n),te("Download completed")}function or(n){te("Start PNG download");const e=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),t=URL.createObjectURL(e),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 r=new Image;i.width=s.naturalWidth,i.height=s.naturalHeight,r.crossOrigin="Anonymous",r.addEventListener("load",function(){o.drawImage(r,0,0),URL.revokeObjectURL(t);const l=i.toDataURL("image/png");s.remove(),Zt("diagram.png","",l),te("Download completed")}),r.src=s.src}),s.src=t}class rr{constructor(e,t,s,i){g(this,"document");g(this,"head");g(this,"body");this.window=e,this.outerContainerId=t,this.containerToFade=s,this.dropCallback=i,this.document=e.document,this.head=document.head,this.body=document.body,this.initializeDragAndDrop()}initializeDragAndDrop(){this.containerToFade.classList.add("faded-container"),this.addDomElements(this.containerToFade),this.addStyle();const e=document.querySelector(`#${this.outerContainerId}`);this.preventDefaultsOnEvents(["dragover","drop"],this.window),this.preventDefaultsOnEvents(["dragover","dragleave","drop"],e),this.addEventsOnDropContainer(e,this.containerToFade),this.addEventsOnDocument(this.outerContainerId,this.containerToFade)}preventDefaults(e){e.preventDefault(),e.stopPropagation()}preventDefaultsOnEvents(e,t){for(const s of e)t.addEventListener(s,this.preventDefaults.bind(this),!1)}addDomElements(e){const t=this.document.createElement("p");t.textContent="open BPMN diagram";const s=this.document.createElement("div");s.classList.add("drop-here-text"),s.append(t);const i=this.document.createElement("div");i.id=this.outerContainerId,i.append(s),e.parentNode.prepend(i)}addStyle(){const e=` +`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}H.prototype.build=function(n){return this.options.preserveOrder?Vo(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){let e="",s="";for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o))if(typeof n[o]>"u")this.isAttribute(o)&&(s+="");else if(n[o]===null)this.isAttribute(o)?s+="":o[0]==="?"?s+=this.indentate(t)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(t)+"<"+o+"/"+this.tagEndChar;else if(n[o]instanceof Date)s+=this.buildTextValNode(n[o],o,"",t);else if(typeof n[o]!="object"){const i=this.isAttribute(o);if(i)e+=this.buildAttrPairStr(i,""+n[o]);else if(o===this.options.textNodeName){let r=this.options.tagValueProcessor(o,""+n[o]);s+=this.replaceEntitiesValue(r)}else s+=this.buildTextValNode(n[o],o,"",t)}else if(Array.isArray(n[o])){const i=n[o].length;let r="",l="";for(let a=0;a"u"))if(u===null)o[0]==="?"?s+=this.indentate(t)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(t)+"<"+o+"/"+this.tagEndChar;else if(typeof u=="object")if(this.options.oneListGroup){const d=this.j2x(u,t+1);r+=d.val,this.options.attributesGroupName&&u.hasOwnProperty(this.options.attributesGroupName)&&(l+=d.attrStr)}else r+=this.processTextOrObjNode(u,o,t);else if(this.options.oneListGroup){let d=this.options.tagValueProcessor(o,u);d=this.replaceEntitiesValue(d),r+=d}else r+=this.buildTextValNode(u,o,"",t)}this.options.oneListGroup&&(r=this.buildObjectNode(r,o,l,t)),s+=r}else if(this.options.attributesGroupName&&o===this.options.attributesGroupName){const i=Object.keys(n[o]),r=i.length;for(let l=0;l"+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:'"'}],Zo=new Set(["BPMNShape.Bounds","BPMNShape.BPMNLabel.Bounds","BPMNEdge.BPMNLabel.Bounds","BPMNEdge.waypoint"].map(n=>`definitions.BPMNDiagram.BPMNPlane.${n}`)),qo=new Set(["x","y","width","height"]),jo=(n,t)=>Zo.has(t)&&qo.has(n);class Qo{constructor(t){g(this,"x2jOptions",{attributeNamePrefix:"",removeNSPrefix:!0,ignoreAttributes:!1,parseAttributeValue:!0,processEntities:!1,attributeValueProcessor:(t,e,s)=>jo(t,s)?Number(e):this.processAttribute(e)});g(this,"xmlParser",new Xo.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 $o)t=t.replace(s.regex,s.val);return(e=this.options)!=null&&e.additionalXmlAttributeProcessor&&(t=this.options.additionalXmlAttributeProcessor(t)),t}}class Jo{constructor(t,e){this.jsonParser=t,this.xmlParser=e}parse(t){const e=this.xmlParser.parse(t);return this.jsonParser.parse(e)}}function ei(n){return new Jo(bs(new is(n)),new Qo(n))}function ti(n){return new ni(n)}class ni{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=R(i,m.EXTRA_CSS_CLASSES,e.join(",")),s.setStyle(o,i)}}function si(n){return new oi(ti(n),new ii)}class oi{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 I(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=I(e);for(const i of I(t))this.updateCellIfChanged(s(i,o),i)}updateCellIfChanged(t,e){if(t){const s=this.cssClassesCache.getClassNames(e);this.cssClassesUpdater.updateAndRefreshCssClassesOfCell(e,s)}}}class ii{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.sizeri.get(n.position),ai=(n,t)=>{t&&(n.fill.color=t.color??n.fill.color,n.fill.opacity=t.opacity??n.fill.opacity)},ci=(n,t)=>{t&&(n.stroke.color=t.color??n.stroke.color,n.stroke.width=t.width??n.stroke.width)},ui=(n,t)=>{t&&(n.font.color=t.color??n.font.color,n.font.size=t.size??n.font.size)},di=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&&(ai(s,e.fill),ci(s,e.stroke),ui(s,e.font)),s};class hi{convert(t){const e=li(t),s=di(t);return{position:e,style:s}}}function fi(n){return new gi(n,new hi)}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 o of I(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 Ti(n){return new pi(fi(n))}class pi{constructor(t){this.overlaysUpdater=t}addOverlays(t,e){this.overlaysUpdater.addOverlays(t,e)}removeAllOverlays(t){this.overlaysUpdater.removeAllOverlays(t)}}class Ei{element(t){return`svg > g > g > g[data-bpmn-id="${t}"]`}elementsOfKind(t){return`svg > g > g > g.${t}:not(.bpmn-label)`}}function Si(n){return new Ci(n,new mi(n.getModel()))}const nt=n=>{const t=I(n);return t.push(...t.map(e=>be(e))),t};class Ci{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=R(r,c.STYLE_OPACITY,e.opacity,fe),r=$t(r,e.stroke),r=Zt(r,e.font),Jt(e)&&(r=Qt(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=m.EXTRA_CSS_CLASSES;class mi{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=qt(s.getStyle(),st,""),i=R(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 Ii(n){return new Ai(Si(n))}class Ai{constructor(t){this.styleUpdater=t}clearCache(){this.styleUpdater.clear()}updateStyle(t,e){this.styleUpdater.updateStyle(t,e)}resetStyle(t){this.styleUpdater.resetStyle(t)}}function Ni(n,t){return new vi(n,new Oi(t.container,new Ei),si(t),Ti(t),Ii(t))}class vi{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 Oi{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(I(n))];class Li{filter(t,e){const s=[],o=[];for(const E of I(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}=_i(t,s,o),l=[...s,...r],{filteredLanes:a,filteredLaneIds:u,filteredFlowNodes:d,filteredFlowNodeIds:f}=Ot(t.lanes,t.flowNodes,l),T=wi(t.edges,[...l,...u,...f]);if(i.length===0&&a.length===0&&d.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:d,pools:i,edges:T}}}function _i(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 Ot(n,t,e){const{filteredLanes:s,filteredLaneIds:o}=Lt(n,e),{filteredLanes:i,filteredLaneIds:r,filteredFlowNodes:l,filteredFlowNodeIds:a}=yi(t,[...e,...o],n);return s.push(...i),o.push(...r),{filteredLanes:s,filteredLaneIds:o,filteredFlowNodes:l,filteredFlowNodeIds:a}}function Lt(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}=Lt(n,s);e.push(...o),s.push(...i)}return{filteredLanes:e,filteredLaneIds:s}}function yi(n,t,e){const s=n.filter(u=>t.includes(u.bpmnElement.parentId));if(s.length===0)return{filteredLanes:[],filteredLaneIds:[],filteredFlowNodes:[],filteredFlowNodeIds:[]};const o=s.map(u=>u.bpmnElement.id),{filteredLanes:i,filteredLaneIds:r,filteredFlowNodes:l,filteredFlowNodeIds:a}=Ot(e,n,o);return s.push(...l),o.push(...a),{filteredLanes:i,filteredLaneIds:r,filteredFlowNodes:s,filteredFlowNodeIds:o}}function wi(n,t){return n.filter(e=>t.includes(e.bpmnElement.sourceReferenceId)&&t.includes(e.bpmnElement.targetReferenceId))}class Ri{constructor(){g(this,"searchableModel");g(this,"onLoadCallback")}load(t,e){var o;const s=new Li().filter(t,e);return this.searchableModel=new Fi(s),(o=this.onLoadCallback)==null||o.call(this),bi(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 x;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 bi(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 Fi{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)}}const Pi="0.44.0",ki=()=>({lib:Pi,dependencies:new Map([["mxGraph",at.VERSION]])});class Bi{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 ns(Vt(t==null?void 0:t.container));this.graph=e.configure(t),this.navigation=new ss(this.graph),this.bpmnModelRegistry=new Ri,this.bpmnElementsRegistry=Ni(this.bpmnModelRegistry,this.graph),this.parserOptions=t==null?void 0:t.parser}load(t,e){const s=ei(this.parserOptions).parse(t),o=this.bpmnModelRegistry.load(s,e==null?void 0:e.modelFilter);cn(this.graph,this.rendererOptions).render(o,e==null?void 0:e.fit)}getVersion(){return ki()}}function or(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 b(n,...t){Ve("[DEMO STARTUP]",n,...t)}function _t(n,t){yt(n),window.alert(n)}function yt(n){console.error("[DEMO]",n)}function $(n,...t){Ve("[DEMO DOWNLOAD]",n,...t)}async function xi(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 wt(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 Mi(n){$("Start SVG download"),wt("diagram.svg","data:image/svg+xml",n),$("Download completed")}function Vi(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(),wt("diagram.png","",l),$("Download completed")}),r.src=s.src}),s.src=e}class Yi{constructor(t,e,s,o){g(this,"document");g(this,"head");this.window=t,this.outerContainerId=e,this.containerToFade=s,this.dropCallback=o,this.document=t.document,this.head=document.head,this.initializeDragAndDrop()}initializeDragAndDrop(){this.containerToFade.classList.add("faded-container"),this.addDomElements(this.containerToFade),this.addStyle();const t=document.querySelector(`#${this.outerContainerId}`);this.preventDefaultsOnEvents(["dragover","drop"],this.window),this.preventDefaultsOnEvents(["dragover","dragleave","drop"],t),this.addEventsOnDropContainer(t,this.containerToFade),this.addEventsOnDocument(this.outerContainerId,this.containerToFade)}preventDefaults(t){t.preventDefault(),t.stopPropagation()}preventDefaultsOnEvents(t,e){for(const s of t)e.addEventListener(s,this.preventDefaults.bind(this),!1)}addDomElements(t){const e=this.document.createElement("p");e.textContent="open BPMN diagram";const s=this.document.createElement("div");s.classList.add("drop-here-text"),s.append(e);const o=this.document.createElement("div");o.id=this.outerContainerId,o.append(s),t.parentNode.prepend(o)}addStyle(){const t=` .faded-container { opacity: 1; } @@ -47,7 +47,7 @@ var nn=Object.defineProperty;var sn=(n,e,t)=>e in n?nn(n,e,{enumerable:!0,config align-items: center; border: 2px dashed rgba(0,0,0,.2); border-radius: 7px; -}`,t=document.createElement("style");t.append(document.createTextNode(e)),this.head.append(t)}addEventsOnDropContainer(e,t){e.addEventListener("dragover",this.getAddClassCallback(t,!1),!1),e.addEventListener("mousedown",this.getRemoveClassCallback(t,!1),!1),e.addEventListener("drop",this.getDropCallbackForElement(t,!1,this.dropCallback),!1)}addEventsOnDocument(e,t){this.document.addEventListener("dragover",this.getAddClassCallback(t,!0,e),!1),this.document.addEventListener("dragleave",this.getRemoveClassCallback(t,!0,e),!1),this.document.addEventListener("drop",this.getDropCallbackForElement(t,!0,this.dropCallback,e),!1)}getAddClassCallback(e,t,s){return function(){t?this.querySelector("#"+s).classList.add("dragging"):this.classList.add("dragging"),e.classList.add("faded")}}getRemoveClassCallback(e,t,s){return function(){t?this.querySelector("#"+s).classList.remove("dragging"):this.classList.remove("dragging"),e.classList.remove("faded")}}getDropCallbackForElement(e,t,s,i){return function(o){try{const l=o.dataTransfer.files;s(l[0])}catch(r){const l=r instanceof Error?r.message:String(r);Xt(l)}finally{t?this.querySelector("#"+i).classList.remove("dragging"):this.classList.remove("dragging"),e.classList.remove("faded")}}}}class jt{constructor(e){this.graph=e}exportSvg(){return this.doSvgExport(!0)}exportSvgForPng(){const e=Lt.IS_FF;return this.doSvgExport(e)}doSvgExport(e){const t=this.computeSvg({scale:1,border:25,enableForeignObjectForLabel:e});return` +}`,e=document.createElement("style");e.append(document.createTextNode(t)),this.head.append(e)}addEventsOnDropContainer(t,e){t.addEventListener("dragover",this.getAddClassCallback(e,!1),!1),t.addEventListener("mousedown",this.getRemoveClassCallback(e,!1),!1),t.addEventListener("drop",this.getDropCallbackForElement(e,!1,this.dropCallback),!1)}addEventsOnDocument(t,e){this.document.addEventListener("dragover",this.getAddClassCallback(e,!0,t),!1),this.document.addEventListener("dragleave",this.getRemoveClassCallback(e,!0,t),!1),this.document.addEventListener("drop",this.getDropCallbackForElement(e,!0,this.dropCallback,t),!1)}getAddClassCallback(t,e,s){return function(){e?this.querySelector("#"+s).classList.add("dragging"):this.classList.add("dragging"),t.classList.add("faded")}}getRemoveClassCallback(t,e,s){return function(){e?this.querySelector("#"+s).classList.remove("dragging"):this.classList.remove("dragging"),t.classList.remove("faded")}}getDropCallbackForElement(t,e,s,o){return function(i){try{const l=i.dataTransfer.files;s(l[0])}catch(r){const l=r instanceof Error?r.message:String(r);_t(l)}finally{e?this.querySelector("#"+o).classList.remove("dragging"):this.classList.remove("dragging"),t.classList.remove("faded")}}}}class Rt{constructor(t){this.graph=t}exportSvg(){return this.doSvgExport(!0)}exportSvgForPng(){const t=at.IS_FF;return this.doSvgExport(t)}doSvgExport(t){const e=this.computeSvg({scale:1,border:25,enableForeignObjectForLabel:t});return` -${N.getXml(t)} -`}computeSvg(e){const t=e.scale??1,s=e.border??0,i=e.crisp??!0,o=e.enableForeignObjectForLabel??!0,r=this.graph.getGraphBounds(),l=this.graph.view.scale,a=N.createXmlDocument(),u=a.createElementNS(c.NS_SVG,"svg"),d=t/l,f=Math.max(1,Math.ceil(r.width*d)+2*s),T=Math.max(1,Math.ceil(r.height*d)+2*s);u.setAttribute("version","1.1"),u.setAttribute("width",f+"px"),u.setAttribute("height",T+"px"),u.setAttribute("viewBox",(i?"-0.5 -0.5":"0 0")+" "+f+" "+T),a.append(u);const E=a.createElementNS(c.NS_SVG,"g");u.append(E);const S=this.createSvgCanvas(E);S.foEnabled=o,S.foOffset=i?-.5:0,S.textOffset=i?-.5:0,S.imageOffset=i?-.5:0,S.translate(Math.floor((s/t-r.x)/l),Math.floor((s/t-r.y)/l)),S.scale(d);const M=new v.mxImageExport;return M.includeOverlays=!0,M.drawState(this.graph.getView().getState(this.graph.model.root),S),a}createSvgCanvas(e){const t=new lr(e);return t.pointerEvents=!0,t}}class lr extends he{constructor(t){super(t);g(this,"htmlConverter",document.createElement("div"))}getAlternateText(t,s,i,o,r,l,a,u,d,f,T,E,S){return this.computeTruncatedText(l,o)}plainText(t,s,i,o,r,l,a,u,d,f,T,E){r=this.computeTruncatedText(r,i),super.plainText(t,s,i,o,r,l,a,u,d,f,T,E)}computeTruncatedText(t,s){if(t==null||this.state.fontSize<=0)return"";try{this.htmlConverter.innerHTML=t,t=N.extractTextWithWhitespace(this.htmlConverter.childNodes);const i=Math.ceil(2*s/this.state.fontSize),o=[];let r=0,l=0;for(;(i==0||r0)break}else o.push(t.charAt(l)),a<255&&r++;l++}o.length1&&(t=N.trim(o.join(""))+"...")}catch(i){console.warn("Error while computing txt label",i)}return t}}const ar=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 cr extends nr{configureTheme(e){if(e=="default")return new Mt(this.graph).configureStyles(),!0;const t=ar.get(e);if(!t)return!1;const s=this.graph.getStylesheet();for(const d of I.eventKinds()){let f,T;switch(d){case"endEvent":{f=t.endEventFillColor,T=t.endEventStrokeColor;break}case"startEvent":{f=t.startEventFillColor,T=t.startEventStrokeColor;break}case"intermediateCatchEvent":case"intermediateThrowEvent":case"boundaryEvent":{f=t.defaultFillColor,T=t.catchAndThrowEventStrokeColor??t.defaultStrokeColor;break}default:{f=t.defaultFillColor,T=t.defaultStrokeColor;break}}const E=s.styles[d];E.fillColor=f,E.strokeColor=T}for(const d of I.taskKinds()){const f=s.styles[d];f.fillColor=t.taskAndCallActivityFillColor}const i=s.styles[h.CALL_ACTIVITY];i.fillColor=t.taskAndCallActivityFillColor;const o=s.styles[h.TEXT_ANNOTATION];o.fillColor=t.textAnnotationFillColor??p.TEXT_ANNOTATION_FILL_COLOR;const r=s.styles[h.POOL];r.fillColor=t.poolFillColor,r.swimlaneFillColor=t.defaultFillColor;const l=s.styles[h.LANE];l.fillColor=t.laneFillColor;const a=s.getDefaultVertexStyle();a.fontColor=t.defaultFontColor,a.fillColor=t.defaultFillColor,a.strokeColor=t.defaultStrokeColor;const u=s.getDefaultEdgeStyle();return u.fontColor=t.defaultFontColor,u.fillColor=t.defaultFillColor,u.strokeColor=t.flowColor??t.defaultStrokeColor,!0}configureSequenceFlowColor(e){k(`Use dedicated ${e} color for sequence flows`);const s=this.graph.getStylesheet().styles[B.SEQUENCE_FLOW];s[c.STYLE_STROKECOLOR]=e,s[c.STYLE_FILLCOLOR]=e,k("Sequence flows style updated")}}let L,H={},Je,et,Oe,G;function Lr(n){A("Updating load options"),H.fit=n,A("Load options updated",H)}function yr(){return{...H}}function _r(){return Oe}function wr(n){A("Switching theme from %s to %s",Oe,n),L.configureTheme(n)?(L.graph.refresh(),A("Theme switch done"),Oe=n):A("Unknown theme, do nothing")}function qt(n,e=!0){A("Loading bpmn...");try{L.load(n,H),A("BPMN loaded with configuration",H),dr(et),document.dispatchEvent(new CustomEvent("diagramLoaded"))}catch(t){if(e)Je(`Cannot load the BPMN diagram: ${t instanceof Error?t.message:String(t)}`);else throw t}}function Rr(n){A("Fitting..."),L.navigation.fit(n),A("Fit done with configuration",n)}function br(n){A(`Zooming '${n}'...`),L.navigation.zoom(n),A("Zoom done")}function Fr(n){return L.bpmnElementsRegistry.getModelElementsByKinds(n)}function ur(n){return L.bpmnElementsRegistry.getModelElementsByIds(n)}function Qt(n){const e=L.graph.model,t=e.getCell(n);return e.getParent(t)}function Pr(n){return n.map(e=>Qt(e).getId()).filter((e,t,s)=>s.indexOf(e)===t)}function kr(n){var s;const e=Qt(n),t=ur(e.getId());return t&&((s=t[0])==null?void 0:s.kind)===h.SUB_PROCESS}function xr(n,e){return L.bpmnElementsRegistry.addCssClasses(n,e)}function Br(n,e){return L.bpmnElementsRegistry.removeCssClasses(n,e)}function Mr(n,e){return L.bpmnElementsRegistry.addOverlays(n,[e])}function Gr(n){return L.bpmnElementsRegistry.removeAllOverlays(n)}function dr(n){if(!et)return;A("Updating model, bpmnElement to collapse:",n);const e=L.graph.getModel(),t=e.getCell(n);if(t){e.beginUpdate();try{e.setCollapsed(t,!0)}finally{e.endUpdate()}A("Model updated")}else A("Element not found in the model, do nothing")}function Jt(n){n.text().then(e=>{qt(e)}).catch(e=>{throw e})}function Vr(n){const e=n.target.files;if(e&&e.length>0){const t=e[0];Jt(t)}}function hr(n){sr(n).catch(e=>{throw new Error(`Unable to fetch ${n}. ${e}`)}).then(e=>(A("BPMN content fetched"),e)).then(e=>{qt(e,!1),A(`BPMN content loaded from url ${n}`)}).then(()=>{Ir()}).catch(e=>{Je(e.message)})}function Yr(n){Xt(n)}function fr(n){$t(n)}function gr(n,e){var o;const t=((o=n.loadOptions)==null?void 0:o.fit)??{},s=e.get("fitTypeOnLoad");s&&(t.type=s);const i=e.get("fitMargin");return i&&(t.margin=Number(i)),t}function Tr(n){if(n.get("style.container.alternative.background.color")=="true"){const o="yellow";k("Use alternative color for the bpmn container background, color",o);const r=L.graph.container;r.style.backgroundColor=o,k("Bpmn container style updated")}const t=n.get("style.theme");k(`Configuring the '${t}' BPMN theme`),L.configureTheme(t)?(Oe=t,k(`'${t}' BPMN theme configured`)):k(`Unknown '${t}' BPMN theme, skipping configuration`),n.get("style.seqFlow.light.colors")=="true"&&L.configureSequenceFlowColor("#E9E9E9"),k('Configuring the "Update Style" API from query parameters'),[...n.keys()].some(o=>o.startsWith("style.api."))?(G={stroke:{},font:{},fill:{}},n.get("style.api.stroke.color")&&(G.stroke.color=n.get("style.api.stroke.color")),n.get("style.api.font.color")&&(G.font.color=n.get("style.api.font.color")),n.get("style.api.font.opacity")&&(G.font.opacity=Number(n.get("style.api.font.opacity"))),n.get("style.api.fill.color")?G.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")&&(G.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")&&(G.fill.opacity=Number(n.get("style.api.fill.opacity"))),k('Prepared "Update Style" API object',G)):k('No query parameters, do not set the "Update Style" API object')}function pr(n){et=n.get("bpmn.element.id.collapsed")}function Er(n){const e=n.get("bpmn.filter.pool.ids");if(!e)return;const t=e.split(",");return A("Configuring load options to only include pool id: ",t),{pools:t.map(s=>({id:s}))}}function Ur(n){const e=k;e("Initializing BpmnVisualization with container:",n.globalOptions.container);const t=new URLSearchParams(window.location.search),s=t.get("renderer.ignore.bpmn.colors");if(s){const o=s==="true";e('Ignore support for "BPMN in Color"?',o),!n.globalOptions.renderer&&(n.globalOptions.renderer={}),n.globalOptions.renderer.ignoreBpmnColors=o}L=new cr(n.globalOptions),e("Initialization completed"),new rr(window,"drop-container",L.graph.container,Jt),e("Drag&Drop support initialized"),Je=n.statusKoNotifier??fr,e("Configuring Load Options"),H=n.loadOptions??{},H.fit=gr(n,t),H.modelFilter=Er(t),Tr(t),pr(t),e("Checking if an 'url to fetch BPMN content' is provided as query parameter");const i=t.get("url");if(i){const o=decodeURIComponent(i);hr(o);return}e("No 'url to fetch BPMN content' provided")}function Dr(){te("Trigger SVG Download"),ir(new jt(L.graph).exportSvg())}function Wr(){te("Trigger PNG Download"),or(new jt(L.graph).exportSvgForPng())}function Sr(n,e){A("Applying style using the style API: %O",e),L.bpmnElementsRegistry.updateStyle(n,e),A("New style applied on: %O",n)}function Hr(n){A("Resetting styles using the style API!"),L.bpmnElementsRegistry.resetStyle(n),A("Styles reset")}function Ir(){if(G){const n=mr();A("Number of elements whose style is to be updated",n.length),Sr(n,G)}}function mr(){A("Retrieving ids of all BPMN elements");const n=[...Object.values(h),...Object.values(B)],e=L.bpmnElementsRegistry.getModelElementsByKinds(n).map(t=>t.id);return A("All BPMN elements ids retrieved:",e.length),e}export{ce as F,h as S,rn as Z,wr as a,tr as b,_r as c,vr as d,Gr as e,Rr as f,yr as g,Vr as h,xr as i,Dr as j,Wr as k,A as l,kr as m,Fr as n,Sr as o,I as p,Pr as q,Br as r,Ur as s,Hr as t,Lr as u,is as v,Yr as w,Mr as x,br as z}; +${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(),u=a.createElementNS(c.NS_SVG,"svg"),d=e/l,f=Math.max(1,Math.ceil(r.width*d)+2*s),T=Math.max(1,Math.ceil(r.height*d)+2*s);u.setAttribute("version","1.1"),u.setAttribute("width",f+"px"),u.setAttribute("height",T+"px"),u.setAttribute("viewBox",(o?"-0.5 -0.5":"0 0")+" "+f+" "+T),a.append(u);const E=a.createElementNS(c.NS_SVG,"g");u.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(d);const M=new O.mxImageExport;return M.includeOverlays=!0,M.drawState(this.graph.getView().getState(this.graph.model.root),S),a}createSvgCanvas(t){const e=new Gi(t);return e.pointerEvents=!0,e}}class Gi extends Re{constructor(e){super(e);g(this,"htmlConverter",document.createElement("div"))}getAlternateText(e,s,o,i,r,l,a,u,d,f,T,E,S){return this.computeTruncatedText(l,i)}plainText(e,s,o,i,r,l,a,u,d,f,T,E){r=this.computeTruncatedText(r,o),super.plainText(e,s,o,i,r,l,a,u,d,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 Di=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 Ui extends Bi{configureTheme(t){if(t=="default")return new Et(this.graph).configureStyles(),!0;const e=Di.get(t);if(!e)return!1;const s=this.graph.getStylesheet();for(const d of C.eventKinds()){let f,T;switch(d){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[d];E.fillColor=f,E.strokeColor=T}for(const d of C.taskKinds()){const f=s.styles[d];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 u=s.getDefaultEdgeStyle();return u.fontColor=e.defaultFontColor,u.fillColor=e.defaultFillColor,u.strokeColor=e.flowColor??e.defaultStrokeColor,!0}configureSequenceFlowColor(t){b(`Use dedicated ${t} color for sequence flows`);const s=this.graph.getStylesheet().styles[P.SEQUENCE_FLOW];s[c.STYLE_STROKECOLOR]=t,s[c.STYLE_FILLCOLOR]=t,b("Sequence flows style updated")}}let v,D={},Ye,Ge,ue,k;function ir(n){A("Updating load options"),D.fit=n,A("Load options updated",D)}function rr(){return{...D}}function lr(){return ue}function ar(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 bt(n,t=!0){A("Loading bpmn...");try{v.load(n,D),A("BPMN loaded with configuration",D),Hi(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 cr(n){A("Fitting..."),v.navigation.fit(n),A("Fit done with configuration",n)}function ur(n){A(`Zooming '${n}'...`),v.navigation.zoom(n),A("Zoom done")}function dr(n){return v.bpmnElementsRegistry.getModelElementsByKinds(n)}function Wi(n){return v.bpmnElementsRegistry.getModelElementsByIds(n)}function Ft(n){const t=v.graph.model,e=t.getCell(n);return t.getParent(e)}function hr(n){return n.map(t=>Ft(t).getId()).filter((t,e,s)=>s.indexOf(t)===e)}function fr(n){var s;const t=Ft(n),e=Wi(t.getId());return e&&((s=e[0])==null?void 0:s.kind)===h.SUB_PROCESS}function gr(n,t){return v.bpmnElementsRegistry.addCssClasses(n,t)}function Tr(n,t){return v.bpmnElementsRegistry.removeCssClasses(n,t)}function pr(n,t){return v.bpmnElementsRegistry.addOverlays(n,[t])}function Er(n){return v.bpmnElementsRegistry.removeAllOverlays(n)}function Hi(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 Pt(n){n.text().then(t=>{bt(t)}).catch(t=>{throw t})}function Sr(n){const t=n.target.files;if(t&&t.length>0){const e=t[0];Pt(e)}}function Ki(n){xi(n).catch(t=>{throw new Error(`Unable to fetch ${n}. ${t}`)}).then(t=>(A("BPMN content fetched"),t)).then(t=>{bt(t,!1),A(`BPMN content loaded from url ${n}`)}).then(()=>{Qi()}).catch(t=>{Ye(t.message)})}function Cr(n){_t(n)}function zi(n){yt(n)}function Xi(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 $i(n){if(n.get("style.container.alternative.background.color")=="true"){const i="yellow";b("Use alternative color for the bpmn container background, color",i);const r=v.graph.container;r.style.backgroundColor=i,b("Bpmn container style updated")}const e=n.get("style.theme");b(`Configuring the '${e}' BPMN theme`),v.configureTheme(e)?(ue=e,b(`'${e}' BPMN theme configured`)):b(`Unknown '${e}' BPMN theme, skipping configuration`),n.get("style.seqFlow.light.colors")=="true"&&v.configureSequenceFlowColor("#E9E9E9"),b('Configuring the "Update Style" API from query parameters'),[...n.keys()].some(i=>i.startsWith("style.api."))?(k={stroke:{},font:{},fill:{}},n.get("style.api.stroke.color")&&(k.stroke.color=n.get("style.api.stroke.color")),n.get("style.api.font.color")&&(k.font.color=n.get("style.api.font.color")),n.get("style.api.font.opacity")&&(k.font.opacity=Number(n.get("style.api.font.opacity"))),n.get("style.api.fill.color")?k.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")&&(k.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")&&(k.fill.opacity=Number(n.get("style.api.fill.opacity"))),b('Prepared "Update Style" API object',k)):b('No query parameters, do not set the "Update Style" API object')}function Zi(n){Ge=n.get("bpmn.element.id.collapsed")}function qi(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 mr(n){const t=b;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 Ui(n.globalOptions),t("Initialization completed"),new Yi(window,"drop-container",v.graph.container,Pt),t("Drag&Drop support initialized"),Ye=n.statusKoNotifier??zi,t("Configuring Load Options"),D=n.loadOptions??{},D.fit=Xi(n,e),D.modelFilter=qi(e),$i(e),Zi(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);Ki(i);return}t("No 'url to fetch BPMN content' provided")}function Ir(){$("Trigger SVG Download"),Mi(new Rt(v.graph).exportSvg())}function Ar(){$("Trigger PNG Download"),Vi(new Rt(v.graph).exportSvgForPng())}function ji(n,t){A("Applying style using the style API: %O",t),v.bpmnElementsRegistry.updateStyle(n,t),A("New style applied on: %O",n)}function Nr(n){A("Resetting styles using the style API!"),v.bpmnElementsRegistry.resetStyle(n),A("Styles reset")}function Qi(){if(k){const n=Ji();A("Number of elements whose style is to be updated",n.length),ji(n,k)}}function Ji(){A("Retrieving ids of all BPMN elements");const n=[...Object.values(h),...Object.values(P)],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,Mt as Z,ar as a,ki as b,lr as c,or as d,Er as e,cr as f,rr as g,Sr as h,gr as i,Ir as j,Ar as k,A as l,fr as m,dr as n,ji as o,C as p,hr as q,Tr as r,mr as s,Nr as t,ir as u,hn as v,Cr as w,pr as x,ur as z}; diff --git a/demo/load-and-navigation/index.html b/demo/load-and-navigation/index.html index 98d936f8..f9647502 100644 --- a/demo/load-and-navigation/index.html +++ b/demo/load-and-navigation/index.html @@ -4,7 +4,7 @@ bpmn-visualization - Demo - + diff --git a/demo/monitoring-all-process-instances/index.html b/demo/monitoring-all-process-instances/index.html index 9e0e8e46..8ce5cec6 100644 --- a/demo/monitoring-all-process-instances/index.html +++ b/demo/monitoring-all-process-instances/index.html @@ -24,7 +24,7 @@ - + diff --git a/demo/prediction/index.html b/demo/prediction/index.html index aaa3f90d..67930feb 100644 --- a/demo/prediction/index.html +++ b/demo/prediction/index.html @@ -30,7 +30,7 @@ - + diff --git a/examples/custom-behavior/apply-css-classes/index.html b/examples/custom-behavior/apply-css-classes/index.html index 00e981e1..61cd6b57 100644 --- a/examples/custom-behavior/apply-css-classes/index.html +++ b/examples/custom-behavior/apply-css-classes/index.html @@ -86,7 +86,7 @@ } - + diff --git a/examples/custom-behavior/call-activity-with-modal-on-mouse-over/index.html b/examples/custom-behavior/call-activity-with-modal-on-mouse-over/index.html index 0e4fc971..02ef38b1 100644 --- a/examples/custom-behavior/call-activity-with-modal-on-mouse-over/index.html +++ b/examples/custom-behavior/call-activity-with-modal-on-mouse-over/index.html @@ -34,7 +34,7 @@ - + diff --git a/examples/custom-behavior/call-activity-with-reload-on-dblclick/index.html b/examples/custom-behavior/call-activity-with-reload-on-dblclick/index.html index 78615c24..f513674f 100644 --- a/examples/custom-behavior/call-activity-with-reload-on-dblclick/index.html +++ b/examples/custom-behavior/call-activity-with-reload-on-dblclick/index.html @@ -36,7 +36,7 @@ - + diff --git a/examples/custom-behavior/call-activity-with-tabs-on-click/index.html b/examples/custom-behavior/call-activity-with-tabs-on-click/index.html index a8c88f7a..7dc9913a 100644 --- a/examples/custom-behavior/call-activity-with-tabs-on-click/index.html +++ b/examples/custom-behavior/call-activity-with-tabs-on-click/index.html @@ -36,7 +36,7 @@ - + diff --git a/examples/custom-behavior/growing-sequence-flow/index.html b/examples/custom-behavior/growing-sequence-flow/index.html index 347d4efa..830e7337 100644 --- a/examples/custom-behavior/growing-sequence-flow/index.html +++ b/examples/custom-behavior/growing-sequence-flow/index.html @@ -57,7 +57,7 @@ - + diff --git a/examples/custom-behavior/javascript-tooltip-and-popover/index.html b/examples/custom-behavior/javascript-tooltip-and-popover/index.html index 8579bd79..1dd82a6e 100644 --- a/examples/custom-behavior/javascript-tooltip-and-popover/index.html +++ b/examples/custom-behavior/javascript-tooltip-and-popover/index.html @@ -49,7 +49,7 @@ - + diff --git a/examples/custom-behavior/running-dashed-message-flow/index.html b/examples/custom-behavior/running-dashed-message-flow/index.html index 70fe7046..60f7088a 100644 --- a/examples/custom-behavior/running-dashed-message-flow/index.html +++ b/examples/custom-behavior/running-dashed-message-flow/index.html @@ -57,7 +57,7 @@ - + diff --git a/examples/custom-behavior/select-elements-by-bpmn-kind/index.html b/examples/custom-behavior/select-elements-by-bpmn-kind/index.html index a8022c5c..f17b2688 100644 --- a/examples/custom-behavior/select-elements-by-bpmn-kind/index.html +++ b/examples/custom-behavior/select-elements-by-bpmn-kind/index.html @@ -55,7 +55,7 @@ } - + diff --git a/examples/custom-bpmn-theme/custom-colors/index.html b/examples/custom-bpmn-theme/custom-colors/index.html index 98e70e14..2a6fe472 100644 --- a/examples/custom-bpmn-theme/custom-colors/index.html +++ b/examples/custom-bpmn-theme/custom-colors/index.html @@ -22,7 +22,7 @@ - + diff --git a/examples/custom-bpmn-theme/custom-edge-marker-colors/index.html b/examples/custom-bpmn-theme/custom-edge-marker-colors/index.html index b28910a3..c4512c51 100644 --- a/examples/custom-bpmn-theme/custom-edge-marker-colors/index.html +++ b/examples/custom-bpmn-theme/custom-edge-marker-colors/index.html @@ -36,7 +36,7 @@ - + diff --git a/examples/custom-bpmn-theme/custom-fonts/index.html b/examples/custom-bpmn-theme/custom-fonts/index.html index ae23d256..49f6d373 100644 --- a/examples/custom-bpmn-theme/custom-fonts/index.html +++ b/examples/custom-bpmn-theme/custom-fonts/index.html @@ -22,7 +22,7 @@ - + diff --git a/examples/custom-bpmn-theme/custom-user-task-icon/index.html b/examples/custom-bpmn-theme/custom-user-task-icon/index.html index 910b7b13..a2c8214d 100644 --- a/examples/custom-bpmn-theme/custom-user-task-icon/index.html +++ b/examples/custom-bpmn-theme/custom-user-task-icon/index.html @@ -22,7 +22,7 @@ - + diff --git a/examples/diagram-navigation/diagram-fit-after-load/index.html b/examples/diagram-navigation/diagram-fit-after-load/index.html index b46361dc..cfc4d902 100644 --- a/examples/diagram-navigation/diagram-fit-after-load/index.html +++ b/examples/diagram-navigation/diagram-fit-after-load/index.html @@ -53,7 +53,7 @@ - + diff --git a/examples/diagram-navigation/diagram-fit-on-load/index.html b/examples/diagram-navigation/diagram-fit-on-load/index.html index 153af316..03277d08 100644 --- a/examples/diagram-navigation/diagram-fit-on-load/index.html +++ b/examples/diagram-navigation/diagram-fit-on-load/index.html @@ -40,7 +40,7 @@ - + diff --git a/examples/diagram-navigation/diagram-navigation/index.html b/examples/diagram-navigation/diagram-navigation/index.html index 5a16b3f3..633f9264 100644 --- a/examples/diagram-navigation/diagram-navigation/index.html +++ b/examples/diagram-navigation/diagram-navigation/index.html @@ -34,7 +34,7 @@ } - + diff --git a/examples/display-bpmn-diagram/load-local-bpmn-diagrams/index.html b/examples/display-bpmn-diagram/load-local-bpmn-diagrams/index.html index 2b642447..c249985e 100644 --- a/examples/display-bpmn-diagram/load-local-bpmn-diagrams/index.html +++ b/examples/display-bpmn-diagram/load-local-bpmn-diagrams/index.html @@ -50,7 +50,7 @@ - + diff --git a/examples/display-bpmn-diagram/load-remote-bpmn-diagrams/index.html b/examples/display-bpmn-diagram/load-remote-bpmn-diagrams/index.html index 720b8e56..b9b3c30f 100644 --- a/examples/display-bpmn-diagram/load-remote-bpmn-diagrams/index.html +++ b/examples/display-bpmn-diagram/load-remote-bpmn-diagrams/index.html @@ -60,7 +60,7 @@ - + diff --git a/examples/display-bpmn-diagram/pools-filter-on-load/index.html b/examples/display-bpmn-diagram/pools-filter-on-load/index.html index 086ce3cd..71e333fa 100644 --- a/examples/display-bpmn-diagram/pools-filter-on-load/index.html +++ b/examples/display-bpmn-diagram/pools-filter-on-load/index.html @@ -34,7 +34,7 @@ - + diff --git a/examples/misc/compare-with-bpmn-js/index.html b/examples/misc/compare-with-bpmn-js/index.html index dc3446e5..cc9b285d 100644 --- a/examples/misc/compare-with-bpmn-js/index.html +++ b/examples/misc/compare-with-bpmn-js/index.html @@ -59,7 +59,7 @@ - + diff --git a/examples/misc/compare-with-kie-editors-standalone/index.html b/examples/misc/compare-with-kie-editors-standalone/index.html index dd6245a3..9b8c181e 100644 --- a/examples/misc/compare-with-kie-editors-standalone/index.html +++ b/examples/misc/compare-with-kie-editors-standalone/index.html @@ -59,7 +59,7 @@ - + diff --git a/examples/overlays/add-remove/index.html b/examples/overlays/add-remove/index.html index b6a7db51..93bfc369 100644 --- a/examples/overlays/add-remove/index.html +++ b/examples/overlays/add-remove/index.html @@ -48,7 +48,7 @@ - + diff --git a/examples/overlays/add-stylized/index.html b/examples/overlays/add-stylized/index.html index ef3bb7ce..f751dac4 100644 --- a/examples/overlays/add-stylized/index.html +++ b/examples/overlays/add-stylized/index.html @@ -43,7 +43,7 @@ - + diff --git a/examples/overlays/custom-overlay-default-style/index.html b/examples/overlays/custom-overlay-default-style/index.html index 273eb8bc..9887c94d 100644 --- a/examples/overlays/custom-overlay-default-style/index.html +++ b/examples/overlays/custom-overlay-default-style/index.html @@ -29,7 +29,7 @@ - + diff --git a/projects/javascript-vanilla-with-webpack/package.json b/projects/javascript-vanilla-with-webpack/package.json index 3b1688ca..1a226cb3 100644 --- a/projects/javascript-vanilla-with-webpack/package.json +++ b/projects/javascript-vanilla-with-webpack/package.json @@ -9,7 +9,7 @@ "serve": "webpack serve" }, "dependencies": { - "bpmn-visualization": "0.43.0" + "bpmn-visualization": "0.44.0" }, "devDependencies": { "html-webpack-plugin": "~5.6.0", diff --git a/projects/typescript-angular/package.json b/projects/typescript-angular/package.json index 841dd028..c9790570 100644 --- a/projects/typescript-angular/package.json +++ b/projects/typescript-angular/package.json @@ -19,7 +19,7 @@ "@angular/platform-browser": "~15.2.10", "@angular/platform-browser-dynamic": "~15.2.10", "@angular/router": "~15.2.10", - "bpmn-visualization": "0.43.0", + "bpmn-visualization": "0.44.0", "rxjs": "~7.8.1", "tslib": "~2.5.3", "zone.js": "~0.12.0" diff --git a/projects/typescript-lit-element/package.json b/projects/typescript-lit-element/package.json index 38b12e7f..3c8fb415 100644 --- a/projects/typescript-lit-element/package.json +++ b/projects/typescript-lit-element/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "lit": "~2.7.5", - "bpmn-visualization": "0.43.0" + "bpmn-visualization": "0.44.0" }, "devDependencies": { "patch-package": "~8.0.0", diff --git a/projects/typescript-vanilla-with-parcel/README.md b/projects/typescript-vanilla-with-parcel/README.md index d190db8f..432d1c24 100644 --- a/projects/typescript-vanilla-with-parcel/README.md +++ b/projects/typescript-vanilla-with-parcel/README.md @@ -17,8 +17,20 @@ The code calling `bpmn-visualization` to render the BPMN diagram is available in If you want to bundle the application, run `npm run build`. -## WARNING about the Parcel configuration for old `bpmn-visualization` versions +## WARNING about the Parcel configuration for some `bpmn-visualization` versions -When using bpmn-visualization@0.26.1 or older, a special configuration is required. This no more needed starting from version 0.26.2 (see [PR 384 ](https://github.com/process-analytics/bpmn-visualization-examples/pull/384) for more explanations). +### 0.44.0 and newer[](url) + +`bpmn-visualization` [0.44.0](https://github.com/process-analytics/bpmn-visualization-js/releases/tag/v0.44.0) starts depending on [es-toolkit](https://github.com/toss/es-toolkit) (version 1.16.0). +The package.json file of es-toolkit declares a `browser` attrbute ("./dist/browser.global.js"), so it is used by parcel as the entry point of the module. However, parcel encounters an error with this entry point. + +To workaround this problem, configure an alias in the package.json to use the same entry point as defined by the `module` attribute ("./dist/index.mjs"). + +See [PR 599](https://github.com/process-analytics/bpmn-visualization-examples/pull/599) for more details. + + +### 0.26.1 and older + +When using bpmn-visualization@0.26.1 or older, a special configuration is required. This no more needed starting from version 0.26.2 (see [PR 384](https://github.com/process-analytics/bpmn-visualization-examples/pull/384) for more explanations). For old versions, configure an alias in the package.json: https://github.com/process-analytics/bpmn-visualization-examples/blob/v0.26.1/projects/typescript-vanilla-with-parcel/package.json#L18-L20 diff --git a/projects/typescript-vanilla-with-parcel/package.json b/projects/typescript-vanilla-with-parcel/package.json index 5176f7e3..5f5956a8 100644 --- a/projects/typescript-vanilla-with-parcel/package.json +++ b/projects/typescript-vanilla-with-parcel/package.json @@ -8,12 +8,16 @@ "build": "tsc && parcel build --public-url ./ index.html" }, "dependencies": { - "bpmn-visualization": "0.43.0" + "bpmn-visualization": "0.44.0" }, "devDependencies": { "@parcel/core": "~2.10.0", "@parcel/transformer-inline-string": "~2.10.0", + "buffer": "^6.0.3", "parcel": "~2.10.0", "typescript": "~4.5.5" + }, + "alias": { + "es-toolkit": "es-toolkit/dist/index.mjs" } } diff --git a/projects/typescript-vanilla-with-rollup/package.json b/projects/typescript-vanilla-with-rollup/package.json index d805308f..f9c4c733 100644 --- a/projects/typescript-vanilla-with-rollup/package.json +++ b/projects/typescript-vanilla-with-rollup/package.json @@ -10,7 +10,7 @@ "start": "rollup -cw --environment devMode:true" }, "dependencies": { - "bpmn-visualization": "0.43.0" + "bpmn-visualization": "0.44.0" }, "devDependencies": { "@rollup/plugin-commonjs": "~25.0.7", diff --git a/projects/typescript-vanilla-with-vitejs/package.json b/projects/typescript-vanilla-with-vitejs/package.json index 92a4193a..49f712b0 100644 --- a/projects/typescript-vanilla-with-vitejs/package.json +++ b/projects/typescript-vanilla-with-vitejs/package.json @@ -9,7 +9,7 @@ "preview": "vite preview" }, "dependencies": { - "bpmn-visualization": "0.43.0" + "bpmn-visualization": "0.44.0" }, "devDependencies": { "typescript": "~4.5.5", diff --git a/projects/typescript-vue/package.json b/projects/typescript-vue/package.json index 7b10daa1..8e6465a8 100644 --- a/projects/typescript-vue/package.json +++ b/projects/typescript-vue/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "@process-analytics/bv-experimental-add-ons": "0.2.0", - "bpmn-visualization": "0.43.0", + "bpmn-visualization": "0.44.0", "spectre.css": "~0.5.9", "vue": "~3.3.4" },