From 7193801fd33f47a5f651929135d77cd0c10d1be0 Mon Sep 17 00:00:00 2001 From: alibama Date: Thu, 11 Jun 2026 12:51:47 +0000 Subject: [PATCH] feat: add bpmnlint integration for BPMN diagrams Surface model validation issues directly in rendered diagrams and in the editor via bpmn-js-bpmnlint. A toggle button on the canvas shows clickable error/warning overlays on the offending elements. - New `lint` attribute on : on | off | inactive. The viewer defaults to button-present-inactive; the editor defaults to active. - Rules live in .bpmnlintrc (extends bpmnlint:recommended) and are packed into the committed bundles at build time via bpmnlint-pack-config, since bpmnlint cannot resolve rules in the browser. build:vendor handles this automatically. - The lint module runs in a plain Viewer (every injected service is present; editorActions resolves optionally), so no viewer upgrade was needed. - Add syntax tests for the lint attribute; default output is unchanged when the attribute is absent. Refs #83 --- .bpmnlintrc | 3 + .gitignore | 3 + README.md | 58 ++ _test/syntax_plugin_bpmnio_bpmnio.test.php | 65 ++ all.less | 1 + build/build-vendor.mjs | 67 +- build/vendor-entrypoints/bpmn-modeler.js | 14 + build/vendor-entrypoints/bpmn-viewer.js | 14 + package-lock.json | 908 +++++++++++++++++- package.json | 3 + script/bpmnio_render.js | 61 +- syntax/bpmnio.php | 28 +- vendor/bpmn-js-bpmnlint/LICENSE | 22 + vendor/bpmn-js-bpmnlint/README.md | 74 ++ .../dist/assets/css/bpmn-js-bpmnlint.less | 238 +++++ vendor/bpmn-js-bpmnlint/package.json | 80 ++ .../dist/bpmn-modeler.production.min.js | 166 ++-- .../dist/bpmn-viewer.production.min.js | 52 +- vendor/build-manifest.json | 7 +- 19 files changed, 1766 insertions(+), 98 deletions(-) create mode 100644 .bpmnlintrc create mode 100644 vendor/bpmn-js-bpmnlint/LICENSE create mode 100644 vendor/bpmn-js-bpmnlint/README.md create mode 100644 vendor/bpmn-js-bpmnlint/dist/assets/css/bpmn-js-bpmnlint.less create mode 100644 vendor/bpmn-js-bpmnlint/package.json diff --git a/.bpmnlintrc b/.bpmnlintrc new file mode 100644 index 0000000..0c1faae --- /dev/null +++ b/.bpmnlintrc @@ -0,0 +1,3 @@ +{ + "extends": "bpmnlint:recommended" +} diff --git a/.gitignore b/.gitignore index fbfd259..ca1d1eb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ composer.lock # npm node_modules/ + +# generated lint config bundle (rebuilt by build:vendor) +/build/generated/ diff --git a/README.md b/README.md index 62f7706..d880502 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,45 @@ Renders using the bpmn.io js libraries within dokuwiki: Refer to this page for details: +## Usage + +Embed a diagram by wrapping inline XML (or referencing a media file) in a +`` block: + +``` + +...BPMN 2.0 XML... + + + +``` + +### Attributes + +| Attribute | Values | Description | +| --------- | ------ | ----------- | +| `type` | `bpmn` (default), `dmn` | Diagram kind. | +| `src` | media id | Render a stored media file instead of inline XML. | +| `zoom` | positive number | Scale factor applied to the rendered diagram. | +| `lint` | `on`, `off`, `inactive` | Per-diagram [bpmnlint](https://github.com/bpmn-io/bpmnlint) behaviour (BPMN only). | + +### Linting BPMN diagrams + +BPMN diagrams ship with an embedded [bpmnlint](https://github.com/bpmn-io/bpmnlint) +linter via [bpmn-js-bpmnlint](https://github.com/bpmn-io/bpmn-js-bpmnlint). A +toggle button appears in the corner of the canvas; clicking it overlays +clickable error/warning badges on the offending elements, each opening the list +of issues for that element. This works on rendered wiki pages (read-only viewer) +as well as in the editor. + +The `lint` attribute controls the default state per diagram: + +* `lint="on"` — overlays are shown immediately. +* `lint="inactive"` — the toggle button is present but overlays start hidden. +* `lint="off"` — the linter is not loaded for that diagram (no button). +* omitted — viewer diagrams default to the button being present but inactive; + the editor defaults to active so authors get immediate feedback. + ## Development ### Prerequisites @@ -54,6 +93,25 @@ cd /path/to/dokuwiki php vendor/bin/phpunit --group plugin_bpmnio ``` +### Customising the BPMN linter + +The lint rules are defined in [`.bpmnlintrc`](.bpmnlintrc) at the repo root and +are compiled into the committed viewer/modeler bundles at build time (bpmnlint +cannot resolve rules in the browser). The default config extends +[`bpmnlint:recommended`](https://github.com/bpmn-io/bpmnlint#built-in-rules). +After editing `.bpmnlintrc`, rebuild the bundles: + +```bash +npm run build:vendor # or ./update-vendor.sh +``` + +To add project-specific rules, create a local +[bpmnlint plugin](https://github.com/bpmn-io/bpmnlint#plugins) (a +`bpmnlint-plugin-` package exporting `rules` and a `recommended` config), +add it to `package.json` (e.g. as a `file:` dependency), reference it from +`.bpmnlintrc` via `plugin:/recommended`, and rebuild. The packing step +inlines the resolved rules so no resolver is needed at runtime. + ### Updating vendor libraries The committed `vendor/` bundles are generated locally from the npm packages diff --git a/_test/syntax_plugin_bpmnio_bpmnio.test.php b/_test/syntax_plugin_bpmnio_bpmnio.test.php index 8623d59..79b27e7 100644 --- a/_test/syntax_plugin_bpmnio_bpmnio.test.php +++ b/_test/syntax_plugin_bpmnio_bpmnio.test.php @@ -223,6 +223,71 @@ public function test_syntax_ignores_invalid_zoom_attribute() $this->assertStringNotContainsString('data-zoom=', $xhtml); } + public function test_syntax_lint_attribute() + { + $info = array(); + + $input = << + XML... + + IN; + + $instructions = p_get_instructions($input); + $xhtml = p_render('xhtml', $instructions, $info); + + $this->assertStringContainsString('data-lint="on"', $xhtml); + } + + public function test_syntax_lint_off_attribute() + { + $info = array(); + + $input = << + XML... + + IN; + + $instructions = p_get_instructions($input); + $xhtml = p_render('xhtml', $instructions, $info); + + $this->assertStringContainsString('data-lint="off"', $xhtml); + } + + public function test_syntax_ignores_invalid_lint_attribute() + { + $info = array(); + + $input = << + XML... + + IN; + + $instructions = p_get_instructions($input); + $xhtml = p_render('xhtml', $instructions, $info); + + $this->assertStringNotContainsString('data-lint=', $xhtml); + } + + public function test_syntax_lint_and_zoom_coexist() + { + $info = array(); + + $input = << + XML... + + IN; + + $instructions = p_get_instructions($input); + $xhtml = p_render('xhtml', $instructions, $info); + + $this->assertStringContainsString('data-zoom="1.5"', $xhtml); + $this->assertStringContainsString('data-lint="inactive"', $xhtml); + } + public function test_syntax_builds_link_payload_for_named_elements() { $info = array(); diff --git a/all.less b/all.less index 10f5060..c8afd59 100644 --- a/all.less +++ b/all.less @@ -1,6 +1,7 @@ @import "vendor/bpmn-js/dist/assets/diagram-js.less"; @import "vendor/bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.less"; @import "vendor/bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.less"; +@import "vendor/bpmn-js-bpmnlint/dist/assets/css/bpmn-js-bpmnlint.less"; @import "vendor/dmn-js/dist/assets/diagram-js.less"; @import "vendor/dmn-js/dist/assets/dmn-js-shared.less"; diff --git a/build/build-vendor.mjs b/build/build-vendor.mjs index 11534b1..f2380af 100644 --- a/build/build-vendor.mjs +++ b/build/build-vendor.mjs @@ -2,11 +2,21 @@ import { build } from 'esbuild'; import { cp, mkdir, readdir, readFile, rm, stat, writeFile } from 'node:fs/promises'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; +import packConfigModule from 'bpmnlint-pack-config'; + +const { packConfig } = packConfigModule; const rootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..'); const nodeModulesDir = path.join(rootDir, 'node_modules'); const vendorDir = path.join(rootDir, 'vendor'); const fontDir = path.join(rootDir, 'font'); +const generatedDir = path.join(rootDir, 'build', 'generated'); + +// .bpmnlintrc is resolved into a self-contained { config, resolver } module at +// build time. bpmnlint cannot resolve rule references in the browser, so the +// packed module is what the bpmn-viewer / bpmn-modeler entry points import. +const bpmnlintConfigPath = path.join(rootDir, '.bpmnlintrc'); +const packedLintConfigPath = path.join(generatedDir, 'bpmnlintrc.packed.js'); const packages = [ { @@ -153,7 +163,55 @@ async function buildBundle({ entryPoint, outFile, metadata, packageName }) { console.log(`Built ${packageName} bundle: ${path.relative(rootDir, outFile)}`); } +async function packLintConfig() { + if (!(await pathExists(bpmnlintConfigPath))) { + throw new Error( + `Missing .bpmnlintrc at repo root. It is required to build the linter bundle.` + ); + } + + await mkdir(generatedDir, { recursive: true }); + + // Produces an ES module exporting { config, resolver, ... } with every rule + // implementation inlined, so it can run in the browser without a resolver. + const output = await packConfig(bpmnlintConfigPath, 'es'); + const banner = '/*! generated from .bpmnlintrc for dokuwiki-plugin-bpmnio — do not edit by hand */\n'; + + await writeFile(packedLintConfigPath, `${banner}${output.code}`); + + console.log(`Packed lint config: ${path.relative(rootDir, packedLintConfigPath)}`); +} + +async function copyLintAssets() { + const packageName = 'bpmn-js-bpmnlint'; + const sourceDir = path.join(nodeModulesDir, packageName); + + await ensureInstalled(packageName); + await cleanPackageOutput(packageName); + await copyMetadata(packageName); + + // Only the stylesheet is needed as a committed asset; the JS is bundled into + // the viewer/modeler entry points. The .css is renamed to .less so DokuWiki's + // LESS pipeline (all.less) can @import it like the other vendor stylesheets. + const cssSource = path.join(sourceDir, 'dist', 'assets', 'css', 'bpmn-js-bpmnlint.css'); + const cssTarget = path.join( + vendorDir, + packageName, + 'dist', + 'assets', + 'css', + 'bpmn-js-bpmnlint.less' + ); + + await copyFileEnsuringDir(cssSource, cssTarget); + + console.log(`Copied ${packageName} stylesheet: ${path.relative(rootDir, cssTarget)}`); +} + async function main() { + await packLintConfig(); + await copyLintAssets(); + for (const pkg of packages) { const metadata = await readPackageMetadata(pkg.name); const sourceDir = path.join(nodeModulesDir, pkg.name); @@ -176,12 +234,15 @@ async function main() { } } + const lintPackages = ['bpmn-js-bpmnlint', 'bpmnlint', 'bpmnlint-pack-config']; + const generatedMetadata = { generatedAt: new Date().toISOString(), packages: Object.fromEntries( - await Promise.all( - packages.map(async (pkg) => [pkg.name, (await readPackageMetadata(pkg.name)).version]) - ) + await Promise.all([ + ...packages.map(async (pkg) => [pkg.name, (await readPackageMetadata(pkg.name)).version]), + ...lintPackages.map(async (name) => [name, (await readPackageMetadata(name)).version]), + ]) ), }; diff --git a/build/vendor-entrypoints/bpmn-modeler.js b/build/vendor-entrypoints/bpmn-modeler.js index 59ee749..93fc2e6 100644 --- a/build/vendor-entrypoints/bpmn-modeler.js +++ b/build/vendor-entrypoints/bpmn-modeler.js @@ -1,6 +1,8 @@ import Modeler from 'bpmn-js/lib/Modeler'; import NavigatedViewer from 'bpmn-js/lib/NavigatedViewer'; import Viewer from 'bpmn-js/lib/Viewer'; +import lintModule from 'bpmn-js-bpmnlint'; +import { config, resolver } from '../generated/bpmnlintrc.packed.js'; const root = globalThis; Object.assign(Modeler, { @@ -10,4 +12,16 @@ Object.assign(Modeler, { }); root.BpmnJS = Modeler; +// Same packed lint config as the viewer bundle. Attaching it to each exported +// constructor (and to window globals) keeps the render script independent of +// which bundle loaded last. +const lintConfig = { config, resolver }; + +root.BpmnLintModule = lintModule; +root.BpmnLintConfig = lintConfig; +for (const Ctor of [Modeler, NavigatedViewer, Viewer]) { + Ctor.lintModule = lintModule; + Ctor.lintConfig = lintConfig; +} + export default Modeler; diff --git a/build/vendor-entrypoints/bpmn-viewer.js b/build/vendor-entrypoints/bpmn-viewer.js index 508e18e..c12d4fd 100644 --- a/build/vendor-entrypoints/bpmn-viewer.js +++ b/build/vendor-entrypoints/bpmn-viewer.js @@ -1,7 +1,21 @@ import Viewer from 'bpmn-js/lib/Viewer'; +import lintModule from 'bpmn-js-bpmnlint'; +import { config, resolver } from '../generated/bpmnlintrc.packed.js'; const root = globalThis; root.BpmnJS = Viewer; root.BpmnJS.Viewer = Viewer; +// Linter integration. bpmn-js-bpmnlint runs in a plain Viewer: every service it +// needs (canvas, overlays, elementRegistry, eventBus, translate, bpmnjs) ships +// with the Viewer, and its editor-action helper resolves editorActions +// optionally. The render script passes lintModule + lintConfig into the +// constructor; we expose them here so it can opt diagrams in or out. +const lintConfig = { config, resolver }; + +root.BpmnLintModule = lintModule; +root.BpmnLintConfig = lintConfig; +Viewer.lintModule = lintModule; +Viewer.lintConfig = lintConfig; + export default Viewer; diff --git a/package-lock.json b/package-lock.json index bce2df9..f30836c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,9 @@ "devDependencies": { "@eslint/js": "^9.0.0", "bpmn-js": "18.14.0", + "bpmn-js-bpmnlint": "^0.24.0", + "bpmnlint": "^11.12.1", + "bpmnlint-pack-config": "^0.9.0", "dmn-js": "17.7.0", "esbuild": "^0.25.11", "eslint": "^9.0.0", @@ -18,6 +21,13 @@ "stylelint-config-standard-less": "^3.0.0" } }, + "bpmnlint-plugin-lexipedia": { + "version": "0.1.0", + "extraneous": true, + "peerDependencies": { + "bpmnlint": ">=11" + } + }, "node_modules/@babel/code-frame": { "version": "7.29.0", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz", @@ -130,6 +140,16 @@ "node": ">= 20.12.0" } }, + "node_modules/@bpmn-io/moddle-utils": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@bpmn-io/moddle-utils/-/moddle-utils-0.3.0.tgz", + "integrity": "sha512-0kz2PKfjIH3XFtO9Koxh7jV8e1DWWs4rgp0IczhJgluoRHf9Jhq8zX1H3wGJu6+lpg1Rkzc6YW1ezKz+2K8wTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "min-dash": "^5.0.0" + } + }, "node_modules/@cacheable/memory": { "version": "2.0.8", "resolved": "https://registry.npmjs.org/@cacheable/memory/-/memory-2.0.8.tgz", @@ -166,7 +186,6 @@ "integrity": "sha512-CYDD3SOtsHtyXeEORYRx2qBtpDJFjRTGXUtmNEMGyzYOKj1TE3tycdlho7kA1Ufx9OYWZzg52QFBGALTirzDSw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@keyv/serialize": "^1.1.1" } @@ -291,7 +310,6 @@ } ], "license": "MIT", - "peer": true, "engines": { "node": ">=18" }, @@ -340,7 +358,6 @@ } ], "license": "MIT", - "peer": true, "engines": { "node": ">=18" } @@ -1041,6 +1058,13 @@ "url": "https://github.com/sponsors/nzakas" } }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, "node_modules/@keyv/serialize": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@keyv/serialize/-/serialize-1.1.1.tgz", @@ -1120,10 +1144,479 @@ "node": ">= 8" } }, + "node_modules/@rollup/plugin-commonjs": { + "version": "29.0.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-29.0.3.tgz", + "integrity": "sha512-ZaOxZceP7SOUW7Lqw5IRVweSQYWaeIPnXIGLiB690EBA3FGJTO40EEr2L5yZplJWsgTCogILRSpcAe7+U0Otdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "commondir": "^1.0.1", + "estree-walker": "^2.0.2", + "fdir": "^6.2.0", + "is-reference": "1.2.1", + "magic-string": "^0.30.3", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=16.0.0 || 14 >= 14.17" + }, + "peerDependencies": { + "rollup": "^2.68.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-commonjs/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-commonjs/node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/@rollup/plugin-node-resolve": { + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.3.tgz", + "integrity": "sha512-lUYM3UBGuM93CnMPG1YocWu7X802BrNF3jW2zny5gQyLQgRFJhV1Sq0Zi74+dh/6NBx1DxFC4b4GXg9wUCG5Qg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "@types/resolve": "1.20.2", + "deepmerge": "^4.2.2", + "is-module": "^1.0.0", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.78.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.4.0.tgz", + "integrity": "sha512-MfPp06CjRLfXQ3wY0R8vJDYBy/MvVcc9OulEfR0B8Iv9ko+GCNaRZ+EpJYFl27LhKsZK0o420sYCRHCjfCgeUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils/node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.61.1.tgz", + "integrity": "sha512-JnBB8MdXj45cajvTuO5FmPlvFVJRQgvrz1uSEl3NwqFnReAPGwb8EanbGi4z2nRaqLzjJSv5/JmycoTKlRZxHA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.61.1.tgz", + "integrity": "sha512-Jx2g7iSjw4AOT0HDPHM9RV3GNjRXwybWtSFZiZAYUTjUwjVrYIwq3kBf+LnhqJlzXFAqTAh2F7IGI+O568exPw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.61.1.tgz", + "integrity": "sha512-0F1L/Z3Eqv8mT2n3dCpeO8GcTvHvVqkP5/t6DMsn0KzhYVcg+s7Ncl5DS8qjKYEeio6Az0Gt6nyBORay5qIlCA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.61.1.tgz", + "integrity": "sha512-qLttcH871ujY4YcVfUSShhOw+CsoTatYz8gRbHO7Bb92QH059/P0y5do1KMs41fY0BpD2x4AJH/gID0zFiqVKQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.61.1.tgz", + "integrity": "sha512-fUI4RapGE0Oh3mb8mgfvC1O2nU1RpDZUKnDQm3xB1Ipg7C2wTs5Kstz7G2uWK99a8S2yTMq8/P4uycwNa0nJyw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.61.1.tgz", + "integrity": "sha512-H5YrdvJaDtI/U9/emrD4b++xkvp3y/JvOe4rizHbxvkyMfRS/CiRYdji+Pl8D0brEaNFWUh1drQxgAGIl6Xudw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.61.1.tgz", + "integrity": "sha512-Q8CBCCQtDFrYtXoeUXSrnFXKOnyUhx6bz+SkL6A0E7V8kAiCJ5pamq1WtbfpVGhR5TSpXY6ak3avmDc5fHTyJA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.61.1.tgz", + "integrity": "sha512-nwnhk1581l0FBVellGcVCAT0Oi06onEA3WB53sf01VO3I0UPBkMH9sXONYME2K0ovXcNayJfNtHfm6mpJElatQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.61.1.tgz", + "integrity": "sha512-x5Xr49hwt3hdW75UOZm3395YwwzPyauktslv29KpWL/T+vVAzoT3azLcTWv0eMciBNrx+DYjH4paehHoLpPvpg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.61.1.tgz", + "integrity": "sha512-unMS3H73DpaoPyyEVPjGKleM/s0mkmsauTENpw4INQY8y4+IuLNjkueQ5QCtC0D3N38Y38yhAU8OoZ20S2Tm6w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.61.1.tgz", + "integrity": "sha512-zNZzGRnAhwjFEYmvphJRV5XaQGjs62cCmeYYHUT//NbvEnHauw+I85nGG+SiVg5ld4GX8D1IbKIX+ozITQnhMQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.61.1.tgz", + "integrity": "sha512-LdpWGL8X209B2SIvWjqlc8VZgM6PKfontSerGepuldQmHYrAOtnMCXeJkxXGbC+PPZVOuu5czJo7fNV6aeW8rQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.61.1.tgz", + "integrity": "sha512-EC5kTtNaNGOmbMGqar8dvJy6y/hg99GAwjfBz++pxZhQATXGcRjd6c5en5wcbru0vkRmiMGsQKdMJOOf6sza4g==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.61.1.tgz", + "integrity": "sha512-8hiwp6D4acEcNK78I4rP0/XtS1sknWIAMJBPdR4l6zUtyTm5KiTDr5bXmWt4foY7nAN7AThDHgkLIEZOWKbzWw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.61.1.tgz", + "integrity": "sha512-10dh/h/BqA7DuMPWSxkR8uks18FRwnwOEqr5zOTEl+NOwP/OMzKX8OFR/Of9xxDA7D5qef1Nzar5WDD2kCCr1g==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.61.1.tgz", + "integrity": "sha512-YKJ5lg35DP17gcAOggnihe+APw9HLyj1Xn7gsmGumBJAUDa6NGXNixJzmkWLhcK9TOuuyQjdamzvJefkO7qHZQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.61.1.tgz", + "integrity": "sha512-Mlil5G2Jj6a7B3LWGctg+XPL9vdXYuzCtNXfxOQ0nPjc2m6ueUktocPGH9bnAM0bNRKb/bAWTujUU7IJQdQA+g==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.61.1.tgz", + "integrity": "sha512-bVWIOIk6pV01p4CdUbPP7CJ/434z+OooYjDuFcR+44N35YvKUC66G8MGnvcWx5mWKW3g61J+t74l3Kj15Kwn2Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.61.1.tgz", + "integrity": "sha512-qy5pBvZbqNFheBz61R1rzsezjm0J7O2oNGoWtGoY89SZYLUfxAJTBAqDChqAIdB4rCiIbi9nF7yZ83GnNiLwSw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.61.1.tgz", + "integrity": "sha512-E83TXjI4zm0+5f2qO+UOudaCYIhYwpJ5jq6YCZNIZ+6CbfhKrkAGezeiASBL9ElxAxFsRS9ZhESv8mfnj6TKeg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.61.1.tgz", + "integrity": "sha512-fbWnKqVkjrJN38vNe3ahkbk6iejS/3b0Nt7EEtPpE6RBacZcGXNKbzfHN3GUUlXOPghUg0j6XUGrtjX9z1sIvA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.61.1.tgz", + "integrity": "sha512-ArMl38iVAbk0New1ogihQNY6iphLi4ZaRsa037gUzv5yeKPY8TD3Dmy4x2RNC1VztU/uqm+G+/RwFrSka3Oy2g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.61.1.tgz", + "integrity": "sha512-0mYtjHS9ucAbcATycCNK9IGBk/cCe/ma7EmSLGZdsxnOA8cjRIyU04wDpVAD9NiOfLUR9KTxdiO53uOkherqjQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.61.1.tgz", + "integrity": "sha512-gK1iCEPfpoSG9wfBihXxvBMi8ZfcWffYkEsC/Eih+iFENTaewvNcrEQ69lIOWYO5pePHKLHHO7nq5AILGO/HQQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.61.1.tgz", + "integrity": "sha512-X+zaP2x+j4RXGfbp/seSoRHWnPxzApilDszisZxbYH5C/jTxFhCtDNdPGZb9lJyYPs24wGxruPF7Y+sIXt9Gzw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@types/estree": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", "dev": true, "license": "MIT" }, @@ -1134,13 +1627,19 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/resolve": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", + "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", + "dev": true, + "license": "MIT" + }, "node_modules/acorn": { "version": "8.16.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", "dev": true, "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -1175,6 +1674,16 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -1255,6 +1764,22 @@ "node": "*" } }, + "node_modules/bpmn-js-bpmnlint": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/bpmn-js-bpmnlint/-/bpmn-js-bpmnlint-0.24.0.tgz", + "integrity": "sha512-KTBtJfoHCNc7e13Eb2Pkbf9hX+9ntGvSgbt0/lwJXt2bHkz9rBWi12iajXT+Xl2427jxYh6IcC6BxUAyaq+rPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "min-dash": "^5.0.0", + "min-dom": "^5.2.0" + }, + "peerDependencies": { + "bpmn-js": "*", + "bpmnlint": ">= 3.2", + "diagram-js": "*" + } + }, "node_modules/bpmn-moddle": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/bpmn-moddle/-/bpmn-moddle-10.0.0.tgz", @@ -1270,6 +1795,58 @@ "node": ">= 20.12" } }, + "node_modules/bpmnlint": { + "version": "11.12.1", + "resolved": "https://registry.npmjs.org/bpmnlint/-/bpmnlint-11.12.1.tgz", + "integrity": "sha512-s/V68yzJU/ko7ea6ljp/xUUC8PUN+fzZaqI+votu0DPzDc6OqvpBcKzw7rMpqS4WPw/HOW3cLw/C2poWilClCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@bpmn-io/moddle-utils": "^0.3.0", + "ansi-colors": "^4.1.3", + "bpmn-moddle": "^10.0.0", + "bpmnlint-utils": "^1.1.1", + "cli-table": "^0.3.11", + "color-support": "^1.1.3", + "min-dash": "^5.0.0", + "mri": "^1.2.0", + "pluralize": "^8.0.0", + "tiny-glob": "^0.2.9" + }, + "bin": { + "bpmnlint": "bin/bpmnlint.js" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/bpmnlint-pack-config": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/bpmnlint-pack-config/-/bpmnlint-pack-config-0.9.0.tgz", + "integrity": "sha512-Wb4f/WXnLcWsWaOSMGi5mQr2PD1ydWpT/YLQCMGZ9hsxnzFX1/yoUrMOkUYzl0NX86vZrBxMZDy+5Ih3njY2eA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/plugin-commonjs": "^29.0.0", + "@rollup/plugin-node-resolve": "^16.0.3", + "mri": "^1.2.0", + "rollup": "^4.59.0", + "rollup-plugin-bpmnlint": "^0.4.1" + }, + "bin": { + "bpmnlint-pack-config": "bin/cli.js" + }, + "peerDependencies": { + "bpmnlint": "*" + } + }, + "node_modules/bpmnlint-utils": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/bpmnlint-utils/-/bpmnlint-utils-1.1.1.tgz", + "integrity": "sha512-Afdb77FmwNB3INyUfbzXW40yY+mc0qYU3SgDFeI4zTtduiVomOlfqoXiEaUIGI8Hyh7aVYpmf3O97P2w7x0DYQ==", + "dev": true, + "license": "MIT" + }, "node_modules/brace-expansion": { "version": "1.1.14", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.14.tgz", @@ -1345,6 +1922,18 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/cli-table": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.11.tgz", + "integrity": "sha512-IqLQi4lO0nIB4tcdTpN4LCB9FI3uqrJZK7RC515EnhZ6qBaglkIgICb1wjeAqpdoOabm1+SuQtkXIPdYC93jhQ==", + "dev": true, + "dependencies": { + "colors": "1.0.3" + }, + "engines": { + "node": ">= 0.2.0" + } + }, "node_modules/clsx": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", @@ -1375,6 +1964,16 @@ "dev": true, "license": "MIT" }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true, + "license": "ISC", + "bin": { + "color-support": "bin.js" + } + }, "node_modules/colord": { "version": "2.9.3", "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", @@ -1382,6 +1981,23 @@ "dev": true, "license": "MIT" }, + "node_modules/colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha512-pFGrxThWcWQ2MsAz6RtgeWe4NK2kUE1WfsrvvlctdII745EW9I0yflqhe7++M5LEc7bV2c/9/5zc8sFcpL0Drw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true, + "license": "MIT" + }, "node_modules/component-props": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/component-props/-/component-props-1.1.1.tgz", @@ -1467,7 +2083,6 @@ "integrity": "sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "mdn-data": "2.27.1", "source-map-js": "^1.2.1" @@ -1521,13 +2136,22 @@ "dev": true, "license": "MIT" }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/diagram-js": { "version": "15.12.0", "resolved": "https://registry.npmjs.org/diagram-js/-/diagram-js-15.12.0.tgz", "integrity": "sha512-BQmdvh4fbnvP/2r6QnEEwbpPwS80OLMTn64UQN4CKfg4u08fQd7aqMVyP1kVF2mElYfK7477sAI4kdVKKR1F+g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@bpmn-io/diagram-js-ui": "^0.2.3", "clsx": "^2.1.1", @@ -1753,6 +2377,16 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/esbuild": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", @@ -1821,7 +2455,6 @@ "integrity": "sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -1986,6 +2619,13 @@ "node": ">=4.0" } }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true, + "license": "MIT" + }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -2148,6 +2788,31 @@ "dev": true, "license": "ISC" }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -2215,6 +2880,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/globalyzer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz", + "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==", + "dev": true, + "license": "MIT" + }, "node_modules/globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", @@ -2243,6 +2915,13 @@ "dev": true, "license": "MIT" }, + "node_modules/globrex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", + "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", + "dev": true, + "license": "MIT" + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2266,6 +2945,19 @@ "node": ">=20" } }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/hookified": { "version": "1.15.1", "resolved": "https://registry.npmjs.org/hookified/-/hookified-1.15.1.tgz", @@ -2347,7 +3039,6 @@ "dev": true, "hasInstallScript": true, "license": "MIT", - "peer": true, "dependencies": { "inferno-shared": "5.6.3", "inferno-vnode-flags": "5.6.3", @@ -2389,6 +3080,22 @@ "dev": true, "license": "MIT" }, + "node_modules/is-core-module": { + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.2.tgz", + "integrity": "sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -2422,6 +3129,13 @@ "node": ">=0.10.0" } }, + "node_modules/is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", + "dev": true, + "license": "MIT" + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -2442,6 +3156,16 @@ "node": ">=0.10.0" } }, + "node_modules/is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*" + } + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -2575,6 +3299,16 @@ "dev": true, "license": "MIT" }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, "node_modules/mathml-tag-names": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz", @@ -2674,7 +3408,6 @@ "integrity": "sha512-dBddc1CNuZHgro8nQWwfPZ2BkyLWdnxoNpPu9d+XKPN96DAiiBOeBw527ft++ebDuFez5PMdaR3pgUgoOaUGrA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "min-dash": "^5.0.0" } @@ -2696,6 +3429,16 @@ "moddle": ">= 6.2.0" } }, + "node_modules/mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -2871,6 +3614,13 @@ "node": ">=8" } }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -2901,6 +3651,16 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pluralize": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/postcss": { "version": "8.5.9", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.9.tgz", @@ -2921,7 +3681,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", @@ -2984,7 +3743,6 @@ "integrity": "sha512-orRsuYpJVw8LdAwqqLykBj9ecS5/cRHlI5+nvTo8LcCKmzDmqVORXtOIYEEQuL9D4BxtA1lm5isAqzQZCoQ6Eg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -3082,6 +3840,28 @@ "node": ">=0.10.0" } }, + "node_modules/resolve": { + "version": "1.22.12", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.12.tgz", + "integrity": "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "is-core-module": "^2.16.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -3103,6 +3883,81 @@ "node": ">=0.10.0" } }, + "node_modules/rollup": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.61.1.tgz", + "integrity": "sha512-I4KW6iuRpuu2uHBLraZ1wNZe0DP7lnRha+VJ9tNaYVaVgKhW0aI3h4RYnoRPeql0flHm/Co55b7snEDcOfOJrA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.9" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.61.1", + "@rollup/rollup-android-arm64": "4.61.1", + "@rollup/rollup-darwin-arm64": "4.61.1", + "@rollup/rollup-darwin-x64": "4.61.1", + "@rollup/rollup-freebsd-arm64": "4.61.1", + "@rollup/rollup-freebsd-x64": "4.61.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.61.1", + "@rollup/rollup-linux-arm-musleabihf": "4.61.1", + "@rollup/rollup-linux-arm64-gnu": "4.61.1", + "@rollup/rollup-linux-arm64-musl": "4.61.1", + "@rollup/rollup-linux-loong64-gnu": "4.61.1", + "@rollup/rollup-linux-loong64-musl": "4.61.1", + "@rollup/rollup-linux-ppc64-gnu": "4.61.1", + "@rollup/rollup-linux-ppc64-musl": "4.61.1", + "@rollup/rollup-linux-riscv64-gnu": "4.61.1", + "@rollup/rollup-linux-riscv64-musl": "4.61.1", + "@rollup/rollup-linux-s390x-gnu": "4.61.1", + "@rollup/rollup-linux-x64-gnu": "4.61.1", + "@rollup/rollup-linux-x64-musl": "4.61.1", + "@rollup/rollup-openbsd-x64": "4.61.1", + "@rollup/rollup-openharmony-arm64": "4.61.1", + "@rollup/rollup-win32-arm64-msvc": "4.61.1", + "@rollup/rollup-win32-ia32-msvc": "4.61.1", + "@rollup/rollup-win32-x64-gnu": "4.61.1", + "@rollup/rollup-win32-x64-msvc": "4.61.1", + "fsevents": "~2.3.2" + } + }, + "node_modules/rollup-plugin-bpmnlint": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-bpmnlint/-/rollup-plugin-bpmnlint-0.4.1.tgz", + "integrity": "sha512-Fcd4G6hNQs7IpvmxLQCdWu5cZRonrGhPv1qFEKjL3Cjy//wmS3uvzUlxTicvTZgM7E3DS2ugQSJikk9vUkp3IA==", + "dev": true, + "license": "MIT", + "dependencies": { + "rollup-pluginutils": "^2.8.2" + }, + "peerDependencies": { + "bpmnlint": "*" + } + }, + "node_modules/rollup-pluginutils": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", + "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "estree-walker": "^0.6.1" + } + }, + "node_modules/rollup-pluginutils/node_modules/estree-walker": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", + "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", + "dev": true, + "license": "MIT" + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -3292,7 +4147,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "@csstools/css-parser-algorithms": "^3.0.5", "@csstools/css-syntax-patches-for-csstree": "^1.0.19", @@ -3515,6 +4369,19 @@ "url": "https://github.com/chalk/supports-hyperlinks?sponsor=1" } }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/svg-tags": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/svg-tags/-/svg-tags-1.0.0.tgz", @@ -3582,6 +4449,17 @@ "dev": true, "license": "MIT" }, + "node_modules/tiny-glob": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz", + "integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==", + "dev": true, + "license": "MIT", + "dependencies": { + "globalyzer": "0.1.0", + "globrex": "^0.1.2" + } + }, "node_modules/tiny-svg": { "version": "4.1.4", "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-4.1.4.tgz", diff --git a/package.json b/package.json index 170cf52..54ac84e 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,9 @@ "devDependencies": { "@eslint/js": "^9.0.0", "bpmn-js": "18.14.0", + "bpmn-js-bpmnlint": "^0.24.0", + "bpmnlint": "^11.12.1", + "bpmnlint-pack-config": "^0.9.0", "dmn-js": "17.7.0", "esbuild": "^0.25.11", "eslint": "^9.0.0", diff --git a/script/bpmnio_render.js b/script/bpmnio_render.js index 2a502de..c87dcfa 100644 --- a/script/bpmnio_render.js +++ b/script/bpmnio_render.js @@ -329,13 +329,69 @@ function computeDmnDiagramSize(viewer, zoom) { }; } +function resolveBpmnLint() { + const lintModule = + window.BpmnLintModule ?? + window.BpmnJS?.lintModule ?? + window.BpmnJS?.Viewer?.lintModule ?? + null; + const lintConfig = + window.BpmnLintConfig ?? + window.BpmnJS?.lintConfig ?? + window.BpmnJS?.Viewer?.lintConfig ?? + null; + + if (lintModule === null || (typeof lintModule !== "object" && typeof lintModule !== "function")) { + return null; + } + + if (!lintConfig?.config || !lintConfig?.resolver) { + return null; + } + + return { lintModule, lintConfig }; +} + +// Reads the per-diagram data-lint attribute and turns it into bpmn-js +// constructor options. Recognised values: +// "off" -> linter not loaded (no toggle button, no overlays) +// "on" -> linter loaded, overlays active immediately +// "inactive" -> linter loaded, toggle button present, overlays hidden +// absent / other -> falls back to defaultActive +// When the linter cannot be resolved the diagram renders exactly as before. +function buildBpmnLintOptions(container, defaultActive) { + const mode = (container?.dataset?.lint ?? "").trim().toLowerCase(); + + if (mode === "off") { + return { additionalModules: [], linting: undefined }; + } + + const resolved = resolveBpmnLint(); + if (!resolved) { + return { additionalModules: [], linting: undefined }; + } + + let active = defaultActive; + if (mode === "on") { + active = true; + } else if (mode === "inactive") { + active = false; + } + + return { + additionalModules: [resolved.lintModule], + linting: { bpmnlint: resolved.lintConfig, active }, + }; +} + async function renderBpmnDiagram(xml, container) { const BpmnViewer = window.BpmnJS?.Viewer; if (typeof BpmnViewer !== "function") { throw new Error("BPMN viewer library is unavailable."); } - const viewer = new BpmnViewer({ container }); + const { additionalModules, linting } = buildBpmnLintOptions(container, false); + const viewer = new BpmnViewer({ container, additionalModules, linting }); const root = jQuery(container).closest(".plugin-bpmnio"); const linkMap = parseLinkMap(root, "bpmn"); @@ -431,7 +487,8 @@ async function renderBpmnEditor(xml, container) { throw new Error("BPMN editor library is unavailable."); } - const editor = new BpmnEditor({ container }); + const { additionalModules, linting } = buildBpmnLintOptions(container, true); + const editor = new BpmnEditor({ container, additionalModules, linting }); addFormSubmitListener(editor, container, "bpmn"); return renderDiagram(xml, container, editor, null, {}, "bpmn"); } diff --git a/syntax/bpmnio.php b/syntax/bpmnio.php index 233d253..0498734 100644 --- a/syntax/bpmnio.php +++ b/syntax/bpmnio.php @@ -22,6 +22,7 @@ class syntax_plugin_bpmnio_bpmnio extends SyntaxPlugin protected string $type = ''; // 'bpmn' or 'dmn' protected string $src = ''; // media file protected string $zoom = ''; // optional scaling factor + protected string $lint = ''; // optional bpmnlint mode: on|off|inactive private function loadLinkProcessor(): void { @@ -68,8 +69,9 @@ public function handle($match, $state, $pos, Doku_Handler $handler): array $this->type = $attrs['type'] ?? 'bpmn'; $this->src = $attrs['src'] ?? ''; $this->zoom = $this->normalizeZoom($attrs['zoom'] ?? null) ?? ''; + $this->lint = $this->normalizeLint($attrs['lint'] ?? null); - return [$state, $this->type, '', $pos, '', false, $this->zoom]; + return [$state, $this->type, '', $pos, '', false, $this->zoom, $this->lint]; case DOKU_LEXER_UNMATCHED: $posStart = $pos; @@ -79,13 +81,17 @@ public function handle($match, $state, $pos, Doku_Handler $handler): array if (!$inline) { $match = $this->getMedia($this->src); } - return [$state, $this->type, base64_encode($match), $posStart, $posEnd, $inline, $this->zoom]; + return [ + $state, $this->type, base64_encode($match), + $posStart, $posEnd, $inline, $this->zoom, $this->lint, + ]; case DOKU_LEXER_EXIT: $this->type = ''; $this->src = ''; $this->zoom = ''; - return [$state, '', '', '', '', '', false, '']; + $this->lint = ''; + return [$state, '', '', '', '', '', '', '']; } return []; } @@ -118,6 +124,17 @@ private function normalizeZoom($zoom): ?string return rtrim(rtrim(number_format($zoom, 4, '.', ''), '0'), '.'); } + private function normalizeLint($lint): string + { + if (!is_string($lint)) { + return ''; + } + + $lint = strtolower(trim($lint)); + + return in_array($lint, ['on', 'off', 'inactive'], true) ? $lint : ''; + } + private function getMedia($src) { global $ID; @@ -137,7 +154,7 @@ private function getMedia($src) public function render($mode, Doku_Renderer $renderer, $data): bool { - [$state, $type, $match, $posStart, $posEnd, $inline, $zoom] = array_pad($data, 7, ''); + [$state, $type, $match, $posStart, $posEnd, $inline, $zoom, $lint] = array_pad($data, 8, ''); if (is_a($renderer, 'renderer_plugin_dw2pdf')) { if ($state == DOKU_LEXER_EXIT) { @@ -187,9 +204,10 @@ public function render($mode, Doku_Renderer $renderer, $data): bool $class = ''; } $zoomAttr = $zoom !== '' ? " data-zoom=\"{$zoom}\"" : ''; + $lintAttr = $lint !== '' ? " data-lint=\"{$lint}\"" : ''; $renderer->doc .= << -
+
HTML; if ($inline) { diff --git a/vendor/bpmn-js-bpmnlint/LICENSE b/vendor/bpmn-js-bpmnlint/LICENSE new file mode 100644 index 0000000..e1c3eab --- /dev/null +++ b/vendor/bpmn-js-bpmnlint/LICENSE @@ -0,0 +1,22 @@ + +The MIT License (MIT) + +Copyright (c) 2018 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/bpmn-js-bpmnlint/README.md b/vendor/bpmn-js-bpmnlint/README.md new file mode 100644 index 0000000..9f63445 --- /dev/null +++ b/vendor/bpmn-js-bpmnlint/README.md @@ -0,0 +1,74 @@ +# bpmn-js-bpmnlint + +[![CI](https://github.com/bpmn-io/bpmn-js-bpmnlint/workflows/CI/badge.svg)](https://github.com/bpmn-io/bpmn-js-bpmnlint/actions?query=workflow%3ACI) + +Integrates [bpmnlint](https://github.com/bpmn-io/bpmnlint) into [bpmn-js](https://github.com/bpmn-io/bpmn-js). + +![Screenshot](docs/screenshot.png) + +See this extension in action as part of the [bpmnlint playground](https://github.com/bpmn-io/bpmnlint-playground). + + +## Usage + +Integrate the linter into [bpmn-js](https://github.com/bpmn-io/bpmn-js): + +```javascript +import lintModule from 'bpmn-js-bpmnlint'; + +import 'bpmn-js-bpmnlint/dist/assets/css/bpmn-js-bpmnlint.css'; + +import BpmnModeler from 'bpmn-js/lib/Modeler'; + +import bpmnlintConfig from './.bpmnlintrc'; + +const modeler = new BpmnModeler({ + linting: { + bpmnlint: bpmnlintConfig + }, + additionalModules: [ + lintModule + ] +}); +``` + + +## Bundle Lint Rules + +Use an appropriate plugin/loader for your module bundler (cf. [rollup-plugin-bpmnlint](https://github.com/nikku/rollup-plugin-bpmnlint), [bpmnlint-loader](https://github.com/nikku/bpmnlint-loader)) to bundle the bpmnlint configuration directly with your application as [shown above](#usage). + +Alternatively, pack your local `.bpmnlintrc` file using the [bpmnlint-pack-config](https://github.com/nikku/bpmnlint-pack-config) utility: + +```shell +bpmnlint-pack-config -c .bpmnlintrc -o bundled-config.js +``` + + +## Plug-in Lint Rules + +Provide the [packed lint rules](#bundle-lint-rules) via the `linting.bpmnlint` option. You may set it dynamically, too: + +```javascript +const linting = modeler.get('linting'); + +linting.setLinterConfig(bpmnlintConfig); +``` + + +## Resources + +* [Issues](https://github.com/bpmn-io/bpmn-js-bpmnlint/issues) +* [Playground Project](https://github.com/bpmn-io/bpmnlint-playground) + + +## Development Setup + +``` +npm install +npm run dev +``` + + +## License + +MIT diff --git a/vendor/bpmn-js-bpmnlint/dist/assets/css/bpmn-js-bpmnlint.less b/vendor/bpmn-js-bpmnlint/dist/assets/css/bpmn-js-bpmnlint.less new file mode 100644 index 0000000..330b6e7 --- /dev/null +++ b/vendor/bpmn-js-bpmnlint/dist/assets/css/bpmn-js-bpmnlint.less @@ -0,0 +1,238 @@ +.djs-parent { + --bjsl-color-info: var(--color-blue-205-100-45); + --bjsl-color-warning: #f7c71a; + --bjsl-color-error: var(--color-red-360-100-40); + --bjsl-color-success: #52b415; + + --bjsl-font-color: var(--color-grey-225-10-15); + --bjsl-font-family: 'Arial', sans-serif; + --bjsl-font-size: 13px; +} + +.bjsl-overlay { + z-index: 500; +} + +.bjsl-overlay * { + box-sizing: border-box; +} + +.bjsl-overlay:hover { + z-index: 1000; +} + +.bjsl-dropdown { + display: none; +} + +.bjsl-overlay:hover .bjsl-dropdown, +.bjsl-dropdown.open { + display: block; +} + +.bjsl-issues { + padding: 8px; + color: var(--bjsl-font-color); + font-family: var(--bjsl-font-family); + font-size: var(--bjsl-font-size); + background: var(--color-grey-225-10-97); + border: solid 1px var(--color-grey-225-10-75); + border-radius: 2px; +} + +.bjsl-icon { + --icon-color: white; + background: var(--icon-bg-color); + color: var(--icon-color); + border-radius: 100%; + height: 20px; + width: 20px; + padding: 5px; + display: flex; + align-items: center; + justify-content: center; +} + +.bjsl-icon svg { + width: 100%; + height: 100%; +} + +.bjsl-icon-error { + --icon-bg-color: var(--bjsl-color-error); +} + +.bjsl-icon-warning { + --icon-bg-color: var(--bjsl-color-warning); +} + +.bjsl-icon-info { + --icon-bg-color: var(--bjsl-color-info); +} + +.bjsl-overlay { + position: relative; +} + +.bjsl-issues-top-right .bjsl-dropdown, +.bjsl-issues-bottom-right .bjsl-dropdown-content { + top: 0; + left: 0; +} + +.bjsl-issues-bottom-right .bjsl-dropdown, +.bjsl-issues-top-right .bjsl-dropdown-content { + bottom: 0; + left: 0; +} + +.bjsl-issues-top-right .bjsl-dropdown-content { + padding-bottom: 5px; +} + +.bjsl-issues-bottom-right .bjsl-dropdown-content { + padding-top: 5px; +} + +.bjsl-dropdown-content { + min-width: 260px; + position: absolute; +} + +.bjsl-dropdown { + position: absolute; +} + +.bjsl-issues { + list-style: none; + margin: 0; +} + +.bjsl-issues ul { + list-style: none; + margin: 0; + padding: 0; +} + +.bjsl-issues li { + display: flex; + flex-direction: row; + white-space: nowrap; +} + +.bjsl-issues .icon { + width: 1em; + height: 1em; + margin-top: 1px; +} + +.bjsl-issues li + li { + margin-top: .5rem; +} + +.bjsl-issues .icon { + --icon-color: var(--bjsl-font-color); + + color: var(--icon-color); +} + +.bjsl-issues .error .icon { + --icon-color: var(--bjsl-color-error); +} + +.bjsl-issues .warning .icon { + --icon-color: var(--bjsl-color-warning); +} + +.bjsl-issues .info .icon { + --icon-color: var(--bjsl-color-info); +} + +.bjsl-issues .message { + color: var(--bjsl-font-color); + margin-left: .5em; + text-decoration: none; +} + +.bjsl-issues .rule { + color: var(--bjsl-font-color); + margin-left: .5em; + font-family: monospace; +} + +.bjsl-issues .bjsl-issue-heading { + margin-left: 0px; + font-weight: bold; + margin-bottom: 100px; +} + +.bjsl-child-issues hr { + display: block; + height: 1px; + border: 0; + border-top: 1px solid #ccc; +} + +.bjsl-child-issues ul { + margin-top: 7px; +} + +.bjsl-issues a:hover { + text-decoration: none; +} + +.bjsl-id-hint { + background-color: #bdbdbd; + padding: 1px; + padding-left: 5px; + padding-right: 5px; + font-weight: bold; + border-radius: 20px; +} + + +/** + * Summary button styles + */ + +.bjsl-button { + border-radius: 100px; + position: absolute; + bottom: 20px; + left: 50%; + transform: translate(-50%); + background-color: #fafafa; + padding: 5px 10px; + border: none; + color: #ddd; + display: flex; + outline: none; + font-weight: bold; + font-size: var(--bjsl-font-size); +} + +.bjsl-button-inactive:hover { + color: #444; +} + +.bjsl-button .icon { + margin-right: 10px; + margin-top: 1px; + width: .9em; + height: .9em; +} + +.bjsl-button-success { + background-color: var(--bjsl-color-success); + color: white; +} + +.bjsl-button-error { + background-color: var(--bjsl-color-error); + color: white; +} + +.bjsl-button-warning { + background-color: var(--bjsl-color-warning); + color: white; +} \ No newline at end of file diff --git a/vendor/bpmn-js-bpmnlint/package.json b/vendor/bpmn-js-bpmnlint/package.json new file mode 100644 index 0000000..a6137f3 --- /dev/null +++ b/vendor/bpmn-js-bpmnlint/package.json @@ -0,0 +1,80 @@ +{ + "name": "bpmn-js-bpmnlint", + "version": "0.24.0", + "description": "bpmn-js integration for bpmnlint", + "main": "dist/index.js", + "module": "dist/index.esm.js", + "source": "lib/index.js", + "umd:main": "dist/bpmn-js-bpmnlint.umd.js", + "scripts": { + "all": "run-s lint test distro", + "lint": "eslint .", + "start": "cross-env SINGLE_START=true npm run dev", + "test": "karma start --no-auto-test --single-run", + "dev": "karma start", + "distro": "run-s build test:build copy-assets", + "build": "NODE_ENV=production rollup -c --bundleConfigAsCjs", + "build:watch": "npm run build -- -w", + "test:build": "karma start test/distro/karma.conf.js", + "copy-assets": "cpx assets/css/* dist/assets/css/ -v", + "prepublishOnly": "run-s distro" + }, + "exports": { + ".": { + "require": "./dist/index.js", + "import": "./dist/index.esm.js" + }, + "./package.json": "./package.json", + "./dist/*": "./dist/*" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/bpmn-io/bpmn-js-bpmnlint.git" + }, + "author": "Philipp Fromme ", + "contributors": [ + { + "name": "Nico Rehwaldt", + "url": "https://github.com/nikku" + } + ], + "license": "MIT", + "devDependencies": { + "bpmn-js": "^18.11.0", + "bpmnlint": "^11.8.0", + "bpmnlint-loader": "^0.1.6", + "chai": "^6.0.0", + "cpx2": "^8.0.0", + "cross-env": "^10.1.0", + "diagram-js": "^15.7.0", + "eslint": "^9.39.2", + "eslint-plugin-bpmn-io": "^2.2.0", + "karma": "^6.4.4", + "karma-chrome-launcher-2": "^3.3.0", + "karma-debug-launcher": "^0.0.5", + "karma-env-preprocessor": "^0.1.1", + "karma-mocha": "^2.0.1", + "karma-webpack": "^5.0.1", + "mocha": "^11.0.0", + "mocha-test-container-support": "^0.2.0", + "npm-run-all2": "^8.0.4", + "puppeteer": "^24.34.0", + "rollup": "^4.54.0", + "rollup-plugin-string": "^3.0.0", + "sinon": "^21.0.0", + "sinon-chai": "^4.0.0", + "webpack": "^5.104.1" + }, + "dependencies": { + "min-dash": "^5.0.0", + "min-dom": "^5.2.0" + }, + "peerDependencies": { + "bpmn-js": "*", + "bpmnlint": ">= 3.2", + "diagram-js": "*" + }, + "files": [ + "dist" + ] +} diff --git a/vendor/bpmn-js/dist/bpmn-modeler.production.min.js b/vendor/bpmn-js/dist/bpmn-modeler.production.min.js index 6eb841d..a905914 100644 --- a/vendor/bpmn-js/dist/bpmn-modeler.production.min.js +++ b/vendor/bpmn-js/dist/bpmn-modeler.production.min.js @@ -1,45 +1,45 @@ /*! bpmn-js - 18.14.0 | generated for dokuwiki-plugin-bpmnio | SEE LICENSE IN LICENSE */ -(()=>{function N(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function Nx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yu={exports:{}},Zf;function Bx(){if(Zf)return Yu.exports;Zf=1;var e=Yu.exports=function(t,n){if(n||(n=16),t===void 0&&(t=128),t<=0)return"0";for(var r=Math.log(Math.pow(2,t))/Math.log(n),i=2;r===1/0;i*=2)r=Math.log(Math.pow(2,t/i))/Math.log(n)*i;for(var o=r-Math.floor(r),a="",i=0;i=Math.pow(2,t)?e(t,n):a};return e.rack=function(t,n,r){var i=function(a){var s=0;do{if(s++>10)if(r)t+=r;else throw new Error("too many ID collisions, use more bits");var c=e(t,n)}while(Object.hasOwnProperty.call(o,c));return o[c]=a,c},o=i.hats={};return i.get=function(a){return i.hats[a]},i.set=function(a,s){return i.hats[a]=s,i},i.bits=t||128,i.base=n||16,i},Yu.exports}var Ix=Bx(),Lx=Nx(Ix);function dn(e){if(!(this instanceof dn))return new dn(e);e=e||[128,36,1],this._seed=e.length?Lx.rack(e[0],e[1],e[2]):e}dn.prototype.next=function(e){return this._seed(e||!0)};dn.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n};dn.prototype.claim=function(e,t){this._seed.set(e,t||!0)};dn.prototype.assigned=function(e){return this._seed.get(e)||!1};dn.prototype.unclaim=function(e){delete this._seed.hats[e]};dn.prototype.clear=function(){var e=this._seed.hats,t;for(t in e)this.unclaim(t)};function Ui(e){return Array.prototype.concat.apply([],e)}var ca=Object.prototype.toString,jx=Object.prototype.hasOwnProperty;function Ln(e){return e===void 0}function Ge(e){return e!==void 0}function Rr(e){return e==null}function U(e){return ca.call(e)==="[object Array]"}function Ce(e){return ca.call(e)==="[object Object]"}function ee(e){return ca.call(e)==="[object Number]"}function Ne(e){let t=ca.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function et(e){return ca.call(e)==="[object String]"}function Fx(e){if(!U(e))throw new Error("must supply array")}function tt(e,t){return!Rr(e)&&jx.call(e,t)}function ne(e,t){let n=Ys(t),r;return E(e,function(i,o){if(n(i,o))return r=i,!1}),r}function Ks(e,t){let n=Ys(t),r=U(e)?-1:void 0;return E(e,function(i,o){if(n(i,o))return r=o,!1}),r}function J(e,t){let n=Ys(t),r=[];return E(e,function(i,o){n(i,o)&&r.push(i)}),r}function E(e,t){let n,r;if(Ln(e))return;let i=U(e)?$x:Hx;for(let o in e)if(tt(e,o)&&(n=e[o],r=t(n,i(o)),r===!1))return n}function Qf(e,t){if(Ln(e))return[];Fx(e);let n=Ys(t);return e.filter(function(r,i){return!n(r,i)})}function Ke(e,t,n){return E(e,function(r,i){n=t(n,r,i)}),n}function hn(e,t){return!!Ke(e,function(n,r,i){return n&&t(r,i)},!0)}function Nt(e,t){return!!ne(e,t)}function He(e,t){let n=[];return E(e,function(r,i){n.push(t(r,i))}),n}function Ki(e){return e&&Object.keys(e)||[]}function Jf(e){return Ki(e).length}function Pr(e){return He(e,t=>t)}function wn(e,t,n={}){return t=Xu(t),E(e,function(r){let i=t(r)||"_",o=n[i];o||(o=n[i]=[]),o.push(r)}),n}function qu(e,...t){e=Xu(e);let n={};return E(t,i=>wn(i,e,n)),He(n,function(i,o){return i[0]})}var ed=qu;function St(e,t){t=Xu(t);let n=[];return E(e,function(r,i){let o=t(r,i),a={d:o,v:r};for(var s=0;sr.v)}function yt(e){return function(t){return hn(e,function(n,r){return t[r]===n})}}function Xu(e){return Ne(e)?e:t=>t[e]}function Ys(e){return Ne(e)?e:t=>t===e}function Hx(e){return e}function $x(e){return Number(e)}function qs(e,t){let n,r,i,o;function a(l){let f=Date.now(),d=l?0:o+t-f;if(d>0)return s(d);e.apply(i,r),c()}function s(l){n=setTimeout(a,l)}function c(){n&&clearTimeout(n),n=o=r=i=void 0}function p(){n&&a(!0),c()}function u(...l){o=Date.now(),r=l,i=this,n||s(t)}return u.flush=p,u.cancel=c,u}function Je(e,t){return e.bind(t)}function C(e,...t){return Object.assign(e,...t)}function td(e,t,n){let r=e;return E(t,function(i,o){if(typeof i!="number"&&typeof i!="string")throw new Error("illegal key type: "+typeof i+". Key should be of type number or string.");if(i==="constructor")throw new Error("illegal key: constructor");if(i==="__proto__")throw new Error("illegal key: __proto__");let a=t[o+1],s=r[i];Ge(a)&&Rr(s)&&(s=r[i]=isNaN(+a)?{}:[]),Ln(a)?Ln(n)?delete r[i]:r[i]=n:r=s}),e}function pt(e,t){let n={},r=Object(e);return E(t,function(i){i in r&&(n[i]=e[i])}),n}function At(e,t){let n={},r=Object(e);return E(r,function(i,o){t.indexOf(o)===-1&&(n[o]=i)}),n}var ot={legend:[1,"
","
"],tr:[2,"","
"],col:[2,"","
"],_default:[0,"",""]};ot.td=ot.th=[3,"","
"];ot.option=ot.optgroup=[1,'"];ot.thead=ot.tbody=ot.colgroup=ot.caption=ot.tfoot=[1,"","
"];ot.polyline=ot.ellipse=ot.polygon=ot.circle=ot.text=ot.line=ot.path=ot.rect=ot.g=[1,'',""];function ye(e,t=globalThis.document){var p;if(typeof e!="string")throw new TypeError("String expected");let n=/^$/s.exec(e);if(n)return t.createComment(n[1]);let r=(p=/<([\w:]+)/.exec(e))==null?void 0:p[1];if(!r)return t.createTextNode(e);if(e=e.trim(),r==="body"){let u=t.createElement("html");u.innerHTML=e;let{lastChild:l}=u;return l.remove(),l}let[i,o,a]=Object.hasOwn(ot,r)?ot[r]:ot._default,s=t.createElement("div");for(s.innerHTML=o+e+a;i--;)s=s.lastChild;if(s.firstChild===s.lastChild){let{firstChild:u}=s;return u.remove(),u}let c=t.createDocumentFragment();return c.append(...s.childNodes),c}function zx(e,t){return t.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(r){if(r!=="default"&&!(r in e)){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}})}),Object.freeze(e)}function at(e,...t){let n=e.style;return E(t,function(r){r&&E(r,function(i,o){n[o]=i})}),e}function Ye(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}var Vx=Object.prototype.toString;function Ae(e){return new Ar(e)}function Ar(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Ar.prototype.add=function(e){return this.list.add(e),this};Ar.prototype.remove=function(e){return Vx.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)};Ar.prototype.removeMatching=function(e){let t=this.array();for(let n=0;n"+e+"",t=!0);var n=Jx(e);if(!t)return n;for(var r=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)r.appendChild(i.firstChild);return r}function Jx(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function G(e,t){var n;return e=e.trim(),e.charAt(0)==="<"?(n=ld(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(nl.svg,e),t&&$(n,t),n}var Zu=null;function el(){return Zu===null&&(Zu=G("svg")),Zu}function ad(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)e[r]=t[r];return e}function fd(e,t,n,r,i,o){var a=el().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return ad(a,e);case 6:return ad(a,{a:e,b:t,c:n,d:r,e:i,f:o})}}function Yi(e){return e?el().createSVGTransformFromMatrix(e):el().createSVGTransform()}var sd=/([&<>]{1})/g,eb=/([&<>\n\r"]{1})/g,tb={"&":"&","<":"<",">":">",'"':"'"};function Qu(e,t){function n(r,i){return tb[i]||i}return e.replace(t,n)}function dd(e,t){var n,r,i,o,a;switch(e.nodeType){case 3:t.push(Qu(e.textContent,sd));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(i=e.attributes,n=0,r=i.length;n"),a=e.childNodes,n=0,r=a.length;n")}else t.push("/>");break;case 8:t.push("");break;case 4:t.push("");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function nb(e,t){var n=ld(t);if(or(e),!!t){ib(n)||(n=n.documentElement);for(var r=ob(n.childNodes),i=0;i{let i=r.match(fb);return(i&&i[1]||r).trim()})||[]}function al(e,t){let n=t||{get:function(b,x){if(r.push(b),x===!1)return null;throw s(`No provider for "${b}"!`)}},r=[],i=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),a=o.injector=this,s=function(b){let x=r.join(" -> ");return r.length=0,new Error(x?`${b} (Resolving: ${x})`:b)};function c(b,x){if(!i[b]&&b.includes(".")){let S=b.split("."),A=c(S.shift());for(;S.length;)A=A[S.shift()];return A}if(il(o,b))return o[b];if(il(i,b)){if(r.indexOf(b)!==-1)throw r.push(b),s("Cannot resolve circular dependency!");return r.push(b),o[b]=i[b][0](i[b][1]),r.pop(),o[b]}return n.get(b,x)}function p(b,x){if(typeof x=="undefined"&&(x={}),typeof b!="function")if(ol(b))b=Qs(b.slice());else throw s(`Cannot invoke "${b}". Expected a function!`);let A=(b.$inject||db(b)).map(O=>il(x,O)?x[O]:c(O));return{fn:b,dependencies:A}}function u(b){let{fn:x,dependencies:S}=p(b),A=Function.prototype.bind.call(x,null,...S);return new A}function l(b,x,S){let{fn:A,dependencies:O}=p(b,S);return A.apply(x,O)}function f(b){return Qs(x=>b.get(x))}function d(b,x){if(x&&x.length){let S=Object.create(null),A=Object.create(null),O=[],M=[],B=[],I,H,z,K;for(let ce in i)I=i[ce],x.indexOf(ce)!==-1&&(I[2]==="private"?(H=O.indexOf(I[3]),H===-1?(z=I[3].createChild([],x),K=f(z),O.push(I[3]),M.push(z),B.push(K),S[ce]=[K,ce,"private",z]):S[ce]=[B[H],ce,"private",M[H]]):S[ce]=[I[2],I[1]],A[ce]=!0),(I[2]==="factory"||I[2]==="type")&&I[1].$scope&&x.forEach(ln=>{I[1].$scope.indexOf(ln)!==-1&&(S[ce]=[I[2],I[1]],A[ln]=!0)});x.forEach(ce=>{if(!A[ce])throw new Error('No provider for "'+ce+'". Cannot use provider from the parent!')}),b.unshift(S)}return new al(b,a)}let h={factory:l,type:u,value:function(b){return b}};function _(b,x){let S=b.__init__||[];return function(){S.forEach(A=>{typeof A=="string"?x.get(A):x.invoke(A)})}}function v(b){let x=b.__exports__;if(x){let S=b.__modules__,A=Object.keys(b).reduce((H,z)=>(z!=="__exports__"&&z!=="__modules__"&&z!=="__init__"&&z!=="__depends__"&&(H[z]=b[z]),H),Object.create(null)),O=(S||[]).concat(A),M=d(O),B=Qs(function(H){return M.get(H)});x.forEach(function(H){i[H]=[B,H,"private",M]});let I=(b.__init__||[]).slice();return I.unshift(function(){M.init()}),b=Object.assign({},b,{__init__:I}),_(b,M)}return Object.keys(b).forEach(function(S){if(S==="__init__"||S==="__depends__")return;let A=b[S];if(A[2]==="private"){i[S]=A;return}let O=A[0],M=A[1];i[S]=[h[O],hb(O,M),O]}),_(b,a)}function w(b,x){return b.indexOf(x)!==-1||(b=(x.__depends__||[]).reduce(w,b),b.indexOf(x)!==-1)?b:b.concat(x)}function P(b){let x=b.reduce(w,[]).map(v),S=!1;return function(){S||(S=!0,x.forEach(A=>A()))}}this.get=c,this.invoke=l,this.instantiate=u,this.createChild=d,this.init=P(e)}function hb(e,t){return e!=="value"&&ol(t)&&(t=Qs(t.slice())),t}var mb=1e3;function mn(e,t){var n=this;t=t||mb,e.on(["render.shape","render.connection"],t,function(r,i){var o=r.type,a=i.element,s=i.gfx,c=i.attrs;if(n.canRender(a))return o==="render.shape"?n.drawShape(s,a,c):n.drawConnection(s,a,c)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(r,i){if(n.canRender(i))return r.type==="render.getShapePath"?n.getShapePath(i):n.getConnectionPath(i)})}mn.prototype.canRender=function(e){};mn.prototype.drawShape=function(e,t){};mn.prototype.drawConnection=function(e,t){};mn.prototype.getShapePath=function(e){};mn.prototype.getConnectionPath=function(e){};function ar(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function gb(e){return["M",e.x,e.y]}function sl(e){return["L",e.x,e.y]}function vb(e,t,n){return["C",e.x,e.y,t.x,t.y,n.x,n.y]}function yb(e,t){let n=e.length,r=[gb(e[0])];for(let i=1;ii||i===void 0)&&(i=c+l),(p+u>o||o===void 0)&&(o=p+u)}),{x:n,y:r,height:o-r,width:i-n}}function ec(e,t){var n={};return E(e,function(r){var i=r;i.waypoints&&(i=Ee(i)),!ee(t.y)&&i.x>t.x&&(n[r.id]=r),!ee(t.x)&&i.y>t.y&&(n[r.id]=r),i.x>t.x&&i.y>t.y&&(ee(t.width)&&ee(t.height)&&i.width+i.xt.x-n&&e.y>t.y-n&&e.x=1e3&&delete i[o.shift()],o.push(r),i[r]=e(...arguments),i[r])}return t}function Ab(e){if(!e)return null;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},n=[];return String(e).replace(wb,function(r,i,o){var a=[],s=i.toLowerCase();for(o.replace(Sb,function(c,p){p&&a.push(+p)}),s=="m"&&a.length>2&&(n.push([i,...a.splice(0,2)]),s="l",i=i=="m"?"l":"L");a.length>=t[s]&&(n.push([i,...a.splice(0,t[s])]),!!t[s]););}),n.toString=fl,n}function Tb(e){for(var t=0,n=e.length;t=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function kb(e,t){return e=ll(e),t=ll(t),Nr(t,e.x,e.y)||Nr(t,e.x2,e.y)||Nr(t,e.x,e.y2)||Nr(t,e.x2,e.y2)||Nr(e,t.x,t.y)||Nr(e,t.x2,t.y)||Nr(e,t.x,t.y2)||Nr(e,t.x2,t.y2)||(e.xt.x||t.xe.x)&&(e.yt.y||t.ye.y)}function wd(e,t,n,r,i){var o=-3*t+9*n-9*r+3*i,a=e*o+6*t-12*n+6*r;return e*a-3*t+3*n}function Sd(e,t,n,r,i,o,a,s,c){c==null&&(c=1),c=c>1?1:c<0?0:c;for(var p=c/2,u=12,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,h=0;hzn(i,a)||zn(t,r)<$n(o,s)||$n(t,r)>zn(o,s))){var c=(e*r-t*n)*(i-a)-(e-n)*(i*s-o*a),p=(e*r-t*n)*(o-s)-(t-r)*(i*s-o*a),u=(e-n)*(o-s)-(t-r)*(i-a);if(u){var l=ic(c/u),f=ic(p/u),d=+l.toFixed(2),h=+f.toFixed(2);if(!(d<+$n(e,n).toFixed(2)||d>+zn(e,n).toFixed(2)||d<+$n(i,a).toFixed(2)||d>+zn(i,a).toFixed(2)||h<+$n(t,r).toFixed(2)||h>+zn(t,r).toFixed(2)||h<+$n(o,s).toFixed(2)||h>+zn(o,s).toFixed(2)))return{x:l,y:f}}}}function ic(e){return Math.round(e*1e11)/1e11}function Nb(e,t,n){var r=Ed(e),i=Ed(t);if(!kb(r,i))return n?0:[];var o=Sd(...e),a=Sd(...t),s=Cd(e)?1:~~(o/5)||1,c=Cd(t)?1:~~(a/5)||1,p=new Array(s+1),u=new Array(c+1),l={},f=n?0:[],d,h;for(d=0;d=0&&M<=1&&B>=0&&B<=1&&(n?f++:f.push({x:A.x,y:A.y,t1:M,t2:B}))}}return f}function da(e,t,n){e=Pd(e),t=Pd(t);for(var r,i,o,a,s,c,p,u,l,f,d=n?0:[],h=0,_=e.length;h<_;h++){var v=e[h];if(v[0]=="M")r=s=v[1],i=c=v[2];else{v[0]=="C"?(l=[r,i,...v.slice(1)],r=l[6],i=l[7]):(l=[r,i,r,i,s,c,s,c],r=s,i=c);for(var w=0,P=t.length;w1&&(w=nt.sqrt(w),n=w*n,r=w*r);var P=n*n,b=r*r,x=(o==a?-1:1)*nt.sqrt(Br((P*b-P*v*v-b*_*_)/(P*v*v+b*_*_))),S=x*n*v/r+(e+s)/2,A=x*-r*_/n+(t+c)/2,O=nt.asin(((t-A)/r).toFixed(9)),M=nt.asin(((c-A)/r).toFixed(9));O=eM&&(O=O-Or*2),!a&&M>O&&(M=M-Or*2)}var B=M-O;if(Br(B)>u){var I=M,H=s,z=c;M=O+u*(a&&M>O?1:-1),s=S+n*nt.cos(M),c=A+r*nt.sin(M),f=Ad(s,c,n,r,i,0,a,H,z,[M,I,S,A])}B=M-O;var K=nt.cos(O),ce=nt.sin(O),ln=nt.cos(M),De=nt.sin(M),ge=nt.tan(B/4),Vt=4/3*n*ge,Wt=4/3*r*ge,We=[e,t],ht=[e+Vt*ce,t-Wt*K],F=[s+Vt*De,c-Wt*ln],V=[s,c];if(ht[0]=2*We[0]-ht[0],ht[1]=2*We[1]-ht[1],p)return[ht,F,V].concat(f);f=[ht,F,V].concat(f).join().split(",");for(var re=[],_e=0,Ot=f.length;_e7){f[d].shift();for(var h=f[d];h.length;)o[d]="A",f.splice(d++,0,["C",...h.splice(0,6)]);f.splice(d,1),p=t.length}},o=[],a="",s="",c=0,p=t.length;c=i.right,s=r.top-n.y>=i.bottom,c=r.right+n.x<=i.left,p=o?"top":s?"bottom":null,u=c?"left":a?"right":null;return u&&p?p+"-"+u:u||p||"intersect"}function Ir(e,t,n){var r=Hb(e,t);return r.length===1||r.length===2&&kr(r[0],r[1])<1?gn(r[0]):r.length>1?(r=St(r,function(i){var o=Math.floor(i.t2*100)||1;return o=100-o,o=(o<10?"0":"")+o,i.segment2+"#"+o}),gn(r[n?0:r.length-1])):null}function Hb(e,t){return da(e,t)}function Td(e){e=e.slice();for(var t=0,n,r,i;e[t];)n=e[t],r=e[t-1],i=e[t+1],kr(n,i)===0||Xi(r,i,n)?e.splice(t,1):t++;return e}function $b(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ac(e,t){return Math.round(e*t)/t}function Md(e){return ee(e)?e+"px":e}function zb(e){for(;e.parent;)e=e.parent;return e}function Vb(e){e=C({},{width:"100%",height:"100%"},e);let t=e.container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),at(n,{position:"relative",overflow:"hidden",width:Md(e.width),height:Md(e.height)}),t.appendChild(n),n}function Dd(e,t,n){let r=G("g");ue(r).add(t);let i=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(r,e.childNodes[i]||null),r}var Wb="base",kd=0,Gb=1,Ub={shape:["x","y","width","height"],connection:["waypoints"]};function pe(e,t,n,r){this._eventBus=t,this._elementRegistry=r,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}pe.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"];pe.prototype._init=function(e){let t=this._eventBus,n=this._container=Vb(e),r=this._svg=G("svg");$(r,{width:"100%",height:"100%"}),Ye(r,"tabindex",0),e.autoFocus&&t.on("element.hover",()=>{this.restoreFocus()}),t.on("element.mousedown",500,o=>{this.focus()}),r.addEventListener("focusin",()=>{this._setFocused(!0)}),r.addEventListener("focusout",()=>{this._setFocused(!1)}),r.addEventListener("mouseover",()=>{this._eventBus.fire("canvas.mouseover")}),r.addEventListener("mouseout",()=>{this._eventBus.fire("canvas.mouseout")}),Z(n,r);let i=this._viewport=Dd(r,"viewport");e.deferUpdate&&(this._viewboxChanged=qs(Je(this._viewboxChanged,this),300)),t.on("diagram.init",()=>{t.fire("canvas.init",{svg:r,viewport:i})}),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)};pe.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});let e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport};pe.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))};pe.prototype._clear=function(){this._elementRegistry.getAll().forEach(t=>{let n=tc(t);n==="root"?this.removeRootElement(t):this._removeElement(t,n)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox};pe.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)};pe.prototype.restoreFocus=function(){document.activeElement===document.body&&this.focus()};pe.prototype.isFocused=function(){return this._focused};pe.prototype.getDefaultLayer=function(){return this.getLayer(Wb,kd)};pe.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),typeof t!="undefined"&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group};pe.prototype._getChildIndex=function(e){return Ke(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)};pe.prototype._createLayer=function(e,t){typeof t=="undefined"&&(t=Gb);let n=this._getChildIndex(t);return{group:Dd(this._viewport,"layer-"+e,n),index:t,visible:!0}};pe.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");let t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");let n=this._viewport,r=t.group,i=t.index;if(t.visible)return r;let o=this._getChildIndex(i);return n.insertBefore(r,n.childNodes[o]||null),t.visible=!0,r};pe.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");let t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");let n=t.group;return t.visible&&(be(n),t.visible=!1),n};pe.prototype._removeLayer=function(e){let t=this._layers[e];t&&(delete this._layers[e],be(t.group))};pe.prototype.getActiveLayer=function(){let e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null};pe.prototype.findRoot=function(e){return typeof e=="string"&&(e=this._elementRegistry.get(e)),e?(this._findPlaneForRoot(zb(e))||{}).rootElement:void 0};pe.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})};pe.prototype._findPlaneForRoot=function(e){return ne(this._planes,function(t){return t.rootElement===e})};pe.prototype.getContainer=function(){return this._container};pe.prototype._updateMarker=function(e,t,n){let r;e.id||(e=this._elementRegistry.get(e)),e.markers=e.markers||new Set,r=this._elementRegistry._elements[e.id],r&&(E([r.gfx,r.secondaryGfx],function(i){i&&(n?(e.markers.add(t),ue(i).add(t)):(e.markers.delete(t),ue(i).remove(t)))}),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))};pe.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)};pe.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)};pe.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),e.markers?e.markers.has(t):!1};pe.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)};pe.prototype.getRootElement=function(){let e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))};pe.prototype.addRootElement=function(e){let t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});let n=e.layer="root-"+t;this._ensureValid("root",e);let r=this.getLayer(n,kd);return this.hideLayer(n),this._addRoot(e,r),this._planes.push({rootElement:e,layer:r}),e};pe.prototype.removeRootElement=function(e){if(typeof e=="string"&&(e=this._elementRegistry.get(e)),!!this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter(function(n){return n.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e};pe.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e};pe.prototype._removeRoot=function(e){let t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)};pe.prototype._addRoot=function(e,t){let n=this._elementRegistry,r=this._eventBus;r.fire("root.add",{element:e}),n.add(e,t),r.fire("root.added",{element:e,gfx:t})};pe.prototype._setRoot=function(e,t){let n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})};pe.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");let n=Ub[e];if(!hn(n,function(i){return typeof t[i]!="undefined"}))throw new Error("must supply { "+n.join(", ")+" } with "+e)};pe.prototype._setParent=function(e,t,n){we(t.children,e,n),e.parent=t};pe.prototype._addElement=function(e,t,n,r){n=n||this.getRootElement();let i=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),i.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,r);let a=o.create(e,t,r);return this._elementRegistry.add(t,a),o.update(e,t,a),i.fire(e+".added",{element:t,gfx:a}),t};pe.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)};pe.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)};pe.prototype._removeElement=function(e,t){let n=this._elementRegistry,r=this._graphicsFactory,i=this._eventBus;if(e=n.get(e.id||e),!!e)return i.fire(t+".remove",{element:e}),r.remove(e),Te(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+".removed",{element:e}),n.remove(e),e};pe.prototype.removeShape=function(e){return this._removeElement(e,"shape")};pe.prototype.removeConnection=function(e){return this._removeElement(e,"connection")};pe.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)};pe.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()};pe.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})};pe.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);let t=this._viewport,n=this.getSize(),r,i,o,a,s,c,p;if(e)this._changeViewbox(function(){s=Math.min(n.width/e.width,n.height/e.height);let u=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);pi(t,u)});else return o=this._rootElement?this.getActiveLayer():null,r=o&&o.getBBox()||{},a=pi(t),i=a?a.matrix:fd(),s=ac(i.a,1e3),c=ac(-i.e||0,1e3),p=ac(-i.f||0,1e3),e=this._cachedViewbox={x:c?c/s:0,y:p?p/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:r.width||0,height:r.height||0,x:r.x||0,y:r.y||0},outer:n},e;return e};pe.prototype.scroll=function(e){let t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=C({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Od(t,n)}),{x:n.e,y:n.f}};pe.prototype.scrollToElement=function(e,t){let n=100;typeof e=="string"&&(e=this._elementRegistry.get(e));let r=this.findRoot(e);if(r!==this.getRootElement()&&this.setRootElement(r),r===e)return;t||(t={}),typeof t=="number"&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};let i=Ee(e),o=X(i),a=this.viewbox(),s=this.zoom(),c,p;a.y+=t.top/s,a.x+=t.left/s,a.width-=(t.right+t.left)/s,a.height-=(t.bottom+t.top)/s;let u=X(a);if(!(i.width=0&&r.y>=0&&r.x+r.width<=n.width&&r.y+r.height<=n.height&&!e?o={x:0,y:0,width:Math.max(r.width+r.x,n.width),height:Math.max(r.height+r.y,n.height)}:(i=Math.min(1,n.width/r.width,n.height/r.height),o={x:r.x+(e?r.width/2-n.width/i/2:0),y:r.y+(e?r.height/2-n.height/i/2:0),width:n.width/i,height:n.height/i}),this.viewbox(o),this.viewbox(!1).scale};pe.prototype._setZoom=function(e,t){let n=this._svg,r=this._viewport,i=n.createSVGMatrix(),o=n.createSVGPoint(),a,s,c,p,u;c=r.getCTM();let l=c.a;return t?(a=C(o,t),s=a.matrixTransform(c.inverse()),p=i.translate(s.x,s.y).scale(1/l*e).translate(-s.x,-s.y),u=c.multiply(p)):u=i.scale(e),Od(this._viewport,u),u};pe.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}};pe.prototype.getAbsoluteBBox=function(e){let t=this.viewbox(),n;e.waypoints?n=this.getGraphics(e).getBBox():n=e;let r=n.x*t.scale-t.x*t.scale,i=n.y*t.scale-t.y*t.scale,o=n.width*t.scale,a=n.height*t.scale;return{x:r,y:i,width:o,height:a}};pe.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Zi="data-element-id";function It(e){this._elements={},this._eventBus=e}It.$inject=["eventBus"];It.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),$(t,Zi,r),n&&$(n,Zi,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}};It.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&($(r.gfx,Zi,""),r.secondaryGfx&&$(r.secondaryGfx,Zi,""),delete t[n])};It.prototype.updateId=function(e,t){this._validateId(t),typeof e=="string"&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),r=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,r)};It.prototype.updateGraphics=function(e,t,n){var r=e.id||e,i=this._elements[r];return n?i.secondaryGfx=t:i.gfx=t,t&&$(t,Zi,r),t};It.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&$(e,Zi);var n=this._elements[t];return n&&n.element};It.prototype.filter=function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(n)}),t};It.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),r=0;r in ref");t=this.props[t]}t.collection?Nd(this,t,e):Xb(this,t,e)};en.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Yb(n)||Nd(this,t,e),n};en.prototype.ensureBound=function(e,t){qb(e,t)||this.bind(e,t)};en.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)};en.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var dl=new en({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Id=new en({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Bd=new en({name:"attachers",collection:!0},{name:"host"}),Ld=new en({name:"outgoing",collection:!0},{name:"source"}),jd=new en({name:"incoming",collection:!0},{name:"target"});function Qi(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),dl.bind(this,"parent"),Id.bind(this,"labels"),Ld.bind(this,"outgoing"),jd.bind(this,"incoming")}function ha(){Qi.call(this),dl.bind(this,"children"),Bd.bind(this,"host"),Bd.bind(this,"attachers")}N(ha,Qi);function Fd(){Qi.call(this),dl.bind(this,"children")}N(Fd,ha);function Hd(){ha.call(this),Id.bind(this,"labelTarget")}N(Hd,ha);function $d(){Qi.call(this),Ld.bind(this,"source"),jd.bind(this,"target")}N($d,Qi);var Zb={connection:$d,shape:ha,label:Hd,root:Fd};function zd(e,t){var n=Zb[e];if(!n)throw new Error("unknown type: <"+e+">");return C(new n,t)}function Vd(e){return e instanceof Qi}function vn(){this._uid=12}vn.prototype.createRoot=function(e){return this.create("root",e)};vn.prototype.createLabel=function(e){return this.create("label",e)};vn.prototype.createShape=function(e){return this.create("shape",e)};vn.prototype.createConnection=function(e){return this.create("connection",e)};vn.prototype.create=function(e,t){return t=C({},t||{}),t.id||(t.id=e+"_"+this._uid++),zd(e,t)};var sc="__fn",Wd=1e3,Qb=Array.prototype.slice;function Tt(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}Tt.prototype.on=function(e,t,n,r){if(e=U(e)?e:[e],Ne(t)&&(r=n,n=t,t=Wd),!ee(t))throw new Error("priority must be a number");var i=n;r&&(i=Je(n,r),i[sc]=n[sc]||n);var o=this;e.forEach(function(a){o._addListener(a,{priority:t,callback:i,next:null})})};Tt.prototype.once=function(e,t,n,r){var i=this;if(Ne(t)&&(r=n,n=t,t=Wd),!ee(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var a=n.apply(r,arguments);return i.off(e,o),a}o[sc]=n,this.on(e,t,o)};Tt.prototype.off=function(e,t){e=U(e)?e:[e];var n=this;e.forEach(function(r){n._removeListener(r,t)})};Tt.prototype.createEvent=function(e){var t=new ma;return t.init(e),t};Tt.prototype.fire=function(e,t){var n,r,i,o;if(o=Qb.call(arguments),typeof e=="object"&&(t=e,e=t.type),!e)throw new Error("no event type specified");if(r=this._listeners[e],!!r){t instanceof ma?n=t:n=this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{i=this._invokeListeners(n,o,r)}finally{e!==a&&(n.type=a)}return i===void 0&&n.defaultPrevented&&(i=!1),i}};Tt.prototype.handleError=function(e){return this.fire("error",{error:e})===!1};Tt.prototype._destroy=function(){this._listeners={}};Tt.prototype._invokeListeners=function(e,t,n){for(var r;n&&!e.cancelBubble;)r=this._invokeListener(e,t,n),n=n.next;return r};Tt.prototype._invokeListener=function(e,t,n){var r;if(n.callback.__isTomb)return r;try{r=Jb(n.callback,t),r!==void 0&&(e.returnValue=r,e.stopPropagation()),r===!1&&e.preventDefault()}catch(i){if(!this.handleError(i))throw console.error("unhandled error in event listener",i),i}return r};Tt.prototype._addListener=function(e,t){var n=this._getListeners(e),r;if(!n){this._setListeners(e,t);return}for(;n;){if(n.priority or , got "+e);return e=(i?i+":":"")+r,{name:e,prefix:i,localName:r}}function tn(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}tn.prototype.build=function(){return pt(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])};tn.prototype.addProperty=function(e,t,n){typeof t=="boolean"&&(n=t,t=void 0),this.addNamedProperty(e,n!==!1);var r=this.properties;t!==void 0?r.splice(t,0,e):r.push(e)};tn.prototype.replaceProperty=function(e,t,n){var r=e.ns,i=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var s=i.indexOf(e);if(s===-1)throw new Error("property <"+r.name+"> not found in property list");i.splice(s,1),this.addProperty(t,n?void 0:s,a),o[r.name]=o[r.localName]=t};tn.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,i=t.split("#"),o=_t(i[0],r),a=_t(i[1],o.prefix).name,s=this.propertiesByName[a];if(s)this.replaceProperty(s,e,n);else throw new Error("refined property <"+a+"> not found");delete e.redefines};tn.prototype.addNamedProperty=function(e,t){var n=e.ns,r=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),r[n.name]=r[n.localName]=e};tn.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]};tn.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e};tn.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e};tn.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)};tn.prototype.assertNotDefined=function(e,t){var n=e.name,r=this.propertiesByName[n];if(r)throw new Error("property <"+n+"> already defined; override of <"+r.definedBy.ns.name+"#"+r.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")};tn.prototype.hasProperty=function(e){return this.propertiesByName[e]};tn.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,r=this.allTypes,i=e.name;i in n||(E(e.properties,Je(function(o){o=C({},o,{name:o.ns.localName,inherited:t}),Object.defineProperty(o,"definedBy",{value:e});var a=o.replaces,s=o.redefines;a||s?this.redefineProperty(o,a||s,a):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),r.push(e),n[i]=e)};function Lr(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,E(e,Je(this.registerPackage,this))}Lr.prototype.getPackage=function(e){return this.packageMap[e]};Lr.prototype.getPackages=function(){return this.packages};Lr.prototype.registerPackage=function(e){e=C({},e);var t=this.packageMap;Yd(t,e,"prefix"),Yd(t,e,"uri"),E(e.types,Je(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)};Lr.prototype.registerType=function(e,t){e=C({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:C(e.meta||{})});var n=_t(e.name,t.prefix),r=n.name,i={};E(e.properties,Je(function(o){var a=_t(o.name,n.prefix),s=a.name;hl(o.type)||(o.type=_t(o.type,a.prefix).name),C(o,{ns:a,name:s}),i[s]=o},this)),C(e,{ns:n,name:r,propertiesByName:i}),E(e.extends,Je(function(o){var a=_t(o,n.prefix),s=this.typeMap[a.name];s.traits=s.traits||[],s.traits.push(r)},this)),this.definePackage(e,t),this.typeMap[r]=e};Lr.prototype.mapTypes=function(e,t,n){var r=hl(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(c,p){var u=_t(c,hl(c)?"":e.prefix);i.mapTypes(u,t,p)}function a(c){return o(c,!0)}function s(c){return o(c,!1)}if(!r)throw new Error("unknown type <"+e.name+">");E(r.superClass,n?a:s),t(r,!n),E(r.traits,a)};Lr.prototype.getEffectiveDescriptor=function(e){var t=_t(e),n=new tn(t);this.mapTypes(t,function(i,o){n.addTrait(i,o)});var r=n.build();return this.definePackage(r,r.allTypes[r.allTypes.length-1].$pkg),r};Lr.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};function Yd(e,t,n){var r=t[n];if(r in e)throw new Error("package with "+n+" <"+r+"> already defined")}function li(e){this.model=e}li.prototype.set=function(e,t,n){if(!et(t)||!t.length)throw new TypeError("property name must be a non-empty string");var r=this.getProperty(e,t),i=r&&r.name;rE(n)?r?delete e[i]:delete e.$attrs[ml(t)]:r?i in e?e[i]=n:Zd(e,r,n):e.$attrs[ml(t)]=n};li.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[ml(t)];var r=n.name;return!e[r]&&n.isMany&&Zd(e,n,[]),e[r]};li.prototype.define=function(e,t,n){if(!n.writable){var r=n.value;n=C({},n,{get:function(){return r}}),delete n.value}Object.defineProperty(e,t,n)};li.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})};li.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})};li.prototype.getProperty=function(e,t){var n=this.model,r=n.getPropertyDescriptor(e,t);if(r)return r;if(t.includes(":"))return null;let i=n.config.strict;if(typeof i!="undefined"){let o=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(i)throw o;typeof console!="undefined"&&console.warn(o)}return null};function rE(e){return typeof e=="undefined"}function Zd(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function ml(e){return e.replace(/^:/,"")}function Ut(e,t={}){this.properties=new li(this),this.factory=new qd(this,this.properties),this.registry=new Lr(e,this.properties),this.typeCache={},this.config=t}Ut.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)};Ut.prototype.getType=function(e){var t=this.typeCache,n=et(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r};Ut.prototype.createAny=function(e,t,n){var r=_t(e),i={$type:e,$instanceOf:function(a){return a===this.$type},get:function(a){return this[a]},set:function(a,s){td(this,[a],s)}},o={name:e,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:t}};return this.properties.defineDescriptor(i,o),this.properties.defineModel(i,this),this.properties.define(i,"get",{enumerable:!1,writable:!0}),this.properties.define(i,"set",{enumerable:!1,writable:!0}),this.properties.define(i,"$parent",{enumerable:!1,writable:!0}),this.properties.define(i,"$instanceOf",{enumerable:!1,writable:!0}),E(n,function(a,s){Ce(a)&&a.value!==void 0?i[a.name]=a.value:i[s]=a}),i};Ut.prototype.getPackage=function(e){return this.registry.getPackage(e)};Ut.prototype.getPackages=function(){return this.registry.getPackages()};Ut.prototype.getElementDescriptor=function(e){return e.$descriptor};Ut.prototype.hasType=function(e,t){t===void 0&&(t=e,e=this);var n=e.$model.getElementDescriptor(e);return t in n.allTypesByName};Ut.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]};Ut.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var Qd=String.fromCharCode,iE=Object.prototype.hasOwnProperty,oE=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,ga={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(ga).forEach(function(e){ga[e.toUpperCase()]=ga[e]});function aE(e,t,n,r){return r?iE.call(ga,r)?ga[r]:"&"+r+";":Qd(t||parseInt(n,16))}function fi(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(oE,aE):e}var Jd="non-whitespace outside of root node";function eo(e){return new Error(e)}function eh(e){return"missing namespace for prefix <"+e+">"}function uc(e){return{get:e,enumerable:!0}}function sE(e){var t={},n;for(n in e)t[n]=e[n];return t}function yl(e){return e+"$uri"}function cE(e){var t={},n,r;for(n in e)r=e[n],t[r]=r,t[yl(r)]=n;return t}function th(){return{line:0,column:0}}function pE(e){throw e}function _l(e){if(!this)return new _l(e);var t=e&&e.proxy,n,r,i,o,a=pE,s,c,p,u,l=th,f=!1,d=!1,h=null,_=!1,v;function w(x){x instanceof Error||(x=eo(x)),h=x,a(x,l)}function P(x){s&&(x instanceof Error||(x=eo(x)),s(x,l))}this.on=function(x,S){if(typeof S!="function")throw eo("required args ");switch(x){case"openTag":r=S;break;case"text":n=S;break;case"closeTag":i=S;break;case"error":a=S;break;case"warn":s=S;break;case"cdata":o=S;break;case"attention":u=S;break;case"question":p=S;break;case"comment":c=S;break;default:throw eo("unsupported event: "+x)}return this},this.ns=function(x){if(typeof x=="undefined"&&(x={}),typeof x!="object")throw eo("required args ");var S={},A;for(A in x)S[A]=x[A];return d=!0,v=S,this},this.parse=function(x){if(typeof x!="string")throw eo("required args ");return h=null,b(x),l=th,_=!1,h},this.stop=function(){_=!0};function b(x){var S=d?[]:null,A=d?cE(v):null,O,M=[],B=0,I=!1,H=!1,z=0,K=0,ce,ln,De,ge,Vt,Wt,We,ht,F,V="",re=0,_e;function Ot(){if(_e!==null)return _e;var y,g,T,D=d&&A.xmlns,j=d&&f?[]:null,W=re,oe=V,ve=oe.length,it,Qe,mt,fn,Me,ir={},Us={},Jt,de,Se;e:for(;W8)){for((de<65||de>122||de>90&&de<97)&&de!==95&&de!==58&&(P("illegal first char attribute name"),Jt=!0),Se=W+1;Se96&&de<123||de>64&&de<91||de>47&&de<59||de===46||de===45||de===95)){if(de===32||de<14&&de>8){P("missing attribute value"),W=Se;continue e}if(de===61)break;P("illegal attribute name char"),Jt=!0}if(Me=oe.substring(W,Se),Me==="xmlns:xmlns"&&(P("illegal declaration of xmlns"),Jt=!0),de=oe.charCodeAt(Se+1),de===34)Se=oe.indexOf('"',W=Se+2),Se===-1&&(Se=oe.indexOf("'",W),Se!==-1&&(P("attribute value quote missmatch"),Jt=!0));else if(de===39)Se=oe.indexOf("'",W=Se+2),Se===-1&&(Se=oe.indexOf('"',W),Se!==-1&&(P("attribute value quote missmatch"),Jt=!0));else for(P("missing attribute value quotes"),Jt=!0,Se=Se+1;Se8));Se++);for(Se===-1&&(P("missing closing quotes"),Se=ve,Jt=!0),Jt||(mt=oe.substring(W,Se)),W=Se;Se+18));Se++)W===Se&&(P("illegal character after attribute end"),Jt=!0);if(W=Se+1,Jt)continue e;if(Me in Us){P("attribute <"+Me+"> already defined");continue}if(Us[Me]=!0,!d){ir[Me]=mt;continue}if(f){if(Qe=Me==="xmlns"?"xmlns":Me.charCodeAt(0)===120&&Me.substr(0,6)==="xmlns:"?Me.substr(6):null,Qe!==null){if(y=fi(mt),g=yl(Qe),fn=v[y],!fn){if(Qe==="xmlns"||g in A&&A[g]!==y)do fn="ns"+B++;while(typeof A[fn]!="undefined");else fn=Qe;v[y]=fn}A[Qe]!==fn&&(it||(A=sE(A),it=!0),A[Qe]=fn,Qe==="xmlns"&&(A[yl(fn)]=y,D=fn),A[g]=y),ir[Me]=mt;continue}j.push(Me,mt);continue}if(de=Me.indexOf(":"),de===-1){ir[Me]=mt;continue}if(!(T=A[Me.substring(0,de)])){P(eh(Me.substring(0,de)));continue}Me=D===T?Me.substr(de+1):T+Me.substr(de),ir[Me]=mt}if(f)for(W=0,ve=j.length;W=D&&(W=y.exec(x),!(!W||(j=W[0].length+W.index,j>z)));)g+=1,D=j;return z==-1?(T=j,oe=x.substring(K)):K===0?oe=x.substring(K,z):(T=z-D,oe=K==-1?x.substring(z):x.substring(z,K+1)),{data:oe,line:g,column:T}}for(l=R,t&&(F=Object.create({},{name:uc(function(){return We}),originalName:uc(function(){return ht}),attrs:uc(Ot),ns:uc(function(){return A})}));K!==-1;){if(x.charCodeAt(K)===60?z=K:z=x.indexOf("<",K),z===-1){if(M.length)return w("unexpected end of file");if(K===0)return w("missing start tag");K",z),K===-1)return w("unclosed cdata");if(o&&(o(x.substring(z+9,K),l),_))return;K+=3;continue}if(De===45&&x.charCodeAt(z+3)===45){if(K=x.indexOf("-->",z),K===-1)return w("unclosed comment");if(c&&(c(x.substring(z+4,K),fi,l),_))return;K+=3;continue}}if(ge===63){if(K=x.indexOf("?>",z),K===-1)return w("unclosed question");if(p&&(p(x.substring(z,K+2),l),_))return;K+=2;continue}for(ce=z+1;;ce++){if(Vt=x.charCodeAt(ce),isNaN(Vt))return K=-1,w("unclosed tag");if(Vt===34)De=x.indexOf('"',ce+1),ce=De!==-1?De:ce;else if(Vt===39)De=x.indexOf("'",ce+1),ce=De!==-1?De:ce;else if(Vt===62){K=ce;break}}if(ge===33){if(u&&(u(x.substring(z,K+1),fi,l),_))return;K+=1;continue}if(_e={},ge===47){if(I=!1,H=!0,!M.length)return w("missing open tag");if(ce=We=M.pop(),De=z+2+ce.length,x.substring(z+2,De)!==ce)return w("closing tag mismatch");for(;De8&&ge<14))return w("close tag")}else{if(x.charCodeAt(K-1)===47?(ce=We=x.substring(z+1,K-1),I=!0,H=!0):(ce=We=x.substring(z+1,K),I=!0,H=!1),!(ge>96&&ge<123||ge>64&&ge<91||ge===95||ge===58))return w("illegal first char nodeName");for(De=1,ln=ce.length;De96&&ge<123||ge>64&&ge<91||ge>47&&ge<59||ge===45||ge===95||ge==46)){if(ge===32||ge<14&&ge>8){We=ce.substring(0,De),_e=null;break}return w("invalid nodeName")}H||M.push(We)}if(d){if(O=A,I&&(H||S.push(O),_e===null&&(f=ce.indexOf("xmlns",De)!==-1)&&(re=De,V=ce,Ot(),f=!1)),ht=We,ge=We.indexOf(":"),ge!==-1){if(Wt=A[We.substring(0,ge)],!Wt)return w("missing namespace on <"+ht+">");We=We.substr(ge+1)}else Wt=A.xmlns;Wt&&(We=Wt+":"+We)}if(I&&(re=De,V=ce,r&&(t?r(F,fi,H,l):r(We,Ot,fi,H,l),_)))return;if(H){if(i&&(i(t?F:We,fi,I,l),_))return;d&&(I?A=O:A=S.pop())}K+=1}}}function nh(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var xl={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},rh="property";function ih(e){return e.xml&&e.xml.serialize}function uE(e){let t=ih(e);return t!==rh&&(t||null)}function lE(e){return e.charAt(0).toUpperCase()+e.slice(1)}function oh(e,t){return nh(t)?e.prefix+":"+lE(e.localName):e.name}function fE(e,t){var n=e.name,r=e.localName,i=t&&t.xml&&t.xml.typePrefix;return i&&r.indexOf(i)===0?e.prefix+":"+r.slice(i.length):n}function dE(e,t,n){let r=_t(e,t.xmlns),i=`${t[r.prefix]||r.prefix}:${r.localName}`,o=_t(i);var a=n.getPackage(o.prefix);return fE(o,a)}function jr(e){return new Error(e)}function sr(e){return e.$descriptor}function hE(e){C(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw jr("expected element");var n=this.elementsById,r=sr(t),i=r.idProperty,o;if(i&&(o=t.get(i.name),o)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(o))throw new Error("illegal ID <"+o+">");if(n[o])throw jr("duplicate ID <"+o+">");n[o]=t}},this.addWarning=function(t){this.warnings.push(t)}}function va(){}va.prototype.handleEnd=function(){};va.prototype.handleText=function(){};va.prototype.handleNode=function(){};function bl(){}bl.prototype=Object.create(va.prototype);bl.prototype.handleNode=function(){return this};function no(){}no.prototype=Object.create(va.prototype);no.prototype.handleText=function(e){this.body=(this.body||"")+e};function ya(e,t){this.property=e,this.context=t}ya.prototype=Object.create(no.prototype);ya.prototype.handleNode=function(e){if(this.element)throw jr("expected no sub nodes");return this.element=this.createReference(e),this};ya.prototype.handleEnd=function(){this.element.id=this.body};ya.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}};function El(e,t){this.element=t,this.propertyDesc=e}El.prototype=Object.create(no.prototype);El.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=pc(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)};function lc(){}lc.prototype=Object.create(no.prototype);lc.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t};function Mt(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}Mt.prototype=Object.create(lc.prototype);Mt.prototype.addReference=function(e){this.context.addReference(e)};Mt.prototype.handleText=function(e){var t=this.element,n=sr(t),r=n.bodyProperty;if(!r)throw jr("unexpected body text <"+e+">");no.prototype.handleText.call(this,e)};Mt.prototype.handleEnd=function(){var e=this.body,t=this.element,n=sr(t),r=n.bodyProperty;r&&e!==void 0&&(e=pc(r.type,e),t.set(r.name,e))};Mt.prototype.createElement=function(e){var t=e.attributes,n=this.type,r=sr(n),i=this.context,o=new n({}),a=this.model,s;return E(t,function(c,p){var u=r.propertiesByName[p],l;u&&u.isReference?u.isMany?(l=c.split(" "),E(l,function(f){i.addReference({element:o,property:u.ns.name,id:f})})):i.addReference({element:o,property:u.ns.name,id:c}):(u?c=pc(u.type,c):p==="xmlns"?p=":"+p:(s=_t(p,r.ns.prefix),a.getPackage(s.prefix)&&i.addWarning({message:"unknown attribute <"+p+">",element:o,property:p,value:c})),o.set(p,c))}),o};Mt.prototype.getPropertyForNode=function(e){var t=e.name,n=_t(t),r=this.type,i=this.model,o=sr(r),a=n.name,s=o.propertiesByName[a];if(s&&!s.isAttr){let p=uE(s);if(p){let u=e.attributes[p];if(u){let l=dE(u,e.ns,i),f=i.getType(l);return C({},s,{effectiveType:sr(f).name})}}return s}var c=i.getPackage(n.prefix);if(c){let p=oh(n,c),u=i.getType(p);if(s=ne(o.properties,function(l){return!l.isVirtual&&!l.isReference&&!l.isAttribute&&u.hasType(l.type)}),s)return C({},s,{effectiveType:sr(u).name})}else if(s=ne(o.properties,function(p){return!p.isReference&&!p.isAttribute&&p.type==="Element"}),s)return s;throw jr("unrecognized element <"+n.name+">")};Mt.prototype.toString=function(){return"ElementDescriptor["+sr(this.type).name+"]"};Mt.prototype.valueHandler=function(e,t){return new El(e,t)};Mt.prototype.referenceHandler=function(e){return new ya(e,this.context)};Mt.prototype.handler=function(e){return e==="Element"?new to(this.model,e,this.context):new Mt(this.model,e,this.context)};Mt.prototype.handleChild=function(e){var t,n,r,i;if(t=this.getPropertyForNode(e),r=this.element,n=t.effectiveType||t.type,vl(n))return this.valueHandler(t,r);t.isReference?i=this.referenceHandler(t).handleNode(e):i=this.handler(n).handleNode(e);var o=i.element;return o!==void 0&&(t.isMany?r.get(t.name).push(o):r.set(t.name,o),t.isReference?(C(o,{element:r}),this.context.addReference(o)):o.$parent=r),i};function wl(e,t,n){Mt.call(this,e,t,n)}wl.prototype=Object.create(Mt.prototype);wl.prototype.createElement=function(e){var t=e.name,n=_t(t),r=this.model,i=this.type,o=r.getPackage(n.prefix),a=o&&oh(n,o)||t;if(!i.hasType(a))throw jr("unexpected element <"+e.originalName+">");return Mt.prototype.createElement.call(this,e)};function to(e,t,n){this.model=e,this.context=n}to.prototype=Object.create(lc.prototype);to.prototype.createElement=function(e){var t=e.name,n=_t(t),r=n.prefix,i=e.ns[r+"$uri"],o=e.attributes;return this.model.createAny(t,i,o)};to.prototype.handleChild=function(e){var t=new to(this.model,"Element",this.context).handleNode(e),n=this.element,r=t.element,i;return r!==void 0&&(i=n.$children=n.$children||[],i.push(r),r.$parent=n),t};to.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function fc(e){e instanceof Ut&&(e={model:e}),C(this,{lax:!1},e)}fc.prototype.fromXML=function(e,t,n){var r=t.rootHandler;t instanceof Mt?(r=t,t={}):typeof t=="string"?(r=this.handler(t),t={}):typeof r=="string"&&(r=this.handler(r));var i=this.model,o=this.lax,a=new hE(C({},t,{rootHandler:r})),s=new _l({proxy:!0}),c=mE();r.context=a,c.push(r);function p(S,A,O){var M=A(),B=M.line,I=M.column,H=M.data;H.charAt(0)==="<"&&H.indexOf(" ")!==-1&&(H=H.slice(0,H.indexOf(" "))+">");var z="unparsable content "+(H?H+" ":"")+`detected - line: `+B+` +(()=>{var jE=Object.create;var sc=Object.defineProperty;var FE=Object.getOwnPropertyDescriptor;var HE=Object.getOwnPropertyNames;var $E=Object.getPrototypeOf,zE=Object.prototype.hasOwnProperty;var GE=(e,t)=>()=>(e&&(t=e(e=0)),t);var cc=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),VE=(e,t)=>{for(var n in t)sc(e,n,{get:t[n],enumerable:!0})},Xd=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of HE(t))!zE.call(e,i)&&i!==n&&sc(e,i,{get:()=>t[i],enumerable:!(r=FE(t,i))||r.enumerable});return e};var WE=(e,t,n)=>(n=e!=null?jE($E(e)):{},Xd(t||!e||!e.__esModule?sc(n,"default",{value:e,enumerable:!0}):n,e)),UE=e=>Xd(sc({},"__esModule",{value:!0}),e);var em={};VE(em,{assign:()=>C,bind:()=>Qe,debounce:()=>xa,ensureArray:()=>Qd,every:()=>pn,filter:()=>J,find:()=>re,findIndex:()=>ba,flatten:()=>gi,forEach:()=>E,get:()=>t0,groupBy:()=>zt,has:()=>ot,isArray:()=>q,isDefined:()=>Ge,isFunction:()=>Ne,isNil:()=>qn,isNumber:()=>te,isObject:()=>Ee,isString:()=>it,isUndefined:()=>wn,keys:()=>yi,map:()=>Oe,matchPattern:()=>Et,merge:()=>Jd,omit:()=>Mt,pick:()=>lt,reduce:()=>Fe,set:()=>yl,size:()=>hl,some:()=>Bt,sortBy:()=>Ct,throttle:()=>e0,unionBy:()=>vl,uniqueBy:()=>uc,values:()=>vr,without:()=>ml});function gi(e){return Array.prototype.concat.apply([],e)}function wn(e){return e===void 0}function Ge(e){return e!==void 0}function qn(e){return e==null}function q(e){return _a.call(e)==="[object Array]"}function Ee(e){return _a.call(e)==="[object Object]"}function te(e){return _a.call(e)==="[object Number]"}function Ne(e){let t=_a.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function it(e){return _a.call(e)==="[object String]"}function Qd(e){if(!q(e))throw new Error("must supply array")}function ot(e,t){return!qn(e)&&ZE.call(e,t)}function re(e,t){let n=pc(t),r;return E(e,function(i,o){if(n(i,o))return r=i,!1}),r}function ba(e,t){let n=pc(t),r=q(e)?-1:void 0;return E(e,function(i,o){if(n(i,o))return r=o,!1}),r}function J(e,t){let n=pc(t),r=[];return E(e,function(i,o){n(i,o)&&r.push(i)}),r}function E(e,t){let n,r;if(wn(e))return;let i=q(e)?JE:QE;for(let o in e)if(ot(e,o)&&(n=e[o],r=t(n,i(o)),r===!1))return n}function ml(e,t){if(wn(e))return[];Qd(e);let n=pc(t);return e.filter(function(r,i){return!n(r,i)})}function Fe(e,t,n){return E(e,function(r,i){n=t(n,r,i)}),n}function pn(e,t){return!!Fe(e,function(n,r,i){return n&&t(r,i)},!0)}function Bt(e,t){return!!re(e,t)}function Oe(e,t){let n=[];return E(e,function(r,i){n.push(t(r,i))}),n}function yi(e){return e&&Object.keys(e)||[]}function hl(e){return yi(e).length}function vr(e){return Oe(e,t=>t)}function zt(e,t,n={}){return t=gl(t),E(e,function(r){let i=t(r)||"_",o=n[i];o||(o=n[i]=[]),o.push(r)}),n}function uc(e,...t){e=gl(e);let n={};return E(t,i=>zt(i,e,n)),Oe(n,function(i,o){return i[0]})}function Ct(e,t){t=gl(t);let n=[];return E(e,function(r,i){let o=t(r,i),a={d:o,v:r};for(var s=0;sr.v)}function Et(e){return function(t){return pn(e,function(n,r){return t[r]===n})}}function gl(e){return Ne(e)?e:t=>t[e]}function pc(e){return Ne(e)?e:t=>t===e}function QE(e){return e}function JE(e){return Number(e)}function xa(e,t){let n,r,i,o;function a(l){let f=Date.now(),d=l?0:o+t-f;if(d>0)return s(d);e.apply(i,r),c()}function s(l){n=setTimeout(a,l)}function c(){n&&clearTimeout(n),n=o=r=i=void 0}function u(){n&&a(!0),c()}function p(...l){o=Date.now(),r=l,i=this,n||s(t)}return p.flush=u,p.cancel=c,p}function e0(e,t){let n=!1;return function(...r){n||(e(...r),n=!0,setTimeout(()=>{n=!1},t))}}function Qe(e,t){return e.bind(t)}function C(e,...t){return Object.assign(e,...t)}function yl(e,t,n){let r=e;return E(t,function(i,o){if(typeof i!="number"&&typeof i!="string")throw new Error("illegal key type: "+typeof i+". Key should be of type number or string.");if(i==="constructor")throw new Error("illegal key: constructor");if(i==="__proto__")throw new Error("illegal key: __proto__");let a=t[o+1],s=r[i];Ge(a)&&qn(s)&&(s=r[i]=isNaN(+a)?{}:[]),wn(a)?wn(n)?delete r[i]:r[i]=n:r=s}),e}function t0(e,t,n){let r=e;return E(t,function(i){if(qn(r))return r=void 0,!1;r=r[i]}),wn(r)?n:r}function lt(e,t){let n={},r=Object(e);return E(t,function(i){i in r&&(n[i]=e[i])}),n}function Mt(e,t){let n={},r=Object(e);return E(r,function(i,o){t.indexOf(o)===-1&&(n[o]=i)}),n}function Jd(e,...t){return t.length&&E(t,function(n){!n||!Ee(n)||E(n,function(r,i){if(i==="__proto__")return;let o=e[i];Ee(r)?(Ee(o)||(o={}),e[i]=Jd(o,r)):e[i]=r})}),e}var _a,ZE,vl,k=GE(()=>{_a=Object.prototype.toString,ZE=Object.prototype.hasOwnProperty;vl=uc});var Ox=cc((Nee,Nx)=>{function pM(e){return["String","Boolean","Integer","Real"].includes(e)}Nx.exports=function e(t,n){let r=n.enter,i=n.leave,o=r&&r(t),a=t.$descriptor;o!==!1&&!a.isGeneric&&a.properties.filter(c=>!c.isAttr&&!c.isReference&&!pM(c.type)).forEach(c=>{if(c.name in t){let u=t[c.name];c.isMany?u.forEach(p=>{e(p,n)}):e(u,n)}}),i&&i(t)}});var Ix=cc((Oee,Bx)=>{var lM=Ox(),{isArray:fM,isObject:dM,isFunction:mM}=(k(),UE(em)),_d=class{constructor({moddleRoot:t,rule:n}){this.rule=n,this.moddleRoot=t,this.messages=[],this.report=this.report.bind(this)}report(t,n,r){let i={id:t,message:n};r&&fM(r)&&(i={...i,path:r}),r&&dM(r)&&(i={...i,...r}),this.messages.push(i)}};Bx.exports=function({moddleRoot:t,rule:n}){let r=new _d({rule:n,moddleRoot:t}),i=n.check||{},o="leave"in i?i.leave:void 0,a="enter"in i?i.enter:mM(i)?i:void 0;if(!a&&!o)throw new Error("no check implemented");return lM(t,{enter:a?s=>a(s,r):void 0,leave:o?s=>o(s,r):void 0}),r.messages}});var Fx=cc((Bee,jx)=>{var hM=Ix(),vM=(e,t)=>e,gM={0:"off",1:"warn",2:"error",3:"info"},yM="rule-error";function kn(e){let{config:t={},resolver:n,transformRule:r=vM}=e||{};if(typeof n=="undefined")throw new Error("must provide ");this.config=t,this.resolver=n,this.transformRule=r,this.cachedRules={},this.cachedConfigs={}}jx.exports=kn;kn.prototype.applyRule=function(t,n){let{config:r,rule:i,category:o,name:a}=n;try{return hM({moddleRoot:t,rule:i,config:r}).map(function(c){return{...c,meta:i.meta,category:o}})}catch(s){return console.error("rule <"+a+"> failed with error: ",s),[{message:s.message,category:yM}]}};kn.prototype.resolveRule=function(e,t){let{pkg:n,ruleName:r}=this.parseRuleName(e),i=`${n}-${r}`,o=this.cachedRules[i];return o?Promise.resolve(o):Promise.resolve(this.resolver.resolveRule(n,r)).then(a=>{if(!a)throw new Error(`unknown rule <${e}>`);return this.cachedRules[i]=this.transformRule(a(t),{pkg:n,ruleName:r})})};kn.prototype.resolveConfig=function(e){let{pkg:t,configName:n}=this.parseConfigName(e),r=`${t}-${n}`,i=this.cachedConfigs[r];return i?Promise.resolve(i):Promise.resolve(this.resolver.resolveConfig(t,n)).then(o=>{if(!o)throw new Error(`unknown config <${e}>`);return this.cachedConfigs[r]=this.normalizeConfig(o,t)})};kn.prototype.resolveRules=function(e){return this.resolveConfiguredRules(e).then(t=>{let i=Object.entries(t).map(([o,a])=>{let{category:s,config:c}=this.parseRuleValue(a);return{name:o,category:s,config:c}}).filter(o=>o.category!=="off").map(o=>{let{name:a,config:s}=o;return this.resolveRule(a,s).then(function(c){return{...o,rule:c}})});return Promise.all(i)})};kn.prototype.resolveConfiguredRules=function(e){let t=e.extends;return typeof t=="string"&&(t=[t]),typeof t=="undefined"&&(t=[]),Promise.all(t.map(n=>this.resolveConfig(n).then(r=>this.resolveConfiguredRules(r)))).then(n=>{let r=this.normalizeConfig(e,"bpmnlint").rules;return[...n,r].reduce((o,a)=>({...o,...a}),{})})};kn.prototype.lint=function(e,t){return t=t||this.config,this.resolveRules(t).then(n=>{let r={};return n.forEach(i=>{let{name:o}=i,a=this.applyRule(e,i);a.length&&(r[o]=a)}),r})};kn.prototype.parseRuleValue=function(e){let t,n;return Array.isArray(e)?(t=e[0],n=e[1]):(t=e,n={}),typeof t=="string"&&(t=t.toLowerCase()),t=gM[t]||t,{config:n,category:t}};kn.prototype.parseRuleName=function(e,t="bpmnlint"){let n=/^(?:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)?([^/]+)$/.exec(e);if(!n)throw new Error(`unparseable rule name <${e}>`);let[r,i,o,a]=n;return o?{pkg:`${i?i+"/":""}${Lx(o)}`,ruleName:a}:{pkg:t,ruleName:a}};kn.prototype.parseConfigName=function(e){let t=/^(?:(?:plugin:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)|bpmnlint:)([^/]+)$/.exec(e);if(!t)throw new Error(`unparseable config name <${e}>`);let[n,r,i,o]=t;return i?{pkg:`${r?r+"/":""}${Lx(i)}`,configName:o}:{pkg:"bpmnlint",configName:o}};kn.prototype.getSimplePackageName=function(e){let t=/^(?:(@[^/]+)\/)?([^/]+)$/.exec(e);if(!t)throw new Error(`unparseable package name <${e}>`);let[n,r,i]=t;return`${r?r+"/":""}${_M(i)}`};kn.prototype.normalizeConfig=function(e,t){let n=e.rules||{},r=Object.keys(n).reduce((i,o)=>{let a=n[o],{pkg:s,ruleName:c}=this.parseRuleName(o,t),u=s==="bpmnlint"?c:`${this.getSimplePackageName(s)}/${c}`;return i[u]=a,i},{});return{...e,rules:r}};function Lx(e){return e==="bpmnlint"?"bpmnlint":e.startsWith("bpmnlint-plugin-")?e:`bpmnlint-plugin-${e}`}function _M(e){return e.startsWith("bpmnlint-plugin-")?e.substring(16):e}});var $x=cc((Iee,Hx)=>{var bM=Fx();Hx.exports={Linter:bM}});function B(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function qE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dl={exports:{}},Zd;function KE(){if(Zd)return dl.exports;Zd=1;var e=dl.exports=function(t,n){if(n||(n=16),t===void 0&&(t=128),t<=0)return"0";for(var r=Math.log(Math.pow(2,t))/Math.log(n),i=2;r===1/0;i*=2)r=Math.log(Math.pow(2,t/i))/Math.log(n)*i;for(var o=r-Math.floor(r),a="",i=0;i=Math.pow(2,t)?e(t,n):a};return e.rack=function(t,n,r){var i=function(a){var s=0;do{if(s++>10)if(r)t+=r;else throw new Error("too many ID collisions, use more bits");var c=e(t,n)}while(Object.hasOwnProperty.call(o,c));return o[c]=a,c},o=i.hats={};return i.get=function(a){return i.hats[a]},i.set=function(a,s){return i.hats[a]=s,i},i.bits=t||128,i.base=n||16,i},dl.exports}var YE=KE(),XE=qE(YE);function En(e){if(!(this instanceof En))return new En(e);e=e||[128,36,1],this._seed=e.length?XE.rack(e[0],e[1],e[2]):e}En.prototype.next=function(e){return this._seed(e||!0)};En.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n};En.prototype.claim=function(e,t){this._seed.set(e,t||!0)};En.prototype.assigned=function(e){return this._seed.get(e)||!1};En.prototype.unclaim=function(e){delete this._seed.hats[e]};En.prototype.clear=function(){var e=this._seed.hats,t;for(t in e)this.unclaim(t)};k();k();var ft={legend:[1,"
","
"],tr:[2,"","
"],col:[2,"","
"],_default:[0,"",""]};ft.td=ft.th=[3,"","
"];ft.option=ft.optgroup=[1,'"];ft.thead=ft.tbody=ft.colgroup=ft.caption=ft.tfoot=[1,"","
"];ft.polyline=ft.ellipse=ft.polygon=ft.circle=ft.text=ft.line=ft.path=ft.rect=ft.g=[1,'',""];function ue(e,t=globalThis.document){var u;if(typeof e!="string")throw new TypeError("String expected");let n=/^$/s.exec(e);if(n)return t.createComment(n[1]);let r=(u=/<([\w:]+)/.exec(e))==null?void 0:u[1];if(!r)return t.createTextNode(e);if(e=e.trim(),r==="body"){let p=t.createElement("html");p.innerHTML=e;let{lastChild:l}=p;return l.remove(),l}let[i,o,a]=Object.hasOwn(ft,r)?ft[r]:ft._default,s=t.createElement("div");for(s.innerHTML=o+e+a;i--;)s=s.lastChild;if(s.firstChild===s.lastChild){let{firstChild:p}=s;return p.remove(),p}let c=t.createDocumentFragment();return c.append(...s.childNodes),c}function n0(e,t){return t.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(r){if(r!=="default"&&!(r in e)){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}})}),Object.freeze(e)}function dt(e,...t){let n=e.style;return E(t,function(r){r&&E(r,function(i,o){n[o]=i})}),e}function Je(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}var r0=Object.prototype.toString;function Te(e){return new Lr(e)}function Lr(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Lr.prototype.add=function(e){return this.list.add(e),this};Lr.prototype.remove=function(e){return r0.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)};Lr.prototype.removeMatching=function(e){let t=this.array();for(let n=0;n"+e+"",t=!0);var n=d0(e);if(!t)return n;for(var r=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)r.appendChild(i.firstChild);return r}function d0(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function U(e,t){var n;return e=e.trim(),e.charAt(0)==="<"?(n=pm(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Sl.svg,e),t&&z(n,t),n}var _l=null;function El(){return _l===null&&(_l=U("svg")),_l}function om(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)e[r]=t[r];return e}function lm(e,t,n,r,i,o){var a=El().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return om(a,e);case 6:return om(a,{a:e,b:t,c:n,d:r,e:i,f:o})}}function ro(e){return e?El().createSVGTransformFromMatrix(e):El().createSVGTransform()}var am=/([&<>]{1})/g,m0=/([&<>\n\r"]{1})/g,h0={"&":"&","<":"<",">":">",'"':"'"};function bl(e,t){function n(r,i){return h0[i]||i}return e.replace(t,n)}function fm(e,t){var n,r,i,o,a;switch(e.nodeType){case 3:t.push(bl(e.textContent,am));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(i=e.attributes,n=0,r=i.length;n"),a=e.childNodes,n=0,r=a.length;n")}else t.push("/>");break;case 8:t.push("");break;case 4:t.push("");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function v0(e,t){var n=pm(t);if(gr(e),!!t){y0(n)||(n=n.documentElement);for(var r=_0(n.childNodes),i=0;i{let i=r.match(R0);return(i&&i[1]||r).trim()})||[]}function Al(e,t){let n=t||{get:function(x,b){if(r.push(x),b===!1)return null;throw s(`No provider for "${x}"!`)}},r=[],i=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),a=o.injector=this,s=function(x){let b=r.join(" -> ");return r.length=0,new Error(b?`${x} (Resolving: ${b})`:x)};function c(x,b){if(!i[x]&&x.includes(".")){let S=x.split("."),A=c(S.shift());for(;S.length;)A=A[S.shift()];return A}if(Rl(o,x))return o[x];if(Rl(i,x)){if(r.indexOf(x)!==-1)throw r.push(x),s("Cannot resolve circular dependency!");return r.push(x),o[x]=i[x][0](i[x][1]),r.pop(),o[x]}return n.get(x,b)}function u(x,b){if(typeof b=="undefined"&&(b={}),typeof x!="function")if(Pl(x))x=dc(x.slice());else throw s(`Cannot invoke "${x}". Expected a function!`);let A=(x.$inject||P0(x)).map(O=>Rl(b,O)?b[O]:c(O));return{fn:x,dependencies:A}}function p(x){let{fn:b,dependencies:S}=u(x),A=Function.prototype.bind.call(b,null,...S);return new A}function l(x,b,S){let{fn:A,dependencies:O}=u(x,S);return A.apply(b,O)}function f(x){return dc(b=>x.get(b))}function d(x,b){if(b&&b.length){let S=Object.create(null),A=Object.create(null),O=[],D=[],L=[],I,$,G,K;for(let pe in i)I=i[pe],b.indexOf(pe)!==-1&&(I[2]==="private"?($=O.indexOf(I[3]),$===-1?(G=I[3].createChild([],b),K=f(G),O.push(I[3]),D.push(G),L.push(K),S[pe]=[K,pe,"private",G]):S[pe]=[L[$],pe,"private",D[$]]):S[pe]=[I[2],I[1]],A[pe]=!0),(I[2]==="factory"||I[2]==="type")&&I[1].$scope&&b.forEach(bn=>{I[1].$scope.indexOf(bn)!==-1&&(S[pe]=[I[2],I[1]],A[bn]=!0)});b.forEach(pe=>{if(!A[pe])throw new Error('No provider for "'+pe+'". Cannot use provider from the parent!')}),x.unshift(S)}return new Al(x,a)}let m={factory:l,type:p,value:function(x){return x}};function y(x,b){let S=x.__init__||[];return function(){S.forEach(A=>{typeof A=="string"?b.get(A):b.invoke(A)})}}function v(x){let b=x.__exports__;if(b){let S=x.__modules__,A=Object.keys(x).reduce(($,G)=>(G!=="__exports__"&&G!=="__modules__"&&G!=="__init__"&&G!=="__depends__"&&($[G]=x[G]),$),Object.create(null)),O=(S||[]).concat(A),D=d(O),L=dc(function($){return D.get($)});b.forEach(function($){i[$]=[L,$,"private",D]});let I=(x.__init__||[]).slice();return I.unshift(function(){D.init()}),x=Object.assign({},x,{__init__:I}),y(x,D)}return Object.keys(x).forEach(function(S){if(S==="__init__"||S==="__depends__")return;let A=x[S];if(A[2]==="private"){i[S]=A;return}let O=A[0],D=A[1];i[S]=[m[O],A0(O,D),O]}),y(x,a)}function w(x,b){return x.indexOf(b)!==-1||(x=(b.__depends__||[]).reduce(w,x),x.indexOf(b)!==-1)?x:x.concat(b)}function R(x){let b=x.reduce(w,[]).map(v),S=!1;return function(){S||(S=!0,b.forEach(A=>A()))}}this.get=c,this.invoke=l,this.instantiate=p,this.createChild=d,this.init=R(e)}function A0(e,t){return e!=="value"&&Pl(t)&&(t=dc(t.slice())),t}var T0=1e3;function Sn(e,t){var n=this;t=t||T0,e.on(["render.shape","render.connection"],t,function(r,i){var o=r.type,a=i.element,s=i.gfx,c=i.attrs;if(n.canRender(a))return o==="render.shape"?n.drawShape(s,a,c):n.drawConnection(s,a,c)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(r,i){if(n.canRender(i))return r.type==="render.getShapePath"?n.getShapePath(i):n.getConnectionPath(i)})}Sn.prototype.canRender=function(e){};Sn.prototype.drawShape=function(e,t){};Sn.prototype.drawConnection=function(e,t){};Sn.prototype.getShapePath=function(e){};Sn.prototype.getConnectionPath=function(e){};k();function yr(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function D0(e){return["M",e.x,e.y]}function Tl(e){return["L",e.x,e.y]}function M0(e,t,n){return["C",e.x,e.y,t.x,t.y,n.x,n.y]}function k0(e,t){let n=e.length,r=[D0(e[0])];for(let i=1;ii||i===void 0)&&(i=c+l),(u+p>o||o===void 0)&&(o=u+p)}),{x:n,y:r,height:o-r,width:i-n}}function hc(e,t){var n={};return E(e,function(r){var i=r;i.waypoints&&(i=Se(i)),!te(t.y)&&i.x>t.x&&(n[r.id]=r),!te(t.x)&&i.y>t.y&&(n[r.id]=r),i.x>t.x&&i.y>t.y&&(te(t.width)&&te(t.height)&&i.width+i.xt.x-n&&e.y>t.y-n&&e.x=1e3&&delete i[o.shift()],o.push(r),i[r]=e(...arguments),i[r])}return t}function z0(e){if(!e)return null;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},n=[];return String(e).replace(L0,function(r,i,o){var a=[],s=i.toLowerCase();for(o.replace(j0,function(c,u){u&&a.push(+u)}),s=="m"&&a.length>2&&(n.push([i,...a.splice(0,2)]),s="l",i=i=="m"?"l":"L");a.length>=t[s]&&(n.push([i,...a.splice(0,t[s])]),!!t[s]););}),n.toString=Ol,n}function G0(e){for(var t=0,n=e.length;t=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function U0(e,t){return e=Nl(e),t=Nl(t),Gr(t,e.x,e.y)||Gr(t,e.x2,e.y)||Gr(t,e.x,e.y2)||Gr(t,e.x2,e.y2)||Gr(e,t.x,t.y)||Gr(e,t.x2,t.y)||Gr(e,t.x,t.y2)||Gr(e,t.x2,t.y2)||(e.xt.x||t.xe.x)&&(e.yt.y||t.ye.y)}function Em(e,t,n,r,i){var o=-3*t+9*n-9*r+3*i,a=e*o+6*t-12*n+6*r;return e*a-3*t+3*n}function wm(e,t,n,r,i,o,a,s,c){c==null&&(c=1),c=c>1?1:c<0?0:c;for(var u=c/2,p=12,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,m=0;mQn(i,a)||Qn(t,r)Qn(o,s))){var c=(e*r-t*n)*(i-a)-(e-n)*(i*s-o*a),u=(e*r-t*n)*(o-s)-(t-r)*(i*s-o*a),p=(e-n)*(o-s)-(t-r)*(i-a);if(p){var l=_c(c/p),f=_c(u/p),d=+l.toFixed(2),m=+f.toFixed(2);if(!(d<+Zn(e,n).toFixed(2)||d>+Qn(e,n).toFixed(2)||d<+Zn(i,a).toFixed(2)||d>+Qn(i,a).toFixed(2)||m<+Zn(t,r).toFixed(2)||m>+Qn(t,r).toFixed(2)||m<+Zn(o,s).toFixed(2)||m>+Qn(o,s).toFixed(2)))return{x:l,y:f}}}}function _c(e){return Math.round(e*1e11)/1e11}function K0(e,t,n){var r=xm(e),i=xm(t);if(!U0(r,i))return n?0:[];var o=wm(...e),a=wm(...t),s=Sm(e)?1:~~(o/5)||1,c=Sm(t)?1:~~(a/5)||1,u=new Array(s+1),p=new Array(c+1),l={},f=n?0:[],d,m;for(d=0;d=0&&D<=1&&L>=0&&L<=1&&(n?f++:f.push({x:A.x,y:A.y,t1:D,t2:L}))}}return f}function Ra(e,t,n){e=Rm(e),t=Rm(t);for(var r,i,o,a,s,c,u,p,l,f,d=n?0:[],m=0,y=e.length;m1&&(w=ct.sqrt(w),n=w*n,r=w*r);var R=n*n,x=r*r,b=(o==a?-1:1)*ct.sqrt(Vr((R*x-R*v*v-x*y*y)/(R*v*v+x*y*y))),S=b*n*v/r+(e+s)/2,A=b*-r*y/n+(t+c)/2,O=ct.asin(((t-A)/r).toFixed(9)),D=ct.asin(((c-A)/r).toFixed(9));O=eD&&(O=O-zr*2),!a&&D>O&&(D=D-zr*2)}var L=D-O;if(Vr(L)>p){var I=D,$=s,G=c;D=O+p*(a&&D>O?1:-1),s=S+n*ct.cos(D),c=A+r*ct.sin(D),f=Pm(s,c,n,r,i,0,a,$,G,[D,I,S,A])}L=D-O;var K=ct.cos(O),pe=ct.sin(O),bn=ct.cos(D),ke=ct.sin(D),ye=ct.tan(L/4),Zt=4/3*n*ye,Qt=4/3*r*ye,Ke=[e,t],bt=[e+Zt*pe,t-Qt*K],H=[s+Zt*ke,c-Qt*bn],V=[s,c];if(bt[0]=2*Ke[0]-bt[0],bt[1]=2*Ke[1]-bt[1],u)return[bt,H,V].concat(f);f=[bt,H,V].concat(f).join().split(",");for(var ie=[],be=0,$t=f.length;be<$t;be++)ie[be]=be%2?m(f[be-1],f[be],l).y:m(f[be],f[be+1],l).x;return ie}function Z0(e,t,n,r,i,o,a,s){for(var c=[],u=[[],[]],p,l,f,d,m,y,v,w,R=0;R<2;++R){if(R==0?(l=6*e-12*n+6*i,p=-3*e+9*n-9*i+3*a,f=3*n-3*e):(l=6*t-12*r+6*o,p=-3*t+9*r-9*o+3*s,f=3*r-3*t),Vr(p)<1e-12){if(Vr(l)<1e-12)continue;d=-f/l,07){f[d].shift();for(var m=f[d];m.length;)o[d]="A",f.splice(d++,0,["C",...m.splice(0,6)]);f.splice(d,1),u=t.length}},o=[],a="",s="",c=0,u=t.length;c=i.right,s=r.top-n.y>=i.bottom,c=r.right+n.x<=i.left,u=o?"top":s?"bottom":null,p=c?"left":a?"right":null;return p&&u?u+"-"+p:p||u||"intersect"}function Wr(e,t,n){var r=ew(e,t);return r.length===1||r.length===2&&$r(r[0],r[1])<1?Cn(r[0]):r.length>1?(r=Ct(r,function(i){var o=Math.floor(i.t2*100)||1;return o=100-o,o=(o<10?"0":"")+o,i.segment2+"#"+o}),Cn(r[n?0:r.length-1])):null}function ew(e,t){return Ra(e,t)}function Am(e){e=e.slice();for(var t=0,n,r,i;e[t];)n=e[t],r=e[t-1],i=e[t+1],$r(n,i)===0||oo(r,i,n)?e.splice(t,1):t++;return e}function tw(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function xc(e,t){return Math.round(e*t)/t}function Tm(e){return te(e)?e+"px":e}function nw(e){for(;e.parent;)e=e.parent;return e}function rw(e){e=C({},{width:"100%",height:"100%"},e);let t=e.container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),dt(n,{position:"relative",overflow:"hidden",width:Tm(e.width),height:Tm(e.height)}),t.appendChild(n),n}function Dm(e,t,n){let r=U("g");fe(r).add(t);let i=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(r,e.childNodes[i]||null),r}var iw="base",Mm=0,ow=1,aw={shape:["x","y","width","height"],connection:["waypoints"]};function le(e,t,n,r){this._eventBus=t,this._elementRegistry=r,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}le.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"];le.prototype._init=function(e){let t=this._eventBus,n=this._container=rw(e),r=this._svg=U("svg");z(r,{width:"100%",height:"100%"}),Je(r,"tabindex",0),e.autoFocus&&t.on("element.hover",()=>{this.restoreFocus()}),t.on("element.mousedown",500,o=>{this.focus()}),r.addEventListener("focusin",()=>{this._setFocused(!0)}),r.addEventListener("focusout",()=>{this._setFocused(!1)}),r.addEventListener("mouseover",()=>{this._eventBus.fire("canvas.mouseover")}),r.addEventListener("mouseout",()=>{this._eventBus.fire("canvas.mouseout")}),Q(n,r);let i=this._viewport=Dm(r,"viewport");e.deferUpdate&&(this._viewboxChanged=xa(Qe(this._viewboxChanged,this),300)),t.on("diagram.init",()=>{t.fire("canvas.init",{svg:r,viewport:i})}),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)};le.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});let e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport};le.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))};le.prototype._clear=function(){this._elementRegistry.getAll().forEach(t=>{let n=vc(t);n==="root"?this.removeRootElement(t):this._removeElement(t,n)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox};le.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)};le.prototype.restoreFocus=function(){document.activeElement===document.body&&this.focus()};le.prototype.isFocused=function(){return this._focused};le.prototype.getDefaultLayer=function(){return this.getLayer(iw,Mm)};le.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),typeof t!="undefined"&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group};le.prototype._getChildIndex=function(e){return Fe(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)};le.prototype._createLayer=function(e,t){typeof t=="undefined"&&(t=ow);let n=this._getChildIndex(t);return{group:Dm(this._viewport,"layer-"+e,n),index:t,visible:!0}};le.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");let t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");let n=this._viewport,r=t.group,i=t.index;if(t.visible)return r;let o=this._getChildIndex(i);return n.insertBefore(r,n.childNodes[o]||null),t.visible=!0,r};le.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");let t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");let n=t.group;return t.visible&&(we(n),t.visible=!1),n};le.prototype._removeLayer=function(e){let t=this._layers[e];t&&(delete this._layers[e],we(t.group))};le.prototype.getActiveLayer=function(){let e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null};le.prototype.findRoot=function(e){return typeof e=="string"&&(e=this._elementRegistry.get(e)),e?(this._findPlaneForRoot(nw(e))||{}).rootElement:void 0};le.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})};le.prototype._findPlaneForRoot=function(e){return re(this._planes,function(t){return t.rootElement===e})};le.prototype.getContainer=function(){return this._container};le.prototype._updateMarker=function(e,t,n){let r;e.id||(e=this._elementRegistry.get(e)),e.markers=e.markers||new Set,r=this._elementRegistry._elements[e.id],r&&(E([r.gfx,r.secondaryGfx],function(i){i&&(n?(e.markers.add(t),fe(i).add(t)):(e.markers.delete(t),fe(i).remove(t)))}),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))};le.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)};le.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)};le.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),e.markers?e.markers.has(t):!1};le.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)};le.prototype.getRootElement=function(){let e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))};le.prototype.addRootElement=function(e){let t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});let n=e.layer="root-"+t;this._ensureValid("root",e);let r=this.getLayer(n,Mm);return this.hideLayer(n),this._addRoot(e,r),this._planes.push({rootElement:e,layer:r}),e};le.prototype.removeRootElement=function(e){if(typeof e=="string"&&(e=this._elementRegistry.get(e)),!!this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter(function(n){return n.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e};le.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e};le.prototype._removeRoot=function(e){let t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)};le.prototype._addRoot=function(e,t){let n=this._elementRegistry,r=this._eventBus;r.fire("root.add",{element:e}),n.add(e,t),r.fire("root.added",{element:e,gfx:t})};le.prototype._setRoot=function(e,t){let n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})};le.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");let n=aw[e];if(!pn(n,function(i){return typeof t[i]!="undefined"}))throw new Error("must supply { "+n.join(", ")+" } with "+e)};le.prototype._setParent=function(e,t,n){Ce(t.children,e,n),e.parent=t};le.prototype._addElement=function(e,t,n,r){n=n||this.getRootElement();let i=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),i.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,r);let a=o.create(e,t,r);return this._elementRegistry.add(t,a),o.update(e,t,a),i.fire(e+".added",{element:t,gfx:a}),t};le.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)};le.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)};le.prototype._removeElement=function(e,t){let n=this._elementRegistry,r=this._graphicsFactory,i=this._eventBus;if(e=n.get(e.id||e),!!e)return i.fire(t+".remove",{element:e}),r.remove(e),De(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+".removed",{element:e}),n.remove(e),e};le.prototype.removeShape=function(e){return this._removeElement(e,"shape")};le.prototype.removeConnection=function(e){return this._removeElement(e,"connection")};le.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)};le.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()};le.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})};le.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);let t=this._viewport,n=this.getSize(),r,i,o,a,s,c,u;if(e)this._changeViewbox(function(){s=Math.min(n.width/e.width,n.height/e.height);let p=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);bi(t,p)});else return o=this._rootElement?this.getActiveLayer():null,r=o&&o.getBBox()||{},a=bi(t),i=a?a.matrix:lm(),s=xc(i.a,1e3),c=xc(-i.e||0,1e3),u=xc(-i.f||0,1e3),e=this._cachedViewbox={x:c?c/s:0,y:u?u/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:r.width||0,height:r.height||0,x:r.x||0,y:r.y||0},outer:n},e;return e};le.prototype.scroll=function(e){let t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=C({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),km(t,n)}),{x:n.e,y:n.f}};le.prototype.scrollToElement=function(e,t){let n=100;typeof e=="string"&&(e=this._elementRegistry.get(e));let r=this.findRoot(e);if(r!==this.getRootElement()&&this.setRootElement(r),r===e)return;t||(t={}),typeof t=="number"&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};let i=Se(e),o=Z(i),a=this.viewbox(),s=this.zoom(),c,u;a.y+=t.top/s,a.x+=t.left/s,a.width-=(t.right+t.left)/s,a.height-=(t.bottom+t.top)/s;let p=Z(a);if(!(i.width=0&&r.y>=0&&r.x+r.width<=n.width&&r.y+r.height<=n.height&&!e?o={x:0,y:0,width:Math.max(r.width+r.x,n.width),height:Math.max(r.height+r.y,n.height)}:(i=Math.min(1,n.width/r.width,n.height/r.height),o={x:r.x+(e?r.width/2-n.width/i/2:0),y:r.y+(e?r.height/2-n.height/i/2:0),width:n.width/i,height:n.height/i}),this.viewbox(o),this.viewbox(!1).scale};le.prototype._setZoom=function(e,t){let n=this._svg,r=this._viewport,i=n.createSVGMatrix(),o=n.createSVGPoint(),a,s,c,u,p;c=r.getCTM();let l=c.a;return t?(a=C(o,t),s=a.matrixTransform(c.inverse()),u=i.translate(s.x,s.y).scale(1/l*e).translate(-s.x,-s.y),p=c.multiply(u)):p=i.scale(e),km(this._viewport,p),p};le.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}};le.prototype.getAbsoluteBBox=function(e){let t=this.viewbox(),n;e.waypoints?n=this.getGraphics(e).getBBox():n=e;let r=n.x*t.scale-t.x*t.scale,i=n.y*t.scale-t.y*t.scale,o=n.width*t.scale,a=n.height*t.scale;return{x:r,y:i,width:o,height:a}};le.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var ao="data-element-id";function Vt(e){this._elements={},this._eventBus=e}Vt.$inject=["eventBus"];Vt.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),z(t,ao,r),n&&z(n,ao,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}};Vt.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&(z(r.gfx,ao,""),r.secondaryGfx&&z(r.secondaryGfx,ao,""),delete t[n])};Vt.prototype.updateId=function(e,t){this._validateId(t),typeof e=="string"&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),r=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,r)};Vt.prototype.updateGraphics=function(e,t,n){var r=e.id||e,i=this._elements[r];return n?i.secondaryGfx=t:i.gfx=t,t&&z(t,ao,r),t};Vt.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&z(e,ao);var n=this._elements[t];return n&&n.element};Vt.prototype.filter=function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(n)}),t};Vt.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),r=0;r in ref");t=this.props[t]}t.collection?Nm(this,t,e):pw(this,t,e)};ln.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return cw(n)||Nm(this,t,e),n};ln.prototype.ensureBound=function(e,t){uw(e,t)||this.bind(e,t)};ln.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)};ln.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Bl=new ln({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Bm=new ln({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Om=new ln({name:"attachers",collection:!0},{name:"host"}),Im=new ln({name:"outgoing",collection:!0},{name:"source"}),Lm=new ln({name:"incoming",collection:!0},{name:"target"});function so(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),Bl.bind(this,"parent"),Bm.bind(this,"labels"),Im.bind(this,"outgoing"),Lm.bind(this,"incoming")}function Pa(){so.call(this),Bl.bind(this,"children"),Om.bind(this,"host"),Om.bind(this,"attachers")}B(Pa,so);function jm(){so.call(this),Bl.bind(this,"children")}B(jm,Pa);function Fm(){Pa.call(this),Bm.bind(this,"labelTarget")}B(Fm,Pa);function Hm(){so.call(this),Im.bind(this,"source"),Lm.bind(this,"target")}B(Hm,so);var lw={connection:Hm,shape:Pa,label:Fm,root:jm};function $m(e,t){var n=lw[e];if(!n)throw new Error("unknown type: <"+e+">");return C(new n,t)}function zm(e){return e instanceof so}k();function Rn(){this._uid=12}Rn.prototype.createRoot=function(e){return this.create("root",e)};Rn.prototype.createLabel=function(e){return this.create("label",e)};Rn.prototype.createShape=function(e){return this.create("shape",e)};Rn.prototype.createConnection=function(e){return this.create("connection",e)};Rn.prototype.create=function(e,t){return t=C({},t||{}),t.id||(t.id=e+"_"+this._uid++),$m(e,t)};k();var Ec="__fn",Gm=1e3,fw=Array.prototype.slice;function It(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}It.prototype.on=function(e,t,n,r){if(e=q(e)?e:[e],Ne(t)&&(r=n,n=t,t=Gm),!te(t))throw new Error("priority must be a number");var i=n;r&&(i=Qe(n,r),i[Ec]=n[Ec]||n);var o=this;e.forEach(function(a){o._addListener(a,{priority:t,callback:i,next:null})})};It.prototype.once=function(e,t,n,r){var i=this;if(Ne(t)&&(r=n,n=t,t=Gm),!te(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var a=n.apply(r,arguments);return i.off(e,o),a}o[Ec]=n,this.on(e,t,o)};It.prototype.off=function(e,t){e=q(e)?e:[e];var n=this;e.forEach(function(r){n._removeListener(r,t)})};It.prototype.createEvent=function(e){var t=new Aa;return t.init(e),t};It.prototype.fire=function(e,t){var n,r,i,o;if(o=fw.call(arguments),typeof e=="object"&&(t=e,e=t.type),!e)throw new Error("no event type specified");if(r=this._listeners[e],!!r){t instanceof Aa?n=t:n=this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{i=this._invokeListeners(n,o,r)}finally{e!==a&&(n.type=a)}return i===void 0&&n.defaultPrevented&&(i=!1),i}};It.prototype.handleError=function(e){return this.fire("error",{error:e})===!1};It.prototype._destroy=function(){this._listeners={}};It.prototype._invokeListeners=function(e,t,n){for(var r;n&&!e.cancelBubble;)r=this._invokeListener(e,t,n),n=n.next;return r};It.prototype._invokeListener=function(e,t,n){var r;if(n.callback.__isTomb)return r;try{r=dw(n.callback,t),r!==void 0&&(e.returnValue=r,e.stopPropagation()),r===!1&&e.preventDefault()}catch(i){if(!this.handleError(i))throw console.error("unhandled error in event listener",i),i}return r};It.prototype._addListener=function(e,t){var n=this._getListeners(e),r;if(!n){this._setListeners(e,t);return}for(;n;){if(n.priority or , got "+e);return e=(i?i+":":"")+r,{name:e,prefix:i,localName:r}}function fn(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}fn.prototype.build=function(){return lt(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])};fn.prototype.addProperty=function(e,t,n){typeof t=="boolean"&&(n=t,t=void 0),this.addNamedProperty(e,n!==!1);var r=this.properties;t!==void 0?r.splice(t,0,e):r.push(e)};fn.prototype.replaceProperty=function(e,t,n){var r=e.ns,i=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var s=i.indexOf(e);if(s===-1)throw new Error("property <"+r.name+"> not found in property list");i.splice(s,1),this.addProperty(t,n?void 0:s,a),o[r.name]=o[r.localName]=t};fn.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,i=t.split("#"),o=Rt(i[0],r),a=Rt(i[1],o.prefix).name,s=this.propertiesByName[a];if(s)this.replaceProperty(s,e,n);else throw new Error("refined property <"+a+"> not found");delete e.redefines};fn.prototype.addNamedProperty=function(e,t){var n=e.ns,r=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),r[n.name]=r[n.localName]=e};fn.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]};fn.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e};fn.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e};fn.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)};fn.prototype.assertNotDefined=function(e,t){var n=e.name,r=this.propertiesByName[n];if(r)throw new Error("property <"+n+"> already defined; override of <"+r.definedBy.ns.name+"#"+r.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")};fn.prototype.hasProperty=function(e){return this.propertiesByName[e]};fn.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,r=this.allTypes,i=e.name;i in n||(E(e.properties,Qe(function(o){o=C({},o,{name:o.ns.localName,inherited:t}),Object.defineProperty(o,"definedBy",{value:e});var a=o.replaces,s=o.redefines;a||s?this.redefineProperty(o,a||s,a):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),r.push(e),n[i]=e)};function Ur(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,E(e,Qe(this.registerPackage,this))}Ur.prototype.getPackage=function(e){return this.packageMap[e]};Ur.prototype.getPackages=function(){return this.packages};Ur.prototype.registerPackage=function(e){e=C({},e);var t=this.packageMap;qm(t,e,"prefix"),qm(t,e,"uri"),E(e.types,Qe(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)};Ur.prototype.registerType=function(e,t){e=C({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:C(e.meta||{})});var n=Rt(e.name,t.prefix),r=n.name,i={};E(e.properties,Qe(function(o){var a=Rt(o.name,n.prefix),s=a.name;Il(o.type)||(o.type=Rt(o.type,a.prefix).name),C(o,{ns:a,name:s}),i[s]=o},this)),C(e,{ns:n,name:r,propertiesByName:i}),E(e.extends,Qe(function(o){var a=Rt(o,n.prefix),s=this.typeMap[a.name];s.traits=s.traits||[],s.traits.push(r)},this)),this.definePackage(e,t),this.typeMap[r]=e};Ur.prototype.mapTypes=function(e,t,n){var r=Il(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(c,u){var p=Rt(c,Il(c)?"":e.prefix);i.mapTypes(p,t,u)}function a(c){return o(c,!0)}function s(c){return o(c,!1)}if(!r)throw new Error("unknown type <"+e.name+">");E(r.superClass,n?a:s),t(r,!n),E(r.traits,a)};Ur.prototype.getEffectiveDescriptor=function(e){var t=Rt(e),n=new fn(t);this.mapTypes(t,function(i,o){n.addTrait(i,o)});var r=n.build();return this.definePackage(r,r.allTypes[r.allTypes.length-1].$pkg),r};Ur.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};function qm(e,t,n){var r=t[n];if(r in e)throw new Error("package with "+n+" <"+r+"> already defined")}function Ei(e){this.model=e}Ei.prototype.set=function(e,t,n){if(!it(t)||!t.length)throw new TypeError("property name must be a non-empty string");var r=this.getProperty(e,t),i=r&&r.name;gw(n)?r?delete e[i]:delete e.$attrs[Ll(t)]:r?i in e?e[i]=n:Xm(e,r,n):e.$attrs[Ll(t)]=n};Ei.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[Ll(t)];var r=n.name;return!e[r]&&n.isMany&&Xm(e,n,[]),e[r]};Ei.prototype.define=function(e,t,n){if(!n.writable){var r=n.value;n=C({},n,{get:function(){return r}}),delete n.value}Object.defineProperty(e,t,n)};Ei.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})};Ei.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})};Ei.prototype.getProperty=function(e,t){var n=this.model,r=n.getPropertyDescriptor(e,t);if(r)return r;if(t.includes(":"))return null;let i=n.config.strict;if(typeof i!="undefined"){let o=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(i)throw o;typeof console!="undefined"&&console.warn(o)}return null};function gw(e){return typeof e=="undefined"}function Xm(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Ll(e){return e.replace(/^:/,"")}function en(e,t={}){this.properties=new Ei(this),this.factory=new Km(this,this.properties),this.registry=new Ur(e,this.properties),this.typeCache={},this.config=t}en.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)};en.prototype.getType=function(e){var t=this.typeCache,n=it(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r};en.prototype.createAny=function(e,t,n){var r=Rt(e),i={$type:e,$instanceOf:function(a){return a===this.$type},get:function(a){return this[a]},set:function(a,s){yl(this,[a],s)}},o={name:e,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:t}};return this.properties.defineDescriptor(i,o),this.properties.defineModel(i,this),this.properties.define(i,"get",{enumerable:!1,writable:!0}),this.properties.define(i,"set",{enumerable:!1,writable:!0}),this.properties.define(i,"$parent",{enumerable:!1,writable:!0}),this.properties.define(i,"$instanceOf",{enumerable:!1,writable:!0}),E(n,function(a,s){Ee(a)&&a.value!==void 0?i[a.name]=a.value:i[s]=a}),i};en.prototype.getPackage=function(e){return this.registry.getPackage(e)};en.prototype.getPackages=function(){return this.registry.getPackages()};en.prototype.getElementDescriptor=function(e){return e.$descriptor};en.prototype.hasType=function(e,t){t===void 0&&(t=e,e=this);var n=e.$model.getElementDescriptor(e);return t in n.allTypesByName};en.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]};en.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};k();var Zm=String.fromCharCode,yw=Object.prototype.hasOwnProperty,_w=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,Ta={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(Ta).forEach(function(e){Ta[e.toUpperCase()]=Ta[e]});function bw(e,t,n,r){return r?yw.call(Ta,r)?Ta[r]:"&"+r+";":Zm(t||parseInt(n,16))}function wi(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(_w,bw):e}var Qm="non-whitespace outside of root node";function uo(e){return new Error(e)}function Jm(e){return"missing namespace for prefix <"+e+">"}function Cc(e){return{get:e,enumerable:!0}}function xw(e){var t={},n;for(n in e)t[n]=e[n];return t}function Hl(e){return e+"$uri"}function Ew(e){var t={},n,r;for(n in e)r=e[n],t[r]=r,t[Hl(r)]=n;return t}function eh(){return{line:0,column:0}}function ww(e){throw e}function $l(e){if(!this)return new $l(e);var t=e&&e.proxy,n,r,i,o,a=ww,s,c,u,p,l=eh,f=!1,d=!1,m=null,y=!1,v;function w(b){b instanceof Error||(b=uo(b)),m=b,a(b,l)}function R(b){s&&(b instanceof Error||(b=uo(b)),s(b,l))}this.on=function(b,S){if(typeof S!="function")throw uo("required args ");switch(b){case"openTag":r=S;break;case"text":n=S;break;case"closeTag":i=S;break;case"error":a=S;break;case"warn":s=S;break;case"cdata":o=S;break;case"attention":p=S;break;case"question":u=S;break;case"comment":c=S;break;default:throw uo("unsupported event: "+b)}return this},this.ns=function(b){if(typeof b=="undefined"&&(b={}),typeof b!="object")throw uo("required args ");var S={},A;for(A in b)S[A]=b[A];return d=!0,v=S,this},this.parse=function(b){if(typeof b!="string")throw uo("required args ");return m=null,x(b),l=eh,y=!1,m},this.stop=function(){y=!0};function x(b){var S=d?[]:null,A=d?Ew(v):null,O,D=[],L=0,I=!1,$=!1,G=0,K=0,pe,bn,ke,ye,Zt,Qt,Ke,bt,H,V="",ie=0,be;function $t(){if(be!==null)return be;var _,g,T,M=d&&A.xmlns,F=d&&f?[]:null,W=ie,ae=V,_e=ae.length,pt,rt,xt,xn,Me,hr={},ac={},un,he,Re;e:for(;W<_e;W++)if(un=!1,he=ae.charCodeAt(W),!(he===32||he<14&&he>8)){for((he<65||he>122||he>90&&he<97)&&he!==95&&he!==58&&(R("illegal first char attribute name"),un=!0),Re=W+1;Re<_e;Re++)if(he=ae.charCodeAt(Re),!(he>96&&he<123||he>64&&he<91||he>47&&he<59||he===46||he===45||he===95)){if(he===32||he<14&&he>8){R("missing attribute value"),W=Re;continue e}if(he===61)break;R("illegal attribute name char"),un=!0}if(Me=ae.substring(W,Re),Me==="xmlns:xmlns"&&(R("illegal declaration of xmlns"),un=!0),he=ae.charCodeAt(Re+1),he===34)Re=ae.indexOf('"',W=Re+2),Re===-1&&(Re=ae.indexOf("'",W),Re!==-1&&(R("attribute value quote missmatch"),un=!0));else if(he===39)Re=ae.indexOf("'",W=Re+2),Re===-1&&(Re=ae.indexOf('"',W),Re!==-1&&(R("attribute value quote missmatch"),un=!0));else for(R("missing attribute value quotes"),un=!0,Re=Re+1;Re<_e&&(he=ae.charCodeAt(Re+1),!(he===32||he<14&&he>8));Re++);for(Re===-1&&(R("missing closing quotes"),Re=_e,un=!0),un||(xt=ae.substring(W,Re)),W=Re;Re+1<_e&&(he=ae.charCodeAt(Re+1),!(he===32||he<14&&he>8));Re++)W===Re&&(R("illegal character after attribute end"),un=!0);if(W=Re+1,un)continue e;if(Me in ac){R("attribute <"+Me+"> already defined");continue}if(ac[Me]=!0,!d){hr[Me]=xt;continue}if(f){if(rt=Me==="xmlns"?"xmlns":Me.charCodeAt(0)===120&&Me.substr(0,6)==="xmlns:"?Me.substr(6):null,rt!==null){if(_=wi(xt),g=Hl(rt),xn=v[_],!xn){if(rt==="xmlns"||g in A&&A[g]!==_)do xn="ns"+L++;while(typeof A[xn]!="undefined");else xn=rt;v[_]=xn}A[rt]!==xn&&(pt||(A=xw(A),pt=!0),A[rt]=xn,rt==="xmlns"&&(A[Hl(xn)]=_,M=xn),A[g]=_),hr[Me]=xt;continue}F.push(Me,xt);continue}if(he=Me.indexOf(":"),he===-1){hr[Me]=xt;continue}if(!(T=A[Me.substring(0,he)])){R(Jm(Me.substring(0,he)));continue}Me=M===T?Me.substr(he+1):T+Me.substr(he),hr[Me]=xt}if(f)for(W=0,_e=F.length;W<_e;W++){if(Me=F[W++],xt=F[W],he=Me.indexOf(":"),he!==-1){if(!(T=A[Me.substring(0,he)])){R(Jm(Me.substring(0,he)));continue}Me=M===T?Me.substr(he+1):T+Me.substr(he)}hr[Me]=xt}return be=hr}function P(){for(var _=/(\r\n|\r|\n)/g,g=0,T=0,M=0,F=K,W,ae;G>=M&&(W=_.exec(b),!(!W||(F=W[0].length+W.index,F>G)));)g+=1,M=F;return G==-1?(T=F,ae=b.substring(K)):K===0?ae=b.substring(K,G):(T=G-M,ae=K==-1?b.substring(G):b.substring(G,K+1)),{data:ae,line:g,column:T}}for(l=P,t&&(H=Object.create({},{name:Cc(function(){return Ke}),originalName:Cc(function(){return bt}),attrs:Cc($t),ns:Cc(function(){return A})}));K!==-1;){if(b.charCodeAt(K)===60?G=K:G=b.indexOf("<",K),G===-1){if(D.length)return w("unexpected end of file");if(K===0)return w("missing start tag");K",G),K===-1)return w("unclosed cdata");if(o&&(o(b.substring(G+9,K),l),y))return;K+=3;continue}if(ke===45&&b.charCodeAt(G+3)===45){if(K=b.indexOf("-->",G),K===-1)return w("unclosed comment");if(c&&(c(b.substring(G+4,K),wi,l),y))return;K+=3;continue}}if(ye===63){if(K=b.indexOf("?>",G),K===-1)return w("unclosed question");if(u&&(u(b.substring(G,K+2),l),y))return;K+=2;continue}for(pe=G+1;;pe++){if(Zt=b.charCodeAt(pe),isNaN(Zt))return K=-1,w("unclosed tag");if(Zt===34)ke=b.indexOf('"',pe+1),pe=ke!==-1?ke:pe;else if(Zt===39)ke=b.indexOf("'",pe+1),pe=ke!==-1?ke:pe;else if(Zt===62){K=pe;break}}if(ye===33){if(p&&(p(b.substring(G,K+1),wi,l),y))return;K+=1;continue}if(be={},ye===47){if(I=!1,$=!0,!D.length)return w("missing open tag");if(pe=Ke=D.pop(),ke=G+2+pe.length,b.substring(G+2,ke)!==pe)return w("closing tag mismatch");for(;ke8&&ye<14))return w("close tag")}else{if(b.charCodeAt(K-1)===47?(pe=Ke=b.substring(G+1,K-1),I=!0,$=!0):(pe=Ke=b.substring(G+1,K),I=!0,$=!1),!(ye>96&&ye<123||ye>64&&ye<91||ye===95||ye===58))return w("illegal first char nodeName");for(ke=1,bn=pe.length;ke96&&ye<123||ye>64&&ye<91||ye>47&&ye<59||ye===45||ye===95||ye==46)){if(ye===32||ye<14&&ye>8){Ke=pe.substring(0,ke),be=null;break}return w("invalid nodeName")}$||D.push(Ke)}if(d){if(O=A,I&&($||S.push(O),be===null&&(f=pe.indexOf("xmlns",ke)!==-1)&&(ie=ke,V=pe,$t(),f=!1)),bt=Ke,ye=Ke.indexOf(":"),ye!==-1){if(Qt=A[Ke.substring(0,ye)],!Qt)return w("missing namespace on <"+bt+">");Ke=Ke.substr(ye+1)}else Qt=A.xmlns;Qt&&(Ke=Qt+":"+Ke)}if(I&&(ie=ke,V=pe,r&&(t?r(H,wi,$,l):r(Ke,$t,wi,$,l),y)))return;if($){if(i&&(i(t?H:Ke,wi,I,l),y))return;d&&(I?A=O:A=S.pop())}K+=1}}}function th(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var zl={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},nh="property";function rh(e){return e.xml&&e.xml.serialize}function Sw(e){let t=rh(e);return t!==nh&&(t||null)}function Cw(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ih(e,t){return th(t)?e.prefix+":"+Cw(e.localName):e.name}function Rw(e,t){var n=e.name,r=e.localName,i=t&&t.xml&&t.xml.typePrefix;return i&&r.indexOf(i)===0?e.prefix+":"+r.slice(i.length):n}function Pw(e,t,n){let r=Rt(e,t.xmlns),i=`${t[r.prefix]||r.prefix}:${r.localName}`,o=Rt(i);var a=n.getPackage(o.prefix);return Rw(o,a)}function qr(e){return new Error(e)}function _r(e){return e.$descriptor}function Aw(e){C(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw qr("expected element");var n=this.elementsById,r=_r(t),i=r.idProperty,o;if(i&&(o=t.get(i.name),o)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(o))throw new Error("illegal ID <"+o+">");if(n[o])throw qr("duplicate ID <"+o+">");n[o]=t}},this.addWarning=function(t){this.warnings.push(t)}}function Da(){}Da.prototype.handleEnd=function(){};Da.prototype.handleText=function(){};Da.prototype.handleNode=function(){};function Gl(){}Gl.prototype=Object.create(Da.prototype);Gl.prototype.handleNode=function(){return this};function lo(){}lo.prototype=Object.create(Da.prototype);lo.prototype.handleText=function(e){this.body=(this.body||"")+e};function Ma(e,t){this.property=e,this.context=t}Ma.prototype=Object.create(lo.prototype);Ma.prototype.handleNode=function(e){if(this.element)throw qr("expected no sub nodes");return this.element=this.createReference(e),this};Ma.prototype.handleEnd=function(){this.element.id=this.body};Ma.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}};function Vl(e,t){this.element=t,this.propertyDesc=e}Vl.prototype=Object.create(lo.prototype);Vl.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=Sc(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)};function Rc(){}Rc.prototype=Object.create(lo.prototype);Rc.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t};function Lt(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}Lt.prototype=Object.create(Rc.prototype);Lt.prototype.addReference=function(e){this.context.addReference(e)};Lt.prototype.handleText=function(e){var t=this.element,n=_r(t),r=n.bodyProperty;if(!r)throw qr("unexpected body text <"+e+">");lo.prototype.handleText.call(this,e)};Lt.prototype.handleEnd=function(){var e=this.body,t=this.element,n=_r(t),r=n.bodyProperty;r&&e!==void 0&&(e=Sc(r.type,e),t.set(r.name,e))};Lt.prototype.createElement=function(e){var t=e.attributes,n=this.type,r=_r(n),i=this.context,o=new n({}),a=this.model,s;return E(t,function(c,u){var p=r.propertiesByName[u],l;p&&p.isReference?p.isMany?(l=c.split(" "),E(l,function(f){i.addReference({element:o,property:p.ns.name,id:f})})):i.addReference({element:o,property:p.ns.name,id:c}):(p?c=Sc(p.type,c):u==="xmlns"?u=":"+u:(s=Rt(u,r.ns.prefix),a.getPackage(s.prefix)&&i.addWarning({message:"unknown attribute <"+u+">",element:o,property:u,value:c})),o.set(u,c))}),o};Lt.prototype.getPropertyForNode=function(e){var t=e.name,n=Rt(t),r=this.type,i=this.model,o=_r(r),a=n.name,s=o.propertiesByName[a];if(s&&!s.isAttr){let u=Sw(s);if(u){let p=e.attributes[u];if(p){let l=Pw(p,e.ns,i),f=i.getType(l);return C({},s,{effectiveType:_r(f).name})}}return s}var c=i.getPackage(n.prefix);if(c){let u=ih(n,c),p=i.getType(u);if(s=re(o.properties,function(l){return!l.isVirtual&&!l.isReference&&!l.isAttribute&&p.hasType(l.type)}),s)return C({},s,{effectiveType:_r(p).name})}else if(s=re(o.properties,function(u){return!u.isReference&&!u.isAttribute&&u.type==="Element"}),s)return s;throw qr("unrecognized element <"+n.name+">")};Lt.prototype.toString=function(){return"ElementDescriptor["+_r(this.type).name+"]"};Lt.prototype.valueHandler=function(e,t){return new Vl(e,t)};Lt.prototype.referenceHandler=function(e){return new Ma(e,this.context)};Lt.prototype.handler=function(e){return e==="Element"?new po(this.model,e,this.context):new Lt(this.model,e,this.context)};Lt.prototype.handleChild=function(e){var t,n,r,i;if(t=this.getPropertyForNode(e),r=this.element,n=t.effectiveType||t.type,Fl(n))return this.valueHandler(t,r);t.isReference?i=this.referenceHandler(t).handleNode(e):i=this.handler(n).handleNode(e);var o=i.element;return o!==void 0&&(t.isMany?r.get(t.name).push(o):r.set(t.name,o),t.isReference?(C(o,{element:r}),this.context.addReference(o)):o.$parent=r),i};function Wl(e,t,n){Lt.call(this,e,t,n)}Wl.prototype=Object.create(Lt.prototype);Wl.prototype.createElement=function(e){var t=e.name,n=Rt(t),r=this.model,i=this.type,o=r.getPackage(n.prefix),a=o&&ih(n,o)||t;if(!i.hasType(a))throw qr("unexpected element <"+e.originalName+">");return Lt.prototype.createElement.call(this,e)};function po(e,t,n){this.model=e,this.context=n}po.prototype=Object.create(Rc.prototype);po.prototype.createElement=function(e){var t=e.name,n=Rt(t),r=n.prefix,i=e.ns[r+"$uri"],o=e.attributes;return this.model.createAny(t,i,o)};po.prototype.handleChild=function(e){var t=new po(this.model,"Element",this.context).handleNode(e),n=this.element,r=t.element,i;return r!==void 0&&(i=n.$children=n.$children||[],i.push(r),r.$parent=n),t};po.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function Pc(e){e instanceof en&&(e={model:e}),C(this,{lax:!1},e)}Pc.prototype.fromXML=function(e,t,n){var r=t.rootHandler;t instanceof Lt?(r=t,t={}):typeof t=="string"?(r=this.handler(t),t={}):typeof r=="string"&&(r=this.handler(r));var i=this.model,o=this.lax,a=new Aw(C({},t,{rootHandler:r})),s=new $l({proxy:!0}),c=Tw();r.context=a,c.push(r);function u(S,A,O){var D=A(),L=D.line,I=D.column,$=D.data;$.charAt(0)==="<"&&$.indexOf(" ")!==-1&&($=$.slice(0,$.indexOf(" "))+">");var G="unparsable content "+($?$+" ":"")+`detected + line: `+L+` column: `+I+` - nested error: `+S.message;if(O)return a.addWarning({message:z,error:S}),!0;throw jr(z)}function u(S,A){return p(S,A,!0)}function l(){var S=a.elementsById,A=a.references,O,M;for(O=0;M=A[O];O++){var B=M.element,I=S[M.id],H=sr(B).propertiesByName[M.property];if(I||a.addWarning({message:"unresolved reference <"+M.id+">",element:M.element,property:M.property,value:M.id}),H.isMany){var z=B.get(H.name),K=z.indexOf(M);K===-1&&(K=z.length),I?z[K]=I:z.splice(K,1)}else B.set(H.name,I)}}function f(){c.pop().handleEnd()}var d=/^<\?xml /i,h=/ encoding="([^"]+)"/i,_=/^utf-8$/i;function v(S){if(d.test(S)){var A=h.exec(S),O=A&&A[1];!O||_.test(O)||a.addWarning({message:"unsupported document encoding <"+O+">, falling back to UTF-8"})}}function w(S,A){var O=c.peek();try{c.push(O.handleNode(S))}catch(M){p(M,A,o)&&c.push(new bl)}}function P(S,A){try{c.peek().handleText(S)}catch(O){u(O,A)}}function b(S,A){S.trim()&&P(S,A)}var x=i.getPackages().reduce(function(S,A){return S[A.uri]=A.prefix,S},Object.entries(xl).reduce(function(S,[A,O]){return S[O]=A,S},i.config&&i.config.nsMap||{}));return s.ns(x).on("openTag",function(S,A,O,M){var B=S.attrs||{},I=Object.keys(B).reduce(function(z,K){var ce=A(B[K]);return z[K]=ce,z},{}),H={name:S.name,originalName:S.originalName,attributes:I,ns:S.ns};w(H,M)}).on("question",v).on("closeTag",f).on("cdata",P).on("text",function(S,A,O){b(A(S),O)}).on("error",p).on("warn",u),new Promise(function(S,A){var O;try{s.parse(e),l()}catch(z){O=z}var M=r.element;!O&&!M&&(O=jr("failed to parse document as <"+r.type.$descriptor.name+">"));var B=a.warnings,I=a.references,H=a.elementsById;return O?(O.warnings=B,A(O)):S({rootElement:M,elementsById:H,references:I,warnings:B})})};fc.prototype.handler=function(e){return new wl(this.model,e)};function mE(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}var gE=` -`,vE=/<|>|'|"|&|\n\r|\n/g,ah=/<|>|&/g;function Wn(e){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=e,this.defaultPrefixMap=e&&e.defaultPrefixMap||{}}Wn.prototype.mapDefaultPrefixes=function(e){this.defaultPrefixMap=e};Wn.prototype.defaultUriByPrefix=function(e){return this.defaultPrefixMap[e]};Wn.prototype.byUri=function(e){return this.uriMap[e]||this.parent&&this.parent.byUri(e)};Wn.prototype.add=function(e,t){this.uriMap[e.uri]=e,t?this.wellknown.push(e):this.custom.push(e),this.mapPrefix(e.prefix,e.uri)};Wn.prototype.uriByPrefix=function(e){return this.prefixMap[e||"xmlns"]||this.parent&&this.parent.uriByPrefix(e)};Wn.prototype.mapPrefix=function(e,t){this.prefixMap[e||"xmlns"]=t};Wn.prototype.getNSKey=function(e){return e.prefix!==void 0?e.uri+"|"+e.prefix:e.uri};Wn.prototype.logUsed=function(e){var t=e.uri,n=this.getNSKey(e);this.used[n]=this.byUri(t),this.parent&&this.parent.logUsed(e)};Wn.prototype.getUsed=function(e){var t=[].concat(this.wellknown,this.custom);return t.filter(n=>{var r=this.getNSKey(n);return this.used[r]})};function yE(e){return e.charAt(0).toLowerCase()+e.slice(1)}function _E(e,t){return nh(t)?yE(e):e}function sh(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function ch(e){return et(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function xE(e){return e.getUsed().filter(function(t){return t.prefix!=="xml"}).map(function(t){var n="xmlns"+(t.prefix?":"+t.prefix:"");return{name:n,value:t.uri}})}function bE(e,t){return t.isGeneric?C({localName:t.ns.localName},e):C({localName:_E(t.ns.localName,t.$pkg)},e)}function EE(e,t){return C({localName:t.ns.localName},e)}function wE(e){var t=e.$descriptor;return J(t.properties,function(n){var r=n.name;if(n.isVirtual||!tt(e,r))return!1;var i=e[r];return i===n.default||i===null?!1:n.isMany?i.length:!0})}var SE={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},CE={"<":"lt",">":"gt","&":"amp"};function ph(e,t,n){return e=et(e)?e:""+e,e.replace(t,function(r){return"&"+n[r]+";"})}function RE(e){return ph(e,vE,SE)}function PE(e){return ph(e,ah,CE)}function AE(e){return J(e,function(t){return t.isAttr})}function TE(e){return J(e,function(t){return!t.isAttr})}function Sl(e){this.tagName=e}Sl.prototype.build=function(e){return this.element=e,this};Sl.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"").appendNewLine()};function di(){}di.prototype.serializeValue=di.prototype.serializeTo=function(e){e.append(this.escape?PE(this.value):this.value)};di.prototype.build=function(e,t){return this.value=t,e.type==="String"&&t.search(ah)!==-1&&(this.escape=!0),this};function Cl(e){this.tagName=e}sh(Cl,di);Cl.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("").appendNewLine()};function $e(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}$e.prototype.build=function(e){this.element=e;var t=e.$descriptor,n=this.propertyDescriptor,r,i,o=t.isGeneric;return o?r=this.parseGenericNsAttributes(e):r=this.parseNsAttributes(e),n?this.ns=this.nsPropertyTagName(n):this.ns=this.nsTagName(t),this.tagName=this.addTagName(this.ns),o?this.parseGenericContainments(e):(i=wE(e),this.parseAttributes(AE(i)),this.parseContainments(TE(i))),this.parseGenericAttributes(e,r),this};$e.prototype.nsTagName=function(e){var t=this.logNamespaceUsed(e.ns);return bE(t,e)};$e.prototype.nsPropertyTagName=function(e){var t=this.logNamespaceUsed(e.ns);return EE(t,e)};$e.prototype.isLocalNs=function(e){return e.uri===this.ns.uri};$e.prototype.nsAttributeName=function(e){var t;if(et(e)?t=_t(e):t=e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:C({localName:t.localName},n)};$e.prototype.parseGenericNsAttributes=function(e){return Object.entries(e).filter(([t,n])=>!t.startsWith("$")&&this.parseNsAttribute(e,t,n)).map(([t,n])=>({name:t,value:n}))};$e.prototype.parseGenericContainments=function(e){var t=e.$body;t&&this.body.push(new di().build({type:"String"},t));var n=e.$children;n&&E(n,r=>{this.body.push(new $e(this).build(r))})};$e.prototype.parseNsAttribute=function(e,t,n){var r=e.$model,i=_t(t),o;if(i.prefix==="xmlns"&&(o={prefix:i.localName,uri:n}),!i.prefix&&i.localName==="xmlns"&&(o={uri:n}),!o)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(o,!0,!0);else{var a=this.logNamespaceUsed(o,!0);this.getNamespaces().logUsed(a)}};$e.prototype.parseNsAttributes=function(e){var t=this,n=e.$attrs,r=[];return E(n,function(i,o){var a=t.parseNsAttribute(e,o,i);a&&r.push(a)}),r};$e.prototype.parseGenericAttributes=function(e,t){var n=this;E(t,function(r){try{n.addAttribute(n.nsAttributeName(r.name),r.value)}catch(i){typeof console!="undefined"&&console.warn(`missing namespace information for <${r.name}=${r.value}> on`,e,i)}})};$e.prototype.parseContainments=function(e){var t=this,n=this.body,r=this.element;E(e,function(i){var o=r.get(i.name),a=i.isReference,s=i.isMany;if(s||(o=[o]),i.isBody)n.push(new di().build(i,o[0]));else if(vl(i.type))E(o,function(p){n.push(new Cl(t.addTagName(t.nsPropertyTagName(i))).build(i,p))});else if(a)E(o,function(p){n.push(new Sl(t.addTagName(t.nsPropertyTagName(i))).build(p))});else{var c=ih(i);E(o,function(p){var u;c?c===rh?u=new $e(t,i):u=new dc(t,i,c):u=new $e(t),n.push(u.build(p))})}})};$e.prototype.getNamespaces=function(e){var t=this.namespaces,n=this.parent,r;return t||(r=n&&n.getNamespaces(),e||!r?this.namespaces=t=new Wn(r):t=r),t};$e.prototype.logNamespace=function(e,t,n){var r=this.getNamespaces(n),i=e.uri,o=e.prefix,a=r.byUri(i);return(!a||n)&&r.add(e,t),r.mapPrefix(o,i),e};$e.prototype.logNamespaceUsed=function(e,t){var n=this.getNamespaces(t),r=e.prefix,i=e.uri,o,a,s;if(!r&&!i)return{localName:e.localName};if(s=n.defaultUriByPrefix(r),i=i||s||n.uriByPrefix(r),!i)throw new Error("no namespace uri given for prefix <"+r+">");if(e=n.byUri(i),!e&&!r&&(e=this.logNamespace({uri:i},s===i,!0)),!e){for(o=r,a=1;n.uriByPrefix(o);)o=r+"_"+a++;e=this.logNamespace({prefix:o,uri:i},s===i)}return r&&n.mapPrefix(r,i),e};$e.prototype.parseAttributes=function(e){var t=this,n=this.element;E(e,function(r){var i=n.get(r.name);if(r.isReference)if(!r.isMany)i=i.id;else{var o=[];E(i,function(a){o.push(a.id)}),i=o.join(" ")}t.addAttribute(t.nsAttributeName(r),i)})};$e.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),ch(e)};$e.prototype.addAttribute=function(e,t){var n=this.attrs;et(t)&&(t=RE(t));var r=Ks(n,function(o){return o.name.localName===e.localName&&o.name.uri===e.uri&&o.name.prefix===e.prefix}),i={name:e,value:t};r!==-1?n.splice(r,1,i):n.push(i)};$e.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=xE(n).concat(t)),E(t,function(r){e.append(" ").append(ch(r.name)).append('="').append(r.value).append('"')})};$e.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==di;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),E(this.body,function(r){r.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("")),e.appendNewLine()};function dc(e,t,n){$e.call(this,e,t),this.serialization=n}sh(dc,$e);dc.prototype.parseNsAttributes=function(e){var t=$e.prototype.parseNsAttributes.call(this,e).filter(a=>a.name!==this.serialization),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var r=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var i=e.$model.getPackage(r.uri),o=i.xml&&i.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(this.serialization),(r.prefix?r.prefix+":":"")+o+n.ns.localName),t};dc.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri};function ME(){this.value="",this.write=function(e){this.value+=e}}function DE(e,t){var n=[""];this.append=function(r){return e.write(r),this},this.appendNewLine=function(){return t&&e.write(` -`),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function uh(e){e=C({format:!1,preamble:!0},e||{});function t(n,r){var i=r||new ME,o=new DE(i,e.format);e.preamble&&o.append(gE);var a=new $e,s=n.$model;if(a.getNamespaces().mapDefaultPrefixes(kE(s)),a.build(n).serializeTo(o),!r)return i.value}return{toXML:t}}function kE(e){let t=e.config&&e.config.nsMap||{},n={};for(let r in xl)n[r]=xl[r];for(let r in t){let i=t[r];n[i]=r}for(let r of e.getPackages())n[r.prefix]=r.uri;return n}function hc(e,t){Ut.call(this,e,t)}hc.prototype=Object.create(Ut.prototype);hc.prototype.fromXML=function(e,t,n){et(t)||(n=t,t="bpmn:Definitions");var r=new fc(C({model:this,lax:!0},n)),i=r.handler(t);return r.fromXML(e,i)};hc.prototype.toXML=function(e,t){var n=new uh(t);return new Promise(function(r,i){try{var o=n.toXML(e);return r({xml:o})}catch(a){return i(a)}})};var OE="BPMN20",NE="http://www.omg.org/spec/BPMN/20100524/MODEL",BE="bpmn",IE=[],LE=[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],jE=[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],FE={tagAlias:"lowerCase",typePrefix:"t"},HE={name:OE,uri:NE,prefix:BE,associations:IE,types:LE,enumerations:jE,xml:FE},$E="BPMNDI",zE="http://www.omg.org/spec/BPMN/20100524/DI",VE="bpmndi",WE=[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],GE=[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],UE=[],KE={name:$E,uri:zE,prefix:VE,types:WE,enumerations:GE,associations:UE},YE="DC",qE="http://www.omg.org/spec/DD/20100524/DC",XE="dc",ZE=[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],QE=[],JE={name:YE,uri:qE,prefix:XE,types:ZE,associations:QE},e0="DI",t0="http://www.omg.org/spec/DD/20100524/DI",n0="di",r0=[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],i0=[],o0={tagAlias:"lowerCase"},a0={name:e0,uri:t0,prefix:n0,types:r0,associations:i0,xml:o0},s0="bpmn.io colors for BPMN",c0="http://bpmn.io/schema/bpmn/biocolor/1.0",p0="bioc",u0=[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],l0=[],f0=[],d0={name:s0,uri:c0,prefix:p0,types:u0,enumerations:l0,associations:f0},h0="BPMN in Color",m0="http://www.omg.org/spec/BPMN/non-normative/color/1.0",g0="color",v0=[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],y0=[],_0=[],x0={name:h0,uri:m0,prefix:g0,types:v0,enumerations:y0,associations:_0},b0={bpmn:HE,bpmndi:KE,dc:JE,di:a0,bioc:d0,color:x0};function lh(e,t){let n=C({},b0,e);return new hc(n,t)}function gt(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':""}var E0="Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472";function mc(e){tt(e,"di")||Object.defineProperty(e,"di",{enumerable:!1,get:function(){throw new Error(E0)}})}function jt(e,t){return e.$instanceOf(t)}function w0(e){return ne(e.rootElements,function(t){return jt(t,"bpmn:Process")||jt(t,"bpmn:Collaboration")})}function Rl(e){var t={},n=[],r={};function i(F,V){return function(re){F(re,V)}}function o(F){t[F.id]=F}function a(F){return t[F.id]}function s(F,V){var re=F.gfx;if(re)throw new Error(`already rendered ${gt(F)}`);return e.element(F,r[F.id],V)}function c(F,V){return e.root(F,r[F.id],V)}function p(F,V){try{var re=r[F.id]&&s(F,V);return o(F),re}catch(_e){u(_e.message,{element:F,error:_e}),console.error(`failed to import ${gt(F)}`,_e)}}function u(F,V){e.error(F,V)}var l=this.registerDi=function(V){var re=V.bpmnElement;re?r[re.id]?u(`multiple DI elements defined for ${gt(re)}`,{element:re}):(r[re.id]=V,mc(re)):u(`no bpmnElement referenced in ${gt(V)}`,{element:V})};function f(F){d(F.plane)}function d(F){l(F),E(F.planeElement,h)}function h(F){l(F)}this.handleDefinitions=function(V,re){var _e=V.diagrams;if(re&&_e.indexOf(re)===-1)throw new Error("diagram not part of ");if(!re&&_e&&_e.length&&(re=_e[0]),!re)throw new Error("no diagram to display");r={},f(re);var Ot=re.plane;if(!Ot)throw new Error(`no plane for ${gt(re)}`);var R=Ot.bpmnElement;if(!R)if(R=w0(V),R)u(`correcting missing bpmnElement on ${gt(Ot)} to ${gt(R)}`),Ot.bpmnElement=R,l(Ot);else throw new Error("no process or collaboration to display");var y=c(R,Ot);if(jt(R,"bpmn:Process")||jt(R,"bpmn:SubProcess"))v(R,y);else if(jt(R,"bpmn:Collaboration"))We(R,y),w(V.rootElements,y);else throw new Error(`unsupported bpmnElement for ${gt(Ot)}: ${gt(R)}`);_(n)};var _=this.handleDeferred=function(){for(var V;n.length;)V=n.shift(),V()};function v(F,V){ge(F,V),B(F.ioSpecification,V),M(F.artifacts,V),o(F)}function w(F,V){var re=J(F,function(_e){return!a(_e)&&jt(_e,"bpmn:Process")&&_e.laneSets});re.forEach(i(v,V))}function P(F,V){p(F,V)}function b(F,V){E(F,i(P,V))}function x(F,V){p(F,V)}function S(F,V){p(F,V)}function A(F,V){p(F,V)}function O(F,V){p(F,V)}function M(F,V){E(F,function(re){jt(re,"bpmn:Association")?n.push(function(){O(re,V)}):O(re,V)})}function B(F,V){F&&(E(F.dataInputs,i(S,V)),E(F.dataOutputs,i(A,V)))}var I=this.handleSubProcess=function(V,re){ge(V,re),M(V.artifacts,re)};function H(F,V){var re=p(F,V);jt(F,"bpmn:SubProcess")&&I(F,re||V),jt(F,"bpmn:Activity")&&B(F.ioSpecification,V),n.push(function(){E(F.dataInputAssociations,i(x,V)),E(F.dataOutputAssociations,i(x,V))})}function z(F,V){p(F,V)}function K(F,V){p(F,V)}function ce(F,V){n.push(function(){var re=p(F,V);F.childLaneSet&&ln(F.childLaneSet,re||V),ht(F)})}function ln(F,V){E(F.lanes,i(ce,V))}function De(F,V){E(F,i(ln,V))}function ge(F,V){Vt(F.flowElements,V),F.laneSets&&De(F.laneSets,V)}function Vt(F,V){E(F,function(re){jt(re,"bpmn:SequenceFlow")?n.push(function(){z(re,V)}):jt(re,"bpmn:BoundaryEvent")?n.unshift(function(){H(re,V)}):jt(re,"bpmn:FlowNode")?H(re,V):jt(re,"bpmn:DataObject")||(jt(re,"bpmn:DataStoreReference")||jt(re,"bpmn:DataObjectReference")?K(re,V):u(`unrecognized flowElement ${gt(re)} in context ${gt(V&&V.businessObject)}`,{element:re,context:V}))})}function Wt(F,V){var re=p(F,V),_e=F.processRef;_e&&v(_e,re||V)}function We(F,V){E(F.participants,i(Wt,V)),n.push(function(){b(F.messageFlows,V)}),M(F.artifacts,V)}function ht(F){E(F.flowNodeRef,function(V){var re=V.get("lanes");re&&re.push(F)})}}function m(e,t){var n=L(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)}function Q(e,t){return Nt(t,function(n){return m(e,n)})}function L(e){return e&&e.businessObject||e}function se(e){return e&&e.di}function fh(e,t,n){var r,i,o,a,s=[];function c(p,u){var l={root:function(_,v){return r.add(_,v)},element:function(_,v,w){return r.add(_,v,w)},error:function(_,v){s.push({message:_,context:v})}},f=new Rl(l);u=u||p.diagrams&&p.diagrams[0];var d=S0(p,u);if(!d)throw new Error("no diagram to display");E(d,function(_){f.handleDefinitions(p,_)});var h=u.plane.bpmnElement.id;o.setRootElement(o.findRoot(h+"_plane")||o.findRoot(h))}return new Promise(function(p,u){try{return r=e.get("bpmnImporter"),i=e.get("eventBus"),o=e.get("canvas"),i.fire("import.render.start",{definitions:t}),c(t,n),i.fire("import.render.complete",{error:a,warnings:s}),p({warnings:s})}catch(l){return l.warnings=s,u(l)}})}function S0(e,t){if(!(!t||!t.plane)){var n=t.plane.bpmnElement,r=n;!m(n,"bpmn:Process")&&!m(n,"bpmn:Collaboration")&&(r=C0(n));var i;m(r,"bpmn:Collaboration")?i=r:i=ne(e.rootElements,function(p){if(m(p,"bpmn:Collaboration"))return ne(p.participants,function(u){return u.processRef===r})});var o=[r];i&&(o=He(i.participants,function(p){return p.processRef}),o.push(i));var a=dh(o),s=[t],c=[n];return E(e.diagrams,function(p){if(p.plane){var u=p.plane.bpmnElement;a.indexOf(u)!==-1&&c.indexOf(u)===-1&&(s.push(p),c.push(u))}}),s}}function dh(e){var t=[];return E(e,function(n){n&&(t.push(n),t=t.concat(dh(n.flowElements)))}),t}function C0(e){for(var t=e;t;){if(m(t,"bpmn:Process"))return t;t=t.$parent}}var R0='',Pl=R0,Al={verticalAlign:"middle"},Tl={color:"#404040"},P0={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},A0={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},T0={position:"absolute",left:"50%",top:"40%",transform:"translate(-50%)",width:"260px",padding:"10px",background:"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",display:"flex",lineHeight:"1.3"},M0='
'+Pl+'Web-based tooling for BPMN, DMN and forms powered by bpmn.io.
',Gn;function D0(){Gn=ye(M0),at(Gn,P0),at(me("svg",Gn),Al),at(me(".backdrop",Gn),A0),at(me(".notice",Gn),T0),at(me(".link",Gn),Tl,{margin:"15px 20px 15px 10px",alignSelf:"center"})}function hh(){Gn||(D0(),ut.bind(Gn,".backdrop","click",function(e){document.body.removeChild(Gn)})),document.body.appendChild(Gn)}function Be(e){e=C({},O0,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),this._init(this._container,this._moddle,e),B0(this._container)}N(Be,Vn);Be.prototype.importXML=async function(t,n){let r=this;function i(a){return r.get("eventBus").createEvent(a)}let o=[];try{t=this._emit("import.parse.start",{xml:t})||t;let a;try{a=await this._moddle.fromXML(t,"bpmn:Definitions")}catch(f){throw this._emit("import.parse.complete",{error:f}),f}let s=a.rootElement,c=a.references,p=a.warnings,u=a.elementsById;o=o.concat(p),s=this._emit("import.parse.complete",i({error:null,definitions:s,elementsById:u,references:c,warnings:o}))||s;let l=await this.importDefinitions(s,n);return o=o.concat(l.warnings),this._emit("import.done",{error:null,warnings:o}),{warnings:o}}catch(a){let s=a;throw o=o.concat(s.warnings||[]),gc(s,o),s=k0(s),this._emit("import.done",{error:s,warnings:s.warnings}),s}};Be.prototype.importDefinitions=async function(t,n){return this._setDefinitions(t),{warnings:(await this.open(n)).warnings}};Be.prototype.open=async function(t){let n=this._definitions,r=t;if(!n){let o=new Error("no XML imported");throw gc(o,[]),o}if(typeof t=="string"&&(r=N0(n,t),!r)){let o=new Error("BPMNDiagram <"+t+"> not found");throw gc(o,[]),o}try{this.clear()}catch(o){throw gc(o,[]),o}let{warnings:i}=await fh(this,n,r);return{warnings:i}};Be.prototype.saveXML=async function(t){t=t||{};let n=this._definitions,r,i;try{if(!n)throw new Error("no definitions loaded");n=this._emit("saveXML.start",{definitions:n})||n,i=(await this._moddle.toXML(n,t)).xml,i=this._emit("saveXML.serialized",{xml:i})||i}catch(a){r=a}let o=r?{error:r}:{xml:i};if(this._emit("saveXML.done",o),r)throw r;return o};Be.prototype.saveSVG=async function(){this._emit("saveSVG.start");let t,n;try{let r=this.get("canvas"),i=r.getActiveLayer(),o=me(":scope > defs",r._svg),a=rl(i),s=o?""+rl(o)+"":"",c=i.getBBox();t=` + nested error: `+S.message;if(O)return a.addWarning({message:G,error:S}),!0;throw qr(G)}function p(S,A){return u(S,A,!0)}function l(){var S=a.elementsById,A=a.references,O,D;for(O=0;D=A[O];O++){var L=D.element,I=S[D.id],$=_r(L).propertiesByName[D.property];if(I||a.addWarning({message:"unresolved reference <"+D.id+">",element:D.element,property:D.property,value:D.id}),$.isMany){var G=L.get($.name),K=G.indexOf(D);K===-1&&(K=G.length),I?G[K]=I:G.splice(K,1)}else L.set($.name,I)}}function f(){c.pop().handleEnd()}var d=/^<\?xml /i,m=/ encoding="([^"]+)"/i,y=/^utf-8$/i;function v(S){if(d.test(S)){var A=m.exec(S),O=A&&A[1];!O||y.test(O)||a.addWarning({message:"unsupported document encoding <"+O+">, falling back to UTF-8"})}}function w(S,A){var O=c.peek();try{c.push(O.handleNode(S))}catch(D){u(D,A,o)&&c.push(new Gl)}}function R(S,A){try{c.peek().handleText(S)}catch(O){p(O,A)}}function x(S,A){S.trim()&&R(S,A)}var b=i.getPackages().reduce(function(S,A){return S[A.uri]=A.prefix,S},Object.entries(zl).reduce(function(S,[A,O]){return S[O]=A,S},i.config&&i.config.nsMap||{}));return s.ns(b).on("openTag",function(S,A,O,D){var L=S.attrs||{},I=Object.keys(L).reduce(function(G,K){var pe=A(L[K]);return G[K]=pe,G},{}),$={name:S.name,originalName:S.originalName,attributes:I,ns:S.ns};w($,D)}).on("question",v).on("closeTag",f).on("cdata",R).on("text",function(S,A,O){x(A(S),O)}).on("error",u).on("warn",p),new Promise(function(S,A){var O;try{s.parse(e),l()}catch(G){O=G}var D=r.element;!O&&!D&&(O=qr("failed to parse document as <"+r.type.$descriptor.name+">"));var L=a.warnings,I=a.references,$=a.elementsById;return O?(O.warnings=L,A(O)):S({rootElement:D,elementsById:$,references:I,warnings:L})})};Pc.prototype.handler=function(e){return new Wl(this.model,e)};function Tw(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}var Dw=` +`,Mw=/<|>|'|"|&|\n\r|\n/g,oh=/<|>|&/g;function er(e){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=e,this.defaultPrefixMap=e&&e.defaultPrefixMap||{}}er.prototype.mapDefaultPrefixes=function(e){this.defaultPrefixMap=e};er.prototype.defaultUriByPrefix=function(e){return this.defaultPrefixMap[e]};er.prototype.byUri=function(e){return this.uriMap[e]||this.parent&&this.parent.byUri(e)};er.prototype.add=function(e,t){this.uriMap[e.uri]=e,t?this.wellknown.push(e):this.custom.push(e),this.mapPrefix(e.prefix,e.uri)};er.prototype.uriByPrefix=function(e){return this.prefixMap[e||"xmlns"]||this.parent&&this.parent.uriByPrefix(e)};er.prototype.mapPrefix=function(e,t){this.prefixMap[e||"xmlns"]=t};er.prototype.getNSKey=function(e){return e.prefix!==void 0?e.uri+"|"+e.prefix:e.uri};er.prototype.logUsed=function(e){var t=e.uri,n=this.getNSKey(e);this.used[n]=this.byUri(t),this.parent&&this.parent.logUsed(e)};er.prototype.getUsed=function(e){var t=[].concat(this.wellknown,this.custom);return t.filter(n=>{var r=this.getNSKey(n);return this.used[r]})};function kw(e){return e.charAt(0).toLowerCase()+e.slice(1)}function Nw(e,t){return th(t)?kw(e):e}function ah(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function sh(e){return it(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function Ow(e){return e.getUsed().filter(function(t){return t.prefix!=="xml"}).map(function(t){var n="xmlns"+(t.prefix?":"+t.prefix:"");return{name:n,value:t.uri}})}function Bw(e,t){return t.isGeneric?C({localName:t.ns.localName},e):C({localName:Nw(t.ns.localName,t.$pkg)},e)}function Iw(e,t){return C({localName:t.ns.localName},e)}function Lw(e){var t=e.$descriptor;return J(t.properties,function(n){var r=n.name;if(n.isVirtual||!ot(e,r))return!1;var i=e[r];return i===n.default||i===null?!1:n.isMany?i.length:!0})}var jw={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Fw={"<":"lt",">":"gt","&":"amp"};function ch(e,t,n){return e=it(e)?e:""+e,e.replace(t,function(r){return"&"+n[r]+";"})}function Hw(e){return ch(e,Mw,jw)}function $w(e){return ch(e,oh,Fw)}function zw(e){return J(e,function(t){return t.isAttr})}function Gw(e){return J(e,function(t){return!t.isAttr})}function Ul(e){this.tagName=e}Ul.prototype.build=function(e){return this.element=e,this};Ul.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"").appendNewLine()};function Si(){}Si.prototype.serializeValue=Si.prototype.serializeTo=function(e){e.append(this.escape?$w(this.value):this.value)};Si.prototype.build=function(e,t){return this.value=t,e.type==="String"&&t.search(oh)!==-1&&(this.escape=!0),this};function ql(e){this.tagName=e}ah(ql,Si);ql.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("").appendNewLine()};function Ve(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}Ve.prototype.build=function(e){this.element=e;var t=e.$descriptor,n=this.propertyDescriptor,r,i,o=t.isGeneric;return o?r=this.parseGenericNsAttributes(e):r=this.parseNsAttributes(e),n?this.ns=this.nsPropertyTagName(n):this.ns=this.nsTagName(t),this.tagName=this.addTagName(this.ns),o?this.parseGenericContainments(e):(i=Lw(e),this.parseAttributes(zw(i)),this.parseContainments(Gw(i))),this.parseGenericAttributes(e,r),this};Ve.prototype.nsTagName=function(e){var t=this.logNamespaceUsed(e.ns);return Bw(t,e)};Ve.prototype.nsPropertyTagName=function(e){var t=this.logNamespaceUsed(e.ns);return Iw(t,e)};Ve.prototype.isLocalNs=function(e){return e.uri===this.ns.uri};Ve.prototype.nsAttributeName=function(e){var t;if(it(e)?t=Rt(e):t=e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:C({localName:t.localName},n)};Ve.prototype.parseGenericNsAttributes=function(e){return Object.entries(e).filter(([t,n])=>!t.startsWith("$")&&this.parseNsAttribute(e,t,n)).map(([t,n])=>({name:t,value:n}))};Ve.prototype.parseGenericContainments=function(e){var t=e.$body;t&&this.body.push(new Si().build({type:"String"},t));var n=e.$children;n&&E(n,r=>{this.body.push(new Ve(this).build(r))})};Ve.prototype.parseNsAttribute=function(e,t,n){var r=e.$model,i=Rt(t),o;if(i.prefix==="xmlns"&&(o={prefix:i.localName,uri:n}),!i.prefix&&i.localName==="xmlns"&&(o={uri:n}),!o)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(o,!0,!0);else{var a=this.logNamespaceUsed(o,!0);this.getNamespaces().logUsed(a)}};Ve.prototype.parseNsAttributes=function(e){var t=this,n=e.$attrs,r=[];return E(n,function(i,o){var a=t.parseNsAttribute(e,o,i);a&&r.push(a)}),r};Ve.prototype.parseGenericAttributes=function(e,t){var n=this;E(t,function(r){try{n.addAttribute(n.nsAttributeName(r.name),r.value)}catch(i){typeof console!="undefined"&&console.warn(`missing namespace information for <${r.name}=${r.value}> on`,e,i)}})};Ve.prototype.parseContainments=function(e){var t=this,n=this.body,r=this.element;E(e,function(i){var o=r.get(i.name),a=i.isReference,s=i.isMany;if(s||(o=[o]),i.isBody)n.push(new Si().build(i,o[0]));else if(Fl(i.type))E(o,function(u){n.push(new ql(t.addTagName(t.nsPropertyTagName(i))).build(i,u))});else if(a)E(o,function(u){n.push(new Ul(t.addTagName(t.nsPropertyTagName(i))).build(u))});else{var c=rh(i);E(o,function(u){var p;c?c===nh?p=new Ve(t,i):p=new Ac(t,i,c):p=new Ve(t),n.push(p.build(u))})}})};Ve.prototype.getNamespaces=function(e){var t=this.namespaces,n=this.parent,r;return t||(r=n&&n.getNamespaces(),e||!r?this.namespaces=t=new er(r):t=r),t};Ve.prototype.logNamespace=function(e,t,n){var r=this.getNamespaces(n),i=e.uri,o=e.prefix,a=r.byUri(i);return(!a||n)&&r.add(e,t),r.mapPrefix(o,i),e};Ve.prototype.logNamespaceUsed=function(e,t){var n=this.getNamespaces(t),r=e.prefix,i=e.uri,o,a,s;if(!r&&!i)return{localName:e.localName};if(s=n.defaultUriByPrefix(r),i=i||s||n.uriByPrefix(r),!i)throw new Error("no namespace uri given for prefix <"+r+">");if(e=n.byUri(i),!e&&!r&&(e=this.logNamespace({uri:i},s===i,!0)),!e){for(o=r,a=1;n.uriByPrefix(o);)o=r+"_"+a++;e=this.logNamespace({prefix:o,uri:i},s===i)}return r&&n.mapPrefix(r,i),e};Ve.prototype.parseAttributes=function(e){var t=this,n=this.element;E(e,function(r){var i=n.get(r.name);if(r.isReference)if(!r.isMany)i=i.id;else{var o=[];E(i,function(a){o.push(a.id)}),i=o.join(" ")}t.addAttribute(t.nsAttributeName(r),i)})};Ve.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),sh(e)};Ve.prototype.addAttribute=function(e,t){var n=this.attrs;it(t)&&(t=Hw(t));var r=ba(n,function(o){return o.name.localName===e.localName&&o.name.uri===e.uri&&o.name.prefix===e.prefix}),i={name:e,value:t};r!==-1?n.splice(r,1,i):n.push(i)};Ve.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=Ow(n).concat(t)),E(t,function(r){e.append(" ").append(sh(r.name)).append('="').append(r.value).append('"')})};Ve.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Si;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),E(this.body,function(r){r.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("")),e.appendNewLine()};function Ac(e,t,n){Ve.call(this,e,t),this.serialization=n}ah(Ac,Ve);Ac.prototype.parseNsAttributes=function(e){var t=Ve.prototype.parseNsAttributes.call(this,e).filter(a=>a.name!==this.serialization),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var r=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var i=e.$model.getPackage(r.uri),o=i.xml&&i.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(this.serialization),(r.prefix?r.prefix+":":"")+o+n.ns.localName),t};Ac.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri};function Vw(){this.value="",this.write=function(e){this.value+=e}}function Ww(e,t){var n=[""];this.append=function(r){return e.write(r),this},this.appendNewLine=function(){return t&&e.write(` +`),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function uh(e){e=C({format:!1,preamble:!0},e||{});function t(n,r){var i=r||new Vw,o=new Ww(i,e.format);e.preamble&&o.append(Dw);var a=new Ve,s=n.$model;if(a.getNamespaces().mapDefaultPrefixes(Uw(s)),a.build(n).serializeTo(o),!r)return i.value}return{toXML:t}}function Uw(e){let t=e.config&&e.config.nsMap||{},n={};for(let r in zl)n[r]=zl[r];for(let r in t){let i=t[r];n[i]=r}for(let r of e.getPackages())n[r.prefix]=r.uri;return n}function Tc(e,t){en.call(this,e,t)}Tc.prototype=Object.create(en.prototype);Tc.prototype.fromXML=function(e,t,n){it(t)||(n=t,t="bpmn:Definitions");var r=new Pc(C({model:this,lax:!0},n)),i=r.handler(t);return r.fromXML(e,i)};Tc.prototype.toXML=function(e,t){var n=new uh(t);return new Promise(function(r,i){try{var o=n.toXML(e);return r({xml:o})}catch(a){return i(a)}})};var qw="BPMN20",Kw="http://www.omg.org/spec/BPMN/20100524/MODEL",Yw="bpmn",Xw=[],Zw=[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],Qw=[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],Jw={tagAlias:"lowerCase",typePrefix:"t"},eS={name:qw,uri:Kw,prefix:Yw,associations:Xw,types:Zw,enumerations:Qw,xml:Jw},tS="BPMNDI",nS="http://www.omg.org/spec/BPMN/20100524/DI",rS="bpmndi",iS=[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],oS=[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],aS=[],sS={name:tS,uri:nS,prefix:rS,types:iS,enumerations:oS,associations:aS},cS="DC",uS="http://www.omg.org/spec/DD/20100524/DC",pS="dc",lS=[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],fS=[],dS={name:cS,uri:uS,prefix:pS,types:lS,associations:fS},mS="DI",hS="http://www.omg.org/spec/DD/20100524/DI",vS="di",gS=[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],yS=[],_S={tagAlias:"lowerCase"},bS={name:mS,uri:hS,prefix:vS,types:gS,associations:yS,xml:_S},xS="bpmn.io colors for BPMN",ES="http://bpmn.io/schema/bpmn/biocolor/1.0",wS="bioc",SS=[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],CS=[],RS=[],PS={name:xS,uri:ES,prefix:wS,types:SS,enumerations:CS,associations:RS},AS="BPMN in Color",TS="http://www.omg.org/spec/BPMN/non-normative/color/1.0",DS="color",MS=[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],kS=[],NS=[],OS={name:AS,uri:TS,prefix:DS,types:MS,enumerations:kS,associations:NS},BS={bpmn:eS,bpmndi:sS,dc:dS,di:bS,bioc:PS,color:OS};function ph(e,t){let n=C({},BS,e);return new Tc(n,t)}k();k();function wt(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':""}k();var IS="Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472";function Dc(e){ot(e,"di")||Object.defineProperty(e,"di",{enumerable:!1,get:function(){throw new Error(IS)}})}function Ut(e,t){return e.$instanceOf(t)}function LS(e){return re(e.rootElements,function(t){return Ut(t,"bpmn:Process")||Ut(t,"bpmn:Collaboration")})}function Kl(e){var t={},n=[],r={};function i(H,V){return function(ie){H(ie,V)}}function o(H){t[H.id]=H}function a(H){return t[H.id]}function s(H,V){var ie=H.gfx;if(ie)throw new Error(`already rendered ${wt(H)}`);return e.element(H,r[H.id],V)}function c(H,V){return e.root(H,r[H.id],V)}function u(H,V){try{var ie=r[H.id]&&s(H,V);return o(H),ie}catch(be){p(be.message,{element:H,error:be}),console.error(`failed to import ${wt(H)}`,be)}}function p(H,V){e.error(H,V)}var l=this.registerDi=function(V){var ie=V.bpmnElement;ie?r[ie.id]?p(`multiple DI elements defined for ${wt(ie)}`,{element:ie}):(r[ie.id]=V,Dc(ie)):p(`no bpmnElement referenced in ${wt(V)}`,{element:V})};function f(H){d(H.plane)}function d(H){l(H),E(H.planeElement,m)}function m(H){l(H)}this.handleDefinitions=function(V,ie){var be=V.diagrams;if(ie&&be.indexOf(ie)===-1)throw new Error("diagram not part of ");if(!ie&&be&&be.length&&(ie=be[0]),!ie)throw new Error("no diagram to display");r={},f(ie);var $t=ie.plane;if(!$t)throw new Error(`no plane for ${wt(ie)}`);var P=$t.bpmnElement;if(!P)if(P=LS(V),P)p(`correcting missing bpmnElement on ${wt($t)} to ${wt(P)}`),$t.bpmnElement=P,l($t);else throw new Error("no process or collaboration to display");var _=c(P,$t);if(Ut(P,"bpmn:Process")||Ut(P,"bpmn:SubProcess"))v(P,_);else if(Ut(P,"bpmn:Collaboration"))Ke(P,_),w(V.rootElements,_);else throw new Error(`unsupported bpmnElement for ${wt($t)}: ${wt(P)}`);y(n)};var y=this.handleDeferred=function(){for(var V;n.length;)V=n.shift(),V()};function v(H,V){ye(H,V),L(H.ioSpecification,V),D(H.artifacts,V),o(H)}function w(H,V){var ie=J(H,function(be){return!a(be)&&Ut(be,"bpmn:Process")&&be.laneSets});ie.forEach(i(v,V))}function R(H,V){u(H,V)}function x(H,V){E(H,i(R,V))}function b(H,V){u(H,V)}function S(H,V){u(H,V)}function A(H,V){u(H,V)}function O(H,V){u(H,V)}function D(H,V){E(H,function(ie){Ut(ie,"bpmn:Association")?n.push(function(){O(ie,V)}):O(ie,V)})}function L(H,V){H&&(E(H.dataInputs,i(S,V)),E(H.dataOutputs,i(A,V)))}var I=this.handleSubProcess=function(V,ie){ye(V,ie),D(V.artifacts,ie)};function $(H,V){var ie=u(H,V);Ut(H,"bpmn:SubProcess")&&I(H,ie||V),Ut(H,"bpmn:Activity")&&L(H.ioSpecification,V),n.push(function(){E(H.dataInputAssociations,i(b,V)),E(H.dataOutputAssociations,i(b,V))})}function G(H,V){u(H,V)}function K(H,V){u(H,V)}function pe(H,V){n.push(function(){var ie=u(H,V);H.childLaneSet&&bn(H.childLaneSet,ie||V),bt(H)})}function bn(H,V){E(H.lanes,i(pe,V))}function ke(H,V){E(H,i(bn,V))}function ye(H,V){Zt(H.flowElements,V),H.laneSets&&ke(H.laneSets,V)}function Zt(H,V){E(H,function(ie){Ut(ie,"bpmn:SequenceFlow")?n.push(function(){G(ie,V)}):Ut(ie,"bpmn:BoundaryEvent")?n.unshift(function(){$(ie,V)}):Ut(ie,"bpmn:FlowNode")?$(ie,V):Ut(ie,"bpmn:DataObject")||(Ut(ie,"bpmn:DataStoreReference")||Ut(ie,"bpmn:DataObjectReference")?K(ie,V):p(`unrecognized flowElement ${wt(ie)} in context ${wt(V&&V.businessObject)}`,{element:ie,context:V}))})}function Qt(H,V){var ie=u(H,V),be=H.processRef;be&&v(be,ie||V)}function Ke(H,V){E(H.participants,i(Qt,V)),n.push(function(){x(H.messageFlows,V)}),D(H.artifacts,V)}function bt(H){E(H.flowNodeRef,function(V){var ie=V.get("lanes");ie&&ie.push(H)})}}k();function h(e,t){var n=j(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)}function ee(e,t){return Bt(t,function(n){return h(e,n)})}function j(e){return e&&e.businessObject||e}function ce(e){return e&&e.di}function lh(e,t,n){var r,i,o,a,s=[];function c(u,p){var l={root:function(y,v){return r.add(y,v)},element:function(y,v,w){return r.add(y,v,w)},error:function(y,v){s.push({message:y,context:v})}},f=new Kl(l);p=p||u.diagrams&&u.diagrams[0];var d=jS(u,p);if(!d)throw new Error("no diagram to display");E(d,function(y){f.handleDefinitions(u,y)});var m=p.plane.bpmnElement.id;o.setRootElement(o.findRoot(m+"_plane")||o.findRoot(m))}return new Promise(function(u,p){try{return r=e.get("bpmnImporter"),i=e.get("eventBus"),o=e.get("canvas"),i.fire("import.render.start",{definitions:t}),c(t,n),i.fire("import.render.complete",{error:a,warnings:s}),u({warnings:s})}catch(l){return l.warnings=s,p(l)}})}function jS(e,t){if(!(!t||!t.plane)){var n=t.plane.bpmnElement,r=n;!h(n,"bpmn:Process")&&!h(n,"bpmn:Collaboration")&&(r=FS(n));var i;h(r,"bpmn:Collaboration")?i=r:i=re(e.rootElements,function(u){if(h(u,"bpmn:Collaboration"))return re(u.participants,function(p){return p.processRef===r})});var o=[r];i&&(o=Oe(i.participants,function(u){return u.processRef}),o.push(i));var a=fh(o),s=[t],c=[n];return E(e.diagrams,function(u){if(u.plane){var p=u.plane.bpmnElement;a.indexOf(p)!==-1&&c.indexOf(p)===-1&&(s.push(u),c.push(p))}}),s}}function fh(e){var t=[];return E(e,function(n){n&&(t.push(n),t=t.concat(fh(n.flowElements)))}),t}function FS(e){for(var t=e;t;){if(h(t,"bpmn:Process"))return t;t=t.$parent}}var HS='',Yl=HS,Xl={verticalAlign:"middle"},Zl={color:"#404040"},$S={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},zS={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},GS={position:"absolute",left:"50%",top:"40%",transform:"translate(-50%)",width:"260px",padding:"10px",background:"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",display:"flex",lineHeight:"1.3"},VS='
'+Yl+'Web-based tooling for BPMN, DMN and forms powered by bpmn.io.
',tr;function WS(){tr=ue(VS),dt(tr,$S),dt(ge("svg",tr),Xl),dt(ge(".backdrop",tr),zS),dt(ge(".notice",tr),GS),dt(ge(".link",tr),Zl,{margin:"15px 20px 15px 10px",alignSelf:"center"})}function dh(){tr||(WS(),vt.bind(tr,".backdrop","click",function(e){document.body.removeChild(tr)})),document.body.appendChild(tr)}function Le(e){e=C({},qS,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),this._init(this._container,this._moddle,e),YS(this._container)}B(Le,Jn);Le.prototype.importXML=async function(t,n){let r=this;function i(a){return r.get("eventBus").createEvent(a)}let o=[];try{t=this._emit("import.parse.start",{xml:t})||t;let a;try{a=await this._moddle.fromXML(t,"bpmn:Definitions")}catch(f){throw this._emit("import.parse.complete",{error:f}),f}let s=a.rootElement,c=a.references,u=a.warnings,p=a.elementsById;o=o.concat(u),s=this._emit("import.parse.complete",i({error:null,definitions:s,elementsById:p,references:c,warnings:o}))||s;let l=await this.importDefinitions(s,n);return o=o.concat(l.warnings),this._emit("import.done",{error:null,warnings:o}),{warnings:o}}catch(a){let s=a;throw o=o.concat(s.warnings||[]),Mc(s,o),s=US(s),this._emit("import.done",{error:s,warnings:s.warnings}),s}};Le.prototype.importDefinitions=async function(t,n){return this._setDefinitions(t),{warnings:(await this.open(n)).warnings}};Le.prototype.open=async function(t){let n=this._definitions,r=t;if(!n){let o=new Error("no XML imported");throw Mc(o,[]),o}if(typeof t=="string"&&(r=KS(n,t),!r)){let o=new Error("BPMNDiagram <"+t+"> not found");throw Mc(o,[]),o}try{this.clear()}catch(o){throw Mc(o,[]),o}let{warnings:i}=await lh(this,n,r);return{warnings:i}};Le.prototype.saveXML=async function(t){t=t||{};let n=this._definitions,r,i;try{if(!n)throw new Error("no definitions loaded");n=this._emit("saveXML.start",{definitions:n})||n,i=(await this._moddle.toXML(n,t)).xml,i=this._emit("saveXML.serialized",{xml:i})||i}catch(a){r=a}let o=r?{error:r}:{xml:i};if(this._emit("saveXML.done",o),r)throw r;return o};Le.prototype.saveSVG=async function(){this._emit("saveSVG.start");let t,n;try{let r=this.get("canvas"),i=r.getActiveLayer(),o=ge(":scope > defs",r._svg),a=Cl(i),s=o?""+Cl(o)+"":"",c=i.getBBox();t=` -'+s+a+""}catch(r){n=r}if(this._emit("saveSVG.done",{error:n,svg:t}),n)throw n;return{svg:t}};Be.prototype._setDefinitions=function(e){this._definitions=e};Be.prototype.getModules=function(){return this._modules};Be.prototype.clear=function(){this.getDefinitions()&&Vn.prototype.clear.call(this)};Be.prototype.destroy=function(){Vn.prototype.destroy.call(this),Bt(this._container)};Be.prototype.on=function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)};Be.prototype.off=function(e,t){this.get("eventBus").off(e,t)};Be.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),typeof e=="string"&&(e=me(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()};Be.prototype.getDefinitions=function(){return this._definitions};Be.prototype.detach=function(){let e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))};Be.prototype._init=function(e,t,n){let r=n.modules||this.getModules(n),i=n.additionalModules||[],o=[{bpmnjs:["value",this],moddle:["value",t]}],a=[].concat(o,r,i),s=C(At(n,["additionalModules"]),{canvas:C({},n.canvas,{container:e}),modules:a});Vn.call(this,s),n&&n.container&&this.attachTo(n.container)};Be.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)};Be.prototype._createContainer=function(e){let t=ye('
');return at(t,{width:mh(e.width),height:mh(e.height),position:e.position}),t};Be.prototype._createModdle=function(e){let t=C({},this._moddleExtensions,e.moddleExtensions);return new lh(t)};Be.prototype._modules=[];function gc(e,t){return e.warnings=t,e}function k0(e){let n=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return n&&(e.message="unparsable content <"+n[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+n[2]),e}var O0={width:"100%",height:"100%",position:"relative"};function mh(e){return e+(ee(e)?"px":"")}function N0(e,t){return t&&ne(e.diagrams,function(n){return n.id===t})||null}function B0(e){let n=''+Pl+"",r=ye(n);at(me("svg",r),Al),at(r,Tl,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(r),ae.bind(r,"click",function(i){hh(),i.preventDefault()})}function hi(e){Be.call(this,e),this.on("import.parse.complete",function(t){t.error||this._collectIds(t.definitions,t.elementsById)},this),this.on("diagram.destroy",function(){this.get("moddle").ids.clear()},this)}N(hi,Be);hi.prototype._createModdle=function(e){var t=Be.prototype._createModdle.call(this,e);return t.ids=new dn([32,36,1]),t};hi.prototype._collectIds=function(e,t){var n=e.$model,r=n.ids,i;r.clear();for(i in t)r.claim(i,t[i])};function ie(e,t){return m(e,"bpmn:CallActivity")?!1:m(e,"bpmn:SubProcess")?(t=t||se(e),t&&m(t,"bpmndi:BPMNPlane")?!0:t&&!!t.isExpanded):m(e,"bpmn:Participant")?!!L(e).processRef:!0}function Re(e){if(!(!m(e,"bpmn:Participant")&&!m(e,"bpmn:Lane"))){var t=se(e).isHorizontal;return t===void 0?!0:t}}function gh(e){return e&&L(e).isInterrupting!==!1}function Ue(e){return e&&!!L(e).triggeredByEvent}function cr(e,t){var n=L(e).eventDefinitions;return Nt(n,function(r){return m(r,t)})}function vh(e){return cr(e,"bpmn:ErrorEventDefinition")}function yh(e){return cr(e,"bpmn:EscalationEventDefinition")}function _h(e){return cr(e,"bpmn:CompensateEventDefinition")}var ro={width:90,height:20},xh=15;function nn(e){return m(e,"bpmn:Event")||m(e,"bpmn:Gateway")||m(e,"bpmn:DataStoreReference")||m(e,"bpmn:DataObjectReference")||m(e,"bpmn:DataInput")||m(e,"bpmn:DataOutput")||m(e,"bpmn:SequenceFlow")||m(e,"bpmn:MessageFlow")||m(e,"bpmn:Group")}function Fr(e){return te(e.label)}function I0(e){var t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)],i=L0(e),o=Math.atan((r.y-n.y)/(r.x-n.x)),a=i.x,s=i.y;return Math.abs(o) defs",j);oe||(oe=G("defs"),Z(j,oe)),Z(oe,W)}function d(R,y,g,T){var D=H0.nextPrefixed("marker-");return h(R,D,y,g,T),"url(#"+D+")"}function h(R,y,g,T,D){if(g==="sequenceflow-end"){var j=G("path",{d:"M 1 5 L 11 10 L 1 15 Z",...u({fill:D,stroke:D,strokeWidth:1})});f(y,{element:j,ref:{x:11,y:10},scale:.5,parentGfx:R})}if(g==="messageflow-start"){var W=G("circle",{cx:6,cy:6,r:3.5,...u({fill:T,stroke:D,strokeWidth:1,strokeDasharray:[1e4,1]})});f(y,{element:W,ref:{x:6,y:6},parentGfx:R})}if(g==="messageflow-end"){var oe=G("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...u({fill:T,stroke:D,strokeWidth:1,strokeDasharray:[1e4,1]})});f(y,{element:oe,ref:{x:8.5,y:5},parentGfx:R})}if(g==="association-start"){var ve=G("path",{d:"M 11 5 L 1 10 L 11 15",...l({fill:"none",stroke:D,strokeWidth:1.5,strokeDasharray:[1e4,1]})});f(y,{element:ve,ref:{x:1,y:10},scale:.5,parentGfx:R})}if(g==="association-end"){var it=G("path",{d:"M 1 5 L 11 10 L 1 15",...l({fill:"none",stroke:D,strokeWidth:1.5,strokeDasharray:[1e4,1]})});f(y,{element:it,ref:{x:11,y:10},scale:.5,parentGfx:R})}if(g==="conditional-flow-marker"){var Qe=G("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...u({fill:T,stroke:D})});f(y,{element:Qe,ref:{x:-1,y:10},scale:.5,parentGfx:R})}if(g==="conditional-default-flow-marker"){var mt=G("path",{d:"M 6 4 L 10 16",...u({stroke:D,fill:"none"})});f(y,{element:mt,ref:{x:0,y:10},scale:.5,parentGfx:R})}}function _(R,y,g,T,D={}){Ce(T)&&(D=T,T=0),T=T||0,D=u(D);var j=y/2,W=g/2,oe=G("circle",{cx:j,cy:W,r:Math.round((y+g)/4-T),...D});return Z(R,oe),oe}function v(R,y,g,T,D,j){Ce(D)&&(j=D,D=0),D=D||0,j=u(j);var W=G("rect",{x:D,y:D,width:y-D*2,height:g-D*2,rx:T,ry:T,...j});return Z(R,W),W}function w(R,y,g,T){var D=y/2,j=g/2,W=[{x:D,y:0},{x:y,y:j},{x:D,y:g},{x:0,y:j}],oe=W.map(function(it){return it.x+","+it.y}).join(" ");T=u(T);var ve=G("polygon",{...T,points:oe});return Z(R,ve),ve}function P(R,y,g,T){g=l(g);var D=jn(y,g,T);return Z(R,D),D}function b(R,y,g){return P(R,y,g,5)}function x(R,y,g){g=l(g);var T=G("path",{...g,d:y});return Z(R,T),T}function S(R,y,g,T){return x(y,g,C({"data-marker":R},T))}function A(R){return Ot[R]}function O(R){return function(y,g,T){return A(R)(y,g,T)}}var M={"bpmn:MessageEventDefinition":function(R,y,g={},T){var D=r.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:g.width||y.width,containerHeight:g.height||y.height,position:{mx:.235,my:.315}}),j=T?q(y,c,g.stroke):he(y,s,g.fill),W=T?he(y,s,g.fill):q(y,c,g.stroke),oe=x(R,D,{fill:j,stroke:W,strokeWidth:1});return oe},"bpmn:TimerEventDefinition":function(R,y,g={}){var T=g.width||y.width,D=g.height||y.height,j=g.width?1:2,W=_(R,T,D,.2*D,{fill:he(y,s,g.fill),stroke:q(y,c,g.stroke),strokeWidth:j}),oe=r.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:T,containerHeight:D,position:{mx:.5,my:.5}});x(R,oe,{stroke:q(y,c,g.stroke),strokeWidth:j});for(var ve=0;ve<12;ve++){var it=r.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:T,containerHeight:D,position:{mx:.5,my:.5}}),Qe=T/2,mt=D/2;x(R,it,{strokeWidth:1,stroke:q(y,c,g.stroke),transform:"rotate("+ve*30+","+mt+","+Qe+")"})}return W},"bpmn:EscalationEventDefinition":function(R,y,g={},T){var D=r.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:g.width||y.width,containerHeight:g.height||y.height,position:{mx:.5,my:.2}}),j=T?q(y,c,g.stroke):he(y,s,g.fill);return x(R,D,{fill:j,stroke:q(y,c,g.stroke),strokeWidth:1})},"bpmn:ConditionalEventDefinition":function(R,y,g={}){var T=r.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:g.width||y.width,containerHeight:g.height||y.height,position:{mx:.5,my:.222}});return x(R,T,{fill:he(y,s,g.fill),stroke:q(y,c,g.stroke),strokeWidth:1})},"bpmn:LinkEventDefinition":function(R,y,g={},T){var D=r.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:y.width,containerHeight:y.height,position:{mx:.57,my:.263}}),j=T?q(y,c,g.stroke):he(y,s,g.fill);return x(R,D,{fill:j,stroke:q(y,c,g.stroke),strokeWidth:1})},"bpmn:ErrorEventDefinition":function(R,y,g={},T){var D=r.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:g.width||y.width,containerHeight:g.height||y.height,position:{mx:.2,my:.722}}),j=T?q(y,c,g.stroke):he(y,s,g.fill);return x(R,D,{fill:j,stroke:q(y,c,g.stroke),strokeWidth:1})},"bpmn:CancelEventDefinition":function(R,y,g={},T){var D=r.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:y.width,containerHeight:y.height,position:{mx:.638,my:-.055}}),j=T?q(y,c,g.stroke):"none",W=x(R,D,{fill:j,stroke:q(y,c,g.stroke),strokeWidth:1});return cc(W,45),W},"bpmn:CompensateEventDefinition":function(R,y,g={},T){var D=r.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:g.width||y.width,containerHeight:g.height||y.height,position:{mx:.22,my:.5}}),j=T?q(y,c,g.stroke):he(y,s,g.fill);return x(R,D,{fill:j,stroke:q(y,c,g.stroke),strokeWidth:1})},"bpmn:SignalEventDefinition":function(R,y,g={},T){var D=r.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:g.width||y.width,containerHeight:g.height||y.height,position:{mx:.5,my:.2}}),j=T?q(y,c,g.stroke):he(y,s,g.fill);return x(R,D,{strokeWidth:1,fill:j,stroke:q(y,c,g.stroke)})},"bpmn:MultipleEventDefinition":function(R,y,g={},T){var D=r.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:g.width||y.width,containerHeight:g.height||y.height,position:{mx:.211,my:.36}}),j=T?q(y,c,g.stroke):he(y,s,g.fill);return x(R,D,{fill:j,stroke:q(y,c,g.stroke),strokeWidth:1})},"bpmn:ParallelMultipleEventDefinition":function(R,y,g={}){var T=r.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:g.width||y.width,containerHeight:g.height||y.height,position:{mx:.458,my:.194}});return x(R,T,{fill:he(y,s,g.fill),stroke:q(y,c,g.stroke),strokeWidth:1})},"bpmn:TerminateEventDefinition":function(R,y,g={}){var T=_(R,y.width,y.height,8,{fill:q(y,c,g.stroke),stroke:q(y,c,g.stroke),strokeWidth:4});return T}};function B(R,y,g={},T){var D=L(R),j=Ch(D),W=T||R;return D.get("eventDefinitions")&&D.get("eventDefinitions").length>1?D.get("parallelMultiple")?M["bpmn:ParallelMultipleEventDefinition"](y,W,g,j):M["bpmn:MultipleEventDefinition"](y,W,g,j):Pn(D,"bpmn:MessageEventDefinition")?M["bpmn:MessageEventDefinition"](y,W,g,j):Pn(D,"bpmn:TimerEventDefinition")?M["bpmn:TimerEventDefinition"](y,W,g,j):Pn(D,"bpmn:ConditionalEventDefinition")?M["bpmn:ConditionalEventDefinition"](y,W,g,j):Pn(D,"bpmn:SignalEventDefinition")?M["bpmn:SignalEventDefinition"](y,W,g,j):Pn(D,"bpmn:EscalationEventDefinition")?M["bpmn:EscalationEventDefinition"](y,W,g,j):Pn(D,"bpmn:LinkEventDefinition")?M["bpmn:LinkEventDefinition"](y,W,g,j):Pn(D,"bpmn:ErrorEventDefinition")?M["bpmn:ErrorEventDefinition"](y,W,g,j):Pn(D,"bpmn:CancelEventDefinition")?M["bpmn:CancelEventDefinition"](y,W,g,j):Pn(D,"bpmn:CompensateEventDefinition")?M["bpmn:CompensateEventDefinition"](y,W,g,j):Pn(D,"bpmn:TerminateEventDefinition")?M["bpmn:TerminateEventDefinition"](y,W,g,j):null}var I={ParticipantMultiplicityMarker:function(R,y,g={}){var T=rn(y,g),D=Ft(y,g),j=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:T,containerHeight:D,position:{mx:(T/2-6)/T,my:(D-15)/D}});S("participant-multiplicity",R,j,{strokeWidth:2,fill:he(y,s,g.fill),stroke:q(y,c,g.stroke)})},SubProcessMarker:function(R,y,g={}){var T=v(R,14,14,0,{strokeWidth:1,fill:he(y,s,g.fill),stroke:q(y,c,g.stroke)});ke(T,y.width/2-7.5,y.height-20);var D=r.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:y.width,containerHeight:y.height,position:{mx:(y.width/2-7.5)/y.width,my:(y.height-20)/y.height}});S("sub-process",R,D,{fill:he(y,s,g.fill),stroke:q(y,c,g.stroke)})},ParallelMarker:function(R,y,g){var T=rn(y,g),D=Ft(y,g),j=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:T,containerHeight:D,position:{mx:(T/2+g.parallel)/T,my:(D-20)/D}});S("parallel",R,j,{fill:he(y,s,g.fill),stroke:q(y,c,g.stroke)})},SequentialMarker:function(R,y,g){var T=r.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:y.width,containerHeight:y.height,position:{mx:(y.width/2+g.seq)/y.width,my:(y.height-19)/y.height}});S("sequential",R,T,{fill:he(y,s,g.fill),stroke:q(y,c,g.stroke)})},CompensationMarker:function(R,y,g){var T=r.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:y.width,containerHeight:y.height,position:{mx:(y.width/2+g.compensation)/y.width,my:(y.height-13)/y.height}});S("compensation",R,T,{strokeWidth:1,fill:he(y,s,g.fill),stroke:q(y,c,g.stroke)})},LoopMarker:function(R,y,g){var T=rn(y,g),D=Ft(y,g),j=r.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:T,containerHeight:D,position:{mx:(T/2+g.loop)/T,my:(D-7)/D}});S("loop",R,j,{strokeWidth:1.5,fill:"none",stroke:q(y,c,g.stroke),strokeMiterlimit:.5})},AdhocMarker:function(R,y,g){var T=rn(y,g),D=Ft(y,g),j=r.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:T,containerHeight:D,position:{mx:(T/2+g.adhoc)/T,my:(D-15)/D}});S("adhoc",R,j,{strokeWidth:1,fill:q(y,c,g.stroke),stroke:q(y,c,g.stroke)})}};function H(R,y,g,T){I[R](y,g,T)}function z(R,y,g=[],T={}){T={fill:T.fill,stroke:T.stroke,width:rn(y,T),height:Ft(y,T)};var D=L(y),j=g.includes("SubProcessMarker");j?T={...T,seq:-21,parallel:-22,compensation:-25,loop:-18,adhoc:10}:T={...T,seq:-5,parallel:-6,compensation:-7,loop:0,adhoc:-8},D.get("isForCompensation")&&g.push("CompensationMarker"),m(D,"bpmn:AdHocSubProcess")&&(g.push("AdhocMarker"),j||C(T,{compensation:T.compensation-18}));var W=D.get("loopCharacteristics"),oe=W&&W.get("isSequential");W&&(C(T,{compensation:T.compensation-18}),g.includes("AdhocMarker")&&C(T,{seq:-23,loop:-18,parallel:-24}),oe===void 0&&g.push("LoopMarker"),oe===!1&&g.push("ParallelMarker"),oe===!0&&g.push("SequentialMarker")),g.includes("CompensationMarker")&&g.length===1&&C(T,{compensation:-8}),E(g,function(ve){H(ve,R,y,T)})}function K(R,y,g={}){g=C({size:{width:100}},g);var T=o.createText(y||"",g);return ue(T).add("djs-label"),Z(R,T),T}function ce(R,y,g,T={}){var D=L(y),j=oo({x:y.x,y:y.y,width:y.width,height:y.height},T);return K(R,D.name,{align:g,box:j,padding:7,style:{fill:io(y,p,c,T.stroke)}})}function ln(R,y,g={}){var T={width:90,height:30,x:y.width/2+y.x,y:y.height/2+y.y};return K(R,xt(y),{box:T,fitBox:!0,style:C({},o.getExternalStyle(),{fill:io(y,p,c,g.stroke)})})}function De(R,y,g,T={}){var D=Re(g),j=K(R,y,{box:{height:30,width:D?Ft(g,T):rn(g,T)},align:"center-middle",style:{fill:io(g,p,c,T.stroke)}});if(D){var W=-1*Ft(g,T);Ji(j,0,-W,270)}}function ge(R,y,g={}){var{width:T,height:D}=oo(y,g);return v(R,T,D,xc,{...g,fill:he(y,s,g.fill),fillOpacity:ao,stroke:q(y,c,g.stroke)})}function Vt(R,y,g={}){var T=L(y),D=he(y,s,g.fill),j=q(y,c,g.stroke);return(T.get("associationDirection")==="One"||T.get("associationDirection")==="Both")&&(g.markerEnd=d(R,"association-end",D,j)),T.get("associationDirection")==="Both"&&(g.markerStart=d(R,"association-start",D,j)),g=xe(g,["markerStart","markerEnd"]),b(R,y.waypoints,{...g,stroke:j,strokeDasharray:"0, 5"})}function Wt(R,y,g={}){var T=he(y,s,g.fill),D=q(y,c,g.stroke),j=r.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:y.width,containerHeight:y.height,position:{mx:.474,my:.296}}),W=x(R,j,{fill:T,fillOpacity:ao,stroke:D}),oe=L(y);if(Rh(oe)){var ve=r.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:y.width,containerHeight:y.height,position:{mx:.33,my:(y.height-18)/y.height}});x(R,ve,{strokeWidth:2,fill:T,stroke:D})}return W}function We(R,y,g={}){return _(R,y.width,y.height,{fillOpacity:ao,...g,fill:he(y,s,g.fill),stroke:q(y,c,g.stroke)})}function ht(R,y,g={}){return w(R,y.width,y.height,{fill:he(y,s,g.fill),fillOpacity:ao,stroke:q(y,c,g.stroke)})}function F(R,y,g={}){var T=v(R,rn(y,g),Ft(y,g),0,{fill:he(y,s,g.fill),fillOpacity:g.fillOpacity||ao,stroke:q(y,c,g.stroke),strokeWidth:1.5}),D=L(y);if(m(D,"bpmn:Lane")){var j=D.get("name");De(R,j,y,g)}return T}function V(R,y,g={}){var T=ge(R,y,g),D=ie(y);if(Ue(y)&&($(T,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!D)){var j=L(y).flowElements||[],W=j.filter(oe=>m(oe,"bpmn:StartEvent"));W.length===1&&re(W[0],R,g,y)}return ce(R,y,D?"center-top":"center-middle",g),D?z(R,y,void 0,g):z(R,y,["SubProcessMarker"],g),T}function re(R,y,g,T){var D=22,j={fill:he(T,s,g.fill),stroke:q(T,c,g.stroke),width:D,height:D},W=L(R).isInterrupting,oe=W?0:3,ve=W?1:1.2,it=20,Qe=(D-it)/2,mt="translate("+Qe+","+Qe+")";_(y,it,it,{fill:j.fill,stroke:j.stroke,strokeWidth:ve,strokeDasharray:oe,transform:mt}),B(R,y,j,T)}function _e(R,y,g={}){var T=ge(R,y,g);return ce(R,y,"center-middle",g),z(R,y,void 0,g),T}var Ot=this.handlers={"bpmn:AdHocSubProcess":function(R,y,g={}){return ie(y)?g=xe(g,["fill","stroke","width","height"]):g=xe(g,["fill","stroke"]),V(R,y,g)},"bpmn:Association":function(R,y,g={}){return g=xe(g,["fill","stroke"]),Vt(R,y,g)},"bpmn:BoundaryEvent":function(R,y,g={}){var{renderIcon:T=!0}=g;g=xe(g,["fill","stroke"]);var D=L(y),j=D.get("cancelActivity");g={strokeWidth:1.5,fill:he(y,s,g.fill),fillOpacity:W0,stroke:q(y,c,g.stroke)},j||(g.strokeDasharray="6");var W=We(R,y,g);return _(R,y.width,y.height,_c,{...g,fill:"none"}),T&&B(y,R,g),W},"bpmn:BusinessRuleTask":function(R,y,g={}){g=xe(g,["fill","stroke"]);var T=_e(R,y,g),D=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),j=x(R,D);$(j,{fill:he(y,s,g.fill),stroke:q(y,c,g.stroke),strokeWidth:1});var W=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),oe=x(R,W);return $(oe,{fill:q(y,c,g.stroke),stroke:q(y,c,g.stroke),strokeWidth:1}),T},"bpmn:CallActivity":function(R,y,g={}){return g=xe(g,["fill","stroke"]),V(R,y,{strokeWidth:5,...g})},"bpmn:ComplexGateway":function(R,y,g={}){g=xe(g,["fill","stroke"]);var T=ht(R,y,g),D=r.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:y.width,containerHeight:y.height,position:{mx:.46,my:.26}});return x(R,D,{fill:q(y,c,g.stroke),stroke:q(y,c,g.stroke),strokeWidth:1}),T},"bpmn:DataInput":function(R,y,g={}){g=xe(g,["fill","stroke"]);var T=r.getRawPath("DATA_ARROW"),D=Wt(R,y,g);return x(R,T,{fill:"none",stroke:q(y,c,g.stroke),strokeWidth:1}),D},"bpmn:DataInputAssociation":function(R,y,g={}){return g=xe(g,["fill","stroke"]),Vt(R,y,{...g,markerEnd:d(R,"association-end",he(y,s,g.fill),q(y,c,g.stroke))})},"bpmn:DataObject":function(R,y,g={}){return g=xe(g,["fill","stroke"]),Wt(R,y,g)},"bpmn:DataObjectReference":O("bpmn:DataObject"),"bpmn:DataOutput":function(R,y,g={}){g=xe(g,["fill","stroke"]);var T=r.getRawPath("DATA_ARROW"),D=Wt(R,y,g);return x(R,T,{strokeWidth:1,fill:he(y,s,g.fill),stroke:q(y,c,g.stroke)}),D},"bpmn:DataOutputAssociation":function(R,y,g={}){return g=xe(g,["fill","stroke"]),Vt(R,y,{...g,markerEnd:d(R,"association-end",he(y,s,g.fill),q(y,c,g.stroke))})},"bpmn:DataStoreReference":function(R,y,g={}){g=xe(g,["fill","stroke"]);var T=r.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:y.width,containerHeight:y.height,position:{mx:0,my:.133}});return x(R,T,{fill:he(y,s,g.fill),fillOpacity:ao,stroke:q(y,c,g.stroke),strokeWidth:2})},"bpmn:EndEvent":function(R,y,g={}){var{renderIcon:T=!0}=g;g=xe(g,["fill","stroke"]);var D=We(R,y,{...g,strokeWidth:4});return T&&B(y,R,g),D},"bpmn:EventBasedGateway":function(R,y,g={}){g=xe(g,["fill","stroke"]);var T=L(y),D=ht(R,y,g);_(R,y.width,y.height,y.height*.2,{fill:he(y,"none",g.fill),stroke:q(y,c,g.stroke),strokeWidth:1});var j=T.get("eventGatewayType"),W=!!T.get("instantiate");function oe(){var it=r.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:y.width,containerHeight:y.height,position:{mx:.36,my:.44}});x(R,it,{fill:"none",stroke:q(y,c,g.stroke),strokeWidth:2})}if(j==="Parallel"){var ve=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:y.width,containerHeight:y.height,position:{mx:.474,my:.296}});x(R,ve,{fill:"none",stroke:q(y,c,g.stroke),strokeWidth:1})}else j==="Exclusive"&&(W||_(R,y.width,y.height,y.height*.26,{fill:"none",stroke:q(y,c,g.stroke),strokeWidth:1}),oe());return D},"bpmn:ExclusiveGateway":function(R,y,g={}){g=xe(g,["fill","stroke"]);var T=ht(R,y,g),D=r.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:y.width,containerHeight:y.height,position:{mx:.32,my:.3}}),j=se(y);return j.get("isMarkerVisible")&&x(R,D,{fill:q(y,c,g.stroke),stroke:q(y,c,g.stroke),strokeWidth:1}),T},"bpmn:Gateway":function(R,y,g={}){return g=xe(g,["fill","stroke"]),ht(R,y,g)},"bpmn:Group":function(R,y,g={}){return g=xe(g,["fill","stroke","width","height"]),v(R,y.width,y.height,xc,{stroke:q(y,c,g.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:rn(y,g),height:Ft(y,g)})},"bpmn:InclusiveGateway":function(R,y,g={}){g=xe(g,["fill","stroke"]);var T=ht(R,y,g);return _(R,y.width,y.height,y.height*.24,{fill:he(y,s,g.fill),stroke:q(y,c,g.stroke),strokeWidth:2.5}),T},"bpmn:IntermediateEvent":function(R,y,g={}){var{renderIcon:T=!0}=g;g=xe(g,["fill","stroke"]);var D=We(R,y,{...g,strokeWidth:1.5});return _(R,y.width,y.height,_c,{fill:"none",stroke:q(y,c,g.stroke),strokeWidth:1.5}),T&&B(y,R,g),D},"bpmn:IntermediateCatchEvent":O("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":O("bpmn:IntermediateEvent"),"bpmn:Lane":function(R,y,g={}){return g=xe(g,["fill","stroke","width","height"]),F(R,y,{...g,fillOpacity:G0})},"bpmn:ManualTask":function(R,y,g={}){g=xe(g,["fill","stroke"]);var T=_e(R,y,g),D=r.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return x(R,D,{fill:he(y,s,g.fill),stroke:q(y,c,g.stroke),strokeWidth:.5}),T},"bpmn:MessageFlow":function(R,y,g={}){g=xe(g,["fill","stroke"]);var T=L(y),D=se(y),j=he(y,s,g.fill),W=q(y,c,g.stroke),oe=b(R,y.waypoints,{markerEnd:d(R,"messageflow-end",j,W),markerStart:d(R,"messageflow-start",j,W),stroke:W,strokeDasharray:"10, 11",strokeWidth:1.5});if(T.get("messageRef")){var ve=oe.getPointAtLength(oe.getTotalLength()/2),it=r.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:ve.x,y:ve.y}}),Qe={strokeWidth:1};D.get("messageVisibleKind")==="initiating"?(Qe.fill=j,Qe.stroke=W):(Qe.fill=W,Qe.stroke=j);var mt=x(R,it,Qe),fn=T.get("messageRef"),Me=fn.get("name"),ir=K(R,Me,{align:"center-top",fitBox:!0,style:{fill:W}}),Us=mt.getBBox(),Jt=ir.getBBox(),de=ve.x-Jt.width/2,Se=ve.y+Us.height/2+$0;Ji(ir,de,Se,0)}return oe},"bpmn:ParallelGateway":function(R,y,g={}){g=xe(g,["fill","stroke"]);var T=ht(R,y,g),D=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:y.width,containerHeight:y.height,position:{mx:.46,my:.2}});return x(R,D,{fill:q(y,c,g.stroke),stroke:q(y,c,g.stroke),strokeWidth:1}),T},"bpmn:Participant":function(R,y,g={}){g=xe(g,["fill","stroke","width","height"]);var T=F(R,y,g),D=ie(y),j=Re(y),W=L(y),oe=W.get("name");if(D){var ve=j?[{x:30,y:0},{x:30,y:Ft(y,g)}]:[{x:0,y:30},{x:rn(y,g),y:30}];P(R,ve,{stroke:q(y,c,g.stroke),strokeWidth:z0}),De(R,oe,y,g)}else{var it=oo(y,g);j||(it.height=rn(y,g),it.width=Ft(y,g));var Qe=K(R,oe,{box:it,align:"center-middle",style:{fill:io(y,p,c,g.stroke)}});if(!j){var mt=-1*Ft(y,g);Ji(Qe,0,-mt,270)}}return W.get("participantMultiplicity")&&H("ParticipantMultiplicityMarker",R,y,g),T},"bpmn:ReceiveTask":function(R,y,g={}){g=xe(g,["fill","stroke"]);var T=L(y),D=_e(R,y,g),j;return T.get("instantiate")?(_(R,28,28,20*.22,{fill:he(y,s,g.fill),stroke:q(y,c,g.stroke),strokeWidth:1}),j=r.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):j=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),x(R,j,{fill:he(y,s,g.fill),stroke:q(y,c,g.stroke),strokeWidth:1}),D},"bpmn:ScriptTask":function(R,y,g={}){g=xe(g,["fill","stroke"]);var T=_e(R,y,g),D=r.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return x(R,D,{fill:he(y,s,g.fill),stroke:q(y,c,g.stroke),strokeWidth:1}),T},"bpmn:SendTask":function(R,y,g={}){g=xe(g,["fill","stroke"]);var T=_e(R,y,g),D=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return x(R,D,{fill:q(y,c,g.stroke),stroke:he(y,s,g.fill),strokeWidth:1}),T},"bpmn:SequenceFlow":function(R,y,g={}){g=xe(g,["fill","stroke"]);var T=he(y,s,g.fill),D=q(y,c,g.stroke),j=b(R,y.waypoints,{markerEnd:d(R,"sequenceflow-end",T,D),stroke:D}),W=L(y),{source:oe}=y;if(oe){var ve=L(oe);W.get("conditionExpression")&&m(ve,"bpmn:Activity")&&$(j,{markerStart:d(R,"conditional-flow-marker",T,D)}),ve.get("default")&&(m(ve,"bpmn:Gateway")||m(ve,"bpmn:Activity"))&&ve.get("default")===W&&$(j,{markerStart:d(R,"conditional-default-flow-marker",T,D)})}return j},"bpmn:ServiceTask":function(R,y,g={}){g=xe(g,["fill","stroke"]);var T=_e(R,y,g);_(R,10,10,{fill:he(y,s,g.fill),stroke:"none",transform:"translate(6, 6)"});var D=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});x(R,D,{fill:he(y,s,g.fill),stroke:q(y,c,g.stroke),strokeWidth:1}),_(R,10,10,{fill:he(y,s,g.fill),stroke:"none",transform:"translate(11, 10)"});var j=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return x(R,j,{fill:he(y,s,g.fill),stroke:q(y,c,g.stroke),strokeWidth:1}),T},"bpmn:StartEvent":function(R,y,g={}){var{renderIcon:T=!0}=g;g=xe(g,["fill","stroke"]);var D=L(y);D.get("isInterrupting")||(g={...g,strokeDasharray:"6"});var j=We(R,y,g);return T&&B(y,R,g),j},"bpmn:SubProcess":function(R,y,g={}){return ie(y)?g=xe(g,["fill","stroke","width","height"]):g=xe(g,["fill","stroke"]),V(R,y,g)},"bpmn:Task":function(R,y,g={}){return g=xe(g,["fill","stroke"]),_e(R,y,g)},"bpmn:TextAnnotation":function(R,y,g={}){g=xe(g,["fill","stroke","width","height"]);var{width:T,height:D}=oo(y,g),j=v(R,T,D,0,0,{fill:"none",stroke:"none"}),W=r.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:T,containerHeight:D,position:{mx:0,my:0}});x(R,W,{stroke:q(y,c,g.stroke)});var oe=L(y),ve=oe.get("text")||"";return K(R,ve,{align:"left-top",box:oo(y,g),padding:7,style:{fill:io(y,p,c,g.stroke)}}),j},"bpmn:Transaction":function(R,y,g={}){ie(y)?g=xe(g,["fill","stroke","width","height"]):g=xe(g,["fill","stroke"]);var T=V(R,y,{strokeWidth:1.5,...g}),D=n.style(["no-fill","no-events"],{stroke:q(y,c,g.stroke),strokeWidth:1.5}),j=ie(y);return j||(g={}),v(R,rn(y,g),Ft(y,g),xc-_c,_c,D),T},"bpmn:UserTask":function(R,y,g={}){g=xe(g,["fill","stroke"]);var T=_e(R,y,g),D=15,j=12,W=r.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:D,y:j}});x(R,W,{fill:he(y,s,g.fill),stroke:q(y,c,g.stroke),strokeWidth:.5});var oe=r.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:D,y:j}});x(R,oe,{fill:he(y,s,g.fill),stroke:q(y,c,g.stroke),strokeWidth:.5});var ve=r.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:D,y:j}});return x(R,ve,{fill:q(y,c,g.stroke),stroke:q(y,c,g.stroke),strokeWidth:.5}),T},label:function(R,y,g={}){return ln(R,y,g)}};this._drawPath=x,this._renderer=A}N(pr,mn);pr.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"];pr.prototype.canRender=function(e){return m(e,"bpmn:BaseElement")};pr.prototype.drawShape=function(e,t,n={}){var{type:r}=t,i=this._renderer(r);return i(e,t,n)};pr.prototype.drawConnection=function(e,t,n={}){var{type:r}=t,i=this._renderer(r);return i(e,t,n)};pr.prototype.getShapePath=function(e){return te(e)?xa(e,V0):m(e,"bpmn:Event")?yc(e):m(e,"bpmn:Activity")?xa(e,xc):m(e,"bpmn:Gateway")?Ph(e):Ah(e)};function xe(e,t=[]){return t.reduce((n,r)=>(e[r]&&(n[r]=e[r]),n),{})}var U0=0,K0={width:150,height:50};function Y0(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function q0(e){return Ce(e)?C({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}var Ml=null;function X0(){return Ml||(Ml=document.createElement("canvas").getContext("2d")),Ml}function Z0(e){var t=[];return e.fontStyle&&t.push(e.fontStyle),e.fontVariant&&t.push(e.fontVariant),e.fontWeight&&t.push(e.fontWeight),e.fontStretch&&t.push(e.fontStretch),t.push(Mh(e.fontSize)||"12px"),t.push(e.fontFamily||"sans-serif"),t.join(" ")}function Mh(e){if(e!=null)return typeof e=="number"||/^-?\d+(\.\d+)?$/.test(e)?e+"px":e}function Q0(e,t){var n=X0();if(!n)return{width:0,height:0};n.font=Z0(t),"letterSpacing"in n&&(n.letterSpacing=Mh(t.letterSpacing)||"0px");var r=e==="",i=r?"dummy":e.replace(/\s+$/,""),o=n.measureText(i);return{width:r?0:o.width,height:"fontBoundingBoxAscent"in o?o.fontBoundingBoxAscent+o.fontBoundingBoxDescent:o.actualBoundingBoxAscent+o.actualBoundingBoxDescent}}function J0(e,t,n){for(var r=e.shift(),i=r,o;;){if(o=Q0(i,n),o.width=i?o.width:0,i===" "||i===""||o.width1)for(;r=n.shift();)if(r.length+ov?w.width:v},0),d=o.top;i.vertical==="middle"&&(d+=(n.height-l)/2),d-=(s||p[0].height)/4;var h=G("text");$(h,r),E(p,function(v){var w;switch(d+=s||v.height,i.horizontal){case"left":w=o.left;break;case"right":w=(a?f:u)-o.right-v.width;break;default:w=Math.max(((a?f:u)-v.width)/2+o.left,0)}var P=G("tspan");$(P,{x:w,y:d}),P.textContent=v.text,Z(h,P)});var _={width:f,height:l};return{dimensions:_,element:h}};function rw(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}var iw=12,ow=1.2,aw=30;function bc(e){var t=C({fontFamily:"Arial, sans-serif",fontSize:iw,fontWeight:"normal",lineHeight:ow},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,r=C({},t,{fontSize:n},e&&e.externalStyle||{}),i=new so({style:t});this.getExternalLabelBounds=function(o,a){var s=i.getDimensions(a,{box:{width:90,height:30},style:r});return{x:Math.round(o.x+o.width/2-s.width/2),y:Math.round(o.y),width:Math.ceil(s.width),height:Math.ceil(s.height)}},this.getTextAnnotationBounds=function(o,a){var s=i.getDimensions(a,{box:o,style:t,align:"left-top",padding:5});return{x:o.x,y:o.y,width:o.width,height:Math.max(aw,Math.round(s.height))}},this.createText=function(o,a){return i.createText(o,a||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return r}}bc.$inject=["config.textRenderer"];function Dl(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(t){return this.pathMap[t].d},this.getScaledPath=function(t,n){var r=this.pathMap[t],i,o;n.abspos?(i=n.abspos.x,o=n.abspos.y):(i=n.containerWidth*n.position.mx,o=n.containerHeight*n.position.my);var a={};if(n.position){for(var s=n.containerHeight/r.height*n.yScaleFactor,c=n.containerWidth/r.width*n.xScaleFactor,p=0;p=e.x&&n<=e.x+e.width&&r>=e.y&&r<=e.y+e.height}function dw(e){return m(e,"bpmn:Group")}var Oh={__depends__:[Hr],bpmnImporter:["type",An]};var Nh={__depends__:[Dh,Oh]};function Un(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}Un.prototype.next=function(){return this._prefix+ ++this._counter};var hw=new Un("ov"),mw=500;function st(e,t,n,r){this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=hw,this._overlayDefaults=C({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=gw(n.getContainer()),this._init()}st.$inject=["config.overlays","eventBus","canvas","elementRegistry"];st.prototype.get=function(e){if(et(e)&&(e={id:e}),et(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?J(t.overlays,yt({type:e.type})):t.overlays.slice():[]}else return e.type?J(this._overlays,yt({type:e.type})):e.id?this._overlays[e.id]:null};st.prototype.add=function(e,t,n){if(Ce(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var r=this._ids.next();return n=C({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r};st.prototype.remove=function(e){var t=this.get(e)||[];U(t)||(t=[t]);var n=this;E(t,function(r){var i=n._getOverlayContainer(r.element,!0);if(r&&(Bt(r.html),Bt(r.htmlContainer),delete r.htmlContainer,delete r.element,delete n._overlays[r.id]),i){var o=i.overlays.indexOf(r);o!==-1&&i.overlays.splice(o,1)}})};st.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"};st.prototype.show=function(){wc(this._overlayRoot)};st.prototype.hide=function(){wc(this._overlayRoot,!1)};st.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Tr(this._overlayRoot)};st.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,i=t.y;if(t.waypoints){var o=Ee(t);r=o.x,i=o.y}Bh(n,r,i),Ye(e.html,"data-container-id",t.id)};st.prototype._updateOverlay=function(e){var t=e.position,n=e.htmlContainer,r=e.element,i=t.left,o=t.top;if(t.right!==void 0){var a;r.waypoints?a=Ee(r).width:a=r.width,i=t.right*-1+a}if(t.bottom!==void 0){var s;r.waypoints?s=Ee(r).height:s=r.height,o=t.bottom*-1+s}Bh(n,i||0,o||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())};st.prototype._createOverlayContainer=function(e){var t=ye('
');at(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n};st.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Ih(this._overlayRoot,n)};st.prototype._getOverlayContainer=function(e,t){var n=ne(this._overlayContainers,function(r){return r.element===e});return!n&&!t?this._createOverlayContainer(e):n};st.prototype._addOverlay=function(e){var t=e.id,n=e.element,r=e.html,i,o;r.get&&r.constructor.prototype.jquery&&(r=r.get(0)),et(r)&&(r=ye(r)),o=this._getOverlayContainer(n),i=ye('
'),at(i,{position:"absolute"}),i.appendChild(r),e.type&&Ae(i).add("djs-overlay-"+e.type);var a=this._canvas.findRoot(n),s=this._canvas.getRootElement();wc(i,a===s),e.htmlContainer=i,o.overlays.push(e),o.html.appendChild(i),this._overlays[t]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())};st.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=this._canvas.findRoot(e.element),i=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,s=this._canvas.getRootElement(),c=!0;(r!==s||n&&(Ge(i)&&i>t.scale||Ge(o)&&oi&&(a=(1/t.scale||1)*i)),Ge(a)&&(s="scale("+a+","+a+")"),Ih(o,s)};st.prototype._updateOverlaysVisibilty=function(e){var t=this;E(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})};st.prototype._init=function(){var e=this._eventBus,t=this;function n(r){t._updateRoot(r),t._updateOverlaysVisibilty(r),t.show()}e.on("canvas.viewbox.changing",function(r){t.hide()}),e.on("canvas.viewbox.changed",function(r){n(r.viewbox)}),e.on(["shape.remove","connection.remove"],function(r){var i=r.element,o=t.get({element:i});E(o,function(c){t.remove(c.id)});var a=t._getOverlayContainer(i);if(a){Bt(a.html);var s=t._overlayContainers.indexOf(a);s!==-1&&t._overlayContainers.splice(s,1)}}),e.on("element.changed",mw,function(r){var i=r.element,o=t._getOverlayContainer(i,!0);o&&(E(o.overlays,function(a){t._updateOverlay(a)}),t._updateOverlayContainer(o))}),e.on("element.marker.update",function(r){var i=t._getOverlayContainer(r.element,!0);i&&Ae(i.html)[r.add?"add":"remove"](r.marker)}),e.on("root.set",function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};function gw(e){var t=ye('
');return at(t,{position:"absolute",width:0,height:0}),e.insertBefore(t,e.firstChild),t}function Bh(e,t,n){at(e,{left:t+"px",top:n+"px"})}function wc(e,t){e.style.display=t===!1?"none":""}function Ih(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}var $r={__init__:["overlays"],overlays:["type",st]};function Sc(e,t,n,r){e.on("element.changed",function(i){var o=i.element;(o.parent||o===t.getRootElement())&&(i.gfx=n.getGraphics(o)),i.gfx&&e.fire(tc(o)+".changed",i)}),e.on("elements.changed",function(i){var o=i.elements;o.forEach(function(a){e.fire("element.changed",{element:a})}),r.updateContainments(o)}),e.on("shape.changed",function(i){r.update("shape",i.element,i.gfx)}),e.on("connection.changed",function(i){r.update("connection",i.element,i.gfx)})}Sc.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var co={__init__:["changeSupport"],changeSupport:["type",Sc]};var vw=1e3;function k(e){this._eventBus=e}k.$inject=["eventBus"];function yw(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}k.prototype.on=function(e,t,n,r,i,o){if((Ne(t)||ee(t))&&(o=i,i=r,r=n,n=t,t=null),Ne(n)&&(o=i,i=r,r=n,n=vw),Ce(i)&&(o=i,i=!1),!Ne(r))throw new Error("handlerFn must be a function");U(e)||(e=[e]);var a=this._eventBus;E(e,function(s){var c=["commandStack",s,t].filter(function(p){return p}).join(".");a.on(c,n,i?yw(r,o):r,o)})};k.prototype.canExecute=ur("canExecute");k.prototype.preExecute=ur("preExecute");k.prototype.preExecuted=ur("preExecuted");k.prototype.execute=ur("execute");k.prototype.executed=ur("executed");k.prototype.postExecute=ur("postExecute");k.prototype.postExecuted=ur("postExecuted");k.prototype.revert=ur("revert");k.prototype.reverted=ur("reverted");function ur(e){return function(n,r,i,o,a){(Ne(n)||ee(n))&&(a=o,o=i,i=r,r=n,n=null),this.on(n,e,r,i,o,a)}}function ba(e,t){t.invoke(k,this),this.executed(function(n){var r=n.context;r.rootElement?e.setRootElement(r.rootElement):r.rootElement=e.getRootElement()}),this.revert(function(n){var r=n.context;r.rootElement&&e.setRootElement(r.rootElement)})}N(ba,k);ba.$inject=["canvas","injector"];var Lh={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",ba]};function lr(e){return CSS.escape(e)}var _w={"&":"&","<":"<",">":">",'"':""","'":"'"};function Cc(e){return e=""+e,e&&e.replace(/[&<>"']/g,function(t){return _w[t]})}var jh="_plane";function Ol(e){var t=e.id;return xw(t)}function on(e){var t=e.id;return m(e,"bpmn:SubProcess")?Fh(t):t}function zr(e){return Fh(e)}function po(e){var t=se(e);return m(t,"bpmndi:BPMNPlane")}function Fh(e){return e+jh}function xw(e){return e.replace(new RegExp(jh+"$"),"")}var bw="bjs-breadcrumbs-shown";function Rc(e,t,n){var r=ye('
    '),i=n.getContainer(),o=Ae(i);i.appendChild(r);var a=[];e.on("element.changed",function(c){var p=c.element,u=L(p),l=ne(a,function(f){return f===u});l&&s()});function s(c){c&&(a=Ew(c));var p=a.flatMap(function(l){var f=n.findRoot(on(l))||n.findRoot(l.id);if(!f&&m(l,"bpmn:Process")){var d=t.find(function(v){var w=L(v);return w&&w.get("processRef")===l});f=d&&n.findRoot(d.id)}if(!f)return[];var h=Cc(l.name||l.id),_=ye('
  • '+h+"
  • ");return _.addEventListener("click",function(){n.setRootElement(f)}),_});r.innerHTML="";var u=p.length>1;o.toggle(bw,u),p.forEach(function(l){r.appendChild(l)})}e.on("root.set",function(c){s(c.element)})}Rc.$inject=["eventBus","elementRegistry","canvas"];function Ew(e){for(var t=L(e),n=[],r=t;r;r=r.$parent)(m(r,"bpmn:SubProcess")||m(r,"bpmn:Process"))&&n.push(r);return n.reverse()}function Pc(e,t){var n=null,r=new ww;e.on("root.set",function(i){var o=i.element,a=t.viewbox(),s=r.get(o);if(r.set(n,{x:a.x,y:a.y,zoom:a.scale}),n=o,!(!m(o,"bpmn:SubProcess")&&!s)){s=s||{x:0,y:0,zoom:1};var c=(a.x-s.x)*a.scale,p=(a.y-s.y)*a.scale;(c!==0||p!==0)&&t.scroll({dx:c,dy:p}),s.zoom!==a.scale&&t.zoom(s.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){r.clear(),n=null})}Pc.$inject=["eventBus","canvas"];function ww(){this._entries=[],this.set=function(e,t){var n=!1;for(var r in this._entries)if(this._entries[r][0]===e){this._entries[r][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}t!==-1&&this._entries.splice(t,1)}}var Hh={x:180,y:160};function fr(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,function(r,i){n._handleImport(i.definitions)})}fr.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach(function(r){!r.plane||!r.plane.bpmnElement||(t._processToDiagramMap[r.plane.bpmnElement.id]=r)});var n=e.diagrams.filter(r=>r.plane).flatMap(r=>t._createNewDiagrams(r.plane));n.forEach(function(r){t._movePlaneElementsToOrigin(r.plane)})}};fr.prototype._createNewDiagrams=function(e){var t=this,n=[],r=[];e.get("planeElement").forEach(function(o){var a=o.bpmnElement;if(a){var s=a.$parent;m(a,"bpmn:SubProcess")&&!o.isExpanded&&n.push(a),Cw(a,e)&&r.push({diElement:o,parent:s})}});var i=[];return n.forEach(function(o){if(!t._processToDiagramMap[o.id]){var a=t._createDiagram(o);t._processToDiagramMap[o.id]=a,i.push(a)}}),r.forEach(function(o){for(var a=o.diElement,s=o.parent;s&&n.indexOf(s)===-1;)s=s.$parent;if(s){var c=t._processToDiagramMap[s.id];t._moveToDiPlane(a,c.plane)}}),i};fr.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=Sw(e),r={x:n.x-Hh.x,y:n.y-Hh.y};t.forEach(function(i){i.waypoint?i.waypoint.forEach(function(o){o.x=o.x-r.x,o.y=o.y-r.y}):i.bounds&&(i.bounds.x=i.bounds.x-r.x,i.bounds.y=i.bounds.y-r.y)})};fr.prototype._moveToDiPlane=function(e,t){var n=$h(e),r=n.plane.get("planeElement");r.splice(r.indexOf(e),1),t.get("planeElement").push(e)};fr.prototype._createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n};fr.$inject=["eventBus","moddle"];function $h(e){return m(e,"bpmndi:BPMNDiagram")?e:$h(e.$parent)}function Sw(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach(function(n){if(n.bounds){var r=X(n.bounds);t.top=Math.min(r.top,t.top),t.left=Math.min(r.left,t.left)}}),ui(t)}function Cw(e,t){var n=e.$parent;return!(!m(n,"bpmn:SubProcess")||n===t.bpmnElement||Q(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))}var Ac=250,Rw='',Pw="bjs-drilldown-empty";function Kn(e,t,n,r,i){k.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=r,this._translate=i;var o=this;this.executed("shape.toggleCollapse",Ac,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.reverted("shape.toggleCollapse",Ac,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.executed(["shape.create","shape.move","shape.delete"],Ac,function(a){var s=a.oldParent,c=a.newParent||a.parent,p=a.shape;o._canDrillDown(p)&&o._addOverlay(p),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(p)},!0),this.reverted(["shape.create","shape.move","shape.delete"],Ac,function(a){var s=a.oldParent,c=a.newParent||a.parent,p=a.shape;o._canDrillDown(p)&&o._addOverlay(p),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(p)},!0),t.on("import.render.complete",function(){n.filter(function(a){return o._canDrillDown(a)}).map(function(a){o._addOverlay(a)})})}N(Kn,k);Kn.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}};Kn.prototype._canDrillDown=function(e){var t=this._canvas;return m(e,"bpmn:SubProcess")&&t.findRoot(on(e))};Kn.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=L(e),r=t.get({element:n.id,type:"drilldown"})[0];if(r){var i=n&&n.get("flowElements")&&n.get("flowElements").length;Ae(r.html).toggle(Pw,!i)}};Kn.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,r=L(e),i=n.get({element:e,type:"drilldown"});i.length&&this._removeOverlay(e);var o=ye('"),a=r.get("name")||r.get("id"),s=this._translate("Open {element}",{element:a});o.setAttribute("title",s),o.addEventListener("click",function(){t.setRootElement(t.findRoot(on(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:o}),this._updateOverlayVisibility(e)};Kn.prototype._removeOverlay=function(e){var t=this._overlays;t.remove({element:e,type:"drilldown"})};Kn.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];var zh={__depends__:[$r,co,Lh],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Rc],drilldownCentering:["type",Pc],drilldownOverlayBehavior:["type",Kn],subprocessCompatibility:["type",fr]};function Vh(e){!e||typeof e.stopPropagation!="function"||e.stopPropagation()}function dr(e){return e.originalEvent||e.srcEvent}function Tc(e){Vh(e),Vh(dr(e))}function yn(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function Mc(){return/mac/i.test(navigator.platform)}function Wh(e,t){return(dr(e)||e).button===t}function an(e){return Wh(e,0)}function Gh(e){return Wh(e,1)}function hr(e){var t=dr(e)||e;return an(e)?Mc()?t.metaKey:t.ctrlKey:!1}function mi(e){var t=dr(e)||e;return an(e)&&t.shiftKey}function Aw(e){return!0}function Dc(e){return an(e)||Gh(e)}var Uh=500;function kc(e,t,n){var r=this;function i(M,B,I){if(!s(M,B)){var H,z,K;I?z=t.getGraphics(I):(H=B.delegateTarget||B.target,H&&(z=H,I=t.get(z))),!(!z||!I)&&(K=e.fire(M,{element:I,gfx:z,originalEvent:B}),K===!1&&(B.stopPropagation(),B.preventDefault()))}}var o={};function a(M){return o[M]}function s(M,B){var I=p[M]||an;return!I(B)}var c={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},p={"element.contextmenu":Aw,"element.mousedown":Dc,"element.mouseup":Dc,"element.click":Dc,"element.dblclick":Dc};function u(M,B,I){var H=c[M];if(!H)throw new Error("unmapped DOM event name <"+M+">");return i(H,B,I)}var l="svg, .djs-element";function f(M,B,I,H){var z=o[I]=function(K){i(I,K)};H&&(p[I]=H),z.$delegate=ut.bind(M,l,B,z)}function d(M,B,I){var H=a(I);H&&ut.unbind(M,B,H.$delegate)}function h(M){E(c,function(B,I){f(M,I,B)})}function _(M){E(c,function(B,I){d(M,I,B)})}e.on("canvas.destroy",function(M){_(M.svg)}),e.on("canvas.init",function(M){h(M.svg)}),e.on(["shape.added","connection.added"],function(M){var B=M.element,I=M.gfx;e.fire("interactionEvents.createHit",{element:B,gfx:I})}),e.on(["shape.changed","connection.changed"],Uh,function(M){var B=M.element,I=M.gfx;e.fire("interactionEvents.updateHit",{element:B,gfx:I})}),e.on("interactionEvents.createHit",Uh,function(M){var B=M.element,I=M.gfx;r.createDefaultHit(B,I)}),e.on("interactionEvents.updateHit",function(M){var B=M.element,I=M.gfx;r.updateDefaultHit(B,I)});var v=S("djs-hit djs-hit-stroke"),w=S("djs-hit djs-hit-click-stroke"),P=S("djs-hit djs-hit-all"),b=S("djs-hit djs-hit-no-move"),x={all:P,"click-stroke":w,stroke:v,"no-move":b};function S(M,B){return B=C({stroke:"white",strokeWidth:15},B||{}),n.cls(M,["no-fill","no-border"],B)}function A(M,B){var I=x[B];if(!I)throw new Error("invalid hit type <"+B+">");return $(M,I),M}function O(M,B){Z(M,B)}this.removeHits=function(M){var B=ci(".djs-hit",M);E(B,be)},this.createDefaultHit=function(M,B){var I=M.waypoints,H=M.isFrame,z;return I?this.createWaypointsHit(B,I):(z=H?"stroke":"all",this.createBoxHit(B,z,{width:M.width,height:M.height}))},this.createWaypointsHit=function(M,B){var I=jn(B);return A(I,"stroke"),O(M,I),I},this.createBoxHit=function(M,B,I){I=C({x:0,y:0},I);var H=G("rect");return A(H,B),$(H,I),O(M,H),H},this.updateDefaultHit=function(M,B){var I=me(".djs-hit",B);if(I)return M.waypoints?pa(I,M.waypoints):$(I,{width:M.width,height:M.height}),I},this.fire=i,this.triggerMouseEvent=u,this.mouseHandler=a,this.registerEvent=f,this.unregisterEvent=d}kc.$inject=["eventBus","elementRegistry","styles"];var Vr={__init__:["interactionEvents"],interactionEvents:["type",kc]};function Wr(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],function(r){var i=r.element;n.deselect(i)}),e.on(["diagram.clear","root.set"],function(r){n.select(null)})}Wr.$inject=["eventBus","canvas"];Wr.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(n!==-1){var r=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:t})}};Wr.prototype.get=function(){return this._selectedElements};Wr.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1};Wr.prototype.select=function(e,t){var n=this._selectedElements,r=n.slice();U(e)||(e=e?[e]:[]);var i=this._canvas,o=i.getRootElement();e=e.filter(function(a){var s=i.findRoot(a);return o===s}),t?E(e,function(a){n.indexOf(a)===-1&&n.push(a)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:n})};var Kh="hover",Yh="selected";function Oc(e,t){this._canvas=e;function n(i,o){e.addMarker(i,o)}function r(i,o){e.removeMarker(i,o)}t.on("element.hover",function(i){n(i.element,Kh)}),t.on("element.out",function(i){r(i.element,Kh)}),t.on("selection.changed",function(i){function o(p){r(p,Yh)}function a(p){n(p,Yh)}var s=i.oldSelection,c=i.newSelection;E(s,function(p){c.indexOf(p)===-1&&o(p)}),E(c,function(p){s.indexOf(p)===-1&&a(p)})})}Oc.$inject=["canvas","eventBus"];function Nc(e,t,n,r){e.on("create.end",500,function(i){var o=i.context,a=o.canExecute,s=o.elements,c=o.hints||{},p=c.autoSelect;if(a){if(p===!1)return;U(p)?t.select(p):t.select(s.filter(Tw))}}),e.on("connect.end",500,function(i){var o=i.context,a=o.connection;a&&t.select(a)}),e.on("shape.move.end",500,function(i){var o=i.previousSelection||[],a=r.get(i.context.shape.id),s=ne(o,function(c){return a.id===c.id});s||t.select(a)}),e.on("element.click",function(i){if(an(i)){var o=i.element;o===n.getRootElement()&&(o=null);var a=t.isSelected(o),s=t.get().length>1,c=mi(i);if(a&&s)return c?t.deselect(o):t.select(o);a?t.deselect(o):t.select(o,c)}})}Nc.$inject=["eventBus","selection","canvas","elementRegistry"];function Tw(e){return!e.hidden}var qe={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Vr],selection:["type",Wr],selectionVisuals:["type",Oc],selectionBehavior:["type",Nc]};function sn(e){Be.call(this,e)}N(sn,Be);sn.prototype._modules=[Nh,zh,$r,qe,Hr];sn.prototype._moddleExtensions={};var qh=["c","C"],Xh=["v","V"],Mw=["d","D"],Dw=["x","X"],Zh=["y","Y"],Nl=["z","Z"];function Qh(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function lt(e){return e.altKey?!1:e.ctrlKey||e.metaKey}function ze(e,t){return e=U(e)?e:[e],e.indexOf(t.key)!==-1||e.indexOf(t.code)!==-1}function Bc(e){return e.shiftKey}function Jh(e){return lt(e)&&ze(qh,e)}function em(e){return lt(e)&&ze(Xh,e)}function tm(e){return lt(e)&&ze(Mw,e)}function nm(e){return lt(e)&&ze(Dw,e)}function rm(e){return lt(e)&&!Bc(e)&&ze(Nl,e)}function im(e){return lt(e)&&(ze(Zh,e)||ze(Nl,e)&&Bc(e))}var Ic="keyboard.keydown",kw="keyboard.keyup",Ow=1e3,om="Keyboard binding is now implicit; explicit binding to an element got removed. For more information, see https://github.com/bpmn-io/diagram-js/issues/661";function bt(e,t){var n=this;this._config=e=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",function(){n._fire("destroy"),n.unbind()}),e.bindTo&&console.error("unsupported configuration ",new Error(om));var r=e&&e.bind!==!1;t.on("canvas.init",function(i){n._target=i.svg,r&&n.bind(),n._fire("init")})}bt.$inject=["config.keyboard","eventBus"];bt.prototype._keydownHandler=function(e){this._keyHandler(e,Ic)};bt.prototype._keyupHandler=function(e){this._keyHandler(e,kw)};bt.prototype._keyHandler=function(e,t){var n;if(!this._isEventIgnored(e)){var r={keyEvent:e};n=this._eventBus.fire(t||Ic,r),n&&e.preventDefault()}};bt.prototype._isEventIgnored=function(e){return!1};bt.prototype.bind=function(e){e&&console.error("unsupported argument ",new Error(om)),this.unbind(),e=this._node=this._target,ae.bind(e,"keydown",this._keydownHandler),ae.bind(e,"keyup",this._keyupHandler),this._fire("bind")};bt.prototype.getBinding=function(){return this._node};bt.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),ae.unbind(e,"keydown",this._keydownHandler),ae.unbind(e,"keyup",this._keyupHandler)),this._node=null};bt.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})};bt.prototype.addListener=function(e,t,n){Ne(e)&&(n=t,t=e,e=Ow),this._eventBus.on(n||Ic,e,t)};bt.prototype.removeListener=function(e,t){this._eventBus.off(t||Ic,e)};bt.prototype.hasModifier=Qh;bt.prototype.isCmd=lt;bt.prototype.isShift=Bc;bt.prototype.isKey=ze;var Nw=500;function mr(e,t){var n=this;e.on("editorActions.init",Nw,function(r){var i=r.editorActions;n.registerBindings(t,i)})}mr.$inject=["eventBus","keyboard"];mr.prototype.registerBindings=function(e,t){function n(r,i){t.isRegistered(r)&&e.addListener(i)}n("undo",function(r){var i=r.keyEvent;if(rm(i))return t.trigger("undo"),!0}),n("redo",function(r){var i=r.keyEvent;if(im(i))return t.trigger("redo"),!0}),n("copy",function(r){var i=r.keyEvent;if(Jh(i))return t.trigger("copy"),!0}),n("paste",function(r){var i=r.keyEvent;if(em(i))return t.trigger("paste"),!0}),n("duplicate",function(r){var i=r.keyEvent;if(tm(i))return t.trigger("duplicate"),!0}),n("cut",function(r){var i=r.keyEvent;if(nm(i))return t.trigger("cut"),!0}),n("stepZoom",function(r){var i=r.keyEvent;if(ze(["+","Add","="],i)&<(i))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(r){var i=r.keyEvent;if(ze(["-","Subtract"],i)&<(i))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(r){var i=r.keyEvent;if(ze("0",i)&<(i))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(r){var i=r.keyEvent;if(ze(["Backspace","Delete","Del"],i))return t.trigger("removeSelection"),!0})};var uo={__init__:["keyboard","keyboardBindings"],keyboard:["type",bt],keyboardBindings:["type",mr]};var Bw={moveSpeed:50,moveSpeedAccelerated:200};function Lc(e,t,n){var r=this;this._config=C({},Bw,e||{}),t.addListener(i);function i(o){var a=o.keyEvent,s=r._config;if(t.isCmd(a)&&t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],a)){var c=t.isShift(a)?s.moveSpeedAccelerated:s.moveSpeed,p;switch(a.key){case"ArrowLeft":case"Left":p="left";break;case"ArrowUp":case"Up":p="up";break;case"ArrowRight":case"Right":p="right";break;case"ArrowDown":case"Down":p="down";break}return r.moveCanvas({speed:c,direction:p}),!0}}this.moveCanvas=function(o){var a=0,s=0,c=o.speed,p=c/Math.min(Math.sqrt(n.viewbox().scale),1);switch(o.direction){case"left":a=p;break;case"up":s=p;break;case"right":a=-p;break;case"down":s=-p;break}n.scroll({dx:a,dy:s})}}Lc.$inject=["config.keyboardMove","keyboard","canvas"];var jc={__depends__:[uo],__init__:["keyboardMove"],keyboardMove:["type",Lc]};var Iw=/^djs-cursor-.*$/;function gi(e){var t=Ae(document.body);t.removeMatching(Iw),e&&t.add("djs-cursor-"+e)}function Fc(){gi(null)}var Lw=5e3;function Hc(e,t){t=t||"element.click";function n(){return!1}return e.once(t,Lw,n),function(){e.off(t,n)}}function lo(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Et(e,t){return{x:e.x-t.x,y:e.y-t.y}}var jw=15;function $c(e,t){var n;function r(s){return a(s.originalEvent)}e.on("canvas.focus.changed",function(s){s.focused?e.on("element.mousedown",500,r):e.off("element.mousedown",r)});function i(s){var c=n.start,p=n.button,u=yn(s),l=Et(u,c);if(!n.dragging&&Fw(l)>jw&&(n.dragging=!0,p===0&&Hc(e),gi("grab")),n.dragging){var f=n.last||n.start;l=Et(u,f),t.scroll({dx:l.x,dy:l.y}),n.last=u}s.preventDefault()}function o(s){ae.unbind(document,"mousemove",i),ae.unbind(document,"mouseup",o),n=null,Fc()}function a(s){if(!Sn(s.target,".djs-draggable")){var c=s.button;if(!(c>=2||s.ctrlKey||s.shiftKey||s.altKey))return n={button:c,start:yn(s)},ae.bind(document,"mousemove",i),ae.bind(document,"mouseup",o),!0}}this.isActive=function(){return!!n}}$c.$inject=["eventBus","canvas"];function Fw(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}var zc={__init__:["moveCanvas"],moveCanvas:["type",$c]};function Ea(e){return Math.log(e)/Math.log(10)}function Bl(e,t){var n=Ea(e.min),r=Ea(e.max),i=Math.abs(n)+Math.abs(r);return i/t}function am(e,t){return Math.max(e.min,Math.min(e.max,t))}var Hw=Math.sign||function(e){return e>=0?1:-1},Il={min:.2,max:4},sm=10,$w=.1,zw=.75;function _n(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=Je(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||zw;var r=this;t.on("canvas.mouseover",function(){r._init(e.enabled!==!1)}),t.on("canvas.mouseout",function(){r._init(!1)})}_n.$inject=["config.zoomScroll","eventBus","canvas"];_n.prototype.scroll=function(t){this._canvas.scroll(t)};_n.prototype.reset=function(){this._canvas.zoom("fit-viewport")};_n.prototype.zoom=function(t,n){var r=Bl(Il,sm*2);this._totalDelta+=t,Math.abs(this._totalDelta)>$w&&(this._zoom(t,n,r),this._totalDelta=0)};_n.prototype._handleWheel=function(t){if(this._enabled){var n=this._container;t.preventDefault();var r=t.ctrlKey||Mc()&&t.metaKey,i=t.shiftKey,o=-1*this._scale,a;if(r?o*=t.deltaMode===0?.02:.32:o*=t.deltaMode===0?1:16,r){var s=n.getBoundingClientRect(),c={x:t.clientX-s.left,y:t.clientY-s.top};a=Math.sqrt(Math.pow(t.deltaY,2)+Math.pow(t.deltaX,2))*Hw(t.deltaY)*o,this.zoom(a,c)}else i?a={dx:o*t.deltaY,dy:0}:a={dx:o*t.deltaX,dy:o*t.deltaY},this.scroll(a)}};_n.prototype.stepZoom=function(t,n){var r=Bl(Il,sm);this._zoom(t,n,r)};_n.prototype._zoom=function(e,t,n){var r=this._canvas,i=e>0?1:-1,o=Ea(r.zoom()),a=Math.round(o/n)*n;a+=n*i;var s=Math.pow(10,a);r.zoom(am(Il,s),t)};_n.prototype.toggle=function(t){var n=this._container,r=this._handleWheel,i=this._enabled;return typeof t=="undefined"&&(t=!i),i!==t&&ae[t?"bind":"unbind"](n,"wheel",r,!1),this._enabled=t,t};_n.prototype._init=function(e){this.toggle(e)};var Vc={__init__:["zoomScroll"],zoomScroll:["type",_n]};function gr(e){sn.call(this,e)}N(gr,sn);gr.prototype._navigationModules=[jc,zc,Vc];gr.prototype._modules=[].concat(sn.prototype._modules,gr.prototype._navigationModules);function Ll(e){return e&&e[e.length-1]}function cm(e){return e.y}function pm(e){return e.x}var Vw={left:pm,center:pm,right:function(e){return e.x+e.width},top:cm,middle:cm,bottom:function(e){return e.y+e.height}};function Gr(e,t){this._modeling=e,this._rules=t}Gr.$inject=["modeling","rules"];Gr.prototype._getOrientationDetails=function(e){var t=["top","bottom","middle"],n="x",r="width";return t.indexOf(e)!==-1&&(n="y",r="height"),{axis:n,dimension:r}};Gr.prototype._isType=function(e,t){return t.indexOf(e)!==-1};Gr.prototype._alignmentPosition=function(e,t){var n=this._getOrientationDetails(e),r=n.axis,i=n.dimension,o={},a={},s=!1,c,p,u;function l(f,d){return Math.round((f[r]+d[r]+d[i])/2)}if(this._isType(e,["left","top"]))o[e]=t[0][r];else if(this._isType(e,["right","bottom"]))u=Ll(t),o[e]=u[r]+u[i];else if(this._isType(e,["center","middle"])){if(E(t,function(f){var d=f[r]+Math.round(f[i]/2);a[d]?a[d].elements.push(f):a[d]={elements:[f],center:d}}),c=St(a,function(f){return f.elements.length>1&&(s=!0),f.elements.length}),s)return o[e]=Ll(c).center,o;p=t[0],t=St(t,function(f){return f[r]+f[i]}),u=Ll(t),o[e]=l(p,u)}return o};Gr.prototype.trigger=function(e,t){var n=this._modeling,r,i=J(e,function(c){return!(c.waypoints||c.host||c.labelTarget)});if(r=this._rules.allowed("elements.align",{elements:i}),U(r)&&(i=r),!(i.length<2||!r)){var o=Vw[t],a=St(i,o),s=this._alignmentPosition(t,a);n.alignElements(a,s)}};var um={__init__:["alignElements"],alignElements:["type",Gr]};var Ww=new Un;function Ur(e){this._scheduled={},e.on("diagram.destroy",()=>{Object.keys(this._scheduled).forEach(t=>{this.cancel(t)})})}Ur.$inject=["eventBus"];Ur.prototype.schedule=function(e,t=Ww.next()){this.cancel(t);let n=this._schedule(e,t);return this._scheduled[t]=n,n.promise};Ur.prototype._schedule=function(e,t){let n=Gw();return{executionId:setTimeout(()=>{try{this._scheduled[t]=null;try{n.resolve(e())}catch(i){n.reject(i)}}catch(i){console.error("Scheduler#_schedule execution failed",i)}}),promise:n.promise}};Ur.prototype.cancel=function(e){let t=this._scheduled[e];t&&(this._cancel(t),this._scheduled[e]=null)};Ur.prototype._cancel=function(e){clearTimeout(e.executionId)};function Gw(){let e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}var lm={scheduler:["type",Ur]};var Uw="djs-element-hidden",Wc=".entry",Kw=1e3,fm=8,Yw=300;function Xe(e,t,n,r){this._canvas=e,this._elementRegistry=t,this._eventBus=n,this._scheduler=r,this._current=null,this._init()}Xe.$inject=["canvas","elementRegistry","eventBus","scheduler"];Xe.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",function(t){var n=t.newSelection,r=n.length?n.length===1?n[0]:n:null;r?e.open(r,!0):e.close()}),this._eventBus.on("elements.changed",function(t){var n=t.elements,r=e._current;if(r){var i=r.target,o=U(i)?i:[i],a=o.filter(function(c){return n.includes(c)});if(a.length){e.close();var s=o.filter(function(c){return e._elementRegistry.get(c.id)});s.length&&e._updateAndOpen(s.length>1?s:s[0])}}}),this._eventBus.on("canvas.viewbox.changed",function(){e._updatePosition()}),this._eventBus.on("element.marker.update",function(t){if(e.isOpen()){var n=t.element,r=e._current,i=U(r.target)?r.target:[r.target];i.includes(n)&&e._updateVisibility()}}),this._container=this._createContainer()};Xe.prototype._createContainer=function(){var e=ye('
    ');return this._canvas.getContainer().appendChild(e),e};Xe.prototype.registerProvider=function(e,t){t||(t=e,e=Kw),this._eventBus.on("contextPad.getProviders",e,function(n){n.providers.push(t)})};Xe.prototype.getEntries=function(e){var t=this._getProviders(),n=U(e)?"getMultiElementContextPadEntries":"getContextPadEntries",r={};return E(t,function(i){if(Ne(i[n])){var o=i[n](e);Ne(o)?r=o(r):E(o,function(a,s){r[s]=a})}}),r};Xe.prototype.trigger=function(e,t,n){var r=this,i,o,a=t.delegateTarget||t.target;if(!a)return t.preventDefault();if(i=Ye(a,"data-action"),o=t.originalEvent||t,e==="mouseover"){this._timeout=setTimeout(function(){r._mouseout=r.triggerEntry(i,"hover",o,n)},Yw);return}else if(e==="mouseout"){clearTimeout(this._timeout),this._mouseout&&(this._mouseout(),this._mouseout=null);return}return this.triggerEntry(i,e,o,n)};Xe.prototype.triggerEntry=function(e,t,n,r){if(this.isShown()){var i=this._current.target,o=this._current.entries,a=o[e];if(a){var s=a.action;if(this._eventBus.fire("contextPad.trigger",{entry:a,event:n})!==!1){if(Ne(s)){if(t==="click")return s(n,i,r)}else if(s[t])return s[t](n,i,r);n.preventDefault()}}}};Xe.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))};Xe.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers};Xe.prototype._updateAndOpen=function(e){var t=this.getEntries(e),n=this._createHtml(e),r;E(t,function(i,o){var a=i.group||"default",s=ye(i.html||'
    '),c;Ye(s,"data-action",o),c=me("[data-group="+lr(a)+"]",n),c||(c=ye('
    '),Ye(c,"data-group",a),n.appendChild(c)),c.appendChild(s),i.className&&qw(s,i.className),i.title&&Ye(s,"title",i.title),i.imageUrl&&(r=ye(""),Ye(r,"src",i.imageUrl),r.style.width="100%",r.style.height="100%",s.appendChild(r))}),Ae(n).add("open"),this._current={entries:t,html:n,target:e},this._updatePosition(),this._updateVisibility(),this._eventBus.fire("contextPad.open",{current:this._current})};Xe.prototype._createHtml=function(e){var t=this,n=ye('
    ');return ut.bind(n,Wc,"click",function(r){t.trigger("click",r)}),ut.bind(n,Wc,"dragstart",function(r){t.trigger("dragstart",r)}),ut.bind(n,Wc,"mouseover",function(r){t.trigger("mouseover",r)}),ut.bind(n,Wc,"mouseout",function(r){t.trigger("mouseout",r)}),ae.bind(n,"mousedown",function(r){r.stopPropagation()}),this._container.appendChild(n),this._eventBus.fire("contextPad.create",{target:e,pad:n}),n};Xe.prototype.getPad=function(e){console.warn(new Error("ContextPad#getPad is deprecated and will be removed in future library versions, cf. https://github.com/bpmn-io/diagram-js/pull/888"));let t;return this.isOpen()&&Zw(this._current.target,e)?t=this._current.html:t=this._createHtml(e),{html:t}};Xe.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)};Xe.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return U(e)!==U(n)?!1:U(e)?e.length===n.length&&hn(e,function(r){return n.includes(r)}):n===e};Xe.prototype.isShown=function(){return this.isOpen()&&Ae(this._current.html).has("open")};Xe.prototype.show=function(){this.isOpen()&&(Ae(this._current.html).add("open"),this._updatePosition(),this._eventBus.fire("contextPad.show",{current:this._current}))};Xe.prototype.hide=function(){this.isOpen()&&(Ae(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))};Xe.prototype._getPosition=function(e){if(!U(e)&&fe(e)){var t=this._canvas.viewbox(),n=Xw(e),r=n.x*t.scale-t.x*t.scale,i=n.y*t.scale-t.y*t.scale;return{left:r+fm*this._canvas.zoom(),top:i}}var o=this._canvas.getContainer(),a=o.getBoundingClientRect(),s=this._getTargetBounds(e);return{left:s.right-a.left+fm*this._canvas.zoom(),top:s.top-a.top}};Xe.prototype._updatePosition=function(){let e=()=>{if(this.isOpen()){var t=this._current.html,n=this._getPosition(this._current.target);"x"in n&&"y"in n?(t.style.left=n.x+"px",t.style.top=n.y+"px"):["top","right","bottom","left"].forEach(function(r){r in n&&(t.style[r]=n[r]+"px")})}};this._scheduler.schedule(e,"ContextPad#_updatePosition")};Xe.prototype._updateVisibility=function(){let e=()=>{if(this.isOpen()){var t=this,n=this._current.target,r=U(n)?n:[n],i=r.some(function(o){return t._canvas.hasMarker(o,Uw)});i?t.hide():t.show()}};this._scheduler.schedule(e,"ContextPad#_updateVisibility")};Xe.prototype._getTargetBounds=function(e){var t=this,n=U(e)?e:[e],r=n.map(function(i){return t._canvas.getGraphics(i)});return r.reduce(function(i,o){let a=o.getBoundingClientRect();return i.top=Math.min(i.top,a.top),i.right=Math.max(i.right,a.right),i.bottom=Math.max(i.bottom,a.bottom),i.left=Math.min(i.left,a.left),i.x=i.left,i.y=i.top,i.width=i.right-i.left,i.height=i.bottom-i.top,i},{top:1/0,right:-1/0,bottom:-1/0,left:1/0})};function qw(e,t){var n=Ae(e);t=U(t)?t:t.split(/\s+/g),t.forEach(function(r){n.add(r)})}function Xw(e){return e.waypoints[e.waypoints.length-1]}function Zw(e,t){return e=U(e)?e:[e],t=U(t)?t:[t],e.length===t.length&&hn(e,function(n){return t.includes(n)})}var Gc={__depends__:[Vr,lm,$r],contextPad:["type",Xe]};var Qc,Ve,vm,Qw,Kr,dm,ym,_m,jl,Kc,wa,xm,zl,Fl,Hl,Jw,qc={},Xc=[],eS=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Jc=Array.isArray;function vr(e,t){for(var n in t)e[n]=t[n];return e}function Vl(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ep(e,t,n){var r,i,o,a={};for(o in t)o=="key"?r=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Qc.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return Yc(e,a,r,i,null)}function Yc(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i==null?++vm:i,__i:-1,__u:0};return i==null&&Ve.vnode!=null&&Ve.vnode(o),o}function tp(e){return e.children}function Sa(e,t){this.props=e,this.context=t}function fo(e,t){if(t==null)return e.__?fo(e.__,e.__i+1):null;for(var n;tt&&Kr.sort(_m),e=Kr.shift(),t=Kr.length,tS(e)}finally{Kr.length=Zc.__r=0}}function Em(e,t,n,r,i,o,a,s,c,p,u){var l,f,d,h,_,v,w,P=r&&r.__k||Xc,b=t.length;for(c=nS(n,t,P,c,b),l=0;l0?a=e.__k[o]=Yc(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[o]=a,c=o+f,a.__=e,a.__b=e.__b+1,s=null,(p=a.__i=rS(a,n,c,l))!=-1&&(l--,(s=n[p])&&(s.__u|=2)),s==null||s.__v==null?(p==-1&&(i>u?f--:ic?f--:f++,a.__u|=4))):e.__k[o]=null;if(l)for(o=0;o(u?1:0)){for(i=n-1,o=n+1;i>=0||o=0?i--:o++])!=null&&(2&p.__u)==0&&s==p.key&&c==p.type)return a}return-1}function mm(e,t,n){t[0]=="-"?e.setProperty(t,n==null?"":n):e[t]=n==null?"":typeof n!="number"||eS.test(t)?n:n+"px"}function Uc(e,t,n,r,i){var o,a;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||mm(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||mm(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(xm,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n[wa]=r[wa]:(n[wa]=zl,e.addEventListener(t,o?Hl:Fl,o)):e.removeEventListener(t,o?Hl:Fl,o);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n==null?"":n;break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function gm(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[Kc]==null)t[Kc]=zl++;else if(t[Kc]0?e:Jc(e)?e.map(Cm):vr({},e)}function iS(e,t,n,r,i,o,a,s,c){var p,u,l,f,d,h,_,v=n.props||qc,w=t.props,P=t.type;if(P=="svg"?i="http://www.w3.org/2000/svg":P=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(p=0;p=5&&((a||!f&&o===5)&&(c.push(o,0,a,i),o=6),f&&(c.push(o,f,0,i),o=6)),a=""},u=0;u"?(o=1,a=""):a=r+a[0]:s?r===s?s="":a+=r:r==='"'||r==="'"?s=r:r===">"?(p(),o=1):o&&(r==="="?(o=5,i=a,a=""):r==="/"&&(o<5||n[u][l+1]===">")?(p(),o===3&&(c=c[0]),o=c,(c=c[0]).push(2,0,o),o=0):r===" "||r===" "||r===` -`||r==="\r"?(p(),o=2):a+=r),o===3&&a==="!--"&&(o=4,c=c[0])}return p(),c})(e)),t),arguments,[])).length>1?t:t[0]}var Oe=Tm.bind(ep);var ho,rt,Ul,Mm,Ca=0,jm=[],ct=Ve,Dm=ct.__b,km=ct.__r,Om=ct.diffed,Nm=ct.__c,Bm=ct.unmount,Im=ct.__;function ip(e,t){ct.__h&&ct.__h(rt,e,Ca||t),Ca=0;var n=rt.__H||(rt.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function op(e){return Ca=1,Fm(Hm,e)}function Fm(e,t,n){var r=ip(ho++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Hm(void 0,t),function(s){var c=r.__N?r.__N[0]:r.__[0],p=r.t(c,s);c!==p&&(r.__N=[p,r.__[1]],r.__c.setState({}))}],r.__c=rt,!rt.__f)){var i=function(s,c,p){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(f){return f.__c});if(u.every(function(f){return!f.__N}))return!o||o.call(this,s,c,p);var l=r.__c.props!==s;return u.some(function(f){if(f.__N){var d=f.__[0];f.__=f.__N,f.__N=void 0,d!==f.__[0]&&(l=!0)}}),o&&o.call(this,s,c,p)||l};rt.__f=!0;var o=rt.shouldComponentUpdate,a=rt.componentWillUpdate;rt.componentWillUpdate=function(s,c,p){if(this.__e){var u=o;o=void 0,i(s,c,p),o=u}a&&a.call(this,s,c,p)},rt.shouldComponentUpdate=i}return r.__N||r.__}function Ra(e,t){var n=ip(ho++,3);!ct.__s&&Yl(n.__H,t)&&(n.__=e,n.u=t,rt.__H.__h.push(n))}function mo(e,t){var n=ip(ho++,4);!ct.__s&&Yl(n.__H,t)&&(n.__=e,n.u=t,rt.__h.push(n))}function Pa(e){return Ca=5,Yn(function(){return{current:e}},[])}function Yn(e,t){var n=ip(ho++,7);return Yl(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function go(e,t){return Ca=8,Yn(function(){return e},t)}function aS(){for(var e;e=jm.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(rp),t.__h.some(Kl),t.__h=[]}catch(n){t.__h=[],ct.__e(n,e.__v)}}}ct.__b=function(e){rt=null,Dm&&Dm(e)},ct.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Im&&Im(e,t)},ct.__r=function(e){km&&km(e),ho=0;var t=(rt=e.__c).__H;t&&(Ul===rt?(t.__h=[],rt.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(rp),t.__h.some(Kl),t.__h=[],ho=0)),Ul=rt},ct.diffed=function(e){Om&&Om(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(jm.push(t)!==1&&Mm===ct.requestAnimationFrame||((Mm=ct.requestAnimationFrame)||sS)(aS)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Ul=rt=null},ct.__c=function(e,t){t.some(function(n){try{n.__h.some(rp),n.__h=n.__h.filter(function(r){return!r.__||Kl(r)})}catch(r){t.some(function(i){i.__h&&(i.__h=[])}),t=[],ct.__e(r,n.__v)}}),Nm&&Nm(e,t)},ct.unmount=function(e){Bm&&Bm(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{rp(r)}catch(i){t=i}}),n.__H=void 0,t&&ct.__e(t,n.__v))};var Lm=typeof requestAnimationFrame=="function";function sS(e){var t,n=function(){clearTimeout(r),Lm&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Lm&&(t=requestAnimationFrame(n))}function rp(e){var t=rt,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),rt=t}function Kl(e){var t=rt;e.__c=e.__(),rt=t}function Yl(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Hm(e,t){return typeof t=="function"?t(e):t}function $m(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;tpS(t),[t]),s=p=>p.action&&!p.disabled,c=(p,u)=>{if(s(u))return n(p,u)};return Oe` +'+s+a+""}catch(r){n=r}if(this._emit("saveSVG.done",{error:n,svg:t}),n)throw n;return{svg:t}};Le.prototype._setDefinitions=function(e){this._definitions=e};Le.prototype.getModules=function(){return this._modules};Le.prototype.clear=function(){this.getDefinitions()&&Jn.prototype.clear.call(this)};Le.prototype.destroy=function(){Jn.prototype.destroy.call(this),Gt(this._container)};Le.prototype.on=function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)};Le.prototype.off=function(e,t){this.get("eventBus").off(e,t)};Le.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),typeof e=="string"&&(e=ge(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()};Le.prototype.getDefinitions=function(){return this._definitions};Le.prototype.detach=function(){let e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))};Le.prototype._init=function(e,t,n){let r=n.modules||this.getModules(n),i=n.additionalModules||[],o=[{bpmnjs:["value",this],moddle:["value",t]}],a=[].concat(o,r,i),s=C(Mt(n,["additionalModules"]),{canvas:C({},n.canvas,{container:e}),modules:a});Jn.call(this,s),n&&n.container&&this.attachTo(n.container)};Le.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)};Le.prototype._createContainer=function(e){let t=ue('
    ');return dt(t,{width:mh(e.width),height:mh(e.height),position:e.position}),t};Le.prototype._createModdle=function(e){let t=C({},this._moddleExtensions,e.moddleExtensions);return new ph(t)};Le.prototype._modules=[];function Mc(e,t){return e.warnings=t,e}function US(e){let n=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return n&&(e.message="unparsable content <"+n[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+n[2]),e}var qS={width:"100%",height:"100%",position:"relative"};function mh(e){return e+(te(e)?"px":"")}function KS(e,t){return t&&re(e.diagrams,function(n){return n.id===t})||null}function YS(e){let n=''+Yl+"",r=ue(n);dt(ge("svg",r),Xl),dt(r,Zl,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(r),se.bind(r,"click",function(i){dh(),i.preventDefault()})}function Ci(e){Le.call(this,e),this.on("import.parse.complete",function(t){t.error||this._collectIds(t.definitions,t.elementsById)},this),this.on("diagram.destroy",function(){this.get("moddle").ids.clear()},this)}B(Ci,Le);Ci.prototype._createModdle=function(e){var t=Le.prototype._createModdle.call(this,e);return t.ids=new En([32,36,1]),t};Ci.prototype._collectIds=function(e,t){var n=e.$model,r=n.ids,i;r.clear();for(i in t)r.claim(i,t[i])};k();k();function oe(e,t){return h(e,"bpmn:CallActivity")?!1:h(e,"bpmn:SubProcess")?(t=t||ce(e),t&&h(t,"bpmndi:BPMNPlane")?!0:t&&!!t.isExpanded):h(e,"bpmn:Participant")?!!j(e).processRef:!0}function Pe(e){if(!(!h(e,"bpmn:Participant")&&!h(e,"bpmn:Lane"))){var t=ce(e).isHorizontal;return t===void 0?!0:t}}function hh(e){return e&&j(e).isInterrupting!==!1}function Ye(e){return e&&!!j(e).triggeredByEvent}function br(e,t){var n=j(e).eventDefinitions;return Bt(n,function(r){return h(r,t)})}function vh(e){return br(e,"bpmn:ErrorEventDefinition")}function gh(e){return br(e,"bpmn:EscalationEventDefinition")}function yh(e){return br(e,"bpmn:CompensateEventDefinition")}k();var fo={width:90,height:20},_h=15;function dn(e){return h(e,"bpmn:Event")||h(e,"bpmn:Gateway")||h(e,"bpmn:DataStoreReference")||h(e,"bpmn:DataObjectReference")||h(e,"bpmn:DataInput")||h(e,"bpmn:DataOutput")||h(e,"bpmn:SequenceFlow")||h(e,"bpmn:MessageFlow")||h(e,"bpmn:Group")}function Kr(e){return ne(e.label)}function XS(e){var t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)],i=ZS(e),o=Math.atan((r.y-n.y)/(r.x-n.x)),a=i.x,s=i.y;return Math.abs(o) defs",F);ae||(ae=U("defs"),Q(F,ae)),Q(ae,W)}function d(P,_,g,T){var M=e1.nextPrefixed("marker-");return m(P,M,_,g,T),"url(#"+M+")"}function m(P,_,g,T,M){if(g==="sequenceflow-end"){var F=U("path",{d:"M 1 5 L 11 10 L 1 15 Z",...p({fill:M,stroke:M,strokeWidth:1})});f(_,{element:F,ref:{x:11,y:10},scale:.5,parentGfx:P})}if(g==="messageflow-start"){var W=U("circle",{cx:6,cy:6,r:3.5,...p({fill:T,stroke:M,strokeWidth:1,strokeDasharray:[1e4,1]})});f(_,{element:W,ref:{x:6,y:6},parentGfx:P})}if(g==="messageflow-end"){var ae=U("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...p({fill:T,stroke:M,strokeWidth:1,strokeDasharray:[1e4,1]})});f(_,{element:ae,ref:{x:8.5,y:5},parentGfx:P})}if(g==="association-start"){var _e=U("path",{d:"M 11 5 L 1 10 L 11 15",...l({fill:"none",stroke:M,strokeWidth:1.5,strokeDasharray:[1e4,1]})});f(_,{element:_e,ref:{x:1,y:10},scale:.5,parentGfx:P})}if(g==="association-end"){var pt=U("path",{d:"M 1 5 L 11 10 L 1 15",...l({fill:"none",stroke:M,strokeWidth:1.5,strokeDasharray:[1e4,1]})});f(_,{element:pt,ref:{x:11,y:10},scale:.5,parentGfx:P})}if(g==="conditional-flow-marker"){var rt=U("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...p({fill:T,stroke:M})});f(_,{element:rt,ref:{x:-1,y:10},scale:.5,parentGfx:P})}if(g==="conditional-default-flow-marker"){var xt=U("path",{d:"M 6 4 L 10 16",...p({stroke:M,fill:"none"})});f(_,{element:xt,ref:{x:0,y:10},scale:.5,parentGfx:P})}}function y(P,_,g,T,M={}){Ee(T)&&(M=T,T=0),T=T||0,M=p(M);var F=_/2,W=g/2,ae=U("circle",{cx:F,cy:W,r:Math.round((_+g)/4-T),...M});return Q(P,ae),ae}function v(P,_,g,T,M,F){Ee(M)&&(F=M,M=0),M=M||0,F=p(F);var W=U("rect",{x:M,y:M,width:_-M*2,height:g-M*2,rx:T,ry:T,...F});return Q(P,W),W}function w(P,_,g,T){var M=_/2,F=g/2,W=[{x:M,y:0},{x:_,y:F},{x:M,y:g},{x:0,y:F}],ae=W.map(function(pt){return pt.x+","+pt.y}).join(" ");T=p(T);var _e=U("polygon",{...T,points:ae});return Q(P,_e),_e}function R(P,_,g,T){g=l(g);var M=Kn(_,g,T);return Q(P,M),M}function x(P,_,g){return R(P,_,g,5)}function b(P,_,g){g=l(g);var T=U("path",{...g,d:_});return Q(P,T),T}function S(P,_,g,T){return b(_,g,C({"data-marker":P},T))}function A(P){return $t[P]}function O(P){return function(_,g,T){return A(P)(_,g,T)}}var D={"bpmn:MessageEventDefinition":function(P,_,g={},T){var M=r.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:g.width||_.width,containerHeight:g.height||_.height,position:{mx:.235,my:.315}}),F=T?X(_,c,g.stroke):ve(_,s,g.fill),W=T?ve(_,s,g.fill):X(_,c,g.stroke),ae=b(P,M,{fill:F,stroke:W,strokeWidth:1});return ae},"bpmn:TimerEventDefinition":function(P,_,g={}){var T=g.width||_.width,M=g.height||_.height,F=g.width?1:2,W=y(P,T,M,.2*M,{fill:ve(_,s,g.fill),stroke:X(_,c,g.stroke),strokeWidth:F}),ae=r.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:T,containerHeight:M,position:{mx:.5,my:.5}});b(P,ae,{stroke:X(_,c,g.stroke),strokeWidth:F});for(var _e=0;_e<12;_e++){var pt=r.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:T,containerHeight:M,position:{mx:.5,my:.5}}),rt=T/2,xt=M/2;b(P,pt,{strokeWidth:1,stroke:X(_,c,g.stroke),transform:"rotate("+_e*30+","+xt+","+rt+")"})}return W},"bpmn:EscalationEventDefinition":function(P,_,g={},T){var M=r.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:g.width||_.width,containerHeight:g.height||_.height,position:{mx:.5,my:.2}}),F=T?X(_,c,g.stroke):ve(_,s,g.fill);return b(P,M,{fill:F,stroke:X(_,c,g.stroke),strokeWidth:1})},"bpmn:ConditionalEventDefinition":function(P,_,g={}){var T=r.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:g.width||_.width,containerHeight:g.height||_.height,position:{mx:.5,my:.222}});return b(P,T,{fill:ve(_,s,g.fill),stroke:X(_,c,g.stroke),strokeWidth:1})},"bpmn:LinkEventDefinition":function(P,_,g={},T){var M=r.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.57,my:.263}}),F=T?X(_,c,g.stroke):ve(_,s,g.fill);return b(P,M,{fill:F,stroke:X(_,c,g.stroke),strokeWidth:1})},"bpmn:ErrorEventDefinition":function(P,_,g={},T){var M=r.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:g.width||_.width,containerHeight:g.height||_.height,position:{mx:.2,my:.722}}),F=T?X(_,c,g.stroke):ve(_,s,g.fill);return b(P,M,{fill:F,stroke:X(_,c,g.stroke),strokeWidth:1})},"bpmn:CancelEventDefinition":function(P,_,g={},T){var M=r.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.638,my:-.055}}),F=T?X(_,c,g.stroke):"none",W=b(P,M,{fill:F,stroke:X(_,c,g.stroke),strokeWidth:1});return wc(W,45),W},"bpmn:CompensateEventDefinition":function(P,_,g={},T){var M=r.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:g.width||_.width,containerHeight:g.height||_.height,position:{mx:.22,my:.5}}),F=T?X(_,c,g.stroke):ve(_,s,g.fill);return b(P,M,{fill:F,stroke:X(_,c,g.stroke),strokeWidth:1})},"bpmn:SignalEventDefinition":function(P,_,g={},T){var M=r.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:g.width||_.width,containerHeight:g.height||_.height,position:{mx:.5,my:.2}}),F=T?X(_,c,g.stroke):ve(_,s,g.fill);return b(P,M,{strokeWidth:1,fill:F,stroke:X(_,c,g.stroke)})},"bpmn:MultipleEventDefinition":function(P,_,g={},T){var M=r.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:g.width||_.width,containerHeight:g.height||_.height,position:{mx:.211,my:.36}}),F=T?X(_,c,g.stroke):ve(_,s,g.fill);return b(P,M,{fill:F,stroke:X(_,c,g.stroke),strokeWidth:1})},"bpmn:ParallelMultipleEventDefinition":function(P,_,g={}){var T=r.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:g.width||_.width,containerHeight:g.height||_.height,position:{mx:.458,my:.194}});return b(P,T,{fill:ve(_,s,g.fill),stroke:X(_,c,g.stroke),strokeWidth:1})},"bpmn:TerminateEventDefinition":function(P,_,g={}){var T=y(P,_.width,_.height,8,{fill:X(_,c,g.stroke),stroke:X(_,c,g.stroke),strokeWidth:4});return T}};function L(P,_,g={},T){var M=j(P),F=Sh(M),W=T||P;return M.get("eventDefinitions")&&M.get("eventDefinitions").length>1?M.get("parallelMultiple")?D["bpmn:ParallelMultipleEventDefinition"](_,W,g,F):D["bpmn:MultipleEventDefinition"](_,W,g,F):In(M,"bpmn:MessageEventDefinition")?D["bpmn:MessageEventDefinition"](_,W,g,F):In(M,"bpmn:TimerEventDefinition")?D["bpmn:TimerEventDefinition"](_,W,g,F):In(M,"bpmn:ConditionalEventDefinition")?D["bpmn:ConditionalEventDefinition"](_,W,g,F):In(M,"bpmn:SignalEventDefinition")?D["bpmn:SignalEventDefinition"](_,W,g,F):In(M,"bpmn:EscalationEventDefinition")?D["bpmn:EscalationEventDefinition"](_,W,g,F):In(M,"bpmn:LinkEventDefinition")?D["bpmn:LinkEventDefinition"](_,W,g,F):In(M,"bpmn:ErrorEventDefinition")?D["bpmn:ErrorEventDefinition"](_,W,g,F):In(M,"bpmn:CancelEventDefinition")?D["bpmn:CancelEventDefinition"](_,W,g,F):In(M,"bpmn:CompensateEventDefinition")?D["bpmn:CompensateEventDefinition"](_,W,g,F):In(M,"bpmn:TerminateEventDefinition")?D["bpmn:TerminateEventDefinition"](_,W,g,F):null}var I={ParticipantMultiplicityMarker:function(P,_,g={}){var T=mn(_,g),M=qt(_,g),F=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:T,containerHeight:M,position:{mx:(T/2-6)/T,my:(M-15)/M}});S("participant-multiplicity",P,F,{strokeWidth:2,fill:ve(_,s,g.fill),stroke:X(_,c,g.stroke)})},SubProcessMarker:function(P,_,g={}){var T=v(P,14,14,0,{strokeWidth:1,fill:ve(_,s,g.fill),stroke:X(_,c,g.stroke)});Be(T,_.width/2-7.5,_.height-20);var M=r.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:_.width,containerHeight:_.height,position:{mx:(_.width/2-7.5)/_.width,my:(_.height-20)/_.height}});S("sub-process",P,M,{fill:ve(_,s,g.fill),stroke:X(_,c,g.stroke)})},ParallelMarker:function(P,_,g){var T=mn(_,g),M=qt(_,g),F=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:T,containerHeight:M,position:{mx:(T/2+g.parallel)/T,my:(M-20)/M}});S("parallel",P,F,{fill:ve(_,s,g.fill),stroke:X(_,c,g.stroke)})},SequentialMarker:function(P,_,g){var T=r.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:(_.width/2+g.seq)/_.width,my:(_.height-19)/_.height}});S("sequential",P,T,{fill:ve(_,s,g.fill),stroke:X(_,c,g.stroke)})},CompensationMarker:function(P,_,g){var T=r.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:(_.width/2+g.compensation)/_.width,my:(_.height-13)/_.height}});S("compensation",P,T,{strokeWidth:1,fill:ve(_,s,g.fill),stroke:X(_,c,g.stroke)})},LoopMarker:function(P,_,g){var T=mn(_,g),M=qt(_,g),F=r.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:T,containerHeight:M,position:{mx:(T/2+g.loop)/T,my:(M-7)/M}});S("loop",P,F,{strokeWidth:1.5,fill:"none",stroke:X(_,c,g.stroke),strokeMiterlimit:.5})},AdhocMarker:function(P,_,g){var T=mn(_,g),M=qt(_,g),F=r.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:T,containerHeight:M,position:{mx:(T/2+g.adhoc)/T,my:(M-15)/M}});S("adhoc",P,F,{strokeWidth:1,fill:X(_,c,g.stroke),stroke:X(_,c,g.stroke)})}};function $(P,_,g,T){I[P](_,g,T)}function G(P,_,g=[],T={}){T={fill:T.fill,stroke:T.stroke,width:mn(_,T),height:qt(_,T)};var M=j(_),F=g.includes("SubProcessMarker");F?T={...T,seq:-21,parallel:-22,compensation:-25,loop:-18,adhoc:10}:T={...T,seq:-5,parallel:-6,compensation:-7,loop:0,adhoc:-8},M.get("isForCompensation")&&g.push("CompensationMarker"),h(M,"bpmn:AdHocSubProcess")&&(g.push("AdhocMarker"),F||C(T,{compensation:T.compensation-18}));var W=M.get("loopCharacteristics"),ae=W&&W.get("isSequential");W&&(C(T,{compensation:T.compensation-18}),g.includes("AdhocMarker")&&C(T,{seq:-23,loop:-18,parallel:-24}),ae===void 0&&g.push("LoopMarker"),ae===!1&&g.push("ParallelMarker"),ae===!0&&g.push("SequentialMarker")),g.includes("CompensationMarker")&&g.length===1&&C(T,{compensation:-8}),E(g,function(_e){$(_e,P,_,T)})}function K(P,_,g={}){g=C({size:{width:100}},g);var T=o.createText(_||"",g);return fe(T).add("djs-label"),Q(P,T),T}function pe(P,_,g,T={}){var M=j(_),F=ho({x:_.x,y:_.y,width:_.width,height:_.height},T);return K(P,M.name,{align:g,box:F,padding:7,style:{fill:mo(_,u,c,T.stroke)}})}function bn(P,_,g={}){var T={width:90,height:30,x:_.width/2+_.x,y:_.height/2+_.y};return K(P,Pt(_),{box:T,fitBox:!0,style:C({},o.getExternalStyle(),{fill:mo(_,u,c,g.stroke)})})}function ke(P,_,g,T={}){var M=Pe(g),F=K(P,_,{box:{height:30,width:M?qt(g,T):mn(g,T)},align:"center-middle",style:{fill:mo(g,u,c,T.stroke)}});if(M){var W=-1*qt(g,T);co(F,0,-W,270)}}function ye(P,_,g={}){var{width:T,height:M}=ho(_,g);return v(P,T,M,Bc,{...g,fill:ve(_,s,g.fill),fillOpacity:vo,stroke:X(_,c,g.stroke)})}function Zt(P,_,g={}){var T=j(_),M=ve(_,s,g.fill),F=X(_,c,g.stroke);return(T.get("associationDirection")==="One"||T.get("associationDirection")==="Both")&&(g.markerEnd=d(P,"association-end",M,F)),T.get("associationDirection")==="Both"&&(g.markerStart=d(P,"association-start",M,F)),g=xe(g,["markerStart","markerEnd"]),x(P,_.waypoints,{...g,stroke:F,strokeDasharray:"0, 5"})}function Qt(P,_,g={}){var T=ve(_,s,g.fill),M=X(_,c,g.stroke),F=r.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.474,my:.296}}),W=b(P,F,{fill:T,fillOpacity:vo,stroke:M}),ae=j(_);if(Ch(ae)){var _e=r.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.33,my:(_.height-18)/_.height}});b(P,_e,{strokeWidth:2,fill:T,stroke:M})}return W}function Ke(P,_,g={}){return y(P,_.width,_.height,{fillOpacity:vo,...g,fill:ve(_,s,g.fill),stroke:X(_,c,g.stroke)})}function bt(P,_,g={}){return w(P,_.width,_.height,{fill:ve(_,s,g.fill),fillOpacity:vo,stroke:X(_,c,g.stroke)})}function H(P,_,g={}){var T=v(P,mn(_,g),qt(_,g),0,{fill:ve(_,s,g.fill),fillOpacity:g.fillOpacity||vo,stroke:X(_,c,g.stroke),strokeWidth:1.5}),M=j(_);if(h(M,"bpmn:Lane")){var F=M.get("name");ke(P,F,_,g)}return T}function V(P,_,g={}){var T=ye(P,_,g),M=oe(_);if(Ye(_)&&(z(T,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!M)){var F=j(_).flowElements||[],W=F.filter(ae=>h(ae,"bpmn:StartEvent"));W.length===1&&ie(W[0],P,g,_)}return pe(P,_,M?"center-top":"center-middle",g),M?G(P,_,void 0,g):G(P,_,["SubProcessMarker"],g),T}function ie(P,_,g,T){var M=22,F={fill:ve(T,s,g.fill),stroke:X(T,c,g.stroke),width:M,height:M},W=j(P).isInterrupting,ae=W?0:3,_e=W?1:1.2,pt=20,rt=(M-pt)/2,xt="translate("+rt+","+rt+")";y(_,pt,pt,{fill:F.fill,stroke:F.stroke,strokeWidth:_e,strokeDasharray:ae,transform:xt}),L(P,_,F,T)}function be(P,_,g={}){var T=ye(P,_,g);return pe(P,_,"center-middle",g),G(P,_,void 0,g),T}var $t=this.handlers={"bpmn:AdHocSubProcess":function(P,_,g={}){return oe(_)?g=xe(g,["fill","stroke","width","height"]):g=xe(g,["fill","stroke"]),V(P,_,g)},"bpmn:Association":function(P,_,g={}){return g=xe(g,["fill","stroke"]),Zt(P,_,g)},"bpmn:BoundaryEvent":function(P,_,g={}){var{renderIcon:T=!0}=g;g=xe(g,["fill","stroke"]);var M=j(_),F=M.get("cancelActivity");g={strokeWidth:1.5,fill:ve(_,s,g.fill),fillOpacity:i1,stroke:X(_,c,g.stroke)},F||(g.strokeDasharray="6");var W=Ke(P,_,g);return y(P,_.width,_.height,Oc,{...g,fill:"none"}),T&&L(_,P,g),W},"bpmn:BusinessRuleTask":function(P,_,g={}){g=xe(g,["fill","stroke"]);var T=be(P,_,g),M=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),F=b(P,M);z(F,{fill:ve(_,s,g.fill),stroke:X(_,c,g.stroke),strokeWidth:1});var W=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),ae=b(P,W);return z(ae,{fill:X(_,c,g.stroke),stroke:X(_,c,g.stroke),strokeWidth:1}),T},"bpmn:CallActivity":function(P,_,g={}){return g=xe(g,["fill","stroke"]),V(P,_,{strokeWidth:5,...g})},"bpmn:ComplexGateway":function(P,_,g={}){g=xe(g,["fill","stroke"]);var T=bt(P,_,g),M=r.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:_.width,containerHeight:_.height,position:{mx:.46,my:.26}});return b(P,M,{fill:X(_,c,g.stroke),stroke:X(_,c,g.stroke),strokeWidth:1}),T},"bpmn:DataInput":function(P,_,g={}){g=xe(g,["fill","stroke"]);var T=r.getRawPath("DATA_ARROW"),M=Qt(P,_,g);return b(P,T,{fill:"none",stroke:X(_,c,g.stroke),strokeWidth:1}),M},"bpmn:DataInputAssociation":function(P,_,g={}){return g=xe(g,["fill","stroke"]),Zt(P,_,{...g,markerEnd:d(P,"association-end",ve(_,s,g.fill),X(_,c,g.stroke))})},"bpmn:DataObject":function(P,_,g={}){return g=xe(g,["fill","stroke"]),Qt(P,_,g)},"bpmn:DataObjectReference":O("bpmn:DataObject"),"bpmn:DataOutput":function(P,_,g={}){g=xe(g,["fill","stroke"]);var T=r.getRawPath("DATA_ARROW"),M=Qt(P,_,g);return b(P,T,{strokeWidth:1,fill:ve(_,s,g.fill),stroke:X(_,c,g.stroke)}),M},"bpmn:DataOutputAssociation":function(P,_,g={}){return g=xe(g,["fill","stroke"]),Zt(P,_,{...g,markerEnd:d(P,"association-end",ve(_,s,g.fill),X(_,c,g.stroke))})},"bpmn:DataStoreReference":function(P,_,g={}){g=xe(g,["fill","stroke"]);var T=r.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:0,my:.133}});return b(P,T,{fill:ve(_,s,g.fill),fillOpacity:vo,stroke:X(_,c,g.stroke),strokeWidth:2})},"bpmn:EndEvent":function(P,_,g={}){var{renderIcon:T=!0}=g;g=xe(g,["fill","stroke"]);var M=Ke(P,_,{...g,strokeWidth:4});return T&&L(_,P,g),M},"bpmn:EventBasedGateway":function(P,_,g={}){g=xe(g,["fill","stroke"]);var T=j(_),M=bt(P,_,g);y(P,_.width,_.height,_.height*.2,{fill:ve(_,"none",g.fill),stroke:X(_,c,g.stroke),strokeWidth:1});var F=T.get("eventGatewayType"),W=!!T.get("instantiate");function ae(){var pt=r.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:_.width,containerHeight:_.height,position:{mx:.36,my:.44}});b(P,pt,{fill:"none",stroke:X(_,c,g.stroke),strokeWidth:2})}if(F==="Parallel"){var _e=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:_.width,containerHeight:_.height,position:{mx:.474,my:.296}});b(P,_e,{fill:"none",stroke:X(_,c,g.stroke),strokeWidth:1})}else F==="Exclusive"&&(W||y(P,_.width,_.height,_.height*.26,{fill:"none",stroke:X(_,c,g.stroke),strokeWidth:1}),ae());return M},"bpmn:ExclusiveGateway":function(P,_,g={}){g=xe(g,["fill","stroke"]);var T=bt(P,_,g),M=r.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:_.width,containerHeight:_.height,position:{mx:.32,my:.3}}),F=ce(_);return F.get("isMarkerVisible")&&b(P,M,{fill:X(_,c,g.stroke),stroke:X(_,c,g.stroke),strokeWidth:1}),T},"bpmn:Gateway":function(P,_,g={}){return g=xe(g,["fill","stroke"]),bt(P,_,g)},"bpmn:Group":function(P,_,g={}){return g=xe(g,["fill","stroke","width","height"]),v(P,_.width,_.height,Bc,{stroke:X(_,c,g.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:mn(_,g),height:qt(_,g)})},"bpmn:InclusiveGateway":function(P,_,g={}){g=xe(g,["fill","stroke"]);var T=bt(P,_,g);return y(P,_.width,_.height,_.height*.24,{fill:ve(_,s,g.fill),stroke:X(_,c,g.stroke),strokeWidth:2.5}),T},"bpmn:IntermediateEvent":function(P,_,g={}){var{renderIcon:T=!0}=g;g=xe(g,["fill","stroke"]);var M=Ke(P,_,{...g,strokeWidth:1.5});return y(P,_.width,_.height,Oc,{fill:"none",stroke:X(_,c,g.stroke),strokeWidth:1.5}),T&&L(_,P,g),M},"bpmn:IntermediateCatchEvent":O("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":O("bpmn:IntermediateEvent"),"bpmn:Lane":function(P,_,g={}){return g=xe(g,["fill","stroke","width","height"]),H(P,_,{...g,fillOpacity:o1})},"bpmn:ManualTask":function(P,_,g={}){g=xe(g,["fill","stroke"]);var T=be(P,_,g),M=r.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return b(P,M,{fill:ve(_,s,g.fill),stroke:X(_,c,g.stroke),strokeWidth:.5}),T},"bpmn:MessageFlow":function(P,_,g={}){g=xe(g,["fill","stroke"]);var T=j(_),M=ce(_),F=ve(_,s,g.fill),W=X(_,c,g.stroke),ae=x(P,_.waypoints,{markerEnd:d(P,"messageflow-end",F,W),markerStart:d(P,"messageflow-start",F,W),stroke:W,strokeDasharray:"10, 11",strokeWidth:1.5});if(T.get("messageRef")){var _e=ae.getPointAtLength(ae.getTotalLength()/2),pt=r.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:_e.x,y:_e.y}}),rt={strokeWidth:1};M.get("messageVisibleKind")==="initiating"?(rt.fill=F,rt.stroke=W):(rt.fill=W,rt.stroke=F);var xt=b(P,pt,rt),xn=T.get("messageRef"),Me=xn.get("name"),hr=K(P,Me,{align:"center-top",fitBox:!0,style:{fill:W}}),ac=xt.getBBox(),un=hr.getBBox(),he=_e.x-un.width/2,Re=_e.y+ac.height/2+t1;co(hr,he,Re,0)}return ae},"bpmn:ParallelGateway":function(P,_,g={}){g=xe(g,["fill","stroke"]);var T=bt(P,_,g),M=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:_.width,containerHeight:_.height,position:{mx:.46,my:.2}});return b(P,M,{fill:X(_,c,g.stroke),stroke:X(_,c,g.stroke),strokeWidth:1}),T},"bpmn:Participant":function(P,_,g={}){g=xe(g,["fill","stroke","width","height"]);var T=H(P,_,g),M=oe(_),F=Pe(_),W=j(_),ae=W.get("name");if(M){var _e=F?[{x:30,y:0},{x:30,y:qt(_,g)}]:[{x:0,y:30},{x:mn(_,g),y:30}];R(P,_e,{stroke:X(_,c,g.stroke),strokeWidth:n1}),ke(P,ae,_,g)}else{var pt=ho(_,g);F||(pt.height=mn(_,g),pt.width=qt(_,g));var rt=K(P,ae,{box:pt,align:"center-middle",style:{fill:mo(_,u,c,g.stroke)}});if(!F){var xt=-1*qt(_,g);co(rt,0,-xt,270)}}return W.get("participantMultiplicity")&&$("ParticipantMultiplicityMarker",P,_,g),T},"bpmn:ReceiveTask":function(P,_,g={}){g=xe(g,["fill","stroke"]);var T=j(_),M=be(P,_,g),F;return T.get("instantiate")?(y(P,28,28,20*.22,{fill:ve(_,s,g.fill),stroke:X(_,c,g.stroke),strokeWidth:1}),F=r.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):F=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),b(P,F,{fill:ve(_,s,g.fill),stroke:X(_,c,g.stroke),strokeWidth:1}),M},"bpmn:ScriptTask":function(P,_,g={}){g=xe(g,["fill","stroke"]);var T=be(P,_,g),M=r.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return b(P,M,{fill:ve(_,s,g.fill),stroke:X(_,c,g.stroke),strokeWidth:1}),T},"bpmn:SendTask":function(P,_,g={}){g=xe(g,["fill","stroke"]);var T=be(P,_,g),M=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return b(P,M,{fill:X(_,c,g.stroke),stroke:ve(_,s,g.fill),strokeWidth:1}),T},"bpmn:SequenceFlow":function(P,_,g={}){g=xe(g,["fill","stroke"]);var T=ve(_,s,g.fill),M=X(_,c,g.stroke),F=x(P,_.waypoints,{markerEnd:d(P,"sequenceflow-end",T,M),stroke:M}),W=j(_),{source:ae}=_;if(ae){var _e=j(ae);W.get("conditionExpression")&&h(_e,"bpmn:Activity")&&z(F,{markerStart:d(P,"conditional-flow-marker",T,M)}),_e.get("default")&&(h(_e,"bpmn:Gateway")||h(_e,"bpmn:Activity"))&&_e.get("default")===W&&z(F,{markerStart:d(P,"conditional-default-flow-marker",T,M)})}return F},"bpmn:ServiceTask":function(P,_,g={}){g=xe(g,["fill","stroke"]);var T=be(P,_,g);y(P,10,10,{fill:ve(_,s,g.fill),stroke:"none",transform:"translate(6, 6)"});var M=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});b(P,M,{fill:ve(_,s,g.fill),stroke:X(_,c,g.stroke),strokeWidth:1}),y(P,10,10,{fill:ve(_,s,g.fill),stroke:"none",transform:"translate(11, 10)"});var F=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return b(P,F,{fill:ve(_,s,g.fill),stroke:X(_,c,g.stroke),strokeWidth:1}),T},"bpmn:StartEvent":function(P,_,g={}){var{renderIcon:T=!0}=g;g=xe(g,["fill","stroke"]);var M=j(_);M.get("isInterrupting")||(g={...g,strokeDasharray:"6"});var F=Ke(P,_,g);return T&&L(_,P,g),F},"bpmn:SubProcess":function(P,_,g={}){return oe(_)?g=xe(g,["fill","stroke","width","height"]):g=xe(g,["fill","stroke"]),V(P,_,g)},"bpmn:Task":function(P,_,g={}){return g=xe(g,["fill","stroke"]),be(P,_,g)},"bpmn:TextAnnotation":function(P,_,g={}){g=xe(g,["fill","stroke","width","height"]);var{width:T,height:M}=ho(_,g),F=v(P,T,M,0,0,{fill:"none",stroke:"none"}),W=r.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:T,containerHeight:M,position:{mx:0,my:0}});b(P,W,{stroke:X(_,c,g.stroke)});var ae=j(_),_e=ae.get("text")||"";return K(P,_e,{align:"left-top",box:ho(_,g),padding:7,style:{fill:mo(_,u,c,g.stroke)}}),F},"bpmn:Transaction":function(P,_,g={}){oe(_)?g=xe(g,["fill","stroke","width","height"]):g=xe(g,["fill","stroke"]);var T=V(P,_,{strokeWidth:1.5,...g}),M=n.style(["no-fill","no-events"],{stroke:X(_,c,g.stroke),strokeWidth:1.5}),F=oe(_);return F||(g={}),v(P,mn(_,g),qt(_,g),Bc-Oc,Oc,M),T},"bpmn:UserTask":function(P,_,g={}){g=xe(g,["fill","stroke"]);var T=be(P,_,g),M=15,F=12,W=r.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:M,y:F}});b(P,W,{fill:ve(_,s,g.fill),stroke:X(_,c,g.stroke),strokeWidth:.5});var ae=r.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:M,y:F}});b(P,ae,{fill:ve(_,s,g.fill),stroke:X(_,c,g.stroke),strokeWidth:.5});var _e=r.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:M,y:F}});return b(P,_e,{fill:X(_,c,g.stroke),stroke:X(_,c,g.stroke),strokeWidth:.5}),T},label:function(P,_,g={}){return bn(P,_,g)}};this._drawPath=b,this._renderer=A}B(xr,Sn);xr.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"];xr.prototype.canRender=function(e){return h(e,"bpmn:BaseElement")};xr.prototype.drawShape=function(e,t,n={}){var{type:r}=t,i=this._renderer(r);return i(e,t,n)};xr.prototype.drawConnection=function(e,t,n={}){var{type:r}=t,i=this._renderer(r);return i(e,t,n)};xr.prototype.getShapePath=function(e){return ne(e)?Na(e,r1):h(e,"bpmn:Event")?Nc(e):h(e,"bpmn:Activity")?Na(e,Bc):h(e,"bpmn:Gateway")?Rh(e):Ph(e)};function xe(e,t=[]){return t.reduce((n,r)=>(e[r]&&(n[r]=e[r]),n),{})}k();k();var a1=0,s1={width:150,height:50};function c1(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function u1(e){return Ee(e)?C({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}var Ql=null;function p1(){return Ql||(Ql=document.createElement("canvas").getContext("2d")),Ql}function l1(e){var t=[];return e.fontStyle&&t.push(e.fontStyle),e.fontVariant&&t.push(e.fontVariant),e.fontWeight&&t.push(e.fontWeight),e.fontStretch&&t.push(e.fontStretch),t.push(Th(e.fontSize)||"12px"),t.push(e.fontFamily||"sans-serif"),t.join(" ")}function Th(e){if(e!=null)return typeof e=="number"||/^-?\d+(\.\d+)?$/.test(e)?e+"px":e}function f1(e,t){var n=p1();if(!n)return{width:0,height:0};n.font=l1(t),"letterSpacing"in n&&(n.letterSpacing=Th(t.letterSpacing)||"0px");var r=e==="",i=r?"dummy":e.replace(/\s+$/,""),o=n.measureText(i);return{width:r?0:o.width,height:"fontBoundingBoxAscent"in o?o.fontBoundingBoxAscent+o.fontBoundingBoxDescent:o.actualBoundingBoxAscent+o.actualBoundingBoxDescent}}function d1(e,t,n){for(var r=e.shift(),i=r,o;;){if(o=f1(i,n),o.width=i?o.width:0,i===" "||i===""||o.width1)for(;r=n.shift();)if(r.length+ov?w.width:v},0),d=o.top;i.vertical==="middle"&&(d+=(n.height-l)/2),d-=(s||u[0].height)/4;var m=U("text");z(m,r),E(u,function(v){var w;switch(d+=s||v.height,i.horizontal){case"left":w=o.left;break;case"right":w=(a?f:p)-o.right-v.width;break;default:w=Math.max(((a?f:p)-v.width)/2+o.left,0)}var R=U("tspan");z(R,{x:w,y:d}),R.textContent=v.text,Q(m,R)});var y={width:f,height:l};return{dimensions:y,element:m}};function g1(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}var y1=12,_1=1.2,b1=30;function Ic(e){var t=C({fontFamily:"Arial, sans-serif",fontSize:y1,fontWeight:"normal",lineHeight:_1},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,r=C({},t,{fontSize:n},e&&e.externalStyle||{}),i=new go({style:t});this.getExternalLabelBounds=function(o,a){var s=i.getDimensions(a,{box:{width:90,height:30},style:r});return{x:Math.round(o.x+o.width/2-s.width/2),y:Math.round(o.y),width:Math.ceil(s.width),height:Math.ceil(s.height)}},this.getTextAnnotationBounds=function(o,a){var s=i.getDimensions(a,{box:o,style:t,align:"left-top",padding:5});return{x:o.x,y:o.y,width:o.width,height:Math.max(b1,Math.round(s.height))}},this.createText=function(o,a){return i.createText(o,a||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return r}}Ic.$inject=["config.textRenderer"];function Jl(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(t){return this.pathMap[t].d},this.getScaledPath=function(t,n){var r=this.pathMap[t],i,o;n.abspos?(i=n.abspos.x,o=n.abspos.y):(i=n.containerWidth*n.position.mx,o=n.containerHeight*n.position.my);var a={};if(n.position){for(var s=n.containerHeight/r.height*n.yScaleFactor,c=n.containerWidth/r.width*n.xScaleFactor,u=0;u=e.x&&n<=e.x+e.width&&r>=e.y&&r<=e.y+e.height}function P1(e){return h(e,"bpmn:Group")}var kh={__depends__:[Yr],bpmnImporter:["type",Ln]};var Nh={__depends__:[Dh,kh]};k();function nr(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}nr.prototype.next=function(){return this._prefix+ ++this._counter};var A1=new nr("ov"),T1=500;function mt(e,t,n,r){this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=A1,this._overlayDefaults=C({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=D1(n.getContainer()),this._init()}mt.$inject=["config.overlays","eventBus","canvas","elementRegistry"];mt.prototype.get=function(e){if(it(e)&&(e={id:e}),it(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?J(t.overlays,Et({type:e.type})):t.overlays.slice():[]}else return e.type?J(this._overlays,Et({type:e.type})):e.id?this._overlays[e.id]:null};mt.prototype.add=function(e,t,n){if(Ee(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var r=this._ids.next();return n=C({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r};mt.prototype.remove=function(e){var t=this.get(e)||[];q(t)||(t=[t]);var n=this;E(t,function(r){var i=n._getOverlayContainer(r.element,!0);if(r&&(Gt(r.html),Gt(r.htmlContainer),delete r.htmlContainer,delete r.element,delete n._overlays[r.id]),i){var o=i.overlays.indexOf(r);o!==-1&&i.overlays.splice(o,1)}})};mt.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"};mt.prototype.show=function(){jc(this._overlayRoot)};mt.prototype.hide=function(){jc(this._overlayRoot,!1)};mt.prototype.clear=function(){this._overlays={},this._overlayContainers=[],jr(this._overlayRoot)};mt.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,i=t.y;if(t.waypoints){var o=Se(t);r=o.x,i=o.y}Oh(n,r,i),Je(e.html,"data-container-id",t.id)};mt.prototype._updateOverlay=function(e){var t=e.position,n=e.htmlContainer,r=e.element,i=t.left,o=t.top;if(t.right!==void 0){var a;r.waypoints?a=Se(r).width:a=r.width,i=t.right*-1+a}if(t.bottom!==void 0){var s;r.waypoints?s=Se(r).height:s=r.height,o=t.bottom*-1+s}Oh(n,i||0,o||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())};mt.prototype._createOverlayContainer=function(e){var t=ue('
    ');dt(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n};mt.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Bh(this._overlayRoot,n)};mt.prototype._getOverlayContainer=function(e,t){var n=re(this._overlayContainers,function(r){return r.element===e});return!n&&!t?this._createOverlayContainer(e):n};mt.prototype._addOverlay=function(e){var t=e.id,n=e.element,r=e.html,i,o;r.get&&r.constructor.prototype.jquery&&(r=r.get(0)),it(r)&&(r=ue(r)),o=this._getOverlayContainer(n),i=ue('
    '),dt(i,{position:"absolute"}),i.appendChild(r),e.type&&Te(i).add("djs-overlay-"+e.type);var a=this._canvas.findRoot(n),s=this._canvas.getRootElement();jc(i,a===s),e.htmlContainer=i,o.overlays.push(e),o.html.appendChild(i),this._overlays[t]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())};mt.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=this._canvas.findRoot(e.element),i=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,s=this._canvas.getRootElement(),c=!0;(r!==s||n&&(Ge(i)&&i>t.scale||Ge(o)&&oi&&(a=(1/t.scale||1)*i)),Ge(a)&&(s="scale("+a+","+a+")"),Bh(o,s)};mt.prototype._updateOverlaysVisibilty=function(e){var t=this;E(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})};mt.prototype._init=function(){var e=this._eventBus,t=this;function n(r){t._updateRoot(r),t._updateOverlaysVisibilty(r),t.show()}e.on("canvas.viewbox.changing",function(r){t.hide()}),e.on("canvas.viewbox.changed",function(r){n(r.viewbox)}),e.on(["shape.remove","connection.remove"],function(r){var i=r.element,o=t.get({element:i});E(o,function(c){t.remove(c.id)});var a=t._getOverlayContainer(i);if(a){Gt(a.html);var s=t._overlayContainers.indexOf(a);s!==-1&&t._overlayContainers.splice(s,1)}}),e.on("element.changed",T1,function(r){var i=r.element,o=t._getOverlayContainer(i,!0);o&&(E(o.overlays,function(a){t._updateOverlay(a)}),t._updateOverlayContainer(o))}),e.on("element.marker.update",function(r){var i=t._getOverlayContainer(r.element,!0);i&&Te(i.html)[r.add?"add":"remove"](r.marker)}),e.on("root.set",function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};function D1(e){var t=ue('
    ');return dt(t,{position:"absolute",width:0,height:0}),e.insertBefore(t,e.firstChild),t}function Oh(e,t,n){dt(e,{left:t+"px",top:n+"px"})}function jc(e,t){e.style.display=t===!1?"none":""}function Bh(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}var Xr={__init__:["overlays"],overlays:["type",mt]};function Fc(e,t,n,r){e.on("element.changed",function(i){var o=i.element;(o.parent||o===t.getRootElement())&&(i.gfx=n.getGraphics(o)),i.gfx&&e.fire(vc(o)+".changed",i)}),e.on("elements.changed",function(i){var o=i.elements;o.forEach(function(a){e.fire("element.changed",{element:a})}),r.updateContainments(o)}),e.on("shape.changed",function(i){r.update("shape",i.element,i.gfx)}),e.on("connection.changed",function(i){r.update("connection",i.element,i.gfx)})}Fc.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var yo={__init__:["changeSupport"],changeSupport:["type",Fc]};k();var M1=1e3;function N(e){this._eventBus=e}N.$inject=["eventBus"];function k1(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}N.prototype.on=function(e,t,n,r,i,o){if((Ne(t)||te(t))&&(o=i,i=r,r=n,n=t,t=null),Ne(n)&&(o=i,i=r,r=n,n=M1),Ee(i)&&(o=i,i=!1),!Ne(r))throw new Error("handlerFn must be a function");q(e)||(e=[e]);var a=this._eventBus;E(e,function(s){var c=["commandStack",s,t].filter(function(u){return u}).join(".");a.on(c,n,i?k1(r,o):r,o)})};N.prototype.canExecute=Er("canExecute");N.prototype.preExecute=Er("preExecute");N.prototype.preExecuted=Er("preExecuted");N.prototype.execute=Er("execute");N.prototype.executed=Er("executed");N.prototype.postExecute=Er("postExecute");N.prototype.postExecuted=Er("postExecuted");N.prototype.revert=Er("revert");N.prototype.reverted=Er("reverted");function Er(e){return function(n,r,i,o,a){(Ne(n)||te(n))&&(a=o,o=i,i=r,r=n,n=null),this.on(n,e,r,i,o,a)}}function Oa(e,t){t.invoke(N,this),this.executed(function(n){var r=n.context;r.rootElement?e.setRootElement(r.rootElement):r.rootElement=e.getRootElement()}),this.revert(function(n){var r=n.context;r.rootElement&&e.setRootElement(r.rootElement)})}B(Oa,N);Oa.$inject=["canvas","injector"];var Ih={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",Oa]};k();function wr(e){return CSS.escape(e)}var N1={"&":"&","<":"<",">":">",'"':""","'":"'"};function jn(e){return e=""+e,e&&e.replace(/[&<>"']/g,function(t){return N1[t]})}var Lh="_plane";function tf(e){var t=e.id;return O1(t)}function hn(e){var t=e.id;return h(e,"bpmn:SubProcess")?jh(t):t}function Zr(e){return jh(e)}function _o(e){var t=ce(e);return h(t,"bpmndi:BPMNPlane")}function jh(e){return e+Lh}function O1(e){return e.replace(new RegExp(Lh+"$"),"")}var B1="bjs-breadcrumbs-shown";function Hc(e,t,n){var r=ue('
      '),i=n.getContainer(),o=Te(i);i.appendChild(r);var a=[];e.on("element.changed",function(c){var u=c.element,p=j(u),l=re(a,function(f){return f===p});l&&s()});function s(c){c&&(a=I1(c));var u=a.flatMap(function(l){var f=n.findRoot(hn(l))||n.findRoot(l.id);if(!f&&h(l,"bpmn:Process")){var d=t.find(function(v){var w=j(v);return w&&w.get("processRef")===l});f=d&&n.findRoot(d.id)}if(!f)return[];var m=jn(l.name||l.id),y=ue('
    • '+m+"
    • ");return y.addEventListener("click",function(){n.setRootElement(f)}),y});r.innerHTML="";var p=u.length>1;o.toggle(B1,p),u.forEach(function(l){r.appendChild(l)})}e.on("root.set",function(c){s(c.element)})}Hc.$inject=["eventBus","elementRegistry","canvas"];function I1(e){for(var t=j(e),n=[],r=t;r;r=r.$parent)(h(r,"bpmn:SubProcess")||h(r,"bpmn:Process"))&&n.push(r);return n.reverse()}function $c(e,t){var n=null,r=new L1;e.on("root.set",function(i){var o=i.element,a=t.viewbox(),s=r.get(o);if(r.set(n,{x:a.x,y:a.y,zoom:a.scale}),n=o,!(!h(o,"bpmn:SubProcess")&&!s)){s=s||{x:0,y:0,zoom:1};var c=(a.x-s.x)*a.scale,u=(a.y-s.y)*a.scale;(c!==0||u!==0)&&t.scroll({dx:c,dy:u}),s.zoom!==a.scale&&t.zoom(s.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){r.clear(),n=null})}$c.$inject=["eventBus","canvas"];function L1(){this._entries=[],this.set=function(e,t){var n=!1;for(var r in this._entries)if(this._entries[r][0]===e){this._entries[r][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}t!==-1&&this._entries.splice(t,1)}}var Fh={x:180,y:160};function Sr(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,function(r,i){n._handleImport(i.definitions)})}Sr.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach(function(r){!r.plane||!r.plane.bpmnElement||(t._processToDiagramMap[r.plane.bpmnElement.id]=r)});var n=e.diagrams.filter(r=>r.plane).flatMap(r=>t._createNewDiagrams(r.plane));n.forEach(function(r){t._movePlaneElementsToOrigin(r.plane)})}};Sr.prototype._createNewDiagrams=function(e){var t=this,n=[],r=[];e.get("planeElement").forEach(function(o){var a=o.bpmnElement;if(a){var s=a.$parent;h(a,"bpmn:SubProcess")&&!o.isExpanded&&n.push(a),F1(a,e)&&r.push({diElement:o,parent:s})}});var i=[];return n.forEach(function(o){if(!t._processToDiagramMap[o.id]){var a=t._createDiagram(o);t._processToDiagramMap[o.id]=a,i.push(a)}}),r.forEach(function(o){for(var a=o.diElement,s=o.parent;s&&n.indexOf(s)===-1;)s=s.$parent;if(s){var c=t._processToDiagramMap[s.id];t._moveToDiPlane(a,c.plane)}}),i};Sr.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=j1(e),r={x:n.x-Fh.x,y:n.y-Fh.y};t.forEach(function(i){i.waypoint?i.waypoint.forEach(function(o){o.x=o.x-r.x,o.y=o.y-r.y}):i.bounds&&(i.bounds.x=i.bounds.x-r.x,i.bounds.y=i.bounds.y-r.y)})};Sr.prototype._moveToDiPlane=function(e,t){var n=Hh(e),r=n.plane.get("planeElement");r.splice(r.indexOf(e),1),t.get("planeElement").push(e)};Sr.prototype._createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n};Sr.$inject=["eventBus","moddle"];function Hh(e){return h(e,"bpmndi:BPMNDiagram")?e:Hh(e.$parent)}function j1(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach(function(n){if(n.bounds){var r=Z(n.bounds);t.top=Math.min(r.top,t.top),t.left=Math.min(r.left,t.left)}}),xi(t)}function F1(e,t){var n=e.$parent;return!(!h(n,"bpmn:SubProcess")||n===t.bpmnElement||ee(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))}var zc=250,H1='',$1="bjs-drilldown-empty";function rr(e,t,n,r,i){N.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=r,this._translate=i;var o=this;this.executed("shape.toggleCollapse",zc,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.reverted("shape.toggleCollapse",zc,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.executed(["shape.create","shape.move","shape.delete"],zc,function(a){var s=a.oldParent,c=a.newParent||a.parent,u=a.shape;o._canDrillDown(u)&&o._addOverlay(u),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(u)},!0),this.reverted(["shape.create","shape.move","shape.delete"],zc,function(a){var s=a.oldParent,c=a.newParent||a.parent,u=a.shape;o._canDrillDown(u)&&o._addOverlay(u),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(u)},!0),t.on("import.render.complete",function(){n.filter(function(a){return o._canDrillDown(a)}).map(function(a){o._addOverlay(a)})})}B(rr,N);rr.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}};rr.prototype._canDrillDown=function(e){var t=this._canvas;return h(e,"bpmn:SubProcess")&&t.findRoot(hn(e))};rr.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=j(e),r=t.get({element:n.id,type:"drilldown"})[0];if(r){var i=n&&n.get("flowElements")&&n.get("flowElements").length;Te(r.html).toggle($1,!i)}};rr.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,r=j(e),i=n.get({element:e,type:"drilldown"});i.length&&this._removeOverlay(e);var o=ue('"),a=r.get("name")||r.get("id"),s=this._translate("Open {element}",{element:a});o.setAttribute("title",s),o.addEventListener("click",function(){t.setRootElement(t.findRoot(hn(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:o}),this._updateOverlayVisibility(e)};rr.prototype._removeOverlay=function(e){var t=this._overlays;t.remove({element:e,type:"drilldown"})};rr.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];var $h={__depends__:[Xr,yo,Ih],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Hc],drilldownCentering:["type",$c],drilldownOverlayBehavior:["type",rr],subprocessCompatibility:["type",Sr]};k();function zh(e){!e||typeof e.stopPropagation!="function"||e.stopPropagation()}function Cr(e){return e.originalEvent||e.srcEvent}function Gc(e){zh(e),zh(Cr(e))}function Pn(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function Vc(){return/mac/i.test(navigator.platform)}function Gh(e,t){return(Cr(e)||e).button===t}function vn(e){return Gh(e,0)}function Vh(e){return Gh(e,1)}function Rr(e){var t=Cr(e)||e;return vn(e)?Vc()?t.metaKey:t.ctrlKey:!1}function Ri(e){var t=Cr(e)||e;return vn(e)&&t.shiftKey}function z1(e){return!0}function Wc(e){return vn(e)||Vh(e)}var Wh=500;function Uc(e,t,n){var r=this;function i(D,L,I){if(!s(D,L)){var $,G,K;I?G=t.getGraphics(I):($=L.delegateTarget||L.target,$&&(G=$,I=t.get(G))),!(!G||!I)&&(K=e.fire(D,{element:I,gfx:G,originalEvent:L}),K===!1&&(L.stopPropagation(),L.preventDefault()))}}var o={};function a(D){return o[D]}function s(D,L){var I=u[D]||vn;return!I(L)}var c={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},u={"element.contextmenu":z1,"element.mousedown":Wc,"element.mouseup":Wc,"element.click":Wc,"element.dblclick":Wc};function p(D,L,I){var $=c[D];if(!$)throw new Error("unmapped DOM event name <"+D+">");return i($,L,I)}var l="svg, .djs-element";function f(D,L,I,$){var G=o[I]=function(K){i(I,K)};$&&(u[I]=$),G.$delegate=vt.bind(D,l,L,G)}function d(D,L,I){var $=a(I);$&&vt.unbind(D,L,$.$delegate)}function m(D){E(c,function(L,I){f(D,I,L)})}function y(D){E(c,function(L,I){d(D,I,L)})}e.on("canvas.destroy",function(D){y(D.svg)}),e.on("canvas.init",function(D){m(D.svg)}),e.on(["shape.added","connection.added"],function(D){var L=D.element,I=D.gfx;e.fire("interactionEvents.createHit",{element:L,gfx:I})}),e.on(["shape.changed","connection.changed"],Wh,function(D){var L=D.element,I=D.gfx;e.fire("interactionEvents.updateHit",{element:L,gfx:I})}),e.on("interactionEvents.createHit",Wh,function(D){var L=D.element,I=D.gfx;r.createDefaultHit(L,I)}),e.on("interactionEvents.updateHit",function(D){var L=D.element,I=D.gfx;r.updateDefaultHit(L,I)});var v=S("djs-hit djs-hit-stroke"),w=S("djs-hit djs-hit-click-stroke"),R=S("djs-hit djs-hit-all"),x=S("djs-hit djs-hit-no-move"),b={all:R,"click-stroke":w,stroke:v,"no-move":x};function S(D,L){return L=C({stroke:"white",strokeWidth:15},L||{}),n.cls(D,["no-fill","no-border"],L)}function A(D,L){var I=b[L];if(!I)throw new Error("invalid hit type <"+L+">");return z(D,I),D}function O(D,L){Q(D,L)}this.removeHits=function(D){var L=_i(".djs-hit",D);E(L,we)},this.createDefaultHit=function(D,L){var I=D.waypoints,$=D.isFrame,G;return I?this.createWaypointsHit(L,I):(G=$?"stroke":"all",this.createBoxHit(L,G,{width:D.width,height:D.height}))},this.createWaypointsHit=function(D,L){var I=Kn(L);return A(I,"stroke"),O(D,I),I},this.createBoxHit=function(D,L,I){I=C({x:0,y:0},I);var $=U("rect");return A($,L),z($,I),O(D,$),$},this.updateDefaultHit=function(D,L){var I=ge(".djs-hit",L);if(I)return D.waypoints?Ea(I,D.waypoints):z(I,{width:D.width,height:D.height}),I},this.fire=i,this.triggerMouseEvent=p,this.mouseHandler=a,this.registerEvent=f,this.unregisterEvent=d}Uc.$inject=["eventBus","elementRegistry","styles"];var Qr={__init__:["interactionEvents"],interactionEvents:["type",Uc]};k();function Jr(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],function(r){var i=r.element;n.deselect(i)}),e.on(["diagram.clear","root.set"],function(r){n.select(null)})}Jr.$inject=["eventBus","canvas"];Jr.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(n!==-1){var r=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:t})}};Jr.prototype.get=function(){return this._selectedElements};Jr.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1};Jr.prototype.select=function(e,t){var n=this._selectedElements,r=n.slice();q(e)||(e=e?[e]:[]);var i=this._canvas,o=i.getRootElement();e=e.filter(function(a){var s=i.findRoot(a);return o===s}),t?E(e,function(a){n.indexOf(a)===-1&&n.push(a)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:n})};k();var Uh="hover",qh="selected";function qc(e,t){this._canvas=e;function n(i,o){e.addMarker(i,o)}function r(i,o){e.removeMarker(i,o)}t.on("element.hover",function(i){n(i.element,Uh)}),t.on("element.out",function(i){r(i.element,Uh)}),t.on("selection.changed",function(i){function o(u){r(u,qh)}function a(u){n(u,qh)}var s=i.oldSelection,c=i.newSelection;E(s,function(u){c.indexOf(u)===-1&&o(u)}),E(c,function(u){s.indexOf(u)===-1&&a(u)})})}qc.$inject=["canvas","eventBus"];k();function Kc(e,t,n,r){e.on("create.end",500,function(i){var o=i.context,a=o.canExecute,s=o.elements,c=o.hints||{},u=c.autoSelect;if(a){if(u===!1)return;q(u)?t.select(u):t.select(s.filter(G1))}}),e.on("connect.end",500,function(i){var o=i.context,a=o.connection;a&&t.select(a)}),e.on("shape.move.end",500,function(i){var o=i.previousSelection||[],a=r.get(i.context.shape.id),s=re(o,function(c){return a.id===c.id});s||t.select(a)}),e.on("element.click",function(i){if(vn(i)){var o=i.element;o===n.getRootElement()&&(o=null);var a=t.isSelected(o),s=t.get().length>1,c=Ri(i);if(a&&s)return c?t.deselect(o):t.select(o);a?t.deselect(o):t.select(o,c)}})}Kc.$inject=["eventBus","selection","canvas","elementRegistry"];function G1(e){return!e.hidden}var et={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Qr],selection:["type",Jr],selectionVisuals:["type",qc],selectionBehavior:["type",Kc]};function tn(e){Le.call(this,e)}B(tn,Le);tn.prototype._modules=[Nh,$h,Xr,et,Yr];tn.prototype._moddleExtensions={};k();k();var Kh=["c","C"],Yh=["v","V"],V1=["d","D"],W1=["x","X"],Xh=["y","Y"],nf=["z","Z"];function Zh(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function gt(e){return e.altKey?!1:e.ctrlKey||e.metaKey}function We(e,t){return e=q(e)?e:[e],e.indexOf(t.key)!==-1||e.indexOf(t.code)!==-1}function Yc(e){return e.shiftKey}function Qh(e){return gt(e)&&We(Kh,e)}function Jh(e){return gt(e)&&We(Yh,e)}function ev(e){return gt(e)&&We(V1,e)}function tv(e){return gt(e)&&We(W1,e)}function nv(e){return gt(e)&&!Yc(e)&&We(nf,e)}function rv(e){return gt(e)&&(We(Xh,e)||We(nf,e)&&Yc(e))}var Xc="keyboard.keydown",U1="keyboard.keyup",q1=1e3,iv="Keyboard binding is now implicit; explicit binding to an element got removed. For more information, see https://github.com/bpmn-io/diagram-js/issues/661";function At(e,t){var n=this;this._config=e=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",function(){n._fire("destroy"),n.unbind()}),e.bindTo&&console.error("unsupported configuration ",new Error(iv));var r=e&&e.bind!==!1;t.on("canvas.init",function(i){n._target=i.svg,r&&n.bind(),n._fire("init")})}At.$inject=["config.keyboard","eventBus"];At.prototype._keydownHandler=function(e){this._keyHandler(e,Xc)};At.prototype._keyupHandler=function(e){this._keyHandler(e,U1)};At.prototype._keyHandler=function(e,t){var n;if(!this._isEventIgnored(e)){var r={keyEvent:e};n=this._eventBus.fire(t||Xc,r),n&&e.preventDefault()}};At.prototype._isEventIgnored=function(e){return!1};At.prototype.bind=function(e){e&&console.error("unsupported argument ",new Error(iv)),this.unbind(),e=this._node=this._target,se.bind(e,"keydown",this._keydownHandler),se.bind(e,"keyup",this._keyupHandler),this._fire("bind")};At.prototype.getBinding=function(){return this._node};At.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),se.unbind(e,"keydown",this._keydownHandler),se.unbind(e,"keyup",this._keyupHandler)),this._node=null};At.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})};At.prototype.addListener=function(e,t,n){Ne(e)&&(n=t,t=e,e=q1),this._eventBus.on(n||Xc,e,t)};At.prototype.removeListener=function(e,t){this._eventBus.off(t||Xc,e)};At.prototype.hasModifier=Zh;At.prototype.isCmd=gt;At.prototype.isShift=Yc;At.prototype.isKey=We;var K1=500;function Pr(e,t){var n=this;e.on("editorActions.init",K1,function(r){var i=r.editorActions;n.registerBindings(t,i)})}Pr.$inject=["eventBus","keyboard"];Pr.prototype.registerBindings=function(e,t){function n(r,i){t.isRegistered(r)&&e.addListener(i)}n("undo",function(r){var i=r.keyEvent;if(nv(i))return t.trigger("undo"),!0}),n("redo",function(r){var i=r.keyEvent;if(rv(i))return t.trigger("redo"),!0}),n("copy",function(r){var i=r.keyEvent;if(Qh(i))return t.trigger("copy"),!0}),n("paste",function(r){var i=r.keyEvent;if(Jh(i))return t.trigger("paste"),!0}),n("duplicate",function(r){var i=r.keyEvent;if(ev(i))return t.trigger("duplicate"),!0}),n("cut",function(r){var i=r.keyEvent;if(tv(i))return t.trigger("cut"),!0}),n("stepZoom",function(r){var i=r.keyEvent;if(We(["+","Add","="],i)&>(i))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(r){var i=r.keyEvent;if(We(["-","Subtract"],i)&>(i))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(r){var i=r.keyEvent;if(We("0",i)&>(i))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(r){var i=r.keyEvent;if(We(["Backspace","Delete","Del"],i))return t.trigger("removeSelection"),!0})};var bo={__init__:["keyboard","keyboardBindings"],keyboard:["type",At],keyboardBindings:["type",Pr]};k();var Y1={moveSpeed:50,moveSpeedAccelerated:200};function Zc(e,t,n){var r=this;this._config=C({},Y1,e||{}),t.addListener(i);function i(o){var a=o.keyEvent,s=r._config;if(t.isCmd(a)&&t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],a)){var c=t.isShift(a)?s.moveSpeedAccelerated:s.moveSpeed,u;switch(a.key){case"ArrowLeft":case"Left":u="left";break;case"ArrowUp":case"Up":u="up";break;case"ArrowRight":case"Right":u="right";break;case"ArrowDown":case"Down":u="down";break}return r.moveCanvas({speed:c,direction:u}),!0}}this.moveCanvas=function(o){var a=0,s=0,c=o.speed,u=c/Math.min(Math.sqrt(n.viewbox().scale),1);switch(o.direction){case"left":a=u;break;case"up":s=u;break;case"right":a=-u;break;case"down":s=-u;break}n.scroll({dx:a,dy:s})}}Zc.$inject=["config.keyboardMove","keyboard","canvas"];var Qc={__depends__:[bo],__init__:["keyboardMove"],keyboardMove:["type",Zc]};var X1=/^djs-cursor-.*$/;function Pi(e){var t=Te(document.body);t.removeMatching(X1),e&&t.add("djs-cursor-"+e)}function Jc(){Pi(null)}var Z1=5e3;function eu(e,t){t=t||"element.click";function n(){return!1}return e.once(t,Z1,n),function(){e.off(t,n)}}function xo(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Tt(e,t){return{x:e.x-t.x,y:e.y-t.y}}var Q1=15;function tu(e,t){var n;function r(s){return a(s.originalEvent)}e.on("canvas.focus.changed",function(s){s.focused?e.on("element.mousedown",500,r):e.off("element.mousedown",r)});function i(s){var c=n.start,u=n.button,p=Pn(s),l=Tt(p,c);if(!n.dragging&&J1(l)>Q1&&(n.dragging=!0,u===0&&eu(e),Pi("grab")),n.dragging){var f=n.last||n.start;l=Tt(p,f),t.scroll({dx:l.x,dy:l.y}),n.last=p}s.preventDefault()}function o(s){se.unbind(document,"mousemove",i),se.unbind(document,"mouseup",o),n=null,Jc()}function a(s){if(!Nn(s.target,".djs-draggable")){var c=s.button;if(!(c>=2||s.ctrlKey||s.shiftKey||s.altKey))return n={button:c,start:Pn(s)},se.bind(document,"mousemove",i),se.bind(document,"mouseup",o),!0}}this.isActive=function(){return!!n}}tu.$inject=["eventBus","canvas"];function J1(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}var nu={__init__:["moveCanvas"],moveCanvas:["type",tu]};function Ba(e){return Math.log(e)/Math.log(10)}function rf(e,t){var n=Ba(e.min),r=Ba(e.max),i=Math.abs(n)+Math.abs(r);return i/t}function ov(e,t){return Math.max(e.min,Math.min(e.max,t))}k();var eC=Math.sign||function(e){return e>=0?1:-1},of={min:.2,max:4},av=10,tC=.1,nC=.75;function An(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=Qe(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||nC;var r=this;t.on("canvas.mouseover",function(){r._init(e.enabled!==!1)}),t.on("canvas.mouseout",function(){r._init(!1)})}An.$inject=["config.zoomScroll","eventBus","canvas"];An.prototype.scroll=function(t){this._canvas.scroll(t)};An.prototype.reset=function(){this._canvas.zoom("fit-viewport")};An.prototype.zoom=function(t,n){var r=rf(of,av*2);this._totalDelta+=t,Math.abs(this._totalDelta)>tC&&(this._zoom(t,n,r),this._totalDelta=0)};An.prototype._handleWheel=function(t){if(this._enabled){var n=this._container;t.preventDefault();var r=t.ctrlKey||Vc()&&t.metaKey,i=t.shiftKey,o=-1*this._scale,a;if(r?o*=t.deltaMode===0?.02:.32:o*=t.deltaMode===0?1:16,r){var s=n.getBoundingClientRect(),c={x:t.clientX-s.left,y:t.clientY-s.top};a=Math.sqrt(Math.pow(t.deltaY,2)+Math.pow(t.deltaX,2))*eC(t.deltaY)*o,this.zoom(a,c)}else i?a={dx:o*t.deltaY,dy:0}:a={dx:o*t.deltaX,dy:o*t.deltaY},this.scroll(a)}};An.prototype.stepZoom=function(t,n){var r=rf(of,av);this._zoom(t,n,r)};An.prototype._zoom=function(e,t,n){var r=this._canvas,i=e>0?1:-1,o=Ba(r.zoom()),a=Math.round(o/n)*n;a+=n*i;var s=Math.pow(10,a);r.zoom(ov(of,s),t)};An.prototype.toggle=function(t){var n=this._container,r=this._handleWheel,i=this._enabled;return typeof t=="undefined"&&(t=!i),i!==t&&se[t?"bind":"unbind"](n,"wheel",r,!1),this._enabled=t,t};An.prototype._init=function(e){this.toggle(e)};var ru={__init__:["zoomScroll"],zoomScroll:["type",An]};function ir(e){tn.call(this,e)}B(ir,tn);ir.prototype._navigationModules=[Qc,nu,ru];ir.prototype._modules=[].concat(tn.prototype._modules,ir.prototype._navigationModules);k();function af(e){return e&&e[e.length-1]}function sv(e){return e.y}function cv(e){return e.x}var rC={left:cv,center:cv,right:function(e){return e.x+e.width},top:sv,middle:sv,bottom:function(e){return e.y+e.height}};function ei(e,t){this._modeling=e,this._rules=t}ei.$inject=["modeling","rules"];ei.prototype._getOrientationDetails=function(e){var t=["top","bottom","middle"],n="x",r="width";return t.indexOf(e)!==-1&&(n="y",r="height"),{axis:n,dimension:r}};ei.prototype._isType=function(e,t){return t.indexOf(e)!==-1};ei.prototype._alignmentPosition=function(e,t){var n=this._getOrientationDetails(e),r=n.axis,i=n.dimension,o={},a={},s=!1,c,u,p;function l(f,d){return Math.round((f[r]+d[r]+d[i])/2)}if(this._isType(e,["left","top"]))o[e]=t[0][r];else if(this._isType(e,["right","bottom"]))p=af(t),o[e]=p[r]+p[i];else if(this._isType(e,["center","middle"])){if(E(t,function(f){var d=f[r]+Math.round(f[i]/2);a[d]?a[d].elements.push(f):a[d]={elements:[f],center:d}}),c=Ct(a,function(f){return f.elements.length>1&&(s=!0),f.elements.length}),s)return o[e]=af(c).center,o;u=t[0],t=Ct(t,function(f){return f[r]+f[i]}),p=af(t),o[e]=l(u,p)}return o};ei.prototype.trigger=function(e,t){var n=this._modeling,r,i=J(e,function(c){return!(c.waypoints||c.host||c.labelTarget)});if(r=this._rules.allowed("elements.align",{elements:i}),q(r)&&(i=r),!(i.length<2||!r)){var o=rC[t],a=Ct(i,o),s=this._alignmentPosition(t,a);n.alignElements(a,s)}};var uv={__init__:["alignElements"],alignElements:["type",ei]};var iC=new nr;function ti(e){this._scheduled={},e.on("diagram.destroy",()=>{Object.keys(this._scheduled).forEach(t=>{this.cancel(t)})})}ti.$inject=["eventBus"];ti.prototype.schedule=function(e,t=iC.next()){this.cancel(t);let n=this._schedule(e,t);return this._scheduled[t]=n,n.promise};ti.prototype._schedule=function(e,t){let n=oC();return{executionId:setTimeout(()=>{try{this._scheduled[t]=null;try{n.resolve(e())}catch(i){n.reject(i)}}catch(i){console.error("Scheduler#_schedule execution failed",i)}}),promise:n.promise}};ti.prototype.cancel=function(e){let t=this._scheduled[e];t&&(this._cancel(t),this._scheduled[e]=null)};ti.prototype._cancel=function(e){clearTimeout(e.executionId)};function oC(){let e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}var pv={scheduler:["type",ti]};k();var aC="djs-element-hidden",iu=".entry",sC=1e3,lv=8,cC=300;function tt(e,t,n,r){this._canvas=e,this._elementRegistry=t,this._eventBus=n,this._scheduler=r,this._current=null,this._init()}tt.$inject=["canvas","elementRegistry","eventBus","scheduler"];tt.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",function(t){var n=t.newSelection,r=n.length?n.length===1?n[0]:n:null;r?e.open(r,!0):e.close()}),this._eventBus.on("elements.changed",function(t){var n=t.elements,r=e._current;if(r){var i=r.target,o=q(i)?i:[i],a=o.filter(function(c){return n.includes(c)});if(a.length){e.close();var s=o.filter(function(c){return e._elementRegistry.get(c.id)});s.length&&e._updateAndOpen(s.length>1?s:s[0])}}}),this._eventBus.on("canvas.viewbox.changed",function(){e._updatePosition()}),this._eventBus.on("element.marker.update",function(t){if(e.isOpen()){var n=t.element,r=e._current,i=q(r.target)?r.target:[r.target];i.includes(n)&&e._updateVisibility()}}),this._container=this._createContainer()};tt.prototype._createContainer=function(){var e=ue('
      ');return this._canvas.getContainer().appendChild(e),e};tt.prototype.registerProvider=function(e,t){t||(t=e,e=sC),this._eventBus.on("contextPad.getProviders",e,function(n){n.providers.push(t)})};tt.prototype.getEntries=function(e){var t=this._getProviders(),n=q(e)?"getMultiElementContextPadEntries":"getContextPadEntries",r={};return E(t,function(i){if(Ne(i[n])){var o=i[n](e);Ne(o)?r=o(r):E(o,function(a,s){r[s]=a})}}),r};tt.prototype.trigger=function(e,t,n){var r=this,i,o,a=t.delegateTarget||t.target;if(!a)return t.preventDefault();if(i=Je(a,"data-action"),o=t.originalEvent||t,e==="mouseover"){this._timeout=setTimeout(function(){r._mouseout=r.triggerEntry(i,"hover",o,n)},cC);return}else if(e==="mouseout"){clearTimeout(this._timeout),this._mouseout&&(this._mouseout(),this._mouseout=null);return}return this.triggerEntry(i,e,o,n)};tt.prototype.triggerEntry=function(e,t,n,r){if(this.isShown()){var i=this._current.target,o=this._current.entries,a=o[e];if(a){var s=a.action;if(this._eventBus.fire("contextPad.trigger",{entry:a,event:n})!==!1){if(Ne(s)){if(t==="click")return s(n,i,r)}else if(s[t])return s[t](n,i,r);n.preventDefault()}}}};tt.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))};tt.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers};tt.prototype._updateAndOpen=function(e){var t=this.getEntries(e),n=this._createHtml(e),r;E(t,function(i,o){var a=i.group||"default",s=ue(i.html||'
      '),c;Je(s,"data-action",o),c=ge("[data-group="+wr(a)+"]",n),c||(c=ue('
      '),Je(c,"data-group",a),n.appendChild(c)),c.appendChild(s),i.className&&uC(s,i.className),i.title&&Je(s,"title",i.title),i.imageUrl&&(r=ue(""),Je(r,"src",i.imageUrl),r.style.width="100%",r.style.height="100%",s.appendChild(r))}),Te(n).add("open"),this._current={entries:t,html:n,target:e},this._updatePosition(),this._updateVisibility(),this._eventBus.fire("contextPad.open",{current:this._current})};tt.prototype._createHtml=function(e){var t=this,n=ue('
      ');return vt.bind(n,iu,"click",function(r){t.trigger("click",r)}),vt.bind(n,iu,"dragstart",function(r){t.trigger("dragstart",r)}),vt.bind(n,iu,"mouseover",function(r){t.trigger("mouseover",r)}),vt.bind(n,iu,"mouseout",function(r){t.trigger("mouseout",r)}),se.bind(n,"mousedown",function(r){r.stopPropagation()}),this._container.appendChild(n),this._eventBus.fire("contextPad.create",{target:e,pad:n}),n};tt.prototype.getPad=function(e){console.warn(new Error("ContextPad#getPad is deprecated and will be removed in future library versions, cf. https://github.com/bpmn-io/diagram-js/pull/888"));let t;return this.isOpen()&&lC(this._current.target,e)?t=this._current.html:t=this._createHtml(e),{html:t}};tt.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)};tt.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return q(e)!==q(n)?!1:q(e)?e.length===n.length&&pn(e,function(r){return n.includes(r)}):n===e};tt.prototype.isShown=function(){return this.isOpen()&&Te(this._current.html).has("open")};tt.prototype.show=function(){this.isOpen()&&(Te(this._current.html).add("open"),this._updatePosition(),this._eventBus.fire("contextPad.show",{current:this._current}))};tt.prototype.hide=function(){this.isOpen()&&(Te(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))};tt.prototype._getPosition=function(e){if(!q(e)&&me(e)){var t=this._canvas.viewbox(),n=pC(e),r=n.x*t.scale-t.x*t.scale,i=n.y*t.scale-t.y*t.scale;return{left:r+lv*this._canvas.zoom(),top:i}}var o=this._canvas.getContainer(),a=o.getBoundingClientRect(),s=this._getTargetBounds(e);return{left:s.right-a.left+lv*this._canvas.zoom(),top:s.top-a.top}};tt.prototype._updatePosition=function(){let e=()=>{if(this.isOpen()){var t=this._current.html,n=this._getPosition(this._current.target);"x"in n&&"y"in n?(t.style.left=n.x+"px",t.style.top=n.y+"px"):["top","right","bottom","left"].forEach(function(r){r in n&&(t.style[r]=n[r]+"px")})}};this._scheduler.schedule(e,"ContextPad#_updatePosition")};tt.prototype._updateVisibility=function(){let e=()=>{if(this.isOpen()){var t=this,n=this._current.target,r=q(n)?n:[n],i=r.some(function(o){return t._canvas.hasMarker(o,aC)});i?t.hide():t.show()}};this._scheduler.schedule(e,"ContextPad#_updateVisibility")};tt.prototype._getTargetBounds=function(e){var t=this,n=q(e)?e:[e],r=n.map(function(i){return t._canvas.getGraphics(i)});return r.reduce(function(i,o){let a=o.getBoundingClientRect();return i.top=Math.min(i.top,a.top),i.right=Math.max(i.right,a.right),i.bottom=Math.max(i.bottom,a.bottom),i.left=Math.min(i.left,a.left),i.x=i.left,i.y=i.top,i.width=i.right-i.left,i.height=i.bottom-i.top,i},{top:1/0,right:-1/0,bottom:-1/0,left:1/0})};function uC(e,t){var n=Te(e);t=q(t)?t:t.split(/\s+/g),t.forEach(function(r){n.add(r)})}function pC(e){return e.waypoints[e.waypoints.length-1]}function lC(e,t){return e=q(e)?e:[e],t=q(t)?t:[t],e.length===t.length&&pn(e,function(n){return t.includes(n)})}var ou={__depends__:[Qr,pv,Xr],contextPad:["type",tt]};var fu,Ue,vv,fC,ni,fv,gv,yv,sf,su,Ia,_v,lf,cf,uf,dC,uu={},pu=[],mC=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,du=Array.isArray;function Ar(e,t){for(var n in t)e[n]=t[n];return e}function ff(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function mu(e,t,n){var r,i,o,a={};for(o in t)o=="key"?r=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?fu.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return cu(e,a,r,i,null)}function cu(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i==null?++vv:i,__i:-1,__u:0};return i==null&&Ue.vnode!=null&&Ue.vnode(o),o}function hu(e){return e.children}function La(e,t){this.props=e,this.context=t}function Eo(e,t){if(t==null)return e.__?Eo(e.__,e.__i+1):null;for(var n;tt&&ni.sort(yv),e=ni.shift(),t=ni.length,hC(e)}finally{ni.length=lu.__r=0}}function xv(e,t,n,r,i,o,a,s,c,u,p){var l,f,d,m,y,v,w,R=r&&r.__k||pu,x=t.length;for(c=vC(n,t,R,c,x),l=0;l0?a=e.__k[o]=cu(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[o]=a,c=o+f,a.__=e,a.__b=e.__b+1,s=null,(u=a.__i=gC(a,n,c,l))!=-1&&(l--,(s=n[u])&&(s.__u|=2)),s==null||s.__v==null?(u==-1&&(i>p?f--:ic?f--:f++,a.__u|=4))):e.__k[o]=null;if(l)for(o=0;o(p?1:0)){for(i=n-1,o=n+1;i>=0||o=0?i--:o++])!=null&&(2&u.__u)==0&&s==u.key&&c==u.type)return a}return-1}function mv(e,t,n){t[0]=="-"?e.setProperty(t,n==null?"":n):e[t]=n==null?"":typeof n!="number"||mC.test(t)?n:n+"px"}function au(e,t,n,r,i){var o,a;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||mv(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||mv(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(_v,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n[Ia]=r[Ia]:(n[Ia]=lf,e.addEventListener(t,o?uf:cf,o)):e.removeEventListener(t,o?uf:cf,o);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n==null?"":n;break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function hv(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[su]==null)t[su]=lf++;else if(t[su]0?e:du(e)?e.map(Sv):Ar({},e)}function yC(e,t,n,r,i,o,a,s,c){var u,p,l,f,d,m,y,v=n.props||uu,w=t.props,R=t.type;if(R=="svg"?i="http://www.w3.org/2000/svg":R=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(u=0;u=5&&((a||!f&&o===5)&&(c.push(o,0,a,i),o=6),f&&(c.push(o,f,0,i),o=6)),a=""},p=0;p"?(o=1,a=""):a=r+a[0]:s?r===s?s="":a+=r:r==='"'||r==="'"?s=r:r===">"?(u(),o=1):o&&(r==="="?(o=5,i=a,a=""):r==="/"&&(o<5||n[p][l+1]===">")?(u(),o===3&&(c=c[0]),o=c,(c=c[0]).push(2,0,o),o=0):r===" "||r===" "||r===` +`||r==="\r"?(u(),o=2):a+=r),o===3&&a==="!--"&&(o=4,c=c[0])}return u(),c})(e)),t),arguments,[])).length>1?t:t[0]}var Ie=Av.bind(mu);var wo,ut,hf,Tv,ja=0,Lv=[],ht=Ue,Dv=ht.__b,Mv=ht.__r,kv=ht.diffed,Nv=ht.__c,Ov=ht.unmount,Bv=ht.__;function yu(e,t){ht.__h&&ht.__h(ut,e,ja||t),ja=0;var n=ut.__H||(ut.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function _u(e){return ja=1,jv(Fv,e)}function jv(e,t,n){var r=yu(wo++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Fv(void 0,t),function(s){var c=r.__N?r.__N[0]:r.__[0],u=r.t(c,s);c!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=ut,!ut.__f)){var i=function(s,c,u){if(!r.__c.__H)return!0;var p=r.__c.__H.__.filter(function(f){return f.__c});if(p.every(function(f){return!f.__N}))return!o||o.call(this,s,c,u);var l=r.__c.props!==s;return p.some(function(f){if(f.__N){var d=f.__[0];f.__=f.__N,f.__N=void 0,d!==f.__[0]&&(l=!0)}}),o&&o.call(this,s,c,u)||l};ut.__f=!0;var o=ut.shouldComponentUpdate,a=ut.componentWillUpdate;ut.componentWillUpdate=function(s,c,u){if(this.__e){var p=o;o=void 0,i(s,c,u),o=p}a&&a.call(this,s,c,u)},ut.shouldComponentUpdate=i}return r.__N||r.__}function Fa(e,t){var n=yu(wo++,3);!ht.__s&&gf(n.__H,t)&&(n.__=e,n.u=t,ut.__H.__h.push(n))}function So(e,t){var n=yu(wo++,4);!ht.__s&&gf(n.__H,t)&&(n.__=e,n.u=t,ut.__h.push(n))}function Ha(e){return ja=5,or(function(){return{current:e}},[])}function or(e,t){var n=yu(wo++,7);return gf(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Co(e,t){return ja=8,or(function(){return e},t)}function bC(){for(var e;e=Lv.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(gu),t.__h.some(vf),t.__h=[]}catch(n){t.__h=[],ht.__e(n,e.__v)}}}ht.__b=function(e){ut=null,Dv&&Dv(e)},ht.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Bv&&Bv(e,t)},ht.__r=function(e){Mv&&Mv(e),wo=0;var t=(ut=e.__c).__H;t&&(hf===ut?(t.__h=[],ut.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(gu),t.__h.some(vf),t.__h=[],wo=0)),hf=ut},ht.diffed=function(e){kv&&kv(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Lv.push(t)!==1&&Tv===ht.requestAnimationFrame||((Tv=ht.requestAnimationFrame)||xC)(bC)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),hf=ut=null},ht.__c=function(e,t){t.some(function(n){try{n.__h.some(gu),n.__h=n.__h.filter(function(r){return!r.__||vf(r)})}catch(r){t.some(function(i){i.__h&&(i.__h=[])}),t=[],ht.__e(r,n.__v)}}),Nv&&Nv(e,t)},ht.unmount=function(e){Ov&&Ov(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{gu(r)}catch(i){t=i}}),n.__H=void 0,t&&ht.__e(t,n.__v))};var Iv=typeof requestAnimationFrame=="function";function xC(e){var t,n=function(){clearTimeout(r),Iv&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Iv&&(t=requestAnimationFrame(n))}function gu(e){var t=ut,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),ut=t}function vf(e){var t=ut;e.__c=e.__(),ut=t}function gf(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Fv(e,t){return typeof t=="function"?t(e):t}k();function Hv(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;twC(t),[t]),s=u=>u.action&&!u.disabled,c=(u,p)=>{if(s(p))return n(u,p)};return Ie`

      ${o}

      - ${a.map(p=>Oe` -
        + ${a.map(u=>Ie` +
          - ${p.entries.map(u=>Oe` -
        • - <${s(u)?"button":"span"} - class=${uS(u,u===r)} - onClick=${l=>c(l,u)} - title=${u.title||u.label} - data-id=${u.id} - aria-disabled=${u.disabled||void 0} - onMouseEnter=${()=>s(u)&&i(u)} - onMouseLeave=${()=>s(u)&&i(null)} - onFocus=${()=>s(u)&&i(u)} - onBlur=${()=>s(u)&&i(null)} + ${u.entries.map(p=>Ie` +
        • + <${s(p)?"button":"span"} + class=${SC(p,p===r)} + onClick=${l=>c(l,p)} + title=${p.title||p.label} + data-id=${p.id} + aria-disabled=${p.disabled||void 0} + onMouseEnter=${()=>s(p)&&i(p)} + onMouseLeave=${()=>s(p)&&i(null)} + onFocus=${()=>s(p)&&i(p)} + onBlur=${()=>s(p)&&i(null)} > - ${u.imageUrl&&Oe``||u.imageHtml&&Oe`
          `} - ${u.label?Oe` - ${u.label} + ${p.imageUrl&&Ie``||p.imageHtml&&Ie`
          `} + ${p.label?Ie` + ${p.label} `:null} - +
        • `)}
        `)}
      - `}function pS(e){return e.reduce((t,n)=>{let r=n.group||"default",i=t.find(o=>o.id===r);return i?i.entries.push(n):t.push({id:r,entries:[n]}),t},[])}function uS(e,t){return vi("entry",e.className,e.active?"active":"",e.disabled?"disabled":"",t?"selected":"")}function Xl(e){let{entry:t,selected:n,onMouseEnter:r,onMouseLeave:i,onAction:o}=e,a=(s,c)=>{if(!t.disabled)return o(s,t,c)};return Oe` + `}function wC(e){return e.reduce((t,n)=>{let r=n.group||"default",i=t.find(o=>o.id===r);return i?i.entries.push(n):t.push({id:r,entries:[n]}),t},[])}function SC(e,t){return Ai("entry",e.className,e.active?"active":"",e.disabled?"disabled":"",t?"selected":"")}function _f(e){let{entry:t,selected:n,onMouseEnter:r,onMouseLeave:i,onAction:o}=e,a=(s,c)=>{if(!t.disabled)return o(s,t,c)};return Ie`
    • - ${t.imageUrl&&Oe``||t.imageHtml&&Oe`
      `} + ${t.imageUrl&&Ie``||t.imageHtml&&Ie`
      `} - ${t.label?Oe` + ${t.label?Ie` ${t.label} `:null} - ${t.description&&Oe` + ${t.description&&Ie` `}
      - ${t.documentationRef&&Oe` + ${t.documentationRef&&Ie`
      `}
    • - `}function Zl(e){let{selectedEntry:t,setSelectedEntry:n,groupedEntries:r,...i}=e,o=Pa();return mo(()=>{let a=o.current;if(!a)return;let s=a.querySelector(".selected");s&&lS(s)},[t]),Oe` + `}function bf(e){let{selectedEntry:t,setSelectedEntry:n,groupedEntries:r,...i}=e,o=Ha();return So(()=>{let a=o.current;if(!a)return;let s=a.querySelector(".selected");s&&CC(s)},[t]),Ie`
      - ${r.map(a=>Oe` - ${a.name&&Oe` + ${r.map(a=>Ie` + ${a.name&&Ie`
      ${a.name}
      `}
        - ${a.entries.map(s=>Oe` - <${Xl} + ${a.entries.map(s=>Ie` + <${_f} key=${s.id} entry=${s} selected=${s===t} @@ -111,29 +111,29 @@
      `)}
      - `}function lS(e){typeof e.scrollIntoViewIfNeeded=="function"?e.scrollIntoViewIfNeeded():e.scrollIntoView({scrollMode:"if-needed",block:"nearest"})}function Ql(e){let{onClose:t,onSelect:n,className:r,headerEntries:i,position:o,title:a,width:s,scale:c,search:p,emptyPlaceholder:u,searchFn:l,entries:f,onOpened:d,onClosed:h}=e,_=Yn(()=>Ge(p)?f.length>5:!1,[p,f]),[v,w]=op(""),P=go((H,z)=>{if(!_)return H;if(!z.trim())return H.filter(({rank:ce=0})=>ce>=0);let K=H.filter(({searchable:ce})=>ce!==!1);return l(K,z,{keys:["label","search","description"]}).map(({item:ce})=>ce)},[_]),b=Yn(()=>P(f,v),[f,v,P]),[x,S]=op(b[0]),A=Yn(()=>v.trim()?b.length?[{id:"default",entries:b}]:[]:hS(b),[b,v]);Ra(()=>{S(b[0])},[b]);let O=go(H=>{let z=dS(A),ce=z.indexOf(x)+H;ce<0&&(ce=z.length-1),ce>=z.length&&(ce=0),S(z[ce])},[A,x,S]),M=go(H=>{if(H.key==="Enter"&&x)return x.disabled?void 0:n(H,x);if(H.key==="ArrowUp")return O(-1),H.preventDefault();if(H.key==="ArrowDown")return O(1),H.preventDefault()},[n,x,O]),B=go(H=>{Zs(H.target,"input")&&w(()=>H.target.value)},[w]);Ra(()=>(d(),()=>{h()}),[]);let I=Yn(()=>a||i.length>0,[a,i]);return Oe` - <${zm} + `}function CC(e){typeof e.scrollIntoViewIfNeeded=="function"?e.scrollIntoViewIfNeeded():e.scrollIntoView({scrollMode:"if-needed",block:"nearest"})}k();function xf(e){let{onClose:t,onSelect:n,className:r,headerEntries:i,position:o,title:a,width:s,scale:c,search:u,emptyPlaceholder:p,searchFn:l,entries:f,onOpened:d,onClosed:m}=e,y=or(()=>Ge(u)?f.length>5:!1,[u,f]),[v,w]=_u(""),R=Co(($,G)=>{if(!y)return $;if(!G.trim())return $.filter(({rank:pe=0})=>pe>=0);let K=$.filter(({searchable:pe})=>pe!==!1);return l(K,G,{keys:["label","search","description"]}).map(({item:pe})=>pe)},[y]),x=or(()=>R(f,v),[f,v,R]),[b,S]=_u(x[0]),A=or(()=>v.trim()?x.length?[{id:"default",entries:x}]:[]:AC(x),[x,v]);Fa(()=>{S(x[0])},[x]);let O=Co($=>{let G=PC(A),pe=G.indexOf(b)+$;pe<0&&(pe=G.length-1),pe>=G.length&&(pe=0),S(G[pe])},[A,b,S]),D=Co($=>{if($.key==="Enter"&&b)return b.disabled?void 0:n($,b);if($.key==="ArrowUp")return O(-1),$.preventDefault();if($.key==="ArrowDown")return O(1),$.preventDefault()},[n,b,O]),L=Co($=>{fc($.target,"input")&&w(()=>$.target.value)},[w]);Fa(()=>(d(),()=>{m()}),[]);let I=or(()=>a||i.length>0,[a,i]);return Ie` + <${$v} onClose=${t} - onKeyup=${B} - onKeydown=${M} + onKeyup=${L} + onKeydown=${D} className=${r} position=${o} width=${s} scale=${c} > - ${I&&Oe` - <${ql} + ${I&&Ie` + <${yf} headerEntries=${i} onSelect=${n} - selectedEntry=${x} + selectedEntry=${b} setSelectedEntry=${S} title=${a} /> `} - ${f.length>0&&Oe` + ${f.length>0&&Ie`
      - ${_&&Oe` + ${y&&Ie` `} - <${Zl} + <${bf} groupedEntries=${A} - selectedEntry=${x} + selectedEntry=${b} setSelectedEntry=${S} onAction=${n} />
      `} - ${u&&b.length===0&&Oe` -
      ${Ne(u)?u(v):u}
      + ${p&&x.length===0&&Ie` +
      ${Ne(p)?p(v):p}
      `} - - `}function zm(e){let{onClose:t,onKeydown:n,onKeyup:r,className:i,children:o,position:a}=e,s=Pa();return mo(()=>{if(typeof a!="function")return;let c=s.current,p=a(c);c.style.left=`${p.x}px`,c.style.top=`${p.y}px`},[s.current,a]),mo(()=>{let c=s.current;if(!c)return;(c.querySelector("input")||c).focus()},[]),Ra(()=>{let c=u=>{if(u.key==="Escape")return u.preventDefault(),t()},p=u=>{if(!Sn(u.target,".djs-popup",!0))return t()};return document.documentElement.addEventListener("keydown",c),document.body.addEventListener("click",p),()=>{document.documentElement.removeEventListener("keydown",c),document.body.removeEventListener("click",p)}},[]),Oe` + + `}function $v(e){let{onClose:t,onKeydown:n,onKeyup:r,className:i,children:o,position:a}=e,s=Ha();return So(()=>{if(typeof a!="function")return;let c=s.current,u=a(c);c.style.left=`${u.x}px`,c.style.top=`${u.y}px`},[s.current,a]),So(()=>{let c=s.current;if(!c)return;(c.querySelector("input")||c).focus()},[]),Fa(()=>{let c=p=>{if(p.key==="Escape")return p.preventDefault(),t()},u=p=>{if(!Nn(p.target,".djs-popup",!0))return t()};return document.documentElement.addEventListener("keydown",c),document.body.addEventListener("click",u),()=>{document.documentElement.removeEventListener("keydown",c),document.body.removeEventListener("click",u)}},[]),Ie`
      ${o}
      - `}function fS(e){return{transform:`scale(${e.scale})`,width:`${e.width}px`,"transform-origin":"top left"}}function dS(e){let t=[];return e.forEach(n=>{n.entries.forEach(r=>{t.push(r)})}),t}function hS(e){let t=[],n=o=>t.find(a=>o.id===a.id),r=o=>!!n(o),i=o=>typeof o=="string"?{id:o}:o;return e.forEach(o=>{let a=o.group?i(o.group):{id:"default"};r(a)?n(a).entries.push(o):t.push({...a,entries:[o]})}),t}var mS="data-id",Vm=["contextPad.close","canvas.viewbox.changing","commandStack.changed"],gS=1e3;function je(e,t,n,r){this._eventBus=t,this._canvas=n,this._search=r,this._current=null;var i=Ge(e&&e.scale)?e.scale:{min:1,max:1};this._config={scale:i},t.on("diagram.destroy",()=>{this.close()}),t.on("element.changed",o=>{let a=this.isOpen()&&this._current.target;o.element===a&&this.refresh()})}je.$inject=["config.popupMenu","eventBus","canvas","search"];je.prototype._render=function(){let{position:e,providerId:t,entries:n,headerEntries:r,emptyPlaceholder:i,options:o}=this._current,a=Object.entries(n).map(([f,d])=>({id:f,...d})),s=Object.entries(r).map(([f,d])=>({id:f,...d})),c=e&&(f=>this._ensureVisible(f,e)),p=this._updateScale(this._current.container);np(Oe` - <${Ql} + `}function RC(e){return{transform:`scale(${e.scale})`,width:`${e.width}px`,"transform-origin":"top left"}}function PC(e){let t=[];return e.forEach(n=>{n.entries.forEach(r=>{t.push(r)})}),t}function AC(e){let t=[],n=o=>t.find(a=>o.id===a.id),r=o=>!!n(o),i=o=>typeof o=="string"?{id:o}:o;return e.forEach(o=>{let a=o.group?i(o.group):{id:"default"};r(a)?n(a).entries.push(o):t.push({...a,entries:[o]})}),t}var TC="data-id",zv=["contextPad.close","canvas.viewbox.changing","commandStack.changed"],DC=1e3;function $e(e,t,n,r){this._eventBus=t,this._canvas=n,this._search=r,this._current=null;var i=Ge(e&&e.scale)?e.scale:{min:1,max:1};this._config={scale:i},t.on("diagram.destroy",()=>{this.close()}),t.on("element.changed",o=>{let a=this.isOpen()&&this._current.target;o.element===a&&this.refresh()})}$e.$inject=["config.popupMenu","eventBus","canvas","search"];$e.prototype._render=function(){let{position:e,providerId:t,entries:n,headerEntries:r,emptyPlaceholder:i,options:o}=this._current,a=Object.entries(n).map(([f,d])=>({id:f,...d})),s=Object.entries(r).map(([f,d])=>({id:f,...d})),c=e&&(f=>this._ensureVisible(f,e)),u=this._updateScale(this._current.container);vu(Ie` + <${xf} onClose=${f=>this.close(f)} - onSelect=${(f,d,h)=>this.trigger(f,d,h)} + onSelect=${(f,d,m)=>this.trigger(f,d,m)} position=${c} className=${t} entries=${a} headerEntries=${s} emptyPlaceholder=${i} - scale=${p} + scale=${u} onOpened=${this._onOpened.bind(this)} onClosed=${this._onClosed.bind(this)} searchFn=${this._search} ...${{...o}} /> - `,this._current.container)};je.prototype.open=function(e,t,n,r){if(!e)throw new Error("target is missing");if(!t)throw new Error("providers for <"+t+"> not found");if(!n)throw new Error("position is missing");this.isOpen()&&this.close();let{entries:i,headerEntries:o,emptyPlaceholder:a}=this._getContext(e,t);this._current={position:n,providerId:t,target:e,entries:i,headerEntries:o,emptyPlaceholder:a,container:this._createContainer({provider:t}),options:r},this._emit("open"),this._bindAutoClose(),this._render()};je.prototype.refresh=function(){if(!this.isOpen())return;let{target:e,providerId:t}=this._current,{entries:n,headerEntries:r,emptyPlaceholder:i}=this._getContext(e,t);this._current={...this._current,entries:n,headerEntries:r,emptyPlaceholder:i},this._emit("refresh"),this._render()};je.prototype._getContext=function(e,t){let n=this._getProviders(t);if(!n||!n.length)throw new Error("provider for <"+t+"> not found");let r=this._getEntries(e,n),i=this._getHeaderEntries(e,n),o=this._getEmptyPlaceholder(n);return{entries:r,headerEntries:i,emptyPlaceholder:o,empty:!(Object.keys(r).length||Object.keys(i).length)}};je.prototype.close=function(){this.isOpen()&&(this._emit("close"),this.reset(),this._canvas.restoreFocus(),this._current=null)};je.prototype.reset=function(){let e=this._current.container;np(null,e),Bt(e)};je.prototype._emit=function(e,t){this._eventBus.fire(`popupMenu.${e}`,t)};je.prototype._onOpened=function(){this._emit("opened")};je.prototype._onClosed=function(){this._emit("closed")};je.prototype._createContainer=function(e){var t=this._canvas,n=t.getContainer();let r=ye(`
      `);return n.appendChild(r),r};je.prototype._bindAutoClose=function(){this._eventBus.once(Vm,this.close,this)};je.prototype._unbindAutoClose=function(){this._eventBus.off(Vm,this.close,this)};je.prototype._updateScale=function(){var e=this._canvas.zoom(),t=this._config.scale,n,r,i=e;return t!==!0&&(t===!1?(n=1,r=1):(n=t.min,r=t.max),Ge(n)&&er&&(i=r)),i};je.prototype._ensureVisible=function(e,t){var n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect(),i={},o=t.x,a=t.y;return t.x+r.width>n.width&&(i.x=!0),t.y+r.height>n.height&&(i.y=!0),i.x&&i.y?(o=t.x-r.width,a=t.y-r.height):i.x?(o=t.x-r.width,a=t.y):i.y&&t.yNe(n.getEmptyPlaceholder));return t&&t.getEmptyPlaceholder()};je.prototype.isOpen=function(){return!!this._current};je.prototype.trigger=function(e,t,n="click"){if(e.preventDefault(),!t){let i=Sn(e.delegateTarget||e.target,".entry",!0),o=Ye(i,mS);t={id:o,...this._getEntry(o)}}let r=t.action;if(this._emit("trigger",{entry:t,event:e})!==!1){if(Ne(r)){if(n==="click")return r(e,t)}else if(r[n])return r[n](e,t)}};je.prototype._getEntry=function(e){var t=this._current.entries[e]||this._current.headerEntries[e];if(!t)throw new Error("entry not found");return t};function Jl(e,t,n){let{keys:r}=n;if(t=t.trim().toLowerCase(),!t)throw new Error(" must not be empty");let i=t.trim().toLowerCase().split(/\s+/);return e.flatMap(o=>{let a=vS(o,i,r);return a?{item:o,tokens:a}:[]}).sort(yS(r))}function vS(e,t,n){let{matchedWords:r,tokens:i}=n.reduce((o,a)=>{let s=e[a],{tokens:c,matchedWords:p}=U(s)?s.reduce((u,l)=>{let{tokens:f,matchedWords:d}=Km(l,t);return{tokens:[...u.tokens,f],matchedWords:{...u.matchedWords,...d}}},{matchedWords:{},tokens:[]}):Km(s,t);return{tokens:{...o.tokens,[a]:c},matchedWords:{...o.matchedWords,...p}}},{matchedWords:{},tokens:{}});return Object.keys(r).length!==t.length?null:i}function yS(e){return(t,n)=>{let r=0,i=1;for(let o of e){let a=_S(t.tokens[o],n.tokens[o]);if(a!==0){r+=a*i,i*=Wm;continue}let s=xS(t.item[o],n.item[o]);if(s!==0){r+=s*i,i*=Wm;continue}}return r}}function _S(e,t){return Gm(t)-Gm(e)}var Wm=.5,vo={FULL:131.9,START_FULL_WORD:8,START_WORD_PART:7.87,WORD_START:2.19,WORD_PART:1,NO_MATCH:-.07};function Gm(e){let t=e.reduce((s,c)=>s+Ym(c),0),n=e.flat(),r=n.reduce((s,c)=>s+c.value.length,0),i=n.reduce((s,c)=>s+(c.match?c.value.length:0),0),o=r?i/r:0;return t*(1+o)}function Ym(e){if(U(e))return Math.max(...e.map(Ym));let t=Math.log(e.value.length);return e.match?(e.start?e.end?vo.FULL:e.wordEnd?vo.START_FULL_WORD:vo.START_WORD_PART:e.wordStart?vo.WORD_START:vo.WORD_PART)*t:vo.NO_MATCH*t}function Um(e=""){return U(e)?e.join(", "):e}function xS(e,t){return Um(e).localeCompare(Um(t))}function Km(e,t){var p;if(!e)return{tokens:[],matchedWords:{}};let n=[],r={},i=t.map(bS),o=[`(?${i.join("\\s+")})`,...i].join("|"),a=new RegExp(o,"ig"),s,c=0;for(;s=a.exec(e);){let[u]=s,l=s.index,f=s.index+u.length,d=l===0,h=f===e.length,_=!!((p=s.groups)!=null&&p.all),v=d||/\s/.test(e.charAt(l-1)),w=h||/\s/.test(e.charAt(f));s.index>c&&n.push({value:e.slice(c,s.index),index:c}),n.push({value:u,index:s.index,match:!0,wordStart:v,wordEnd:w,start:d,end:h,all:_});let P=_?t:[u];for(let b of P)r[b.toLowerCase()]=!0;c=s.index+u.length}return c + `,this._current.container)};$e.prototype.open=function(e,t,n,r){if(!e)throw new Error("target is missing");if(!t)throw new Error("providers for <"+t+"> not found");if(!n)throw new Error("position is missing");this.isOpen()&&this.close();let{entries:i,headerEntries:o,emptyPlaceholder:a}=this._getContext(e,t);this._current={position:n,providerId:t,target:e,entries:i,headerEntries:o,emptyPlaceholder:a,container:this._createContainer({provider:t}),options:r},this._emit("open"),this._bindAutoClose(),this._render()};$e.prototype.refresh=function(){if(!this.isOpen())return;let{target:e,providerId:t}=this._current,{entries:n,headerEntries:r,emptyPlaceholder:i}=this._getContext(e,t);this._current={...this._current,entries:n,headerEntries:r,emptyPlaceholder:i},this._emit("refresh"),this._render()};$e.prototype._getContext=function(e,t){let n=this._getProviders(t);if(!n||!n.length)throw new Error("provider for <"+t+"> not found");let r=this._getEntries(e,n),i=this._getHeaderEntries(e,n),o=this._getEmptyPlaceholder(n);return{entries:r,headerEntries:i,emptyPlaceholder:o,empty:!(Object.keys(r).length||Object.keys(i).length)}};$e.prototype.close=function(){this.isOpen()&&(this._emit("close"),this.reset(),this._canvas.restoreFocus(),this._current=null)};$e.prototype.reset=function(){let e=this._current.container;vu(null,e),Gt(e)};$e.prototype._emit=function(e,t){this._eventBus.fire(`popupMenu.${e}`,t)};$e.prototype._onOpened=function(){this._emit("opened")};$e.prototype._onClosed=function(){this._emit("closed")};$e.prototype._createContainer=function(e){var t=this._canvas,n=t.getContainer();let r=ue(`
      `);return n.appendChild(r),r};$e.prototype._bindAutoClose=function(){this._eventBus.once(zv,this.close,this)};$e.prototype._unbindAutoClose=function(){this._eventBus.off(zv,this.close,this)};$e.prototype._updateScale=function(){var e=this._canvas.zoom(),t=this._config.scale,n,r,i=e;return t!==!0&&(t===!1?(n=1,r=1):(n=t.min,r=t.max),Ge(n)&&er&&(i=r)),i};$e.prototype._ensureVisible=function(e,t){var n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect(),i={},o=t.x,a=t.y;return t.x+r.width>n.width&&(i.x=!0),t.y+r.height>n.height&&(i.y=!0),i.x&&i.y?(o=t.x-r.width,a=t.y-r.height):i.x?(o=t.x-r.width,a=t.y):i.y&&t.yNe(n.getEmptyPlaceholder));return t&&t.getEmptyPlaceholder()};$e.prototype.isOpen=function(){return!!this._current};$e.prototype.trigger=function(e,t,n="click"){if(e.preventDefault(),!t){let i=Nn(e.delegateTarget||e.target,".entry",!0),o=Je(i,TC);t={id:o,...this._getEntry(o)}}let r=t.action;if(this._emit("trigger",{entry:t,event:e})!==!1){if(Ne(r)){if(n==="click")return r(e,t)}else if(r[n])return r[n](e,t)}};$e.prototype._getEntry=function(e){var t=this._current.entries[e]||this._current.headerEntries[e];if(!t)throw new Error("entry not found");return t};k();function Ef(e,t,n){let{keys:r}=n;if(t=t.trim().toLowerCase(),!t)throw new Error(" must not be empty");let i=t.trim().toLowerCase().split(/\s+/);return e.flatMap(o=>{let a=MC(o,i,r);return a?{item:o,tokens:a}:[]}).sort(kC(r))}function MC(e,t,n){let{matchedWords:r,tokens:i}=n.reduce((o,a)=>{let s=e[a],{tokens:c,matchedWords:u}=q(s)?s.reduce((p,l)=>{let{tokens:f,matchedWords:d}=Uv(l,t);return{tokens:[...p.tokens,f],matchedWords:{...p.matchedWords,...d}}},{matchedWords:{},tokens:[]}):Uv(s,t);return{tokens:{...o.tokens,[a]:c},matchedWords:{...o.matchedWords,...u}}},{matchedWords:{},tokens:{}});return Object.keys(r).length!==t.length?null:i}function kC(e){return(t,n)=>{let r=0,i=1;for(let o of e){let a=NC(t.tokens[o],n.tokens[o]);if(a!==0){r+=a*i,i*=Gv;continue}let s=OC(t.item[o],n.item[o]);if(s!==0){r+=s*i,i*=Gv;continue}}return r}}function NC(e,t){return Vv(t)-Vv(e)}var Gv=.5,Ro={FULL:131.9,START_FULL_WORD:8,START_WORD_PART:7.87,WORD_START:2.19,WORD_PART:1,NO_MATCH:-.07};function Vv(e){let t=e.reduce((s,c)=>s+qv(c),0),n=e.flat(),r=n.reduce((s,c)=>s+c.value.length,0),i=n.reduce((s,c)=>s+(c.match?c.value.length:0),0),o=r?i/r:0;return t*(1+o)}function qv(e){if(q(e))return Math.max(...e.map(qv));let t=Math.log(e.value.length);return e.match?(e.start?e.end?Ro.FULL:e.wordEnd?Ro.START_FULL_WORD:Ro.START_WORD_PART:e.wordStart?Ro.WORD_START:Ro.WORD_PART)*t:Ro.NO_MATCH*t}function Wv(e=""){return q(e)?e.join(", "):e}function OC(e,t){return Wv(e).localeCompare(Wv(t))}function Uv(e,t){var u;if(!e)return{tokens:[],matchedWords:{}};let n=[],r={},i=t.map(BC),o=[`(?${i.join("\\s+")})`,...i].join("|"),a=new RegExp(o,"ig"),s,c=0;for(;s=a.exec(e);){let[p]=s,l=s.index,f=s.index+p.length,d=l===0,m=f===e.length,y=!!((u=s.groups)!=null&&u.all),v=d||/\s/.test(e.charAt(l-1)),w=m||/\s/.test(e.charAt(f));s.index>c&&n.push({value:e.slice(c,s.index),index:c}),n.push({value:p,index:s.index,match:!0,wordStart:v,wordEnd:w,start:d,end:m,all:y});let R=y?t:[p];for(let x of R)r[x.toLowerCase()]=!0;c=s.index+p.length}return c @@ -208,8 +208,8 @@ - `},sp=ES;var wS=900;function Yr(e,t,n,r){e.registerProvider(wS,this),this._contextPad=e,this._popupMenu=t,this._translate=n,this._canvas=r}Yr.$inject=["contextPad","popupMenu","translate","canvas"];Yr.prototype.getMultiElementContextPadEntries=function(e){var t={};return this._isAllowed(e)&&C(t,this._getEntries(e)),t};Yr.prototype._isAllowed=function(e){return!this._popupMenu.isEmpty(e,"align-elements")};Yr.prototype._getEntries=function(){var e=this;return{"align-elements":{group:"align-elements",title:e._translate("Align elements"),html:`
      ${sp.align}
      `,action:{click:function(t,n){var r=e._getMenuPosition(n);C(r,{cursor:{x:t.x,y:t.y}}),e._popupMenu.open(n,"align-elements",r)}}}}};Yr.prototype._getMenuPosition=function(e){var t=5,n=this._contextPad.getPad(e).html,r=n.getBoundingClientRect(),i={x:r.left,y:r.bottom+t};return i};var SS=["left","center","right","top","middle","bottom"];function yi(e,t,n,r){this._alignElements=t,this._translate=n,this._popupMenu=e,this._rules=r,e.registerProvider("align-elements",this)}yi.$inject=["popupMenu","alignElements","translate","rules"];yi.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&C(t,this._getEntries(e)),t};yi.prototype._isAllowed=function(e){return this._rules.allowed("elements.align",{elements:e})};yi.prototype._getEntries=function(e){var t=this._alignElements,n=this._translate,r=this._popupMenu,i={};return E(SS,function(o){i["align-elements-"+o]={group:"align",title:n("Align elements "+o),className:"bjs-align-elements-menu-entry",imageHtml:sp[o],action:function(){t.trigger(e,o),r.close()}}}),i};function Ct(e){k.call(this,e),this.init()}Ct.$inject=["eventBus"];N(Ct,k);Ct.prototype.addRule=function(e,t,n){var r=this;typeof e=="string"&&(e=[e]),e.forEach(function(i){r.canExecute(i,t,function(o,a,s){return n(o)},!0)})};Ct.prototype.init=function(){};function _o(e){Ct.call(this,e)}_o.$inject=["eventBus"];N(_o,Ct);_o.prototype.init=function(){this.addRule("elements.align",function(e){var t=e.elements,n=J(t,function(r){return!(r.waypoints||r.host||r.labelTarget)});return n=Dr(n),n.length<2?!1:n})};var qm={__depends__:[um,Gc,yo],__init__:["alignElementsContextPadProvider","alignElementsMenuProvider","bpmnAlignElements"],alignElementsContextPadProvider:["type",Yr],alignElementsMenuProvider:["type",yi],bpmnAlignElements:["type",_o]};var CS=10,tf=50,RS=250;function cp(e,t,n,r){for(var i;i=PS(e,n,t);)n=r(t,n,i);return n}function pp(e){return function(t,n,r){var i={x:n.x,y:n.y};return["x","y"].forEach(function(o){var a=e[o];if(a){var s=o==="x"?"width":"height",c=a.margin,p=a.minDistance;c<0?i[o]=Math.min(r[o]+c-t[s]/2,n[o]-p+c):i[o]=Math.max(r[o]+r[s]+c+t[s]/2,n[o]+p+c)}}),i}}function PS(e,t,n){var r={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height},i=AS(e);return ne(i,function(o){if(o===n)return!1;var a=Le(o,r,CS);return a==="intersect"})}function Xm(e,t){t||(t={});function n(h){return h.source===e?1:-1}var r=t.defaultDistance||tf,i=t.direction||"e",o=t.filter,a=t.getWeight||n,s=t.maxDistance||RS,c=t.reference||"start";o||(o=DS);function p(h,_){return i==="n"?c==="start"?X(h).top-X(_).bottom:c==="center"?X(h).top-Y(_).y:X(h).top-X(_).top:i==="w"?c==="start"?X(h).left-X(_).right:c==="center"?X(h).left-Y(_).x:X(h).left-X(_).left:i==="s"?c==="start"?X(_).top-X(h).bottom:c==="center"?Y(_).y-X(h).bottom:X(_).bottom-X(h).bottom:c==="start"?X(_).left-X(h).right:c==="center"?Y(_).x-X(h).right:X(_).right-X(h).right}var u=e.incoming.filter(o).map(function(h){var _=a(h),v=_<0?p(h.source,e):p(e,h.source);return{id:h.source.id,distance:v,weight:_}}),l=e.outgoing.filter(o).map(function(h){var _=a(h),v=_>0?p(e,h.target):p(h.target,e);return{id:h.target.id,distance:v,weight:_}}),f=u.concat(l).reduce(function(h,_){return h[_.id+"__weight_"+_.weight]=_,h},{}),d=Ke(f,function(h,_){var v=_.distance,w=_.weight;return v<0||v>s||(h[String(v)]||(h[String(v)]=0),h[String(v)]+=1*w,(!h.distance||h[h.distance]t.top&&(n=n.concat("n")),e.rightt.left&&(n=n.concat("e")),n}function bo(e){e.invoke(Tn,this)}bo.$inject=["injector"];N(bo,Tn);bo.prototype.resize=function(e,t,n){m(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)};function _i(e){Ct.call(this,e);var t=this;this.addRule("element.autoResize",function(n){return t.canResize(n.elements,n.target)})}_i.$inject=["eventBus"];N(_i,Ct);_i.prototype.canResize=function(e,t){return!1};function Eo(e,t){_i.call(this,e),this._modeling=t}N(Eo,_i);Eo.$inject=["eventBus","modeling"];Eo.prototype.canResize=function(e,t){if(m(t.di,"bpmndi:BPMNPlane")||!m(t,"bpmn:Participant")&&!m(t,"bpmn:Lane")&&!m(t,"bpmn:SubProcess"))return!1;var n=!0;return E(e,function(r){if(m(r,"bpmn:Lane")||te(r)){n=!1;return}}),n};var Jm={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",bo],bpmnAutoResizeProvider:["type",Eo]};var eg=1500;function mp(e,t,n){var r=this,i=n.get("dragging",!1);function o(a){if(!a.hover){var s=a.originalEvent,c=r._findTargetGfx(s),p=c&&e.get(c);c&&p&&(a.stopPropagation(),i.hover({element:p,gfx:c}),i.move(s))}}i&&t.on("drag.start",function(a){t.once("drag.move",eg,function(s){o(s)})}),(function(){var a,s;t.on("element.hover",function(c){a=c.gfx,s=c.element}),t.on("element.hover",eg,function(c){s&&t.fire("element.out",{element:s,gfx:a})}),t.on("element.out",function(){a=null,s=null})})(),this._findTargetGfx=function(a){var s,c;if(a instanceof MouseEvent)return s=yn(a),c=document.elementFromPoint(s.x,s.y),FS(c)}}mp.$inject=["elementRegistry","eventBus","injector"];function FS(e){return Sn(e,"svg, .djs-element",!0)}var tg={__init__:["hoverFix"],hoverFix:["type",mp]};var wo=Math.round,ng="djs-drag-active";function xi(e){e.preventDefault()}function HS(e){return typeof TouchEvent!="undefined"&&e instanceof TouchEvent}function $S(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function gp(e,t,n,r){var i={threshold:5,trapClick:!0},o;function a(b){var x=t.viewbox(),S=t._container.getBoundingClientRect();return{x:x.x+(b.x-S.left)/x.scale,y:x.y+(b.y-S.top)/x.scale}}function s(b,x){x=x||o;var S=e.createEvent(C({},x.payload,x.data,{isTouch:x.isTouch}));return e.fire("drag."+b,S)===!1?!1:e.fire(x.prefix+"."+b,S)}function c(b){var x=b.filter(function(S){return r.get(S.id)});x.length&&n.select(x)}function p(b,x){var S=o.payload,A=o.displacement,O=o.globalStart,M=yn(b),B=Et(M,O),I=o.localStart,H=a(M),z=Et(H,I);if(!o.active&&(x||$S(B)>o.threshold)){if(C(S,{x:wo(I.x+A.x),y:wo(I.y+A.y),dx:0,dy:0},{originalEvent:b}),s("start")===!1)return v();o.active=!0,o.keepSelection||(S.previousSelection=n.get(),n.select(null)),o.cursor&&gi(o.cursor),t.addMarker(t.getRootElement(),ng)}Tc(b),o.active&&(C(S,{x:wo(H.x+A.x),y:wo(H.y+A.y),dx:wo(z.x),dy:wo(z.y)},{originalEvent:b}),s("move"))}function u(b){var x,S=!0;o.active&&(b&&(o.payload.originalEvent=b,Tc(b)),S=s("end")),S===!1&&s("rejected"),x=w(S!==!0),s("ended",x)}function l(b){ze("Escape",b)&&(xi(b),v())}function f(b){var x;o.active&&(x=Hc(e),setTimeout(x,400),xi(b)),u(b)}function d(b){p(b)}function h(b){var x=o.payload;x.hoverGfx=b.gfx,x.hover=b.element,s("hover")}function _(b){s("out");var x=o.payload;x.hoverGfx=null,x.hover=null}function v(b){var x;if(o){var S=o.active;S&&s("cancel"),x=w(b),S&&s("canceled",x)}}function w(b){var x,S;s("cleanup"),Fc(),o.trapClick?S=f:S=u,ae.unbind(document,"mousemove",p),ae.unbind(document,"dragstart",xi),ae.unbind(document,"selectstart",xi),ae.unbind(document,"mousedown",S,!0),ae.unbind(document,"mouseup",S,!0),ae.unbind(document,"keyup",l),ae.unbind(document,"touchstart",d,!0),ae.unbind(document,"touchcancel",v,!0),ae.unbind(document,"touchmove",p,!0),ae.unbind(document,"touchend",u,!0),e.off("element.hover",h),e.off("element.out",_),t.removeMarker(t.getRootElement(),ng);var A=o.payload.previousSelection;return b!==!1&&A&&!n.get().length&&c(A),x=o,o=null,x}function P(b,x,S,A){o&&v(!1),typeof x=="string"&&(A=S,S=x,x=null),A=C({},i,A||{});var O=A.data||{},M,B,I,H,z;A.trapClick?H=f:H=u,b?(M=dr(b)||b,B=yn(b),Tc(b),M.type==="dragstart"&&xi(M)):(M=null,B={x:0,y:0}),I=a(B),x||(x=I),z=HS(M),o=C({prefix:S,data:O,payload:{},globalStart:B,displacement:Et(x,I),localStart:I,isTouch:z},A),A.manual||(z?(ae.bind(document,"touchstart",d,!0),ae.bind(document,"touchcancel",v,!0),ae.bind(document,"touchmove",p,!0),ae.bind(document,"touchend",u,!0)):(ae.bind(document,"mousemove",p),ae.bind(document,"dragstart",xi),ae.bind(document,"selectstart",xi),ae.bind(document,"mousedown",H,!0),ae.bind(document,"mouseup",H,!0)),ae.bind(document,"keyup",l),e.on("element.hover",h),e.on("element.out",_)),s("init"),A.autoActivate&&p(b,!0)}e.on("diagram.destroy",v),this.init=P,this.move=p,this.hover=h,this.out=_,this.end=u,this.cancel=v,this.context=function(){return o},this.setOptions=function(b){C(i,b)}}gp.$inject=["eventBus","canvas","selection","elementRegistry"];var wt={__depends__:[tg,qe],dragging:["type",gp]};function qr(e,t,n){this._canvas=n,this._opts=C({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},e);var r=this;t.on("drag.move",function(i){var o=r._toBorderPoint(i);r.startScroll(o)}),t.on(["drag.cleanup"],function(){r.stopScroll()})}qr.$inject=["config.autoScroll","eventBus","canvas"];qr.prototype.startScroll=function(e){var t=this._canvas,n=this._opts,r=this,i=t.getContainer().getBoundingClientRect(),o=[e.x,e.y,i.width-e.x,i.height-e.y];this.stopScroll();for(var a=0,s=0,c=0;c<4;c++)zS(o[c],n.scrollThresholdOut[c],n.scrollThresholdIn[c])&&(c===0?a=n.scrollStep:c==1?s=n.scrollStep:c==2?a=-n.scrollStep:c==3&&(s=-n.scrollStep));(a!==0||s!==0)&&(t.scroll({dx:a,dy:s}),this._scrolling=setTimeout(function(){r.startScroll(e)},n.scrollRepeatTimeout))};function zS(e,t,n){return tA-3&&(B=Le(d.target,S),_===A-2?B==="intersect"&&(b.pop(),b[b.length-1]=S):B!=="intersect"&&b.push(w)),f.newWaypoints=d.waypoints=s(d,b),p(f,O,l),f.newSegmentStartIndex=h+O,c(l)}),t.on("connectionSegment.move.hover",function(l){l.context.hover=l.hover,n.addMarker(l.hover,hg)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(l){var f=l.context.hover;f&&n.removeMarker(f,hg)}),t.on("connectionSegment.move.cleanup",function(l){var f=l.context,d=f.connection;f.draggerGfx&&be(f.draggerGfx),n.removeMarker(d,mg)}),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(l){var f=l.context,d=f.connection;d.waypoints=f.originalWaypoints,c(l)}),t.on("connectionSegment.move.end",function(l){var f=l.context,d=f.connection,h=f.newWaypoints,_=f.newSegmentStartIndex;h=h.map(function(S){return{original:S.original,x:Math.round(S.x),y:Math.round(S.y)}});var v=u(h,_),w=v.waypoints,P=s(d,w),b=v.segmentOffset,x={segmentMove:{segmentStartIndex:f.segmentStartIndex,newSegmentStartIndex:_+b}};o.updateWaypoints(d,P,x)})}Sp.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var r1=Math.abs,_g=Math.round;function xg(e,t,n){n=n===void 0?10:n;var r,i;for(r=0;ro-sf)return a-c+o}return a}function n(o,a){if(o.waypoints)return sg(a,o);if(o.width)return{x:bg(o.width/2+o.x),y:bg(o.height/2+o.y)}}function r(o){var a=o.context,s=a.snapPoints,c=a.connection,p=c.waypoints,u=a.segmentStart,l=a.segmentStartIndex,f=a.segmentEnd,d=a.segmentEndIndex,h=a.axis;if(s)return s;var _=[p[l-1],u,f,p[d+1]];return l<2&&_.unshift(n(c.source,o)),d>p.length-3&&_.unshift(n(c.target,o)),a.snapPoints=s={horizontal:[],vertical:[]},E(_,function(v){v&&(v=v.original||v,h==="y"&&s.horizontal.push(v.y),h==="x"&&s.vertical.push(v.x))}),s}e.on("connectionSegment.move.move",1500,function(o){var a=r(o),s=o.x,c=o.y,p,u;if(a){p=t(a.vertical,s),u=t(a.horizontal,c);var l=s-p,f=c-u;C(o,{dx:o.dx-l,dy:o.dy-f,x:p,y:u}),(l||a.vertical.indexOf(s)!==-1)&&Ie(o,"x",p),(f||a.horizontal.indexOf(c)!==-1)&&Ie(o,"y",u)}});function i(o){var a=o.snapPoints,s=o.connection.waypoints,c=o.bendpointIndex;if(a)return a;var p=[s[c-1],s[c+1]];return o.snapPoints=a={horizontal:[],vertical:[]},E(p,function(u){u&&(u=u.original||u,a.horizontal.push(u.y),a.vertical.push(u.x))}),a}e.on(["connect.hover","connect.move","connect.end"],1500,function(o){var a=o.context,s=a.hover,c=s&&n(s,o);!fe(s)||!c||!c.x||!c.y||(Ie(o,"x",c.x),Ie(o,"y",c.y))}),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(o){var a=o.context,s=i(a),c=a.hover,p=c&&n(c,o),u=o.x,l=o.y,f,d;if(s){f=t(p?s.vertical.concat([p.x]):s.vertical,u),d=t(p?s.horizontal.concat([p.y]):s.horizontal,l);var h=u-f,_=l-d;C(o,{dx:o.dx-h,dy:o.dy-_,x:o.x-h,y:o.y-_}),(h||s.vertical.indexOf(u)!==-1)&&Ie(o,"x",f),(_||s.horizontal.indexOf(l)!==-1)&&Ie(o,"y",d)}})}Ap.$inject=["eventBus"];var Eg={__depends__:[wt,ft],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",bp],bendpointMove:["type",Ba],bendpointMovePreview:["type",wp],connectionSegmentMove:["type",Sp],bendpointSnapping:["type",Ap]};function Mp(e,t,n,r){function i(a,s){return r.allowed("connection.create",{source:a,target:s})}function o(a,s){return i(s,a)}e.on("connect.hover",function(a){var s=a.context,c=s.start,p=a.hover,u;if(s.hover=p,u=s.canExecute=i(c,p),!Rr(u)){if(u!==!1){s.source=c,s.target=p;return}u=s.canExecute=o(c,p),!Rr(u)&&u!==!1&&(s.source=p,s.target=c)}}),e.on(["connect.out","connect.cleanup"],function(a){var s=a.context;s.hover=null,s.source=null,s.target=null,s.canExecute=!1}),e.on("connect.end",function(a){var s=a.context,c=s.canExecute,p=s.connectionStart,u={x:a.x,y:a.y},l=s.source,f=s.target;if(!c)return!1;var d=null,h={connectionStart:Tp(s)?u:p,connectionEnd:Tp(s)?p:u};Ce(c)&&(d=c),s.connection=n.connect(l,f,d,h)}),this.start=function(a,s,c,p){Ce(c)||(p=c,c=Y(s)),t.init(a,"connect",{autoActivate:p,data:{shape:s,context:{start:s,connectionStart:c}}})}}Mp.$inject=["eventBus","dragging","modeling","rules"];function Tp(e){var t=e.hover,n=e.source,r=e.target;return t&&n&&t===n&&n!==r}var o1=1100,a1=900,wg="connect-ok",Sg="connect-not-ok";function Dp(e,t,n){var r=e.get("connectionPreview",!1);r&&t.on("connect.move",function(i){var o=i.context,a=o.canExecute,s=o.hover,c=o.source,p=o.start,u=o.startPosition,l=o.target,f=o.connectionStart||u,d=o.connectionEnd||{x:i.x,y:i.y},h=f,_=d;Tp(o)&&(h=d,_=f),r.drawPreview(o,a,{source:c||p,target:l||s,connectionStart:h,connectionEnd:_})}),t.on("connect.hover",a1,function(i){var o=i.context,a=i.hover,s=o.canExecute;s!==null&&n.addMarker(a,s?wg:Sg)}),t.on(["connect.out","connect.cleanup"],o1,function(i){var o=i.hover;o&&(n.removeMarker(o,wg),n.removeMarker(o,Sg))}),r&&t.on("connect.cleanup",function(i){r.cleanUp(i.context)})}Dp.$inject=["injector","eventBus","canvas"];var So={__depends__:[qe,ft,wt],__init__:["connectPreview"],connect:["type",Mp],connectPreview:["type",Dp]};var s1="djs-dragger";function Dn(e,t,n,r){this._canvas=t,this._graphicsFactory=n,this._elementFactory=r,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}Dn.$inject=["injector","canvas","graphicsFactory","elementFactory"];Dn.prototype.drawPreview=function(e,t,n){n=n||{};var r=e.connectionPreviewGfx,i=e.getConnection,o=n.source,a=n.target,s=n.waypoints,c=n.connectionStart,p=n.connectionEnd,u=n.noLayout,l=n.noCropping,f=n.noNoop,d,h=this;if(r||(r=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),or(r),i||(i=e.getConnection=c1(function(_,v,w){return h.getConnection(_,v,w)})),t&&(d=i(t,o,a)),!d){!f&&this.drawNoopPreview(r,n);return}d.waypoints=s||[],this._layouter&&!u&&(d.waypoints=this._layouter.layoutConnection(d,{source:o,target:a,connectionStart:c,connectionEnd:p,waypoints:n.waypoints||d.waypoints})),(!d.waypoints||!d.waypoints.length)&&(d.waypoints=[o?Y(o):c,a?Y(a):p]),this._connectionDocking&&(o||a)&&!l&&(d.waypoints=this._connectionDocking.getCroppedWaypoints(d,o,a)),this._graphicsFactory.drawConnection(r,d,{stroke:"var(--element-dragger-color)"})};Dn.prototype.drawNoopPreview=function(e,t){var n=t.source,r=t.target,i=t.connectionStart||Y(n),o=t.connectionEnd||Y(r),a=this.cropWaypoints(i,o,n,r),s=this.createNoopConnection(a[0],a[1]);Z(e,s)};Dn.prototype.cropWaypoints=function(e,t,n,r){var i=this._graphicsFactory,o=n&&i.getShapePath(n),a=r&&i.getShapePath(r),s=i.getConnectionPath({waypoints:[e,t]});return e=n&&Ir(o,s,!0)||e,t=r&&Ir(a,s,!1)||t,[e,t]};Dn.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&be(e.connectionPreviewGfx)};Dn.prototype.getConnection=function(e){var t=p1(e);return this._elementFactory.createConnection(t)};Dn.prototype.createConnectionPreviewGfx=function(){var e=G("g");return $(e,{pointerEvents:"none"}),ue(e).add(s1),Z(this._canvas.getActiveLayer(),e),e};Dn.prototype.createNoopConnection=function(e,t){return jn([e,t],{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"})};function c1(e){var t={};return function(n){var r=JSON.stringify(n),i=t[r];return i||(i=t[r]=e.apply(null,arguments)),i}}function p1(e){return Ce(e)?e:{}}var Cg={__init__:["connectionPreview"],connectionPreview:["type",Dn]};var u1=new Un("ps"),l1=["marker-start","marker-mid","marker-end"],f1=["circle","ellipse","line","path","polygon","polyline","path","rect"];function qn(e,t,n,r){this._elementRegistry=e,this._canvas=n,this._styles=r}qn.$inject=["elementRegistry","eventBus","canvas","styles"];qn.prototype.cleanUp=function(){console.warn("PreviewSupport#cleanUp is deprecated and will be removed in future versions. You do not need to manually clean up previews anymore. cf. https://github.com/bpmn-io/diagram-js/pull/906")};qn.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)};qn.prototype.addDragger=function(e,t,n,r="djs-dragger"){n=n||this.getGfx(e);var i=tl(n),o=n.getBoundingClientRect();return this._cloneMarkers(Rn(i),r),$(i,this._styles.cls(r,[],{x:o.top,y:o.left})),Z(t,i),$(i,"data-preview-support-element-id",e.id),i};qn.prototype.addFrame=function(e,t){var n=G("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return Z(t,n),$(n,"data-preview-support-element-id",e.id),n};qn.prototype._cloneMarkers=function(e,t="djs-dragger",n=e){var r=this;e.childNodes&&e.childNodes.forEach(i=>{r._cloneMarkers(i,t,n)}),g1(e)&&l1.forEach(function(i){if($(e,i)){var o=d1(e,i,r._canvas.getContainer());o&&r._cloneMarker(n,e,o,i,t)}})};qn.prototype._cloneMarker=function(e,t,n,r,i="djs-dragger"){var o=[n.id,i,u1.next()].join("-"),a=me("marker#"+n.id,e);e=e||this._canvas._svg;var s=a||tl(n);s.id=o,ue(s).add(i);var c=me(":scope > defs",e);c||(c=G("defs"),Z(e,c)),Z(c,s);var p=m1(s.id);$(t,r,p)};function d1(e,t,n){var r=h1($(e,t));return me("marker#"+r,n||document)}function h1(e){return e.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]}function m1(e){return"url(#"+e+")"}function g1(e){return f1.indexOf(e.nodeName)!==-1}var xn={__init__:["previewSupport"],previewSupport:["type",qn]};var kp="complex-preview",Co=class{constructor(t,n,r){this._canvas=t,this._graphicsFactory=n,this._previewSupport=r,this._markers=[]}create(t){this.cleanUp();let{created:n=[],moved:r=[],removed:i=[],resized:o=[]}=t,a=this._canvas.getLayer(kp);n.filter(s=>!v1(s)).forEach(s=>{let c;fe(s)?(c=this._graphicsFactory._createContainer("connection",G("g")),this._graphicsFactory.drawConnection(Rn(c),s)):(c=this._graphicsFactory._createContainer("shape",G("g")),this._graphicsFactory.drawShape(Rn(c),s),ke(c,s.x,s.y)),this._previewSupport.addDragger(s,a,c)}),r.forEach(({element:s,delta:c})=>{this._previewSupport.addDragger(s,a,void 0,"djs-dragging"),this._canvas.addMarker(s,"djs-element-hidden"),this._markers.push([s,"djs-element-hidden"]);let p=this._previewSupport.addDragger(s,a);fe(s)?ke(p,c.x,c.y):ke(p,s.x+c.x,s.y+c.y)}),i.forEach(s=>{this._previewSupport.addDragger(s,a,void 0,"djs-dragging"),this._canvas.addMarker(s,"djs-element-hidden"),this._markers.push([s,"djs-element-hidden"])}),o.forEach(({shape:s,bounds:c})=>{this._canvas.addMarker(s,"djs-hidden"),this._markers.push([s,"djs-hidden"]),this._previewSupport.addDragger(s,a,void 0,"djs-dragging");let p=this._graphicsFactory._createContainer("shape",G("g"));this._graphicsFactory.drawShape(Rn(p),s,{width:c.width,height:c.height}),ke(p,c.x,c.y),this._previewSupport.addDragger(s,a,p)})}cleanUp(){or(this._canvas.getLayer(kp)),this._markers.forEach(([t,n])=>this._canvas.removeMarker(t,n)),this._markers=[]}show(){this._canvas.showLayer(kp)}hide(){this._canvas.hideLayer(kp)}};Co.$inject=["canvas","graphicsFactory","previewSupport"];function v1(e){return e.hidden}var Rg={__depends__:[xn],__init__:["complexPreview"],complexPreview:["type",Co]};var cf=["top","bottom","left","right"],Op=10;function La(e,t){k.call(this,e),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],function(i){var o=i.context,a=o.connection,s=a.source,c=a.target,p=o.hints||{};p.createElementsBehavior!==!1&&(n(s),n(c))}),this.postExecuted(["label.create"],function(i){var o=i.context,a=o.shape,s=o.hints||{};s.createElementsBehavior!==!1&&n(a.labelTarget)}),this.postExecuted(["elements.create"],function(i){var o=i.context,a=o.elements,s=o.hints||{};s.createElementsBehavior!==!1&&a.forEach(function(c){n(c)})});function n(i){if(Fr(i)&&!fe(i)){var o=x1(i);o&&r(i,o)}}function r(i,o){var a=Y(i),s=i.label,c=Y(s);if(s.parent){var p=X(i),u;switch(o){case"top":u={x:a.x,y:p.top-Op-s.height/2};break;case"left":u={x:p.left-Op-s.width/2,y:a.y};break;case"bottom":u={x:a.x,y:p.bottom+Op+s.height/2};break;case"right":u={x:p.right+Op+s.width/2,y:a.y};break}var l=Et(u,c);t.moveShape(s,l)}}}N(La,k);La.$inject=["eventBus","modeling"];function y1(e){var t=e.host,n=Y(e),r=Le(n,t),i;r.indexOf("-")>=0?i=r.split("-"):i=[r];var o=cf.filter(function(a){return i.indexOf(a)===-1});return o}function _1(e){var t=Y(e),n=[].concat(e.incoming.map(function(r){return r.waypoints[r.waypoints.length-2]}),e.outgoing.map(function(r){return r.waypoints[1]})).map(function(r){return Pg(t,r)});return n}function x1(e){var t=Y(e.label),n=Y(e),r=Pg(n,t);if(b1(r)){var i=_1(e);if(e.host){var o=y1(e);i=i.concat(o)}var a=cf.filter(function(s){return i.indexOf(s)===-1});if(a.indexOf(r)===-1)return a[0]}}function Pg(e,t){return Le(t,e,5)}function b1(e){return cf.indexOf(e)!==-1}function ja(e){k.call(this,e),this.preExecute("shape.append",function(t){var n=t.source,r=t.shape;t.position||(m(r,"bpmn:TextAnnotation")?t.position={x:n.x+n.width/2+75,y:n.y-50-r.height/2}:t.position={x:n.x+n.width+80+r.width/2,y:n.y+n.height/2})},!0)}N(ja,k);ja.$inject=["eventBus"];function Fa(e,t){e.invoke(k,this),this.postExecute("shape.move",function(n){var r=n.newParent,i=n.shape,o=J(i.incoming.concat(i.outgoing),function(a){return m(a,"bpmn:Association")});E(o,function(a){t.moveConnection(a,{x:0,y:0},r)})},!0)}N(Fa,k);Fa.$inject=["injector","modeling"];var Ag=500;function Ro(e,t){t.invoke(k,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",Ag,function(r){var i=r.elements;i=i.filter(function(o){var a=o.host;return Tg(o,a)}),i.length===1&&i.map(function(o){return i.indexOf(o)}).forEach(function(o){var a=i[o];r.elements[o]=n._replaceShape(i[o],a)})},!0),this.preExecute("elements.move",Ag,function(r){var i=r.shapes,o=r.newHost;if(i.length===1){var a=i[0];Tg(a,o)&&(r.shapes=[n._replaceShape(a,o)])}},!0)}Ro.$inject=["bpmnReplace","injector"];N(Ro,k);Ro.prototype._replaceShape=function(e,t){var n=E1(e),r={type:"bpmn:BoundaryEvent",host:t};return n&&(r.eventDefinitionType=n.$type),this._bpmnReplace.replaceElement(e,r,{layoutConnection:!1})};function E1(e){var t=L(e),n=t.eventDefinitions;return n&&n[0]}function Tg(e,t){return!te(e)&&Q(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}function Ha(e,t){k.call(this,e);function n(r){return J(r.attachers,function(i){return m(i,"bpmn:BoundaryEvent")})}this.postExecute("connection.create",function(r){var i=r.context.source,o=r.context.target,a=n(o);m(i,"bpmn:EventBasedGateway")&&m(o,"bpmn:ReceiveTask")&&a.length>0&&t.removeElements(a)}),this.postExecute("connection.reconnect",function(r){var i=r.context.oldSource,o=r.context.newSource;m(i,"bpmn:Gateway")&&m(o,"bpmn:EventBasedGateway")&&E(o.outgoing,function(a){var s=a.target,c=n(s);m(s,"bpmn:ReceiveTask")&&c.length>0&&t.removeElements(c)})})}Ha.$inject=["eventBus","modeling"];N(Ha,k);function za(e,t,n){k.call(this,e),this.preExecute("shape.replace",s,!0),this.postExecuted("shape.replace",c,!0),this.preExecute("connection.create",i,!0),this.postExecuted("connection.delete",r,!0),this.postExecuted("connection.reconnect",o,!0),this.postExecuted("element.updateProperties",a,!0);function r(v){let w=v.source,P=v.target;Po(w)&&$a(P)&&u(P)}function i(v){let w=v.connection,P=v.source,b=v.target;Po(P)&&Np(b)&&(p(b),f(P,[w]))}function o(v){let w=v.newTarget,P=v.oldSource,b=v.oldTarget;if(b!==w){let x=P;$a(b)&&u(b),Po(x)&&Np(w)&&p(w)}}function a(v){let{element:w}=v;$a(w)?(l(w),d(w)):Np(w)&&h(w)}function s(v){let{newData:w,oldShape:P}=v;if(Po(v.oldShape)&&w.eventDefinitionType!=="bpmn:CompensateEventDefinition"||w.type!=="bpmn:BoundaryEvent"){let b=P.outgoing.find(({target:x})=>$a(x));b&&b.target&&(v._connectionTarget=b.target)}else if(!Po(v.oldShape)&&w.eventDefinitionType==="bpmn:CompensateEventDefinition"&&w.type==="bpmn:BoundaryEvent"){let b=P.outgoing.find(({target:x})=>Np(x));b&&b.target&&(v._connectionTarget=b.target),_(P)}}function c(v){let{_connectionTarget:w,newShape:P}=v;w&&t.connect(P,w)}function p(v){t.updateProperties(v,{isForCompensation:!0})}function u(v){t.updateProperties(v,{isForCompensation:void 0})}function l(v){for(let w of v.incoming)n.canConnect(w.source,v)||t.removeConnection(w);for(let w of v.outgoing)n.canConnect(v,w.target)||t.removeConnection(w)}function f(v,w){v.outgoing.filter(x=>m(x,"bpmn:Association")).filter(x=>$a(x.target)&&!w.includes(x)).forEach(x=>t.removeConnection(x))}function d(v){let w=v.attachers.slice();w.length&&t.removeElements(w)}function h(v){let w=v.incoming.filter(P=>Po(P.source));t.removeElements(w)}function _(v){let w=v.outgoing.filter(P=>m(P,"bpmn:SequenceFlow"));t.removeElements(w)}}N(za,k);za.$inject=["eventBus","modeling","bpmnRules"];function $a(e){let t=L(e);return t&&t.get("isForCompensation")}function Po(e){return e&&m(e,"bpmn:BoundaryEvent")&&cr(e,"bpmn:CompensateEventDefinition")}function Np(e){return e&&m(e,"bpmn:Activity")&&!Ue(e)}function Va(e){e.invoke(k,this),this.preExecute("shape.create",1500,function(t){var n=t.context,r=n.parent,i=n.shape;m(r,"bpmn:Lane")&&!m(i,"bpmn:Lane")&&(n.parent=yr(r,"bpmn:Participant"))})}Va.$inject=["injector"];N(Va,k);function Wa(e,t){k.call(this,e),this.preExecute("shape.create",function(n){var a;var r=n.context,i=r.shape;if(m(i,"bpmn:DataObjectReference")&&i.type!=="label"){var o=t.create("bpmn:DataObject");o.isCollection=((a=i.businessObject.dataObjectRef)==null?void 0:a.isCollection)||!1,i.businessObject.dataObjectRef=o}})}Wa.$inject=["eventBus","bpmnFactory"];N(Wa,k);var pf=20,uf=20,Mg=30,Bp=2e3;function Ga(e,t,n){k.call(this,t),t.on(["create.start","shape.move.start"],Bp,function(i){var o=i.context,a=o.shape,s=e.getRootElement();if(!(!m(a,"bpmn:Participant")||!m(s,"bpmn:Process")||!s.children.length)){var c=s.children.filter(function(l){return!m(l,"bpmn:Group")&&!te(l)&&!fe(l)});if(c.length){var p=Ee(c),u=w1(a,p);C(a,u),o.createConstraints=S1(a,p)}}}),t.on("create.start",Bp,function(i){var o=i.context,a=o.shape,s=e.getRootElement(),c=e.getGraphics(s);function p(u){u.element=s,u.gfx=c}m(a,"bpmn:Participant")&&m(s,"bpmn:Process")&&(t.on("element.hover",Bp,p),t.once("create.cleanup",function(){t.off("element.hover",p)}))});function r(){var i=e.getRootElement();return m(i,"bpmn:Collaboration")?i:n.makeCollaboration()}this.preExecute("elements.create",Bp,function(i){var o=i.elements,a=i.parent,s=C1(o),c;s&&m(a,"bpmn:Process")&&(i.parent=r(),c=i.hints=i.hints||{},c.participant=s,c.process=a,c.processRef=L(s).get("processRef"))},!0),this.preExecute("shape.create",function(i){var o=i.parent,a=i.shape;m(a,"bpmn:Participant")&&m(o,"bpmn:Process")&&(i.parent=r(),i.process=o,i.processRef=L(a).get("processRef"))},!0),this.execute("shape.create",function(i){var o=i.hints||{},a=i.process||o.process,s=i.shape,c=o.participant;a&&(!c||s===c)&&L(s).set("processRef",L(a))},!0),this.revert("shape.create",function(i){var o=i.hints||{},a=i.process||o.process,s=i.processRef||o.processRef,c=i.shape,p=o.participant;a&&(!p||c===p)&&L(c).set("processRef",s)},!0),this.postExecute("shape.create",function(i){var o=i.hints||{},a=i.process||i.hints.process,s=i.shape,c=o.participant;if(a){var p=a.children.slice();c?s===c&&n.moveElements(p,{x:0,y:0},c):n.moveElements(p,{x:0,y:0},s)}},!0)}Ga.$inject=["canvas","eventBus","modeling"];N(Ga,k);function w1(e,t){t={width:t.width+pf*2+Mg,height:t.height+uf*2};var n=Math.max(e.width,t.width),r=Math.max(e.height,t.height);return{x:-n/2,y:-r/2,width:n,height:r}}function S1(e,t){return t=X(t),{bottom:t.top+e.height/2-uf,left:t.right-e.width/2+pf,top:t.bottom-e.height/2+uf,right:t.left+e.width/2-pf-Mg}}function C1(e){return ne(e,function(t){return m(t,"bpmn:Participant")})}var Dg="__targetRef_placeholder";function Ua(e,t){k.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],kg(o)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],kg(o));function n(a,s,c){var p=a.get("dataInputAssociations");return ne(p,function(u){return u!==c&&u.targetRef===s})}function r(a,s){var c=a.get("properties"),p=ne(c,function(u){return u.name===Dg});return!p&&s&&(p=t.create("bpmn:Property",{name:Dg}),we(c,p)),p}function i(a,s){var c=r(a);c&&(n(a,c,s)||Te(a.get("properties"),c))}function o(a){var s=a.context,c=s.connection,p=c.businessObject,u=c.target,l=u&&u.businessObject,f=s.newTarget,d=f&&f.businessObject,h=s.oldTarget||s.target,_=h&&h.businessObject,v=c.businessObject,w;_&&_!==l&&i(_,p),d&&d!==l&&i(d,p),l?(w=r(l,!0),v.targetRef=w):v.targetRef=null}}Ua.$inject=["eventBus","bpmnFactory"];N(Ua,k);function kg(e){return function(t){var n=t.context,r=n.connection;if(m(r,"bpmn:DataInputAssociation"))return e(t)}}function Ao(e){this._bpmnUpdater=e}Ao.$inject=["bpmnUpdater"];Ao.prototype.execute=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,r=e.newSemanticParent,i=e.newDiParent;return e.oldSemanticParent=t.$parent,e.oldDiParent=n.$parent,this._bpmnUpdater.updateSemanticParent(t,r),this._bpmnUpdater.updateDiParent(n,i),[]};Ao.prototype.revert=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,r=e.oldSemanticParent,i=e.oldDiParent;return this._bpmnUpdater.updateSemanticParent(t,r),this._bpmnUpdater.updateDiParent(n,i),[]};function Ka(e,t,n,r){k.call(this,r),t.registerHandler("dataStore.updateContainment",Ao);function i(){return n.filter(function(s){return m(s,"bpmn:Participant")&&L(s).processRef})[0]}function o(s){return s.children.filter(function(c){return m(c,"bpmn:DataStoreReference")&&!c.labelTarget})}function a(s,c){var p=s.businessObject||s;if(c=c||i(),c){var u=c.businessObject||c;t.execute("dataStore.updateContainment",{dataStoreBo:p,dataStoreDi:se(s),newSemanticParent:u.processRef||u,newDiParent:se(c)})}}this.preExecute("shape.create",function(s){var c=s.context,p=c.shape;m(p,"bpmn:DataStoreReference")&&p.type!=="label"&&(c.hints||(c.hints={}),c.hints.autoResize=!1)}),this.preExecute("elements.move",function(s){var c=s.context,p=c.shapes,u=p.filter(function(l){return m(l,"bpmn:DataStoreReference")});u.length&&(c.hints||(c.hints={}),c.hints.autoResize=p.filter(function(l){return!m(l,"bpmn:DataStoreReference")}))}),this.postExecute("shape.create",function(s){var c=s.context,p=c.shape,u=p.parent;m(p,"bpmn:DataStoreReference")&&p.type!=="label"&&m(u,"bpmn:Collaboration")&&a(p)}),this.postExecute("shape.move",function(s){var c=s.context,p=c.shape,u=c.oldParent,l=p.parent;if(!m(u,"bpmn:Collaboration")&&m(p,"bpmn:DataStoreReference")&&p.type!=="label"&&m(l,"bpmn:Collaboration")){var f=m(u,"bpmn:Participant")?u:P1(u,"bpmn:Participant");a(p,f)}}),this.postExecute("shape.delete",function(s){var c=s.context,p=c.shape,u=e.getRootElement();Q(p,["bpmn:Participant","bpmn:SubProcess"])&&m(u,"bpmn:Collaboration")&&o(u).filter(function(l){return R1(l,p)}).forEach(function(l){a(l)})}),this.postExecute("canvas.updateRoot",function(s){var c=s.context,p=c.oldRoot,u=c.newRoot,l=o(p);l.forEach(function(f){m(u,"bpmn:Process")&&a(f,u)})})}Ka.$inject=["canvas","commandStack","elementRegistry","eventBus"];N(Ka,k);function R1(e,t){for(var n=e.businessObject||e,r=t.businessObject||t;n.$parent;){if(n.$parent===r.processRef||r)return!0;n=n.$parent}return!1}function P1(e,t){for(;e.parent;){if(m(e.parent,t))return e.parent;e=e.parent}}var Lp=Math.max,jp=Math.min,A1=20;function Fp(e,t){return{top:e.top-t.top,right:e.right-t.right,bottom:e.bottom-t.bottom,left:e.left-t.left}}function Og(e,t,n){var r=n.x,i=n.y,o={x:e.x,y:e.y,width:e.width,height:e.height};return t.indexOf("n")!==-1?(o.y=e.y+i,o.height=e.height-i):t.indexOf("s")!==-1&&(o.height=e.height+i),t.indexOf("e")!==-1?o.width=e.width+r:t.indexOf("w")!==-1&&(o.x=e.x+r,o.width=e.width-r),o}function Ng(e,t){return{x:e.x+(t.left||0),y:e.y+(t.top||0),width:e.width-(t.left||0)+(t.right||0),height:e.height-(t.top||0)+(t.bottom||0)}}function Ip(e,t,n){var r=t[e],i=n.min&&n.min[e],o=n.max&&n.max[e];return ee(i)&&(r=(/top|left/.test(e)?jp:Lp)(r,i)),ee(o)&&(r=(/top|left/.test(e)?Lp:jp)(r,o)),r}function Bg(e,t){if(!t)return e;var n=X(e);return ui({top:Ip("top",n,t),right:Ip("right",n,t),bottom:Ip("bottom",n,t),left:Ip("left",n,t)})}function Ig(e,t,n,r){var i=X(t),o={top:/n/.test(e)?i.bottom-n.height:i.top,left:/w/.test(e)?i.right-n.width:i.left,bottom:/s/.test(e)?i.top+n.height:i.bottom,right:/e/.test(e)?i.left+n.width:i.right},a=r?X(r):o,s={top:jp(o.top,a.top),left:jp(o.left,a.left),bottom:Lp(o.bottom,a.bottom),right:Lp(o.right,a.right)};return ui(s)}function Ya(e,t){return typeof e!="undefined"?e:A1}function T1(e,t){var n,r,i,o;return typeof t=="object"?(n=Ya(t.left),r=Ya(t.right),i=Ya(t.top),o=Ya(t.bottom)):n=r=i=o=Ya(t),{x:e.x-n,y:e.y-i,width:e.width+n+r,height:e.height+i+o}}function M1(e){return!(e.waypoints||e.type==="label")}function Hp(e,t){var n;if(e.length===void 0?n=J(e.children,M1):n=e,n.length)return T1(Ee(n),t)}var Xr=Math.abs;function D1(e,t){return Fp(X(t),X(e))}var k1=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],Yt=30;function To(e,t){return t=t||[],e.children.filter(function(n){m(n,"bpmn:Lane")&&(To(n,t),t.push(n))}),t}function cn(e){return e.children.filter(function(t){return m(t,"bpmn:Lane")})}function Rt(e){return yr(e,k1)||e}function Lg(e,t){var n=Rt(e),r=m(n,"bpmn:Process")?[]:[n],i=To(n,r),o=X(e),a=X(t),s=D1(e,t),c=[],p=Re(e);return i.forEach(function(u){if(u!==e){var l=p?0:s.top,f=p?s.right:0,d=p?0:s.bottom,h=p?s.left:0,_=X(u);s.top&&(Xr(_.bottom-o.top)<10&&(d=a.top-_.bottom),Xr(_.top-o.top)<5&&(l=a.top-_.top)),s.left&&(Xr(_.right-o.left)<10&&(f=a.left-_.right),Xr(_.left-o.left)<5&&(h=a.left-_.left)),s.bottom&&(Xr(_.top-o.bottom)<10&&(l=a.bottom-_.top),Xr(_.bottom-o.bottom)<5&&(d=a.bottom-_.bottom)),s.right&&(Xr(_.left-o.right)<10&&(h=a.right-_.left),Xr(_.right-o.right)<5&&(f=a.right-_.right)),(l||f||d||h)&&c.push({shape:u,newBounds:Ng(u,{top:l,right:f,bottom:d,left:h})})}}),c}var O1=500;function qa(e,t){k.call(this,e);function n(r,i){var o=Re(r),a=cn(i),s=[],c=[],p=[],u=[];if(Cn(a,function(v){return o?v.y>r.y?c.push(v):s.push(v):v.x>r.x?u.push(v):p.push(v),v.children}),!!a.length){var l;o?c.length&&s.length?l=r.height/2:l=r.height:u.length&&p.length?l=r.width/2:l=r.width;var f,d,h,_;s.length&&(f=t.calculateAdjustments(s,"y",l,r.y-10),t.makeSpace(f.movingShapes,f.resizingShapes,{x:0,y:l},"s")),c.length&&(d=t.calculateAdjustments(c,"y",-l,r.y+r.height+10),t.makeSpace(d.movingShapes,d.resizingShapes,{x:0,y:-l},"n")),p.length&&(h=t.calculateAdjustments(p,"x",l,r.x-10),t.makeSpace(h.movingShapes,h.resizingShapes,{x:l,y:0},"e")),u.length&&(_=t.calculateAdjustments(u,"x",-l,r.x+r.width+10),t.makeSpace(_.movingShapes,_.resizingShapes,{x:-l,y:0},"w"))}}this.postExecuted("shape.delete",O1,function(r){var i=r.context,o=i.hints,a=i.shape,s=i.oldParent;m(a,"bpmn:Lane")&&(o&&o.nested||n(a,s))})}qa.$inject=["eventBus","spaceTool"];N(qa,k);var jg=500;function Mo(e,t){t.invoke(k,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",jg,function(r){var i=r.elements;i.filter(function(o){var a=o.host;return Fg(o,a)}).map(function(o){return i.indexOf(o)}).forEach(function(o){r.elements[o]=n._replaceShape(i[o])})},!0),this.preExecute("elements.move",jg,function(r){var i=r.shapes,o=r.newHost;i.forEach(function(a,s){var c=a.host;Fg(a,B1(i,c)?c:o)&&(i[s]=n._replaceShape(a))})},!0)}Mo.$inject=["bpmnReplace","injector"];N(Mo,k);Mo.prototype._replaceShape=function(e){var t=N1(e),n;return t?n={type:"bpmn:IntermediateCatchEvent",eventDefinitionType:t.$type}:n={type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,n,{layoutConnection:!1})};function N1(e){var t=L(e),n=t.eventDefinitions;return n&&n[0]}function Fg(e,t){return!te(e)&&m(e,"bpmn:BoundaryEvent")&&!t}function B1(e,t){return e.indexOf(t)!==-1}function Xa(e,t,n){k.call(this,e);function r(i,o,a){var s=o.waypoints,c,p,u,l,f,d,h,_=i.outgoing.slice(),v=i.incoming.slice(),w;ee(a.width)?w=Y(a):w=a;var P=Ta(s,w);if(P){if(c=s.slice(0,P.index),p=s.slice(P.index+(P.bendpoint?1:0)),!c.length||!p.length)return;u=P.bendpoint?s[P.index]:w,(c.length===1||!Hg(i,c[c.length-1]))&&c.push($g(u)),(p.length===1||!Hg(i,p[0]))&&p.unshift($g(u))}l=o.source,f=o.target,t.canConnect(l,i,o)&&(n.reconnectEnd(o,i,c||w),d=o),t.canConnect(i,f,o)&&(d?h=n.connect(i,f,{type:o.type,waypoints:p}):(n.reconnectStart(o,i,p||w),h=o));var b=[].concat(d&&J(v,function(x){return x.source===d.source})||[],h&&J(_,function(x){return x.target===h.target})||[]);b.length&&n.removeElements(b)}this.preExecute("elements.move",function(i){var o=i.newParent,a=i.shapes,s=i.delta,c=a[0];if(!(!c||!o)){o&&o.waypoints&&(i.newParent=o=o.parent);var p=Y(c),u={x:p.x+s.x,y:p.y+s.y},l=ne(o.children,function(f){var d=t.canInsert(a,f);return d&&Ta(f.waypoints,u)});l&&(i.targetFlow=l,i.position=u)}},!0),this.postExecuted("elements.move",function(i){var o=i.shapes,a=i.targetFlow,s=i.position;a&&r(o[0],a,s)},!0),this.preExecute("shape.create",function(i){var o=i.parent,a=i.shape;t.canInsert(a,o)&&(i.targetFlow=o,i.parent=o.parent)},!0),this.postExecuted("shape.create",function(i){var o=i.shape,a=i.targetFlow,s=i.position;a&&r(o,a,s)},!0)}N(Xa,k);Xa.$inject=["eventBus","bpmnRules","modeling"];function Hg(e,t){var n=t.x,r=t.y;return n>=e.x&&n<=e.x+e.width&&r>=e.y&&r<=e.y+e.height}function $g(e){return C({},e)}function Za(e,t){k.call(this,e),this.preExecuted("connection.create",function(n){var r=n.context,i=r.connection,o=r.source,a=r.target,s=r.hints;if(!(s&&s.createElementsBehavior===!1)&&Do(i)){var c=[];m(o,"bpmn:EventBasedGateway")?c=a.incoming.filter(p=>p!==i&&Do(p)):c=a.incoming.filter(p=>p!==i&&Do(p)&&m(p.source,"bpmn:EventBasedGateway")),c.forEach(function(p){t.removeConnection(p)})}}),this.preExecuted("shape.replace",function(n){var r=n.context,i=r.newShape;if(m(i,"bpmn:EventBasedGateway")){var o=i.outgoing.filter(Do).reduce(function(a,s){return a.includes(s.target)?a:a.concat(s.target)},[]);o.forEach(function(a){a.incoming.filter(Do).forEach(function(s){let c=a.incoming.filter(Do).filter(function(p){return p.source===i});(s.source!==i||c.length>1)&&t.removeConnection(s)})})}})}Za.$inject=["eventBus","modeling"];N(Za,k);function Do(e){return m(e,"bpmn:SequenceFlow")}var $p=1500,zg=2e3;function zp(e,t,n){t.on(["create.hover","create.move","create.out","create.end","shape.move.hover","shape.move.move","shape.move.out","shape.move.end"],$p,function(r){var i=r.context,o=i.shape||r.shape,a=r.hover;m(a,"bpmn:Lane")&&!Q(o,["bpmn:Lane","bpmn:Participant"])&&(r.hover=Rt(a),r.hoverGfx=e.getGraphics(r.hover));var s=n.getRootElement();a!==s&&(o.labelTarget||Q(o,["bpmn:Group","bpmn:TextAnnotation"]))&&(r.hover=s,r.hoverGfx=e.getGraphics(r.hover))}),t.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],$p,function(r){var i=r.hover;m(i,"bpmn:Lane")&&(r.hover=Rt(i)||i,r.hoverGfx=e.getGraphics(r.hover))}),t.on(["bendpoint.move.hover"],$p,function(r){var i=r.context,o=r.hover,a=i.type;m(o,"bpmn:Lane")&&/reconnect/.test(a)&&(r.hover=Rt(o)||o,r.hoverGfx=e.getGraphics(r.hover))}),t.on(["connect.start"],$p,function(r){var i=r.context,o=i.start;m(o,"bpmn:Lane")&&(i.start=Rt(o)||o)}),t.on("shape.move.start",zg,function(r){var i=r.shape;m(i,"bpmn:Lane")&&(r.shape=Rt(i)||i)}),t.on("spaceTool.move",zg,function(r){var i=r.hover;i&&m(i,"bpmn:Lane")&&(r.hover=Rt(i))})}zp.$inject=["elementRegistry","eventBus","canvas"];function Vg(e){return e.create("bpmn:Category")}function Wg(e){return e.create("bpmn:CategoryValue")}function Gg(e,t,n){return we(t.get("categoryValue"),e),e.$parent=t,we(n.get("rootElements"),t),t.$parent=n,e}function Ug(e){var t=e.$parent;return t&&(Te(t.get("categoryValue"),e),e.$parent=null),e}function Kg(e){var t=e.$parent;return t&&(Te(t.get("rootElements"),e),e.$parent=null),e}var Yg=770;function Qa(e,t,n,r,i,o){i.invoke(k,this);function a(){return n.filter(function(h){return m(h,"bpmn:Group")})}function s(h,_){return h.some(function(v){var w=L(v),P=w.categoryValueRef&&w.categoryValueRef.$parent;return P===_})}function c(h,_){return h.some(function(v){var w=L(v);return w.categoryValueRef===_})}function p(h,_,v){var w=a().filter(function(P){return P.businessObject!==v});_&&!s(w,_)&&Kg(_),h&&!c(w,h)&&Ug(h)}function u(h,_){return Gg(h,_,t.getDefinitions())}function l(h,_){var v=L(h),w=v.categoryValueRef;w||(w=v.categoryValueRef=_.categoryValue=_.categoryValue||Wg(e));var P=w.$parent;P||(P=w.$parent=_.category=_.category||Vg(e)),u(w,P,t.getDefinitions())}function f(h,_){var v=_.category,w=_.categoryValue,P=L(h);w?(P.categoryValueRef=null,p(w,v,P)):p(null,P.categoryValueRef.$parent,P)}this.execute("label.create",function(h){var _=h.context,v=_.labelTarget;m(v,"bpmn:Group")&&l(v,_)}),this.revert("label.create",function(h){var _=h.context,v=_.labelTarget;m(v,"bpmn:Group")&&f(v,_)}),this.execute("shape.delete",function(h){var _=h.context,v=_.shape,w=L(v);if(!(!m(v,"bpmn:Group")||v.labelTarget)){var P=_.categoryValue=w.categoryValueRef,b;P&&(b=_.category=P.$parent,p(P,b,w),w.categoryValueRef=null)}}),this.reverted("shape.delete",function(h){var _=h.context,v=_.shape;if(!(!m(v,"bpmn:Group")||v.labelTarget)){var w=_.category,P=_.categoryValue,b=L(v);P&&(b.categoryValueRef=P,u(P,w))}}),this.execute("shape.create",function(h){var _=h.context,v=_.shape;!m(v,"bpmn:Group")||v.labelTarget||L(v).categoryValueRef&&l(v,_)}),this.reverted("shape.create",function(h){var _=h.context,v=_.shape;!m(v,"bpmn:Group")||v.labelTarget||L(v).categoryValueRef&&f(v,_)});function d(h,_){var v=e.create(h.$type);return o.copyElement(h,v,null,_)}r.on("copyPaste.copyElement",Yg,function(h){var _=h.descriptor,v=h.element;if(!(!m(v,"bpmn:Group")||v.labelTarget)){var w=L(v);if(w.categoryValueRef){var P=w.categoryValueRef;_.categoryValue=d(P,!0),P.$parent&&(_.category=d(P.$parent,!0))}}}),r.on("copyPaste.pasteElement",Yg,function(h){var _=h.descriptor,v=_.businessObject,w=_.categoryValue,P=_.category;w&&(w=v.categoryValueRef=d(w)),P&&(w.$parent=d(P)),delete _.category,delete _.categoryValue})}Qa.$inject=["bpmnFactory","bpmnjs","elementRegistry","eventBus","injector","moddleCopy"];N(Qa,k);function ko(e,t,n,r){var i,o,a,s,c;return i=(r.y-n.y)*(t.x-e.x)-(r.x-n.x)*(t.y-e.y),i==0?null:(o=e.y-n.y,a=e.x-n.x,c=(r.x-n.x)*o-(r.y-n.y)*a,s=c/i,{x:Math.round(e.x+s*(t.x-e.x)),y:Math.round(e.y+s*(t.y-e.y))})}function Vp(e){function t(r,i,o){var a={x:o.x,y:o.y-50},s={x:o.x-50,y:o.y},c=ko(r,i,o,a),p=ko(r,i,o,s),u;c&&p?qg(c,o)>qg(p,o)?u=p:u=c:u=c||p,r.original=u}function n(r){var i=r.waypoints;t(i[0],i[1],Y(r.source)),t(i[i.length-1],i[i.length-2],Y(r.target))}e.on("bpmnElement.added",function(r){var i=r.element;i.waypoints&&n(i)})}Vp.$inject=["eventBus"];function qg(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Ja(e){k.call(this,e);var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],function(n){var r=n.context.shape,i=L(r),o=se(r);if(Q(i,t)){var a=o.get("isHorizontal");a===void 0&&(a=!0),o.set("isHorizontal",a)}})}Ja.$inject=["eventBus"];N(Ja,k);var ev=Math.sqrt,tv=Math.min,I1=Math.max,Xg=Math.abs;function Zg(e){return Math.pow(e,2)}function es(e,t){return ev(Zg(e.x-t.x)+Zg(e.y-t.y))}function nv(e,t){var n=0,r,i,o,a,s,c,p,u,l,f,d;for(n=0;n line intersections");p.length===1&&(u={type:"bendpoint",position:p[0],segmentIndex:n,bendpointIndex:Jg(r,p[0])?n:n+1}),p.length===2&&(s=F1(p[0],p[1]),u={type:"segment",position:s,segmentIndex:n,relativeLocation:es(r,s)/es(r,i)}),l=es(u.position,e),(!d||f>l)&&(d=u,f=l)}return d}function L1(e,t,n,r){var i=t.x-e.x,o=t.y-e.y,a=n.x-e.x,s=n.y-e.y,c=i*i+o*o,p=i*a+o*s,u=a*a+s*s-r*r,l=p/c,f=u/c,d=l*l-f;if(d<0&&d>-1e-6&&(d=0),d<0)return[];var h=ev(d),_=-l+h,v=-l-h,w={x:e.x-i*_,y:e.y-o*_};if(d===0)return[w];var P={x:e.x-i*v,y:e.y-o*v};return[w,P].filter(function(b){return j1(b,e,t)})}function j1(e,t,n){return Qg(e.x,t.x,n.x)&&Qg(e.y,t.y,n.y)}function Qg(e,t,n){return e>=tv(t,n)-Wp&&e<=I1(t,n)+Wp}function F1(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}var Wp=.1;function Jg(e,t){return Xg(e.x-t.x)<=Wp&&Xg(e.y-t.y)<=Wp}function iv(e,t,n,r){var i=n.segmentIndex,o=t.length-e.length;if(r.segmentMove){var a=r.segmentMove.segmentStartIndex,s=r.segmentMove.newSegmentStartIndex;return i===a?s:i>=s?i+o=p&&(u=c?i+1:i-1),it.length-2||p===null)return a;var u=rv(n,c),l=rv(t,p),f=s.position,d=$1(u,f),h=H1(u,l);if(s.type==="bendpoint"){var _=t.length-n.length,v=s.bendpointIndex,w=n[v];if(t.indexOf(w)!==-1)return a;if(_===0){var P=t[v];return i=P.x-s.position.x,o=P.y-s.position.y,{delta:{x:i,y:o},point:{x:e.x+i,y:e.y+o}}}_<0&&v!==0&&v{L(a.context.element)===a.context.moddleElement&&i(a)});function i(a){var s=a.context,c=s.element,p=s.properties;if(sv in p&&t.updateLabel(c,p[sv]),cv in p&&m(c,"bpmn:TextAnnotation")){var u=r.getTextAnnotationBounds({x:c.x,y:c.y,width:c.width,height:c.height},p[cv]||"");t.updateLabel(c,p.text,u)}}this.postExecute(["shape.create","connection.create"],function(a){var s=a.context,c=s.hints||{};if(c.createElementsBehavior!==!1){var p=s.shape||s.connection;te(p)||!nn(p)||xt(p)&&t.updateLabel(p,xt(p))}}),this.postExecute("shape.delete",function(a){var s=a.context,c=s.labelTarget,p=s.hints||{};c&&p.unsetLabel!==!1&&t.updateLabel(c,null,null,{removeShape:!1})});function o(a){var s=a.context,c=s.connection,p=c.label,u=C({},s.hints),l=s.newWaypoints||c.waypoints,f=s.oldWaypoints;return typeof u.startChanged=="undefined"&&(u.startChanged=!!u.connectionStart),typeof u.endChanged=="undefined"&&(u.endChanged=!!u.connectionEnd),av(p,l,f,u)}this.postExecute(["connection.layout","connection.updateWaypoints"],function(a){var s=a.context,c=s.hints||{};if(c.labelBehavior!==!1){var p=s.connection,u=p.label,l;!u||!u.parent||(l=o(a),t.moveShape(u,l))}}),this.postExecute(["shape.replace"],function(a){var s=a.context,c=s.newShape,p=s.oldShape,u=L(c);u&&nn(u)&&p.label&&c.label&&(c.label.x=p.label.x,c.label.y=p.label.y)}),this.postExecute("shape.resize",function(a){var s=a.context,c=s.shape,p=s.newBounds,u=s.oldBounds;if(Fr(c)){var l=c.label,f=Y(l),d=Y1(u),h=K1(f,d),_=U1(h,u,p);t.moveShape(l,_)}})}N(ts,k);ts.$inject=["eventBus","modeling","bpmnFactory","textRenderer"];function U1(e,t,n){var r=Si(e,t,n);return gn(Et(r,e))}function K1(e,t){if(t.length){var n=q1(e,t);return Ma(e,n)}}function Y1(e){return[[{x:e.x,y:e.y},{x:e.x+(e.width||0),y:e.y}],[{x:e.x+(e.width||0),y:e.y},{x:e.x+(e.width||0),y:e.y+(e.height||0)}],[{x:e.x,y:e.y+(e.height||0)},{x:e.x+(e.width||0),y:e.y+(e.height||0)}],[{x:e.x,y:e.y},{x:e.x,y:e.y+(e.height||0)}]]}function q1(e,t){var n=t.map(function(i){return{line:i,distance:yp(e,i)}}),r=St(n,"distance");return r[0].line}function pv(e,t,n,r){return Gp(e,t,n,r).point}function ns(e,t){k.call(this,e);function n(r,i){var o=r.context,a=o.connection,s=C({},o.hints),c=o.newWaypoints||a.waypoints,p=o.oldWaypoints;return typeof s.startChanged=="undefined"&&(s.startChanged=!!s.connectionStart),typeof s.endChanged=="undefined"&&(s.endChanged=!!s.connectionEnd),pv(i,c,p,s)}this.postExecute(["connection.layout","connection.updateWaypoints"],function(r){var i=r.context,o=i.connection,a=o.outgoing,s=o.incoming;s.forEach(function(c){var p=c.waypoints[c.waypoints.length-1],u=n(r,p),l=[].concat(c.waypoints.slice(0,-1),[u]);t.updateWaypoints(c,l)}),a.forEach(function(c){var p=c.waypoints[0],u=n(r,p),l=[].concat([u],c.waypoints.slice(1));t.updateWaypoints(c,l)})}),this.postExecute(["connection.move"],function(r){var i=r.context,o=i.connection,a=o.outgoing,s=o.incoming,c=i.delta;s.forEach(function(p){var u=p.waypoints[p.waypoints.length-1],l={x:u.x+c.x,y:u.y+c.y},f=[].concat(p.waypoints.slice(0,-1),[l]);t.updateWaypoints(p,f)}),a.forEach(function(p){var u=p.waypoints[0],l={x:u.x+c.x,y:u.y+c.y},f=[].concat([l],p.waypoints.slice(1));t.updateWaypoints(p,f)})})}N(ns,k);ns.$inject=["eventBus","modeling"];function Zr(e,t,n){var r=Up(e),i=lv(r,t),o=r[0];return i.length?i[i.length-1]:Si(o.original||o,n,t)}function Qr(e,t,n){var r=Up(e),i=lv(r,t),o=r[r.length-1];return i.length?i[0]:Si(o.original||o,n,t)}function Oo(e,t,n){var r=Up(e),i=uv(t,n),o=r[0];return Si(o.original||o,i,t)}function No(e,t,n){var r=Up(e),i=uv(t,n),o=r[r.length-1];return Si(o.original||o,i,t)}function uv(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function Up(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function lv(e,t){var n=He(e,Z1);return J(n,function(r){return X1(r,t)})}function X1(e,t){return Le(t,e,1)==="intersect"}function Z1(e){return e.original||e}function rs(e,t){k.call(this,e),this.postExecute("shape.replace",function(n){var r=n.oldShape,i=n.newShape;if(Q1(r,i)){var o=J1(r);o.incoming.forEach(function(a){var s=Qr(a,i,r);t.reconnectEnd(a,i,s)}),o.outgoing.forEach(function(a){var s=Zr(a,i,r);t.reconnectStart(a,i,s)})}},!0)}rs.$inject=["eventBus","modeling"];N(rs,k);function Q1(e,t){return m(e,"bpmn:Participant")&&ie(e)&&m(t,"bpmn:Participant")&&!ie(t)}function J1(e){var t=Fn([e],!1),n=[],r=[];return t.forEach(function(i){i!==e&&(i.incoming.forEach(function(o){m(o,"bpmn:MessageFlow")&&n.push(o)}),i.outgoing.forEach(function(o){m(o,"bpmn:MessageFlow")&&r.push(o)}))},[]),{incoming:n,outgoing:r}}var eC=["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:EscalationEventDefinition","bpmn:ConditionalEventDefinition","bpmn:SignalEventDefinition"];function Kp(e){let t=L(e);if(!m(t,"bpmn:BoundaryEvent")&&!(m(t,"bpmn:StartEvent")&&Ue(t.$parent)))return!1;let n=t.get("eventDefinitions");return!n||!n.length?!1:eC.some(r=>m(n[0],r))}function Yp(e){return m(e,"bpmn:BoundaryEvent")?"cancelActivity":"isInterrupting"}function is(e,t){e.invoke(k,this),this.postExecuted("shape.replace",function(n){let r=n.context.oldShape,i=n.context.newShape,o=n.context.hints;if(!Kp(i))return;let a=Yp(i);if(o.targetElement&&o.targetElement[a]!==void 0)return;let c=L(r).get(a),p=L(i).get(a);c!==p&&t.updateProperties(i,{[a]:c})})}is.$inject=["injector","modeling"];N(is,k);function os(e,t){k.call(this,e),this.preExecute("shape.resize",function(n){var r=n.shape,i=se(r),o=i&&i.get("label"),a=o&&o.get("bounds");a&&t.updateModdleProperties(r,o,{bounds:void 0})},!0)}N(os,k);os.$inject=["eventBus","modeling"];function as(e,t,n){k.call(this,e),this.preExecute("shape.delete",function(r){var i=r.context.shape;if(!(i.incoming.length!==1||i.outgoing.length!==1)){var o=i.incoming[0],a=i.outgoing[0];if(!(!m(o,"bpmn:SequenceFlow")||!m(a,"bpmn:SequenceFlow"))&&t.canConnect(o.source,a.target,o)){var s=tC(o.waypoints,a.waypoints);n.reconnectEnd(o,a.target,s)}}})}N(as,k);as.$inject=["eventBus","bpmnRules","modeling"];function Bo(e){return e.original||e}function tC(e,t){var n=ko(Bo(e[e.length-2]),Bo(e[e.length-1]),Bo(t[1]),Bo(t[0]));return n?[].concat(e.slice(0,e.length-1),[n],t.slice(1)):[Bo(e[0]),Bo(t[t.length-1])]}function ss(e,t){k.call(this,e),this.preExecute("shape.delete",function(n){var r=n.shape,i=r.parent;m(r,"bpmn:Participant")&&(n.collaborationRoot=i)},!0),this.postExecute("shape.delete",function(n){var r=n.collaborationRoot;if(r&&!r.businessObject.participants.length){var i=t.makeProcess(),o=r.children.slice();t.moveElements(o,{x:0,y:0},i)}},!0)}ss.$inject=["eventBus","modeling"];N(ss,k);function cs(e,t,n,r){k.call(this,e);var i=r.get("dragging",!1);function o(c){var p=c.source,u=c.target,l=c.parent;if(l){var f,d;m(c,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(p,u)||(d=!0),n.canConnectMessageFlow(p,u)&&(f="bpmn:MessageFlow")),m(c,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(p,u)||(d=!0),n.canConnectSequenceFlow(p,u)&&(f="bpmn:SequenceFlow")),d&&t.removeConnection(c),f&&t.connect(p,u,{type:f,waypoints:c.waypoints.slice()})}}function a(c){var p=c.context,u=p.connection,l=p.newSource||u.source,f=p.newTarget||u.target,d,h;d=n.canConnect(l,f),!(!d||d.type===u.type)&&(h=t.connect(l,f,{type:d.type,associationDirection:d.associationDirection,waypoints:u.waypoints.slice()}),u.parent&&t.removeConnection(u),p.connection=h,i&&s(u,h))}function s(c,p){var u=i.context(),l=u&&u.payload.previousSelection,f;!l||!l.length||(f=l.indexOf(c),f!==-1&&l.splice(f,1,p))}this.postExecuted("elements.move",function(c){var p=c.closure,u=p.allConnections;E(u,o)},!0),this.preExecute("connection.reconnect",a),this.postExecuted("element.updateProperties",function(c){var p=c.context,u=p.properties,l=p.element,f=l.businessObject,d;u.default&&(d=ne(l.outgoing,yt({id:l.businessObject.default.id})),d&&t.updateProperties(d,{conditionExpression:void 0})),u.conditionExpression&&f.sourceRef.default===f&&t.updateProperties(l.source,{default:void 0})})}N(cs,k);cs.$inject=["eventBus","modeling","bpmnRules","injector"];function Io(e,t,n,r,i,o){r.invoke(k,this),this._bpmnReplace=e,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,function(a){var s=a.context,c=s.parent,p=s.elements,u=Ke(p,function(l,f){var d=t.canReplace([f],f.host||f.parent||c);return d?l.concat(d.replacements):l},[]);u.length&&this._replaceElements(p,u)},this),this.postExecuted(["elements.move"],500,function(a){var s=a.context,c=s.newParent,p=s.newHost,u=[];E(s.closure.topLevel,function(f){Ue(f)?u=u.concat(f.children):u=u.concat(f)}),u.length===1&&p&&(c=p);var l=t.canReplace(u,c);l&&this._replaceElements(u,l.replacements,p)},this),this.postExecute(["shape.replace"],1500,function(a){var s=a.context,c=s.oldShape,p=s.newShape,u=c.attachers,l;u&&u.length&&(l=t.canReplace(u,p),this._replaceElements(u,l.replacements))},this),this.postExecuted(["shape.replace"],1500,function(a){var s=a.context,c=s.oldShape,p=s.newShape;i.unclaimId(c.businessObject.id,c.businessObject),i.updateProperties(p,{id:c.id})})}N(Io,k);Io.prototype._replaceElements=function(e,t){var n=this._elementRegistry,r=this._bpmnReplace,i=this._selection;E(t,function(o){var a={type:o.newElementType},s=n.get(o.oldElementId),c=e.indexOf(s);e[c]=r.replaceElement(s,a,{select:!1})}),t&&i.select(e)};Io.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var nC=1500,fv={width:140,height:120},qp={width:300,height:60},Xp={width:60,height:300},ps={width:300,height:150},us={width:150,height:300},ff={width:140,height:120},df={width:50,height:30};function Zp(e){e.on("resize.start",nC,function(t){var n=t.context,r=n.shape,i=n.direction,o=n.balanced;(m(r,"bpmn:Lane")||m(r,"bpmn:Participant"))&&(n.resizeConstraints=sC(r,i,o)),m(r,"bpmn:SubProcess")&&ie(r)&&(n.minDimensions=ff),m(r,"bpmn:TextAnnotation")&&(n.minDimensions=df)})}Zp.$inject=["eventBus"];var Jr=Math.abs,rC=Math.min,iC=Math.max;function dv(e,t,n,r){var i=e[t];e[t]=i===void 0?n:r(n,i)}function Lo(e,t,n){return dv(e,t,n,rC)}function jo(e,t,n){return dv(e,t,n,iC)}var oC={top:20,left:50,right:20,bottom:20},aC={top:50,left:20,right:20,bottom:20};function sC(e,t,n){var r=Rt(e),i=!0,o=!0,a=To(r,[r]),s=X(e),c={},p={},u=Re(e),l=u?qp:Xp;/n/.test(t)?p.top=s.bottom-l.height:/e/.test(t)?p.right=s.left+l.width:/s/.test(t)?p.bottom=s.top+l.height:/w/.test(t)&&(p.left=s.right-l.width),a.forEach(function(h){var _=X(h);u?(_.tops.bottom+10&&(o=!1)):(_.lefts.right+10&&(o=!1)),/n/.test(t)&&(n&&Jr(s.top-_.bottom)<10&&jo(c,"top",_.top+l.height),Jr(s.top-_.top)<5&&Lo(p,"top",_.bottom-l.height)),/e/.test(t)&&(n&&Jr(s.right-_.left)<10&&Lo(c,"right",_.right-l.width),Jr(s.right-_.right)<5&&jo(p,"right",_.left+l.width)),/s/.test(t)&&(n&&Jr(s.bottom-_.top)<10&&Lo(c,"bottom",_.bottom-l.height),Jr(s.bottom-_.bottom)<5&&jo(p,"bottom",_.top+l.height)),/w/.test(t)&&(n&&Jr(s.left-_.right)<10&&jo(c,"left",_.left+l.width),Jr(s.left-_.left)<5&&Lo(p,"left",_.right-l.width))});var f=r.children.filter(function(h){return!h.hidden&&!h.waypoints&&(m(h,"bpmn:FlowElement")||m(h,"bpmn:Artifact"))}),d=u?oC:aC;return f.forEach(function(h){var _=X(h);/n/.test(t)&&(!u||i)&&Lo(p,"top",_.top-d.top),/e/.test(t)&&(u||o)&&jo(p,"right",_.right+d.right),/s/.test(t)&&(!u||o)&&jo(p,"bottom",_.bottom+d.bottom),/w/.test(t)&&(u||i)&&Lo(p,"left",_.left-d.left)}),{min:p,max:c}}var hv=1001;function Qp(e,t){e.on("resize.start",hv+500,function(n){var r=n.context,i=r.shape;(m(i,"bpmn:Lane")||m(i,"bpmn:Participant"))&&(r.balanced=!hr(n))}),e.on("resize.end",hv,function(n){var r=n.context,i=r.shape,o=r.canExecute,a=r.newBounds;if(m(i,"bpmn:Lane")||m(i,"bpmn:Participant"))return o&&(a=oc(a),t.resizeLane(i,a,r.balanced)),!1})}Qp.$inject=["eventBus","modeling"];var cC=500;function ls(e,t,n,r,i){n.invoke(k,this);function o(u){return Q(u,["bpmn:ReceiveTask","bpmn:SendTask"])||pC(u,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(u){var l=e.getDefinitions(),f=l.get("rootElements");return!!ne(f,yt({id:u.id}))}function s(u){if(m(u,"bpmn:ErrorEventDefinition"))return"errorRef";if(m(u,"bpmn:EscalationEventDefinition"))return"escalationRef";if(m(u,"bpmn:MessageEventDefinition"))return"messageRef";if(m(u,"bpmn:SignalEventDefinition"))return"signalRef"}function c(u){if(Q(u,["bpmn:ReceiveTask","bpmn:SendTask"]))return u.get("messageRef");var l=u.get("eventDefinitions"),f=l[0];return f.get(s(f))}function p(u,l){if(Q(u,["bpmn:ReceiveTask","bpmn:SendTask"]))return u.set("messageRef",l);var f=u.get("eventDefinitions"),d=f[0];return d.set(s(d),l)}this.executed(["shape.create","element.updateProperties","element.updateModdleProperties"],function(u){var l=u.shape||u.element;if(o(l)){var f=L(l),d=c(f),h;d&&!a(d)&&(h=e.getDefinitions().get("rootElements"),we(h,d),u.addedRootElement=d)}},!0),this.reverted(["shape.create","element.updateProperties","element.updateModdleProperties"],function(u){var l=u.addedRootElement;if(l){var f=e.getDefinitions().get("rootElements");Te(f,l)}},!0),t.on("copyPaste.copyElement",function(u){var l=u.descriptor,f=u.element;if(!(f.labelTarget||!o(f))){var d=L(f),h=c(d);h&&(l.referencedRootElement=h)}}),t.on("copyPaste.pasteElement",cC,function(u){var l=u.descriptor,f=l.businessObject,d=l.referencedRootElement;d&&(a(d)||(d=r.copyElement(d,i.create(d.$type))),p(f,d),delete l.referencedRootElement)})}ls.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"];N(ls,k);function pC(e,t){return U(t)||(t=[t]),Nt(t,function(n){return cr(e,n)})}var mv=Math.max;function Jp(e){e.on("spaceTool.getMinDimensions",function(t){var n=t.shapes,r=t.axis,i=t.start,o={};return E(n,function(a){var s=a.id;m(a,"bpmn:Participant")&&(o[s]=lC(a,r,i)),m(a,"bpmn:Lane")&&(o[s]=Re(a)?qp:Xp),m(a,"bpmn:SubProcess")&&ie(a)&&(o[s]=ff),m(a,"bpmn:TextAnnotation")&&(o[s]=df),m(a,"bpmn:Group")&&(o[s]=fv)}),o})}Jp.$inject=["eventBus"];function uC(e){return e==="x"}function lC(e,t,n){var r=Re(e);if(!hC(e))return r?ps:us;var i=uC(t),o={};return i?r?o=ps:o={width:dC(e,n,i),height:us.height}:r?o={width:ps.width,height:fC(e,n,i)}:o=us,o}function fC(e,t,n){var r;return r=mC(e,t,n),mv(ps.height,r)}function dC(e,t,n){var r;return r=gC(e,t,n),mv(us.width,r)}function hC(e){return!!cn(e).length}function mC(e,t,n){var r=cn(e),i;return i=hf(r,t,n),e.height-i.height+qp.height}function gC(e,t,n){var r=cn(e),i;return i=hf(r,t,n),e.width-i.width+Xp.width}function hf(e,t,n){var r,i,o;for(r=0;r=i.y&&t<=i.y+i.height||n&&t>=i.x&&t<=i.x+i.width)return o=cn(i),o.length?hf(o,t,n):i}function mf(e){let t=[];return E(e.incoming,n=>{m(n,"bpmn:Association")&&m(n.source,"bpmn:TextAnnotation")&&t.push({annotation:n.source,association:n})}),E(e.outgoing,n=>{m(n,"bpmn:Association")&&m(n.target,"bpmn:TextAnnotation")&&t.push({annotation:n.target,association:n})}),t}function Ci(e){let t=new Map;return E(la(e,!0,-1),n=>{E(mf(n),r=>{t.has(r.annotation)||t.set(r.annotation,{annotation:r.annotation,associations:[]}),t.get(r.annotation).associations.push(r.association)})}),[...t.values()]}var gv=400,vC=600,vv={x:180,y:160};function kn(e,t,n,r,i,o,a){k.call(this,t),this._canvas=e,this._eventBus=t,this._modeling=n,this._elementFactory=r,this._bpmnFactory=i,this._bpmnjs=o,this._elementRegistry=a;var s=this;function c(l){return m(l,"bpmn:SubProcess")&&!ie(l)}function p(l){var f=l.shape,d=l.newRootElement,h=L(f);d=s._addDiagram(d||h),l.newRootElement=e.addRootElement(d)}function u(l){var f=l.shape,d=L(f);s._removeDiagram(d);var h=l.newRootElement=a.get(on(d));e.removeRootElement(h)}this.executed("shape.create",function(l){var f=l.shape;c(f)&&p(l)},!0),this.postExecuted("elements.create",function(l){var f=l.elements;E(f,function(d){if(c(d)){var h=a.get(on(d));if(!(!h||!d.children||!d.children.length)){var _=yv(d);s._showRecursively(_),s._moveChildrenToShape(_,h)}}})},!0),this.reverted("shape.create",function(l){var f=l.shape;c(f)&&u(l)},!0),this.preExecute("shape.delete",function(l){var f=l.shape;!m(f,"bpmn:SubProcess")||!ie(f)||E(Ci([f]),d=>{n.removeShape(d.annotation)})},!0),this.preExecuted("shape.delete",function(l){var f=l.shape;if(c(f)){var d=a.get(on(f));d&&n.removeElements(d.children.slice())}},!0),this.executed("shape.delete",function(l){var f=l.shape;c(f)&&u(l)},!0),this.reverted("shape.delete",function(l){var f=l.shape;c(f)&&p(l)},!0),this.preExecuted("shape.replace",function(l){var f=l.oldShape,d=l.newShape;!c(f)||!c(d)||(l.oldRoot=e.removeRootElement(on(f)))},!0),this.postExecuted("shape.replace",function(l){var f=l.newShape,d=l.oldRoot,h=e.findRoot(on(f));if(!(!d||!h)){var _=d.children;n.moveElements(_,{x:0,y:0},h)}},!0),this.executed("element.updateProperties",function(l){var f=l.element;if(m(f,"bpmn:SubProcess")){var d=l.properties,h=l.oldProperties,_=h.id,v=d.id;if(_!==v){if(po(f)){a.updateId(f,zr(v)),a.updateId(_,v);return}var w=a.get(zr(_));w&&a.updateId(zr(_),zr(v))}}},!0),this.reverted("element.updateProperties",function(l){var f=l.element;if(m(f,"bpmn:SubProcess")){var d=l.properties,h=l.oldProperties,_=h.id,v=d.id;if(_!==v){if(po(f)){a.updateId(f,zr(_)),a.updateId(v,_);return}var w=a.get(zr(v));w&&a.updateId(w,zr(_))}}},!0),t.on("element.changed",function(l){var f=l.element;if(po(f)){var d=f,h=a.get(Ol(d));!h||h===d||t.fire("element.changed",{element:h})}}),this.executed("shape.toggleCollapse",gv,function(l){var f=l.shape;m(f,"bpmn:SubProcess")&&(ie(f)?u(l):(p(l),s._showRecursively(f.children)))},!0),this.reverted("shape.toggleCollapse",gv,function(l){var f=l.shape;m(f,"bpmn:SubProcess")&&(ie(f)?u(l):(p(l),s._showRecursively(f.children)))},!0),this.postExecuted("shape.toggleCollapse",vC,function(l){var f=l.shape;if(m(f,"bpmn:SubProcess")){var d=l.newRootElement;if(d)if(ie(f))s._moveChildrenToShape(d.children.slice(),f),E(Ci(f.children),_=>{n.moveShape(_.annotation,{x:0,y:0},f.parent),E(_.associations,v=>{n.moveConnection(v,{x:0,y:0},f.parent)})});else{s._disconnectSharedAnnotations(f);var h=yv(f);s._moveChildrenToShape(h,d)}}},!0),t.on("copyPaste.createTree",function(l){var f=l.element,d=l.children;if(c(f)){var h=on(f),_=a.get(h);_&&d.push.apply(d,_.children)}}),t.on("copyPaste.copyElement",function(l){var f=l.descriptor,d=l.element,h=l.elements,_=d.parent,v=m(se(_),"bpmndi:BPMNPlane");if(v){var w=Ol(_),P=ne(h,function(b){return b.id===w});P&&(f.parent=P.id)}}),t.on("copyPaste.pasteElement",function(l){var f=l.descriptor;f.parent&&(c(f.parent)||f.parent.hidden)&&(f.hidden=!0)})}N(kn,k);kn.prototype._moveChildrenToShape=function(e,t){var n=this._modeling;if(e.length){var r=e.filter(function(c){return!c.hidden});if(!r.length){n.moveElements(e,{x:0,y:0},t,{autoResize:!1});return}var i=Ee(r),o;if(!t.x)o={x:vv.x-i.x,y:vv.y-i.y};else{var a=Y(t),s=Y(i);o={x:a.x-s.x,y:a.y-s.y}}n.moveElements(e,o,t,{autoResize:!1})}};kn.prototype._disconnectSharedAnnotations=function(e){var t=this._modeling,n=new Set(mf(e).map(r=>r.annotation));n.size&&E(Ci(e.children),r=>{n.has(r.annotation)&&E(r.associations,i=>{t.removeConnection(i)})})};kn.prototype._showRecursively=function(e,t){var n=this,r=[];return e.forEach(function(i){i.hidden=!!t,r=r.concat(i),i.children&&(r=r.concat(n._showRecursively(i.children,i.collapsed||t)))}),r};kn.prototype._addDiagram=function(e){var t=this._bpmnjs,n=t.getDefinitions().diagrams;return e.businessObject||(e=this._createNewDiagram(e)),n.push(e.di.$parent),e};kn.prototype._createNewDiagram=function(e){var t=this._bpmnFactory,n=this._elementFactory,r=t.create("bpmndi:BPMNPlane",{bpmnElement:e}),i=t.create("bpmndi:BPMNDiagram",{plane:r});r.$parent=i;var o=n.createRoot({id:on(e),type:e.$type,di:r,businessObject:e,collapsed:!0});return o};kn.prototype._removeDiagram=function(e){var t=this._bpmnjs,n=t.getDefinitions().diagrams,r=ne(n,function(i){return i.plane.bpmnElement.id===e.id});return n.splice(n.indexOf(r),1),r};kn.$inject=["canvas","eventBus","modeling","elementFactory","bpmnFactory","bpmnjs","elementRegistry"];function yC(e){var t=[];return E(Ci(e),n=>{t.push(n.annotation),t.push.apply(t,n.associations)}),t}function yv(e){return e.children.slice().concat(yC(e.children)).concat(_C(e))}function _C(e){return la(e.children||[],!0,-1).reduce(function(t,n){return n.label&&n.label.parent!==e&&t.push(n.label),t},[])}function fs(e,t){e.invoke(k,this),this.postExecuted("shape.replace",function(n){var r=n.context.oldShape,i=n.context.newShape;if(!(!m(i,"bpmn:SubProcess")||m(i,"bpmn:AdHocSubProcess")||!(m(r,"bpmn:Task")||m(r,"bpmn:CallActivity"))||!ie(i))){var o=xC(i);t.createShape({type:"bpmn:StartEvent"},o,i)}})}fs.$inject=["injector","modeling"];N(fs,k);function xC(e){return{x:e.x+e.width/6,y:e.y+e.height/2}}function ds(e){k.call(this,e),this.preExecute("connection.create",function(t){let{target:n}=t;m(n,"bpmn:TextAnnotation")&&(t.parent=n.parent)},!0),this.preExecute(["shape.create","shape.resize","elements.move"],function(t){let n=t.shapes||[t.shape];n.length===1&&m(n[0],"bpmn:TextAnnotation")&&(t.hints=t.hints||{},t.hints.autoResize=!1)},!0)}N(ds,k);ds.$inject=["eventBus"];function hs(e,t){k.call(this,e),this.postExecuted("shape.toggleCollapse",1500,function(n){var r=n.shape;if(ie(r))return;var i=Fn(r);i.forEach(function(a){var s=a.incoming.slice(),c=a.outgoing.slice();E(s,function(p){o(p,!0)}),E(c,function(p){o(p,!1)})});function o(a,s){i.indexOf(a.source)!==-1&&i.indexOf(a.target)!==-1||m(a,"bpmn:Association")&&(m(a.source,"bpmn:TextAnnotation")||m(a.target,"bpmn:TextAnnotation"))||(s?t.reconnectEnd(a,r,Y(r)):t.reconnectStart(a,r,Y(r)))}},!0)}N(hs,k);hs.$inject=["eventBus","modeling"];var gf=500;function ms(e,t,n){k.call(this,e);function r(a){a.length&&a.forEach(function(s){s.type==="label"&&!s.businessObject.name&&(s.hidden=!0)})}function i(a,s){var c=a.children,p=s,u,l;return u=bC(c).concat([a]),l=Hp(u),l?(p.width=Math.max(l.width,p.width),p.height=Math.max(l.height,p.height),p.x=l.x+(l.width-p.width)/2,p.y=l.y+(l.height-p.height)/2):(p.x=a.x+(a.width-p.width)/2,p.y=a.y+(a.height-p.height)/2),p}function o(a,s){return{x:a.x+(a.width-s.width)/2,y:a.y+(a.height-s.height)/2,width:s.width,height:s.height}}this.executed(["shape.toggleCollapse"],gf,function(a){var s=a.context,c=s.shape;m(c,"bpmn:SubProcess")&&(c.collapsed?se(c).isExpanded=!1:(r(c.children),se(c).isExpanded=!0))}),this.reverted(["shape.toggleCollapse"],gf,function(a){var s=a.context,c=s.shape;c.collapsed?se(c).isExpanded=!1:se(c).isExpanded=!0}),this.postExecuted(["shape.toggleCollapse"],gf,function(a){var s=a.context.shape,c=t.getDefaultSize(s),p;s.collapsed?p=o(s,c):p=i(s,c),n.resizeShape(s,p,null,{autoResize:s.collapsed?!1:"nwse"})})}N(ms,k);ms.$inject=["eventBus","elementFactory","modeling"];function bC(e){return e.filter(function(t){return!t.hidden})}function gs(e,t,n,r){t.invoke(k,this),this.preExecute("shape.delete",function(i){var o=i.context,a=o.shape,s=a.businessObject;te(a)||(m(a,"bpmn:Participant")&&ie(a)&&n.ids.unclaim(s.processRef.id),r.unclaimId(s.id,s))}),this.preExecute("connection.delete",function(i){var o=i.context,a=o.connection,s=a.businessObject;r.unclaimId(s.id,s)}),this.preExecute("canvas.updateRoot",function(){var i=e.getRootElement(),o=i.businessObject;m(i,"bpmn:Collaboration")&&n.ids.unclaim(o.id)})}N(gs,k);gs.$inject=["canvas","injector","moddle","modeling"];function vs(e,t){k.call(this,e),this.preExecute("connection.delete",function(n){var r=n.context,i=r.connection,o=i.source;EC(i,o)&&t.updateProperties(o,{default:null})})}N(vs,k);vs.$inject=["eventBus","modeling"];function EC(e,t){if(!m(e,"bpmn:SequenceFlow"))return!1;var n=L(t),r=L(e);return n.get("default")===r}var wC=500,SC=5e3;function ys(e,t){k.call(this,e);var n;function r(){return n=n||new CC,n.enter(),n}function i(){if(!n)throw new Error("out of bounds release");return n}function o(){if(!n)throw new Error("out of bounds release");var s=n.leave();return s&&(t.updateLaneRefs(n.flowNodes,n.lanes),n=null),s}var a=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(a,SC,function(s){r()}),this.postExecuted(a,wC,function(s){o()}),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],function(s){var c=s.context,p=c.shape,u=i();p.labelTarget||(m(p,"bpmn:Lane")&&u.addLane(p),m(p,"bpmn:FlowNode")&&u.addFlowNode(p))})}ys.$inject=["eventBus","modeling"];N(ys,k);function CC(){this.flowNodes=[],this.lanes=[],this.counter=0,this.addLane=function(e){this.lanes.push(e)},this.addFlowNode=function(e){this.flowNodes.push(e)},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}function _s(e,t){k.call(this,e),this.postExecuted("elements.create",function(n){let r=n.context,i=r.elements;for(let o of i)RC(o)&&!AC(o)&&t.updateProperties(o,{isForCompensation:void 0})})}N(_s,k);_s.$inject=["eventBus","modeling"];function RC(e){let t=L(e);return t&&t.isForCompensation}function PC(e){return e&&m(e,"bpmn:BoundaryEvent")&&cr(e,"bpmn:CompensateEventDefinition")}function AC(e){return e.incoming.filter(n=>PC(n.source)).length>0}var _v={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","associationBehavior","attachEventBehavior","boundaryEventBehavior","compensateBoundaryEventBehaviour","createBehavior","createDataObjectBehavior","createParticipantBehavior","dataInputAssociationBehavior","dataStoreBehavior","deleteLaneBehavior","detachEventBehavior","dropOnFlowBehavior","eventBasedGatewayBehavior","fixHoverBehavior","groupBehavior","importDockingFix","isHorizontalFix","labelBehavior","layoutConnectionBehavior","messageFlowBehavior","nonInterruptingBehavior","removeElementBehavior","removeEmbeddedLabelBoundsBehavior","removeParticipantBehavior","replaceConnectionBehavior","replaceElementBehaviour","resizeBehavior","resizeLaneBehavior","rootElementReferenceBehavior","spaceToolBehavior","subProcessPlaneBehavior","subProcessStartEventBehavior","textAnnotationBehavior","toggleCollapseConnectionBehaviour","toggleElementCollapseBehaviour","unclaimIdBehavior","updateFlowNodeRefsBehavior","unsetDefaultFlowBehavior","setCompensationActivityAfterPasteBehavior"],adaptiveLabelPositioningBehavior:["type",La],appendBehavior:["type",ja],associationBehavior:["type",Fa],attachEventBehavior:["type",Ro],boundaryEventBehavior:["type",Ha],compensateBoundaryEventBehaviour:["type",za],createBehavior:["type",Va],createDataObjectBehavior:["type",Wa],createParticipantBehavior:["type",Ga],dataInputAssociationBehavior:["type",Ua],dataStoreBehavior:["type",Ka],deleteLaneBehavior:["type",qa],detachEventBehavior:["type",Mo],dropOnFlowBehavior:["type",Xa],eventBasedGatewayBehavior:["type",Za],fixHoverBehavior:["type",zp],groupBehavior:["type",Qa],importDockingFix:["type",Vp],isHorizontalFix:["type",Ja],labelBehavior:["type",ts],layoutConnectionBehavior:["type",ns],messageFlowBehavior:["type",rs],nonInterruptingBehavior:["type",is],removeElementBehavior:["type",as],removeEmbeddedLabelBoundsBehavior:["type",os],removeParticipantBehavior:["type",ss],replaceConnectionBehavior:["type",cs],replaceElementBehaviour:["type",Io],resizeBehavior:["type",Zp],resizeLaneBehavior:["type",Qp],rootElementReferenceBehavior:["type",ls],spaceToolBehavior:["type",Jp],subProcessPlaneBehavior:["type",kn],subProcessStartEventBehavior:["type",fs],textAnnotationBehavior:["type",ds],toggleCollapseConnectionBehaviour:["type",hs],toggleElementCollapseBehaviour:["type",ms],unclaimIdBehavior:["type",gs],unsetDefaultFlowBehavior:["type",vs],updateFlowNodeRefsBehavior:["type",ys],setCompensationActivityAfterPasteBehavior:["type",_s]};function eu(e,t){var n=Le(e,t,-15);return n!=="intersect"?n:null}function dt(e){Ct.call(this,e)}N(dt,Ct);dt.$inject=["eventBus"];dt.prototype.init=function(){this.addRule("connection.start",function(e){var t=e.source;return TC(t)}),this.addRule("connection.create",function(e){var t=e.source,n=e.target,r=e.hints||{},i=r.targetParent,o=r.targetAttach;if(o)return!1;i&&(n.parent=i);try{return tu(t,n)}finally{i&&(n.parent=null)}}),this.addRule("connection.reconnect",function(e){var t=e.connection,n=e.source,r=e.target;return tu(n,r,t)}),this.addRule("connection.updateWaypoints",function(e){return{type:e.connection.type}}),this.addRule("shape.resize",function(e){var t=e.shape,n=e.newBounds;return Ov(t,n)}),this.addRule("elements.create",function(e){var t=e.elements,n=e.position,r=e.target;return fe(r)&&!nu(t,r,n)?!1:hn(t,function(i){return fe(i)?tu(i.source,i.target,i):i.host?xs(i,i.host,null,n):_f(i,r,null,n)})}),this.addRule("elements.move",function(e){var t=e.target,n=e.shapes,r=e.position,i=e.hints;return i!=null&&i.keyboardMove&&n.some(function(a){return Pv(a)&&!n.includes(a.host)})?!1:xs(n,t,null,r)||Dv(n,t,r)||kv(n,t,r)||nu(n,t,r)}),this.addRule("shape.create",function(e){return _f(e.shape,e.target,e.source,e.position)}),this.addRule("shape.attach",function(e){return xs(e.shape,e.target,null,e.position)}),this.addRule("element.copy",function(e){var t=e.element,n=e.elements;return jv(n,t)})};dt.prototype.canConnectMessageFlow=Iv;dt.prototype.canConnectSequenceFlow=Lv;dt.prototype.canConnectDataAssociation=bf;dt.prototype.canConnectAssociation=Nv;dt.prototype.canConnectCompensationAssociation=Bv;dt.prototype.canMove=kv;dt.prototype.canAttach=xs;dt.prototype.canReplace=Dv;dt.prototype.canDrop=Fo;dt.prototype.canInsert=nu;dt.prototype.canCreate=_f;dt.prototype.canConnect=tu;dt.prototype.canResize=Ov;dt.prototype.canCopy=jv;function TC(e){return vf(e)?null:Q(e,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}function vf(e){return!e||te(e)}function xv(e){do{if(m(e,"bpmn:Process"))return L(e);if(m(e,"bpmn:Participant"))return L(e).processRef||L(e)}while(e=e.parent)}function yf(e){return m(e,"bpmn:TextAnnotation")}function xf(e){return m(e,"bpmn:Group")&&!e.labelTarget}function Sv(e){return m(e,"bpmn:BoundaryEvent")&&Xn(e,"bpmn:CompensateEventDefinition")}function ru(e){return L(e).isForCompensation}function MC(e,t){var n=xv(e),r=xv(t);return n===r}function DC(e){return m(e,"bpmn:InteractionNode")&&!m(e,"bpmn:BoundaryEvent")&&(!m(e,"bpmn:Event")||m(e,"bpmn:ThrowEvent")&&Rv(e,"bpmn:MessageEventDefinition"))}function kC(e){return m(e,"bpmn:InteractionNode")&&!ru(e)&&(!m(e,"bpmn:Event")||m(e,"bpmn:CatchEvent")&&Rv(e,"bpmn:MessageEventDefinition"))&&!(m(e,"bpmn:BoundaryEvent")&&!Xn(e,"bpmn:MessageEventDefinition"))}function bv(e){for(var t=e;t=t.parent;){if(m(t,"bpmn:FlowElementsContainer"))return L(t);if(m(t,"bpmn:Participant"))return L(t).processRef}return null}function Cv(e,t){var n=bv(e),r=bv(t);return n===r}function Xn(e,t){var n=L(e);return!!ne(n.eventDefinitions||[],function(r){return m(r,t)})}function Rv(e,t){var n=L(e);return(n.eventDefinitions||[]).every(function(r){return m(r,t)})}function OC(e){return m(e,"bpmn:FlowNode")&&!m(e,"bpmn:EndEvent")&&!Ue(e)&&!(m(e,"bpmn:IntermediateThrowEvent")&&Xn(e,"bpmn:LinkEventDefinition"))&&!Sv(e)&&!ru(e)}function NC(e){return m(e,"bpmn:FlowNode")&&!m(e,"bpmn:StartEvent")&&!m(e,"bpmn:BoundaryEvent")&&!Ue(e)&&!(m(e,"bpmn:IntermediateCatchEvent")&&Xn(e,"bpmn:LinkEventDefinition"))&&!ru(e)}function BC(e){return m(e,"bpmn:ReceiveTask")||m(e,"bpmn:IntermediateCatchEvent")&&(Xn(e,"bpmn:MessageEventDefinition")||Xn(e,"bpmn:TimerEventDefinition")||Xn(e,"bpmn:ConditionalEventDefinition")||Xn(e,"bpmn:SignalEventDefinition"))}function IC(e){for(var t=[];e;)e=e.parent,e&&t.push(e);return t}function Ev(e,t){var n=IC(t);return n.indexOf(e)!==-1}function tu(e,t,n){if(vf(e)||vf(t))return null;if(!m(n,"bpmn:DataAssociation")){if(Iv(e,t))return{type:"bpmn:MessageFlow"};if(Lv(e,t))return{type:"bpmn:SequenceFlow"}}var r=bf(e,t);return r||(Bv(e,t)?{type:"bpmn:Association",associationDirection:"One"}:Nv(e,t)?{type:"bpmn:Association",associationDirection:"None"}:!1)}function Fo(e,t){return te(e)||xf(e)?!0:m(t,"bpmn:Participant")&&!ie(t)?!1:m(e,"bpmn:Participant")?m(t,"bpmn:Process")||m(t,"bpmn:Collaboration"):Q(e,["bpmn:DataInput","bpmn:DataOutput"])&&e.parent?t===e.parent:m(e,"bpmn:Lane")?m(t,"bpmn:Participant")||m(t,"bpmn:Lane"):m(e,"bpmn:BoundaryEvent")&&!LC(e)?!1:m(e,"bpmn:FlowElement")&&!m(e,"bpmn:DataStoreReference")?m(t,"bpmn:FlowElementsContainer")?ie(t):Q(t,["bpmn:Participant","bpmn:Lane"]):m(e,"bpmn:DataStoreReference")&&m(t,"bpmn:Collaboration")?Nt(L(t).get("participants"),function(n){return!!n.get("processRef")}):Q(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?Q(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):m(e,"bpmn:MessageFlow")?m(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t:!1}function LC(e){return L(e).cancelActivity&&(Av(e)||Tv(e))}function Pv(e){return!te(e)&&m(e,"bpmn:BoundaryEvent")}function jC(e){return m(e,"bpmn:Lane")}function FC(e){return Pv(e)||m(e,"bpmn:IntermediateThrowEvent")&&Av(e)?!0:m(e,"bpmn:IntermediateCatchEvent")&&Tv(e)}function Av(e){var t=L(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function Tv(e){return Mv(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function Mv(e,t){return t.some(function(n){return Xn(e,n)})}function HC(e){return m(e,"bpmn:ReceiveTask")&&ne(e.incoming,function(t){return m(t.source,"bpmn:EventBasedGateway")})}function xs(e,t,n,r){if(Array.isArray(e)||(e=[e]),e.length!==1)return!1;var i=e[0];return te(i)||!FC(i)||Ue(t)||!m(t,"bpmn:Activity")||ru(t)||r&&!eu(r,t)||HC(t)?!1:"attach"}function Dv(e,t,n){if(!t)return!1;var r={replacements:[]};return E(e,function(i){Ue(t)||m(i,"bpmn:StartEvent")&&i.type!=="label"&&Fo(i,t)&&(gh(i)||r.replacements.push({oldElementId:i.id,newElementType:"bpmn:StartEvent"}),(vh(i)||yh(i)||_h(i))&&r.replacements.push({oldElementId:i.id,newElementType:"bpmn:StartEvent"}),Mv(i,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&m(t,"bpmn:SubProcess")&&r.replacements.push({oldElementId:i.id,newElementType:"bpmn:StartEvent"})),m(t,"bpmn:Transaction")||Xn(i,"bpmn:CancelEventDefinition")&&i.type!=="label"&&(m(i,"bpmn:EndEvent")&&Fo(i,t)&&r.replacements.push({oldElementId:i.id,newElementType:"bpmn:EndEvent"}),m(i,"bpmn:BoundaryEvent")&&xs(i,t,null,n)&&r.replacements.push({oldElementId:i.id,newElementType:"bpmn:BoundaryEvent"}))}),r.replacements.length?r:!1}function kv(e,t){return Nt(e,jC)?!1:t?e.every(function(n){return Fo(n,t)}):!0}function _f(e,t,n,r){return t?te(e)||xf(e)?!0:Fo(e,t,r)||nu(e,t,r):!1}function Ov(e,t){return m(e,"bpmn:SubProcess")?ie(e)&&(!t||t.width>=100&&t.height>=80):!!(m(e,"bpmn:Lane")||m(e,"bpmn:Participant")||yf(e)||xf(e))}function $C(e,t){var n=yf(e),r=yf(t);return(n||r)&&n!==r}function Nv(e,t){return Ev(t,e)||Ev(e,t)?!1:$C(e,t)?!0:!!bf(e,t)}function Bv(e,t){return Cv(e,t)&&Sv(e)&&m(t,"bpmn:Activity")&&!VC(t,e)&&!Ue(t)}function Iv(e,t){return wv(e)&&!wv(t)?!1:DC(e)&&kC(t)&&!MC(e,t)}function Lv(e,t){return OC(e)&&NC(t)&&Cv(e,t)&&!(m(e,"bpmn:EventBasedGateway")&&!BC(t))}function bf(e,t){return Q(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&Q(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:Q(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&Q(e,["bpmn:Activity","bpmn:CatchEvent"])?{type:"bpmn:DataOutputAssociation"}:!1}function nu(e,t,n){if(!t)return!1;if(Array.isArray(e)){if(e.length!==1)return!1;e=e[0]}return t.source===e||t.target===e?!1:Q(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!te(t)&&m(e,"bpmn:FlowNode")&&!m(e,"bpmn:BoundaryEvent")&&Fo(e,t.parent,n)}function zC(e,t){return e&&t&&e.indexOf(t)!==-1}function jv(e,t){return te(t)?!0:!(m(t,"bpmn:Lane")&&!zC(e,t.parent))}function wv(e){return yr(e,"bpmn:Process")||yr(e,"bpmn:Collaboration")}function VC(e,t){return e.attachers.includes(t)}var Fv={__depends__:[ft],__init__:["bpmnRules"],bpmnRules:["type",dt]};var WC=2e3;function iu(e,t){e.on("saveXML.start",WC,n);function n(){var r=t.getRootElements();E(r,function(i){var o=se(i),a,s;a=Fn([i],!1),a=J(a,function(c){return c!==i&&!c.labelTarget}),s=He(a,se),o.set("planeElement",s)})}}iu.$inject=["eventBus","canvas"];var Hv={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",iu]};function Ho(e){k.call(this,e);var t=this;this.preExecute(["shape.create","connection.create"],function(n){var r=n.context,i=r.shape||r.connection,o=r.parent,a=t.getOrdering(i,o);a&&(a.parent!==void 0&&(r.parent=a.parent),r.parentIndex=a.index)}),this.preExecute(["shape.move","connection.move"],function(n){var r=n.context,i=r.shape||r.connection,o=r.newParent||i.parent,a=t.getOrdering(i,o);a&&(a.parent!==void 0&&(r.newParent=a.parent),r.newParentIndex=a.index)})}Ho.prototype.getOrdering=function(e,t){return null};N(Ho,k);function bs(e,t){Ho.call(this,e);var n=[{type:"bpmn:SubProcess",order:{level:6}},{type:"bpmn:SequenceFlow",order:{level:9,containers:["bpmn:Participant","bpmn:FlowElementsContainer"]}},{type:"bpmn:DataAssociation",order:{level:9,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:TextAnnotation",order:{level:9}},{type:"bpmn:MessageFlow",order:{level:9,containers:["bpmn:Collaboration"]}},{type:"bpmn:Association",order:{level:6,containers:["bpmn:Participant","bpmn:FlowElementsContainer","bpmn:Collaboration"]}},{type:"bpmn:BoundaryEvent",order:{level:8}},{type:"bpmn:Group",order:{level:10,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:FlowElement",order:{level:5}},{type:"bpmn:Participant",order:{level:-2}},{type:"bpmn:Lane",order:{level:-1}}];function r(a){if(a.labelTarget)return{level:10};var s=ne(n,function(c){return Q(a,[c.type])});return s&&s.order||{level:1}}function i(a){var s=a.order;if(s||(a.order=s=r(a)),!s)throw new Error(`no order for <${a.id}>`);return s}function o(a,s,c){for(var p=s;p&&!Q(p,c);)p=p.parent;if(!p)throw new Error(`no parent for <${a.id}> in <${s&&s.id}>`);return p}this.getOrdering=function(a,s){if(a.labelTarget||m(a,"bpmn:TextAnnotation"))return{parent:t.findRoot(s)||t.getRootElement(),index:-1};var c=i(a);c.containers&&(s=o(a,s,c.containers));var p=s.children.indexOf(a),u=Ks(s.children,function(l){return!a.labelTarget&&l.labelTarget?!1:c.level0&&this._modeling.removeElements(r),t};Dt.prototype._getElementIdsFromTree=function(e){var t={};return E(e,function(n){E(n,function(r){r.id&&(t[r.id]=!0)})}),t};Dt.prototype._paste=function(e,t,n,r){E(e,function(o){ee(o.x)||(o.x=0),ee(o.y)||(o.y=0)});var i=Ee(e);return E(e,function(o){fe(o)&&(o.waypoints=He(o.waypoints,function(a){return{x:a.x-i.x-i.width/2,y:a.y-i.y-i.height/2}})),C(o,{x:o.x-i.x-i.width/2,y:o.y-i.y-i.height/2})}),this._modeling.createElements(e,n,t,C({},r))};Dt.prototype._createElements=function(e){var t=this,n=this._eventBus,r={},i=[];return E(e,function(o,a){a=parseInt(a,10),o=St(o,"priority"),E(o,function(s){var c=C({},At(s,["priority"]));r[s.parent]?c.parent=r[s.parent]:delete c.parent,n.fire("copyPaste.pasteElement",{cache:r,descriptor:c});var p;if(fe(c)){c.source=r[s.source],c.target=r[s.target],p=r[s.id]=t.createConnection(c),i.push(p);return}if(te(c)){c.labelTarget=r[c.labelTarget],p=r[s.id]=t.createLabel(c),i.push(p);return}c.host&&(c.host=r[c.host]),p=r[s.id]=t.createShape(c),i.push(p)})}),i};Dt.prototype.createConnection=function(e){var t=this._elementFactory.createConnection(At(e,["id"]));return t};Dt.prototype.createLabel=function(e){var t=this._elementFactory.createLabel(At(e,["id"]));return t};Dt.prototype.createShape=function(e){var t=this._elementFactory.createShape(At(e,["id"]));return t};Dt.prototype.hasRelations=function(e,t){var n,r,i;return!(fe(e)&&(r=ne(t,yt({id:e.source.id})),i=ne(t,yt({id:e.target.id})),!r||!i)||te(e)&&(n=ne(t,yt({id:e.labelTarget.id})),!n))};Dt.prototype.createTree=function(e){var t=this._rules,n=this,r={},i=[],o=Dr(e);function a(p,u){return t.allowed("element.copy",{element:p,elements:u})}function s(p,u){var l=ne(i,function(f){return p===f.element});if(!l){i.push({element:p,depth:u});return}l.depth{u.push(l.annotation)})}),t.on("copyPaste.pasteElement",wf,function(c){var p=c.cache,u=c.descriptor;a(p,s(u,p,o(p)))})}su.$inject=["bpmnFactory","eventBus","moddleCopy"];var ZC=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing","categoryValue"],QC=["errorRef","escalationRef","messageRef","signalRef","dataObjectRef"];function Pi(e,t,n){this._bpmnFactory=t,this._eventBus=e,this._moddle=n,e.on("moddleCopy.canCopyProperties",r=>{let{propertyNames:i}=r;if(!(!i||!i.length))return St(i,o=>o==="extensionElements")}),e.on("moddleCopy.canCopyProperty",r=>{let{parent:i,property:o,propertyName:a}=r,s=Ce(i)&&i.$descriptor;if(a&&QC.includes(a))return o;if(a&&ZC.includes(a)||a&&s&&!ne(s.properties,yt({name:a})))return!1}),e.on("moddleCopy.canSetCopiedProperty",r=>{let{property:i}=r;if(m(i,"bpmn:ExtensionElements")&&(!i.values||!i.values.length))return!1})}Pi.$inject=["eventBus","bpmnFactory","moddle"];Pi.prototype.copyElement=function(e,t,n,r=!1){n&&!U(n)&&(n=[n]),n=n||cu(e.$descriptor);let i=this._eventBus.fire("moddleCopy.canCopyProperties",{propertyNames:n,sourceElement:e,targetElement:t,clone:r});return i===!1||(U(i)&&(n=i),E(n,o=>{let a;tt(e,o)&&(a=e.get(o));let s=this.copyProperty(a,t,o,r);!Ge(s)||this._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent:t,property:s,propertyName:o})===!1||t.set(o,s)})),t};Pi.prototype.copyProperty=function(e,t,n,r=!1){let i=this._eventBus.fire("moddleCopy.canCopyProperty",{parent:t,property:e,propertyName:n,clone:r});if(i===!1)return;if(i)return Ce(i)&&i.$type&&!i.$parent&&(i.$parent=t),i;let o=this._moddle.getPropertyDescriptor(t,n);if(!o.isReference)return o.isId?e&&this._copyId(e,t,r):U(e)?Ke(e,(a,s)=>{let c=this.copyProperty(s,t,n,r);return c?a.concat(c):a},[]):Ce(e)&&e.$type?this._moddle.getElementDescriptor(e).isGeneric?void 0:(i=this._bpmnFactory.create(e.$type),i.$parent=t,i=this.copyElement(e,i,null,r),i):e};Pi.prototype._copyId=function(e,t,n=!1){if(n)return e;if(!this._moddle.ids.assigned(e))return this._moddle.ids.claim(e,t),e};function cu(e,t){return Ke(e.properties,(n,r)=>t&&r.default?n:n.concat(r.name),[])}var pu={__depends__:[Qv],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",su],moddleCopy:["type",Pi]};var Jv=Math.round;function ws(e,t){this._modeling=e,this._eventBus=t}ws.$inject=["modeling","eventBus"];ws.prototype.replaceElement=function(e,t,n){if(e.waypoints)return null;var r=this._modeling,i=this._eventBus;i.fire("replace.start",{element:e,attrs:t,hints:n});var o=t.width||e.width,a=t.height||e.height,s=t.x||e.x,c=t.y||e.y,p=Jv(s+o/2),u=Jv(c+a/2),l=r.replaceShape(e,C({},t,{x:p,y:u,width:o,height:a}),n);return i.fire("replace.end",{element:e,newElement:l,hints:n}),l};function uu(e,t){t.on("replace.end",500,function(n){let{newElement:r,hints:i={}}=n;i.select!==!1&&e.select(r)})}uu.$inject=["selection","eventBus"];var ey={__init__:["replace","replaceSelectionBehavior"],replaceSelectionBehavior:["type",uu],replace:["type",ws]};function JC(e,t,n){U(n)||(n=[n]),E(n,function(r){Ln(e[r])||(t[r]=e[r])})}var eR=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function tR(e,t){var n=e&&tt(e,"collapsed")?e.collapsed:!ie(e),r;return t&&(tt(t,"collapsed")||tt(t,"isExpanded"))?r=tt(t,"collapsed")?t.collapsed:!t.isExpanded:r=n,n!==r}function fu(e,t,n,r,i,o){function a(s,c,p){p=p||{};var u=c.type,l=s.businessObject;if(lu(l)&&(u==="bpmn:SubProcess"||u==="bpmn:AdHocSubProcess")&&tR(s,c))return r.toggleCollapse(s),s;var f=e.create(u),d={type:u,businessObject:f};d.di={},u==="bpmn:ExclusiveGateway"&&(d.di.isMarkerVisible=!0),JC(s.di,d.di,["fill","stroke","background-color","border-color","color"]);var h=cu(l.$descriptor),_=cu(f.$descriptor,!0),v=nR(h,_);C(f,pt(c,eR));var w=J(v,function(x){return x==="eventDefinitions"?ty(s,c.eventDefinitionType):x==="loopCharacteristics"?!Ue(f):tt(f,x)||x==="processRef"&&c.isExpanded===!1||x==="triggeredByEvent"?!1:x==="isForCompensation"?!Ue(f):!0});if(f=n.copyElement(l,f,w),c.eventDefinitionType&&(ty(f,c.eventDefinitionType)||(d.eventDefinitionType=c.eventDefinitionType,d.eventDefinitionAttrs=c.eventDefinitionAttrs)),m(l,"bpmn:Activity")){if(lu(l))d.isExpanded=ie(s);else if(c&&tt(c,"isExpanded")){d.isExpanded=c.isExpanded;var P=t.getDefaultSize(f,{isExpanded:d.isExpanded});d.width=P.width,d.height=P.height,d.x=s.x-(d.width-s.width)/2,d.y=s.y-(d.height-s.height)/2}ie(s)&&!m(l,"bpmn:Task")&&d.isExpanded&&(d.width=s.width,d.height=s.height)}if(lu(l)&&!lu(f)&&(p.moveChildren=!1),m(l,"bpmn:Participant")){c.isExpanded===!0?f.processRef=e.create("bpmn:Process"):p.moveChildren=!1;var b=Re(s);se(s).isHorizontal||(se(d).isHorizontal=b),d.width=b?s.width:t.getDefaultSize(d).width,d.height=b?t.getDefaultSize(d).height:s.height}return o.allowed("shape.resize",{shape:f})||(d.height=t.getDefaultSize(d).height,d.width=t.getDefaultSize(d).width),f.name=l.name,Q(l,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&Q(f,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&(f.default=l.default),c.host&&!m(l,"bpmn:BoundaryEvent")&&m(f,"bpmn:BoundaryEvent")&&(d.host=c.host),(d.type==="bpmn:DataStoreReference"||d.type==="bpmn:DataObjectReference")&&(d.x=s.x+(s.width-d.width)/2),i.replaceElement(s,d,{...p,targetElement:c})}this.replaceElement=a}fu.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules"];function lu(e){return m(e,"bpmn:SubProcess")}function ty(e,t){var n=L(e);return t&&n.get("eventDefinitions").some(function(r){return m(r,t)})}function nR(e,t){return e.filter(function(n){return t.includes(n)})}var du={__depends__:[pu,ey,qe],bpmnReplace:["type",fu]};var rR=250;function _r(e){this._eventBus=e,this._tools=[],this._active=null}_r.$inject=["eventBus"];_r.prototype.registerTool=function(e,t){var n=this._tools;if(!t)throw new Error(`A tool has to be registered with it's "events"`);n.push(e),this.bindEvents(e,t)};_r.prototype.isActive=function(e){return e&&this._active===e};_r.prototype.length=function(e){return this._tools.length};_r.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))};_r.prototype.bindEvents=function(e,t){var n=this._eventBus,r=[];n.on(t.tool+".init",function(i){var o=i.context;if(!o.reactivate&&this.isActive(e)){this.setActive(null);return}this.setActive(e)},this),E(t,function(i){r.push(i+".ended"),r.push(i+".canceled")}),n.on(r,rR,function(i){this._active&&(iR(i)||this.setActive(null))},this)};function iR(e){var t=e.originalEvent&&e.originalEvent.target;return t&&Sn(t,'.group[data-group="tools"]')}var ti={__depends__:[wt],__init__:["toolManager"],toolManager:["type",_r]};function ny(e,t){if(e==="x"){if(t>0)return"e";if(t<0)return"w"}if(e==="y"){if(t>0)return"s";if(t<0)return"n"}return null}function ry(e,t){var n=[];return E(e.concat(t),function(r){var i=r.incoming,o=r.outgoing;E(i.concat(o),function(a){var s=a.source,c=a.target;(Ss(e,s)||Ss(e,c)||Ss(t,s)||Ss(t,c))&&(Ss(n,a)||n.push(a))})}),n}function Ss(e,t){return e.indexOf(t)!==-1}function iy(e,t,n){var r=e.x,i=e.y,o=e.width,a=e.height,s=n.x,c=n.y;switch(t){case"n":return{x:r,y:i+c,width:o,height:a-c};case"s":return{x:r,y:i,width:o,height:a+c};case"w":return{x:r+s,y:i,width:o-s,height:a};case"e":return{x:r,y:i,width:o+s,height:a};default:throw new Error("unknown direction: "+t)}}var Sf=Math.abs,oR=Math.round,xr={x:"width",y:"height"},sy="crosshair",ni={n:"top",w:"left",s:"bottom",e:"right"},aR=1500,hu={n:"s",w:"e",s:"n",e:"w"},mu=20;function Ht(e,t,n,r,i,o,a){this._canvas=e,this._dragging=t,this._eventBus=n,this._modeling=r,this._rules=i,this._toolManager=o,this._mouse=a;var s=this;o.registerTool("space",{tool:"spaceTool.selection",dragging:"spaceTool"}),n.on("spaceTool.selection.end",function(c){n.once("spaceTool.selection.ended",function(){s.activateMakeSpace(c.originalEvent)})}),n.on("spaceTool.move",aR,function(c){var p=c.context,u=p.initialized;u||(u=p.initialized=s.init(c,p)),u&&ay(c)}),n.on("spaceTool.end",function(c){var p=c.context,u=p.axis,l=p.direction,f=p.movingShapes,d=p.resizingShapes,h=p.start;if(p.initialized){ay(c);var _={x:0,y:0};_[u]=oR(c["d"+u]),s.makeSpace(f,d,_,l,h),n.once("spaceTool.ended",function(v){s.activateSelection(v.originalEvent,!0,!0)})}})}Ht.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"];Ht.prototype.activateSelection=function(e,t,n){this._dragging.init(e,"spaceTool.selection",{autoActivate:t,cursor:sy,data:{context:{reactivate:n}},trapClick:!1})};Ht.prototype.activateMakeSpace=function(e){this._dragging.init(e,"spaceTool",{autoActivate:!0,cursor:sy,data:{context:{}}})};Ht.prototype.makeSpace=function(e,t,n,r,i){return this._modeling.createSpace(e,t,n,r,i)};Ht.prototype.init=function(e,t){var n=Sf(e.dx)>Sf(e.dy)?"x":"y",r=e["d"+n],i=e[n]-r;if(Sf(r)<5)return!1;r<0&&(r*=-1),hr(e)&&(r*=-1);var o=ny(n,r),a=this._canvas.getRootElement();!mi(e)&&e.hover&&(a=e.hover);var s=[...Fn(a,!0),...a.attachers||[]],c=this.calculateAdjustments(s,n,r,i),p=this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:c.resizingShapes,start:i}),u=sR(c,n,o,i,p);return C(t,c,{axis:n,direction:o,spaceToolConstraints:u,start:i}),gi("resize-"+(n==="x"?"ew":"ns")),!0};Ht.prototype.calculateAdjustments=function(e,t,n,r){var i=this._rules,o=[],a=[],s=[],c=[];function p(f){o.includes(f)||o.push(f);var d=f.label;d&&!o.includes(d)&&o.push(d)}function u(f){a.includes(f)||a.push(f)}E(e,function(f){if(!(!f.parent||te(f))){if(fe(f)){c.push(f);return}var d=f[t],h=d+f[xr[t]];if(cR(f)&&(n>0&&Y(f)[t]>r||n<0&&Y(f)[t]0&&d>r||n<0&&hr&&i.allowed("shape.resize",{shape:f})){u(f);return}}}),E(o,function(f){var d=f.attachers;d&&E(d,function(h){p(h)})});var l=o.concat(a);return E(s,function(f){var d=f.host;Ai(l,d)&&p(f)}),l=o.concat(a),E(c,function(f){var d=f.source,h=f.target,_=f.label;Ai(l,d)&&Ai(l,h)&&_&&p(_)}),{movingShapes:o,resizingShapes:a}};Ht.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)};Ht.prototype.isActive=function(){var e=this._dragging.context();return e?/^spaceTool/.test(e.prefix):!1};function oy(e){return{top:e.top-mu,right:e.right+mu,bottom:e.bottom+mu,left:e.left-mu}}function ay(e){var t=e.context,n=t.spaceToolConstraints;if(n){var r,i;ee(n.left)&&(r=Math.max(e.x,n.left),e.dx=e.dx+r-e.x,e.x=r),ee(n.right)&&(r=Math.min(e.x,n.right),e.dx=e.dx+r-e.x,e.x=r),ee(n.top)&&(i=Math.max(e.y,n.top),e.dy=e.dy+i-e.y,e.y=i),ee(n.bottom)&&(i=Math.min(e.y,n.bottom),e.dy=e.dy+i-e.y,e.y=i)}}function sR(e,t,n,r,i){var o=e.movingShapes,a=e.resizingShapes;if(a.length){var s={},c,p;return E(a,function(u){var l=u.attachers,f=u.children,d=X(u),h=J(f,function(I){return!fe(I)&&!te(I)&&!Ai(o,I)&&!Ai(a,I)}),_=J(f,function(I){return!fe(I)&&!te(I)&&Ai(o,I)}),v,w,P,b=[],x=[],S,A,O,M;h.length&&(w=oy(X(Ee(h))),v=r-d[ni[n]]+w[ni[n]],n==="n"?s.bottom=p=ee(p)?Math.min(p,v):v:n==="w"?s.right=p=ee(p)?Math.min(p,v):v:n==="s"?s.top=c=ee(c)?Math.max(c,v):v:n==="e"&&(s.left=c=ee(c)?Math.max(c,v):v)),_.length&&(P=oy(X(Ee(_))),v=r-P[ni[hu[n]]]+d[ni[hu[n]]],n==="n"?s.bottom=p=ee(p)?Math.min(p,v):v:n==="w"?s.right=p=ee(p)?Math.min(p,v):v:n==="s"?s.top=c=ee(c)?Math.max(c,v):v:n==="e"&&(s.left=c=ee(c)?Math.max(c,v):v)),l&&l.length&&(l.forEach(function(I){Ai(o,I)?b.push(I):x.push(I)}),b.length&&(S=X(Ee(b.map(Y))),A=d[ni[hu[n]]]-(S[ni[hu[n]]]-r)),x.length&&(O=X(Ee(x.map(Y))),M=O[ni[n]]-(d[ni[n]]-r)),n==="n"?(v=Math.min(A||1/0,M||1/0),s.bottom=p=ee(p)?Math.min(p,v):v):n==="w"?(v=Math.min(A||1/0,M||1/0),s.right=p=ee(p)?Math.min(p,v):v):n==="s"?(v=Math.max(A||-1/0,M||-1/0),s.top=c=ee(c)?Math.max(c,v):v):n==="e"&&(v=Math.max(A||-1/0,M||-1/0),s.left=c=ee(c)?Math.max(c,v):v));var B=i&&i[u.id];B&&(n==="n"?(v=r+u[xr[t]]-B[xr[t]],s.bottom=p=ee(p)?Math.min(p,v):v):n==="w"?(v=r+u[xr[t]]-B[xr[t]],s.right=p=ee(p)?Math.min(p,v):v):n==="s"?(v=r-u[xr[t]]+B[xr[t]],s.top=c=ee(c)?Math.max(c,v):v):n==="e"&&(v=r-u[xr[t]]+B[xr[t]],s.left=c=ee(c)?Math.max(c,v):v))}),s}}function Ai(e,t){return e.indexOf(t)!==-1}function cR(e){return!!e.host}var Cf="djs-dragging",cy="djs-resizing",pR=250,gu=Math.max;function vu(e,t,n,r,i){function o(a,s){E(a,function(c){i.addDragger(c,s),n.addMarker(c,Cf)})}e.on("spaceTool.selection.start",function(a){var s=n.getLayer("space"),c=a.context,p={x:"M 0,-10000 L 0,10000",y:"M -10000,0 L 10000,0"},u=G("g");$(u,r.cls("djs-crosshair-group",["no-events"])),Z(s,u);var l=G("path");$(l,"d",p.x),ue(l).add("djs-crosshair"),Z(u,l);var f=G("path");$(f,"d",p.y),ue(f).add("djs-crosshair"),Z(u,f),c.crosshairGroup=u}),e.on("spaceTool.selection.move",function(a){var s=a.context.crosshairGroup;ke(s,a.x,a.y)}),e.on("spaceTool.selection.cleanup",function(a){var s=a.context,c=s.crosshairGroup;c&&be(c)}),e.on("spaceTool.move",pR,function(a){var s=a.context,c=s.line,p=s.axis,u=s.movingShapes,l=s.resizingShapes;if(s.initialized){if(!s.dragGroup){var f=n.getLayer("space");c=G("path"),$(c,"d","M0,0 L0,0"),ue(c).add("djs-crosshair"),Z(f,c),s.line=c;var d=G("g");$(d,r.cls("djs-drag-group",["no-events"])),Z(n.getActiveLayer(),d),o(u,d);var h=s.movingConnections=t.filter(function(x){var S=!1;E(u,function(B){E(B.outgoing,function(I){x===I&&(S=!0)})});var A=!1;E(u,function(B){E(B.incoming,function(I){x===I&&(A=!0)})});var O=!1;E(l,function(B){E(B.outgoing,function(I){x===I&&(O=!0)})});var M=!1;return E(l,function(B){E(B.incoming,function(I){x===I&&(M=!0)})}),fe(x)&&(S||O)&&(A||M)});o(h,d),s.dragGroup=d}if(!s.frameGroup){var _=G("g");$(_,r.cls("djs-frame-group",["no-events"])),Z(n.getActiveLayer(),_);var v=[];E(l,function(x){var S=i.addFrame(x,_),A=S.getBBox();v.push({element:S,initialBounds:A}),n.addMarker(x,cy)}),s.frameGroup=_,s.frames=v}var w={x:"M"+a.x+", -10000 L"+a.x+", 10000",y:"M -10000, "+a.y+" L 10000, "+a.y};$(c,{d:w[p]});var P={x:"y",y:"x"},b={x:a.dx,y:a.dy};b[P[s.axis]]=0,ke(s.dragGroup,b.x,b.y),E(s.frames,function(x){var S=x.element,A=x.initialBounds,O,M;s.direction==="e"?$(S,{width:gu(A.width+b.x,5)}):(O=gu(A.width-b.x,5),$(S,{width:O,x:A.x+A.width-O})),s.direction==="s"?$(S,{height:gu(A.height+b.y,5)}):(M=gu(A.height-b.y,5),$(S,{height:M,y:A.y+A.height-M}))})}}),e.on("spaceTool.cleanup",function(a){var s=a.context,c=s.movingShapes,p=s.movingConnections,u=s.resizingShapes,l=s.line,f=s.dragGroup,d=s.frameGroup;E(c,function(h){n.removeMarker(h,Cf)}),E(p,function(h){n.removeMarker(h,Cf)}),f&&(be(l),be(f)),E(u,function(h){n.removeMarker(h,cy)}),d&&be(d)})}vu.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];var py={__init__:["spaceToolPreview"],__depends__:[wt,ft,ti,xn,Zn],spaceTool:["type",Ht],spaceToolPreview:["type",vu]};function $o(e,t){e.invoke(Ht,this),this._canvas=t}$o.$inject=["injector","canvas"];N($o,Ht);$o.prototype.calculateAdjustments=function(e,t,n,r){var i=this._canvas.getRootElement(),o=e[0]===i?null:e[0],a=[];o&&(a=Pr(ec(i.children.filter(p=>m(p,"bpmn:Artifact")),Ee(o))));let s=[...e,...a];var c=Ht.prototype.calculateAdjustments.call(this,s,t,n,r);return c.resizingShapes=c.resizingShapes.filter(function(p){return!(m(p,"bpmn:TextAnnotation")||uR(p)&&(t==="y"&&Re(p)||t==="x"&&!Re(p)))}),c};function uR(e){return m(e,"bpmn:Participant")&&!L(e).processRef}var yu={__depends__:[py],spaceTool:["type",$o]};function Fe(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],function(){this.clear(!1)},this)}Fe.$inject=["eventBus","injector"];Fe.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";let n={command:e,context:t};this._pushAction(n),this._internalExecute(n),this._popAction()};Fe.prototype.canExecute=function(e,t){let n={command:e,context:t},r=this._getHandler(e),i=this._fire(e,"canExecute",n);if(i===void 0){if(!r)return!1;r.canExecute&&(i=r.canExecute(t))}return i};Fe.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,e!==!1&&this._fire("changed",{trigger:"clear"})};Fe.prototype.undo=function(){let e=this._getUndoAction(),t;if(e){for(this._currentExecution.trigger="undo",this._pushAction(e);e&&(this._internalUndo(e),t=this._getUndoAction(),!(!t||t.id!==e.id));)e=t;this._popAction()}};Fe.prototype.redo=function(){let e=this._getRedoAction(),t;if(e){for(this._currentExecution.trigger="redo",this._pushAction(e);e&&(this._internalExecute(e,!0),t=this._getRedoAction(),!(!t||t.id!==e.id));)e=t;this._popAction()}};Fe.prototype.register=function(e,t){this._setHandler(e,t)};Fe.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");let n=this._injector.instantiate(t);this.register(e,n)};Fe.prototype.canUndo=function(){return!!this._getUndoAction()};Fe.prototype.canRedo=function(){return!!this._getRedoAction()};Fe.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]};Fe.prototype._getUndoAction=function(){return this._stack[this._stackIdx]};Fe.prototype._internalUndo=function(e){let t=e.command,n=e.context,r=this._getHandler(t);this._atomicDo(()=>{this._fire(t,"revert",e),r.revert&&this._markDirty(r.revert(n)),this._revertedAction(e),this._fire(t,"reverted",e)})};Fe.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);let r=t?[e+"."+t,t]:[e],i;n=this._eventBus.createEvent(n);for(let o of r)if(i=this._eventBus.fire("commandStack."+o,n),n.cancelBubble)break;return i};Fe.prototype._createId=function(){return this._uid++};Fe.prototype._atomicDo=function(e){let t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}};Fe.prototype._internalExecute=function(e,t){let n=e.command,r=e.context,i=this._getHandler(n);if(!i)throw new Error("no command handler registered for <"+n+">");this._pushAction(e),t||(this._fire(n,"preExecute",e),i.preExecute&&i.preExecute(r),this._fire(n,"preExecuted",e)),this._atomicDo(()=>{this._fire(n,"execute",e),i.execute&&this._markDirty(i.execute(r)),this._executedAction(e,t),this._fire(n,"executed",e)}),t||(this._fire(n,"postExecute",e),i.postExecute&&i.postExecute(r),this._fire(n,"postExecuted",e)),this._popAction()};Fe.prototype._pushAction=function(e){let t=this._currentExecution,n=t.actions,r=n[0];if(t.atomic)throw new Error("illegal invocation in or phase (action: "+e.command+")");e.id||(e.id=r&&r.id||this._createId()),n.push(e)};Fe.prototype._popAction=function(){let e=this._currentExecution,t=e.trigger,n=e.actions,r=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:qu("id",r.reverse())}),r.length=0,this._fire("changed",{trigger:t}),e.trigger=null)};Fe.prototype._markDirty=function(e){let t=this._currentExecution;e&&(e=U(e)?e:[e],t.dirty=t.dirty.concat(e))};Fe.prototype._executedAction=function(e,t){let n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)};Fe.prototype._revertedAction=function(e){this._stackIdx--};Fe.prototype._getHandler=function(e){return this._handlerMap[e]};Fe.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};var uy={commandStack:["type",Fe]};function bn(e,t){if(typeof t!="function")throw new Error("removeFn iterator must be a function");if(e){for(var n;n=e[0];)t(n);return e}}var lR=250,ly=1400;function Cs(e,t,n){k.call(this,t);var r=e.get("movePreview",!1);t.on("shape.move.start",ly,function(i){var o=i.context,a=o.shapes,s=o.validatedShapes;o.shapes=fy(a),o.validatedShapes=fy(s)}),r&&t.on("shape.move.start",lR,function(i){var o=i.context,a=o.shapes,s=[];E(a,function(c){E(c.labels,function(p){!p.hidden&&o.shapes.indexOf(p)===-1&&s.push(p),c.labelTarget&&s.push(c)})}),E(s,function(c){r.makeDraggable(o,c,!0)})}),this.preExecuted("elements.move",ly,function(i){var o=i.context,a=o.closure,s=a.enclosedElements,c=[];E(s,function(p){E(p.labels,function(u){s[u.id]||c.push(u)})}),a.addAll(c)}),this.preExecute(["connection.delete","shape.delete"],function(i){var o=i.context,a=o.connection||o.shape;bn(a.labels,function(s){n.removeShape(s,{nested:!0})})}),this.execute("shape.delete",function(i){var o=i.context,a=o.shape,s=a.labelTarget;s&&(o.labelTargetIndex=qi(s.labels,a),o.labelTarget=s,a.labelTarget=null)}),this.revert("shape.delete",function(i){var o=i.context,a=o.shape,s=o.labelTarget,c=o.labelTargetIndex;s&&(we(s.labels,a,c),a.labelTarget=s)})}N(Cs,k);Cs.$inject=["injector","eventBus","modeling"];function fy(e){return J(e,function(t){return e.indexOf(t.labelTarget)===-1})}var dy={__init__:["labelSupport"],labelSupport:["type",Cs]};var fR=251,hy=1401,my="attach-ok";function Rs(e,t,n,r,i){k.call(this,t);var o=e.get("movePreview",!1);t.on("shape.move.start",hy,function(a){var s=a.context,c=s.shapes,p=s.validatedShapes;s.shapes=dR(c),s.validatedShapes=hR(p)}),o&&t.on("shape.move.start",fR,function(a){var s=a.context,c=s.shapes,p=Rf(c);E(p,function(u){o.makeDraggable(s,u,!0),E(u.labels,function(l){o.makeDraggable(s,l,!0)})})}),o&&t.on("shape.move.start",function(a){var s=a.context,c=s.shapes;if(c.length===1){var p=c[0],u=p.host;u&&(n.addMarker(u,my),t.once(["shape.move.out","shape.move.cleanup"],function(){n.removeMarker(u,my)}))}}),this.preExecuted("elements.move",hy,function(a){var s=a.context,c=s.closure,p=s.shapes,u=Rf(p);E(u,function(l){c.add(l,c.topLevel[l.host.id])})}),this.postExecuted("elements.move",function(a){var s=a.context,c=s.shapes,p=s.newHost,u;p&&c.length!==1||(p?u=c:u=J(c,function(l){var f=l.host;return mR(l)&&!gR(c,f)}),E(u,function(l){i.updateAttachment(l,p)}))}),this.postExecuted("elements.move",function(a){var s=a.context.shapes;E(s,function(c){E(c.attachers,function(p){E(p.outgoing.slice(),function(u){var l=r.allowed("connection.reconnect",{connection:u,source:u.source,target:u.target});l||i.removeConnection(u)}),E(p.incoming.slice(),function(u){var l=r.allowed("connection.reconnect",{connection:u,source:u.source,target:u.target});l||i.removeConnection(u)})})})}),this.postExecute("shape.create",function(a){var s=a.context,c=s.shape,p=s.host;p&&i.updateAttachment(c,p)}),this.postExecute("shape.replace",function(a){var s=a.context,c=s.oldShape,p=s.newShape;bn(c.attachers,function(u){var l=r.allowed("elements.move",{target:p,shapes:[u]});l==="attach"?i.updateAttachment(u,p):i.removeShape(u)}),p.attachers.length&&E(p.attachers,function(u){var l=lf(u,c,p);i.moveShape(u,l,u.parent)})}),this.postExecute("shape.resize",function(a){var s=a.context,c=s.shape,p=s.oldBounds,u=s.newBounds,l=c.attachers,f=s.hints||{};f.attachSupport!==!1&&E(l,function(d){var h=lf(d,p,u);i.moveShape(d,h,d.parent),E(d.labels,function(_){i.moveShape(_,h,_.parent)})})}),this.preExecute("shape.delete",function(a){var s=a.context.shape;bn(s.attachers,function(c){i.removeShape(c)}),s.host&&i.updateAttachment(s,null)})}N(Rs,k);Rs.$inject=["injector","eventBus","canvas","rules","modeling"];function Rf(e){return Ui(He(e,function(t){return t.attachers||[]}))}function dR(e){var t=Rf(e);return ed("id",e,t)}function hR(e){var t=wn(e,"id");return J(e,function(n){for(;n;){if(n.host&&t[n.host.id])return!1;n=n.parent}return!0})}function mR(e){return!!e.host}function gR(e,t){return e.indexOf(t)!==-1}var gy={__depends__:[ft],__init__:["attachSupport"],attachSupport:["type",Rs]};function qt(e){this._model=e}qt.$inject=["moddle"];qt.prototype._needsId=function(e){return Q(e,["bpmn:RootElement","bpmn:FlowElement","bpmn:MessageFlow","bpmn:DataAssociation","bpmn:Artifact","bpmn:Participant","bpmn:Lane","bpmn:LaneSet","bpmn:Process","bpmn:Collaboration","bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane","bpmn:Property","bpmn:CategoryValue"])};qt.prototype._ensureId=function(e){if(e.id){this._model.ids.claim(e.id,e);return}var t;m(e,"bpmn:Activity")?t="Activity":m(e,"bpmn:Event")?t="Event":m(e,"bpmn:Gateway")?t="Gateway":Q(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])?t="Flow":t=(e.$type||"").replace(/^[^:]*:/g,""),t+="_",!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e))};qt.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n};qt.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})};qt.prototype.createDiShape=function(e,t){return this.create("bpmndi:BPMNShape",C({bpmnElement:e,bounds:this.createDiBounds()},t))};qt.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)};qt.prototype.createDiWaypoints=function(e){var t=this;return He(e,function(n){return t.createDiWaypoint(n)})};qt.prototype.createDiWaypoint=function(e){return this.create("dc:Point",pt(e,["x","y"]))};qt.prototype.createDiEdge=function(e,t){return this.create("bpmndi:BPMNEdge",C({bpmnElement:e,waypoint:this.createDiWaypoints([])},t))};qt.prototype.createDiPlane=function(e,t){return this.create("bpmndi:BPMNPlane",C({bpmnElement:e},t))};function kt(e,t,n){k.call(this,e),this._bpmnFactory=t;var r=this;function i(d){var h=d.context,_=h.hints||{},v;!h.cropped&&_.createElementsBehavior!==!1&&(v=h.connection,v.waypoints=n.getCroppedWaypoints(v),h.cropped=!0)}this.executed(["connection.layout","connection.create"],i),this.reverted(["connection.layout"],function(d){delete d.context.cropped});function o(d){var h=d.context;r.updateParent(h.shape||h.connection,h.oldParent)}function a(d){var h=d.context,_=h.shape||h.connection,v=h.parent||h.newParent;r.updateParent(_,v)}this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Xt(o)),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Xt(a));function s(d){var h=d.context,_=h.oldRoot,v=_.children;E(v,function(w){m(w,"bpmn:BaseElement")&&r.updateParent(w)})}this.executed(["canvas.updateRoot"],s),this.reverted(["canvas.updateRoot"],s);function c(d){var h=d.context.shape;m(h,"bpmn:BaseElement")&&r.updateBounds(h)}this.executed(["shape.move","shape.create","shape.resize"],Xt(function(d){d.context.shape.type!=="label"&&c(d)})),this.reverted(["shape.move","shape.create","shape.resize"],Xt(function(d){d.context.shape.type!=="label"&&c(d)})),e.on("shape.changed",function(d){d.element.type==="label"&&c({context:{shape:d.element}})});function p(d){r.updateConnection(d.context)}this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],Xt(p)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],Xt(p));function u(d){r.updateConnectionWaypoints(d.context.connection)}this.executed(["connection.layout","connection.move","connection.updateWaypoints"],Xt(u)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],Xt(u)),this.executed("connection.reconnect",Xt(function(d){var h=d.context,_=h.connection,v=h.oldSource,w=h.newSource,P=L(_),b=L(v),x=L(w);P.conditionExpression&&!Q(x,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(h.oldConditionExpression=P.conditionExpression,delete P.conditionExpression),v!==w&&b.default===P&&(h.oldDefault=b.default,delete b.default)})),this.reverted("connection.reconnect",Xt(function(d){var h=d.context,_=h.connection,v=h.oldSource,w=h.newSource,P=L(_),b=L(v),x=L(w);h.oldConditionExpression&&(P.conditionExpression=h.oldConditionExpression),h.oldDefault&&(b.default=h.oldDefault,delete x.default)}));function l(d){r.updateAttachment(d.context)}this.executed(["element.updateAttachment"],Xt(l)),this.reverted(["element.updateAttachment"],Xt(l)),this.executed("element.updateLabel",Xt(f)),this.reverted("element.updateLabel",Xt(f));function f(d){let{element:h}=d.context,_=xt(h),v=se(h),w=v&&v.get("label");nn(h)||po(h)||(_&&!w?v.set("label",t.create("bpmndi:BPMNLabel")):!_&&w&&v.set("label",void 0))}}N(kt,k);kt.$inject=["eventBus","bpmnFactory","connectionDocking"];kt.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,r=t.host;n.attachedToRef=r&&r.businessObject};kt.prototype.updateParent=function(e,t){if(!te(e)&&!(m(e,"bpmn:DataStoreReference")&&e.parent&&m(e.parent,"bpmn:Collaboration"))){var n=e.parent,r=e.businessObject,i=se(e),o=n&&n.businessObject,a=se(n);m(e,"bpmn:FlowNode")&&this.updateFlowNodeRefs(r,o,t&&t.businessObject),m(e,"bpmn:DataOutputAssociation")&&(e.source?o=e.source.businessObject:o=null),m(e,"bpmn:DataInputAssociation")&&(e.target?o=e.target.businessObject:o=null),this.updateSemanticParent(r,o),m(e,"bpmn:DataObjectReference")&&r.dataObjectRef&&this.updateSemanticParent(r.dataObjectRef,o),this.updateDiParent(i,a)}};kt.prototype.updateBounds=function(e){var t=se(e),n=yR(e);if(n){var r=Et(n,t.get("bounds"));C(n,{x:e.x+r.x,y:e.y+r.y})}var i=te(e)?this._getLabel(t):t,o=i.bounds;o||(o=this._bpmnFactory.createDiBounds(),i.set("bounds",o)),C(o,{x:e.x,y:e.y,width:e.width,height:e.height})};kt.prototype.updateFlowNodeRefs=function(e,t,n){if(n!==t){var r,i;m(n,"bpmn:Lane")&&(r=n.get("flowNodeRef"),Te(r,e)),m(t,"bpmn:Lane")&&(i=t.get("flowNodeRef"),we(i,e))}};kt.prototype.updateDiConnection=function(e,t,n){var r=se(e),i=se(t),o=se(n);r.sourceElement&&r.sourceElement.bpmnElement!==L(t)&&(r.sourceElement=t&&i),r.targetElement&&r.targetElement.bpmnElement!==L(n)&&(r.targetElement=n&&o)};kt.prototype.updateDiParent=function(e,t){if(t&&!m(t,"bpmndi:BPMNPlane")&&(t=t.$parent),e.$parent!==t){var n=(t||e.$parent).get("planeElement");t?(n.push(e),e.$parent=t):(Te(n,e),e.$parent=null)}};function vR(e){for(;e&&!m(e,"bpmn:Definitions");)e=e.$parent;return e}kt.prototype.getLaneSet=function(e){var t,n;return m(e,"bpmn:Lane")?(t=e.childLaneSet,t||(t=this._bpmnFactory.create("bpmn:LaneSet"),e.childLaneSet=t,t.$parent=e),t):(m(e,"bpmn:Participant")&&(e=e.processRef),n=e.get("laneSets"),t=n[0],t||(t=this._bpmnFactory.create("bpmn:LaneSet"),t.$parent=e,n.push(t)),t)};kt.prototype.updateSemanticParent=function(e,t,n){var r;if(e.$parent!==t&&!((m(e,"bpmn:DataInput")||m(e,"bpmn:DataOutput"))&&(m(t,"bpmn:Participant")&&"processRef"in t&&(t=t.processRef),"ioSpecification"in t&&t.ioSpecification===e.$parent))){if(m(e,"bpmn:Lane"))t&&(t=this.getLaneSet(t)),r="lanes";else if(m(e,"bpmn:FlowElement")){if(t){if(m(t,"bpmn:Participant"))t=t.processRef;else if(m(t,"bpmn:Lane"))do t=t.$parent.$parent;while(m(t,"bpmn:Lane"))}r="flowElements"}else if(m(e,"bpmn:Artifact")){for(;t&&!m(t,"bpmn:Process")&&!m(t,"bpmn:SubProcess")&&!m(t,"bpmn:Collaboration");)if(m(t,"bpmn:Participant")){t=t.processRef;break}else t=t.$parent;r="artifacts"}else if(m(e,"bpmn:MessageFlow"))r="messageFlows";else if(m(e,"bpmn:Participant")){r="participants";var i=e.processRef,o;i&&(o=vR(e.$parent||t),e.$parent&&(Te(o.get("rootElements"),i),i.$parent=null),t&&(we(o.get("rootElements"),i),i.$parent=o))}else m(e,"bpmn:DataOutputAssociation")?r="dataOutputAssociations":m(e,"bpmn:DataInputAssociation")&&(r="dataInputAssociations");if(!r)throw new Error(`no parent for <${e.id}> in <${t.id}>`);var a;if(e.$parent&&(a=e.$parent.get(r),Te(a,e)),t?(a=t.get(r),a.push(e),e.$parent=t):e.$parent=null,n){var s=n.get(r);Te(a,e),t&&(s||(s=[],t.set(r,s)),s.push(e))}}};kt.prototype.updateConnectionWaypoints=function(e){var t=se(e);t.set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))};kt.prototype.updateConnection=function(e){var t=e.connection,n=L(t),r=t.source,i=L(r),o=t.target,a=L(t.target),s;if(m(n,"bpmn:DataAssociation"))m(n,"bpmn:DataInputAssociation")?(n.get("sourceRef")[0]=i,s=e.parent||e.newParent||a,this.updateSemanticParent(n,a,s)):m(n,"bpmn:DataOutputAssociation")&&(s=e.parent||e.newParent||i,this.updateSemanticParent(n,i,s),n.targetRef=a);else{var c=m(n,"bpmn:SequenceFlow");n.sourceRef!==i&&(c&&(Te(n.sourceRef&&n.sourceRef.get("outgoing"),n),i&&i.get("outgoing")&&i.get("outgoing").push(n)),n.sourceRef=i),n.targetRef!==a&&(c&&(Te(n.targetRef&&n.targetRef.get("incoming"),n),a&&a.get("incoming")&&a.get("incoming").push(n)),n.targetRef=a)}this.updateConnectionWaypoints(t),this.updateDiConnection(t,r,o)};kt.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label};function Xt(e){return function(t){var n=t.context,r=n.shape||n.connection||n.element;m(r,"bpmn:BaseElement")&&e(t)}}function yR(e){if(m(e,"bpmn:Activity")){var t=se(e);if(t){var n=t.get("label");if(n)return n.get("bounds")}}}function Qn(e,t){vn.call(this),this._bpmnFactory=e,this._moddle=t}N(Qn,vn);Qn.$inject=["bpmnFactory","moddle"];Qn.prototype._baseCreate=vn.prototype.create;Qn.prototype.create=function(e,t){if(e==="label"){var n=t.di||this._bpmnFactory.createDiLabel();return this._baseCreate(e,C({type:"label",di:n},ro,t))}return this.createElement(e,t)};Qn.prototype.createElement=function(e,t){t=C({},t||{});var n,r=t.businessObject,i=t.di;if(!r){if(!t.type)throw new Error("no shape type specified");r=this._bpmnFactory.create(t.type),mc(r)}if(!xR(i)){var o=C({},i||{},{id:r.id+"_di"});e==="root"?i=this._bpmnFactory.createDiPlane(r,o):e==="connection"?i=this._bpmnFactory.createDiEdge(r,o):i=this._bpmnFactory.createDiShape(r,o)}m(r,"bpmn:Group")&&(t=C({isFrame:!0},t)),t=_R(r,t,["processRef","isInterrupting","associationDirection","isForCompensation"]),t.isExpanded&&(t=Pf(i,t,"isExpanded")),Q(r,["bpmn:Lane","bpmn:Participant"])&&(t=Pf(i,t,"isHorizontal")),m(r,"bpmn:SubProcess")&&(t.collapsed=!ie(r,i)),m(r,"bpmn:ExclusiveGateway")&&(tt(i,"isMarkerVisible")?i.isMarkerVisible===void 0&&(i.isMarkerVisible=!1):i.isMarkerVisible=!0),Ge(t.triggeredByEvent)&&(r.triggeredByEvent=t.triggeredByEvent,delete t.triggeredByEvent),Ge(t.cancelActivity)&&(r.cancelActivity=t.cancelActivity,delete t.cancelActivity);var a,s;return t.eventDefinitionType&&(a=r.get("eventDefinitions")||[],s=this._bpmnFactory.create(t.eventDefinitionType,t.eventDefinitionAttrs),t.eventDefinitionType==="bpmn:ConditionalEventDefinition"&&(s.condition=this._bpmnFactory.create("bpmn:FormalExpression")),a.push(s),s.$parent=r,r.eventDefinitions=a,delete t.eventDefinitionType),n=this.getDefaultSize(r,i),t=C({id:r.id},n,t,{businessObject:r,di:i}),this._baseCreate(e,t)};Qn.prototype.getDefaultSize=function(e,t){var n=L(e);if(t=t||se(e),m(n,"bpmn:SubProcess"))return ie(n,t)?{width:350,height:200}:{width:100,height:80};if(m(n,"bpmn:Task"))return{width:100,height:80};if(m(n,"bpmn:Gateway"))return{width:50,height:50};if(m(n,"bpmn:Event"))return{width:36,height:36};if(m(n,"bpmn:Participant")){var r=t.isHorizontal===void 0||t.isHorizontal===!0;return ie(n,t)?r?{width:600,height:250}:{width:250,height:600}:r?{width:400,height:60}:{width:60,height:400}}return m(n,"bpmn:Lane")?{width:400,height:100}:m(n,"bpmn:DataObjectReference")?{width:36,height:50}:m(n,"bpmn:DataStoreReference")?{width:50,height:50}:m(n,"bpmn:TextAnnotation")?{width:100,height:30}:m(n,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}};Qn.prototype.createParticipantShape=function(e){return Ce(e)||(e={isExpanded:e}),e=C({type:"bpmn:Participant"},e||{}),e.isExpanded!==!1&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)};function _R(e,t,n){return E(n,function(r){t=Pf(e,t,r)}),t}function Pf(e,t,n){return t[n]===void 0?t:(e[n]=t[n],At(t,[n]))}function xR(e){return Q(e,["bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane"])}function zo(e,t){this._modeling=e,this._canvas=t}zo.$inject=["modeling","canvas"];zo.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,r=e.alignment;E(n,function(i){var o={x:0,y:0};Ge(r.left)?o.x=r.left-i.x:Ge(r.right)?o.x=r.right-i.width-i.x:Ge(r.center)?o.x=r.center-Math.round(i.width/2)-i.x:Ge(r.top)?o.y=r.top-i.y:Ge(r.bottom)?o.y=r.bottom-i.height-i.y:Ge(r.middle)&&(o.y=r.middle-Math.round(i.height/2)-i.y),t.moveElements([i],o,i.parent)})};zo.prototype.postExecute=function(e){};function Vo(e){this._modeling=e}Vo.$inject=["modeling"];Vo.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var n=e.target||t.parent,r=e.shape,i=e.hints||{};r=e.shape=this._modeling.createShape(r,e.position,n,{attach:i.attach}),e.shape=r};Vo.prototype.postExecute=function(e){var t=e.hints||{};bR(e.source,e.shape)||(t.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))};function bR(e,t){return Nt(e.outgoing,function(n){return n.target===t})}function Wo(e,t){this._canvas=e,this._layouter=t}Wo.$inject=["canvas","layouter"];Wo.prototype.execute=function(e){var t=e.connection,n=e.source,r=e.target,i=e.parent,o=e.parentIndex,a=e.hints;if(!n||!r)throw new Error("source and target required");if(!i)throw new Error("parent required");return t.source=n,t.target=r,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,a)),this._canvas.addConnection(t,i,o),t};Wo.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var _u=Math.round;function Ps(e){this._modeling=e}Ps.$inject=["modeling"];Ps.prototype.preExecute=function(e){var t=e.elements,n=e.parent,r=e.parentIndex,i=e.position,o=e.hints,a=this._modeling;E(t,function(l){ee(l.x)||(l.x=0),ee(l.y)||(l.y=0)});var s=J(t,function(l){return!l.hidden}),c=Ee(s);E(t,function(l){fe(l)&&(l.waypoints=He(l.waypoints,function(f){return{x:_u(f.x-c.x-c.width/2+i.x),y:_u(f.y-c.y-c.height/2+i.y)}})),C(l,{x:_u(l.x-c.x-c.width/2+i.x),y:_u(l.y-c.y-c.height/2+i.y)})});var p=Dr(t),u={};E(t,function(l){if(fe(l)){u[l.id]=ee(r)?a.createConnection(u[l.source.id],u[l.target.id],r,l,l.parent||n,o):a.createConnection(u[l.source.id],u[l.target.id],l,l.parent||n,o);return}var f=C({},o);p.indexOf(l)===-1&&(f.autoResize=!1),te(l)&&(f=At(f,["attach"])),u[l.id]=ee(r)?a.createShape(l,pt(l,["x","y","width","height"]),l.parent||n,r,f):a.createShape(l,pt(l,["x","y","width","height"]),l.parent||n,f)}),e.elements=Pr(u)};var vy=Math.round;function On(e){this._canvas=e}On.$inject=["canvas"];On.prototype.execute=function(e){var t=e.shape,n=e.position,r=e.parent,i=e.parentIndex;if(!r)throw new Error("parent required");if(!n)throw new Error("position required");return n.width!==void 0?C(t,n):C(t,{x:n.x-vy(t.width/2),y:n.y-vy(t.height/2)}),this._canvas.addShape(t,r,i),t};On.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t};function Ti(e){On.call(this,e)}N(Ti,On);Ti.$inject=["canvas"];var ER=On.prototype.execute;Ti.prototype.execute=function(e){var t=e.shape;return SR(t),t.labelTarget=e.labelTarget,ER.call(this,e)};var wR=On.prototype.revert;Ti.prototype.revert=function(e){return e.shape.labelTarget=null,wR.call(this,e)};function SR(e){["width","height"].forEach(function(t){typeof e[t]=="undefined"&&(e[t]=0)})}function Mi(e,t){this._canvas=e,this._modeling=t}Mi.$inject=["canvas","modeling"];Mi.prototype.preExecute=function(e){var t=this._modeling,n=e.connection;bn(n.incoming,function(r){t.removeConnection(r,{nested:!0})}),bn(n.outgoing,function(r){t.removeConnection(r,{nested:!0})})};Mi.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=qi(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t};Mi.prototype.revert=function(e){var t=e.connection,n=e.parent,r=e.parentIndex;return t.source=e.source,t.target=e.target,we(n.children,t,r),this._canvas.addConnection(t,n),t};function As(e,t){this._modeling=e,this._elementRegistry=t}As.$inject=["modeling","elementRegistry"];As.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry,r=e.elements;E(r,function(i){n.get(i.id)&&(i.waypoints?t.removeConnection(i):t.removeShape(i))})};function Di(e,t){this._canvas=e,this._modeling=t}Di.$inject=["canvas","modeling"];Di.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;bn(n.incoming,function(r){t.removeConnection(r,{nested:!0})}),bn(n.outgoing,function(r){t.removeConnection(r,{nested:!0})}),bn(n.children,function(r){fe(r)?t.removeConnection(r,{nested:!0}):t.removeShape(r,{nested:!0})})};Di.prototype.execute=function(e){var t=this._canvas,n=e.shape,r=n.parent;return e.oldParent=r,e.oldParentIndex=qi(r.children,n),t.removeShape(n),n};Di.prototype.revert=function(e){var t=this._canvas,n=e.shape,r=e.oldParent,i=e.oldParentIndex;return we(r.children,n,i),t.addShape(n,r),n};function Go(e){this._modeling=e}Go.$inject=["modeling"];var yy={x:"y",y:"x"};Go.prototype.preExecute=function(e){var t=this._modeling,n=e.groups,r=e.axis,i=e.dimension;function o(v,w){v.range.min=Math.min(w[r],v.range.min),v.range.max=Math.max(w[r]+w[i],v.range.max)}function a(v){return v[r]+v[i]/2}function s(v){return v.length-1}function c(v){return v.max-v.min}function p(v,w){var P={y:0};P[r]=v-a(w),P[r]&&(P[yy[r]]=0,t.moveElements([w],P,w.parent))}var u=n[0],l=s(n),f=n[l],d,h,_=0;E(n,function(v,w){var P,b,x;if(v.elements.length<2){w&&w!==n.length-1&&(o(v,v.elements[0]),_+=c(v.range));return}P=St(v.elements,r),b=P[0],w===l&&(b=P[s(P)]),x=a(b),v.range=null,E(P,function(S){if(p(x,S),v.range===null){v.range={min:S[r],max:S[r]+S[i]};return}o(v,S)}),w&&w!==n.length-1&&(_+=c(v.range))}),h=Math.abs(f.range.min-u.range.max),d=Math.round((h-_)/(n.length-1)),!(dt;if(/n|w/.test(n))return e[r] required");var i=e.changed||this._getVisualReferences(n).concat(t),o=e.oldProperties||PR(n,Ki(r));return Ay(n,r),e.oldProperties=o,e.changed=i,i};Ni.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,r=e.changed;return Ay(n,t),r};Ni.prototype._getVisualReferences=function(e){var t=this._elementRegistry;return m(e,"bpmn:DataObject")?AR(e,t):[]};function PR(e,t){return Ke(t,function(n,r){return n[r]=e.get(r),n},{})}function Ay(e,t){E(t,function(n,r){e.set(r,n)})}function AR(e,t){return t.filter(function(n){return m(n,"bpmn:DataObjectReference")&&L(n).dataObjectRef===e})}var ks="default",Er="id",Ty="di",TR={width:0,height:0};function Bi(e,t,n,r){this._elementRegistry=e,this._moddle=t,this._modeling=n,this._textRenderer=r}Bi.$inject=["elementRegistry","moddle","modeling","textRenderer"];Bi.prototype.execute=function(e){var t=e.element,n=[t];if(!t)throw new Error("element required");var r=this._elementRegistry,i=this._moddle.ids,o=t.businessObject,a=NR(e.properties),s=e.oldProperties||MR(t,a);return My(a,o)&&(i.unclaim(o[Er]),r.updateId(t,a[Er]),i.claim(a[Er],o)),ks in a&&(a[ks]&&n.push(r.get(a[ks].id)),o[ks]&&n.push(r.get(o[ks].id))),Dy(t,a),e.oldProperties=s,e.changed=n,n};Bi.prototype.postExecute=function(e){var t=e.element,n=t.label,r=n&&L(n).name;if(r){var i=this._textRenderer.getExternalLabelBounds(n,r);this._modeling.resizeShape(n,i,TR)}};Bi.prototype.revert=function(e){var t=e.element,n=e.properties,r=e.oldProperties,i=t.businessObject,o=this._elementRegistry,a=this._moddle.ids;return Dy(t,r),My(n,i)&&(a.unclaim(n[Er]),o.updateId(t,r[Er]),a.claim(r[Er],i)),e.changed};function My(e,t){return Er in e&&e[Er]!==t[Er]}function MR(e,t){var n=Ki(t),r=e.businessObject,i=se(e);return Ke(n,function(o,a){return a!==Ty?o[a]=r.get(a):o[a]=DR(i,Ki(t.di)),o},{})}function DR(e,t){return Ke(t,function(n,r){return n[r]=e&&e.get(r),n},{})}function Dy(e,t){var n=e.businessObject,r=se(e);E(t,function(i,o){o!==Ty?n.set(o,i):r&&kR(r,i)})}function kR(e,t){E(t,function(n,r){e.set(r,n)})}var OR=["default"];function NR(e){var t=C({},e);return OR.forEach(function(n){n in e&&(t[n]=L(t[n]))}),t}function Xo(e,t){this._canvas=e,this._modeling=t}Xo.$inject=["canvas","modeling"];Xo.prototype.execute=function(e){var t=this._canvas,n=e.newRoot,r=n.businessObject,i=t.getRootElement(),o=i.businessObject,a=o.$parent,s=se(i);return t.setRootElement(n),t.removeRootElement(i),we(a.rootElements,r),r.$parent=a,Te(a.rootElements,o),o.$parent=null,i.di=null,s.bpmnElement=r,n.di=s,e.oldRoot=i,[]};Xo.prototype.revert=function(e){var t=this._canvas,n=e.newRoot,r=n.businessObject,i=e.oldRoot,o=i.businessObject,a=r.$parent,s=se(n);return t.setRootElement(i),t.removeRootElement(n),Te(a.rootElements,r),r.$parent=null,we(a.rootElements,o),o.$parent=a,n.di=null,s.bpmnElement=o,i.di=s,[]};function Os(e,t){this._modeling=e,this._spaceTool=t}Os.$inject=["modeling","spaceTool"];Os.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,r=e.shape,i=e.location,o=Rt(r),a=o===r,s=a?r:r.parent,c=cn(s),p=Re(r);if(p?i==="left"?i="top":i==="right"&&(i="bottom"):i==="top"?i="left":i==="bottom"&&(i="right"),!c.length){var u=p?{x:r.x+Yt,y:r.y,width:r.width-Yt,height:r.height}:{x:r.x,y:r.y+Yt,width:r.width,height:r.height-Yt};n.createShape({type:"bpmn:Lane",isHorizontal:p},u,s)}var l=[];Cn(o,function(x){return l.push(x),x.label&&l.push(x.label),x===r?[]:J(x.children,function(S){return S!==r})});var f,d,h,_,v;i==="top"?(f=-120,d=r.y,h=d+10,_="n",v="y"):i==="left"?(f=-120,d=r.x,h=d+10,_="w",v="x"):i==="bottom"?(f=120,d=r.y+r.height,h=d-10,_="s",v="y"):i==="right"&&(f=120,d=r.x+r.width,h=d-10,_="e",v="x");var w=t.calculateAdjustments(l,v,f,h),P=p?{x:0,y:f}:{x:f,y:0};t.makeSpace(w.movingShapes,w.resizingShapes,P,_,h);var b=p?{x:r.x+(a?Yt:0),y:d-(i==="top"?120:0),width:r.width-(a?Yt:0),height:120}:{x:d-(i==="left"?120:0),y:r.y+(a?Yt:0),width:120,height:r.height-(a?Yt:0)};e.newLane=n.createShape({type:"bpmn:Lane",isHorizontal:p},b,s)};function Ns(e){this._modeling=e}Ns.$inject=["modeling"];Ns.prototype.preExecute=function(e){var t=this._modeling,n=e.shape,r=e.count,i=cn(n),o=i.length;if(o>r)throw new Error(`more than <${r}> child lanes`);var a=Re(n),s=a?n.height:n.width,c=Math.round(s/r),p,u,l,f;for(f=0;f0||o.bottom<0?-p:p,d=n.calculateAdjustments(s,"y",f,u),n.makeSpace(d.movingShapes,d.resizingShapes,{x:0,y:p},l)),(o.left||o.right)&&(p=o.right||o.left,u=e.x+(o.right?e.width:0)+(o.right?-10:100),l=o.right?"e":"w",f=o.left>0||o.right<0?-p:p,d=n.calculateAdjustments(c,"x",f,u),n.makeSpace(d.movingShapes,d.resizingShapes,{x:p,y:0},l))};var Bs="flowNodeRef",Af="lanes";function Li(e){this._elementRegistry=e}Li.$inject=["elementRegistry"];Li.prototype._computeUpdates=function(e,t){var n=[],r=[],i={},o=[];function a(u,l){var f=X(l),d={x:u.x+u.width/2,y:u.y+u.height/2};return d.x>f.left&&d.xf.top&&d.y: must be specified as : with start/end in { h,v,t,r,b,l }");if(Fy(n)){var r=VR(e,t,n),i=WR(e,t,n),o=GR(r,i);return[].concat(r.waypoints,o.waypoints,i.waypoints)}return UR(e,t,n)}function KR(e,t,n){var r=Tf(e,t,n);return r.unshift(e),r.push(t),Df(r)}function YR(e,t,n,r,i){var o=i&&i.preferredLayouts||[],a=Qf(o,"straight")[0]||"h:h",s=HR[a]||0,c=Le(e,t,s),p=JR(c,a);n=n||Y(e),r=r||Y(t);var u=p.split(":"),l=Iy(n,e,u[0],tP(c)),f=Iy(r,t,u[1],c);return KR(l,f,p)}function jy(e,t,n,r,i,o){U(n)&&(i=n,o=r,n=Y(e),r=Y(t)),o=C({preferredLayouts:[]},o),i=i||[];var a=o.preferredLayouts,s=a.indexOf("straight")!==-1,c;return c=s&&XR(e,t,n,r,o),c||(c=o.connectionEnd&&QR(t,e,r,i),c)||(c=o.connectionStart&&ZR(e,t,n,i),c)?c:!o.connectionStart&&!o.connectionEnd&&i&&i.length?i:YR(e,t,n,r,o)}function qR(e,t,n){return e>=t&&e<=n}function By(e,t,n){var r={x:"width",y:"height"};return qR(t[e],n[e],n[e]+n[r[e]])}function XR(e,t,n,r,i){var o={},a,s;return s=Le(e,t),/^(top|bottom|left|right)$/.test(s)?(/top|bottom/.test(s)&&(a="x"),/left|right/.test(s)&&(a="y"),i.preserveDocking==="target"?By(a,r,e)?(o[a]=r[a],[{x:o.x!==void 0?o.x:n.x,y:o.y!==void 0?o.y:n.y,original:{x:o.x!==void 0?o.x:n.x,y:o.y!==void 0?o.y:n.y}},{x:r.x,y:r.y}]):null:By(a,n,t)?(o[a]=n[a],[{x:n.x,y:n.y},{x:o.x!==void 0?o.x:r.x,y:o.y!==void 0?o.y:r.y,original:{x:o.x!==void 0?o.x:r.x,y:o.y!==void 0?o.y:r.y}}]):null):null}function ZR(e,t,n,r){return Mf(e,t,n,r)}function QR(e,t,n,r){var i=r.slice().reverse();return i=Mf(e,t,n,i),i?i.reverse():null}function Mf(e,t,n,r){function i(u){return u.length<3?!0:u.length>4?!1:!!ne(u,function(l,f){var d=u[f-1];return d&&kr(l,d)<3})}function o(u,l,f){var d=Gt(l,u);switch(d){case"v":return{x:f.x,y:u.y};case"h":return{x:u.x,y:f.y}}return{x:u.x,y:u.y}}function a(u,l,f){var d;for(d=u.length-2;d!==0;d--)if(ul(u[d],l,Oy)||ul(u[d],f,Oy))return u.slice(d);return u}if(i(r))return null;var s=r[0],c=r.slice(),p;return c[0]=n,c[1]=o(c[1],s,n),p=a(c,e,t),p!==c&&(c=Mf(e,t,n,p)),c&&Gt(c)?null:c}function JR(e,t){if(Fy(t))return t;switch(e){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return t}}function eP(e){return e&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(e)}function Fy(e){return e&&/t|r|b|l/.test(e)}function tP(e){return{top:"bottom",bottom:"top",left:"right",right:"left","top-left":"bottom-right","bottom-right":"top-left","top-right":"bottom-left","bottom-left":"top-right"}[e]}function Iy(e,t,n,r){if(n==="h"&&(n=/left/.test(r)?"l":"r"),n==="v"&&(n=/top/.test(r)?"t":"b"),n==="t")return{original:e,x:e.x,y:t.y};if(n==="r")return{original:e,x:t.x+t.width,y:e.y};if(n==="b")return{original:e,x:e.x,y:t.y+t.height};if(n==="l")return{original:e,x:t.x,y:e.y};throw new Error("unexpected dockingDirection: <"+n+">")}function Df(e){return e.reduce(function(t,n,r){var i=t[t.length-1],o=e[r+1];return Xi(i,o,n,0)||t.push(n),t},[])}var nP=-10,rP=40,iP={default:["h:h"],fromGateway:["v:h"],toGateway:["h:v"],loop:{fromTop:["t:r"],fromRight:["r:b"],fromLeft:["l:t"],fromBottom:["b:l"]},boundaryLoop:{alternateHorizontalSide:"b",alternateVerticalSide:"l",default:"v"},messageFlow:["straight","v:v"],subProcess:["straight","h:h"],isHorizontal:!0},oP={default:["v:v"],fromGateway:["h:v"],toGateway:["v:h"],loop:{fromTop:["t:l"],fromRight:["r:t"],fromLeft:["l:b"],fromBottom:["b:r"]},boundaryLoop:{alternateHorizontalSide:"t",alternateVerticalSide:"r",default:"h"},messageFlow:["straight","h:h"],subProcess:["straight","v:v"],isHorizontal:!1},Of={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},Ls={top:"t",right:"r",bottom:"b",left:"l"};function ea(e){this._elementRegistry=e}N(ea,bu);ea.prototype.layoutConnection=function(e,t){t||(t={});var n=t.source||e.source,r=t.target||e.target,i=t.waypoints||e.waypoints,o=t.connectionStart,a=t.connectionEnd,s=this._elementRegistry,c,p;if(o||(o=Hy(i&&i[0],n)),a||(a=Hy(i&&i[i.length-1],r)),(m(e,"bpmn:Association")||m(e,"bpmn:DataAssociation"))&&i&&!$y(n,r))return[].concat([o],i.slice(1,-1),[a]);var u=fp(n,s)?iP:oP;return m(e,"bpmn:MessageFlow")?c=sP(n,r,u):(m(e,"bpmn:SequenceFlow")||$y(n,r))&&(n===r?c={preferredLayouts:dP(n,e,u)}:m(n,"bpmn:BoundaryEvent")?c={preferredLayouts:hP(n,r,a,u)}:js(n)||js(r)?c={preferredLayouts:u.subProcess,preserveDocking:pP(n)}:m(n,"bpmn:Gateway")?c={preferredLayouts:u.fromGateway}:m(r,"bpmn:Gateway")?c={preferredLayouts:u.toGateway}:c={preferredLayouts:u.default}),c&&(c=C(c,t),p=Df(jy(n,r,o,a,i,c))),p||[o,a]};function aP(e){var t=e.host;return Le(Y(e),t,nP)}function sP(e,t,n){return{preferredLayouts:n.messageFlow,preserveDocking:cP(e,t)}}function cP(e,t){return m(t,"bpmn:Participant")?"source":m(e,"bpmn:Participant")?"target":js(t)?"source":js(e)||m(t,"bpmn:Event")?"target":m(e,"bpmn:Event")?"source":null}function pP(e){return js(e)?"target":"source"}function Hy(e,t){return e?e.original||e:Y(t)}function $y(e,t){return m(t,"bpmn:Activity")&&m(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function js(e){return m(e,"bpmn:SubProcess")&&ie(e)}function ji(e,t){return e===t}function uP(e,t){return t.indexOf(e)!==-1}function Qo(e){var t=/right|left/.exec(e);return t&&t[0]}function Jo(e){var t=/top|bottom/.exec(e);return t&&t[0]}function zy(e,t){return Of[e]===t}function lP(e,t){var n=Qo(e),r=Of[n];return t.indexOf(r)!==-1}function fP(e,t){var n=Jo(e),r=Of[n];return t.indexOf(r)!==-1}function Wy(e){return e==="right"||e==="left"}function dP(e,t,n){var r=t.waypoints,i=r&&r.length&&Le(r[0],e);return i==="top"?n.loop.fromTop:i==="right"?n.loop.fromRight:i==="left"?n.loop.fromLeft:n.loop.fromBottom}function hP(e,t,n,r){var i=Y(e),o=Y(t),a=aP(e),s,c,p=ji(e.host,t),u=uP(a,["top","right","bottom","left"]),l=Le(o,i,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return p?mP(a,u,e,t,n,r):(s=gP(a,l,u,r.isHorizontal),c=vP(a,l,u,r.isHorizontal),[s+":"+c])}function mP(e,t,n,r,i,o){var a=t?e:o.isHorizontal?Jo(e):Qo(e),s=Ls[a],c;return t?Wy(e)?c=Vy("y",n,r,i)?"h":o.boundaryLoop.alternateHorizontalSide:c=Vy("x",n,r,i)?"v":o.boundaryLoop.alternateVerticalSide:c=o.boundaryLoop.default,[s+":"+c]}function Vy(e,t,n,r){var i=rP;return!(kf(e,r,n,i)||kf(e,r,{x:n.x+n.width,y:n.y+n.height},i)||kf(e,r,Y(t),i))}function kf(e,t,n,r){return Math.abs(t[e]-n[e])!Rr(d))})};ta.prototype.cleanUp=function(){this._complexPreview.cleanUp()};ta.$inject=["complexPreview","connectionDocking","elementFactory","eventBus","layouter","rules"];var Ky={__depends__:[xo,Rg,Su],__init__:["appendPreview"],appendPreview:["type",ta]};var Yy=Math.min,qy=Math.max;function Nf(e){e.preventDefault()}function Fs(e){e.stopPropagation()}function yP(e){return e.nodeType===Node.TEXT_NODE}function _P(e){return[].slice.call(e)}function pn(e){this.container=e.container,this.parent=ye('
      '),this.content=me("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=Je(this.autoResize,this),this.handlePaste=Je(this.handlePaste,this)}pn.prototype.create=function(e,t,n,r){var i=this,o=this.parent,a=this.content,s=this.container;r=this.options=r||{},t=this.style=t||{};var c=pt(t,["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);C(o.style,{width:e.width+"px",height:e.height+"px",maxWidth:e.maxWidth+"px",maxHeight:e.maxHeight+"px",minWidth:e.minWidth+"px",minHeight:e.minHeight+"px",left:e.x+"px",top:e.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},c);var p=pt(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return C(a.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},p),r.centerVertically&&C(a.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},p),a.innerText=n,ae.bind(a,"keydown",this.keyHandler),ae.bind(a,"mousedown",Fs),ae.bind(a,"paste",i.handlePaste),r.autoResize&&ae.bind(a,"input",this.autoResize),r.resizable&&this.resizable(t),s.appendChild(o),this.setSelection(a.lastChild,a.lastChild&&a.lastChild.length),o};pn.prototype.handlePaste=function(e){var t=this.options,n=this.style;e.preventDefault();var r;if(e.clipboardData?r=e.clipboardData.getData("text/plain"):r=window.clipboardData.getData("Text"),this.insertText(r),t.autoResize){var i=this.autoResize(n);i&&this.resizeHandler(i)}};pn.prototype.insertText=function(e){e=xP(e);var t=document.execCommand("insertText",!1,e);t||this._insertTextIE(e)};pn.prototype._insertTextIE=function(e){var t=this.getSelection(),n=t.startContainer,r=t.endContainer,i=t.startOffset,o=t.endOffset,a=t.commonAncestorContainer,s=_P(a.childNodes),c,p;if(yP(a)){var u=n.textContent;n.textContent=u.substring(0,i)+e+u.substring(o),c=n,p=i+e.length}else if(n===this.content&&r===this.content){var l=document.createTextNode(e);this.content.insertBefore(l,s[i]),c=l,p=l.textContent.length}else{var f=s.indexOf(n),d=s.indexOf(r);s.forEach(function(h,_){_===f?h.textContent=n.textContent.substring(0,i)+e+r.textContent.substring(o):_>f&&_<=d&&Bt(h)}),c=n,p=i+e.length}c&&p!==void 0&&setTimeout(function(){self.setSelection(c,p)})};pn.prototype.autoResize=function(){var e=this.parent,t=this.content,n=parseInt(this.style.fontSize)||12;if(t.scrollHeight>e.offsetHeight||t.scrollHeight
      ');var s,c,p,u,l=function(h){Nf(h),Fs(h),s=h.clientX,c=h.clientY;var _=t.getBoundingClientRect();p=_.width,u=_.height,ae.bind(document,"mousemove",f),ae.bind(document,"mouseup",d)},f=function(h){Nf(h),Fs(h);var _=Yy(qy(p+h.clientX-s,r),o),v=Yy(qy(u+h.clientY-c,i),a);t.style.width=_+"px",t.style.height=v+"px",e.resizeHandler({width:p,height:u,dx:h.clientX-s,dy:h.clientY-c})},d=function(h){Nf(h),Fs(h),ae.unbind(document,"mousemove",f,!1),ae.unbind(document,"mouseup",d,!1)};ae.bind(n,"mousedown",l)}C(n.style,{position:"absolute",bottom:"0px",right:"0px",cursor:"nwse-resize",width:"0",height:"0",borderTop:(parseInt(this.style.fontSize)/4||3)+"px solid transparent",borderRight:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderBottom:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderLeft:(parseInt(this.style.fontSize)/4||3)+"px solid transparent"}),t.appendChild(n)};pn.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),ae.unbind(t,"keydown",this.keyHandler),ae.unbind(t,"mousedown",Fs),ae.unbind(t,"input",this.autoResize),ae.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),Bt(n)),Bt(e)};pn.prototype.getValue=function(){return this.content.innerText.trim()};pn.prototype.getSelection=function(){var e=window.getSelection(),t=e.getRangeAt(0);return t};pn.prototype.setSelection=function(e,t){var n=document.createRange();e===null?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t));var r=window.getSelection();r.removeAllRanges(),r.addRange(n)};function xP(e){return e.replace(/\r\n|\r|\n/g,` -`)}function Zt(e,t){this._eventBus=e,this._canvas=t,this._providers=[],this._textbox=new pn({container:t.getContainer(),keyHandler:Je(this._handleKey,this),resizeHandler:Je(this._handleResize,this)})}Zt.$inject=["eventBus","canvas"];Zt.prototype.registerProvider=function(e){this._providers.push(e)};Zt.prototype.isActive=function(e){return!!(this._active&&(!e||this._active.element===e))};Zt.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())};Zt.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})};Zt.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0,this._canvas.restoreFocus&&this._canvas.restoreFocus()};Zt.prototype.complete=function(){var e=this._active;if(e){var t,n=e.context.bounds,r=this.$textbox.getBoundingClientRect(),i=this.getValue(),o=e.context.text;(i!==o||r.height!==n.height||r.width!==n.width)&&(t=this._textbox.container.getBoundingClientRect(),e.provider.update(e.element,i,e.context.text,{x:r.left-t.left,y:r.top-t.top,width:r.width,height:r.height})),this._fire("complete"),this.close()}};Zt.prototype.getValue=function(){return this._textbox.getValue()};Zt.prototype._handleKey=function(e){e.stopPropagation();var t=e.keyCode||e.charCode;if(t===27)return e.preventDefault(),this.cancel();if(t===13&&!e.shiftKey)return e.preventDefault(),this.complete()};Zt.prototype._handleResize=function(e){this._fire("resize",e)};Zt.prototype.activate=function(e){this.isActive()&&this.cancel();var t,n=ne(this._providers,function(r){return(t=r.activate(e))?r:null});return t&&(this.$textbox=this._textbox.create(t.bounds,t.style,t.text,t.options),this._active={element:e,context:t,provider:n},t.options&&t.options.resizable&&(this.resizable=!0),this._fire("activate")),!!t};var Cu={__depends__:[Vr],__init__:["directEditing"],directEditing:["type",Zt]};function Xy(e){return function(t){var n=t.target,r=L(e),i=r.eventDefinitions&&r.eventDefinitions[0],o=r.$type===n.type,a=(i&&i.$type)===n.eventDefinitionType,s=!!n.triggeredByEvent==!!r.triggeredByEvent,c=n.isExpanded===void 0||n.isExpanded===ie(e);return!o||!a||!s||!c}}var Zy=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],Qy=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}}],Jy=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message intermediate catch event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate throw event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer intermediate catch event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Escalation intermediate throw event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Conditional intermediate catch event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Link intermediate catch event",actionName:"replace-with-link-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-link",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Link intermediate throw event",actionName:"replace-with-link-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-link",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Compensation intermediate throw event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal intermediate catch event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate throw event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],e_=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message end event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Escalation end event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Error end event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Cancel end event",actionName:"replace-with-cancel-end",className:"bpmn-icon-end-event-cancel",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},{label:"Compensation end event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal end event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Terminate end event",actionName:"replace-with-terminate-end",className:"bpmn-icon-end-event-terminate",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:TerminateEventDefinition"}}],t_=[{label:"Exclusive gateway",actionName:"replace-with-exclusive-gateway",className:"bpmn-icon-gateway-xor",target:{type:"bpmn:ExclusiveGateway"}},{label:"Parallel gateway",actionName:"replace-with-parallel-gateway",className:"bpmn-icon-gateway-parallel",target:{type:"bpmn:ParallelGateway"}},{label:"Inclusive gateway",actionName:"replace-with-inclusive-gateway",className:"bpmn-icon-gateway-or",target:{type:"bpmn:InclusiveGateway"}},{label:"Complex gateway",actionName:"replace-with-complex-gateway",className:"bpmn-icon-gateway-complex",target:{type:"bpmn:ComplexGateway"}},{label:"Event-based gateway",actionName:"replace-with-event-based-gateway",className:"bpmn-icon-gateway-eventbased",target:{type:"bpmn:EventBasedGateway",instantiate:!1,eventGatewayType:"Exclusive"}}],n_=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Ad-hoc sub-process",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}},{label:"Sub-process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}}],r_=[{label:"Sub-process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Ad-hoc sub-process (collapsed)",actionName:"replace-with-collapsed-ad-hoc-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:AdHocSubProcess",isExpanded:!1}}],Bf=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Sub-process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Ad-hoc sub-process",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}}],i_=Bf,If=[{label:"Task",actionName:"replace-with-task",className:"bpmn-icon-task",target:{type:"bpmn:Task"}},{label:"User task",actionName:"replace-with-user-task",className:"bpmn-icon-user",target:{type:"bpmn:UserTask"}},{label:"Service task",actionName:"replace-with-service-task",className:"bpmn-icon-service",target:{type:"bpmn:ServiceTask"}},{label:"Send task",actionName:"replace-with-send-task",className:"bpmn-icon-send",target:{type:"bpmn:SendTask"}},{label:"Receive task",actionName:"replace-with-receive-task",className:"bpmn-icon-receive",target:{type:"bpmn:ReceiveTask"}},{label:"Manual task",actionName:"replace-with-manual-task",className:"bpmn-icon-manual",target:{type:"bpmn:ManualTask"}},{label:"Business rule task",actionName:"replace-with-rule-task",className:"bpmn-icon-business-rule",target:{type:"bpmn:BusinessRuleTask"}},{label:"Script task",actionName:"replace-with-script-task",className:"bpmn-icon-script",target:{type:"bpmn:ScriptTask"}},{label:"Call activity",actionName:"replace-with-call-activity",className:"bpmn-icon-call-activity",target:{type:"bpmn:CallActivity"}},{label:"Sub-process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}},{label:"Sub-process (expanded)",actionName:"replace-with-expanded-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Ad-hoc sub-process (collapsed)",actionName:"replace-with-collapsed-ad-hoc-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:AdHocSubProcess",isExpanded:!1}},{label:"Ad-hoc sub-process (expanded)",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}}],o_=[{label:"Data store reference",actionName:"replace-with-data-store-reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}}],a_=[{label:"Data object reference",actionName:"replace-with-data-object-reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}}],s_=[{label:"Message boundary event",actionName:"replace-with-message-boundary",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!0}},{label:"Timer boundary event",actionName:"replace-with-timer-boundary",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!0}},{label:"Escalation boundary event",actionName:"replace-with-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!0}},{label:"Conditional boundary event",actionName:"replace-with-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!0}},{label:"Error boundary event",actionName:"replace-with-error-boundary",className:"bpmn-icon-intermediate-event-catch-error",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",cancelActivity:!0}},{label:"Cancel boundary event",actionName:"replace-with-cancel-boundary",className:"bpmn-icon-intermediate-event-catch-cancel",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CancelEventDefinition",cancelActivity:!0}},{label:"Signal boundary event",actionName:"replace-with-signal-boundary",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!0}},{label:"Compensation boundary event",actionName:"replace-with-compensation-boundary",className:"bpmn-icon-intermediate-event-catch-compensation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",cancelActivity:!0}},{label:"Message boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-message-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!1}},{label:"Timer boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!1}},{label:"Escalation boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!1}},{label:"Conditional boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!1}},{label:"Signal boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!1}}],c_=[{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!0}},{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!0}},{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!0}},{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!0}},{label:"Error start event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",isInterrupting:!0}},{label:"Escalation start event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!0}},{label:"Compensation start event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",isInterrupting:!0}},{label:"Message start event (non-interrupting)",actionName:"replace-with-non-interrupting-message-start",className:"bpmn-icon-start-event-non-interrupting-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!1}},{label:"Timer start event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-start",className:"bpmn-icon-start-event-non-interrupting-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!1}},{label:"Conditional start event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-start",className:"bpmn-icon-start-event-non-interrupting-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!1}},{label:"Signal start event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-start",className:"bpmn-icon-start-event-non-interrupting-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!1}},{label:"Escalation start event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-start",className:"bpmn-icon-start-event-non-interrupting-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!1}}],p_=[{label:"Sequence flow",actionName:"replace-with-sequence-flow",className:"bpmn-icon-connection"},{label:"Default flow",actionName:"replace-with-default-flow",className:"bpmn-icon-default-flow"},{label:"Conditional flow",actionName:"replace-with-conditional-flow",className:"bpmn-icon-conditional-flow"}],u_=[{label:"Expanded pool/participant",actionName:"replace-with-expanded-pool",className:"bpmn-icon-participant",target:{type:"bpmn:Participant",isExpanded:!0}},{label:function(e){var t="Empty pool/participant";return e.children&&e.children.length&&(t+=" (removes content)"),t},actionName:"replace-with-collapsed-pool",className:"bpmn-icon-lane",target:{type:"bpmn:Participant",isExpanded:!1}}],l_={"bpmn:MessageEventDefinition":[{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!0}},{label:"Message intermediate catch event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate throw event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message end event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}}],"bpmn:TimerEventDefinition":[{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!0}},{label:"Timer intermediate catch event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}}],"bpmn:ConditionalEventDefinition":[{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!0}},{label:"Conditional intermediate catch event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}}],"bpmn:SignalEventDefinition":[{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!0}},{label:"Signal intermediate catch event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate throw event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal end event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],"bpmn:ErrorEventDefinition":[{label:"Error start event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",isInterrupting:!0}},{label:"Error end event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}}],"bpmn:EscalationEventDefinition":[{label:"Escalation start event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!0}},{label:"Escalation intermediate throw event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Escalation end event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}}],"bpmn:CompensateEventDefinition":[{label:"Compensation start event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",isInterrupting:!0}},{label:"Compensation intermediate throw event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Compensation end event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}}]};var Lf={"start-event-non-interrupting":` + `},xu=IC;var LC=900;function ri(e,t,n,r){e.registerProvider(LC,this),this._contextPad=e,this._popupMenu=t,this._translate=n,this._canvas=r}ri.$inject=["contextPad","popupMenu","translate","canvas"];ri.prototype.getMultiElementContextPadEntries=function(e){var t={};return this._isAllowed(e)&&C(t,this._getEntries(e)),t};ri.prototype._isAllowed=function(e){return!this._popupMenu.isEmpty(e,"align-elements")};ri.prototype._getEntries=function(){var e=this;return{"align-elements":{group:"align-elements",title:e._translate("Align elements"),html:`
      ${xu.align}
      `,action:{click:function(t,n){var r=e._getMenuPosition(n);C(r,{cursor:{x:t.x,y:t.y}}),e._popupMenu.open(n,"align-elements",r)}}}}};ri.prototype._getMenuPosition=function(e){var t=5,n=this._contextPad.getPad(e).html,r=n.getBoundingClientRect(),i={x:r.left,y:r.bottom+t};return i};k();var jC=["left","center","right","top","middle","bottom"];function Ti(e,t,n,r){this._alignElements=t,this._translate=n,this._popupMenu=e,this._rules=r,e.registerProvider("align-elements",this)}Ti.$inject=["popupMenu","alignElements","translate","rules"];Ti.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&C(t,this._getEntries(e)),t};Ti.prototype._isAllowed=function(e){return this._rules.allowed("elements.align",{elements:e})};Ti.prototype._getEntries=function(e){var t=this._alignElements,n=this._translate,r=this._popupMenu,i={};return E(jC,function(o){i["align-elements-"+o]={group:"align",title:n("Align elements "+o),className:"bjs-align-elements-menu-entry",imageHtml:xu[o],action:function(){t.trigger(e,o),r.close()}}}),i};function kt(e){N.call(this,e),this.init()}kt.$inject=["eventBus"];B(kt,N);kt.prototype.addRule=function(e,t,n){var r=this;typeof e=="string"&&(e=[e]),e.forEach(function(i){r.canExecute(i,t,function(o,a,s){return n(o)},!0)})};kt.prototype.init=function(){};k();function Ao(e){kt.call(this,e)}Ao.$inject=["eventBus"];B(Ao,kt);Ao.prototype.init=function(){this.addRule("elements.align",function(e){var t=e.elements,n=J(t,function(r){return!(r.waypoints||r.host||r.labelTarget)});return n=Hr(n),n.length<2?!1:n})};var Kv={__depends__:[uv,ou,Po],__init__:["alignElementsContextPadProvider","alignElementsMenuProvider","bpmnAlignElements"],alignElementsContextPadProvider:["type",ri],alignElementsMenuProvider:["type",Ti],bpmnAlignElements:["type",Ao]};k();var FC=10,Sf=50,HC=250;function Eu(e,t,n,r){for(var i;i=$C(e,n,t);)n=r(t,n,i);return n}function wu(e){return function(t,n,r){var i={x:n.x,y:n.y};return["x","y"].forEach(function(o){var a=e[o];if(a){var s=o==="x"?"width":"height",c=a.margin,u=a.minDistance;c<0?i[o]=Math.min(r[o]+c-t[s]/2,n[o]-u+c):i[o]=Math.max(r[o]+r[s]+c+t[s]/2,n[o]+u+c)}}),i}}function $C(e,t,n){var r={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height},i=zC(e);return re(i,function(o){if(o===n)return!1;var a=He(o,r,FC);return a==="intersect"})}function Yv(e,t){t||(t={});function n(m){return m.source===e?1:-1}var r=t.defaultDistance||Sf,i=t.direction||"e",o=t.filter,a=t.getWeight||n,s=t.maxDistance||HC,c=t.reference||"start";o||(o=WC);function u(m,y){return i==="n"?c==="start"?Z(m).top-Z(y).bottom:c==="center"?Z(m).top-Y(y).y:Z(m).top-Z(y).top:i==="w"?c==="start"?Z(m).left-Z(y).right:c==="center"?Z(m).left-Y(y).x:Z(m).left-Z(y).left:i==="s"?c==="start"?Z(y).top-Z(m).bottom:c==="center"?Y(y).y-Z(m).bottom:Z(y).bottom-Z(m).bottom:c==="start"?Z(y).left-Z(m).right:c==="center"?Y(y).x-Z(m).right:Z(y).right-Z(m).right}var p=e.incoming.filter(o).map(function(m){var y=a(m),v=y<0?u(m.source,e):u(e,m.source);return{id:m.source.id,distance:v,weight:y}}),l=e.outgoing.filter(o).map(function(m){var y=a(m),v=y>0?u(e,m.target):u(m.target,e);return{id:m.target.id,distance:v,weight:y}}),f=p.concat(l).reduce(function(m,y){return m[y.id+"__weight_"+y.weight]=y,m},{}),d=Fe(f,function(m,y){var v=y.distance,w=y.weight;return v<0||v>s||(m[String(v)]||(m[String(v)]=0),m[String(v)]+=1*w,(!m.distance||m[m.distance]t.top&&(n=n.concat("n")),e.rightt.left&&(n=n.concat("e")),n}function Do(e){e.invoke(Fn,this)}Do.$inject=["injector"];B(Do,Fn);Do.prototype.resize=function(e,t,n){h(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)};k();function Di(e){kt.call(this,e);var t=this;this.addRule("element.autoResize",function(n){return t.canResize(n.elements,n.target)})}Di.$inject=["eventBus"];B(Di,kt);Di.prototype.canResize=function(e,t){return!1};function Mo(e,t){Di.call(this,e),this._modeling=t}B(Mo,Di);Mo.$inject=["eventBus","modeling"];Mo.prototype.canResize=function(e,t){if(h(t.di,"bpmndi:BPMNPlane")||!h(t,"bpmn:Participant")&&!h(t,"bpmn:Lane")&&!h(t,"bpmn:SubProcess"))return!1;var n=!0;return E(e,function(r){if(h(r,"bpmn:Lane")||ne(r)){n=!1;return}}),n};var Qv={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",Do],bpmnAutoResizeProvider:["type",Mo]};var Jv=1500;function Tu(e,t,n){var r=this,i=n.get("dragging",!1);function o(a){if(!a.hover){var s=a.originalEvent,c=r._findTargetGfx(s),u=c&&e.get(c);c&&u&&(a.stopPropagation(),i.hover({element:u,gfx:c}),i.move(s))}}i&&t.on("drag.start",function(a){t.once("drag.move",Jv,function(s){o(s)})}),(function(){var a,s;t.on("element.hover",function(c){a=c.gfx,s=c.element}),t.on("element.hover",Jv,function(c){s&&t.fire("element.out",{element:s,gfx:a})}),t.on("element.out",function(){a=null,s=null})})(),this._findTargetGfx=function(a){var s,c;if(a instanceof MouseEvent)return s=Pn(a),c=document.elementFromPoint(s.x,s.y),JC(c)}}Tu.$inject=["elementRegistry","eventBus","injector"];function JC(e){return Nn(e,"svg, .djs-element",!0)}var eg={__init__:["hoverFix"],hoverFix:["type",Tu]};k();var ko=Math.round,tg="djs-drag-active";function Mi(e){e.preventDefault()}function eR(e){return typeof TouchEvent!="undefined"&&e instanceof TouchEvent}function tR(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function Du(e,t,n,r){var i={threshold:5,trapClick:!0},o;function a(x){var b=t.viewbox(),S=t._container.getBoundingClientRect();return{x:b.x+(x.x-S.left)/b.scale,y:b.y+(x.y-S.top)/b.scale}}function s(x,b){b=b||o;var S=e.createEvent(C({},b.payload,b.data,{isTouch:b.isTouch}));return e.fire("drag."+x,S)===!1?!1:e.fire(b.prefix+"."+x,S)}function c(x){var b=x.filter(function(S){return r.get(S.id)});b.length&&n.select(b)}function u(x,b){var S=o.payload,A=o.displacement,O=o.globalStart,D=Pn(x),L=Tt(D,O),I=o.localStart,$=a(D),G=Tt($,I);if(!o.active&&(b||tR(L)>o.threshold)){if(C(S,{x:ko(I.x+A.x),y:ko(I.y+A.y),dx:0,dy:0},{originalEvent:x}),s("start")===!1)return v();o.active=!0,o.keepSelection||(S.previousSelection=n.get(),n.select(null)),o.cursor&&Pi(o.cursor),t.addMarker(t.getRootElement(),tg)}Gc(x),o.active&&(C(S,{x:ko($.x+A.x),y:ko($.y+A.y),dx:ko(G.x),dy:ko(G.y)},{originalEvent:x}),s("move"))}function p(x){var b,S=!0;o.active&&(x&&(o.payload.originalEvent=x,Gc(x)),S=s("end")),S===!1&&s("rejected"),b=w(S!==!0),s("ended",b)}function l(x){We("Escape",x)&&(Mi(x),v())}function f(x){var b;o.active&&(b=eu(e),setTimeout(b,400),Mi(x)),p(x)}function d(x){u(x)}function m(x){var b=o.payload;b.hoverGfx=x.gfx,b.hover=x.element,s("hover")}function y(x){s("out");var b=o.payload;b.hoverGfx=null,b.hover=null}function v(x){var b;if(o){var S=o.active;S&&s("cancel"),b=w(x),S&&s("canceled",b)}}function w(x){var b,S;s("cleanup"),Jc(),o.trapClick?S=f:S=p,se.unbind(document,"mousemove",u),se.unbind(document,"dragstart",Mi),se.unbind(document,"selectstart",Mi),se.unbind(document,"mousedown",S,!0),se.unbind(document,"mouseup",S,!0),se.unbind(document,"keyup",l),se.unbind(document,"touchstart",d,!0),se.unbind(document,"touchcancel",v,!0),se.unbind(document,"touchmove",u,!0),se.unbind(document,"touchend",p,!0),e.off("element.hover",m),e.off("element.out",y),t.removeMarker(t.getRootElement(),tg);var A=o.payload.previousSelection;return x!==!1&&A&&!n.get().length&&c(A),b=o,o=null,b}function R(x,b,S,A){o&&v(!1),typeof b=="string"&&(A=S,S=b,b=null),A=C({},i,A||{});var O=A.data||{},D,L,I,$,G;A.trapClick?$=f:$=p,x?(D=Cr(x)||x,L=Pn(x),Gc(x),D.type==="dragstart"&&Mi(D)):(D=null,L={x:0,y:0}),I=a(L),b||(b=I),G=eR(D),o=C({prefix:S,data:O,payload:{},globalStart:L,displacement:Tt(b,I),localStart:I,isTouch:G},A),A.manual||(G?(se.bind(document,"touchstart",d,!0),se.bind(document,"touchcancel",v,!0),se.bind(document,"touchmove",u,!0),se.bind(document,"touchend",p,!0)):(se.bind(document,"mousemove",u),se.bind(document,"dragstart",Mi),se.bind(document,"selectstart",Mi),se.bind(document,"mousedown",$,!0),se.bind(document,"mouseup",$,!0)),se.bind(document,"keyup",l),e.on("element.hover",m),e.on("element.out",y)),s("init"),A.autoActivate&&u(x,!0)}e.on("diagram.destroy",v),this.init=R,this.move=u,this.hover=m,this.out=y,this.end=p,this.cancel=v,this.context=function(){return o},this.setOptions=function(x){C(i,x)}}Du.$inject=["eventBus","canvas","selection","elementRegistry"];var Dt={__depends__:[eg,et],dragging:["type",Du]};k();function ii(e,t,n){this._canvas=n,this._opts=C({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},e);var r=this;t.on("drag.move",function(i){var o=r._toBorderPoint(i);r.startScroll(o)}),t.on(["drag.cleanup"],function(){r.stopScroll()})}ii.$inject=["config.autoScroll","eventBus","canvas"];ii.prototype.startScroll=function(e){var t=this._canvas,n=this._opts,r=this,i=t.getContainer().getBoundingClientRect(),o=[e.x,e.y,i.width-e.x,i.height-e.y];this.stopScroll();for(var a=0,s=0,c=0;c<4;c++)nR(o[c],n.scrollThresholdOut[c],n.scrollThresholdIn[c])&&(c===0?a=n.scrollStep:c==1?s=n.scrollStep:c==2?a=-n.scrollStep:c==3&&(s=-n.scrollStep));(a!==0||s!==0)&&(t.scroll({dx:a,dy:s}),this._scrolling=setTimeout(function(){r.startScroll(e)},n.scrollRepeatTimeout))};function nR(e,t,n){return tA-3&&(L=He(d.target,S),y===A-2?L==="intersect"&&(x.pop(),x[x.length-1]=S):L!=="intersect"&&x.push(w)),f.newWaypoints=d.waypoints=s(d,x),u(f,O,l),f.newSegmentStartIndex=m+O,c(l)}),t.on("connectionSegment.move.hover",function(l){l.context.hover=l.hover,n.addMarker(l.hover,dg)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(l){var f=l.context.hover;f&&n.removeMarker(f,dg)}),t.on("connectionSegment.move.cleanup",function(l){var f=l.context,d=f.connection;f.draggerGfx&&we(f.draggerGfx),n.removeMarker(d,mg)}),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(l){var f=l.context,d=f.connection;d.waypoints=f.originalWaypoints,c(l)}),t.on("connectionSegment.move.end",function(l){var f=l.context,d=f.connection,m=f.newWaypoints,y=f.newSegmentStartIndex;m=m.map(function(S){return{original:S.original,x:Math.round(S.x),y:Math.round(S.y)}});var v=p(m,y),w=v.waypoints,R=s(d,w),x=v.segmentOffset,b={segmentMove:{segmentStartIndex:f.segmentStartIndex,newSegmentStartIndex:y+x}};o.updateWaypoints(d,R,b)})}ju.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];k();var gR=Math.abs,yg=Math.round;function _g(e,t,n){n=n===void 0?10:n;var r,i;for(r=0;ro-Tf)return a-c+o}return a}function n(o,a){if(o.waypoints)return ag(a,o);if(o.width)return{x:bg(o.width/2+o.x),y:bg(o.height/2+o.y)}}function r(o){var a=o.context,s=a.snapPoints,c=a.connection,u=c.waypoints,p=a.segmentStart,l=a.segmentStartIndex,f=a.segmentEnd,d=a.segmentEndIndex,m=a.axis;if(s)return s;var y=[u[l-1],p,f,u[d+1]];return l<2&&y.unshift(n(c.source,o)),d>u.length-3&&y.unshift(n(c.target,o)),a.snapPoints=s={horizontal:[],vertical:[]},E(y,function(v){v&&(v=v.original||v,m==="y"&&s.horizontal.push(v.y),m==="x"&&s.vertical.push(v.x))}),s}e.on("connectionSegment.move.move",1500,function(o){var a=r(o),s=o.x,c=o.y,u,p;if(a){u=t(a.vertical,s),p=t(a.horizontal,c);var l=s-u,f=c-p;C(o,{dx:o.dx-l,dy:o.dy-f,x:u,y:p}),(l||a.vertical.indexOf(s)!==-1)&&je(o,"x",u),(f||a.horizontal.indexOf(c)!==-1)&&je(o,"y",p)}});function i(o){var a=o.snapPoints,s=o.connection.waypoints,c=o.bendpointIndex;if(a)return a;var u=[s[c-1],s[c+1]];return o.snapPoints=a={horizontal:[],vertical:[]},E(u,function(p){p&&(p=p.original||p,a.horizontal.push(p.y),a.vertical.push(p.x))}),a}e.on(["connect.hover","connect.move","connect.end"],1500,function(o){var a=o.context,s=a.hover,c=s&&n(s,o);!me(s)||!c||!c.x||!c.y||(je(o,"x",c.x),je(o,"y",c.y))}),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(o){var a=o.context,s=i(a),c=a.hover,u=c&&n(c,o),p=o.x,l=o.y,f,d;if(s){f=t(u?s.vertical.concat([u.x]):s.vertical,p),d=t(u?s.horizontal.concat([u.y]):s.horizontal,l);var m=p-f,y=l-d;C(o,{dx:o.dx-m,dy:o.dy-y,x:o.x-m,y:o.y-y}),(m||s.vertical.indexOf(p)!==-1)&&je(o,"x",f),(y||s.horizontal.indexOf(l)!==-1)&&je(o,"y",d)}})}zu.$inject=["eventBus"];var xg={__depends__:[Dt,yt],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",Bu],bendpointMove:["type",Ka],bendpointMovePreview:["type",Lu],connectionSegmentMove:["type",ju],bendpointSnapping:["type",zu]};k();function Vu(e,t,n,r){function i(a,s){return r.allowed("connection.create",{source:a,target:s})}function o(a,s){return i(s,a)}e.on("connect.hover",function(a){var s=a.context,c=s.start,u=a.hover,p;if(s.hover=u,p=s.canExecute=i(c,u),!qn(p)){if(p!==!1){s.source=c,s.target=u;return}p=s.canExecute=o(c,u),!qn(p)&&p!==!1&&(s.source=u,s.target=c)}}),e.on(["connect.out","connect.cleanup"],function(a){var s=a.context;s.hover=null,s.source=null,s.target=null,s.canExecute=!1}),e.on("connect.end",function(a){var s=a.context,c=s.canExecute,u=s.connectionStart,p={x:a.x,y:a.y},l=s.source,f=s.target;if(!c)return!1;var d=null,m={connectionStart:Gu(s)?p:u,connectionEnd:Gu(s)?u:p};Ee(c)&&(d=c),s.connection=n.connect(l,f,d,m)}),this.start=function(a,s,c,u){Ee(c)||(u=c,c=Y(s)),t.init(a,"connect",{autoActivate:u,data:{shape:s,context:{start:s,connectionStart:c}}})}}Vu.$inject=["eventBus","dragging","modeling","rules"];function Gu(e){var t=e.hover,n=e.source,r=e.target;return t&&n&&t===n&&n!==r}var _R=1100,bR=900,Eg="connect-ok",wg="connect-not-ok";function Wu(e,t,n){var r=e.get("connectionPreview",!1);r&&t.on("connect.move",function(i){var o=i.context,a=o.canExecute,s=o.hover,c=o.source,u=o.start,p=o.startPosition,l=o.target,f=o.connectionStart||p,d=o.connectionEnd||{x:i.x,y:i.y},m=f,y=d;Gu(o)&&(m=d,y=f),r.drawPreview(o,a,{source:c||u,target:l||s,connectionStart:m,connectionEnd:y})}),t.on("connect.hover",bR,function(i){var o=i.context,a=i.hover,s=o.canExecute;s!==null&&n.addMarker(a,s?Eg:wg)}),t.on(["connect.out","connect.cleanup"],_R,function(i){var o=i.hover;o&&(n.removeMarker(o,Eg),n.removeMarker(o,wg))}),r&&t.on("connect.cleanup",function(i){r.cleanUp(i.context)})}Wu.$inject=["injector","eventBus","canvas"];var No={__depends__:[et,yt,Dt],__init__:["connectPreview"],connect:["type",Vu],connectPreview:["type",Wu]};k();var xR="djs-dragger";function $n(e,t,n,r){this._canvas=t,this._graphicsFactory=n,this._elementFactory=r,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}$n.$inject=["injector","canvas","graphicsFactory","elementFactory"];$n.prototype.drawPreview=function(e,t,n){n=n||{};var r=e.connectionPreviewGfx,i=e.getConnection,o=n.source,a=n.target,s=n.waypoints,c=n.connectionStart,u=n.connectionEnd,p=n.noLayout,l=n.noCropping,f=n.noNoop,d,m=this;if(r||(r=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),gr(r),i||(i=e.getConnection=ER(function(y,v,w){return m.getConnection(y,v,w)})),t&&(d=i(t,o,a)),!d){!f&&this.drawNoopPreview(r,n);return}d.waypoints=s||[],this._layouter&&!p&&(d.waypoints=this._layouter.layoutConnection(d,{source:o,target:a,connectionStart:c,connectionEnd:u,waypoints:n.waypoints||d.waypoints})),(!d.waypoints||!d.waypoints.length)&&(d.waypoints=[o?Y(o):c,a?Y(a):u]),this._connectionDocking&&(o||a)&&!l&&(d.waypoints=this._connectionDocking.getCroppedWaypoints(d,o,a)),this._graphicsFactory.drawConnection(r,d,{stroke:"var(--element-dragger-color)"})};$n.prototype.drawNoopPreview=function(e,t){var n=t.source,r=t.target,i=t.connectionStart||Y(n),o=t.connectionEnd||Y(r),a=this.cropWaypoints(i,o,n,r),s=this.createNoopConnection(a[0],a[1]);Q(e,s)};$n.prototype.cropWaypoints=function(e,t,n,r){var i=this._graphicsFactory,o=n&&i.getShapePath(n),a=r&&i.getShapePath(r),s=i.getConnectionPath({waypoints:[e,t]});return e=n&&Wr(o,s,!0)||e,t=r&&Wr(a,s,!1)||t,[e,t]};$n.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&we(e.connectionPreviewGfx)};$n.prototype.getConnection=function(e){var t=wR(e);return this._elementFactory.createConnection(t)};$n.prototype.createConnectionPreviewGfx=function(){var e=U("g");return z(e,{pointerEvents:"none"}),fe(e).add(xR),Q(this._canvas.getActiveLayer(),e),e};$n.prototype.createNoopConnection=function(e,t){return Kn([e,t],{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"})};function ER(e){var t={};return function(n){var r=JSON.stringify(n),i=t[r];return i||(i=t[r]=e.apply(null,arguments)),i}}function wR(e){return Ee(e)?e:{}}var Sg={__init__:["connectionPreview"],connectionPreview:["type",$n]};var SR=new nr("ps"),CR=["marker-start","marker-mid","marker-end"],RR=["circle","ellipse","line","path","polygon","polyline","path","rect"];function ar(e,t,n,r){this._elementRegistry=e,this._canvas=n,this._styles=r}ar.$inject=["elementRegistry","eventBus","canvas","styles"];ar.prototype.cleanUp=function(){console.warn("PreviewSupport#cleanUp is deprecated and will be removed in future versions. You do not need to manually clean up previews anymore. cf. https://github.com/bpmn-io/diagram-js/pull/906")};ar.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)};ar.prototype.addDragger=function(e,t,n,r="djs-dragger"){n=n||this.getGfx(e);var i=wl(n),o=n.getBoundingClientRect();return this._cloneMarkers(Bn(i),r),z(i,this._styles.cls(r,[],{x:o.top,y:o.left})),Q(t,i),z(i,"data-preview-support-element-id",e.id),i};ar.prototype.addFrame=function(e,t){var n=U("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return Q(t,n),z(n,"data-preview-support-element-id",e.id),n};ar.prototype._cloneMarkers=function(e,t="djs-dragger",n=e){var r=this;e.childNodes&&e.childNodes.forEach(i=>{r._cloneMarkers(i,t,n)}),DR(e)&&CR.forEach(function(i){if(z(e,i)){var o=PR(e,i,r._canvas.getContainer());o&&r._cloneMarker(n,e,o,i,t)}})};ar.prototype._cloneMarker=function(e,t,n,r,i="djs-dragger"){var o=[n.id,i,SR.next()].join("-"),a=ge("marker#"+n.id,e);e=e||this._canvas._svg;var s=a||wl(n);s.id=o,fe(s).add(i);var c=ge(":scope > defs",e);c||(c=U("defs"),Q(e,c)),Q(c,s);var u=TR(s.id);z(t,r,u)};function PR(e,t,n){var r=AR(z(e,t));return ge("marker#"+r,n||document)}function AR(e){return e.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]}function TR(e){return"url(#"+e+")"}function DR(e){return RR.indexOf(e.nodeName)!==-1}var Tn={__init__:["previewSupport"],previewSupport:["type",ar]};var Uu="complex-preview",Oo=class{constructor(t,n,r){this._canvas=t,this._graphicsFactory=n,this._previewSupport=r,this._markers=[]}create(t){this.cleanUp();let{created:n=[],moved:r=[],removed:i=[],resized:o=[]}=t,a=this._canvas.getLayer(Uu);n.filter(s=>!MR(s)).forEach(s=>{let c;me(s)?(c=this._graphicsFactory._createContainer("connection",U("g")),this._graphicsFactory.drawConnection(Bn(c),s)):(c=this._graphicsFactory._createContainer("shape",U("g")),this._graphicsFactory.drawShape(Bn(c),s),Be(c,s.x,s.y)),this._previewSupport.addDragger(s,a,c)}),r.forEach(({element:s,delta:c})=>{this._previewSupport.addDragger(s,a,void 0,"djs-dragging"),this._canvas.addMarker(s,"djs-element-hidden"),this._markers.push([s,"djs-element-hidden"]);let u=this._previewSupport.addDragger(s,a);me(s)?Be(u,c.x,c.y):Be(u,s.x+c.x,s.y+c.y)}),i.forEach(s=>{this._previewSupport.addDragger(s,a,void 0,"djs-dragging"),this._canvas.addMarker(s,"djs-element-hidden"),this._markers.push([s,"djs-element-hidden"])}),o.forEach(({shape:s,bounds:c})=>{this._canvas.addMarker(s,"djs-hidden"),this._markers.push([s,"djs-hidden"]),this._previewSupport.addDragger(s,a,void 0,"djs-dragging");let u=this._graphicsFactory._createContainer("shape",U("g"));this._graphicsFactory.drawShape(Bn(u),s,{width:c.width,height:c.height}),Be(u,c.x,c.y),this._previewSupport.addDragger(s,a,u)})}cleanUp(){gr(this._canvas.getLayer(Uu)),this._markers.forEach(([t,n])=>this._canvas.removeMarker(t,n)),this._markers=[]}show(){this._canvas.showLayer(Uu)}hide(){this._canvas.hideLayer(Uu)}};Oo.$inject=["canvas","graphicsFactory","previewSupport"];function MR(e){return e.hidden}var Cg={__depends__:[Tn],__init__:["complexPreview"],complexPreview:["type",Oo]};var Df=["top","bottom","left","right"],qu=10;function Xa(e,t){N.call(this,e),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],function(i){var o=i.context,a=o.connection,s=a.source,c=a.target,u=o.hints||{};u.createElementsBehavior!==!1&&(n(s),n(c))}),this.postExecuted(["label.create"],function(i){var o=i.context,a=o.shape,s=o.hints||{};s.createElementsBehavior!==!1&&n(a.labelTarget)}),this.postExecuted(["elements.create"],function(i){var o=i.context,a=o.elements,s=o.hints||{};s.createElementsBehavior!==!1&&a.forEach(function(c){n(c)})});function n(i){if(Kr(i)&&!me(i)){var o=OR(i);o&&r(i,o)}}function r(i,o){var a=Y(i),s=i.label,c=Y(s);if(s.parent){var u=Z(i),p;switch(o){case"top":p={x:a.x,y:u.top-qu-s.height/2};break;case"left":p={x:u.left-qu-s.width/2,y:a.y};break;case"bottom":p={x:a.x,y:u.bottom+qu+s.height/2};break;case"right":p={x:u.right+qu+s.width/2,y:a.y};break}var l=Tt(p,c);t.moveShape(s,l)}}}B(Xa,N);Xa.$inject=["eventBus","modeling"];function kR(e){var t=e.host,n=Y(e),r=He(n,t),i;r.indexOf("-")>=0?i=r.split("-"):i=[r];var o=Df.filter(function(a){return i.indexOf(a)===-1});return o}function NR(e){var t=Y(e),n=[].concat(e.incoming.map(function(r){return r.waypoints[r.waypoints.length-2]}),e.outgoing.map(function(r){return r.waypoints[1]})).map(function(r){return Rg(t,r)});return n}function OR(e){var t=Y(e.label),n=Y(e),r=Rg(n,t);if(BR(r)){var i=NR(e);if(e.host){var o=kR(e);i=i.concat(o)}var a=Df.filter(function(s){return i.indexOf(s)===-1});if(a.indexOf(r)===-1)return a[0]}}function Rg(e,t){return He(t,e,5)}function BR(e){return Df.indexOf(e)!==-1}function Za(e){N.call(this,e),this.preExecute("shape.append",function(t){var n=t.source,r=t.shape;t.position||(h(r,"bpmn:TextAnnotation")?t.position={x:n.x+n.width/2+75,y:n.y-50-r.height/2}:t.position={x:n.x+n.width+80+r.width/2,y:n.y+n.height/2})},!0)}B(Za,N);Za.$inject=["eventBus"];k();function Qa(e,t){e.invoke(N,this),this.postExecute("shape.move",function(n){var r=n.newParent,i=n.shape,o=J(i.incoming.concat(i.outgoing),function(a){return h(a,"bpmn:Association")});E(o,function(a){t.moveConnection(a,{x:0,y:0},r)})},!0)}B(Qa,N);Qa.$inject=["injector","modeling"];var Pg=500;function Bo(e,t){t.invoke(N,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",Pg,function(r){var i=r.elements;i=i.filter(function(o){var a=o.host;return Ag(o,a)}),i.length===1&&i.map(function(o){return i.indexOf(o)}).forEach(function(o){var a=i[o];r.elements[o]=n._replaceShape(i[o],a)})},!0),this.preExecute("elements.move",Pg,function(r){var i=r.shapes,o=r.newHost;if(i.length===1){var a=i[0];Ag(a,o)&&(r.shapes=[n._replaceShape(a,o)])}},!0)}Bo.$inject=["bpmnReplace","injector"];B(Bo,N);Bo.prototype._replaceShape=function(e,t){var n=IR(e),r={type:"bpmn:BoundaryEvent",host:t};return n&&(r.eventDefinitionType=n.$type),this._bpmnReplace.replaceElement(e,r,{layoutConnection:!1})};function IR(e){var t=j(e),n=t.eventDefinitions;return n&&n[0]}function Ag(e,t){return!ne(e)&&ee(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}k();function Ja(e,t){N.call(this,e);function n(r){return J(r.attachers,function(i){return h(i,"bpmn:BoundaryEvent")})}this.postExecute("connection.create",function(r){var i=r.context.source,o=r.context.target,a=n(o);h(i,"bpmn:EventBasedGateway")&&h(o,"bpmn:ReceiveTask")&&a.length>0&&t.removeElements(a)}),this.postExecute("connection.reconnect",function(r){var i=r.context.oldSource,o=r.context.newSource;h(i,"bpmn:Gateway")&&h(o,"bpmn:EventBasedGateway")&&E(o.outgoing,function(a){var s=a.target,c=n(s);h(s,"bpmn:ReceiveTask")&&c.length>0&&t.removeElements(c)})})}Ja.$inject=["eventBus","modeling"];B(Ja,N);function ts(e,t,n){N.call(this,e),this.preExecute("shape.replace",s,!0),this.postExecuted("shape.replace",c,!0),this.preExecute("connection.create",i,!0),this.postExecuted("connection.delete",r,!0),this.postExecuted("connection.reconnect",o,!0),this.postExecuted("element.updateProperties",a,!0);function r(v){let w=v.source,R=v.target;Io(w)&&es(R)&&p(R)}function i(v){let w=v.connection,R=v.source,x=v.target;Io(R)&&Ku(x)&&(u(x),f(R,[w]))}function o(v){let w=v.newTarget,R=v.oldSource,x=v.oldTarget;if(x!==w){let b=R;es(x)&&p(x),Io(b)&&Ku(w)&&u(w)}}function a(v){let{element:w}=v;es(w)?(l(w),d(w)):Ku(w)&&m(w)}function s(v){let{newData:w,oldShape:R}=v;if(Io(v.oldShape)&&w.eventDefinitionType!=="bpmn:CompensateEventDefinition"||w.type!=="bpmn:BoundaryEvent"){let x=R.outgoing.find(({target:b})=>es(b));x&&x.target&&(v._connectionTarget=x.target)}else if(!Io(v.oldShape)&&w.eventDefinitionType==="bpmn:CompensateEventDefinition"&&w.type==="bpmn:BoundaryEvent"){let x=R.outgoing.find(({target:b})=>Ku(b));x&&x.target&&(v._connectionTarget=x.target),y(R)}}function c(v){let{_connectionTarget:w,newShape:R}=v;w&&t.connect(R,w)}function u(v){t.updateProperties(v,{isForCompensation:!0})}function p(v){t.updateProperties(v,{isForCompensation:void 0})}function l(v){for(let w of v.incoming)n.canConnect(w.source,v)||t.removeConnection(w);for(let w of v.outgoing)n.canConnect(v,w.target)||t.removeConnection(w)}function f(v,w){v.outgoing.filter(b=>h(b,"bpmn:Association")).filter(b=>es(b.target)&&!w.includes(b)).forEach(b=>t.removeConnection(b))}function d(v){let w=v.attachers.slice();w.length&&t.removeElements(w)}function m(v){let w=v.incoming.filter(R=>Io(R.source));t.removeElements(w)}function y(v){let w=v.outgoing.filter(R=>h(R,"bpmn:SequenceFlow"));t.removeElements(w)}}B(ts,N);ts.$inject=["eventBus","modeling","bpmnRules"];function es(e){let t=j(e);return t&&t.get("isForCompensation")}function Io(e){return e&&h(e,"bpmn:BoundaryEvent")&&br(e,"bpmn:CompensateEventDefinition")}function Ku(e){return e&&h(e,"bpmn:Activity")&&!Ye(e)}function ns(e){e.invoke(N,this),this.preExecute("shape.create",1500,function(t){var n=t.context,r=n.parent,i=n.shape;h(r,"bpmn:Lane")&&!h(i,"bpmn:Lane")&&(n.parent=Tr(r,"bpmn:Participant"))})}ns.$inject=["injector"];B(ns,N);function rs(e,t){N.call(this,e),this.preExecute("shape.create",function(n){var a;var r=n.context,i=r.shape;if(h(i,"bpmn:DataObjectReference")&&i.type!=="label"){var o=t.create("bpmn:DataObject");o.isCollection=((a=i.businessObject.dataObjectRef)==null?void 0:a.isCollection)||!1,i.businessObject.dataObjectRef=o}})}rs.$inject=["eventBus","bpmnFactory"];B(rs,N);k();var Mf=20,kf=20,Tg=30,Yu=2e3;function is(e,t,n){N.call(this,t),t.on(["create.start","shape.move.start"],Yu,function(i){var o=i.context,a=o.shape,s=e.getRootElement();if(!(!h(a,"bpmn:Participant")||!h(s,"bpmn:Process")||!s.children.length)){var c=s.children.filter(function(l){return!h(l,"bpmn:Group")&&!ne(l)&&!me(l)});if(c.length){var u=Se(c),p=LR(a,u);C(a,p),o.createConstraints=jR(a,u)}}}),t.on("create.start",Yu,function(i){var o=i.context,a=o.shape,s=e.getRootElement(),c=e.getGraphics(s);function u(p){p.element=s,p.gfx=c}h(a,"bpmn:Participant")&&h(s,"bpmn:Process")&&(t.on("element.hover",Yu,u),t.once("create.cleanup",function(){t.off("element.hover",u)}))});function r(){var i=e.getRootElement();return h(i,"bpmn:Collaboration")?i:n.makeCollaboration()}this.preExecute("elements.create",Yu,function(i){var o=i.elements,a=i.parent,s=FR(o),c;s&&h(a,"bpmn:Process")&&(i.parent=r(),c=i.hints=i.hints||{},c.participant=s,c.process=a,c.processRef=j(s).get("processRef"))},!0),this.preExecute("shape.create",function(i){var o=i.parent,a=i.shape;h(a,"bpmn:Participant")&&h(o,"bpmn:Process")&&(i.parent=r(),i.process=o,i.processRef=j(a).get("processRef"))},!0),this.execute("shape.create",function(i){var o=i.hints||{},a=i.process||o.process,s=i.shape,c=o.participant;a&&(!c||s===c)&&j(s).set("processRef",j(a))},!0),this.revert("shape.create",function(i){var o=i.hints||{},a=i.process||o.process,s=i.processRef||o.processRef,c=i.shape,u=o.participant;a&&(!u||c===u)&&j(c).set("processRef",s)},!0),this.postExecute("shape.create",function(i){var o=i.hints||{},a=i.process||i.hints.process,s=i.shape,c=o.participant;if(a){var u=a.children.slice();c?s===c&&n.moveElements(u,{x:0,y:0},c):n.moveElements(u,{x:0,y:0},s)}},!0)}is.$inject=["canvas","eventBus","modeling"];B(is,N);function LR(e,t){t={width:t.width+Mf*2+Tg,height:t.height+kf*2};var n=Math.max(e.width,t.width),r=Math.max(e.height,t.height);return{x:-n/2,y:-r/2,width:n,height:r}}function jR(e,t){return t=Z(t),{bottom:t.top+e.height/2-kf,left:t.right-e.width/2+Mf,top:t.bottom-e.height/2+kf,right:t.left+e.width/2-Mf-Tg}}function FR(e){return re(e,function(t){return h(t,"bpmn:Participant")})}k();var Dg="__targetRef_placeholder";function os(e,t){N.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],Mg(o)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],Mg(o));function n(a,s,c){var u=a.get("dataInputAssociations");return re(u,function(p){return p!==c&&p.targetRef===s})}function r(a,s){var c=a.get("properties"),u=re(c,function(p){return p.name===Dg});return!u&&s&&(u=t.create("bpmn:Property",{name:Dg}),Ce(c,u)),u}function i(a,s){var c=r(a);c&&(n(a,c,s)||De(a.get("properties"),c))}function o(a){var s=a.context,c=s.connection,u=c.businessObject,p=c.target,l=p&&p.businessObject,f=s.newTarget,d=f&&f.businessObject,m=s.oldTarget||s.target,y=m&&m.businessObject,v=c.businessObject,w;y&&y!==l&&i(y,u),d&&d!==l&&i(d,u),l?(w=r(l,!0),v.targetRef=w):v.targetRef=null}}os.$inject=["eventBus","bpmnFactory"];B(os,N);function Mg(e){return function(t){var n=t.context,r=n.connection;if(h(r,"bpmn:DataInputAssociation"))return e(t)}}function Lo(e){this._bpmnUpdater=e}Lo.$inject=["bpmnUpdater"];Lo.prototype.execute=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,r=e.newSemanticParent,i=e.newDiParent;return e.oldSemanticParent=t.$parent,e.oldDiParent=n.$parent,this._bpmnUpdater.updateSemanticParent(t,r),this._bpmnUpdater.updateDiParent(n,i),[]};Lo.prototype.revert=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,r=e.oldSemanticParent,i=e.oldDiParent;return this._bpmnUpdater.updateSemanticParent(t,r),this._bpmnUpdater.updateDiParent(n,i),[]};function as(e,t,n,r){N.call(this,r),t.registerHandler("dataStore.updateContainment",Lo);function i(){return n.filter(function(s){return h(s,"bpmn:Participant")&&j(s).processRef})[0]}function o(s){return s.children.filter(function(c){return h(c,"bpmn:DataStoreReference")&&!c.labelTarget})}function a(s,c){var u=s.businessObject||s;if(c=c||i(),c){var p=c.businessObject||c;t.execute("dataStore.updateContainment",{dataStoreBo:u,dataStoreDi:ce(s),newSemanticParent:p.processRef||p,newDiParent:ce(c)})}}this.preExecute("shape.create",function(s){var c=s.context,u=c.shape;h(u,"bpmn:DataStoreReference")&&u.type!=="label"&&(c.hints||(c.hints={}),c.hints.autoResize=!1)}),this.preExecute("elements.move",function(s){var c=s.context,u=c.shapes,p=u.filter(function(l){return h(l,"bpmn:DataStoreReference")});p.length&&(c.hints||(c.hints={}),c.hints.autoResize=u.filter(function(l){return!h(l,"bpmn:DataStoreReference")}))}),this.postExecute("shape.create",function(s){var c=s.context,u=c.shape,p=u.parent;h(u,"bpmn:DataStoreReference")&&u.type!=="label"&&h(p,"bpmn:Collaboration")&&a(u)}),this.postExecute("shape.move",function(s){var c=s.context,u=c.shape,p=c.oldParent,l=u.parent;if(!h(p,"bpmn:Collaboration")&&h(u,"bpmn:DataStoreReference")&&u.type!=="label"&&h(l,"bpmn:Collaboration")){var f=h(p,"bpmn:Participant")?p:$R(p,"bpmn:Participant");a(u,f)}}),this.postExecute("shape.delete",function(s){var c=s.context,u=c.shape,p=e.getRootElement();ee(u,["bpmn:Participant","bpmn:SubProcess"])&&h(p,"bpmn:Collaboration")&&o(p).filter(function(l){return HR(l,u)}).forEach(function(l){a(l)})}),this.postExecute("canvas.updateRoot",function(s){var c=s.context,u=c.oldRoot,p=c.newRoot,l=o(u);l.forEach(function(f){h(p,"bpmn:Process")&&a(f,p)})})}as.$inject=["canvas","commandStack","elementRegistry","eventBus"];B(as,N);function HR(e,t){for(var n=e.businessObject||e,r=t.businessObject||t;n.$parent;){if(n.$parent===r.processRef||r)return!0;n=n.$parent}return!1}function $R(e,t){for(;e.parent;){if(h(e.parent,t))return e.parent;e=e.parent}}k();var Zu=Math.max,Qu=Math.min,zR=20;function Ju(e,t){return{top:e.top-t.top,right:e.right-t.right,bottom:e.bottom-t.bottom,left:e.left-t.left}}function kg(e,t,n){var r=n.x,i=n.y,o={x:e.x,y:e.y,width:e.width,height:e.height};return t.indexOf("n")!==-1?(o.y=e.y+i,o.height=e.height-i):t.indexOf("s")!==-1&&(o.height=e.height+i),t.indexOf("e")!==-1?o.width=e.width+r:t.indexOf("w")!==-1&&(o.x=e.x+r,o.width=e.width-r),o}function Ng(e,t){return{x:e.x+(t.left||0),y:e.y+(t.top||0),width:e.width-(t.left||0)+(t.right||0),height:e.height-(t.top||0)+(t.bottom||0)}}function Xu(e,t,n){var r=t[e],i=n.min&&n.min[e],o=n.max&&n.max[e];return te(i)&&(r=(/top|left/.test(e)?Qu:Zu)(r,i)),te(o)&&(r=(/top|left/.test(e)?Zu:Qu)(r,o)),r}function Og(e,t){if(!t)return e;var n=Z(e);return xi({top:Xu("top",n,t),right:Xu("right",n,t),bottom:Xu("bottom",n,t),left:Xu("left",n,t)})}function Bg(e,t,n,r){var i=Z(t),o={top:/n/.test(e)?i.bottom-n.height:i.top,left:/w/.test(e)?i.right-n.width:i.left,bottom:/s/.test(e)?i.top+n.height:i.bottom,right:/e/.test(e)?i.left+n.width:i.right},a=r?Z(r):o,s={top:Qu(o.top,a.top),left:Qu(o.left,a.left),bottom:Zu(o.bottom,a.bottom),right:Zu(o.right,a.right)};return xi(s)}function ss(e,t){return typeof e!="undefined"?e:zR}function GR(e,t){var n,r,i,o;return typeof t=="object"?(n=ss(t.left),r=ss(t.right),i=ss(t.top),o=ss(t.bottom)):n=r=i=o=ss(t),{x:e.x-n,y:e.y-i,width:e.width+n+r,height:e.height+i+o}}function VR(e){return!(e.waypoints||e.type==="label")}function ep(e,t){var n;if(e.length===void 0?n=J(e.children,VR):n=e,n.length)return GR(Se(n),t)}var oi=Math.abs;function WR(e,t){return Ju(Z(t),Z(e))}var UR=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],rn=30;function jo(e,t){return t=t||[],e.children.filter(function(n){h(n,"bpmn:Lane")&&(jo(n,t),t.push(n))}),t}function gn(e){return e.children.filter(function(t){return h(t,"bpmn:Lane")})}function Nt(e){return Tr(e,UR)||e}function Ig(e,t){var n=Nt(e),r=h(n,"bpmn:Process")?[]:[n],i=jo(n,r),o=Z(e),a=Z(t),s=WR(e,t),c=[],u=Pe(e);return i.forEach(function(p){if(p!==e){var l=u?0:s.top,f=u?s.right:0,d=u?0:s.bottom,m=u?s.left:0,y=Z(p);s.top&&(oi(y.bottom-o.top)<10&&(d=a.top-y.bottom),oi(y.top-o.top)<5&&(l=a.top-y.top)),s.left&&(oi(y.right-o.left)<10&&(f=a.left-y.right),oi(y.left-o.left)<5&&(m=a.left-y.left)),s.bottom&&(oi(y.top-o.bottom)<10&&(l=a.bottom-y.top),oi(y.bottom-o.bottom)<5&&(d=a.bottom-y.bottom)),s.right&&(oi(y.left-o.right)<10&&(m=a.right-y.left),oi(y.right-o.right)<5&&(f=a.right-y.right)),(l||f||d||m)&&c.push({shape:p,newBounds:Ng(p,{top:l,right:f,bottom:d,left:m})})}}),c}var qR=500;function cs(e,t){N.call(this,e);function n(r,i){var o=Pe(r),a=gn(i),s=[],c=[],u=[],p=[];if(On(a,function(v){return o?v.y>r.y?c.push(v):s.push(v):v.x>r.x?p.push(v):u.push(v),v.children}),!!a.length){var l;o?c.length&&s.length?l=r.height/2:l=r.height:p.length&&u.length?l=r.width/2:l=r.width;var f,d,m,y;s.length&&(f=t.calculateAdjustments(s,"y",l,r.y-10),t.makeSpace(f.movingShapes,f.resizingShapes,{x:0,y:l},"s")),c.length&&(d=t.calculateAdjustments(c,"y",-l,r.y+r.height+10),t.makeSpace(d.movingShapes,d.resizingShapes,{x:0,y:-l},"n")),u.length&&(m=t.calculateAdjustments(u,"x",l,r.x-10),t.makeSpace(m.movingShapes,m.resizingShapes,{x:l,y:0},"e")),p.length&&(y=t.calculateAdjustments(p,"x",-l,r.x+r.width+10),t.makeSpace(y.movingShapes,y.resizingShapes,{x:-l,y:0},"w"))}}this.postExecuted("shape.delete",qR,function(r){var i=r.context,o=i.hints,a=i.shape,s=i.oldParent;h(a,"bpmn:Lane")&&(o&&o.nested||n(a,s))})}cs.$inject=["eventBus","spaceTool"];B(cs,N);var Lg=500;function Fo(e,t){t.invoke(N,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",Lg,function(r){var i=r.elements;i.filter(function(o){var a=o.host;return jg(o,a)}).map(function(o){return i.indexOf(o)}).forEach(function(o){r.elements[o]=n._replaceShape(i[o])})},!0),this.preExecute("elements.move",Lg,function(r){var i=r.shapes,o=r.newHost;i.forEach(function(a,s){var c=a.host;jg(a,YR(i,c)?c:o)&&(i[s]=n._replaceShape(a))})},!0)}Fo.$inject=["bpmnReplace","injector"];B(Fo,N);Fo.prototype._replaceShape=function(e){var t=KR(e),n;return t?n={type:"bpmn:IntermediateCatchEvent",eventDefinitionType:t.$type}:n={type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,n,{layoutConnection:!1})};function KR(e){var t=j(e),n=t.eventDefinitions;return n&&n[0]}function jg(e,t){return!ne(e)&&h(e,"bpmn:BoundaryEvent")&&!t}function YR(e,t){return e.indexOf(t)!==-1}k();function us(e,t,n){N.call(this,e);function r(i,o,a){var s=o.waypoints,c,u,p,l,f,d,m,y=i.outgoing.slice(),v=i.incoming.slice(),w;te(a.width)?w=Y(a):w=a;var R=za(s,w);if(R){if(c=s.slice(0,R.index),u=s.slice(R.index+(R.bendpoint?1:0)),!c.length||!u.length)return;p=R.bendpoint?s[R.index]:w,(c.length===1||!Fg(i,c[c.length-1]))&&c.push(Hg(p)),(u.length===1||!Fg(i,u[0]))&&u.unshift(Hg(p))}l=o.source,f=o.target,t.canConnect(l,i,o)&&(n.reconnectEnd(o,i,c||w),d=o),t.canConnect(i,f,o)&&(d?m=n.connect(i,f,{type:o.type,waypoints:u}):(n.reconnectStart(o,i,u||w),m=o));var x=[].concat(d&&J(v,function(b){return b.source===d.source})||[],m&&J(y,function(b){return b.target===m.target})||[]);x.length&&n.removeElements(x)}this.preExecute("elements.move",function(i){var o=i.newParent,a=i.shapes,s=i.delta,c=a[0];if(!(!c||!o)){o&&o.waypoints&&(i.newParent=o=o.parent);var u=Y(c),p={x:u.x+s.x,y:u.y+s.y},l=re(o.children,function(f){var d=t.canInsert(a,f);return d&&za(f.waypoints,p)});l&&(i.targetFlow=l,i.position=p)}},!0),this.postExecuted("elements.move",function(i){var o=i.shapes,a=i.targetFlow,s=i.position;a&&r(o[0],a,s)},!0),this.preExecute("shape.create",function(i){var o=i.parent,a=i.shape;t.canInsert(a,o)&&(i.targetFlow=o,i.parent=o.parent)},!0),this.postExecuted("shape.create",function(i){var o=i.shape,a=i.targetFlow,s=i.position;a&&r(o,a,s)},!0)}B(us,N);us.$inject=["eventBus","bpmnRules","modeling"];function Fg(e,t){var n=t.x,r=t.y;return n>=e.x&&n<=e.x+e.width&&r>=e.y&&r<=e.y+e.height}function Hg(e){return C({},e)}function ps(e,t){N.call(this,e),this.preExecuted("connection.create",function(n){var r=n.context,i=r.connection,o=r.source,a=r.target,s=r.hints;if(!(s&&s.createElementsBehavior===!1)&&Ho(i)){var c=[];h(o,"bpmn:EventBasedGateway")?c=a.incoming.filter(u=>u!==i&&Ho(u)):c=a.incoming.filter(u=>u!==i&&Ho(u)&&h(u.source,"bpmn:EventBasedGateway")),c.forEach(function(u){t.removeConnection(u)})}}),this.preExecuted("shape.replace",function(n){var r=n.context,i=r.newShape;if(h(i,"bpmn:EventBasedGateway")){var o=i.outgoing.filter(Ho).reduce(function(a,s){return a.includes(s.target)?a:a.concat(s.target)},[]);o.forEach(function(a){a.incoming.filter(Ho).forEach(function(s){let c=a.incoming.filter(Ho).filter(function(u){return u.source===i});(s.source!==i||c.length>1)&&t.removeConnection(s)})})}})}ps.$inject=["eventBus","modeling"];B(ps,N);function Ho(e){return h(e,"bpmn:SequenceFlow")}var tp=1500,$g=2e3;function np(e,t,n){t.on(["create.hover","create.move","create.out","create.end","shape.move.hover","shape.move.move","shape.move.out","shape.move.end"],tp,function(r){var i=r.context,o=i.shape||r.shape,a=r.hover;h(a,"bpmn:Lane")&&!ee(o,["bpmn:Lane","bpmn:Participant"])&&(r.hover=Nt(a),r.hoverGfx=e.getGraphics(r.hover));var s=n.getRootElement();a!==s&&(o.labelTarget||ee(o,["bpmn:Group","bpmn:TextAnnotation"]))&&(r.hover=s,r.hoverGfx=e.getGraphics(r.hover))}),t.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],tp,function(r){var i=r.hover;h(i,"bpmn:Lane")&&(r.hover=Nt(i)||i,r.hoverGfx=e.getGraphics(r.hover))}),t.on(["bendpoint.move.hover"],tp,function(r){var i=r.context,o=r.hover,a=i.type;h(o,"bpmn:Lane")&&/reconnect/.test(a)&&(r.hover=Nt(o)||o,r.hoverGfx=e.getGraphics(r.hover))}),t.on(["connect.start"],tp,function(r){var i=r.context,o=i.start;h(o,"bpmn:Lane")&&(i.start=Nt(o)||o)}),t.on("shape.move.start",$g,function(r){var i=r.shape;h(i,"bpmn:Lane")&&(r.shape=Nt(i)||i)}),t.on("spaceTool.move",$g,function(r){var i=r.hover;i&&h(i,"bpmn:Lane")&&(r.hover=Nt(i))})}np.$inject=["elementRegistry","eventBus","canvas"];function zg(e){return e.create("bpmn:Category")}function Gg(e){return e.create("bpmn:CategoryValue")}function Vg(e,t,n){return Ce(t.get("categoryValue"),e),e.$parent=t,Ce(n.get("rootElements"),t),t.$parent=n,e}function Wg(e){var t=e.$parent;return t&&(De(t.get("categoryValue"),e),e.$parent=null),e}function Ug(e){var t=e.$parent;return t&&(De(t.get("rootElements"),e),e.$parent=null),e}var qg=770;function ls(e,t,n,r,i,o){i.invoke(N,this);function a(){return n.filter(function(m){return h(m,"bpmn:Group")})}function s(m,y){return m.some(function(v){var w=j(v),R=w.categoryValueRef&&w.categoryValueRef.$parent;return R===y})}function c(m,y){return m.some(function(v){var w=j(v);return w.categoryValueRef===y})}function u(m,y,v){var w=a().filter(function(R){return R.businessObject!==v});y&&!s(w,y)&&Ug(y),m&&!c(w,m)&&Wg(m)}function p(m,y){return Vg(m,y,t.getDefinitions())}function l(m,y){var v=j(m),w=v.categoryValueRef;w||(w=v.categoryValueRef=y.categoryValue=y.categoryValue||Gg(e));var R=w.$parent;R||(R=w.$parent=y.category=y.category||zg(e)),p(w,R,t.getDefinitions())}function f(m,y){var v=y.category,w=y.categoryValue,R=j(m);w?(R.categoryValueRef=null,u(w,v,R)):u(null,R.categoryValueRef.$parent,R)}this.execute("label.create",function(m){var y=m.context,v=y.labelTarget;h(v,"bpmn:Group")&&l(v,y)}),this.revert("label.create",function(m){var y=m.context,v=y.labelTarget;h(v,"bpmn:Group")&&f(v,y)}),this.execute("shape.delete",function(m){var y=m.context,v=y.shape,w=j(v);if(!(!h(v,"bpmn:Group")||v.labelTarget)){var R=y.categoryValue=w.categoryValueRef,x;R&&(x=y.category=R.$parent,u(R,x,w),w.categoryValueRef=null)}}),this.reverted("shape.delete",function(m){var y=m.context,v=y.shape;if(!(!h(v,"bpmn:Group")||v.labelTarget)){var w=y.category,R=y.categoryValue,x=j(v);R&&(x.categoryValueRef=R,p(R,w))}}),this.execute("shape.create",function(m){var y=m.context,v=y.shape;!h(v,"bpmn:Group")||v.labelTarget||j(v).categoryValueRef&&l(v,y)}),this.reverted("shape.create",function(m){var y=m.context,v=y.shape;!h(v,"bpmn:Group")||v.labelTarget||j(v).categoryValueRef&&f(v,y)});function d(m,y){var v=e.create(m.$type);return o.copyElement(m,v,null,y)}r.on("copyPaste.copyElement",qg,function(m){var y=m.descriptor,v=m.element;if(!(!h(v,"bpmn:Group")||v.labelTarget)){var w=j(v);if(w.categoryValueRef){var R=w.categoryValueRef;y.categoryValue=d(R,!0),R.$parent&&(y.category=d(R.$parent,!0))}}}),r.on("copyPaste.pasteElement",qg,function(m){var y=m.descriptor,v=y.businessObject,w=y.categoryValue,R=y.category;w&&(w=v.categoryValueRef=d(w)),R&&(w.$parent=d(R)),delete y.category,delete y.categoryValue})}ls.$inject=["bpmnFactory","bpmnjs","elementRegistry","eventBus","injector","moddleCopy"];B(ls,N);function $o(e,t,n,r){var i,o,a,s,c;return i=(r.y-n.y)*(t.x-e.x)-(r.x-n.x)*(t.y-e.y),i==0?null:(o=e.y-n.y,a=e.x-n.x,c=(r.x-n.x)*o-(r.y-n.y)*a,s=c/i,{x:Math.round(e.x+s*(t.x-e.x)),y:Math.round(e.y+s*(t.y-e.y))})}function rp(e){function t(r,i,o){var a={x:o.x,y:o.y-50},s={x:o.x-50,y:o.y},c=$o(r,i,o,a),u=$o(r,i,o,s),p;c&&u?Kg(c,o)>Kg(u,o)?p=u:p=c:p=c||u,r.original=p}function n(r){var i=r.waypoints;t(i[0],i[1],Y(r.source)),t(i[i.length-1],i[i.length-2],Y(r.target))}e.on("bpmnElement.added",function(r){var i=r.element;i.waypoints&&n(i)})}rp.$inject=["eventBus"];function Kg(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function fs(e){N.call(this,e);var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],function(n){var r=n.context.shape,i=j(r),o=ce(r);if(ee(i,t)){var a=o.get("isHorizontal");a===void 0&&(a=!0),o.set("isHorizontal",a)}})}fs.$inject=["eventBus"];B(fs,N);k();var Jg=Math.sqrt,ey=Math.min,XR=Math.max,Yg=Math.abs;function Xg(e){return Math.pow(e,2)}function ds(e,t){return Jg(Xg(e.x-t.x)+Xg(e.y-t.y))}function ty(e,t){var n=0,r,i,o,a,s,c,u,p,l,f,d;for(n=0;n line intersections");u.length===1&&(p={type:"bendpoint",position:u[0],segmentIndex:n,bendpointIndex:Qg(r,u[0])?n:n+1}),u.length===2&&(s=JR(u[0],u[1]),p={type:"segment",position:s,segmentIndex:n,relativeLocation:ds(r,s)/ds(r,i)}),l=ds(p.position,e),(!d||f>l)&&(d=p,f=l)}return d}function ZR(e,t,n,r){var i=t.x-e.x,o=t.y-e.y,a=n.x-e.x,s=n.y-e.y,c=i*i+o*o,u=i*a+o*s,p=a*a+s*s-r*r,l=u/c,f=p/c,d=l*l-f;if(d<0&&d>-1e-6&&(d=0),d<0)return[];var m=Jg(d),y=-l+m,v=-l-m,w={x:e.x-i*y,y:e.y-o*y};if(d===0)return[w];var R={x:e.x-i*v,y:e.y-o*v};return[w,R].filter(function(x){return QR(x,e,t)})}function QR(e,t,n){return Zg(e.x,t.x,n.x)&&Zg(e.y,t.y,n.y)}function Zg(e,t,n){return e>=ey(t,n)-ip&&e<=XR(t,n)+ip}function JR(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}var ip=.1;function Qg(e,t){return Yg(e.x-t.x)<=ip&&Yg(e.y-t.y)<=ip}function ry(e,t,n,r){var i=n.segmentIndex,o=t.length-e.length;if(r.segmentMove){var a=r.segmentMove.segmentStartIndex,s=r.segmentMove.newSegmentStartIndex;return i===a?s:i>=s?i+o=u&&(p=c?i+1:i-1),it.length-2||u===null)return a;var p=ny(n,c),l=ny(t,u),f=s.position,d=tP(p,f),m=eP(p,l);if(s.type==="bendpoint"){var y=t.length-n.length,v=s.bendpointIndex,w=n[v];if(t.indexOf(w)!==-1)return a;if(y===0){var R=t[v];return i=R.x-s.position.x,o=R.y-s.position.y,{delta:{x:i,y:o},point:{x:e.x+i,y:e.y+o}}}y<0&&v!==0&&v{j(a.context.element)===a.context.moddleElement&&i(a)});function i(a){var s=a.context,c=s.element,u=s.properties;if(ay in u&&t.updateLabel(c,u[ay]),sy in u&&h(c,"bpmn:TextAnnotation")){var p=r.getTextAnnotationBounds({x:c.x,y:c.y,width:c.width,height:c.height},u[sy]||"");t.updateLabel(c,u.text,p)}}this.postExecute(["shape.create","connection.create"],function(a){var s=a.context,c=s.hints||{};if(c.createElementsBehavior!==!1){var u=s.shape||s.connection;ne(u)||!dn(u)||Pt(u)&&t.updateLabel(u,Pt(u))}}),this.postExecute("shape.delete",function(a){var s=a.context,c=s.labelTarget,u=s.hints||{};c&&u.unsetLabel!==!1&&t.updateLabel(c,null,null,{removeShape:!1})});function o(a){var s=a.context,c=s.connection,u=c.label,p=C({},s.hints),l=s.newWaypoints||c.waypoints,f=s.oldWaypoints;return typeof p.startChanged=="undefined"&&(p.startChanged=!!p.connectionStart),typeof p.endChanged=="undefined"&&(p.endChanged=!!p.connectionEnd),oy(u,l,f,p)}this.postExecute(["connection.layout","connection.updateWaypoints"],function(a){var s=a.context,c=s.hints||{};if(c.labelBehavior!==!1){var u=s.connection,p=u.label,l;!p||!p.parent||(l=o(a),t.moveShape(p,l))}}),this.postExecute(["shape.replace"],function(a){var s=a.context,c=s.newShape,u=s.oldShape,p=j(c);p&&dn(p)&&u.label&&c.label&&(c.label.x=u.label.x,c.label.y=u.label.y)}),this.postExecute("shape.resize",function(a){var s=a.context,c=s.shape,u=s.newBounds,p=s.oldBounds;if(Kr(c)){var l=c.label,f=Y(l),d=cP(p),m=sP(f,d),y=aP(m,p,u);t.moveShape(l,y)}})}B(ms,N);ms.$inject=["eventBus","modeling","bpmnFactory","textRenderer"];function aP(e,t,n){var r=Bi(e,t,n);return Cn(Tt(r,e))}function sP(e,t){if(t.length){var n=uP(e,t);return Ga(e,n)}}function cP(e){return[[{x:e.x,y:e.y},{x:e.x+(e.width||0),y:e.y}],[{x:e.x+(e.width||0),y:e.y},{x:e.x+(e.width||0),y:e.y+(e.height||0)}],[{x:e.x,y:e.y+(e.height||0)},{x:e.x+(e.width||0),y:e.y+(e.height||0)}],[{x:e.x,y:e.y},{x:e.x,y:e.y+(e.height||0)}]]}function uP(e,t){var n=t.map(function(i){return{line:i,distance:ku(e,i)}}),r=Ct(n,"distance");return r[0].line}k();function cy(e,t,n,r){return op(e,t,n,r).point}function hs(e,t){N.call(this,e);function n(r,i){var o=r.context,a=o.connection,s=C({},o.hints),c=o.newWaypoints||a.waypoints,u=o.oldWaypoints;return typeof s.startChanged=="undefined"&&(s.startChanged=!!s.connectionStart),typeof s.endChanged=="undefined"&&(s.endChanged=!!s.connectionEnd),cy(i,c,u,s)}this.postExecute(["connection.layout","connection.updateWaypoints"],function(r){var i=r.context,o=i.connection,a=o.outgoing,s=o.incoming;s.forEach(function(c){var u=c.waypoints[c.waypoints.length-1],p=n(r,u),l=[].concat(c.waypoints.slice(0,-1),[p]);t.updateWaypoints(c,l)}),a.forEach(function(c){var u=c.waypoints[0],p=n(r,u),l=[].concat([p],c.waypoints.slice(1));t.updateWaypoints(c,l)})}),this.postExecute(["connection.move"],function(r){var i=r.context,o=i.connection,a=o.outgoing,s=o.incoming,c=i.delta;s.forEach(function(u){var p=u.waypoints[u.waypoints.length-1],l={x:p.x+c.x,y:p.y+c.y},f=[].concat(u.waypoints.slice(0,-1),[l]);t.updateWaypoints(u,f)}),a.forEach(function(u){var p=u.waypoints[0],l={x:p.x+c.x,y:p.y+c.y},f=[].concat([l],u.waypoints.slice(1));t.updateWaypoints(u,f)})})}B(hs,N);hs.$inject=["eventBus","modeling"];k();function ai(e,t,n){var r=ap(e),i=py(r,t),o=r[0];return i.length?i[i.length-1]:Bi(o.original||o,n,t)}function si(e,t,n){var r=ap(e),i=py(r,t),o=r[r.length-1];return i.length?i[0]:Bi(o.original||o,n,t)}function zo(e,t,n){var r=ap(e),i=uy(t,n),o=r[0];return Bi(o.original||o,i,t)}function Go(e,t,n){var r=ap(e),i=uy(t,n),o=r[r.length-1];return Bi(o.original||o,i,t)}function uy(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function ap(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function py(e,t){var n=Oe(e,lP);return J(n,function(r){return pP(r,t)})}function pP(e,t){return He(t,e,1)==="intersect"}function lP(e){return e.original||e}function vs(e,t){N.call(this,e),this.postExecute("shape.replace",function(n){var r=n.oldShape,i=n.newShape;if(fP(r,i)){var o=dP(r);o.incoming.forEach(function(a){var s=si(a,i,r);t.reconnectEnd(a,i,s)}),o.outgoing.forEach(function(a){var s=ai(a,i,r);t.reconnectStart(a,i,s)})}},!0)}vs.$inject=["eventBus","modeling"];B(vs,N);function fP(e,t){return h(e,"bpmn:Participant")&&oe(e)&&h(t,"bpmn:Participant")&&!oe(t)}function dP(e){var t=Yn([e],!1),n=[],r=[];return t.forEach(function(i){i!==e&&(i.incoming.forEach(function(o){h(o,"bpmn:MessageFlow")&&n.push(o)}),i.outgoing.forEach(function(o){h(o,"bpmn:MessageFlow")&&r.push(o)}))},[]),{incoming:n,outgoing:r}}var mP=["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:EscalationEventDefinition","bpmn:ConditionalEventDefinition","bpmn:SignalEventDefinition"];function sp(e){let t=j(e);if(!h(t,"bpmn:BoundaryEvent")&&!(h(t,"bpmn:StartEvent")&&Ye(t.$parent)))return!1;let n=t.get("eventDefinitions");return!n||!n.length?!1:mP.some(r=>h(n[0],r))}function cp(e){return h(e,"bpmn:BoundaryEvent")?"cancelActivity":"isInterrupting"}function gs(e,t){e.invoke(N,this),this.postExecuted("shape.replace",function(n){let r=n.context.oldShape,i=n.context.newShape,o=n.context.hints;if(!sp(i))return;let a=cp(i);if(o.targetElement&&o.targetElement[a]!==void 0)return;let c=j(r).get(a),u=j(i).get(a);c!==u&&t.updateProperties(i,{[a]:c})})}gs.$inject=["injector","modeling"];B(gs,N);function ys(e,t){N.call(this,e),this.preExecute("shape.resize",function(n){var r=n.shape,i=ce(r),o=i&&i.get("label"),a=o&&o.get("bounds");a&&t.updateModdleProperties(r,o,{bounds:void 0})},!0)}B(ys,N);ys.$inject=["eventBus","modeling"];function _s(e,t,n){N.call(this,e),this.preExecute("shape.delete",function(r){var i=r.context.shape;if(!(i.incoming.length!==1||i.outgoing.length!==1)){var o=i.incoming[0],a=i.outgoing[0];if(!(!h(o,"bpmn:SequenceFlow")||!h(a,"bpmn:SequenceFlow"))&&t.canConnect(o.source,a.target,o)){var s=hP(o.waypoints,a.waypoints);n.reconnectEnd(o,a.target,s)}}})}B(_s,N);_s.$inject=["eventBus","bpmnRules","modeling"];function Vo(e){return e.original||e}function hP(e,t){var n=$o(Vo(e[e.length-2]),Vo(e[e.length-1]),Vo(t[1]),Vo(t[0]));return n?[].concat(e.slice(0,e.length-1),[n],t.slice(1)):[Vo(e[0]),Vo(t[t.length-1])]}function bs(e,t){N.call(this,e),this.preExecute("shape.delete",function(n){var r=n.shape,i=r.parent;h(r,"bpmn:Participant")&&(n.collaborationRoot=i)},!0),this.postExecute("shape.delete",function(n){var r=n.collaborationRoot;if(r&&!r.businessObject.participants.length){var i=t.makeProcess(),o=r.children.slice();t.moveElements(o,{x:0,y:0},i)}},!0)}bs.$inject=["eventBus","modeling"];B(bs,N);k();function xs(e,t,n,r){N.call(this,e);var i=r.get("dragging",!1);function o(c){var u=c.source,p=c.target,l=c.parent;if(l){var f,d;h(c,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(u,p)||(d=!0),n.canConnectMessageFlow(u,p)&&(f="bpmn:MessageFlow")),h(c,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(u,p)||(d=!0),n.canConnectSequenceFlow(u,p)&&(f="bpmn:SequenceFlow")),d&&t.removeConnection(c),f&&t.connect(u,p,{type:f,waypoints:c.waypoints.slice()})}}function a(c){var u=c.context,p=u.connection,l=u.newSource||p.source,f=u.newTarget||p.target,d,m;d=n.canConnect(l,f),!(!d||d.type===p.type)&&(m=t.connect(l,f,{type:d.type,associationDirection:d.associationDirection,waypoints:p.waypoints.slice()}),p.parent&&t.removeConnection(p),u.connection=m,i&&s(p,m))}function s(c,u){var p=i.context(),l=p&&p.payload.previousSelection,f;!l||!l.length||(f=l.indexOf(c),f!==-1&&l.splice(f,1,u))}this.postExecuted("elements.move",function(c){var u=c.closure,p=u.allConnections;E(p,o)},!0),this.preExecute("connection.reconnect",a),this.postExecuted("element.updateProperties",function(c){var u=c.context,p=u.properties,l=u.element,f=l.businessObject,d;p.default&&(d=re(l.outgoing,Et({id:l.businessObject.default.id})),d&&t.updateProperties(d,{conditionExpression:void 0})),p.conditionExpression&&f.sourceRef.default===f&&t.updateProperties(l.source,{default:void 0})})}B(xs,N);xs.$inject=["eventBus","modeling","bpmnRules","injector"];k();function Wo(e,t,n,r,i,o){r.invoke(N,this),this._bpmnReplace=e,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,function(a){var s=a.context,c=s.parent,u=s.elements,p=Fe(u,function(l,f){var d=t.canReplace([f],f.host||f.parent||c);return d?l.concat(d.replacements):l},[]);p.length&&this._replaceElements(u,p)},this),this.postExecuted(["elements.move"],500,function(a){var s=a.context,c=s.newParent,u=s.newHost,p=[];E(s.closure.topLevel,function(f){Ye(f)?p=p.concat(f.children):p=p.concat(f)}),p.length===1&&u&&(c=u);var l=t.canReplace(p,c);l&&this._replaceElements(p,l.replacements,u)},this),this.postExecute(["shape.replace"],1500,function(a){var s=a.context,c=s.oldShape,u=s.newShape,p=c.attachers,l;p&&p.length&&(l=t.canReplace(p,u),this._replaceElements(p,l.replacements))},this),this.postExecuted(["shape.replace"],1500,function(a){var s=a.context,c=s.oldShape,u=s.newShape;i.unclaimId(c.businessObject.id,c.businessObject),i.updateProperties(u,{id:c.id})})}B(Wo,N);Wo.prototype._replaceElements=function(e,t){var n=this._elementRegistry,r=this._bpmnReplace,i=this._selection;E(t,function(o){var a={type:o.newElementType},s=n.get(o.oldElementId),c=e.indexOf(s);e[c]=r.replaceElement(s,a,{select:!1})}),t&&i.select(e)};Wo.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var vP=1500,ly={width:140,height:120},up={width:300,height:60},pp={width:60,height:300},Es={width:300,height:150},ws={width:150,height:300},Of={width:140,height:120},Bf={width:50,height:30};function lp(e){e.on("resize.start",vP,function(t){var n=t.context,r=n.shape,i=n.direction,o=n.balanced;(h(r,"bpmn:Lane")||h(r,"bpmn:Participant"))&&(n.resizeConstraints=xP(r,i,o)),h(r,"bpmn:SubProcess")&&oe(r)&&(n.minDimensions=Of),h(r,"bpmn:TextAnnotation")&&(n.minDimensions=Bf)})}lp.$inject=["eventBus"];var ci=Math.abs,gP=Math.min,yP=Math.max;function fy(e,t,n,r){var i=e[t];e[t]=i===void 0?n:r(n,i)}function Uo(e,t,n){return fy(e,t,n,gP)}function qo(e,t,n){return fy(e,t,n,yP)}var _P={top:20,left:50,right:20,bottom:20},bP={top:50,left:20,right:20,bottom:20};function xP(e,t,n){var r=Nt(e),i=!0,o=!0,a=jo(r,[r]),s=Z(e),c={},u={},p=Pe(e),l=p?up:pp;/n/.test(t)?u.top=s.bottom-l.height:/e/.test(t)?u.right=s.left+l.width:/s/.test(t)?u.bottom=s.top+l.height:/w/.test(t)&&(u.left=s.right-l.width),a.forEach(function(m){var y=Z(m);p?(y.tops.bottom+10&&(o=!1)):(y.lefts.right+10&&(o=!1)),/n/.test(t)&&(n&&ci(s.top-y.bottom)<10&&qo(c,"top",y.top+l.height),ci(s.top-y.top)<5&&Uo(u,"top",y.bottom-l.height)),/e/.test(t)&&(n&&ci(s.right-y.left)<10&&Uo(c,"right",y.right-l.width),ci(s.right-y.right)<5&&qo(u,"right",y.left+l.width)),/s/.test(t)&&(n&&ci(s.bottom-y.top)<10&&Uo(c,"bottom",y.bottom-l.height),ci(s.bottom-y.bottom)<5&&qo(u,"bottom",y.top+l.height)),/w/.test(t)&&(n&&ci(s.left-y.right)<10&&qo(c,"left",y.left+l.width),ci(s.left-y.left)<5&&Uo(u,"left",y.right-l.width))});var f=r.children.filter(function(m){return!m.hidden&&!m.waypoints&&(h(m,"bpmn:FlowElement")||h(m,"bpmn:Artifact"))}),d=p?_P:bP;return f.forEach(function(m){var y=Z(m);/n/.test(t)&&(!p||i)&&Uo(u,"top",y.top-d.top),/e/.test(t)&&(p||o)&&qo(u,"right",y.right+d.right),/s/.test(t)&&(!p||o)&&qo(u,"bottom",y.bottom+d.bottom),/w/.test(t)&&(p||i)&&Uo(u,"left",y.left-d.left)}),{min:u,max:c}}var dy=1001;function fp(e,t){e.on("resize.start",dy+500,function(n){var r=n.context,i=r.shape;(h(i,"bpmn:Lane")||h(i,"bpmn:Participant"))&&(r.balanced=!Rr(n))}),e.on("resize.end",dy,function(n){var r=n.context,i=r.shape,o=r.canExecute,a=r.newBounds;if(h(i,"bpmn:Lane")||h(i,"bpmn:Participant"))return o&&(a=bc(a),t.resizeLane(i,a,r.balanced)),!1})}fp.$inject=["eventBus","modeling"];k();var EP=500;function Ss(e,t,n,r,i){n.invoke(N,this);function o(p){return ee(p,["bpmn:ReceiveTask","bpmn:SendTask"])||wP(p,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(p){var l=e.getDefinitions(),f=l.get("rootElements");return!!re(f,Et({id:p.id}))}function s(p){if(h(p,"bpmn:ErrorEventDefinition"))return"errorRef";if(h(p,"bpmn:EscalationEventDefinition"))return"escalationRef";if(h(p,"bpmn:MessageEventDefinition"))return"messageRef";if(h(p,"bpmn:SignalEventDefinition"))return"signalRef"}function c(p){if(ee(p,["bpmn:ReceiveTask","bpmn:SendTask"]))return p.get("messageRef");var l=p.get("eventDefinitions"),f=l[0];return f.get(s(f))}function u(p,l){if(ee(p,["bpmn:ReceiveTask","bpmn:SendTask"]))return p.set("messageRef",l);var f=p.get("eventDefinitions"),d=f[0];return d.set(s(d),l)}this.executed(["shape.create","element.updateProperties","element.updateModdleProperties"],function(p){var l=p.shape||p.element;if(o(l)){var f=j(l),d=c(f),m;d&&!a(d)&&(m=e.getDefinitions().get("rootElements"),Ce(m,d),p.addedRootElement=d)}},!0),this.reverted(["shape.create","element.updateProperties","element.updateModdleProperties"],function(p){var l=p.addedRootElement;if(l){var f=e.getDefinitions().get("rootElements");De(f,l)}},!0),t.on("copyPaste.copyElement",function(p){var l=p.descriptor,f=p.element;if(!(f.labelTarget||!o(f))){var d=j(f),m=c(d);m&&(l.referencedRootElement=m)}}),t.on("copyPaste.pasteElement",EP,function(p){var l=p.descriptor,f=l.businessObject,d=l.referencedRootElement;d&&(a(d)||(d=r.copyElement(d,i.create(d.$type))),u(f,d),delete l.referencedRootElement)})}Ss.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"];B(Ss,N);function wP(e,t){return q(t)||(t=[t]),Bt(t,function(n){return br(e,n)})}k();var my=Math.max;function dp(e){e.on("spaceTool.getMinDimensions",function(t){var n=t.shapes,r=t.axis,i=t.start,o={};return E(n,function(a){var s=a.id;h(a,"bpmn:Participant")&&(o[s]=CP(a,r,i)),h(a,"bpmn:Lane")&&(o[s]=Pe(a)?up:pp),h(a,"bpmn:SubProcess")&&oe(a)&&(o[s]=Of),h(a,"bpmn:TextAnnotation")&&(o[s]=Bf),h(a,"bpmn:Group")&&(o[s]=ly)}),o})}dp.$inject=["eventBus"];function SP(e){return e==="x"}function CP(e,t,n){var r=Pe(e);if(!AP(e))return r?Es:ws;var i=SP(t),o={};return i?r?o=Es:o={width:PP(e,n,i),height:ws.height}:r?o={width:Es.width,height:RP(e,n,i)}:o=ws,o}function RP(e,t,n){var r;return r=TP(e,t,n),my(Es.height,r)}function PP(e,t,n){var r;return r=DP(e,t,n),my(ws.width,r)}function AP(e){return!!gn(e).length}function TP(e,t,n){var r=gn(e),i;return i=If(r,t,n),e.height-i.height+up.height}function DP(e,t,n){var r=gn(e),i;return i=If(r,t,n),e.width-i.width+pp.width}function If(e,t,n){var r,i,o;for(r=0;r=i.y&&t<=i.y+i.height||n&&t>=i.x&&t<=i.x+i.width)return o=gn(i),o.length?If(o,t,n):i}k();k();function Lf(e){let t=[];return E(e.incoming,n=>{h(n,"bpmn:Association")&&h(n.source,"bpmn:TextAnnotation")&&t.push({annotation:n.source,association:n})}),E(e.outgoing,n=>{h(n,"bpmn:Association")&&h(n.target,"bpmn:TextAnnotation")&&t.push({annotation:n.target,association:n})}),t}function Ii(e){let t=new Map;return E(Sa(e,!0,-1),n=>{E(Lf(n),r=>{t.has(r.annotation)||t.set(r.annotation,{annotation:r.annotation,associations:[]}),t.get(r.annotation).associations.push(r.association)})}),[...t.values()]}var hy=400,MP=600,vy={x:180,y:160};function zn(e,t,n,r,i,o,a){N.call(this,t),this._canvas=e,this._eventBus=t,this._modeling=n,this._elementFactory=r,this._bpmnFactory=i,this._bpmnjs=o,this._elementRegistry=a;var s=this;function c(l){return h(l,"bpmn:SubProcess")&&!oe(l)}function u(l){var f=l.shape,d=l.newRootElement,m=j(f);d=s._addDiagram(d||m),l.newRootElement=e.addRootElement(d)}function p(l){var f=l.shape,d=j(f);s._removeDiagram(d);var m=l.newRootElement=a.get(hn(d));e.removeRootElement(m)}this.executed("shape.create",function(l){var f=l.shape;c(f)&&u(l)},!0),this.postExecuted("elements.create",function(l){var f=l.elements;E(f,function(d){if(c(d)){var m=a.get(hn(d));if(!(!m||!d.children||!d.children.length)){var y=gy(d);s._showRecursively(y),s._moveChildrenToShape(y,m)}}})},!0),this.reverted("shape.create",function(l){var f=l.shape;c(f)&&p(l)},!0),this.preExecute("shape.delete",function(l){var f=l.shape;!h(f,"bpmn:SubProcess")||!oe(f)||E(Ii([f]),d=>{n.removeShape(d.annotation)})},!0),this.preExecuted("shape.delete",function(l){var f=l.shape;if(c(f)){var d=a.get(hn(f));d&&n.removeElements(d.children.slice())}},!0),this.executed("shape.delete",function(l){var f=l.shape;c(f)&&p(l)},!0),this.reverted("shape.delete",function(l){var f=l.shape;c(f)&&u(l)},!0),this.preExecuted("shape.replace",function(l){var f=l.oldShape,d=l.newShape;!c(f)||!c(d)||(l.oldRoot=e.removeRootElement(hn(f)))},!0),this.postExecuted("shape.replace",function(l){var f=l.newShape,d=l.oldRoot,m=e.findRoot(hn(f));if(!(!d||!m)){var y=d.children;n.moveElements(y,{x:0,y:0},m)}},!0),this.executed("element.updateProperties",function(l){var f=l.element;if(h(f,"bpmn:SubProcess")){var d=l.properties,m=l.oldProperties,y=m.id,v=d.id;if(y!==v){if(_o(f)){a.updateId(f,Zr(v)),a.updateId(y,v);return}var w=a.get(Zr(y));w&&a.updateId(Zr(y),Zr(v))}}},!0),this.reverted("element.updateProperties",function(l){var f=l.element;if(h(f,"bpmn:SubProcess")){var d=l.properties,m=l.oldProperties,y=m.id,v=d.id;if(y!==v){if(_o(f)){a.updateId(f,Zr(y)),a.updateId(v,y);return}var w=a.get(Zr(v));w&&a.updateId(w,Zr(y))}}},!0),t.on("element.changed",function(l){var f=l.element;if(_o(f)){var d=f,m=a.get(tf(d));!m||m===d||t.fire("element.changed",{element:m})}}),this.executed("shape.toggleCollapse",hy,function(l){var f=l.shape;h(f,"bpmn:SubProcess")&&(oe(f)?p(l):(u(l),s._showRecursively(f.children)))},!0),this.reverted("shape.toggleCollapse",hy,function(l){var f=l.shape;h(f,"bpmn:SubProcess")&&(oe(f)?p(l):(u(l),s._showRecursively(f.children)))},!0),this.postExecuted("shape.toggleCollapse",MP,function(l){var f=l.shape;if(h(f,"bpmn:SubProcess")){var d=l.newRootElement;if(d)if(oe(f))s._moveChildrenToShape(d.children.slice(),f),E(Ii(f.children),y=>{n.moveShape(y.annotation,{x:0,y:0},f.parent),E(y.associations,v=>{n.moveConnection(v,{x:0,y:0},f.parent)})});else{s._disconnectSharedAnnotations(f);var m=gy(f);s._moveChildrenToShape(m,d)}}},!0),t.on("copyPaste.createTree",function(l){var f=l.element,d=l.children;if(c(f)){var m=hn(f),y=a.get(m);y&&d.push.apply(d,y.children)}}),t.on("copyPaste.copyElement",function(l){var f=l.descriptor,d=l.element,m=l.elements,y=d.parent,v=h(ce(y),"bpmndi:BPMNPlane");if(v){var w=tf(y),R=re(m,function(x){return x.id===w});R&&(f.parent=R.id)}}),t.on("copyPaste.pasteElement",function(l){var f=l.descriptor;f.parent&&(c(f.parent)||f.parent.hidden)&&(f.hidden=!0)})}B(zn,N);zn.prototype._moveChildrenToShape=function(e,t){var n=this._modeling;if(e.length){var r=e.filter(function(c){return!c.hidden});if(!r.length){n.moveElements(e,{x:0,y:0},t,{autoResize:!1});return}var i=Se(r),o;if(!t.x)o={x:vy.x-i.x,y:vy.y-i.y};else{var a=Y(t),s=Y(i);o={x:a.x-s.x,y:a.y-s.y}}n.moveElements(e,o,t,{autoResize:!1})}};zn.prototype._disconnectSharedAnnotations=function(e){var t=this._modeling,n=new Set(Lf(e).map(r=>r.annotation));n.size&&E(Ii(e.children),r=>{n.has(r.annotation)&&E(r.associations,i=>{t.removeConnection(i)})})};zn.prototype._showRecursively=function(e,t){var n=this,r=[];return e.forEach(function(i){i.hidden=!!t,r=r.concat(i),i.children&&(r=r.concat(n._showRecursively(i.children,i.collapsed||t)))}),r};zn.prototype._addDiagram=function(e){var t=this._bpmnjs,n=t.getDefinitions().diagrams;return e.businessObject||(e=this._createNewDiagram(e)),n.push(e.di.$parent),e};zn.prototype._createNewDiagram=function(e){var t=this._bpmnFactory,n=this._elementFactory,r=t.create("bpmndi:BPMNPlane",{bpmnElement:e}),i=t.create("bpmndi:BPMNDiagram",{plane:r});r.$parent=i;var o=n.createRoot({id:hn(e),type:e.$type,di:r,businessObject:e,collapsed:!0});return o};zn.prototype._removeDiagram=function(e){var t=this._bpmnjs,n=t.getDefinitions().diagrams,r=re(n,function(i){return i.plane.bpmnElement.id===e.id});return n.splice(n.indexOf(r),1),r};zn.$inject=["canvas","eventBus","modeling","elementFactory","bpmnFactory","bpmnjs","elementRegistry"];function kP(e){var t=[];return E(Ii(e),n=>{t.push(n.annotation),t.push.apply(t,n.associations)}),t}function gy(e){return e.children.slice().concat(kP(e.children)).concat(NP(e))}function NP(e){return Sa(e.children||[],!0,-1).reduce(function(t,n){return n.label&&n.label.parent!==e&&t.push(n.label),t},[])}function Cs(e,t){e.invoke(N,this),this.postExecuted("shape.replace",function(n){var r=n.context.oldShape,i=n.context.newShape;if(!(!h(i,"bpmn:SubProcess")||h(i,"bpmn:AdHocSubProcess")||!(h(r,"bpmn:Task")||h(r,"bpmn:CallActivity"))||!oe(i))){var o=OP(i);t.createShape({type:"bpmn:StartEvent"},o,i)}})}Cs.$inject=["injector","modeling"];B(Cs,N);function OP(e){return{x:e.x+e.width/6,y:e.y+e.height/2}}function Rs(e){N.call(this,e),this.preExecute("connection.create",function(t){let{target:n}=t;h(n,"bpmn:TextAnnotation")&&(t.parent=n.parent)},!0),this.preExecute(["shape.create","shape.resize","elements.move"],function(t){let n=t.shapes||[t.shape];n.length===1&&h(n[0],"bpmn:TextAnnotation")&&(t.hints=t.hints||{},t.hints.autoResize=!1)},!0)}B(Rs,N);Rs.$inject=["eventBus"];k();function Ps(e,t){N.call(this,e),this.postExecuted("shape.toggleCollapse",1500,function(n){var r=n.shape;if(oe(r))return;var i=Yn(r);i.forEach(function(a){var s=a.incoming.slice(),c=a.outgoing.slice();E(s,function(u){o(u,!0)}),E(c,function(u){o(u,!1)})});function o(a,s){i.indexOf(a.source)!==-1&&i.indexOf(a.target)!==-1||h(a,"bpmn:Association")&&(h(a.source,"bpmn:TextAnnotation")||h(a.target,"bpmn:TextAnnotation"))||(s?t.reconnectEnd(a,r,Y(r)):t.reconnectStart(a,r,Y(r)))}},!0)}B(Ps,N);Ps.$inject=["eventBus","modeling"];var jf=500;function As(e,t,n){N.call(this,e);function r(a){a.length&&a.forEach(function(s){s.type==="label"&&!s.businessObject.name&&(s.hidden=!0)})}function i(a,s){var c=a.children,u=s,p,l;return p=BP(c).concat([a]),l=ep(p),l?(u.width=Math.max(l.width,u.width),u.height=Math.max(l.height,u.height),u.x=l.x+(l.width-u.width)/2,u.y=l.y+(l.height-u.height)/2):(u.x=a.x+(a.width-u.width)/2,u.y=a.y+(a.height-u.height)/2),u}function o(a,s){return{x:a.x+(a.width-s.width)/2,y:a.y+(a.height-s.height)/2,width:s.width,height:s.height}}this.executed(["shape.toggleCollapse"],jf,function(a){var s=a.context,c=s.shape;h(c,"bpmn:SubProcess")&&(c.collapsed?ce(c).isExpanded=!1:(r(c.children),ce(c).isExpanded=!0))}),this.reverted(["shape.toggleCollapse"],jf,function(a){var s=a.context,c=s.shape;c.collapsed?ce(c).isExpanded=!1:ce(c).isExpanded=!0}),this.postExecuted(["shape.toggleCollapse"],jf,function(a){var s=a.context.shape,c=t.getDefaultSize(s),u;s.collapsed?u=o(s,c):u=i(s,c),n.resizeShape(s,u,null,{autoResize:s.collapsed?!1:"nwse"})})}B(As,N);As.$inject=["eventBus","elementFactory","modeling"];function BP(e){return e.filter(function(t){return!t.hidden})}function Ts(e,t,n,r){t.invoke(N,this),this.preExecute("shape.delete",function(i){var o=i.context,a=o.shape,s=a.businessObject;ne(a)||(h(a,"bpmn:Participant")&&oe(a)&&n.ids.unclaim(s.processRef.id),r.unclaimId(s.id,s))}),this.preExecute("connection.delete",function(i){var o=i.context,a=o.connection,s=a.businessObject;r.unclaimId(s.id,s)}),this.preExecute("canvas.updateRoot",function(){var i=e.getRootElement(),o=i.businessObject;h(i,"bpmn:Collaboration")&&n.ids.unclaim(o.id)})}B(Ts,N);Ts.$inject=["canvas","injector","moddle","modeling"];function Ds(e,t){N.call(this,e),this.preExecute("connection.delete",function(n){var r=n.context,i=r.connection,o=i.source;IP(i,o)&&t.updateProperties(o,{default:null})})}B(Ds,N);Ds.$inject=["eventBus","modeling"];function IP(e,t){if(!h(e,"bpmn:SequenceFlow"))return!1;var n=j(t),r=j(e);return n.get("default")===r}var LP=500,jP=5e3;function Ms(e,t){N.call(this,e);var n;function r(){return n=n||new FP,n.enter(),n}function i(){if(!n)throw new Error("out of bounds release");return n}function o(){if(!n)throw new Error("out of bounds release");var s=n.leave();return s&&(t.updateLaneRefs(n.flowNodes,n.lanes),n=null),s}var a=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(a,jP,function(s){r()}),this.postExecuted(a,LP,function(s){o()}),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],function(s){var c=s.context,u=c.shape,p=i();u.labelTarget||(h(u,"bpmn:Lane")&&p.addLane(u),h(u,"bpmn:FlowNode")&&p.addFlowNode(u))})}Ms.$inject=["eventBus","modeling"];B(Ms,N);function FP(){this.flowNodes=[],this.lanes=[],this.counter=0,this.addLane=function(e){this.lanes.push(e)},this.addFlowNode=function(e){this.flowNodes.push(e)},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}function ks(e,t){N.call(this,e),this.postExecuted("elements.create",function(n){let r=n.context,i=r.elements;for(let o of i)HP(o)&&!zP(o)&&t.updateProperties(o,{isForCompensation:void 0})})}B(ks,N);ks.$inject=["eventBus","modeling"];function HP(e){let t=j(e);return t&&t.isForCompensation}function $P(e){return e&&h(e,"bpmn:BoundaryEvent")&&br(e,"bpmn:CompensateEventDefinition")}function zP(e){return e.incoming.filter(n=>$P(n.source)).length>0}var yy={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","associationBehavior","attachEventBehavior","boundaryEventBehavior","compensateBoundaryEventBehaviour","createBehavior","createDataObjectBehavior","createParticipantBehavior","dataInputAssociationBehavior","dataStoreBehavior","deleteLaneBehavior","detachEventBehavior","dropOnFlowBehavior","eventBasedGatewayBehavior","fixHoverBehavior","groupBehavior","importDockingFix","isHorizontalFix","labelBehavior","layoutConnectionBehavior","messageFlowBehavior","nonInterruptingBehavior","removeElementBehavior","removeEmbeddedLabelBoundsBehavior","removeParticipantBehavior","replaceConnectionBehavior","replaceElementBehaviour","resizeBehavior","resizeLaneBehavior","rootElementReferenceBehavior","spaceToolBehavior","subProcessPlaneBehavior","subProcessStartEventBehavior","textAnnotationBehavior","toggleCollapseConnectionBehaviour","toggleElementCollapseBehaviour","unclaimIdBehavior","updateFlowNodeRefsBehavior","unsetDefaultFlowBehavior","setCompensationActivityAfterPasteBehavior"],adaptiveLabelPositioningBehavior:["type",Xa],appendBehavior:["type",Za],associationBehavior:["type",Qa],attachEventBehavior:["type",Bo],boundaryEventBehavior:["type",Ja],compensateBoundaryEventBehaviour:["type",ts],createBehavior:["type",ns],createDataObjectBehavior:["type",rs],createParticipantBehavior:["type",is],dataInputAssociationBehavior:["type",os],dataStoreBehavior:["type",as],deleteLaneBehavior:["type",cs],detachEventBehavior:["type",Fo],dropOnFlowBehavior:["type",us],eventBasedGatewayBehavior:["type",ps],fixHoverBehavior:["type",np],groupBehavior:["type",ls],importDockingFix:["type",rp],isHorizontalFix:["type",fs],labelBehavior:["type",ms],layoutConnectionBehavior:["type",hs],messageFlowBehavior:["type",vs],nonInterruptingBehavior:["type",gs],removeElementBehavior:["type",_s],removeEmbeddedLabelBoundsBehavior:["type",ys],removeParticipantBehavior:["type",bs],replaceConnectionBehavior:["type",xs],replaceElementBehaviour:["type",Wo],resizeBehavior:["type",lp],resizeLaneBehavior:["type",fp],rootElementReferenceBehavior:["type",Ss],spaceToolBehavior:["type",dp],subProcessPlaneBehavior:["type",zn],subProcessStartEventBehavior:["type",Cs],textAnnotationBehavior:["type",Rs],toggleCollapseConnectionBehaviour:["type",Ps],toggleElementCollapseBehaviour:["type",As],unclaimIdBehavior:["type",Ts],unsetDefaultFlowBehavior:["type",Ds],updateFlowNodeRefsBehavior:["type",Ms],setCompensationActivityAfterPasteBehavior:["type",ks]};k();function mp(e,t){var n=He(e,t,-15);return n!=="intersect"?n:null}function _t(e){kt.call(this,e)}B(_t,kt);_t.$inject=["eventBus"];_t.prototype.init=function(){this.addRule("connection.start",function(e){var t=e.source;return GP(t)}),this.addRule("connection.create",function(e){var t=e.source,n=e.target,r=e.hints||{},i=r.targetParent,o=r.targetAttach;if(o)return!1;i&&(n.parent=i);try{return hp(t,n)}finally{i&&(n.parent=null)}}),this.addRule("connection.reconnect",function(e){var t=e.connection,n=e.source,r=e.target;return hp(n,r,t)}),this.addRule("connection.updateWaypoints",function(e){return{type:e.connection.type}}),this.addRule("shape.resize",function(e){var t=e.shape,n=e.newBounds;return ky(t,n)}),this.addRule("elements.create",function(e){var t=e.elements,n=e.position,r=e.target;return me(r)&&!vp(t,r,n)?!1:pn(t,function(i){return me(i)?hp(i.source,i.target,i):i.host?Ns(i,i.host,null,n):$f(i,r,null,n)})}),this.addRule("elements.move",function(e){var t=e.target,n=e.shapes,r=e.position,i=e.hints;return i!=null&&i.keyboardMove&&n.some(function(a){return Ry(a)&&!n.includes(a.host)})?!1:Ns(n,t,null,r)||Dy(n,t,r)||My(n,t,r)||vp(n,t,r)}),this.addRule("shape.create",function(e){return $f(e.shape,e.target,e.source,e.position)}),this.addRule("shape.attach",function(e){return Ns(e.shape,e.target,null,e.position)}),this.addRule("element.copy",function(e){var t=e.element,n=e.elements;return Ly(n,t)})};_t.prototype.canConnectMessageFlow=By;_t.prototype.canConnectSequenceFlow=Iy;_t.prototype.canConnectDataAssociation=Gf;_t.prototype.canConnectAssociation=Ny;_t.prototype.canConnectCompensationAssociation=Oy;_t.prototype.canMove=My;_t.prototype.canAttach=Ns;_t.prototype.canReplace=Dy;_t.prototype.canDrop=Ko;_t.prototype.canInsert=vp;_t.prototype.canCreate=$f;_t.prototype.canConnect=hp;_t.prototype.canResize=ky;_t.prototype.canCopy=Ly;function GP(e){return Ff(e)?null:ee(e,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}function Ff(e){return!e||ne(e)}function _y(e){do{if(h(e,"bpmn:Process"))return j(e);if(h(e,"bpmn:Participant"))return j(e).processRef||j(e)}while(e=e.parent)}function Hf(e){return h(e,"bpmn:TextAnnotation")}function zf(e){return h(e,"bpmn:Group")&&!e.labelTarget}function wy(e){return h(e,"bpmn:BoundaryEvent")&&sr(e,"bpmn:CompensateEventDefinition")}function gp(e){return j(e).isForCompensation}function VP(e,t){var n=_y(e),r=_y(t);return n===r}function WP(e){return h(e,"bpmn:InteractionNode")&&!h(e,"bpmn:BoundaryEvent")&&(!h(e,"bpmn:Event")||h(e,"bpmn:ThrowEvent")&&Cy(e,"bpmn:MessageEventDefinition"))}function UP(e){return h(e,"bpmn:InteractionNode")&&!gp(e)&&(!h(e,"bpmn:Event")||h(e,"bpmn:CatchEvent")&&Cy(e,"bpmn:MessageEventDefinition"))&&!(h(e,"bpmn:BoundaryEvent")&&!sr(e,"bpmn:MessageEventDefinition"))}function by(e){for(var t=e;t=t.parent;){if(h(t,"bpmn:FlowElementsContainer"))return j(t);if(h(t,"bpmn:Participant"))return j(t).processRef}return null}function Sy(e,t){var n=by(e),r=by(t);return n===r}function sr(e,t){var n=j(e);return!!re(n.eventDefinitions||[],function(r){return h(r,t)})}function Cy(e,t){var n=j(e);return(n.eventDefinitions||[]).every(function(r){return h(r,t)})}function qP(e){return h(e,"bpmn:FlowNode")&&!h(e,"bpmn:EndEvent")&&!Ye(e)&&!(h(e,"bpmn:IntermediateThrowEvent")&&sr(e,"bpmn:LinkEventDefinition"))&&!wy(e)&&!gp(e)}function KP(e){return h(e,"bpmn:FlowNode")&&!h(e,"bpmn:StartEvent")&&!h(e,"bpmn:BoundaryEvent")&&!Ye(e)&&!(h(e,"bpmn:IntermediateCatchEvent")&&sr(e,"bpmn:LinkEventDefinition"))&&!gp(e)}function YP(e){return h(e,"bpmn:ReceiveTask")||h(e,"bpmn:IntermediateCatchEvent")&&(sr(e,"bpmn:MessageEventDefinition")||sr(e,"bpmn:TimerEventDefinition")||sr(e,"bpmn:ConditionalEventDefinition")||sr(e,"bpmn:SignalEventDefinition"))}function XP(e){for(var t=[];e;)e=e.parent,e&&t.push(e);return t}function xy(e,t){var n=XP(t);return n.indexOf(e)!==-1}function hp(e,t,n){if(Ff(e)||Ff(t))return null;if(!h(n,"bpmn:DataAssociation")){if(By(e,t))return{type:"bpmn:MessageFlow"};if(Iy(e,t))return{type:"bpmn:SequenceFlow"}}var r=Gf(e,t);return r||(Oy(e,t)?{type:"bpmn:Association",associationDirection:"One"}:Ny(e,t)?{type:"bpmn:Association",associationDirection:"None"}:!1)}function Ko(e,t){return ne(e)||zf(e)?!0:h(t,"bpmn:Participant")&&!oe(t)?!1:h(e,"bpmn:Participant")?h(t,"bpmn:Process")||h(t,"bpmn:Collaboration"):ee(e,["bpmn:DataInput","bpmn:DataOutput"])&&e.parent?t===e.parent:h(e,"bpmn:Lane")?h(t,"bpmn:Participant")||h(t,"bpmn:Lane"):h(e,"bpmn:BoundaryEvent")&&!ZP(e)?!1:h(e,"bpmn:FlowElement")&&!h(e,"bpmn:DataStoreReference")?h(t,"bpmn:FlowElementsContainer")?oe(t):ee(t,["bpmn:Participant","bpmn:Lane"]):h(e,"bpmn:DataStoreReference")&&h(t,"bpmn:Collaboration")?Bt(j(t).get("participants"),function(n){return!!n.get("processRef")}):ee(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?ee(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):h(e,"bpmn:MessageFlow")?h(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t:!1}function ZP(e){return j(e).cancelActivity&&(Py(e)||Ay(e))}function Ry(e){return!ne(e)&&h(e,"bpmn:BoundaryEvent")}function QP(e){return h(e,"bpmn:Lane")}function JP(e){return Ry(e)||h(e,"bpmn:IntermediateThrowEvent")&&Py(e)?!0:h(e,"bpmn:IntermediateCatchEvent")&&Ay(e)}function Py(e){var t=j(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function Ay(e){return Ty(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function Ty(e,t){return t.some(function(n){return sr(e,n)})}function eA(e){return h(e,"bpmn:ReceiveTask")&&re(e.incoming,function(t){return h(t.source,"bpmn:EventBasedGateway")})}function Ns(e,t,n,r){if(Array.isArray(e)||(e=[e]),e.length!==1)return!1;var i=e[0];return ne(i)||!JP(i)||Ye(t)||!h(t,"bpmn:Activity")||gp(t)||r&&!mp(r,t)||eA(t)?!1:"attach"}function Dy(e,t,n){if(!t)return!1;var r={replacements:[]};return E(e,function(i){Ye(t)||h(i,"bpmn:StartEvent")&&i.type!=="label"&&Ko(i,t)&&(hh(i)||r.replacements.push({oldElementId:i.id,newElementType:"bpmn:StartEvent"}),(vh(i)||gh(i)||yh(i))&&r.replacements.push({oldElementId:i.id,newElementType:"bpmn:StartEvent"}),Ty(i,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&h(t,"bpmn:SubProcess")&&r.replacements.push({oldElementId:i.id,newElementType:"bpmn:StartEvent"})),h(t,"bpmn:Transaction")||sr(i,"bpmn:CancelEventDefinition")&&i.type!=="label"&&(h(i,"bpmn:EndEvent")&&Ko(i,t)&&r.replacements.push({oldElementId:i.id,newElementType:"bpmn:EndEvent"}),h(i,"bpmn:BoundaryEvent")&&Ns(i,t,null,n)&&r.replacements.push({oldElementId:i.id,newElementType:"bpmn:BoundaryEvent"}))}),r.replacements.length?r:!1}function My(e,t){return Bt(e,QP)?!1:t?e.every(function(n){return Ko(n,t)}):!0}function $f(e,t,n,r){return t?ne(e)||zf(e)?!0:Ko(e,t,r)||vp(e,t,r):!1}function ky(e,t){return h(e,"bpmn:SubProcess")?oe(e)&&(!t||t.width>=100&&t.height>=80):!!(h(e,"bpmn:Lane")||h(e,"bpmn:Participant")||Hf(e)||zf(e))}function tA(e,t){var n=Hf(e),r=Hf(t);return(n||r)&&n!==r}function Ny(e,t){return xy(t,e)||xy(e,t)?!1:tA(e,t)?!0:!!Gf(e,t)}function Oy(e,t){return Sy(e,t)&&wy(e)&&h(t,"bpmn:Activity")&&!rA(t,e)&&!Ye(t)}function By(e,t){return Ey(e)&&!Ey(t)?!1:WP(e)&&UP(t)&&!VP(e,t)}function Iy(e,t){return qP(e)&&KP(t)&&Sy(e,t)&&!(h(e,"bpmn:EventBasedGateway")&&!YP(t))}function Gf(e,t){return ee(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&ee(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:ee(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&ee(e,["bpmn:Activity","bpmn:CatchEvent"])?{type:"bpmn:DataOutputAssociation"}:!1}function vp(e,t,n){if(!t)return!1;if(Array.isArray(e)){if(e.length!==1)return!1;e=e[0]}return t.source===e||t.target===e?!1:ee(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!ne(t)&&h(e,"bpmn:FlowNode")&&!h(e,"bpmn:BoundaryEvent")&&Ko(e,t.parent,n)}function nA(e,t){return e&&t&&e.indexOf(t)!==-1}function Ly(e,t){return ne(t)?!0:!(h(t,"bpmn:Lane")&&!nA(e,t.parent))}function Ey(e){return Tr(e,"bpmn:Process")||Tr(e,"bpmn:Collaboration")}function rA(e,t){return e.attachers.includes(t)}var jy={__depends__:[yt],__init__:["bpmnRules"],bpmnRules:["type",_t]};k();var iA=2e3;function yp(e,t){e.on("saveXML.start",iA,n);function n(){var r=t.getRootElements();E(r,function(i){var o=ce(i),a,s;a=Yn([i],!1),a=J(a,function(c){return c!==i&&!c.labelTarget}),s=Oe(a,ce),o.set("planeElement",s)})}}yp.$inject=["eventBus","canvas"];var Fy={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",yp]};function Yo(e){N.call(this,e);var t=this;this.preExecute(["shape.create","connection.create"],function(n){var r=n.context,i=r.shape||r.connection,o=r.parent,a=t.getOrdering(i,o);a&&(a.parent!==void 0&&(r.parent=a.parent),r.parentIndex=a.index)}),this.preExecute(["shape.move","connection.move"],function(n){var r=n.context,i=r.shape||r.connection,o=r.newParent||i.parent,a=t.getOrdering(i,o);a&&(a.parent!==void 0&&(r.newParent=a.parent),r.newParentIndex=a.index)})}Yo.prototype.getOrdering=function(e,t){return null};B(Yo,N);k();function Os(e,t){Yo.call(this,e);var n=[{type:"bpmn:SubProcess",order:{level:6}},{type:"bpmn:SequenceFlow",order:{level:9,containers:["bpmn:Participant","bpmn:FlowElementsContainer"]}},{type:"bpmn:DataAssociation",order:{level:9,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:TextAnnotation",order:{level:9}},{type:"bpmn:MessageFlow",order:{level:9,containers:["bpmn:Collaboration"]}},{type:"bpmn:Association",order:{level:6,containers:["bpmn:Participant","bpmn:FlowElementsContainer","bpmn:Collaboration"]}},{type:"bpmn:BoundaryEvent",order:{level:8}},{type:"bpmn:Group",order:{level:10,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:FlowElement",order:{level:5}},{type:"bpmn:Participant",order:{level:-2}},{type:"bpmn:Lane",order:{level:-1}}];function r(a){if(a.labelTarget)return{level:10};var s=re(n,function(c){return ee(a,[c.type])});return s&&s.order||{level:1}}function i(a){var s=a.order;if(s||(a.order=s=r(a)),!s)throw new Error(`no order for <${a.id}>`);return s}function o(a,s,c){for(var u=s;u&&!ee(u,c);)u=u.parent;if(!u)throw new Error(`no parent for <${a.id}> in <${s&&s.id}>`);return u}this.getOrdering=function(a,s){if(a.labelTarget||h(a,"bpmn:TextAnnotation"))return{parent:t.findRoot(s)||t.getRootElement(),index:-1};var c=i(a);c.containers&&(s=o(a,s,c.containers));var u=s.children.indexOf(a),p=ba(s.children,function(l){return!a.labelTarget&&l.labelTarget?!1:c.level0&&this._modeling.removeElements(r),t};jt.prototype._getElementIdsFromTree=function(e){var t={};return E(e,function(n){E(n,function(r){r.id&&(t[r.id]=!0)})}),t};jt.prototype._paste=function(e,t,n,r){E(e,function(o){te(o.x)||(o.x=0),te(o.y)||(o.y=0)});var i=Se(e);return E(e,function(o){me(o)&&(o.waypoints=Oe(o.waypoints,function(a){return{x:a.x-i.x-i.width/2,y:a.y-i.y-i.height/2}})),C(o,{x:o.x-i.x-i.width/2,y:o.y-i.y-i.height/2})}),this._modeling.createElements(e,n,t,C({},r))};jt.prototype._createElements=function(e){var t=this,n=this._eventBus,r={},i=[];return E(e,function(o,a){a=parseInt(a,10),o=Ct(o,"priority"),E(o,function(s){var c=C({},Mt(s,["priority"]));r[s.parent]?c.parent=r[s.parent]:delete c.parent,n.fire("copyPaste.pasteElement",{cache:r,descriptor:c});var u;if(me(c)){c.source=r[s.source],c.target=r[s.target],u=r[s.id]=t.createConnection(c),i.push(u);return}if(ne(c)){c.labelTarget=r[c.labelTarget],u=r[s.id]=t.createLabel(c),i.push(u);return}c.host&&(c.host=r[c.host]),u=r[s.id]=t.createShape(c),i.push(u)})}),i};jt.prototype.createConnection=function(e){var t=this._elementFactory.createConnection(Mt(e,["id"]));return t};jt.prototype.createLabel=function(e){var t=this._elementFactory.createLabel(Mt(e,["id"]));return t};jt.prototype.createShape=function(e){var t=this._elementFactory.createShape(Mt(e,["id"]));return t};jt.prototype.hasRelations=function(e,t){var n,r,i;return!(me(e)&&(r=re(t,Et({id:e.source.id})),i=re(t,Et({id:e.target.id})),!r||!i)||ne(e)&&(n=re(t,Et({id:e.labelTarget.id})),!n))};jt.prototype.createTree=function(e){var t=this._rules,n=this,r={},i=[],o=Hr(e);function a(u,p){return t.allowed("element.copy",{element:u,elements:p})}function s(u,p){var l=re(i,function(f){return u===f.element});if(!l){i.push({element:u,depth:p});return}l.depth{p.push(l.annotation)})}),t.on("copyPaste.pasteElement",Wf,function(c){var u=c.cache,p=c.descriptor;a(u,s(p,u,o(u)))})}xp.$inject=["bpmnFactory","eventBus","moddleCopy"];k();var lA=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing","categoryValue"],fA=["errorRef","escalationRef","messageRef","signalRef","dataObjectRef"];function ji(e,t,n){this._bpmnFactory=t,this._eventBus=e,this._moddle=n,e.on("moddleCopy.canCopyProperties",r=>{let{propertyNames:i}=r;if(!(!i||!i.length))return Ct(i,o=>o==="extensionElements")}),e.on("moddleCopy.canCopyProperty",r=>{let{parent:i,property:o,propertyName:a}=r,s=Ee(i)&&i.$descriptor;if(a&&fA.includes(a))return o;if(a&&lA.includes(a)||a&&s&&!re(s.properties,Et({name:a})))return!1}),e.on("moddleCopy.canSetCopiedProperty",r=>{let{property:i}=r;if(h(i,"bpmn:ExtensionElements")&&(!i.values||!i.values.length))return!1})}ji.$inject=["eventBus","bpmnFactory","moddle"];ji.prototype.copyElement=function(e,t,n,r=!1){n&&!q(n)&&(n=[n]),n=n||Ep(e.$descriptor);let i=this._eventBus.fire("moddleCopy.canCopyProperties",{propertyNames:n,sourceElement:e,targetElement:t,clone:r});return i===!1||(q(i)&&(n=i),E(n,o=>{let a;ot(e,o)&&(a=e.get(o));let s=this.copyProperty(a,t,o,r);!Ge(s)||this._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent:t,property:s,propertyName:o})===!1||t.set(o,s)})),t};ji.prototype.copyProperty=function(e,t,n,r=!1){let i=this._eventBus.fire("moddleCopy.canCopyProperty",{parent:t,property:e,propertyName:n,clone:r});if(i===!1)return;if(i)return Ee(i)&&i.$type&&!i.$parent&&(i.$parent=t),i;let o=this._moddle.getPropertyDescriptor(t,n);if(!o.isReference)return o.isId?e&&this._copyId(e,t,r):q(e)?Fe(e,(a,s)=>{let c=this.copyProperty(s,t,n,r);return c?a.concat(c):a},[]):Ee(e)&&e.$type?this._moddle.getElementDescriptor(e).isGeneric?void 0:(i=this._bpmnFactory.create(e.$type),i.$parent=t,i=this.copyElement(e,i,null,r),i):e};ji.prototype._copyId=function(e,t,n=!1){if(n)return e;if(!this._moddle.ids.assigned(e))return this._moddle.ids.claim(e,t),e};function Ep(e,t){return Fe(e.properties,(n,r)=>t&&r.default?n:n.concat(r.name),[])}var wp={__depends__:[Zy],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",xp],moddleCopy:["type",ji]};k();var Qy=Math.round;function Is(e,t){this._modeling=e,this._eventBus=t}Is.$inject=["modeling","eventBus"];Is.prototype.replaceElement=function(e,t,n){if(e.waypoints)return null;var r=this._modeling,i=this._eventBus;i.fire("replace.start",{element:e,attrs:t,hints:n});var o=t.width||e.width,a=t.height||e.height,s=t.x||e.x,c=t.y||e.y,u=Qy(s+o/2),p=Qy(c+a/2),l=r.replaceShape(e,C({},t,{x:u,y:p,width:o,height:a}),n);return i.fire("replace.end",{element:e,newElement:l,hints:n}),l};function Sp(e,t){t.on("replace.end",500,function(n){let{newElement:r,hints:i={}}=n;i.select!==!1&&e.select(r)})}Sp.$inject=["selection","eventBus"];var Jy={__init__:["replace","replaceSelectionBehavior"],replaceSelectionBehavior:["type",Sp],replace:["type",Is]};k();function dA(e,t,n){q(n)||(n=[n]),E(n,function(r){wn(e[r])||(t[r]=e[r])})}var mA=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function hA(e,t){var n=e&&ot(e,"collapsed")?e.collapsed:!oe(e),r;return t&&(ot(t,"collapsed")||ot(t,"isExpanded"))?r=ot(t,"collapsed")?t.collapsed:!t.isExpanded:r=n,n!==r}function Rp(e,t,n,r,i,o){function a(s,c,u){u=u||{};var p=c.type,l=s.businessObject;if(Cp(l)&&(p==="bpmn:SubProcess"||p==="bpmn:AdHocSubProcess")&&hA(s,c))return r.toggleCollapse(s),s;var f=e.create(p),d={type:p,businessObject:f};d.di={},p==="bpmn:ExclusiveGateway"&&(d.di.isMarkerVisible=!0),dA(s.di,d.di,["fill","stroke","background-color","border-color","color"]);var m=Ep(l.$descriptor),y=Ep(f.$descriptor,!0),v=vA(m,y);C(f,lt(c,mA));var w=J(v,function(b){return b==="eventDefinitions"?e_(s,c.eventDefinitionType):b==="loopCharacteristics"?!Ye(f):ot(f,b)||b==="processRef"&&c.isExpanded===!1||b==="triggeredByEvent"?!1:b==="isForCompensation"?!Ye(f):!0});if(f=n.copyElement(l,f,w),c.eventDefinitionType&&(e_(f,c.eventDefinitionType)||(d.eventDefinitionType=c.eventDefinitionType,d.eventDefinitionAttrs=c.eventDefinitionAttrs)),h(l,"bpmn:Activity")){if(Cp(l))d.isExpanded=oe(s);else if(c&&ot(c,"isExpanded")){d.isExpanded=c.isExpanded;var R=t.getDefaultSize(f,{isExpanded:d.isExpanded});d.width=R.width,d.height=R.height,d.x=s.x-(d.width-s.width)/2,d.y=s.y-(d.height-s.height)/2}oe(s)&&!h(l,"bpmn:Task")&&d.isExpanded&&(d.width=s.width,d.height=s.height)}if(Cp(l)&&!Cp(f)&&(u.moveChildren=!1),h(l,"bpmn:Participant")){c.isExpanded===!0?f.processRef=e.create("bpmn:Process"):u.moveChildren=!1;var x=Pe(s);ce(s).isHorizontal||(ce(d).isHorizontal=x),d.width=x?s.width:t.getDefaultSize(d).width,d.height=x?t.getDefaultSize(d).height:s.height}return o.allowed("shape.resize",{shape:f})||(d.height=t.getDefaultSize(d).height,d.width=t.getDefaultSize(d).width),f.name=l.name,ee(l,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&ee(f,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&(f.default=l.default),c.host&&!h(l,"bpmn:BoundaryEvent")&&h(f,"bpmn:BoundaryEvent")&&(d.host=c.host),(d.type==="bpmn:DataStoreReference"||d.type==="bpmn:DataObjectReference")&&(d.x=s.x+(s.width-d.width)/2),i.replaceElement(s,d,{...u,targetElement:c})}this.replaceElement=a}Rp.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules"];function Cp(e){return h(e,"bpmn:SubProcess")}function e_(e,t){var n=j(e);return t&&n.get("eventDefinitions").some(function(r){return h(r,t)})}function vA(e,t){return e.filter(function(n){return t.includes(n)})}var Pp={__depends__:[wp,Jy,et],bpmnReplace:["type",Rp]};k();var gA=250;function Dr(e){this._eventBus=e,this._tools=[],this._active=null}Dr.$inject=["eventBus"];Dr.prototype.registerTool=function(e,t){var n=this._tools;if(!t)throw new Error(`A tool has to be registered with it's "events"`);n.push(e),this.bindEvents(e,t)};Dr.prototype.isActive=function(e){return e&&this._active===e};Dr.prototype.length=function(e){return this._tools.length};Dr.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))};Dr.prototype.bindEvents=function(e,t){var n=this._eventBus,r=[];n.on(t.tool+".init",function(i){var o=i.context;if(!o.reactivate&&this.isActive(e)){this.setActive(null);return}this.setActive(e)},this),E(t,function(i){r.push(i+".ended"),r.push(i+".canceled")}),n.on(r,gA,function(i){this._active&&(yA(i)||this.setActive(null))},this)};function yA(e){var t=e.originalEvent&&e.originalEvent.target;return t&&Nn(t,'.group[data-group="tools"]')}var pi={__depends__:[Dt],__init__:["toolManager"],toolManager:["type",Dr]};k();k();function t_(e,t){if(e==="x"){if(t>0)return"e";if(t<0)return"w"}if(e==="y"){if(t>0)return"s";if(t<0)return"n"}return null}function n_(e,t){var n=[];return E(e.concat(t),function(r){var i=r.incoming,o=r.outgoing;E(i.concat(o),function(a){var s=a.source,c=a.target;(Ls(e,s)||Ls(e,c)||Ls(t,s)||Ls(t,c))&&(Ls(n,a)||n.push(a))})}),n}function Ls(e,t){return e.indexOf(t)!==-1}function r_(e,t,n){var r=e.x,i=e.y,o=e.width,a=e.height,s=n.x,c=n.y;switch(t){case"n":return{x:r,y:i+c,width:o,height:a-c};case"s":return{x:r,y:i,width:o,height:a+c};case"w":return{x:r+s,y:i,width:o-s,height:a};case"e":return{x:r,y:i,width:o+s,height:a};default:throw new Error("unknown direction: "+t)}}var Uf=Math.abs,_A=Math.round,Mr={x:"width",y:"height"},a_="crosshair",li={n:"top",w:"left",s:"bottom",e:"right"},bA=1500,Ap={n:"s",w:"e",s:"n",e:"w"},Tp=20;function Kt(e,t,n,r,i,o,a){this._canvas=e,this._dragging=t,this._eventBus=n,this._modeling=r,this._rules=i,this._toolManager=o,this._mouse=a;var s=this;o.registerTool("space",{tool:"spaceTool.selection",dragging:"spaceTool"}),n.on("spaceTool.selection.end",function(c){n.once("spaceTool.selection.ended",function(){s.activateMakeSpace(c.originalEvent)})}),n.on("spaceTool.move",bA,function(c){var u=c.context,p=u.initialized;p||(p=u.initialized=s.init(c,u)),p&&o_(c)}),n.on("spaceTool.end",function(c){var u=c.context,p=u.axis,l=u.direction,f=u.movingShapes,d=u.resizingShapes,m=u.start;if(u.initialized){o_(c);var y={x:0,y:0};y[p]=_A(c["d"+p]),s.makeSpace(f,d,y,l,m),n.once("spaceTool.ended",function(v){s.activateSelection(v.originalEvent,!0,!0)})}})}Kt.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"];Kt.prototype.activateSelection=function(e,t,n){this._dragging.init(e,"spaceTool.selection",{autoActivate:t,cursor:a_,data:{context:{reactivate:n}},trapClick:!1})};Kt.prototype.activateMakeSpace=function(e){this._dragging.init(e,"spaceTool",{autoActivate:!0,cursor:a_,data:{context:{}}})};Kt.prototype.makeSpace=function(e,t,n,r,i){return this._modeling.createSpace(e,t,n,r,i)};Kt.prototype.init=function(e,t){var n=Uf(e.dx)>Uf(e.dy)?"x":"y",r=e["d"+n],i=e[n]-r;if(Uf(r)<5)return!1;r<0&&(r*=-1),Rr(e)&&(r*=-1);var o=t_(n,r),a=this._canvas.getRootElement();!Ri(e)&&e.hover&&(a=e.hover);var s=[...Yn(a,!0),...a.attachers||[]],c=this.calculateAdjustments(s,n,r,i),u=this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:c.resizingShapes,start:i}),p=xA(c,n,o,i,u);return C(t,c,{axis:n,direction:o,spaceToolConstraints:p,start:i}),Pi("resize-"+(n==="x"?"ew":"ns")),!0};Kt.prototype.calculateAdjustments=function(e,t,n,r){var i=this._rules,o=[],a=[],s=[],c=[];function u(f){o.includes(f)||o.push(f);var d=f.label;d&&!o.includes(d)&&o.push(d)}function p(f){a.includes(f)||a.push(f)}E(e,function(f){if(!(!f.parent||ne(f))){if(me(f)){c.push(f);return}var d=f[t],m=d+f[Mr[t]];if(EA(f)&&(n>0&&Y(f)[t]>r||n<0&&Y(f)[t]0&&d>r||n<0&&mr&&i.allowed("shape.resize",{shape:f})){p(f);return}}}),E(o,function(f){var d=f.attachers;d&&E(d,function(m){u(m)})});var l=o.concat(a);return E(s,function(f){var d=f.host;Fi(l,d)&&u(f)}),l=o.concat(a),E(c,function(f){var d=f.source,m=f.target,y=f.label;Fi(l,d)&&Fi(l,m)&&y&&u(y)}),{movingShapes:o,resizingShapes:a}};Kt.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)};Kt.prototype.isActive=function(){var e=this._dragging.context();return e?/^spaceTool/.test(e.prefix):!1};function i_(e){return{top:e.top-Tp,right:e.right+Tp,bottom:e.bottom+Tp,left:e.left-Tp}}function o_(e){var t=e.context,n=t.spaceToolConstraints;if(n){var r,i;te(n.left)&&(r=Math.max(e.x,n.left),e.dx=e.dx+r-e.x,e.x=r),te(n.right)&&(r=Math.min(e.x,n.right),e.dx=e.dx+r-e.x,e.x=r),te(n.top)&&(i=Math.max(e.y,n.top),e.dy=e.dy+i-e.y,e.y=i),te(n.bottom)&&(i=Math.min(e.y,n.bottom),e.dy=e.dy+i-e.y,e.y=i)}}function xA(e,t,n,r,i){var o=e.movingShapes,a=e.resizingShapes;if(a.length){var s={},c,u;return E(a,function(p){var l=p.attachers,f=p.children,d=Z(p),m=J(f,function(I){return!me(I)&&!ne(I)&&!Fi(o,I)&&!Fi(a,I)}),y=J(f,function(I){return!me(I)&&!ne(I)&&Fi(o,I)}),v,w,R,x=[],b=[],S,A,O,D;m.length&&(w=i_(Z(Se(m))),v=r-d[li[n]]+w[li[n]],n==="n"?s.bottom=u=te(u)?Math.min(u,v):v:n==="w"?s.right=u=te(u)?Math.min(u,v):v:n==="s"?s.top=c=te(c)?Math.max(c,v):v:n==="e"&&(s.left=c=te(c)?Math.max(c,v):v)),y.length&&(R=i_(Z(Se(y))),v=r-R[li[Ap[n]]]+d[li[Ap[n]]],n==="n"?s.bottom=u=te(u)?Math.min(u,v):v:n==="w"?s.right=u=te(u)?Math.min(u,v):v:n==="s"?s.top=c=te(c)?Math.max(c,v):v:n==="e"&&(s.left=c=te(c)?Math.max(c,v):v)),l&&l.length&&(l.forEach(function(I){Fi(o,I)?x.push(I):b.push(I)}),x.length&&(S=Z(Se(x.map(Y))),A=d[li[Ap[n]]]-(S[li[Ap[n]]]-r)),b.length&&(O=Z(Se(b.map(Y))),D=O[li[n]]-(d[li[n]]-r)),n==="n"?(v=Math.min(A||1/0,D||1/0),s.bottom=u=te(u)?Math.min(u,v):v):n==="w"?(v=Math.min(A||1/0,D||1/0),s.right=u=te(u)?Math.min(u,v):v):n==="s"?(v=Math.max(A||-1/0,D||-1/0),s.top=c=te(c)?Math.max(c,v):v):n==="e"&&(v=Math.max(A||-1/0,D||-1/0),s.left=c=te(c)?Math.max(c,v):v));var L=i&&i[p.id];L&&(n==="n"?(v=r+p[Mr[t]]-L[Mr[t]],s.bottom=u=te(u)?Math.min(u,v):v):n==="w"?(v=r+p[Mr[t]]-L[Mr[t]],s.right=u=te(u)?Math.min(u,v):v):n==="s"?(v=r-p[Mr[t]]+L[Mr[t]],s.top=c=te(c)?Math.max(c,v):v):n==="e"&&(v=r-p[Mr[t]]+L[Mr[t]],s.left=c=te(c)?Math.max(c,v):v))}),s}}function Fi(e,t){return e.indexOf(t)!==-1}function EA(e){return!!e.host}k();var qf="djs-dragging",s_="djs-resizing",wA=250,Dp=Math.max;function Mp(e,t,n,r,i){function o(a,s){E(a,function(c){i.addDragger(c,s),n.addMarker(c,qf)})}e.on("spaceTool.selection.start",function(a){var s=n.getLayer("space"),c=a.context,u={x:"M 0,-10000 L 0,10000",y:"M -10000,0 L 10000,0"},p=U("g");z(p,r.cls("djs-crosshair-group",["no-events"])),Q(s,p);var l=U("path");z(l,"d",u.x),fe(l).add("djs-crosshair"),Q(p,l);var f=U("path");z(f,"d",u.y),fe(f).add("djs-crosshair"),Q(p,f),c.crosshairGroup=p}),e.on("spaceTool.selection.move",function(a){var s=a.context.crosshairGroup;Be(s,a.x,a.y)}),e.on("spaceTool.selection.cleanup",function(a){var s=a.context,c=s.crosshairGroup;c&&we(c)}),e.on("spaceTool.move",wA,function(a){var s=a.context,c=s.line,u=s.axis,p=s.movingShapes,l=s.resizingShapes;if(s.initialized){if(!s.dragGroup){var f=n.getLayer("space");c=U("path"),z(c,"d","M0,0 L0,0"),fe(c).add("djs-crosshair"),Q(f,c),s.line=c;var d=U("g");z(d,r.cls("djs-drag-group",["no-events"])),Q(n.getActiveLayer(),d),o(p,d);var m=s.movingConnections=t.filter(function(b){var S=!1;E(p,function(L){E(L.outgoing,function(I){b===I&&(S=!0)})});var A=!1;E(p,function(L){E(L.incoming,function(I){b===I&&(A=!0)})});var O=!1;E(l,function(L){E(L.outgoing,function(I){b===I&&(O=!0)})});var D=!1;return E(l,function(L){E(L.incoming,function(I){b===I&&(D=!0)})}),me(b)&&(S||O)&&(A||D)});o(m,d),s.dragGroup=d}if(!s.frameGroup){var y=U("g");z(y,r.cls("djs-frame-group",["no-events"])),Q(n.getActiveLayer(),y);var v=[];E(l,function(b){var S=i.addFrame(b,y),A=S.getBBox();v.push({element:S,initialBounds:A}),n.addMarker(b,s_)}),s.frameGroup=y,s.frames=v}var w={x:"M"+a.x+", -10000 L"+a.x+", 10000",y:"M -10000, "+a.y+" L 10000, "+a.y};z(c,{d:w[u]});var R={x:"y",y:"x"},x={x:a.dx,y:a.dy};x[R[s.axis]]=0,Be(s.dragGroup,x.x,x.y),E(s.frames,function(b){var S=b.element,A=b.initialBounds,O,D;s.direction==="e"?z(S,{width:Dp(A.width+x.x,5)}):(O=Dp(A.width-x.x,5),z(S,{width:O,x:A.x+A.width-O})),s.direction==="s"?z(S,{height:Dp(A.height+x.y,5)}):(D=Dp(A.height-x.y,5),z(S,{height:D,y:A.y+A.height-D}))})}}),e.on("spaceTool.cleanup",function(a){var s=a.context,c=s.movingShapes,u=s.movingConnections,p=s.resizingShapes,l=s.line,f=s.dragGroup,d=s.frameGroup;E(c,function(m){n.removeMarker(m,qf)}),E(u,function(m){n.removeMarker(m,qf)}),f&&(we(l),we(f)),E(p,function(m){n.removeMarker(m,s_)}),d&&we(d)})}Mp.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];var c_={__init__:["spaceToolPreview"],__depends__:[Dt,yt,pi,Tn,cr],spaceTool:["type",Kt],spaceToolPreview:["type",Mp]};k();function Xo(e,t){e.invoke(Kt,this),this._canvas=t}Xo.$inject=["injector","canvas"];B(Xo,Kt);Xo.prototype.calculateAdjustments=function(e,t,n,r){var i=this._canvas.getRootElement(),o=e[0]===i?null:e[0],a=[];o&&(a=vr(hc(i.children.filter(u=>h(u,"bpmn:Artifact")),Se(o))));let s=[...e,...a];var c=Kt.prototype.calculateAdjustments.call(this,s,t,n,r);return c.resizingShapes=c.resizingShapes.filter(function(u){return!(h(u,"bpmn:TextAnnotation")||SA(u)&&(t==="y"&&Pe(u)||t==="x"&&!Pe(u)))}),c};function SA(e){return h(e,"bpmn:Participant")&&!j(e).processRef}var kp={__depends__:[c_],spaceTool:["type",Xo]};k();function ze(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],function(){this.clear(!1)},this)}ze.$inject=["eventBus","injector"];ze.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";let n={command:e,context:t};this._pushAction(n),this._internalExecute(n),this._popAction()};ze.prototype.canExecute=function(e,t){let n={command:e,context:t},r=this._getHandler(e),i=this._fire(e,"canExecute",n);if(i===void 0){if(!r)return!1;r.canExecute&&(i=r.canExecute(t))}return i};ze.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,e!==!1&&this._fire("changed",{trigger:"clear"})};ze.prototype.undo=function(){let e=this._getUndoAction(),t;if(e){for(this._currentExecution.trigger="undo",this._pushAction(e);e&&(this._internalUndo(e),t=this._getUndoAction(),!(!t||t.id!==e.id));)e=t;this._popAction()}};ze.prototype.redo=function(){let e=this._getRedoAction(),t;if(e){for(this._currentExecution.trigger="redo",this._pushAction(e);e&&(this._internalExecute(e,!0),t=this._getRedoAction(),!(!t||t.id!==e.id));)e=t;this._popAction()}};ze.prototype.register=function(e,t){this._setHandler(e,t)};ze.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");let n=this._injector.instantiate(t);this.register(e,n)};ze.prototype.canUndo=function(){return!!this._getUndoAction()};ze.prototype.canRedo=function(){return!!this._getRedoAction()};ze.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]};ze.prototype._getUndoAction=function(){return this._stack[this._stackIdx]};ze.prototype._internalUndo=function(e){let t=e.command,n=e.context,r=this._getHandler(t);this._atomicDo(()=>{this._fire(t,"revert",e),r.revert&&this._markDirty(r.revert(n)),this._revertedAction(e),this._fire(t,"reverted",e)})};ze.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);let r=t?[e+"."+t,t]:[e],i;n=this._eventBus.createEvent(n);for(let o of r)if(i=this._eventBus.fire("commandStack."+o,n),n.cancelBubble)break;return i};ze.prototype._createId=function(){return this._uid++};ze.prototype._atomicDo=function(e){let t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}};ze.prototype._internalExecute=function(e,t){let n=e.command,r=e.context,i=this._getHandler(n);if(!i)throw new Error("no command handler registered for <"+n+">");this._pushAction(e),t||(this._fire(n,"preExecute",e),i.preExecute&&i.preExecute(r),this._fire(n,"preExecuted",e)),this._atomicDo(()=>{this._fire(n,"execute",e),i.execute&&this._markDirty(i.execute(r)),this._executedAction(e,t),this._fire(n,"executed",e)}),t||(this._fire(n,"postExecute",e),i.postExecute&&i.postExecute(r),this._fire(n,"postExecuted",e)),this._popAction()};ze.prototype._pushAction=function(e){let t=this._currentExecution,n=t.actions,r=n[0];if(t.atomic)throw new Error("illegal invocation in or phase (action: "+e.command+")");e.id||(e.id=r&&r.id||this._createId()),n.push(e)};ze.prototype._popAction=function(){let e=this._currentExecution,t=e.trigger,n=e.actions,r=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:uc("id",r.reverse())}),r.length=0,this._fire("changed",{trigger:t}),e.trigger=null)};ze.prototype._markDirty=function(e){let t=this._currentExecution;e&&(e=q(e)?e:[e],t.dirty=t.dirty.concat(e))};ze.prototype._executedAction=function(e,t){let n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)};ze.prototype._revertedAction=function(e){this._stackIdx--};ze.prototype._getHandler=function(e){return this._handlerMap[e]};ze.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};var u_={commandStack:["type",ze]};k();function Dn(e,t){if(typeof t!="function")throw new Error("removeFn iterator must be a function");if(e){for(var n;n=e[0];)t(n);return e}}var CA=250,p_=1400;function js(e,t,n){N.call(this,t);var r=e.get("movePreview",!1);t.on("shape.move.start",p_,function(i){var o=i.context,a=o.shapes,s=o.validatedShapes;o.shapes=l_(a),o.validatedShapes=l_(s)}),r&&t.on("shape.move.start",CA,function(i){var o=i.context,a=o.shapes,s=[];E(a,function(c){E(c.labels,function(u){!u.hidden&&o.shapes.indexOf(u)===-1&&s.push(u),c.labelTarget&&s.push(c)})}),E(s,function(c){r.makeDraggable(o,c,!0)})}),this.preExecuted("elements.move",p_,function(i){var o=i.context,a=o.closure,s=a.enclosedElements,c=[];E(s,function(u){E(u.labels,function(p){s[p.id]||c.push(p)})}),a.addAll(c)}),this.preExecute(["connection.delete","shape.delete"],function(i){var o=i.context,a=o.connection||o.shape;Dn(a.labels,function(s){n.removeShape(s,{nested:!0})})}),this.execute("shape.delete",function(i){var o=i.context,a=o.shape,s=a.labelTarget;s&&(o.labelTargetIndex=io(s.labels,a),o.labelTarget=s,a.labelTarget=null)}),this.revert("shape.delete",function(i){var o=i.context,a=o.shape,s=o.labelTarget,c=o.labelTargetIndex;s&&(Ce(s.labels,a,c),a.labelTarget=s)})}B(js,N);js.$inject=["injector","eventBus","modeling"];function l_(e){return J(e,function(t){return e.indexOf(t.labelTarget)===-1})}var f_={__init__:["labelSupport"],labelSupport:["type",js]};k();var RA=251,d_=1401,m_="attach-ok";function Fs(e,t,n,r,i){N.call(this,t);var o=e.get("movePreview",!1);t.on("shape.move.start",d_,function(a){var s=a.context,c=s.shapes,u=s.validatedShapes;s.shapes=PA(c),s.validatedShapes=AA(u)}),o&&t.on("shape.move.start",RA,function(a){var s=a.context,c=s.shapes,u=Kf(c);E(u,function(p){o.makeDraggable(s,p,!0),E(p.labels,function(l){o.makeDraggable(s,l,!0)})})}),o&&t.on("shape.move.start",function(a){var s=a.context,c=s.shapes;if(c.length===1){var u=c[0],p=u.host;p&&(n.addMarker(p,m_),t.once(["shape.move.out","shape.move.cleanup"],function(){n.removeMarker(p,m_)}))}}),this.preExecuted("elements.move",d_,function(a){var s=a.context,c=s.closure,u=s.shapes,p=Kf(u);E(p,function(l){c.add(l,c.topLevel[l.host.id])})}),this.postExecuted("elements.move",function(a){var s=a.context,c=s.shapes,u=s.newHost,p;u&&c.length!==1||(u?p=c:p=J(c,function(l){var f=l.host;return TA(l)&&!DA(c,f)}),E(p,function(l){i.updateAttachment(l,u)}))}),this.postExecuted("elements.move",function(a){var s=a.context.shapes;E(s,function(c){E(c.attachers,function(u){E(u.outgoing.slice(),function(p){var l=r.allowed("connection.reconnect",{connection:p,source:p.source,target:p.target});l||i.removeConnection(p)}),E(u.incoming.slice(),function(p){var l=r.allowed("connection.reconnect",{connection:p,source:p.source,target:p.target});l||i.removeConnection(p)})})})}),this.postExecute("shape.create",function(a){var s=a.context,c=s.shape,u=s.host;u&&i.updateAttachment(c,u)}),this.postExecute("shape.replace",function(a){var s=a.context,c=s.oldShape,u=s.newShape;Dn(c.attachers,function(p){var l=r.allowed("elements.move",{target:u,shapes:[p]});l==="attach"?i.updateAttachment(p,u):i.removeShape(p)}),u.attachers.length&&E(u.attachers,function(p){var l=Nf(p,c,u);i.moveShape(p,l,p.parent)})}),this.postExecute("shape.resize",function(a){var s=a.context,c=s.shape,u=s.oldBounds,p=s.newBounds,l=c.attachers,f=s.hints||{};f.attachSupport!==!1&&E(l,function(d){var m=Nf(d,u,p);i.moveShape(d,m,d.parent),E(d.labels,function(y){i.moveShape(y,m,y.parent)})})}),this.preExecute("shape.delete",function(a){var s=a.context.shape;Dn(s.attachers,function(c){i.removeShape(c)}),s.host&&i.updateAttachment(s,null)})}B(Fs,N);Fs.$inject=["injector","eventBus","canvas","rules","modeling"];function Kf(e){return gi(Oe(e,function(t){return t.attachers||[]}))}function PA(e){var t=Kf(e);return vl("id",e,t)}function AA(e){var t=zt(e,"id");return J(e,function(n){for(;n;){if(n.host&&t[n.host.id])return!1;n=n.parent}return!0})}function TA(e){return!!e.host}function DA(e,t){return e.indexOf(t)!==-1}var h_={__depends__:[yt],__init__:["attachSupport"],attachSupport:["type",Fs]};k();function on(e){this._model=e}on.$inject=["moddle"];on.prototype._needsId=function(e){return ee(e,["bpmn:RootElement","bpmn:FlowElement","bpmn:MessageFlow","bpmn:DataAssociation","bpmn:Artifact","bpmn:Participant","bpmn:Lane","bpmn:LaneSet","bpmn:Process","bpmn:Collaboration","bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane","bpmn:Property","bpmn:CategoryValue"])};on.prototype._ensureId=function(e){if(e.id){this._model.ids.claim(e.id,e);return}var t;h(e,"bpmn:Activity")?t="Activity":h(e,"bpmn:Event")?t="Event":h(e,"bpmn:Gateway")?t="Gateway":ee(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])?t="Flow":t=(e.$type||"").replace(/^[^:]*:/g,""),t+="_",!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e))};on.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n};on.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})};on.prototype.createDiShape=function(e,t){return this.create("bpmndi:BPMNShape",C({bpmnElement:e,bounds:this.createDiBounds()},t))};on.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)};on.prototype.createDiWaypoints=function(e){var t=this;return Oe(e,function(n){return t.createDiWaypoint(n)})};on.prototype.createDiWaypoint=function(e){return this.create("dc:Point",lt(e,["x","y"]))};on.prototype.createDiEdge=function(e,t){return this.create("bpmndi:BPMNEdge",C({bpmnElement:e,waypoint:this.createDiWaypoints([])},t))};on.prototype.createDiPlane=function(e,t){return this.create("bpmndi:BPMNPlane",C({bpmnElement:e},t))};k();function Ft(e,t,n){N.call(this,e),this._bpmnFactory=t;var r=this;function i(d){var m=d.context,y=m.hints||{},v;!m.cropped&&y.createElementsBehavior!==!1&&(v=m.connection,v.waypoints=n.getCroppedWaypoints(v),m.cropped=!0)}this.executed(["connection.layout","connection.create"],i),this.reverted(["connection.layout"],function(d){delete d.context.cropped});function o(d){var m=d.context;r.updateParent(m.shape||m.connection,m.oldParent)}function a(d){var m=d.context,y=m.shape||m.connection,v=m.parent||m.newParent;r.updateParent(y,v)}this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],an(o)),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],an(a));function s(d){var m=d.context,y=m.oldRoot,v=y.children;E(v,function(w){h(w,"bpmn:BaseElement")&&r.updateParent(w)})}this.executed(["canvas.updateRoot"],s),this.reverted(["canvas.updateRoot"],s);function c(d){var m=d.context.shape;h(m,"bpmn:BaseElement")&&r.updateBounds(m)}this.executed(["shape.move","shape.create","shape.resize"],an(function(d){d.context.shape.type!=="label"&&c(d)})),this.reverted(["shape.move","shape.create","shape.resize"],an(function(d){d.context.shape.type!=="label"&&c(d)})),e.on("shape.changed",function(d){d.element.type==="label"&&c({context:{shape:d.element}})});function u(d){r.updateConnection(d.context)}this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],an(u)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],an(u));function p(d){r.updateConnectionWaypoints(d.context.connection)}this.executed(["connection.layout","connection.move","connection.updateWaypoints"],an(p)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],an(p)),this.executed("connection.reconnect",an(function(d){var m=d.context,y=m.connection,v=m.oldSource,w=m.newSource,R=j(y),x=j(v),b=j(w);R.conditionExpression&&!ee(b,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(m.oldConditionExpression=R.conditionExpression,delete R.conditionExpression),v!==w&&x.default===R&&(m.oldDefault=x.default,delete x.default)})),this.reverted("connection.reconnect",an(function(d){var m=d.context,y=m.connection,v=m.oldSource,w=m.newSource,R=j(y),x=j(v),b=j(w);m.oldConditionExpression&&(R.conditionExpression=m.oldConditionExpression),m.oldDefault&&(x.default=m.oldDefault,delete b.default)}));function l(d){r.updateAttachment(d.context)}this.executed(["element.updateAttachment"],an(l)),this.reverted(["element.updateAttachment"],an(l)),this.executed("element.updateLabel",an(f)),this.reverted("element.updateLabel",an(f));function f(d){let{element:m}=d.context,y=Pt(m),v=ce(m),w=v&&v.get("label");dn(m)||_o(m)||(y&&!w?v.set("label",t.create("bpmndi:BPMNLabel")):!y&&w&&v.set("label",void 0))}}B(Ft,N);Ft.$inject=["eventBus","bpmnFactory","connectionDocking"];Ft.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,r=t.host;n.attachedToRef=r&&r.businessObject};Ft.prototype.updateParent=function(e,t){if(!ne(e)&&!(h(e,"bpmn:DataStoreReference")&&e.parent&&h(e.parent,"bpmn:Collaboration"))){var n=e.parent,r=e.businessObject,i=ce(e),o=n&&n.businessObject,a=ce(n);h(e,"bpmn:FlowNode")&&this.updateFlowNodeRefs(r,o,t&&t.businessObject),h(e,"bpmn:DataOutputAssociation")&&(e.source?o=e.source.businessObject:o=null),h(e,"bpmn:DataInputAssociation")&&(e.target?o=e.target.businessObject:o=null),this.updateSemanticParent(r,o),h(e,"bpmn:DataObjectReference")&&r.dataObjectRef&&this.updateSemanticParent(r.dataObjectRef,o),this.updateDiParent(i,a)}};Ft.prototype.updateBounds=function(e){var t=ce(e),n=kA(e);if(n){var r=Tt(n,t.get("bounds"));C(n,{x:e.x+r.x,y:e.y+r.y})}var i=ne(e)?this._getLabel(t):t,o=i.bounds;o||(o=this._bpmnFactory.createDiBounds(),i.set("bounds",o)),C(o,{x:e.x,y:e.y,width:e.width,height:e.height})};Ft.prototype.updateFlowNodeRefs=function(e,t,n){if(n!==t){var r,i;h(n,"bpmn:Lane")&&(r=n.get("flowNodeRef"),De(r,e)),h(t,"bpmn:Lane")&&(i=t.get("flowNodeRef"),Ce(i,e))}};Ft.prototype.updateDiConnection=function(e,t,n){var r=ce(e),i=ce(t),o=ce(n);r.sourceElement&&r.sourceElement.bpmnElement!==j(t)&&(r.sourceElement=t&&i),r.targetElement&&r.targetElement.bpmnElement!==j(n)&&(r.targetElement=n&&o)};Ft.prototype.updateDiParent=function(e,t){if(t&&!h(t,"bpmndi:BPMNPlane")&&(t=t.$parent),e.$parent!==t){var n=(t||e.$parent).get("planeElement");t?(n.push(e),e.$parent=t):(De(n,e),e.$parent=null)}};function MA(e){for(;e&&!h(e,"bpmn:Definitions");)e=e.$parent;return e}Ft.prototype.getLaneSet=function(e){var t,n;return h(e,"bpmn:Lane")?(t=e.childLaneSet,t||(t=this._bpmnFactory.create("bpmn:LaneSet"),e.childLaneSet=t,t.$parent=e),t):(h(e,"bpmn:Participant")&&(e=e.processRef),n=e.get("laneSets"),t=n[0],t||(t=this._bpmnFactory.create("bpmn:LaneSet"),t.$parent=e,n.push(t)),t)};Ft.prototype.updateSemanticParent=function(e,t,n){var r;if(e.$parent!==t&&!((h(e,"bpmn:DataInput")||h(e,"bpmn:DataOutput"))&&(h(t,"bpmn:Participant")&&"processRef"in t&&(t=t.processRef),"ioSpecification"in t&&t.ioSpecification===e.$parent))){if(h(e,"bpmn:Lane"))t&&(t=this.getLaneSet(t)),r="lanes";else if(h(e,"bpmn:FlowElement")){if(t){if(h(t,"bpmn:Participant"))t=t.processRef;else if(h(t,"bpmn:Lane"))do t=t.$parent.$parent;while(h(t,"bpmn:Lane"))}r="flowElements"}else if(h(e,"bpmn:Artifact")){for(;t&&!h(t,"bpmn:Process")&&!h(t,"bpmn:SubProcess")&&!h(t,"bpmn:Collaboration");)if(h(t,"bpmn:Participant")){t=t.processRef;break}else t=t.$parent;r="artifacts"}else if(h(e,"bpmn:MessageFlow"))r="messageFlows";else if(h(e,"bpmn:Participant")){r="participants";var i=e.processRef,o;i&&(o=MA(e.$parent||t),e.$parent&&(De(o.get("rootElements"),i),i.$parent=null),t&&(Ce(o.get("rootElements"),i),i.$parent=o))}else h(e,"bpmn:DataOutputAssociation")?r="dataOutputAssociations":h(e,"bpmn:DataInputAssociation")&&(r="dataInputAssociations");if(!r)throw new Error(`no parent for <${e.id}> in <${t.id}>`);var a;if(e.$parent&&(a=e.$parent.get(r),De(a,e)),t?(a=t.get(r),a.push(e),e.$parent=t):e.$parent=null,n){var s=n.get(r);De(a,e),t&&(s||(s=[],t.set(r,s)),s.push(e))}}};Ft.prototype.updateConnectionWaypoints=function(e){var t=ce(e);t.set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))};Ft.prototype.updateConnection=function(e){var t=e.connection,n=j(t),r=t.source,i=j(r),o=t.target,a=j(t.target),s;if(h(n,"bpmn:DataAssociation"))h(n,"bpmn:DataInputAssociation")?(n.get("sourceRef")[0]=i,s=e.parent||e.newParent||a,this.updateSemanticParent(n,a,s)):h(n,"bpmn:DataOutputAssociation")&&(s=e.parent||e.newParent||i,this.updateSemanticParent(n,i,s),n.targetRef=a);else{var c=h(n,"bpmn:SequenceFlow");n.sourceRef!==i&&(c&&(De(n.sourceRef&&n.sourceRef.get("outgoing"),n),i&&i.get("outgoing")&&i.get("outgoing").push(n)),n.sourceRef=i),n.targetRef!==a&&(c&&(De(n.targetRef&&n.targetRef.get("incoming"),n),a&&a.get("incoming")&&a.get("incoming").push(n)),n.targetRef=a)}this.updateConnectionWaypoints(t),this.updateDiConnection(t,r,o)};Ft.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label};function an(e){return function(t){var n=t.context,r=n.shape||n.connection||n.element;h(r,"bpmn:BaseElement")&&e(t)}}function kA(e){if(h(e,"bpmn:Activity")){var t=ce(e);if(t){var n=t.get("label");if(n)return n.get("bounds")}}}k();function ur(e,t){Rn.call(this),this._bpmnFactory=e,this._moddle=t}B(ur,Rn);ur.$inject=["bpmnFactory","moddle"];ur.prototype._baseCreate=Rn.prototype.create;ur.prototype.create=function(e,t){if(e==="label"){var n=t.di||this._bpmnFactory.createDiLabel();return this._baseCreate(e,C({type:"label",di:n},fo,t))}return this.createElement(e,t)};ur.prototype.createElement=function(e,t){t=C({},t||{});var n,r=t.businessObject,i=t.di;if(!r){if(!t.type)throw new Error("no shape type specified");r=this._bpmnFactory.create(t.type),Dc(r)}if(!OA(i)){var o=C({},i||{},{id:r.id+"_di"});e==="root"?i=this._bpmnFactory.createDiPlane(r,o):e==="connection"?i=this._bpmnFactory.createDiEdge(r,o):i=this._bpmnFactory.createDiShape(r,o)}h(r,"bpmn:Group")&&(t=C({isFrame:!0},t)),t=NA(r,t,["processRef","isInterrupting","associationDirection","isForCompensation"]),t.isExpanded&&(t=Yf(i,t,"isExpanded")),ee(r,["bpmn:Lane","bpmn:Participant"])&&(t=Yf(i,t,"isHorizontal")),h(r,"bpmn:SubProcess")&&(t.collapsed=!oe(r,i)),h(r,"bpmn:ExclusiveGateway")&&(ot(i,"isMarkerVisible")?i.isMarkerVisible===void 0&&(i.isMarkerVisible=!1):i.isMarkerVisible=!0),Ge(t.triggeredByEvent)&&(r.triggeredByEvent=t.triggeredByEvent,delete t.triggeredByEvent),Ge(t.cancelActivity)&&(r.cancelActivity=t.cancelActivity,delete t.cancelActivity);var a,s;return t.eventDefinitionType&&(a=r.get("eventDefinitions")||[],s=this._bpmnFactory.create(t.eventDefinitionType,t.eventDefinitionAttrs),t.eventDefinitionType==="bpmn:ConditionalEventDefinition"&&(s.condition=this._bpmnFactory.create("bpmn:FormalExpression")),a.push(s),s.$parent=r,r.eventDefinitions=a,delete t.eventDefinitionType),n=this.getDefaultSize(r,i),t=C({id:r.id},n,t,{businessObject:r,di:i}),this._baseCreate(e,t)};ur.prototype.getDefaultSize=function(e,t){var n=j(e);if(t=t||ce(e),h(n,"bpmn:SubProcess"))return oe(n,t)?{width:350,height:200}:{width:100,height:80};if(h(n,"bpmn:Task"))return{width:100,height:80};if(h(n,"bpmn:Gateway"))return{width:50,height:50};if(h(n,"bpmn:Event"))return{width:36,height:36};if(h(n,"bpmn:Participant")){var r=t.isHorizontal===void 0||t.isHorizontal===!0;return oe(n,t)?r?{width:600,height:250}:{width:250,height:600}:r?{width:400,height:60}:{width:60,height:400}}return h(n,"bpmn:Lane")?{width:400,height:100}:h(n,"bpmn:DataObjectReference")?{width:36,height:50}:h(n,"bpmn:DataStoreReference")?{width:50,height:50}:h(n,"bpmn:TextAnnotation")?{width:100,height:30}:h(n,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}};ur.prototype.createParticipantShape=function(e){return Ee(e)||(e={isExpanded:e}),e=C({type:"bpmn:Participant"},e||{}),e.isExpanded!==!1&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)};function NA(e,t,n){return E(n,function(r){t=Yf(e,t,r)}),t}function Yf(e,t,n){return t[n]===void 0?t:(e[n]=t[n],Mt(t,[n]))}function OA(e){return ee(e,["bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane"])}k();k();function Zo(e,t){this._modeling=e,this._canvas=t}Zo.$inject=["modeling","canvas"];Zo.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,r=e.alignment;E(n,function(i){var o={x:0,y:0};Ge(r.left)?o.x=r.left-i.x:Ge(r.right)?o.x=r.right-i.width-i.x:Ge(r.center)?o.x=r.center-Math.round(i.width/2)-i.x:Ge(r.top)?o.y=r.top-i.y:Ge(r.bottom)?o.y=r.bottom-i.height-i.y:Ge(r.middle)&&(o.y=r.middle-Math.round(i.height/2)-i.y),t.moveElements([i],o,i.parent)})};Zo.prototype.postExecute=function(e){};k();function Qo(e){this._modeling=e}Qo.$inject=["modeling"];Qo.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var n=e.target||t.parent,r=e.shape,i=e.hints||{};r=e.shape=this._modeling.createShape(r,e.position,n,{attach:i.attach}),e.shape=r};Qo.prototype.postExecute=function(e){var t=e.hints||{};BA(e.source,e.shape)||(t.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))};function BA(e,t){return Bt(e.outgoing,function(n){return n.target===t})}function Jo(e,t){this._canvas=e,this._layouter=t}Jo.$inject=["canvas","layouter"];Jo.prototype.execute=function(e){var t=e.connection,n=e.source,r=e.target,i=e.parent,o=e.parentIndex,a=e.hints;if(!n||!r)throw new Error("source and target required");if(!i)throw new Error("parent required");return t.source=n,t.target=r,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,a)),this._canvas.addConnection(t,i,o),t};Jo.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};k();var Np=Math.round;function Hs(e){this._modeling=e}Hs.$inject=["modeling"];Hs.prototype.preExecute=function(e){var t=e.elements,n=e.parent,r=e.parentIndex,i=e.position,o=e.hints,a=this._modeling;E(t,function(l){te(l.x)||(l.x=0),te(l.y)||(l.y=0)});var s=J(t,function(l){return!l.hidden}),c=Se(s);E(t,function(l){me(l)&&(l.waypoints=Oe(l.waypoints,function(f){return{x:Np(f.x-c.x-c.width/2+i.x),y:Np(f.y-c.y-c.height/2+i.y)}})),C(l,{x:Np(l.x-c.x-c.width/2+i.x),y:Np(l.y-c.y-c.height/2+i.y)})});var u=Hr(t),p={};E(t,function(l){if(me(l)){p[l.id]=te(r)?a.createConnection(p[l.source.id],p[l.target.id],r,l,l.parent||n,o):a.createConnection(p[l.source.id],p[l.target.id],l,l.parent||n,o);return}var f=C({},o);u.indexOf(l)===-1&&(f.autoResize=!1),ne(l)&&(f=Mt(f,["attach"])),p[l.id]=te(r)?a.createShape(l,lt(l,["x","y","width","height"]),l.parent||n,r,f):a.createShape(l,lt(l,["x","y","width","height"]),l.parent||n,f)}),e.elements=vr(p)};k();var v_=Math.round;function Gn(e){this._canvas=e}Gn.$inject=["canvas"];Gn.prototype.execute=function(e){var t=e.shape,n=e.position,r=e.parent,i=e.parentIndex;if(!r)throw new Error("parent required");if(!n)throw new Error("position required");return n.width!==void 0?C(t,n):C(t,{x:n.x-v_(t.width/2),y:n.y-v_(t.height/2)}),this._canvas.addShape(t,r,i),t};Gn.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t};function Hi(e){Gn.call(this,e)}B(Hi,Gn);Hi.$inject=["canvas"];var IA=Gn.prototype.execute;Hi.prototype.execute=function(e){var t=e.shape;return jA(t),t.labelTarget=e.labelTarget,IA.call(this,e)};var LA=Gn.prototype.revert;Hi.prototype.revert=function(e){return e.shape.labelTarget=null,LA.call(this,e)};function jA(e){["width","height"].forEach(function(t){typeof e[t]=="undefined"&&(e[t]=0)})}function $i(e,t){this._canvas=e,this._modeling=t}$i.$inject=["canvas","modeling"];$i.prototype.preExecute=function(e){var t=this._modeling,n=e.connection;Dn(n.incoming,function(r){t.removeConnection(r,{nested:!0})}),Dn(n.outgoing,function(r){t.removeConnection(r,{nested:!0})})};$i.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=io(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t};$i.prototype.revert=function(e){var t=e.connection,n=e.parent,r=e.parentIndex;return t.source=e.source,t.target=e.target,Ce(n.children,t,r),this._canvas.addConnection(t,n),t};k();function $s(e,t){this._modeling=e,this._elementRegistry=t}$s.$inject=["modeling","elementRegistry"];$s.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry,r=e.elements;E(r,function(i){n.get(i.id)&&(i.waypoints?t.removeConnection(i):t.removeShape(i))})};function zi(e,t){this._canvas=e,this._modeling=t}zi.$inject=["canvas","modeling"];zi.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;Dn(n.incoming,function(r){t.removeConnection(r,{nested:!0})}),Dn(n.outgoing,function(r){t.removeConnection(r,{nested:!0})}),Dn(n.children,function(r){me(r)?t.removeConnection(r,{nested:!0}):t.removeShape(r,{nested:!0})})};zi.prototype.execute=function(e){var t=this._canvas,n=e.shape,r=n.parent;return e.oldParent=r,e.oldParentIndex=io(r.children,n),t.removeShape(n),n};zi.prototype.revert=function(e){var t=this._canvas,n=e.shape,r=e.oldParent,i=e.oldParentIndex;return Ce(r.children,n,i),t.addShape(n,r),n};k();function ea(e){this._modeling=e}ea.$inject=["modeling"];var g_={x:"y",y:"x"};ea.prototype.preExecute=function(e){var t=this._modeling,n=e.groups,r=e.axis,i=e.dimension;function o(v,w){v.range.min=Math.min(w[r],v.range.min),v.range.max=Math.max(w[r]+w[i],v.range.max)}function a(v){return v[r]+v[i]/2}function s(v){return v.length-1}function c(v){return v.max-v.min}function u(v,w){var R={y:0};R[r]=v-a(w),R[r]&&(R[g_[r]]=0,t.moveElements([w],R,w.parent))}var p=n[0],l=s(n),f=n[l],d,m,y=0;E(n,function(v,w){var R,x,b;if(v.elements.length<2){w&&w!==n.length-1&&(o(v,v.elements[0]),y+=c(v.range));return}R=Ct(v.elements,r),x=R[0],w===l&&(x=R[s(R)]),b=a(x),v.range=null,E(R,function(S){if(u(b,S),v.range===null){v.range={min:S[r],max:S[r]+S[i]};return}o(v,S)}),w&&w!==n.length-1&&(y+=c(v.range))}),m=Math.abs(f.range.min-p.range.max),d=Math.round((m-y)/(n.length-1)),!(dt;if(/n|w/.test(n))return e[r] required");var i=e.changed||this._getVisualReferences(n).concat(t),o=e.oldProperties||$A(n,yi(r));return P_(n,r),e.oldProperties=o,e.changed=i,i};Wi.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,r=e.changed;return P_(n,t),r};Wi.prototype._getVisualReferences=function(e){var t=this._elementRegistry;return h(e,"bpmn:DataObject")?zA(e,t):[]};function $A(e,t){return Fe(t,function(n,r){return n[r]=e.get(r),n},{})}function P_(e,t){E(t,function(n,r){e.set(r,n)})}function zA(e,t){return t.filter(function(n){return h(n,"bpmn:DataObjectReference")&&j(n).dataObjectRef===e})}k();var Ws="default",Nr="id",A_="di",GA={width:0,height:0};function Ui(e,t,n,r){this._elementRegistry=e,this._moddle=t,this._modeling=n,this._textRenderer=r}Ui.$inject=["elementRegistry","moddle","modeling","textRenderer"];Ui.prototype.execute=function(e){var t=e.element,n=[t];if(!t)throw new Error("element required");var r=this._elementRegistry,i=this._moddle.ids,o=t.businessObject,a=KA(e.properties),s=e.oldProperties||VA(t,a);return T_(a,o)&&(i.unclaim(o[Nr]),r.updateId(t,a[Nr]),i.claim(a[Nr],o)),Ws in a&&(a[Ws]&&n.push(r.get(a[Ws].id)),o[Ws]&&n.push(r.get(o[Ws].id))),D_(t,a),e.oldProperties=s,e.changed=n,n};Ui.prototype.postExecute=function(e){var t=e.element,n=t.label,r=n&&j(n).name;if(r){var i=this._textRenderer.getExternalLabelBounds(n,r);this._modeling.resizeShape(n,i,GA)}};Ui.prototype.revert=function(e){var t=e.element,n=e.properties,r=e.oldProperties,i=t.businessObject,o=this._elementRegistry,a=this._moddle.ids;return D_(t,r),T_(n,i)&&(a.unclaim(n[Nr]),o.updateId(t,r[Nr]),a.claim(r[Nr],i)),e.changed};function T_(e,t){return Nr in e&&e[Nr]!==t[Nr]}function VA(e,t){var n=yi(t),r=e.businessObject,i=ce(e);return Fe(n,function(o,a){return a!==A_?o[a]=r.get(a):o[a]=WA(i,yi(t.di)),o},{})}function WA(e,t){return Fe(t,function(n,r){return n[r]=e&&e.get(r),n},{})}function D_(e,t){var n=e.businessObject,r=ce(e);E(t,function(i,o){o!==A_?n.set(o,i):r&&UA(r,i)})}function UA(e,t){E(t,function(n,r){e.set(r,n)})}var qA=["default"];function KA(e){var t=C({},e);return qA.forEach(function(n){n in e&&(t[n]=j(t[n]))}),t}function oa(e,t){this._canvas=e,this._modeling=t}oa.$inject=["canvas","modeling"];oa.prototype.execute=function(e){var t=this._canvas,n=e.newRoot,r=n.businessObject,i=t.getRootElement(),o=i.businessObject,a=o.$parent,s=ce(i);return t.setRootElement(n),t.removeRootElement(i),Ce(a.rootElements,r),r.$parent=a,De(a.rootElements,o),o.$parent=null,i.di=null,s.bpmnElement=r,n.di=s,e.oldRoot=i,[]};oa.prototype.revert=function(e){var t=this._canvas,n=e.newRoot,r=n.businessObject,i=e.oldRoot,o=i.businessObject,a=r.$parent,s=ce(n);return t.setRootElement(i),t.removeRootElement(n),De(a.rootElements,r),r.$parent=null,Ce(a.rootElements,o),o.$parent=a,n.di=null,s.bpmnElement=o,i.di=s,[]};k();function Us(e,t){this._modeling=e,this._spaceTool=t}Us.$inject=["modeling","spaceTool"];Us.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,r=e.shape,i=e.location,o=Nt(r),a=o===r,s=a?r:r.parent,c=gn(s),u=Pe(r);if(u?i==="left"?i="top":i==="right"&&(i="bottom"):i==="top"?i="left":i==="bottom"&&(i="right"),!c.length){var p=u?{x:r.x+rn,y:r.y,width:r.width-rn,height:r.height}:{x:r.x,y:r.y+rn,width:r.width,height:r.height-rn};n.createShape({type:"bpmn:Lane",isHorizontal:u},p,s)}var l=[];On(o,function(b){return l.push(b),b.label&&l.push(b.label),b===r?[]:J(b.children,function(S){return S!==r})});var f,d,m,y,v;i==="top"?(f=-120,d=r.y,m=d+10,y="n",v="y"):i==="left"?(f=-120,d=r.x,m=d+10,y="w",v="x"):i==="bottom"?(f=120,d=r.y+r.height,m=d-10,y="s",v="y"):i==="right"&&(f=120,d=r.x+r.width,m=d-10,y="e",v="x");var w=t.calculateAdjustments(l,v,f,m),R=u?{x:0,y:f}:{x:f,y:0};t.makeSpace(w.movingShapes,w.resizingShapes,R,y,m);var x=u?{x:r.x+(a?rn:0),y:d-(i==="top"?120:0),width:r.width-(a?rn:0),height:120}:{x:d-(i==="left"?120:0),y:r.y+(a?rn:0),width:120,height:r.height-(a?rn:0)};e.newLane=n.createShape({type:"bpmn:Lane",isHorizontal:u},x,s)};function qs(e){this._modeling=e}qs.$inject=["modeling"];qs.prototype.preExecute=function(e){var t=this._modeling,n=e.shape,r=e.count,i=gn(n),o=i.length;if(o>r)throw new Error(`more than <${r}> child lanes`);var a=Pe(n),s=a?n.height:n.width,c=Math.round(s/r),u,p,l,f;for(f=0;f0||o.bottom<0?-u:u,d=n.calculateAdjustments(s,"y",f,p),n.makeSpace(d.movingShapes,d.resizingShapes,{x:0,y:u},l)),(o.left||o.right)&&(u=o.right||o.left,p=e.x+(o.right?e.width:0)+(o.right?-10:100),l=o.right?"e":"w",f=o.left>0||o.right<0?-u:u,d=n.calculateAdjustments(c,"x",f,p),n.makeSpace(d.movingShapes,d.resizingShapes,{x:u,y:0},l))};var Ks="flowNodeRef",Xf="lanes";function Ki(e){this._elementRegistry=e}Ki.$inject=["elementRegistry"];Ki.prototype._computeUpdates=function(e,t){var n=[],r=[],i={},o=[];function a(p,l){var f=Z(l),d={x:p.x+p.width/2,y:p.y+p.height/2};return d.x>f.left&&d.xf.top&&d.y: must be specified as : with start/end in { h,v,t,r,b,l }");if(j_(n)){var r=rT(e,t,n),i=iT(e,t,n),o=oT(r,i);return[].concat(r.waypoints,o.waypoints,i.waypoints)}return aT(e,t,n)}function sT(e,t,n){var r=Zf(e,t,n);return r.unshift(e),r.push(t),Jf(r)}function cT(e,t,n,r,i){var o=i&&i.preferredLayouts||[],a=ml(o,"straight")[0]||"h:h",s=eT[a]||0,c=He(e,t,s),u=dT(c,a);n=n||Y(e),r=r||Y(t);var p=u.split(":"),l=B_(n,e,p[0],hT(c)),f=B_(r,t,p[1],c);return sT(l,f,u)}function L_(e,t,n,r,i,o){q(n)&&(i=n,o=r,n=Y(e),r=Y(t)),o=C({preferredLayouts:[]},o),i=i||[];var a=o.preferredLayouts,s=a.indexOf("straight")!==-1,c;return c=s&&pT(e,t,n,r,o),c||(c=o.connectionEnd&&fT(t,e,r,i),c)||(c=o.connectionStart&&lT(e,t,n,i),c)?c:!o.connectionStart&&!o.connectionEnd&&i&&i.length?i:cT(e,t,n,r,o)}function uT(e,t,n){return e>=t&&e<=n}function O_(e,t,n){var r={x:"width",y:"height"};return uT(t[e],n[e],n[e]+n[r[e]])}function pT(e,t,n,r,i){var o={},a,s;return s=He(e,t),/^(top|bottom|left|right)$/.test(s)?(/top|bottom/.test(s)&&(a="x"),/left|right/.test(s)&&(a="y"),i.preserveDocking==="target"?O_(a,r,e)?(o[a]=r[a],[{x:o.x!==void 0?o.x:n.x,y:o.y!==void 0?o.y:n.y,original:{x:o.x!==void 0?o.x:n.x,y:o.y!==void 0?o.y:n.y}},{x:r.x,y:r.y}]):null:O_(a,n,t)?(o[a]=n[a],[{x:n.x,y:n.y},{x:o.x!==void 0?o.x:r.x,y:o.y!==void 0?o.y:r.y,original:{x:o.x!==void 0?o.x:r.x,y:o.y!==void 0?o.y:r.y}}]):null):null}function lT(e,t,n,r){return Qf(e,t,n,r)}function fT(e,t,n,r){var i=r.slice().reverse();return i=Qf(e,t,n,i),i?i.reverse():null}function Qf(e,t,n,r){function i(p){return p.length<3?!0:p.length>4?!1:!!re(p,function(l,f){var d=p[f-1];return d&&$r(l,d)<3})}function o(p,l,f){var d=Jt(l,p);switch(d){case"v":return{x:f.x,y:p.y};case"h":return{x:p.x,y:f.y}}return{x:p.x,y:p.y}}function a(p,l,f){var d;for(d=p.length-2;d!==0;d--)if(kl(p[d],l,k_)||kl(p[d],f,k_))return p.slice(d);return p}if(i(r))return null;var s=r[0],c=r.slice(),u;return c[0]=n,c[1]=o(c[1],s,n),u=a(c,e,t),u!==c&&(c=Qf(e,t,n,u)),c&&Jt(c)?null:c}function dT(e,t){if(j_(t))return t;switch(e){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return t}}function mT(e){return e&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(e)}function j_(e){return e&&/t|r|b|l/.test(e)}function hT(e){return{top:"bottom",bottom:"top",left:"right",right:"left","top-left":"bottom-right","bottom-right":"top-left","top-right":"bottom-left","bottom-left":"top-right"}[e]}function B_(e,t,n,r){if(n==="h"&&(n=/left/.test(r)?"l":"r"),n==="v"&&(n=/top/.test(r)?"t":"b"),n==="t")return{original:e,x:e.x,y:t.y};if(n==="r")return{original:e,x:t.x+t.width,y:e.y};if(n==="b")return{original:e,x:e.x,y:t.y+t.height};if(n==="l")return{original:e,x:t.x,y:e.y};throw new Error("unexpected dockingDirection: <"+n+">")}function Jf(e){return e.reduce(function(t,n,r){var i=t[t.length-1],o=e[r+1];return oo(i,o,n,0)||t.push(n),t},[])}var vT=-10,gT=40,yT={default:["h:h"],fromGateway:["v:h"],toGateway:["h:v"],loop:{fromTop:["t:r"],fromRight:["r:b"],fromLeft:["l:t"],fromBottom:["b:l"]},boundaryLoop:{alternateHorizontalSide:"b",alternateVerticalSide:"l",default:"v"},messageFlow:["straight","v:v"],subProcess:["straight","h:h"],isHorizontal:!0},_T={default:["v:v"],fromGateway:["h:v"],toGateway:["v:h"],loop:{fromTop:["t:l"],fromRight:["r:t"],fromLeft:["l:b"],fromBottom:["b:r"]},boundaryLoop:{alternateHorizontalSide:"t",alternateVerticalSide:"r",default:"h"},messageFlow:["straight","h:h"],subProcess:["straight","v:v"],isHorizontal:!1},td={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},Xs={top:"t",right:"r",bottom:"b",left:"l"};function ua(e){this._elementRegistry=e}B(ua,Bp);ua.prototype.layoutConnection=function(e,t){t||(t={});var n=t.source||e.source,r=t.target||e.target,i=t.waypoints||e.waypoints,o=t.connectionStart,a=t.connectionEnd,s=this._elementRegistry,c,u;if(o||(o=F_(i&&i[0],n)),a||(a=F_(i&&i[i.length-1],r)),(h(e,"bpmn:Association")||h(e,"bpmn:DataAssociation"))&&i&&!H_(n,r))return[].concat([o],i.slice(1,-1),[a]);var p=Ru(n,s)?yT:_T;return h(e,"bpmn:MessageFlow")?c=xT(n,r,p):(h(e,"bpmn:SequenceFlow")||H_(n,r))&&(n===r?c={preferredLayouts:PT(n,e,p)}:h(n,"bpmn:BoundaryEvent")?c={preferredLayouts:AT(n,r,a,p)}:Zs(n)||Zs(r)?c={preferredLayouts:p.subProcess,preserveDocking:wT(n)}:h(n,"bpmn:Gateway")?c={preferredLayouts:p.fromGateway}:h(r,"bpmn:Gateway")?c={preferredLayouts:p.toGateway}:c={preferredLayouts:p.default}),c&&(c=C(c,t),u=Jf(L_(n,r,o,a,i,c))),u||[o,a]};function bT(e){var t=e.host;return He(Y(e),t,vT)}function xT(e,t,n){return{preferredLayouts:n.messageFlow,preserveDocking:ET(e,t)}}function ET(e,t){return h(t,"bpmn:Participant")?"source":h(e,"bpmn:Participant")?"target":Zs(t)?"source":Zs(e)||h(t,"bpmn:Event")?"target":h(e,"bpmn:Event")?"source":null}function wT(e){return Zs(e)?"target":"source"}function F_(e,t){return e?e.original||e:Y(t)}function H_(e,t){return h(t,"bpmn:Activity")&&h(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function Zs(e){return h(e,"bpmn:SubProcess")&&oe(e)}function Yi(e,t){return e===t}function ST(e,t){return t.indexOf(e)!==-1}function sa(e){var t=/right|left/.exec(e);return t&&t[0]}function ca(e){var t=/top|bottom/.exec(e);return t&&t[0]}function $_(e,t){return td[e]===t}function CT(e,t){var n=sa(e),r=td[n];return t.indexOf(r)!==-1}function RT(e,t){var n=ca(e),r=td[n];return t.indexOf(r)!==-1}function G_(e){return e==="right"||e==="left"}function PT(e,t,n){var r=t.waypoints,i=r&&r.length&&He(r[0],e);return i==="top"?n.loop.fromTop:i==="right"?n.loop.fromRight:i==="left"?n.loop.fromLeft:n.loop.fromBottom}function AT(e,t,n,r){var i=Y(e),o=Y(t),a=bT(e),s,c,u=Yi(e.host,t),p=ST(a,["top","right","bottom","left"]),l=He(o,i,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return u?TT(a,p,e,t,n,r):(s=DT(a,l,p,r.isHorizontal),c=MT(a,l,p,r.isHorizontal),[s+":"+c])}function TT(e,t,n,r,i,o){var a=t?e:o.isHorizontal?ca(e):sa(e),s=Xs[a],c;return t?G_(e)?c=z_("y",n,r,i)?"h":o.boundaryLoop.alternateHorizontalSide:c=z_("x",n,r,i)?"v":o.boundaryLoop.alternateVerticalSide:c=o.boundaryLoop.default,[s+":"+c]}function z_(e,t,n,r){var i=gT;return!(ed(e,r,n,i)||ed(e,r,{x:n.x+n.width,y:n.y+n.height},i)||ed(e,r,Y(t),i))}function ed(e,t,n,r){return Math.abs(t[e]-n[e])!qn(d))})};pa.prototype.cleanUp=function(){this._complexPreview.cleanUp()};pa.$inject=["complexPreview","connectionDocking","elementFactory","eventBus","layouter","rules"];var U_={__depends__:[To,Cg,jp],__init__:["appendPreview"],appendPreview:["type",pa]};k();k();var q_=Math.min,K_=Math.max;function nd(e){e.preventDefault()}function Qs(e){e.stopPropagation()}function kT(e){return e.nodeType===Node.TEXT_NODE}function NT(e){return[].slice.call(e)}function yn(e){this.container=e.container,this.parent=ue('
      '),this.content=ge("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=Qe(this.autoResize,this),this.handlePaste=Qe(this.handlePaste,this)}yn.prototype.create=function(e,t,n,r){var i=this,o=this.parent,a=this.content,s=this.container;r=this.options=r||{},t=this.style=t||{};var c=lt(t,["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);C(o.style,{width:e.width+"px",height:e.height+"px",maxWidth:e.maxWidth+"px",maxHeight:e.maxHeight+"px",minWidth:e.minWidth+"px",minHeight:e.minHeight+"px",left:e.x+"px",top:e.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},c);var u=lt(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return C(a.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},u),r.centerVertically&&C(a.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},u),a.innerText=n,se.bind(a,"keydown",this.keyHandler),se.bind(a,"mousedown",Qs),se.bind(a,"paste",i.handlePaste),r.autoResize&&se.bind(a,"input",this.autoResize),r.resizable&&this.resizable(t),s.appendChild(o),this.setSelection(a.lastChild,a.lastChild&&a.lastChild.length),o};yn.prototype.handlePaste=function(e){var t=this.options,n=this.style;e.preventDefault();var r;if(e.clipboardData?r=e.clipboardData.getData("text/plain"):r=window.clipboardData.getData("Text"),this.insertText(r),t.autoResize){var i=this.autoResize(n);i&&this.resizeHandler(i)}};yn.prototype.insertText=function(e){e=OT(e);var t=document.execCommand("insertText",!1,e);t||this._insertTextIE(e)};yn.prototype._insertTextIE=function(e){var t=this.getSelection(),n=t.startContainer,r=t.endContainer,i=t.startOffset,o=t.endOffset,a=t.commonAncestorContainer,s=NT(a.childNodes),c,u;if(kT(a)){var p=n.textContent;n.textContent=p.substring(0,i)+e+p.substring(o),c=n,u=i+e.length}else if(n===this.content&&r===this.content){var l=document.createTextNode(e);this.content.insertBefore(l,s[i]),c=l,u=l.textContent.length}else{var f=s.indexOf(n),d=s.indexOf(r);s.forEach(function(m,y){y===f?m.textContent=n.textContent.substring(0,i)+e+r.textContent.substring(o):y>f&&y<=d&&Gt(m)}),c=n,u=i+e.length}c&&u!==void 0&&setTimeout(function(){self.setSelection(c,u)})};yn.prototype.autoResize=function(){var e=this.parent,t=this.content,n=parseInt(this.style.fontSize)||12;if(t.scrollHeight>e.offsetHeight||t.scrollHeight
      ');var s,c,u,p,l=function(m){nd(m),Qs(m),s=m.clientX,c=m.clientY;var y=t.getBoundingClientRect();u=y.width,p=y.height,se.bind(document,"mousemove",f),se.bind(document,"mouseup",d)},f=function(m){nd(m),Qs(m);var y=q_(K_(u+m.clientX-s,r),o),v=q_(K_(p+m.clientY-c,i),a);t.style.width=y+"px",t.style.height=v+"px",e.resizeHandler({width:u,height:p,dx:m.clientX-s,dy:m.clientY-c})},d=function(m){nd(m),Qs(m),se.unbind(document,"mousemove",f,!1),se.unbind(document,"mouseup",d,!1)};se.bind(n,"mousedown",l)}C(n.style,{position:"absolute",bottom:"0px",right:"0px",cursor:"nwse-resize",width:"0",height:"0",borderTop:(parseInt(this.style.fontSize)/4||3)+"px solid transparent",borderRight:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderBottom:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderLeft:(parseInt(this.style.fontSize)/4||3)+"px solid transparent"}),t.appendChild(n)};yn.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),se.unbind(t,"keydown",this.keyHandler),se.unbind(t,"mousedown",Qs),se.unbind(t,"input",this.autoResize),se.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),Gt(n)),Gt(e)};yn.prototype.getValue=function(){return this.content.innerText.trim()};yn.prototype.getSelection=function(){var e=window.getSelection(),t=e.getRangeAt(0);return t};yn.prototype.setSelection=function(e,t){var n=document.createRange();e===null?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t));var r=window.getSelection();r.removeAllRanges(),r.addRange(n)};function OT(e){return e.replace(/\r\n|\r|\n/g,` +`)}function sn(e,t){this._eventBus=e,this._canvas=t,this._providers=[],this._textbox=new yn({container:t.getContainer(),keyHandler:Qe(this._handleKey,this),resizeHandler:Qe(this._handleResize,this)})}sn.$inject=["eventBus","canvas"];sn.prototype.registerProvider=function(e){this._providers.push(e)};sn.prototype.isActive=function(e){return!!(this._active&&(!e||this._active.element===e))};sn.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())};sn.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})};sn.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0,this._canvas.restoreFocus&&this._canvas.restoreFocus()};sn.prototype.complete=function(){var e=this._active;if(e){var t,n=e.context.bounds,r=this.$textbox.getBoundingClientRect(),i=this.getValue(),o=e.context.text;(i!==o||r.height!==n.height||r.width!==n.width)&&(t=this._textbox.container.getBoundingClientRect(),e.provider.update(e.element,i,e.context.text,{x:r.left-t.left,y:r.top-t.top,width:r.width,height:r.height})),this._fire("complete"),this.close()}};sn.prototype.getValue=function(){return this._textbox.getValue()};sn.prototype._handleKey=function(e){e.stopPropagation();var t=e.keyCode||e.charCode;if(t===27)return e.preventDefault(),this.cancel();if(t===13&&!e.shiftKey)return e.preventDefault(),this.complete()};sn.prototype._handleResize=function(e){this._fire("resize",e)};sn.prototype.activate=function(e){this.isActive()&&this.cancel();var t,n=re(this._providers,function(r){return(t=r.activate(e))?r:null});return t&&(this.$textbox=this._textbox.create(t.bounds,t.style,t.text,t.options),this._active={element:e,context:t,provider:n},t.options&&t.options.resizable&&(this.resizable=!0),this._fire("activate")),!!t};var Fp={__depends__:[Qr],__init__:["directEditing"],directEditing:["type",sn]};function Y_(e){return function(t){var n=t.target,r=j(e),i=r.eventDefinitions&&r.eventDefinitions[0],o=r.$type===n.type,a=(i&&i.$type)===n.eventDefinitionType,s=!!n.triggeredByEvent==!!r.triggeredByEvent,c=n.isExpanded===void 0||n.isExpanded===oe(e);return!o||!a||!s||!c}}k();var X_=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],Z_=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}}],Q_=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message intermediate catch event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate throw event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer intermediate catch event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Escalation intermediate throw event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Conditional intermediate catch event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Link intermediate catch event",actionName:"replace-with-link-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-link",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Link intermediate throw event",actionName:"replace-with-link-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-link",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Compensation intermediate throw event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal intermediate catch event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate throw event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],J_=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message end event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Escalation end event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Error end event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Cancel end event",actionName:"replace-with-cancel-end",className:"bpmn-icon-end-event-cancel",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},{label:"Compensation end event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal end event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Terminate end event",actionName:"replace-with-terminate-end",className:"bpmn-icon-end-event-terminate",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:TerminateEventDefinition"}}],eb=[{label:"Exclusive gateway",actionName:"replace-with-exclusive-gateway",className:"bpmn-icon-gateway-xor",target:{type:"bpmn:ExclusiveGateway"}},{label:"Parallel gateway",actionName:"replace-with-parallel-gateway",className:"bpmn-icon-gateway-parallel",target:{type:"bpmn:ParallelGateway"}},{label:"Inclusive gateway",actionName:"replace-with-inclusive-gateway",className:"bpmn-icon-gateway-or",target:{type:"bpmn:InclusiveGateway"}},{label:"Complex gateway",actionName:"replace-with-complex-gateway",className:"bpmn-icon-gateway-complex",target:{type:"bpmn:ComplexGateway"}},{label:"Event-based gateway",actionName:"replace-with-event-based-gateway",className:"bpmn-icon-gateway-eventbased",target:{type:"bpmn:EventBasedGateway",instantiate:!1,eventGatewayType:"Exclusive"}}],tb=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Ad-hoc sub-process",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}},{label:"Sub-process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}}],nb=[{label:"Sub-process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Ad-hoc sub-process (collapsed)",actionName:"replace-with-collapsed-ad-hoc-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:AdHocSubProcess",isExpanded:!1}}],rd=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Sub-process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Ad-hoc sub-process",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}}],rb=rd,id=[{label:"Task",actionName:"replace-with-task",className:"bpmn-icon-task",target:{type:"bpmn:Task"}},{label:"User task",actionName:"replace-with-user-task",className:"bpmn-icon-user",target:{type:"bpmn:UserTask"}},{label:"Service task",actionName:"replace-with-service-task",className:"bpmn-icon-service",target:{type:"bpmn:ServiceTask"}},{label:"Send task",actionName:"replace-with-send-task",className:"bpmn-icon-send",target:{type:"bpmn:SendTask"}},{label:"Receive task",actionName:"replace-with-receive-task",className:"bpmn-icon-receive",target:{type:"bpmn:ReceiveTask"}},{label:"Manual task",actionName:"replace-with-manual-task",className:"bpmn-icon-manual",target:{type:"bpmn:ManualTask"}},{label:"Business rule task",actionName:"replace-with-rule-task",className:"bpmn-icon-business-rule",target:{type:"bpmn:BusinessRuleTask"}},{label:"Script task",actionName:"replace-with-script-task",className:"bpmn-icon-script",target:{type:"bpmn:ScriptTask"}},{label:"Call activity",actionName:"replace-with-call-activity",className:"bpmn-icon-call-activity",target:{type:"bpmn:CallActivity"}},{label:"Sub-process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}},{label:"Sub-process (expanded)",actionName:"replace-with-expanded-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Ad-hoc sub-process (collapsed)",actionName:"replace-with-collapsed-ad-hoc-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:AdHocSubProcess",isExpanded:!1}},{label:"Ad-hoc sub-process (expanded)",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}}],ib=[{label:"Data store reference",actionName:"replace-with-data-store-reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}}],ob=[{label:"Data object reference",actionName:"replace-with-data-object-reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}}],ab=[{label:"Message boundary event",actionName:"replace-with-message-boundary",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!0}},{label:"Timer boundary event",actionName:"replace-with-timer-boundary",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!0}},{label:"Escalation boundary event",actionName:"replace-with-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!0}},{label:"Conditional boundary event",actionName:"replace-with-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!0}},{label:"Error boundary event",actionName:"replace-with-error-boundary",className:"bpmn-icon-intermediate-event-catch-error",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",cancelActivity:!0}},{label:"Cancel boundary event",actionName:"replace-with-cancel-boundary",className:"bpmn-icon-intermediate-event-catch-cancel",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CancelEventDefinition",cancelActivity:!0}},{label:"Signal boundary event",actionName:"replace-with-signal-boundary",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!0}},{label:"Compensation boundary event",actionName:"replace-with-compensation-boundary",className:"bpmn-icon-intermediate-event-catch-compensation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",cancelActivity:!0}},{label:"Message boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-message-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!1}},{label:"Timer boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!1}},{label:"Escalation boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!1}},{label:"Conditional boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!1}},{label:"Signal boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!1}}],sb=[{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!0}},{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!0}},{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!0}},{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!0}},{label:"Error start event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",isInterrupting:!0}},{label:"Escalation start event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!0}},{label:"Compensation start event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",isInterrupting:!0}},{label:"Message start event (non-interrupting)",actionName:"replace-with-non-interrupting-message-start",className:"bpmn-icon-start-event-non-interrupting-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!1}},{label:"Timer start event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-start",className:"bpmn-icon-start-event-non-interrupting-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!1}},{label:"Conditional start event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-start",className:"bpmn-icon-start-event-non-interrupting-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!1}},{label:"Signal start event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-start",className:"bpmn-icon-start-event-non-interrupting-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!1}},{label:"Escalation start event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-start",className:"bpmn-icon-start-event-non-interrupting-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!1}}],cb=[{label:"Sequence flow",actionName:"replace-with-sequence-flow",className:"bpmn-icon-connection"},{label:"Default flow",actionName:"replace-with-default-flow",className:"bpmn-icon-default-flow"},{label:"Conditional flow",actionName:"replace-with-conditional-flow",className:"bpmn-icon-conditional-flow"}],ub=[{label:"Expanded pool/participant",actionName:"replace-with-expanded-pool",className:"bpmn-icon-participant",target:{type:"bpmn:Participant",isExpanded:!0}},{label:function(e){var t="Empty pool/participant";return e.children&&e.children.length&&(t+=" (removes content)"),t},actionName:"replace-with-collapsed-pool",className:"bpmn-icon-lane",target:{type:"bpmn:Participant",isExpanded:!1}}],pb={"bpmn:MessageEventDefinition":[{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!0}},{label:"Message intermediate catch event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate throw event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message end event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}}],"bpmn:TimerEventDefinition":[{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!0}},{label:"Timer intermediate catch event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}}],"bpmn:ConditionalEventDefinition":[{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!0}},{label:"Conditional intermediate catch event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}}],"bpmn:SignalEventDefinition":[{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!0}},{label:"Signal intermediate catch event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate throw event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal end event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],"bpmn:ErrorEventDefinition":[{label:"Error start event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",isInterrupting:!0}},{label:"Error end event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}}],"bpmn:EscalationEventDefinition":[{label:"Escalation start event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!0}},{label:"Escalation intermediate throw event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Escalation end event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}}],"bpmn:CompensateEventDefinition":[{label:"Compensation start event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",isInterrupting:!0}},{label:"Compensation intermediate throw event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Compensation end event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}}]};var od={"start-event-non-interrupting":` @@ -220,7 +220,7 @@ - `};function Qt(e,t,n,r,i,o,a,s){this._bpmnFactory=e,this._popupMenu=t,this._modeling=n,this._moddle=r,this._bpmnReplace=i,this._rules=o,this._translate=a,this._moddleCopy=s,this._register()}Qt.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate","moddleCopy"];Qt.prototype._register=function(){this._popupMenu.registerProvider("bpmn-replace",this)};Qt.prototype.getPopupMenuEntries=function(e){var s;var t=e.businessObject,n=this._rules,r=[],i,o=[];if(U(e)||!n.allowed("shape.replace",{element:e}))return{};var a=Xy(e);return m(t,"bpmn:DataObjectReference")?this._createEntries(e,o_):m(t,"bpmn:DataStoreReference")&&!m(e.parent,"bpmn:Collaboration")?this._createEntries(e,a_):(m(t,"bpmn:Event")&&!m(t,"bpmn:BoundaryEvent")&&(i=(s=t.get("eventDefinitions")[0])==null?void 0:s.$type,r=l_[i]||[],!Ue(t.$parent)&&m(t.$parent,"bpmn:SubProcess")&&(r=J(r,function(c){return c.target.type!=="bpmn:StartEvent"}))),m(t,"bpmn:StartEvent")&&!m(t.$parent,"bpmn:SubProcess")?(o=J(Zy.concat(r),a),this._createEntries(e,o)):m(t,"bpmn:Participant")?(o=J(u_,function(c){return ie(e)!==c.target.isExpanded}),this._createEntries(e,o)):m(t,"bpmn:StartEvent")&&Ue(t.$parent)?(o=J(c_.concat(r),function(c){var p=c.target,u=p.isInterrupting!==!1,l=t.isInterrupting===u;return a(c)||!a(c)&&!l}),this._createEntries(e,o)):m(t,"bpmn:StartEvent")&&!Ue(t.$parent)&&m(t.$parent,"bpmn:SubProcess")?(o=J(Qy.concat(r),a),this._createEntries(e,o)):m(t,"bpmn:EndEvent")?(o=J(e_.concat(r),function(c){var p=c.target;return p.eventDefinitionType=="bpmn:CancelEventDefinition"&&!m(t.$parent,"bpmn:Transaction")?!1:a(c)}),this._createEntries(e,o)):m(t,"bpmn:BoundaryEvent")?(o=J(s_,function(c){var p=c.target;if(p.eventDefinitionType=="bpmn:CancelEventDefinition"&&!m(t.attachedToRef,"bpmn:Transaction"))return!1;var u=p.cancelActivity!==!1,l=t.cancelActivity==u;return a(c)||!a(c)&&!l}),this._createEntries(e,o)):m(t,"bpmn:IntermediateCatchEvent")||m(t,"bpmn:IntermediateThrowEvent")?(o=J(Jy.concat(r),a),this._createEntries(e,o)):m(t,"bpmn:Gateway")?(o=J(t_,a),this._createEntries(e,o)):m(t,"bpmn:Transaction")?(o=J(Bf,a),this._createEntries(e,o)):Ue(t)&&ie(e)?(o=J(i_,a),this._createEntries(e,o)):m(t,"bpmn:AdHocSubProcess")&&ie(e)?(o=J(r_,a),this._createEntries(e,o)):m(t,"bpmn:SubProcess")&&ie(e)?(o=J(n_,a),this._createEntries(e,o)):m(t,"bpmn:SubProcess")&&!ie(e)?(o=J(If,function(c){var p=c.target.type===e.type,u=c.target.isExpanded===!0;return p===u}),this._createEntries(e,o)):m(t,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(e,p_):m(t,"bpmn:FlowNode")?(o=J(If,a),this._createEntries(e,o)):{})};Qt.prototype.getPopupMenuHeaderEntries=function(e){var t={};return m(e,"bpmn:Activity")&&!Ue(e)&&(t={...t,...this._getLoopCharacteristicsHeaderEntries(e)}),m(e,"bpmn:DataObjectReference")&&(t={...t,...this._getCollectionHeaderEntries(e)}),m(e,"bpmn:Participant")&&(t={...t,...this._getParticipantMultiplicityHeaderEntries(e)}),Kp(e)&&(t={...t,...this._getNonInterruptingHeaderEntries(e)}),t};Qt.prototype._createEntries=function(e,t){var n={},r=this;return E(t,function(i){n[i.actionName]=r._createEntry(i,e)}),n};Qt.prototype._createSequenceFlowEntries=function(e,t){var n=L(e),r={},i=this._modeling,o=this._moddle,a=this;return E(t,function(s){switch(s.actionName){case"replace-with-default-flow":n.sourceRef.default!==n&&(m(n.sourceRef,"bpmn:ExclusiveGateway")||m(n.sourceRef,"bpmn:InclusiveGateway")||m(n.sourceRef,"bpmn:ComplexGateway")||m(n.sourceRef,"bpmn:Activity"))&&(r={...r,[s.actionName]:a._createEntry(s,e,function(){i.updateProperties(e.source,{default:n})})});break;case"replace-with-conditional-flow":!n.conditionExpression&&m(n.sourceRef,"bpmn:Activity")&&(r={...r,[s.actionName]:a._createEntry(s,e,function(){var c=o.create("bpmn:FormalExpression",{body:""});i.updateProperties(e,{conditionExpression:c})})});break;default:m(n.sourceRef,"bpmn:Activity")&&n.conditionExpression&&(r={...r,[s.actionName]:a._createEntry(s,e,function(){i.updateProperties(e,{conditionExpression:void 0})})}),(m(n.sourceRef,"bpmn:ExclusiveGateway")||m(n.sourceRef,"bpmn:InclusiveGateway")||m(n.sourceRef,"bpmn:ComplexGateway")||m(n.sourceRef,"bpmn:Activity"))&&n.sourceRef.default===n&&(r={...r,[s.actionName]:a._createEntry(s,e,function(){i.updateProperties(e.source,{default:void 0})})})}}),r};Qt.prototype._createEntry=function(e,t,n){var r=this._translate,i=this._bpmnReplace.replaceElement,o=function(){return i(t,e.target)},a=e.label;return a&&typeof a=="function"&&(a=a(t)),n=n||o,{label:r(a),className:e.className,action:n}};Qt.prototype._getLoopCharacteristicsHeaderEntries=function(e){var t=this,n=this._translate;function r(p,u){if(u.active){t._modeling.updateProperties(e,{loopCharacteristics:void 0});return}var l=e.businessObject.get("loopCharacteristics");l&&m(l,u.options.loopCharacteristics)?t._modeling.updateModdleProperties(e,l,{isSequential:u.options.isSequential}):(l=t._moddle.create(u.options.loopCharacteristics,{isSequential:u.options.isSequential}),t._modeling.updateProperties(e,{loopCharacteristics:l}))}var i=L(e),o=i.loopCharacteristics,a,s,c;return o&&(a=o.isSequential,s=o.isSequential===void 0,c=o.isSequential!==void 0&&!o.isSequential),{"toggle-parallel-mi":{className:"bpmn-icon-parallel-mi-marker",title:n("Parallel multi-instance"),active:c,action:r,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!1}},"toggle-sequential-mi":{className:"bpmn-icon-sequential-mi-marker",title:n("Sequential multi-instance"),active:a,action:r,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!0}},"toggle-loop":{className:"bpmn-icon-loop-marker",title:n("Loop"),active:s,action:r,options:{loopCharacteristics:"bpmn:StandardLoopCharacteristics"}}}};Qt.prototype._getCollectionHeaderEntries=function(e){var t=this,n=this._translate,r=e.businessObject.dataObjectRef;if(!r)return{};function i(a,s){t._modeling.updateModdleProperties(e,r,{isCollection:!s.active})}var o=r.isCollection;return{"toggle-is-collection":{className:"bpmn-icon-parallel-mi-marker",title:n("Collection"),active:o,action:i}}};Qt.prototype._getParticipantMultiplicityHeaderEntries=function(e){var t=this,n=this._bpmnFactory,r=this._translate;function i(a,s){var c=s.active,p;c||(p=n.create("bpmn:ParticipantMultiplicity")),t._modeling.updateProperties(e,{participantMultiplicity:p})}var o=e.businessObject.participantMultiplicity;return{"toggle-participant-multiplicity":{className:"bpmn-icon-parallel-mi-marker",title:r("Participant multiplicity"),active:!!o,action:i}}};Qt.prototype._getNonInterruptingHeaderEntries=function(e){let t=this._translate,n=L(e),r=this,i=Yp(e),o=m(e,"bpmn:BoundaryEvent")?Lf["intermediate-event-non-interrupting"]:Lf["start-event-non-interrupting"],a=!n[i];return{"toggle-non-interrupting":{imageHtml:o,title:t("Toggle non-interrupting"),active:a,action:function(){r._modeling.updateProperties(e,{[i]:!!a})}}}};var f_={__depends__:[yo,du,xo],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",Qt]};function Fi(e,t,n,r,i,o,a,s,c,p,u,l,f){e=e||{},r.registerProvider(this),this._contextPad=r,this._modeling=i,this._elementFactory=o,this._connect=a,this._create=s,this._popupMenu=c,this._canvas=p,this._rules=u,this._translate=l,this._eventBus=n,this._appendPreview=f,e.autoPlace!==!1&&(this._autoPlace=t.get("autoPlace",!1)),n.on("create.end",250,function(d){var h=d.context,_=h.shape;if(!(!hr(d)||!r.isOpen(_))){var v=r.getEntries(_);v.replace&&v.replace.action.click(d,_)}}),n.on("contextPad.close",function(){f.cleanUp()})}Fi.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate","appendPreview"];Fi.prototype.getMultiElementContextPadEntries=function(e){var t=this._modeling,n={};return this._isDeleteAllowed(e)&&C(n,{delete:{group:"edit",className:"bpmn-icon-trash",title:this._translate("Delete"),action:{click:function(r,i){t.removeElements(i.slice())}}}}),n};Fi.prototype._isDeleteAllowed=function(e){var t=this._rules.allowed("elements.delete",{elements:e});return U(t)?hn(e,n=>t.includes(n)):t};Fi.prototype.getContextPadEntries=function(e){var t=this._contextPad,n=this._modeling,r=this._elementFactory,i=this._connect,o=this._create,a=this._popupMenu,s=this._autoPlace,c=this._translate,p=this._appendPreview,u={};if(e.type==="label")return this._isDeleteAllowed([e])&&C(u,h()),u;var l=e.businessObject;function f(b,x){i.start(b,x)}function d(b,x){n.removeElements([x])}function h(){return{delete:{group:"edit",className:"bpmn-icon-trash",title:c("Delete"),action:{click:d}}}}function _(b){var x=5,S=t.getPad(b).html,A=S.getBoundingClientRect(),O={x:A.left,y:A.bottom+x};return O}function v(b,x,S,A){function O(I,H){var z=r.createShape(C({type:b},A));o.start(I,z,{source:H})}var M=s?function(I,H){var z=r.createShape(C({type:b},A));s.append(H,z)}:O,B=s?function(I,H){return p.create(H,b,A),()=>{p.cleanUp()}}:null;return{group:"model",className:x,title:S,action:{dragstart:O,click:M,hover:B}}}function w(b){return function(x,S){n.splitLane(S,b),t.open(S,!0)}}if(Q(l,["bpmn:Lane","bpmn:Participant"])&&ie(e)){var P=cn(e);C(u,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:c("Add lane above"),action:{click:function(b,x){n.addLane(x,"top")}}}}),P.length<2&&((Re(e)?e.height>=120:e.width>=120)&&C(u,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:c("Divide into two lanes"),action:{click:w(2)}}}),(Re(e)?e.height>=180:e.width>=180)&&C(u,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:c("Divide into three lanes"),action:{click:w(3)}}})),C(u,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:c("Add lane below"),action:{click:function(b,x){n.addLane(x,"bottom")}}}})}return m(l,"bpmn:FlowNode")&&(m(l,"bpmn:EventBasedGateway")?C(u,{"append.receive-task":v("bpmn:ReceiveTask","bpmn-icon-receive-task",c("Append receive task")),"append.message-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",c("Append message intermediate catch event"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",c("Append timer intermediate catch event"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",c("Append conditional intermediate catch event"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",c("Append signal intermediate catch event"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):d_(l,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?C(u,{"append.compensation-activity":v("bpmn:Task","bpmn-icon-task",c("Append compensation activity"),{isForCompensation:!0})}):!m(l,"bpmn:EndEvent")&&!l.isForCompensation&&!d_(l,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")&&!Ue(l)&&C(u,{"append.end-event":v("bpmn:EndEvent","bpmn-icon-end-event-none",c("Append end event")),"append.gateway":v("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",c("Append gateway")),"append.append-task":v("bpmn:Task","bpmn-icon-task",c("Append task")),"append.intermediate-event":v("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",c("Append intermediate/boundary event"))})),a.isEmpty(e,"bpmn-replace")||C(u,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:c("Change element"),action:{click:function(b,x){var S=C(_(x),{cursor:{x:b.x,y:b.y}});a.open(x,"bpmn-replace",S,{title:c("Change element"),width:300,search:!0})}}}}),m(l,"bpmn:SequenceFlow")&&C(u,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),m(l,"bpmn:MessageFlow")&&C(u,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),Q(l,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&C(u,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation")),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect to other element"),action:{click:f,dragstart:f}}}),m(l,"bpmn:TextAnnotation")&&C(u,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect using association"),action:{click:f,dragstart:f}}}),Q(l,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&C(u,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect using data input association"),action:{click:f,dragstart:f}}}),m(l,"bpmn:Group")&&C(u,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),this._isDeleteAllowed([e])&&C(u,h()),u};function d_(e,t,n){var r=e.$instanceOf(t),i=!1,o=e.eventDefinitions||[];return E(o,function(a){a.$type===n&&(i=!0)}),r&&i}var h_={__depends__:[Ky,Cu,Gc,qe,So,ei,f_],__init__:["contextPadProvider"],contextPadProvider:["type",Fi]};var EP={horizontal:["x","width"],vertical:["y","height"]},m_=5;function Bn(e,t){this._modeling=e,this._filters=[],this.registerFilter(function(n){var r=t.allowed("elements.distribute",{elements:n});return U(r)?r:r?n:[]})}Bn.$inject=["modeling","rules"];Bn.prototype.registerFilter=function(e){if(typeof e!="function")throw new Error("the filter has to be a function");this._filters.push(e)};Bn.prototype.trigger=function(e,t){var n=this._modeling,r,i;if(!(e.length<3)&&(this._setOrientation(t),i=this._filterElements(e),r=this._createGroups(i),!(r.length<=2)))return n.distributeElements(r,this._axis,this._dimension),r};Bn.prototype._filterElements=function(e){var t=this._filters,n=this._axis,r=this._dimension,i=[].concat(e);return t.length?(E(t,function(o){i=o(i,n,r)}),i):e};Bn.prototype._createGroups=function(e){var t=[],n=this,r=this._axis,i=this._dimension;if(!r)throw new Error('must have a defined "axis" and "dimension"');var o=St(e,r);return E(o,function(a,s){var c=n._findRange(a,r,i),p,u=t[t.length-1];u&&n._hasIntersection(u.range,c)?t[t.length-1].elements.push(a):(p={range:c,elements:[a]},t.push(p))}),t};Bn.prototype._setOrientation=function(e){var t=EP[e];this._axis=t[0],this._dimension=t[1]};Bn.prototype._hasIntersection=function(e,t){return Math.max(e.min,e.max)>=Math.min(t.min,t.max)&&Math.min(e.min,e.max)<=Math.max(t.min,t.max)};Bn.prototype._findRange=function(e){var t=e[this._axis],n=e[this._dimension];return{min:t+m_,max:t+n-m_}};var g_={__init__:["distributeElements"],distributeElements:["type",Bn]};function na(e){Ct.call(this,e)}na.$inject=["eventBus"];N(na,Ct);na.prototype.init=function(){this.addRule("elements.distribute",function(e){var t=e.elements;return t=J(t,function(n){var r=Q(n,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(n.labelTarget||r)}),t=Dr(t),t.length<3?!1:t})};var wP={horizontal:` + `};function cn(e,t,n,r,i,o,a,s){this._bpmnFactory=e,this._popupMenu=t,this._modeling=n,this._moddle=r,this._bpmnReplace=i,this._rules=o,this._translate=a,this._moddleCopy=s,this._register()}cn.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate","moddleCopy"];cn.prototype._register=function(){this._popupMenu.registerProvider("bpmn-replace",this)};cn.prototype.getPopupMenuEntries=function(e){var s;var t=e.businessObject,n=this._rules,r=[],i,o=[];if(q(e)||!n.allowed("shape.replace",{element:e}))return{};var a=Y_(e);return h(t,"bpmn:DataObjectReference")?this._createEntries(e,ib):h(t,"bpmn:DataStoreReference")&&!h(e.parent,"bpmn:Collaboration")?this._createEntries(e,ob):(h(t,"bpmn:Event")&&!h(t,"bpmn:BoundaryEvent")&&(i=(s=t.get("eventDefinitions")[0])==null?void 0:s.$type,r=pb[i]||[],!Ye(t.$parent)&&h(t.$parent,"bpmn:SubProcess")&&(r=J(r,function(c){return c.target.type!=="bpmn:StartEvent"}))),h(t,"bpmn:StartEvent")&&!h(t.$parent,"bpmn:SubProcess")?(o=J(X_.concat(r),a),this._createEntries(e,o)):h(t,"bpmn:Participant")?(o=J(ub,function(c){return oe(e)!==c.target.isExpanded}),this._createEntries(e,o)):h(t,"bpmn:StartEvent")&&Ye(t.$parent)?(o=J(sb.concat(r),function(c){var u=c.target,p=u.isInterrupting!==!1,l=t.isInterrupting===p;return a(c)||!a(c)&&!l}),this._createEntries(e,o)):h(t,"bpmn:StartEvent")&&!Ye(t.$parent)&&h(t.$parent,"bpmn:SubProcess")?(o=J(Z_.concat(r),a),this._createEntries(e,o)):h(t,"bpmn:EndEvent")?(o=J(J_.concat(r),function(c){var u=c.target;return u.eventDefinitionType=="bpmn:CancelEventDefinition"&&!h(t.$parent,"bpmn:Transaction")?!1:a(c)}),this._createEntries(e,o)):h(t,"bpmn:BoundaryEvent")?(o=J(ab,function(c){var u=c.target;if(u.eventDefinitionType=="bpmn:CancelEventDefinition"&&!h(t.attachedToRef,"bpmn:Transaction"))return!1;var p=u.cancelActivity!==!1,l=t.cancelActivity==p;return a(c)||!a(c)&&!l}),this._createEntries(e,o)):h(t,"bpmn:IntermediateCatchEvent")||h(t,"bpmn:IntermediateThrowEvent")?(o=J(Q_.concat(r),a),this._createEntries(e,o)):h(t,"bpmn:Gateway")?(o=J(eb,a),this._createEntries(e,o)):h(t,"bpmn:Transaction")?(o=J(rd,a),this._createEntries(e,o)):Ye(t)&&oe(e)?(o=J(rb,a),this._createEntries(e,o)):h(t,"bpmn:AdHocSubProcess")&&oe(e)?(o=J(nb,a),this._createEntries(e,o)):h(t,"bpmn:SubProcess")&&oe(e)?(o=J(tb,a),this._createEntries(e,o)):h(t,"bpmn:SubProcess")&&!oe(e)?(o=J(id,function(c){var u=c.target.type===e.type,p=c.target.isExpanded===!0;return u===p}),this._createEntries(e,o)):h(t,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(e,cb):h(t,"bpmn:FlowNode")?(o=J(id,a),this._createEntries(e,o)):{})};cn.prototype.getPopupMenuHeaderEntries=function(e){var t={};return h(e,"bpmn:Activity")&&!Ye(e)&&(t={...t,...this._getLoopCharacteristicsHeaderEntries(e)}),h(e,"bpmn:DataObjectReference")&&(t={...t,...this._getCollectionHeaderEntries(e)}),h(e,"bpmn:Participant")&&(t={...t,...this._getParticipantMultiplicityHeaderEntries(e)}),sp(e)&&(t={...t,...this._getNonInterruptingHeaderEntries(e)}),t};cn.prototype._createEntries=function(e,t){var n={},r=this;return E(t,function(i){n[i.actionName]=r._createEntry(i,e)}),n};cn.prototype._createSequenceFlowEntries=function(e,t){var n=j(e),r={},i=this._modeling,o=this._moddle,a=this;return E(t,function(s){switch(s.actionName){case"replace-with-default-flow":n.sourceRef.default!==n&&(h(n.sourceRef,"bpmn:ExclusiveGateway")||h(n.sourceRef,"bpmn:InclusiveGateway")||h(n.sourceRef,"bpmn:ComplexGateway")||h(n.sourceRef,"bpmn:Activity"))&&(r={...r,[s.actionName]:a._createEntry(s,e,function(){i.updateProperties(e.source,{default:n})})});break;case"replace-with-conditional-flow":!n.conditionExpression&&h(n.sourceRef,"bpmn:Activity")&&(r={...r,[s.actionName]:a._createEntry(s,e,function(){var c=o.create("bpmn:FormalExpression",{body:""});i.updateProperties(e,{conditionExpression:c})})});break;default:h(n.sourceRef,"bpmn:Activity")&&n.conditionExpression&&(r={...r,[s.actionName]:a._createEntry(s,e,function(){i.updateProperties(e,{conditionExpression:void 0})})}),(h(n.sourceRef,"bpmn:ExclusiveGateway")||h(n.sourceRef,"bpmn:InclusiveGateway")||h(n.sourceRef,"bpmn:ComplexGateway")||h(n.sourceRef,"bpmn:Activity"))&&n.sourceRef.default===n&&(r={...r,[s.actionName]:a._createEntry(s,e,function(){i.updateProperties(e.source,{default:void 0})})})}}),r};cn.prototype._createEntry=function(e,t,n){var r=this._translate,i=this._bpmnReplace.replaceElement,o=function(){return i(t,e.target)},a=e.label;return a&&typeof a=="function"&&(a=a(t)),n=n||o,{label:r(a),className:e.className,action:n}};cn.prototype._getLoopCharacteristicsHeaderEntries=function(e){var t=this,n=this._translate;function r(u,p){if(p.active){t._modeling.updateProperties(e,{loopCharacteristics:void 0});return}var l=e.businessObject.get("loopCharacteristics");l&&h(l,p.options.loopCharacteristics)?t._modeling.updateModdleProperties(e,l,{isSequential:p.options.isSequential}):(l=t._moddle.create(p.options.loopCharacteristics,{isSequential:p.options.isSequential}),t._modeling.updateProperties(e,{loopCharacteristics:l}))}var i=j(e),o=i.loopCharacteristics,a,s,c;return o&&(a=o.isSequential,s=o.isSequential===void 0,c=o.isSequential!==void 0&&!o.isSequential),{"toggle-parallel-mi":{className:"bpmn-icon-parallel-mi-marker",title:n("Parallel multi-instance"),active:c,action:r,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!1}},"toggle-sequential-mi":{className:"bpmn-icon-sequential-mi-marker",title:n("Sequential multi-instance"),active:a,action:r,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!0}},"toggle-loop":{className:"bpmn-icon-loop-marker",title:n("Loop"),active:s,action:r,options:{loopCharacteristics:"bpmn:StandardLoopCharacteristics"}}}};cn.prototype._getCollectionHeaderEntries=function(e){var t=this,n=this._translate,r=e.businessObject.dataObjectRef;if(!r)return{};function i(a,s){t._modeling.updateModdleProperties(e,r,{isCollection:!s.active})}var o=r.isCollection;return{"toggle-is-collection":{className:"bpmn-icon-parallel-mi-marker",title:n("Collection"),active:o,action:i}}};cn.prototype._getParticipantMultiplicityHeaderEntries=function(e){var t=this,n=this._bpmnFactory,r=this._translate;function i(a,s){var c=s.active,u;c||(u=n.create("bpmn:ParticipantMultiplicity")),t._modeling.updateProperties(e,{participantMultiplicity:u})}var o=e.businessObject.participantMultiplicity;return{"toggle-participant-multiplicity":{className:"bpmn-icon-parallel-mi-marker",title:r("Participant multiplicity"),active:!!o,action:i}}};cn.prototype._getNonInterruptingHeaderEntries=function(e){let t=this._translate,n=j(e),r=this,i=cp(e),o=h(e,"bpmn:BoundaryEvent")?od["intermediate-event-non-interrupting"]:od["start-event-non-interrupting"],a=!n[i];return{"toggle-non-interrupting":{imageHtml:o,title:t("Toggle non-interrupting"),active:a,action:function(){r._modeling.updateProperties(e,{[i]:!!a})}}}};var lb={__depends__:[Po,Pp,To],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",cn]};k();function Xi(e,t,n,r,i,o,a,s,c,u,p,l,f){e=e||{},r.registerProvider(this),this._contextPad=r,this._modeling=i,this._elementFactory=o,this._connect=a,this._create=s,this._popupMenu=c,this._canvas=u,this._rules=p,this._translate=l,this._eventBus=n,this._appendPreview=f,e.autoPlace!==!1&&(this._autoPlace=t.get("autoPlace",!1)),n.on("create.end",250,function(d){var m=d.context,y=m.shape;if(!(!Rr(d)||!r.isOpen(y))){var v=r.getEntries(y);v.replace&&v.replace.action.click(d,y)}}),n.on("contextPad.close",function(){f.cleanUp()})}Xi.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate","appendPreview"];Xi.prototype.getMultiElementContextPadEntries=function(e){var t=this._modeling,n={};return this._isDeleteAllowed(e)&&C(n,{delete:{group:"edit",className:"bpmn-icon-trash",title:this._translate("Delete"),action:{click:function(r,i){t.removeElements(i.slice())}}}}),n};Xi.prototype._isDeleteAllowed=function(e){var t=this._rules.allowed("elements.delete",{elements:e});return q(t)?pn(e,n=>t.includes(n)):t};Xi.prototype.getContextPadEntries=function(e){var t=this._contextPad,n=this._modeling,r=this._elementFactory,i=this._connect,o=this._create,a=this._popupMenu,s=this._autoPlace,c=this._translate,u=this._appendPreview,p={};if(e.type==="label")return this._isDeleteAllowed([e])&&C(p,m()),p;var l=e.businessObject;function f(x,b){i.start(x,b)}function d(x,b){n.removeElements([b])}function m(){return{delete:{group:"edit",className:"bpmn-icon-trash",title:c("Delete"),action:{click:d}}}}function y(x){var b=5,S=t.getPad(x).html,A=S.getBoundingClientRect(),O={x:A.left,y:A.bottom+b};return O}function v(x,b,S,A){function O(I,$){var G=r.createShape(C({type:x},A));o.start(I,G,{source:$})}var D=s?function(I,$){var G=r.createShape(C({type:x},A));s.append($,G)}:O,L=s?function(I,$){return u.create($,x,A),()=>{u.cleanUp()}}:null;return{group:"model",className:b,title:S,action:{dragstart:O,click:D,hover:L}}}function w(x){return function(b,S){n.splitLane(S,x),t.open(S,!0)}}if(ee(l,["bpmn:Lane","bpmn:Participant"])&&oe(e)){var R=gn(e);C(p,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:c("Add lane above"),action:{click:function(x,b){n.addLane(b,"top")}}}}),R.length<2&&((Pe(e)?e.height>=120:e.width>=120)&&C(p,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:c("Divide into two lanes"),action:{click:w(2)}}}),(Pe(e)?e.height>=180:e.width>=180)&&C(p,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:c("Divide into three lanes"),action:{click:w(3)}}})),C(p,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:c("Add lane below"),action:{click:function(x,b){n.addLane(b,"bottom")}}}})}return h(l,"bpmn:FlowNode")&&(h(l,"bpmn:EventBasedGateway")?C(p,{"append.receive-task":v("bpmn:ReceiveTask","bpmn-icon-receive-task",c("Append receive task")),"append.message-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",c("Append message intermediate catch event"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",c("Append timer intermediate catch event"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",c("Append conditional intermediate catch event"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",c("Append signal intermediate catch event"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):fb(l,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?C(p,{"append.compensation-activity":v("bpmn:Task","bpmn-icon-task",c("Append compensation activity"),{isForCompensation:!0})}):!h(l,"bpmn:EndEvent")&&!l.isForCompensation&&!fb(l,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")&&!Ye(l)&&C(p,{"append.end-event":v("bpmn:EndEvent","bpmn-icon-end-event-none",c("Append end event")),"append.gateway":v("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",c("Append gateway")),"append.append-task":v("bpmn:Task","bpmn-icon-task",c("Append task")),"append.intermediate-event":v("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",c("Append intermediate/boundary event"))})),a.isEmpty(e,"bpmn-replace")||C(p,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:c("Change element"),action:{click:function(x,b){var S=C(y(b),{cursor:{x:x.x,y:x.y}});a.open(b,"bpmn-replace",S,{title:c("Change element"),width:300,search:!0})}}}}),h(l,"bpmn:SequenceFlow")&&C(p,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),h(l,"bpmn:MessageFlow")&&C(p,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),ee(l,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&C(p,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation")),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect to other element"),action:{click:f,dragstart:f}}}),h(l,"bpmn:TextAnnotation")&&C(p,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect using association"),action:{click:f,dragstart:f}}}),ee(l,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&C(p,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect using data input association"),action:{click:f,dragstart:f}}}),h(l,"bpmn:Group")&&C(p,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),this._isDeleteAllowed([e])&&C(p,m()),p};function fb(e,t,n){var r=e.$instanceOf(t),i=!1,o=e.eventDefinitions||[];return E(o,function(a){a.$type===n&&(i=!0)}),r&&i}var db={__depends__:[U_,Fp,ou,et,No,ui,lb],__init__:["contextPadProvider"],contextPadProvider:["type",Xi]};k();var IT={horizontal:["x","width"],vertical:["y","height"]},mb=5;function Wn(e,t){this._modeling=e,this._filters=[],this.registerFilter(function(n){var r=t.allowed("elements.distribute",{elements:n});return q(r)?r:r?n:[]})}Wn.$inject=["modeling","rules"];Wn.prototype.registerFilter=function(e){if(typeof e!="function")throw new Error("the filter has to be a function");this._filters.push(e)};Wn.prototype.trigger=function(e,t){var n=this._modeling,r,i;if(!(e.length<3)&&(this._setOrientation(t),i=this._filterElements(e),r=this._createGroups(i),!(r.length<=2)))return n.distributeElements(r,this._axis,this._dimension),r};Wn.prototype._filterElements=function(e){var t=this._filters,n=this._axis,r=this._dimension,i=[].concat(e);return t.length?(E(t,function(o){i=o(i,n,r)}),i):e};Wn.prototype._createGroups=function(e){var t=[],n=this,r=this._axis,i=this._dimension;if(!r)throw new Error('must have a defined "axis" and "dimension"');var o=Ct(e,r);return E(o,function(a,s){var c=n._findRange(a,r,i),u,p=t[t.length-1];p&&n._hasIntersection(p.range,c)?t[t.length-1].elements.push(a):(u={range:c,elements:[a]},t.push(u))}),t};Wn.prototype._setOrientation=function(e){var t=IT[e];this._axis=t[0],this._dimension=t[1]};Wn.prototype._hasIntersection=function(e,t){return Math.max(e.min,e.max)>=Math.min(t.min,t.max)&&Math.min(e.min,e.max)<=Math.max(t.min,t.max)};Wn.prototype._findRange=function(e){var t=e[this._axis],n=e[this._dimension];return{min:t+mb,max:t+n-mb}};var hb={__init__:["distributeElements"],distributeElements:["type",Wn]};k();function la(e){kt.call(this,e)}la.$inject=["eventBus"];B(la,kt);la.prototype.init=function(){this.addRule("elements.distribute",function(e){var t=e.elements;return t=J(t,function(n){var r=ee(n,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(n.labelTarget||r)}),t=Hr(t),t.length<3?!1:t})};var LT={horizontal:` @@ -228,7 +228,7 @@ - `},jf=wP;var SP=900;function Hi(e,t,n,r){this._distributeElements=t,this._translate=n,this._popupMenu=e,this._rules=r,e.registerProvider("align-elements",SP,this)}Hi.$inject=["popupMenu","distributeElements","translate","rules"];Hi.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&C(t,this._getEntries(e)),t};Hi.prototype._isAllowed=function(e){return this._rules.allowed("elements.distribute",{elements:e})};Hi.prototype._getEntries=function(e){var t=this._distributeElements,n=this._translate,r=this._popupMenu,i={"distribute-elements-horizontal":{group:"distribute",title:n("Distribute elements horizontally"),className:"bjs-align-elements-menu-entry",imageHtml:jf.horizontal,action:function(o,a){t.trigger(e,"horizontal"),r.close()}},"distribute-elements-vertical":{group:"distribute",title:n("Distribute elements vertically"),imageHtml:jf.vertical,action:function(o,a){t.trigger(e,"vertical"),r.close()}}};return i};var v_={__depends__:[yo,g_],__init__:["bpmnDistributeElements","distributeElementsMenuProvider"],bpmnDistributeElements:["type",na],distributeElementsMenuProvider:["type",Hi]};var y_="is not a registered action",CP="is already registered";function $t(e,t){this._actions={};var n=this;e.on("diagram.init",function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})})}$t.$inject=["eventBus","injector"];$t.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),n=e.get("modeling",!1),r=e.get("selection",!1),i=e.get("zoomScroll",!1),o=e.get("copyPaste",!1),a=e.get("canvas",!1),s=e.get("rules",!1),c=e.get("keyboardMove",!1),p=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",function(){t.undo()}),this.register("redo",function(){t.redo()})),o&&r&&this.register("copy",function(){var u=r.get();if(u.length)return o.copy(u)}),o&&r&&this.register("duplicate",function(){var u=r.get();if(u.length)return o.duplicate(u)}),o&&this.register("paste",function(){o.paste()}),o&&r&&s&&this.register("cut",function(){var u=r.get();if(u.length){var l=s.allowed("elements.delete",{elements:u});if(l!==!1){var f=U(l)?l:u;return o.cut(f.slice())}}}),i&&this.register("stepZoom",function(u){i.stepZoom(u.value)}),a&&this.register("zoom",function(u){a.zoom(u.value)}),n&&r&&s&&this.register("removeSelection",function(){var u=r.get();if(u.length){var l=s.allowed("elements.delete",{elements:u}),f;l!==!1&&(U(l)?f=l:f=u,f.length&&n.removeElements(f.slice()))}}),c&&this.register("moveCanvas",function(u){c.moveCanvas(u)}),p&&this.register("moveSelection",function(u){p.moveSelection(u.direction,u.accelerated)})};$t.prototype.trigger=function(e,t){if(!this._actions[e])throw Ff(e,y_);return this._actions[e](t)};$t.prototype.register=function(e,t){var n=this;if(typeof e=="string")return this._registerAction(e,t);E(e,function(r,i){n._registerAction(i,r)})};$t.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw Ff(e,CP);this._actions[e]=t};$t.prototype.unregister=function(e){if(!this.isRegistered(e))throw Ff(e,y_);this._actions[e]=void 0};$t.prototype.getActions=function(){return Object.keys(this._actions)};$t.prototype.isRegistered=function(e){return!!this._actions[e]};function Ff(e,t){return new Error(e+" "+t)}var __={__init__:["editorActions"],editorActions:["type",$t]};function ra(e){e.invoke($t,this)}N(ra,$t);ra.$inject=["injector"];ra.prototype._registerDefaultActions=function(e){$t.prototype._registerDefaultActions.call(this,e);var t=e.get("canvas",!1),n=e.get("elementRegistry",!1),r=e.get("selection",!1),i=e.get("spaceTool",!1),o=e.get("lassoTool",!1),a=e.get("handTool",!1),s=e.get("globalConnect",!1),c=e.get("distributeElements",!1),p=e.get("alignElements",!1),u=e.get("directEditing",!1),l=e.get("searchPad",!1),f=e.get("modeling",!1),d=e.get("contextPad",!1);t&&n&&r&&this._registerAction("selectElements",function(){var h=t.getRootElement(),_=n.filter(function(v){return v!==h});return r.select(_),_}),i&&this._registerAction("spaceTool",function(){i.toggle()}),o&&this._registerAction("lassoTool",function(){o.toggle()}),a&&this._registerAction("handTool",function(){a.toggle()}),s&&this._registerAction("globalConnectTool",function(){s.toggle()}),r&&c&&this._registerAction("distributeElements",function(h){var _=r.get(),v=h.type;_.length&&c.trigger(_,v)}),r&&p&&this._registerAction("alignElements",function(h){var _=r.get(),v=[],w=h.type;_.length&&(v=J(_,function(P){return!m(P,"bpmn:Lane")}),p.trigger(v,w))}),r&&f&&this._registerAction("setColor",function(h){var _=r.get();_.length&&f.setColor(_,h)}),r&&u&&this._registerAction("directEditing",function(){var h=r.get();h.length&&u.activate(h[0])}),l&&this._registerAction("find",function(){l.toggle()}),t&&f&&this._registerAction("moveToOrigin",function(){var h=t.getRootElement(),_,v;m(h,"bpmn:Collaboration")?v=n.filter(function(w){return m(w.parent,"bpmn:Collaboration")}):v=n.filter(function(w){return w!==h&&!m(w.parent,"bpmn:SubProcess")}),_=Ee(v),f.moveElements(v,{x:-_.x,y:-_.y},h)}),r&&d&&this._registerAction("replaceElement",function(h){d.triggerEntry("replace","click",h)})};var x_={__depends__:[__],editorActions:["type",ra]};function Ru(e){e.on(["create.init","shape.move.init"],function(t){var n=t.context,r=t.shape;Q(r,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}Ru.$inject=["eventBus"];var Hs=10;function Pu(e,t,n){return n||(n="round"),Math[n](e/t)*t}var RP=1200,PP=800;function tr(e,t,n){var r=!n||n.active!==!1;this._eventBus=t;var i=this;t.on("diagram.init",PP,function(){i.setActive(r)}),t.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],RP,function(o){var a=o.originalEvent;if(!(!i.active||a&<(a))){var s=o.context,c=s.gridSnappingContext;c||(c=s.gridSnappingContext={}),["x","y"].forEach(function(p){var u={},l=TP(o,p,e);l&&(u.offset=l);var f=AP(o,p);f&&C(u,f),Mn(o,p)||i.snapEvent(o,p,u)})}})}tr.prototype.snapEvent=function(e,t,n){var r=this.snapValue(e[t],n);Ie(e,t,r)};tr.prototype.getGridSpacing=function(){return Hs};tr.prototype.snapValue=function(e,t){var n=0;t&&t.offset&&(n=t.offset),e+=n,e=Pu(e,Hs);var r,i;return t&&t.min&&(r=t.min,ee(r)&&(r=Pu(r+n,Hs,"ceil"),e=Math.max(e,r))),t&&t.max&&(i=t.max,ee(i)&&(i=Pu(i+n,Hs,"floor"),e=Math.min(e,i))),e-=n,e};tr.prototype.isActive=function(){return this.active};tr.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})};tr.prototype.toggleActive=function(){this.setActive(!this.active)};tr.$inject=["elementRegistry","eventBus","config.gridSnapping"];function AP(e,t){var n=e.context,r=n.createConstraints,i=n.resizeConstraints||{},o=n.gridSnappingContext,a=o.snapConstraints;if(a&&a[t])return a[t];a||(a=o.snapConstraints={}),a[t]||(a[t]={});var s=n.direction;r&&(Au(t)?(a.x.min=r.left,a.x.max=r.right):(a.y.min=r.top,a.y.max=r.bottom));var c=i.min,p=i.max;return c&&(Au(t)?E_(s)?a.x.max=c.left:a.x.min=c.right:b_(s)?a.y.max=c.top:a.y.min=c.bottom),p&&(Au(t)?E_(s)?a.x.min=p.left:a.x.max=p.right:b_(s)?a.y.min=p.top:a.y.max=p.bottom),a[t]}function TP(e,t,n){var r=e.context,i=e.shape,o=r.gridSnappingContext,a=o.snapLocation,s=o.snapOffset;return s&&ee(s[t])||(s||(s=o.snapOffset={}),ee(s[t])||(s[t]=0),!i)||(n.get(i.id)||(Au(t)?s[t]+=i[t]+i.width/2:s[t]+=i[t]+i.height/2),!a)||(t==="x"?/left/.test(a)?s[t]-=i.width/2:/right/.test(a)&&(s[t]+=i.width/2):/top/.test(a)?s[t]-=i.height/2:/bottom/.test(a)&&(s[t]+=i.height/2)),s[t]}function Au(e){return e==="x"}function b_(e){return e.indexOf("n")!==-1}function E_(e){return e.indexOf("w")!==-1}function wr(e,t){k.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",function(r){var i=r.context,o=i.hints||{},a=o.autoResize;if(a){var s=i.shape,c=i.newBounds;et(a)?i.newBounds=n.snapComplex(c,a):i.newBounds=n.snapSimple(s,c)}})}wr.$inject=["eventBus","gridSnapping","modeling"];N(wr,k);wr.prototype.snapSimple=function(e,t){var n=this._gridSnapping;return t.width=n.snapValue(t.width,{min:t.width}),t.height=n.snapValue(t.height,{min:t.height}),t.x=e.x+e.width/2-t.width/2,t.y=e.y+e.height/2-t.height/2,t};wr.prototype.snapComplex=function(e,t){return/w|e/.test(t)&&(e=this.snapHorizontally(e,t)),/n|s/.test(t)&&(e=this.snapVertically(e,t)),e};wr.prototype.snapHorizontally=function(e,t){var n=this._gridSnapping,r=/w/.test(t),i=/e/.test(t),o={};return o.width=n.snapValue(e.width,{min:e.width}),i&&(r?(o.x=n.snapValue(e.x,{max:e.x}),o.width+=n.snapValue(e.x-o.x,{min:e.x-o.x})):e.x=e.x+e.width-o.width),C(e,o),e};wr.prototype.snapVertically=function(e,t){var n=this._gridSnapping,r=/n/.test(t),i=/s/.test(t),o={};return o.height=n.snapValue(e.height,{min:e.height}),r&&(i?(o.y=n.snapValue(e.y,{max:e.y}),o.height+=n.snapValue(e.y-o.y,{min:e.y-o.y})):e.y=e.y+e.height-o.height),C(e,o),e};var MP=2e3;function Tu(e,t){e.on(["spaceTool.move","spaceTool.end"],MP,function(n){var r=n.context;if(r.initialized){var i=r.axis,o;i==="x"?(o=t.snapValue(n.dx),n.x=n.x+o-n.dx,n.dx=o):(o=t.snapValue(n.dy),n.y=n.y+o-n.dy,n.dy=o)}})}Tu.$inject=["eventBus","gridSnapping"];var w_={__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",wr],gridSnappingSpaceToolBehavior:["type",Tu]};var S_={__depends__:[w_],__init__:["gridSnapping"],gridSnapping:["type",tr]};var DP=2e3;function Mu(e,t,n){e.on("autoPlace",DP,function(r){var i=r.source,o=Y(i),a=r.shape,s=dp(i,a,n);return["x","y"].forEach(function(c){var p={};s[c]!==o[c]&&(s[c]>o[c]?p.min=s[c]:p.max=s[c],m(a,"bpmn:TextAnnotation")&&(kP(c)?p.offset=-a.width/2:p.offset=-a.height/2),s[c]=t.snapValue(s[c],p))}),s})}Mu.$inject=["eventBus","gridSnapping","elementRegistry"];function kP(e){return e==="x"}var OP=1750;function Du(e,t,n){t.on(["create.start","shape.move.start"],OP,function(r){var i=r.context,o=i.shape,a=e.getRootElement();if(!(!m(o,"bpmn:Participant")||!m(a,"bpmn:Process")||!a.children.length)){var s=i.createConstraints;s&&(o.width=n.snapValue(o.width,{min:o.width}),o.height=n.snapValue(o.height,{min:o.height}))}})}Du.$inject=["canvas","eventBus","gridSnapping"];var NP=3e3;function ia(e,t,n){k.call(this,e),this._gridSnapping=t;var r=this;this.postExecuted(["connection.create","connection.layout"],NP,function(i){var o=i.context,a=o.connection,s=o.hints||{},c=a.waypoints;s.connectionStart||s.connectionEnd||s.createElementsBehavior===!1||BP(c)&&n.updateWaypoints(a,r.snapMiddleSegments(c))})}ia.$inject=["eventBus","gridSnapping","modeling"];N(ia,k);ia.prototype.snapMiddleSegments=function(e){var t=this._gridSnapping,n;e=e.slice();for(var r=1;r3}function IP(e){return e==="h"}function LP(e){return e==="v"}function jP(e,t,n){var r=Gt(t,n),i={};return IP(r)&&(i.y=e.snapValue(t.y)),LP(r)&&(i.x=e.snapValue(t.x)),("x"in i||"y"in i)&&(t=C({},t,i),n=C({},n,i)),[t,n]}var C_={__init__:["gridSnappingAutoPlaceBehavior","gridSnappingParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",Mu],gridSnappingParticipantBehavior:["type",Du],gridSnappingLayoutConnectionBehavior:["type",ia]};var R_={__depends__:[S_,C_],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",Ru]};var FP=30,P_=30;function $i(e,t){this._interactionEvents=t;var n=this;e.on(["interactionEvents.createHit","interactionEvents.updateHit"],function(r){var i=r.element,o=r.gfx;if(m(i,"bpmn:Lane"))return n._createParticipantHit(i,o);if(m(i,"bpmn:Participant"))return ie(i)?n._createParticipantHit(i,o):n._createDefaultHit(i,o);if(m(i,"bpmn:SubProcess"))return ie(i)?n._createSubProcessHit(i,o):n._createDefaultHit(i,o)})}$i.$inject=["eventBus","interactionEvents"];$i.prototype._createDefaultHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createDefaultHit(e,t),!0};$i.prototype._createParticipantHit=function(e,t){this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height});var n=Re(e)?{width:FP,height:e.height}:{width:e.width,height:P_};return this._interactionEvents.createBoxHit(t,"all",n),!0};$i.prototype._createSubProcessHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:e.width,height:P_}),!0};var A_={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",$i]};function oa(e){e.invoke(mr,this)}N(oa,mr);oa.$inject=["injector"];oa.prototype.registerBindings=function(e,t){mr.prototype.registerBindings.call(this,e,t);function n(r,i){t.isRegistered(r)&&e.addListener(i)}n("selectElements",function(r){var i=r.keyEvent;if(e.isKey(["a","A"],i)&&e.isCmd(i))return t.trigger("selectElements"),!0}),n("find",function(r){var i=r.keyEvent;if(e.isKey(["f","F"],i)&&e.isCmd(i))return t.trigger("find"),!0}),n("spaceTool",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["s","S"],i))return t.trigger("spaceTool"),!0}),n("lassoTool",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["l","L"],i))return t.trigger("lassoTool"),!0}),n("handTool",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["h","H"],i))return t.trigger("handTool"),!0}),n("globalConnectTool",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["c","C"],i))return t.trigger("globalConnectTool"),!0}),n("directEditing",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["e","E"],i))return t.trigger("directEditing"),!0}),n("replaceElement",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["r","R"],i))return t.trigger("replaceElement",i),!0})};var T_={__depends__:[uo],__init__:["keyboardBindings"],keyboardBindings:["type",oa]};var HP={moveSpeed:1,moveSpeedAccelerated:10},$P=1500,M_="left",D_="up",k_="right",O_="down",zP={ArrowLeft:M_,Left:M_,ArrowUp:D_,Up:D_,ArrowRight:k_,Right:k_,ArrowDown:O_,Down:O_},VP={left:function(e){return{x:-e,y:0}},up:function(e){return{x:0,y:-e}},right:function(e){return{x:e,y:0}},down:function(e){return{x:0,y:e}}};function ku(e,t,n,r,i){var o=this;this._config=C({},HP,e||{}),t.addListener($P,function(a){var s=a.keyEvent,c=zP[s.key];if(c&&!t.isCmd(s)){var p=t.isShift(s);return o.moveSelection(c,p),!0}}),this.moveSelection=function(a,s){var c=i.get();if(c.length){var p=this._config[s?"moveSpeedAccelerated":"moveSpeed"],u=VP[a](p),l=r.allowed("elements.move",{shapes:c,hints:{keyboardMove:!0}});l&&n.moveElements(c,u)}}}ku.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];var N_={__depends__:[uo,qe],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",ku]};var B_=10;function zi(e,t,n,r){this._dragging=r,this._rules=t;var i=this;function o(c,p){var u=c.shape,l=c.direction,f=c.resizeConstraints,d;c.delta=p,d=Og(u,l,p),c.newBounds=Bg(d,f),c.canExecute=i.canResize(c)}function a(c){var p=c.resizeConstraints,u=c.minBounds;p===void 0&&(u===void 0&&(u=i.computeMinResizeBox(c)),c.resizeConstraints={min:X(u)})}function s(c){var p=c.shape,u=c.canExecute,l=c.newBounds;if(u){if(l=oc(l),!WP(p,l))return;n.resizeShape(p,l)}}e.on("resize.start",function(c){a(c.context)}),e.on("resize.move",function(c){var p={x:c.dx,y:c.dy};o(c.context,p)}),e.on("resize.end",function(c){s(c.context)})}zi.prototype.canResize=function(e){var t=this._rules,n=pt(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)};zi.prototype.activate=function(e,t,n){var r=this._dragging,i,o;if(typeof n=="string"&&(n={direction:n}),i=C({shape:t},n),o=i.direction,!o)throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");r.init(e,Hf(t,o),"resize",{autoActivate:!0,cursor:GP(o),data:{shape:t,context:i}})};zi.prototype.computeMinResizeBox=function(e){var t=e.shape,n=e.direction,r,i;return r=e.minDimensions||{width:B_,height:B_},i=Hp(t,e.childrenBoxPadding),Ig(n,t,r,i)};zi.$inject=["eventBus","rules","modeling","dragging"];function WP(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function Hf(e,t){var n=Y(e),r=X(e),i={x:n.x,y:n.y};return t.indexOf("n")!==-1?i.y=r.top:t.indexOf("s")!==-1&&(i.y=r.bottom),t.indexOf("e")!==-1?i.x=r.right:t.indexOf("w")!==-1&&(i.x=r.left),i}function GP(e){var t="resize-";return e==="n"||e==="s"?t+"ns":e==="e"||e==="w"?t+"ew":e==="nw"||e==="se"?t+"nwse":t+"nesw"}var I_="djs-resizing",L_="resize-not-ok",UP=500;function Ou(e,t,n){function r(o){var a=o.shape,s=o.newBounds,c=o.frame;c||(c=o.frame=n.addFrame(a,t.getActiveLayer()),t.addMarker(a,I_)),s.width>5&&$(c,{x:s.x,width:s.width}),s.height>5&&$(c,{y:s.y,height:s.height}),o.canExecute?ue(c).remove(L_):ue(c).add(L_)}function i(o){var a=o.shape,s=o.frame;s&&be(o.frame),t.removeMarker(a,I_)}e.on("resize.move",UP,function(o){r(o.context)}),e.on("resize.cleanup",function(o){i(o.context)})}Ou.$inject=["eventBus","canvas","previewSupport"];var Nu=-6,Bu=8,Iu=20,$s="djs-resizer",KP=["n","w","s","e","nw","ne","se","sw"];function nr(e,t,n,r){this._resize=r,this._canvas=t;var i=this;e.on("selection.changed",function(o){var a=o.newSelection;i.removeResizers(),a.length===1&&E(a,Je(i.addResizer,i))}),e.on("shape.changed",function(o){var a=o.element;n.isSelected(a)&&(i.removeResizers(),i.addResizer(a))})}nr.prototype.makeDraggable=function(e,t,n){var r=this._resize;function i(o){an(o)&&r.activate(o,e,n)}ae.bind(t,"mousedown",i),ae.bind(t,"touchstart",i)};nr.prototype._createResizer=function(e,t,n,r){var i=this._getResizersParent(),o=YP(r),a=G("g");ue(a).add($s),ue(a).add($s+"-"+e.id),ue(a).add($s+"-"+r),Z(i,a);var s=G("rect");$(s,{x:-Bu/2+o.x,y:-Bu/2+o.y,width:Bu,height:Bu}),ue(s).add($s+"-visual"),Z(a,s);var c=G("rect");return $(c,{x:-Iu/2+o.x,y:-Iu/2+o.y,width:Iu,height:Iu}),ue(c).add($s+"-hit"),Z(a,c),Ji(a,t,n),a};nr.prototype.createResizer=function(e,t){var n=Hf(e,t),r=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,r,t)};nr.prototype.addResizer=function(e){var t=this;fe(e)||!this._resize.canResize({shape:e})||E(KP,function(n){t.createResizer(e,n)})};nr.prototype.removeResizers=function(){var e=this._getResizersParent();or(e)};nr.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")};nr.$inject=["eventBus","canvas","selection","resize"];function YP(e){var t={x:0,y:0};return e.indexOf("e")!==-1?t.x=-Nu:e.indexOf("w")!==-1&&(t.x=Nu),e.indexOf("s")!==-1?t.y=-Nu:e.indexOf("n")!==-1&&(t.y=Nu),t}var Lu={__depends__:[ft,wt,xn],__init__:["resize","resizePreview","resizeHandles"],resize:["type",zi],resizePreview:["type",Ou],resizeHandles:["type",nr]};var qP=2e3;function Vi(e,t,n,r,i,o,a){this._bpmnFactory=t,this._canvas=n,this._modeling=i,this._textRenderer=a,r.registerProvider(this),e.on("element.dblclick",function(c){s(c.element,!0)}),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open","root.set","selection.changed"],function(){r.isActive()&&r.complete()}),e.on(["shape.remove","connection.remove"],qP,function(c){r.isActive(c.element)&&r.cancel()}),e.on(["commandStack.changed"],function(c){r.isActive()&&r.cancel()}),e.on("directEditing.activate",function(c){o.removeResizers()}),e.on("create.end",500,function(c){var p=c.context,u=p.shape,l=c.context.canExecute,f=c.isTouch;f||l&&(p.hints&&p.hints.createElementsBehavior===!1||s(u))}),e.on("autoPlace.end",500,function(c){s(c.shape)});function s(c,p){(p||Q(c,["bpmn:Task","bpmn:TextAnnotation","bpmn:Participant"])||$f(c))&&r.activate(c)}}Vi.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"];Vi.prototype.activate=function(e){var t=xt(e);if(t!==void 0){var n={text:t},r=this.getEditingBBox(e);C(n,r);var i={},o=n.style||{};return C(o,{backgroundColor:null,border:null}),(Q(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||$f(e))&&C(i,{centerVertically:!0}),nn(e)&&(C(i,{autoResize:!0}),C(o,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),m(e,"bpmn:TextAnnotation")&&(C(i,{resizable:!0,autoResize:!0}),C(o,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),C(n,{options:i,style:o}),n}};Vi.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,r=t.getAbsoluteBBox(n),i={x:r.x+r.width/2,y:r.y+r.height/2},o={x:r.x,y:r.y},a=t.zoom(),s=this._textRenderer.getDefaultStyle(),c=this._textRenderer.getExternalStyle(),p=c.fontSize*a,u=c.lineHeight,l=s.fontSize*a,f=s.lineHeight,d={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};if(m(e,"bpmn:Lane")||QP(e)){var h=Re(e),_=h?{width:r.height,height:30*a,x:r.x-r.height/2+15*a,y:i.y-30*a/2}:{width:r.width,height:30*a};C(o,_),C(d,{fontSize:l+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px",transform:h?"rotate(-90deg)":null})}if(ZP(e)){var v=Re(e),w=v?{width:r.width,height:r.height}:{width:r.height,height:r.width,x:i.x-r.height/2,y:i.y-r.width/2};C(o,w),C(d,{fontSize:l+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px",transform:v?null:"rotate(-90deg)"})}(Q(e,["bpmn:Task","bpmn:CallActivity"])||$f(e))&&(C(o,{width:r.width,height:r.height}),C(d,{fontSize:l+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"})),XP(e)&&(C(o,{width:r.width,x:r.x}),C(d,{fontSize:l+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"}));var P=90*a,b=7*a,x=4*a;if(n.labelTarget&&(C(o,{width:P,height:r.height+b+x,x:i.x-P/2,y:r.y-b}),C(d,{fontSize:p+"px",lineHeight:u,paddingTop:b+"px",paddingBottom:x+"px"})),nn(n)&&!Fr(n)&&!te(n)){var S=_a(e),A=t.getAbsoluteBBox({x:S.x,y:S.y,width:0,height:0}),O=p+b+x;C(o,{width:P,height:O,x:A.x-P/2,y:A.y-O/2}),C(d,{fontSize:p+"px",lineHeight:u,paddingTop:b+"px",paddingBottom:x+"px"})}return m(e,"bpmn:TextAnnotation")&&(C(o,{width:r.width,height:r.height,minWidth:30*a,minHeight:10*a}),C(d,{textAlign:"left",paddingTop:5*a+"px",paddingBottom:7*a+"px",paddingLeft:7*a+"px",paddingRight:5*a+"px",fontSize:l+"px",lineHeight:f})),{bounds:o,style:d}};Vi.prototype.update=function(e,t,n,r){var i,o;m(e,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(e),i={x:e.x,y:e.y,width:e.width/o.width*r.width,height:e.height/o.height*r.height}),JP(t)&&(t=null),this._modeling.updateLabel(e,t,i)};function $f(e){return m(e,"bpmn:SubProcess")&&!ie(e)}function XP(e){return m(e,"bpmn:SubProcess")&&ie(e)}function ZP(e){return m(e,"bpmn:Participant")&&!ie(e)}function QP(e){return m(e,"bpmn:Participant")&&ie(e)}function JP(e){return!e||!e.trim()}var j_="djs-element-hidden",F_="djs-label-hidden";function ju(e,t,n){var r=this,i=t.getDefaultLayer(),o,a,s;e.on("directEditing.activate",function(c){var p=c.active;if(o=p.element.label||p.element,m(o,"bpmn:TextAnnotation")){a=t.getAbsoluteBBox(o),s=G("g");var u=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:o.height,position:{mx:0,my:0}}),l=r.path=G("path");$(l,{d:u,strokeWidth:2,stroke:eA(o)}),Z(s,l),Z(i,s),ke(s,o.x,o.y)}m(o,"bpmn:TextAnnotation")||o.labelTarget?t.addMarker(o,j_):(m(o,"bpmn:Task")||m(o,"bpmn:CallActivity")||m(o,"bpmn:SubProcess")||m(o,"bpmn:Participant")||m(o,"bpmn:Lane"))&&t.addMarker(o,F_)}),e.on("directEditing.resize",function(c){if(m(o,"bpmn:TextAnnotation")){var p=c.height,u=c.dy,l=Math.max(o.height/a.height*(p+u),0),f=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:l,position:{mx:0,my:0}});$(r.path,{d:f})}}),e.on(["directEditing.complete","directEditing.cancel"],function(c){var p=c.active;p&&(t.removeMarker(p.element.label||p.element,j_),t.removeMarker(o,F_)),o=void 0,a=void 0,s&&(be(s),s=void 0)})}ju.$inject=["eventBus","canvas","pathMap"];function eA(e,t){var n=se(e);return n.get("stroke")||t||"black"}var H_={__depends__:[co,Lu,Cu],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",Vi],labelEditingPreview:["type",ju]};var tA=500,nA=1e3;function Sr(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),r=this;function i(o){var a=G("rect");return $(a,C({x:0,y:0,rx:4,width:100,height:100},n)),a}e.on(["shape.added","shape.changed"],tA,function(o){var a=o.element,s=o.gfx,c=me(".djs-outline",s);c||(c=r.getOutline(a)||i(s),Z(s,c)),r.updateShapeOutline(c,a)}),e.on(["connection.added","connection.changed"],function(o){var a=o.element,s=o.gfx,c=me(".djs-outline",s);c||(c=i(s),Z(s,c)),r.updateConnectionOutline(c,a)})}Sr.prototype.updateShapeOutline=function(e,t){var n=!1,r=this._getProviders();r.length&&E(r,function(i){n=n||i.updateOutline(t,e)}),n||$(e,{x:-this.offset,y:-this.offset,width:t.width+this.offset*2,height:t.height+this.offset*2})};Sr.prototype.updateConnectionOutline=function(e,t){var n=Ee(t);$(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+this.offset*2,height:n.height+this.offset*2})};Sr.prototype.registerProvider=function(e,t){t||(t=e,e=nA),this._eventBus.on("outline.getProviders",e,function(n){n.providers.push(t)})};Sr.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers};Sr.prototype.getOutline=function(e){var t,n=this._getProviders();return E(n,function(r){Ne(r.getOutline)&&(t=t||r.getOutline(e))}),t};Sr.$inject=["eventBus","styles","elementRegistry"];var Fu=6;function zs(e,t,n){this._canvas=t;var r=this;e.on("element.changed",function(i){n.isSelected(i.element)&&r._updateMultiSelectionOutline(n.get())}),e.on("selection.changed",function(i){var o=i.newSelection;r._updateMultiSelectionOutline(o)})}zs.prototype._updateMultiSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");or(t);var n=e.length>1,r=this._canvas.getContainer();if(ue(r)[n?"add":"remove"]("djs-multi-select"),!!n){var i=rA(Ee(e)),o=G("rect");$(o,C({rx:3},i)),ue(o).add("djs-selection-outline"),Z(t,o)}};zs.$inject=["eventBus","canvas","selection"];function rA(e){return{x:e.x-Fu,y:e.y-Fu,width:e.width+Fu*2,height:e.height+Fu*2}}var aa={__depends__:[qe],__init__:["outline","multiSelectionOutline"],outline:["type",Sr],multiSelectionOutline:["type",zs]};var $_=["bpmn:Event","bpmn:SequenceFlow","bpmn:Gateway"],z_={class:"bjs-label-link",stroke:"var(--element-selected-outline-secondary-stroke-color)",strokeDasharray:"5, 5"},iA=15,Hu=2;function $u(e,t,n,r,i){let o=t.getLayer("overlays");e.on(["selection.changed","shape.changed"],function(){s()}),e.on("selection.changed",function({newSelection:l}){var d;let f=l.filter(h=>Q(h,$_));if(f.length===1){let h=f[0];te(h)?a(h,h.labelTarget,l):(d=h.labels)!=null&&d.length&&a(h.labels[0],h,l)}if(f.length===2){let h=f.find(te),_=f.find(v=>{var w;return(w=v.labels)==null?void 0:w.includes(h)});h&&_&&a(h,_,l)}}),e.on("shape.changed",function({element:l}){var f;!Q(l,$_)||!u(l)||(te(l)?a(l,l.labelTarget,i.get()):(f=l.labels)!=null&&f.length&&a(l.labels[0],l,i.get()))});function a(l,f,d=[]){let h=jn([Y(f),Y(l)],z_),_=h.getAttribute("d"),w=d.includes(l)?c(l):p(l),P=Ir(w,_);if(!P)return;let x=d.includes(f)?c(f):p(f),S=Ir(x,_)||Y(f);bi(S,P)');return at(t,{position:"absolute",width:"0",height:"0"}),e.insertBefore(t,e.firstChild),t}function sA(e,t,n){at(e,{left:t+"px",top:n+"px"})}function Vf(e,t){e.style.display=t===!1?"none":""}var W_="djs-tooltip",zf="."+W_;function Pt(e,t){this._eventBus=e,this._canvas=t,this._ids=oA,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=aA(t.getContainer());var n=this;ut.bind(this._tooltipRoot,zf,"mousedown",function(r){r.stopPropagation()}),ut.bind(this._tooltipRoot,zf,"mouseover",function(r){n.trigger("mouseover",r)}),ut.bind(this._tooltipRoot,zf,"mouseout",function(r){n.trigger("mouseout",r)}),this._init()}Pt.$inject=["eventBus","canvas"];Pt.prototype.add=function(e){if(!e.position)throw new Error("must specifiy tooltip position");if(!e.html)throw new Error("must specifiy tooltip html");var t=this._ids.next();return e=C({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t};Pt.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,r=this.get(Ye(n,"data-tooltip-id"));r&&(e==="mouseover"&&r.timeout&&this.clearTimeout(r),e==="mouseout"&&r.timeout&&(r.timeout=1e3,this.setTimeout(r)))};Pt.prototype.get=function(e){return typeof e!="string"&&(e=e.id),this._tooltips[e]};Pt.prototype.clearTimeout=function(e){if(e=this.get(e),!!e){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}};Pt.prototype.setTimeout=function(e){if(e=this.get(e),!!e){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout(function(){t.remove(e)},e.timeout)}};Pt.prototype.remove=function(e){var t=this.get(e);t&&(Bt(t.html),Bt(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])};Pt.prototype.show=function(){Vf(this._tooltipRoot)};Pt.prototype.hide=function(){Vf(this._tooltipRoot,!1)};Pt.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1,r="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._tooltipRoot.style.transform=r,this._tooltipRoot.style["-ms-transform"]=r};Pt.prototype._addTooltip=function(e){var t=e.id,n=e.html,r,i=this._tooltipRoot;n.get&&n.constructor.prototype.jquery&&(n=n.get(0)),et(n)&&(n=ye(n)),r=ye('
      '),at(r,{position:"absolute"}),r.appendChild(n),e.type&&Ae(r).add("djs-tooltip-"+e.type),e.className&&Ae(r).add(e.className),e.htmlContainer=r,i.appendChild(r),this._tooltips[t]=e,this._updateTooltip(e)};Pt.prototype._updateTooltip=function(e){var t=e.position,n=e.htmlContainer;sA(n,t.x,t.y)};Pt.prototype._updateTooltipVisibilty=function(e){E(this._tooltips,function(t){var n=t.show,r=t.htmlContainer,i=!0;n&&((n.minZoom>e.scale||n.maxZoom"+o+"
      "})}e.on(["shape.move.rejected","create.rejected"],function(i){var o=i.context,a=o.shape,s=o.target;m(s,"bpmn:Collaboration")&&(m(a,"bpmn:FlowNode")?r(i,n(cA)):m(a,"bpmn:DataObjectReference")&&r(i,n(pA)))})}zu.$inject=["eventBus","tooltips","translate"];var U_={__depends__:[G_],__init__:["modelingFeedback"],modelingFeedback:["type",zu]};var uA=500,lA=1250,fA=1500,Vu=Math.round;function dA(e){return{x:e.x+Vu(e.width/2),y:e.y+Vu(e.height/2)}}function Wu(e,t,n,r,i){function o(s,c,p,u){return i.allowed("elements.move",{shapes:s,delta:c,position:p,target:u})}e.on("shape.move.start",fA,function(s){var c=s.context,p=s.shape,u=r.get().slice();u.indexOf(p)===-1&&(u=[p]),u=hA(u),C(c,{shapes:u,validatedShapes:u,shape:p})}),e.on("shape.move.start",lA,function(s){var c=s.context,p=c.validatedShapes,u;if(u=c.canExecute=o(p),!u)return!1}),e.on("shape.move.move",uA,function(s){var c=s.context,p=c.validatedShapes,u=s.hover,l={x:s.dx,y:s.dy},f={x:s.x,y:s.y},d;if(d=o(p,l,f,u),c.delta=l,c.canExecute=d,d===null){c.target=null;return}c.target=u}),e.on("shape.move.end",function(s){var c=s.context,p=c.delta,u=c.canExecute,l=u==="attach",f=c.shapes;if(u===!1)return!1;p.x=Vu(p.x),p.y=Vu(p.y),!(p.x===0&&p.y===0)&&n.moveElements(f,p,c.target,{primaryShape:c.shape,attach:l})}),e.on("element.mousedown",function(s){if(an(s)){var c=dr(s);if(!c)throw new Error("must supply DOM mousedown event");return a(c,s.element)}});function a(s,c,p,u){if(Ce(p)&&(u=p,p=!1),!(c.waypoints||!c.parent)&&!ue(s.target).has("djs-hit-no-move")){var l=dA(c);return t.init(s,l,"shape.move",{cursor:"grabbing",autoActivate:p,data:{shape:c,context:u||{}}}),!0}}this.start=a}Wu.$inject=["eventBus","dragging","modeling","selection","rules"];function hA(e){var t=wn(e,"id");return J(e,function(n){for(;n=n.parent;)if(t[n.id])return!1;return!0})}var K_=499,Wf="djs-dragging",Y_="drop-ok",q_="drop-not-ok",X_="new-parent",Z_="attach-ok";function Gu(e,t,n,r){function i(c){var p=o(c),u=mA(p);return u}function o(c){var p=Fn(c,!0),u=p.flatMap(d=>(d.incoming||[]).concat(d.outgoing||[])),l=p.concat(u),f=[...new Set(l)];return f}function a(c,p){[Z_,Y_,q_,X_].forEach(function(u){u===p?t.addMarker(c,u):t.removeMarker(c,u)})}function s(c,p,u){r.addDragger(p,c.dragGroup),u&&t.addMarker(p,Wf),c.allDraggedElements?c.allDraggedElements.push(p):c.allDraggedElements=[p]}e.on("shape.move.start",K_,function(c){var p=c.context,u=p.shapes,l=p.allDraggedElements,f=i(u);if(!p.dragGroup){var d=G("g");$(d,n.cls("djs-drag-group",["no-events"]));var h=t.getActiveLayer();Z(h,d),p.dragGroup=d}f.forEach(function(_){r.addDragger(_,p.dragGroup)}),l?l=Ui([l,o(u)]):l=o(u),E(l,function(_){t.addMarker(_,Wf)}),p.allDraggedElements=l,p.differentParents=gA(u)}),e.on("shape.move.move",K_,function(c){var p=c.context,u=p.dragGroup,l=p.target,f=p.shape.parent,d=p.canExecute;l&&(d==="attach"?a(l,Z_):p.canExecute&&f&&l.id!==f.id?a(l,X_):a(l,p.canExecute?Y_:q_)),ke(u,c.dx,c.dy)}),e.on(["shape.move.out","shape.move.cleanup"],function(c){var p=c.context,u=p.target;u&&a(u,null)}),e.on("shape.move.cleanup",function(c){var p=c.context,u=p.allDraggedElements,l=p.dragGroup;E(u,function(f){t.removeMarker(f,Wf)}),l&&be(l)}),this.makeDraggable=s}Gu.$inject=["eventBus","canvas","styles","previewSupport"];function mA(e){var t=J(e,function(n){return fe(n)?ne(e,yt({id:n.source.id}))&&ne(e,yt({id:n.target.id})):!0});return t}function gA(e){return Jf(wn(e,function(t){return t.parent&&t.parent.id}))!==1}var Q_={__depends__:[Vr,qe,aa,ft,wt,xn],__init__:["move","movePreview"],move:["type",Wu],movePreview:["type",Gu]};var ex=".djs-palette-toggle",tx=".entry",vA=ex+", "+tx,Gf="djs-palette-",yA="shown",Uf="open",J_="two-column",_A=1e3;function Ze(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",function(r){var i=r.tool;n.updateToolHighlight(i)}),e.on("i18n.changed",function(){n._update()}),e.on("diagram.init",function(){n._diagramInitialized=!0,n._rebuild()})}Ze.$inject=["eventBus","canvas"];Ze.prototype.registerProvider=function(e,t){t||(t=e,e=_A),this._eventBus.on("palette.getProviders",e,function(n){n.providers.push(t)}),this._rebuild()};Ze.prototype.getEntries=function(){var e=this._getProviders();return e.reduce(bA,{})};Ze.prototype._rebuild=function(){if(this._diagramInitialized){var e=this._getProviders();e.length&&(this._container||this._init(),this._update())}};Ze.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),r=this._container=ye(Ze.HTML_MARKUP);n.appendChild(r),Ae(n).add(Gf+yA),ut.bind(r,vA,"click",function(i){var o=i.delegateTarget;if(Zs(o,ex))return e.toggle();e.trigger("click",i)}),ae.bind(r,"mousedown",function(i){i.stopPropagation()}),ut.bind(r,tx,"dragstart",function(i){e.trigger("dragstart",i)}),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:r})};Ze.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers};Ze.prototype._toggleState=function(e){e=e||{};var t=this._getParentContainer(),n=this._container,r=this._eventBus,i,o=Ae(n),a=Ae(t);"twoColumn"in e?i=e.twoColumn:i=this._needsCollapse(t.clientHeight,this._entries||{}),o.toggle(J_,i),a.toggle(Gf+J_,i),"open"in e&&(o.toggle(Uf,e.open),a.toggle(Gf+Uf,e.open)),r.fire("palette.changed",{twoColumn:i,open:this.isOpen()})};Ze.prototype._update=function(){var e=me(".djs-palette-entries",this._container),t=this._entries=this.getEntries();Tr(e),E(t,function(n,r){var i=n.group||"default",o=me("[data-group="+lr(i)+"]",e);o||(o=ye('
      '),Ye(o,"data-group",i),e.appendChild(o));var a=n.html||(n.separator?'
      ':'
      '),s=ye(a);if(o.appendChild(s),!n.separator&&(Ye(s,"data-action",r),n.title&&Ye(s,"title",n.title),n.className&&xA(s,n.className),n.imageUrl)){var c=ye("");Ye(c,"src",n.imageUrl),s.appendChild(c)}}),this.open()};Ze.prototype.trigger=function(e,t,n){var r,i,o=t.delegateTarget||t.target;return o?(r=Ye(o,"data-action"),i=t.originalEvent||t,this.triggerEntry(r,e,i,n)):t.preventDefault()};Ze.prototype.triggerEntry=function(e,t,n,r){var i=this._entries,o,a;if(o=i[e],!!o&&(a=o.action,this._eventBus.fire("palette.trigger",{entry:o,event:n})!==!1)){if(Ne(a)){if(t==="click")return a(n,r)}else if(a[t])return a[t](n,r);n.preventDefault()}};Ze.prototype._layoutChanged=function(){this._toggleState({})};Ze.prototype._needsCollapse=function(e,t){var n=50,r=Object.keys(t).length*46;return e=n.x&&t.yn.x&&t.y<=n.y?r={x:n.x,y:t.y,width:t.x-n.x,height:n.y-t.y}:t.x<=n.x&&t.y>n.y||t.x=n.y?r={x:t.x,y:n.y,width:n.x-t.x,height:t.y-n.y}:t.x>=n.x&&t.y>n.y||t.x>n.x&&t.y>=n.y?r={x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:r={x:n.x,y:n.y,width:0,height:0},r}var ix={__depends__:[ti,Zn],__init__:["lassoTool"],lassoTool:["type",Cr]};var Yf=1500,ax="grab";function oi(e,t,n,r,i,o){this._dragging=n,this._mouse=o;var a=this,s=r.get("keyboard",!1);i.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",Yf,function(c){if(hr(c))return a.activateMove(c.originalEvent,!0),!1}),s&&s.addListener(Yf,function(c){if(!(!ox(c.keyEvent)||a.isActive())){var p=a._mouse.getLastMoveEvent();a.activateMove(p,!!p)}},"keyboard.keydown"),s&&s.addListener(Yf,function(c){!ox(c.keyEvent)||!a.isActive()||a.toggle()},"keyboard.keyup"),e.on("hand.end",function(c){var p=c.originalEvent.target;if(!c.hover&&!(p instanceof SVGElement))return!1;e.once("hand.ended",function(){a.activateMove(c.originalEvent,{reactivate:!0})})}),e.on("hand.move.move",function(c){var p=t.viewbox().scale;t.scroll({dx:c.dx*p,dy:c.dy*p})}),e.on("hand.move.end",function(c){var p=c.context,u=p.reactivate;return!hr(c)&&u&&e.once("hand.move.ended",function(l){a.activateHand(l.originalEvent,!0,!0)}),!1})}oi.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"];oi.prototype.activateMove=function(e,t,n){typeof t=="object"&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:ax,data:{context:n||{}}})};oi.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:ax,data:{context:{reactivate:n}}})};oi.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)};oi.prototype.isActive=function(){var e=this._dragging.context();return e?/^(hand|hand\.move)$/.test(e.prefix):!1};function ox(e){return ze("Space",e)}var sx={__depends__:[ti,Zn],__init__:["handTool"],handTool:["type",oi]};var cx="connect-ok",px="connect-not-ok";function ai(e,t,n,r,i,o,a){var s=this;this._dragging=t,this._rules=o,this._mouse=a,i.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),e.on("global-connect.hover",function(c){var p=c.context,u=c.hover,l=p.canStartConnect=s.canStartConnect(u);l!==null&&(p.startTarget=u,r.addMarker(u,l?cx:px))}),e.on(["global-connect.out","global-connect.cleanup"],function(c){var p=c.context.startTarget,u=c.context.canStartConnect;p&&r.removeMarker(p,u?cx:px)}),e.on(["global-connect.ended"],function(c){var p=c.context,u=p.startTarget,l={x:c.x,y:c.y},f=s.canStartConnect(u);if(f)return e.once("element.out",function(){e.once(["connect.ended","connect.canceled"],function(){e.fire("global-connect.drag.ended")}),n.start(null,u,l)}),!1})}ai.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"];ai.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})};ai.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)};ai.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)};ai.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};var ux={__depends__:[So,ft,wt,ti,Zn],globalConnect:["type",ai]};function Vs(e,t,n,r,i,o,a,s){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=r,this._lassoTool=i,this._handTool=o,this._globalConnect=a,this._translate=s,e.registerProvider(this)}Vs.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"];Vs.prototype.getPaletteEntries=function(){var e={},t=this._create,n=this._elementFactory,r=this._spaceTool,i=this._lassoTool,o=this._handTool,a=this._globalConnect,s=this._translate;function c(l,f,d,h,_){function v(w){var P=n.createShape(C({type:l},_));t.start(w,P)}return{group:f,className:d,title:h,action:{dragstart:v,click:v}}}function p(l){var f=n.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),d=n.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:f});t.start(l,[f,d],{hints:{autoSelect:[f]}})}function u(l){t.start(l,n.createParticipantShape())}return C(e,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:s("Activate hand tool"),action:{click:function(l){o.activateHand(l)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:s("Activate lasso tool"),action:{click:function(l){i.activateSelection(l)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:s("Activate create/remove space tool"),action:{click:function(l){r.activateSelection(l)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:s("Activate global connect tool"),action:{click:function(l){a.start(l)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":c("bpmn:StartEvent","event","bpmn-icon-start-event-none",s("Create start event")),"create.intermediate-event":c("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",s("Create intermediate/boundary event")),"create.end-event":c("bpmn:EndEvent","event","bpmn-icon-end-event-none",s("Create end event")),"create.exclusive-gateway":c("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",s("Create gateway")),"create.task":c("bpmn:Task","activity","bpmn-icon-task",s("Create task")),"create.data-object":c("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",s("Create data object reference")),"create.data-store":c("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",s("Create data store reference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:s("Create expanded sub-process"),action:{dragstart:p,click:p}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:s("Create pool/participant"),action:{dragstart:u,click:u}},"create.group":c("bpmn:Group","artifact","bpmn-icon-group",s("Create group"))}),e};var lx={__depends__:[nx,ei,yu,ix,sx,ux,Hr],__init__:["paletteProvider"],paletteProvider:["type",Vs]};var EA=250;function Ws(e,t,n,r,i){k.call(this,e);function o(s){var c=s.canExecute.replacements;E(c,function(p){var u=p.oldElementId,l={type:p.newElementType};if(!s.visualReplacements[u]){var f=t.get(u);C(l,{x:f.x,y:f.y});var d=n.createShape(l);r.addShape(d,f.parent);var h=me('[data-element-id="'+lr(f.id)+'"]',s.dragGroup);h&&$(h,{display:"none"});var _=i.addDragger(d,s.dragGroup);s.visualReplacements[u]=_,r.removeShape(d)}})}function a(s){var c=s.visualReplacements;E(c,function(p,u){var l=me('[data-element-id="'+lr(u)+'"]',s.dragGroup);l&&$(l,{display:"inline"}),p.remove(),c[u]&&delete c[u]})}e.on("shape.move.move",EA,function(s){var c=s.context,p=c.canExecute;c.visualReplacements||(c.visualReplacements={}),p&&p.replacements?o(c):a(c)})}Ws.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"];N(Ws,k);var fx={__depends__:[xn],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",Ws]};var wA=1250,qf=40,SA=20,CA=10,dx=20,mx=["x","y"],RA=Math.abs;function Uu(e){e.on(["connect.hover","connect.move","connect.end"],wA,function(t){var n=t.context,r=n.canExecute,i=n.start,o=n.hover,a=n.source,s=n.target;t.originalEvent&<(t.originalEvent)||(n.initialConnectionStart||(n.initialConnectionStart=n.connectionStart),r&&o&&PA(t,o,DA(o)),o&&MA(r,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(n.connectionStart=Kt(i),Q(o,["bpmn:Event","bpmn:Gateway"])&&hx(t,Kt(o)),Q(o,["bpmn:Task","bpmn:SubProcess"])&&AA(t,o),m(a,"bpmn:BoundaryEvent")&&s===a.host&&TA(t)):gx(r,"bpmn:MessageFlow")?(m(i,"bpmn:Event")&&(n.connectionStart=Kt(i)),m(o,"bpmn:Event")&&hx(t,Kt(o))):n.connectionStart=n.initialConnectionStart)})}Uu.$inject=["eventBus"];function PA(e,t,n){mx.forEach(function(r){var i=vx(r,t);e[r]t[r]+i-n&&Ie(e,r,t[r]+i-n)})}function AA(e,t){var n=Kt(t);mx.forEach(function(r){kA(e,t,r)&&Ie(e,r,n[r])})}function TA(e){var t=e.context,n=t.source,r=t.target;if(!OA(t)){var i=Kt(n),o=Le(i,r,-10),a=[];/top|bottom/.test(o)&&a.push("x"),/left|right/.test(o)&&a.push("y"),a.forEach(function(s){var c=e[s],p;RA(c-i[s])i[s]?p=i[s]+qf:p=i[s]-qf,Ie(e,s,p))})}}function hx(e,t){Ie(e,"x",t.x),Ie(e,"y",t.y)}function gx(e,t){return e&&e.type===t}function MA(e,t){return Nt(t,function(n){return gx(e,n)})}function vx(e,t){return e==="x"?t.width:t.height}function DA(e){return m(e,"bpmn:Task")?CA:SA}function kA(e,t,n){return e[n]>t[n]+dx&&e[n]=e.x||i&&i<=e.x)&&Ie(e,"x",e.x),(r&&r>=e.y||o&&o<=e.y)&&Ie(e,"y",e.y)}}function _x(e,t){return e.indexOf(t)!==-1}function xx(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}var HA=1250;function Gi(e,t){var n=this;e.on(["resize.start"],function(r){n.initSnap(r)}),e.on(["resize.move","resize.end"],HA,function(r){var i=r.context,o=i.shape,a=o.parent,s=i.direction,c=i.snapContext;if(!(r.originalEvent&<(r.originalEvent))&&!Mn(r)){var p=c.pointsForTarget(a);p.initialized||(p=n.addSnapTargetPoints(p,o,a,s),p.initialized=!0),VA(s)&&Ie(r,"x",r.x),WA(s)&&Ie(r,"y",r.y),t.snap(r,p)}}),e.on(["resize.cleanup"],function(){t.hide()})}Gi.prototype.initSnap=function(e){var t=e.context,n=t.shape,r=t.direction,i=t.snapContext;i||(i=t.snapContext=new In);var o=bx(n,r);return i.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),i};Gi.prototype.addSnapTargetPoints=function(e,t,n,r){var i=this.getSnapTargets(t,n);return E(i,function(o){e.add("corner",Rp(o)),e.add("corner",Cp(o))}),e.add("corner",bx(t,r)),e};Gi.$inject=["eventBus","snapping"];Gi.prototype.getSnapTargets=function(e,t){return Pp(t).filter(function(n){return!$A(n,e)&&!fe(n)&&!zA(n)&&!te(n)})};function bx(e,t){var n=Y(e),r=X(e),i={x:n.x,y:n.y};return t.indexOf("n")!==-1?i.y=r.top:t.indexOf("s")!==-1&&(i.y=r.bottom),t.indexOf("e")!==-1?i.x=r.right:t.indexOf("w")!==-1&&(i.x=r.left),i}function $A(e,t){return e.host===t}function zA(e){return!!e.hidden}function VA(e){return e==="n"||e==="s"}function WA(e){return e==="e"||e==="w"}var GA=7,UA=1e3;function rr(e){this._canvas=e,this._asyncHide=qs(Je(this.hide,this),UA)}rr.$inject=["canvas"];rr.prototype.snap=function(e,t){var n=e.context,r=n.snapContext,i=r.getSnapLocations(),o={x:Mn(e,"x"),y:Mn(e,"y")};E(i,function(a){var s=r.getSnapOrigin(a),c={x:e.x+s.x,y:e.y+s.y};if(E(["x","y"],function(p){var u;o[p]||(u=t.snap(c,a,p,GA),u!==void 0&&(o[p]={value:u,originValue:u-s[p]}))}),o.x&&o.y)return!1}),this.showSnapLine("vertical",o.x&&o.x.value),this.showSnapLine("horizontal",o.y&&o.y.value),E(["x","y"],function(a){var s=o[a];Ce(s)&&Ie(e,a,s.originValue)})};rr.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=G("path");return $(n,{d:"M0,0 L0,0"}),ue(n).add("djs-snap-line"),Z(t,n),{update:function(r){ee(r)?e==="horizontal"?$(n,{d:"M-100000,"+r+" L+100000,"+r,display:""}):$(n,{d:"M "+r+",-100000 L "+r+", +100000",display:""}):$(n,{display:"none"})}}};rr.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}};rr.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()};rr.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]};rr.prototype.hide=function(){E(this._snapLines,function(e){e.update()})};var Ex={__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",un],resizeSnapping:["type",Gi],snapping:["type",rr]};var wx={__depends__:[Ex],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",Uu],createMoveSnapping:["type",si]};var Cx=300;function le(e,t,n,r){this._open=!1,this._results={},this._eventMaps=[],this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._canvas=e,this._eventBus=t,this._selection=n,this._translate=r,this._container=this._getBoxHtml(),this._searchInput=me(le.INPUT_SELECTOR,this._container),this._resultsContainer=me(le.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy","drag.init","elements.changed"],this.close,this)}le.$inject=["canvas","eventBus","selection","translate"];le.prototype._bindEvents=function(){var e=this;function t(n,r,i,o){e._eventMaps.push({el:n,type:i,listener:ut.bind(n,r,i,o)})}t(document,"html","click",function(n){e.close(!1)}),t(this._container,le.INPUT_SELECTOR,"click",function(n){n.stopPropagation(),n.delegateTarget.focus()}),t(this._container,le.RESULT_SELECTOR,"mouseover",function(n){n.stopPropagation(),e._scrollToNode(n.delegateTarget),e._preselect(n.delegateTarget)}),t(this._container,le.RESULT_SELECTOR,"click",function(n){n.stopPropagation(),e._select(n.delegateTarget)}),t(this._container,le.INPUT_SELECTOR,"keydown",function(n){ze("ArrowUp",n)&&n.preventDefault(),ze("ArrowDown",n)&&n.preventDefault()}),t(this._container,le.INPUT_SELECTOR,"keyup",function(n){if(ze("Escape",n))return e.close();if(ze("Enter",n)){var r=e._getCurrentResult();return r?e._select(r):e.close(!1)}if(ze("ArrowUp",n))return e._scrollToDirection(!0);if(ze("ArrowDown",n))return e._scrollToDirection();ze(["ArrowLeft","ArrowRight"],n)||e._search(n.delegateTarget.value)})};le.prototype._unbindEvents=function(){this._eventMaps.forEach(function(e){ut.unbind(e.el,e.type,e.listener)})};le.prototype._search=function(e){var t=this;if(this._clearResults(),!!e.trim()){var n=this._searchProvider.find(e);if(n=n.filter(function(i){return!t._canvas.getRootElements().includes(i.element)}),!n.length){this._selection.select(null);return}n.forEach(function(i){var o=i.element.id,a=t._createResultNode(i,o);t._results[o]={element:i.element,node:a}});var r=me(le.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(r),this._preselect(r)}};le.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}};le.prototype._scrollToNode=function(e){if(!(!e||e===this._getCurrentResult())){var t=e.offsetTop,n=this._resultsContainer.scrollTop,r=t-this._resultsContainer.clientHeight+e.clientHeight;t0&&Sx(n,e.primaryTokens,le.RESULT_PRIMARY_HTML),Sx(n,e.secondaryTokens,le.RESULT_SECONDARY_HTML),Ye(n,le.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n};le.prototype.registerProvider=function(e){this._searchProvider=e};le.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._cachedRootElement=this._canvas.getRootElement(),this._cachedSelection=this._selection.get(),this._cachedViewbox=this._canvas.viewbox(),this._selection.select(null),this._bindEvents(),this._open=!0,Ae(this._canvas.getContainer()).add("djs-search-open"),Ae(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))};le.prototype.close=function(e=!0){this.isOpen()&&(e&&(this._cachedRootElement&&this._canvas.setRootElement(this._cachedRootElement),this._cachedSelection&&this._selection.select(this._cachedSelection),this._cachedViewbox&&this._canvas.viewbox(this._cachedViewbox),this._eventBus.fire("searchPad.restored")),this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._unbindEvents(),this._open=!1,Ae(this._canvas.getContainer()).remove("djs-search-open"),Ae(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._eventBus.fire("searchPad.closed"),this._canvas.restoreFocus())};le.prototype.toggle=function(){this.isOpen()?this.close():this.open()};le.prototype.isOpen=function(){return this._open};le.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&Ae(t).remove(le.RESULT_SELECTED_CLASS);var n=Ye(e,le.RESULT_ID_ATTRIBUTE),r=this._results[n].element;Ae(e).add(le.RESULT_SELECTED_CLASS),this._canvas.scrollToElement(r,{top:Cx}),this._selection.select(r),this._eventBus.fire("searchPad.preselected",r)}};le.prototype._select=function(e){var t=Ye(e,le.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this._cachedSelection=null,this._cachedViewbox=null,this.close(!1),this._canvas.scrollToElement(n,{top:Cx}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)};le.prototype._getBoxHtml=function(){let e=ye(le.BOX_HTML),t=me(le.INPUT_SELECTOR,e);return t&&t.setAttribute("aria-label",this._translate("Search in diagram")),e};function Sx(e,t,n){var r=KA(t),i=ye(n);i.innerHTML=r,e.appendChild(i)}function KA(e){var t="";return e.forEach(function(n){var r=Cc(n.value||n.matched||n.normal),i=n.match||n.matched;i?t+=''+r+"":t+=r}),t!==""?t:null}le.CONTAINER_SELECTOR=".djs-search-container";le.INPUT_SELECTOR=".djs-search-input input";le.RESULTS_CONTAINER_SELECTOR=".djs-search-results";le.RESULT_SELECTOR=".djs-search-result";le.RESULT_SELECTED_CLASS="djs-search-result-selected";le.RESULT_SELECTED_SELECTOR="."+le.RESULT_SELECTED_CLASS;le.RESULT_ID_ATTRIBUTE="data-result-id";le.RESULT_HIGHLIGHT_CLASS="djs-search-highlight";le.BOX_HTML=`
      + `},ad=LT;k();var jT=900;function Zi(e,t,n,r){this._distributeElements=t,this._translate=n,this._popupMenu=e,this._rules=r,e.registerProvider("align-elements",jT,this)}Zi.$inject=["popupMenu","distributeElements","translate","rules"];Zi.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&C(t,this._getEntries(e)),t};Zi.prototype._isAllowed=function(e){return this._rules.allowed("elements.distribute",{elements:e})};Zi.prototype._getEntries=function(e){var t=this._distributeElements,n=this._translate,r=this._popupMenu,i={"distribute-elements-horizontal":{group:"distribute",title:n("Distribute elements horizontally"),className:"bjs-align-elements-menu-entry",imageHtml:ad.horizontal,action:function(o,a){t.trigger(e,"horizontal"),r.close()}},"distribute-elements-vertical":{group:"distribute",title:n("Distribute elements vertically"),imageHtml:ad.vertical,action:function(o,a){t.trigger(e,"vertical"),r.close()}}};return i};var vb={__depends__:[Po,hb],__init__:["bpmnDistributeElements","distributeElementsMenuProvider"],bpmnDistributeElements:["type",la],distributeElementsMenuProvider:["type",Zi]};k();var gb="is not a registered action",FT="is already registered";function Yt(e,t){this._actions={};var n=this;e.on("diagram.init",function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})})}Yt.$inject=["eventBus","injector"];Yt.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),n=e.get("modeling",!1),r=e.get("selection",!1),i=e.get("zoomScroll",!1),o=e.get("copyPaste",!1),a=e.get("canvas",!1),s=e.get("rules",!1),c=e.get("keyboardMove",!1),u=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",function(){t.undo()}),this.register("redo",function(){t.redo()})),o&&r&&this.register("copy",function(){var p=r.get();if(p.length)return o.copy(p)}),o&&r&&this.register("duplicate",function(){var p=r.get();if(p.length)return o.duplicate(p)}),o&&this.register("paste",function(){o.paste()}),o&&r&&s&&this.register("cut",function(){var p=r.get();if(p.length){var l=s.allowed("elements.delete",{elements:p});if(l!==!1){var f=q(l)?l:p;return o.cut(f.slice())}}}),i&&this.register("stepZoom",function(p){i.stepZoom(p.value)}),a&&this.register("zoom",function(p){a.zoom(p.value)}),n&&r&&s&&this.register("removeSelection",function(){var p=r.get();if(p.length){var l=s.allowed("elements.delete",{elements:p}),f;l!==!1&&(q(l)?f=l:f=p,f.length&&n.removeElements(f.slice()))}}),c&&this.register("moveCanvas",function(p){c.moveCanvas(p)}),u&&this.register("moveSelection",function(p){u.moveSelection(p.direction,p.accelerated)})};Yt.prototype.trigger=function(e,t){if(!this._actions[e])throw sd(e,gb);return this._actions[e](t)};Yt.prototype.register=function(e,t){var n=this;if(typeof e=="string")return this._registerAction(e,t);E(e,function(r,i){n._registerAction(i,r)})};Yt.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw sd(e,FT);this._actions[e]=t};Yt.prototype.unregister=function(e){if(!this.isRegistered(e))throw sd(e,gb);this._actions[e]=void 0};Yt.prototype.getActions=function(){return Object.keys(this._actions)};Yt.prototype.isRegistered=function(e){return!!this._actions[e]};function sd(e,t){return new Error(e+" "+t)}var yb={__init__:["editorActions"],editorActions:["type",Yt]};k();function fa(e){e.invoke(Yt,this)}B(fa,Yt);fa.$inject=["injector"];fa.prototype._registerDefaultActions=function(e){Yt.prototype._registerDefaultActions.call(this,e);var t=e.get("canvas",!1),n=e.get("elementRegistry",!1),r=e.get("selection",!1),i=e.get("spaceTool",!1),o=e.get("lassoTool",!1),a=e.get("handTool",!1),s=e.get("globalConnect",!1),c=e.get("distributeElements",!1),u=e.get("alignElements",!1),p=e.get("directEditing",!1),l=e.get("searchPad",!1),f=e.get("modeling",!1),d=e.get("contextPad",!1);t&&n&&r&&this._registerAction("selectElements",function(){var m=t.getRootElement(),y=n.filter(function(v){return v!==m});return r.select(y),y}),i&&this._registerAction("spaceTool",function(){i.toggle()}),o&&this._registerAction("lassoTool",function(){o.toggle()}),a&&this._registerAction("handTool",function(){a.toggle()}),s&&this._registerAction("globalConnectTool",function(){s.toggle()}),r&&c&&this._registerAction("distributeElements",function(m){var y=r.get(),v=m.type;y.length&&c.trigger(y,v)}),r&&u&&this._registerAction("alignElements",function(m){var y=r.get(),v=[],w=m.type;y.length&&(v=J(y,function(R){return!h(R,"bpmn:Lane")}),u.trigger(v,w))}),r&&f&&this._registerAction("setColor",function(m){var y=r.get();y.length&&f.setColor(y,m)}),r&&p&&this._registerAction("directEditing",function(){var m=r.get();m.length&&p.activate(m[0])}),l&&this._registerAction("find",function(){l.toggle()}),t&&f&&this._registerAction("moveToOrigin",function(){var m=t.getRootElement(),y,v;h(m,"bpmn:Collaboration")?v=n.filter(function(w){return h(w.parent,"bpmn:Collaboration")}):v=n.filter(function(w){return w!==m&&!h(w.parent,"bpmn:SubProcess")}),y=Se(v),f.moveElements(v,{x:-y.x,y:-y.y},m)}),r&&d&&this._registerAction("replaceElement",function(m){d.triggerEntry("replace","click",m)})};var _b={__depends__:[yb],editorActions:["type",fa]};function Hp(e){e.on(["create.init","shape.move.init"],function(t){var n=t.context,r=t.shape;ee(r,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}Hp.$inject=["eventBus"];k();var Js=10;function $p(e,t,n){return n||(n="round"),Math[n](e/t)*t}var HT=1200,$T=800;function fr(e,t,n){var r=!n||n.active!==!1;this._eventBus=t;var i=this;t.on("diagram.init",$T,function(){i.setActive(r)}),t.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],HT,function(o){var a=o.originalEvent;if(!(!i.active||a&>(a))){var s=o.context,c=s.gridSnappingContext;c||(c=s.gridSnappingContext={}),["x","y"].forEach(function(u){var p={},l=GT(o,u,e);l&&(p.offset=l);var f=zT(o,u);f&&C(p,f),Hn(o,u)||i.snapEvent(o,u,p)})}})}fr.prototype.snapEvent=function(e,t,n){var r=this.snapValue(e[t],n);je(e,t,r)};fr.prototype.getGridSpacing=function(){return Js};fr.prototype.snapValue=function(e,t){var n=0;t&&t.offset&&(n=t.offset),e+=n,e=$p(e,Js);var r,i;return t&&t.min&&(r=t.min,te(r)&&(r=$p(r+n,Js,"ceil"),e=Math.max(e,r))),t&&t.max&&(i=t.max,te(i)&&(i=$p(i+n,Js,"floor"),e=Math.min(e,i))),e-=n,e};fr.prototype.isActive=function(){return this.active};fr.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})};fr.prototype.toggleActive=function(){this.setActive(!this.active)};fr.$inject=["elementRegistry","eventBus","config.gridSnapping"];function zT(e,t){var n=e.context,r=n.createConstraints,i=n.resizeConstraints||{},o=n.gridSnappingContext,a=o.snapConstraints;if(a&&a[t])return a[t];a||(a=o.snapConstraints={}),a[t]||(a[t]={});var s=n.direction;r&&(zp(t)?(a.x.min=r.left,a.x.max=r.right):(a.y.min=r.top,a.y.max=r.bottom));var c=i.min,u=i.max;return c&&(zp(t)?xb(s)?a.x.max=c.left:a.x.min=c.right:bb(s)?a.y.max=c.top:a.y.min=c.bottom),u&&(zp(t)?xb(s)?a.x.min=u.left:a.x.max=u.right:bb(s)?a.y.min=u.top:a.y.max=u.bottom),a[t]}function GT(e,t,n){var r=e.context,i=e.shape,o=r.gridSnappingContext,a=o.snapLocation,s=o.snapOffset;return s&&te(s[t])||(s||(s=o.snapOffset={}),te(s[t])||(s[t]=0),!i)||(n.get(i.id)||(zp(t)?s[t]+=i[t]+i.width/2:s[t]+=i[t]+i.height/2),!a)||(t==="x"?/left/.test(a)?s[t]-=i.width/2:/right/.test(a)&&(s[t]+=i.width/2):/top/.test(a)?s[t]-=i.height/2:/bottom/.test(a)&&(s[t]+=i.height/2)),s[t]}function zp(e){return e==="x"}function bb(e){return e.indexOf("n")!==-1}function xb(e){return e.indexOf("w")!==-1}k();function Or(e,t){N.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",function(r){var i=r.context,o=i.hints||{},a=o.autoResize;if(a){var s=i.shape,c=i.newBounds;it(a)?i.newBounds=n.snapComplex(c,a):i.newBounds=n.snapSimple(s,c)}})}Or.$inject=["eventBus","gridSnapping","modeling"];B(Or,N);Or.prototype.snapSimple=function(e,t){var n=this._gridSnapping;return t.width=n.snapValue(t.width,{min:t.width}),t.height=n.snapValue(t.height,{min:t.height}),t.x=e.x+e.width/2-t.width/2,t.y=e.y+e.height/2-t.height/2,t};Or.prototype.snapComplex=function(e,t){return/w|e/.test(t)&&(e=this.snapHorizontally(e,t)),/n|s/.test(t)&&(e=this.snapVertically(e,t)),e};Or.prototype.snapHorizontally=function(e,t){var n=this._gridSnapping,r=/w/.test(t),i=/e/.test(t),o={};return o.width=n.snapValue(e.width,{min:e.width}),i&&(r?(o.x=n.snapValue(e.x,{max:e.x}),o.width+=n.snapValue(e.x-o.x,{min:e.x-o.x})):e.x=e.x+e.width-o.width),C(e,o),e};Or.prototype.snapVertically=function(e,t){var n=this._gridSnapping,r=/n/.test(t),i=/s/.test(t),o={};return o.height=n.snapValue(e.height,{min:e.height}),r&&(i?(o.y=n.snapValue(e.y,{max:e.y}),o.height+=n.snapValue(e.y-o.y,{min:e.y-o.y})):e.y=e.y+e.height-o.height),C(e,o),e};var VT=2e3;function Gp(e,t){e.on(["spaceTool.move","spaceTool.end"],VT,function(n){var r=n.context;if(r.initialized){var i=r.axis,o;i==="x"?(o=t.snapValue(n.dx),n.x=n.x+o-n.dx,n.dx=o):(o=t.snapValue(n.dy),n.y=n.y+o-n.dy,n.dy=o)}})}Gp.$inject=["eventBus","gridSnapping"];var Eb={__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",Or],gridSnappingSpaceToolBehavior:["type",Gp]};var wb={__depends__:[Eb],__init__:["gridSnapping"],gridSnapping:["type",fr]};var WT=2e3;function Vp(e,t,n){e.on("autoPlace",WT,function(r){var i=r.source,o=Y(i),a=r.shape,s=Pu(i,a,n);return["x","y"].forEach(function(c){var u={};s[c]!==o[c]&&(s[c]>o[c]?u.min=s[c]:u.max=s[c],h(a,"bpmn:TextAnnotation")&&(UT(c)?u.offset=-a.width/2:u.offset=-a.height/2),s[c]=t.snapValue(s[c],u))}),s})}Vp.$inject=["eventBus","gridSnapping","elementRegistry"];function UT(e){return e==="x"}var qT=1750;function Wp(e,t,n){t.on(["create.start","shape.move.start"],qT,function(r){var i=r.context,o=i.shape,a=e.getRootElement();if(!(!h(o,"bpmn:Participant")||!h(a,"bpmn:Process")||!a.children.length)){var s=i.createConstraints;s&&(o.width=n.snapValue(o.width,{min:o.width}),o.height=n.snapValue(o.height,{min:o.height}))}})}Wp.$inject=["canvas","eventBus","gridSnapping"];k();var KT=3e3;function da(e,t,n){N.call(this,e),this._gridSnapping=t;var r=this;this.postExecuted(["connection.create","connection.layout"],KT,function(i){var o=i.context,a=o.connection,s=o.hints||{},c=a.waypoints;s.connectionStart||s.connectionEnd||s.createElementsBehavior===!1||YT(c)&&n.updateWaypoints(a,r.snapMiddleSegments(c))})}da.$inject=["eventBus","gridSnapping","modeling"];B(da,N);da.prototype.snapMiddleSegments=function(e){var t=this._gridSnapping,n;e=e.slice();for(var r=1;r3}function XT(e){return e==="h"}function ZT(e){return e==="v"}function QT(e,t,n){var r=Jt(t,n),i={};return XT(r)&&(i.y=e.snapValue(t.y)),ZT(r)&&(i.x=e.snapValue(t.x)),("x"in i||"y"in i)&&(t=C({},t,i),n=C({},n,i)),[t,n]}var Sb={__init__:["gridSnappingAutoPlaceBehavior","gridSnappingParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",Vp],gridSnappingParticipantBehavior:["type",Wp],gridSnappingLayoutConnectionBehavior:["type",da]};var Cb={__depends__:[wb,Sb],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",Hp]};var JT=30,Rb=30;function Qi(e,t){this._interactionEvents=t;var n=this;e.on(["interactionEvents.createHit","interactionEvents.updateHit"],function(r){var i=r.element,o=r.gfx;if(h(i,"bpmn:Lane"))return n._createParticipantHit(i,o);if(h(i,"bpmn:Participant"))return oe(i)?n._createParticipantHit(i,o):n._createDefaultHit(i,o);if(h(i,"bpmn:SubProcess"))return oe(i)?n._createSubProcessHit(i,o):n._createDefaultHit(i,o)})}Qi.$inject=["eventBus","interactionEvents"];Qi.prototype._createDefaultHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createDefaultHit(e,t),!0};Qi.prototype._createParticipantHit=function(e,t){this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height});var n=Pe(e)?{width:JT,height:e.height}:{width:e.width,height:Rb};return this._interactionEvents.createBoxHit(t,"all",n),!0};Qi.prototype._createSubProcessHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:e.width,height:Rb}),!0};var Pb={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",Qi]};function ma(e){e.invoke(Pr,this)}B(ma,Pr);ma.$inject=["injector"];ma.prototype.registerBindings=function(e,t){Pr.prototype.registerBindings.call(this,e,t);function n(r,i){t.isRegistered(r)&&e.addListener(i)}n("selectElements",function(r){var i=r.keyEvent;if(e.isKey(["a","A"],i)&&e.isCmd(i))return t.trigger("selectElements"),!0}),n("find",function(r){var i=r.keyEvent;if(e.isKey(["f","F"],i)&&e.isCmd(i))return t.trigger("find"),!0}),n("spaceTool",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["s","S"],i))return t.trigger("spaceTool"),!0}),n("lassoTool",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["l","L"],i))return t.trigger("lassoTool"),!0}),n("handTool",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["h","H"],i))return t.trigger("handTool"),!0}),n("globalConnectTool",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["c","C"],i))return t.trigger("globalConnectTool"),!0}),n("directEditing",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["e","E"],i))return t.trigger("directEditing"),!0}),n("replaceElement",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["r","R"],i))return t.trigger("replaceElement",i),!0})};var Ab={__depends__:[bo],__init__:["keyboardBindings"],keyboardBindings:["type",ma]};k();var eD={moveSpeed:1,moveSpeedAccelerated:10},tD=1500,Tb="left",Db="up",Mb="right",kb="down",nD={ArrowLeft:Tb,Left:Tb,ArrowUp:Db,Up:Db,ArrowRight:Mb,Right:Mb,ArrowDown:kb,Down:kb},rD={left:function(e){return{x:-e,y:0}},up:function(e){return{x:0,y:-e}},right:function(e){return{x:e,y:0}},down:function(e){return{x:0,y:e}}};function Up(e,t,n,r,i){var o=this;this._config=C({},eD,e||{}),t.addListener(tD,function(a){var s=a.keyEvent,c=nD[s.key];if(c&&!t.isCmd(s)){var u=t.isShift(s);return o.moveSelection(c,u),!0}}),this.moveSelection=function(a,s){var c=i.get();if(c.length){var u=this._config[s?"moveSpeedAccelerated":"moveSpeed"],p=rD[a](u),l=r.allowed("elements.move",{shapes:c,hints:{keyboardMove:!0}});l&&n.moveElements(c,p)}}}Up.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];var Nb={__depends__:[bo,et],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",Up]};k();var Ob=10;function Ji(e,t,n,r){this._dragging=r,this._rules=t;var i=this;function o(c,u){var p=c.shape,l=c.direction,f=c.resizeConstraints,d;c.delta=u,d=kg(p,l,u),c.newBounds=Og(d,f),c.canExecute=i.canResize(c)}function a(c){var u=c.resizeConstraints,p=c.minBounds;u===void 0&&(p===void 0&&(p=i.computeMinResizeBox(c)),c.resizeConstraints={min:Z(p)})}function s(c){var u=c.shape,p=c.canExecute,l=c.newBounds;if(p){if(l=bc(l),!iD(u,l))return;n.resizeShape(u,l)}}e.on("resize.start",function(c){a(c.context)}),e.on("resize.move",function(c){var u={x:c.dx,y:c.dy};o(c.context,u)}),e.on("resize.end",function(c){s(c.context)})}Ji.prototype.canResize=function(e){var t=this._rules,n=lt(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)};Ji.prototype.activate=function(e,t,n){var r=this._dragging,i,o;if(typeof n=="string"&&(n={direction:n}),i=C({shape:t},n),o=i.direction,!o)throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");r.init(e,cd(t,o),"resize",{autoActivate:!0,cursor:oD(o),data:{shape:t,context:i}})};Ji.prototype.computeMinResizeBox=function(e){var t=e.shape,n=e.direction,r,i;return r=e.minDimensions||{width:Ob,height:Ob},i=ep(t,e.childrenBoxPadding),Bg(n,t,r,i)};Ji.$inject=["eventBus","rules","modeling","dragging"];function iD(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function cd(e,t){var n=Y(e),r=Z(e),i={x:n.x,y:n.y};return t.indexOf("n")!==-1?i.y=r.top:t.indexOf("s")!==-1&&(i.y=r.bottom),t.indexOf("e")!==-1?i.x=r.right:t.indexOf("w")!==-1&&(i.x=r.left),i}function oD(e){var t="resize-";return e==="n"||e==="s"?t+"ns":e==="e"||e==="w"?t+"ew":e==="nw"||e==="se"?t+"nwse":t+"nesw"}var Bb="djs-resizing",Ib="resize-not-ok",aD=500;function qp(e,t,n){function r(o){var a=o.shape,s=o.newBounds,c=o.frame;c||(c=o.frame=n.addFrame(a,t.getActiveLayer()),t.addMarker(a,Bb)),s.width>5&&z(c,{x:s.x,width:s.width}),s.height>5&&z(c,{y:s.y,height:s.height}),o.canExecute?fe(c).remove(Ib):fe(c).add(Ib)}function i(o){var a=o.shape,s=o.frame;s&&we(o.frame),t.removeMarker(a,Bb)}e.on("resize.move",aD,function(o){r(o.context)}),e.on("resize.cleanup",function(o){i(o.context)})}qp.$inject=["eventBus","canvas","previewSupport"];k();var Kp=-6,Yp=8,Xp=20,ec="djs-resizer",sD=["n","w","s","e","nw","ne","se","sw"];function dr(e,t,n,r){this._resize=r,this._canvas=t;var i=this;e.on("selection.changed",function(o){var a=o.newSelection;i.removeResizers(),a.length===1&&E(a,Qe(i.addResizer,i))}),e.on("shape.changed",function(o){var a=o.element;n.isSelected(a)&&(i.removeResizers(),i.addResizer(a))})}dr.prototype.makeDraggable=function(e,t,n){var r=this._resize;function i(o){vn(o)&&r.activate(o,e,n)}se.bind(t,"mousedown",i),se.bind(t,"touchstart",i)};dr.prototype._createResizer=function(e,t,n,r){var i=this._getResizersParent(),o=cD(r),a=U("g");fe(a).add(ec),fe(a).add(ec+"-"+e.id),fe(a).add(ec+"-"+r),Q(i,a);var s=U("rect");z(s,{x:-Yp/2+o.x,y:-Yp/2+o.y,width:Yp,height:Yp}),fe(s).add(ec+"-visual"),Q(a,s);var c=U("rect");return z(c,{x:-Xp/2+o.x,y:-Xp/2+o.y,width:Xp,height:Xp}),fe(c).add(ec+"-hit"),Q(a,c),co(a,t,n),a};dr.prototype.createResizer=function(e,t){var n=cd(e,t),r=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,r,t)};dr.prototype.addResizer=function(e){var t=this;me(e)||!this._resize.canResize({shape:e})||E(sD,function(n){t.createResizer(e,n)})};dr.prototype.removeResizers=function(){var e=this._getResizersParent();gr(e)};dr.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")};dr.$inject=["eventBus","canvas","selection","resize"];function cD(e){var t={x:0,y:0};return e.indexOf("e")!==-1?t.x=-Kp:e.indexOf("w")!==-1&&(t.x=Kp),e.indexOf("s")!==-1?t.y=-Kp:e.indexOf("n")!==-1&&(t.y=Kp),t}var Zp={__depends__:[yt,Dt,Tn],__init__:["resize","resizePreview","resizeHandles"],resize:["type",Ji],resizePreview:["type",qp],resizeHandles:["type",dr]};k();var uD=2e3;function eo(e,t,n,r,i,o,a){this._bpmnFactory=t,this._canvas=n,this._modeling=i,this._textRenderer=a,r.registerProvider(this),e.on("element.dblclick",function(c){s(c.element,!0)}),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open","root.set","selection.changed"],function(){r.isActive()&&r.complete()}),e.on(["shape.remove","connection.remove"],uD,function(c){r.isActive(c.element)&&r.cancel()}),e.on(["commandStack.changed"],function(c){r.isActive()&&r.cancel()}),e.on("directEditing.activate",function(c){o.removeResizers()}),e.on("create.end",500,function(c){var u=c.context,p=u.shape,l=c.context.canExecute,f=c.isTouch;f||l&&(u.hints&&u.hints.createElementsBehavior===!1||s(p))}),e.on("autoPlace.end",500,function(c){s(c.shape)});function s(c,u){(u||ee(c,["bpmn:Task","bpmn:TextAnnotation","bpmn:Participant"])||ud(c))&&r.activate(c)}}eo.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"];eo.prototype.activate=function(e){var t=Pt(e);if(t!==void 0){var n={text:t},r=this.getEditingBBox(e);C(n,r);var i={},o=n.style||{};return C(o,{backgroundColor:null,border:null}),(ee(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||ud(e))&&C(i,{centerVertically:!0}),dn(e)&&(C(i,{autoResize:!0}),C(o,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),h(e,"bpmn:TextAnnotation")&&(C(i,{resizable:!0,autoResize:!0}),C(o,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),C(n,{options:i,style:o}),n}};eo.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,r=t.getAbsoluteBBox(n),i={x:r.x+r.width/2,y:r.y+r.height/2},o={x:r.x,y:r.y},a=t.zoom(),s=this._textRenderer.getDefaultStyle(),c=this._textRenderer.getExternalStyle(),u=c.fontSize*a,p=c.lineHeight,l=s.fontSize*a,f=s.lineHeight,d={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};if(h(e,"bpmn:Lane")||fD(e)){var m=Pe(e),y=m?{width:r.height,height:30*a,x:r.x-r.height/2+15*a,y:i.y-30*a/2}:{width:r.width,height:30*a};C(o,y),C(d,{fontSize:l+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px",transform:m?"rotate(-90deg)":null})}if(lD(e)){var v=Pe(e),w=v?{width:r.width,height:r.height}:{width:r.height,height:r.width,x:i.x-r.height/2,y:i.y-r.width/2};C(o,w),C(d,{fontSize:l+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px",transform:v?null:"rotate(-90deg)"})}(ee(e,["bpmn:Task","bpmn:CallActivity"])||ud(e))&&(C(o,{width:r.width,height:r.height}),C(d,{fontSize:l+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"})),pD(e)&&(C(o,{width:r.width,x:r.x}),C(d,{fontSize:l+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"}));var R=90*a,x=7*a,b=4*a;if(n.labelTarget&&(C(o,{width:R,height:r.height+x+b,x:i.x-R/2,y:r.y-x}),C(d,{fontSize:u+"px",lineHeight:p,paddingTop:x+"px",paddingBottom:b+"px"})),dn(n)&&!Kr(n)&&!ne(n)){var S=ka(e),A=t.getAbsoluteBBox({x:S.x,y:S.y,width:0,height:0}),O=u+x+b;C(o,{width:R,height:O,x:A.x-R/2,y:A.y-O/2}),C(d,{fontSize:u+"px",lineHeight:p,paddingTop:x+"px",paddingBottom:b+"px"})}return h(e,"bpmn:TextAnnotation")&&(C(o,{width:r.width,height:r.height,minWidth:30*a,minHeight:10*a}),C(d,{textAlign:"left",paddingTop:5*a+"px",paddingBottom:7*a+"px",paddingLeft:7*a+"px",paddingRight:5*a+"px",fontSize:l+"px",lineHeight:f})),{bounds:o,style:d}};eo.prototype.update=function(e,t,n,r){var i,o;h(e,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(e),i={x:e.x,y:e.y,width:e.width/o.width*r.width,height:e.height/o.height*r.height}),dD(t)&&(t=null),this._modeling.updateLabel(e,t,i)};function ud(e){return h(e,"bpmn:SubProcess")&&!oe(e)}function pD(e){return h(e,"bpmn:SubProcess")&&oe(e)}function lD(e){return h(e,"bpmn:Participant")&&!oe(e)}function fD(e){return h(e,"bpmn:Participant")&&oe(e)}function dD(e){return!e||!e.trim()}var Lb="djs-element-hidden",jb="djs-label-hidden";function Qp(e,t,n){var r=this,i=t.getDefaultLayer(),o,a,s;e.on("directEditing.activate",function(c){var u=c.active;if(o=u.element.label||u.element,h(o,"bpmn:TextAnnotation")){a=t.getAbsoluteBBox(o),s=U("g");var p=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:o.height,position:{mx:0,my:0}}),l=r.path=U("path");z(l,{d:p,strokeWidth:2,stroke:mD(o)}),Q(s,l),Q(i,s),Be(s,o.x,o.y)}h(o,"bpmn:TextAnnotation")||o.labelTarget?t.addMarker(o,Lb):(h(o,"bpmn:Task")||h(o,"bpmn:CallActivity")||h(o,"bpmn:SubProcess")||h(o,"bpmn:Participant")||h(o,"bpmn:Lane"))&&t.addMarker(o,jb)}),e.on("directEditing.resize",function(c){if(h(o,"bpmn:TextAnnotation")){var u=c.height,p=c.dy,l=Math.max(o.height/a.height*(u+p),0),f=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:l,position:{mx:0,my:0}});z(r.path,{d:f})}}),e.on(["directEditing.complete","directEditing.cancel"],function(c){var u=c.active;u&&(t.removeMarker(u.element.label||u.element,Lb),t.removeMarker(o,jb)),o=void 0,a=void 0,s&&(we(s),s=void 0)})}Qp.$inject=["eventBus","canvas","pathMap"];function mD(e,t){var n=ce(e);return n.get("stroke")||t||"black"}var Fb={__depends__:[yo,Zp,Fp],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",eo],labelEditingPreview:["type",Qp]};k();var hD=500,vD=1e3;function Br(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),r=this;function i(o){var a=U("rect");return z(a,C({x:0,y:0,rx:4,width:100,height:100},n)),a}e.on(["shape.added","shape.changed"],hD,function(o){var a=o.element,s=o.gfx,c=ge(".djs-outline",s);c||(c=r.getOutline(a)||i(s),Q(s,c)),r.updateShapeOutline(c,a)}),e.on(["connection.added","connection.changed"],function(o){var a=o.element,s=o.gfx,c=ge(".djs-outline",s);c||(c=i(s),Q(s,c)),r.updateConnectionOutline(c,a)})}Br.prototype.updateShapeOutline=function(e,t){var n=!1,r=this._getProviders();r.length&&E(r,function(i){n=n||i.updateOutline(t,e)}),n||z(e,{x:-this.offset,y:-this.offset,width:t.width+this.offset*2,height:t.height+this.offset*2})};Br.prototype.updateConnectionOutline=function(e,t){var n=Se(t);z(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+this.offset*2,height:n.height+this.offset*2})};Br.prototype.registerProvider=function(e,t){t||(t=e,e=vD),this._eventBus.on("outline.getProviders",e,function(n){n.providers.push(t)})};Br.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers};Br.prototype.getOutline=function(e){var t,n=this._getProviders();return E(n,function(r){Ne(r.getOutline)&&(t=t||r.getOutline(e))}),t};Br.$inject=["eventBus","styles","elementRegistry"];k();var Jp=6;function tc(e,t,n){this._canvas=t;var r=this;e.on("element.changed",function(i){n.isSelected(i.element)&&r._updateMultiSelectionOutline(n.get())}),e.on("selection.changed",function(i){var o=i.newSelection;r._updateMultiSelectionOutline(o)})}tc.prototype._updateMultiSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");gr(t);var n=e.length>1,r=this._canvas.getContainer();if(fe(r)[n?"add":"remove"]("djs-multi-select"),!!n){var i=gD(Se(e)),o=U("rect");z(o,C({rx:3},i)),fe(o).add("djs-selection-outline"),Q(t,o)}};tc.$inject=["eventBus","canvas","selection"];function gD(e){return{x:e.x-Jp,y:e.y-Jp,width:e.width+Jp*2,height:e.height+Jp*2}}var ha={__depends__:[et],__init__:["outline","multiSelectionOutline"],outline:["type",Br],multiSelectionOutline:["type",tc]};var Hb=["bpmn:Event","bpmn:SequenceFlow","bpmn:Gateway"],$b={class:"bjs-label-link",stroke:"var(--element-selected-outline-secondary-stroke-color)",strokeDasharray:"5, 5"},yD=15,el=2;function tl(e,t,n,r,i){let o=t.getLayer("overlays");e.on(["selection.changed","shape.changed"],function(){s()}),e.on("selection.changed",function({newSelection:l}){var d;let f=l.filter(m=>ee(m,Hb));if(f.length===1){let m=f[0];ne(m)?a(m,m.labelTarget,l):(d=m.labels)!=null&&d.length&&a(m.labels[0],m,l)}if(f.length===2){let m=f.find(ne),y=f.find(v=>{var w;return(w=v.labels)==null?void 0:w.includes(m)});m&&y&&a(m,y,l)}}),e.on("shape.changed",function({element:l}){var f;!ee(l,Hb)||!p(l)||(ne(l)?a(l,l.labelTarget,i.get()):(f=l.labels)!=null&&f.length&&a(l.labels[0],l,i.get()))});function a(l,f,d=[]){let m=Kn([Y(f),Y(l)],$b),y=m.getAttribute("d"),w=d.includes(l)?c(l):u(l),R=Wr(w,y);if(!R)return;let b=d.includes(f)?c(f):u(f),S=Wr(b,y)||Y(f);ki(S,R)');return dt(t,{position:"absolute",width:"0",height:"0"}),e.insertBefore(t,e.firstChild),t}function xD(e,t,n){dt(e,{left:t+"px",top:n+"px"})}function ld(e,t){e.style.display=t===!1?"none":""}var Gb="djs-tooltip",pd="."+Gb;function Ot(e,t){this._eventBus=e,this._canvas=t,this._ids=_D,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=bD(t.getContainer());var n=this;vt.bind(this._tooltipRoot,pd,"mousedown",function(r){r.stopPropagation()}),vt.bind(this._tooltipRoot,pd,"mouseover",function(r){n.trigger("mouseover",r)}),vt.bind(this._tooltipRoot,pd,"mouseout",function(r){n.trigger("mouseout",r)}),this._init()}Ot.$inject=["eventBus","canvas"];Ot.prototype.add=function(e){if(!e.position)throw new Error("must specifiy tooltip position");if(!e.html)throw new Error("must specifiy tooltip html");var t=this._ids.next();return e=C({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t};Ot.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,r=this.get(Je(n,"data-tooltip-id"));r&&(e==="mouseover"&&r.timeout&&this.clearTimeout(r),e==="mouseout"&&r.timeout&&(r.timeout=1e3,this.setTimeout(r)))};Ot.prototype.get=function(e){return typeof e!="string"&&(e=e.id),this._tooltips[e]};Ot.prototype.clearTimeout=function(e){if(e=this.get(e),!!e){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}};Ot.prototype.setTimeout=function(e){if(e=this.get(e),!!e){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout(function(){t.remove(e)},e.timeout)}};Ot.prototype.remove=function(e){var t=this.get(e);t&&(Gt(t.html),Gt(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])};Ot.prototype.show=function(){ld(this._tooltipRoot)};Ot.prototype.hide=function(){ld(this._tooltipRoot,!1)};Ot.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1,r="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._tooltipRoot.style.transform=r,this._tooltipRoot.style["-ms-transform"]=r};Ot.prototype._addTooltip=function(e){var t=e.id,n=e.html,r,i=this._tooltipRoot;n.get&&n.constructor.prototype.jquery&&(n=n.get(0)),it(n)&&(n=ue(n)),r=ue('
      '),dt(r,{position:"absolute"}),r.appendChild(n),e.type&&Te(r).add("djs-tooltip-"+e.type),e.className&&Te(r).add(e.className),e.htmlContainer=r,i.appendChild(r),this._tooltips[t]=e,this._updateTooltip(e)};Ot.prototype._updateTooltip=function(e){var t=e.position,n=e.htmlContainer;xD(n,t.x,t.y)};Ot.prototype._updateTooltipVisibilty=function(e){E(this._tooltips,function(t){var n=t.show,r=t.htmlContainer,i=!0;n&&((n.minZoom>e.scale||n.maxZoom"+o+"
      "})}e.on(["shape.move.rejected","create.rejected"],function(i){var o=i.context,a=o.shape,s=o.target;h(s,"bpmn:Collaboration")&&(h(a,"bpmn:FlowNode")?r(i,n(ED)):h(a,"bpmn:DataObjectReference")&&r(i,n(wD)))})}nl.$inject=["eventBus","tooltips","translate"];var Wb={__depends__:[Vb],__init__:["modelingFeedback"],modelingFeedback:["type",nl]};k();var SD=500,CD=1250,RD=1500,rl=Math.round;function PD(e){return{x:e.x+rl(e.width/2),y:e.y+rl(e.height/2)}}function il(e,t,n,r,i){function o(s,c,u,p){return i.allowed("elements.move",{shapes:s,delta:c,position:u,target:p})}e.on("shape.move.start",RD,function(s){var c=s.context,u=s.shape,p=r.get().slice();p.indexOf(u)===-1&&(p=[u]),p=AD(p),C(c,{shapes:p,validatedShapes:p,shape:u})}),e.on("shape.move.start",CD,function(s){var c=s.context,u=c.validatedShapes,p;if(p=c.canExecute=o(u),!p)return!1}),e.on("shape.move.move",SD,function(s){var c=s.context,u=c.validatedShapes,p=s.hover,l={x:s.dx,y:s.dy},f={x:s.x,y:s.y},d;if(d=o(u,l,f,p),c.delta=l,c.canExecute=d,d===null){c.target=null;return}c.target=p}),e.on("shape.move.end",function(s){var c=s.context,u=c.delta,p=c.canExecute,l=p==="attach",f=c.shapes;if(p===!1)return!1;u.x=rl(u.x),u.y=rl(u.y),!(u.x===0&&u.y===0)&&n.moveElements(f,u,c.target,{primaryShape:c.shape,attach:l})}),e.on("element.mousedown",function(s){if(vn(s)){var c=Cr(s);if(!c)throw new Error("must supply DOM mousedown event");return a(c,s.element)}});function a(s,c,u,p){if(Ee(u)&&(p=u,u=!1),!(c.waypoints||!c.parent)&&!fe(s.target).has("djs-hit-no-move")){var l=PD(c);return t.init(s,l,"shape.move",{cursor:"grabbing",autoActivate:u,data:{shape:c,context:p||{}}}),!0}}this.start=a}il.$inject=["eventBus","dragging","modeling","selection","rules"];function AD(e){var t=zt(e,"id");return J(e,function(n){for(;n=n.parent;)if(t[n.id])return!1;return!0})}k();var Ub=499,fd="djs-dragging",qb="drop-ok",Kb="drop-not-ok",Yb="new-parent",Xb="attach-ok";function ol(e,t,n,r){function i(c){var u=o(c),p=TD(u);return p}function o(c){var u=Yn(c,!0),p=u.flatMap(d=>(d.incoming||[]).concat(d.outgoing||[])),l=u.concat(p),f=[...new Set(l)];return f}function a(c,u){[Xb,qb,Kb,Yb].forEach(function(p){p===u?t.addMarker(c,p):t.removeMarker(c,p)})}function s(c,u,p){r.addDragger(u,c.dragGroup),p&&t.addMarker(u,fd),c.allDraggedElements?c.allDraggedElements.push(u):c.allDraggedElements=[u]}e.on("shape.move.start",Ub,function(c){var u=c.context,p=u.shapes,l=u.allDraggedElements,f=i(p);if(!u.dragGroup){var d=U("g");z(d,n.cls("djs-drag-group",["no-events"]));var m=t.getActiveLayer();Q(m,d),u.dragGroup=d}f.forEach(function(y){r.addDragger(y,u.dragGroup)}),l?l=gi([l,o(p)]):l=o(p),E(l,function(y){t.addMarker(y,fd)}),u.allDraggedElements=l,u.differentParents=DD(p)}),e.on("shape.move.move",Ub,function(c){var u=c.context,p=u.dragGroup,l=u.target,f=u.shape.parent,d=u.canExecute;l&&(d==="attach"?a(l,Xb):u.canExecute&&f&&l.id!==f.id?a(l,Yb):a(l,u.canExecute?qb:Kb)),Be(p,c.dx,c.dy)}),e.on(["shape.move.out","shape.move.cleanup"],function(c){var u=c.context,p=u.target;p&&a(p,null)}),e.on("shape.move.cleanup",function(c){var u=c.context,p=u.allDraggedElements,l=u.dragGroup;E(p,function(f){t.removeMarker(f,fd)}),l&&we(l)}),this.makeDraggable=s}ol.$inject=["eventBus","canvas","styles","previewSupport"];function TD(e){var t=J(e,function(n){return me(n)?re(e,Et({id:n.source.id}))&&re(e,Et({id:n.target.id})):!0});return t}function DD(e){return hl(zt(e,function(t){return t.parent&&t.parent.id}))!==1}var Zb={__depends__:[Qr,et,ha,yt,Dt,Tn],__init__:["move","movePreview"],move:["type",il],movePreview:["type",ol]};k();var Jb=".djs-palette-toggle",ex=".entry",MD=Jb+", "+ex,dd="djs-palette-",kD="shown",md="open",Qb="two-column",ND=1e3;function nt(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",function(r){var i=r.tool;n.updateToolHighlight(i)}),e.on("i18n.changed",function(){n._update()}),e.on("diagram.init",function(){n._diagramInitialized=!0,n._rebuild()})}nt.$inject=["eventBus","canvas"];nt.prototype.registerProvider=function(e,t){t||(t=e,e=ND),this._eventBus.on("palette.getProviders",e,function(n){n.providers.push(t)}),this._rebuild()};nt.prototype.getEntries=function(){var e=this._getProviders();return e.reduce(BD,{})};nt.prototype._rebuild=function(){if(this._diagramInitialized){var e=this._getProviders();e.length&&(this._container||this._init(),this._update())}};nt.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),r=this._container=ue(nt.HTML_MARKUP);n.appendChild(r),Te(n).add(dd+kD),vt.bind(r,MD,"click",function(i){var o=i.delegateTarget;if(fc(o,Jb))return e.toggle();e.trigger("click",i)}),se.bind(r,"mousedown",function(i){i.stopPropagation()}),vt.bind(r,ex,"dragstart",function(i){e.trigger("dragstart",i)}),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:r})};nt.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers};nt.prototype._toggleState=function(e){e=e||{};var t=this._getParentContainer(),n=this._container,r=this._eventBus,i,o=Te(n),a=Te(t);"twoColumn"in e?i=e.twoColumn:i=this._needsCollapse(t.clientHeight,this._entries||{}),o.toggle(Qb,i),a.toggle(dd+Qb,i),"open"in e&&(o.toggle(md,e.open),a.toggle(dd+md,e.open)),r.fire("palette.changed",{twoColumn:i,open:this.isOpen()})};nt.prototype._update=function(){var e=ge(".djs-palette-entries",this._container),t=this._entries=this.getEntries();jr(e),E(t,function(n,r){var i=n.group||"default",o=ge("[data-group="+wr(i)+"]",e);o||(o=ue('
      '),Je(o,"data-group",i),e.appendChild(o));var a=n.html||(n.separator?'
      ':'
      '),s=ue(a);if(o.appendChild(s),!n.separator&&(Je(s,"data-action",r),n.title&&Je(s,"title",n.title),n.className&&OD(s,n.className),n.imageUrl)){var c=ue("");Je(c,"src",n.imageUrl),s.appendChild(c)}}),this.open()};nt.prototype.trigger=function(e,t,n){var r,i,o=t.delegateTarget||t.target;return o?(r=Je(o,"data-action"),i=t.originalEvent||t,this.triggerEntry(r,e,i,n)):t.preventDefault()};nt.prototype.triggerEntry=function(e,t,n,r){var i=this._entries,o,a;if(o=i[e],!!o&&(a=o.action,this._eventBus.fire("palette.trigger",{entry:o,event:n})!==!1)){if(Ne(a)){if(t==="click")return a(n,r)}else if(a[t])return a[t](n,r);n.preventDefault()}};nt.prototype._layoutChanged=function(){this._toggleState({})};nt.prototype._needsCollapse=function(e,t){var n=50,r=Object.keys(t).length*46;return e=n.x&&t.yn.x&&t.y<=n.y?r={x:n.x,y:t.y,width:t.x-n.x,height:n.y-t.y}:t.x<=n.x&&t.y>n.y||t.x=n.y?r={x:t.x,y:n.y,width:n.x-t.x,height:t.y-n.y}:t.x>=n.x&&t.y>n.y||t.x>n.x&&t.y>=n.y?r={x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:r={x:n.x,y:n.y,width:0,height:0},r}var rx={__depends__:[pi,cr],__init__:["lassoTool"],lassoTool:["type",Ir]};var vd=1500,ox="grab";function mi(e,t,n,r,i,o){this._dragging=n,this._mouse=o;var a=this,s=r.get("keyboard",!1);i.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",vd,function(c){if(Rr(c))return a.activateMove(c.originalEvent,!0),!1}),s&&s.addListener(vd,function(c){if(!(!ix(c.keyEvent)||a.isActive())){var u=a._mouse.getLastMoveEvent();a.activateMove(u,!!u)}},"keyboard.keydown"),s&&s.addListener(vd,function(c){!ix(c.keyEvent)||!a.isActive()||a.toggle()},"keyboard.keyup"),e.on("hand.end",function(c){var u=c.originalEvent.target;if(!c.hover&&!(u instanceof SVGElement))return!1;e.once("hand.ended",function(){a.activateMove(c.originalEvent,{reactivate:!0})})}),e.on("hand.move.move",function(c){var u=t.viewbox().scale;t.scroll({dx:c.dx*u,dy:c.dy*u})}),e.on("hand.move.end",function(c){var u=c.context,p=u.reactivate;return!Rr(c)&&p&&e.once("hand.move.ended",function(l){a.activateHand(l.originalEvent,!0,!0)}),!1})}mi.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"];mi.prototype.activateMove=function(e,t,n){typeof t=="object"&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:ox,data:{context:n||{}}})};mi.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:ox,data:{context:{reactivate:n}}})};mi.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)};mi.prototype.isActive=function(){var e=this._dragging.context();return e?/^(hand|hand\.move)$/.test(e.prefix):!1};function ix(e){return We("Space",e)}var ax={__depends__:[pi,cr],__init__:["handTool"],handTool:["type",mi]};var sx="connect-ok",cx="connect-not-ok";function hi(e,t,n,r,i,o,a){var s=this;this._dragging=t,this._rules=o,this._mouse=a,i.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),e.on("global-connect.hover",function(c){var u=c.context,p=c.hover,l=u.canStartConnect=s.canStartConnect(p);l!==null&&(u.startTarget=p,r.addMarker(p,l?sx:cx))}),e.on(["global-connect.out","global-connect.cleanup"],function(c){var u=c.context.startTarget,p=c.context.canStartConnect;u&&r.removeMarker(u,p?sx:cx)}),e.on(["global-connect.ended"],function(c){var u=c.context,p=u.startTarget,l={x:c.x,y:c.y},f=s.canStartConnect(p);if(f)return e.once("element.out",function(){e.once(["connect.ended","connect.canceled"],function(){e.fire("global-connect.drag.ended")}),n.start(null,p,l)}),!1})}hi.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"];hi.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})};hi.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)};hi.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)};hi.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};var ux={__depends__:[No,yt,Dt,pi,cr],globalConnect:["type",hi]};k();function nc(e,t,n,r,i,o,a,s){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=r,this._lassoTool=i,this._handTool=o,this._globalConnect=a,this._translate=s,e.registerProvider(this)}nc.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"];nc.prototype.getPaletteEntries=function(){var e={},t=this._create,n=this._elementFactory,r=this._spaceTool,i=this._lassoTool,o=this._handTool,a=this._globalConnect,s=this._translate;function c(l,f,d,m,y){function v(w){var R=n.createShape(C({type:l},y));t.start(w,R)}return{group:f,className:d,title:m,action:{dragstart:v,click:v}}}function u(l){var f=n.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),d=n.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:f});t.start(l,[f,d],{hints:{autoSelect:[f]}})}function p(l){t.start(l,n.createParticipantShape())}return C(e,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:s("Activate hand tool"),action:{click:function(l){o.activateHand(l)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:s("Activate lasso tool"),action:{click:function(l){i.activateSelection(l)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:s("Activate create/remove space tool"),action:{click:function(l){r.activateSelection(l)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:s("Activate global connect tool"),action:{click:function(l){a.start(l)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":c("bpmn:StartEvent","event","bpmn-icon-start-event-none",s("Create start event")),"create.intermediate-event":c("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",s("Create intermediate/boundary event")),"create.end-event":c("bpmn:EndEvent","event","bpmn-icon-end-event-none",s("Create end event")),"create.exclusive-gateway":c("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",s("Create gateway")),"create.task":c("bpmn:Task","activity","bpmn-icon-task",s("Create task")),"create.data-object":c("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",s("Create data object reference")),"create.data-store":c("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",s("Create data store reference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:s("Create expanded sub-process"),action:{dragstart:u,click:u}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:s("Create pool/participant"),action:{dragstart:p,click:p}},"create.group":c("bpmn:Group","artifact","bpmn-icon-group",s("Create group"))}),e};var px={__depends__:[tx,ui,kp,rx,ax,ux,Yr],__init__:["paletteProvider"],paletteProvider:["type",nc]};k();var ID=250;function rc(e,t,n,r,i){N.call(this,e);function o(s){var c=s.canExecute.replacements;E(c,function(u){var p=u.oldElementId,l={type:u.newElementType};if(!s.visualReplacements[p]){var f=t.get(p);C(l,{x:f.x,y:f.y});var d=n.createShape(l);r.addShape(d,f.parent);var m=ge('[data-element-id="'+wr(f.id)+'"]',s.dragGroup);m&&z(m,{display:"none"});var y=i.addDragger(d,s.dragGroup);s.visualReplacements[p]=y,r.removeShape(d)}})}function a(s){var c=s.visualReplacements;E(c,function(u,p){var l=ge('[data-element-id="'+wr(p)+'"]',s.dragGroup);l&&z(l,{display:"inline"}),u.remove(),c[p]&&delete c[p]})}e.on("shape.move.move",ID,function(s){var c=s.context,u=c.canExecute;c.visualReplacements||(c.visualReplacements={}),u&&u.replacements?o(c):a(c)})}rc.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"];B(rc,N);var lx={__depends__:[Tn],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",rc]};k();var LD=1250,gd=40,jD=20,FD=10,fx=20,mx=["x","y"],HD=Math.abs;function al(e){e.on(["connect.hover","connect.move","connect.end"],LD,function(t){var n=t.context,r=n.canExecute,i=n.start,o=n.hover,a=n.source,s=n.target;t.originalEvent&>(t.originalEvent)||(n.initialConnectionStart||(n.initialConnectionStart=n.connectionStart),r&&o&&$D(t,o,WD(o)),o&&VD(r,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(n.connectionStart=nn(i),ee(o,["bpmn:Event","bpmn:Gateway"])&&dx(t,nn(o)),ee(o,["bpmn:Task","bpmn:SubProcess"])&&zD(t,o),h(a,"bpmn:BoundaryEvent")&&s===a.host&&GD(t)):hx(r,"bpmn:MessageFlow")?(h(i,"bpmn:Event")&&(n.connectionStart=nn(i)),h(o,"bpmn:Event")&&dx(t,nn(o))):n.connectionStart=n.initialConnectionStart)})}al.$inject=["eventBus"];function $D(e,t,n){mx.forEach(function(r){var i=vx(r,t);e[r]t[r]+i-n&&je(e,r,t[r]+i-n)})}function zD(e,t){var n=nn(t);mx.forEach(function(r){UD(e,t,r)&&je(e,r,n[r])})}function GD(e){var t=e.context,n=t.source,r=t.target;if(!qD(t)){var i=nn(n),o=He(i,r,-10),a=[];/top|bottom/.test(o)&&a.push("x"),/left|right/.test(o)&&a.push("y"),a.forEach(function(s){var c=e[s],u;HD(c-i[s])i[s]?u=i[s]+gd:u=i[s]-gd,je(e,s,u))})}}function dx(e,t){je(e,"x",t.x),je(e,"y",t.y)}function hx(e,t){return e&&e.type===t}function VD(e,t){return Bt(t,function(n){return hx(e,n)})}function vx(e,t){return e==="x"?t.width:t.height}function WD(e){return h(e,"bpmn:Task")?FD:jD}function UD(e,t,n){return e[n]>t[n]+fx&&e[n]=e.x||i&&i<=e.x)&&je(e,"x",e.x),(r&&r>=e.y||o&&o<=e.y)&&je(e,"y",e.y)}}function yx(e,t){return e.indexOf(t)!==-1}function _x(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}k();var eM=1250;function no(e,t){var n=this;e.on(["resize.start"],function(r){n.initSnap(r)}),e.on(["resize.move","resize.end"],eM,function(r){var i=r.context,o=i.shape,a=o.parent,s=i.direction,c=i.snapContext;if(!(r.originalEvent&>(r.originalEvent))&&!Hn(r)){var u=c.pointsForTarget(a);u.initialized||(u=n.addSnapTargetPoints(u,o,a,s),u.initialized=!0),rM(s)&&je(r,"x",r.x),iM(s)&&je(r,"y",r.y),t.snap(r,u)}}),e.on(["resize.cleanup"],function(){t.hide()})}no.prototype.initSnap=function(e){var t=e.context,n=t.shape,r=t.direction,i=t.snapContext;i||(i=t.snapContext=new Un);var o=bx(n,r);return i.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),i};no.prototype.addSnapTargetPoints=function(e,t,n,r){var i=this.getSnapTargets(t,n);return E(i,function(o){e.add("corner",Hu(o)),e.add("corner",Fu(o))}),e.add("corner",bx(t,r)),e};no.$inject=["eventBus","snapping"];no.prototype.getSnapTargets=function(e,t){return $u(t).filter(function(n){return!tM(n,e)&&!me(n)&&!nM(n)&&!ne(n)})};function bx(e,t){var n=Y(e),r=Z(e),i={x:n.x,y:n.y};return t.indexOf("n")!==-1?i.y=r.top:t.indexOf("s")!==-1&&(i.y=r.bottom),t.indexOf("e")!==-1?i.x=r.right:t.indexOf("w")!==-1&&(i.x=r.left),i}function tM(e,t){return e.host===t}function nM(e){return!!e.hidden}function rM(e){return e==="n"||e==="s"}function iM(e){return e==="e"||e==="w"}k();var oM=7,aM=1e3;function mr(e){this._canvas=e,this._asyncHide=xa(Qe(this.hide,this),aM)}mr.$inject=["canvas"];mr.prototype.snap=function(e,t){var n=e.context,r=n.snapContext,i=r.getSnapLocations(),o={x:Hn(e,"x"),y:Hn(e,"y")};E(i,function(a){var s=r.getSnapOrigin(a),c={x:e.x+s.x,y:e.y+s.y};if(E(["x","y"],function(u){var p;o[u]||(p=t.snap(c,a,u,oM),p!==void 0&&(o[u]={value:p,originValue:p-s[u]}))}),o.x&&o.y)return!1}),this.showSnapLine("vertical",o.x&&o.x.value),this.showSnapLine("horizontal",o.y&&o.y.value),E(["x","y"],function(a){var s=o[a];Ee(s)&&je(e,a,s.originValue)})};mr.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=U("path");return z(n,{d:"M0,0 L0,0"}),fe(n).add("djs-snap-line"),Q(t,n),{update:function(r){te(r)?e==="horizontal"?z(n,{d:"M-100000,"+r+" L+100000,"+r,display:""}):z(n,{d:"M "+r+",-100000 L "+r+", +100000",display:""}):z(n,{display:"none"})}}};mr.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}};mr.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()};mr.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]};mr.prototype.hide=function(){E(this._snapLines,function(e){e.update()})};var xx={__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",_n],resizeSnapping:["type",no],snapping:["type",mr]};var Ex={__depends__:[xx],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",al],createMoveSnapping:["type",vi]};var Sx=300;function de(e,t,n,r){this._open=!1,this._results={},this._eventMaps=[],this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._canvas=e,this._eventBus=t,this._selection=n,this._translate=r,this._container=this._getBoxHtml(),this._searchInput=ge(de.INPUT_SELECTOR,this._container),this._resultsContainer=ge(de.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy","drag.init","elements.changed"],this.close,this)}de.$inject=["canvas","eventBus","selection","translate"];de.prototype._bindEvents=function(){var e=this;function t(n,r,i,o){e._eventMaps.push({el:n,type:i,listener:vt.bind(n,r,i,o)})}t(document,"html","click",function(n){e.close(!1)}),t(this._container,de.INPUT_SELECTOR,"click",function(n){n.stopPropagation(),n.delegateTarget.focus()}),t(this._container,de.RESULT_SELECTOR,"mouseover",function(n){n.stopPropagation(),e._scrollToNode(n.delegateTarget),e._preselect(n.delegateTarget)}),t(this._container,de.RESULT_SELECTOR,"click",function(n){n.stopPropagation(),e._select(n.delegateTarget)}),t(this._container,de.INPUT_SELECTOR,"keydown",function(n){We("ArrowUp",n)&&n.preventDefault(),We("ArrowDown",n)&&n.preventDefault()}),t(this._container,de.INPUT_SELECTOR,"keyup",function(n){if(We("Escape",n))return e.close();if(We("Enter",n)){var r=e._getCurrentResult();return r?e._select(r):e.close(!1)}if(We("ArrowUp",n))return e._scrollToDirection(!0);if(We("ArrowDown",n))return e._scrollToDirection();We(["ArrowLeft","ArrowRight"],n)||e._search(n.delegateTarget.value)})};de.prototype._unbindEvents=function(){this._eventMaps.forEach(function(e){vt.unbind(e.el,e.type,e.listener)})};de.prototype._search=function(e){var t=this;if(this._clearResults(),!!e.trim()){var n=this._searchProvider.find(e);if(n=n.filter(function(i){return!t._canvas.getRootElements().includes(i.element)}),!n.length){this._selection.select(null);return}n.forEach(function(i){var o=i.element.id,a=t._createResultNode(i,o);t._results[o]={element:i.element,node:a}});var r=ge(de.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(r),this._preselect(r)}};de.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}};de.prototype._scrollToNode=function(e){if(!(!e||e===this._getCurrentResult())){var t=e.offsetTop,n=this._resultsContainer.scrollTop,r=t-this._resultsContainer.clientHeight+e.clientHeight;t0&&wx(n,e.primaryTokens,de.RESULT_PRIMARY_HTML),wx(n,e.secondaryTokens,de.RESULT_SECONDARY_HTML),Je(n,de.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n};de.prototype.registerProvider=function(e){this._searchProvider=e};de.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._cachedRootElement=this._canvas.getRootElement(),this._cachedSelection=this._selection.get(),this._cachedViewbox=this._canvas.viewbox(),this._selection.select(null),this._bindEvents(),this._open=!0,Te(this._canvas.getContainer()).add("djs-search-open"),Te(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))};de.prototype.close=function(e=!0){this.isOpen()&&(e&&(this._cachedRootElement&&this._canvas.setRootElement(this._cachedRootElement),this._cachedSelection&&this._selection.select(this._cachedSelection),this._cachedViewbox&&this._canvas.viewbox(this._cachedViewbox),this._eventBus.fire("searchPad.restored")),this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._unbindEvents(),this._open=!1,Te(this._canvas.getContainer()).remove("djs-search-open"),Te(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._eventBus.fire("searchPad.closed"),this._canvas.restoreFocus())};de.prototype.toggle=function(){this.isOpen()?this.close():this.open()};de.prototype.isOpen=function(){return this._open};de.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&Te(t).remove(de.RESULT_SELECTED_CLASS);var n=Je(e,de.RESULT_ID_ATTRIBUTE),r=this._results[n].element;Te(e).add(de.RESULT_SELECTED_CLASS),this._canvas.scrollToElement(r,{top:Sx}),this._selection.select(r),this._eventBus.fire("searchPad.preselected",r)}};de.prototype._select=function(e){var t=Je(e,de.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this._cachedSelection=null,this._cachedViewbox=null,this.close(!1),this._canvas.scrollToElement(n,{top:Sx}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)};de.prototype._getBoxHtml=function(){let e=ue(de.BOX_HTML),t=ge(de.INPUT_SELECTOR,e);return t&&t.setAttribute("aria-label",this._translate("Search in diagram")),e};function wx(e,t,n){var r=sM(t),i=ue(n);i.innerHTML=r,e.appendChild(i)}function sM(e){var t="";return e.forEach(function(n){var r=jn(n.value||n.matched||n.normal),i=n.match||n.matched;i?t+=''+r+"":t+=r}),t!==""?t:null}de.CONTAINER_SELECTOR=".djs-search-container";de.INPUT_SELECTOR=".djs-search-input input";de.RESULTS_CONTAINER_SELECTOR=".djs-search-results";de.RESULT_SELECTOR=".djs-search-result";de.RESULT_SELECTED_CLASS="djs-search-result-selected";de.RESULT_SELECTED_SELECTOR="."+de.RESULT_SELECTED_CLASS;de.RESULT_ID_ATTRIBUTE="data-result-id";de.RESULT_HIGHLIGHT_CLASS="djs-search-highlight";de.BOX_HTML=`
      @@ -236,4 +236,42 @@
      -
      `;le.RESULT_HTML='
      ';le.RESULT_PRIMARY_HTML='
      ';le.RESULT_SECONDARY_HTML='

      ';var Rx={__depends__:[Hr,$r,qe],searchPad:["type",le]};function Gs(e,t,n,r){this._elementRegistry=e,this._canvas=n,this._search=r,t.registerProvider(this)}Gs.$inject=["elementRegistry","searchPad","canvas","search"];Gs.prototype.find=function(e){var t=this._canvas.getRootElements(),n=this._elementRegistry.filter(function(r){return!te(r)&&!t.includes(r)});return this._search(n.map(r=>({element:r,label:xt(r),id:r.id})),e,{keys:["label","id"]}).map(YA)};function YA(e){let{item:{element:t},tokens:n}=e;return{element:t,primaryTokens:n.label,secondaryTokens:n.id}}var Px={__depends__:[Rx,ap],__init__:["bpmnSearch"],bpmnSearch:["type",Gs]};var Ax="M44.7648 11.3263L36.9892 2.64074C36.0451 1.58628 34.5651 0.988708 33.1904 0.988708H5.98667C3.22688 0.988708 0.989624 3.34892 0.989624 6.26039V55.0235C0.989624 57.9349 3.22688 60.2952 5.98667 60.2952H40.966C43.7257 60.2952 45.963 57.9349 45.963 55.0235V14.9459C45.963 13.5998 45.6407 12.3048 44.7648 11.3263Z",Tx="M1.03845 48.1347C1.03845 49.3511 1.07295 50.758 1.38342 52.064C1.69949 53.3938 2.32428 54.7154 3.56383 55.6428C6.02533 57.4841 10.1161 58.7685 14.8212 59.6067C19.5772 60.4538 25.1388 60.8738 30.6831 60.8738C36.2276 60.8738 41.7891 60.4538 46.545 59.6067C51.2504 58.7687 55.3412 57.4842 57.8028 55.6429C59.0424 54.7156 59.6673 53.3938 59.9834 52.064C60.2938 50.7579 60.3285 49.351 60.3285 48.1344V13.8415C60.3285 12.6249 60.2938 11.218 59.9834 9.91171C59.6673 8.58194 59.0423 7.2602 57.8027 6.33294C55.341 4.49168 51.2503 3.20723 46.545 2.36914C41.7891 1.522 36.2276 1.10204 30.6831 1.10205C25.1388 1.10206 19.5772 1.52206 14.8213 2.36923C10.1162 3.20734 6.02543 4.49183 3.5639 6.33314C2.32433 7.26038 1.69951 8.58206 1.38343 9.91181C1.07295 11.2179 1.03845 12.6247 1.03845 13.8411V48.1347Z",Mx={width:36,height:50},Dx={width:50,height:50};function Xf(e,t,n){return G("path",{d:e,strokeWidth:2,transform:`translate(${t.x}, ${t.y})`,...n})}var En=5;function sa(e,t){this._styles=t,e.registerProvider(this)}sa.$inject=["outline","styles"];sa.prototype.getOutline=function(e){let t=this._styles.cls("djs-outline",["no-fill"]);var n;if(Sh(e))return n=G("rect"),$(n,C({x:-En,y:-En,rx:4,width:e.width+En*2,height:e.height+En*2},t)),n;if(!te(e))return m(e,"bpmn:Gateway")?(n=G("rect"),C(n.style,{"transform-box":"fill-box",transform:"rotate(45deg)","transform-origin":"center"}),$(n,C({x:2,y:2,rx:4,width:e.width-4,height:e.height-4},t))):Q(e,["bpmn:Task","bpmn:SubProcess","bpmn:Group","bpmn:CallActivity"])?(n=G("rect"),$(n,C({x:-En,y:-En,rx:14,width:e.width+En*2,height:e.height+En*2},t))):m(e,"bpmn:EndEvent")?(n=G("circle"),$(n,C({cx:e.width/2,cy:e.height/2,r:e.width/2+En+1},t))):m(e,"bpmn:Event")?(n=G("circle"),$(n,C({cx:e.width/2,cy:e.height/2,r:e.width/2+En},t))):m(e,"bpmn:DataObjectReference")&&kx(e,"bpmn:DataObjectReference")?n=Xf(Ax,{x:-6,y:-6},t):m(e,"bpmn:DataStoreReference")&&kx(e,"bpmn:DataStoreReference")&&(n=Xf(Tx,{x:-6,y:-6},t)),n};sa.prototype.updateOutline=function(e,t){if(!te(e))return Q(e,["bpmn:SubProcess","bpmn:Group"])?($(t,{width:e.width+En*2,height:e.height+En*2}),!0):!!Q(e,["bpmn:Event","bpmn:Gateway","bpmn:DataStoreReference","bpmn:DataObjectReference"])};function kx(e,t){var n;return t==="bpmn:DataObjectReference"?n=Mx:t==="bpmn:DataStoreReference"&&(n=Dx),e.width===n.width&&e.height===n.height}var Ox={__depends__:[aa],__init__:["outlineProvider"],outlineProvider:["type",sa]};var qA='';function zt(e){hi.call(this,e)}N(zt,hi);zt.Viewer=sn;zt.NavigatedViewer=gr;zt.prototype.createDiagram=function(){return this.importXML(qA)};zt.prototype._interactionModules=[jc,zc,Vc];zt.prototype._modelingModules=[qm,xo,rg,Jm,Eg,So,Cg,h_,pu,ei,v_,x_,R_,A_,T_,N_,H_,V_,Su,U_,Q_,lx,fx,Lu,wx,Px,Ox];zt.prototype._modules=[].concat(sn.prototype._modules,zt.prototype._interactionModules,zt.prototype._modelingModules);var XA=globalThis;Object.assign(zt,{Modeler:zt,NavigatedViewer:gr,Viewer:sn});XA.BpmnJS=zt;var mX=zt;})(); +
      `;de.RESULT_HTML='
      ';de.RESULT_PRIMARY_HTML='
      ';de.RESULT_SECONDARY_HTML='

      ';var Cx={__depends__:[Yr,Xr,et],searchPad:["type",de]};function ic(e,t,n,r){this._elementRegistry=e,this._canvas=n,this._search=r,t.registerProvider(this)}ic.$inject=["elementRegistry","searchPad","canvas","search"];ic.prototype.find=function(e){var t=this._canvas.getRootElements(),n=this._elementRegistry.filter(function(r){return!ne(r)&&!t.includes(r)});return this._search(n.map(r=>({element:r,label:Pt(r),id:r.id})),e,{keys:["label","id"]}).map(cM)};function cM(e){let{item:{element:t},tokens:n}=e;return{element:t,primaryTokens:n.label,secondaryTokens:n.id}}var Rx={__depends__:[Cx,bu],__init__:["bpmnSearch"],bpmnSearch:["type",ic]};k();var Px="M44.7648 11.3263L36.9892 2.64074C36.0451 1.58628 34.5651 0.988708 33.1904 0.988708H5.98667C3.22688 0.988708 0.989624 3.34892 0.989624 6.26039V55.0235C0.989624 57.9349 3.22688 60.2952 5.98667 60.2952H40.966C43.7257 60.2952 45.963 57.9349 45.963 55.0235V14.9459C45.963 13.5998 45.6407 12.3048 44.7648 11.3263Z",Ax="M1.03845 48.1347C1.03845 49.3511 1.07295 50.758 1.38342 52.064C1.69949 53.3938 2.32428 54.7154 3.56383 55.6428C6.02533 57.4841 10.1161 58.7685 14.8212 59.6067C19.5772 60.4538 25.1388 60.8738 30.6831 60.8738C36.2276 60.8738 41.7891 60.4538 46.545 59.6067C51.2504 58.7687 55.3412 57.4842 57.8028 55.6429C59.0424 54.7156 59.6673 53.3938 59.9834 52.064C60.2938 50.7579 60.3285 49.351 60.3285 48.1344V13.8415C60.3285 12.6249 60.2938 11.218 59.9834 9.91171C59.6673 8.58194 59.0423 7.2602 57.8027 6.33294C55.341 4.49168 51.2503 3.20723 46.545 2.36914C41.7891 1.522 36.2276 1.10204 30.6831 1.10205C25.1388 1.10206 19.5772 1.52206 14.8213 2.36923C10.1162 3.20734 6.02543 4.49183 3.5639 6.33314C2.32433 7.26038 1.69951 8.58206 1.38343 9.91181C1.07295 11.2179 1.03845 12.6247 1.03845 13.8411V48.1347Z",Tx={width:36,height:50},Dx={width:50,height:50};function yd(e,t,n){return U("path",{d:e,strokeWidth:2,transform:`translate(${t.x}, ${t.y})`,...n})}var Mn=5;function va(e,t){this._styles=t,e.registerProvider(this)}va.$inject=["outline","styles"];va.prototype.getOutline=function(e){let t=this._styles.cls("djs-outline",["no-fill"]);var n;if(wh(e))return n=U("rect"),z(n,C({x:-Mn,y:-Mn,rx:4,width:e.width+Mn*2,height:e.height+Mn*2},t)),n;if(!ne(e))return h(e,"bpmn:Gateway")?(n=U("rect"),C(n.style,{"transform-box":"fill-box",transform:"rotate(45deg)","transform-origin":"center"}),z(n,C({x:2,y:2,rx:4,width:e.width-4,height:e.height-4},t))):ee(e,["bpmn:Task","bpmn:SubProcess","bpmn:Group","bpmn:CallActivity"])?(n=U("rect"),z(n,C({x:-Mn,y:-Mn,rx:14,width:e.width+Mn*2,height:e.height+Mn*2},t))):h(e,"bpmn:EndEvent")?(n=U("circle"),z(n,C({cx:e.width/2,cy:e.height/2,r:e.width/2+Mn+1},t))):h(e,"bpmn:Event")?(n=U("circle"),z(n,C({cx:e.width/2,cy:e.height/2,r:e.width/2+Mn},t))):h(e,"bpmn:DataObjectReference")&&Mx(e,"bpmn:DataObjectReference")?n=yd(Px,{x:-6,y:-6},t):h(e,"bpmn:DataStoreReference")&&Mx(e,"bpmn:DataStoreReference")&&(n=yd(Ax,{x:-6,y:-6},t)),n};va.prototype.updateOutline=function(e,t){if(!ne(e))return ee(e,["bpmn:SubProcess","bpmn:Group"])?(z(t,{width:e.width+Mn*2,height:e.height+Mn*2}),!0):!!ee(e,["bpmn:Event","bpmn:Gateway","bpmn:DataStoreReference","bpmn:DataObjectReference"])};function Mx(e,t){var n;return t==="bpmn:DataObjectReference"?n=Tx:t==="bpmn:DataStoreReference"&&(n=Dx),e.width===n.width&&e.height===n.height}var kx={__depends__:[ha],__init__:["outlineProvider"],outlineProvider:["type",va]};var uM='';function Ht(e){Ci.call(this,e)}B(Ht,Ci);Ht.Viewer=tn;Ht.NavigatedViewer=ir;Ht.prototype.createDiagram=function(){return this.importXML(uM)};Ht.prototype._interactionModules=[Qc,nu,ru];Ht.prototype._modelingModules=[Kv,To,ng,Qv,xg,No,Sg,db,wp,ui,vb,_b,Cb,Pb,Ab,Nb,Fb,zb,jp,Wb,Zb,px,lx,Zp,Ex,Rx,kx];Ht.prototype._modules=[].concat(tn.prototype._modules,Ht.prototype._interactionModules,Ht.prototype._modelingModules);var Vx=WE($x());k();function Wx(e,t){var n=e.get("editorActions",!1);n&&n.register({toggleLinting:function(){t.toggle()}})}Wx.$inject=["injector","linting"];var Ux=` + + + +`,qx=` + + +`,zx=` + + + +`,Kx=` + +`,xM=-7,EM=-7,wM=500,Gx={resolver:{resolveRule:function(){return null}},config:{}},Yx={error:Ux,warning:qx,success:zx,info:Kx,inactive:zx};function at(e,t,n,r,i,o,a){this._bpmnjs=e,this._canvas=t,this._elementRegistry=r,this._eventBus=i,this._overlays=o,this._translate=a,this._issues={},this._active=n&&n.active||!1,this._linterConfig=Gx,this._overlayIds={};var s=this;i.on(["import.done","elements.changed","linting.configChanged","linting.toggle"],wM,function(u){s.update()}),i.on("linting.toggle",function(u){u.active||(s._clearIssues(),s._updateButton())}),i.on("diagram.clear",function(){s._clearIssues()});var c=n&&n.bpmnlint;c&&i.once("diagram.init",function(){if(s.getLinterConfig()===Gx)try{s.setLinterConfig(c)}catch{console.error("[bpmn-js-bpmnlint] Invalid lint rules configured. Please doublecheck your linting.bpmnlint configuration, cf. https://github.com/bpmn-io/bpmn-js-bpmnlint#configure-lint-rules")}}),this._init()}at.prototype.setLinterConfig=function(e){if(!e.config||!e.resolver)throw new Error("Expected linterConfig = { config, resolver }");this._linterConfig=e,this._eventBus.fire("linting.configChanged")};at.prototype.getLinterConfig=function(){return this._linterConfig};at.prototype._init=function(){this._createButton(),this._updateButton()};at.prototype.isActive=function(){return this._active};at.prototype._formatIssues=function(e){let t=this,n=Fe(e,function(o,a,s){return o.concat(a.map(function(c){return c.rule=s,c}))},[]),r=t._elementRegistry.filter(o=>h(o,"bpmn:Participant")),i=r.map(o=>o.businessObject);return n=Oe(n,function(o){if(!t._elementRegistry.get(o.id)){o.isChildIssue=!0,o.actualElementId=o.id;let s=i.filter(c=>c.processRef&&c.processRef.id&&c.processRef.id===o.id);s.length?o.id=s[0].id:o.id=t._canvas.getRootElement().id}return o}),n=zt(n,function(o){return o.id}),n};at.prototype.toggle=function(e){return e=typeof e=="undefined"?!this.isActive():e,this._setActive(e),e};at.prototype._setActive=function(e){this._active!==e&&(this._active=e,this._eventBus.fire("linting.toggle",{active:e}))};at.prototype.update=function(){var e=this,t=this._bpmnjs.getDefinitions();if(t){var n=this._lintStart=Math.random();this.lint().then(function(r){if(e._lintStart===n){r=e._formatIssues(r);var i={},o={},a={};for(var s in e._issues)r[s]||(i[s]=e._issues[s]);for(var c in r)e._issues[c]?r[c]!==e._issues[c]&&(o[c]=r[c]):a[c]=r[c];i=C(i,o),a=C(a,o),e._clearOverlays(),e.isActive()&&e._createIssues(a),e._issues=r,e._updateButton(),e._fireComplete(r)}})}};at.prototype._fireComplete=function(e){this._eventBus.fire("linting.completed",{issues:e})};at.prototype._createIssues=function(e){for(var t in e)this._createElementIssues(t,e[t])};at.prototype._createElementIssues=function(e,t){var n=this._elementRegistry.get(e);if(n){var r=this._elementRegistry.get(e+"_plane");r&&this._createElementIssues(r.id,t);var i,o,a=!n.parent;a&&h(n,"bpmn:Process")?(i="bottom-right",o={top:20,left:150}):a&&h(n,"bpmn:SubProcess")?(i="bottom-right",o={top:50,left:150}):(i="top-right",o={top:xM,left:EM});var s=zt(t,function(I){return(I.isChildIssue?"child":"")+I.category}),c=s.error,u=s.warn,p=s.info,l=s.childerror,f=s.childwarn,d=s.childinfo;if(!(!p&&!c&&!u&&!l&&!f&&!d)){var m=ue('
      '),y=c||l?ue('
      '+Ux+"
      "):u||f?ue('
      '+qx+"
      "):ue('
      '+Kx+"
      "),v=ue('
      '),w=ue('
      '),R=ue('
      '),x=ue('
      '),b=ue("
        ");if(m.appendChild(y),m.appendChild(v),v.appendChild(w),w.appendChild(R),R.appendChild(x),x.appendChild(b),c&&this._addErrors(b,c),u&&this._addWarnings(b,u),p&&this._addInfos(b,p),l||f||d){var S=ue('
        '),A=ue("
          "),O=this._translate("Issues for child elements"),D=ue('
          '+O+":");if(l&&this._addErrors(A,l),f&&this._addWarnings(A,f),d&&this._addInfos(A,d),c||u){var L=ue("
          ");S.appendChild(L)}S.appendChild(D),S.appendChild(A),R.appendChild(S)}this._overlayIds[e]=this._overlays.add(n,"linting",{position:o,html:m,scale:{min:.7}})}}};at.prototype._addErrors=function(e,t){var n=this;t.forEach(function(r){n._addEntry(e,"error",r)})};at.prototype._addWarnings=function(e,t){var n=this;t.forEach(function(r){n._addEntry(e,"warning",r)})};at.prototype._addInfos=function(e,t){var n=this;t.forEach(function(r){n._addEntry(e,"info",r)})};at.prototype._addEntry=function(e,t,n){var u;var r=n.rule,i=(u=n.meta)==null?void 0:u.documentation.url,o=this._translate(n.message),a=n.actualElementId,s=Yx[t],c=ue(` +
        • + ${s} + ${jn(o)} + (${i?`${jn(r)}`:jn(r)}) + ${a?`${jn(a)}`:""} +
        • + `);e.appendChild(c)};at.prototype._clearOverlays=function(){this._overlays.remove({type:"linting"}),this._overlayIds={}};at.prototype._clearIssues=function(){this._issues={},this._clearOverlays()};at.prototype._setButtonState=function(e){var{errors:t,warnings:n,infos:r}=e,i=this._button,o=t&&"error"||n&&"warning"||"success",a=Yx[o],s=this._translate(t||n?"{errors} Errors, {warnings} Warnings":"No Issues",{errors:String(t),warnings:String(n),infos:String(r)}),c=` + ${a} + ${s}`;o=this.isActive()?o:"inactive",["error","inactive","success","warning"].forEach(function(u){o===u?i.classList.add("bjsl-button-"+u):i.classList.remove("bjsl-button-"+u)}),i.innerHTML=c};at.prototype._updateButton=function(){var e=0,t=0,n=0;for(var r in this._issues)this._issues[r].forEach(function(i){i.category==="error"?e++:i.category==="warn"?t++:i.category==="info"&&n++});this._setButtonState({errors:e,warnings:t,infos:n})};at.prototype._createButton=function(){var e=this;this._button=ue(''),this._button.addEventListener("click",function(){e.toggle()}),this._canvas.getContainer().appendChild(this._button)};at.prototype.lint=function(){var e=this._bpmnjs.getDefinitions(),t=new Vx.Linter(this._linterConfig);return t.lint(e)};at.$inject=["bpmnjs","canvas","config.linting","elementRegistry","eventBus","overlays","translate"];var bd={__init__:["linting","lintingEditorActions"],linting:["type",at],lintingEditorActions:["type",Wx]};/*! generated from .bpmnlintrc for dokuwiki-plugin-bpmnio — do not edit by hand */function Xe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function EE(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}function wE(e,t){return t.indexOf(":")===-1&&(t="bpmn:"+t),typeof e.$instanceOf=="function"?e.$instanceOf(t):e.$type===t}function SM(e,t){return t.some(function(n){return wE(e,n)})}var CM=Object.freeze({__proto__:null,is:wE,isAny:SM}),st=EE(CM),ga={},Xx;function Ze(){if(Xx)return ga;Xx=1;let{is:e}=st;function t(a,s){return function(){function c(u,p){e(u,a)&&p.report(u.id,"Element type <"+a+"> is discouraged")}return o(s,{check:c})}}ga.checkDiscouragedNodeType=t;function n(a,s){if(!a)return null;let c=a.$parent;return c?e(c,s)?c:n(c,s):a}ga.findParent=n;function r(a){let s=n(a,"bpmn:Process");return s&&s.isExecutable}ga.isInExecutableProcess=r;let i="https://github.com/bpmn-io/bpmnlint/blob/main/docs/rules";function o(a,s){let{meta:{documentation:c={},...u}={},...p}=s;return{meta:{documentation:{url:`${i}/${a}.md`,...c},...u},...p}}return ga.annotateRule=o,ga}var xd,Zx;function RM(){if(Zx)return xd;Zx=1;let{is:e}=st,{annotateRule:t}=Ze();return xd=function(){function n(r,i){if(!e(r,"bpmn:AdHocSubProcess"))return;(r.flowElements||[]).forEach(function(a){e(a,"bpmn:StartEvent")&&i.report(a.id,"A is not allowed in "),e(a,"bpmn:EndEvent")&&i.report(a.id,"An is not allowed in ")})}return t("ad-hoc-sub-process",{check:n})},xd}var PM=RM(),AM=Xe(PM),Ed,Qx;function TM(){if(Qx)return Ed;Qx=1;let{annotateRule:e}=Ze();Ed=function(){function i(o,a){if(!t(o))return;(o.outgoing||[]).forEach(c=>{!n(c)&&!r(o,c)&&a.report(c.id,"Sequence flow is missing condition",["conditionExpression"])})}return e("conditional-flows",{check:i})};function t(i){let o=i.default,a=i.outgoing||[];return o||a.find(n)}function n(i){return!!i.conditionExpression}function r(i,o){return i.default===o}return Ed}var DM=TM(),MM=Xe(DM),wd,Jx;function kM(){if(Jx)return wd;Jx=1;let{is:e,isAny:t}=st,{annotateRule:n}=Ze();return wd=function(){function r(o){return(o.flowElements||[]).some(s=>e(s,"bpmn:EndEvent"))}function i(o,a){if(!(!t(o,["bpmn:Process","bpmn:SubProcess"])||e(o,"bpmn:AdHocSubProcess"))&&!r(o)){let s=e(o,"bpmn:SubProcess")?"Sub process":"Process";a.report(o.id,s+" is missing end event")}}return n("end-event-required",{check:i})},wd}var NM=kM(),OM=Xe(NM),Sd,eE;function BM(){if(eE)return Sd;eE=1;let{is:e}=st,{annotateRule:t}=Ze();Sd=function(){function r(i,o){if(!e(i,"bpmn:EventBasedGateway"))return;let a=i.outgoing||[];a.length<2&&o.report(i.id,"An must have at least 2 outgoing "),a.forEach(s=>{n(s)&&o.report(s.id,"A outgoing from an must not be conditional")})}return t("event-based-gateway",{check:r})};function n(r){return!!r.conditionExpression}return Sd}var IM=BM(),LM=Xe(IM),Cd,tE;function jM(){if(tE)return Cd;tE=1;let{is:e}=st,{annotateRule:t}=Ze();return Cd=function(){function n(r,i){if(!e(r,"bpmn:SubProcess")||!r.triggeredByEvent)return;(r.flowElements||[]).forEach(function(a){if(!e(a,"bpmn:StartEvent"))return!1;(a.eventDefinitions||[]).length===0&&i.report(a.id,"Start event is missing event definition",["eventDefinitions"])})}return t("event-sub-process-typed-start-event",{check:n})},Cd}var FM=jM(),HM=Xe(FM),Rd,nE;function $M(){if(nE)return Rd;nE=1;let{isAny:e}=st,{annotateRule:t}=Ze();return Rd=function(){function n(r,i){if(!e(r,["bpmn:Activity","bpmn:Event"]))return;(r.incoming||[]).length>1&&i.report(r.id,"Incoming flows do not join")}return t("fake-join",{check:n})},Rd}var zM=$M(),GM=Xe(zM),Pd,rE;function VM(){if(rE)return Pd;rE=1;let{is:e,isAny:t}=st,{annotateRule:n}=Ze();return Pd=function(){function r(u,p){if(!e(u,"bpmn:Definitions"))return!1;let l=i(u),f=o(u);l.forEach(d=>{a(d)||p.report(d.id,"Element is missing name"),s(d,f)||p.report(d.id,"Element is unused"),c(d,l)||p.report(d.id,"Element name is not unique")})}return n("global",{check:r});function i(u){return u.rootElements.filter(p=>t(p,["bpmn:Error","bpmn:Escalation","bpmn:Message","bpmn:Signal"]))}function o(u){let p=[];function l(f){e(f,"bpmn:Definitions")&&f.get("rootElements").length&&f.get("rootElements").forEach(l),e(f,"bpmn:FlowElementsContainer")&&f.get("flowElements").length&&f.get("flowElements").forEach(l),e(f,"bpmn:Event")&&f.get("eventDefinitions").length&&f.get("eventDefinitions").forEach(d=>p.push(d)),e(f,"bpmn:Collaboration")&&f.get("messageFlows").length&&f.get("messageFlows").forEach(l),t(f,["bpmn:MessageFlow","bpmn:ReceiveTask","bpmn:SendTask"])&&p.push(f)}return l(u),p}function a(u){var p;return((p=u.name)==null?void 0:p.trim())!==""}function s(u,p){if(e(u,"bpmn:Error"))return p.some(l=>{var f;return e(l,"bpmn:ErrorEventDefinition")&&u.get("id")===((f=l.get("errorRef"))==null?void 0:f.get("id"))});if(e(u,"bpmn:Escalation"))return p.some(l=>{var f;return e(l,"bpmn:EscalationEventDefinition")&&u.get("id")===((f=l.get("escalationRef"))==null?void 0:f.get("id"))});if(e(u,"bpmn:Message"))return p.some(l=>{var f;return t(l,["bpmn:MessageEventDefinition","bpmn:MessageFlow","bpmn:ReceiveTask","bpmn:SendTask"])&&u.get("id")===((f=l.get("messageRef"))==null?void 0:f.get("id"))});if(e(u,"bpmn:Signal"))return p.some(l=>{var f;return e(l,"bpmn:SignalEventDefinition")&&u.get("id")===((f=l.get("signalRef"))==null?void 0:f.get("id"))})}function c(u,p){return p.filter(l=>e(l,u.$type)&&u.name===l.name).length===1}},Pd}var WM=VM(),UM=Xe(WM),Ad,iE;function qM(){if(iE)return Ad;iE=1;let{is:e,isAny:t}=st,{annotateRule:n}=Ze();Ad=function(){function o(a,s){t(a,["bpmn:ParallelGateway","bpmn:EventBasedGateway"])||e(a,"bpmn:Gateway")&&!r(a)||e(a,"bpmn:SubProcess")||e(a,"bpmn:SequenceFlow")&&!i(a)||t(a,["bpmn:FlowNode","bpmn:SequenceFlow","bpmn:Participant","bpmn:Lane"])&&(a.name||"").trim().length===0&&s.report(a.id,"Element is missing label/name",["name"])}return n("label-required",{check:o})};function r(o){return(o.outgoing||[]).length>1}function i(o){return o.conditionExpression}return Ad}var KM=qM(),YM=Xe(KM);function XM(e){return Array.prototype.concat.apply([],e)}var oc=Object.prototype.toString,ZM=Object.prototype.hasOwnProperty;function ya(e){return e===void 0}function SE(e){return e!==void 0}function ul(e){return e==null}function pl(e){return oc.call(e)==="[object Array]"}function cl(e){return oc.call(e)==="[object Object]"}function QM(e){return oc.call(e)==="[object Number]"}function Ud(e){let t=oc.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function JM(e){return oc.call(e)==="[object String]"}function CE(e){if(!pl(e))throw new Error("must supply array")}function RE(e,t){return!ul(e)&&ZM.call(e,t)}function PE(e,t){let n=fl(t),r;return Xt(e,function(i,o){if(n(i,o))return r=i,!1}),r}function e2(e,t){let n=fl(t),r=pl(e)?-1:void 0;return Xt(e,function(i,o){if(n(i,o))return r=o,!1}),r}function t2(e,t){let n=fl(t),r=[];return Xt(e,function(i,o){n(i,o)&&r.push(i)}),r}function Xt(e,t){let n,r;if(ya(e))return;let i=pl(e)?p2:u2;for(let o in e)if(RE(e,o)&&(n=e[o],r=t(n,i(o)),r===!1))return n}function n2(e,t){if(ya(e))return[];CE(e);let n=fl(t);return e.filter(function(r,i){return!n(r,i)})}function AE(e,t,n){return Xt(e,function(r,i){n=t(n,r,i)}),n}function TE(e,t){return!!AE(e,function(n,r,i){return n&&t(r,i)},!0)}function r2(e,t){return!!PE(e,t)}function ll(e,t){let n=[];return Xt(e,function(r,i){n.push(t(r,i))}),n}function DE(e){return e&&Object.keys(e)||[]}function i2(e){return DE(e).length}function o2(e){return ll(e,t=>t)}function ME(e,t,n={}){return t=qd(t),Xt(e,function(r){let i=t(r)||"_",o=n[i];o||(o=n[i]=[]),o.push(r)}),n}function kE(e,...t){e=qd(e);let n={};return Xt(t,i=>ME(i,e,n)),ll(n,function(i,o){return i[0]})}var a2=kE;function s2(e,t){t=qd(t);let n=[];return Xt(e,function(r,i){let o=t(r,i),a={d:o,v:r};for(var s=0;sr.v)}function c2(e){return function(t){return TE(e,function(n,r){return t[r]===n})}}function qd(e){return Ud(e)?e:t=>t[e]}function fl(e){return Ud(e)?e:t=>t===e}function u2(e){return e}function p2(e){return Number(e)}function l2(e,t){let n,r,i,o;function a(l){let f=Date.now(),d=l?0:o+t-f;if(d>0)return s(d);e.apply(i,r),c()}function s(l){n=setTimeout(a,l)}function c(){n&&clearTimeout(n),n=o=r=i=void 0}function u(){n&&a(!0),c()}function p(...l){o=Date.now(),r=l,i=this,n||s(t)}return p.flush=u,p.cancel=c,p}function f2(e,t){let n=!1;return function(...r){n||(e(...r),n=!0,setTimeout(()=>{n=!1},t))}}function d2(e,t){return e.bind(t)}function m2(e,...t){return Object.assign(e,...t)}function h2(e,t,n){let r=e;return Xt(t,function(i,o){if(typeof i!="number"&&typeof i!="string")throw new Error("illegal key type: "+typeof i+". Key should be of type number or string.");if(i==="constructor")throw new Error("illegal key: constructor");if(i==="__proto__")throw new Error("illegal key: __proto__");let a=t[o+1],s=r[i];SE(a)&&ul(s)&&(s=r[i]=isNaN(+a)?{}:[]),ya(a)?ya(n)?delete r[i]:r[i]=n:r=s}),e}function v2(e,t,n){let r=e;return Xt(t,function(i){if(ul(r))return r=void 0,!1;r=r[i]}),ya(r)?n:r}function g2(e,t){let n={},r=Object(e);return Xt(t,function(i){i in r&&(n[i]=e[i])}),n}function y2(e,t){let n={},r=Object(e);return Xt(r,function(i,o){t.indexOf(o)===-1&&(n[o]=i)}),n}function NE(e,...t){return t.length&&Xt(t,function(n){!n||!cl(n)||Xt(n,function(r,i){if(i==="__proto__")return;let o=e[i];cl(r)?(cl(o)||(o={}),e[i]=NE(o,r)):e[i]=r})}),e}var _2=Object.freeze({__proto__:null,assign:m2,bind:d2,debounce:l2,ensureArray:CE,every:TE,filter:t2,find:PE,findIndex:e2,flatten:XM,forEach:Xt,get:v2,groupBy:ME,has:RE,isArray:pl,isDefined:SE,isFunction:Ud,isNil:ul,isNumber:QM,isObject:cl,isString:JM,isUndefined:ya,keys:DE,map:ll,matchPattern:c2,merge:NE,omit:y2,pick:g2,reduce:AE,set:h2,size:i2,some:r2,sortBy:s2,throttle:f2,unionBy:a2,uniqueBy:kE,values:o2,without:n2}),OE=EE(_2),Td,oE;function b2(){if(oE)return Td;oE=1;let{groupBy:e}=OE,{is:t}=st,{annotateRule:n}=Ze();Td=function(){function s(c,u){if(!t(c,"bpmn:FlowElementsContainer"))return;let p=(c.flowElements||[]).filter(r);for(let f of p)i(f)||u.report(f.id,"Link event is missing link name");let l=e(p,f=>i(f));for(let[f,d]of Object.entries(l)){if(!f)continue;if(d.length===1){let y=d[0];u.report(y.id,`Link ${o(y)?"catch":"throw"} event with link name <${f}> missing in scope`);continue}let m=d.filter(a);if(m.length>1)for(let y of m)u.report(y.id,`Duplicate link catch event with link name <${f}> in scope`);else if(m.length===0)for(let y of d)u.report(y.id,`Link catch event with link name <${f}> missing in scope`)}}return n("link-event",{check:s})};function r(s){var c=s.eventDefinitions||[];return t(s,"bpmn:Event")?c.some(u=>t(u,"bpmn:LinkEventDefinition")):!1}function i(s){return s.get("eventDefinitions").find(c=>t(c,"bpmn:LinkEventDefinition")).name}function o(s){return t(s,"bpmn:ThrowEvent")}function a(s){return t(s,"bpmn:CatchEvent")}return Td}var x2=b2(),E2=Xe(x2),Dd,aE;function w2(){if(aE)return Dd;aE=1;let{is:e}=st,{flatten:t}=OE,{annotateRule:n}=Ze();Dd=function(){function c(u,p){if(!e(u,"bpmn:Definitions"))return!1;let f=r(u.rootElements).filter(o),d=i(u);f.forEach(m=>{d.indexOf(m.id)===-1&&p.report(m.id,"Element is missing bpmndi")})}return n("no-bpmndi",{check:c})};function r(c){return t(c.map(u=>{let p=u.laneSets&&u.laneSets[0]||u.childLaneSet,l=t([u.flowElements||[],u.flowElements&&r(u.flowElements.filter(a))||[],u.participants||[],u.artifacts||[],p&&p.lanes||[],p&&p.lanes&&r(p.lanes.filter(s))||[],u.messageFlows||[]]);return l.length>0?l.map(f=>({id:f.id,$type:f.$type})):[]}))}function i(c){return t(c.get("diagrams").map(u=>(u.plane.planeElement||[]).map(l=>{var f;return(f=l.bpmnElement)==null?void 0:f.id})))}function o(c){return!["bpmn:DataObject"].includes(c.$type)}function a(c){return!!c.flowElements}function s(c){return!!c.childLaneSet}return Dd}var S2=w2(),C2=Xe(S2),Md,sE;function R2(){if(sE)return Md;sE=1;let e=Ze().checkDiscouragedNodeType;return Md=e("bpmn:ComplexGateway","no-complex-gateway"),Md}var P2=R2(),A2=Xe(P2),kd,cE;function T2(){if(cE)return kd;cE=1;let{isAny:e,is:t}=st,{annotateRule:n}=Ze();kd=function(){function a(s,c){if(!e(s,["bpmn:Task","bpmn:Gateway","bpmn:SubProcess","bpmn:Event"])||s.triggeredByEvent||o(s)||t(s.$parent,"bpmn:AdHocSubProcess"))return;let u=s.incoming||[],p=s.outgoing||[];!u.length&&!p.length&&c.report(s.id,"Element is not connected")}return n("no-disconnected",{check:a})};function r(a){var s=a.eventDefinitions;return!t(a,"bpmn:BoundaryEvent")||!s||s.length!==1?!1:t(s[0],"bpmn:CompensateEventDefinition")}function i(a){return a.isForCompensation}function o(a){var s=r(a),c=i(a);return s||c}return kd}var D2=T2(),M2=Xe(D2),Nd,uE;function k2(){if(uE)return Nd;uE=1;let{is:e}=st,{annotateRule:t}=Ze();Nd=function(){let r={},i={},o={};function a(s,c){if(!e(s,"bpmn:SequenceFlow"))return;let u=n(s);if(u in r){c.report(s.id,"SequenceFlow is a duplicate");let p=s.sourceRef.id,l=s.targetRef.id;i[p]||(c.report(p,"Duplicate outgoing sequence flows"),i[p]=!0),o[l]||(c.report(l,"Duplicate incoming sequence flows"),o[l]=!0)}else r[u]=s}return t("no-duplicate-sequence-flows",{check:a})};function n(r){let i=r.conditionExpression,o=i?i.body:"",a=r.sourceRef?r.sourceRef.id:r.id,s=r.targetRef?r.targetRef.id:r.id;return a+"#"+s+"#"+o}return Nd}var N2=k2(),O2=Xe(N2),Od,pE;function B2(){if(pE)return Od;pE=1;let{is:e}=st,{annotateRule:t}=Ze();return Od=function(){function n(r,i){if(!e(r,"bpmn:Gateway"))return;let o=r.incoming||[],a=r.outgoing||[];o.length>1&&a.length>1&&i.report(r.id,"Gateway forks and joins")}return t("no-gateway-join-fork",{check:n})},Od}var I2=B2(),L2=Xe(I2),Bd,lE;function j2(){if(lE)return Bd;lE=1;let{isAny:e}=st,{annotateRule:t}=Ze();Bd=function(){function i(o,a){if(!e(o,["bpmn:Activity","bpmn:Event"]))return;(o.outgoing||[]).filter(u=>!n(u)&&!r(o,u)).length>1&&a.report(o.id,"Flow splits implicitly")}return t("no-implicit-split",{check:i})};function n(i){return!!i.conditionExpression}function r(i,o){return i.default===o}return Bd}var F2=j2(),H2=Xe(F2),Id,fE;function $2(){if(fE)return Id;fE=1;let{is:e,isAny:t}=st,{findParent:n,annotateRule:r}=Ze();return Id=function(){function i(p){let l=p.eventDefinitions||[];return l.length&&l.every(f=>e(f,"bpmn:LinkEventDefinition"))}function o(p){let l=p.eventDefinitions||[];return l.length&&l.every(f=>e(f,"bpmn:CompensateEventDefinition"))}function a(p){return(n(p,"bpmn:Process").artifacts||[]).some(d=>e(d,"bpmn:Association")?d.sourceRef.id===p.id:!1)}function s(p){return p.isForCompensation}function c(p){let l=p.outgoing||[];return e(p,"bpmn:SubProcess")&&p.triggeredByEvent||e(p,"bpmn:IntermediateThrowEvent")&&i(p)||e(p.$parent,"bpmn:AdHocSubProcess")||e(p,"bpmn:EndEvent")||e(p,"bpmn:BoundaryEvent")&&o(p)&&a(p)||e(p,"bpmn:Activity")&&s(p)?!1:l.length===0}function u(p,l){t(p,["bpmn:Event","bpmn:Activity","bpmn:Gateway"])&&c(p)&&l.report(p.id,"Element is an implicit end")}return r("no-implicit-end",{check:u})},Id}var z2=$2(),G2=Xe(z2),Ld,dE;function V2(){if(dE)return Ld;dE=1;let{is:e,isAny:t}=st,{annotateRule:n}=Ze();return Ld=function(){function r(s){let c=s.eventDefinitions||[];return c.length&&c.every(u=>e(u,"bpmn:LinkEventDefinition"))}function i(s){return s.isForCompensation}function o(s){let c=s.incoming||[];return e(s,"bpmn:Activity")&&i(s)||e(s.$parent,"bpmn:AdHocSubProcess")||e(s,"bpmn:SubProcess")&&s.triggeredByEvent||e(s,"bpmn:IntermediateCatchEvent")&&r(s)||t(s,["bpmn:StartEvent","bpmn:BoundaryEvent"])?!1:c.length===0}function a(s,c){t(s,["bpmn:Event","bpmn:Activity","bpmn:Gateway"])&&o(s)&&c.report(s.id,"Element is an implicit start")}return n("no-implicit-start",{check:a})},Ld}var W2=V2(),U2=Xe(W2),jd,mE;function q2(){if(mE)return jd;mE=1;let e=Ze().checkDiscouragedNodeType;return jd=e("bpmn:InclusiveGateway","no-inclusive-gateway"),jd}var K2=q2(),Y2=Xe(K2),Fd,hE;function X2(){if(hE)return Fd;hE=1;let{is:e}=st,{annotateRule:t}=Ze();Fd=function(){function c(u,p){if(!e(u,"bpmn:Definitions"))return;let l=u.rootElements||[],f=new Set,d=new Set,m=s(u),y=new Map;l.filter(v=>e(v,"bpmn:Collaboration")).forEach(v=>{let w=v.participants||[];r(w,f,m),w.forEach(R=>{y.set(R.processRef,m.get(R))})}),l.filter(v=>e(v,"bpmn:Process")).forEach(v=>{let w=y.get(v)||{};n(v,f,d,m,w)}),f.forEach(v=>p.report(v.id,"Element overlaps with other element")),d.forEach(v=>p.report(v.id,"Element is outside of parent boundary"))}return t("no-overlapping-elements",{check:c})};function n(c,u,p,l,f){let d=c.flowElements||[],m=d.filter(v=>l.has(v));r(m,u,l),m.forEach(v=>{!e(v,"bpmn:DataStoreReference")&&i(l.get(v).bounds,f.bounds)&&p.add(v)}),d.filter(v=>e(v,"bpmn:SubProcess")).forEach(v=>{let w=l.get(v)||{},R=w.isExpanded?w:{};n(v,u,p,l,R)})}function r(c,u,p){var l,f;for(let d=0;d=u.x&&c.y>=u.y,l=c.x+c.width<=u.x+u.width&&c.y+c.height<=u.y+u.height;return!(p&&l)}function o(c,u){if(!a(c)||!a(u))return!1;let p=c.x+c.width>=u.x&&u.x+u.width>=c.x,l=c.y+c.height>=u.y&&u.y+u.height>=c.y;return p&&l}function a(c){return!!c&&e(c,"dc:Bounds")&&typeof c.x=="number"&&typeof c.y=="number"&&typeof c.width=="number"&&typeof c.height=="number"}function s(c){let u=new Map;return(c.diagrams||[]).filter(l=>!!l.plane).forEach(l=>{(l.plane.planeElement||[]).filter(d=>!!d.bpmnElement).forEach(d=>{u.set(d.bpmnElement,d)})}),u}return Fd}var Z2=X2(),Q2=Xe(Z2),Hd,vE;function J2(){if(vE)return Hd;vE=1;let{is:e}=st,{annotateRule:t}=Ze();return Hd=function(){function n(r,i){if(!e(r,"bpmn:FlowElementsContainer"))return;if((r.flowElements||[]).filter(function(s){return e(s,"bpmn:StartEvent")?(s.eventDefinitions||[]).length===0:!1}).length>1){let s=e(r,"bpmn:SubProcess")?"Sub process":"Process";i.report(r.id,s+" has multiple blank start events")}}return t("single-blank-start-event",{check:n})},Hd}var ek=J2(),tk=Xe(ek),$d,gE;function nk(){if(gE)return $d;gE=1;let{is:e}=st,{annotateRule:t}=Ze();return $d=function(){function n(r,i){if(!e(r,"bpmn:Event"))return;(r.eventDefinitions||[]).length>1&&i.report(r.id,"Event has multiple event definitions",["eventDefinitions"])}return t("single-event-definition",{check:n})},$d}var rk=nk(),ik=Xe(rk),zd,yE;function ok(){if(yE)return zd;yE=1;let{is:e,isAny:t}=st,{annotateRule:n}=Ze();return zd=function(){function r(o){return(o.flowElements||[]).some(s=>e(s,"bpmn:StartEvent"))}function i(o,a){if(!(!t(o,["bpmn:Process","bpmn:SubProcess"])||e(o,"bpmn:AdHocSubProcess"))&&!r(o)){let s=e(o,"bpmn:SubProcess")?"Sub process":"Process";a.report(o.id,s+" is missing start event")}}return n("start-event-required",{check:i})},zd}var ak=ok(),sk=Xe(ak),Gd,_E;function ck(){if(_E)return Gd;_E=1;let{is:e}=st,{annotateRule:t}=Ze();return Gd=function(){function n(r,i){if(!e(r,"bpmn:SubProcess")||r.triggeredByEvent)return;(r.flowElements||[]).forEach(function(a){if(!e(a,"bpmn:StartEvent"))return!1;(a.eventDefinitions||[]).length>0&&i.report(a.id,"Start event must be blank",["eventDefinitions"])})}return t("sub-process-blank-start-event",{check:n})},Gd}var uk=ck(),pk=Xe(uk),Vd,bE;function lk(){if(bE)return Vd;bE=1;let{is:e}=st,{annotateRule:t}=Ze();return Vd=function(){function n(r,i){if(!e(r,"bpmn:Gateway"))return;let o=r.incoming||[],a=r.outgoing||[];o.length===1&&a.length===1&&i.report(r.id,"Gateway is superfluous. It only has one source and target.")}return t("superfluous-gateway",{check:n})},Vd}var fk=lk(),dk=Xe(fk),Wd,xE;function mk(){if(xE)return Wd;xE=1;let{is:e,isAny:t}=st,{annotateRule:n}=Ze();Wd=function(){function o(a,s){if(!t(a,["bpmn:Process","bpmn:SubProcess"]))return;let u=(a.flowElements||[]).filter(f=>e(f,"bpmn:FlowNode")&&(f.outgoing||[]).length===0),p=u.filter(r);if(p.length!==1)return;if(u.every(f=>i(f)||r(f)))for(let f of p)s.report(f.id,"Termination is superfluous.")}return n("superfluous-termination",{check:o})};function r(o){return e(o,"bpmn:EndEvent")&&(o.eventDefinitions||[]).some(a=>e(a,"bpmn:TerminateEventDefinition"))}function i(o){return e(o,"bpmn:SubProcess")&&o.triggeredByEvent&&(o.flowElements||[]).some(s=>e(s,"bpmn:StartEvent")&&s.isInterrupting)}return Wd}var hk=mk(),vk=Xe(hk),qe={};function Kd(){}Kd.prototype.resolveRule=function(e,t){let n=qe[e+"/"+t];if(!n)throw new Error("cannot resolve rule <"+e+"/"+t+">: not bundled");return n};Kd.prototype.resolveConfig=function(e,t){throw new Error("cannot resolve config <"+t+"> in <"+e+">: not bundled")};var BE=new Kd,gk={"ad-hoc-sub-process":"error","conditional-flows":"error","end-event-required":"error","event-based-gateway":"error","event-sub-process-typed-start-event":"error","fake-join":"warn",global:"warn","label-required":"error","link-event":"error","no-bpmndi":"error","no-complex-gateway":"error","no-disconnected":"error","no-duplicate-sequence-flows":"error","no-gateway-join-fork":"error","no-implicit-split":"error","no-implicit-end":"error","no-implicit-start":"error","no-inclusive-gateway":"warn","no-overlapping-elements":"warn","single-blank-start-event":"error","single-event-definition":"error","start-event-required":"error","sub-process-blank-start-event":"error","superfluous-gateway":"warn","superfluous-termination":"warn"},IE={rules:gk};qe["bpmnlint/ad-hoc-sub-process"]=AM;qe["bpmnlint/conditional-flows"]=MM;qe["bpmnlint/end-event-required"]=OM;qe["bpmnlint/event-based-gateway"]=LM;qe["bpmnlint/event-sub-process-typed-start-event"]=HM;qe["bpmnlint/fake-join"]=GM;qe["bpmnlint/global"]=UM;qe["bpmnlint/label-required"]=YM;qe["bpmnlint/link-event"]=E2;qe["bpmnlint/no-bpmndi"]=C2;qe["bpmnlint/no-complex-gateway"]=A2;qe["bpmnlint/no-disconnected"]=M2;qe["bpmnlint/no-duplicate-sequence-flows"]=O2;qe["bpmnlint/no-gateway-join-fork"]=L2;qe["bpmnlint/no-implicit-split"]=H2;qe["bpmnlint/no-implicit-end"]=G2;qe["bpmnlint/no-implicit-start"]=U2;qe["bpmnlint/no-inclusive-gateway"]=Y2;qe["bpmnlint/no-overlapping-elements"]=Q2;qe["bpmnlint/single-blank-start-event"]=tk;qe["bpmnlint/single-event-definition"]=ik;qe["bpmnlint/start-event-required"]=sk;qe["bpmnlint/sub-process-blank-start-event"]=pk;qe["bpmnlint/superfluous-gateway"]=dk;qe["bpmnlint/superfluous-termination"]=vk;var Yd=globalThis;Object.assign(Ht,{Modeler:Ht,NavigatedViewer:ir,Viewer:tn});Yd.BpmnJS=Ht;var LE={config:IE,resolver:BE};Yd.BpmnLintModule=bd;Yd.BpmnLintConfig=LE;for(let e of[Ht,ir,tn])e.lintModule=bd,e.lintConfig=LE;var Kee=Ht;})(); diff --git a/vendor/bpmn-js/dist/bpmn-viewer.production.min.js b/vendor/bpmn-js/dist/bpmn-viewer.production.min.js index 1e22d39..a57af8b 100644 --- a/vendor/bpmn-js/dist/bpmn-viewer.production.min.js +++ b/vendor/bpmn-js/dist/bpmn-viewer.production.min.js @@ -1,10 +1,48 @@ /*! bpmn-js - 18.14.0 | generated for dokuwiki-plugin-bpmnio | SEE LICENSE IN LICENSE */ -(()=>{function Ee(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}var Vt=Object.prototype.toString,wo=Object.prototype.hasOwnProperty;function Jt(e){return e===void 0}function Et(e){return e!==void 0}function jr(e){return e==null}function ye(e){return Vt.call(e)==="[object Array]"}function Ae(e){return Vt.call(e)==="[object Object]"}function Te(e){return Vt.call(e)==="[object Number]"}function ot(e){let t=Vt.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function ke(e){return Vt.call(e)==="[object String]"}function Ue(e,t){return!jr(e)&&wo.call(e,t)}function he(e,t){let r=$r(t),n;return R(e,function(i,o){if(r(i,o))return n=i,!1}),n}function Pn(e,t){let r=$r(t),n=ye(e)?-1:void 0;return R(e,function(i,o){if(r(i,o))return n=o,!1}),n}function Xe(e,t){let r=$r(t),n=[];return R(e,function(i,o){r(i,o)&&n.push(i)}),n}function R(e,t){let r,n;if(Jt(e))return;let i=ye(e)?bo:_o;for(let o in e)if(Ue(e,o)&&(r=e[o],n=t(r,i(o)),n===!1))return r}function Ze(e,t,r){return R(e,function(n,i){r=t(r,n,i)}),r}function Vr(e,t){return!!Ze(e,function(r,n,i){return r&&t(n,i)},!0)}function er(e,t){return!!he(e,t)}function Tn(e,t){let r=[];return R(e,function(n,i){r.push(t(n,i))}),r}function Wr(e){return function(t){return Vr(e,function(r,n){return t[n]===r})}}function $r(e){return ot(e)?e:t=>t===e}function _o(e){return e}function bo(e){return Number(e)}function kn(e,t){let r,n,i,o;function u(A){let j=Date.now(),$=A?0:o+t-j;if($>0)return l($);e.apply(i,n),f()}function l(A){r=setTimeout(u,A)}function f(){r&&clearTimeout(r),r=o=n=i=void 0}function d(){r&&u(!0),f()}function g(...A){o=Date.now(),n=A,i=this,r||l(t)}return g.flush=d,g.cancel=f,g}function qe(e,t){return e.bind(t)}function k(e,...t){return Object.assign(e,...t)}function Mn(e,t,r){let n=e;return R(t,function(i,o){if(typeof i!="number"&&typeof i!="string")throw new Error("illegal key type: "+typeof i+". Key should be of type number or string.");if(i==="constructor")throw new Error("illegal key: constructor");if(i==="__proto__")throw new Error("illegal key: __proto__");let u=t[o+1],l=n[i];Et(u)&&jr(l)&&(l=n[i]=isNaN(+u)?{}:[]),Jt(u)?Jt(r)?delete n[i]:n[i]=r:n=l}),e}function Dn(e,t){let r={},n=Object(e);return R(t,function(i){i in n&&(r[i]=e[i])}),r}function Nn(e,t){let r={},n=Object(e);return R(n,function(i,o){t.indexOf(o)===-1&&(r[o]=i)}),r}var Ao=1e3;function We(e,t){var r=this;t=t||Ao,e.on(["render.shape","render.connection"],t,function(n,i){var o=n.type,u=i.element,l=i.gfx,f=i.attrs;if(r.canRender(u))return o==="render.shape"?r.drawShape(l,u,f):r.drawConnection(l,u,f)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(n,i){if(r.canRender(i))return n.type==="render.getShapePath"?r.getShapePath(i):r.getConnectionPath(i)})}We.prototype.canRender=function(e){};We.prototype.drawShape=function(e,t){};We.prototype.drawConnection=function(e,t){};We.prototype.getShapePath=function(e){};We.prototype.getConnectionPath=function(e){};function D(e,t){var r=re(e);return r&&typeof r.$instanceOf=="function"&&r.$instanceOf(t)}function Bn(e,t){return er(t,function(r){return D(e,r)})}function re(e){return e&&e.businessObject||e}function $e(e){return e&&e.di}function at(e,t){return D(e,"bpmn:CallActivity")?!1:D(e,"bpmn:SubProcess")?(t=t||$e(e),t&&D(t,"bpmndi:BPMNPlane")?!0:t&&!!t.isExpanded):D(e,"bpmn:Participant")?!!re(e).processRef:!0}function zr(e){if(!(!D(e,"bpmn:Participant")&&!D(e,"bpmn:Lane"))){var t=$e(e).isHorizontal;return t===void 0?!0:t}}function On(e){return e&&!!re(e).triggeredByEvent}function Ln(e){return Ae(e)&&Ue(e,"waypoints")}function Hr(e){return Ae(e)&&Ue(e,"labelTarget")}var tr={width:90,height:20},In=15;function Fn(e){return D(e,"bpmn:Event")||D(e,"bpmn:Gateway")||D(e,"bpmn:DataStoreReference")||D(e,"bpmn:DataObjectReference")||D(e,"bpmn:DataInput")||D(e,"bpmn:DataOutput")||D(e,"bpmn:SequenceFlow")||D(e,"bpmn:MessageFlow")||D(e,"bpmn:Group")}function So(e){var t=e.length/2-1,r=e[Math.floor(t)],n=e[Math.ceil(t+.01)],i=Ro(e),o=Math.atan((n.y-r.y)/(n.x-r.x)),u=i.x,l=i.y;return Math.abs(o)"+e+"",t=!0);var r=Oo(e);if(!t)return r;for(var n=document.createDocumentFragment(),i=r.firstChild;i.firstChild;)n.appendChild(i.firstChild);return n}function Oo(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function J(e,t){var r;return e=e.trim(),e.charAt(0)==="<"?(r=qn(e).firstChild,r=document.importNode(r,!0)):r=document.createElementNS(Gr.svg,e),t&&Q(r,t),r}var Ur=null;function Yr(){return Ur===null&&(Ur=J("svg")),Ur}function Wn(e,t){var r,n,i=Object.keys(t);for(r=0;n=i[r];r++)e[n]=t[n];return e}function Kn(e,t,r,n,i,o){var u=Yr().createSVGMatrix();switch(arguments.length){case 0:return u;case 1:return Wn(u,e);case 6:return Wn(u,{a:e,b:t,c:r,d:n,e:i,f:o})}}function Pt(e){return e?Yr().createSVGTransformFromMatrix(e):Yr().createSVGTransform()}var $n=/([&<>]{1})/g,Lo=/([&<>\n\r"]{1})/g,Io={"&":"&","<":"<",">":">",'"':"'"};function qr(e,t){function r(n,i){return Io[i]||i}return e.replace(t,r)}function Yn(e,t){var r,n,i,o,u;switch(e.nodeType){case 3:t.push(qr(e.textContent,$n));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(i=e.attributes,r=0,n=i.length;r"),u=e.childNodes,r=0,n=u.length;r")}else t.push("/>");break;case 8:t.push("");break;case 4:t.push("");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function Fo(e,t){var r=qn(t);if(Bo(e),!!t){Vo(r)||(r=r.documentElement);for(var n=Wo(r.childNodes),i=0;i",""],tr:[2,"","
          "],col:[2,"","
          "],_default:[0,"",""]};fe.td=fe.th=[3,"","
          "];fe.option=fe.optgroup=[1,'"];fe.thead=fe.tbody=fe.colgroup=fe.caption=fe.tfoot=[1,"","
          "];fe.polyline=fe.ellipse=fe.polygon=fe.circle=fe.text=fe.line=fe.path=fe.rect=fe.g=[1,'',""];function xe(e,t=globalThis.document){var d;if(typeof e!="string")throw new TypeError("String expected");let r=/^$/s.exec(e);if(r)return t.createComment(r[1]);let n=(d=/<([\w:]+)/.exec(e))==null?void 0:d[1];if(!n)return t.createTextNode(e);if(e=e.trim(),n==="body"){let g=t.createElement("html");g.innerHTML=e;let{lastChild:A}=g;return A.remove(),A}let[i,o,u]=Object.hasOwn(fe,n)?fe[n]:fe._default,l=t.createElement("div");for(l.innerHTML=o+e+u;i--;)l=l.lastChild;if(l.firstChild===l.lastChild){let{firstChild:g}=l;return g.remove(),g}let f=t.createDocumentFragment();return f.append(...l.childNodes),f}function Yo(e,t){return t.forEach(function(r){r&&typeof r!="string"&&!Array.isArray(r)&&Object.keys(r).forEach(function(n){if(n!=="default"&&!(n in e)){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}})}),Object.freeze(e)}function we(e,...t){let r=e.style;return R(t,function(n){n&&R(n,function(i,o){r[o]=i})}),e}function or(e,t,r){return arguments.length==2?e.getAttribute(t):r===null?e.removeAttribute(t):(e.setAttribute(t,r),e)}var Go=Object.prototype.toString;function _t(e){return new ht(e)}function ht(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}ht.prototype.add=function(e){return this.list.add(e),this};ht.prototype.remove=function(e){return Go.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)};ht.prototype.removeMatching=function(e){let t=this.array();for(let r=0;r=Math.pow(2,t)?e(t,r):u};return e.rack=function(t,r,n){var i=function(u){var l=0;do{if(l++>10)if(n)t+=n;else throw new Error("too many ID collisions, use more bits");var f=e(t,r)}while(Object.hasOwnProperty.call(o,f));return o[f]=u,f},o=i.hats={};return i.get=function(u){return i.hats[u]},i.set=function(u,l){return i.hats[u]=l,i},i.bits=t||128,i.base=r||16,i},tn.exports}var ia=na(),oa=ra(ia);function Qe(e){if(!(this instanceof Qe))return new Qe(e);e=e||[128,36,1],this._seed=e.length?oa.rack(e[0],e[1],e[2]):e}Qe.prototype.next=function(e){return this._seed(e||!0)};Qe.prototype.nextPrefixed=function(e,t){var r;do r=e+this.next(!0);while(this.assigned(r));return this.claim(r,t),r};Qe.prototype.claim=function(e,t){this._seed.set(e,t||!0)};Qe.prototype.assigned=function(e){return this._seed.get(e)||!1};Qe.prototype.unclaim=function(e){delete this._seed.hats[e]};Qe.prototype.clear=function(){var e=this._seed.hats,t;for(t in e)this.unclaim(t)};var aa=new Qe,sa=10,cr=3,ua=1.5,fr=10,la=4,Nt=.95,ca=1,fa=.25;function ut(e,t,r,n,i,o,u){We.call(this,t,u);var l=e&&e.defaultFillColor,f=e&&e.defaultStrokeColor,d=e&&e.defaultLabelColor;function g(c){return r.computeStyle(c,{strokeLinecap:"round",strokeLinejoin:"round",stroke:nr,strokeWidth:2,fill:"white"})}function A(c){return r.computeStyle(c,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:nr,strokeWidth:2})}function j(c,s){var{ref:a={x:0,y:0},scale:p=1,element:h,parentGfx:y=i._svg}=s,w=J("marker",{id:c,viewBox:"0 0 20 20",refX:a.x,refY:a.y,markerWidth:20*p,markerHeight:20*p,orient:"auto"});ae(w,h);var O=Le(":scope > defs",y);O||(O=J("defs"),ae(y,O)),ae(O,w)}function $(c,s,a,p){var h=aa.nextPrefixed("marker-");return ne(c,h,s,a,p),"url(#"+h+")"}function ne(c,s,a,p,h){if(a==="sequenceflow-end"){var y=J("path",{d:"M 1 5 L 11 10 L 1 15 Z",...g({fill:h,stroke:h,strokeWidth:1})});j(s,{element:y,ref:{x:11,y:10},scale:.5,parentGfx:c})}if(a==="messageflow-start"){var w=J("circle",{cx:6,cy:6,r:3.5,...g({fill:p,stroke:h,strokeWidth:1,strokeDasharray:[1e4,1]})});j(s,{element:w,ref:{x:6,y:6},parentGfx:c})}if(a==="messageflow-end"){var O=J("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...g({fill:p,stroke:h,strokeWidth:1,strokeDasharray:[1e4,1]})});j(s,{element:O,ref:{x:8.5,y:5},parentGfx:c})}if(a==="association-start"){var U=J("path",{d:"M 11 5 L 1 10 L 11 15",...A({fill:"none",stroke:h,strokeWidth:1.5,strokeDasharray:[1e4,1]})});j(s,{element:U,ref:{x:1,y:10},scale:.5,parentGfx:c})}if(a==="association-end"){var ce=J("path",{d:"M 1 5 L 11 10 L 1 15",...A({fill:"none",stroke:h,strokeWidth:1.5,strokeDasharray:[1e4,1]})});j(s,{element:ce,ref:{x:11,y:10},scale:.5,parentGfx:c})}if(a==="conditional-flow-marker"){var ue=J("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...g({fill:p,stroke:h})});j(s,{element:ue,ref:{x:-1,y:10},scale:.5,parentGfx:c})}if(a==="conditional-default-flow-marker"){var de=J("path",{d:"M 6 4 L 10 16",...g({stroke:h,fill:"none"})});j(s,{element:de,ref:{x:0,y:10},scale:.5,parentGfx:c})}}function V(c,s,a,p,h={}){Ae(p)&&(h=p,p=0),p=p||0,h=g(h);var y=s/2,w=a/2,O=J("circle",{cx:y,cy:w,r:Math.round((s+a)/4-p),...h});return ae(c,O),O}function q(c,s,a,p,h,y){Ae(h)&&(y=h,h=0),h=h||0,y=g(y);var w=J("rect",{x:h,y:h,width:s-h*2,height:a-h*2,rx:p,ry:p,...y});return ae(c,w),w}function Y(c,s,a,p){var h=s/2,y=a/2,w=[{x:h,y:0},{x:s,y},{x:h,y:a},{x:0,y}],O=w.map(function(ce){return ce.x+","+ce.y}).join(" ");p=g(p);var U=J("polygon",{...p,points:O});return ae(c,U),U}function Z(c,s,a,p){a=A(a);var h=Tt(s,a,p);return ae(c,h),h}function P(c,s,a){return Z(c,s,a,5)}function m(c,s,a){a=A(a);var p=J("path",{...a,d:s});return ae(c,p),p}function _(c,s,a,p){return m(s,a,k({"data-marker":c},p))}function S(c){return De[c]}function F(c){return function(s,a,p){return S(c)(s,a,p)}}var v={"bpmn:MessageEventDefinition":function(c,s,a={},p){var h=n.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:a.width||s.width,containerHeight:a.height||s.height,position:{mx:.235,my:.315}}),y=p?C(s,f,a.stroke):z(s,l,a.fill),w=p?z(s,l,a.fill):C(s,f,a.stroke),O=m(c,h,{fill:y,stroke:w,strokeWidth:1});return O},"bpmn:TimerEventDefinition":function(c,s,a={}){var p=a.width||s.width,h=a.height||s.height,y=a.width?1:2,w=V(c,p,h,.2*h,{fill:z(s,l,a.fill),stroke:C(s,f,a.stroke),strokeWidth:y}),O=n.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:p,containerHeight:h,position:{mx:.5,my:.5}});m(c,O,{stroke:C(s,f,a.stroke),strokeWidth:y});for(var U=0;U<12;U++){var ce=n.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:p,containerHeight:h,position:{mx:.5,my:.5}}),ue=p/2,de=h/2;m(c,ce,{strokeWidth:1,stroke:C(s,f,a.stroke),transform:"rotate("+U*30+","+de+","+ue+")"})}return w},"bpmn:EscalationEventDefinition":function(c,s,a={},p){var h=n.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:a.width||s.width,containerHeight:a.height||s.height,position:{mx:.5,my:.2}}),y=p?C(s,f,a.stroke):z(s,l,a.fill);return m(c,h,{fill:y,stroke:C(s,f,a.stroke),strokeWidth:1})},"bpmn:ConditionalEventDefinition":function(c,s,a={}){var p=n.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:a.width||s.width,containerHeight:a.height||s.height,position:{mx:.5,my:.222}});return m(c,p,{fill:z(s,l,a.fill),stroke:C(s,f,a.stroke),strokeWidth:1})},"bpmn:LinkEventDefinition":function(c,s,a={},p){var h=n.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:s.width,containerHeight:s.height,position:{mx:.57,my:.263}}),y=p?C(s,f,a.stroke):z(s,l,a.fill);return m(c,h,{fill:y,stroke:C(s,f,a.stroke),strokeWidth:1})},"bpmn:ErrorEventDefinition":function(c,s,a={},p){var h=n.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:a.width||s.width,containerHeight:a.height||s.height,position:{mx:.2,my:.722}}),y=p?C(s,f,a.stroke):z(s,l,a.fill);return m(c,h,{fill:y,stroke:C(s,f,a.stroke),strokeWidth:1})},"bpmn:CancelEventDefinition":function(c,s,a={},p){var h=n.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:s.width,containerHeight:s.height,position:{mx:.638,my:-.055}}),y=p?C(s,f,a.stroke):"none",w=m(c,h,{fill:y,stroke:C(s,f,a.stroke),strokeWidth:1});return ii(w,45),w},"bpmn:CompensateEventDefinition":function(c,s,a={},p){var h=n.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:a.width||s.width,containerHeight:a.height||s.height,position:{mx:.22,my:.5}}),y=p?C(s,f,a.stroke):z(s,l,a.fill);return m(c,h,{fill:y,stroke:C(s,f,a.stroke),strokeWidth:1})},"bpmn:SignalEventDefinition":function(c,s,a={},p){var h=n.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:a.width||s.width,containerHeight:a.height||s.height,position:{mx:.5,my:.2}}),y=p?C(s,f,a.stroke):z(s,l,a.fill);return m(c,h,{strokeWidth:1,fill:y,stroke:C(s,f,a.stroke)})},"bpmn:MultipleEventDefinition":function(c,s,a={},p){var h=n.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:a.width||s.width,containerHeight:a.height||s.height,position:{mx:.211,my:.36}}),y=p?C(s,f,a.stroke):z(s,l,a.fill);return m(c,h,{fill:y,stroke:C(s,f,a.stroke),strokeWidth:1})},"bpmn:ParallelMultipleEventDefinition":function(c,s,a={}){var p=n.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:a.width||s.width,containerHeight:a.height||s.height,position:{mx:.458,my:.194}});return m(c,p,{fill:z(s,l,a.fill),stroke:C(s,f,a.stroke),strokeWidth:1})},"bpmn:TerminateEventDefinition":function(c,s,a={}){var p=V(c,s.width,s.height,8,{fill:C(s,f,a.stroke),stroke:C(s,f,a.stroke),strokeWidth:4});return p}};function T(c,s,a={},p){var h=re(c),y=Gn(h),w=p||c;return h.get("eventDefinitions")&&h.get("eventDefinitions").length>1?h.get("parallelMultiple")?v["bpmn:ParallelMultipleEventDefinition"](s,w,a,y):v["bpmn:MultipleEventDefinition"](s,w,a,y):Ke(h,"bpmn:MessageEventDefinition")?v["bpmn:MessageEventDefinition"](s,w,a,y):Ke(h,"bpmn:TimerEventDefinition")?v["bpmn:TimerEventDefinition"](s,w,a,y):Ke(h,"bpmn:ConditionalEventDefinition")?v["bpmn:ConditionalEventDefinition"](s,w,a,y):Ke(h,"bpmn:SignalEventDefinition")?v["bpmn:SignalEventDefinition"](s,w,a,y):Ke(h,"bpmn:EscalationEventDefinition")?v["bpmn:EscalationEventDefinition"](s,w,a,y):Ke(h,"bpmn:LinkEventDefinition")?v["bpmn:LinkEventDefinition"](s,w,a,y):Ke(h,"bpmn:ErrorEventDefinition")?v["bpmn:ErrorEventDefinition"](s,w,a,y):Ke(h,"bpmn:CancelEventDefinition")?v["bpmn:CancelEventDefinition"](s,w,a,y):Ke(h,"bpmn:CompensateEventDefinition")?v["bpmn:CompensateEventDefinition"](s,w,a,y):Ke(h,"bpmn:TerminateEventDefinition")?v["bpmn:TerminateEventDefinition"](s,w,a,y):null}var b={ParticipantMultiplicityMarker:function(c,s,a={}){var p=Oe(s,a),h=Se(s,a),y=n.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:p,containerHeight:h,position:{mx:(p/2-6)/p,my:(h-15)/h}});_("participant-multiplicity",c,y,{strokeWidth:2,fill:z(s,l,a.fill),stroke:C(s,f,a.stroke)})},SubProcessMarker:function(c,s,a={}){var p=q(c,14,14,0,{strokeWidth:1,fill:z(s,l,a.fill),stroke:C(s,f,a.stroke)});lr(p,s.width/2-7.5,s.height-20);var h=n.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:s.width,containerHeight:s.height,position:{mx:(s.width/2-7.5)/s.width,my:(s.height-20)/s.height}});_("sub-process",c,h,{fill:z(s,l,a.fill),stroke:C(s,f,a.stroke)})},ParallelMarker:function(c,s,a){var p=Oe(s,a),h=Se(s,a),y=n.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:p,containerHeight:h,position:{mx:(p/2+a.parallel)/p,my:(h-20)/h}});_("parallel",c,y,{fill:z(s,l,a.fill),stroke:C(s,f,a.stroke)})},SequentialMarker:function(c,s,a){var p=n.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:s.width,containerHeight:s.height,position:{mx:(s.width/2+a.seq)/s.width,my:(s.height-19)/s.height}});_("sequential",c,p,{fill:z(s,l,a.fill),stroke:C(s,f,a.stroke)})},CompensationMarker:function(c,s,a){var p=n.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:s.width,containerHeight:s.height,position:{mx:(s.width/2+a.compensation)/s.width,my:(s.height-13)/s.height}});_("compensation",c,p,{strokeWidth:1,fill:z(s,l,a.fill),stroke:C(s,f,a.stroke)})},LoopMarker:function(c,s,a){var p=Oe(s,a),h=Se(s,a),y=n.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:p,containerHeight:h,position:{mx:(p/2+a.loop)/p,my:(h-7)/h}});_("loop",c,y,{strokeWidth:1.5,fill:"none",stroke:C(s,f,a.stroke),strokeMiterlimit:.5})},AdhocMarker:function(c,s,a){var p=Oe(s,a),h=Se(s,a),y=n.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:p,containerHeight:h,position:{mx:(p/2+a.adhoc)/p,my:(h-15)/h}});_("adhoc",c,y,{strokeWidth:1,fill:C(s,f,a.stroke),stroke:C(s,f,a.stroke)})}};function B(c,s,a,p){b[c](s,a,p)}function M(c,s,a=[],p={}){p={fill:p.fill,stroke:p.stroke,width:Oe(s,p),height:Se(s,p)};var h=re(s),y=a.includes("SubProcessMarker");y?p={...p,seq:-21,parallel:-22,compensation:-25,loop:-18,adhoc:10}:p={...p,seq:-5,parallel:-6,compensation:-7,loop:0,adhoc:-8},h.get("isForCompensation")&&a.push("CompensationMarker"),D(h,"bpmn:AdHocSubProcess")&&(a.push("AdhocMarker"),y||k(p,{compensation:p.compensation-18}));var w=h.get("loopCharacteristics"),O=w&&w.get("isSequential");w&&(k(p,{compensation:p.compensation-18}),a.includes("AdhocMarker")&&k(p,{seq:-23,loop:-18,parallel:-24}),O===void 0&&a.push("LoopMarker"),O===!1&&a.push("ParallelMarker"),O===!0&&a.push("SequentialMarker")),a.includes("CompensationMarker")&&a.length===1&&k(p,{compensation:-8}),R(a,function(U){B(U,c,s,p)})}function N(c,s,a={}){a=k({size:{width:100}},a);var p=o.createText(s||"",a);return Be(p).add("djs-label"),ae(c,p),p}function H(c,s,a,p={}){var h=re(s),y=Mt({x:s.x,y:s.y,width:s.width,height:s.height},p);return N(c,h.name,{align:a,box:y,padding:7,style:{fill:kt(s,d,f,p.stroke)}})}function Ge(c,s,a={}){var p={width:90,height:30,x:s.width/2+s.x,y:s.height/2+s.y};return N(c,Ct(s),{box:p,fitBox:!0,style:k({},o.getExternalStyle(),{fill:kt(s,d,f,a.stroke)})})}function ie(c,s,a,p={}){var h=zr(a),y=N(c,s,{box:{height:30,width:h?Se(a,p):Oe(a,p)},align:"center-middle",style:{fill:kt(a,d,f,p.stroke)}});if(h){var w=-1*Se(a,p);ur(y,0,-w,270)}}function G(c,s,a={}){var{width:p,height:h}=Mt(s,a);return q(c,p,h,fr,{...a,fill:z(s,l,a.fill),fillOpacity:Nt,stroke:C(s,f,a.stroke)})}function ze(c,s,a={}){var p=re(s),h=z(s,l,a.fill),y=C(s,f,a.stroke);return(p.get("associationDirection")==="One"||p.get("associationDirection")==="Both")&&(a.markerEnd=$(c,"association-end",h,y)),p.get("associationDirection")==="Both"&&(a.markerStart=$(c,"association-start",h,y)),a=K(a,["markerStart","markerEnd"]),P(c,s.waypoints,{...a,stroke:y,strokeDasharray:"0, 5"})}function He(c,s,a={}){var p=z(s,l,a.fill),h=C(s,f,a.stroke),y=n.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:s.width,containerHeight:s.height,position:{mx:.474,my:.296}}),w=m(c,y,{fill:p,fillOpacity:Nt,stroke:h}),O=re(s);if(Xn(O)){var U=n.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:s.width,containerHeight:s.height,position:{mx:.33,my:(s.height-18)/s.height}});m(c,U,{strokeWidth:2,fill:p,stroke:h})}return w}function le(c,s,a={}){return V(c,s.width,s.height,{fillOpacity:Nt,...a,fill:z(s,l,a.fill),stroke:C(s,f,a.stroke)})}function je(c,s,a={}){return Y(c,s.width,s.height,{fill:z(s,l,a.fill),fillOpacity:Nt,stroke:C(s,f,a.stroke)})}function E(c,s,a={}){var p=q(c,Oe(s,a),Se(s,a),0,{fill:z(s,l,a.fill),fillOpacity:a.fillOpacity||Nt,stroke:C(s,f,a.stroke),strokeWidth:1.5}),h=re(s);if(D(h,"bpmn:Lane")){var y=h.get("name");ie(c,y,s,a)}return p}function x(c,s,a={}){var p=G(c,s,a),h=at(s);if(On(s)&&(Q(p,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!h)){var y=re(s).flowElements||[],w=y.filter(O=>D(O,"bpmn:StartEvent"));w.length===1&&L(w[0],c,a,s)}return H(c,s,h?"center-top":"center-middle",a),h?M(c,s,void 0,a):M(c,s,["SubProcessMarker"],a),p}function L(c,s,a,p){var h=22,y={fill:z(p,l,a.fill),stroke:C(p,f,a.stroke),width:h,height:h},w=re(c).isInterrupting,O=w?0:3,U=w?1:1.2,ce=20,ue=(h-ce)/2,de="translate("+ue+","+ue+")";V(s,ce,ce,{fill:y.fill,stroke:y.stroke,strokeWidth:U,strokeDasharray:O,transform:de}),T(c,s,y,p)}function ee(c,s,a={}){var p=G(c,s,a);return H(c,s,"center-middle",a),M(c,s,void 0,a),p}var De=this.handlers={"bpmn:AdHocSubProcess":function(c,s,a={}){return at(s)?a=K(a,["fill","stroke","width","height"]):a=K(a,["fill","stroke"]),x(c,s,a)},"bpmn:Association":function(c,s,a={}){return a=K(a,["fill","stroke"]),ze(c,s,a)},"bpmn:BoundaryEvent":function(c,s,a={}){var{renderIcon:p=!0}=a;a=K(a,["fill","stroke"]);var h=re(s),y=h.get("cancelActivity");a={strokeWidth:1.5,fill:z(s,l,a.fill),fillOpacity:ca,stroke:C(s,f,a.stroke)},y||(a.strokeDasharray="6");var w=le(c,s,a);return V(c,s.width,s.height,cr,{...a,fill:"none"}),p&&T(s,c,a),w},"bpmn:BusinessRuleTask":function(c,s,a={}){a=K(a,["fill","stroke"]);var p=ee(c,s,a),h=n.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),y=m(c,h);Q(y,{fill:z(s,l,a.fill),stroke:C(s,f,a.stroke),strokeWidth:1});var w=n.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),O=m(c,w);return Q(O,{fill:C(s,f,a.stroke),stroke:C(s,f,a.stroke),strokeWidth:1}),p},"bpmn:CallActivity":function(c,s,a={}){return a=K(a,["fill","stroke"]),x(c,s,{strokeWidth:5,...a})},"bpmn:ComplexGateway":function(c,s,a={}){a=K(a,["fill","stroke"]);var p=je(c,s,a),h=n.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:s.width,containerHeight:s.height,position:{mx:.46,my:.26}});return m(c,h,{fill:C(s,f,a.stroke),stroke:C(s,f,a.stroke),strokeWidth:1}),p},"bpmn:DataInput":function(c,s,a={}){a=K(a,["fill","stroke"]);var p=n.getRawPath("DATA_ARROW"),h=He(c,s,a);return m(c,p,{fill:"none",stroke:C(s,f,a.stroke),strokeWidth:1}),h},"bpmn:DataInputAssociation":function(c,s,a={}){return a=K(a,["fill","stroke"]),ze(c,s,{...a,markerEnd:$(c,"association-end",z(s,l,a.fill),C(s,f,a.stroke))})},"bpmn:DataObject":function(c,s,a={}){return a=K(a,["fill","stroke"]),He(c,s,a)},"bpmn:DataObjectReference":F("bpmn:DataObject"),"bpmn:DataOutput":function(c,s,a={}){a=K(a,["fill","stroke"]);var p=n.getRawPath("DATA_ARROW"),h=He(c,s,a);return m(c,p,{strokeWidth:1,fill:z(s,l,a.fill),stroke:C(s,f,a.stroke)}),h},"bpmn:DataOutputAssociation":function(c,s,a={}){return a=K(a,["fill","stroke"]),ze(c,s,{...a,markerEnd:$(c,"association-end",z(s,l,a.fill),C(s,f,a.stroke))})},"bpmn:DataStoreReference":function(c,s,a={}){a=K(a,["fill","stroke"]);var p=n.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:s.width,containerHeight:s.height,position:{mx:0,my:.133}});return m(c,p,{fill:z(s,l,a.fill),fillOpacity:Nt,stroke:C(s,f,a.stroke),strokeWidth:2})},"bpmn:EndEvent":function(c,s,a={}){var{renderIcon:p=!0}=a;a=K(a,["fill","stroke"]);var h=le(c,s,{...a,strokeWidth:4});return p&&T(s,c,a),h},"bpmn:EventBasedGateway":function(c,s,a={}){a=K(a,["fill","stroke"]);var p=re(s),h=je(c,s,a);V(c,s.width,s.height,s.height*.2,{fill:z(s,"none",a.fill),stroke:C(s,f,a.stroke),strokeWidth:1});var y=p.get("eventGatewayType"),w=!!p.get("instantiate");function O(){var ce=n.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:s.width,containerHeight:s.height,position:{mx:.36,my:.44}});m(c,ce,{fill:"none",stroke:C(s,f,a.stroke),strokeWidth:2})}if(y==="Parallel"){var U=n.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:s.width,containerHeight:s.height,position:{mx:.474,my:.296}});m(c,U,{fill:"none",stroke:C(s,f,a.stroke),strokeWidth:1})}else y==="Exclusive"&&(w||V(c,s.width,s.height,s.height*.26,{fill:"none",stroke:C(s,f,a.stroke),strokeWidth:1}),O());return h},"bpmn:ExclusiveGateway":function(c,s,a={}){a=K(a,["fill","stroke"]);var p=je(c,s,a),h=n.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:s.width,containerHeight:s.height,position:{mx:.32,my:.3}}),y=$e(s);return y.get("isMarkerVisible")&&m(c,h,{fill:C(s,f,a.stroke),stroke:C(s,f,a.stroke),strokeWidth:1}),p},"bpmn:Gateway":function(c,s,a={}){return a=K(a,["fill","stroke"]),je(c,s,a)},"bpmn:Group":function(c,s,a={}){return a=K(a,["fill","stroke","width","height"]),q(c,s.width,s.height,fr,{stroke:C(s,f,a.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:Oe(s,a),height:Se(s,a)})},"bpmn:InclusiveGateway":function(c,s,a={}){a=K(a,["fill","stroke"]);var p=je(c,s,a);return V(c,s.width,s.height,s.height*.24,{fill:z(s,l,a.fill),stroke:C(s,f,a.stroke),strokeWidth:2.5}),p},"bpmn:IntermediateEvent":function(c,s,a={}){var{renderIcon:p=!0}=a;a=K(a,["fill","stroke"]);var h=le(c,s,{...a,strokeWidth:1.5});return V(c,s.width,s.height,cr,{fill:"none",stroke:C(s,f,a.stroke),strokeWidth:1.5}),p&&T(s,c,a),h},"bpmn:IntermediateCatchEvent":F("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":F("bpmn:IntermediateEvent"),"bpmn:Lane":function(c,s,a={}){return a=K(a,["fill","stroke","width","height"]),E(c,s,{...a,fillOpacity:fa})},"bpmn:ManualTask":function(c,s,a={}){a=K(a,["fill","stroke"]);var p=ee(c,s,a),h=n.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return m(c,h,{fill:z(s,l,a.fill),stroke:C(s,f,a.stroke),strokeWidth:.5}),p},"bpmn:MessageFlow":function(c,s,a={}){a=K(a,["fill","stroke"]);var p=re(s),h=$e(s),y=z(s,l,a.fill),w=C(s,f,a.stroke),O=P(c,s.waypoints,{markerEnd:$(c,"messageflow-end",y,w),markerStart:$(c,"messageflow-start",y,w),stroke:w,strokeDasharray:"10, 11",strokeWidth:1.5});if(p.get("messageRef")){var U=O.getPointAtLength(O.getTotalLength()/2),ce=n.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:U.x,y:U.y}}),ue={strokeWidth:1};h.get("messageVisibleKind")==="initiating"?(ue.fill=y,ue.stroke=w):(ue.fill=w,ue.stroke=y);var de=m(c,ce,ue),Ve=p.get("messageRef"),te=Ve.get("name"),it=N(c,te,{align:"center-top",fitBox:!0,style:{fill:w}}),Qt=de.getBBox(),Ne=it.getBBox(),W=U.x-Ne.width/2,X=U.y+Qt.height/2+sa;ur(it,W,X,0)}return O},"bpmn:ParallelGateway":function(c,s,a={}){a=K(a,["fill","stroke"]);var p=je(c,s,a),h=n.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:s.width,containerHeight:s.height,position:{mx:.46,my:.2}});return m(c,h,{fill:C(s,f,a.stroke),stroke:C(s,f,a.stroke),strokeWidth:1}),p},"bpmn:Participant":function(c,s,a={}){a=K(a,["fill","stroke","width","height"]);var p=E(c,s,a),h=at(s),y=zr(s),w=re(s),O=w.get("name");if(h){var U=y?[{x:30,y:0},{x:30,y:Se(s,a)}]:[{x:0,y:30},{x:Oe(s,a),y:30}];Z(c,U,{stroke:C(s,f,a.stroke),strokeWidth:ua}),ie(c,O,s,a)}else{var ce=Mt(s,a);y||(ce.height=Oe(s,a),ce.width=Se(s,a));var ue=N(c,O,{box:ce,align:"center-middle",style:{fill:kt(s,d,f,a.stroke)}});if(!y){var de=-1*Se(s,a);ur(ue,0,-de,270)}}return w.get("participantMultiplicity")&&B("ParticipantMultiplicityMarker",c,s,a),p},"bpmn:ReceiveTask":function(c,s,a={}){a=K(a,["fill","stroke"]);var p=re(s),h=ee(c,s,a),y;return p.get("instantiate")?(V(c,28,28,20*.22,{fill:z(s,l,a.fill),stroke:C(s,f,a.stroke),strokeWidth:1}),y=n.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):y=n.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),m(c,y,{fill:z(s,l,a.fill),stroke:C(s,f,a.stroke),strokeWidth:1}),h},"bpmn:ScriptTask":function(c,s,a={}){a=K(a,["fill","stroke"]);var p=ee(c,s,a),h=n.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return m(c,h,{fill:z(s,l,a.fill),stroke:C(s,f,a.stroke),strokeWidth:1}),p},"bpmn:SendTask":function(c,s,a={}){a=K(a,["fill","stroke"]);var p=ee(c,s,a),h=n.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return m(c,h,{fill:C(s,f,a.stroke),stroke:z(s,l,a.fill),strokeWidth:1}),p},"bpmn:SequenceFlow":function(c,s,a={}){a=K(a,["fill","stroke"]);var p=z(s,l,a.fill),h=C(s,f,a.stroke),y=P(c,s.waypoints,{markerEnd:$(c,"sequenceflow-end",p,h),stroke:h}),w=re(s),{source:O}=s;if(O){var U=re(O);w.get("conditionExpression")&&D(U,"bpmn:Activity")&&Q(y,{markerStart:$(c,"conditional-flow-marker",p,h)}),U.get("default")&&(D(U,"bpmn:Gateway")||D(U,"bpmn:Activity"))&&U.get("default")===w&&Q(y,{markerStart:$(c,"conditional-default-flow-marker",p,h)})}return y},"bpmn:ServiceTask":function(c,s,a={}){a=K(a,["fill","stroke"]);var p=ee(c,s,a);V(c,10,10,{fill:z(s,l,a.fill),stroke:"none",transform:"translate(6, 6)"});var h=n.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});m(c,h,{fill:z(s,l,a.fill),stroke:C(s,f,a.stroke),strokeWidth:1}),V(c,10,10,{fill:z(s,l,a.fill),stroke:"none",transform:"translate(11, 10)"});var y=n.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return m(c,y,{fill:z(s,l,a.fill),stroke:C(s,f,a.stroke),strokeWidth:1}),p},"bpmn:StartEvent":function(c,s,a={}){var{renderIcon:p=!0}=a;a=K(a,["fill","stroke"]);var h=re(s);h.get("isInterrupting")||(a={...a,strokeDasharray:"6"});var y=le(c,s,a);return p&&T(s,c,a),y},"bpmn:SubProcess":function(c,s,a={}){return at(s)?a=K(a,["fill","stroke","width","height"]):a=K(a,["fill","stroke"]),x(c,s,a)},"bpmn:Task":function(c,s,a={}){return a=K(a,["fill","stroke"]),ee(c,s,a)},"bpmn:TextAnnotation":function(c,s,a={}){a=K(a,["fill","stroke","width","height"]);var{width:p,height:h}=Mt(s,a),y=q(c,p,h,0,0,{fill:"none",stroke:"none"}),w=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:p,containerHeight:h,position:{mx:0,my:0}});m(c,w,{stroke:C(s,f,a.stroke)});var O=re(s),U=O.get("text")||"";return N(c,U,{align:"left-top",box:Mt(s,a),padding:7,style:{fill:kt(s,d,f,a.stroke)}}),y},"bpmn:Transaction":function(c,s,a={}){at(s)?a=K(a,["fill","stroke","width","height"]):a=K(a,["fill","stroke"]);var p=x(c,s,{strokeWidth:1.5,...a}),h=r.style(["no-fill","no-events"],{stroke:C(s,f,a.stroke),strokeWidth:1.5}),y=at(s);return y||(a={}),q(c,Oe(s,a),Se(s,a),fr-cr,cr,h),p},"bpmn:UserTask":function(c,s,a={}){a=K(a,["fill","stroke"]);var p=ee(c,s,a),h=15,y=12,w=n.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:h,y}});m(c,w,{fill:z(s,l,a.fill),stroke:C(s,f,a.stroke),strokeWidth:.5});var O=n.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:h,y}});m(c,O,{fill:z(s,l,a.fill),stroke:C(s,f,a.stroke),strokeWidth:.5});var U=n.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:h,y}});return m(c,U,{fill:C(s,f,a.stroke),stroke:C(s,f,a.stroke),strokeWidth:.5}),p},label:function(c,s,a={}){return Ge(c,s,a)}};this._drawPath=m,this._renderer=S}Ee(ut,We);ut.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"];ut.prototype.canRender=function(e){return D(e,"bpmn:BaseElement")};ut.prototype.drawShape=function(e,t,r={}){var{type:n}=t,i=this._renderer(n);return i(e,t,r)};ut.prototype.drawConnection=function(e,t,r={}){var{type:n}=t,i=this._renderer(n);return i(e,t,r)};ut.prototype.getShapePath=function(e){return Hr(e)?en(e,la):D(e,"bpmn:Event")?Zn(e):D(e,"bpmn:Activity")?en(e,fr):D(e,"bpmn:Gateway")?Qn(e):Jn(e)};function K(e,t=[]){return t.reduce((r,n)=>(e[n]&&(r[n]=e[n]),r),{})}var pa=0,ha={width:150,height:50};function da(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function ma(e){return Ae(e)?k({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}var rn=null;function ya(){return rn||(rn=document.createElement("canvas").getContext("2d")),rn}function ga(e){var t=[];return e.fontStyle&&t.push(e.fontStyle),e.fontVariant&&t.push(e.fontVariant),e.fontWeight&&t.push(e.fontWeight),e.fontStretch&&t.push(e.fontStretch),t.push(si(e.fontSize)||"12px"),t.push(e.fontFamily||"sans-serif"),t.join(" ")}function si(e){if(e!=null)return typeof e=="number"||/^-?\d+(\.\d+)?$/.test(e)?e+"px":e}function va(e,t){var r=ya();if(!r)return{width:0,height:0};r.font=ga(t),"letterSpacing"in r&&(r.letterSpacing=si(t.letterSpacing)||"0px");var n=e==="",i=n?"dummy":e.replace(/\s+$/,""),o=r.measureText(i);return{width:n?0:o.width,height:"fontBoundingBoxAscent"in o?o.fontBoundingBoxAscent+o.fontBoundingBoxDescent:o.actualBoundingBoxAscent+o.actualBoundingBoxDescent}}function Ea(e,t,r){for(var n=e.shift(),i=n,o;;){if(o=va(i,r),o.width=i?o.width:0,i===" "||i===""||o.width1)for(;n=r.shift();)if(n.length+oq?Y.width:q},0),$=o.top;i.vertical==="middle"&&($+=(r.height-A)/2),$-=(l||d[0].height)/4;var ne=J("text");Q(ne,n),R(d,function(q){var Y;switch($+=l||q.height,i.horizontal){case"left":Y=o.left;break;case"right":Y=(u?j:g)-o.right-q.width;break;default:Y=Math.max(((u?j:g)-q.width)/2+o.left,0)}var Z=J("tspan");Q(Z,{x:Y,y:$}),Z.textContent=q.text,ae(ne,Z)});var V={width:j,height:A};return{dimensions:V,element:ne}};function ba(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}var Aa=12,Sa=1.2,Ra=30;function pr(e){var t=k({fontFamily:"Arial, sans-serif",fontSize:Aa,fontWeight:"normal",lineHeight:Sa},e&&e.defaultStyle||{}),r=parseInt(t.fontSize,10)-1,n=k({},t,{fontSize:r},e&&e.externalStyle||{}),i=new Bt({style:t});this.getExternalLabelBounds=function(o,u){var l=i.getDimensions(u,{box:{width:90,height:30},style:n});return{x:Math.round(o.x+o.width/2-l.width/2),y:Math.round(o.y),width:Math.ceil(l.width),height:Math.ceil(l.height)}},this.getTextAnnotationBounds=function(o,u){var l=i.getDimensions(u,{box:o,style:t,align:"left-top",padding:5});return{x:o.x,y:o.y,width:o.width,height:Math.max(Ra,Math.round(l.height))}},this.createText=function(o,u){return i.createText(o,u||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return n}}pr.$inject=["config.textRenderer"];function nn(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(t){return this.pathMap[t].d},this.getScaledPath=function(t,r){var n=this.pathMap[t],i,o;r.abspos?(i=r.abspos.x,o=r.abspos.y):(i=r.containerWidth*r.position.mx,o=r.containerHeight*r.position.my);var u={};if(r.position){for(var l=r.containerHeight/n.height*r.yScaleFactor,f=r.containerWidth/n.width*r.xScaleFactor,d=0;d':""}function mr(e,t,r){return k({id:e.id,type:e.$type,businessObject:e,di:t},r)}function Oa(e,t,r){var n=e.waypoint;return!n||n.length<2?[dr(t),dr(r)]:n.map(function(i){return{x:i.x,y:i.y}})}function ci(e,t,r){return new Error(`element ${me(t)} referenced by ${me(e)}#${r} not yet drawn`)}function Ye(e,t,r,n,i){this._eventBus=e,this._canvas=t,this._elementFactory=r,this._elementRegistry=n,this._textRenderer=i}Ye.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"];Ye.prototype.add=function(e,t,r){var n,i,o;if(D(t,"bpmndi:BPMNPlane")){var u=D(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};n=this._elementFactory.createRoot(mr(e,t,u)),this._canvas.addRootElement(n)}else if(D(t,"bpmndi:BPMNShape")){var l=!at(e,t),f=Ia(e);i=r&&(r.hidden||r.collapsed);var d=t.bounds;n=this._elementFactory.createShape(mr(e,t,{collapsed:l,hidden:i,x:Math.round(d.x),y:Math.round(d.y),width:Math.round(d.width),height:Math.round(d.height),isFrame:f})),D(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,n),D(e,"bpmn:Lane")&&(o=0),D(e,"bpmn:DataStoreReference")&&(La(r,dr(d))||(r=this._canvas.findRoot(r))),this._canvas.addShape(n,r,o)}else if(D(t,"bpmndi:BPMNEdge")){var g=this._getSource(e),A=this._getTarget(e);i=r&&(r.hidden||r.collapsed),n=this._elementFactory.createConnection(mr(e,t,{hidden:i,source:g,target:A,waypoints:Oa(t,g,A)})),D(e,"bpmn:DataAssociation")&&(r=this._canvas.findRoot(r)),this._canvas.addConnection(n,r,o)}else throw new Error(`unknown di ${me(t)} for element ${me(e)}`);return Fn(e)&&Ct(n)&&this.addLabel(e,t,n),this._eventBus.fire("bpmnElement.added",{element:n}),n};Ye.prototype._attachBoundary=function(e,t){var r=e.attachedToRef;if(!r)throw new Error(`missing ${me(e)}#attachedToRef`);var n=this._elementRegistry.get(r.id),i=n&&n.attachers;if(!n)throw ci(e,r,"attachedToRef");t.host=n,i||(n.attachers=i=[]),i.indexOf(t)===-1&&i.push(t)};Ye.prototype.addLabel=function(e,t,r){var n,i,o;return n=jn(t,r),i=Ct(r),i&&(n=this._textRenderer.getExternalLabelBounds(n,i)),o=this._elementFactory.createLabel(mr(e,t,{id:e.id+"_label",labelTarget:r,type:"label",hidden:r.hidden||!Ct(r),x:Math.round(n.x),y:Math.round(n.y),width:Math.round(n.width),height:Math.round(n.height)})),this._canvas.addShape(o,r.parent)};Ye.prototype._getConnectedElement=function(e,t){var r,n,i=e.$type;if(n=e[t+"Ref"],t==="source"&&i==="bpmn:DataInputAssociation"&&(n=n&&n[0]),(t==="source"&&i==="bpmn:DataOutputAssociation"||t==="target"&&i==="bpmn:DataInputAssociation")&&(n=e.$parent),r=n&&this._getElement(n),r)return r;throw n?ci(e,n,t+"Ref"):new Error(`${me(e)}#${t} Ref not specified`)};Ye.prototype._getSource=function(e){return this._getConnectedElement(e,"source")};Ye.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")};Ye.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};function La(e,t){var r=t.x,n=t.y;return r>=e.x&&r<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Ia(e){return D(e,"bpmn:Group")}var fi={__depends__:[hr],bpmnImporter:["type",Ye]};var pi={__depends__:[ui,fi]};function bt(e,t){t=!!t,ye(e)||(e=[e]);var r,n,i,o;return R(e,function(u){var l=u;u.waypoints&&!t&&(l=bt(u.waypoints,!0));var f=l.x,d=l.y,g=l.height||0,A=l.width||0;(fi||i===void 0)&&(i=f+A),(d+g>o||o===void 0)&&(o=d+g)}),{x:r,y:n,height:o-n,width:i-r}}function yr(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function gr(e){return!!(e&&e.isFrame)}function vr(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}vr.prototype.next=function(){return this._prefix+ ++this._counter};var Fa=new vr("ov"),ja=500;function pe(e,t,r,n){this._eventBus=t,this._canvas=r,this._elementRegistry=n,this._ids=Fa,this._overlayDefaults=k({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=Va(r.getContainer()),this._init()}pe.$inject=["config.overlays","eventBus","canvas","elementRegistry"];pe.prototype.get=function(e){if(ke(e)&&(e={id:e}),ke(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?Xe(t.overlays,Wr({type:e.type})):t.overlays.slice():[]}else return e.type?Xe(this._overlays,Wr({type:e.type})):e.id?this._overlays[e.id]:null};pe.prototype.add=function(e,t,r){if(Ae(t)&&(r=t,t=null),e.id||(e=this._elementRegistry.get(e)),!r.position)throw new Error("must specifiy overlay position");if(!r.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var n=this._ids.next();return r=k({},this._overlayDefaults,r,{id:n,type:t,element:e,html:r.html}),this._addOverlay(r),n};pe.prototype.remove=function(e){var t=this.get(e)||[];ye(t)||(t=[t]);var r=this;R(t,function(n){var i=r._getOverlayContainer(n.element,!0);if(n&&(Dt(n.html),Dt(n.htmlContainer),delete n.htmlContainer,delete n.element,delete r._overlays[n.id]),i){var o=i.overlays.indexOf(n);o!==-1&&i.overlays.splice(o,1)}})};pe.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"};pe.prototype.show=function(){Er(this._overlayRoot)};pe.prototype.hide=function(){Er(this._overlayRoot,!1)};pe.prototype.clear=function(){this._overlays={},this._overlayContainers=[],ar(this._overlayRoot)};pe.prototype._updateOverlayContainer=function(e){var t=e.element,r=e.html,n=t.x,i=t.y;if(t.waypoints){var o=bt(t);n=o.x,i=o.y}hi(r,n,i),or(e.html,"data-container-id",t.id)};pe.prototype._updateOverlay=function(e){var t=e.position,r=e.htmlContainer,n=e.element,i=t.left,o=t.top;if(t.right!==void 0){var u;n.waypoints?u=bt(n).width:u=n.width,i=t.right*-1+u}if(t.bottom!==void 0){var l;n.waypoints?l=bt(n).height:l=n.height,o=t.bottom*-1+l}hi(r,i||0,o||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())};pe.prototype._createOverlayContainer=function(e){var t=xe('
          ');we(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var r={html:t,element:e,overlays:[]};return this._updateOverlayContainer(r),this._overlayContainers.push(r),r};pe.prototype._updateRoot=function(e){var t=e.scale||1,r="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";di(this._overlayRoot,r)};pe.prototype._getOverlayContainer=function(e,t){var r=he(this._overlayContainers,function(n){return n.element===e});return!r&&!t?this._createOverlayContainer(e):r};pe.prototype._addOverlay=function(e){var t=e.id,r=e.element,n=e.html,i,o;n.get&&n.constructor.prototype.jquery&&(n=n.get(0)),ke(n)&&(n=xe(n)),o=this._getOverlayContainer(r),i=xe('
          '),we(i,{position:"absolute"}),i.appendChild(n),e.type&&_t(i).add("djs-overlay-"+e.type);var u=this._canvas.findRoot(r),l=this._canvas.getRootElement();Er(i,u===l),e.htmlContainer=i,o.overlays.push(e),o.html.appendChild(i),this._overlays[t]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())};pe.prototype._updateOverlayVisibilty=function(e,t){var r=e.show,n=this._canvas.findRoot(e.element),i=r&&r.minZoom,o=r&&r.maxZoom,u=e.htmlContainer,l=this._canvas.getRootElement(),f=!0;(n!==l||r&&(Et(i)&&i>t.scale||Et(o)&&oi&&(u=(1/t.scale||1)*i)),Et(u)&&(l="scale("+u+","+u+")"),di(o,l)};pe.prototype._updateOverlaysVisibilty=function(e){var t=this;R(this._overlays,function(r){t._updateOverlayVisibilty(r,e)})};pe.prototype._init=function(){var e=this._eventBus,t=this;function r(n){t._updateRoot(n),t._updateOverlaysVisibilty(n),t.show()}e.on("canvas.viewbox.changing",function(n){t.hide()}),e.on("canvas.viewbox.changed",function(n){r(n.viewbox)}),e.on(["shape.remove","connection.remove"],function(n){var i=n.element,o=t.get({element:i});R(o,function(f){t.remove(f.id)});var u=t._getOverlayContainer(i);if(u){Dt(u.html);var l=t._overlayContainers.indexOf(u);l!==-1&&t._overlayContainers.splice(l,1)}}),e.on("element.changed",ja,function(n){var i=n.element,o=t._getOverlayContainer(i,!0);o&&(R(o.overlays,function(u){t._updateOverlay(u)}),t._updateOverlayContainer(o))}),e.on("element.marker.update",function(n){var i=t._getOverlayContainer(n.element,!0);i&&_t(i.html)[n.add?"add":"remove"](n.marker)}),e.on("root.set",function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};function Va(e){var t=xe('
          ');return we(t,{position:"absolute",width:0,height:0}),e.insertBefore(t,e.firstChild),t}function hi(e,t,r){we(e,{left:t+"px",top:r+"px"})}function Er(e,t){e.style.display=t===!1?"none":""}function di(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(r){e.style[r+"transform"]=t})}var xr={__init__:["overlays"],overlays:["type",pe]};function wr(e,t,r,n){e.on("element.changed",function(i){var o=i.element;(o.parent||o===t.getRootElement())&&(i.gfx=r.getGraphics(o)),i.gfx&&e.fire(yr(o)+".changed",i)}),e.on("elements.changed",function(i){var o=i.elements;o.forEach(function(u){e.fire("element.changed",{element:u})}),n.updateContainments(o)}),e.on("shape.changed",function(i){n.update("shape",i.element,i.gfx)}),e.on("connection.changed",function(i){n.update("connection",i.element,i.gfx)})}wr.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var mi={__init__:["changeSupport"],changeSupport:["type",wr]};var Wa=1e3;function ge(e){this._eventBus=e}ge.$inject=["eventBus"];function $a(e,t){return function(r){return e.call(t||null,r.context,r.command,r)}}ge.prototype.on=function(e,t,r,n,i,o){if((ot(t)||Te(t))&&(o=i,i=n,n=r,r=t,t=null),ot(r)&&(o=i,i=n,n=r,r=Wa),Ae(i)&&(o=i,i=!1),!ot(n))throw new Error("handlerFn must be a function");ye(e)||(e=[e]);var u=this._eventBus;R(e,function(l){var f=["commandStack",l,t].filter(function(d){return d}).join(".");u.on(f,r,i?$a(n,o):n,o)})};ge.prototype.canExecute=lt("canExecute");ge.prototype.preExecute=lt("preExecute");ge.prototype.preExecuted=lt("preExecuted");ge.prototype.execute=lt("execute");ge.prototype.executed=lt("executed");ge.prototype.postExecute=lt("postExecute");ge.prototype.postExecuted=lt("postExecuted");ge.prototype.revert=lt("revert");ge.prototype.reverted=lt("reverted");function lt(e){return function(r,n,i,o,u){(ot(r)||Te(r))&&(u=o,o=i,i=n,n=r,r=null),this.on(r,e,n,i,o,u)}}function Ht(e,t){t.invoke(ge,this),this.executed(function(r){var n=r.context;n.rootElement?e.setRootElement(n.rootElement):n.rootElement=e.getRootElement()}),this.revert(function(r){var n=r.context;n.rootElement&&e.setRootElement(n.rootElement)})}Ee(Ht,ge);Ht.$inject=["canvas","injector"];var yi={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",Ht]};var za={"&":"&","<":"<",">":">",'"':""","'":"'"};function gi(e){return e=""+e,e&&e.replace(/[&<>"']/g,function(t){return za[t]})}var Ha="_plane";function Ut(e){var t=e.id;return D(e,"bpmn:SubProcess")?Ua(t):t}function Ua(e){return e+Ha}var qa="bjs-breadcrumbs-shown";function _r(e,t,r){var n=xe('
            '),i=r.getContainer(),o=_t(i);i.appendChild(n);var u=[];e.on("element.changed",function(f){var d=f.element,g=re(d),A=he(u,function(j){return j===g});A&&l()});function l(f){f&&(u=Ka(f));var d=u.flatMap(function(A){var j=r.findRoot(Ut(A))||r.findRoot(A.id);if(!j&&D(A,"bpmn:Process")){var $=t.find(function(q){var Y=re(q);return Y&&Y.get("processRef")===A});j=$&&r.findRoot($.id)}if(!j)return[];var ne=gi(A.name||A.id),V=xe('
          • '+ne+"
          • ");return V.addEventListener("click",function(){r.setRootElement(j)}),V});n.innerHTML="";var g=d.length>1;o.toggle(qa,g),d.forEach(function(A){n.appendChild(A)})}e.on("root.set",function(f){l(f.element)})}_r.$inject=["eventBus","elementRegistry","canvas"];function Ka(e){for(var t=re(e),r=[],n=t;n;n=n.$parent)(D(n,"bpmn:SubProcess")||D(n,"bpmn:Process"))&&r.push(n);return r.reverse()}function br(e,t){var r=null,n=new Ya;e.on("root.set",function(i){var o=i.element,u=t.viewbox(),l=n.get(o);if(n.set(r,{x:u.x,y:u.y,zoom:u.scale}),r=o,!(!D(o,"bpmn:SubProcess")&&!l)){l=l||{x:0,y:0,zoom:1};var f=(u.x-l.x)*u.scale,d=(u.y-l.y)*u.scale;(f!==0||d!==0)&&t.scroll({dx:f,dy:d}),l.zoom!==u.scale&&t.zoom(l.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){n.clear(),r=null})}br.$inject=["eventBus","canvas"];function Ya(){this._entries=[],this.set=function(e,t){var r=!1;for(var n in this._entries)if(this._entries[n][0]===e){this._entries[n][1]=t,r=!0;break}r||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var r in this._entries)if(this._entries[r][0]===e){t=r;break}t!==-1&&this._entries.splice(t,1)}}var vi={x:180,y:160};function ct(e,t){this._eventBus=e,this._moddle=t;var r=this;e.on("import.render.start",1500,function(n,i){r._handleImport(i.definitions)})}ct.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach(function(n){!n.plane||!n.plane.bpmnElement||(t._processToDiagramMap[n.plane.bpmnElement.id]=n)});var r=e.diagrams.filter(n=>n.plane).flatMap(n=>t._createNewDiagrams(n.plane));r.forEach(function(n){t._movePlaneElementsToOrigin(n.plane)})}};ct.prototype._createNewDiagrams=function(e){var t=this,r=[],n=[];e.get("planeElement").forEach(function(o){var u=o.bpmnElement;if(u){var l=u.$parent;D(u,"bpmn:SubProcess")&&!o.isExpanded&&r.push(u),Xa(u,e)&&n.push({diElement:o,parent:l})}});var i=[];return r.forEach(function(o){if(!t._processToDiagramMap[o.id]){var u=t._createDiagram(o);t._processToDiagramMap[o.id]=u,i.push(u)}}),n.forEach(function(o){for(var u=o.diElement,l=o.parent;l&&r.indexOf(l)===-1;)l=l.$parent;if(l){var f=t._processToDiagramMap[l.id];t._moveToDiPlane(u,f.plane)}}),i};ct.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),r=Ga(e),n={x:r.x-vi.x,y:r.y-vi.y};t.forEach(function(i){i.waypoint?i.waypoint.forEach(function(o){o.x=o.x-n.x,o.y=o.y-n.y}):i.bounds&&(i.bounds.x=i.bounds.x-n.x,i.bounds.y=i.bounds.y-n.y)})};ct.prototype._moveToDiPlane=function(e,t){var r=Ei(e),n=r.plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)};ct.prototype._createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),r=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=r,t.bpmnElement=e,r.$parent=this._definitions,this._definitions.diagrams.push(r),r};ct.$inject=["eventBus","moddle"];function Ei(e){return D(e,"bpmndi:BPMNDiagram")?e:Ei(e.$parent)}function Ga(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach(function(r){if(r.bounds){var n=zt(r.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}}),li(t)}function Xa(e,t){var r=e.$parent;return!(!D(r,"bpmn:SubProcess")||r===t.bpmnElement||Bn(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))}var Ar=250,Za='',Qa="bjs-drilldown-empty";function Je(e,t,r,n,i){ge.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=r,this._overlays=n,this._translate=i;var o=this;this.executed("shape.toggleCollapse",Ar,function(u){var l=u.shape;o._canDrillDown(l)?o._addOverlay(l):o._removeOverlay(l)},!0),this.reverted("shape.toggleCollapse",Ar,function(u){var l=u.shape;o._canDrillDown(l)?o._addOverlay(l):o._removeOverlay(l)},!0),this.executed(["shape.create","shape.move","shape.delete"],Ar,function(u){var l=u.oldParent,f=u.newParent||u.parent,d=u.shape;o._canDrillDown(d)&&o._addOverlay(d),o._updateDrilldownOverlay(l),o._updateDrilldownOverlay(f),o._updateDrilldownOverlay(d)},!0),this.reverted(["shape.create","shape.move","shape.delete"],Ar,function(u){var l=u.oldParent,f=u.newParent||u.parent,d=u.shape;o._canDrillDown(d)&&o._addOverlay(d),o._updateDrilldownOverlay(l),o._updateDrilldownOverlay(f),o._updateDrilldownOverlay(d)},!0),t.on("import.render.complete",function(){r.filter(function(u){return o._canDrillDown(u)}).map(function(u){o._addOverlay(u)})})}Ee(Je,ge);Je.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var r=t.findRoot(e);r&&this._updateOverlayVisibility(r)}};Je.prototype._canDrillDown=function(e){var t=this._canvas;return D(e,"bpmn:SubProcess")&&t.findRoot(Ut(e))};Je.prototype._updateOverlayVisibility=function(e){var t=this._overlays,r=re(e),n=t.get({element:r.id,type:"drilldown"})[0];if(n){var i=r&&r.get("flowElements")&&r.get("flowElements").length;_t(n.html).toggle(Qa,!i)}};Je.prototype._addOverlay=function(e){var t=this._canvas,r=this._overlays,n=re(e),i=r.get({element:e,type:"drilldown"});i.length&&this._removeOverlay(e);var o=xe('"),u=n.get("name")||n.get("id"),l=this._translate("Open {element}",{element:u});o.setAttribute("title",l),o.addEventListener("click",function(){t.setRootElement(t.findRoot(Ut(e)))}),r.add(e,"drilldown",{position:{bottom:-7,right:-8},html:o}),this._updateOverlayVisibility(e)};Je.prototype._removeOverlay=function(e){var t=this._overlays;t.remove({element:e,type:"drilldown"})};Je.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];var xi={__depends__:[xr,mi,yi],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",_r],drilldownCentering:["type",br],drilldownOverlayBehavior:["type",Je],subprocessCompatibility:["type",ct]};function an(e){return e.originalEvent||e.srcEvent}function wi(e,t){return(an(e)||e).button===t}function Ot(e){return wi(e,0)}function _i(e){return wi(e,1)}function bi(e){var t=an(e)||e;return Ot(e)&&t.shiftKey}function Ja(e){return!0}function Sr(e){return Ot(e)||_i(e)}var Ai=500;function Rr(e,t,r){var n=this;function i(v,T,b){if(!l(v,T)){var B,M,N;b?M=t.getGraphics(b):(B=T.delegateTarget||T.target,B&&(M=B,b=t.get(M))),!(!M||!b)&&(N=e.fire(v,{element:b,gfx:M,originalEvent:T}),N===!1&&(T.stopPropagation(),T.preventDefault()))}}var o={};function u(v){return o[v]}function l(v,T){var b=d[v]||Ot;return!b(T)}var f={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},d={"element.contextmenu":Ja,"element.mousedown":Sr,"element.mouseup":Sr,"element.click":Sr,"element.dblclick":Sr};function g(v,T,b){var B=f[v];if(!B)throw new Error("unmapped DOM event name <"+v+">");return i(B,T,b)}var A="svg, .djs-element";function j(v,T,b,B){var M=o[b]=function(N){i(b,N)};B&&(d[b]=B),M.$delegate=Wt.bind(v,A,T,M)}function $(v,T,b){var B=u(b);B&&Wt.unbind(v,T,B.$delegate)}function ne(v){R(f,function(T,b){j(v,b,T)})}function V(v){R(f,function(T,b){$(v,b,T)})}e.on("canvas.destroy",function(v){V(v.svg)}),e.on("canvas.init",function(v){ne(v.svg)}),e.on(["shape.added","connection.added"],function(v){var T=v.element,b=v.gfx;e.fire("interactionEvents.createHit",{element:T,gfx:b})}),e.on(["shape.changed","connection.changed"],Ai,function(v){var T=v.element,b=v.gfx;e.fire("interactionEvents.updateHit",{element:T,gfx:b})}),e.on("interactionEvents.createHit",Ai,function(v){var T=v.element,b=v.gfx;n.createDefaultHit(T,b)}),e.on("interactionEvents.updateHit",function(v){var T=v.element,b=v.gfx;n.updateDefaultHit(T,b)});var q=_("djs-hit djs-hit-stroke"),Y=_("djs-hit djs-hit-click-stroke"),Z=_("djs-hit djs-hit-all"),P=_("djs-hit djs-hit-no-move"),m={all:Z,"click-stroke":Y,stroke:q,"no-move":P};function _(v,T){return T=k({stroke:"white",strokeWidth:15},T||{}),r.cls(v,["no-fill","no-border"],T)}function S(v,T){var b=m[T];if(!b)throw new Error("invalid hit type <"+T+">");return Q(v,b),v}function F(v,T){ae(v,T)}this.removeHits=function(v){var T=ni(".djs-hit",v);R(T,xt)},this.createDefaultHit=function(v,T){var b=v.waypoints,B=v.isFrame,M;return b?this.createWaypointsHit(T,b):(M=B?"stroke":"all",this.createBoxHit(T,M,{width:v.width,height:v.height}))},this.createWaypointsHit=function(v,T){var b=Tt(T);return S(b,"stroke"),F(v,b),b},this.createBoxHit=function(v,T,b){b=k({x:0,y:0},b);var B=J("rect");return S(B,T),Q(B,b),F(v,B),B},this.updateDefaultHit=function(v,T){var b=Le(".djs-hit",T);if(b)return v.waypoints?Jr(b,v.waypoints):Q(b,{width:v.width,height:v.height}),b},this.fire=i,this.triggerMouseEvent=g,this.mouseHandler=u,this.registerEvent=j,this.unregisterEvent=$}Rr.$inject=["eventBus","elementRegistry","styles"];var Si={__init__:["interactionEvents"],interactionEvents:["type",Rr]};function dt(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var r=this;e.on(["shape.remove","connection.remove"],function(n){var i=n.element;r.deselect(i)}),e.on(["diagram.clear","root.set"],function(n){r.select(null)})}dt.$inject=["eventBus","canvas"];dt.prototype.deselect=function(e){var t=this._selectedElements,r=t.indexOf(e);if(r!==-1){var n=t.slice();t.splice(r,1),this._eventBus.fire("selection.changed",{oldSelection:n,newSelection:t})}};dt.prototype.get=function(){return this._selectedElements};dt.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1};dt.prototype.select=function(e,t){var r=this._selectedElements,n=r.slice();ye(e)||(e=e?[e]:[]);var i=this._canvas,o=i.getRootElement();e=e.filter(function(u){var l=i.findRoot(u);return o===l}),t?R(e,function(u){r.indexOf(u)===-1&&r.push(u)}):this._selectedElements=r=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:n,newSelection:r})};var Ri="hover",Ci="selected";function Cr(e,t){this._canvas=e;function r(i,o){e.addMarker(i,o)}function n(i,o){e.removeMarker(i,o)}t.on("element.hover",function(i){r(i.element,Ri)}),t.on("element.out",function(i){n(i.element,Ri)}),t.on("selection.changed",function(i){function o(d){n(d,Ci)}function u(d){r(d,Ci)}var l=i.oldSelection,f=i.newSelection;R(l,function(d){f.indexOf(d)===-1&&o(d)}),R(f,function(d){l.indexOf(d)===-1&&u(d)})})}Cr.$inject=["canvas","eventBus"];function Pr(e,t,r,n){e.on("create.end",500,function(i){var o=i.context,u=o.canExecute,l=o.elements,f=o.hints||{},d=f.autoSelect;if(u){if(d===!1)return;ye(d)?t.select(d):t.select(l.filter(es))}}),e.on("connect.end",500,function(i){var o=i.context,u=o.connection;u&&t.select(u)}),e.on("shape.move.end",500,function(i){var o=i.previousSelection||[],u=n.get(i.context.shape.id),l=he(o,function(f){return u.id===f.id});l||t.select(u)}),e.on("element.click",function(i){if(Ot(i)){var o=i.element;o===r.getRootElement()&&(o=null);var u=t.isSelected(o),l=t.get().length>1,f=bi(i);if(u&&l)return f?t.deselect(o):t.select(o);u?t.deselect(o):t.select(o,f)}})}Pr.$inject=["eventBus","selection","canvas","elementRegistry"];function es(e){return!e.hidden}var Pi={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Si],selection:["type",dt],selectionVisuals:["type",Cr],selectionBehavior:["type",Pr]};var ts=/^class[ {]/;function rs(e){return ts.test(e.toString())}function un(e){return Array.isArray(e)}function sn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Tr(...e){e.length===1&&un(e[0])&&(e=e[0]),e=[...e];let t=e.pop();return t.$inject=e,t}var ns=/constructor\s*[^(]*\(\s*([^)]*)\)/m,is=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,os=/\/\*([^*]*)\*\//m;function as(e){if(typeof e!="function")throw new Error(`Cannot annotate "${e}". Expected a function!`);let t=e.toString().match(rs(e)?ns:is);if(!t)return[];let r=t[1]||t[2];return r&&r.split(",").map(n=>{let i=n.match(os);return(i&&i[1]||n).trim()})||[]}function ln(e,t){let r=t||{get:function(P,m){if(n.push(P),m===!1)return null;throw l(`No provider for "${P}"!`)}},n=[],i=this._providers=Object.create(r._providers||null),o=this._instances=Object.create(null),u=o.injector=this,l=function(P){let m=n.join(" -> ");return n.length=0,new Error(m?`${P} (Resolving: ${m})`:P)};function f(P,m){if(!i[P]&&P.includes(".")){let _=P.split("."),S=f(_.shift());for(;_.length;)S=S[_.shift()];return S}if(sn(o,P))return o[P];if(sn(i,P)){if(n.indexOf(P)!==-1)throw n.push(P),l("Cannot resolve circular dependency!");return n.push(P),o[P]=i[P][0](i[P][1]),n.pop(),o[P]}return r.get(P,m)}function d(P,m){if(typeof m=="undefined"&&(m={}),typeof P!="function")if(un(P))P=Tr(P.slice());else throw l(`Cannot invoke "${P}". Expected a function!`);let S=(P.$inject||as(P)).map(F=>sn(m,F)?m[F]:f(F));return{fn:P,dependencies:S}}function g(P){let{fn:m,dependencies:_}=d(P),S=Function.prototype.bind.call(m,null,..._);return new S}function A(P,m,_){let{fn:S,dependencies:F}=d(P,_);return S.apply(m,F)}function j(P){return Tr(m=>P.get(m))}function $(P,m){if(m&&m.length){let _=Object.create(null),S=Object.create(null),F=[],v=[],T=[],b,B,M,N;for(let H in i)b=i[H],m.indexOf(H)!==-1&&(b[2]==="private"?(B=F.indexOf(b[3]),B===-1?(M=b[3].createChild([],m),N=j(M),F.push(b[3]),v.push(M),T.push(N),_[H]=[N,H,"private",M]):_[H]=[T[B],H,"private",v[B]]):_[H]=[b[2],b[1]],S[H]=!0),(b[2]==="factory"||b[2]==="type")&&b[1].$scope&&m.forEach(Ge=>{b[1].$scope.indexOf(Ge)!==-1&&(_[H]=[b[2],b[1]],S[Ge]=!0)});m.forEach(H=>{if(!S[H])throw new Error('No provider for "'+H+'". Cannot use provider from the parent!')}),P.unshift(_)}return new ln(P,u)}let ne={factory:A,type:g,value:function(P){return P}};function V(P,m){let _=P.__init__||[];return function(){_.forEach(S=>{typeof S=="string"?m.get(S):m.invoke(S)})}}function q(P){let m=P.__exports__;if(m){let _=P.__modules__,S=Object.keys(P).reduce((B,M)=>(M!=="__exports__"&&M!=="__modules__"&&M!=="__init__"&&M!=="__depends__"&&(B[M]=P[M]),B),Object.create(null)),F=(_||[]).concat(S),v=$(F),T=Tr(function(B){return v.get(B)});m.forEach(function(B){i[B]=[T,B,"private",v]});let b=(P.__init__||[]).slice();return b.unshift(function(){v.init()}),P=Object.assign({},P,{__init__:b}),V(P,v)}return Object.keys(P).forEach(function(_){if(_==="__init__"||_==="__depends__")return;let S=P[_];if(S[2]==="private"){i[_]=S;return}let F=S[0],v=S[1];i[_]=[ne[F],ss(F,v),F]}),V(P,u)}function Y(P,m){return P.indexOf(m)!==-1||(P=(m.__depends__||[]).reduce(Y,P),P.indexOf(m)!==-1)?P:P.concat(m)}function Z(P){let m=P.reduce(Y,[]).map(q),_=!1;return function(){_||(_=!0,m.forEach(S=>S()))}}this.get=f,this.invoke=A,this.instantiate=g,this.createChild=$,this.init=Z(e)}function ss(e,t){return e!=="value"&&un(t)&&(t=Tr(t.slice())),t}var us=1;function et(e,t){We.call(this,e,us),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}Ee(et,We);et.prototype.canRender=function(){return!0};et.prototype.drawShape=function(t,r,n){var i=J("rect");return Q(i,{x:0,y:0,width:r.width||0,height:r.height||0}),gr(r)?Q(i,k({},this.FRAME_STYLE,n||{})):Q(i,k({},this.SHAPE_STYLE,n||{})),ae(t,i),i};et.prototype.drawConnection=function(t,r,n){var i=Tt(r.waypoints,k({},this.CONNECTION_STYLE,n||{}));return ae(t,i),i};et.prototype.getShapePath=function(t){var r=t.x,n=t.y,i=t.width,o=t.height,u=[["M",r,n],["l",i,0],["l",0,o],["l",-i,0],["z"]];return st(u)};et.prototype.getConnectionPath=function(t){var r=t.waypoints,n,i,o=[];for(n=0;i=r[n];n++)i=i.original||i,o.push([n===0?"M":"L",i.x,i.y]);return st(o)};et.$inject=["eventBus","styles"];function cn(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(r,n,i){var o=this.style(n,i);return k(o,{class:r})},this.style=function(r,n){!ye(r)&&!n&&(n=r,r=[]);var i=Ze(r,function(o,u){return k(o,e[u]||{})},{});return n?k(i,n):i},this.computeStyle=function(r,n,i){return ye(n)||(i=n,n=[]),t.style(n||[],k({},i,r||{}))}}var Ti={__init__:["defaultRenderer"],defaultRenderer:["type",et],styles:["type",cn]};function ki(e,t){if(!e||!t)return-1;var r=e.indexOf(t);return r!==-1&&e.splice(r,1),r}function Mi(e,t,r){if(!(!e||!t)){typeof r!="number"&&(r=-1);var n=e.indexOf(t);if(n!==-1){if(n===r)return;if(r!==-1)e.splice(n,1);else return}r!==-1?e.splice(r,0,t):e.push(t)}}function kr(e,t){return Math.round(e*t)/t}function Di(e){return Te(e)?e+"px":e}function ls(e){for(;e.parent;)e=e.parent;return e}function cs(e){e=k({},{width:"100%",height:"100%"},e);let t=e.container||document.body,r=document.createElement("div");return r.setAttribute("class","djs-container djs-parent"),we(r,{position:"relative",overflow:"hidden",width:Di(e.width),height:Di(e.height)}),t.appendChild(r),r}function Ni(e,t,r){let n=J("g");Be(n).add(t);let i=r!==void 0?r:e.childNodes.length-1;return e.insertBefore(n,e.childNodes[i]||null),n}var fs="base",Bi=0,ps=1,hs={shape:["x","y","width","height"],connection:["waypoints"]};function I(e,t,r,n){this._eventBus=t,this._elementRegistry=n,this._graphicsFactory=r,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}I.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"];I.prototype._init=function(e){let t=this._eventBus,r=this._container=cs(e),n=this._svg=J("svg");Q(n,{width:"100%",height:"100%"}),or(n,"tabindex",0),e.autoFocus&&t.on("element.hover",()=>{this.restoreFocus()}),t.on("element.mousedown",500,o=>{this.focus()}),n.addEventListener("focusin",()=>{this._setFocused(!0)}),n.addEventListener("focusout",()=>{this._setFocused(!1)}),n.addEventListener("mouseover",()=>{this._eventBus.fire("canvas.mouseover")}),n.addEventListener("mouseout",()=>{this._eventBus.fire("canvas.mouseout")}),ae(r,n);let i=this._viewport=Ni(n,"viewport");e.deferUpdate&&(this._viewboxChanged=kn(qe(this._viewboxChanged,this),300)),t.on("diagram.init",()=>{t.fire("canvas.init",{svg:n,viewport:i})}),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)};I.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});let e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport};I.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))};I.prototype._clear=function(){this._elementRegistry.getAll().forEach(t=>{let r=yr(t);r==="root"?this.removeRootElement(t):this._removeElement(t,r)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox};I.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)};I.prototype.restoreFocus=function(){document.activeElement===document.body&&this.focus()};I.prototype.isFocused=function(){return this._focused};I.prototype.getDefaultLayer=function(){return this.getLayer(fs,Bi)};I.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let r=this._layers[e];if(r||(r=this._layers[e]=this._createLayer(e,t)),typeof t!="undefined"&&r.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return r.group};I.prototype._getChildIndex=function(e){return Ze(this._layers,function(t,r){return r.visible&&e>=r.index&&t++,t},0)};I.prototype._createLayer=function(e,t){typeof t=="undefined"&&(t=ps);let r=this._getChildIndex(t);return{group:Ni(this._viewport,"layer-"+e,r),index:t,visible:!0}};I.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");let t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");let r=this._viewport,n=t.group,i=t.index;if(t.visible)return n;let o=this._getChildIndex(i);return r.insertBefore(n,r.childNodes[o]||null),t.visible=!0,n};I.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");let t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");let r=t.group;return t.visible&&(xt(r),t.visible=!1),r};I.prototype._removeLayer=function(e){let t=this._layers[e];t&&(delete this._layers[e],xt(t.group))};I.prototype.getActiveLayer=function(){let e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null};I.prototype.findRoot=function(e){return typeof e=="string"&&(e=this._elementRegistry.get(e)),e?(this._findPlaneForRoot(ls(e))||{}).rootElement:void 0};I.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})};I.prototype._findPlaneForRoot=function(e){return he(this._planes,function(t){return t.rootElement===e})};I.prototype.getContainer=function(){return this._container};I.prototype._updateMarker=function(e,t,r){let n;e.id||(e=this._elementRegistry.get(e)),e.markers=e.markers||new Set,n=this._elementRegistry._elements[e.id],n&&(R([n.gfx,n.secondaryGfx],function(i){i&&(r?(e.markers.add(t),Be(i).add(t)):(e.markers.delete(t),Be(i).remove(t)))}),this._eventBus.fire("element.marker.update",{element:e,gfx:n.gfx,marker:t,add:!!r}))};I.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)};I.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)};I.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),e.markers?e.markers.has(t):!1};I.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)};I.prototype.getRootElement=function(){let e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))};I.prototype.addRootElement=function(e){let t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});let r=e.layer="root-"+t;this._ensureValid("root",e);let n=this.getLayer(r,Bi);return this.hideLayer(r),this._addRoot(e,n),this._planes.push({rootElement:e,layer:n}),e};I.prototype.removeRootElement=function(e){if(typeof e=="string"&&(e=this._elementRegistry.get(e)),!!this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter(function(r){return r.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e};I.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e};I.prototype._removeRoot=function(e){let t=this._elementRegistry,r=this._eventBus;r.fire("root.remove",{element:e}),r.fire("root.removed",{element:e}),t.remove(e)};I.prototype._addRoot=function(e,t){let r=this._elementRegistry,n=this._eventBus;n.fire("root.add",{element:e}),r.add(e,t),n.fire("root.added",{element:e,gfx:t})};I.prototype._setRoot=function(e,t){let r=this._rootElement;r&&(this._elementRegistry.updateGraphics(r,null,!0),this.hideLayer(r.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})};I.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");let r=hs[e];if(!Vr(r,function(i){return typeof t[i]!="undefined"}))throw new Error("must supply { "+r.join(", ")+" } with "+e)};I.prototype._setParent=function(e,t,r){Mi(t.children,e,r),e.parent=t};I.prototype._addElement=function(e,t,r,n){r=r||this.getRootElement();let i=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),i.fire(e+".add",{element:t,parent:r}),this._setParent(t,r,n);let u=o.create(e,t,n);return this._elementRegistry.add(t,u),o.update(e,t,u),i.fire(e+".added",{element:t,gfx:u}),t};I.prototype.addShape=function(e,t,r){return this._addElement("shape",e,t,r)};I.prototype.addConnection=function(e,t,r){return this._addElement("connection",e,t,r)};I.prototype._removeElement=function(e,t){let r=this._elementRegistry,n=this._graphicsFactory,i=this._eventBus;if(e=r.get(e.id||e),!!e)return i.fire(t+".remove",{element:e}),n.remove(e),ki(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+".removed",{element:e}),r.remove(e),e};I.prototype.removeShape=function(e){return this._removeElement(e,"shape")};I.prototype.removeConnection=function(e){return this._removeElement(e,"connection")};I.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)};I.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()};I.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})};I.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);let t=this._viewport,r=this.getSize(),n,i,o,u,l,f,d;if(e)this._changeViewbox(function(){l=Math.min(r.width/e.width,r.height/e.height);let g=this._svg.createSVGMatrix().scale(l).translate(-e.x,-e.y);wt(t,g)});else return o=this._rootElement?this.getActiveLayer():null,n=o&&o.getBBox()||{},u=wt(t),i=u?u.matrix:Kn(),l=kr(i.a,1e3),f=kr(-i.e||0,1e3),d=kr(-i.f||0,1e3),e=this._cachedViewbox={x:f?f/l:0,y:d?d/l:0,width:r.width/l,height:r.height/l,scale:l,inner:{width:n.width||0,height:n.height||0,x:n.x||0,y:n.y||0},outer:r},e;return e};I.prototype.scroll=function(e){let t=this._viewport,r=t.getCTM();return e&&this._changeViewbox(function(){e=k({dx:0,dy:0},e||{}),r=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(r),Oi(t,r)}),{x:r.e,y:r.f}};I.prototype.scrollToElement=function(e,t){let r=100;typeof e=="string"&&(e=this._elementRegistry.get(e));let n=this.findRoot(e);if(n!==this.getRootElement()&&this.setRootElement(n),n===e)return;t||(t={}),typeof t=="number"&&(r=t),t={top:t.top||r,right:t.right||r,bottom:t.bottom||r,left:t.left||r};let i=bt(e),o=zt(i),u=this.viewbox(),l=this.zoom(),f,d;u.y+=t.top/l,u.x+=t.left/l,u.width-=(t.right+t.left)/l,u.height-=(t.bottom+t.top)/l;let g=zt(u);if(!(i.width=0&&n.y>=0&&n.x+n.width<=r.width&&n.y+n.height<=r.height&&!e?o={x:0,y:0,width:Math.max(n.width+n.x,r.width),height:Math.max(n.height+n.y,r.height)}:(i=Math.min(1,r.width/n.width,r.height/n.height),o={x:n.x+(e?n.width/2-r.width/i/2:0),y:n.y+(e?n.height/2-r.height/i/2:0),width:r.width/i,height:r.height/i}),this.viewbox(o),this.viewbox(!1).scale};I.prototype._setZoom=function(e,t){let r=this._svg,n=this._viewport,i=r.createSVGMatrix(),o=r.createSVGPoint(),u,l,f,d,g;f=n.getCTM();let A=f.a;return t?(u=k(o,t),l=u.matrixTransform(f.inverse()),d=i.translate(l.x,l.y).scale(1/A*e).translate(-l.x,-l.y),g=f.multiply(d)):g=i.scale(e),Oi(this._viewport,g),g};I.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}};I.prototype.getAbsoluteBBox=function(e){let t=this.viewbox(),r;e.waypoints?r=this.getGraphics(e).getBBox():r=e;let n=r.x*t.scale-t.x*t.scale,i=r.y*t.scale-t.y*t.scale,o=r.width*t.scale,u=r.height*t.scale;return{x:n,y:i,width:o,height:u}};I.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Lt="data-element-id";function Re(e){this._elements={},this._eventBus=e}Re.$inject=["eventBus"];Re.prototype.add=function(e,t,r){var n=e.id;this._validateId(n),Q(t,Lt,n),r&&Q(r,Lt,n),this._elements[n]={element:e,gfx:t,secondaryGfx:r}};Re.prototype.remove=function(e){var t=this._elements,r=e.id||e,n=r&&t[r];n&&(Q(n.gfx,Lt,""),n.secondaryGfx&&Q(n.secondaryGfx,Lt,""),delete t[r])};Re.prototype.updateId=function(e,t){this._validateId(t),typeof e=="string"&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var r=this.getGraphics(e),n=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,r,n)};Re.prototype.updateGraphics=function(e,t,r){var n=e.id||e,i=this._elements[n];return r?i.secondaryGfx=t:i.gfx=t,t&&Q(t,Lt,n),t};Re.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&Q(e,Lt);var r=this._elements[t];return r&&r.element};Re.prototype.filter=function(e){var t=[];return this.forEach(function(r,n){e(r,n)&&t.push(r)}),t};Re.prototype.find=function(e){for(var t=this._elements,r=Object.keys(t),n=0;n in ref");t=this.props[t]}t.collection?Li(this,t,e):gs(this,t,e)};Ie.prototype.ensureRefsCollection=function(e,t){var r=e[t.name];return ms(r)||Li(this,t,e),r};Ie.prototype.ensureBound=function(e,t){ys(e,t)||this.bind(e,t)};Ie.prototype.unset=function(e,t,r){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(r):e[t.name]=void 0)};Ie.prototype.set=function(e,t,r){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(r):e[t.name]=r)};var fn=new Ie({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Fi=new Ie({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Ii=new Ie({name:"attachers",collection:!0},{name:"host"}),ji=new Ie({name:"outgoing",collection:!0},{name:"source"}),Vi=new Ie({name:"incoming",collection:!0},{name:"target"});function qt(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,r=this.labels;!e&&t?r.remove(t):r.add(e,0)}}),fn.bind(this,"parent"),Fi.bind(this,"labels"),ji.bind(this,"outgoing"),Vi.bind(this,"incoming")}function Kt(){qt.call(this),fn.bind(this,"children"),Ii.bind(this,"host"),Ii.bind(this,"attachers")}Ee(Kt,qt);function Wi(){qt.call(this),fn.bind(this,"children")}Ee(Wi,Kt);function $i(){Kt.call(this),Fi.bind(this,"labelTarget")}Ee($i,Kt);function zi(){qt.call(this),ji.bind(this,"source"),Vi.bind(this,"target")}Ee(zi,qt);var vs={connection:zi,shape:Kt,label:$i,root:Wi};function Hi(e,t){var r=vs[e];if(!r)throw new Error("unknown type: <"+e+">");return k(new r,t)}function mt(){this._uid=12}mt.prototype.createRoot=function(e){return this.create("root",e)};mt.prototype.createLabel=function(e){return this.create("label",e)};mt.prototype.createShape=function(e){return this.create("shape",e)};mt.prototype.createConnection=function(e){return this.create("connection",e)};mt.prototype.create=function(e,t){return t=k({},t||{}),t.id||(t.id=e+"_"+this._uid++),Hi(e,t)};var Mr="__fn",Ui=1e3,Es=Array.prototype.slice;function _e(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}_e.prototype.on=function(e,t,r,n){if(e=ye(e)?e:[e],ot(t)&&(n=r,r=t,t=Ui),!Te(t))throw new Error("priority must be a number");var i=r;n&&(i=qe(r,n),i[Mr]=r[Mr]||r);var o=this;e.forEach(function(u){o._addListener(u,{priority:t,callback:i,next:null})})};_e.prototype.once=function(e,t,r,n){var i=this;if(ot(t)&&(n=r,r=t,t=Ui),!Te(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var u=r.apply(n,arguments);return i.off(e,o),u}o[Mr]=r,this.on(e,t,o)};_e.prototype.off=function(e,t){e=ye(e)?e:[e];var r=this;e.forEach(function(n){r._removeListener(n,t)})};_e.prototype.createEvent=function(e){var t=new Yt;return t.init(e),t};_e.prototype.fire=function(e,t){var r,n,i,o;if(o=Es.call(arguments),typeof e=="object"&&(t=e,e=t.type),!e)throw new Error("no event type specified");if(n=this._listeners[e],!!n){t instanceof Yt?r=t:r=this.createEvent(t),o[0]=r;var u=r.type;e!==u&&(r.type=e);try{i=this._invokeListeners(r,o,n)}finally{e!==u&&(r.type=u)}return i===void 0&&r.defaultPrevented&&(i=!1),i}};_e.prototype.handleError=function(e){return this.fire("error",{error:e})===!1};_e.prototype._destroy=function(){this._listeners={}};_e.prototype._invokeListeners=function(e,t,r){for(var n;r&&!e.cancelBubble;)n=this._invokeListener(e,t,r),r=r.next;return n};_e.prototype._invokeListener=function(e,t,r){var n;if(r.callback.__isTomb)return n;try{n=xs(r.callback,t),n!==void 0&&(e.returnValue=n,e.stopPropagation()),n===!1&&e.preventDefault()}catch(i){if(!this.handleError(i))throw console.error("unhandled error in event listener",i),i}return n};_e.prototype._addListener=function(e,t){var r=this._getListeners(e),n;if(!r){this._setListeners(e,t);return}for(;r;){if(r.priority or , got "+e);return e=(i?i+":":"")+n,{name:e,prefix:i,localName:n}}function Fe(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}Fe.prototype.build=function(){return Dn(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])};Fe.prototype.addProperty=function(e,t,r){typeof t=="boolean"&&(r=t,t=void 0),this.addNamedProperty(e,r!==!1);var n=this.properties;t!==void 0?n.splice(t,0,e):n.push(e)};Fe.prototype.replaceProperty=function(e,t,r){var n=e.ns,i=this.properties,o=this.propertiesByName,u=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var l=i.indexOf(e);if(l===-1)throw new Error("property <"+n.name+"> not found in property list");i.splice(l,1),this.addProperty(t,r?void 0:l,u),o[n.name]=o[n.localName]=t};Fe.prototype.redefineProperty=function(e,t,r){var n=e.ns.prefix,i=t.split("#"),o=ve(i[0],n),u=ve(i[1],o.prefix).name,l=this.propertiesByName[u];if(l)this.replaceProperty(l,e,r);else throw new Error("refined property <"+u+"> not found");delete e.redefines};Fe.prototype.addNamedProperty=function(e,t){var r=e.ns,n=this.propertiesByName;t&&(this.assertNotDefined(e,r.name),this.assertNotDefined(e,r.localName)),n[r.name]=n[r.localName]=e};Fe.prototype.removeNamedProperty=function(e){var t=e.ns,r=this.propertiesByName;delete r[t.name],delete r[t.localName]};Fe.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e};Fe.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e};Fe.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)};Fe.prototype.assertNotDefined=function(e,t){var r=e.name,n=this.propertiesByName[r];if(n)throw new Error("property <"+r+"> already defined; override of <"+n.definedBy.ns.name+"#"+n.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")};Fe.prototype.hasProperty=function(e){return this.propertiesByName[e]};Fe.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var r=this.allTypesByName,n=this.allTypes,i=e.name;i in r||(R(e.properties,qe(function(o){o=k({},o,{name:o.ns.localName,inherited:t}),Object.defineProperty(o,"definedBy",{value:e});var u=o.replaces,l=o.redefines;u||l?this.redefineProperty(o,u||l,u):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),n.push(e),r[i]=e)};function yt(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,R(e,qe(this.registerPackage,this))}yt.prototype.getPackage=function(e){return this.packageMap[e]};yt.prototype.getPackages=function(){return this.packages};yt.prototype.registerPackage=function(e){e=k({},e);var t=this.packageMap;Xi(t,e,"prefix"),Xi(t,e,"uri"),R(e.types,qe(function(r){this.registerType(r,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)};yt.prototype.registerType=function(e,t){e=k({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:k(e.meta||{})});var r=ve(e.name,t.prefix),n=r.name,i={};R(e.properties,qe(function(o){var u=ve(o.name,r.prefix),l=u.name;pn(o.type)||(o.type=ve(o.type,u.prefix).name),k(o,{ns:u,name:l}),i[l]=o},this)),k(e,{ns:r,name:n,propertiesByName:i}),R(e.extends,qe(function(o){var u=ve(o,r.prefix),l=this.typeMap[u.name];l.traits=l.traits||[],l.traits.push(n)},this)),this.definePackage(e,t),this.typeMap[n]=e};yt.prototype.mapTypes=function(e,t,r){var n=pn(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(f,d){var g=ve(f,pn(f)?"":e.prefix);i.mapTypes(g,t,d)}function u(f){return o(f,!0)}function l(f){return o(f,!1)}if(!n)throw new Error("unknown type <"+e.name+">");R(n.superClass,r?u:l),t(n,!r),R(n.traits,u)};yt.prototype.getEffectiveDescriptor=function(e){var t=ve(e),r=new Fe(t);this.mapTypes(t,function(i,o){r.addTrait(i,o)});var n=r.build();return this.definePackage(n,n.allTypes[n.allTypes.length-1].$pkg),n};yt.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};function Xi(e,t,r){var n=t[r];if(n in e)throw new Error("package with "+r+" <"+n+"> already defined")}function At(e){this.model=e}At.prototype.set=function(e,t,r){if(!ke(t)||!t.length)throw new TypeError("property name must be a non-empty string");var n=this.getProperty(e,t),i=n&&n.name;As(r)?n?delete e[i]:delete e.$attrs[hn(t)]:n?i in e?e[i]=r:Ji(e,n,r):e.$attrs[hn(t)]=r};At.prototype.get=function(e,t){var r=this.getProperty(e,t);if(!r)return e.$attrs[hn(t)];var n=r.name;return!e[n]&&r.isMany&&Ji(e,r,[]),e[n]};At.prototype.define=function(e,t,r){if(!r.writable){var n=r.value;r=k({},r,{get:function(){return n}}),delete r.value}Object.defineProperty(e,t,r)};At.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})};At.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})};At.prototype.getProperty=function(e,t){var r=this.model,n=r.getPropertyDescriptor(e,t);if(n)return n;if(t.includes(":"))return null;let i=r.config.strict;if(typeof i!="undefined"){let o=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(i)throw o;typeof console!="undefined"&&console.warn(o)}return null};function As(e){return typeof e=="undefined"}function Ji(e,t,r){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:r,configurable:!0})}function hn(e){return e.replace(/^:/,"")}function Me(e,t={}){this.properties=new At(this),this.factory=new Zi(this,this.properties),this.registry=new yt(e,this.properties),this.typeCache={},this.config=t}Me.prototype.create=function(e,t){var r=this.getType(e);if(!r)throw new Error("unknown type <"+e+">");return new r(t)};Me.prototype.getType=function(e){var t=this.typeCache,r=ke(e)?e:e.ns.name,n=t[r];return n||(e=this.registry.getEffectiveDescriptor(r),n=t[r]=this.factory.createType(e)),n};Me.prototype.createAny=function(e,t,r){var n=ve(e),i={$type:e,$instanceOf:function(u){return u===this.$type},get:function(u){return this[u]},set:function(u,l){Mn(this,[u],l)}},o={name:e,isGeneric:!0,ns:{prefix:n.prefix,localName:n.localName,uri:t}};return this.properties.defineDescriptor(i,o),this.properties.defineModel(i,this),this.properties.define(i,"get",{enumerable:!1,writable:!0}),this.properties.define(i,"set",{enumerable:!1,writable:!0}),this.properties.define(i,"$parent",{enumerable:!1,writable:!0}),this.properties.define(i,"$instanceOf",{enumerable:!1,writable:!0}),R(r,function(u,l){Ae(u)&&u.value!==void 0?i[u.name]=u.value:i[l]=u}),i};Me.prototype.getPackage=function(e){return this.registry.getPackage(e)};Me.prototype.getPackages=function(){return this.registry.getPackages()};Me.prototype.getElementDescriptor=function(e){return e.$descriptor};Me.prototype.hasType=function(e,t){t===void 0&&(t=e,e=this);var r=e.$model.getElementDescriptor(e);return t in r.allTypesByName};Me.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]};Me.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var eo=String.fromCharCode,Ss=Object.prototype.hasOwnProperty,Rs=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,Gt={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(Gt).forEach(function(e){Gt[e.toUpperCase()]=Gt[e]});function Cs(e,t,r,n){return n?Ss.call(Gt,n)?Gt[n]:"&"+n+";":eo(t||parseInt(r,16))}function St(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(Rs,Cs):e}var to="non-whitespace outside of root node";function It(e){return new Error(e)}function ro(e){return"missing namespace for prefix <"+e+">"}function Nr(e){return{get:e,enumerable:!0}}function Ps(e){var t={},r;for(r in e)t[r]=e[r];return t}function yn(e){return e+"$uri"}function Ts(e){var t={},r,n;for(r in e)n=e[r],t[n]=n,t[yn(n)]=r;return t}function no(){return{line:0,column:0}}function ks(e){throw e}function gn(e){if(!this)return new gn(e);var t=e&&e.proxy,r,n,i,o,u=ks,l,f,d,g,A=no,j=!1,$=!1,ne=null,V=!1,q;function Y(m){m instanceof Error||(m=It(m)),ne=m,u(m,A)}function Z(m){l&&(m instanceof Error||(m=It(m)),l(m,A))}this.on=function(m,_){if(typeof _!="function")throw It("required args ");switch(m){case"openTag":n=_;break;case"text":r=_;break;case"closeTag":i=_;break;case"error":u=_;break;case"warn":l=_;break;case"cdata":o=_;break;case"attention":g=_;break;case"question":d=_;break;case"comment":f=_;break;default:throw It("unsupported event: "+m)}return this},this.ns=function(m){if(typeof m=="undefined"&&(m={}),typeof m!="object")throw It("required args ");var _={},S;for(S in m)_[S]=m[S];return $=!0,q=_,this},this.parse=function(m){if(typeof m!="string")throw It("required args ");return ne=null,P(m),A=no,V=!1,ne},this.stop=function(){V=!0};function P(m){var _=$?[]:null,S=$?Ts(q):null,F,v=[],T=0,b=!1,B=!1,M=0,N=0,H,Ge,ie,G,ze,He,le,je,E,x="",L=0,ee;function De(){if(ee!==null)return ee;var s,a,p,h=$&&S.xmlns,y=$&&j?[]:null,w=L,O=x,U=O.length,ce,ue,de,Ve,te,it={},Qt={},Ne,W,X;e:for(;w8)){for((W<65||W>122||W>90&&W<97)&&W!==95&&W!==58&&(Z("illegal first char attribute name"),Ne=!0),X=w+1;X96&&W<123||W>64&&W<91||W>47&&W<59||W===46||W===45||W===95)){if(W===32||W<14&&W>8){Z("missing attribute value"),w=X;continue e}if(W===61)break;Z("illegal attribute name char"),Ne=!0}if(te=O.substring(w,X),te==="xmlns:xmlns"&&(Z("illegal declaration of xmlns"),Ne=!0),W=O.charCodeAt(X+1),W===34)X=O.indexOf('"',w=X+2),X===-1&&(X=O.indexOf("'",w),X!==-1&&(Z("attribute value quote missmatch"),Ne=!0));else if(W===39)X=O.indexOf("'",w=X+2),X===-1&&(X=O.indexOf('"',w),X!==-1&&(Z("attribute value quote missmatch"),Ne=!0));else for(Z("missing attribute value quotes"),Ne=!0,X=X+1;X8));X++);for(X===-1&&(Z("missing closing quotes"),X=U,Ne=!0),Ne||(de=O.substring(w,X)),w=X;X+18));X++)w===X&&(Z("illegal character after attribute end"),Ne=!0);if(w=X+1,Ne)continue e;if(te in Qt){Z("attribute <"+te+"> already defined");continue}if(Qt[te]=!0,!$){it[te]=de;continue}if(j){if(ue=te==="xmlns"?"xmlns":te.charCodeAt(0)===120&&te.substr(0,6)==="xmlns:"?te.substr(6):null,ue!==null){if(s=St(de),a=yn(ue),Ve=q[s],!Ve){if(ue==="xmlns"||a in S&&S[a]!==s)do Ve="ns"+T++;while(typeof S[Ve]!="undefined");else Ve=ue;q[s]=Ve}S[ue]!==Ve&&(ce||(S=Ps(S),ce=!0),S[ue]=Ve,ue==="xmlns"&&(S[yn(Ve)]=s,h=Ve),S[a]=s),it[te]=de;continue}y.push(te,de);continue}if(W=te.indexOf(":"),W===-1){it[te]=de;continue}if(!(p=S[te.substring(0,W)])){Z(ro(te.substring(0,W)));continue}te=h===p?te.substr(W+1):p+te.substr(W),it[te]=de}if(j)for(w=0,U=y.length;w=h&&(w=s.exec(m),!(!w||(y=w[0].length+w.index,y>M)));)a+=1,h=y;return M==-1?(p=y,O=m.substring(N)):N===0?O=m.substring(N,M):(p=M-h,O=N==-1?m.substring(M):m.substring(M,N+1)),{data:O,line:a,column:p}}for(A=c,t&&(E=Object.create({},{name:Nr(function(){return le}),originalName:Nr(function(){return je}),attrs:Nr(De),ns:Nr(function(){return S})}));N!==-1;){if(m.charCodeAt(N)===60?M=N:M=m.indexOf("<",N),M===-1){if(v.length)return Y("unexpected end of file");if(N===0)return Y("missing start tag");N",M),N===-1)return Y("unclosed cdata");if(o&&(o(m.substring(M+9,N),A),V))return;N+=3;continue}if(ie===45&&m.charCodeAt(M+3)===45){if(N=m.indexOf("-->",M),N===-1)return Y("unclosed comment");if(f&&(f(m.substring(M+4,N),St,A),V))return;N+=3;continue}}if(G===63){if(N=m.indexOf("?>",M),N===-1)return Y("unclosed question");if(d&&(d(m.substring(M,N+2),A),V))return;N+=2;continue}for(H=M+1;;H++){if(ze=m.charCodeAt(H),isNaN(ze))return N=-1,Y("unclosed tag");if(ze===34)ie=m.indexOf('"',H+1),H=ie!==-1?ie:H;else if(ze===39)ie=m.indexOf("'",H+1),H=ie!==-1?ie:H;else if(ze===62){N=H;break}}if(G===33){if(g&&(g(m.substring(M,N+1),St,A),V))return;N+=1;continue}if(ee={},G===47){if(b=!1,B=!0,!v.length)return Y("missing open tag");if(H=le=v.pop(),ie=M+2+H.length,m.substring(M+2,ie)!==H)return Y("closing tag mismatch");for(;ie8&&G<14))return Y("close tag")}else{if(m.charCodeAt(N-1)===47?(H=le=m.substring(M+1,N-1),b=!0,B=!0):(H=le=m.substring(M+1,N),b=!0,B=!1),!(G>96&&G<123||G>64&&G<91||G===95||G===58))return Y("illegal first char nodeName");for(ie=1,Ge=H.length;ie96&&G<123||G>64&&G<91||G>47&&G<59||G===45||G===95||G==46)){if(G===32||G<14&&G>8){le=H.substring(0,ie),ee=null;break}return Y("invalid nodeName")}B||v.push(le)}if($){if(F=S,b&&(B||_.push(F),ee===null&&(j=H.indexOf("xmlns",ie)!==-1)&&(L=ie,x=H,De(),j=!1)),je=le,G=le.indexOf(":"),G!==-1){if(He=S[le.substring(0,G)],!He)return Y("missing namespace on <"+je+">");le=le.substr(G+1)}else He=S.xmlns;He&&(le=He+":"+le)}if(b&&(L=ie,x=H,n&&(t?n(E,St,B,A):n(le,De,St,B,A),V)))return;if(B){if(i&&(i(t?E:le,St,b,A),V))return;$&&(b?S=F:S=_.pop())}N+=1}}}function io(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var vn={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},oo="property";function ao(e){return e.xml&&e.xml.serialize}function Ms(e){let t=ao(e);return t!==oo&&(t||null)}function Ds(e){return e.charAt(0).toUpperCase()+e.slice(1)}function so(e,t){return io(t)?e.prefix+":"+Ds(e.localName):e.name}function Ns(e,t){var r=e.name,n=e.localName,i=t&&t.xml&&t.xml.typePrefix;return i&&n.indexOf(i)===0?e.prefix+":"+n.slice(i.length):r}function Bs(e,t,r){let n=ve(e,t.xmlns),i=`${t[n.prefix]||n.prefix}:${n.localName}`,o=ve(i);var u=r.getPackage(o.prefix);return Ns(o,u)}function gt(e){return new Error(e)}function ft(e){return e.$descriptor}function Os(e){k(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw gt("expected element");var r=this.elementsById,n=ft(t),i=n.idProperty,o;if(i&&(o=t.get(i.name),o)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(o))throw new Error("illegal ID <"+o+">");if(r[o])throw gt("duplicate ID <"+o+">");r[o]=t}},this.addWarning=function(t){this.warnings.push(t)}}function Xt(){}Xt.prototype.handleEnd=function(){};Xt.prototype.handleText=function(){};Xt.prototype.handleNode=function(){};function En(){}En.prototype=Object.create(Xt.prototype);En.prototype.handleNode=function(){return this};function jt(){}jt.prototype=Object.create(Xt.prototype);jt.prototype.handleText=function(e){this.body=(this.body||"")+e};function Zt(e,t){this.property=e,this.context=t}Zt.prototype=Object.create(jt.prototype);Zt.prototype.handleNode=function(e){if(this.element)throw gt("expected no sub nodes");return this.element=this.createReference(e),this};Zt.prototype.handleEnd=function(){this.element.id=this.body};Zt.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}};function xn(e,t){this.element=t,this.propertyDesc=e}xn.prototype=Object.create(jt.prototype);xn.prototype.handleEnd=function(){var e=this.body||"",t=this.element,r=this.propertyDesc;e=Dr(r.type,e),r.isMany?t.get(r.name).push(e):t.set(r.name,e)};function Br(){}Br.prototype=Object.create(jt.prototype);Br.prototype.handleNode=function(e){var t=this,r=this.element;return r?t=this.handleChild(e):(r=this.element=this.createElement(e),this.context.addElement(r)),t};function be(e,t,r){this.model=e,this.type=e.getType(t),this.context=r}be.prototype=Object.create(Br.prototype);be.prototype.addReference=function(e){this.context.addReference(e)};be.prototype.handleText=function(e){var t=this.element,r=ft(t),n=r.bodyProperty;if(!n)throw gt("unexpected body text <"+e+">");jt.prototype.handleText.call(this,e)};be.prototype.handleEnd=function(){var e=this.body,t=this.element,r=ft(t),n=r.bodyProperty;n&&e!==void 0&&(e=Dr(n.type,e),t.set(n.name,e))};be.prototype.createElement=function(e){var t=e.attributes,r=this.type,n=ft(r),i=this.context,o=new r({}),u=this.model,l;return R(t,function(f,d){var g=n.propertiesByName[d],A;g&&g.isReference?g.isMany?(A=f.split(" "),R(A,function(j){i.addReference({element:o,property:g.ns.name,id:j})})):i.addReference({element:o,property:g.ns.name,id:f}):(g?f=Dr(g.type,f):d==="xmlns"?d=":"+d:(l=ve(d,n.ns.prefix),u.getPackage(l.prefix)&&i.addWarning({message:"unknown attribute <"+d+">",element:o,property:d,value:f})),o.set(d,f))}),o};be.prototype.getPropertyForNode=function(e){var t=e.name,r=ve(t),n=this.type,i=this.model,o=ft(n),u=r.name,l=o.propertiesByName[u];if(l&&!l.isAttr){let d=Ms(l);if(d){let g=e.attributes[d];if(g){let A=Bs(g,e.ns,i),j=i.getType(A);return k({},l,{effectiveType:ft(j).name})}}return l}var f=i.getPackage(r.prefix);if(f){let d=so(r,f),g=i.getType(d);if(l=he(o.properties,function(A){return!A.isVirtual&&!A.isReference&&!A.isAttribute&&g.hasType(A.type)}),l)return k({},l,{effectiveType:ft(g).name})}else if(l=he(o.properties,function(d){return!d.isReference&&!d.isAttribute&&d.type==="Element"}),l)return l;throw gt("unrecognized element <"+r.name+">")};be.prototype.toString=function(){return"ElementDescriptor["+ft(this.type).name+"]"};be.prototype.valueHandler=function(e,t){return new xn(e,t)};be.prototype.referenceHandler=function(e){return new Zt(e,this.context)};be.prototype.handler=function(e){return e==="Element"?new Ft(this.model,e,this.context):new be(this.model,e,this.context)};be.prototype.handleChild=function(e){var t,r,n,i;if(t=this.getPropertyForNode(e),n=this.element,r=t.effectiveType||t.type,mn(r))return this.valueHandler(t,n);t.isReference?i=this.referenceHandler(t).handleNode(e):i=this.handler(r).handleNode(e);var o=i.element;return o!==void 0&&(t.isMany?n.get(t.name).push(o):n.set(t.name,o),t.isReference?(k(o,{element:n}),this.context.addReference(o)):o.$parent=n),i};function wn(e,t,r){be.call(this,e,t,r)}wn.prototype=Object.create(be.prototype);wn.prototype.createElement=function(e){var t=e.name,r=ve(t),n=this.model,i=this.type,o=n.getPackage(r.prefix),u=o&&so(r,o)||t;if(!i.hasType(u))throw gt("unexpected element <"+e.originalName+">");return be.prototype.createElement.call(this,e)};function Ft(e,t,r){this.model=e,this.context=r}Ft.prototype=Object.create(Br.prototype);Ft.prototype.createElement=function(e){var t=e.name,r=ve(t),n=r.prefix,i=e.ns[n+"$uri"],o=e.attributes;return this.model.createAny(t,i,o)};Ft.prototype.handleChild=function(e){var t=new Ft(this.model,"Element",this.context).handleNode(e),r=this.element,n=t.element,i;return n!==void 0&&(i=r.$children=r.$children||[],i.push(n),n.$parent=r),t};Ft.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function Or(e){e instanceof Me&&(e={model:e}),k(this,{lax:!1},e)}Or.prototype.fromXML=function(e,t,r){var n=t.rootHandler;t instanceof be?(n=t,t={}):typeof t=="string"?(n=this.handler(t),t={}):typeof n=="string"&&(n=this.handler(n));var i=this.model,o=this.lax,u=new Os(k({},t,{rootHandler:n})),l=new gn({proxy:!0}),f=Ls();n.context=u,f.push(n);function d(_,S,F){var v=S(),T=v.line,b=v.column,B=v.data;B.charAt(0)==="<"&&B.indexOf(" ")!==-1&&(B=B.slice(0,B.indexOf(" "))+">");var M="unparsable content "+(B?B+" ":"")+`detected - line: `+T+` - column: `+b+` - nested error: `+_.message;if(F)return u.addWarning({message:M,error:_}),!0;throw gt(M)}function g(_,S){return d(_,S,!0)}function A(){var _=u.elementsById,S=u.references,F,v;for(F=0;v=S[F];F++){var T=v.element,b=_[v.id],B=ft(T).propertiesByName[v.property];if(b||u.addWarning({message:"unresolved reference <"+v.id+">",element:v.element,property:v.property,value:v.id}),B.isMany){var M=T.get(B.name),N=M.indexOf(v);N===-1&&(N=M.length),b?M[N]=b:M.splice(N,1)}else T.set(B.name,b)}}function j(){f.pop().handleEnd()}var $=/^<\?xml /i,ne=/ encoding="([^"]+)"/i,V=/^utf-8$/i;function q(_){if($.test(_)){var S=ne.exec(_),F=S&&S[1];!F||V.test(F)||u.addWarning({message:"unsupported document encoding <"+F+">, falling back to UTF-8"})}}function Y(_,S){var F=f.peek();try{f.push(F.handleNode(_))}catch(v){d(v,S,o)&&f.push(new En)}}function Z(_,S){try{f.peek().handleText(_)}catch(F){g(F,S)}}function P(_,S){_.trim()&&Z(_,S)}var m=i.getPackages().reduce(function(_,S){return _[S.uri]=S.prefix,_},Object.entries(vn).reduce(function(_,[S,F]){return _[F]=S,_},i.config&&i.config.nsMap||{}));return l.ns(m).on("openTag",function(_,S,F,v){var T=_.attrs||{},b=Object.keys(T).reduce(function(M,N){var H=S(T[N]);return M[N]=H,M},{}),B={name:_.name,originalName:_.originalName,attributes:b,ns:_.ns};Y(B,v)}).on("question",q).on("closeTag",j).on("cdata",Z).on("text",function(_,S,F){P(S(_),F)}).on("error",d).on("warn",g),new Promise(function(_,S){var F;try{l.parse(e),A()}catch(M){F=M}var v=n.element;!F&&!v&&(F=gt("failed to parse document as <"+n.type.$descriptor.name+">"));var T=u.warnings,b=u.references,B=u.elementsById;return F?(F.warnings=T,S(F)):_({rootElement:v,elementsById:B,references:b,warnings:T})})};Or.prototype.handler=function(e){return new wn(this.model,e)};function Ls(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}var Is=` -`,Fs=/<|>|'|"|&|\n\r|\n/g,uo=/<|>|&/g;function rt(e){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=e,this.defaultPrefixMap=e&&e.defaultPrefixMap||{}}rt.prototype.mapDefaultPrefixes=function(e){this.defaultPrefixMap=e};rt.prototype.defaultUriByPrefix=function(e){return this.defaultPrefixMap[e]};rt.prototype.byUri=function(e){return this.uriMap[e]||this.parent&&this.parent.byUri(e)};rt.prototype.add=function(e,t){this.uriMap[e.uri]=e,t?this.wellknown.push(e):this.custom.push(e),this.mapPrefix(e.prefix,e.uri)};rt.prototype.uriByPrefix=function(e){return this.prefixMap[e||"xmlns"]||this.parent&&this.parent.uriByPrefix(e)};rt.prototype.mapPrefix=function(e,t){this.prefixMap[e||"xmlns"]=t};rt.prototype.getNSKey=function(e){return e.prefix!==void 0?e.uri+"|"+e.prefix:e.uri};rt.prototype.logUsed=function(e){var t=e.uri,r=this.getNSKey(e);this.used[r]=this.byUri(t),this.parent&&this.parent.logUsed(e)};rt.prototype.getUsed=function(e){var t=[].concat(this.wellknown,this.custom);return t.filter(r=>{var n=this.getNSKey(r);return this.used[n]})};function js(e){return e.charAt(0).toLowerCase()+e.slice(1)}function Vs(e,t){return io(t)?js(e):e}function lo(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function co(e){return ke(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function Ws(e){return e.getUsed().filter(function(t){return t.prefix!=="xml"}).map(function(t){var r="xmlns"+(t.prefix?":"+t.prefix:"");return{name:r,value:t.uri}})}function $s(e,t){return t.isGeneric?k({localName:t.ns.localName},e):k({localName:Vs(t.ns.localName,t.$pkg)},e)}function zs(e,t){return k({localName:t.ns.localName},e)}function Hs(e){var t=e.$descriptor;return Xe(t.properties,function(r){var n=r.name;if(r.isVirtual||!Ue(e,n))return!1;var i=e[n];return i===r.default||i===null?!1:r.isMany?i.length:!0})}var Us={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},qs={"<":"lt",">":"gt","&":"amp"};function fo(e,t,r){return e=ke(e)?e:""+e,e.replace(t,function(n){return"&"+r[n]+";"})}function Ks(e){return fo(e,Fs,Us)}function Ys(e){return fo(e,uo,qs)}function Gs(e){return Xe(e,function(t){return t.isAttr})}function Xs(e){return Xe(e,function(t){return!t.isAttr})}function _n(e){this.tagName=e}_n.prototype.build=function(e){return this.element=e,this};_n.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"").appendNewLine()};function Rt(){}Rt.prototype.serializeValue=Rt.prototype.serializeTo=function(e){e.append(this.escape?Ys(this.value):this.value)};Rt.prototype.build=function(e,t){return this.value=t,e.type==="String"&&t.search(uo)!==-1&&(this.escape=!0),this};function bn(e){this.tagName=e}lo(bn,Rt);bn.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("").appendNewLine()};function oe(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}oe.prototype.build=function(e){this.element=e;var t=e.$descriptor,r=this.propertyDescriptor,n,i,o=t.isGeneric;return o?n=this.parseGenericNsAttributes(e):n=this.parseNsAttributes(e),r?this.ns=this.nsPropertyTagName(r):this.ns=this.nsTagName(t),this.tagName=this.addTagName(this.ns),o?this.parseGenericContainments(e):(i=Hs(e),this.parseAttributes(Gs(i)),this.parseContainments(Xs(i))),this.parseGenericAttributes(e,n),this};oe.prototype.nsTagName=function(e){var t=this.logNamespaceUsed(e.ns);return $s(t,e)};oe.prototype.nsPropertyTagName=function(e){var t=this.logNamespaceUsed(e.ns);return zs(t,e)};oe.prototype.isLocalNs=function(e){return e.uri===this.ns.uri};oe.prototype.nsAttributeName=function(e){var t;if(ke(e)?t=ve(e):t=e.ns,e.inherited)return{localName:t.localName};var r=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(r),this.isLocalNs(r)?{localName:t.localName}:k({localName:t.localName},r)};oe.prototype.parseGenericNsAttributes=function(e){return Object.entries(e).filter(([t,r])=>!t.startsWith("$")&&this.parseNsAttribute(e,t,r)).map(([t,r])=>({name:t,value:r}))};oe.prototype.parseGenericContainments=function(e){var t=e.$body;t&&this.body.push(new Rt().build({type:"String"},t));var r=e.$children;r&&R(r,n=>{this.body.push(new oe(this).build(n))})};oe.prototype.parseNsAttribute=function(e,t,r){var n=e.$model,i=ve(t),o;if(i.prefix==="xmlns"&&(o={prefix:i.localName,uri:r}),!i.prefix&&i.localName==="xmlns"&&(o={uri:r}),!o)return{name:t,value:r};if(n&&n.getPackage(r))this.logNamespace(o,!0,!0);else{var u=this.logNamespaceUsed(o,!0);this.getNamespaces().logUsed(u)}};oe.prototype.parseNsAttributes=function(e){var t=this,r=e.$attrs,n=[];return R(r,function(i,o){var u=t.parseNsAttribute(e,o,i);u&&n.push(u)}),n};oe.prototype.parseGenericAttributes=function(e,t){var r=this;R(t,function(n){try{r.addAttribute(r.nsAttributeName(n.name),n.value)}catch(i){typeof console!="undefined"&&console.warn(`missing namespace information for <${n.name}=${n.value}> on`,e,i)}})};oe.prototype.parseContainments=function(e){var t=this,r=this.body,n=this.element;R(e,function(i){var o=n.get(i.name),u=i.isReference,l=i.isMany;if(l||(o=[o]),i.isBody)r.push(new Rt().build(i,o[0]));else if(mn(i.type))R(o,function(d){r.push(new bn(t.addTagName(t.nsPropertyTagName(i))).build(i,d))});else if(u)R(o,function(d){r.push(new _n(t.addTagName(t.nsPropertyTagName(i))).build(d))});else{var f=ao(i);R(o,function(d){var g;f?f===oo?g=new oe(t,i):g=new Lr(t,i,f):g=new oe(t),r.push(g.build(d))})}})};oe.prototype.getNamespaces=function(e){var t=this.namespaces,r=this.parent,n;return t||(n=r&&r.getNamespaces(),e||!n?this.namespaces=t=new rt(n):t=n),t};oe.prototype.logNamespace=function(e,t,r){var n=this.getNamespaces(r),i=e.uri,o=e.prefix,u=n.byUri(i);return(!u||r)&&n.add(e,t),n.mapPrefix(o,i),e};oe.prototype.logNamespaceUsed=function(e,t){var r=this.getNamespaces(t),n=e.prefix,i=e.uri,o,u,l;if(!n&&!i)return{localName:e.localName};if(l=r.defaultUriByPrefix(n),i=i||l||r.uriByPrefix(n),!i)throw new Error("no namespace uri given for prefix <"+n+">");if(e=r.byUri(i),!e&&!n&&(e=this.logNamespace({uri:i},l===i,!0)),!e){for(o=n,u=1;r.uriByPrefix(o);)o=n+"_"+u++;e=this.logNamespace({prefix:o,uri:i},l===i)}return n&&r.mapPrefix(n,i),e};oe.prototype.parseAttributes=function(e){var t=this,r=this.element;R(e,function(n){var i=r.get(n.name);if(n.isReference)if(!n.isMany)i=i.id;else{var o=[];R(i,function(u){o.push(u.id)}),i=o.join(" ")}t.addAttribute(t.nsAttributeName(n),i)})};oe.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),co(e)};oe.prototype.addAttribute=function(e,t){var r=this.attrs;ke(t)&&(t=Ks(t));var n=Pn(r,function(o){return o.name.localName===e.localName&&o.name.uri===e.uri&&o.name.prefix===e.prefix}),i={name:e,value:t};n!==-1?r.splice(n,1,i):r.push(i)};oe.prototype.serializeAttributes=function(e){var t=this.attrs,r=this.namespaces;r&&(t=Ws(r).concat(t)),R(t,function(n){e.append(" ").append(co(n.name)).append('="').append(n.value).append('"')})};oe.prototype.serializeTo=function(e){var t=this.body[0],r=t&&t.constructor!==Rt;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(r&&e.appendNewLine().indent(),R(this.body,function(n){n.serializeTo(e)}),r&&e.unindent().appendIndent(),e.append("")),e.appendNewLine()};function Lr(e,t,r){oe.call(this,e,t),this.serialization=r}lo(Lr,oe);Lr.prototype.parseNsAttributes=function(e){var t=oe.prototype.parseNsAttributes.call(this,e).filter(u=>u.name!==this.serialization),r=e.$descriptor;if(r.name===this.propertyDescriptor.type)return t;var n=this.typeNs=this.nsTagName(r);this.getNamespaces().logUsed(this.typeNs);var i=e.$model.getPackage(n.uri),o=i.xml&&i.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(this.serialization),(n.prefix?n.prefix+":":"")+o+r.ns.localName),t};Lr.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri};function Zs(){this.value="",this.write=function(e){this.value+=e}}function Qs(e,t){var r=[""];this.append=function(n){return e.write(n),this},this.appendNewLine=function(){return t&&e.write(` -`),this},this.appendIndent=function(){return t&&e.write(r.join(" ")),this},this.indent=function(){return r.push(""),this},this.unindent=function(){return r.pop(),this}}function po(e){e=k({format:!1,preamble:!0},e||{});function t(r,n){var i=n||new Zs,o=new Qs(i,e.format);e.preamble&&o.append(Is);var u=new oe,l=r.$model;if(u.getNamespaces().mapDefaultPrefixes(Js(l)),u.build(r).serializeTo(o),!n)return i.value}return{toXML:t}}function Js(e){let t=e.config&&e.config.nsMap||{},r={};for(let n in vn)r[n]=vn[n];for(let n in t){let i=t[n];r[i]=n}for(let n of e.getPackages())r[n.prefix]=n.uri;return r}function Ir(e,t){Me.call(this,e,t)}Ir.prototype=Object.create(Me.prototype);Ir.prototype.fromXML=function(e,t,r){ke(t)||(r=t,t="bpmn:Definitions");var n=new Or(k({model:this,lax:!0},r)),i=n.handler(t);return n.fromXML(e,i)};Ir.prototype.toXML=function(e,t){var r=new po(t);return new Promise(function(n,i){try{var o=r.toXML(e);return n({xml:o})}catch(u){return i(u)}})};var eu="BPMN20",tu="http://www.omg.org/spec/BPMN/20100524/MODEL",ru="bpmn",nu=[],iu=[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],ou=[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],au={tagAlias:"lowerCase",typePrefix:"t"},su={name:eu,uri:tu,prefix:ru,associations:nu,types:iu,enumerations:ou,xml:au},uu="BPMNDI",lu="http://www.omg.org/spec/BPMN/20100524/DI",cu="bpmndi",fu=[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],pu=[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],hu=[],du={name:uu,uri:lu,prefix:cu,types:fu,enumerations:pu,associations:hu},mu="DC",yu="http://www.omg.org/spec/DD/20100524/DC",gu="dc",vu=[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],Eu=[],xu={name:mu,uri:yu,prefix:gu,types:vu,associations:Eu},wu="DI",_u="http://www.omg.org/spec/DD/20100524/DI",bu="di",Au=[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],Su=[],Ru={tagAlias:"lowerCase"},Cu={name:wu,uri:_u,prefix:bu,types:Au,associations:Su,xml:Ru},Pu="bpmn.io colors for BPMN",Tu="http://bpmn.io/schema/bpmn/biocolor/1.0",ku="bioc",Mu=[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],Du=[],Nu=[],Bu={name:Pu,uri:Tu,prefix:ku,types:Mu,enumerations:Du,associations:Nu},Ou="BPMN in Color",Lu="http://www.omg.org/spec/BPMN/non-normative/color/1.0",Iu="color",Fu=[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],ju=[],Vu=[],Wu={name:Ou,uri:Lu,prefix:Iu,types:Fu,enumerations:ju,associations:Vu},$u={bpmn:su,bpmndi:du,dc:xu,di:Cu,bioc:Bu,color:Wu};function ho(e,t){let r=k({},$u,e);return new Ir(r,t)}var zu="Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472";function mo(e){Ue(e,"di")||Object.defineProperty(e,"di",{enumerable:!1,get:function(){throw new Error(zu)}})}function Pe(e,t){return e.$instanceOf(t)}function Hu(e){return he(e.rootElements,function(t){return Pe(t,"bpmn:Process")||Pe(t,"bpmn:Collaboration")})}function An(e){var t={},r=[],n={};function i(E,x){return function(L){E(L,x)}}function o(E){t[E.id]=E}function u(E){return t[E.id]}function l(E,x){var L=E.gfx;if(L)throw new Error(`already rendered ${me(E)}`);return e.element(E,n[E.id],x)}function f(E,x){return e.root(E,n[E.id],x)}function d(E,x){try{var L=n[E.id]&&l(E,x);return o(E),L}catch(ee){g(ee.message,{element:E,error:ee}),console.error(`failed to import ${me(E)}`,ee)}}function g(E,x){e.error(E,x)}var A=this.registerDi=function(x){var L=x.bpmnElement;L?n[L.id]?g(`multiple DI elements defined for ${me(L)}`,{element:L}):(n[L.id]=x,mo(L)):g(`no bpmnElement referenced in ${me(x)}`,{element:x})};function j(E){$(E.plane)}function $(E){A(E),R(E.planeElement,ne)}function ne(E){A(E)}this.handleDefinitions=function(x,L){var ee=x.diagrams;if(L&&ee.indexOf(L)===-1)throw new Error("diagram not part of ");if(!L&&ee&&ee.length&&(L=ee[0]),!L)throw new Error("no diagram to display");n={},j(L);var De=L.plane;if(!De)throw new Error(`no plane for ${me(L)}`);var c=De.bpmnElement;if(!c)if(c=Hu(x),c)g(`correcting missing bpmnElement on ${me(De)} to ${me(c)}`),De.bpmnElement=c,A(De);else throw new Error("no process or collaboration to display");var s=f(c,De);if(Pe(c,"bpmn:Process")||Pe(c,"bpmn:SubProcess"))q(c,s);else if(Pe(c,"bpmn:Collaboration"))le(c,s),Y(x.rootElements,s);else throw new Error(`unsupported bpmnElement for ${me(De)}: ${me(c)}`);V(r)};var V=this.handleDeferred=function(){for(var x;r.length;)x=r.shift(),x()};function q(E,x){G(E,x),T(E.ioSpecification,x),v(E.artifacts,x),o(E)}function Y(E,x){var L=Xe(E,function(ee){return!u(ee)&&Pe(ee,"bpmn:Process")&&ee.laneSets});L.forEach(i(q,x))}function Z(E,x){d(E,x)}function P(E,x){R(E,i(Z,x))}function m(E,x){d(E,x)}function _(E,x){d(E,x)}function S(E,x){d(E,x)}function F(E,x){d(E,x)}function v(E,x){R(E,function(L){Pe(L,"bpmn:Association")?r.push(function(){F(L,x)}):F(L,x)})}function T(E,x){E&&(R(E.dataInputs,i(_,x)),R(E.dataOutputs,i(S,x)))}var b=this.handleSubProcess=function(x,L){G(x,L),v(x.artifacts,L)};function B(E,x){var L=d(E,x);Pe(E,"bpmn:SubProcess")&&b(E,L||x),Pe(E,"bpmn:Activity")&&T(E.ioSpecification,x),r.push(function(){R(E.dataInputAssociations,i(m,x)),R(E.dataOutputAssociations,i(m,x))})}function M(E,x){d(E,x)}function N(E,x){d(E,x)}function H(E,x){r.push(function(){var L=d(E,x);E.childLaneSet&&Ge(E.childLaneSet,L||x),je(E)})}function Ge(E,x){R(E.lanes,i(H,x))}function ie(E,x){R(E,i(Ge,x))}function G(E,x){ze(E.flowElements,x),E.laneSets&&ie(E.laneSets,x)}function ze(E,x){R(E,function(L){Pe(L,"bpmn:SequenceFlow")?r.push(function(){M(L,x)}):Pe(L,"bpmn:BoundaryEvent")?r.unshift(function(){B(L,x)}):Pe(L,"bpmn:FlowNode")?B(L,x):Pe(L,"bpmn:DataObject")||(Pe(L,"bpmn:DataStoreReference")||Pe(L,"bpmn:DataObjectReference")?N(L,x):g(`unrecognized flowElement ${me(L)} in context ${me(x&&x.businessObject)}`,{element:L,context:x}))})}function He(E,x){var L=d(E,x),ee=E.processRef;ee&&q(ee,L||x)}function le(E,x){R(E.participants,i(He,x)),r.push(function(){P(E.messageFlows,x)}),v(E.artifacts,x)}function je(E){R(E.flowNodeRef,function(x){var L=x.get("lanes");L&&L.push(E)})}}function yo(e,t,r){var n,i,o,u,l=[];function f(d,g){var A={root:function(V,q){return n.add(V,q)},element:function(V,q,Y){return n.add(V,q,Y)},error:function(V,q){l.push({message:V,context:q})}},j=new An(A);g=g||d.diagrams&&d.diagrams[0];var $=Uu(d,g);if(!$)throw new Error("no diagram to display");R($,function(V){j.handleDefinitions(d,V)});var ne=g.plane.bpmnElement.id;o.setRootElement(o.findRoot(ne+"_plane")||o.findRoot(ne))}return new Promise(function(d,g){try{return n=e.get("bpmnImporter"),i=e.get("eventBus"),o=e.get("canvas"),i.fire("import.render.start",{definitions:t}),f(t,r),i.fire("import.render.complete",{error:u,warnings:l}),d({warnings:l})}catch(A){return A.warnings=l,g(A)}})}function Uu(e,t){if(!(!t||!t.plane)){var r=t.plane.bpmnElement,n=r;!D(r,"bpmn:Process")&&!D(r,"bpmn:Collaboration")&&(n=qu(r));var i;D(n,"bpmn:Collaboration")?i=n:i=he(e.rootElements,function(d){if(D(d,"bpmn:Collaboration"))return he(d.participants,function(g){return g.processRef===n})});var o=[n];i&&(o=Tn(i.participants,function(d){return d.processRef}),o.push(i));var u=go(o),l=[t],f=[r];return R(e.diagrams,function(d){if(d.plane){var g=d.plane.bpmnElement;u.indexOf(g)!==-1&&f.indexOf(g)===-1&&(l.push(d),f.push(g))}}),l}}function go(e){var t=[];return R(e,function(r){r&&(t.push(r),t=t.concat(go(r.flowElements)))}),t}function qu(e){for(var t=e;t;){if(D(t,"bpmn:Process"))return t;t=t.$parent}}var Ku='',Sn=Ku,Rn={verticalAlign:"middle"},Cn={color:"#404040"},Yu={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},Gu={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},Xu={position:"absolute",left:"50%",top:"40%",transform:"translate(-50%)",width:"260px",padding:"10px",background:"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",display:"flex",lineHeight:"1.3"},Zu='
            '+Sn+'Web-based tooling for BPMN, DMN and forms powered by bpmn.io.
            ',nt;function Qu(){nt=xe(Zu),we(nt,Yu),we(Le("svg",nt),Rn),we(Le(".backdrop",nt),Gu),we(Le(".notice",nt),Xu),we(Le(".link",nt),Cn,{margin:"15px 20px 15px 10px",alignSelf:"center"})}function vo(){nt||(Qu(),Wt.bind(nt,".backdrop","click",function(e){document.body.removeChild(nt)})),document.body.appendChild(nt)}function se(e){e=k({},el,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),this._init(this._container,this._moddle,e),rl(this._container)}Ee(se,tt);se.prototype.importXML=async function(t,r){let n=this;function i(u){return n.get("eventBus").createEvent(u)}let o=[];try{t=this._emit("import.parse.start",{xml:t})||t;let u;try{u=await this._moddle.fromXML(t,"bpmn:Definitions")}catch(j){throw this._emit("import.parse.complete",{error:j}),j}let l=u.rootElement,f=u.references,d=u.warnings,g=u.elementsById;o=o.concat(d),l=this._emit("import.parse.complete",i({error:null,definitions:l,elementsById:g,references:f,warnings:o}))||l;let A=await this.importDefinitions(l,r);return o=o.concat(A.warnings),this._emit("import.done",{error:null,warnings:o}),{warnings:o}}catch(u){let l=u;throw o=o.concat(l.warnings||[]),Fr(l,o),l=Ju(l),this._emit("import.done",{error:l,warnings:l.warnings}),l}};se.prototype.importDefinitions=async function(t,r){return this._setDefinitions(t),{warnings:(await this.open(r)).warnings}};se.prototype.open=async function(t){let r=this._definitions,n=t;if(!r){let o=new Error("no XML imported");throw Fr(o,[]),o}if(typeof t=="string"&&(n=tl(r,t),!n)){let o=new Error("BPMNDiagram <"+t+"> not found");throw Fr(o,[]),o}try{this.clear()}catch(o){throw Fr(o,[]),o}let{warnings:i}=await yo(this,r,n);return{warnings:i}};se.prototype.saveXML=async function(t){t=t||{};let r=this._definitions,n,i;try{if(!r)throw new Error("no definitions loaded");r=this._emit("saveXML.start",{definitions:r})||r,i=(await this._moddle.toXML(r,t)).xml,i=this._emit("saveXML.serialized",{xml:i})||i}catch(u){n=u}let o=n?{error:n}:{xml:i};if(this._emit("saveXML.done",o),n)throw n;return o};se.prototype.saveSVG=async function(){this._emit("saveSVG.start");let t,r;try{let n=this.get("canvas"),i=n.getActiveLayer(),o=Le(":scope > defs",n._svg),u=Xr(i),l=o?""+Xr(o)+"":"",f=i.getBBox();t=` +(()=>{var Ps=Object.create;var gn=Object.defineProperty;var ks=Object.getOwnPropertyDescriptor;var Ts=Object.getOwnPropertyNames;var Ms=Object.getPrototypeOf,Ds=Object.prototype.hasOwnProperty;var Ns=(e,t)=>()=>(e&&(t=e(e=0)),t);var vn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Bs=(e,t)=>{for(var n in t)gn(e,n,{get:t[n],enumerable:!0})},Di=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ts(t))!Ds.call(e,i)&&i!==n&&gn(e,i,{get:()=>t[i],enumerable:!(r=ks(t,i))||r.enumerable});return e};var Os=(e,t,n)=>(n=e!=null?Ps(Ms(e)):{},Di(t||!e||!e.__esModule?gn(n,"default",{value:e,enumerable:!0}):n,e)),Ls=e=>Di(gn({},"__esModule",{value:!0}),e);var Ii={};Bs(Ii,{assign:()=>M,bind:()=>Xe,debounce:()=>dr,ensureArray:()=>Ni,every:()=>En,filter:()=>rt,find:()=>ve,findIndex:()=>pr,flatten:()=>Is,forEach:()=>P,get:()=>Gs,groupBy:()=>Ft,has:()=>Ye,isArray:()=>xe,isDefined:()=>wt,isFunction:()=>nt,isNil:()=>tn,isNumber:()=>Me,isObject:()=>_e,isString:()=>De,isUndefined:()=>Tt,keys:()=>Bi,map:()=>_t,matchPattern:()=>bn,merge:()=>Li,omit:()=>gr,pick:()=>yr,reduce:()=>Ve,set:()=>mr,size:()=>$s,some:()=>nn,sortBy:()=>Ws,throttle:()=>Us,unionBy:()=>qs,uniqueBy:()=>Oi,values:()=>Vs,without:()=>js});function Is(e){return Array.prototype.concat.apply([],e)}function Tt(e){return e===void 0}function wt(e){return e!==void 0}function tn(e){return e==null}function xe(e){return en.call(e)==="[object Array]"}function _e(e){return en.call(e)==="[object Object]"}function Me(e){return en.call(e)==="[object Number]"}function nt(e){let t=en.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function De(e){return en.call(e)==="[object String]"}function Ni(e){if(!xe(e))throw new Error("must supply array")}function Ye(e,t){return!tn(e)&&Fs.call(e,t)}function ve(e,t){let n=xn(t),r;return P(e,function(i,o){if(n(i,o))return r=i,!1}),r}function pr(e,t){let n=xn(t),r=xe(e)?-1:void 0;return P(e,function(i,o){if(n(i,o))return r=o,!1}),r}function rt(e,t){let n=xn(t),r=[];return P(e,function(i,o){n(i,o)&&r.push(i)}),r}function P(e,t){let n,r;if(Tt(e))return;let i=xe(e)?zs:Hs;for(let o in e)if(Ye(e,o)&&(n=e[o],r=t(n,i(o)),r===!1))return n}function js(e,t){if(Tt(e))return[];Ni(e);let n=xn(t);return e.filter(function(r,i){return!n(r,i)})}function Ve(e,t,n){return P(e,function(r,i){n=t(n,r,i)}),n}function En(e,t){return!!Ve(e,function(n,r,i){return n&&t(r,i)},!0)}function nn(e,t){return!!ve(e,t)}function _t(e,t){let n=[];return P(e,function(r,i){n.push(t(r,i))}),n}function Bi(e){return e&&Object.keys(e)||[]}function $s(e){return Bi(e).length}function Vs(e){return _t(e,t=>t)}function Ft(e,t,n={}){return t=hr(t),P(e,function(r){let i=t(r)||"_",o=n[i];o||(o=n[i]=[]),o.push(r)}),n}function Oi(e,...t){e=hr(e);let n={};return P(t,i=>Ft(i,e,n)),_t(n,function(i,o){return i[0]})}function Ws(e,t){t=hr(t);let n=[];return P(e,function(r,i){let o=t(r,i),a={d:o,v:r};for(var u=0;ur.v)}function bn(e){return function(t){return En(e,function(n,r){return t[r]===n})}}function hr(e){return nt(e)?e:t=>t[e]}function xn(e){return nt(e)?e:t=>t===e}function Hs(e){return e}function zs(e){return Number(e)}function dr(e,t){let n,r,i,o;function a(y){let v=Date.now(),R=y?0:o+t-v;if(R>0)return u(R);e.apply(i,r),c()}function u(y){n=setTimeout(a,y)}function c(){n&&clearTimeout(n),n=o=r=i=void 0}function f(){n&&a(!0),c()}function h(...y){o=Date.now(),r=y,i=this,n||u(t)}return h.flush=f,h.cancel=c,h}function Us(e,t){let n=!1;return function(...r){n||(e(...r),n=!0,setTimeout(()=>{n=!1},t))}}function Xe(e,t){return e.bind(t)}function M(e,...t){return Object.assign(e,...t)}function mr(e,t,n){let r=e;return P(t,function(i,o){if(typeof i!="number"&&typeof i!="string")throw new Error("illegal key type: "+typeof i+". Key should be of type number or string.");if(i==="constructor")throw new Error("illegal key: constructor");if(i==="__proto__")throw new Error("illegal key: __proto__");let a=t[o+1],u=r[i];wt(a)&&tn(u)&&(u=r[i]=isNaN(+a)?{}:[]),Tt(a)?Tt(n)?delete r[i]:r[i]=n:r=u}),e}function Gs(e,t,n){let r=e;return P(t,function(i){if(tn(r))return r=void 0,!1;r=r[i]}),Tt(r)?n:r}function yr(e,t){let n={},r=Object(e);return P(t,function(i){i in r&&(n[i]=e[i])}),n}function gr(e,t){let n={},r=Object(e);return P(r,function(i,o){t.indexOf(o)===-1&&(n[o]=i)}),n}function Li(e,...t){return t.length&&P(t,function(n){!n||!_e(n)||P(n,function(r,i){if(i==="__proto__")return;let o=e[i];_e(r)?(_e(o)||(o={}),e[i]=Li(o,r)):e[i]=r})}),e}var en,Fs,qs,Q=Ns(()=>{en=Object.prototype.toString,Fs=Object.prototype.hasOwnProperty;qs=Oi});var Sa=vn((pv,_a)=>{function Pf(e){return["String","Boolean","Integer","Real"].includes(e)}_a.exports=function e(t,n){let r=n.enter,i=n.leave,o=r&&r(t),a=t.$descriptor;o!==!1&&!a.isGeneric&&a.properties.filter(c=>!c.isAttr&&!c.isReference&&!Pf(c.type)).forEach(c=>{if(c.name in t){let f=t[c.name];c.isMany?f.forEach(h=>{e(h,n)}):e(f,n)}}),i&&i(t)}});var Aa=vn((hv,Ra)=>{var kf=Sa(),{isArray:Tf,isObject:Mf,isFunction:Df}=(Q(),Ls(Ii)),ni=class{constructor({moddleRoot:t,rule:n}){this.rule=n,this.moddleRoot=t,this.messages=[],this.report=this.report.bind(this)}report(t,n,r){let i={id:t,message:n};r&&Tf(r)&&(i={...i,path:r}),r&&Mf(r)&&(i={...i,...r}),this.messages.push(i)}};Ra.exports=function({moddleRoot:t,rule:n}){let r=new ni({rule:n,moddleRoot:t}),i=n.check||{},o="leave"in i?i.leave:void 0,a="enter"in i?i.enter:Df(i)?i:void 0;if(!a&&!o)throw new Error("no check implemented");return kf(t,{enter:a?u=>a(u,r):void 0,leave:o?u=>o(u,r):void 0}),r.messages}});var ka=vn((dv,Pa)=>{var Nf=Aa(),Bf=(e,t)=>e,Of={0:"off",1:"warn",2:"error",3:"info"},Lf="rule-error";function Je(e){let{config:t={},resolver:n,transformRule:r=Bf}=e||{};if(typeof n=="undefined")throw new Error("must provide ");this.config=t,this.resolver=n,this.transformRule=r,this.cachedRules={},this.cachedConfigs={}}Pa.exports=Je;Je.prototype.applyRule=function(t,n){let{config:r,rule:i,category:o,name:a}=n;try{return Nf({moddleRoot:t,rule:i,config:r}).map(function(c){return{...c,meta:i.meta,category:o}})}catch(u){return console.error("rule <"+a+"> failed with error: ",u),[{message:u.message,category:Lf}]}};Je.prototype.resolveRule=function(e,t){let{pkg:n,ruleName:r}=this.parseRuleName(e),i=`${n}-${r}`,o=this.cachedRules[i];return o?Promise.resolve(o):Promise.resolve(this.resolver.resolveRule(n,r)).then(a=>{if(!a)throw new Error(`unknown rule <${e}>`);return this.cachedRules[i]=this.transformRule(a(t),{pkg:n,ruleName:r})})};Je.prototype.resolveConfig=function(e){let{pkg:t,configName:n}=this.parseConfigName(e),r=`${t}-${n}`,i=this.cachedConfigs[r];return i?Promise.resolve(i):Promise.resolve(this.resolver.resolveConfig(t,n)).then(o=>{if(!o)throw new Error(`unknown config <${e}>`);return this.cachedConfigs[r]=this.normalizeConfig(o,t)})};Je.prototype.resolveRules=function(e){return this.resolveConfiguredRules(e).then(t=>{let i=Object.entries(t).map(([o,a])=>{let{category:u,config:c}=this.parseRuleValue(a);return{name:o,category:u,config:c}}).filter(o=>o.category!=="off").map(o=>{let{name:a,config:u}=o;return this.resolveRule(a,u).then(function(c){return{...o,rule:c}})});return Promise.all(i)})};Je.prototype.resolveConfiguredRules=function(e){let t=e.extends;return typeof t=="string"&&(t=[t]),typeof t=="undefined"&&(t=[]),Promise.all(t.map(n=>this.resolveConfig(n).then(r=>this.resolveConfiguredRules(r)))).then(n=>{let r=this.normalizeConfig(e,"bpmnlint").rules;return[...n,r].reduce((o,a)=>({...o,...a}),{})})};Je.prototype.lint=function(e,t){return t=t||this.config,this.resolveRules(t).then(n=>{let r={};return n.forEach(i=>{let{name:o}=i,a=this.applyRule(e,i);a.length&&(r[o]=a)}),r})};Je.prototype.parseRuleValue=function(e){let t,n;return Array.isArray(e)?(t=e[0],n=e[1]):(t=e,n={}),typeof t=="string"&&(t=t.toLowerCase()),t=Of[t]||t,{config:n,category:t}};Je.prototype.parseRuleName=function(e,t="bpmnlint"){let n=/^(?:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)?([^/]+)$/.exec(e);if(!n)throw new Error(`unparseable rule name <${e}>`);let[r,i,o,a]=n;return o?{pkg:`${i?i+"/":""}${Ca(o)}`,ruleName:a}:{pkg:t,ruleName:a}};Je.prototype.parseConfigName=function(e){let t=/^(?:(?:plugin:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)|bpmnlint:)([^/]+)$/.exec(e);if(!t)throw new Error(`unparseable config name <${e}>`);let[n,r,i,o]=t;return i?{pkg:`${r?r+"/":""}${Ca(i)}`,configName:o}:{pkg:"bpmnlint",configName:o}};Je.prototype.getSimplePackageName=function(e){let t=/^(?:(@[^/]+)\/)?([^/]+)$/.exec(e);if(!t)throw new Error(`unparseable package name <${e}>`);let[n,r,i]=t;return`${r?r+"/":""}${If(i)}`};Je.prototype.normalizeConfig=function(e,t){let n=e.rules||{},r=Object.keys(n).reduce((i,o)=>{let a=n[o],{pkg:u,ruleName:c}=this.parseRuleName(o,t),f=u==="bpmnlint"?c:`${this.getSimplePackageName(u)}/${c}`;return i[f]=a,i},{});return{...e,rules:r}};function Ca(e){return e==="bpmnlint"?"bpmnlint":e.startsWith("bpmnlint-plugin-")?e:`bpmnlint-plugin-${e}`}function If(e){return e.startsWith("bpmnlint-plugin-")?e.substring(16):e}});var Ma=vn((mv,Ta)=>{var Ff=ka();Ta.exports={Linter:Ff}});function Ce(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}Q();var Ks=1e3;function Ze(e,t){var n=this;t=t||Ks,e.on(["render.shape","render.connection"],t,function(r,i){var o=r.type,a=i.element,u=i.gfx,c=i.attrs;if(n.canRender(a))return o==="render.shape"?n.drawShape(u,a,c):n.drawConnection(u,a,c)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(r,i){if(n.canRender(i))return r.type==="render.getShapePath"?n.getShapePath(i):n.getConnectionPath(i)})}Ze.prototype.canRender=function(e){};Ze.prototype.drawShape=function(e,t){};Ze.prototype.drawConnection=function(e,t){};Ze.prototype.getShapePath=function(e){};Ze.prototype.getConnectionPath=function(e){};Q();function N(e,t){var n=oe(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)}function Fi(e,t){return nn(t,function(n){return N(e,n)})}function oe(e){return e&&e.businessObject||e}function Qe(e){return e&&e.di}function mt(e,t){return N(e,"bpmn:CallActivity")?!1:N(e,"bpmn:SubProcess")?(t=t||Qe(e),t&&N(t,"bpmndi:BPMNPlane")?!0:t&&!!t.isExpanded):N(e,"bpmn:Participant")?!!oe(e).processRef:!0}function vr(e){if(!(!N(e,"bpmn:Participant")&&!N(e,"bpmn:Lane"))){var t=Qe(e).isHorizontal;return t===void 0?!0:t}}function ji(e){return e&&!!oe(e).triggeredByEvent}Q();Q();function $i(e){return _e(e)&&Ye(e,"waypoints")}function Er(e){return _e(e)&&Ye(e,"labelTarget")}var wn={width:90,height:20},Vi=15;function qi(e){return N(e,"bpmn:Event")||N(e,"bpmn:Gateway")||N(e,"bpmn:DataStoreReference")||N(e,"bpmn:DataObjectReference")||N(e,"bpmn:DataInput")||N(e,"bpmn:DataOutput")||N(e,"bpmn:SequenceFlow")||N(e,"bpmn:MessageFlow")||N(e,"bpmn:Group")}function Ys(e){var t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)],i=Xs(e),o=Math.atan((r.y-n.y)/(r.x-n.x)),a=i.x,u=i.y;return Math.abs(o)"+e+"",t=!0);var n=ou(e);if(!t)return n;for(var r=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)r.appendChild(i.firstChild);return r}function ou(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function ne(e,t){var n;return e=e.trim(),e.charAt(0)==="<"?(n=Xi(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Sr.svg,e),t&&te(n,t),n}var br=null;function _r(){return br===null&&(br=ne("svg")),br}function zi(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)e[r]=t[r];return e}function Zi(e,t,n,r,i,o){var a=_r().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return zi(a,e);case 6:return zi(a,{a:e,b:t,c:n,d:r,e:i,f:o})}}function $t(e){return e?_r().createSVGTransformFromMatrix(e):_r().createSVGTransform()}var Ui=/([&<>]{1})/g,au=/([&<>\n\r"]{1})/g,su={"&":"&","<":"<",">":">",'"':"'"};function xr(e,t){function n(r,i){return su[i]||i}return e.replace(t,n)}function Qi(e,t){var n,r,i,o,a;switch(e.nodeType){case 3:t.push(xr(e.textContent,Ui));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(i=e.attributes,n=0,r=i.length;n"),a=e.childNodes,n=0,r=a.length;n")}else t.push("/>");break;case 8:t.push("");break;case 4:t.push("");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function uu(e,t){var n=Xi(t);if(iu(e),!!t){cu(n)||(n=n.documentElement);for(var r=fu(n.childNodes),i=0;i",""],tr:[2,"","
            "],col:[2,"","
            "],_default:[0,"",""]};Ee.td=Ee.th=[3,"","
            "];Ee.option=Ee.optgroup=[1,'"];Ee.thead=Ee.tbody=Ee.colgroup=Ee.caption=Ee.tfoot=[1,"","
            "];Ee.polyline=Ee.ellipse=Ee.polygon=Ee.circle=Ee.text=Ee.line=Ee.path=Ee.rect=Ee.g=[1,'',""];function ee(e,t=globalThis.document){var f;if(typeof e!="string")throw new TypeError("String expected");let n=/^$/s.exec(e);if(n)return t.createComment(n[1]);let r=(f=/<([\w:]+)/.exec(e))==null?void 0:f[1];if(!r)return t.createTextNode(e);if(e=e.trim(),r==="body"){let h=t.createElement("html");h.innerHTML=e;let{lastChild:y}=h;return y.remove(),y}let[i,o,a]=Object.hasOwn(Ee,r)?Ee[r]:Ee._default,u=t.createElement("div");for(u.innerHTML=o+e+a;i--;)u=u.lastChild;if(u.firstChild===u.lastChild){let{firstChild:h}=u;return h.remove(),h}let c=t.createDocumentFragment();return c.append(...u.childNodes),c}function vu(e,t){return t.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(r){if(r!=="default"&&!(r in e)){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}})}),Object.freeze(e)}function Pe(e,...t){let n=e.style;return P(t,function(r){r&&P(r,function(i,o){n[o]=i})}),e}function An(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}var Eu=Object.prototype.toString;function Nt(e){return new Rt(e)}function Rt(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Rt.prototype.add=function(e){return this.list.add(e),this};Rt.prototype.remove=function(e){return Eu.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)};Rt.prototype.removeMatching=function(e){let t=this.array();for(let n=0;n=Math.pow(2,t)?e(t,n):a};return e.rack=function(t,n,r){var i=function(a){var u=0;do{if(u++>10)if(r)t+=r;else throw new Error("too many ID collisions, use more bits");var c=e(t,n)}while(Object.hasOwnProperty.call(o,c));return o[c]=a,c},o=i.hats={};return i.get=function(a){return i.hats[a]},i.set=function(a,u){return i.hats[a]=u,i},i.bits=t||128,i.base=n||16,i},Tr.exports}var Pu=Cu(),ku=Au(Pu);function st(e){if(!(this instanceof st))return new st(e);e=e||[128,36,1],this._seed=e.length?ku.rack(e[0],e[1],e[2]):e}st.prototype.next=function(e){return this._seed(e||!0)};st.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n};st.prototype.claim=function(e,t){this._seed.set(e,t||!0)};st.prototype.assigned=function(e){return this._seed.get(e)||!1};st.prototype.unclaim=function(e){delete this._seed.hats[e]};st.prototype.clear=function(){var e=this._seed.hats,t;for(t in e)this.unclaim(t)};var Tu=new st,Mu=10,Mn=3,Du=1.5,Dn=10,Nu=4,zt=.95,Bu=1,Ou=.25;function gt(e,t,n,r,i,o,a){Ze.call(this,t,a);var u=e&&e.defaultFillColor,c=e&&e.defaultStrokeColor,f=e&&e.defaultLabelColor;function h(p){return n.computeStyle(p,{strokeLinecap:"round",strokeLinejoin:"round",stroke:Sn,strokeWidth:2,fill:"white"})}function y(p){return n.computeStyle(p,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:Sn,strokeWidth:2})}function v(p,l){var{ref:s={x:0,y:0},scale:d=1,element:m,parentGfx:E=i._svg}=l,S=ne("marker",{id:p,viewBox:"0 0 20 20",refX:s.x,refY:s.y,markerWidth:20*d,markerHeight:20*d,orient:"auto"});fe(S,m);var j=He(":scope > defs",E);j||(j=ne("defs"),fe(E,j)),fe(j,S)}function R(p,l,s,d){var m=Tu.nextPrefixed("marker-");return W(p,m,l,s,d),"url(#"+m+")"}function W(p,l,s,d,m){if(s==="sequenceflow-end"){var E=ne("path",{d:"M 1 5 L 11 10 L 1 15 Z",...h({fill:m,stroke:m,strokeWidth:1})});v(l,{element:E,ref:{x:11,y:10},scale:.5,parentGfx:p})}if(s==="messageflow-start"){var S=ne("circle",{cx:6,cy:6,r:3.5,...h({fill:d,stroke:m,strokeWidth:1,strokeDasharray:[1e4,1]})});v(l,{element:S,ref:{x:6,y:6},parentGfx:p})}if(s==="messageflow-end"){var j=ne("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...h({fill:d,stroke:m,strokeWidth:1,strokeDasharray:[1e4,1]})});v(l,{element:j,ref:{x:8.5,y:5},parentGfx:p})}if(s==="association-start"){var Y=ne("path",{d:"M 11 5 L 1 10 L 11 15",...y({fill:"none",stroke:m,strokeWidth:1.5,strokeDasharray:[1e4,1]})});v(l,{element:Y,ref:{x:1,y:10},scale:.5,parentGfx:p})}if(s==="association-end"){var ge=ne("path",{d:"M 1 5 L 11 10 L 1 15",...y({fill:"none",stroke:m,strokeWidth:1.5,strokeDasharray:[1e4,1]})});v(l,{element:ge,ref:{x:11,y:10},scale:.5,parentGfx:p})}if(s==="conditional-flow-marker"){var he=ne("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...h({fill:d,stroke:m})});v(l,{element:he,ref:{x:-1,y:10},scale:.5,parentGfx:p})}if(s==="conditional-default-flow-marker"){var we=ne("path",{d:"M 6 4 L 10 16",...h({stroke:m,fill:"none"})});v(l,{element:we,ref:{x:0,y:10},scale:.5,parentGfx:p})}}function L(p,l,s,d,m={}){_e(d)&&(m=d,d=0),d=d||0,m=h(m);var E=l/2,S=s/2,j=ne("circle",{cx:E,cy:S,r:Math.round((l+s)/4-d),...m});return fe(p,j),j}function O(p,l,s,d,m,E){_e(m)&&(E=m,m=0),m=m||0,E=h(E);var S=ne("rect",{x:m,y:m,width:l-m*2,height:s-m*2,rx:d,ry:d,...E});return fe(p,S),S}function H(p,l,s,d){var m=l/2,E=s/2,S=[{x:m,y:0},{x:l,y:E},{x:m,y:s},{x:0,y:E}],j=S.map(function(ge){return ge.x+","+ge.y}).join(" ");d=h(d);var Y=ne("polygon",{...d,points:j});return fe(p,Y),Y}function G(p,l,s,d){s=y(s);var m=Vt(l,s,d);return fe(p,m),m}function k(p,l,s){return G(p,l,s,5)}function g(p,l,s){s=y(s);var d=ne("path",{...s,d:l});return fe(p,d),d}function w(p,l,s,d){return g(l,s,M({"data-marker":p},d))}function C(p){return je[p]}function V(p){return function(l,s,d){return C(p)(l,s,d)}}var b={"bpmn:MessageEventDefinition":function(p,l,s={},d){var m=r.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:s.width||l.width,containerHeight:s.height||l.height,position:{mx:.235,my:.315}}),E=d?T(l,c,s.stroke):U(l,u,s.fill),S=d?U(l,u,s.fill):T(l,c,s.stroke),j=g(p,m,{fill:E,stroke:S,strokeWidth:1});return j},"bpmn:TimerEventDefinition":function(p,l,s={}){var d=s.width||l.width,m=s.height||l.height,E=s.width?1:2,S=L(p,d,m,.2*m,{fill:U(l,u,s.fill),stroke:T(l,c,s.stroke),strokeWidth:E}),j=r.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:d,containerHeight:m,position:{mx:.5,my:.5}});g(p,j,{stroke:T(l,c,s.stroke),strokeWidth:E});for(var Y=0;Y<12;Y++){var ge=r.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:d,containerHeight:m,position:{mx:.5,my:.5}}),he=d/2,we=m/2;g(p,ge,{strokeWidth:1,stroke:T(l,c,s.stroke),transform:"rotate("+Y*30+","+we+","+he+")"})}return S},"bpmn:EscalationEventDefinition":function(p,l,s={},d){var m=r.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:s.width||l.width,containerHeight:s.height||l.height,position:{mx:.5,my:.2}}),E=d?T(l,c,s.stroke):U(l,u,s.fill);return g(p,m,{fill:E,stroke:T(l,c,s.stroke),strokeWidth:1})},"bpmn:ConditionalEventDefinition":function(p,l,s={}){var d=r.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:s.width||l.width,containerHeight:s.height||l.height,position:{mx:.5,my:.222}});return g(p,d,{fill:U(l,u,s.fill),stroke:T(l,c,s.stroke),strokeWidth:1})},"bpmn:LinkEventDefinition":function(p,l,s={},d){var m=r.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:.57,my:.263}}),E=d?T(l,c,s.stroke):U(l,u,s.fill);return g(p,m,{fill:E,stroke:T(l,c,s.stroke),strokeWidth:1})},"bpmn:ErrorEventDefinition":function(p,l,s={},d){var m=r.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:s.width||l.width,containerHeight:s.height||l.height,position:{mx:.2,my:.722}}),E=d?T(l,c,s.stroke):U(l,u,s.fill);return g(p,m,{fill:E,stroke:T(l,c,s.stroke),strokeWidth:1})},"bpmn:CancelEventDefinition":function(p,l,s={},d){var m=r.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:.638,my:-.055}}),E=d?T(l,c,s.stroke):"none",S=g(p,m,{fill:E,stroke:T(l,c,s.stroke),strokeWidth:1});return uo(S,45),S},"bpmn:CompensateEventDefinition":function(p,l,s={},d){var m=r.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:s.width||l.width,containerHeight:s.height||l.height,position:{mx:.22,my:.5}}),E=d?T(l,c,s.stroke):U(l,u,s.fill);return g(p,m,{fill:E,stroke:T(l,c,s.stroke),strokeWidth:1})},"bpmn:SignalEventDefinition":function(p,l,s={},d){var m=r.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:s.width||l.width,containerHeight:s.height||l.height,position:{mx:.5,my:.2}}),E=d?T(l,c,s.stroke):U(l,u,s.fill);return g(p,m,{strokeWidth:1,fill:E,stroke:T(l,c,s.stroke)})},"bpmn:MultipleEventDefinition":function(p,l,s={},d){var m=r.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:s.width||l.width,containerHeight:s.height||l.height,position:{mx:.211,my:.36}}),E=d?T(l,c,s.stroke):U(l,u,s.fill);return g(p,m,{fill:E,stroke:T(l,c,s.stroke),strokeWidth:1})},"bpmn:ParallelMultipleEventDefinition":function(p,l,s={}){var d=r.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:s.width||l.width,containerHeight:s.height||l.height,position:{mx:.458,my:.194}});return g(p,d,{fill:U(l,u,s.fill),stroke:T(l,c,s.stroke),strokeWidth:1})},"bpmn:TerminateEventDefinition":function(p,l,s={}){var d=L(p,l.width,l.height,8,{fill:T(l,c,s.stroke),stroke:T(l,c,s.stroke),strokeWidth:4});return d}};function D(p,l,s={},d){var m=oe(p),E=Ji(m),S=d||p;return m.get("eventDefinitions")&&m.get("eventDefinitions").length>1?m.get("parallelMultiple")?b["bpmn:ParallelMultipleEventDefinition"](l,S,s,E):b["bpmn:MultipleEventDefinition"](l,S,s,E):it(m,"bpmn:MessageEventDefinition")?b["bpmn:MessageEventDefinition"](l,S,s,E):it(m,"bpmn:TimerEventDefinition")?b["bpmn:TimerEventDefinition"](l,S,s,E):it(m,"bpmn:ConditionalEventDefinition")?b["bpmn:ConditionalEventDefinition"](l,S,s,E):it(m,"bpmn:SignalEventDefinition")?b["bpmn:SignalEventDefinition"](l,S,s,E):it(m,"bpmn:EscalationEventDefinition")?b["bpmn:EscalationEventDefinition"](l,S,s,E):it(m,"bpmn:LinkEventDefinition")?b["bpmn:LinkEventDefinition"](l,S,s,E):it(m,"bpmn:ErrorEventDefinition")?b["bpmn:ErrorEventDefinition"](l,S,s,E):it(m,"bpmn:CancelEventDefinition")?b["bpmn:CancelEventDefinition"](l,S,s,E):it(m,"bpmn:CompensateEventDefinition")?b["bpmn:CompensateEventDefinition"](l,S,s,E):it(m,"bpmn:TerminateEventDefinition")?b["bpmn:TerminateEventDefinition"](l,S,s,E):null}var A={ParticipantMultiplicityMarker:function(p,l,s={}){var d=We(l,s),m=Ne(l,s),E=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:d,containerHeight:m,position:{mx:(d/2-6)/d,my:(m-15)/m}});w("participant-multiplicity",p,E,{strokeWidth:2,fill:U(l,u,s.fill),stroke:T(l,c,s.stroke)})},SubProcessMarker:function(p,l,s={}){var d=O(p,14,14,0,{strokeWidth:1,fill:U(l,u,s.fill),stroke:T(l,c,s.stroke)});Tn(d,l.width/2-7.5,l.height-20);var m=r.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:l.width,containerHeight:l.height,position:{mx:(l.width/2-7.5)/l.width,my:(l.height-20)/l.height}});w("sub-process",p,m,{fill:U(l,u,s.fill),stroke:T(l,c,s.stroke)})},ParallelMarker:function(p,l,s){var d=We(l,s),m=Ne(l,s),E=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:d,containerHeight:m,position:{mx:(d/2+s.parallel)/d,my:(m-20)/m}});w("parallel",p,E,{fill:U(l,u,s.fill),stroke:T(l,c,s.stroke)})},SequentialMarker:function(p,l,s){var d=r.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:(l.width/2+s.seq)/l.width,my:(l.height-19)/l.height}});w("sequential",p,d,{fill:U(l,u,s.fill),stroke:T(l,c,s.stroke)})},CompensationMarker:function(p,l,s){var d=r.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:(l.width/2+s.compensation)/l.width,my:(l.height-13)/l.height}});w("compensation",p,d,{strokeWidth:1,fill:U(l,u,s.fill),stroke:T(l,c,s.stroke)})},LoopMarker:function(p,l,s){var d=We(l,s),m=Ne(l,s),E=r.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:d,containerHeight:m,position:{mx:(d/2+s.loop)/d,my:(m-7)/m}});w("loop",p,E,{strokeWidth:1.5,fill:"none",stroke:T(l,c,s.stroke),strokeMiterlimit:.5})},AdhocMarker:function(p,l,s){var d=We(l,s),m=Ne(l,s),E=r.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:d,containerHeight:m,position:{mx:(d/2+s.adhoc)/d,my:(m-15)/m}});w("adhoc",p,E,{strokeWidth:1,fill:T(l,c,s.stroke),stroke:T(l,c,s.stroke)})}};function F(p,l,s,d){A[p](l,s,d)}function B(p,l,s=[],d={}){d={fill:d.fill,stroke:d.stroke,width:We(l,d),height:Ne(l,d)};var m=oe(l),E=s.includes("SubProcessMarker");E?d={...d,seq:-21,parallel:-22,compensation:-25,loop:-18,adhoc:10}:d={...d,seq:-5,parallel:-6,compensation:-7,loop:0,adhoc:-8},m.get("isForCompensation")&&s.push("CompensationMarker"),N(m,"bpmn:AdHocSubProcess")&&(s.push("AdhocMarker"),E||M(d,{compensation:d.compensation-18}));var S=m.get("loopCharacteristics"),j=S&&S.get("isSequential");S&&(M(d,{compensation:d.compensation-18}),s.includes("AdhocMarker")&&M(d,{seq:-23,loop:-18,parallel:-24}),j===void 0&&s.push("LoopMarker"),j===!1&&s.push("ParallelMarker"),j===!0&&s.push("SequentialMarker")),s.includes("CompensationMarker")&&s.length===1&&M(d,{compensation:-8}),P(s,function(Y){F(Y,p,l,d)})}function I(p,l,s={}){s=M({size:{width:100}},s);var d=o.createText(l||"",s);return qe(d).add("djs-label"),fe(p,d),d}function K(p,l,s,d={}){var m=oe(l),E=Wt({x:l.x,y:l.y,width:l.width,height:l.height},d);return I(p,m.name,{align:s,box:E,padding:7,style:{fill:qt(l,f,c,d.stroke)}})}function at(p,l,s={}){var d={width:90,height:30,x:l.width/2+l.x,y:l.height/2+l.y};return I(p,jt(l),{box:d,fitBox:!0,style:M({},o.getExternalStyle(),{fill:qt(l,f,c,s.stroke)})})}function ae(p,l,s,d={}){var m=vr(s),E=I(p,l,{box:{height:30,width:m?Ne(s,d):We(s,d)},align:"center-middle",style:{fill:qt(s,f,c,d.stroke)}});if(m){var S=-1*Ne(s,d);kn(E,0,-S,270)}}function Z(p,l,s={}){var{width:d,height:m}=Wt(l,s);return O(p,d,m,Dn,{...s,fill:U(l,u,s.fill),fillOpacity:zt,stroke:T(l,c,s.stroke)})}function et(p,l,s={}){var d=oe(l),m=U(l,u,s.fill),E=T(l,c,s.stroke);return(d.get("associationDirection")==="One"||d.get("associationDirection")==="Both")&&(s.markerEnd=R(p,"association-end",m,E)),d.get("associationDirection")==="Both"&&(s.markerStart=R(p,"association-start",m,E)),s=X(s,["markerStart","markerEnd"]),k(p,l.waypoints,{...s,stroke:E,strokeDasharray:"0, 5"})}function tt(p,l,s={}){var d=U(l,u,s.fill),m=T(l,c,s.stroke),E=r.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:.474,my:.296}}),S=g(p,E,{fill:d,fillOpacity:zt,stroke:m}),j=oe(l);if(eo(j)){var Y=r.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:.33,my:(l.height-18)/l.height}});g(p,Y,{strokeWidth:2,fill:d,stroke:m})}return S}function ye(p,l,s={}){return L(p,l.width,l.height,{fillOpacity:zt,...s,fill:U(l,u,s.fill),stroke:T(l,c,s.stroke)})}function Ge(p,l,s={}){return H(p,l.width,l.height,{fill:U(l,u,s.fill),fillOpacity:zt,stroke:T(l,c,s.stroke)})}function x(p,l,s={}){var d=O(p,We(l,s),Ne(l,s),0,{fill:U(l,u,s.fill),fillOpacity:s.fillOpacity||zt,stroke:T(l,c,s.stroke),strokeWidth:1.5}),m=oe(l);if(N(m,"bpmn:Lane")){var E=m.get("name");ae(p,E,l,s)}return d}function _(p,l,s={}){var d=Z(p,l,s),m=mt(l);if(ji(l)&&(te(d,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!m)){var E=oe(l).flowElements||[],S=E.filter(j=>N(j,"bpmn:StartEvent"));S.length===1&&$(S[0],p,s,l)}return K(p,l,m?"center-top":"center-middle",s),m?B(p,l,void 0,s):B(p,l,["SubProcessMarker"],s),d}function $(p,l,s,d){var m=22,E={fill:U(d,u,s.fill),stroke:T(d,c,s.stroke),width:m,height:m},S=oe(p).isInterrupting,j=S?0:3,Y=S?1:1.2,ge=20,he=(m-ge)/2,we="translate("+he+","+he+")";L(l,ge,ge,{fill:E.fill,stroke:E.stroke,strokeWidth:Y,strokeDasharray:j,transform:we}),D(p,l,E,d)}function re(p,l,s={}){var d=Z(p,l,s);return K(p,l,"center-middle",s),B(p,l,void 0,s),d}var je=this.handlers={"bpmn:AdHocSubProcess":function(p,l,s={}){return mt(l)?s=X(s,["fill","stroke","width","height"]):s=X(s,["fill","stroke"]),_(p,l,s)},"bpmn:Association":function(p,l,s={}){return s=X(s,["fill","stroke"]),et(p,l,s)},"bpmn:BoundaryEvent":function(p,l,s={}){var{renderIcon:d=!0}=s;s=X(s,["fill","stroke"]);var m=oe(l),E=m.get("cancelActivity");s={strokeWidth:1.5,fill:U(l,u,s.fill),fillOpacity:Bu,stroke:T(l,c,s.stroke)},E||(s.strokeDasharray="6");var S=ye(p,l,s);return L(p,l.width,l.height,Mn,{...s,fill:"none"}),d&&D(l,p,s),S},"bpmn:BusinessRuleTask":function(p,l,s={}){s=X(s,["fill","stroke"]);var d=re(p,l,s),m=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),E=g(p,m);te(E,{fill:U(l,u,s.fill),stroke:T(l,c,s.stroke),strokeWidth:1});var S=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),j=g(p,S);return te(j,{fill:T(l,c,s.stroke),stroke:T(l,c,s.stroke),strokeWidth:1}),d},"bpmn:CallActivity":function(p,l,s={}){return s=X(s,["fill","stroke"]),_(p,l,{strokeWidth:5,...s})},"bpmn:ComplexGateway":function(p,l,s={}){s=X(s,["fill","stroke"]);var d=Ge(p,l,s),m=r.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:l.width,containerHeight:l.height,position:{mx:.46,my:.26}});return g(p,m,{fill:T(l,c,s.stroke),stroke:T(l,c,s.stroke),strokeWidth:1}),d},"bpmn:DataInput":function(p,l,s={}){s=X(s,["fill","stroke"]);var d=r.getRawPath("DATA_ARROW"),m=tt(p,l,s);return g(p,d,{fill:"none",stroke:T(l,c,s.stroke),strokeWidth:1}),m},"bpmn:DataInputAssociation":function(p,l,s={}){return s=X(s,["fill","stroke"]),et(p,l,{...s,markerEnd:R(p,"association-end",U(l,u,s.fill),T(l,c,s.stroke))})},"bpmn:DataObject":function(p,l,s={}){return s=X(s,["fill","stroke"]),tt(p,l,s)},"bpmn:DataObjectReference":V("bpmn:DataObject"),"bpmn:DataOutput":function(p,l,s={}){s=X(s,["fill","stroke"]);var d=r.getRawPath("DATA_ARROW"),m=tt(p,l,s);return g(p,d,{strokeWidth:1,fill:U(l,u,s.fill),stroke:T(l,c,s.stroke)}),m},"bpmn:DataOutputAssociation":function(p,l,s={}){return s=X(s,["fill","stroke"]),et(p,l,{...s,markerEnd:R(p,"association-end",U(l,u,s.fill),T(l,c,s.stroke))})},"bpmn:DataStoreReference":function(p,l,s={}){s=X(s,["fill","stroke"]);var d=r.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:0,my:.133}});return g(p,d,{fill:U(l,u,s.fill),fillOpacity:zt,stroke:T(l,c,s.stroke),strokeWidth:2})},"bpmn:EndEvent":function(p,l,s={}){var{renderIcon:d=!0}=s;s=X(s,["fill","stroke"]);var m=ye(p,l,{...s,strokeWidth:4});return d&&D(l,p,s),m},"bpmn:EventBasedGateway":function(p,l,s={}){s=X(s,["fill","stroke"]);var d=oe(l),m=Ge(p,l,s);L(p,l.width,l.height,l.height*.2,{fill:U(l,"none",s.fill),stroke:T(l,c,s.stroke),strokeWidth:1});var E=d.get("eventGatewayType"),S=!!d.get("instantiate");function j(){var ge=r.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:l.width,containerHeight:l.height,position:{mx:.36,my:.44}});g(p,ge,{fill:"none",stroke:T(l,c,s.stroke),strokeWidth:2})}if(E==="Parallel"){var Y=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:l.width,containerHeight:l.height,position:{mx:.474,my:.296}});g(p,Y,{fill:"none",stroke:T(l,c,s.stroke),strokeWidth:1})}else E==="Exclusive"&&(S||L(p,l.width,l.height,l.height*.26,{fill:"none",stroke:T(l,c,s.stroke),strokeWidth:1}),j());return m},"bpmn:ExclusiveGateway":function(p,l,s={}){s=X(s,["fill","stroke"]);var d=Ge(p,l,s),m=r.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:l.width,containerHeight:l.height,position:{mx:.32,my:.3}}),E=Qe(l);return E.get("isMarkerVisible")&&g(p,m,{fill:T(l,c,s.stroke),stroke:T(l,c,s.stroke),strokeWidth:1}),d},"bpmn:Gateway":function(p,l,s={}){return s=X(s,["fill","stroke"]),Ge(p,l,s)},"bpmn:Group":function(p,l,s={}){return s=X(s,["fill","stroke","width","height"]),O(p,l.width,l.height,Dn,{stroke:T(l,c,s.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:We(l,s),height:Ne(l,s)})},"bpmn:InclusiveGateway":function(p,l,s={}){s=X(s,["fill","stroke"]);var d=Ge(p,l,s);return L(p,l.width,l.height,l.height*.24,{fill:U(l,u,s.fill),stroke:T(l,c,s.stroke),strokeWidth:2.5}),d},"bpmn:IntermediateEvent":function(p,l,s={}){var{renderIcon:d=!0}=s;s=X(s,["fill","stroke"]);var m=ye(p,l,{...s,strokeWidth:1.5});return L(p,l.width,l.height,Mn,{fill:"none",stroke:T(l,c,s.stroke),strokeWidth:1.5}),d&&D(l,p,s),m},"bpmn:IntermediateCatchEvent":V("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":V("bpmn:IntermediateEvent"),"bpmn:Lane":function(p,l,s={}){return s=X(s,["fill","stroke","width","height"]),x(p,l,{...s,fillOpacity:Ou})},"bpmn:ManualTask":function(p,l,s={}){s=X(s,["fill","stroke"]);var d=re(p,l,s),m=r.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return g(p,m,{fill:U(l,u,s.fill),stroke:T(l,c,s.stroke),strokeWidth:.5}),d},"bpmn:MessageFlow":function(p,l,s={}){s=X(s,["fill","stroke"]);var d=oe(l),m=Qe(l),E=U(l,u,s.fill),S=T(l,c,s.stroke),j=k(p,l.waypoints,{markerEnd:R(p,"messageflow-end",E,S),markerStart:R(p,"messageflow-start",E,S),stroke:S,strokeDasharray:"10, 11",strokeWidth:1.5});if(d.get("messageRef")){var Y=j.getPointAtLength(j.getTotalLength()/2),ge=r.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:Y.x,y:Y.y}}),he={strokeWidth:1};m.get("messageVisibleKind")==="initiating"?(he.fill=E,he.stroke=S):(he.fill=S,he.stroke=E);var we=g(p,ge,he),Ke=d.get("messageRef"),ie=Ke.get("name"),dt=I(p,ie,{align:"center-top",fitBox:!0,style:{fill:S}}),yn=we.getBBox(),$e=dt.getBBox(),z=Y.x-$e.width/2,J=Y.y+yn.height/2+Mu;kn(dt,z,J,0)}return j},"bpmn:ParallelGateway":function(p,l,s={}){s=X(s,["fill","stroke"]);var d=Ge(p,l,s),m=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:l.width,containerHeight:l.height,position:{mx:.46,my:.2}});return g(p,m,{fill:T(l,c,s.stroke),stroke:T(l,c,s.stroke),strokeWidth:1}),d},"bpmn:Participant":function(p,l,s={}){s=X(s,["fill","stroke","width","height"]);var d=x(p,l,s),m=mt(l),E=vr(l),S=oe(l),j=S.get("name");if(m){var Y=E?[{x:30,y:0},{x:30,y:Ne(l,s)}]:[{x:0,y:30},{x:We(l,s),y:30}];G(p,Y,{stroke:T(l,c,s.stroke),strokeWidth:Du}),ae(p,j,l,s)}else{var ge=Wt(l,s);E||(ge.height=We(l,s),ge.width=Ne(l,s));var he=I(p,j,{box:ge,align:"center-middle",style:{fill:qt(l,f,c,s.stroke)}});if(!E){var we=-1*Ne(l,s);kn(he,0,-we,270)}}return S.get("participantMultiplicity")&&F("ParticipantMultiplicityMarker",p,l,s),d},"bpmn:ReceiveTask":function(p,l,s={}){s=X(s,["fill","stroke"]);var d=oe(l),m=re(p,l,s),E;return d.get("instantiate")?(L(p,28,28,20*.22,{fill:U(l,u,s.fill),stroke:T(l,c,s.stroke),strokeWidth:1}),E=r.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):E=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),g(p,E,{fill:U(l,u,s.fill),stroke:T(l,c,s.stroke),strokeWidth:1}),m},"bpmn:ScriptTask":function(p,l,s={}){s=X(s,["fill","stroke"]);var d=re(p,l,s),m=r.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return g(p,m,{fill:U(l,u,s.fill),stroke:T(l,c,s.stroke),strokeWidth:1}),d},"bpmn:SendTask":function(p,l,s={}){s=X(s,["fill","stroke"]);var d=re(p,l,s),m=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return g(p,m,{fill:T(l,c,s.stroke),stroke:U(l,u,s.fill),strokeWidth:1}),d},"bpmn:SequenceFlow":function(p,l,s={}){s=X(s,["fill","stroke"]);var d=U(l,u,s.fill),m=T(l,c,s.stroke),E=k(p,l.waypoints,{markerEnd:R(p,"sequenceflow-end",d,m),stroke:m}),S=oe(l),{source:j}=l;if(j){var Y=oe(j);S.get("conditionExpression")&&N(Y,"bpmn:Activity")&&te(E,{markerStart:R(p,"conditional-flow-marker",d,m)}),Y.get("default")&&(N(Y,"bpmn:Gateway")||N(Y,"bpmn:Activity"))&&Y.get("default")===S&&te(E,{markerStart:R(p,"conditional-default-flow-marker",d,m)})}return E},"bpmn:ServiceTask":function(p,l,s={}){s=X(s,["fill","stroke"]);var d=re(p,l,s);L(p,10,10,{fill:U(l,u,s.fill),stroke:"none",transform:"translate(6, 6)"});var m=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});g(p,m,{fill:U(l,u,s.fill),stroke:T(l,c,s.stroke),strokeWidth:1}),L(p,10,10,{fill:U(l,u,s.fill),stroke:"none",transform:"translate(11, 10)"});var E=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return g(p,E,{fill:U(l,u,s.fill),stroke:T(l,c,s.stroke),strokeWidth:1}),d},"bpmn:StartEvent":function(p,l,s={}){var{renderIcon:d=!0}=s;s=X(s,["fill","stroke"]);var m=oe(l);m.get("isInterrupting")||(s={...s,strokeDasharray:"6"});var E=ye(p,l,s);return d&&D(l,p,s),E},"bpmn:SubProcess":function(p,l,s={}){return mt(l)?s=X(s,["fill","stroke","width","height"]):s=X(s,["fill","stroke"]),_(p,l,s)},"bpmn:Task":function(p,l,s={}){return s=X(s,["fill","stroke"]),re(p,l,s)},"bpmn:TextAnnotation":function(p,l,s={}){s=X(s,["fill","stroke","width","height"]);var{width:d,height:m}=Wt(l,s),E=O(p,d,m,0,0,{fill:"none",stroke:"none"}),S=r.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:d,containerHeight:m,position:{mx:0,my:0}});g(p,S,{stroke:T(l,c,s.stroke)});var j=oe(l),Y=j.get("text")||"";return I(p,Y,{align:"left-top",box:Wt(l,s),padding:7,style:{fill:qt(l,f,c,s.stroke)}}),E},"bpmn:Transaction":function(p,l,s={}){mt(l)?s=X(s,["fill","stroke","width","height"]):s=X(s,["fill","stroke"]);var d=_(p,l,{strokeWidth:1.5,...s}),m=n.style(["no-fill","no-events"],{stroke:T(l,c,s.stroke),strokeWidth:1.5}),E=mt(l);return E||(s={}),O(p,We(l,s),Ne(l,s),Dn-Mn,Mn,m),d},"bpmn:UserTask":function(p,l,s={}){s=X(s,["fill","stroke"]);var d=re(p,l,s),m=15,E=12,S=r.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:m,y:E}});g(p,S,{fill:U(l,u,s.fill),stroke:T(l,c,s.stroke),strokeWidth:.5});var j=r.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:m,y:E}});g(p,j,{fill:U(l,u,s.fill),stroke:T(l,c,s.stroke),strokeWidth:.5});var Y=r.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:m,y:E}});return g(p,Y,{fill:T(l,c,s.stroke),stroke:T(l,c,s.stroke),strokeWidth:.5}),d},label:function(p,l,s={}){return at(p,l,s)}};this._drawPath=g,this._renderer=C}Ce(gt,Ze);gt.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"];gt.prototype.canRender=function(e){return N(e,"bpmn:BaseElement")};gt.prototype.drawShape=function(e,t,n={}){var{type:r}=t,i=this._renderer(r);return i(e,t,n)};gt.prototype.drawConnection=function(e,t,n={}){var{type:r}=t,i=this._renderer(r);return i(e,t,n)};gt.prototype.getShapePath=function(e){return Er(e)?kr(e,Nu):N(e,"bpmn:Event")?to(e):N(e,"bpmn:Activity")?kr(e,Dn):N(e,"bpmn:Gateway")?no(e):ro(e)};function X(e,t=[]){return t.reduce((n,r)=>(e[r]&&(n[r]=e[r]),n),{})}Q();Q();var Lu=0,Iu={width:150,height:50};function Fu(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function ju(e){return _e(e)?M({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}var Mr=null;function $u(){return Mr||(Mr=document.createElement("canvas").getContext("2d")),Mr}function Vu(e){var t=[];return e.fontStyle&&t.push(e.fontStyle),e.fontVariant&&t.push(e.fontVariant),e.fontWeight&&t.push(e.fontWeight),e.fontStretch&&t.push(e.fontStretch),t.push(fo(e.fontSize)||"12px"),t.push(e.fontFamily||"sans-serif"),t.join(" ")}function fo(e){if(e!=null)return typeof e=="number"||/^-?\d+(\.\d+)?$/.test(e)?e+"px":e}function qu(e,t){var n=$u();if(!n)return{width:0,height:0};n.font=Vu(t),"letterSpacing"in n&&(n.letterSpacing=fo(t.letterSpacing)||"0px");var r=e==="",i=r?"dummy":e.replace(/\s+$/,""),o=n.measureText(i);return{width:r?0:o.width,height:"fontBoundingBoxAscent"in o?o.fontBoundingBoxAscent+o.fontBoundingBoxDescent:o.actualBoundingBoxAscent+o.actualBoundingBoxDescent}}function Wu(e,t,n){for(var r=e.shift(),i=r,o;;){if(o=qu(i,n),o.width=i?o.width:0,i===" "||i===""||o.width1)for(;r=n.shift();)if(r.length+oO?H.width:O},0),R=o.top;i.vertical==="middle"&&(R+=(n.height-y)/2),R-=(u||f[0].height)/4;var W=ne("text");te(W,r),P(f,function(O){var H;switch(R+=u||O.height,i.horizontal){case"left":H=o.left;break;case"right":H=(a?v:h)-o.right-O.width;break;default:H=Math.max(((a?v:h)-O.width)/2+o.left,0)}var G=ne("tspan");te(G,{x:H,y:R}),G.textContent=O.text,fe(W,G)});var L={width:v,height:y};return{dimensions:L,element:W}};function Gu(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}var Ku=12,Yu=1.2,Xu=30;function Nn(e){var t=M({fontFamily:"Arial, sans-serif",fontSize:Ku,fontWeight:"normal",lineHeight:Yu},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,r=M({},t,{fontSize:n},e&&e.externalStyle||{}),i=new Ut({style:t});this.getExternalLabelBounds=function(o,a){var u=i.getDimensions(a,{box:{width:90,height:30},style:r});return{x:Math.round(o.x+o.width/2-u.width/2),y:Math.round(o.y),width:Math.ceil(u.width),height:Math.ceil(u.height)}},this.getTextAnnotationBounds=function(o,a){var u=i.getDimensions(a,{box:o,style:t,align:"left-top",padding:5});return{x:o.x,y:o.y,width:o.width,height:Math.max(Xu,Math.round(u.height))}},this.createText=function(o,a){return i.createText(o,a||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return r}}Nn.$inject=["config.textRenderer"];function Dr(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(t){return this.pathMap[t].d},this.getScaledPath=function(t,n){var r=this.pathMap[t],i,o;n.abspos?(i=n.abspos.x,o=n.abspos.y):(i=n.containerWidth*n.position.mx,o=n.containerHeight*n.position.my);var a={};if(n.position){for(var u=n.containerHeight/r.height*n.yScaleFactor,c=n.containerWidth/r.width*n.xScaleFactor,f=0;f':""}function Ln(e,t,n){return M({id:e.id,type:e.$type,businessObject:e,di:t},n)}function ol(e,t,n){var r=e.waypoint;return!r||r.length<2?[On(t),On(n)]:r.map(function(i){return{x:i.x,y:i.y}})}function mo(e,t,n){return new Error(`element ${Se(t)} referenced by ${Se(e)}#${n} not yet drawn`)}function ot(e,t,n,r,i){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=r,this._textRenderer=i}ot.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"];ot.prototype.add=function(e,t,n){var r,i,o;if(N(t,"bpmndi:BPMNPlane")){var a=N(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};r=this._elementFactory.createRoot(Ln(e,t,a)),this._canvas.addRootElement(r)}else if(N(t,"bpmndi:BPMNShape")){var u=!mt(e,t),c=sl(e);i=n&&(n.hidden||n.collapsed);var f=t.bounds;r=this._elementFactory.createShape(Ln(e,t,{collapsed:u,hidden:i,x:Math.round(f.x),y:Math.round(f.y),width:Math.round(f.width),height:Math.round(f.height),isFrame:c})),N(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,r),N(e,"bpmn:Lane")&&(o=0),N(e,"bpmn:DataStoreReference")&&(al(n,On(f))||(n=this._canvas.findRoot(n))),this._canvas.addShape(r,n,o)}else if(N(t,"bpmndi:BPMNEdge")){var h=this._getSource(e),y=this._getTarget(e);i=n&&(n.hidden||n.collapsed),r=this._elementFactory.createConnection(Ln(e,t,{hidden:i,source:h,target:y,waypoints:ol(t,h,y)})),N(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(r,n,o)}else throw new Error(`unknown di ${Se(t)} for element ${Se(e)}`);return qi(e)&&jt(r)&&this.addLabel(e,t,r),this._eventBus.fire("bpmnElement.added",{element:r}),r};ot.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${Se(e)}#attachedToRef`);var r=this._elementRegistry.get(n.id),i=r&&r.attachers;if(!r)throw mo(e,n,"attachedToRef");t.host=r,i||(r.attachers=i=[]),i.indexOf(t)===-1&&i.push(t)};ot.prototype.addLabel=function(e,t,n){var r,i,o;return r=Wi(t,n),i=jt(n),i&&(r=this._textRenderer.getExternalLabelBounds(r,i)),o=this._elementFactory.createLabel(Ln(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!jt(n),x:Math.round(r.x),y:Math.round(r.y),width:Math.round(r.width),height:Math.round(r.height)})),this._canvas.addShape(o,n.parent)};ot.prototype._getConnectedElement=function(e,t){var n,r,i=e.$type;if(r=e[t+"Ref"],t==="source"&&i==="bpmn:DataInputAssociation"&&(r=r&&r[0]),(t==="source"&&i==="bpmn:DataOutputAssociation"||t==="target"&&i==="bpmn:DataInputAssociation")&&(r=e.$parent),n=r&&this._getElement(r),n)return n;throw r?mo(e,r,t+"Ref"):new Error(`${Se(e)}#${t} Ref not specified`)};ot.prototype._getSource=function(e){return this._getConnectedElement(e,"source")};ot.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")};ot.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};function al(e,t){var n=t.x,r=t.y;return n>=e.x&&n<=e.x+e.width&&r>=e.y&&r<=e.y+e.height}function sl(e){return N(e,"bpmn:Group")}var yo={__depends__:[Bn],bpmnImporter:["type",ot]};var go={__depends__:[po,yo]};Q();Q();function Bt(e,t){t=!!t,xe(e)||(e=[e]);var n,r,i,o;return P(e,function(a){var u=a;a.waypoints&&!t&&(u=Bt(a.waypoints,!0));var c=u.x,f=u.y,h=u.height||0,y=u.width||0;(ci||i===void 0)&&(i=c+y),(f+h>o||o===void 0)&&(o=f+h)}),{x:n,y:r,height:o-r,width:i-n}}function In(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function Fn(e){return!!(e&&e.isFrame)}function jn(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}jn.prototype.next=function(){return this._prefix+ ++this._counter};var ul=new jn("ov"),ll=500;function be(e,t,n,r){this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=ul,this._overlayDefaults=M({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=cl(n.getContainer()),this._init()}be.$inject=["config.overlays","eventBus","canvas","elementRegistry"];be.prototype.get=function(e){if(De(e)&&(e={id:e}),De(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?rt(t.overlays,bn({type:e.type})):t.overlays.slice():[]}else return e.type?rt(this._overlays,bn({type:e.type})):e.id?this._overlays[e.id]:null};be.prototype.add=function(e,t,n){if(_e(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var r=this._ids.next();return n=M({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r};be.prototype.remove=function(e){var t=this.get(e)||[];xe(t)||(t=[t]);var n=this;P(t,function(r){var i=n._getOverlayContainer(r.element,!0);if(r&&(Ht(r.html),Ht(r.htmlContainer),delete r.htmlContainer,delete r.element,delete n._overlays[r.id]),i){var o=i.overlays.indexOf(r);o!==-1&&i.overlays.splice(o,1)}})};be.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"};be.prototype.show=function(){$n(this._overlayRoot)};be.prototype.hide=function(){$n(this._overlayRoot,!1)};be.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Cn(this._overlayRoot)};be.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,i=t.y;if(t.waypoints){var o=Bt(t);r=o.x,i=o.y}vo(n,r,i),An(e.html,"data-container-id",t.id)};be.prototype._updateOverlay=function(e){var t=e.position,n=e.htmlContainer,r=e.element,i=t.left,o=t.top;if(t.right!==void 0){var a;r.waypoints?a=Bt(r).width:a=r.width,i=t.right*-1+a}if(t.bottom!==void 0){var u;r.waypoints?u=Bt(r).height:u=r.height,o=t.bottom*-1+u}vo(n,i||0,o||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())};be.prototype._createOverlayContainer=function(e){var t=ee('
            ');Pe(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n};be.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Eo(this._overlayRoot,n)};be.prototype._getOverlayContainer=function(e,t){var n=ve(this._overlayContainers,function(r){return r.element===e});return!n&&!t?this._createOverlayContainer(e):n};be.prototype._addOverlay=function(e){var t=e.id,n=e.element,r=e.html,i,o;r.get&&r.constructor.prototype.jquery&&(r=r.get(0)),De(r)&&(r=ee(r)),o=this._getOverlayContainer(n),i=ee('
            '),Pe(i,{position:"absolute"}),i.appendChild(r),e.type&&Nt(i).add("djs-overlay-"+e.type);var a=this._canvas.findRoot(n),u=this._canvas.getRootElement();$n(i,a===u),e.htmlContainer=i,o.overlays.push(e),o.html.appendChild(i),this._overlays[t]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())};be.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=this._canvas.findRoot(e.element),i=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,u=this._canvas.getRootElement(),c=!0;(r!==u||n&&(wt(i)&&i>t.scale||wt(o)&&oi&&(a=(1/t.scale||1)*i)),wt(a)&&(u="scale("+a+","+a+")"),Eo(o,u)};be.prototype._updateOverlaysVisibilty=function(e){var t=this;P(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})};be.prototype._init=function(){var e=this._eventBus,t=this;function n(r){t._updateRoot(r),t._updateOverlaysVisibilty(r),t.show()}e.on("canvas.viewbox.changing",function(r){t.hide()}),e.on("canvas.viewbox.changed",function(r){n(r.viewbox)}),e.on(["shape.remove","connection.remove"],function(r){var i=r.element,o=t.get({element:i});P(o,function(c){t.remove(c.id)});var a=t._getOverlayContainer(i);if(a){Ht(a.html);var u=t._overlayContainers.indexOf(a);u!==-1&&t._overlayContainers.splice(u,1)}}),e.on("element.changed",ll,function(r){var i=r.element,o=t._getOverlayContainer(i,!0);o&&(P(o.overlays,function(a){t._updateOverlay(a)}),t._updateOverlayContainer(o))}),e.on("element.marker.update",function(r){var i=t._getOverlayContainer(r.element,!0);i&&Nt(i.html)[r.add?"add":"remove"](r.marker)}),e.on("root.set",function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};function cl(e){var t=ee('
            ');return Pe(t,{position:"absolute",width:0,height:0}),e.insertBefore(t,e.firstChild),t}function vo(e,t,n){Pe(e,{left:t+"px",top:n+"px"})}function $n(e,t){e.style.display=t===!1?"none":""}function Eo(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}var Vn={__init__:["overlays"],overlays:["type",be]};function qn(e,t,n,r){e.on("element.changed",function(i){var o=i.element;(o.parent||o===t.getRootElement())&&(i.gfx=n.getGraphics(o)),i.gfx&&e.fire(In(o)+".changed",i)}),e.on("elements.changed",function(i){var o=i.elements;o.forEach(function(a){e.fire("element.changed",{element:a})}),r.updateContainments(o)}),e.on("shape.changed",function(i){r.update("shape",i.element,i.gfx)}),e.on("connection.changed",function(i){r.update("connection",i.element,i.gfx)})}qn.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var bo={__init__:["changeSupport"],changeSupport:["type",qn]};Q();var fl=1e3;function Re(e){this._eventBus=e}Re.$inject=["eventBus"];function pl(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}Re.prototype.on=function(e,t,n,r,i,o){if((nt(t)||Me(t))&&(o=i,i=r,r=n,n=t,t=null),nt(n)&&(o=i,i=r,r=n,n=fl),_e(i)&&(o=i,i=!1),!nt(r))throw new Error("handlerFn must be a function");xe(e)||(e=[e]);var a=this._eventBus;P(e,function(u){var c=["commandStack",u,t].filter(function(f){return f}).join(".");a.on(c,n,i?pl(r,o):r,o)})};Re.prototype.canExecute=vt("canExecute");Re.prototype.preExecute=vt("preExecute");Re.prototype.preExecuted=vt("preExecuted");Re.prototype.execute=vt("execute");Re.prototype.executed=vt("executed");Re.prototype.postExecute=vt("postExecute");Re.prototype.postExecuted=vt("postExecuted");Re.prototype.revert=vt("revert");Re.prototype.reverted=vt("reverted");function vt(e){return function(n,r,i,o,a){(nt(n)||Me(n))&&(a=o,o=i,i=r,r=n,n=null),this.on(n,e,r,i,o,a)}}function sn(e,t){t.invoke(Re,this),this.executed(function(n){var r=n.context;r.rootElement?e.setRootElement(r.rootElement):r.rootElement=e.getRootElement()}),this.revert(function(n){var r=n.context;r.rootElement&&e.setRootElement(r.rootElement)})}Ce(sn,Re);sn.$inject=["canvas","injector"];var xo={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",sn]};Q();var hl={"&":"&","<":"<",">":">",'"':""","'":"'"};function Et(e){return e=""+e,e&&e.replace(/[&<>"']/g,function(t){return hl[t]})}var dl="_plane";function un(e){var t=e.id;return N(e,"bpmn:SubProcess")?ml(t):t}function ml(e){return e+dl}var yl="bjs-breadcrumbs-shown";function Wn(e,t,n){var r=ee('
              '),i=n.getContainer(),o=Nt(i);i.appendChild(r);var a=[];e.on("element.changed",function(c){var f=c.element,h=oe(f),y=ve(a,function(v){return v===h});y&&u()});function u(c){c&&(a=gl(c));var f=a.flatMap(function(y){var v=n.findRoot(un(y))||n.findRoot(y.id);if(!v&&N(y,"bpmn:Process")){var R=t.find(function(O){var H=oe(O);return H&&H.get("processRef")===y});v=R&&n.findRoot(R.id)}if(!v)return[];var W=Et(y.name||y.id),L=ee('
            • '+W+"
            • ");return L.addEventListener("click",function(){n.setRootElement(v)}),L});r.innerHTML="";var h=f.length>1;o.toggle(yl,h),f.forEach(function(y){r.appendChild(y)})}e.on("root.set",function(c){u(c.element)})}Wn.$inject=["eventBus","elementRegistry","canvas"];function gl(e){for(var t=oe(e),n=[],r=t;r;r=r.$parent)(N(r,"bpmn:SubProcess")||N(r,"bpmn:Process"))&&n.push(r);return n.reverse()}function Hn(e,t){var n=null,r=new vl;e.on("root.set",function(i){var o=i.element,a=t.viewbox(),u=r.get(o);if(r.set(n,{x:a.x,y:a.y,zoom:a.scale}),n=o,!(!N(o,"bpmn:SubProcess")&&!u)){u=u||{x:0,y:0,zoom:1};var c=(a.x-u.x)*a.scale,f=(a.y-u.y)*a.scale;(c!==0||f!==0)&&t.scroll({dx:c,dy:f}),u.zoom!==a.scale&&t.zoom(u.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){r.clear(),n=null})}Hn.$inject=["eventBus","canvas"];function vl(){this._entries=[],this.set=function(e,t){var n=!1;for(var r in this._entries)if(this._entries[r][0]===e){this._entries[r][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}t!==-1&&this._entries.splice(t,1)}}var wo={x:180,y:160};function bt(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,function(r,i){n._handleImport(i.definitions)})}bt.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach(function(r){!r.plane||!r.plane.bpmnElement||(t._processToDiagramMap[r.plane.bpmnElement.id]=r)});var n=e.diagrams.filter(r=>r.plane).flatMap(r=>t._createNewDiagrams(r.plane));n.forEach(function(r){t._movePlaneElementsToOrigin(r.plane)})}};bt.prototype._createNewDiagrams=function(e){var t=this,n=[],r=[];e.get("planeElement").forEach(function(o){var a=o.bpmnElement;if(a){var u=a.$parent;N(a,"bpmn:SubProcess")&&!o.isExpanded&&n.push(a),bl(a,e)&&r.push({diElement:o,parent:u})}});var i=[];return n.forEach(function(o){if(!t._processToDiagramMap[o.id]){var a=t._createDiagram(o);t._processToDiagramMap[o.id]=a,i.push(a)}}),r.forEach(function(o){for(var a=o.diElement,u=o.parent;u&&n.indexOf(u)===-1;)u=u.$parent;if(u){var c=t._processToDiagramMap[u.id];t._moveToDiPlane(a,c.plane)}}),i};bt.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=El(e),r={x:n.x-wo.x,y:n.y-wo.y};t.forEach(function(i){i.waypoint?i.waypoint.forEach(function(o){o.x=o.x-r.x,o.y=o.y-r.y}):i.bounds&&(i.bounds.x=i.bounds.x-r.x,i.bounds.y=i.bounds.y-r.y)})};bt.prototype._moveToDiPlane=function(e,t){var n=_o(e),r=n.plane.get("planeElement");r.splice(r.indexOf(e),1),t.get("planeElement").push(e)};bt.prototype._createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n};bt.$inject=["eventBus","moddle"];function _o(e){return N(e,"bpmndi:BPMNDiagram")?e:_o(e.$parent)}function El(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach(function(n){if(n.bounds){var r=an(n.bounds);t.top=Math.min(r.top,t.top),t.left=Math.min(r.left,t.left)}}),ho(t)}function bl(e,t){var n=e.$parent;return!(!N(n,"bpmn:SubProcess")||n===t.bpmnElement||Fi(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))}var zn=250,xl='',wl="bjs-drilldown-empty";function ut(e,t,n,r,i){Re.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=r,this._translate=i;var o=this;this.executed("shape.toggleCollapse",zn,function(a){var u=a.shape;o._canDrillDown(u)?o._addOverlay(u):o._removeOverlay(u)},!0),this.reverted("shape.toggleCollapse",zn,function(a){var u=a.shape;o._canDrillDown(u)?o._addOverlay(u):o._removeOverlay(u)},!0),this.executed(["shape.create","shape.move","shape.delete"],zn,function(a){var u=a.oldParent,c=a.newParent||a.parent,f=a.shape;o._canDrillDown(f)&&o._addOverlay(f),o._updateDrilldownOverlay(u),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(f)},!0),this.reverted(["shape.create","shape.move","shape.delete"],zn,function(a){var u=a.oldParent,c=a.newParent||a.parent,f=a.shape;o._canDrillDown(f)&&o._addOverlay(f),o._updateDrilldownOverlay(u),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(f)},!0),t.on("import.render.complete",function(){n.filter(function(a){return o._canDrillDown(a)}).map(function(a){o._addOverlay(a)})})}Ce(ut,Re);ut.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}};ut.prototype._canDrillDown=function(e){var t=this._canvas;return N(e,"bpmn:SubProcess")&&t.findRoot(un(e))};ut.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=oe(e),r=t.get({element:n.id,type:"drilldown"})[0];if(r){var i=n&&n.get("flowElements")&&n.get("flowElements").length;Nt(r.html).toggle(wl,!i)}};ut.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,r=oe(e),i=n.get({element:e,type:"drilldown"});i.length&&this._removeOverlay(e);var o=ee('"),a=r.get("name")||r.get("id"),u=this._translate("Open {element}",{element:a});o.setAttribute("title",u),o.addEventListener("click",function(){t.setRootElement(t.findRoot(un(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:o}),this._updateOverlayVisibility(e)};ut.prototype._removeOverlay=function(e){var t=this._overlays;t.remove({element:e,type:"drilldown"})};ut.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];var So={__depends__:[Vn,bo,xo],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Wn],drilldownCentering:["type",Hn],drilldownOverlayBehavior:["type",ut],subprocessCompatibility:["type",bt]};Q();function Br(e){return e.originalEvent||e.srcEvent}function Ro(e,t){return(Br(e)||e).button===t}function Gt(e){return Ro(e,0)}function Ao(e){return Ro(e,1)}function Co(e){var t=Br(e)||e;return Gt(e)&&t.shiftKey}function _l(e){return!0}function Un(e){return Gt(e)||Ao(e)}var Po=500;function Gn(e,t,n){var r=this;function i(b,D,A){if(!u(b,D)){var F,B,I;A?B=t.getGraphics(A):(F=D.delegateTarget||D.target,F&&(B=F,A=t.get(B))),!(!B||!A)&&(I=e.fire(b,{element:A,gfx:B,originalEvent:D}),I===!1&&(D.stopPropagation(),D.preventDefault()))}}var o={};function a(b){return o[b]}function u(b,D){var A=f[b]||Gt;return!A(D)}var c={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},f={"element.contextmenu":_l,"element.mousedown":Un,"element.mouseup":Un,"element.click":Un,"element.dblclick":Un};function h(b,D,A){var F=c[b];if(!F)throw new Error("unmapped DOM event name <"+b+">");return i(F,D,A)}var y="svg, .djs-element";function v(b,D,A,F){var B=o[A]=function(I){i(A,I)};F&&(f[A]=F),B.$delegate=rn.bind(b,y,D,B)}function R(b,D,A){var F=a(A);F&&rn.unbind(b,D,F.$delegate)}function W(b){P(c,function(D,A){v(b,A,D)})}function L(b){P(c,function(D,A){R(b,A,D)})}e.on("canvas.destroy",function(b){L(b.svg)}),e.on("canvas.init",function(b){W(b.svg)}),e.on(["shape.added","connection.added"],function(b){var D=b.element,A=b.gfx;e.fire("interactionEvents.createHit",{element:D,gfx:A})}),e.on(["shape.changed","connection.changed"],Po,function(b){var D=b.element,A=b.gfx;e.fire("interactionEvents.updateHit",{element:D,gfx:A})}),e.on("interactionEvents.createHit",Po,function(b){var D=b.element,A=b.gfx;r.createDefaultHit(D,A)}),e.on("interactionEvents.updateHit",function(b){var D=b.element,A=b.gfx;r.updateDefaultHit(D,A)});var O=w("djs-hit djs-hit-stroke"),H=w("djs-hit djs-hit-click-stroke"),G=w("djs-hit djs-hit-all"),k=w("djs-hit djs-hit-no-move"),g={all:G,"click-stroke":H,stroke:O,"no-move":k};function w(b,D){return D=M({stroke:"white",strokeWidth:15},D||{}),n.cls(b,["no-fill","no-border"],D)}function C(b,D){var A=g[D];if(!A)throw new Error("invalid hit type <"+D+">");return te(b,A),b}function V(b,D){fe(b,D)}this.removeHits=function(b){var D=so(".djs-hit",b);P(D,Mt)},this.createDefaultHit=function(b,D){var A=b.waypoints,F=b.isFrame,B;return A?this.createWaypointsHit(D,A):(B=F?"stroke":"all",this.createBoxHit(D,B,{width:b.width,height:b.height}))},this.createWaypointsHit=function(b,D){var A=Vt(D);return C(A,"stroke"),V(b,A),A},this.createBoxHit=function(b,D,A){A=M({x:0,y:0},A);var F=ne("rect");return C(F,D),te(F,A),V(b,F),F},this.updateDefaultHit=function(b,D){var A=He(".djs-hit",D);if(A)return b.waypoints?Pr(A,b.waypoints):te(A,{width:b.width,height:b.height}),A},this.fire=i,this.triggerMouseEvent=h,this.mouseHandler=a,this.registerEvent=v,this.unregisterEvent=R}Gn.$inject=["eventBus","elementRegistry","styles"];var ko={__init__:["interactionEvents"],interactionEvents:["type",Gn]};Q();function At(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],function(r){var i=r.element;n.deselect(i)}),e.on(["diagram.clear","root.set"],function(r){n.select(null)})}At.$inject=["eventBus","canvas"];At.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(n!==-1){var r=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:t})}};At.prototype.get=function(){return this._selectedElements};At.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1};At.prototype.select=function(e,t){var n=this._selectedElements,r=n.slice();xe(e)||(e=e?[e]:[]);var i=this._canvas,o=i.getRootElement();e=e.filter(function(a){var u=i.findRoot(a);return o===u}),t?P(e,function(a){n.indexOf(a)===-1&&n.push(a)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:n})};Q();var To="hover",Mo="selected";function Kn(e,t){this._canvas=e;function n(i,o){e.addMarker(i,o)}function r(i,o){e.removeMarker(i,o)}t.on("element.hover",function(i){n(i.element,To)}),t.on("element.out",function(i){r(i.element,To)}),t.on("selection.changed",function(i){function o(f){r(f,Mo)}function a(f){n(f,Mo)}var u=i.oldSelection,c=i.newSelection;P(u,function(f){c.indexOf(f)===-1&&o(f)}),P(c,function(f){u.indexOf(f)===-1&&a(f)})})}Kn.$inject=["canvas","eventBus"];Q();function Yn(e,t,n,r){e.on("create.end",500,function(i){var o=i.context,a=o.canExecute,u=o.elements,c=o.hints||{},f=c.autoSelect;if(a){if(f===!1)return;xe(f)?t.select(f):t.select(u.filter(Sl))}}),e.on("connect.end",500,function(i){var o=i.context,a=o.connection;a&&t.select(a)}),e.on("shape.move.end",500,function(i){var o=i.previousSelection||[],a=r.get(i.context.shape.id),u=ve(o,function(c){return a.id===c.id});u||t.select(a)}),e.on("element.click",function(i){if(Gt(i)){var o=i.element;o===n.getRootElement()&&(o=null);var a=t.isSelected(o),u=t.get().length>1,c=Co(i);if(a&&u)return c?t.deselect(o):t.select(o);a?t.deselect(o):t.select(o,c)}})}Yn.$inject=["eventBus","selection","canvas","elementRegistry"];function Sl(e){return!e.hidden}var Do={__init__:["selectionVisuals","selectionBehavior"],__depends__:[ko],selection:["type",At],selectionVisuals:["type",Kn],selectionBehavior:["type",Yn]};Q();var Rl=/^class[ {]/;function Al(e){return Rl.test(e.toString())}function Lr(e){return Array.isArray(e)}function Or(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Xn(...e){e.length===1&&Lr(e[0])&&(e=e[0]),e=[...e];let t=e.pop();return t.$inject=e,t}var Cl=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Pl=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,kl=/\/\*([^*]*)\*\//m;function Tl(e){if(typeof e!="function")throw new Error(`Cannot annotate "${e}". Expected a function!`);let t=e.toString().match(Al(e)?Cl:Pl);if(!t)return[];let n=t[1]||t[2];return n&&n.split(",").map(r=>{let i=r.match(kl);return(i&&i[1]||r).trim()})||[]}function Ir(e,t){let n=t||{get:function(k,g){if(r.push(k),g===!1)return null;throw u(`No provider for "${k}"!`)}},r=[],i=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),a=o.injector=this,u=function(k){let g=r.join(" -> ");return r.length=0,new Error(g?`${k} (Resolving: ${g})`:k)};function c(k,g){if(!i[k]&&k.includes(".")){let w=k.split("."),C=c(w.shift());for(;w.length;)C=C[w.shift()];return C}if(Or(o,k))return o[k];if(Or(i,k)){if(r.indexOf(k)!==-1)throw r.push(k),u("Cannot resolve circular dependency!");return r.push(k),o[k]=i[k][0](i[k][1]),r.pop(),o[k]}return n.get(k,g)}function f(k,g){if(typeof g=="undefined"&&(g={}),typeof k!="function")if(Lr(k))k=Xn(k.slice());else throw u(`Cannot invoke "${k}". Expected a function!`);let C=(k.$inject||Tl(k)).map(V=>Or(g,V)?g[V]:c(V));return{fn:k,dependencies:C}}function h(k){let{fn:g,dependencies:w}=f(k),C=Function.prototype.bind.call(g,null,...w);return new C}function y(k,g,w){let{fn:C,dependencies:V}=f(k,w);return C.apply(g,V)}function v(k){return Xn(g=>k.get(g))}function R(k,g){if(g&&g.length){let w=Object.create(null),C=Object.create(null),V=[],b=[],D=[],A,F,B,I;for(let K in i)A=i[K],g.indexOf(K)!==-1&&(A[2]==="private"?(F=V.indexOf(A[3]),F===-1?(B=A[3].createChild([],g),I=v(B),V.push(A[3]),b.push(B),D.push(I),w[K]=[I,K,"private",B]):w[K]=[D[F],K,"private",b[F]]):w[K]=[A[2],A[1]],C[K]=!0),(A[2]==="factory"||A[2]==="type")&&A[1].$scope&&g.forEach(at=>{A[1].$scope.indexOf(at)!==-1&&(w[K]=[A[2],A[1]],C[at]=!0)});g.forEach(K=>{if(!C[K])throw new Error('No provider for "'+K+'". Cannot use provider from the parent!')}),k.unshift(w)}return new Ir(k,a)}let W={factory:y,type:h,value:function(k){return k}};function L(k,g){let w=k.__init__||[];return function(){w.forEach(C=>{typeof C=="string"?g.get(C):g.invoke(C)})}}function O(k){let g=k.__exports__;if(g){let w=k.__modules__,C=Object.keys(k).reduce((F,B)=>(B!=="__exports__"&&B!=="__modules__"&&B!=="__init__"&&B!=="__depends__"&&(F[B]=k[B]),F),Object.create(null)),V=(w||[]).concat(C),b=R(V),D=Xn(function(F){return b.get(F)});g.forEach(function(F){i[F]=[D,F,"private",b]});let A=(k.__init__||[]).slice();return A.unshift(function(){b.init()}),k=Object.assign({},k,{__init__:A}),L(k,b)}return Object.keys(k).forEach(function(w){if(w==="__init__"||w==="__depends__")return;let C=k[w];if(C[2]==="private"){i[w]=C;return}let V=C[0],b=C[1];i[w]=[W[V],Ml(V,b),V]}),L(k,a)}function H(k,g){return k.indexOf(g)!==-1||(k=(g.__depends__||[]).reduce(H,k),k.indexOf(g)!==-1)?k:k.concat(g)}function G(k){let g=k.reduce(H,[]).map(O),w=!1;return function(){w||(w=!0,g.forEach(C=>C()))}}this.get=c,this.invoke=y,this.instantiate=h,this.createChild=R,this.init=G(e)}function Ml(e,t){return e!=="value"&&Lr(t)&&(t=Xn(t.slice())),t}Q();var Dl=1;function lt(e,t){Ze.call(this,e,Dl),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}Ce(lt,Ze);lt.prototype.canRender=function(){return!0};lt.prototype.drawShape=function(t,n,r){var i=ne("rect");return te(i,{x:0,y:0,width:n.width||0,height:n.height||0}),Fn(n)?te(i,M({},this.FRAME_STYLE,r||{})):te(i,M({},this.SHAPE_STYLE,r||{})),fe(t,i),i};lt.prototype.drawConnection=function(t,n,r){var i=Vt(n.waypoints,M({},this.CONNECTION_STYLE,r||{}));return fe(t,i),i};lt.prototype.getShapePath=function(t){var n=t.x,r=t.y,i=t.width,o=t.height,a=[["M",n,r],["l",i,0],["l",0,o],["l",-i,0],["z"]];return yt(a)};lt.prototype.getConnectionPath=function(t){var n=t.waypoints,r,i,o=[];for(r=0;i=n[r];r++)i=i.original||i,o.push([r===0?"M":"L",i.x,i.y]);return yt(o)};lt.$inject=["eventBus","styles"];Q();function Fr(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(n,r,i){var o=this.style(r,i);return M(o,{class:n})},this.style=function(n,r){!xe(n)&&!r&&(r=n,n=[]);var i=Ve(n,function(o,a){return M(o,e[a]||{})},{});return r?M(i,r):i},this.computeStyle=function(n,r,i){return xe(r)||(i=r,r=[]),t.style(r||[],M({},i,n||{}))}}var No={__init__:["defaultRenderer"],defaultRenderer:["type",lt],styles:["type",Fr]};Q();function Bo(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return n!==-1&&e.splice(n,1),n}function Oo(e,t,n){if(!(!e||!t)){typeof n!="number"&&(n=-1);var r=e.indexOf(t);if(r!==-1){if(r===n)return;if(n!==-1)e.splice(r,1);else return}n!==-1?e.splice(n,0,t):e.push(t)}}function Zn(e,t){return Math.round(e*t)/t}function Lo(e){return Me(e)?e+"px":e}function Nl(e){for(;e.parent;)e=e.parent;return e}function Bl(e){e=M({},{width:"100%",height:"100%"},e);let t=e.container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),Pe(n,{position:"relative",overflow:"hidden",width:Lo(e.width),height:Lo(e.height)}),t.appendChild(n),n}function Io(e,t,n){let r=ne("g");qe(r).add(t);let i=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(r,e.childNodes[i]||null),r}var Ol="base",Fo=0,Ll=1,Il={shape:["x","y","width","height"],connection:["waypoints"]};function q(e,t,n,r){this._eventBus=t,this._elementRegistry=r,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}q.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"];q.prototype._init=function(e){let t=this._eventBus,n=this._container=Bl(e),r=this._svg=ne("svg");te(r,{width:"100%",height:"100%"}),An(r,"tabindex",0),e.autoFocus&&t.on("element.hover",()=>{this.restoreFocus()}),t.on("element.mousedown",500,o=>{this.focus()}),r.addEventListener("focusin",()=>{this._setFocused(!0)}),r.addEventListener("focusout",()=>{this._setFocused(!1)}),r.addEventListener("mouseover",()=>{this._eventBus.fire("canvas.mouseover")}),r.addEventListener("mouseout",()=>{this._eventBus.fire("canvas.mouseout")}),fe(n,r);let i=this._viewport=Io(r,"viewport");e.deferUpdate&&(this._viewboxChanged=dr(Xe(this._viewboxChanged,this),300)),t.on("diagram.init",()=>{t.fire("canvas.init",{svg:r,viewport:i})}),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)};q.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});let e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport};q.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))};q.prototype._clear=function(){this._elementRegistry.getAll().forEach(t=>{let n=In(t);n==="root"?this.removeRootElement(t):this._removeElement(t,n)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox};q.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)};q.prototype.restoreFocus=function(){document.activeElement===document.body&&this.focus()};q.prototype.isFocused=function(){return this._focused};q.prototype.getDefaultLayer=function(){return this.getLayer(Ol,Fo)};q.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),typeof t!="undefined"&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group};q.prototype._getChildIndex=function(e){return Ve(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)};q.prototype._createLayer=function(e,t){typeof t=="undefined"&&(t=Ll);let n=this._getChildIndex(t);return{group:Io(this._viewport,"layer-"+e,n),index:t,visible:!0}};q.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");let t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");let n=this._viewport,r=t.group,i=t.index;if(t.visible)return r;let o=this._getChildIndex(i);return n.insertBefore(r,n.childNodes[o]||null),t.visible=!0,r};q.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");let t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");let n=t.group;return t.visible&&(Mt(n),t.visible=!1),n};q.prototype._removeLayer=function(e){let t=this._layers[e];t&&(delete this._layers[e],Mt(t.group))};q.prototype.getActiveLayer=function(){let e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null};q.prototype.findRoot=function(e){return typeof e=="string"&&(e=this._elementRegistry.get(e)),e?(this._findPlaneForRoot(Nl(e))||{}).rootElement:void 0};q.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})};q.prototype._findPlaneForRoot=function(e){return ve(this._planes,function(t){return t.rootElement===e})};q.prototype.getContainer=function(){return this._container};q.prototype._updateMarker=function(e,t,n){let r;e.id||(e=this._elementRegistry.get(e)),e.markers=e.markers||new Set,r=this._elementRegistry._elements[e.id],r&&(P([r.gfx,r.secondaryGfx],function(i){i&&(n?(e.markers.add(t),qe(i).add(t)):(e.markers.delete(t),qe(i).remove(t)))}),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))};q.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)};q.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)};q.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),e.markers?e.markers.has(t):!1};q.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)};q.prototype.getRootElement=function(){let e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))};q.prototype.addRootElement=function(e){let t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});let n=e.layer="root-"+t;this._ensureValid("root",e);let r=this.getLayer(n,Fo);return this.hideLayer(n),this._addRoot(e,r),this._planes.push({rootElement:e,layer:r}),e};q.prototype.removeRootElement=function(e){if(typeof e=="string"&&(e=this._elementRegistry.get(e)),!!this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter(function(n){return n.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e};q.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e};q.prototype._removeRoot=function(e){let t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)};q.prototype._addRoot=function(e,t){let n=this._elementRegistry,r=this._eventBus;r.fire("root.add",{element:e}),n.add(e,t),r.fire("root.added",{element:e,gfx:t})};q.prototype._setRoot=function(e,t){let n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})};q.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");let n=Il[e];if(!En(n,function(i){return typeof t[i]!="undefined"}))throw new Error("must supply { "+n.join(", ")+" } with "+e)};q.prototype._setParent=function(e,t,n){Oo(t.children,e,n),e.parent=t};q.prototype._addElement=function(e,t,n,r){n=n||this.getRootElement();let i=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),i.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,r);let a=o.create(e,t,r);return this._elementRegistry.add(t,a),o.update(e,t,a),i.fire(e+".added",{element:t,gfx:a}),t};q.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)};q.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)};q.prototype._removeElement=function(e,t){let n=this._elementRegistry,r=this._graphicsFactory,i=this._eventBus;if(e=n.get(e.id||e),!!e)return i.fire(t+".remove",{element:e}),r.remove(e),Bo(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+".removed",{element:e}),n.remove(e),e};q.prototype.removeShape=function(e){return this._removeElement(e,"shape")};q.prototype.removeConnection=function(e){return this._removeElement(e,"connection")};q.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)};q.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()};q.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})};q.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);let t=this._viewport,n=this.getSize(),r,i,o,a,u,c,f;if(e)this._changeViewbox(function(){u=Math.min(n.width/e.width,n.height/e.height);let h=this._svg.createSVGMatrix().scale(u).translate(-e.x,-e.y);Dt(t,h)});else return o=this._rootElement?this.getActiveLayer():null,r=o&&o.getBBox()||{},a=Dt(t),i=a?a.matrix:Zi(),u=Zn(i.a,1e3),c=Zn(-i.e||0,1e3),f=Zn(-i.f||0,1e3),e=this._cachedViewbox={x:c?c/u:0,y:f?f/u:0,width:n.width/u,height:n.height/u,scale:u,inner:{width:r.width||0,height:r.height||0,x:r.x||0,y:r.y||0},outer:n},e;return e};q.prototype.scroll=function(e){let t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=M({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),jo(t,n)}),{x:n.e,y:n.f}};q.prototype.scrollToElement=function(e,t){let n=100;typeof e=="string"&&(e=this._elementRegistry.get(e));let r=this.findRoot(e);if(r!==this.getRootElement()&&this.setRootElement(r),r===e)return;t||(t={}),typeof t=="number"&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};let i=Bt(e),o=an(i),a=this.viewbox(),u=this.zoom(),c,f;a.y+=t.top/u,a.x+=t.left/u,a.width-=(t.right+t.left)/u,a.height-=(t.bottom+t.top)/u;let h=an(a);if(!(i.width=0&&r.y>=0&&r.x+r.width<=n.width&&r.y+r.height<=n.height&&!e?o={x:0,y:0,width:Math.max(r.width+r.x,n.width),height:Math.max(r.height+r.y,n.height)}:(i=Math.min(1,n.width/r.width,n.height/r.height),o={x:r.x+(e?r.width/2-n.width/i/2:0),y:r.y+(e?r.height/2-n.height/i/2:0),width:n.width/i,height:n.height/i}),this.viewbox(o),this.viewbox(!1).scale};q.prototype._setZoom=function(e,t){let n=this._svg,r=this._viewport,i=n.createSVGMatrix(),o=n.createSVGPoint(),a,u,c,f,h;c=r.getCTM();let y=c.a;return t?(a=M(o,t),u=a.matrixTransform(c.inverse()),f=i.translate(u.x,u.y).scale(1/y*e).translate(-u.x,-u.y),h=c.multiply(f)):h=i.scale(e),jo(this._viewport,h),h};q.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}};q.prototype.getAbsoluteBBox=function(e){let t=this.viewbox(),n;e.waypoints?n=this.getGraphics(e).getBBox():n=e;let r=n.x*t.scale-t.x*t.scale,i=n.y*t.scale-t.y*t.scale,o=n.width*t.scale,a=n.height*t.scale;return{x:r,y:i,width:o,height:a}};q.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Kt="data-element-id";function Be(e){this._elements={},this._eventBus=e}Be.$inject=["eventBus"];Be.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),te(t,Kt,r),n&&te(n,Kt,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}};Be.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&(te(r.gfx,Kt,""),r.secondaryGfx&&te(r.secondaryGfx,Kt,""),delete t[n])};Be.prototype.updateId=function(e,t){this._validateId(t),typeof e=="string"&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),r=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,r)};Be.prototype.updateGraphics=function(e,t,n){var r=e.id||e,i=this._elements[r];return n?i.secondaryGfx=t:i.gfx=t,t&&te(t,Kt,r),t};Be.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&te(e,Kt);var n=this._elements[t];return n&&n.element};Be.prototype.filter=function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(n)}),t};Be.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),r=0;r in ref");t=this.props[t]}t.collection?$o(this,t,e):Vl(this,t,e)};ze.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return jl(n)||$o(this,t,e),n};ze.prototype.ensureBound=function(e,t){$l(e,t)||this.bind(e,t)};ze.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)};ze.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var jr=new ze({name:"children",enumerable:!0,collection:!0},{name:"parent"}),qo=new ze({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Vo=new ze({name:"attachers",collection:!0},{name:"host"}),Wo=new ze({name:"outgoing",collection:!0},{name:"source"}),Ho=new ze({name:"incoming",collection:!0},{name:"target"});function ln(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),jr.bind(this,"parent"),qo.bind(this,"labels"),Wo.bind(this,"outgoing"),Ho.bind(this,"incoming")}function cn(){ln.call(this),jr.bind(this,"children"),Vo.bind(this,"host"),Vo.bind(this,"attachers")}Ce(cn,ln);function zo(){ln.call(this),jr.bind(this,"children")}Ce(zo,cn);function Uo(){cn.call(this),qo.bind(this,"labelTarget")}Ce(Uo,cn);function Go(){ln.call(this),Wo.bind(this,"source"),Ho.bind(this,"target")}Ce(Go,ln);var ql={connection:Go,shape:cn,label:Uo,root:zo};function Ko(e,t){var n=ql[e];if(!n)throw new Error("unknown type: <"+e+">");return M(new n,t)}Q();function Ct(){this._uid=12}Ct.prototype.createRoot=function(e){return this.create("root",e)};Ct.prototype.createLabel=function(e){return this.create("label",e)};Ct.prototype.createShape=function(e){return this.create("shape",e)};Ct.prototype.createConnection=function(e){return this.create("connection",e)};Ct.prototype.create=function(e,t){return t=M({},t||{}),t.id||(t.id=e+"_"+this._uid++),Ko(e,t)};Q();var Qn="__fn",Yo=1e3,Wl=Array.prototype.slice;function ke(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}ke.prototype.on=function(e,t,n,r){if(e=xe(e)?e:[e],nt(t)&&(r=n,n=t,t=Yo),!Me(t))throw new Error("priority must be a number");var i=n;r&&(i=Xe(n,r),i[Qn]=n[Qn]||n);var o=this;e.forEach(function(a){o._addListener(a,{priority:t,callback:i,next:null})})};ke.prototype.once=function(e,t,n,r){var i=this;if(nt(t)&&(r=n,n=t,t=Yo),!Me(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var a=n.apply(r,arguments);return i.off(e,o),a}o[Qn]=n,this.on(e,t,o)};ke.prototype.off=function(e,t){e=xe(e)?e:[e];var n=this;e.forEach(function(r){n._removeListener(r,t)})};ke.prototype.createEvent=function(e){var t=new fn;return t.init(e),t};ke.prototype.fire=function(e,t){var n,r,i,o;if(o=Wl.call(arguments),typeof e=="object"&&(t=e,e=t.type),!e)throw new Error("no event type specified");if(r=this._listeners[e],!!r){t instanceof fn?n=t:n=this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{i=this._invokeListeners(n,o,r)}finally{e!==a&&(n.type=a)}return i===void 0&&n.defaultPrevented&&(i=!1),i}};ke.prototype.handleError=function(e){return this.fire("error",{error:e})===!1};ke.prototype._destroy=function(){this._listeners={}};ke.prototype._invokeListeners=function(e,t,n){for(var r;n&&!e.cancelBubble;)r=this._invokeListener(e,t,n),n=n.next;return r};ke.prototype._invokeListener=function(e,t,n){var r;if(n.callback.__isTomb)return r;try{r=Hl(n.callback,t),r!==void 0&&(e.returnValue=r,e.stopPropagation()),r===!1&&e.preventDefault()}catch(i){if(!this.handleError(i))throw console.error("unhandled error in event listener",i),i}return r};ke.prototype._addListener=function(e,t){var n=this._getListeners(e),r;if(!n){this._setListeners(e,t);return}for(;n;){if(n.priority or , got "+e);return e=(i?i+":":"")+r,{name:e,prefix:i,localName:r}}function Ue(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}Ue.prototype.build=function(){return yr(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])};Ue.prototype.addProperty=function(e,t,n){typeof t=="boolean"&&(n=t,t=void 0),this.addNamedProperty(e,n!==!1);var r=this.properties;t!==void 0?r.splice(t,0,e):r.push(e)};Ue.prototype.replaceProperty=function(e,t,n){var r=e.ns,i=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var u=i.indexOf(e);if(u===-1)throw new Error("property <"+r.name+"> not found in property list");i.splice(u,1),this.addProperty(t,n?void 0:u,a),o[r.name]=o[r.localName]=t};Ue.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,i=t.split("#"),o=Ae(i[0],r),a=Ae(i[1],o.prefix).name,u=this.propertiesByName[a];if(u)this.replaceProperty(u,e,n);else throw new Error("refined property <"+a+"> not found");delete e.redefines};Ue.prototype.addNamedProperty=function(e,t){var n=e.ns,r=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),r[n.name]=r[n.localName]=e};Ue.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]};Ue.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e};Ue.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e};Ue.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)};Ue.prototype.assertNotDefined=function(e,t){var n=e.name,r=this.propertiesByName[n];if(r)throw new Error("property <"+n+"> already defined; override of <"+r.definedBy.ns.name+"#"+r.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")};Ue.prototype.hasProperty=function(e){return this.propertiesByName[e]};Ue.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,r=this.allTypes,i=e.name;i in n||(P(e.properties,Xe(function(o){o=M({},o,{name:o.ns.localName,inherited:t}),Object.defineProperty(o,"definedBy",{value:e});var a=o.replaces,u=o.redefines;a||u?this.redefineProperty(o,a||u,a):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),r.push(e),n[i]=e)};function Pt(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,P(e,Xe(this.registerPackage,this))}Pt.prototype.getPackage=function(e){return this.packageMap[e]};Pt.prototype.getPackages=function(){return this.packages};Pt.prototype.registerPackage=function(e){e=M({},e);var t=this.packageMap;ea(t,e,"prefix"),ea(t,e,"uri"),P(e.types,Xe(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)};Pt.prototype.registerType=function(e,t){e=M({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:M(e.meta||{})});var n=Ae(e.name,t.prefix),r=n.name,i={};P(e.properties,Xe(function(o){var a=Ae(o.name,n.prefix),u=a.name;$r(o.type)||(o.type=Ae(o.type,a.prefix).name),M(o,{ns:a,name:u}),i[u]=o},this)),M(e,{ns:n,name:r,propertiesByName:i}),P(e.extends,Xe(function(o){var a=Ae(o,n.prefix),u=this.typeMap[a.name];u.traits=u.traits||[],u.traits.push(r)},this)),this.definePackage(e,t),this.typeMap[r]=e};Pt.prototype.mapTypes=function(e,t,n){var r=$r(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(c,f){var h=Ae(c,$r(c)?"":e.prefix);i.mapTypes(h,t,f)}function a(c){return o(c,!0)}function u(c){return o(c,!1)}if(!r)throw new Error("unknown type <"+e.name+">");P(r.superClass,n?a:u),t(r,!n),P(r.traits,a)};Pt.prototype.getEffectiveDescriptor=function(e){var t=Ae(e),n=new Ue(t);this.mapTypes(t,function(i,o){n.addTrait(i,o)});var r=n.build();return this.definePackage(r,r.allTypes[r.allTypes.length-1].$pkg),r};Pt.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};function ea(e,t,n){var r=t[n];if(r in e)throw new Error("package with "+n+" <"+r+"> already defined")}function Ot(e){this.model=e}Ot.prototype.set=function(e,t,n){if(!De(t)||!t.length)throw new TypeError("property name must be a non-empty string");var r=this.getProperty(e,t),i=r&&r.name;Kl(n)?r?delete e[i]:delete e.$attrs[Vr(t)]:r?i in e?e[i]=n:ra(e,r,n):e.$attrs[Vr(t)]=n};Ot.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[Vr(t)];var r=n.name;return!e[r]&&n.isMany&&ra(e,n,[]),e[r]};Ot.prototype.define=function(e,t,n){if(!n.writable){var r=n.value;n=M({},n,{get:function(){return r}}),delete n.value}Object.defineProperty(e,t,n)};Ot.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})};Ot.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})};Ot.prototype.getProperty=function(e,t){var n=this.model,r=n.getPropertyDescriptor(e,t);if(r)return r;if(t.includes(":"))return null;let i=n.config.strict;if(typeof i!="undefined"){let o=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(i)throw o;typeof console!="undefined"&&console.warn(o)}return null};function Kl(e){return typeof e=="undefined"}function ra(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Vr(e){return e.replace(/^:/,"")}function Fe(e,t={}){this.properties=new Ot(this),this.factory=new ta(this,this.properties),this.registry=new Pt(e,this.properties),this.typeCache={},this.config=t}Fe.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)};Fe.prototype.getType=function(e){var t=this.typeCache,n=De(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r};Fe.prototype.createAny=function(e,t,n){var r=Ae(e),i={$type:e,$instanceOf:function(a){return a===this.$type},get:function(a){return this[a]},set:function(a,u){mr(this,[a],u)}},o={name:e,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:t}};return this.properties.defineDescriptor(i,o),this.properties.defineModel(i,this),this.properties.define(i,"get",{enumerable:!1,writable:!0}),this.properties.define(i,"set",{enumerable:!1,writable:!0}),this.properties.define(i,"$parent",{enumerable:!1,writable:!0}),this.properties.define(i,"$instanceOf",{enumerable:!1,writable:!0}),P(n,function(a,u){_e(a)&&a.value!==void 0?i[a.name]=a.value:i[u]=a}),i};Fe.prototype.getPackage=function(e){return this.registry.getPackage(e)};Fe.prototype.getPackages=function(){return this.registry.getPackages()};Fe.prototype.getElementDescriptor=function(e){return e.$descriptor};Fe.prototype.hasType=function(e,t){t===void 0&&(t=e,e=this);var n=e.$model.getElementDescriptor(e);return t in n.allTypesByName};Fe.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]};Fe.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};Q();var ia=String.fromCharCode,Yl=Object.prototype.hasOwnProperty,Xl=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,pn={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(pn).forEach(function(e){pn[e.toUpperCase()]=pn[e]});function Zl(e,t,n,r){return r?Yl.call(pn,r)?pn[r]:"&"+r+";":ia(t||parseInt(n,16))}function Lt(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(Xl,Zl):e}var oa="non-whitespace outside of root node";function Yt(e){return new Error(e)}function aa(e){return"missing namespace for prefix <"+e+">"}function er(e){return{get:e,enumerable:!0}}function Ql(e){var t={},n;for(n in e)t[n]=e[n];return t}function Hr(e){return e+"$uri"}function Jl(e){var t={},n,r;for(n in e)r=e[n],t[r]=r,t[Hr(r)]=n;return t}function sa(){return{line:0,column:0}}function ec(e){throw e}function zr(e){if(!this)return new zr(e);var t=e&&e.proxy,n,r,i,o,a=ec,u,c,f,h,y=sa,v=!1,R=!1,W=null,L=!1,O;function H(g){g instanceof Error||(g=Yt(g)),W=g,a(g,y)}function G(g){u&&(g instanceof Error||(g=Yt(g)),u(g,y))}this.on=function(g,w){if(typeof w!="function")throw Yt("required args ");switch(g){case"openTag":r=w;break;case"text":n=w;break;case"closeTag":i=w;break;case"error":a=w;break;case"warn":u=w;break;case"cdata":o=w;break;case"attention":h=w;break;case"question":f=w;break;case"comment":c=w;break;default:throw Yt("unsupported event: "+g)}return this},this.ns=function(g){if(typeof g=="undefined"&&(g={}),typeof g!="object")throw Yt("required args ");var w={},C;for(C in g)w[C]=g[C];return R=!0,O=w,this},this.parse=function(g){if(typeof g!="string")throw Yt("required args ");return W=null,k(g),y=sa,L=!1,W},this.stop=function(){L=!0};function k(g){var w=R?[]:null,C=R?Jl(O):null,V,b=[],D=0,A=!1,F=!1,B=0,I=0,K,at,ae,Z,et,tt,ye,Ge,x,_="",$=0,re;function je(){if(re!==null)return re;var l,s,d,m=R&&C.xmlns,E=R&&v?[]:null,S=$,j=_,Y=j.length,ge,he,we,Ke,ie,dt={},yn={},$e,z,J;e:for(;S8)){for((z<65||z>122||z>90&&z<97)&&z!==95&&z!==58&&(G("illegal first char attribute name"),$e=!0),J=S+1;J96&&z<123||z>64&&z<91||z>47&&z<59||z===46||z===45||z===95)){if(z===32||z<14&&z>8){G("missing attribute value"),S=J;continue e}if(z===61)break;G("illegal attribute name char"),$e=!0}if(ie=j.substring(S,J),ie==="xmlns:xmlns"&&(G("illegal declaration of xmlns"),$e=!0),z=j.charCodeAt(J+1),z===34)J=j.indexOf('"',S=J+2),J===-1&&(J=j.indexOf("'",S),J!==-1&&(G("attribute value quote missmatch"),$e=!0));else if(z===39)J=j.indexOf("'",S=J+2),J===-1&&(J=j.indexOf('"',S),J!==-1&&(G("attribute value quote missmatch"),$e=!0));else for(G("missing attribute value quotes"),$e=!0,J=J+1;J8));J++);for(J===-1&&(G("missing closing quotes"),J=Y,$e=!0),$e||(we=j.substring(S,J)),S=J;J+18));J++)S===J&&(G("illegal character after attribute end"),$e=!0);if(S=J+1,$e)continue e;if(ie in yn){G("attribute <"+ie+"> already defined");continue}if(yn[ie]=!0,!R){dt[ie]=we;continue}if(v){if(he=ie==="xmlns"?"xmlns":ie.charCodeAt(0)===120&&ie.substr(0,6)==="xmlns:"?ie.substr(6):null,he!==null){if(l=Lt(we),s=Hr(he),Ke=O[l],!Ke){if(he==="xmlns"||s in C&&C[s]!==l)do Ke="ns"+D++;while(typeof C[Ke]!="undefined");else Ke=he;O[l]=Ke}C[he]!==Ke&&(ge||(C=Ql(C),ge=!0),C[he]=Ke,he==="xmlns"&&(C[Hr(Ke)]=l,m=Ke),C[s]=l),dt[ie]=we;continue}E.push(ie,we);continue}if(z=ie.indexOf(":"),z===-1){dt[ie]=we;continue}if(!(d=C[ie.substring(0,z)])){G(aa(ie.substring(0,z)));continue}ie=m===d?ie.substr(z+1):d+ie.substr(z),dt[ie]=we}if(v)for(S=0,Y=E.length;S=m&&(S=l.exec(g),!(!S||(E=S[0].length+S.index,E>B)));)s+=1,m=E;return B==-1?(d=E,j=g.substring(I)):I===0?j=g.substring(I,B):(d=B-m,j=I==-1?g.substring(B):g.substring(B,I+1)),{data:j,line:s,column:d}}for(y=p,t&&(x=Object.create({},{name:er(function(){return ye}),originalName:er(function(){return Ge}),attrs:er(je),ns:er(function(){return C})}));I!==-1;){if(g.charCodeAt(I)===60?B=I:B=g.indexOf("<",I),B===-1){if(b.length)return H("unexpected end of file");if(I===0)return H("missing start tag");I",B),I===-1)return H("unclosed cdata");if(o&&(o(g.substring(B+9,I),y),L))return;I+=3;continue}if(ae===45&&g.charCodeAt(B+3)===45){if(I=g.indexOf("-->",B),I===-1)return H("unclosed comment");if(c&&(c(g.substring(B+4,I),Lt,y),L))return;I+=3;continue}}if(Z===63){if(I=g.indexOf("?>",B),I===-1)return H("unclosed question");if(f&&(f(g.substring(B,I+2),y),L))return;I+=2;continue}for(K=B+1;;K++){if(et=g.charCodeAt(K),isNaN(et))return I=-1,H("unclosed tag");if(et===34)ae=g.indexOf('"',K+1),K=ae!==-1?ae:K;else if(et===39)ae=g.indexOf("'",K+1),K=ae!==-1?ae:K;else if(et===62){I=K;break}}if(Z===33){if(h&&(h(g.substring(B,I+1),Lt,y),L))return;I+=1;continue}if(re={},Z===47){if(A=!1,F=!0,!b.length)return H("missing open tag");if(K=ye=b.pop(),ae=B+2+K.length,g.substring(B+2,ae)!==K)return H("closing tag mismatch");for(;ae8&&Z<14))return H("close tag")}else{if(g.charCodeAt(I-1)===47?(K=ye=g.substring(B+1,I-1),A=!0,F=!0):(K=ye=g.substring(B+1,I),A=!0,F=!1),!(Z>96&&Z<123||Z>64&&Z<91||Z===95||Z===58))return H("illegal first char nodeName");for(ae=1,at=K.length;ae96&&Z<123||Z>64&&Z<91||Z>47&&Z<59||Z===45||Z===95||Z==46)){if(Z===32||Z<14&&Z>8){ye=K.substring(0,ae),re=null;break}return H("invalid nodeName")}F||b.push(ye)}if(R){if(V=C,A&&(F||w.push(V),re===null&&(v=K.indexOf("xmlns",ae)!==-1)&&($=ae,_=K,je(),v=!1)),Ge=ye,Z=ye.indexOf(":"),Z!==-1){if(tt=C[ye.substring(0,Z)],!tt)return H("missing namespace on <"+Ge+">");ye=ye.substr(Z+1)}else tt=C.xmlns;tt&&(ye=tt+":"+ye)}if(A&&($=ae,_=K,r&&(t?r(x,Lt,F,y):r(ye,je,Lt,F,y),L)))return;if(F){if(i&&(i(t?x:ye,Lt,A,y),L))return;R&&(A?C=V:C=w.pop())}I+=1}}}function ua(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var Ur={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},la="property";function ca(e){return e.xml&&e.xml.serialize}function tc(e){let t=ca(e);return t!==la&&(t||null)}function nc(e){return e.charAt(0).toUpperCase()+e.slice(1)}function fa(e,t){return ua(t)?e.prefix+":"+nc(e.localName):e.name}function rc(e,t){var n=e.name,r=e.localName,i=t&&t.xml&&t.xml.typePrefix;return i&&r.indexOf(i)===0?e.prefix+":"+r.slice(i.length):n}function ic(e,t,n){let r=Ae(e,t.xmlns),i=`${t[r.prefix]||r.prefix}:${r.localName}`,o=Ae(i);var a=n.getPackage(o.prefix);return rc(o,a)}function kt(e){return new Error(e)}function xt(e){return e.$descriptor}function oc(e){M(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw kt("expected element");var n=this.elementsById,r=xt(t),i=r.idProperty,o;if(i&&(o=t.get(i.name),o)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(o))throw new Error("illegal ID <"+o+">");if(n[o])throw kt("duplicate ID <"+o+">");n[o]=t}},this.addWarning=function(t){this.warnings.push(t)}}function hn(){}hn.prototype.handleEnd=function(){};hn.prototype.handleText=function(){};hn.prototype.handleNode=function(){};function Gr(){}Gr.prototype=Object.create(hn.prototype);Gr.prototype.handleNode=function(){return this};function Zt(){}Zt.prototype=Object.create(hn.prototype);Zt.prototype.handleText=function(e){this.body=(this.body||"")+e};function dn(e,t){this.property=e,this.context=t}dn.prototype=Object.create(Zt.prototype);dn.prototype.handleNode=function(e){if(this.element)throw kt("expected no sub nodes");return this.element=this.createReference(e),this};dn.prototype.handleEnd=function(){this.element.id=this.body};dn.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}};function Kr(e,t){this.element=t,this.propertyDesc=e}Kr.prototype=Object.create(Zt.prototype);Kr.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=Jn(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)};function tr(){}tr.prototype=Object.create(Zt.prototype);tr.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t};function Te(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}Te.prototype=Object.create(tr.prototype);Te.prototype.addReference=function(e){this.context.addReference(e)};Te.prototype.handleText=function(e){var t=this.element,n=xt(t),r=n.bodyProperty;if(!r)throw kt("unexpected body text <"+e+">");Zt.prototype.handleText.call(this,e)};Te.prototype.handleEnd=function(){var e=this.body,t=this.element,n=xt(t),r=n.bodyProperty;r&&e!==void 0&&(e=Jn(r.type,e),t.set(r.name,e))};Te.prototype.createElement=function(e){var t=e.attributes,n=this.type,r=xt(n),i=this.context,o=new n({}),a=this.model,u;return P(t,function(c,f){var h=r.propertiesByName[f],y;h&&h.isReference?h.isMany?(y=c.split(" "),P(y,function(v){i.addReference({element:o,property:h.ns.name,id:v})})):i.addReference({element:o,property:h.ns.name,id:c}):(h?c=Jn(h.type,c):f==="xmlns"?f=":"+f:(u=Ae(f,r.ns.prefix),a.getPackage(u.prefix)&&i.addWarning({message:"unknown attribute <"+f+">",element:o,property:f,value:c})),o.set(f,c))}),o};Te.prototype.getPropertyForNode=function(e){var t=e.name,n=Ae(t),r=this.type,i=this.model,o=xt(r),a=n.name,u=o.propertiesByName[a];if(u&&!u.isAttr){let f=tc(u);if(f){let h=e.attributes[f];if(h){let y=ic(h,e.ns,i),v=i.getType(y);return M({},u,{effectiveType:xt(v).name})}}return u}var c=i.getPackage(n.prefix);if(c){let f=fa(n,c),h=i.getType(f);if(u=ve(o.properties,function(y){return!y.isVirtual&&!y.isReference&&!y.isAttribute&&h.hasType(y.type)}),u)return M({},u,{effectiveType:xt(h).name})}else if(u=ve(o.properties,function(f){return!f.isReference&&!f.isAttribute&&f.type==="Element"}),u)return u;throw kt("unrecognized element <"+n.name+">")};Te.prototype.toString=function(){return"ElementDescriptor["+xt(this.type).name+"]"};Te.prototype.valueHandler=function(e,t){return new Kr(e,t)};Te.prototype.referenceHandler=function(e){return new dn(e,this.context)};Te.prototype.handler=function(e){return e==="Element"?new Xt(this.model,e,this.context):new Te(this.model,e,this.context)};Te.prototype.handleChild=function(e){var t,n,r,i;if(t=this.getPropertyForNode(e),r=this.element,n=t.effectiveType||t.type,Wr(n))return this.valueHandler(t,r);t.isReference?i=this.referenceHandler(t).handleNode(e):i=this.handler(n).handleNode(e);var o=i.element;return o!==void 0&&(t.isMany?r.get(t.name).push(o):r.set(t.name,o),t.isReference?(M(o,{element:r}),this.context.addReference(o)):o.$parent=r),i};function Yr(e,t,n){Te.call(this,e,t,n)}Yr.prototype=Object.create(Te.prototype);Yr.prototype.createElement=function(e){var t=e.name,n=Ae(t),r=this.model,i=this.type,o=r.getPackage(n.prefix),a=o&&fa(n,o)||t;if(!i.hasType(a))throw kt("unexpected element <"+e.originalName+">");return Te.prototype.createElement.call(this,e)};function Xt(e,t,n){this.model=e,this.context=n}Xt.prototype=Object.create(tr.prototype);Xt.prototype.createElement=function(e){var t=e.name,n=Ae(t),r=n.prefix,i=e.ns[r+"$uri"],o=e.attributes;return this.model.createAny(t,i,o)};Xt.prototype.handleChild=function(e){var t=new Xt(this.model,"Element",this.context).handleNode(e),n=this.element,r=t.element,i;return r!==void 0&&(i=n.$children=n.$children||[],i.push(r),r.$parent=n),t};Xt.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function nr(e){e instanceof Fe&&(e={model:e}),M(this,{lax:!1},e)}nr.prototype.fromXML=function(e,t,n){var r=t.rootHandler;t instanceof Te?(r=t,t={}):typeof t=="string"?(r=this.handler(t),t={}):typeof r=="string"&&(r=this.handler(r));var i=this.model,o=this.lax,a=new oc(M({},t,{rootHandler:r})),u=new zr({proxy:!0}),c=ac();r.context=a,c.push(r);function f(w,C,V){var b=C(),D=b.line,A=b.column,F=b.data;F.charAt(0)==="<"&&F.indexOf(" ")!==-1&&(F=F.slice(0,F.indexOf(" "))+">");var B="unparsable content "+(F?F+" ":"")+`detected + line: `+D+` + column: `+A+` + nested error: `+w.message;if(V)return a.addWarning({message:B,error:w}),!0;throw kt(B)}function h(w,C){return f(w,C,!0)}function y(){var w=a.elementsById,C=a.references,V,b;for(V=0;b=C[V];V++){var D=b.element,A=w[b.id],F=xt(D).propertiesByName[b.property];if(A||a.addWarning({message:"unresolved reference <"+b.id+">",element:b.element,property:b.property,value:b.id}),F.isMany){var B=D.get(F.name),I=B.indexOf(b);I===-1&&(I=B.length),A?B[I]=A:B.splice(I,1)}else D.set(F.name,A)}}function v(){c.pop().handleEnd()}var R=/^<\?xml /i,W=/ encoding="([^"]+)"/i,L=/^utf-8$/i;function O(w){if(R.test(w)){var C=W.exec(w),V=C&&C[1];!V||L.test(V)||a.addWarning({message:"unsupported document encoding <"+V+">, falling back to UTF-8"})}}function H(w,C){var V=c.peek();try{c.push(V.handleNode(w))}catch(b){f(b,C,o)&&c.push(new Gr)}}function G(w,C){try{c.peek().handleText(w)}catch(V){h(V,C)}}function k(w,C){w.trim()&&G(w,C)}var g=i.getPackages().reduce(function(w,C){return w[C.uri]=C.prefix,w},Object.entries(Ur).reduce(function(w,[C,V]){return w[V]=C,w},i.config&&i.config.nsMap||{}));return u.ns(g).on("openTag",function(w,C,V,b){var D=w.attrs||{},A=Object.keys(D).reduce(function(B,I){var K=C(D[I]);return B[I]=K,B},{}),F={name:w.name,originalName:w.originalName,attributes:A,ns:w.ns};H(F,b)}).on("question",O).on("closeTag",v).on("cdata",G).on("text",function(w,C,V){k(C(w),V)}).on("error",f).on("warn",h),new Promise(function(w,C){var V;try{u.parse(e),y()}catch(B){V=B}var b=r.element;!V&&!b&&(V=kt("failed to parse document as <"+r.type.$descriptor.name+">"));var D=a.warnings,A=a.references,F=a.elementsById;return V?(V.warnings=D,C(V)):w({rootElement:b,elementsById:F,references:A,warnings:D})})};nr.prototype.handler=function(e){return new Yr(this.model,e)};function ac(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}var sc=` +`,uc=/<|>|'|"|&|\n\r|\n/g,pa=/<|>|&/g;function ft(e){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=e,this.defaultPrefixMap=e&&e.defaultPrefixMap||{}}ft.prototype.mapDefaultPrefixes=function(e){this.defaultPrefixMap=e};ft.prototype.defaultUriByPrefix=function(e){return this.defaultPrefixMap[e]};ft.prototype.byUri=function(e){return this.uriMap[e]||this.parent&&this.parent.byUri(e)};ft.prototype.add=function(e,t){this.uriMap[e.uri]=e,t?this.wellknown.push(e):this.custom.push(e),this.mapPrefix(e.prefix,e.uri)};ft.prototype.uriByPrefix=function(e){return this.prefixMap[e||"xmlns"]||this.parent&&this.parent.uriByPrefix(e)};ft.prototype.mapPrefix=function(e,t){this.prefixMap[e||"xmlns"]=t};ft.prototype.getNSKey=function(e){return e.prefix!==void 0?e.uri+"|"+e.prefix:e.uri};ft.prototype.logUsed=function(e){var t=e.uri,n=this.getNSKey(e);this.used[n]=this.byUri(t),this.parent&&this.parent.logUsed(e)};ft.prototype.getUsed=function(e){var t=[].concat(this.wellknown,this.custom);return t.filter(n=>{var r=this.getNSKey(n);return this.used[r]})};function lc(e){return e.charAt(0).toLowerCase()+e.slice(1)}function cc(e,t){return ua(t)?lc(e):e}function ha(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function da(e){return De(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function fc(e){return e.getUsed().filter(function(t){return t.prefix!=="xml"}).map(function(t){var n="xmlns"+(t.prefix?":"+t.prefix:"");return{name:n,value:t.uri}})}function pc(e,t){return t.isGeneric?M({localName:t.ns.localName},e):M({localName:cc(t.ns.localName,t.$pkg)},e)}function hc(e,t){return M({localName:t.ns.localName},e)}function dc(e){var t=e.$descriptor;return rt(t.properties,function(n){var r=n.name;if(n.isVirtual||!Ye(e,r))return!1;var i=e[r];return i===n.default||i===null?!1:n.isMany?i.length:!0})}var mc={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},yc={"<":"lt",">":"gt","&":"amp"};function ma(e,t,n){return e=De(e)?e:""+e,e.replace(t,function(r){return"&"+n[r]+";"})}function gc(e){return ma(e,uc,mc)}function vc(e){return ma(e,pa,yc)}function Ec(e){return rt(e,function(t){return t.isAttr})}function bc(e){return rt(e,function(t){return!t.isAttr})}function Xr(e){this.tagName=e}Xr.prototype.build=function(e){return this.element=e,this};Xr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"").appendNewLine()};function It(){}It.prototype.serializeValue=It.prototype.serializeTo=function(e){e.append(this.escape?vc(this.value):this.value)};It.prototype.build=function(e,t){return this.value=t,e.type==="String"&&t.search(pa)!==-1&&(this.escape=!0),this};function Zr(e){this.tagName=e}ha(Zr,It);Zr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("").appendNewLine()};function se(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}se.prototype.build=function(e){this.element=e;var t=e.$descriptor,n=this.propertyDescriptor,r,i,o=t.isGeneric;return o?r=this.parseGenericNsAttributes(e):r=this.parseNsAttributes(e),n?this.ns=this.nsPropertyTagName(n):this.ns=this.nsTagName(t),this.tagName=this.addTagName(this.ns),o?this.parseGenericContainments(e):(i=dc(e),this.parseAttributes(Ec(i)),this.parseContainments(bc(i))),this.parseGenericAttributes(e,r),this};se.prototype.nsTagName=function(e){var t=this.logNamespaceUsed(e.ns);return pc(t,e)};se.prototype.nsPropertyTagName=function(e){var t=this.logNamespaceUsed(e.ns);return hc(t,e)};se.prototype.isLocalNs=function(e){return e.uri===this.ns.uri};se.prototype.nsAttributeName=function(e){var t;if(De(e)?t=Ae(e):t=e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:M({localName:t.localName},n)};se.prototype.parseGenericNsAttributes=function(e){return Object.entries(e).filter(([t,n])=>!t.startsWith("$")&&this.parseNsAttribute(e,t,n)).map(([t,n])=>({name:t,value:n}))};se.prototype.parseGenericContainments=function(e){var t=e.$body;t&&this.body.push(new It().build({type:"String"},t));var n=e.$children;n&&P(n,r=>{this.body.push(new se(this).build(r))})};se.prototype.parseNsAttribute=function(e,t,n){var r=e.$model,i=Ae(t),o;if(i.prefix==="xmlns"&&(o={prefix:i.localName,uri:n}),!i.prefix&&i.localName==="xmlns"&&(o={uri:n}),!o)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(o,!0,!0);else{var a=this.logNamespaceUsed(o,!0);this.getNamespaces().logUsed(a)}};se.prototype.parseNsAttributes=function(e){var t=this,n=e.$attrs,r=[];return P(n,function(i,o){var a=t.parseNsAttribute(e,o,i);a&&r.push(a)}),r};se.prototype.parseGenericAttributes=function(e,t){var n=this;P(t,function(r){try{n.addAttribute(n.nsAttributeName(r.name),r.value)}catch(i){typeof console!="undefined"&&console.warn(`missing namespace information for <${r.name}=${r.value}> on`,e,i)}})};se.prototype.parseContainments=function(e){var t=this,n=this.body,r=this.element;P(e,function(i){var o=r.get(i.name),a=i.isReference,u=i.isMany;if(u||(o=[o]),i.isBody)n.push(new It().build(i,o[0]));else if(Wr(i.type))P(o,function(f){n.push(new Zr(t.addTagName(t.nsPropertyTagName(i))).build(i,f))});else if(a)P(o,function(f){n.push(new Xr(t.addTagName(t.nsPropertyTagName(i))).build(f))});else{var c=ca(i);P(o,function(f){var h;c?c===la?h=new se(t,i):h=new rr(t,i,c):h=new se(t),n.push(h.build(f))})}})};se.prototype.getNamespaces=function(e){var t=this.namespaces,n=this.parent,r;return t||(r=n&&n.getNamespaces(),e||!r?this.namespaces=t=new ft(r):t=r),t};se.prototype.logNamespace=function(e,t,n){var r=this.getNamespaces(n),i=e.uri,o=e.prefix,a=r.byUri(i);return(!a||n)&&r.add(e,t),r.mapPrefix(o,i),e};se.prototype.logNamespaceUsed=function(e,t){var n=this.getNamespaces(t),r=e.prefix,i=e.uri,o,a,u;if(!r&&!i)return{localName:e.localName};if(u=n.defaultUriByPrefix(r),i=i||u||n.uriByPrefix(r),!i)throw new Error("no namespace uri given for prefix <"+r+">");if(e=n.byUri(i),!e&&!r&&(e=this.logNamespace({uri:i},u===i,!0)),!e){for(o=r,a=1;n.uriByPrefix(o);)o=r+"_"+a++;e=this.logNamespace({prefix:o,uri:i},u===i)}return r&&n.mapPrefix(r,i),e};se.prototype.parseAttributes=function(e){var t=this,n=this.element;P(e,function(r){var i=n.get(r.name);if(r.isReference)if(!r.isMany)i=i.id;else{var o=[];P(i,function(a){o.push(a.id)}),i=o.join(" ")}t.addAttribute(t.nsAttributeName(r),i)})};se.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),da(e)};se.prototype.addAttribute=function(e,t){var n=this.attrs;De(t)&&(t=gc(t));var r=pr(n,function(o){return o.name.localName===e.localName&&o.name.uri===e.uri&&o.name.prefix===e.prefix}),i={name:e,value:t};r!==-1?n.splice(r,1,i):n.push(i)};se.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=fc(n).concat(t)),P(t,function(r){e.append(" ").append(da(r.name)).append('="').append(r.value).append('"')})};se.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==It;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),P(this.body,function(r){r.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("")),e.appendNewLine()};function rr(e,t,n){se.call(this,e,t),this.serialization=n}ha(rr,se);rr.prototype.parseNsAttributes=function(e){var t=se.prototype.parseNsAttributes.call(this,e).filter(a=>a.name!==this.serialization),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var r=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var i=e.$model.getPackage(r.uri),o=i.xml&&i.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(this.serialization),(r.prefix?r.prefix+":":"")+o+n.ns.localName),t};rr.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri};function xc(){this.value="",this.write=function(e){this.value+=e}}function wc(e,t){var n=[""];this.append=function(r){return e.write(r),this},this.appendNewLine=function(){return t&&e.write(` +`),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function ya(e){e=M({format:!1,preamble:!0},e||{});function t(n,r){var i=r||new xc,o=new wc(i,e.format);e.preamble&&o.append(sc);var a=new se,u=n.$model;if(a.getNamespaces().mapDefaultPrefixes(_c(u)),a.build(n).serializeTo(o),!r)return i.value}return{toXML:t}}function _c(e){let t=e.config&&e.config.nsMap||{},n={};for(let r in Ur)n[r]=Ur[r];for(let r in t){let i=t[r];n[i]=r}for(let r of e.getPackages())n[r.prefix]=r.uri;return n}function ir(e,t){Fe.call(this,e,t)}ir.prototype=Object.create(Fe.prototype);ir.prototype.fromXML=function(e,t,n){De(t)||(n=t,t="bpmn:Definitions");var r=new nr(M({model:this,lax:!0},n)),i=r.handler(t);return r.fromXML(e,i)};ir.prototype.toXML=function(e,t){var n=new ya(t);return new Promise(function(r,i){try{var o=n.toXML(e);return r({xml:o})}catch(a){return i(a)}})};var Sc="BPMN20",Rc="http://www.omg.org/spec/BPMN/20100524/MODEL",Ac="bpmn",Cc=[],Pc=[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],kc=[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],Tc={tagAlias:"lowerCase",typePrefix:"t"},Mc={name:Sc,uri:Rc,prefix:Ac,associations:Cc,types:Pc,enumerations:kc,xml:Tc},Dc="BPMNDI",Nc="http://www.omg.org/spec/BPMN/20100524/DI",Bc="bpmndi",Oc=[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],Lc=[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],Ic=[],Fc={name:Dc,uri:Nc,prefix:Bc,types:Oc,enumerations:Lc,associations:Ic},jc="DC",$c="http://www.omg.org/spec/DD/20100524/DC",Vc="dc",qc=[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],Wc=[],Hc={name:jc,uri:$c,prefix:Vc,types:qc,associations:Wc},zc="DI",Uc="http://www.omg.org/spec/DD/20100524/DI",Gc="di",Kc=[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],Yc=[],Xc={tagAlias:"lowerCase"},Zc={name:zc,uri:Uc,prefix:Gc,types:Kc,associations:Yc,xml:Xc},Qc="bpmn.io colors for BPMN",Jc="http://bpmn.io/schema/bpmn/biocolor/1.0",ef="bioc",tf=[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],nf=[],rf=[],of={name:Qc,uri:Jc,prefix:ef,types:tf,enumerations:nf,associations:rf},af="BPMN in Color",sf="http://www.omg.org/spec/BPMN/non-normative/color/1.0",uf="color",lf=[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],cf=[],ff=[],pf={name:af,uri:sf,prefix:uf,types:lf,enumerations:cf,associations:ff},hf={bpmn:Mc,bpmndi:Fc,dc:Hc,di:Zc,bioc:of,color:pf};function ga(e,t){let n=M({},hf,e);return new ir(n,t)}Q();Q();Q();var df="Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472";function va(e){Ye(e,"di")||Object.defineProperty(e,"di",{enumerable:!1,get:function(){throw new Error(df)}})}function Le(e,t){return e.$instanceOf(t)}function mf(e){return ve(e.rootElements,function(t){return Le(t,"bpmn:Process")||Le(t,"bpmn:Collaboration")})}function Qr(e){var t={},n=[],r={};function i(x,_){return function($){x($,_)}}function o(x){t[x.id]=x}function a(x){return t[x.id]}function u(x,_){var $=x.gfx;if($)throw new Error(`already rendered ${Se(x)}`);return e.element(x,r[x.id],_)}function c(x,_){return e.root(x,r[x.id],_)}function f(x,_){try{var $=r[x.id]&&u(x,_);return o(x),$}catch(re){h(re.message,{element:x,error:re}),console.error(`failed to import ${Se(x)}`,re)}}function h(x,_){e.error(x,_)}var y=this.registerDi=function(_){var $=_.bpmnElement;$?r[$.id]?h(`multiple DI elements defined for ${Se($)}`,{element:$}):(r[$.id]=_,va($)):h(`no bpmnElement referenced in ${Se(_)}`,{element:_})};function v(x){R(x.plane)}function R(x){y(x),P(x.planeElement,W)}function W(x){y(x)}this.handleDefinitions=function(_,$){var re=_.diagrams;if($&&re.indexOf($)===-1)throw new Error("diagram not part of ");if(!$&&re&&re.length&&($=re[0]),!$)throw new Error("no diagram to display");r={},v($);var je=$.plane;if(!je)throw new Error(`no plane for ${Se($)}`);var p=je.bpmnElement;if(!p)if(p=mf(_),p)h(`correcting missing bpmnElement on ${Se(je)} to ${Se(p)}`),je.bpmnElement=p,y(je);else throw new Error("no process or collaboration to display");var l=c(p,je);if(Le(p,"bpmn:Process")||Le(p,"bpmn:SubProcess"))O(p,l);else if(Le(p,"bpmn:Collaboration"))ye(p,l),H(_.rootElements,l);else throw new Error(`unsupported bpmnElement for ${Se(je)}: ${Se(p)}`);L(n)};var L=this.handleDeferred=function(){for(var _;n.length;)_=n.shift(),_()};function O(x,_){Z(x,_),D(x.ioSpecification,_),b(x.artifacts,_),o(x)}function H(x,_){var $=rt(x,function(re){return!a(re)&&Le(re,"bpmn:Process")&&re.laneSets});$.forEach(i(O,_))}function G(x,_){f(x,_)}function k(x,_){P(x,i(G,_))}function g(x,_){f(x,_)}function w(x,_){f(x,_)}function C(x,_){f(x,_)}function V(x,_){f(x,_)}function b(x,_){P(x,function($){Le($,"bpmn:Association")?n.push(function(){V($,_)}):V($,_)})}function D(x,_){x&&(P(x.dataInputs,i(w,_)),P(x.dataOutputs,i(C,_)))}var A=this.handleSubProcess=function(_,$){Z(_,$),b(_.artifacts,$)};function F(x,_){var $=f(x,_);Le(x,"bpmn:SubProcess")&&A(x,$||_),Le(x,"bpmn:Activity")&&D(x.ioSpecification,_),n.push(function(){P(x.dataInputAssociations,i(g,_)),P(x.dataOutputAssociations,i(g,_))})}function B(x,_){f(x,_)}function I(x,_){f(x,_)}function K(x,_){n.push(function(){var $=f(x,_);x.childLaneSet&&at(x.childLaneSet,$||_),Ge(x)})}function at(x,_){P(x.lanes,i(K,_))}function ae(x,_){P(x,i(at,_))}function Z(x,_){et(x.flowElements,_),x.laneSets&&ae(x.laneSets,_)}function et(x,_){P(x,function($){Le($,"bpmn:SequenceFlow")?n.push(function(){B($,_)}):Le($,"bpmn:BoundaryEvent")?n.unshift(function(){F($,_)}):Le($,"bpmn:FlowNode")?F($,_):Le($,"bpmn:DataObject")||(Le($,"bpmn:DataStoreReference")||Le($,"bpmn:DataObjectReference")?I($,_):h(`unrecognized flowElement ${Se($)} in context ${Se(_&&_.businessObject)}`,{element:$,context:_}))})}function tt(x,_){var $=f(x,_),re=x.processRef;re&&O(re,$||_)}function ye(x,_){P(x.participants,i(tt,_)),n.push(function(){k(x.messageFlows,_)}),b(x.artifacts,_)}function Ge(x){P(x.flowNodeRef,function(_){var $=_.get("lanes");$&&$.push(x)})}}function Ea(e,t,n){var r,i,o,a,u=[];function c(f,h){var y={root:function(L,O){return r.add(L,O)},element:function(L,O,H){return r.add(L,O,H)},error:function(L,O){u.push({message:L,context:O})}},v=new Qr(y);h=h||f.diagrams&&f.diagrams[0];var R=yf(f,h);if(!R)throw new Error("no diagram to display");P(R,function(L){v.handleDefinitions(f,L)});var W=h.plane.bpmnElement.id;o.setRootElement(o.findRoot(W+"_plane")||o.findRoot(W))}return new Promise(function(f,h){try{return r=e.get("bpmnImporter"),i=e.get("eventBus"),o=e.get("canvas"),i.fire("import.render.start",{definitions:t}),c(t,n),i.fire("import.render.complete",{error:a,warnings:u}),f({warnings:u})}catch(y){return y.warnings=u,h(y)}})}function yf(e,t){if(!(!t||!t.plane)){var n=t.plane.bpmnElement,r=n;!N(n,"bpmn:Process")&&!N(n,"bpmn:Collaboration")&&(r=gf(n));var i;N(r,"bpmn:Collaboration")?i=r:i=ve(e.rootElements,function(f){if(N(f,"bpmn:Collaboration"))return ve(f.participants,function(h){return h.processRef===r})});var o=[r];i&&(o=_t(i.participants,function(f){return f.processRef}),o.push(i));var a=ba(o),u=[t],c=[n];return P(e.diagrams,function(f){if(f.plane){var h=f.plane.bpmnElement;a.indexOf(h)!==-1&&c.indexOf(h)===-1&&(u.push(f),c.push(h))}}),u}}function ba(e){var t=[];return P(e,function(n){n&&(t.push(n),t=t.concat(ba(n.flowElements)))}),t}function gf(e){for(var t=e;t;){if(N(t,"bpmn:Process"))return t;t=t.$parent}}var vf='',Jr=vf,ei={verticalAlign:"middle"},ti={color:"#404040"},Ef={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},bf={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},xf={position:"absolute",left:"50%",top:"40%",transform:"translate(-50%)",width:"260px",padding:"10px",background:"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",display:"flex",lineHeight:"1.3"},wf='
              '+Jr+'Web-based tooling for BPMN, DMN and forms powered by bpmn.io.
              ',pt;function _f(){pt=ee(wf),Pe(pt,Ef),Pe(He("svg",pt),ei),Pe(He(".backdrop",pt),bf),Pe(He(".notice",pt),xf),Pe(He(".link",pt),ti,{margin:"15px 20px 15px 10px",alignSelf:"center"})}function xa(){pt||(_f(),rn.bind(pt,".backdrop","click",function(e){document.body.removeChild(pt)})),document.body.appendChild(pt)}function pe(e){e=M({},Rf,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),this._init(this._container,this._moddle,e),Cf(this._container)}Ce(pe,ct);pe.prototype.importXML=async function(t,n){let r=this;function i(a){return r.get("eventBus").createEvent(a)}let o=[];try{t=this._emit("import.parse.start",{xml:t})||t;let a;try{a=await this._moddle.fromXML(t,"bpmn:Definitions")}catch(v){throw this._emit("import.parse.complete",{error:v}),v}let u=a.rootElement,c=a.references,f=a.warnings,h=a.elementsById;o=o.concat(f),u=this._emit("import.parse.complete",i({error:null,definitions:u,elementsById:h,references:c,warnings:o}))||u;let y=await this.importDefinitions(u,n);return o=o.concat(y.warnings),this._emit("import.done",{error:null,warnings:o}),{warnings:o}}catch(a){let u=a;throw o=o.concat(u.warnings||[]),or(u,o),u=Sf(u),this._emit("import.done",{error:u,warnings:u.warnings}),u}};pe.prototype.importDefinitions=async function(t,n){return this._setDefinitions(t),{warnings:(await this.open(n)).warnings}};pe.prototype.open=async function(t){let n=this._definitions,r=t;if(!n){let o=new Error("no XML imported");throw or(o,[]),o}if(typeof t=="string"&&(r=Af(n,t),!r)){let o=new Error("BPMNDiagram <"+t+"> not found");throw or(o,[]),o}try{this.clear()}catch(o){throw or(o,[]),o}let{warnings:i}=await Ea(this,n,r);return{warnings:i}};pe.prototype.saveXML=async function(t){t=t||{};let n=this._definitions,r,i;try{if(!n)throw new Error("no definitions loaded");n=this._emit("saveXML.start",{definitions:n})||n,i=(await this._moddle.toXML(n,t)).xml,i=this._emit("saveXML.serialized",{xml:i})||i}catch(a){r=a}let o=r?{error:r}:{xml:i};if(this._emit("saveXML.done",o),r)throw r;return o};pe.prototype.saveSVG=async function(){this._emit("saveSVG.start");let t,n;try{let r=this.get("canvas"),i=r.getActiveLayer(),o=He(":scope > defs",r._svg),a=Rr(i),u=o?""+Rr(o)+"":"",c=i.getBBox();t=` -'+l+u+""}catch(n){r=n}if(this._emit("saveSVG.done",{error:r,svg:t}),r)throw r;return{svg:t}};se.prototype._setDefinitions=function(e){this._definitions=e};se.prototype.getModules=function(){return this._modules};se.prototype.clear=function(){this.getDefinitions()&&tt.prototype.clear.call(this)};se.prototype.destroy=function(){tt.prototype.destroy.call(this),Dt(this._container)};se.prototype.on=function(e,t,r,n){return this.get("eventBus").on(e,t,r,n)};se.prototype.off=function(e,t){this.get("eventBus").off(e,t)};se.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),typeof e=="string"&&(e=Le(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()};se.prototype.getDefinitions=function(){return this._definitions};se.prototype.detach=function(){let e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))};se.prototype._init=function(e,t,r){let n=r.modules||this.getModules(r),i=r.additionalModules||[],o=[{bpmnjs:["value",this],moddle:["value",t]}],u=[].concat(o,n,i),l=k(Nn(r,["additionalModules"]),{canvas:k({},r.canvas,{container:e}),modules:u});tt.call(this,l),r&&r.container&&this.attachTo(r.container)};se.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)};se.prototype._createContainer=function(e){let t=xe('
              ');return we(t,{width:Eo(e.width),height:Eo(e.height),position:e.position}),t};se.prototype._createModdle=function(e){let t=k({},this._moddleExtensions,e.moddleExtensions);return new ho(t)};se.prototype._modules=[];function Fr(e,t){return e.warnings=t,e}function Ju(e){let r=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return r&&(e.message="unparsable content <"+r[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+r[2]),e}var el={width:"100%",height:"100%",position:"relative"};function Eo(e){return e+(Te(e)?"px":"")}function tl(e,t){return t&&he(e.diagrams,function(r){return r.id===t})||null}function rl(e){let r=''+Sn+"",n=xe(r);we(Le("svg",n),Rn),we(n,Cn,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(n),sr.bind(n,"click",function(i){vo(),i.preventDefault()})}function vt(e){se.call(this,e)}Ee(vt,se);vt.prototype._modules=[pi,xi,xr,Pi,hr];vt.prototype._moddleExtensions={};var xo=globalThis;xo.BpmnJS=vt;xo.BpmnJS.Viewer=vt;var Lh=vt;})(); +'+u+a+""}catch(r){n=r}if(this._emit("saveSVG.done",{error:n,svg:t}),n)throw n;return{svg:t}};pe.prototype._setDefinitions=function(e){this._definitions=e};pe.prototype.getModules=function(){return this._modules};pe.prototype.clear=function(){this.getDefinitions()&&ct.prototype.clear.call(this)};pe.prototype.destroy=function(){ct.prototype.destroy.call(this),Ht(this._container)};pe.prototype.on=function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)};pe.prototype.off=function(e,t){this.get("eventBus").off(e,t)};pe.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),typeof e=="string"&&(e=He(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()};pe.prototype.getDefinitions=function(){return this._definitions};pe.prototype.detach=function(){let e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))};pe.prototype._init=function(e,t,n){let r=n.modules||this.getModules(n),i=n.additionalModules||[],o=[{bpmnjs:["value",this],moddle:["value",t]}],a=[].concat(o,r,i),u=M(gr(n,["additionalModules"]),{canvas:M({},n.canvas,{container:e}),modules:a});ct.call(this,u),n&&n.container&&this.attachTo(n.container)};pe.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)};pe.prototype._createContainer=function(e){let t=ee('
              ');return Pe(t,{width:wa(e.width),height:wa(e.height),position:e.position}),t};pe.prototype._createModdle=function(e){let t=M({},this._moddleExtensions,e.moddleExtensions);return new ga(t)};pe.prototype._modules=[];function or(e,t){return e.warnings=t,e}function Sf(e){let n=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return n&&(e.message="unparsable content <"+n[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+n[2]),e}var Rf={width:"100%",height:"100%",position:"relative"};function wa(e){return e+(Me(e)?"px":"")}function Af(e,t){return t&&ve(e.diagrams,function(n){return n.id===t})||null}function Cf(e){let n=''+Jr+"",r=ee(n);Pe(He("svg",r),ei),Pe(r,ti,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(r),Pn.bind(r,"click",function(i){xa(),i.preventDefault()})}function ht(e){pe.call(this,e)}Ce(ht,pe);ht.prototype._modules=[go,So,Vn,Do,Bn];ht.prototype._moddleExtensions={};var Ba=Os(Ma());Q();function Oa(e,t){var n=e.get("editorActions",!1);n&&n.register({toggleLinting:function(){t.toggle()}})}Oa.$inject=["injector","linting"];var La=` + + + +`,Ia=` + + +`,Da=` + + + +`,Fa=` + +`,jf=-7,$f=-7,Vf=500,Na={resolver:{resolveRule:function(){return null}},config:{}},ja={error:La,warning:Ia,success:Da,info:Fa,inactive:Da};function de(e,t,n,r,i,o,a){this._bpmnjs=e,this._canvas=t,this._elementRegistry=r,this._eventBus=i,this._overlays=o,this._translate=a,this._issues={},this._active=n&&n.active||!1,this._linterConfig=Na,this._overlayIds={};var u=this;i.on(["import.done","elements.changed","linting.configChanged","linting.toggle"],Vf,function(f){u.update()}),i.on("linting.toggle",function(f){f.active||(u._clearIssues(),u._updateButton())}),i.on("diagram.clear",function(){u._clearIssues()});var c=n&&n.bpmnlint;c&&i.once("diagram.init",function(){if(u.getLinterConfig()===Na)try{u.setLinterConfig(c)}catch{console.error("[bpmn-js-bpmnlint] Invalid lint rules configured. Please doublecheck your linting.bpmnlint configuration, cf. https://github.com/bpmn-io/bpmn-js-bpmnlint#configure-lint-rules")}}),this._init()}de.prototype.setLinterConfig=function(e){if(!e.config||!e.resolver)throw new Error("Expected linterConfig = { config, resolver }");this._linterConfig=e,this._eventBus.fire("linting.configChanged")};de.prototype.getLinterConfig=function(){return this._linterConfig};de.prototype._init=function(){this._createButton(),this._updateButton()};de.prototype.isActive=function(){return this._active};de.prototype._formatIssues=function(e){let t=this,n=Ve(e,function(o,a,u){return o.concat(a.map(function(c){return c.rule=u,c}))},[]),r=t._elementRegistry.filter(o=>N(o,"bpmn:Participant")),i=r.map(o=>o.businessObject);return n=_t(n,function(o){if(!t._elementRegistry.get(o.id)){o.isChildIssue=!0,o.actualElementId=o.id;let u=i.filter(c=>c.processRef&&c.processRef.id&&c.processRef.id===o.id);u.length?o.id=u[0].id:o.id=t._canvas.getRootElement().id}return o}),n=Ft(n,function(o){return o.id}),n};de.prototype.toggle=function(e){return e=typeof e=="undefined"?!this.isActive():e,this._setActive(e),e};de.prototype._setActive=function(e){this._active!==e&&(this._active=e,this._eventBus.fire("linting.toggle",{active:e}))};de.prototype.update=function(){var e=this,t=this._bpmnjs.getDefinitions();if(t){var n=this._lintStart=Math.random();this.lint().then(function(r){if(e._lintStart===n){r=e._formatIssues(r);var i={},o={},a={};for(var u in e._issues)r[u]||(i[u]=e._issues[u]);for(var c in r)e._issues[c]?r[c]!==e._issues[c]&&(o[c]=r[c]):a[c]=r[c];i=M(i,o),a=M(a,o),e._clearOverlays(),e.isActive()&&e._createIssues(a),e._issues=r,e._updateButton(),e._fireComplete(r)}})}};de.prototype._fireComplete=function(e){this._eventBus.fire("linting.completed",{issues:e})};de.prototype._createIssues=function(e){for(var t in e)this._createElementIssues(t,e[t])};de.prototype._createElementIssues=function(e,t){var n=this._elementRegistry.get(e);if(n){var r=this._elementRegistry.get(e+"_plane");r&&this._createElementIssues(r.id,t);var i,o,a=!n.parent;a&&N(n,"bpmn:Process")?(i="bottom-right",o={top:20,left:150}):a&&N(n,"bpmn:SubProcess")?(i="bottom-right",o={top:50,left:150}):(i="top-right",o={top:jf,left:$f});var u=Ft(t,function(A){return(A.isChildIssue?"child":"")+A.category}),c=u.error,f=u.warn,h=u.info,y=u.childerror,v=u.childwarn,R=u.childinfo;if(!(!h&&!c&&!f&&!y&&!v&&!R)){var W=ee('
              '),L=c||y?ee('
              '+La+"
              "):f||v?ee('
              '+Ia+"
              "):ee('
              '+Fa+"
              "),O=ee('
              '),H=ee('
              '),G=ee('
              '),k=ee('
              '),g=ee("
                ");if(W.appendChild(L),W.appendChild(O),O.appendChild(H),H.appendChild(G),G.appendChild(k),k.appendChild(g),c&&this._addErrors(g,c),f&&this._addWarnings(g,f),h&&this._addInfos(g,h),y||v||R){var w=ee('
                '),C=ee("
                  "),V=this._translate("Issues for child elements"),b=ee(''+V+":");if(y&&this._addErrors(C,y),v&&this._addWarnings(C,v),R&&this._addInfos(C,R),c||f){var D=ee("
                  ");w.appendChild(D)}w.appendChild(b),w.appendChild(C),G.appendChild(w)}this._overlayIds[e]=this._overlays.add(n,"linting",{position:o,html:W,scale:{min:.7}})}}};de.prototype._addErrors=function(e,t){var n=this;t.forEach(function(r){n._addEntry(e,"error",r)})};de.prototype._addWarnings=function(e,t){var n=this;t.forEach(function(r){n._addEntry(e,"warning",r)})};de.prototype._addInfos=function(e,t){var n=this;t.forEach(function(r){n._addEntry(e,"info",r)})};de.prototype._addEntry=function(e,t,n){var f;var r=n.rule,i=(f=n.meta)==null?void 0:f.documentation.url,o=this._translate(n.message),a=n.actualElementId,u=ja[t],c=ee(` +
                • + ${u} + ${Et(o)} + (${i?`${Et(r)}`:Et(r)}) + ${a?`${Et(a)}`:""} +
                • + `);e.appendChild(c)};de.prototype._clearOverlays=function(){this._overlays.remove({type:"linting"}),this._overlayIds={}};de.prototype._clearIssues=function(){this._issues={},this._clearOverlays()};de.prototype._setButtonState=function(e){var{errors:t,warnings:n,infos:r}=e,i=this._button,o=t&&"error"||n&&"warning"||"success",a=ja[o],u=this._translate(t||n?"{errors} Errors, {warnings} Warnings":"No Issues",{errors:String(t),warnings:String(n),infos:String(r)}),c=` + ${a} + ${u}`;o=this.isActive()?o:"inactive",["error","inactive","success","warning"].forEach(function(f){o===f?i.classList.add("bjsl-button-"+f):i.classList.remove("bjsl-button-"+f)}),i.innerHTML=c};de.prototype._updateButton=function(){var e=0,t=0,n=0;for(var r in this._issues)this._issues[r].forEach(function(i){i.category==="error"?e++:i.category==="warn"?t++:i.category==="info"&&n++});this._setButtonState({errors:e,warnings:t,infos:n})};de.prototype._createButton=function(){var e=this;this._button=ee(''),this._button.addEventListener("click",function(){e.toggle()}),this._canvas.getContainer().appendChild(this._button)};de.prototype.lint=function(){var e=this._bpmnjs.getDefinitions(),t=new Ba.Linter(this._linterConfig);return t.lint(e)};de.$inject=["bpmnjs","canvas","config.linting","elementRegistry","eventBus","overlays","translate"];var ri={__init__:["linting","lintingEditorActions"],linting:["type",de],lintingEditorActions:["type",Oa]};/*! generated from .bpmnlintrc for dokuwiki-plugin-bpmnio — do not edit by hand */function le(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ps(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}function hs(e,t){return t.indexOf(":")===-1&&(t="bpmn:"+t),typeof e.$instanceOf=="function"?e.$instanceOf(t):e.$type===t}function qf(e,t){return t.some(function(n){return hs(e,n)})}var Wf=Object.freeze({__proto__:null,is:hs,isAny:qf}),me=ps(Wf),Qt={},$a;function ce(){if($a)return Qt;$a=1;let{is:e}=me;function t(a,u){return function(){function c(f,h){e(f,a)&&h.report(f.id,"Element type <"+a+"> is discouraged")}return o(u,{check:c})}}Qt.checkDiscouragedNodeType=t;function n(a,u){if(!a)return null;let c=a.$parent;return c?e(c,u)?c:n(c,u):a}Qt.findParent=n;function r(a){let u=n(a,"bpmn:Process");return u&&u.isExecutable}Qt.isInExecutableProcess=r;let i="https://github.com/bpmn-io/bpmnlint/blob/main/docs/rules";function o(a,u){let{meta:{documentation:c={},...f}={},...h}=u;return{meta:{documentation:{url:`${i}/${a}.md`,...c},...f},...h}}return Qt.annotateRule=o,Qt}var ii,Va;function Hf(){if(Va)return ii;Va=1;let{is:e}=me,{annotateRule:t}=ce();return ii=function(){function n(r,i){if(!e(r,"bpmn:AdHocSubProcess"))return;(r.flowElements||[]).forEach(function(a){e(a,"bpmn:StartEvent")&&i.report(a.id,"A is not allowed in "),e(a,"bpmn:EndEvent")&&i.report(a.id,"An is not allowed in ")})}return t("ad-hoc-sub-process",{check:n})},ii}var zf=Hf(),Uf=le(zf),oi,qa;function Gf(){if(qa)return oi;qa=1;let{annotateRule:e}=ce();oi=function(){function i(o,a){if(!t(o))return;(o.outgoing||[]).forEach(c=>{!n(c)&&!r(o,c)&&a.report(c.id,"Sequence flow is missing condition",["conditionExpression"])})}return e("conditional-flows",{check:i})};function t(i){let o=i.default,a=i.outgoing||[];return o||a.find(n)}function n(i){return!!i.conditionExpression}function r(i,o){return i.default===o}return oi}var Kf=Gf(),Yf=le(Kf),ai,Wa;function Xf(){if(Wa)return ai;Wa=1;let{is:e,isAny:t}=me,{annotateRule:n}=ce();return ai=function(){function r(o){return(o.flowElements||[]).some(u=>e(u,"bpmn:EndEvent"))}function i(o,a){if(!(!t(o,["bpmn:Process","bpmn:SubProcess"])||e(o,"bpmn:AdHocSubProcess"))&&!r(o)){let u=e(o,"bpmn:SubProcess")?"Sub process":"Process";a.report(o.id,u+" is missing end event")}}return n("end-event-required",{check:i})},ai}var Zf=Xf(),Qf=le(Zf),si,Ha;function Jf(){if(Ha)return si;Ha=1;let{is:e}=me,{annotateRule:t}=ce();si=function(){function r(i,o){if(!e(i,"bpmn:EventBasedGateway"))return;let a=i.outgoing||[];a.length<2&&o.report(i.id,"An must have at least 2 outgoing "),a.forEach(u=>{n(u)&&o.report(u.id,"A outgoing from an must not be conditional")})}return t("event-based-gateway",{check:r})};function n(r){return!!r.conditionExpression}return si}var ep=Jf(),tp=le(ep),ui,za;function np(){if(za)return ui;za=1;let{is:e}=me,{annotateRule:t}=ce();return ui=function(){function n(r,i){if(!e(r,"bpmn:SubProcess")||!r.triggeredByEvent)return;(r.flowElements||[]).forEach(function(a){if(!e(a,"bpmn:StartEvent"))return!1;(a.eventDefinitions||[]).length===0&&i.report(a.id,"Start event is missing event definition",["eventDefinitions"])})}return t("event-sub-process-typed-start-event",{check:n})},ui}var rp=np(),ip=le(rp),li,Ua;function op(){if(Ua)return li;Ua=1;let{isAny:e}=me,{annotateRule:t}=ce();return li=function(){function n(r,i){if(!e(r,["bpmn:Activity","bpmn:Event"]))return;(r.incoming||[]).length>1&&i.report(r.id,"Incoming flows do not join")}return t("fake-join",{check:n})},li}var ap=op(),sp=le(ap),ci,Ga;function up(){if(Ga)return ci;Ga=1;let{is:e,isAny:t}=me,{annotateRule:n}=ce();return ci=function(){function r(f,h){if(!e(f,"bpmn:Definitions"))return!1;let y=i(f),v=o(f);y.forEach(R=>{a(R)||h.report(R.id,"Element is missing name"),u(R,v)||h.report(R.id,"Element is unused"),c(R,y)||h.report(R.id,"Element name is not unique")})}return n("global",{check:r});function i(f){return f.rootElements.filter(h=>t(h,["bpmn:Error","bpmn:Escalation","bpmn:Message","bpmn:Signal"]))}function o(f){let h=[];function y(v){e(v,"bpmn:Definitions")&&v.get("rootElements").length&&v.get("rootElements").forEach(y),e(v,"bpmn:FlowElementsContainer")&&v.get("flowElements").length&&v.get("flowElements").forEach(y),e(v,"bpmn:Event")&&v.get("eventDefinitions").length&&v.get("eventDefinitions").forEach(R=>h.push(R)),e(v,"bpmn:Collaboration")&&v.get("messageFlows").length&&v.get("messageFlows").forEach(y),t(v,["bpmn:MessageFlow","bpmn:ReceiveTask","bpmn:SendTask"])&&h.push(v)}return y(f),h}function a(f){var h;return((h=f.name)==null?void 0:h.trim())!==""}function u(f,h){if(e(f,"bpmn:Error"))return h.some(y=>{var v;return e(y,"bpmn:ErrorEventDefinition")&&f.get("id")===((v=y.get("errorRef"))==null?void 0:v.get("id"))});if(e(f,"bpmn:Escalation"))return h.some(y=>{var v;return e(y,"bpmn:EscalationEventDefinition")&&f.get("id")===((v=y.get("escalationRef"))==null?void 0:v.get("id"))});if(e(f,"bpmn:Message"))return h.some(y=>{var v;return t(y,["bpmn:MessageEventDefinition","bpmn:MessageFlow","bpmn:ReceiveTask","bpmn:SendTask"])&&f.get("id")===((v=y.get("messageRef"))==null?void 0:v.get("id"))});if(e(f,"bpmn:Signal"))return h.some(y=>{var v;return e(y,"bpmn:SignalEventDefinition")&&f.get("id")===((v=y.get("signalRef"))==null?void 0:v.get("id"))})}function c(f,h){return h.filter(y=>e(y,f.$type)&&f.name===y.name).length===1}},ci}var lp=up(),cp=le(lp),fi,Ka;function fp(){if(Ka)return fi;Ka=1;let{is:e,isAny:t}=me,{annotateRule:n}=ce();fi=function(){function o(a,u){t(a,["bpmn:ParallelGateway","bpmn:EventBasedGateway"])||e(a,"bpmn:Gateway")&&!r(a)||e(a,"bpmn:SubProcess")||e(a,"bpmn:SequenceFlow")&&!i(a)||t(a,["bpmn:FlowNode","bpmn:SequenceFlow","bpmn:Participant","bpmn:Lane"])&&(a.name||"").trim().length===0&&u.report(a.id,"Element is missing label/name",["name"])}return n("label-required",{check:o})};function r(o){return(o.outgoing||[]).length>1}function i(o){return o.conditionExpression}return fi}var pp=fp(),hp=le(pp);function dp(e){return Array.prototype.concat.apply([],e)}var mn=Object.prototype.toString,mp=Object.prototype.hasOwnProperty;function Jt(e){return e===void 0}function ds(e){return e!==void 0}function sr(e){return e==null}function ur(e){return mn.call(e)==="[object Array]"}function ar(e){return mn.call(e)==="[object Object]"}function yp(e){return mn.call(e)==="[object Number]"}function ki(e){let t=mn.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function gp(e){return mn.call(e)==="[object String]"}function ms(e){if(!ur(e))throw new Error("must supply array")}function ys(e,t){return!sr(e)&&mp.call(e,t)}function gs(e,t){let n=cr(t),r;return Ie(e,function(i,o){if(n(i,o))return r=i,!1}),r}function vp(e,t){let n=cr(t),r=ur(e)?-1:void 0;return Ie(e,function(i,o){if(n(i,o))return r=o,!1}),r}function Ep(e,t){let n=cr(t),r=[];return Ie(e,function(i,o){n(i,o)&&r.push(i)}),r}function Ie(e,t){let n,r;if(Jt(e))return;let i=ur(e)?Pp:Cp;for(let o in e)if(ys(e,o)&&(n=e[o],r=t(n,i(o)),r===!1))return n}function bp(e,t){if(Jt(e))return[];ms(e);let n=cr(t);return e.filter(function(r,i){return!n(r,i)})}function vs(e,t,n){return Ie(e,function(r,i){n=t(n,r,i)}),n}function Es(e,t){return!!vs(e,function(n,r,i){return n&&t(r,i)},!0)}function xp(e,t){return!!gs(e,t)}function lr(e,t){let n=[];return Ie(e,function(r,i){n.push(t(r,i))}),n}function bs(e){return e&&Object.keys(e)||[]}function wp(e){return bs(e).length}function _p(e){return lr(e,t=>t)}function xs(e,t,n={}){return t=Ti(t),Ie(e,function(r){let i=t(r)||"_",o=n[i];o||(o=n[i]=[]),o.push(r)}),n}function ws(e,...t){e=Ti(e);let n={};return Ie(t,i=>xs(i,e,n)),lr(n,function(i,o){return i[0]})}var Sp=ws;function Rp(e,t){t=Ti(t);let n=[];return Ie(e,function(r,i){let o=t(r,i),a={d:o,v:r};for(var u=0;ur.v)}function Ap(e){return function(t){return Es(e,function(n,r){return t[r]===n})}}function Ti(e){return ki(e)?e:t=>t[e]}function cr(e){return ki(e)?e:t=>t===e}function Cp(e){return e}function Pp(e){return Number(e)}function kp(e,t){let n,r,i,o;function a(y){let v=Date.now(),R=y?0:o+t-v;if(R>0)return u(R);e.apply(i,r),c()}function u(y){n=setTimeout(a,y)}function c(){n&&clearTimeout(n),n=o=r=i=void 0}function f(){n&&a(!0),c()}function h(...y){o=Date.now(),r=y,i=this,n||u(t)}return h.flush=f,h.cancel=c,h}function Tp(e,t){let n=!1;return function(...r){n||(e(...r),n=!0,setTimeout(()=>{n=!1},t))}}function Mp(e,t){return e.bind(t)}function Dp(e,...t){return Object.assign(e,...t)}function Np(e,t,n){let r=e;return Ie(t,function(i,o){if(typeof i!="number"&&typeof i!="string")throw new Error("illegal key type: "+typeof i+". Key should be of type number or string.");if(i==="constructor")throw new Error("illegal key: constructor");if(i==="__proto__")throw new Error("illegal key: __proto__");let a=t[o+1],u=r[i];ds(a)&&sr(u)&&(u=r[i]=isNaN(+a)?{}:[]),Jt(a)?Jt(n)?delete r[i]:r[i]=n:r=u}),e}function Bp(e,t,n){let r=e;return Ie(t,function(i){if(sr(r))return r=void 0,!1;r=r[i]}),Jt(r)?n:r}function Op(e,t){let n={},r=Object(e);return Ie(t,function(i){i in r&&(n[i]=e[i])}),n}function Lp(e,t){let n={},r=Object(e);return Ie(r,function(i,o){t.indexOf(o)===-1&&(n[o]=i)}),n}function _s(e,...t){return t.length&&Ie(t,function(n){!n||!ar(n)||Ie(n,function(r,i){if(i==="__proto__")return;let o=e[i];ar(r)?(ar(o)||(o={}),e[i]=_s(o,r)):e[i]=r})}),e}var Ip=Object.freeze({__proto__:null,assign:Dp,bind:Mp,debounce:kp,ensureArray:ms,every:Es,filter:Ep,find:gs,findIndex:vp,flatten:dp,forEach:Ie,get:Bp,groupBy:xs,has:ys,isArray:ur,isDefined:ds,isFunction:ki,isNil:sr,isNumber:yp,isObject:ar,isString:gp,isUndefined:Jt,keys:bs,map:lr,matchPattern:Ap,merge:_s,omit:Lp,pick:Op,reduce:vs,set:Np,size:wp,some:xp,sortBy:Rp,throttle:Tp,unionBy:Sp,uniqueBy:ws,values:_p,without:bp}),Ss=ps(Ip),pi,Ya;function Fp(){if(Ya)return pi;Ya=1;let{groupBy:e}=Ss,{is:t}=me,{annotateRule:n}=ce();pi=function(){function u(c,f){if(!t(c,"bpmn:FlowElementsContainer"))return;let h=(c.flowElements||[]).filter(r);for(let v of h)i(v)||f.report(v.id,"Link event is missing link name");let y=e(h,v=>i(v));for(let[v,R]of Object.entries(y)){if(!v)continue;if(R.length===1){let L=R[0];f.report(L.id,`Link ${o(L)?"catch":"throw"} event with link name <${v}> missing in scope`);continue}let W=R.filter(a);if(W.length>1)for(let L of W)f.report(L.id,`Duplicate link catch event with link name <${v}> in scope`);else if(W.length===0)for(let L of R)f.report(L.id,`Link catch event with link name <${v}> missing in scope`)}}return n("link-event",{check:u})};function r(u){var c=u.eventDefinitions||[];return t(u,"bpmn:Event")?c.some(f=>t(f,"bpmn:LinkEventDefinition")):!1}function i(u){return u.get("eventDefinitions").find(c=>t(c,"bpmn:LinkEventDefinition")).name}function o(u){return t(u,"bpmn:ThrowEvent")}function a(u){return t(u,"bpmn:CatchEvent")}return pi}var jp=Fp(),$p=le(jp),hi,Xa;function Vp(){if(Xa)return hi;Xa=1;let{is:e}=me,{flatten:t}=Ss,{annotateRule:n}=ce();hi=function(){function c(f,h){if(!e(f,"bpmn:Definitions"))return!1;let v=r(f.rootElements).filter(o),R=i(f);v.forEach(W=>{R.indexOf(W.id)===-1&&h.report(W.id,"Element is missing bpmndi")})}return n("no-bpmndi",{check:c})};function r(c){return t(c.map(f=>{let h=f.laneSets&&f.laneSets[0]||f.childLaneSet,y=t([f.flowElements||[],f.flowElements&&r(f.flowElements.filter(a))||[],f.participants||[],f.artifacts||[],h&&h.lanes||[],h&&h.lanes&&r(h.lanes.filter(u))||[],f.messageFlows||[]]);return y.length>0?y.map(v=>({id:v.id,$type:v.$type})):[]}))}function i(c){return t(c.get("diagrams").map(f=>(f.plane.planeElement||[]).map(y=>{var v;return(v=y.bpmnElement)==null?void 0:v.id})))}function o(c){return!["bpmn:DataObject"].includes(c.$type)}function a(c){return!!c.flowElements}function u(c){return!!c.childLaneSet}return hi}var qp=Vp(),Wp=le(qp),di,Za;function Hp(){if(Za)return di;Za=1;let e=ce().checkDiscouragedNodeType;return di=e("bpmn:ComplexGateway","no-complex-gateway"),di}var zp=Hp(),Up=le(zp),mi,Qa;function Gp(){if(Qa)return mi;Qa=1;let{isAny:e,is:t}=me,{annotateRule:n}=ce();mi=function(){function a(u,c){if(!e(u,["bpmn:Task","bpmn:Gateway","bpmn:SubProcess","bpmn:Event"])||u.triggeredByEvent||o(u)||t(u.$parent,"bpmn:AdHocSubProcess"))return;let f=u.incoming||[],h=u.outgoing||[];!f.length&&!h.length&&c.report(u.id,"Element is not connected")}return n("no-disconnected",{check:a})};function r(a){var u=a.eventDefinitions;return!t(a,"bpmn:BoundaryEvent")||!u||u.length!==1?!1:t(u[0],"bpmn:CompensateEventDefinition")}function i(a){return a.isForCompensation}function o(a){var u=r(a),c=i(a);return u||c}return mi}var Kp=Gp(),Yp=le(Kp),yi,Ja;function Xp(){if(Ja)return yi;Ja=1;let{is:e}=me,{annotateRule:t}=ce();yi=function(){let r={},i={},o={};function a(u,c){if(!e(u,"bpmn:SequenceFlow"))return;let f=n(u);if(f in r){c.report(u.id,"SequenceFlow is a duplicate");let h=u.sourceRef.id,y=u.targetRef.id;i[h]||(c.report(h,"Duplicate outgoing sequence flows"),i[h]=!0),o[y]||(c.report(y,"Duplicate incoming sequence flows"),o[y]=!0)}else r[f]=u}return t("no-duplicate-sequence-flows",{check:a})};function n(r){let i=r.conditionExpression,o=i?i.body:"",a=r.sourceRef?r.sourceRef.id:r.id,u=r.targetRef?r.targetRef.id:r.id;return a+"#"+u+"#"+o}return yi}var Zp=Xp(),Qp=le(Zp),gi,es;function Jp(){if(es)return gi;es=1;let{is:e}=me,{annotateRule:t}=ce();return gi=function(){function n(r,i){if(!e(r,"bpmn:Gateway"))return;let o=r.incoming||[],a=r.outgoing||[];o.length>1&&a.length>1&&i.report(r.id,"Gateway forks and joins")}return t("no-gateway-join-fork",{check:n})},gi}var eh=Jp(),th=le(eh),vi,ts;function nh(){if(ts)return vi;ts=1;let{isAny:e}=me,{annotateRule:t}=ce();vi=function(){function i(o,a){if(!e(o,["bpmn:Activity","bpmn:Event"]))return;(o.outgoing||[]).filter(f=>!n(f)&&!r(o,f)).length>1&&a.report(o.id,"Flow splits implicitly")}return t("no-implicit-split",{check:i})};function n(i){return!!i.conditionExpression}function r(i,o){return i.default===o}return vi}var rh=nh(),ih=le(rh),Ei,ns;function oh(){if(ns)return Ei;ns=1;let{is:e,isAny:t}=me,{findParent:n,annotateRule:r}=ce();return Ei=function(){function i(h){let y=h.eventDefinitions||[];return y.length&&y.every(v=>e(v,"bpmn:LinkEventDefinition"))}function o(h){let y=h.eventDefinitions||[];return y.length&&y.every(v=>e(v,"bpmn:CompensateEventDefinition"))}function a(h){return(n(h,"bpmn:Process").artifacts||[]).some(R=>e(R,"bpmn:Association")?R.sourceRef.id===h.id:!1)}function u(h){return h.isForCompensation}function c(h){let y=h.outgoing||[];return e(h,"bpmn:SubProcess")&&h.triggeredByEvent||e(h,"bpmn:IntermediateThrowEvent")&&i(h)||e(h.$parent,"bpmn:AdHocSubProcess")||e(h,"bpmn:EndEvent")||e(h,"bpmn:BoundaryEvent")&&o(h)&&a(h)||e(h,"bpmn:Activity")&&u(h)?!1:y.length===0}function f(h,y){t(h,["bpmn:Event","bpmn:Activity","bpmn:Gateway"])&&c(h)&&y.report(h.id,"Element is an implicit end")}return r("no-implicit-end",{check:f})},Ei}var ah=oh(),sh=le(ah),bi,rs;function uh(){if(rs)return bi;rs=1;let{is:e,isAny:t}=me,{annotateRule:n}=ce();return bi=function(){function r(u){let c=u.eventDefinitions||[];return c.length&&c.every(f=>e(f,"bpmn:LinkEventDefinition"))}function i(u){return u.isForCompensation}function o(u){let c=u.incoming||[];return e(u,"bpmn:Activity")&&i(u)||e(u.$parent,"bpmn:AdHocSubProcess")||e(u,"bpmn:SubProcess")&&u.triggeredByEvent||e(u,"bpmn:IntermediateCatchEvent")&&r(u)||t(u,["bpmn:StartEvent","bpmn:BoundaryEvent"])?!1:c.length===0}function a(u,c){t(u,["bpmn:Event","bpmn:Activity","bpmn:Gateway"])&&o(u)&&c.report(u.id,"Element is an implicit start")}return n("no-implicit-start",{check:a})},bi}var lh=uh(),ch=le(lh),xi,is;function fh(){if(is)return xi;is=1;let e=ce().checkDiscouragedNodeType;return xi=e("bpmn:InclusiveGateway","no-inclusive-gateway"),xi}var ph=fh(),hh=le(ph),wi,os;function dh(){if(os)return wi;os=1;let{is:e}=me,{annotateRule:t}=ce();wi=function(){function c(f,h){if(!e(f,"bpmn:Definitions"))return;let y=f.rootElements||[],v=new Set,R=new Set,W=u(f),L=new Map;y.filter(O=>e(O,"bpmn:Collaboration")).forEach(O=>{let H=O.participants||[];r(H,v,W),H.forEach(G=>{L.set(G.processRef,W.get(G))})}),y.filter(O=>e(O,"bpmn:Process")).forEach(O=>{let H=L.get(O)||{};n(O,v,R,W,H)}),v.forEach(O=>h.report(O.id,"Element overlaps with other element")),R.forEach(O=>h.report(O.id,"Element is outside of parent boundary"))}return t("no-overlapping-elements",{check:c})};function n(c,f,h,y,v){let R=c.flowElements||[],W=R.filter(O=>y.has(O));r(W,f,y),W.forEach(O=>{!e(O,"bpmn:DataStoreReference")&&i(y.get(O).bounds,v.bounds)&&h.add(O)}),R.filter(O=>e(O,"bpmn:SubProcess")).forEach(O=>{let H=y.get(O)||{},G=H.isExpanded?H:{};n(O,f,h,y,G)})}function r(c,f,h){var y,v;for(let R=0;R=f.x&&c.y>=f.y,y=c.x+c.width<=f.x+f.width&&c.y+c.height<=f.y+f.height;return!(h&&y)}function o(c,f){if(!a(c)||!a(f))return!1;let h=c.x+c.width>=f.x&&f.x+f.width>=c.x,y=c.y+c.height>=f.y&&f.y+f.height>=c.y;return h&&y}function a(c){return!!c&&e(c,"dc:Bounds")&&typeof c.x=="number"&&typeof c.y=="number"&&typeof c.width=="number"&&typeof c.height=="number"}function u(c){let f=new Map;return(c.diagrams||[]).filter(y=>!!y.plane).forEach(y=>{(y.plane.planeElement||[]).filter(R=>!!R.bpmnElement).forEach(R=>{f.set(R.bpmnElement,R)})}),f}return wi}var mh=dh(),yh=le(mh),_i,as;function gh(){if(as)return _i;as=1;let{is:e}=me,{annotateRule:t}=ce();return _i=function(){function n(r,i){if(!e(r,"bpmn:FlowElementsContainer"))return;if((r.flowElements||[]).filter(function(u){return e(u,"bpmn:StartEvent")?(u.eventDefinitions||[]).length===0:!1}).length>1){let u=e(r,"bpmn:SubProcess")?"Sub process":"Process";i.report(r.id,u+" has multiple blank start events")}}return t("single-blank-start-event",{check:n})},_i}var vh=gh(),Eh=le(vh),Si,ss;function bh(){if(ss)return Si;ss=1;let{is:e}=me,{annotateRule:t}=ce();return Si=function(){function n(r,i){if(!e(r,"bpmn:Event"))return;(r.eventDefinitions||[]).length>1&&i.report(r.id,"Event has multiple event definitions",["eventDefinitions"])}return t("single-event-definition",{check:n})},Si}var xh=bh(),wh=le(xh),Ri,us;function _h(){if(us)return Ri;us=1;let{is:e,isAny:t}=me,{annotateRule:n}=ce();return Ri=function(){function r(o){return(o.flowElements||[]).some(u=>e(u,"bpmn:StartEvent"))}function i(o,a){if(!(!t(o,["bpmn:Process","bpmn:SubProcess"])||e(o,"bpmn:AdHocSubProcess"))&&!r(o)){let u=e(o,"bpmn:SubProcess")?"Sub process":"Process";a.report(o.id,u+" is missing start event")}}return n("start-event-required",{check:i})},Ri}var Sh=_h(),Rh=le(Sh),Ai,ls;function Ah(){if(ls)return Ai;ls=1;let{is:e}=me,{annotateRule:t}=ce();return Ai=function(){function n(r,i){if(!e(r,"bpmn:SubProcess")||r.triggeredByEvent)return;(r.flowElements||[]).forEach(function(a){if(!e(a,"bpmn:StartEvent"))return!1;(a.eventDefinitions||[]).length>0&&i.report(a.id,"Start event must be blank",["eventDefinitions"])})}return t("sub-process-blank-start-event",{check:n})},Ai}var Ch=Ah(),Ph=le(Ch),Ci,cs;function kh(){if(cs)return Ci;cs=1;let{is:e}=me,{annotateRule:t}=ce();return Ci=function(){function n(r,i){if(!e(r,"bpmn:Gateway"))return;let o=r.incoming||[],a=r.outgoing||[];o.length===1&&a.length===1&&i.report(r.id,"Gateway is superfluous. It only has one source and target.")}return t("superfluous-gateway",{check:n})},Ci}var Th=kh(),Mh=le(Th),Pi,fs;function Dh(){if(fs)return Pi;fs=1;let{is:e,isAny:t}=me,{annotateRule:n}=ce();Pi=function(){function o(a,u){if(!t(a,["bpmn:Process","bpmn:SubProcess"]))return;let f=(a.flowElements||[]).filter(v=>e(v,"bpmn:FlowNode")&&(v.outgoing||[]).length===0),h=f.filter(r);if(h.length!==1)return;if(f.every(v=>i(v)||r(v)))for(let v of h)u.report(v.id,"Termination is superfluous.")}return n("superfluous-termination",{check:o})};function r(o){return e(o,"bpmn:EndEvent")&&(o.eventDefinitions||[]).some(a=>e(a,"bpmn:TerminateEventDefinition"))}function i(o){return e(o,"bpmn:SubProcess")&&o.triggeredByEvent&&(o.flowElements||[]).some(u=>e(u,"bpmn:StartEvent")&&u.isInterrupting)}return Pi}var Nh=Dh(),Bh=le(Nh),ue={};function Mi(){}Mi.prototype.resolveRule=function(e,t){let n=ue[e+"/"+t];if(!n)throw new Error("cannot resolve rule <"+e+"/"+t+">: not bundled");return n};Mi.prototype.resolveConfig=function(e,t){throw new Error("cannot resolve config <"+t+"> in <"+e+">: not bundled")};var Rs=new Mi,Oh={"ad-hoc-sub-process":"error","conditional-flows":"error","end-event-required":"error","event-based-gateway":"error","event-sub-process-typed-start-event":"error","fake-join":"warn",global:"warn","label-required":"error","link-event":"error","no-bpmndi":"error","no-complex-gateway":"error","no-disconnected":"error","no-duplicate-sequence-flows":"error","no-gateway-join-fork":"error","no-implicit-split":"error","no-implicit-end":"error","no-implicit-start":"error","no-inclusive-gateway":"warn","no-overlapping-elements":"warn","single-blank-start-event":"error","single-event-definition":"error","start-event-required":"error","sub-process-blank-start-event":"error","superfluous-gateway":"warn","superfluous-termination":"warn"},As={rules:Oh};ue["bpmnlint/ad-hoc-sub-process"]=Uf;ue["bpmnlint/conditional-flows"]=Yf;ue["bpmnlint/end-event-required"]=Qf;ue["bpmnlint/event-based-gateway"]=tp;ue["bpmnlint/event-sub-process-typed-start-event"]=ip;ue["bpmnlint/fake-join"]=sp;ue["bpmnlint/global"]=cp;ue["bpmnlint/label-required"]=hp;ue["bpmnlint/link-event"]=$p;ue["bpmnlint/no-bpmndi"]=Wp;ue["bpmnlint/no-complex-gateway"]=Up;ue["bpmnlint/no-disconnected"]=Yp;ue["bpmnlint/no-duplicate-sequence-flows"]=Qp;ue["bpmnlint/no-gateway-join-fork"]=th;ue["bpmnlint/no-implicit-split"]=ih;ue["bpmnlint/no-implicit-end"]=sh;ue["bpmnlint/no-implicit-start"]=ch;ue["bpmnlint/no-inclusive-gateway"]=hh;ue["bpmnlint/no-overlapping-elements"]=yh;ue["bpmnlint/single-blank-start-event"]=Eh;ue["bpmnlint/single-event-definition"]=wh;ue["bpmnlint/start-event-required"]=Rh;ue["bpmnlint/sub-process-blank-start-event"]=Ph;ue["bpmnlint/superfluous-gateway"]=Mh;ue["bpmnlint/superfluous-termination"]=Bh;var fr=globalThis;fr.BpmnJS=ht;fr.BpmnJS.Viewer=ht;var Cs={config:As,resolver:Rs};fr.BpmnLintModule=ri;fr.BpmnLintConfig=Cs;ht.lintModule=ri;ht.lintConfig=Cs;var Rv=ht;})(); diff --git a/vendor/build-manifest.json b/vendor/build-manifest.json index 940f516..180f8ee 100644 --- a/vendor/build-manifest.json +++ b/vendor/build-manifest.json @@ -1,7 +1,10 @@ { - "generatedAt": "2026-04-21T16:11:12.043Z", + "generatedAt": "2026-06-11T12:50:11.992Z", "packages": { "bpmn-js": "18.14.0", - "dmn-js": "17.7.0" + "dmn-js": "17.7.0", + "bpmn-js-bpmnlint": "0.24.0", + "bpmnlint": "11.12.1", + "bpmnlint-pack-config": "0.9.0" } }