From c88bd154bd573c8ceefeb9b009eba97536aec54c Mon Sep 17 00:00:00 2001 From: alibama Date: Thu, 11 Jun 2026 12:51:47 +0000 Subject: [PATCH 1/2] 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 | 4 + 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 | 896 +++++++++++++++++- 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 | 188 ++-- .../dist/bpmn-viewer.production.min.js | 52 +- vendor/build-manifest.json | 7 +- 19 files changed, 1778 insertions(+), 97 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..4e6f23f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,7 @@ 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 d25c39c..099ce5c 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 d65c090..3a5f087 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,9 @@ "devDependencies": { "@eslint/js": "^9.0.0", "bpmn-js": "^18.18.0", + "bpmn-js-bpmnlint": "^0.24.0", + "bpmnlint": "^11.12.1", + "bpmnlint-pack-config": "^0.9.0", "dmn-js": "^17.8.1", "esbuild": "^0.28.1", "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", @@ -1038,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", @@ -1117,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" }, @@ -1131,6 +1627,13 @@ "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", @@ -1171,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", @@ -1251,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", @@ -1266,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", @@ -1341,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", @@ -1371,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", @@ -1378,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", @@ -1516,6 +2136,16 @@ "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.17.0", "resolved": "https://registry.npmjs.org/diagram-js/-/diagram-js-15.17.0.tgz", @@ -1747,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.28.1", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz", @@ -1979,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", @@ -2141,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", @@ -2208,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", @@ -2236,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", @@ -2259,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", @@ -2381,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", @@ -2414,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", @@ -2434,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", @@ -2567,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", @@ -2687,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", @@ -2862,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", @@ -2892,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", @@ -3071,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", @@ -3092,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", @@ -3503,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", @@ -3570,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 d604237..00240fb 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,9 @@ "devDependencies": { "@eslint/js": "^9.0.0", "bpmn-js": "^18.18.0", + "bpmn-js-bpmnlint": "^0.24.0", + "bpmnlint": "^11.12.1", + "bpmnlint-pack-config": "^0.9.0", "dmn-js": "^17.8.1", "esbuild": "^0.28.1", "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 d832f30..082147d 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(trim($match)), $posStart, $posEnd, $inline, $this->zoom]; + return [ + $state, $this->type, base64_encode(trim($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..b5909cb --- /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 62b57f5..001008f 100644 --- a/vendor/bpmn-js/dist/bpmn-modeler.production.min.js +++ b/vendor/bpmn-js/dist/bpmn-modeler.production.min.js @@ -1,16 +1,16 @@ /*! bpmn-js - 18.18.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 jx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qu={exports:{}},Zf;function Fx(){if(Zf)return qu.exports;Zf=1;var e=qu.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},qu.exports}var Hx=Fx(),$x=jx(Hx);function dn(e){if(!(this instanceof dn))return new dn(e);e=e||[128,36,1],this._seed=e.length?$x.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 Xi(e){return Array.prototype.concat.apply([],e)}var fa=Object.prototype.toString,zx=Object.prototype.hasOwnProperty;function Fn(e){return e===void 0}function Ye(e){return e!==void 0}function Tr(e){return e==null}function U(e){return fa.call(e)==="[object Array]"}function Pe(e){return fa.call(e)==="[object Object]"}function te(e){return fa.call(e)==="[object Number]"}function Le(e){let t=fa.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function rt(e){return fa.call(e)==="[object String]"}function Vx(e){if(!U(e))throw new Error("must supply array")}function ft(e,t){return!Tr(e)&&zx.call(e,t)}function ne(e,t){let n=Js(t),r;return E(e,function(i,o){if(n(i,o))return r=i,!1}),r}function Qs(e,t){let n=Js(t),r=U(e)?-1:void 0;return E(e,function(i,o){if(n(i,o))return r=o,!1}),r}function Q(e,t){let n=Js(t),r=[];return E(e,function(i,o){n(i,o)&&r.push(i)}),r}function E(e,t){let n,r;if(Fn(e))return;let i=U(e)?Gx:Wx;for(let o in e)if(ft(e,o)&&(n=e[o],r=t(n,i(o)),r===!1))return n}function Qf(e,t){if(Fn(e))return[];Vx(e);let n=Js(t);return e.filter(function(r,i){return!n(r,i)})}function Xe(e,t,n){return E(e,function(r,i){n=t(n,r,i)}),n}function hn(e,t){return!!Xe(e,function(n,r,i){return n&&t(r,i)},!0)}function It(e,t){return!!ne(e,t)}function Ve(e,t){let n=[];return E(e,function(r,i){n.push(t(r,i))}),n}function Zi(e){return e&&Object.keys(e)||[]}function Jf(e){return Zi(e).length}function Sn(e){return Ve(e,t=>t)}function Cn(e,t,n={}){return t=Zu(t),E(e,function(r){let i=t(r)||"_",o=n[i];o||(o=n[i]=[]),o.push(r)}),n}function Xu(e,...t){e=Zu(e);let n={};return E(t,i=>Cn(i,e,n)),Ve(n,function(i,o){return i[0]})}var ed=Xu;function Rt(e,t){t=Zu(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 bt(e){return function(t){return hn(e,function(n,r){return t[r]===n})}}function Zu(e){return Le(e)?e:t=>t[e]}function Js(e){return Le(e)?e:t=>t===e}function Wx(e){return e}function Gx(e){return Number(e)}function ec(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 nt(e,t){return e.bind(t)}function S(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];Ye(a)&&Tr(s)&&(s=r[i]=isNaN(+a)?{}:[]),Fn(a)?Fn(n)?delete r[i]:r[i]=n:r=s}),e}function dt(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}var st={legend:[1,"
","
"],tr:[2,"","
"],col:[2,"","
"],_default:[0,"",""]};st.td=st.th=[3,"","
"];st.option=st.optgroup=[1,'"];st.thead=st.tbody=st.colgroup=st.caption=st.tfoot=[1,"","
"];st.polyline=st.ellipse=st.polygon=st.circle=st.text=st.line=st.path=st.rect=st.g=[1,'',""];function _e(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(st,r)?st[r]:st._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 Ux(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 ct(e,...t){let n=e.style;return E(t,function(r){r&&E(r,function(i,o){n[o]=i})}),e}function Ze(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}var Kx=Object.prototype.toString;function ke(e){return new Mr(e)}function Mr(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Mr.prototype.add=function(e){return this.list.add(e),this};Mr.prototype.remove=function(e){return Kx.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)};Mr.prototype.removeMatching=function(e){let t=this.array();for(let n=0;n"+e+"",t=!0);var n=rb(e);if(!t)return n;for(var r=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)r.appendChild(i.firstChild);return r}function rb(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(rl.svg,e),t&&H(n,t),n}var Qu=null;function tl(){return Qu===null&&(Qu=G("svg")),Qu}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=tl().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 Qi(e){return e?tl().createSVGTransformFromMatrix(e):tl().createSVGTransform()}var sd=/([&<>]{1})/g,ib=/([&<>\n\r"]{1})/g,ob={"&":"&","<":"<",">":">",'"':"'"};function Ju(e,t){function n(r,i){return ob[i]||i}return e.replace(t,n)}function dd(e,t){var n,r,i,o,a;switch(e.nodeType){case 3:t.push(Ju(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 ab(e,t){var n=ld(t);if(cr(e),!!t){cb(n)||(n=n.documentElement);for(var r=pb(n.childNodes),i=0;i{let i=r.match(gb);return(i&&i[1]||r).trim()})||[]}function sl(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 C=b.split("."),P=c(C.shift());for(;C.length;)P=P[C.shift()];return P}if(ol(o,b))return o[b];if(ol(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(al(b))b=nc(b.slice());else throw s(`Cannot invoke "${b}". Expected a function!`);let P=(b.$inject||vb(b)).map(O=>ol(x,O)?x[O]:c(O));return{fn:b,dependencies:P}}function u(b){let{fn:x,dependencies:C}=p(b),P=Function.prototype.bind.call(x,null,...C);return new P}function l(b,x,C){let{fn:P,dependencies:O}=p(b,C);return P.apply(x,O)}function f(b){return nc(x=>b.get(x))}function d(b,x){if(x&&x.length){let C=Object.create(null),P=Object.create(null),O=[],T=[],B=[],I,W,$,K;for(let he in i)I=i[he],x.indexOf(he)!==-1&&(I[2]==="private"?(W=O.indexOf(I[3]),W===-1?($=I[3].createChild([],x),K=f($),O.push(I[3]),T.push($),B.push(K),C[he]=[K,he,"private",$]):C[he]=[B[W],he,"private",T[W]]):C[he]=[I[2],I[1]],P[he]=!0),(I[2]==="factory"||I[2]==="type")&&I[1].$scope&&x.forEach(Gt=>{I[1].$scope.indexOf(Gt)!==-1&&(C[he]=[I[2],I[1]],P[Gt]=!0)});x.forEach(he=>{if(!P[he])throw new Error('No provider for "'+he+'". Cannot use provider from the parent!')}),b.unshift(C)}return new sl(b,a)}let h={factory:l,type:u,value:function(b){return b}};function y(b,x){let C=b.__init__||[];return function(){C.forEach(P=>{typeof P=="string"?x.get(P):x.invoke(P)})}}function v(b){let x=b.__exports__;if(x){let C=b.__modules__,P=Object.keys(b).reduce((W,$)=>($!=="__exports__"&&$!=="__modules__"&&$!=="__init__"&&$!=="__depends__"&&(W[$]=b[$]),W),Object.create(null)),O=(C||[]).concat(P),T=d(O),B=nc(function(W){return T.get(W)});x.forEach(function(W){i[W]=[B,W,"private",T]});let I=(b.__init__||[]).slice();return I.unshift(function(){T.init()}),b=Object.assign({},b,{__init__:I}),y(b,T)}return Object.keys(b).forEach(function(C){if(C==="__init__"||C==="__depends__")return;let P=b[C];if(P[2]==="private"){i[C]=P;return}let O=P[0],T=P[1];i[C]=[h[O],yb(O,T),O]}),y(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 R(b){let x=b.reduce(w,[]).map(v),C=!1;return function(){C||(C=!0,x.forEach(P=>P()))}}this.get=c,this.invoke=l,this.instantiate=u,this.createChild=d,this.init=R(e)}function yb(e,t){return e!=="value"&&al(t)&&(t=nc(t.slice())),t}var _b=1e3;function mn(e,t){var n=this;t=t||_b,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 pr(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function xb(e){return["M",e.x,e.y]}function cl(e){return["L",e.x,e.y]}function bb(e,t,n){return["C",e.x,e.y,t.x,t.y,n.x,n.y]}function Eb(e,t){let n=e.length,r=[xb(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 fi(e,t){var n={};return E(e,function(r){var i=r;i.waypoints&&(i=we(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 kb(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(Ab,function(r,i,o){var a=[],s=i.toLowerCase();for(o.replace(Pb,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=dl,n}function Nb(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 Ib(e,t){return e=fl(e),t=fl(t),Ir(t,e.x,e.y)||Ir(t,e.x2,e.y)||Ir(t,e.x,e.y2)||Ir(t,e.x2,e.y2)||Ir(e,t.x,t.y)||Ir(e,t.x2,t.y)||Ir(e,t.x,t.y2)||Ir(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;hWn(i,a)||Wn(t,r)Wn(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=sc(c/u),f=sc(p/u),d=+l.toFixed(2),h=+f.toFixed(2);if(!(d<+Vn(e,n).toFixed(2)||d>+Wn(e,n).toFixed(2)||d<+Vn(i,a).toFixed(2)||d>+Wn(i,a).toFixed(2)||h<+Vn(t,r).toFixed(2)||h>+Wn(t,r).toFixed(2)||h<+Vn(o,s).toFixed(2)||h>+Wn(o,s).toFixed(2)))return{x:l,y:f}}}}function sc(e){return Math.round(e*1e11)/1e11}function jb(e,t,n){var r=Ed(e),i=Ed(t);if(!Ib(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&&T<=1&&B>=0&&B<=1&&(n?f++:f.push({x:P.x,y:P.y,t1:T,t2:B}))}}return f}function ya(e,t,n){e=Ad(e),t=Ad(t);for(var r,i,o,a,s,c,p,u,l,f,d=n?0:[],h=0,y=e.length;h1&&(w=it.sqrt(w),n=w*n,r=w*r);var R=n*n,b=r*r,x=(o==a?-1:1)*it.sqrt(Lr((R*b-R*v*v-b*y*y)/(R*v*v+b*y*y))),C=x*n*v/r+(e+s)/2,P=x*-r*y/n+(t+c)/2,O=it.asin(((t-P)/r).toFixed(9)),T=it.asin(((c-P)/r).toFixed(9));O=eT&&(O=O-Br*2),!a&&T>O&&(T=T-Br*2)}var B=T-O;if(Lr(B)>u){var I=T,W=s,$=c;T=O+u*(a&&T>O?1:-1),s=C+n*it.cos(T),c=P+r*it.sin(T),f=Pd(s,c,n,r,i,0,a,W,$,[T,I,C,P])}B=T-O;var K=it.cos(O),he=it.sin(O),Gt=it.cos(T),De=it.sin(T),ge=it.tan(B/4),de=4/3*n*ge,Ee=4/3*r*ge,Be=[e,t],Ke=[e+de*he,t-Ee*K],F=[s+de*De,c-Ee*Gt],z=[s,c];if(Ke[0]=2*Be[0]-Ke[0],Ke[1]=2*Be[1]-Ke[1],p)return[Ke,F,z].concat(f);f=[Ke,F,z].concat(f).join().split(",");for(var ie=[],xe=0,Bt=f.length;xe7){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 jr(e,t,n){var r=Wb(e,t);return r.length===1||r.length===2&&Or(r[0],r[1])<1?gn(r[0]):r.length>1?(r=Rt(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 Wb(e,t){return ya(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],Or(n,i)===0||eo(r,i,n)?e.splice(t,1):t++;return e}function Gb(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function pc(e,t){return Math.round(e*t)/t}function Md(e){return te(e)?e+"px":e}function Ub(e){for(;e.parent;)e=e.parent;return e}function Kb(e){e=S({},{width:"100%",height:"100%"},e);let t=e.container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),ct(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");ce(r).add(t);let i=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(r,e.childNodes[i]||null),r}var Yb="base",kd=0,qb=1,Xb={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=Kb(e),r=this._svg=G("svg");H(r,{width:"100%",height:"100%"}),Ze(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=ec(nt(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=ic(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(Yb,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 Xe(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)};pe.prototype._createLayer=function(e,t){typeof t=="undefined"&&(t=qb);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&&(Ce(n),t.visible=!1),n};pe.prototype._removeLayer=function(e){let t=this._layers[e];t&&(delete this._layers[e],Ce(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(Ub(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),ce(i).add(t)):(e.markers.delete(t),ce(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=Xb[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){Re(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),Ne(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);li(t,u)});else return o=this._rootElement?this.getActiveLayer():null,r=o&&o.getBBox()||{},a=li(t),i=a?a.matrix:fd(),s=pc(i.a,1e3),c=pc(-i.e||0,1e3),p=pc(-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=S({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Nd(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=we(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=S(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),Nd(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 to="data-element-id";function jt(e){this._elements={},this._eventBus=e}jt.$inject=["eventBus"];jt.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),H(t,to,r),n&&H(n,to,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}};jt.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&(H(r.gfx,to,""),r.secondaryGfx&&H(r.secondaryGfx,to,""),delete t[n])};jt.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)};jt.prototype.updateGraphics=function(e,t,n){var r=e.id||e,i=this._elements[r];return n?i.secondaryGfx=t:i.gfx=t,t&&H(t,to,r),t};jt.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&H(e,to);var n=this._elements[t];return n&&n.element};jt.prototype.filter=function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(n)}),t};jt.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),r=0;r in ref");t=this.props[t]}t.collection?Od(this,t,e):eE(this,t,e)};tn.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Qb(n)||Od(this,t,e),n};tn.prototype.ensureBound=function(e,t){Jb(e,t)||this.bind(e,t)};tn.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)};tn.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var hl=new tn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Id=new tn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Bd=new tn({name:"attachers",collection:!0},{name:"host"}),Ld=new tn({name:"outgoing",collection:!0},{name:"source"}),jd=new tn({name:"incoming",collection:!0},{name:"target"});function no(){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)}}),hl.bind(this,"parent"),Id.bind(this,"labels"),Ld.bind(this,"outgoing"),jd.bind(this,"incoming")}function _a(){no.call(this),hl.bind(this,"children"),Bd.bind(this,"host"),Bd.bind(this,"attachers")}N(_a,no);function Fd(){no.call(this),hl.bind(this,"children")}N(Fd,_a);function Hd(){_a.call(this),Id.bind(this,"labelTarget")}N(Hd,_a);function $d(){no.call(this),Ld.bind(this,"source"),jd.bind(this,"target")}N($d,no);var tE={connection:$d,shape:_a,label:Hd,root:Fd};function zd(e,t){var n=tE[e];if(!n)throw new Error("unknown type: <"+e+">");return S(new n,t)}function Vd(e){return e instanceof no}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=S({},t||{}),t.id||(t.id=e+"_"+this._uid++),zd(e,t)};var uc="__fn",Wd=1e3,nE=Array.prototype.slice;function Dt(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}Dt.prototype.on=function(e,t,n,r){if(e=U(e)?e:[e],Le(t)&&(r=n,n=t,t=Wd),!te(t))throw new Error("priority must be a number");var i=n;r&&(i=nt(n,r),i[uc]=n[uc]||n);var o=this;e.forEach(function(a){o._addListener(a,{priority:t,callback:i,next:null})})};Dt.prototype.once=function(e,t,n,r){var i=this;if(Le(t)&&(r=n,n=t,t=Wd),!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[uc]=n,this.on(e,t,o)};Dt.prototype.off=function(e,t){e=U(e)?e:[e];var n=this;e.forEach(function(r){n._removeListener(r,t)})};Dt.prototype.createEvent=function(e){var t=new xa;return t.init(e),t};Dt.prototype.fire=function(e,t){var n,r,i,o;if(o=nE.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 xa?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}};Dt.prototype.handleError=function(e){return this.fire("error",{error:e})===!1};Dt.prototype._destroy=function(){this._listeners={}};Dt.prototype._invokeListeners=function(e,t,n){for(var r;n&&!e.cancelBubble;)r=this._invokeListener(e,t,n),n=n.next;return r};Dt.prototype._invokeListener=function(e,t,n){var r;if(n.callback.__isTomb)return r;try{r=rE(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};Dt.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 nn(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}nn.prototype.build=function(){return dt(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])};nn.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)};nn.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};nn.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,i=t.split("#"),o=Et(i[0],r),a=Et(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};nn.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};nn.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]};nn.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};nn.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};nn.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)};nn.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")};nn.prototype.hasProperty=function(e){return this.propertiesByName[e]};nn.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,nt(function(o){o=S({},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 Fr(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,E(e,nt(this.registerPackage,this))}Fr.prototype.getPackage=function(e){return this.packageMap[e]};Fr.prototype.getPackages=function(){return this.packages};Fr.prototype.registerPackage=function(e){e=S({},e);var t=this.packageMap;Yd(t,e,"prefix"),Yd(t,e,"uri"),E(e.types,nt(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)};Fr.prototype.registerType=function(e,t){e=S({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:S(e.meta||{})});var n=Et(e.name,t.prefix),r=n.name,i={};E(e.properties,nt(function(o){var a=Et(o.name,n.prefix),s=a.name;ml(o.type)||(o.type=Et(o.type,a.prefix).name),S(o,{ns:a,name:s}),i[s]=o},this)),S(e,{ns:n,name:r,propertiesByName:i}),E(e.extends,nt(function(o){var a=Et(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};Fr.prototype.mapTypes=function(e,t,n){var r=ml(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(c,p){var u=Et(c,ml(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)};Fr.prototype.getEffectiveDescriptor=function(e){var t=Et(e),n=new nn(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};Fr.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 hi(e){this.model=e}hi.prototype.set=function(e,t,n){if(!rt(t)||!t.length)throw new TypeError("property name must be a non-empty string");var r=this.getProperty(e,t),i=r&&r.name;sE(n)?r?delete e[i]:delete e.$attrs[gl(t)]:r?i in e?e[i]=n:Zd(e,r,n):e.$attrs[gl(t)]=n};hi.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[gl(t)];var r=n.name;return!e[r]&&n.isMany&&Zd(e,n,[]),e[r]};hi.prototype.define=function(e,t,n){if(!n.writable){var r=n.value;n=S({},n,{get:function(){return r}}),delete n.value}Object.defineProperty(e,t,n)};hi.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})};hi.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})};hi.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 sE(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 gl(e){return e.replace(/^:/,"")}function Kt(e,t={}){this.properties=new hi(this),this.factory=new qd(this,this.properties),this.registry=new Fr(e,this.properties),this.typeCache={},this.config=t}Kt.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)};Kt.prototype.getType=function(e){var t=this.typeCache,n=rt(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r};Kt.prototype.createAny=function(e,t,n){var r=Et(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){Pe(a)&&a.value!==void 0?i[a.name]=a.value:i[s]=a}),i};Kt.prototype.getPackage=function(e){return this.registry.getPackage(e)};Kt.prototype.getPackages=function(){return this.registry.getPackages()};Kt.prototype.getElementDescriptor=function(e){return e.$descriptor};Kt.prototype.hasType=function(e,t){t===void 0&&(t=e,e=this);var n=e.$model.getElementDescriptor(e);return t in n.allTypesByName};Kt.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]};Kt.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var Qd=String.fromCharCode,cE=Object.prototype.hasOwnProperty,pE=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,ba={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(ba).forEach(function(e){ba[e.toUpperCase()]=ba[e]});function uE(e,t,n,r){return r?cE.call(ba,r)?ba[r]:"&"+r+";":Qd(t||parseInt(n,16))}function mi(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(pE,uE):e}var Jd="non-whitespace outside of root node";function io(e){return new Error(e)}function eh(e){return"missing namespace for prefix <"+e+">"}function dc(e){return{get:e,enumerable:!0}}function lE(e){var t={},n;for(n in e)t[n]=e[n];return t}function _l(e){return e+"$uri"}function fE(e){var t={},n,r;for(n in e)r=e[n],t[r]=r,t[_l(r)]=n;return t}function th(){return{line:0,column:0}}function dE(e){throw e}function xl(e){if(!this)return new xl(e);var t=e&&e.proxy,n,r,i,o,a=dE,s,c,p,u,l=th,f=!1,d=!1,h=null,y=!1,v;function w(x){x instanceof Error||(x=io(x)),h=x,a(x,l)}function R(x){s&&(x instanceof Error||(x=io(x)),s(x,l))}this.on=function(x,C){if(typeof C!="function")throw io("required args ");switch(x){case"openTag":r=C;break;case"text":n=C;break;case"closeTag":i=C;break;case"error":a=C;break;case"warn":s=C;break;case"cdata":o=C;break;case"attention":u=C;break;case"question":p=C;break;case"comment":c=C;break;default:throw io("unsupported event: "+x)}return this},this.ns=function(x){if(typeof x=="undefined"&&(x={}),typeof x!="object")throw io("required args ");var C={},P;for(P in x)C[P]=x[P];return d=!0,v=C,this},this.parse=function(x){if(typeof x!="string")throw io("required args ");return h=null,b(x),l=th,y=!1,h},this.stop=function(){y=!0};function b(x){var C=d?[]:null,P=d?fE(v):null,O,T=[],B=0,I=!1,W=!1,$=0,K=0,he,Gt,De,ge,de,Ee,Be,Ke,F,z="",ie=0,xe;function Bt(){if(xe!==null)return xe;var _,g,M,D=d&&P.xmlns,j=d&&f?[]:null,V=ie,oe=z,ye=oe.length,at,tt,yt,fn,Oe,sr={},Zs={},en,fe,Ae;e:for(;V8)){for((fe<65||fe>122||fe>90&&fe<97)&&fe!==95&&fe!==58&&(R("illegal first char attribute name"),en=!0),Ae=V+1;Ae96&&fe<123||fe>64&&fe<91||fe>47&&fe<59||fe===46||fe===45||fe===95)){if(fe===32||fe<14&&fe>8){R("missing attribute value"),V=Ae;continue e}if(fe===61)break;R("illegal attribute name char"),en=!0}if(Oe=oe.substring(V,Ae),Oe==="xmlns:xmlns"&&(R("illegal declaration of xmlns"),en=!0),fe=oe.charCodeAt(Ae+1),fe===34)Ae=oe.indexOf('"',V=Ae+2),Ae===-1&&(Ae=oe.indexOf("'",V),Ae!==-1&&(R("attribute value quote missmatch"),en=!0));else if(fe===39)Ae=oe.indexOf("'",V=Ae+2),Ae===-1&&(Ae=oe.indexOf('"',V),Ae!==-1&&(R("attribute value quote missmatch"),en=!0));else for(R("missing attribute value quotes"),en=!0,Ae=Ae+1;Ae8));Ae++);for(Ae===-1&&(R("missing closing quotes"),Ae=ye,en=!0),en||(yt=oe.substring(V,Ae)),V=Ae;Ae+18));Ae++)V===Ae&&(R("illegal character after attribute end"),en=!0);if(V=Ae+1,en)continue e;if(Oe in Zs){R("attribute <"+Oe+"> already defined");continue}if(Zs[Oe]=!0,!d){sr[Oe]=yt;continue}if(f){if(tt=Oe==="xmlns"?"xmlns":Oe.charCodeAt(0)===120&&Oe.substr(0,6)==="xmlns:"?Oe.substr(6):null,tt!==null){if(_=mi(yt),g=_l(tt),fn=v[_],!fn){if(tt==="xmlns"||g in P&&P[g]!==_)do fn="ns"+B++;while(typeof P[fn]!="undefined");else fn=tt;v[_]=fn}P[tt]!==fn&&(at||(P=lE(P),at=!0),P[tt]=fn,tt==="xmlns"&&(P[_l(fn)]=_,D=fn),P[g]=_),sr[Oe]=yt;continue}j.push(Oe,yt);continue}if(fe=Oe.indexOf(":"),fe===-1){sr[Oe]=yt;continue}if(!(M=P[Oe.substring(0,fe)])){R(eh(Oe.substring(0,fe)));continue}Oe=D===M?Oe.substr(fe+1):M+Oe.substr(fe),sr[Oe]=yt}if(f)for(V=0,ye=j.length;V=D&&(V=_.exec(x),!(!V||(j=V[0].length+V.index,j>$)));)g+=1,D=j;return $==-1?(M=j,oe=x.substring(K)):K===0?oe=x.substring(K,$):(M=$-D,oe=K==-1?x.substring($):x.substring($,K+1)),{data:oe,line:g,column:M}}for(l=A,t&&(F=Object.create({},{name:dc(function(){return Be}),originalName:dc(function(){return Ke}),attrs:dc(Bt),ns:dc(function(){return P})}));K!==-1;){if(x.charCodeAt(K)===60?$=K:$=x.indexOf("<",K),$===-1){if(T.length)return w("unexpected end of file");if(K===0)return w("missing start tag");K",$),K===-1)return w("unclosed cdata");if(o&&(o(x.substring($+9,K),l),y))return;K+=3;continue}if(De===45&&x.charCodeAt($+3)===45){if(K=x.indexOf("-->",$),K===-1)return w("unclosed comment");if(c&&(c(x.substring($+4,K),mi,l),y))return;K+=3;continue}}if(ge===63){if(K=x.indexOf("?>",$),K===-1)return w("unclosed question");if(p&&(p(x.substring($,K+2),l),y))return;K+=2;continue}for(he=$+1;;he++){if(de=x.charCodeAt(he),isNaN(de))return K=-1,w("unclosed tag");if(de===34)De=x.indexOf('"',he+1),he=De!==-1?De:he;else if(de===39)De=x.indexOf("'",he+1),he=De!==-1?De:he;else if(de===62){K=he;break}}if(ge===33){if(u&&(u(x.substring($,K+1),mi,l),y))return;K+=1;continue}if(xe={},ge===47){if(I=!1,W=!0,!T.length)return w("missing open tag");if(he=Be=T.pop(),De=$+2+he.length,x.substring($+2,De)!==he)return w("closing tag mismatch");for(;De8&&ge<14))return w("close tag")}else{if(x.charCodeAt(K-1)===47?(he=Be=x.substring($+1,K-1),I=!0,W=!0):(he=Be=x.substring($+1,K),I=!0,W=!1),!(ge>96&&ge<123||ge>64&&ge<91||ge===95||ge===58))return w("illegal first char nodeName");for(De=1,Gt=he.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){Be=he.substring(0,De),xe=null;break}return w("invalid nodeName")}W||T.push(Be)}if(d){if(O=P,I&&(W||C.push(O),xe===null&&(f=he.indexOf("xmlns",De)!==-1)&&(ie=De,z=he,Bt(),f=!1)),Ke=Be,ge=Be.indexOf(":"),ge!==-1){if(Ee=P[Be.substring(0,ge)],!Ee)return w("missing namespace on <"+Ke+">");Be=Be.substr(ge+1)}else Ee=P.xmlns;Ee&&(Be=Ee+":"+Be)}if(I&&(ie=De,z=he,r&&(t?r(F,mi,W,l):r(Be,Bt,mi,W,l),y)))return;if(W){if(i&&(i(t?F:Be,mi,I,l),y))return;d&&(I?P=O:P=C.pop())}K+=1}}}function nh(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var bl={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 hE(e){let t=ih(e);return t!==rh&&(t||null)}function mE(e){return e.charAt(0).toUpperCase()+e.slice(1)}function oh(e,t){return nh(t)?e.prefix+":"+mE(e.localName):e.name}function gE(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 vE(e,t,n){let r=Et(e,t.xmlns),i=`${t[r.prefix]||r.prefix}:${r.localName}`,o=Et(i);var a=n.getPackage(o.prefix);return gE(o,a)}function Hr(e){return new Error(e)}function ur(e){return e.$descriptor}function yE(e){S(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw Hr("expected element");var n=this.elementsById,r=ur(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 Hr("duplicate ID <"+o+">");n[o]=t}},this.addWarning=function(t){this.warnings.push(t)}}function Ea(){}Ea.prototype.handleEnd=function(){};Ea.prototype.handleText=function(){};Ea.prototype.handleNode=function(){};function El(){}El.prototype=Object.create(Ea.prototype);El.prototype.handleNode=function(){return this};function ao(){}ao.prototype=Object.create(Ea.prototype);ao.prototype.handleText=function(e){this.body=(this.body||"")+e};function wa(e,t){this.property=e,this.context=t}wa.prototype=Object.create(ao.prototype);wa.prototype.handleNode=function(e){if(this.element)throw Hr("expected no sub nodes");return this.element=this.createReference(e),this};wa.prototype.handleEnd=function(){this.element.id=this.body};wa.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}};function wl(e,t){this.element=t,this.propertyDesc=e}wl.prototype=Object.create(ao.prototype);wl.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=fc(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)};function hc(){}hc.prototype=Object.create(ao.prototype);hc.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 kt(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}kt.prototype=Object.create(hc.prototype);kt.prototype.addReference=function(e){this.context.addReference(e)};kt.prototype.handleText=function(e){var t=this.element,n=ur(t),r=n.bodyProperty;if(!r)throw Hr("unexpected body text <"+e+">");ao.prototype.handleText.call(this,e)};kt.prototype.handleEnd=function(){var e=this.body,t=this.element,n=ur(t),r=n.bodyProperty;r&&e!==void 0&&(e=fc(r.type,e),t.set(r.name,e))};kt.prototype.createElement=function(e){var t=e.attributes,n=this.type,r=ur(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=fc(u.type,c):p==="xmlns"?p=":"+p:(s=Et(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};kt.prototype.getPropertyForNode=function(e){var t=e.name,n=Et(t),r=this.type,i=this.model,o=ur(r),a=n.name,s=o.propertiesByName[a];if(s&&!s.isAttr){let p=hE(s);if(p){let u=e.attributes[p];if(u){let l=vE(u,e.ns,i),f=i.getType(l);return S({},s,{effectiveType:ur(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 S({},s,{effectiveType:ur(u).name})}else if(s=ne(o.properties,function(p){return!p.isReference&&!p.isAttribute&&p.type==="Element"}),s)return s;throw Hr("unrecognized element <"+n.name+">")};kt.prototype.toString=function(){return"ElementDescriptor["+ur(this.type).name+"]"};kt.prototype.valueHandler=function(e,t){return new wl(e,t)};kt.prototype.referenceHandler=function(e){return new wa(e,this.context)};kt.prototype.handler=function(e){return e==="Element"?new oo(this.model,e,this.context):new kt(this.model,e,this.context)};kt.prototype.handleChild=function(e){var t,n,r,i;if(t=this.getPropertyForNode(e),r=this.element,n=t.effectiveType||t.type,yl(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?(S(o,{element:r}),this.context.addReference(o)):o.$parent=r),i};function Sl(e,t,n){kt.call(this,e,t,n)}Sl.prototype=Object.create(kt.prototype);Sl.prototype.createElement=function(e){var t=e.name,n=Et(t),r=this.model,i=this.type,o=r.getPackage(n.prefix),a=o&&oh(n,o)||t;if(!i.hasType(a))throw Hr("unexpected element <"+e.originalName+">");return kt.prototype.createElement.call(this,e)};function oo(e,t,n){this.model=e,this.context=n}oo.prototype=Object.create(hc.prototype);oo.prototype.createElement=function(e){var t=e.name,n=Et(t),r=n.prefix,i=e.ns[r+"$uri"],o=e.attributes;return this.model.createAny(t,i,o)};oo.prototype.handleChild=function(e){var t=new oo(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};oo.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function mc(e){e instanceof Kt&&(e={model:e}),S(this,{lax:!1},e)}mc.prototype.fromXML=function(e,t,n){var r=t.rootHandler;t instanceof kt?(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 yE(S({},t,{rootHandler:r})),s=new xl({proxy:!0}),c=_E();r.context=a,c.push(r);function p(C,P,O){var T=P(),B=T.line,I=T.column,W=T.data;W.charAt(0)==="<"&&W.indexOf(" ")!==-1&&(W=W.slice(0,W.indexOf(" "))+">");var $="unparsable content "+(W?W+" ":"")+`detected - line: `+B+` - column: `+I+` - nested error: `+C.message;if(O)return a.addWarning({message:$,error:C}),!0;throw Hr($)}function u(C,P){return p(C,P,!0)}function l(){var C=a.elementsById,P=a.references,O,T;for(O=0;T=P[O];O++){var B=T.element,I=C[T.id],W=ur(B).propertiesByName[T.property];if(I||a.addWarning({message:"unresolved reference <"+T.id+">",element:T.element,property:T.property,value:T.id}),W.isMany){var $=B.get(W.name),K=$.indexOf(T);K===-1&&(K=$.length),I?$[K]=I:$.splice(K,1)}else B.set(W.name,I)}}function f(){c.pop().handleEnd()}var d=/^<\?xml /i,h=/ encoding="([^"]+)"/i,y=/^utf-8$/i;function v(C){if(d.test(C)){var P=h.exec(C),O=P&&P[1];!O||y.test(O)||a.addWarning({message:"unsupported document encoding <"+O+">, falling back to UTF-8"})}}function w(C,P){var O=c.peek();try{c.push(O.handleNode(C))}catch(T){p(T,P,o)&&c.push(new El)}}function R(C,P){try{c.peek().handleText(C)}catch(O){u(O,P)}}function b(C,P){C.trim()&&R(C,P)}var x=i.getPackages().reduce(function(C,P){return C[P.uri]=P.prefix,C},Object.entries(bl).reduce(function(C,[P,O]){return C[O]=P,C},i.config&&i.config.nsMap||{}));return s.ns(x).on("openTag",function(C,P,O,T){var B=C.attrs||{},I=Object.keys(B).reduce(function($,K){var he=P(B[K]);return $[K]=he,$},{}),W={name:C.name,originalName:C.originalName,attributes:I,ns:C.ns};w(W,T)}).on("question",v).on("closeTag",f).on("cdata",R).on("text",function(C,P,O){b(P(C),O)}).on("error",p).on("warn",u),new Promise(function(C,P){var O;try{s.parse(e),l()}catch($){O=$}var T=r.element;!O&&!T&&(O=Hr("failed to parse document as <"+r.type.$descriptor.name+">"));var B=a.warnings,I=a.references,W=a.elementsById;return O?(O.warnings=B,P(O)):C({rootElement:T,elementsById:W,references:I,warnings:B})})};mc.prototype.handler=function(e){return new Sl(this.model,e)};function _E(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}var xE=` -`,bE=/<|>|'|"|&|\n\r|\n/g,ah=/<|>|&/g;function Un(e){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=e,this.defaultPrefixMap=e&&e.defaultPrefixMap||{}}Un.prototype.mapDefaultPrefixes=function(e){this.defaultPrefixMap=e};Un.prototype.defaultUriByPrefix=function(e){return this.defaultPrefixMap[e]};Un.prototype.byUri=function(e){return this.uriMap[e]||this.parent&&this.parent.byUri(e)};Un.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)};Un.prototype.uriByPrefix=function(e){return this.prefixMap[e||"xmlns"]||this.parent&&this.parent.uriByPrefix(e)};Un.prototype.mapPrefix=function(e,t){this.prefixMap[e||"xmlns"]=t};Un.prototype.getNSKey=function(e){return e.prefix!==void 0?e.uri+"|"+e.prefix:e.uri};Un.prototype.logUsed=function(e){var t=e.uri,n=this.getNSKey(e);this.used[n]=this.byUri(t),this.parent&&this.parent.logUsed(e)};Un.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 EE(e){return e.charAt(0).toLowerCase()+e.slice(1)}function wE(e,t){return nh(t)?EE(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 rt(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function SE(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 CE(e,t){return t.isGeneric?S({localName:t.ns.localName},e):S({localName:wE(t.ns.localName,t.$pkg)},e)}function RE(e,t){return S({localName:t.ns.localName},e)}function AE(e){var t=e.$descriptor;return Q(t.properties,function(n){var r=n.name;if(n.isVirtual||!ft(e,r))return!1;var i=e[r];return i===n.default||i===null?!1:n.isMany?i.length:!0})}var PE={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},TE={"<":"lt",">":"gt","&":"amp"};function ph(e,t,n){return e=rt(e)?e:""+e,e.replace(t,function(r){return"&"+n[r]+";"})}function ME(e){return ph(e,bE,PE)}function DE(e){return ph(e,ah,TE)}function kE(e){return Q(e,function(t){return t.isAttr})}function NE(e){return Q(e,function(t){return!t.isAttr})}function Cl(e){this.tagName=e}Cl.prototype.build=function(e){return this.element=e,this};Cl.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"").appendNewLine()};function gi(){}gi.prototype.serializeValue=gi.prototype.serializeTo=function(e){e.append(this.escape?DE(this.value):this.value)};gi.prototype.build=function(e,t){return this.value=t,e.type==="String"&&t.search(ah)!==-1&&(this.escape=!0),this};function Rl(e){this.tagName=e}sh(Rl,gi);Rl.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("").appendNewLine()};function We(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}We.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=AE(e),this.parseAttributes(kE(i)),this.parseContainments(NE(i))),this.parseGenericAttributes(e,r),this};We.prototype.nsTagName=function(e){var t=this.logNamespaceUsed(e.ns);return CE(t,e)};We.prototype.nsPropertyTagName=function(e){var t=this.logNamespaceUsed(e.ns);return RE(t,e)};We.prototype.isLocalNs=function(e){return e.uri===this.ns.uri};We.prototype.nsAttributeName=function(e){var t;if(rt(e)?t=Et(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}:S({localName:t.localName},n)};We.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}))};We.prototype.parseGenericContainments=function(e){var t=e.$body;t&&this.body.push(new gi().build({type:"String"},t));var n=e.$children;n&&E(n,r=>{this.body.push(new We(this).build(r))})};We.prototype.parseNsAttribute=function(e,t,n){var r=e.$model,i=Et(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)}};We.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};We.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)}})};We.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 gi().build(i,o[0]));else if(yl(i.type))E(o,function(p){n.push(new Rl(t.addTagName(t.nsPropertyTagName(i))).build(i,p))});else if(a)E(o,function(p){n.push(new Cl(t.addTagName(t.nsPropertyTagName(i))).build(p))});else{var c=ih(i);E(o,function(p){var u;c?c===rh?u=new We(t,i):u=new gc(t,i,c):u=new We(t),n.push(u.build(p))})}})};We.prototype.getNamespaces=function(e){var t=this.namespaces,n=this.parent,r;return t||(r=n&&n.getNamespaces(),e||!r?this.namespaces=t=new Un(r):t=r),t};We.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};We.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};We.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)})};We.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),ch(e)};We.prototype.addAttribute=function(e,t){var n=this.attrs;rt(t)&&(t=ME(t));var r=Qs(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)};We.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=SE(n).concat(t)),E(t,function(r){e.append(" ").append(ch(r.name)).append('="').append(r.value).append('"')})};We.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==gi;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 gc(e,t,n){We.call(this,e,t),this.serialization=n}sh(gc,We);gc.prototype.parseNsAttributes=function(e){var t=We.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};gc.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri};function OE(){this.value="",this.write=function(e){this.value+=e}}function BE(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=S({format:!1,preamble:!0},e||{});function t(n,r){var i=r||new OE,o=new BE(i,e.format);e.preamble&&o.append(xE);var a=new We,s=n.$model;if(a.getNamespaces().mapDefaultPrefixes(IE(s)),a.build(n).serializeTo(o),!r)return i.value}return{toXML:t}}function IE(e){let t=e.config&&e.config.nsMap||{},n={};for(let r in bl)n[r]=bl[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 vc(e,t){Kt.call(this,e,t)}vc.prototype=Object.create(Kt.prototype);vc.prototype.fromXML=function(e,t,n){rt(t)||(n=t,t="bpmn:Definitions");var r=new mc(S({model:this,lax:!0},n)),i=r.handler(t);return r.fromXML(e,i)};vc.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 LE="BPMN20",jE="http://www.omg.org/spec/BPMN/20100524/MODEL",FE="bpmn",HE=[],$E=[{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"}]}],zE=[{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"}]}],VE={tagAlias:"lowerCase",typePrefix:"t"},WE={name:LE,uri:jE,prefix:FE,associations:HE,types:$E,enumerations:zE,xml:VE},GE="BPMNDI",UE="http://www.omg.org/spec/BPMN/20100524/DI",KE="bpmndi",YE=[{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"]}],qE=[{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"}]}],XE=[],ZE={name:GE,uri:UE,prefix:KE,types:YE,enumerations:qE,associations:XE},QE="DC",JE="http://www.omg.org/spec/DD/20100524/DC",e0="dc",t0=[{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}]}],n0=[],r0={name:QE,uri:JE,prefix:e0,types:t0,associations:n0},i0="DI",o0="http://www.omg.org/spec/DD/20100524/DI",a0="di",s0=[{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"}]}],c0=[],p0={tagAlias:"lowerCase"},u0={name:i0,uri:o0,prefix:a0,types:s0,associations:c0,xml:p0},l0="bpmn.io colors for BPMN",f0="http://bpmn.io/schema/bpmn/biocolor/1.0",d0="bioc",h0=[{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"}]}],m0=[],g0=[],v0={name:l0,uri:f0,prefix:d0,types:h0,enumerations:m0,associations:g0},y0="BPMN in Color",_0="http://www.omg.org/spec/BPMN/non-normative/color/1.0",x0="color",b0=[{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"}]}],E0=[],w0=[],S0={name:y0,uri:_0,prefix:x0,types:b0,enumerations:E0,associations:w0},C0={bpmn:WE,bpmndi:ZE,dc:r0,di:u0,bioc:v0,color:S0};function lh(e,t){let n=S({},C0,e);return new vc(n,t)}function _t(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':""}function Ht(e,t){return e.$instanceOf(t)}function R0(e){return ne(e.rootElements,function(t){return Ht(t,"bpmn:Process")||Ht(t,"bpmn:Collaboration")})}function Al(e){var t={},n=[],r={};function i(F,z){return function(ie){F(ie,z)}}function o(F){t[F.id]=F}function a(F){return t[F.id]}function s(F,z){var ie=F.gfx;if(ie)throw new Error(`already rendered ${_t(F)}`);return e.element(F,r[F.id],z)}function c(F,z){return e.root(F,r[F.id],z)}function p(F,z){try{var ie=r[F.id]&&s(F,z);return o(F),ie}catch(xe){u(xe.message,{element:F,error:xe}),console.error(`failed to import ${_t(F)}`,xe)}}function u(F,z){e.error(F,z)}var l=this.registerDi=function(z){var ie=z.bpmnElement;ie?r[ie.id]?u(`multiple DI elements defined for ${_t(ie)}`,{element:ie}):r[ie.id]=z:u(`no bpmnElement referenced in ${_t(z)}`,{element:z})};function f(F){d(F.plane)}function d(F){l(F),E(F.planeElement,h)}function h(F){l(F)}this.handleDefinitions=function(z,ie){var xe=z.diagrams;if(ie&&xe.indexOf(ie)===-1)throw new Error("diagram not part of ");if(!ie&&xe&&xe.length&&(ie=xe[0]),!ie)throw new Error("no diagram to display");r={},f(ie);var Bt=ie.plane;if(!Bt)throw new Error(`no plane for ${_t(ie)}`);var A=Bt.bpmnElement;if(!A)if(A=R0(z),A)u(`correcting missing bpmnElement on ${_t(Bt)} to ${_t(A)}`),Bt.bpmnElement=A,l(Bt);else throw new Error("no process or collaboration to display");var _=c(A,Bt);if(Ht(A,"bpmn:Process")||Ht(A,"bpmn:SubProcess"))v(A,_);else if(Ht(A,"bpmn:Collaboration"))Be(A,_),w(z.rootElements,_);else throw new Error(`unsupported bpmnElement for ${_t(Bt)}: ${_t(A)}`);y(n)};var y=this.handleDeferred=function(){for(var z;n.length;)z=n.shift(),z()};function v(F,z){ge(F,z),B(F.ioSpecification,z),T(F.artifacts,z),o(F)}function w(F,z){var ie=Q(F,function(xe){return!a(xe)&&Ht(xe,"bpmn:Process")&&xe.laneSets});ie.forEach(i(v,z))}function R(F,z){p(F,z)}function b(F,z){E(F,i(R,z))}function x(F,z){p(F,z)}function C(F,z){p(F,z)}function P(F,z){p(F,z)}function O(F,z){p(F,z)}function T(F,z){E(F,function(ie){Ht(ie,"bpmn:Association")?n.push(function(){O(ie,z)}):O(ie,z)})}function B(F,z){F&&(E(F.dataInputs,i(C,z)),E(F.dataOutputs,i(P,z)))}var I=this.handleSubProcess=function(z,ie){ge(z,ie),T(z.artifacts,ie)};function W(F,z){var ie=p(F,z);Ht(F,"bpmn:SubProcess")&&I(F,ie||z),Ht(F,"bpmn:Activity")&&B(F.ioSpecification,z),n.push(function(){E(F.dataInputAssociations,i(x,z)),E(F.dataOutputAssociations,i(x,z))})}function $(F,z){p(F,z)}function K(F,z){p(F,z)}function he(F,z){n.push(function(){var ie=p(F,z);F.childLaneSet&&Gt(F.childLaneSet,ie||z),Ke(F)})}function Gt(F,z){E(F.lanes,i(he,z))}function De(F,z){E(F,i(Gt,z))}function ge(F,z){de(F.flowElements,z),F.laneSets&&De(F.laneSets,z)}function de(F,z){E(F,function(ie){Ht(ie,"bpmn:SequenceFlow")?n.push(function(){$(ie,z)}):Ht(ie,"bpmn:BoundaryEvent")?n.unshift(function(){W(ie,z)}):Ht(ie,"bpmn:FlowNode")?W(ie,z):Ht(ie,"bpmn:DataObject")||(Ht(ie,"bpmn:DataStoreReference")||Ht(ie,"bpmn:DataObjectReference")?K(ie,z):u(`unrecognized flowElement ${_t(ie)} in context ${_t(z&&z.businessObject)}`,{element:ie,context:z}))})}function Ee(F,z){var ie=p(F,z),xe=F.processRef;xe&&v(xe,ie||z)}function Be(F,z){E(F.participants,i(Ee,z)),n.push(function(){b(F.messageFlows,z)}),T(F.artifacts,z)}function Ke(F){E(F.flowNodeRef,function(z){var ie=z.get("lanes");ie&&ie.push(F)})}}function m(e,t){var n=L(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)}function ee(e,t){return It(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(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 Al(l);u=u||p.diagrams&&p.diagrams[0];var d=A0(p,u);if(!d)throw new Error("no diagram to display");E(d,function(y){f.handleDefinitions(p,y)});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 A0(e,t){if(!(!t||!t.plane)){var n=t.plane.bpmnElement,r=n;!m(n,"bpmn:Process")&&!m(n,"bpmn:Collaboration")&&(r=P0(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=Ve(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 P0(e){for(var t=e;t;){if(m(t,"bpmn:Process"))return t;t=t.$parent}}var T0='',Pl=T0,Tl={verticalAlign:"middle"},Ml={color:"#404040"},M0={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},D0={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},k0={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"},N0='
'+Pl+'Web-based tooling for BPMN, DMN and forms powered by bpmn.io.
',Kn;function O0(){Kn=_e(N0),ct(Kn,M0),ct(ve("svg",Kn),Tl),ct(ve(".backdrop",Kn),D0),ct(ve(".notice",Kn),k0),ct(ve(".link",Kn),Ml,{margin:"15px 20px 15px 10px",alignSelf:"center"})}function hh(){Kn||(O0(),ht.bind(Kn,".backdrop","click",function(e){document.body.removeChild(Kn)})),document.body.appendChild(Kn)}function Fe(e){e=S({},I0,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),this._init(this._container,this._moddle,e),j0(this._container)}N(Fe,Gn);Fe.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||[]),yc(s,o),s=B0(s),this._emit("import.done",{error:s,warnings:s.warnings}),s}};Fe.prototype.importDefinitions=async function(t,n){return this._setDefinitions(t),{warnings:(await this.open(n)).warnings}};Fe.prototype.open=async function(t){let n=this._definitions,r=t;if(!n){let o=new Error("no XML imported");throw yc(o,[]),o}if(typeof t=="string"&&(r=L0(n,t),!r)){let o=new Error("BPMNDiagram <"+t+"> not found");throw yc(o,[]),o}try{this.clear()}catch(o){throw yc(o,[]),o}let{warnings:i}=await fh(this,n,r);return{warnings:i}};Fe.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};Fe.prototype.saveSVG=async function(){this._emit("saveSVG.start");let t,n;try{let r=this.get("canvas"),i=r.getActiveLayer(),o=ve(":scope > defs",r._svg),a=il(i),s=o?""+il(o)+"":"",c=i.getBBox();t=` +(()=>{var zE=Object.create;var fc=Object.defineProperty;var GE=Object.getOwnPropertyDescriptor;var VE=Object.getOwnPropertyNames;var WE=Object.getPrototypeOf,UE=Object.prototype.hasOwnProperty;var qE=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var dc=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},KE=(e,t)=>{for(var n in t)fc(e,n,{get:t[n],enumerable:!0})},Xd=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of VE(t))!UE.call(e,i)&&i!==n&&fc(e,i,{get:()=>t[i],enumerable:!(r=GE(t,i))||r.enumerable});return e};var YE=(e,t,n)=>(n=e!=null?zE(WE(e)):{},Xd(t||!e||!e.__esModule?fc(n,"default",{value:e,enumerable:!0}):n,e)),XE=e=>Xd(fc({},"__esModule",{value:!0}),e);var em={};KE(em,{assign:()=>C,bind:()=>tt,debounce:()=>Ca,ensureArray:()=>Qd,every:()=>ln,filter:()=>Q,find:()=>re,findIndex:()=>Sa,flatten:()=>_i,forEach:()=>E,get:()=>o0,groupBy:()=>Vt,has:()=>dt,isArray:()=>q,isDefined:()=>Ue,isFunction:()=>Le,isNil:()=>Yn,isNumber:()=>ne,isObject:()=>Se,isString:()=>st,isUndefined:()=>wn,keys:()=>bi,map:()=>je,matchPattern:()=>Ct,merge:()=>Jd,omit:()=>Nt,pick:()=>mt,reduce:()=>Ge,set:()=>_l,size:()=>vl,some:()=>Lt,sortBy:()=>At,throttle:()=>i0,unionBy:()=>gl,uniqueBy:()=>mc,values:()=>Sn,without:()=>hl});function _i(e){return Array.prototype.concat.apply([],e)}function wn(e){return e===void 0}function Ue(e){return e!==void 0}function Yn(e){return e==null}function q(e){return wa.call(e)==="[object Array]"}function Se(e){return wa.call(e)==="[object Object]"}function ne(e){return wa.call(e)==="[object Number]"}function Le(e){let t=wa.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function st(e){return wa.call(e)==="[object String]"}function Qd(e){if(!q(e))throw new Error("must supply array")}function dt(e,t){return!Yn(e)&&t0.call(e,t)}function re(e,t){let n=hc(t),r;return E(e,function(i,o){if(n(i,o))return r=i,!1}),r}function Sa(e,t){let n=hc(t),r=q(e)?-1:void 0;return E(e,function(i,o){if(n(i,o))return r=o,!1}),r}function Q(e,t){let n=hc(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)?r0:n0;for(let o in e)if(dt(e,o)&&(n=e[o],r=t(n,i(o)),r===!1))return n}function hl(e,t){if(wn(e))return[];Qd(e);let n=hc(t);return e.filter(function(r,i){return!n(r,i)})}function Ge(e,t,n){return E(e,function(r,i){n=t(n,r,i)}),n}function ln(e,t){return!!Ge(e,function(n,r,i){return n&&t(r,i)},!0)}function Lt(e,t){return!!re(e,t)}function je(e,t){let n=[];return E(e,function(r,i){n.push(t(r,i))}),n}function bi(e){return e&&Object.keys(e)||[]}function vl(e){return bi(e).length}function Sn(e){return je(e,t=>t)}function Vt(e,t,n={}){return t=yl(t),E(e,function(r){let i=t(r)||"_",o=n[i];o||(o=n[i]=[]),o.push(r)}),n}function mc(e,...t){e=yl(e);let n={};return E(t,i=>Vt(i,e,n)),je(n,function(i,o){return i[0]})}function At(e,t){t=yl(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 Ct(e){return function(t){return ln(e,function(n,r){return t[r]===n})}}function yl(e){return Le(e)?e:t=>t[e]}function hc(e){return Le(e)?e:t=>t===e}function n0(e){return e}function r0(e){return Number(e)}function Ca(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 i0(e,t){let n=!1;return function(...r){n||(e(...r),n=!0,setTimeout(()=>{n=!1},t))}}function tt(e,t){return e.bind(t)}function C(e,...t){return Object.assign(e,...t)}function _l(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];Ue(a)&&Yn(s)&&(s=r[i]=isNaN(+a)?{}:[]),wn(a)?wn(n)?delete r[i]:r[i]=n:r=s}),e}function o0(e,t,n){let r=e;return E(t,function(i){if(Yn(r))return r=void 0,!1;r=r[i]}),wn(r)?n:r}function mt(e,t){let n={},r=Object(e);return E(t,function(i){i in r&&(n[i]=e[i])}),n}function Nt(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||!Se(n)||E(n,function(r,i){if(i==="__proto__")return;let o=e[i];Se(r)?(Se(o)||(o={}),e[i]=Jd(o,r)):e[i]=r})}),e}var wa,t0,gl,N=qE(()=>{wa=Object.prototype.toString,t0=Object.prototype.hasOwnProperty;gl=mc});var jx=dc((qee,Lx)=>{function vD(e){return["String","Boolean","Integer","Real"].includes(e)}Lx.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&&!vD(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 Hx=dc((Kee,Fx)=>{var gD=jx(),{isArray:yD,isObject:_D,isFunction:bD}=(N(),XE(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&&yD(r)&&(i={...i,path:r}),r&&_D(r)&&(i={...i,...r}),this.messages.push(i)}};Fx.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:bD(i)?i:void 0;if(!a&&!o)throw new Error("no check implemented");return gD(t,{enter:a?s=>a(s,r):void 0,leave:o?s=>o(s,r):void 0}),r.messages}});var Gx=dc((Yee,zx)=>{var xD=Hx(),ED=(e,t)=>e,wD={0:"off",1:"warn",2:"error",3:"info"},SD="rule-error";function On(e){let{config:t={},resolver:n,transformRule:r=ED}=e||{};if(typeof n=="undefined")throw new Error("must provide ");this.config=t,this.resolver=n,this.transformRule=r,this.cachedRules={},this.cachedConfigs={}}zx.exports=On;On.prototype.applyRule=function(t,n){let{config:r,rule:i,category:o,name:a}=n;try{return xD({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:SD}]}};On.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})})};On.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)})};On.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)})};On.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}),{})})};On.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})};On.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=wD[t]||t,{config:n,category:t}};On.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+"/":""}${$x(o)}`,ruleName:a}:{pkg:t,ruleName:a}};On.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+"/":""}${$x(i)}`,configName:o}:{pkg:"bpmnlint",configName:o}};On.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+"/":""}${CD(i)}`};On.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 $x(e){return e==="bpmnlint"?"bpmnlint":e.startsWith("bpmnlint-plugin-")?e:`bpmnlint-plugin-${e}`}function CD(e){return e.startsWith("bpmnlint-plugin-")?e.substring(16):e}});var Wx=dc((Xee,Vx)=>{var RD=Gx();Vx.exports={Linter:RD}});function B(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function ZE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ml={exports:{}},Zd;function QE(){if(Zd)return ml.exports;Zd=1;var e=ml.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},ml.exports}var JE=QE(),e0=ZE(JE);function En(e){if(!(this instanceof En))return new En(e);e=e||[128,36,1],this._seed=e.length?e0.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)};N();N();var ht={legend:[1,"
","
"],tr:[2,"","
"],col:[2,"","
"],_default:[0,"",""]};ht.td=ht.th=[3,"","
"];ht.option=ht.optgroup=[1,'"];ht.thead=ht.tbody=ht.colgroup=ht.caption=ht.tfoot=[1,"","
"];ht.polyline=ht.ellipse=ht.polygon=ht.circle=ht.text=ht.line=ht.path=ht.rect=ht.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(ht,r)?ht[r]:ht._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 a0(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 vt(e,...t){let n=e.style;return E(t,function(r){r&&E(r,function(i,o){n[o]=i})}),e}function nt(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}var s0=Object.prototype.toString;function Ne(e){return new Fr(e)}function Fr(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Fr.prototype.add=function(e){return this.list.add(e),this};Fr.prototype.remove=function(e){return s0.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)};Fr.prototype.removeMatching=function(e){let t=this.array();for(let n=0;n"+e+"",t=!0);var n=g0(e);if(!t)return n;for(var r=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)r.appendChild(i.firstChild);return r}function g0(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(Cl.svg,e),t&&$(n,t),n}var bl=null;function wl(){return bl===null&&(bl=U("svg")),bl}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=wl().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 so(e){return e?wl().createSVGTransformFromMatrix(e):wl().createSVGTransform()}var am=/([&<>]{1})/g,y0=/([&<>\n\r"]{1})/g,_0={"&":"&","<":"<",">":">",'"':"'"};function xl(e,t){function n(r,i){return _0[i]||i}return e.replace(t,n)}function fm(e,t){var n,r,i,o,a;switch(e.nodeType){case 3:t.push(xl(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 b0(e,t){var n=pm(t);if(_r(e),!!t){E0(n)||(n=n.documentElement);for(var r=w0(n.childNodes),i=0;i{let i=r.match(M0);return(i&&i[1]||r).trim()})||[]}function Tl(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 R=x.split("."),A=c(R.shift());for(;R.length;)A=A[R.shift()];return A}if(Pl(o,x))return o[x];if(Pl(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(Al(x))x=gc(x.slice());else throw s(`Cannot invoke "${x}". Expected a function!`);let A=(x.$inject||D0(x)).map(O=>Pl(b,O)?b[O]:c(O));return{fn:x,dependencies:A}}function p(x){let{fn:b,dependencies:R}=u(x),A=Function.prototype.bind.call(b,null,...R);return new A}function l(x,b,R){let{fn:A,dependencies:O}=u(x,R);return A.apply(b,O)}function f(x){return gc(b=>x.get(b))}function d(x,b){if(b&&b.length){let R=Object.create(null),A=Object.create(null),O=[],T=[],I=[],L,W,z,K;for(let ve in i)L=i[ve],b.indexOf(ve)!==-1&&(L[2]==="private"?(W=O.indexOf(L[3]),W===-1?(z=L[3].createChild([],b),K=f(z),O.push(L[3]),T.push(z),I.push(K),R[ve]=[K,ve,"private",z]):R[ve]=[I[W],ve,"private",T[W]]):R[ve]=[L[2],L[1]],A[ve]=!0),(L[2]==="factory"||L[2]==="type")&&L[1].$scope&&b.forEach(Jt=>{L[1].$scope.indexOf(Jt)!==-1&&(R[ve]=[L[2],L[1]],A[Jt]=!0)});b.forEach(ve=>{if(!A[ve])throw new Error('No provider for "'+ve+'". Cannot use provider from the parent!')}),x.unshift(R)}return new Tl(x,a)}let m={factory:l,type:p,value:function(x){return x}};function g(x,b){let R=x.__init__||[];return function(){R.forEach(A=>{typeof A=="string"?b.get(A):b.invoke(A)})}}function v(x){let b=x.__exports__;if(b){let R=x.__modules__,A=Object.keys(x).reduce((W,z)=>(z!=="__exports__"&&z!=="__modules__"&&z!=="__init__"&&z!=="__depends__"&&(W[z]=x[z]),W),Object.create(null)),O=(R||[]).concat(A),T=d(O),I=gc(function(W){return T.get(W)});b.forEach(function(W){i[W]=[I,W,"private",T]});let L=(x.__init__||[]).slice();return L.unshift(function(){T.init()}),x=Object.assign({},x,{__init__:L}),g(x,T)}return Object.keys(x).forEach(function(R){if(R==="__init__"||R==="__depends__")return;let A=x[R];if(A[2]==="private"){i[R]=A;return}let O=A[0],T=A[1];i[R]=[m[O],k0(O,T),O]}),g(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 S(x){let b=x.reduce(w,[]).map(v),R=!1;return function(){R||(R=!0,b.forEach(A=>A()))}}this.get=c,this.invoke=l,this.instantiate=p,this.createChild=d,this.init=S(e)}function k0(e,t){return e!=="value"&&Al(t)&&(t=gc(t.slice())),t}var N0=1e3;function Cn(e,t){var n=this;t=t||N0,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)})}Cn.prototype.canRender=function(e){};Cn.prototype.drawShape=function(e,t){};Cn.prototype.drawConnection=function(e,t){};Cn.prototype.getShapePath=function(e){};Cn.prototype.getConnectionPath=function(e){};N();function br(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function O0(e){return["M",e.x,e.y]}function Ml(e){return["L",e.x,e.y]}function B0(e,t,n){return["C",e.x,e.y,t.x,t.y,n.x,n.y]}function I0(e,t){let n=e.length,r=[O0(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 wi(e,t){var n={};return E(e,function(r){var i=r;i.waypoints&&(i=Ce(i)),!ne(t.y)&&i.x>t.x&&(n[r.id]=r),!ne(t.x)&&i.y>t.y&&(n[r.id]=r),i.x>t.x&&i.y>t.y&&(ne(t.width)&&ne(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 U0(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($0,function(r,i,o){var a=[],s=i.toLowerCase();for(o.replace(z0,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=Bl,n}function q0(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 X0(e,t){return e=Ol(e),t=Ol(t),Wr(t,e.x,e.y)||Wr(t,e.x2,e.y)||Wr(t,e.x,e.y2)||Wr(t,e.x2,e.y2)||Wr(e,t.x,t.y)||Wr(e,t.x2,t.y)||Wr(e,t.x,t.y2)||Wr(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;mer(i,a)||er(t,r)er(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=Ec(c/p),f=Ec(u/p),d=+l.toFixed(2),m=+f.toFixed(2);if(!(d<+Jn(e,n).toFixed(2)||d>+er(e,n).toFixed(2)||d<+Jn(i,a).toFixed(2)||d>+er(i,a).toFixed(2)||m<+Jn(t,r).toFixed(2)||m>+er(t,r).toFixed(2)||m<+Jn(o,s).toFixed(2)||m>+er(o,s).toFixed(2)))return{x:l,y:f}}}}function Ec(e){return Math.round(e*1e11)/1e11}function Q0(e,t,n){var r=xm(e),i=xm(t);if(!X0(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&&T<=1&&I>=0&&I<=1&&(n?f++:f.push({x:A.x,y:A.y,t1:T,t2:I}))}}return f}function Da(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,g=e.length;m1&&(w=pt.sqrt(w),n=w*n,r=w*r);var S=n*n,x=r*r,b=(o==a?-1:1)*pt.sqrt(Ur((S*x-S*v*v-x*g*g)/(S*v*v+x*g*g))),R=b*n*v/r+(e+s)/2,A=b*-r*g/n+(t+c)/2,O=pt.asin(((t-A)/r).toFixed(9)),T=pt.asin(((c-A)/r).toFixed(9));O=eT&&(O=O-Vr*2),!a&&T>O&&(T=T-Vr*2)}var I=T-O;if(Ur(I)>p){var L=T,W=s,z=c;T=O+p*(a&&T>O?1:-1),s=R+n*pt.cos(T),c=A+r*pt.sin(T),f=Pm(s,c,n,r,i,0,a,W,z,[T,L,R,A])}I=T-O;var K=pt.cos(O),ve=pt.sin(O),Jt=pt.cos(T),ke=pt.sin(T),ye=pt.tan(I/4),he=4/3*n*ye,we=4/3*r*ye,Ie=[e,t],Ze=[e+he*ve,t-we*K],H=[s+he*ke,c-we*Jt],G=[s,c];if(Ze[0]=2*Ie[0]-Ze[0],Ze[1]=2*Ie[1]-Ze[1],u)return[Ze,H,G].concat(f);f=[Ze,H,G].concat(f).join().split(",");for(var oe=[],xe=0,Gt=f.length;xe7){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 qr(e,t,n){var r=iw(e,t);return r.length===1||r.length===2&&Gr(r[0],r[1])<1?Rn(r[0]):r.length>1?(r=At(r,function(i){var o=Math.floor(i.t2*100)||1;return o=100-o,o=(o<10?"0":"")+o,i.segment2+"#"+o}),Rn(r[n?0:r.length-1])):null}function iw(e,t){return Da(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],Gr(n,i)===0||uo(r,i,n)?e.splice(t,1):t++;return e}function ow(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Sc(e,t){return Math.round(e*t)/t}function Tm(e){return ne(e)?e+"px":e}function aw(e){for(;e.parent;)e=e.parent;return e}function sw(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"),vt(n,{position:"relative",overflow:"hidden",width:Tm(e.width),height:Tm(e.height)}),t.appendChild(n),n}function Mm(e,t,n){let r=U("g");pe(r).add(t);let i=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(r,e.childNodes[i]||null),r}var cw="base",Dm=0,uw=1,pw={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=sw(e),r=this._svg=U("svg");$(r,{width:"100%",height:"100%"}),nt(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")}),J(n,r);let i=this._viewport=Mm(r,"viewport");e.deferUpdate&&(this._viewboxChanged=Ca(tt(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=_c(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(cw,Dm)};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 Ge(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)};le.prototype._createLayer=function(e,t){typeof t=="undefined"&&(t=uw);let n=this._getChildIndex(t);return{group:Mm(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&&(Pe(n),t.visible=!1),n};le.prototype._removeLayer=function(e){let t=this._layers[e];t&&(delete this._layers[e],Pe(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(aw(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),pe(i).add(t)):(e.markers.delete(t),pe(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,Dm);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=pw[e];if(!ln(n,function(i){return typeof t[i]!="undefined"}))throw new Error("must supply { "+n.join(", ")+" } with "+e)};le.prototype._setParent=function(e,t,n){Ae(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),Oe(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);Ei(t,p)});else return o=this._rootElement?this.getActiveLayer():null,r=o&&o.getBBox()||{},a=Ei(t),i=a?a.matrix:lm(),s=Sc(i.a,1e3),c=Sc(-i.e||0,1e3),u=Sc(-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=Ce(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 po="data-element-id";function Ut(e){this._elements={},this._eventBus=e}Ut.$inject=["eventBus"];Ut.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),$(t,po,r),n&&$(n,po,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}};Ut.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&($(r.gfx,po,""),r.secondaryGfx&&$(r.secondaryGfx,po,""),delete t[n])};Ut.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)};Ut.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,po,r),t};Ut.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&$(e,po);var n=this._elements[t];return n&&n.element};Ut.prototype.filter=function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(n)}),t};Ut.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):mw(this,t,e)};fn.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return fw(n)||Nm(this,t,e),n};fn.prototype.ensureBound=function(e,t){dw(e,t)||this.bind(e,t)};fn.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)};fn.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Il=new fn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Bm=new fn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Om=new fn({name:"attachers",collection:!0},{name:"host"}),Im=new fn({name:"outgoing",collection:!0},{name:"source"}),Lm=new fn({name:"incoming",collection:!0},{name:"target"});function lo(){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)}}),Il.bind(this,"parent"),Bm.bind(this,"labels"),Im.bind(this,"outgoing"),Lm.bind(this,"incoming")}function ka(){lo.call(this),Il.bind(this,"children"),Om.bind(this,"host"),Om.bind(this,"attachers")}B(ka,lo);function jm(){lo.call(this),Il.bind(this,"children")}B(jm,ka);function Fm(){ka.call(this),Bm.bind(this,"labelTarget")}B(Fm,ka);function Hm(){lo.call(this),Im.bind(this,"source"),Lm.bind(this,"target")}B(Hm,lo);var hw={connection:Hm,shape:ka,label:Fm,root:jm};function $m(e,t){var n=hw[e];if(!n)throw new Error("unknown type: <"+e+">");return C(new n,t)}function zm(e){return e instanceof lo}N();function Pn(){this._uid=12}Pn.prototype.createRoot=function(e){return this.create("root",e)};Pn.prototype.createLabel=function(e){return this.create("label",e)};Pn.prototype.createShape=function(e){return this.create("shape",e)};Pn.prototype.createConnection=function(e){return this.create("connection",e)};Pn.prototype.create=function(e,t){return t=C({},t||{}),t.id||(t.id=e+"_"+this._uid++),$m(e,t)};N();var Cc="__fn",Gm=1e3,vw=Array.prototype.slice;function jt(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}jt.prototype.on=function(e,t,n,r){if(e=q(e)?e:[e],Le(t)&&(r=n,n=t,t=Gm),!ne(t))throw new Error("priority must be a number");var i=n;r&&(i=tt(n,r),i[Cc]=n[Cc]||n);var o=this;e.forEach(function(a){o._addListener(a,{priority:t,callback:i,next:null})})};jt.prototype.once=function(e,t,n,r){var i=this;if(Le(t)&&(r=n,n=t,t=Gm),!ne(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[Cc]=n,this.on(e,t,o)};jt.prototype.off=function(e,t){e=q(e)?e:[e];var n=this;e.forEach(function(r){n._removeListener(r,t)})};jt.prototype.createEvent=function(e){var t=new Na;return t.init(e),t};jt.prototype.fire=function(e,t){var n,r,i,o;if(o=vw.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 Na?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}};jt.prototype.handleError=function(e){return this.fire("error",{error:e})===!1};jt.prototype._destroy=function(){this._listeners={}};jt.prototype._invokeListeners=function(e,t,n){for(var r;n&&!e.cancelBubble;)r=this._invokeListener(e,t,n),n=n.next;return r};jt.prototype._invokeListener=function(e,t,n){var r;if(n.callback.__isTomb)return r;try{r=gw(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};jt.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 dn(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}dn.prototype.build=function(){return mt(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])};dn.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)};dn.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};dn.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,i=t.split("#"),o=Tt(i[0],r),a=Tt(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};dn.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};dn.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]};dn.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};dn.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};dn.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)};dn.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")};dn.prototype.hasProperty=function(e){return this.propertiesByName[e]};dn.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,tt(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 Kr(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,E(e,tt(this.registerPackage,this))}Kr.prototype.getPackage=function(e){return this.packageMap[e]};Kr.prototype.getPackages=function(){return this.packages};Kr.prototype.registerPackage=function(e){e=C({},e);var t=this.packageMap;qm(t,e,"prefix"),qm(t,e,"uri"),E(e.types,tt(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)};Kr.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=Tt(e.name,t.prefix),r=n.name,i={};E(e.properties,tt(function(o){var a=Tt(o.name,n.prefix),s=a.name;Ll(o.type)||(o.type=Tt(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,tt(function(o){var a=Tt(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};Kr.prototype.mapTypes=function(e,t,n){var r=Ll(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(c,u){var p=Tt(c,Ll(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)};Kr.prototype.getEffectiveDescriptor=function(e){var t=Tt(e),n=new dn(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};Kr.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 Ci(e){this.model=e}Ci.prototype.set=function(e,t,n){if(!st(t)||!t.length)throw new TypeError("property name must be a non-empty string");var r=this.getProperty(e,t),i=r&&r.name;xw(n)?r?delete e[i]:delete e.$attrs[jl(t)]:r?i in e?e[i]=n:Xm(e,r,n):e.$attrs[jl(t)]=n};Ci.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[jl(t)];var r=n.name;return!e[r]&&n.isMany&&Xm(e,n,[]),e[r]};Ci.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)};Ci.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})};Ci.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})};Ci.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 xw(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 jl(e){return e.replace(/^:/,"")}function tn(e,t={}){this.properties=new Ci(this),this.factory=new Km(this,this.properties),this.registry=new Kr(e,this.properties),this.typeCache={},this.config=t}tn.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)};tn.prototype.getType=function(e){var t=this.typeCache,n=st(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r};tn.prototype.createAny=function(e,t,n){var r=Tt(e),i={$type:e,$instanceOf:function(a){return a===this.$type},get:function(a){return this[a]},set:function(a,s){_l(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){Se(a)&&a.value!==void 0?i[a.name]=a.value:i[s]=a}),i};tn.prototype.getPackage=function(e){return this.registry.getPackage(e)};tn.prototype.getPackages=function(){return this.registry.getPackages()};tn.prototype.getElementDescriptor=function(e){return e.$descriptor};tn.prototype.hasType=function(e,t){t===void 0&&(t=e,e=this);var n=e.$model.getElementDescriptor(e);return t in n.allTypesByName};tn.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]};tn.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};N();var Zm=String.fromCharCode,Ew=Object.prototype.hasOwnProperty,ww=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,Oa={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(Oa).forEach(function(e){Oa[e.toUpperCase()]=Oa[e]});function Sw(e,t,n,r){return r?Ew.call(Oa,r)?Oa[r]:"&"+r+";":Zm(t||parseInt(n,16))}function Ri(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(ww,Sw):e}var Qm="non-whitespace outside of root node";function mo(e){return new Error(e)}function Jm(e){return"missing namespace for prefix <"+e+">"}function Ac(e){return{get:e,enumerable:!0}}function Cw(e){var t={},n;for(n in e)t[n]=e[n];return t}function $l(e){return e+"$uri"}function Rw(e){var t={},n,r;for(n in e)r=e[n],t[r]=r,t[$l(r)]=n;return t}function eh(){return{line:0,column:0}}function Pw(e){throw e}function zl(e){if(!this)return new zl(e);var t=e&&e.proxy,n,r,i,o,a=Pw,s,c,u,p,l=eh,f=!1,d=!1,m=null,g=!1,v;function w(b){b instanceof Error||(b=mo(b)),m=b,a(b,l)}function S(b){s&&(b instanceof Error||(b=mo(b)),s(b,l))}this.on=function(b,R){if(typeof R!="function")throw mo("required args ");switch(b){case"openTag":r=R;break;case"text":n=R;break;case"closeTag":i=R;break;case"error":a=R;break;case"warn":s=R;break;case"cdata":o=R;break;case"attention":p=R;break;case"question":u=R;break;case"comment":c=R;break;default:throw mo("unsupported event: "+b)}return this},this.ns=function(b){if(typeof b=="undefined"&&(b={}),typeof b!="object")throw mo("required args ");var R={},A;for(A in b)R[A]=b[A];return d=!0,v=R,this},this.parse=function(b){if(typeof b!="string")throw mo("required args ");return m=null,x(b),l=eh,g=!1,m},this.stop=function(){g=!0};function x(b){var R=d?[]:null,A=d?Rw(v):null,O,T=[],I=0,L=!1,W=!1,z=0,K=0,ve,Jt,ke,ye,he,we,Ie,Ze,H,G="",oe=0,xe;function Gt(){if(xe!==null)return xe;var _,y,M,D=d&&A.xmlns,F=d&&f?[]:null,V=oe,ae=G,be=ae.length,ft,at,St,xn,Be,yr={},lc={},pn,me,Te;e:for(;V8)){for((me<65||me>122||me>90&&me<97)&&me!==95&&me!==58&&(S("illegal first char attribute name"),pn=!0),Te=V+1;Te96&&me<123||me>64&&me<91||me>47&&me<59||me===46||me===45||me===95)){if(me===32||me<14&&me>8){S("missing attribute value"),V=Te;continue e}if(me===61)break;S("illegal attribute name char"),pn=!0}if(Be=ae.substring(V,Te),Be==="xmlns:xmlns"&&(S("illegal declaration of xmlns"),pn=!0),me=ae.charCodeAt(Te+1),me===34)Te=ae.indexOf('"',V=Te+2),Te===-1&&(Te=ae.indexOf("'",V),Te!==-1&&(S("attribute value quote missmatch"),pn=!0));else if(me===39)Te=ae.indexOf("'",V=Te+2),Te===-1&&(Te=ae.indexOf('"',V),Te!==-1&&(S("attribute value quote missmatch"),pn=!0));else for(S("missing attribute value quotes"),pn=!0,Te=Te+1;Te8));Te++);for(Te===-1&&(S("missing closing quotes"),Te=be,pn=!0),pn||(St=ae.substring(V,Te)),V=Te;Te+18));Te++)V===Te&&(S("illegal character after attribute end"),pn=!0);if(V=Te+1,pn)continue e;if(Be in lc){S("attribute <"+Be+"> already defined");continue}if(lc[Be]=!0,!d){yr[Be]=St;continue}if(f){if(at=Be==="xmlns"?"xmlns":Be.charCodeAt(0)===120&&Be.substr(0,6)==="xmlns:"?Be.substr(6):null,at!==null){if(_=Ri(St),y=$l(at),xn=v[_],!xn){if(at==="xmlns"||y in A&&A[y]!==_)do xn="ns"+I++;while(typeof A[xn]!="undefined");else xn=at;v[_]=xn}A[at]!==xn&&(ft||(A=Cw(A),ft=!0),A[at]=xn,at==="xmlns"&&(A[$l(xn)]=_,D=xn),A[y]=_),yr[Be]=St;continue}F.push(Be,St);continue}if(me=Be.indexOf(":"),me===-1){yr[Be]=St;continue}if(!(M=A[Be.substring(0,me)])){S(Jm(Be.substring(0,me)));continue}Be=D===M?Be.substr(me+1):M+Be.substr(me),yr[Be]=St}if(f)for(V=0,be=F.length;V=D&&(V=_.exec(b),!(!V||(F=V[0].length+V.index,F>z)));)y+=1,D=F;return z==-1?(M=F,ae=b.substring(K)):K===0?ae=b.substring(K,z):(M=z-D,ae=K==-1?b.substring(z):b.substring(z,K+1)),{data:ae,line:y,column:M}}for(l=P,t&&(H=Object.create({},{name:Ac(function(){return Ie}),originalName:Ac(function(){return Ze}),attrs:Ac(Gt),ns:Ac(function(){return A})}));K!==-1;){if(b.charCodeAt(K)===60?z=K:z=b.indexOf("<",K),z===-1){if(T.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(b.substring(z+9,K),l),g))return;K+=3;continue}if(ke===45&&b.charCodeAt(z+3)===45){if(K=b.indexOf("-->",z),K===-1)return w("unclosed comment");if(c&&(c(b.substring(z+4,K),Ri,l),g))return;K+=3;continue}}if(ye===63){if(K=b.indexOf("?>",z),K===-1)return w("unclosed question");if(u&&(u(b.substring(z,K+2),l),g))return;K+=2;continue}for(ve=z+1;;ve++){if(he=b.charCodeAt(ve),isNaN(he))return K=-1,w("unclosed tag");if(he===34)ke=b.indexOf('"',ve+1),ve=ke!==-1?ke:ve;else if(he===39)ke=b.indexOf("'",ve+1),ve=ke!==-1?ke:ve;else if(he===62){K=ve;break}}if(ye===33){if(p&&(p(b.substring(z,K+1),Ri,l),g))return;K+=1;continue}if(xe={},ye===47){if(L=!1,W=!0,!T.length)return w("missing open tag");if(ve=Ie=T.pop(),ke=z+2+ve.length,b.substring(z+2,ke)!==ve)return w("closing tag mismatch");for(;ke8&&ye<14))return w("close tag")}else{if(b.charCodeAt(K-1)===47?(ve=Ie=b.substring(z+1,K-1),L=!0,W=!0):(ve=Ie=b.substring(z+1,K),L=!0,W=!1),!(ye>96&&ye<123||ye>64&&ye<91||ye===95||ye===58))return w("illegal first char nodeName");for(ke=1,Jt=ve.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){Ie=ve.substring(0,ke),xe=null;break}return w("invalid nodeName")}W||T.push(Ie)}if(d){if(O=A,L&&(W||R.push(O),xe===null&&(f=ve.indexOf("xmlns",ke)!==-1)&&(oe=ke,G=ve,Gt(),f=!1)),Ze=Ie,ye=Ie.indexOf(":"),ye!==-1){if(we=A[Ie.substring(0,ye)],!we)return w("missing namespace on <"+Ze+">");Ie=Ie.substr(ye+1)}else we=A.xmlns;we&&(Ie=we+":"+Ie)}if(L&&(oe=ke,G=ve,r&&(t?r(H,Ri,W,l):r(Ie,Gt,Ri,W,l),g)))return;if(W){if(i&&(i(t?H:Ie,Ri,L,l),g))return;d&&(L?A=O:A=R.pop())}K+=1}}}function th(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var Gl={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 Aw(e){let t=rh(e);return t!==nh&&(t||null)}function Tw(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ih(e,t){return th(t)?e.prefix+":"+Tw(e.localName):e.name}function Mw(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 Dw(e,t,n){let r=Tt(e,t.xmlns),i=`${t[r.prefix]||r.prefix}:${r.localName}`,o=Tt(i);var a=n.getPackage(o.prefix);return Mw(o,a)}function Yr(e){return new Error(e)}function xr(e){return e.$descriptor}function kw(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 Yr("expected element");var n=this.elementsById,r=xr(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 Yr("duplicate ID <"+o+">");n[o]=t}},this.addWarning=function(t){this.warnings.push(t)}}function Ba(){}Ba.prototype.handleEnd=function(){};Ba.prototype.handleText=function(){};Ba.prototype.handleNode=function(){};function Vl(){}Vl.prototype=Object.create(Ba.prototype);Vl.prototype.handleNode=function(){return this};function vo(){}vo.prototype=Object.create(Ba.prototype);vo.prototype.handleText=function(e){this.body=(this.body||"")+e};function Ia(e,t){this.property=e,this.context=t}Ia.prototype=Object.create(vo.prototype);Ia.prototype.handleNode=function(e){if(this.element)throw Yr("expected no sub nodes");return this.element=this.createReference(e),this};Ia.prototype.handleEnd=function(){this.element.id=this.body};Ia.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}};function Wl(e,t){this.element=t,this.propertyDesc=e}Wl.prototype=Object.create(vo.prototype);Wl.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 Tc(){}Tc.prototype=Object.create(vo.prototype);Tc.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 Ft(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}Ft.prototype=Object.create(Tc.prototype);Ft.prototype.addReference=function(e){this.context.addReference(e)};Ft.prototype.handleText=function(e){var t=this.element,n=xr(t),r=n.bodyProperty;if(!r)throw Yr("unexpected body text <"+e+">");vo.prototype.handleText.call(this,e)};Ft.prototype.handleEnd=function(){var e=this.body,t=this.element,n=xr(t),r=n.bodyProperty;r&&e!==void 0&&(e=Pc(r.type,e),t.set(r.name,e))};Ft.prototype.createElement=function(e){var t=e.attributes,n=this.type,r=xr(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=Pc(p.type,c):u==="xmlns"?u=":"+u:(s=Tt(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};Ft.prototype.getPropertyForNode=function(e){var t=e.name,n=Tt(t),r=this.type,i=this.model,o=xr(r),a=n.name,s=o.propertiesByName[a];if(s&&!s.isAttr){let u=Aw(s);if(u){let p=e.attributes[u];if(p){let l=Dw(p,e.ns,i),f=i.getType(l);return C({},s,{effectiveType:xr(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:xr(p).name})}else if(s=re(o.properties,function(u){return!u.isReference&&!u.isAttribute&&u.type==="Element"}),s)return s;throw Yr("unrecognized element <"+n.name+">")};Ft.prototype.toString=function(){return"ElementDescriptor["+xr(this.type).name+"]"};Ft.prototype.valueHandler=function(e,t){return new Wl(e,t)};Ft.prototype.referenceHandler=function(e){return new Ia(e,this.context)};Ft.prototype.handler=function(e){return e==="Element"?new ho(this.model,e,this.context):new Ft(this.model,e,this.context)};Ft.prototype.handleChild=function(e){var t,n,r,i;if(t=this.getPropertyForNode(e),r=this.element,n=t.effectiveType||t.type,Hl(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 Ul(e,t,n){Ft.call(this,e,t,n)}Ul.prototype=Object.create(Ft.prototype);Ul.prototype.createElement=function(e){var t=e.name,n=Tt(t),r=this.model,i=this.type,o=r.getPackage(n.prefix),a=o&&ih(n,o)||t;if(!i.hasType(a))throw Yr("unexpected element <"+e.originalName+">");return Ft.prototype.createElement.call(this,e)};function ho(e,t,n){this.model=e,this.context=n}ho.prototype=Object.create(Tc.prototype);ho.prototype.createElement=function(e){var t=e.name,n=Tt(t),r=n.prefix,i=e.ns[r+"$uri"],o=e.attributes;return this.model.createAny(t,i,o)};ho.prototype.handleChild=function(e){var t=new ho(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};ho.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function Mc(e){e instanceof tn&&(e={model:e}),C(this,{lax:!1},e)}Mc.prototype.fromXML=function(e,t,n){var r=t.rootHandler;t instanceof Ft?(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 kw(C({},t,{rootHandler:r})),s=new zl({proxy:!0}),c=Nw();r.context=a,c.push(r);function u(R,A,O){var T=A(),I=T.line,L=T.column,W=T.data;W.charAt(0)==="<"&&W.indexOf(" ")!==-1&&(W=W.slice(0,W.indexOf(" "))+">");var z="unparsable content "+(W?W+" ":"")+`detected + line: `+I+` + column: `+L+` + nested error: `+R.message;if(O)return a.addWarning({message:z,error:R}),!0;throw Yr(z)}function p(R,A){return u(R,A,!0)}function l(){var R=a.elementsById,A=a.references,O,T;for(O=0;T=A[O];O++){var I=T.element,L=R[T.id],W=xr(I).propertiesByName[T.property];if(L||a.addWarning({message:"unresolved reference <"+T.id+">",element:T.element,property:T.property,value:T.id}),W.isMany){var z=I.get(W.name),K=z.indexOf(T);K===-1&&(K=z.length),L?z[K]=L:z.splice(K,1)}else I.set(W.name,L)}}function f(){c.pop().handleEnd()}var d=/^<\?xml /i,m=/ encoding="([^"]+)"/i,g=/^utf-8$/i;function v(R){if(d.test(R)){var A=m.exec(R),O=A&&A[1];!O||g.test(O)||a.addWarning({message:"unsupported document encoding <"+O+">, falling back to UTF-8"})}}function w(R,A){var O=c.peek();try{c.push(O.handleNode(R))}catch(T){u(T,A,o)&&c.push(new Vl)}}function S(R,A){try{c.peek().handleText(R)}catch(O){p(O,A)}}function x(R,A){R.trim()&&S(R,A)}var b=i.getPackages().reduce(function(R,A){return R[A.uri]=A.prefix,R},Object.entries(Gl).reduce(function(R,[A,O]){return R[O]=A,R},i.config&&i.config.nsMap||{}));return s.ns(b).on("openTag",function(R,A,O,T){var I=R.attrs||{},L=Object.keys(I).reduce(function(z,K){var ve=A(I[K]);return z[K]=ve,z},{}),W={name:R.name,originalName:R.originalName,attributes:L,ns:R.ns};w(W,T)}).on("question",v).on("closeTag",f).on("cdata",S).on("text",function(R,A,O){x(A(R),O)}).on("error",u).on("warn",p),new Promise(function(R,A){var O;try{s.parse(e),l()}catch(z){O=z}var T=r.element;!O&&!T&&(O=Yr("failed to parse document as <"+r.type.$descriptor.name+">"));var I=a.warnings,L=a.references,W=a.elementsById;return O?(O.warnings=I,A(O)):R({rootElement:T,elementsById:W,references:L,warnings:I})})};Mc.prototype.handler=function(e){return new Ul(this.model,e)};function Nw(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}var Ow=` +`,Bw=/<|>|'|"|&|\n\r|\n/g,oh=/<|>|&/g;function nr(e){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=e,this.defaultPrefixMap=e&&e.defaultPrefixMap||{}}nr.prototype.mapDefaultPrefixes=function(e){this.defaultPrefixMap=e};nr.prototype.defaultUriByPrefix=function(e){return this.defaultPrefixMap[e]};nr.prototype.byUri=function(e){return this.uriMap[e]||this.parent&&this.parent.byUri(e)};nr.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)};nr.prototype.uriByPrefix=function(e){return this.prefixMap[e||"xmlns"]||this.parent&&this.parent.uriByPrefix(e)};nr.prototype.mapPrefix=function(e,t){this.prefixMap[e||"xmlns"]=t};nr.prototype.getNSKey=function(e){return e.prefix!==void 0?e.uri+"|"+e.prefix:e.uri};nr.prototype.logUsed=function(e){var t=e.uri,n=this.getNSKey(e);this.used[n]=this.byUri(t),this.parent&&this.parent.logUsed(e)};nr.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 Iw(e){return e.charAt(0).toLowerCase()+e.slice(1)}function Lw(e,t){return th(t)?Iw(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 st(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function jw(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 Fw(e,t){return t.isGeneric?C({localName:t.ns.localName},e):C({localName:Lw(t.ns.localName,t.$pkg)},e)}function Hw(e,t){return C({localName:t.ns.localName},e)}function $w(e){var t=e.$descriptor;return Q(t.properties,function(n){var r=n.name;if(n.isVirtual||!dt(e,r))return!1;var i=e[r];return i===n.default||i===null?!1:n.isMany?i.length:!0})}var zw={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Gw={"<":"lt",">":"gt","&":"amp"};function ch(e,t,n){return e=st(e)?e:""+e,e.replace(t,function(r){return"&"+n[r]+";"})}function Vw(e){return ch(e,Bw,zw)}function Ww(e){return ch(e,oh,Gw)}function Uw(e){return Q(e,function(t){return t.isAttr})}function qw(e){return Q(e,function(t){return!t.isAttr})}function ql(e){this.tagName=e}ql.prototype.build=function(e){return this.element=e,this};ql.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"").appendNewLine()};function Pi(){}Pi.prototype.serializeValue=Pi.prototype.serializeTo=function(e){e.append(this.escape?Ww(this.value):this.value)};Pi.prototype.build=function(e,t){return this.value=t,e.type==="String"&&t.search(oh)!==-1&&(this.escape=!0),this};function Kl(e){this.tagName=e}ah(Kl,Pi);Kl.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("").appendNewLine()};function qe(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}qe.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=$w(e),this.parseAttributes(Uw(i)),this.parseContainments(qw(i))),this.parseGenericAttributes(e,r),this};qe.prototype.nsTagName=function(e){var t=this.logNamespaceUsed(e.ns);return Fw(t,e)};qe.prototype.nsPropertyTagName=function(e){var t=this.logNamespaceUsed(e.ns);return Hw(t,e)};qe.prototype.isLocalNs=function(e){return e.uri===this.ns.uri};qe.prototype.nsAttributeName=function(e){var t;if(st(e)?t=Tt(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)};qe.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}))};qe.prototype.parseGenericContainments=function(e){var t=e.$body;t&&this.body.push(new Pi().build({type:"String"},t));var n=e.$children;n&&E(n,r=>{this.body.push(new qe(this).build(r))})};qe.prototype.parseNsAttribute=function(e,t,n){var r=e.$model,i=Tt(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)}};qe.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};qe.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)}})};qe.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 Pi().build(i,o[0]));else if(Hl(i.type))E(o,function(u){n.push(new Kl(t.addTagName(t.nsPropertyTagName(i))).build(i,u))});else if(a)E(o,function(u){n.push(new ql(t.addTagName(t.nsPropertyTagName(i))).build(u))});else{var c=rh(i);E(o,function(u){var p;c?c===nh?p=new qe(t,i):p=new Dc(t,i,c):p=new qe(t),n.push(p.build(u))})}})};qe.prototype.getNamespaces=function(e){var t=this.namespaces,n=this.parent,r;return t||(r=n&&n.getNamespaces(),e||!r?this.namespaces=t=new nr(r):t=r),t};qe.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};qe.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};qe.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)})};qe.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),sh(e)};qe.prototype.addAttribute=function(e,t){var n=this.attrs;st(t)&&(t=Vw(t));var r=Sa(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)};qe.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=jw(n).concat(t)),E(t,function(r){e.append(" ").append(sh(r.name)).append('="').append(r.value).append('"')})};qe.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Pi;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){qe.call(this,e,t),this.serialization=n}ah(Dc,qe);Dc.prototype.parseNsAttributes=function(e){var t=qe.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 Kw(){this.value="",this.write=function(e){this.value+=e}}function Yw(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 Kw,o=new Yw(i,e.format);e.preamble&&o.append(Ow);var a=new qe,s=n.$model;if(a.getNamespaces().mapDefaultPrefixes(Xw(s)),a.build(n).serializeTo(o),!r)return i.value}return{toXML:t}}function Xw(e){let t=e.config&&e.config.nsMap||{},n={};for(let r in Gl)n[r]=Gl[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 kc(e,t){tn.call(this,e,t)}kc.prototype=Object.create(tn.prototype);kc.prototype.fromXML=function(e,t,n){st(t)||(n=t,t="bpmn:Definitions");var r=new Mc(C({model:this,lax:!0},n)),i=r.handler(t);return r.fromXML(e,i)};kc.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 Zw="BPMN20",Qw="http://www.omg.org/spec/BPMN/20100524/MODEL",Jw="bpmn",eS=[],tS=[{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"}]}],nS=[{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"}]}],rS={tagAlias:"lowerCase",typePrefix:"t"},iS={name:Zw,uri:Qw,prefix:Jw,associations:eS,types:tS,enumerations:nS,xml:rS},oS="BPMNDI",aS="http://www.omg.org/spec/BPMN/20100524/DI",sS="bpmndi",cS=[{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"]}],uS=[{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"}]}],pS=[],lS={name:oS,uri:aS,prefix:sS,types:cS,enumerations:uS,associations:pS},fS="DC",dS="http://www.omg.org/spec/DD/20100524/DC",mS="dc",hS=[{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}]}],vS=[],gS={name:fS,uri:dS,prefix:mS,types:hS,associations:vS},yS="DI",_S="http://www.omg.org/spec/DD/20100524/DI",bS="di",xS=[{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"}]}],ES=[],wS={tagAlias:"lowerCase"},SS={name:yS,uri:_S,prefix:bS,types:xS,associations:ES,xml:wS},CS="bpmn.io colors for BPMN",RS="http://bpmn.io/schema/bpmn/biocolor/1.0",PS="bioc",AS=[{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"}]}],TS=[],MS=[],DS={name:CS,uri:RS,prefix:PS,types:AS,enumerations:TS,associations:MS},kS="BPMN in Color",NS="http://www.omg.org/spec/BPMN/non-normative/color/1.0",OS="color",BS=[{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"}]}],IS=[],LS=[],jS={name:kS,uri:NS,prefix:OS,types:BS,enumerations:IS,associations:LS},FS={bpmn:iS,bpmndi:lS,dc:gS,di:SS,bioc:DS,color:jS};function ph(e,t){let n=C({},FS,e);return new kc(n,t)}N();N();function Rt(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':""}function Kt(e,t){return e.$instanceOf(t)}function HS(e){return re(e.rootElements,function(t){return Kt(t,"bpmn:Process")||Kt(t,"bpmn:Collaboration")})}function Yl(e){var t={},n=[],r={};function i(H,G){return function(oe){H(oe,G)}}function o(H){t[H.id]=H}function a(H){return t[H.id]}function s(H,G){var oe=H.gfx;if(oe)throw new Error(`already rendered ${Rt(H)}`);return e.element(H,r[H.id],G)}function c(H,G){return e.root(H,r[H.id],G)}function u(H,G){try{var oe=r[H.id]&&s(H,G);return o(H),oe}catch(xe){p(xe.message,{element:H,error:xe}),console.error(`failed to import ${Rt(H)}`,xe)}}function p(H,G){e.error(H,G)}var l=this.registerDi=function(G){var oe=G.bpmnElement;oe?r[oe.id]?p(`multiple DI elements defined for ${Rt(oe)}`,{element:oe}):r[oe.id]=G:p(`no bpmnElement referenced in ${Rt(G)}`,{element:G})};function f(H){d(H.plane)}function d(H){l(H),E(H.planeElement,m)}function m(H){l(H)}this.handleDefinitions=function(G,oe){var xe=G.diagrams;if(oe&&xe.indexOf(oe)===-1)throw new Error("diagram not part of ");if(!oe&&xe&&xe.length&&(oe=xe[0]),!oe)throw new Error("no diagram to display");r={},f(oe);var Gt=oe.plane;if(!Gt)throw new Error(`no plane for ${Rt(oe)}`);var P=Gt.bpmnElement;if(!P)if(P=HS(G),P)p(`correcting missing bpmnElement on ${Rt(Gt)} to ${Rt(P)}`),Gt.bpmnElement=P,l(Gt);else throw new Error("no process or collaboration to display");var _=c(P,Gt);if(Kt(P,"bpmn:Process")||Kt(P,"bpmn:SubProcess"))v(P,_);else if(Kt(P,"bpmn:Collaboration"))Ie(P,_),w(G.rootElements,_);else throw new Error(`unsupported bpmnElement for ${Rt(Gt)}: ${Rt(P)}`);g(n)};var g=this.handleDeferred=function(){for(var G;n.length;)G=n.shift(),G()};function v(H,G){ye(H,G),I(H.ioSpecification,G),T(H.artifacts,G),o(H)}function w(H,G){var oe=Q(H,function(xe){return!a(xe)&&Kt(xe,"bpmn:Process")&&xe.laneSets});oe.forEach(i(v,G))}function S(H,G){u(H,G)}function x(H,G){E(H,i(S,G))}function b(H,G){u(H,G)}function R(H,G){u(H,G)}function A(H,G){u(H,G)}function O(H,G){u(H,G)}function T(H,G){E(H,function(oe){Kt(oe,"bpmn:Association")?n.push(function(){O(oe,G)}):O(oe,G)})}function I(H,G){H&&(E(H.dataInputs,i(R,G)),E(H.dataOutputs,i(A,G)))}var L=this.handleSubProcess=function(G,oe){ye(G,oe),T(G.artifacts,oe)};function W(H,G){var oe=u(H,G);Kt(H,"bpmn:SubProcess")&&L(H,oe||G),Kt(H,"bpmn:Activity")&&I(H.ioSpecification,G),n.push(function(){E(H.dataInputAssociations,i(b,G)),E(H.dataOutputAssociations,i(b,G))})}function z(H,G){u(H,G)}function K(H,G){u(H,G)}function ve(H,G){n.push(function(){var oe=u(H,G);H.childLaneSet&&Jt(H.childLaneSet,oe||G),Ze(H)})}function Jt(H,G){E(H.lanes,i(ve,G))}function ke(H,G){E(H,i(Jt,G))}function ye(H,G){he(H.flowElements,G),H.laneSets&&ke(H.laneSets,G)}function he(H,G){E(H,function(oe){Kt(oe,"bpmn:SequenceFlow")?n.push(function(){z(oe,G)}):Kt(oe,"bpmn:BoundaryEvent")?n.unshift(function(){W(oe,G)}):Kt(oe,"bpmn:FlowNode")?W(oe,G):Kt(oe,"bpmn:DataObject")||(Kt(oe,"bpmn:DataStoreReference")||Kt(oe,"bpmn:DataObjectReference")?K(oe,G):p(`unrecognized flowElement ${Rt(oe)} in context ${Rt(G&&G.businessObject)}`,{element:oe,context:G}))})}function we(H,G){var oe=u(H,G),xe=H.processRef;xe&&v(xe,oe||G)}function Ie(H,G){E(H.participants,i(we,G)),n.push(function(){x(H.messageFlows,G)}),T(H.artifacts,G)}function Ze(H){E(H.flowNodeRef,function(G){var oe=G.get("lanes");oe&&oe.push(H)})}}N();function h(e,t){var n=j(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)}function te(e,t){return Lt(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(g,v){return r.add(g,v)},element:function(g,v,w){return r.add(g,v,w)},error:function(g,v){s.push({message:g,context:v})}},f=new Yl(l);p=p||u.diagrams&&u.diagrams[0];var d=$S(u,p);if(!d)throw new Error("no diagram to display");E(d,function(g){f.handleDefinitions(u,g)});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 $S(e,t){if(!(!t||!t.plane)){var n=t.plane.bpmnElement,r=n;!h(n,"bpmn:Process")&&!h(n,"bpmn:Collaboration")&&(r=zS(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=je(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 zS(e){for(var t=e;t;){if(h(t,"bpmn:Process"))return t;t=t.$parent}}var GS='',Xl=GS,Zl={verticalAlign:"middle"},Ql={color:"#404040"},VS={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},WS={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},US={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"},qS='
'+Xl+'Web-based tooling for BPMN, DMN and forms powered by bpmn.io.
',rr;function KS(){rr=ue(qS),vt(rr,VS),vt(_e("svg",rr),Zl),vt(_e(".backdrop",rr),WS),vt(_e(".notice",rr),US),vt(_e(".link",rr),Ql,{margin:"15px 20px 15px 10px",alignSelf:"center"})}function dh(){rr||(KS(),bt.bind(rr,".backdrop","click",function(e){document.body.removeChild(rr)})),document.body.appendChild(rr)}function $e(e){e=C({},XS,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),this._init(this._container,this._moddle,e),QS(this._container)}B($e,tr);$e.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||[]),Nc(s,o),s=YS(s),this._emit("import.done",{error:s,warnings:s.warnings}),s}};$e.prototype.importDefinitions=async function(t,n){return this._setDefinitions(t),{warnings:(await this.open(n)).warnings}};$e.prototype.open=async function(t){let n=this._definitions,r=t;if(!n){let o=new Error("no XML imported");throw Nc(o,[]),o}if(typeof t=="string"&&(r=ZS(n,t),!r)){let o=new Error("BPMNDiagram <"+t+"> not found");throw Nc(o,[]),o}try{this.clear()}catch(o){throw Nc(o,[]),o}let{warnings:i}=await lh(this,n,r);return{warnings:i}};$e.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};$e.prototype.saveSVG=async function(){this._emit("saveSVG.start");let t,n;try{let r=this.get("canvas"),i=r.getActiveLayer(),o=_e(":scope > defs",r._svg),a=Rl(i),s=o?""+Rl(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}};Fe.prototype._setDefinitions=function(e){this._definitions=e};Fe.prototype.getModules=function(){return this._modules};Fe.prototype.clear=function(){this.getDefinitions()&&Gn.prototype.clear.call(this)};Fe.prototype.destroy=function(){Gn.prototype.destroy.call(this),Lt(this._container)};Fe.prototype.on=function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)};Fe.prototype.off=function(e,t){this.get("eventBus").off(e,t)};Fe.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=ve(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()};Fe.prototype.getDefinitions=function(){return this._definitions};Fe.prototype.detach=function(){let e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))};Fe.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=S(Mt(n,["additionalModules"]),{canvas:S({},n.canvas,{container:e}),modules:a});Gn.call(this,s),n&&n.container&&this.attachTo(n.container)};Fe.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)};Fe.prototype._createContainer=function(e){let t=_e('
');return ct(t,{width:mh(e.width),height:mh(e.height),position:e.position}),t};Fe.prototype._createModdle=function(e){let t=S({},this._moddleExtensions,e.moddleExtensions);return new lh(t)};Fe.prototype._modules=[];function yc(e,t){return e.warnings=t,e}function B0(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 I0={width:"100%",height:"100%",position:"relative"};function mh(e){return e+(te(e)?"px":"")}function L0(e,t){return t&&ne(e.diagrams,function(n){return n.id===t})||null}function j0(e){let n=''+Pl+"",r=_e(n);ct(ve("svg",r),Tl),ct(r,Ml,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(r),ae.bind(r,"click",function(i){hh(),i.preventDefault()})}function vi(e){Fe.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(vi,Fe);vi.prototype._createModdle=function(e){var t=Fe.prototype._createModdle.call(this,e);return t.ids=new dn([32,36,1]),t};vi.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 re(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 Te(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 qe(e){return e&&!!L(e).triggeredByEvent}function lr(e,t){var n=L(e).eventDefinitions;return It(n,function(r){return m(r,t)})}function vh(e){return lr(e,"bpmn:ErrorEventDefinition")}function yh(e){return lr(e,"bpmn:EscalationEventDefinition")}function _h(e){return lr(e,"bpmn:CompensateEventDefinition")}var Yn={width:90,height:20},xh=15;function rn(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 $r(e){return J(e.label)}function F0(e){var t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)],i=H0(e),o=Math.atan((r.y-n.y)/(r.x-n.x)),a=i.x,s=i.y;return Math.abs(o){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 yi(e){let t=new Map;return E(ga(e,!0,-1),n=>{E(Dl(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 _c="hsl(225, 10%, 15%)",z0="white";function Tn(e,t){return It(e.eventDefinitions,function(n){return n.$type===t})}function Ch(e){return e.$type==="bpmn:IntermediateThrowEvent"||e.$type==="bpmn:EndEvent"}function Rh(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}function me(e,t,n){var r=se(e);return n||r.get("color:background-color")||r.get("bioc:fill")||t||z0}function Y(e,t,n){var r=se(e);return n||r.get("color:border-color")||r.get("bioc:stroke")||t||_c}function so(e,t,n,r){var i=se(e),o=i.get("label");return r||o&&o.get("color:color")||t||Y(e,n)}function xc(e){var t=e.x+e.width/2,n=e.y+e.height/2,r=e.width/2,i=[["M",t,n],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]];return pr(i)}function Ca(e,t){var n=e.x,r=e.y,i=e.width,o=e.height,a=[["M",n+t,r],["l",i-t*2,0],["a",t,t,0,0,1,t,t],["l",0,o-t*2],["a",t,t,0,0,1,-t,t],["l",t*2-i,0],["a",t,t,0,0,1,-t,-t],["l",0,t*2-o],["a",t,t,0,0,1,t,-t],["z"]];return pr(a)}function Ah(e){var t=e.width,n=e.height,r=e.x,i=e.y,o=t/2,a=n/2,s=[["M",r+o,i],["l",o,a],["l",-o,a],["l",-o,-a],["z"]];return pr(s)}function Ph(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=[["M",t,n],["l",r,0],["l",0,i],["l",-r,0],["z"]];return pr(o)}function co(e,t={}){return{width:on(e,t),height:$t(e,t)}}function on(e,t={}){return ft(t,"width")?t.width:e.width}function $t(e,t={}){return ft(t,"height")?t.height:e.height}var V0=new dn,W0=10,bc=3,G0=1.5,Ec=10,U0=4,po=.95,K0=1,Y0=.25;function dr(e,t,n,r,i,o,a){mn.call(this,t,a);var s=e&&e.defaultFillColor,c=e&&e.defaultStrokeColor,p=e&&e.defaultLabelColor;function u(A){return n.computeStyle(A,{strokeLinecap:"round",strokeLinejoin:"round",stroke:_c,strokeWidth:2,fill:"white"})}function l(A){return n.computeStyle(A,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:_c,strokeWidth:2})}function f(A,_){var{ref:g={x:0,y:0},scale:M=1,element:D,parentGfx:j=i._svg}=_,V=G("marker",{id:A,viewBox:"0 0 20 20",refX:g.x,refY:g.y,markerWidth:20*M,markerHeight:20*M,orient:"auto"});Z(V,D);var oe=ve(":scope > defs",j);oe||(oe=G("defs"),Z(j,oe)),Z(oe,V)}function d(A,_,g,M){var D=V0.nextPrefixed("marker-");return h(A,D,_,g,M),"url(#"+D+")"}function h(A,_,g,M,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(_,{element:j,ref:{x:11,y:10},scale:.5,parentGfx:A})}if(g==="messageflow-start"){var V=G("circle",{cx:6,cy:6,r:3.5,...u({fill:M,stroke:D,strokeWidth:1,strokeDasharray:[1e4,1]})});f(_,{element:V,ref:{x:6,y:6},parentGfx:A})}if(g==="messageflow-end"){var oe=G("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...u({fill:M,stroke:D,strokeWidth:1,strokeDasharray:[1e4,1]})});f(_,{element:oe,ref:{x:8.5,y:5},parentGfx:A})}if(g==="association-start"){var ye=G("path",{d:"M 11 5 L 1 10 L 11 15",...l({fill:"none",stroke:D,strokeWidth:1.5,strokeDasharray:[1e4,1]})});f(_,{element:ye,ref:{x:1,y:10},scale:.5,parentGfx:A})}if(g==="association-end"){var at=G("path",{d:"M 1 5 L 11 10 L 1 15",...l({fill:"none",stroke:D,strokeWidth:1.5,strokeDasharray:[1e4,1]})});f(_,{element:at,ref:{x:11,y:10},scale:.5,parentGfx:A})}if(g==="conditional-flow-marker"){var tt=G("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...u({fill:M,stroke:D})});f(_,{element:tt,ref:{x:-1,y:10},scale:.5,parentGfx:A})}if(g==="conditional-default-flow-marker"){var yt=G("path",{d:"M 6 4 L 10 16",...u({stroke:D,fill:"none"})});f(_,{element:yt,ref:{x:0,y:10},scale:.5,parentGfx:A})}}function y(A,_,g,M,D={}){Pe(M)&&(D=M,M=0),M=M||0,D=u(D);var j=_/2,V=g/2,oe=G("circle",{cx:j,cy:V,r:Math.round((_+g)/4-M),...D});return Z(A,oe),oe}function v(A,_,g,M,D,j){Pe(D)&&(j=D,D=0),D=D||0,j=u(j);var V=G("rect",{x:D,y:D,width:_-D*2,height:g-D*2,rx:M,ry:M,...j});return Z(A,V),V}function w(A,_,g,M){var D=_/2,j=g/2,V=[{x:D,y:0},{x:_,y:j},{x:D,y:g},{x:0,y:j}],oe=V.map(function(at){return at.x+","+at.y}).join(" ");M=u(M);var ye=G("polygon",{...M,points:oe});return Z(A,ye),ye}function R(A,_,g,M){g=l(g);var D=Hn(_,g,M);return Z(A,D),D}function b(A,_,g){return R(A,_,g,5)}function x(A,_,g){g=l(g);var M=G("path",{...g,d:_});return Z(A,M),M}function C(A,_,g,M){return x(_,g,S({"data-marker":A},M))}function P(A){return Bt[A]}function O(A){return function(_,g,M){return P(A)(_,g,M)}}var T={"bpmn:MessageEventDefinition":function(A,_,g={},M){var D=r.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:g.width||_.width,containerHeight:g.height||_.height,position:{mx:.235,my:.315}}),j=M?Y(_,c,g.stroke):me(_,s,g.fill),V=M?me(_,s,g.fill):Y(_,c,g.stroke),oe=x(A,D,{fill:j,stroke:V,strokeWidth:1});return oe},"bpmn:TimerEventDefinition":function(A,_,g={}){var M=g.width||_.width,D=g.height||_.height,j=g.width?1:2,V=y(A,M,D,.2*D,{fill:me(_,s,g.fill),stroke:Y(_,c,g.stroke),strokeWidth:j}),oe=r.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:M,containerHeight:D,position:{mx:.5,my:.5}});x(A,oe,{stroke:Y(_,c,g.stroke),strokeWidth:j});for(var ye=0;ye<12;ye++){var at=r.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:M,containerHeight:D,position:{mx:.5,my:.5}}),tt=M/2,yt=D/2;x(A,at,{strokeWidth:1,stroke:Y(_,c,g.stroke),transform:"rotate("+ye*30+","+yt+","+tt+")"})}return V},"bpmn:EscalationEventDefinition":function(A,_,g={},M){var D=r.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:g.width||_.width,containerHeight:g.height||_.height,position:{mx:.5,my:.2}}),j=M?Y(_,c,g.stroke):me(_,s,g.fill);return x(A,D,{fill:j,stroke:Y(_,c,g.stroke),strokeWidth:1})},"bpmn:ConditionalEventDefinition":function(A,_,g={}){var M=r.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:g.width||_.width,containerHeight:g.height||_.height,position:{mx:.5,my:.222}});return x(A,M,{fill:me(_,s,g.fill),stroke:Y(_,c,g.stroke),strokeWidth:1})},"bpmn:LinkEventDefinition":function(A,_,g={},M){var D=r.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.57,my:.263}}),j=M?Y(_,c,g.stroke):me(_,s,g.fill);return x(A,D,{fill:j,stroke:Y(_,c,g.stroke),strokeWidth:1})},"bpmn:ErrorEventDefinition":function(A,_,g={},M){var D=r.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:g.width||_.width,containerHeight:g.height||_.height,position:{mx:.2,my:.722}}),j=M?Y(_,c,g.stroke):me(_,s,g.fill);return x(A,D,{fill:j,stroke:Y(_,c,g.stroke),strokeWidth:1})},"bpmn:CancelEventDefinition":function(A,_,g={},M){var D=r.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.638,my:-.055}}),j=M?Y(_,c,g.stroke):"none",V=x(A,D,{fill:j,stroke:Y(_,c,g.stroke),strokeWidth:1});return lc(V,45),V},"bpmn:CompensateEventDefinition":function(A,_,g={},M){var D=r.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:g.width||_.width,containerHeight:g.height||_.height,position:{mx:.22,my:.5}}),j=M?Y(_,c,g.stroke):me(_,s,g.fill);return x(A,D,{fill:j,stroke:Y(_,c,g.stroke),strokeWidth:1})},"bpmn:SignalEventDefinition":function(A,_,g={},M){var D=r.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:g.width||_.width,containerHeight:g.height||_.height,position:{mx:.5,my:.2}}),j=M?Y(_,c,g.stroke):me(_,s,g.fill);return x(A,D,{strokeWidth:1,fill:j,stroke:Y(_,c,g.stroke)})},"bpmn:MultipleEventDefinition":function(A,_,g={},M){var D=r.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:g.width||_.width,containerHeight:g.height||_.height,position:{mx:.211,my:.36}}),j=M?Y(_,c,g.stroke):me(_,s,g.fill);return x(A,D,{fill:j,stroke:Y(_,c,g.stroke),strokeWidth:1})},"bpmn:ParallelMultipleEventDefinition":function(A,_,g={}){var M=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 x(A,M,{fill:me(_,s,g.fill),stroke:Y(_,c,g.stroke),strokeWidth:1})},"bpmn:TerminateEventDefinition":function(A,_,g={}){var M=y(A,_.width,_.height,8,{fill:Y(_,c,g.stroke),stroke:Y(_,c,g.stroke),strokeWidth:4});return M}};function B(A,_,g={},M){var D=L(A),j=Ch(D),V=M||A;return D.get("eventDefinitions")&&D.get("eventDefinitions").length>1?D.get("parallelMultiple")?T["bpmn:ParallelMultipleEventDefinition"](_,V,g,j):T["bpmn:MultipleEventDefinition"](_,V,g,j):Tn(D,"bpmn:MessageEventDefinition")?T["bpmn:MessageEventDefinition"](_,V,g,j):Tn(D,"bpmn:TimerEventDefinition")?T["bpmn:TimerEventDefinition"](_,V,g,j):Tn(D,"bpmn:ConditionalEventDefinition")?T["bpmn:ConditionalEventDefinition"](_,V,g,j):Tn(D,"bpmn:SignalEventDefinition")?T["bpmn:SignalEventDefinition"](_,V,g,j):Tn(D,"bpmn:EscalationEventDefinition")?T["bpmn:EscalationEventDefinition"](_,V,g,j):Tn(D,"bpmn:LinkEventDefinition")?T["bpmn:LinkEventDefinition"](_,V,g,j):Tn(D,"bpmn:ErrorEventDefinition")?T["bpmn:ErrorEventDefinition"](_,V,g,j):Tn(D,"bpmn:CancelEventDefinition")?T["bpmn:CancelEventDefinition"](_,V,g,j):Tn(D,"bpmn:CompensateEventDefinition")?T["bpmn:CompensateEventDefinition"](_,V,g,j):Tn(D,"bpmn:TerminateEventDefinition")?T["bpmn:TerminateEventDefinition"](_,V,g,j):null}var I={ParticipantMultiplicityMarker:function(A,_,g={}){var M=on(_,g),D=$t(_,g),j=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:M,containerHeight:D,position:{mx:(M/2-6)/M,my:(D-15)/D}});C("participant-multiplicity",A,j,{strokeWidth:2,fill:me(_,s,g.fill),stroke:Y(_,c,g.stroke)})},SubProcessMarker:function(A,_,g={}){var M=v(A,14,14,0,{strokeWidth:1,fill:me(_,s,g.fill),stroke:Y(_,c,g.stroke)});Ie(M,_.width/2-7.5,_.height-20);var D=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}});C("sub-process",A,D,{fill:me(_,s,g.fill),stroke:Y(_,c,g.stroke)})},ParallelMarker:function(A,_,g){var M=on(_,g),D=$t(_,g),j=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:M,containerHeight:D,position:{mx:(M/2+g.parallel)/M,my:(D-20)/D}});C("parallel",A,j,{fill:me(_,s,g.fill),stroke:Y(_,c,g.stroke)})},SequentialMarker:function(A,_,g){var M=r.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:(_.width/2+g.seq)/_.width,my:(_.height-19)/_.height}});C("sequential",A,M,{fill:me(_,s,g.fill),stroke:Y(_,c,g.stroke)})},CompensationMarker:function(A,_,g){var M=r.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:(_.width/2+g.compensation)/_.width,my:(_.height-13)/_.height}});C("compensation",A,M,{strokeWidth:1,fill:me(_,s,g.fill),stroke:Y(_,c,g.stroke)})},LoopMarker:function(A,_,g){var M=on(_,g),D=$t(_,g),j=r.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:M,containerHeight:D,position:{mx:(M/2+g.loop)/M,my:(D-7)/D}});C("loop",A,j,{strokeWidth:1.5,fill:"none",stroke:Y(_,c,g.stroke),strokeMiterlimit:.5})},AdhocMarker:function(A,_,g){var M=on(_,g),D=$t(_,g),j=r.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:M,containerHeight:D,position:{mx:(M/2+g.adhoc)/M,my:(D-15)/D}});C("adhoc",A,j,{strokeWidth:1,fill:Y(_,c,g.stroke),stroke:Y(_,c,g.stroke)})}};function W(A,_,g,M){I[A](_,g,M)}function $(A,_,g=[],M={}){M={fill:M.fill,stroke:M.stroke,width:on(_,M),height:$t(_,M)};var D=L(_),j=g.includes("SubProcessMarker");j?M={...M,seq:-21,parallel:-22,compensation:-25,loop:-18,adhoc:10}:M={...M,seq:-5,parallel:-6,compensation:-7,loop:0,adhoc:-8},D.get("isForCompensation")&&g.push("CompensationMarker"),m(D,"bpmn:AdHocSubProcess")&&(g.push("AdhocMarker"),j||S(M,{compensation:M.compensation-18}));var V=D.get("loopCharacteristics"),oe=V&&V.get("isSequential");V&&(S(M,{compensation:M.compensation-18}),g.includes("AdhocMarker")&&S(M,{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&&S(M,{compensation:-8}),E(g,function(ye){W(ye,A,_,M)})}function K(A,_,g={}){g=S({size:{width:100}},g);var M=o.createText(_||"",g);return ce(M).add("djs-label"),Z(A,M),M}function he(A,_,g,M={}){var D=L(_),j=co({x:_.x,y:_.y,width:_.width,height:_.height},M);return K(A,D.name,{align:g,box:j,padding:7,style:{fill:so(_,p,c,M.stroke)}})}function Gt(A,_,g={}){var M={width:_.width,height:_.height,x:_.width/2+_.x,y:_.height/2+_.y};return K(A,pt(_),{box:M,style:S({},o.getExternalStyle(),{fill:so(_,p,c,g.stroke)})})}function De(A,_,g,M={}){var D=Te(g),j=K(A,_,{box:{height:30,width:D?$t(g,M):on(g,M)},align:"center-middle",style:{fill:so(g,p,c,M.stroke)}});if(D){var V=-1*$t(g,M);ro(j,0,-V,270)}}function ge(A,_,g={}){var{width:M,height:D}=co(_,g);return v(A,M,D,Ec,{...g,fill:me(_,s,g.fill),fillOpacity:po,stroke:Y(_,c,g.stroke)})}function de(A,_,g={}){var M=L(_),D=me(_,s,g.fill),j=Y(_,c,g.stroke);return(M.get("associationDirection")==="One"||M.get("associationDirection")==="Both")&&(g.markerEnd=d(A,"association-end",D,j)),M.get("associationDirection")==="Both"&&(g.markerStart=d(A,"association-start",D,j)),g=be(g,["markerStart","markerEnd"]),b(A,_.waypoints,{...g,stroke:j,strokeDasharray:"0, 5"})}function Ee(A,_,g={}){var M=me(_,s,g.fill),D=Y(_,c,g.stroke),j=r.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.474,my:.296}}),V=x(A,j,{fill:M,fillOpacity:po,stroke:D}),oe=L(_);if(Rh(oe)){var ye=r.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.33,my:(_.height-18)/_.height}});x(A,ye,{strokeWidth:2,fill:M,stroke:D})}return V}function Be(A,_,g={}){return y(A,_.width,_.height,{fillOpacity:po,...g,fill:me(_,s,g.fill),stroke:Y(_,c,g.stroke)})}function Ke(A,_,g={}){return w(A,_.width,_.height,{fill:me(_,s,g.fill),fillOpacity:po,stroke:Y(_,c,g.stroke)})}function F(A,_,g={}){var M=v(A,on(_,g),$t(_,g),0,{fill:me(_,s,g.fill),fillOpacity:g.fillOpacity||po,stroke:Y(_,c,g.stroke),strokeWidth:1.5}),D=L(_);if(m(D,"bpmn:Lane")){var j=D.get("name");De(A,j,_,g)}return M}function z(A,_,g={}){var M=ge(A,_,g),D=re(_);if(qe(_)&&(H(M,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!D)){var j=L(_).flowElements||[],V=j.filter(oe=>m(oe,"bpmn:StartEvent"));V.length===1&&ie(V[0],A,g,_)}return he(A,_,D?"center-top":"center-middle",g),D?$(A,_,void 0,g):$(A,_,["SubProcessMarker"],g),M}function ie(A,_,g,M){var D=22,j={fill:me(M,s,g.fill),stroke:Y(M,c,g.stroke),width:D,height:D},V=L(A).isInterrupting,oe=V?0:3,ye=V?1:1.2,at=20,tt=(D-at)/2,yt="translate("+tt+","+tt+")";y(_,at,at,{fill:j.fill,stroke:j.stroke,strokeWidth:ye,strokeDasharray:oe,transform:yt}),B(A,_,j,M)}function xe(A,_,g={}){var M=ge(A,_,g);return he(A,_,"center-middle",g),$(A,_,void 0,g),M}var Bt=this.handlers={"bpmn:AdHocSubProcess":function(A,_,g={}){return re(_)?g=be(g,["fill","stroke","width","height"]):g=be(g,["fill","stroke"]),z(A,_,g)},"bpmn:Association":function(A,_,g={}){return g=be(g,["fill","stroke"]),de(A,_,g)},"bpmn:BoundaryEvent":function(A,_,g={}){var{renderIcon:M=!0}=g;g=be(g,["fill","stroke"]);var D=L(_),j=D.get("cancelActivity");g={strokeWidth:1.5,fill:me(_,s,g.fill),fillOpacity:K0,stroke:Y(_,c,g.stroke)},j||(g.strokeDasharray="6");var V=Be(A,_,g);return y(A,_.width,_.height,bc,{...g,fill:"none"}),M&&B(_,A,g),V},"bpmn:BusinessRuleTask":function(A,_,g={}){g=be(g,["fill","stroke"]);var M=xe(A,_,g),D=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),j=x(A,D);H(j,{fill:me(_,s,g.fill),stroke:Y(_,c,g.stroke),strokeWidth:1});var V=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),oe=x(A,V);return H(oe,{fill:Y(_,c,g.stroke),stroke:Y(_,c,g.stroke),strokeWidth:1}),M},"bpmn:CallActivity":function(A,_,g={}){return g=be(g,["fill","stroke"]),z(A,_,{strokeWidth:5,...g})},"bpmn:ComplexGateway":function(A,_,g={}){g=be(g,["fill","stroke"]);var M=Ke(A,_,g),D=r.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:_.width,containerHeight:_.height,position:{mx:.46,my:.26}});return x(A,D,{fill:Y(_,c,g.stroke),stroke:Y(_,c,g.stroke),strokeWidth:1}),M},"bpmn:DataInput":function(A,_,g={}){g=be(g,["fill","stroke"]);var M=r.getRawPath("DATA_ARROW"),D=Ee(A,_,g);return x(A,M,{fill:"none",stroke:Y(_,c,g.stroke),strokeWidth:1}),D},"bpmn:DataInputAssociation":function(A,_,g={}){return g=be(g,["fill","stroke"]),de(A,_,{...g,markerEnd:d(A,"association-end",me(_,s,g.fill),Y(_,c,g.stroke))})},"bpmn:DataObject":function(A,_,g={}){return g=be(g,["fill","stroke"]),Ee(A,_,g)},"bpmn:DataObjectReference":O("bpmn:DataObject"),"bpmn:DataOutput":function(A,_,g={}){g=be(g,["fill","stroke"]);var M=r.getRawPath("DATA_ARROW"),D=Ee(A,_,g);return x(A,M,{strokeWidth:1,fill:Y(_,c,g.stroke),stroke:Y(_,c,g.stroke)}),D},"bpmn:DataOutputAssociation":function(A,_,g={}){return g=be(g,["fill","stroke"]),de(A,_,{...g,markerEnd:d(A,"association-end",me(_,s,g.fill),Y(_,c,g.stroke))})},"bpmn:DataStoreReference":function(A,_,g={}){g=be(g,["fill","stroke"]);var M=r.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:0,my:.133}});return x(A,M,{fill:me(_,s,g.fill),fillOpacity:po,stroke:Y(_,c,g.stroke),strokeWidth:2})},"bpmn:EndEvent":function(A,_,g={}){var{renderIcon:M=!0}=g;g=be(g,["fill","stroke"]);var D=Be(A,_,{...g,strokeWidth:4});return M&&B(_,A,g),D},"bpmn:EventBasedGateway":function(A,_,g={}){g=be(g,["fill","stroke"]);var M=L(_),D=Ke(A,_,g);y(A,_.width,_.height,_.height*.2,{fill:me(_,"none",g.fill),stroke:Y(_,c,g.stroke),strokeWidth:1});var j=M.get("eventGatewayType"),V=!!M.get("instantiate");function oe(){var at=r.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:_.width,containerHeight:_.height,position:{mx:.36,my:.44}});x(A,at,{fill:"none",stroke:Y(_,c,g.stroke),strokeWidth:2})}if(j==="Parallel"){var ye=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:_.width,containerHeight:_.height,position:{mx:.474,my:.296}});x(A,ye,{fill:"none",stroke:Y(_,c,g.stroke),strokeWidth:1})}else j==="Exclusive"&&(V||y(A,_.width,_.height,_.height*.26,{fill:"none",stroke:Y(_,c,g.stroke),strokeWidth:1}),oe());return D},"bpmn:ExclusiveGateway":function(A,_,g={}){g=be(g,["fill","stroke"]);var M=Ke(A,_,g),D=r.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:_.width,containerHeight:_.height,position:{mx:.32,my:.3}}),j=se(_);return j.get("isMarkerVisible")&&x(A,D,{fill:Y(_,c,g.stroke),stroke:Y(_,c,g.stroke),strokeWidth:1}),M},"bpmn:Gateway":function(A,_,g={}){return g=be(g,["fill","stroke"]),Ke(A,_,g)},"bpmn:Group":function(A,_,g={}){return g=be(g,["fill","stroke","width","height"]),v(A,_.width,_.height,Ec,{stroke:Y(_,c,g.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:on(_,g),height:$t(_,g)})},"bpmn:InclusiveGateway":function(A,_,g={}){g=be(g,["fill","stroke"]);var M=Ke(A,_,g);return y(A,_.width,_.height,_.height*.24,{fill:me(_,s,g.fill),stroke:Y(_,c,g.stroke),strokeWidth:2.5}),M},"bpmn:IntermediateEvent":function(A,_,g={}){var{renderIcon:M=!0}=g;g=be(g,["fill","stroke"]);var D=Be(A,_,{...g,strokeWidth:1.5});return y(A,_.width,_.height,bc,{fill:"none",stroke:Y(_,c,g.stroke),strokeWidth:1.5}),M&&B(_,A,g),D},"bpmn:IntermediateCatchEvent":O("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":O("bpmn:IntermediateEvent"),"bpmn:Lane":function(A,_,g={}){return g=be(g,["fill","stroke","width","height"]),F(A,_,{...g,fillOpacity:Y0})},"bpmn:ManualTask":function(A,_,g={}){g=be(g,["fill","stroke"]);var M=xe(A,_,g),D=r.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return x(A,D,{fill:me(_,s,g.fill),stroke:Y(_,c,g.stroke),strokeWidth:.5}),M},"bpmn:MessageFlow":function(A,_,g={}){g=be(g,["fill","stroke"]);var M=L(_),D=se(_),j=me(_,s,g.fill),V=Y(_,c,g.stroke),oe=b(A,_.waypoints,{markerEnd:d(A,"messageflow-end",j,V),markerStart:d(A,"messageflow-start",j,V),stroke:V,strokeDasharray:"10, 11",strokeWidth:1.5});if(M.get("messageRef")){var ye=oe.getPointAtLength(oe.getTotalLength()/2),at=r.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:ye.x,y:ye.y}}),tt={strokeWidth:1};D.get("messageVisibleKind")==="initiating"?(tt.fill=j,tt.stroke=V):(tt.fill=V,tt.stroke=j);var yt=x(A,at,tt),fn=M.get("messageRef"),Oe=fn.get("name"),sr=K(A,Oe,{align:"center-top",fitBox:!0,style:{fill:V}}),Zs=yt.getBBox(),en=sr.getBBox(),fe=ye.x-en.width/2,Ae=ye.y+Zs.height/2+W0;ro(sr,fe,Ae,0)}return oe},"bpmn:ParallelGateway":function(A,_,g={}){g=be(g,["fill","stroke"]);var M=Ke(A,_,g),D=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:_.width,containerHeight:_.height,position:{mx:.46,my:.2}});return x(A,D,{fill:Y(_,c,g.stroke),stroke:Y(_,c,g.stroke),strokeWidth:1}),M},"bpmn:Participant":function(A,_,g={}){g=be(g,["fill","stroke","width","height"]);var M=F(A,_,g),D=re(_),j=Te(_),V=L(_),oe=V.get("name");if(D){var ye=j?[{x:30,y:0},{x:30,y:$t(_,g)}]:[{x:0,y:30},{x:on(_,g),y:30}];R(A,ye,{stroke:Y(_,c,g.stroke),strokeWidth:G0}),De(A,oe,_,g)}else{var at=co(_,g);j||(at.height=on(_,g),at.width=$t(_,g));var tt=K(A,oe,{box:at,align:"center-middle",style:{fill:so(_,p,c,g.stroke)}});if(!j){var yt=-1*$t(_,g);ro(tt,0,-yt,270)}}return V.get("participantMultiplicity")&&W("ParticipantMultiplicityMarker",A,_,g),M},"bpmn:ReceiveTask":function(A,_,g={}){g=be(g,["fill","stroke"]);var M=L(_),D=xe(A,_,g),j;return M.get("instantiate")?(y(A,28,28,20*.22,{fill:me(_,s,g.fill),stroke: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(A,j,{fill:me(_,s,g.fill),stroke:Y(_,c,g.stroke),strokeWidth:1}),D},"bpmn:ScriptTask":function(A,_,g={}){g=be(g,["fill","stroke"]);var M=xe(A,_,g),D=r.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return x(A,D,{fill:me(_,s,g.fill),stroke:Y(_,c,g.stroke),strokeWidth:1}),M},"bpmn:SendTask":function(A,_,g={}){g=be(g,["fill","stroke"]);var M=xe(A,_,g),D=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return x(A,D,{fill:Y(_,c,g.stroke),stroke:me(_,s,g.fill),strokeWidth:1}),M},"bpmn:SequenceFlow":function(A,_,g={}){g=be(g,["fill","stroke"]);var M=me(_,s,g.fill),D=Y(_,c,g.stroke),j=b(A,_.waypoints,{markerEnd:d(A,"sequenceflow-end",M,D),stroke:D}),V=L(_),{source:oe}=_;if(oe){var ye=L(oe);V.get("conditionExpression")&&m(ye,"bpmn:Activity")&&H(j,{markerStart:d(A,"conditional-flow-marker",M,D)}),ye.get("default")&&(m(ye,"bpmn:Gateway")||m(ye,"bpmn:Activity"))&&ye.get("default")===V&&H(j,{markerStart:d(A,"conditional-default-flow-marker",M,D)})}return j},"bpmn:ServiceTask":function(A,_,g={}){g=be(g,["fill","stroke"]);var M=xe(A,_,g);y(A,10,10,{fill:me(_,s,g.fill),stroke:"none",transform:"translate(6, 6)"});var D=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});x(A,D,{fill:me(_,s,g.fill),stroke:Y(_,c,g.stroke),strokeWidth:1}),y(A,10,10,{fill:me(_,s,g.fill),stroke:"none",transform:"translate(11, 10)"});var j=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return x(A,j,{fill:me(_,s,g.fill),stroke:Y(_,c,g.stroke),strokeWidth:1}),M},"bpmn:StartEvent":function(A,_,g={}){var{renderIcon:M=!0}=g;g=be(g,["fill","stroke"]);var D=L(_);D.get("isInterrupting")||(g={...g,strokeDasharray:"6"});var j=Be(A,_,g);return M&&B(_,A,g),j},"bpmn:SubProcess":function(A,_,g={}){return re(_)?g=be(g,["fill","stroke","width","height"]):g=be(g,["fill","stroke"]),z(A,_,g)},"bpmn:Task":function(A,_,g={}){return g=be(g,["fill","stroke"]),xe(A,_,g)},"bpmn:TextAnnotation":function(A,_,g={}){g=be(g,["fill","stroke"]);var{width:M,height:D}=co(_,g),j=v(A,M,D,0,0,{fill:"none",stroke:"none"}),V=r.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:M,containerHeight:D,position:{mx:0,my:0}});x(A,V,{stroke:Y(_,c,g.stroke)});var oe=L(_),ye=oe.get("text")||"";return K(A,ye,{align:"left-top",box:co(_,g),padding:fr,style:{fill:so(_,p,c,g.stroke)}}),j},"bpmn:Transaction":function(A,_,g={}){re(_)?g=be(g,["fill","stroke","width","height"]):g=be(g,["fill","stroke"]);var M=z(A,_,{strokeWidth:1.5,...g}),D=n.style(["no-fill","no-events"],{stroke:Y(_,c,g.stroke),strokeWidth:1.5}),j=re(_);return j||(g={}),v(A,on(_,g),$t(_,g),Ec-bc,bc,D),M},"bpmn:UserTask":function(A,_,g={}){g=be(g,["fill","stroke"]);var M=xe(A,_,g),D=15,j=12,V=r.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:D,y:j}});x(A,V,{fill:me(_,s,g.fill),stroke:Y(_,c,g.stroke),strokeWidth:.5});var oe=r.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:D,y:j}});x(A,oe,{fill:me(_,s,g.fill),stroke:Y(_,c,g.stroke),strokeWidth:.5});var ye=r.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:D,y:j}});return x(A,ye,{fill:Y(_,c,g.stroke),stroke:Y(_,c,g.stroke),strokeWidth:.5}),M},label:function(A,_,g={}){return Gt(A,_,g)}};this._drawPath=x,this._renderer=P}N(dr,mn);dr.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"];dr.prototype.canRender=function(e){return m(e,"bpmn:BaseElement")};dr.prototype.drawShape=function(e,t,n={}){var{type:r}=t,i=this._renderer(r);return i(e,t,n)};dr.prototype.drawConnection=function(e,t,n={}){var{type:r}=t,i=this._renderer(r);return i(e,t,n)};dr.prototype.getShapePath=function(e){return J(e)?Ca(e,U0):m(e,"bpmn:Event")?xc(e):m(e,"bpmn:Activity")?Ca(e,Ec):m(e,"bpmn:Gateway")?Ah(e):Ph(e)};function be(e,t=[]){return t.reduce((n,r)=>(e[r]&&(n[r]=e[r]),n),{})}var q0=0,X0={width:150,height:50};function Z0(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function Q0(e){return Pe(e)?S({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}var kl=null;function J0(){return kl||(kl=document.createElement("canvas").getContext("2d")),kl}function ew(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 tw(e,t){var n=J0();if(!n)return{width:0,height:0};n.font=ew(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 nw(e,t,n){for(var r=e.shift(),i=r,o;;){if(o=tw(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(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 R=G("tspan");H(R,{x:w,y:d}),R.textContent=v.text,Z(h,R)});var y={width:f,height:l};return{dimensions:y,element:h}};function aw(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}var sw=12,cw=1.2,pw=40;function wc(e){var t=S({fontFamily:"Arial, sans-serif",fontSize:sw,fontWeight:"normal",lineHeight:cw},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,r=S({},t,{fontSize:n},e&&e.externalStyle||{}),i=new uo({style:t});this.getExternalLabelBounds=function(a,s){var c={width:Math.max(a.width,Yn.width),height:30},p=o(s,c,{style:r});return{x:Math.round(a.x+a.width/2-p.width/2),y:a.y,width:Math.ceil(p.width),height:Math.ceil(p.height)}},this.getTextAnnotationBounds=function(a,s){var c=o(s,a,{style:t,align:"left-top",padding:fr});return{x:a.x,y:a.y,width:a.width,height:Math.max(pw,Math.round(c.height))}},this.getDimensions=function(a,s){return i.getDimensions(a,s||{})};function o(a,s,c){return i.getDimensions(a,S({box:s},c))}this.createText=function(a,s){return i.createText(a,s||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return r}}wc.$inject=["config.textRenderer"];function Nl(){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 gw(e){return m(e,"bpmn:Group")}var Nh={__depends__:[zr],bpmnImporter:["type",Mn]};var Oh={__depends__:[Dh,Nh]};function qn(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}qn.prototype.next=function(){return this._prefix+ ++this._counter};var vw=new qn("ov"),yw=500;function ut(e,t,n,r){this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=vw,this._overlayDefaults=S({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=_w(n.getContainer()),this._init()}ut.$inject=["config.overlays","eventBus","canvas","elementRegistry"];ut.prototype.get=function(e){if(rt(e)&&(e={id:e}),rt(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?Q(t.overlays,bt({type:e.type})):t.overlays.slice():[]}else return e.type?Q(this._overlays,bt({type:e.type})):e.id?this._overlays[e.id]:null};ut.prototype.add=function(e,t,n){if(Pe(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=S({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r};ut.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&&(Lt(r.html),Lt(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)}})};ut.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"};ut.prototype.show=function(){Cc(this._overlayRoot)};ut.prototype.hide=function(){Cc(this._overlayRoot,!1)};ut.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Dr(this._overlayRoot)};ut.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,i=t.y;if(t.waypoints){var o=we(t);r=o.x,i=o.y}Bh(n,r,i),Ze(e.html,"data-container-id",t.id)};ut.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=we(r).width:a=r.width,i=t.right*-1+a}if(t.bottom!==void 0){var s;r.waypoints?s=we(r).height:s=r.height,o=t.bottom*-1+s}Bh(n,i||0,o||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())};ut.prototype._createOverlayContainer=function(e){var t=_e('
');ct(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n};ut.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)};ut.prototype._getOverlayContainer=function(e,t){var n=ne(this._overlayContainers,function(r){return r.element===e});return!n&&!t?this._createOverlayContainer(e):n};ut.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)),rt(r)&&(r=_e(r)),o=this._getOverlayContainer(n),i=_e('
'),ct(i,{position:"absolute"}),i.appendChild(r),e.type&&ke(i).add("djs-overlay-"+e.type);var a=this._canvas.findRoot(n),s=this._canvas.getRootElement();Cc(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())};ut.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&&(Ye(i)&&i>t.scale||Ye(o)&&oi&&(a=(1/t.scale||1)*i)),Ye(a)&&(s="scale("+a+","+a+")"),Ih(o,s)};ut.prototype._updateOverlaysVisibilty=function(e){var t=this;E(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})};ut.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){Lt(a.html);var s=t._overlayContainers.indexOf(a);s!==-1&&t._overlayContainers.splice(s,1)}}),e.on("element.changed",yw,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&&ke(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 _w(e){var t=_e('
');return ct(t,{position:"absolute",width:0,height:0}),e.insertBefore(t,e.firstChild),t}function Bh(e,t,n){ct(e,{left:t+"px",top:n+"px"})}function Cc(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 Vr={__init__:["overlays"],overlays:["type",ut]};function Rc(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(ic(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)})}Rc.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var lo={__init__:["changeSupport"],changeSupport:["type",Rc]};var xw=1e3;function k(e){this._eventBus=e}k.$inject=["eventBus"];function bw(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((Le(t)||te(t))&&(o=i,i=r,r=n,n=t,t=null),Le(n)&&(o=i,i=r,r=n,n=xw),Pe(i)&&(o=i,i=!1),!Le(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?bw(r,o):r,o)})};k.prototype.canExecute=hr("canExecute");k.prototype.preExecute=hr("preExecute");k.prototype.preExecuted=hr("preExecuted");k.prototype.execute=hr("execute");k.prototype.executed=hr("executed");k.prototype.postExecute=hr("postExecute");k.prototype.postExecuted=hr("postExecuted");k.prototype.revert=hr("revert");k.prototype.reverted=hr("reverted");function hr(e){return function(n,r,i,o,a){(Le(n)||te(n))&&(a=o,o=i,i=r,r=n,n=null),this.on(n,e,r,i,o,a)}}function Ra(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(Ra,k);Ra.$inject=["canvas","injector"];var Lh={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",Ra]};function mr(e){return CSS.escape(e)}var Ew={"&":"&","<":"<",">":">",'"':""","'":"'"};function Ac(e){return e=""+e,e&&e.replace(/[&<>"']/g,function(t){return Ew[t]})}var jh="_plane";function Bl(e){var t=e.id;return ww(t)}function an(e){var t=e.id;return m(e,"bpmn:SubProcess")?Fh(t):t}function Wr(e){return Fh(e)}function fo(e){var t=se(e);return m(t,"bpmndi:BPMNPlane")}function Fh(e){return e+jh}function ww(e){return e.replace(new RegExp(jh+"$"),"")}var Sw="bjs-breadcrumbs-shown";function Pc(e,t,n){var r=_e('
    '),i=n.getContainer(),o=ke(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=Cw(c));var p=a.flatMap(function(l){var f=n.findRoot(an(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=Ac(l.name||l.id),y=_e('
  • '+h+"
  • ");return y.addEventListener("click",function(){n.setRootElement(f)}),y});r.innerHTML="";var u=p.length>1;o.toggle(Sw,u),p.forEach(function(l){r.appendChild(l)})}e.on("root.set",function(c){s(c.element)})}Pc.$inject=["eventBus","elementRegistry","canvas"];function Cw(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 Tc(e,t){var n=null,r=new Rw;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})}Tc.$inject=["eventBus","canvas"];function Rw(){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 gr(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,function(r,i){n._handleImport(i.definitions)})}gr.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)})}};gr.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),Pw(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};gr.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=Aw(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)})};gr.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)};gr.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};gr.$inject=["eventBus","moddle"];function $h(e){return m(e,"bpmndi:BPMNDiagram")?e:$h(e.$parent)}function Aw(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)}}),di(t)}function Pw(e,t){var n=e.$parent;return!(!m(n,"bpmn:SubProcess")||n===t.bpmnElement||ee(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))}var Mc=250,Tw='',Mw="bjs-drilldown-empty";function Xn(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",Mc,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.reverted("shape.toggleCollapse",Mc,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.executed(["shape.create","shape.move","shape.delete"],Mc,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"],Mc,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(Xn,k);Xn.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}};Xn.prototype._canDrillDown=function(e){var t=this._canvas;return m(e,"bpmn:SubProcess")&&t.findRoot(an(e))};Xn.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;ke(r.html).toggle(Mw,!i)}};Xn.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=_e('"),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(an(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:o}),this._updateOverlayVisibility(e)};Xn.prototype._removeOverlay=function(e){var t=this._overlays;t.remove({element:e,type:"drilldown"})};Xn.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];var zh={__depends__:[Vr,lo,Lh],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Pc],drilldownCentering:["type",Tc],drilldownOverlayBehavior:["type",Xn],subprocessCompatibility:["type",gr]};function Vh(e){!e||typeof e.stopPropagation!="function"||e.stopPropagation()}function vr(e){return e.originalEvent||e.srcEvent}function Dc(e){Vh(e),Vh(vr(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 kc(){return/mac/i.test(navigator.platform)}function Wh(e,t){return(vr(e)||e).button===t}function sn(e){return Wh(e,0)}function Gh(e){return Wh(e,1)}function yr(e){var t=vr(e)||e;return sn(e)?kc()?t.metaKey:t.ctrlKey:!1}function _i(e){var t=vr(e)||e;return sn(e)&&t.shiftKey}function Dw(e){return!0}function Nc(e){return sn(e)||Gh(e)}var Uh=500;function Oc(e,t,n){var r=this;function i(T,B,I){if(!s(T,B)){var W,$,K;I?$=t.getGraphics(I):(W=B.delegateTarget||B.target,W&&($=W,I=t.get($))),!(!$||!I)&&(K=e.fire(T,{element:I,gfx:$,originalEvent:B}),K===!1&&(B.stopPropagation(),B.preventDefault()))}}var o={};function a(T){return o[T]}function s(T,B){var I=p[T]||sn;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":Dw,"element.mousedown":Nc,"element.mouseup":Nc,"element.click":Nc,"element.dblclick":Nc};function u(T,B,I){var W=c[T];if(!W)throw new Error("unmapped DOM event name <"+T+">");return i(W,B,I)}var l="svg, .djs-element";function f(T,B,I,W){var $=o[I]=function(K){i(I,K)};W&&(p[I]=W),$.$delegate=ht.bind(T,l,B,$)}function d(T,B,I){var W=a(I);W&&ht.unbind(T,B,W.$delegate)}function h(T){E(c,function(B,I){f(T,I,B)})}function y(T){E(c,function(B,I){d(T,I,B)})}e.on("canvas.destroy",function(T){y(T.svg)}),e.on("canvas.init",function(T){h(T.svg)}),e.on(["shape.added","connection.added"],function(T){var B=T.element,I=T.gfx;e.fire("interactionEvents.createHit",{element:B,gfx:I})}),e.on(["shape.changed","connection.changed"],Uh,function(T){var B=T.element,I=T.gfx;e.fire("interactionEvents.updateHit",{element:B,gfx:I})}),e.on("interactionEvents.createHit",Uh,function(T){var B=T.element,I=T.gfx;r.createDefaultHit(B,I)}),e.on("interactionEvents.updateHit",function(T){var B=T.element,I=T.gfx;r.updateDefaultHit(B,I)});var v=C("djs-hit djs-hit-stroke"),w=C("djs-hit djs-hit-click-stroke"),R=C("djs-hit djs-hit-all"),b=C("djs-hit djs-hit-no-move"),x={all:R,"click-stroke":w,stroke:v,"no-move":b};function C(T,B){return B=S({stroke:"white",strokeWidth:15},B||{}),n.cls(T,["no-fill","no-border"],B)}function P(T,B){var I=x[B];if(!I)throw new Error("invalid hit type <"+B+">");return H(T,I),T}function O(T,B){Z(T,B)}this.removeHits=function(T){var B=ui(".djs-hit",T);E(B,Ce)},this.createDefaultHit=function(T,B){var I=T.waypoints,W=T.isFrame,$;return I?this.createWaypointsHit(B,I):($=W?"stroke":"all",this.createBoxHit(B,$,{width:T.width,height:T.height}))},this.createWaypointsHit=function(T,B){var I=Hn(B);return P(I,"stroke"),O(T,I),I},this.createBoxHit=function(T,B,I){I=S({x:0,y:0},I);var W=G("rect");return P(W,B),H(W,I),O(T,W),W},this.updateDefaultHit=function(T,B){var I=ve(".djs-hit",B);if(I)return T.waypoints?ha(I,T.waypoints):H(I,{width:T.width,height:T.height}),I},this.fire=i,this.triggerMouseEvent=u,this.mouseHandler=a,this.registerEvent=f,this.unregisterEvent=d}Oc.$inject=["eventBus","elementRegistry","styles"];var Gr={__init__:["interactionEvents"],interactionEvents:["type",Oc]};function Ur(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)})}Ur.$inject=["eventBus","canvas"];Ur.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})}};Ur.prototype.get=function(){return this._selectedElements};Ur.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1};Ur.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 Bc(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)})})}Bc.$inject=["canvas","eventBus"];function Ic(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(kw))}}),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(sn(i)){var o=i.element;o===n.getRootElement()&&(o=null);var a=t.isSelected(o),s=t.get().length>1,c=_i(i);if(a&&s)return c?t.deselect(o):t.select(o);a?t.deselect(o):t.select(o,c)}})}Ic.$inject=["eventBus","selection","canvas","elementRegistry"];function kw(e){return!e.hidden}var Qe={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Gr],selection:["type",Ur],selectionVisuals:["type",Bc],selectionBehavior:["type",Ic]};function cn(e){Fe.call(this,e)}N(cn,Fe);cn.prototype._modules=[Oh,zh,Vr,Qe,zr];cn.prototype._moddleExtensions={};var qh=["c","C"],Xh=["v","V"],Nw=["d","D"],Ow=["x","X"],Zh=["y","Y"],Il=["z","Z"];function Qh(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function mt(e){return e.altKey?!1:e.ctrlKey||e.metaKey}function Ge(e,t){return e=U(e)?e:[e],e.indexOf(t.key)!==-1||e.indexOf(t.code)!==-1}function Lc(e){return e.shiftKey}function Jh(e){return mt(e)&&Ge(qh,e)}function em(e){return mt(e)&&Ge(Xh,e)}function tm(e){return mt(e)&&Ge(Nw,e)}function nm(e){return mt(e)&&Ge(Ow,e)}function rm(e){return mt(e)&&!Lc(e)&&Ge(Il,e)}function im(e){return mt(e)&&(Ge(Zh,e)||Ge(Il,e)&&Lc(e))}var jc="keyboard.keydown",Bw="keyboard.keyup",Iw=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 wt(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")})}wt.$inject=["config.keyboard","eventBus"];wt.prototype._keydownHandler=function(e){this._keyHandler(e,jc)};wt.prototype._keyupHandler=function(e){this._keyHandler(e,Bw)};wt.prototype._keyHandler=function(e,t){var n;if(!this._isEventIgnored(e)){var r={keyEvent:e};n=this._eventBus.fire(t||jc,r),n&&e.preventDefault()}};wt.prototype._isEventIgnored=function(e){return!1};wt.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")};wt.prototype.getBinding=function(){return this._node};wt.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};wt.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})};wt.prototype.addListener=function(e,t,n){Le(e)&&(n=t,t=e,e=Iw),this._eventBus.on(n||jc,e,t)};wt.prototype.removeListener=function(e,t){this._eventBus.off(t||jc,e)};wt.prototype.hasModifier=Qh;wt.prototype.isCmd=mt;wt.prototype.isShift=Lc;wt.prototype.isKey=Ge;var Lw=500;function _r(e,t){var n=this;e.on("editorActions.init",Lw,function(r){var i=r.editorActions;n.registerBindings(t,i)})}_r.$inject=["eventBus","keyboard"];_r.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(Ge(["+","Add","="],i)&&mt(i))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(r){var i=r.keyEvent;if(Ge(["-","Subtract"],i)&&mt(i))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(r){var i=r.keyEvent;if(Ge("0",i)&&mt(i))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(r){var i=r.keyEvent;if(Ge(["Backspace","Delete","Del"],i))return t.trigger("removeSelection"),!0})};var ho={__init__:["keyboard","keyboardBindings"],keyboard:["type",wt],keyboardBindings:["type",_r]};var jw={moveSpeed:50,moveSpeedAccelerated:200};function Fc(e,t,n){var r=this;this._config=S({},jw,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})}}Fc.$inject=["config.keyboardMove","keyboard","canvas"];var Hc={__depends__:[ho],__init__:["keyboardMove"],keyboardMove:["type",Fc]};var Fw=/^djs-cursor-.*$/;function xi(e){var t=ke(document.body);t.removeMatching(Fw),e&&t.add("djs-cursor-"+e)}function $c(){xi(null)}var Hw=5e3;function zc(e,t){t=t||"element.click";function n(){return!1}return e.once(t,Hw,n),function(){e.off(t,n)}}function mo(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function St(e,t){return{x:e.x-t.x,y:e.y-t.y}}var $w=15;function Vc(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=St(u,c);if(!n.dragging&&zw(l)>$w&&(n.dragging=!0,p===0&&zc(e),xi("grab")),n.dragging){var f=n.last||n.start;l=St(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,$c()}function a(s){if(!Rn(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}}Vc.$inject=["eventBus","canvas"];function zw(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}var Wc={__init__:["moveCanvas"],moveCanvas:["type",Vc]};function Aa(e){return Math.log(e)/Math.log(10)}function Ll(e,t){var n=Aa(e.min),r=Aa(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 Vw=Math.sign||function(e){return e>=0?1:-1},jl={min:.2,max:4},sm=10,Ww=.1,Gw=.75;function _n(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=nt(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||Gw;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=Ll(jl,sm*2);this._totalDelta+=t,Math.abs(this._totalDelta)>Ww&&(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||kc()&&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))*Vw(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=Ll(jl,sm);this._zoom(t,n,r)};_n.prototype._zoom=function(e,t,n){var r=this._canvas,i=e>0?1:-1,o=Aa(r.zoom()),a=Math.round(o/n)*n;a+=n*i;var s=Math.pow(10,a);r.zoom(am(jl,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 Gc={__init__:["zoomScroll"],zoomScroll:["type",_n]};function xr(e){cn.call(this,e)}N(xr,cn);xr.prototype._navigationModules=[Hc,Wc,Gc];xr.prototype._modules=[].concat(cn.prototype._modules,xr.prototype._navigationModules);function Fl(e){return e&&e[e.length-1]}function cm(e){return e.y}function pm(e){return e.x}var Uw={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 Kr(e,t){this._modeling=e,this._rules=t}Kr.$inject=["modeling","rules"];Kr.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}};Kr.prototype._isType=function(e,t){return t.indexOf(e)!==-1};Kr.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=Fl(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=Rt(a,function(f){return f.elements.length>1&&(s=!0),f.elements.length}),s)return o[e]=Fl(c).center,o;p=t[0],t=Rt(t,function(f){return f[r]+f[i]}),u=Fl(t),o[e]=l(p,u)}return o};Kr.prototype.trigger=function(e,t){var n=this._modeling,r,i=Q(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=Uw[t],a=Rt(i,o),s=this._alignmentPosition(t,a);n.alignElements(a,s)}};var um={__init__:["alignElements"],alignElements:["type",Kr]};var Kw=new qn;function Yr(e){this._scheduled={},e.on("diagram.destroy",()=>{Object.keys(this._scheduled).forEach(t=>{this.cancel(t)})})}Yr.$inject=["eventBus"];Yr.prototype.schedule=function(e,t=Kw.next()){this.cancel(t);let n=this._schedule(e,t);return this._scheduled[t]=n,n.promise};Yr.prototype._schedule=function(e,t){let n=Yw();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}};Yr.prototype.cancel=function(e){let t=this._scheduled[e];t&&(this._cancel(t),this._scheduled[e]=null)};Yr.prototype._cancel=function(e){clearTimeout(e.executionId)};function Yw(){let e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}var lm={scheduler:["type",Yr]};var qw="djs-element-hidden",Uc=".entry",Xw=1e3,fm=8,Zw=300;function Je(e,t,n,r){this._canvas=e,this._elementRegistry=t,this._eventBus=n,this._scheduler=r,this._current=null,this._init()}Je.$inject=["canvas","elementRegistry","eventBus","scheduler"];Je.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()};Je.prototype._createContainer=function(){var e=_e('
    ');return this._canvas.getContainer().appendChild(e),e};Je.prototype.registerProvider=function(e,t){t||(t=e,e=Xw),this._eventBus.on("contextPad.getProviders",e,function(n){n.providers.push(t)})};Je.prototype.getEntries=function(e){var t=this._getProviders(),n=U(e)?"getMultiElementContextPadEntries":"getContextPadEntries",r={};return E(t,function(i){if(Le(i[n])){var o=i[n](e);Le(o)?r=o(r):E(o,function(a,s){r[s]=a})}}),r};Je.prototype.trigger=function(e,t,n){var r=this,i,o,a=t.delegateTarget||t.target;if(!a)return t.preventDefault();if(i=Ze(a,"data-action"),o=t.originalEvent||t,e==="mouseover"){this._timeout=setTimeout(function(){r._mouseout=r.triggerEntry(i,"hover",o,n)},Zw);return}else if(e==="mouseout"){clearTimeout(this._timeout),this._mouseout&&(this._mouseout(),this._mouseout=null);return}return this.triggerEntry(i,e,o,n)};Je.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(Le(s)){if(t==="click")return s(n,i,r)}else if(s[t])return s[t](n,i,r);n.preventDefault()}}}};Je.prototype.open=function(e,t){if(!(!t&&this.isOpen(e))){var n=this._eventBus.fire("contextPad.open.allowed",{target:e});n!==!1&&(this.close(),this._updateAndOpen(e))}};Je.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers};Je.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=_e(i.html||'
    '),c;Ze(s,"data-action",o),c=ve("[data-group="+mr(a)+"]",n),c||(c=_e('
    '),Ze(c,"data-group",a),n.appendChild(c)),c.appendChild(s),i.className&&Qw(s,i.className),i.title&&Ze(s,"title",i.title),i.imageUrl&&(r=_e(""),Ze(r,"src",i.imageUrl),r.style.width="100%",r.style.height="100%",s.appendChild(r))}),ke(n).add("open"),this._current={entries:t,html:n,target:e},this._updatePosition(),this._updateVisibility(),this._eventBus.fire("contextPad.open",{current:this._current})};Je.prototype._createHtml=function(e){var t=this,n=_e('
    ');return ht.bind(n,Uc,"click",function(r){t.trigger("click",r)}),ht.bind(n,Uc,"dragstart",function(r){t.trigger("dragstart",r)}),ht.bind(n,Uc,"mouseover",function(r){t.trigger("mouseover",r)}),ht.bind(n,Uc,"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};Je.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()&&eS(this._current.target,e)?t=this._current.html:t=this._createHtml(e),{html:t}};Je.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)};Je.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};Je.prototype.isShown=function(){return this.isOpen()&&ke(this._current.html).has("open")};Je.prototype.show=function(){this.isOpen()&&(ke(this._current.html).add("open"),this._updatePosition(),this._eventBus.fire("contextPad.show",{current:this._current}))};Je.prototype.hide=function(){this.isOpen()&&(ke(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))};Je.prototype._getPosition=function(e){if(!U(e)&&le(e)){var t=this._canvas.viewbox(),n=Jw(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}};Je.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")};Je.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,qw)});i?t.hide():t.show()}};this._scheduler.schedule(e,"ContextPad#_updateVisibility")};Je.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=ke(e);t=U(t)?t:t.split(/\s+/g),t.forEach(function(r){n.add(r)})}function Jw(e){return e.waypoints[e.waypoints.length-1]}function eS(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 Kc={__depends__:[Gr,lm,Vr],contextPad:["type",Je]};var ep,Ue,vm,tS,qr,dm,ym,_m,Hl,qc,Pa,xm,Wl,$l,zl,nS,Zc={},Qc=[],rS=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,tp=Array.isArray;function br(e,t){for(var n in t)e[n]=t[n];return e}function Gl(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function np(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?ep.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 Xc(e,a,r,i,null)}function Xc(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&&Ue.vnode!=null&&Ue.vnode(o),o}function rp(e){return e.children}function Ta(e,t){this.props=e,this.context=t}function go(e,t){if(t==null)return e.__?go(e.__,e.__i+1):null;for(var n;tt&&qr.sort(_m),e=qr.shift(),t=qr.length,iS(e)}finally{qr.length=Jc.__r=0}}function Em(e,t,n,r,i,o,a,s,c,p,u){var l,f,d,h,y,v,w,R=r&&r.__k||Qc,b=t.length;for(c=oS(n,t,R,c,b),l=0;l0?a=e.__k[o]=Xc(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=aS(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"||rS.test(t)?n:n+"px"}function Yc(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[Pa]=r[Pa]:(n[Pa]=Wl,e.addEventListener(t,o?zl:$l,o)):e.removeEventListener(t,o?zl:$l,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[qc]==null)t[qc]=Wl++;else if(t[qc]0?e:tp(e)?e.map(Cm):e.constructor!==void 0?null:br({},e)}function sS(e,t,n,r,i,o,a,s,c){var p,u,l,f,d,h,y,v=n.props||Zc,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(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 Se=Tm.bind(np);var vo,ot,Yl,Mm,Ma=0,jm=[],lt=Ue,Dm=lt.__b,km=lt.__r,Nm=lt.diffed,Om=lt.__c,Bm=lt.unmount,Im=lt.__;function ap(e,t){lt.__h&<.__h(ot,e,Ma||t),Ma=0;var n=ot.__H||(ot.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Da(e){return Ma=1,Fm(Hm,e)}function Fm(e,t,n){var r=ap(vo++,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=ot,!ot.__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};ot.__f=!0;var o=ot.shouldComponentUpdate,a=ot.componentWillUpdate;ot.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)},ot.shouldComponentUpdate=i}return r.__N||r.__}function yo(e,t){var n=ap(vo++,3);!lt.__s&&Xl(n.__H,t)&&(n.__=e,n.u=t,ot.__H.__h.push(n))}function _o(e,t){var n=ap(vo++,4);!lt.__s&&Xl(n.__H,t)&&(n.__=e,n.u=t,ot.__h.push(n))}function xo(e){return Ma=5,xn(function(){return{current:e}},[])}function xn(e,t){var n=ap(vo++,7);return Xl(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function bi(e,t){return Ma=8,xn(function(){return e},t)}function pS(){for(var e;e=jm.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(op),t.__h.some(ql),t.__h=[]}catch(n){t.__h=[],lt.__e(n,e.__v)}}}lt.__b=function(e){ot=null,Dm&&Dm(e)},lt.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Im&&Im(e,t)},lt.__r=function(e){km&&km(e),vo=0;var t=(ot=e.__c).__H;t&&(Yl===ot?(t.__h=[],ot.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(op),t.__h.some(ql),t.__h=[],vo=0)),Yl=ot},lt.diffed=function(e){Nm&&Nm(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(jm.push(t)!==1&&Mm===lt.requestAnimationFrame||((Mm=lt.requestAnimationFrame)||uS)(pS)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Yl=ot=null},lt.__c=function(e,t){t.some(function(n){try{n.__h.some(op),n.__h=n.__h.filter(function(r){return!r.__||ql(r)})}catch(r){t.some(function(i){i.__h&&(i.__h=[])}),t=[],lt.__e(r,n.__v)}}),Om&&Om(e,t)},lt.unmount=function(e){Bm&&Bm(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{op(r)}catch(i){t=i}}),n.__H=void 0,t&<.__e(t,n.__v))};var Lm=typeof requestAnimationFrame=="function";function uS(e){var t,n=function(){clearTimeout(r),Lm&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Lm&&(t=requestAnimationFrame(n))}function op(e){var t=ot,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),ot=t}function ql(e){var t=ot;e.__c=e.__(),ot=t}function Xl(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 Zl(e){let{navigationStack:t,setNavigationStack:n}=e,r=xn(()=>t.length<=1?[]:t.slice(0,-1).map((a,s)=>({label:a.label,onClick:()=>n(c=>c.slice(0,s+1))})),[t,n]),i=t.length>0?()=>n([]):null,o=t.length>0?t[t.length-1].label:null;return Se` +'+s+a+""}catch(r){n=r}if(this._emit("saveSVG.done",{error:n,svg:t}),n)throw n;return{svg:t}};$e.prototype._setDefinitions=function(e){this._definitions=e};$e.prototype.getModules=function(){return this._modules};$e.prototype.clear=function(){this.getDefinitions()&&tr.prototype.clear.call(this)};$e.prototype.destroy=function(){tr.prototype.destroy.call(this),Wt(this._container)};$e.prototype.on=function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)};$e.prototype.off=function(e,t){this.get("eventBus").off(e,t)};$e.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=_e(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()};$e.prototype.getDefinitions=function(){return this._definitions};$e.prototype.detach=function(){let e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))};$e.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(Nt(n,["additionalModules"]),{canvas:C({},n.canvas,{container:e}),modules:a});tr.call(this,s),n&&n.container&&this.attachTo(n.container)};$e.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)};$e.prototype._createContainer=function(e){let t=ue('
    ');return vt(t,{width:mh(e.width),height:mh(e.height),position:e.position}),t};$e.prototype._createModdle=function(e){let t=C({},this._moddleExtensions,e.moddleExtensions);return new ph(t)};$e.prototype._modules=[];function Nc(e,t){return e.warnings=t,e}function YS(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 XS={width:"100%",height:"100%",position:"relative"};function mh(e){return e+(ne(e)?"px":"")}function ZS(e,t){return t&&re(e.diagrams,function(n){return n.id===t})||null}function QS(e){let n=''+Xl+"",r=ue(n);vt(_e("svg",r),Zl),vt(r,Ql,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(r),se.bind(r,"click",function(i){dh(),i.preventDefault()})}function Ai(e){$e.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(Ai,$e);Ai.prototype._createModdle=function(e){var t=$e.prototype._createModdle.call(this,e);return t.ids=new En([32,36,1]),t};Ai.prototype._collectIds=function(e,t){var n=e.$model,r=n.ids,i;r.clear();for(i in t)r.claim(i,t[i])};N();N();function ie(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 Me(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 Qe(e){return e&&!!j(e).triggeredByEvent}function Er(e,t){var n=j(e).eventDefinitions;return Lt(n,function(r){return h(r,t)})}function vh(e){return Er(e,"bpmn:ErrorEventDefinition")}function gh(e){return Er(e,"bpmn:EscalationEventDefinition")}function yh(e){return Er(e,"bpmn:CompensateEventDefinition")}N();var ir={width:90,height:20},_h=15;function mn(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 Xr(e){return ee(e.label)}function JS(e){var t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)],i=e1(e),o=Math.atan((r.y-n.y)/(r.x-n.x)),a=i.x,s=i.y;return Math.abs(o){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 Ti(e){let t=new Map;return E(Ta(e,!0,-1),n=>{E(Jl(n),r=>{t.has(r.annotation)||t.set(r.annotation,{annotation:r.annotation,associations:[]}),t.get(r.annotation).associations.push(r.association)})}),[...t.values()]}N();var Oc="hsl(225, 10%, 15%)",n1="white";function jn(e,t){return Lt(e.eventDefinitions,function(n){return n.$type===t})}function Sh(e){return e.$type==="bpmn:IntermediateThrowEvent"||e.$type==="bpmn:EndEvent"}function Ch(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}function ge(e,t,n){var r=ce(e);return n||r.get("color:background-color")||r.get("bioc:fill")||t||n1}function Y(e,t,n){var r=ce(e);return n||r.get("color:border-color")||r.get("bioc:stroke")||t||Oc}function go(e,t,n,r){var i=ce(e),o=i.get("label");return r||o&&o.get("color:color")||t||Y(e,n)}function Bc(e){var t=e.x+e.width/2,n=e.y+e.height/2,r=e.width/2,i=[["M",t,n],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]];return br(i)}function ja(e,t){var n=e.x,r=e.y,i=e.width,o=e.height,a=[["M",n+t,r],["l",i-t*2,0],["a",t,t,0,0,1,t,t],["l",0,o-t*2],["a",t,t,0,0,1,-t,t],["l",t*2-i,0],["a",t,t,0,0,1,-t,-t],["l",0,t*2-o],["a",t,t,0,0,1,t,-t],["z"]];return br(a)}function Rh(e){var t=e.width,n=e.height,r=e.x,i=e.y,o=t/2,a=n/2,s=[["M",r+o,i],["l",o,a],["l",-o,a],["l",-o,-a],["z"]];return br(s)}function Ph(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=[["M",t,n],["l",r,0],["l",0,i],["l",-r,0],["z"]];return br(o)}function yo(e,t={}){return{width:hn(e,t),height:Yt(e,t)}}function hn(e,t={}){return dt(t,"width")?t.width:e.width}function Yt(e,t={}){return dt(t,"height")?t.height:e.height}var r1=new En,i1=10,Ic=3,o1=1.5,Lc=10,a1=4,_o=.95,s1=1,c1=.25;function Sr(e,t,n,r,i,o,a){Cn.call(this,t,a);var s=e&&e.defaultFillColor,c=e&&e.defaultStrokeColor,u=e&&e.defaultLabelColor;function p(P){return n.computeStyle(P,{strokeLinecap:"round",strokeLinejoin:"round",stroke:Oc,strokeWidth:2,fill:"white"})}function l(P){return n.computeStyle(P,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:Oc,strokeWidth:2})}function f(P,_){var{ref:y={x:0,y:0},scale:M=1,element:D,parentGfx:F=i._svg}=_,V=U("marker",{id:P,viewBox:"0 0 20 20",refX:y.x,refY:y.y,markerWidth:20*M,markerHeight:20*M,orient:"auto"});J(V,D);var ae=_e(":scope > defs",F);ae||(ae=U("defs"),J(F,ae)),J(ae,V)}function d(P,_,y,M){var D=r1.nextPrefixed("marker-");return m(P,D,_,y,M),"url(#"+D+")"}function m(P,_,y,M,D){if(y==="sequenceflow-end"){var F=U("path",{d:"M 1 5 L 11 10 L 1 15 Z",...p({fill:D,stroke:D,strokeWidth:1})});f(_,{element:F,ref:{x:11,y:10},scale:.5,parentGfx:P})}if(y==="messageflow-start"){var V=U("circle",{cx:6,cy:6,r:3.5,...p({fill:M,stroke:D,strokeWidth:1,strokeDasharray:[1e4,1]})});f(_,{element:V,ref:{x:6,y:6},parentGfx:P})}if(y==="messageflow-end"){var ae=U("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...p({fill:M,stroke:D,strokeWidth:1,strokeDasharray:[1e4,1]})});f(_,{element:ae,ref:{x:8.5,y:5},parentGfx:P})}if(y==="association-start"){var be=U("path",{d:"M 11 5 L 1 10 L 11 15",...l({fill:"none",stroke:D,strokeWidth:1.5,strokeDasharray:[1e4,1]})});f(_,{element:be,ref:{x:1,y:10},scale:.5,parentGfx:P})}if(y==="association-end"){var ft=U("path",{d:"M 1 5 L 11 10 L 1 15",...l({fill:"none",stroke:D,strokeWidth:1.5,strokeDasharray:[1e4,1]})});f(_,{element:ft,ref:{x:11,y:10},scale:.5,parentGfx:P})}if(y==="conditional-flow-marker"){var at=U("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...p({fill:M,stroke:D})});f(_,{element:at,ref:{x:-1,y:10},scale:.5,parentGfx:P})}if(y==="conditional-default-flow-marker"){var St=U("path",{d:"M 6 4 L 10 16",...p({stroke:D,fill:"none"})});f(_,{element:St,ref:{x:0,y:10},scale:.5,parentGfx:P})}}function g(P,_,y,M,D={}){Se(M)&&(D=M,M=0),M=M||0,D=p(D);var F=_/2,V=y/2,ae=U("circle",{cx:F,cy:V,r:Math.round((_+y)/4-M),...D});return J(P,ae),ae}function v(P,_,y,M,D,F){Se(D)&&(F=D,D=0),D=D||0,F=p(F);var V=U("rect",{x:D,y:D,width:_-D*2,height:y-D*2,rx:M,ry:M,...F});return J(P,V),V}function w(P,_,y,M){var D=_/2,F=y/2,V=[{x:D,y:0},{x:_,y:F},{x:D,y},{x:0,y:F}],ae=V.map(function(ft){return ft.x+","+ft.y}).join(" ");M=p(M);var be=U("polygon",{...M,points:ae});return J(P,be),be}function S(P,_,y,M){y=l(y);var D=Xn(_,y,M);return J(P,D),D}function x(P,_,y){return S(P,_,y,5)}function b(P,_,y){y=l(y);var M=U("path",{...y,d:_});return J(P,M),M}function R(P,_,y,M){return b(_,y,C({"data-marker":P},M))}function A(P){return Gt[P]}function O(P){return function(_,y,M){return A(P)(_,y,M)}}var T={"bpmn:MessageEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.235,my:.315}}),F=M?Y(_,c,y.stroke):ge(_,s,y.fill),V=M?ge(_,s,y.fill):Y(_,c,y.stroke),ae=b(P,D,{fill:F,stroke:V,strokeWidth:1});return ae},"bpmn:TimerEventDefinition":function(P,_,y={}){var M=y.width||_.width,D=y.height||_.height,F=y.width?1:2,V=g(P,M,D,.2*D,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:F}),ae=r.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:M,containerHeight:D,position:{mx:.5,my:.5}});b(P,ae,{stroke:Y(_,c,y.stroke),strokeWidth:F});for(var be=0;be<12;be++){var ft=r.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:M,containerHeight:D,position:{mx:.5,my:.5}}),at=M/2,St=D/2;b(P,ft,{strokeWidth:1,stroke:Y(_,c,y.stroke),transform:"rotate("+be*30+","+St+","+at+")"})}return V},"bpmn:EscalationEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.5,my:.2}}),F=M?Y(_,c,y.stroke):ge(_,s,y.fill);return b(P,D,{fill:F,stroke:Y(_,c,y.stroke),strokeWidth:1})},"bpmn:ConditionalEventDefinition":function(P,_,y={}){var M=r.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.5,my:.222}});return b(P,M,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1})},"bpmn:LinkEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.57,my:.263}}),F=M?Y(_,c,y.stroke):ge(_,s,y.fill);return b(P,D,{fill:F,stroke:Y(_,c,y.stroke),strokeWidth:1})},"bpmn:ErrorEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.2,my:.722}}),F=M?Y(_,c,y.stroke):ge(_,s,y.fill);return b(P,D,{fill:F,stroke:Y(_,c,y.stroke),strokeWidth:1})},"bpmn:CancelEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.638,my:-.055}}),F=M?Y(_,c,y.stroke):"none",V=b(P,D,{fill:F,stroke:Y(_,c,y.stroke),strokeWidth:1});return Rc(V,45),V},"bpmn:CompensateEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.22,my:.5}}),F=M?Y(_,c,y.stroke):ge(_,s,y.fill);return b(P,D,{fill:F,stroke:Y(_,c,y.stroke),strokeWidth:1})},"bpmn:SignalEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.5,my:.2}}),F=M?Y(_,c,y.stroke):ge(_,s,y.fill);return b(P,D,{strokeWidth:1,fill:F,stroke:Y(_,c,y.stroke)})},"bpmn:MultipleEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.211,my:.36}}),F=M?Y(_,c,y.stroke):ge(_,s,y.fill);return b(P,D,{fill:F,stroke:Y(_,c,y.stroke),strokeWidth:1})},"bpmn:ParallelMultipleEventDefinition":function(P,_,y={}){var M=r.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.458,my:.194}});return b(P,M,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1})},"bpmn:TerminateEventDefinition":function(P,_,y={}){var M=g(P,_.width,_.height,8,{fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke),strokeWidth:4});return M}};function I(P,_,y={},M){var D=j(P),F=Sh(D),V=M||P;return D.get("eventDefinitions")&&D.get("eventDefinitions").length>1?D.get("parallelMultiple")?T["bpmn:ParallelMultipleEventDefinition"](_,V,y,F):T["bpmn:MultipleEventDefinition"](_,V,y,F):jn(D,"bpmn:MessageEventDefinition")?T["bpmn:MessageEventDefinition"](_,V,y,F):jn(D,"bpmn:TimerEventDefinition")?T["bpmn:TimerEventDefinition"](_,V,y,F):jn(D,"bpmn:ConditionalEventDefinition")?T["bpmn:ConditionalEventDefinition"](_,V,y,F):jn(D,"bpmn:SignalEventDefinition")?T["bpmn:SignalEventDefinition"](_,V,y,F):jn(D,"bpmn:EscalationEventDefinition")?T["bpmn:EscalationEventDefinition"](_,V,y,F):jn(D,"bpmn:LinkEventDefinition")?T["bpmn:LinkEventDefinition"](_,V,y,F):jn(D,"bpmn:ErrorEventDefinition")?T["bpmn:ErrorEventDefinition"](_,V,y,F):jn(D,"bpmn:CancelEventDefinition")?T["bpmn:CancelEventDefinition"](_,V,y,F):jn(D,"bpmn:CompensateEventDefinition")?T["bpmn:CompensateEventDefinition"](_,V,y,F):jn(D,"bpmn:TerminateEventDefinition")?T["bpmn:TerminateEventDefinition"](_,V,y,F):null}var L={ParticipantMultiplicityMarker:function(P,_,y={}){var M=hn(_,y),D=Yt(_,y),F=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:M,containerHeight:D,position:{mx:(M/2-6)/M,my:(D-15)/D}});R("participant-multiplicity",P,F,{strokeWidth:2,fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke)})},SubProcessMarker:function(P,_,y={}){var M=v(P,14,14,0,{strokeWidth:1,fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke)});Fe(M,_.width/2-7.5,_.height-20);var D=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}});R("sub-process",P,D,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke)})},ParallelMarker:function(P,_,y){var M=hn(_,y),D=Yt(_,y),F=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:M,containerHeight:D,position:{mx:(M/2+y.parallel)/M,my:(D-20)/D}});R("parallel",P,F,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke)})},SequentialMarker:function(P,_,y){var M=r.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:(_.width/2+y.seq)/_.width,my:(_.height-19)/_.height}});R("sequential",P,M,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke)})},CompensationMarker:function(P,_,y){var M=r.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:(_.width/2+y.compensation)/_.width,my:(_.height-13)/_.height}});R("compensation",P,M,{strokeWidth:1,fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke)})},LoopMarker:function(P,_,y){var M=hn(_,y),D=Yt(_,y),F=r.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:M,containerHeight:D,position:{mx:(M/2+y.loop)/M,my:(D-7)/D}});R("loop",P,F,{strokeWidth:1.5,fill:"none",stroke:Y(_,c,y.stroke),strokeMiterlimit:.5})},AdhocMarker:function(P,_,y){var M=hn(_,y),D=Yt(_,y),F=r.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:M,containerHeight:D,position:{mx:(M/2+y.adhoc)/M,my:(D-15)/D}});R("adhoc",P,F,{strokeWidth:1,fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke)})}};function W(P,_,y,M){L[P](_,y,M)}function z(P,_,y=[],M={}){M={fill:M.fill,stroke:M.stroke,width:hn(_,M),height:Yt(_,M)};var D=j(_),F=y.includes("SubProcessMarker");F?M={...M,seq:-21,parallel:-22,compensation:-25,loop:-18,adhoc:10}:M={...M,seq:-5,parallel:-6,compensation:-7,loop:0,adhoc:-8},D.get("isForCompensation")&&y.push("CompensationMarker"),h(D,"bpmn:AdHocSubProcess")&&(y.push("AdhocMarker"),F||C(M,{compensation:M.compensation-18}));var V=D.get("loopCharacteristics"),ae=V&&V.get("isSequential");V&&(C(M,{compensation:M.compensation-18}),y.includes("AdhocMarker")&&C(M,{seq:-23,loop:-18,parallel:-24}),ae===void 0&&y.push("LoopMarker"),ae===!1&&y.push("ParallelMarker"),ae===!0&&y.push("SequentialMarker")),y.includes("CompensationMarker")&&y.length===1&&C(M,{compensation:-8}),E(y,function(be){W(be,P,_,M)})}function K(P,_,y={}){y=C({size:{width:100}},y);var M=o.createText(_||"",y);return pe(M).add("djs-label"),J(P,M),M}function ve(P,_,y,M={}){var D=j(_),F=yo({x:_.x,y:_.y,width:_.width,height:_.height},M);return K(P,D.name,{align:y,box:F,padding:7,style:{fill:go(_,u,c,M.stroke)}})}function Jt(P,_,y={}){var M={width:_.width,height:_.height,x:_.width/2+_.x,y:_.height/2+_.y};return K(P,gt(_),{box:M,style:C({},o.getExternalStyle(),{fill:go(_,u,c,y.stroke)})})}function ke(P,_,y,M={}){var D=Me(y),F=K(P,_,{box:{height:30,width:D?Yt(y,M):hn(y,M)},align:"center-middle",style:{fill:go(y,u,c,M.stroke)}});if(D){var V=-1*Yt(y,M);fo(F,0,-V,270)}}function ye(P,_,y={}){var{width:M,height:D}=yo(_,y);return v(P,M,D,Lc,{...y,fill:ge(_,s,y.fill),fillOpacity:_o,stroke:Y(_,c,y.stroke)})}function he(P,_,y={}){var M=j(_),D=ge(_,s,y.fill),F=Y(_,c,y.stroke);return(M.get("associationDirection")==="One"||M.get("associationDirection")==="Both")&&(y.markerEnd=d(P,"association-end",D,F)),M.get("associationDirection")==="Both"&&(y.markerStart=d(P,"association-start",D,F)),y=Ee(y,["markerStart","markerEnd"]),x(P,_.waypoints,{...y,stroke:F,strokeDasharray:"0, 5"})}function we(P,_,y={}){var M=ge(_,s,y.fill),D=Y(_,c,y.stroke),F=r.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.474,my:.296}}),V=b(P,F,{fill:M,fillOpacity:_o,stroke:D}),ae=j(_);if(Ch(ae)){var be=r.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.33,my:(_.height-18)/_.height}});b(P,be,{strokeWidth:2,fill:M,stroke:D})}return V}function Ie(P,_,y={}){return g(P,_.width,_.height,{fillOpacity:_o,...y,fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke)})}function Ze(P,_,y={}){return w(P,_.width,_.height,{fill:ge(_,s,y.fill),fillOpacity:_o,stroke:Y(_,c,y.stroke)})}function H(P,_,y={}){var M=v(P,hn(_,y),Yt(_,y),0,{fill:ge(_,s,y.fill),fillOpacity:y.fillOpacity||_o,stroke:Y(_,c,y.stroke),strokeWidth:1.5}),D=j(_);if(h(D,"bpmn:Lane")){var F=D.get("name");ke(P,F,_,y)}return M}function G(P,_,y={}){var M=ye(P,_,y),D=ie(_);if(Qe(_)&&($(M,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!D)){var F=j(_).flowElements||[],V=F.filter(ae=>h(ae,"bpmn:StartEvent"));V.length===1&&oe(V[0],P,y,_)}return ve(P,_,D?"center-top":"center-middle",y),D?z(P,_,void 0,y):z(P,_,["SubProcessMarker"],y),M}function oe(P,_,y,M){var D=22,F={fill:ge(M,s,y.fill),stroke:Y(M,c,y.stroke),width:D,height:D},V=j(P).isInterrupting,ae=V?0:3,be=V?1:1.2,ft=20,at=(D-ft)/2,St="translate("+at+","+at+")";g(_,ft,ft,{fill:F.fill,stroke:F.stroke,strokeWidth:be,strokeDasharray:ae,transform:St}),I(P,_,F,M)}function xe(P,_,y={}){var M=ye(P,_,y);return ve(P,_,"center-middle",y),z(P,_,void 0,y),M}var Gt=this.handlers={"bpmn:AdHocSubProcess":function(P,_,y={}){return ie(_)?y=Ee(y,["fill","stroke","width","height"]):y=Ee(y,["fill","stroke"]),G(P,_,y)},"bpmn:Association":function(P,_,y={}){return y=Ee(y,["fill","stroke"]),he(P,_,y)},"bpmn:BoundaryEvent":function(P,_,y={}){var{renderIcon:M=!0}=y;y=Ee(y,["fill","stroke"]);var D=j(_),F=D.get("cancelActivity");y={strokeWidth:1.5,fill:ge(_,s,y.fill),fillOpacity:s1,stroke:Y(_,c,y.stroke)},F||(y.strokeDasharray="6");var V=Ie(P,_,y);return g(P,_.width,_.height,Ic,{...y,fill:"none"}),M&&I(_,P,y),V},"bpmn:BusinessRuleTask":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=xe(P,_,y),D=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),F=b(P,D);$(F,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1});var V=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),ae=b(P,V);return $(ae,{fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke),strokeWidth:1}),M},"bpmn:CallActivity":function(P,_,y={}){return y=Ee(y,["fill","stroke"]),G(P,_,{strokeWidth:5,...y})},"bpmn:ComplexGateway":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=Ze(P,_,y),D=r.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:_.width,containerHeight:_.height,position:{mx:.46,my:.26}});return b(P,D,{fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke),strokeWidth:1}),M},"bpmn:DataInput":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=r.getRawPath("DATA_ARROW"),D=we(P,_,y);return b(P,M,{fill:"none",stroke:Y(_,c,y.stroke),strokeWidth:1}),D},"bpmn:DataInputAssociation":function(P,_,y={}){return y=Ee(y,["fill","stroke"]),he(P,_,{...y,markerEnd:d(P,"association-end",ge(_,s,y.fill),Y(_,c,y.stroke))})},"bpmn:DataObject":function(P,_,y={}){return y=Ee(y,["fill","stroke"]),we(P,_,y)},"bpmn:DataObjectReference":O("bpmn:DataObject"),"bpmn:DataOutput":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=r.getRawPath("DATA_ARROW"),D=we(P,_,y);return b(P,M,{strokeWidth:1,fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke)}),D},"bpmn:DataOutputAssociation":function(P,_,y={}){return y=Ee(y,["fill","stroke"]),he(P,_,{...y,markerEnd:d(P,"association-end",ge(_,s,y.fill),Y(_,c,y.stroke))})},"bpmn:DataStoreReference":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=r.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:0,my:.133}});return b(P,M,{fill:ge(_,s,y.fill),fillOpacity:_o,stroke:Y(_,c,y.stroke),strokeWidth:2})},"bpmn:EndEvent":function(P,_,y={}){var{renderIcon:M=!0}=y;y=Ee(y,["fill","stroke"]);var D=Ie(P,_,{...y,strokeWidth:4});return M&&I(_,P,y),D},"bpmn:EventBasedGateway":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=j(_),D=Ze(P,_,y);g(P,_.width,_.height,_.height*.2,{fill:ge(_,"none",y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1});var F=M.get("eventGatewayType"),V=!!M.get("instantiate");function ae(){var ft=r.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:_.width,containerHeight:_.height,position:{mx:.36,my:.44}});b(P,ft,{fill:"none",stroke:Y(_,c,y.stroke),strokeWidth:2})}if(F==="Parallel"){var be=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:_.width,containerHeight:_.height,position:{mx:.474,my:.296}});b(P,be,{fill:"none",stroke:Y(_,c,y.stroke),strokeWidth:1})}else F==="Exclusive"&&(V||g(P,_.width,_.height,_.height*.26,{fill:"none",stroke:Y(_,c,y.stroke),strokeWidth:1}),ae());return D},"bpmn:ExclusiveGateway":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=Ze(P,_,y),D=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,D,{fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke),strokeWidth:1}),M},"bpmn:Gateway":function(P,_,y={}){return y=Ee(y,["fill","stroke"]),Ze(P,_,y)},"bpmn:Group":function(P,_,y={}){return y=Ee(y,["fill","stroke","width","height"]),v(P,_.width,_.height,Lc,{stroke:Y(_,c,y.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:hn(_,y),height:Yt(_,y)})},"bpmn:InclusiveGateway":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=Ze(P,_,y);return g(P,_.width,_.height,_.height*.24,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:2.5}),M},"bpmn:IntermediateEvent":function(P,_,y={}){var{renderIcon:M=!0}=y;y=Ee(y,["fill","stroke"]);var D=Ie(P,_,{...y,strokeWidth:1.5});return g(P,_.width,_.height,Ic,{fill:"none",stroke:Y(_,c,y.stroke),strokeWidth:1.5}),M&&I(_,P,y),D},"bpmn:IntermediateCatchEvent":O("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":O("bpmn:IntermediateEvent"),"bpmn:Lane":function(P,_,y={}){return y=Ee(y,["fill","stroke","width","height"]),H(P,_,{...y,fillOpacity:c1})},"bpmn:ManualTask":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=xe(P,_,y),D=r.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return b(P,D,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:.5}),M},"bpmn:MessageFlow":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=j(_),D=ce(_),F=ge(_,s,y.fill),V=Y(_,c,y.stroke),ae=x(P,_.waypoints,{markerEnd:d(P,"messageflow-end",F,V),markerStart:d(P,"messageflow-start",F,V),stroke:V,strokeDasharray:"10, 11",strokeWidth:1.5});if(M.get("messageRef")){var be=ae.getPointAtLength(ae.getTotalLength()/2),ft=r.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:be.x,y:be.y}}),at={strokeWidth:1};D.get("messageVisibleKind")==="initiating"?(at.fill=F,at.stroke=V):(at.fill=V,at.stroke=F);var St=b(P,ft,at),xn=M.get("messageRef"),Be=xn.get("name"),yr=K(P,Be,{align:"center-top",fitBox:!0,style:{fill:V}}),lc=St.getBBox(),pn=yr.getBBox(),me=be.x-pn.width/2,Te=be.y+lc.height/2+i1;fo(yr,me,Te,0)}return ae},"bpmn:ParallelGateway":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=Ze(P,_,y),D=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:_.width,containerHeight:_.height,position:{mx:.46,my:.2}});return b(P,D,{fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke),strokeWidth:1}),M},"bpmn:Participant":function(P,_,y={}){y=Ee(y,["fill","stroke","width","height"]);var M=H(P,_,y),D=ie(_),F=Me(_),V=j(_),ae=V.get("name");if(D){var be=F?[{x:30,y:0},{x:30,y:Yt(_,y)}]:[{x:0,y:30},{x:hn(_,y),y:30}];S(P,be,{stroke:Y(_,c,y.stroke),strokeWidth:o1}),ke(P,ae,_,y)}else{var ft=yo(_,y);F||(ft.height=hn(_,y),ft.width=Yt(_,y));var at=K(P,ae,{box:ft,align:"center-middle",style:{fill:go(_,u,c,y.stroke)}});if(!F){var St=-1*Yt(_,y);fo(at,0,-St,270)}}return V.get("participantMultiplicity")&&W("ParticipantMultiplicityMarker",P,_,y),M},"bpmn:ReceiveTask":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=j(_),D=xe(P,_,y),F;return M.get("instantiate")?(g(P,28,28,20*.22,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.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:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1}),D},"bpmn:ScriptTask":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=xe(P,_,y),D=r.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return b(P,D,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1}),M},"bpmn:SendTask":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=xe(P,_,y),D=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return b(P,D,{fill:Y(_,c,y.stroke),stroke:ge(_,s,y.fill),strokeWidth:1}),M},"bpmn:SequenceFlow":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=ge(_,s,y.fill),D=Y(_,c,y.stroke),F=x(P,_.waypoints,{markerEnd:d(P,"sequenceflow-end",M,D),stroke:D}),V=j(_),{source:ae}=_;if(ae){var be=j(ae);V.get("conditionExpression")&&h(be,"bpmn:Activity")&&$(F,{markerStart:d(P,"conditional-flow-marker",M,D)}),be.get("default")&&(h(be,"bpmn:Gateway")||h(be,"bpmn:Activity"))&&be.get("default")===V&&$(F,{markerStart:d(P,"conditional-default-flow-marker",M,D)})}return F},"bpmn:ServiceTask":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=xe(P,_,y);g(P,10,10,{fill:ge(_,s,y.fill),stroke:"none",transform:"translate(6, 6)"});var D=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});b(P,D,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1}),g(P,10,10,{fill:ge(_,s,y.fill),stroke:"none",transform:"translate(11, 10)"});var F=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return b(P,F,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1}),M},"bpmn:StartEvent":function(P,_,y={}){var{renderIcon:M=!0}=y;y=Ee(y,["fill","stroke"]);var D=j(_);D.get("isInterrupting")||(y={...y,strokeDasharray:"6"});var F=Ie(P,_,y);return M&&I(_,P,y),F},"bpmn:SubProcess":function(P,_,y={}){return ie(_)?y=Ee(y,["fill","stroke","width","height"]):y=Ee(y,["fill","stroke"]),G(P,_,y)},"bpmn:Task":function(P,_,y={}){return y=Ee(y,["fill","stroke"]),xe(P,_,y)},"bpmn:TextAnnotation":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var{width:M,height:D}=yo(_,y),F=v(P,M,D,0,0,{fill:"none",stroke:"none"}),V=r.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:M,containerHeight:D,position:{mx:0,my:0}});b(P,V,{stroke:Y(_,c,y.stroke)});var ae=j(_),be=ae.get("text")||"";return K(P,be,{align:"left-top",box:yo(_,y),padding:wr,style:{fill:go(_,u,c,y.stroke)}}),F},"bpmn:Transaction":function(P,_,y={}){ie(_)?y=Ee(y,["fill","stroke","width","height"]):y=Ee(y,["fill","stroke"]);var M=G(P,_,{strokeWidth:1.5,...y}),D=n.style(["no-fill","no-events"],{stroke:Y(_,c,y.stroke),strokeWidth:1.5}),F=ie(_);return F||(y={}),v(P,hn(_,y),Yt(_,y),Lc-Ic,Ic,D),M},"bpmn:UserTask":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=xe(P,_,y),D=15,F=12,V=r.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:D,y:F}});b(P,V,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:.5});var ae=r.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:D,y:F}});b(P,ae,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:.5});var be=r.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:D,y:F}});return b(P,be,{fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke),strokeWidth:.5}),M},label:function(P,_,y={}){return Jt(P,_,y)}};this._drawPath=b,this._renderer=A}B(Sr,Cn);Sr.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"];Sr.prototype.canRender=function(e){return h(e,"bpmn:BaseElement")};Sr.prototype.drawShape=function(e,t,n={}){var{type:r}=t,i=this._renderer(r);return i(e,t,n)};Sr.prototype.drawConnection=function(e,t,n={}){var{type:r}=t,i=this._renderer(r);return i(e,t,n)};Sr.prototype.getShapePath=function(e){return ee(e)?ja(e,a1):h(e,"bpmn:Event")?Bc(e):h(e,"bpmn:Activity")?ja(e,Lc):h(e,"bpmn:Gateway")?Rh(e):Ph(e)};function Ee(e,t=[]){return t.reduce((n,r)=>(e[r]&&(n[r]=e[r]),n),{})}N();N();var u1=0,p1={width:150,height:50};function l1(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function f1(e){return Se(e)?C({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}var ef=null;function d1(){return ef||(ef=document.createElement("canvas").getContext("2d")),ef}function m1(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 h1(e,t){var n=d1();if(!n)return{width:0,height:0};n.font=m1(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 v1(e,t,n){for(var r=e.shift(),i=r,o;;){if(o=h1(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");$(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 S=U("tspan");$(S,{x:w,y:d}),S.textContent=v.text,J(m,S)});var g={width:f,height:l};return{dimensions:g,element:m}};function b1(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}var x1=12,E1=1.2,w1=40;function jc(e){var t=C({fontFamily:"Arial, sans-serif",fontSize:x1,fontWeight:"normal",lineHeight:E1},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,r=C({},t,{fontSize:n},e&&e.externalStyle||{}),i=new bo({style:t});this.getExternalLabelBounds=function(a,s){var c={width:Math.max(a.width,ir.width),height:30},u=o(s,c,{style:r});return{x:Math.round(a.x+a.width/2-u.width/2),y:a.y,width:Math.ceil(u.width),height:Math.ceil(u.height)}},this.getTextAnnotationBounds=function(a,s){var c=o(s,a,{style:t,align:"left-top",padding:wr});return{x:a.x,y:a.y,width:a.width,height:Math.max(w1,Math.round(c.height))}},this.getDimensions=function(a,s){return i.getDimensions(a,s||{})};function o(a,s,c){return i.getDimensions(a,C({box:s},c))}this.createText=function(a,s){return i.createText(a,s||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return r}}jc.$inject=["config.textRenderer"];function tf(){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 M1(e){return h(e,"bpmn:Group")}var kh={__depends__:[Zr],bpmnImporter:["type",Fn]};var Nh={__depends__:[Mh,kh]};N();function or(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}or.prototype.next=function(){return this._prefix+ ++this._counter};var D1=new or("ov"),k1=500;function yt(e,t,n,r){this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=D1,this._overlayDefaults=C({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=N1(n.getContainer()),this._init()}yt.$inject=["config.overlays","eventBus","canvas","elementRegistry"];yt.prototype.get=function(e){if(st(e)&&(e={id:e}),st(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?Q(t.overlays,Ct({type:e.type})):t.overlays.slice():[]}else return e.type?Q(this._overlays,Ct({type:e.type})):e.id?this._overlays[e.id]:null};yt.prototype.add=function(e,t,n){if(Se(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};yt.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&&(Wt(r.html),Wt(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)}})};yt.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"};yt.prototype.show=function(){Hc(this._overlayRoot)};yt.prototype.hide=function(){Hc(this._overlayRoot,!1)};yt.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Hr(this._overlayRoot)};yt.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,i=t.y;if(t.waypoints){var o=Ce(t);r=o.x,i=o.y}Oh(n,r,i),nt(e.html,"data-container-id",t.id)};yt.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=Ce(r).width:a=r.width,i=t.right*-1+a}if(t.bottom!==void 0){var s;r.waypoints?s=Ce(r).height:s=r.height,o=t.bottom*-1+s}Oh(n,i||0,o||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())};yt.prototype._createOverlayContainer=function(e){var t=ue('
    ');vt(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n};yt.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)};yt.prototype._getOverlayContainer=function(e,t){var n=re(this._overlayContainers,function(r){return r.element===e});return!n&&!t?this._createOverlayContainer(e):n};yt.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)),st(r)&&(r=ue(r)),o=this._getOverlayContainer(n),i=ue('
    '),vt(i,{position:"absolute"}),i.appendChild(r),e.type&&Ne(i).add("djs-overlay-"+e.type);var a=this._canvas.findRoot(n),s=this._canvas.getRootElement();Hc(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())};yt.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&&(Ue(i)&&i>t.scale||Ue(o)&&oi&&(a=(1/t.scale||1)*i)),Ue(a)&&(s="scale("+a+","+a+")"),Bh(o,s)};yt.prototype._updateOverlaysVisibilty=function(e){var t=this;E(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})};yt.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){Wt(a.html);var s=t._overlayContainers.indexOf(a);s!==-1&&t._overlayContainers.splice(s,1)}}),e.on("element.changed",k1,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&&Ne(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 N1(e){var t=ue('
    ');return vt(t,{position:"absolute",width:0,height:0}),e.insertBefore(t,e.firstChild),t}function Oh(e,t,n){vt(e,{left:t+"px",top:n+"px"})}function Hc(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 Qr={__init__:["overlays"],overlays:["type",yt]};function $c(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(_c(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)})}$c.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var xo={__init__:["changeSupport"],changeSupport:["type",$c]};N();var O1=1e3;function k(e){this._eventBus=e}k.$inject=["eventBus"];function B1(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((Le(t)||ne(t))&&(o=i,i=r,r=n,n=t,t=null),Le(n)&&(o=i,i=r,r=n,n=O1),Se(i)&&(o=i,i=!1),!Le(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?B1(r,o):r,o)})};k.prototype.canExecute=Cr("canExecute");k.prototype.preExecute=Cr("preExecute");k.prototype.preExecuted=Cr("preExecuted");k.prototype.execute=Cr("execute");k.prototype.executed=Cr("executed");k.prototype.postExecute=Cr("postExecute");k.prototype.postExecuted=Cr("postExecuted");k.prototype.revert=Cr("revert");k.prototype.reverted=Cr("reverted");function Cr(e){return function(n,r,i,o,a){(Le(n)||ne(n))&&(a=o,o=i,i=r,r=n,n=null),this.on(n,e,r,i,o,a)}}function Fa(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)})}B(Fa,k);Fa.$inject=["canvas","injector"];var Ih={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",Fa]};N();function Rr(e){return CSS.escape(e)}var I1={"&":"&","<":"<",">":">",'"':""","'":"'"};function Hn(e){return e=""+e,e&&e.replace(/[&<>"']/g,function(t){return I1[t]})}var Lh="_plane";function rf(e){var t=e.id;return L1(t)}function vn(e){var t=e.id;return h(e,"bpmn:SubProcess")?jh(t):t}function Jr(e){return jh(e)}function Eo(e){var t=ce(e);return h(t,"bpmndi:BPMNPlane")}function jh(e){return e+Lh}function L1(e){return e.replace(new RegExp(Lh+"$"),"")}var j1="bjs-breadcrumbs-shown";function zc(e,t,n){var r=ue('
      '),i=n.getContainer(),o=Ne(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=F1(c));var u=a.flatMap(function(l){var f=n.findRoot(vn(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=Hn(l.name||l.id),g=ue('
    • '+m+"
    • ");return g.addEventListener("click",function(){n.setRootElement(f)}),g});r.innerHTML="";var p=u.length>1;o.toggle(j1,p),u.forEach(function(l){r.appendChild(l)})}e.on("root.set",function(c){s(c.element)})}zc.$inject=["eventBus","elementRegistry","canvas"];function F1(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 Gc(e,t){var n=null,r=new H1;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})}Gc.$inject=["eventBus","canvas"];function H1(){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 Pr(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,function(r,i){n._handleImport(i.definitions)})}Pr.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)})}};Pr.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),z1(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};Pr.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=$1(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)})};Pr.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)};Pr.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};Pr.$inject=["eventBus","moddle"];function Hh(e){return h(e,"bpmndi:BPMNDiagram")?e:Hh(e.$parent)}function $1(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)}}),Si(t)}function z1(e,t){var n=e.$parent;return!(!h(n,"bpmn:SubProcess")||n===t.bpmnElement||te(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))}var Vc=250,G1='',V1="bjs-drilldown-empty";function ar(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",Vc,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.reverted("shape.toggleCollapse",Vc,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.executed(["shape.create","shape.move","shape.delete"],Vc,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"],Vc,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(ar,k);ar.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}};ar.prototype._canDrillDown=function(e){var t=this._canvas;return h(e,"bpmn:SubProcess")&&t.findRoot(vn(e))};ar.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;Ne(r.html).toggle(V1,!i)}};ar.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(vn(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:o}),this._updateOverlayVisibility(e)};ar.prototype._removeOverlay=function(e){var t=this._overlays;t.remove({element:e,type:"drilldown"})};ar.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];var $h={__depends__:[Qr,xo,Ih],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",zc],drilldownCentering:["type",Gc],drilldownOverlayBehavior:["type",ar],subprocessCompatibility:["type",Pr]};N();function zh(e){!e||typeof e.stopPropagation!="function"||e.stopPropagation()}function Ar(e){return e.originalEvent||e.srcEvent}function Wc(e){zh(e),zh(Ar(e))}function An(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 Uc(){return/mac/i.test(navigator.platform)}function Gh(e,t){return(Ar(e)||e).button===t}function gn(e){return Gh(e,0)}function Vh(e){return Gh(e,1)}function Tr(e){var t=Ar(e)||e;return gn(e)?Uc()?t.metaKey:t.ctrlKey:!1}function Mi(e){var t=Ar(e)||e;return gn(e)&&t.shiftKey}function W1(e){return!0}function qc(e){return gn(e)||Vh(e)}var Wh=500;function Kc(e,t,n){var r=this;function i(T,I,L){if(!s(T,I)){var W,z,K;L?z=t.getGraphics(L):(W=I.delegateTarget||I.target,W&&(z=W,L=t.get(z))),!(!z||!L)&&(K=e.fire(T,{element:L,gfx:z,originalEvent:I}),K===!1&&(I.stopPropagation(),I.preventDefault()))}}var o={};function a(T){return o[T]}function s(T,I){var L=u[T]||gn;return!L(I)}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":W1,"element.mousedown":qc,"element.mouseup":qc,"element.click":qc,"element.dblclick":qc};function p(T,I,L){var W=c[T];if(!W)throw new Error("unmapped DOM event name <"+T+">");return i(W,I,L)}var l="svg, .djs-element";function f(T,I,L,W){var z=o[L]=function(K){i(L,K)};W&&(u[L]=W),z.$delegate=bt.bind(T,l,I,z)}function d(T,I,L){var W=a(L);W&&bt.unbind(T,I,W.$delegate)}function m(T){E(c,function(I,L){f(T,L,I)})}function g(T){E(c,function(I,L){d(T,L,I)})}e.on("canvas.destroy",function(T){g(T.svg)}),e.on("canvas.init",function(T){m(T.svg)}),e.on(["shape.added","connection.added"],function(T){var I=T.element,L=T.gfx;e.fire("interactionEvents.createHit",{element:I,gfx:L})}),e.on(["shape.changed","connection.changed"],Wh,function(T){var I=T.element,L=T.gfx;e.fire("interactionEvents.updateHit",{element:I,gfx:L})}),e.on("interactionEvents.createHit",Wh,function(T){var I=T.element,L=T.gfx;r.createDefaultHit(I,L)}),e.on("interactionEvents.updateHit",function(T){var I=T.element,L=T.gfx;r.updateDefaultHit(I,L)});var v=R("djs-hit djs-hit-stroke"),w=R("djs-hit djs-hit-click-stroke"),S=R("djs-hit djs-hit-all"),x=R("djs-hit djs-hit-no-move"),b={all:S,"click-stroke":w,stroke:v,"no-move":x};function R(T,I){return I=C({stroke:"white",strokeWidth:15},I||{}),n.cls(T,["no-fill","no-border"],I)}function A(T,I){var L=b[I];if(!L)throw new Error("invalid hit type <"+I+">");return $(T,L),T}function O(T,I){J(T,I)}this.removeHits=function(T){var I=xi(".djs-hit",T);E(I,Pe)},this.createDefaultHit=function(T,I){var L=T.waypoints,W=T.isFrame,z;return L?this.createWaypointsHit(I,L):(z=W?"stroke":"all",this.createBoxHit(I,z,{width:T.width,height:T.height}))},this.createWaypointsHit=function(T,I){var L=Xn(I);return A(L,"stroke"),O(T,L),L},this.createBoxHit=function(T,I,L){L=C({x:0,y:0},L);var W=U("rect");return A(W,I),$(W,L),O(T,W),W},this.updateDefaultHit=function(T,I){var L=_e(".djs-hit",I);if(L)return T.waypoints?Pa(L,T.waypoints):$(L,{width:T.width,height:T.height}),L},this.fire=i,this.triggerMouseEvent=p,this.mouseHandler=a,this.registerEvent=f,this.unregisterEvent=d}Kc.$inject=["eventBus","elementRegistry","styles"];var ei={__init__:["interactionEvents"],interactionEvents:["type",Kc]};N();function ti(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)})}ti.$inject=["eventBus","canvas"];ti.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})}};ti.prototype.get=function(){return this._selectedElements};ti.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1};ti.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})};N();var Uh="hover",qh="selected";function Yc(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)})})}Yc.$inject=["canvas","eventBus"];N();function Xc(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(U1))}}),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(gn(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)}})}Xc.$inject=["eventBus","selection","canvas","elementRegistry"];function U1(e){return!e.hidden}var rt={__init__:["selectionVisuals","selectionBehavior"],__depends__:[ei],selection:["type",ti],selectionVisuals:["type",Yc],selectionBehavior:["type",Xc]};function nn(e){$e.call(this,e)}B(nn,$e);nn.prototype._modules=[Nh,$h,Qr,rt,Zr];nn.prototype._moddleExtensions={};N();N();var Kh=["c","C"],Yh=["v","V"],q1=["d","D"],K1=["x","X"],Xh=["y","Y"],of=["z","Z"];function Zh(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function xt(e){return e.altKey?!1:e.ctrlKey||e.metaKey}function Ke(e,t){return e=q(e)?e:[e],e.indexOf(t.key)!==-1||e.indexOf(t.code)!==-1}function Zc(e){return e.shiftKey}function Qh(e){return xt(e)&&Ke(Kh,e)}function Jh(e){return xt(e)&&Ke(Yh,e)}function ev(e){return xt(e)&&Ke(q1,e)}function tv(e){return xt(e)&&Ke(K1,e)}function nv(e){return xt(e)&&!Zc(e)&&Ke(of,e)}function rv(e){return xt(e)&&(Ke(Xh,e)||Ke(of,e)&&Zc(e))}var Qc="keyboard.keydown",Y1="keyboard.keyup",X1=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 Mt(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")})}Mt.$inject=["config.keyboard","eventBus"];Mt.prototype._keydownHandler=function(e){this._keyHandler(e,Qc)};Mt.prototype._keyupHandler=function(e){this._keyHandler(e,Y1)};Mt.prototype._keyHandler=function(e,t){var n;if(!this._isEventIgnored(e)){var r={keyEvent:e};n=this._eventBus.fire(t||Qc,r),n&&e.preventDefault()}};Mt.prototype._isEventIgnored=function(e){return!1};Mt.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")};Mt.prototype.getBinding=function(){return this._node};Mt.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};Mt.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})};Mt.prototype.addListener=function(e,t,n){Le(e)&&(n=t,t=e,e=X1),this._eventBus.on(n||Qc,e,t)};Mt.prototype.removeListener=function(e,t){this._eventBus.off(t||Qc,e)};Mt.prototype.hasModifier=Zh;Mt.prototype.isCmd=xt;Mt.prototype.isShift=Zc;Mt.prototype.isKey=Ke;var Z1=500;function Mr(e,t){var n=this;e.on("editorActions.init",Z1,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(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(Ke(["+","Add","="],i)&&xt(i))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(r){var i=r.keyEvent;if(Ke(["-","Subtract"],i)&&xt(i))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(r){var i=r.keyEvent;if(Ke("0",i)&&xt(i))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(r){var i=r.keyEvent;if(Ke(["Backspace","Delete","Del"],i))return t.trigger("removeSelection"),!0})};var wo={__init__:["keyboard","keyboardBindings"],keyboard:["type",Mt],keyboardBindings:["type",Mr]};N();var Q1={moveSpeed:50,moveSpeedAccelerated:200};function Jc(e,t,n){var r=this;this._config=C({},Q1,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})}}Jc.$inject=["config.keyboardMove","keyboard","canvas"];var eu={__depends__:[wo],__init__:["keyboardMove"],keyboardMove:["type",Jc]};var J1=/^djs-cursor-.*$/;function Di(e){var t=Ne(document.body);t.removeMatching(J1),e&&t.add("djs-cursor-"+e)}function tu(){Di(null)}var eC=5e3;function nu(e,t){t=t||"element.click";function n(){return!1}return e.once(t,eC,n),function(){e.off(t,n)}}function So(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Dt(e,t){return{x:e.x-t.x,y:e.y-t.y}}var tC=15;function ru(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=An(s),l=Dt(p,c);if(!n.dragging&&nC(l)>tC&&(n.dragging=!0,u===0&&nu(e),Di("grab")),n.dragging){var f=n.last||n.start;l=Dt(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,tu()}function a(s){if(!Bn(s.target,".djs-draggable")){var c=s.button;if(!(c>=2||s.ctrlKey||s.shiftKey||s.altKey))return n={button:c,start:An(s)},se.bind(document,"mousemove",i),se.bind(document,"mouseup",o),!0}}this.isActive=function(){return!!n}}ru.$inject=["eventBus","canvas"];function nC(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}var iu={__init__:["moveCanvas"],moveCanvas:["type",ru]};function Ha(e){return Math.log(e)/Math.log(10)}function af(e,t){var n=Ha(e.min),r=Ha(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))}N();var rC=Math.sign||function(e){return e>=0?1:-1},sf={min:.2,max:4},av=10,iC=.1,oC=.75;function Tn(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=tt(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||oC;var r=this;t.on("canvas.mouseover",function(){r._init(e.enabled!==!1)}),t.on("canvas.mouseout",function(){r._init(!1)})}Tn.$inject=["config.zoomScroll","eventBus","canvas"];Tn.prototype.scroll=function(t){this._canvas.scroll(t)};Tn.prototype.reset=function(){this._canvas.zoom("fit-viewport")};Tn.prototype.zoom=function(t,n){var r=af(sf,av*2);this._totalDelta+=t,Math.abs(this._totalDelta)>iC&&(this._zoom(t,n,r),this._totalDelta=0)};Tn.prototype._handleWheel=function(t){if(this._enabled){var n=this._container;t.preventDefault();var r=t.ctrlKey||Uc()&&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))*rC(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)}};Tn.prototype.stepZoom=function(t,n){var r=af(sf,av);this._zoom(t,n,r)};Tn.prototype._zoom=function(e,t,n){var r=this._canvas,i=e>0?1:-1,o=Ha(r.zoom()),a=Math.round(o/n)*n;a+=n*i;var s=Math.pow(10,a);r.zoom(ov(sf,s),t)};Tn.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};Tn.prototype._init=function(e){this.toggle(e)};var ou={__init__:["zoomScroll"],zoomScroll:["type",Tn]};function sr(e){nn.call(this,e)}B(sr,nn);sr.prototype._navigationModules=[eu,iu,ou];sr.prototype._modules=[].concat(nn.prototype._modules,sr.prototype._navigationModules);N();function cf(e){return e&&e[e.length-1]}function sv(e){return e.y}function cv(e){return e.x}var aC={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 ni(e,t){this._modeling=e,this._rules=t}ni.$inject=["modeling","rules"];ni.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}};ni.prototype._isType=function(e,t){return t.indexOf(e)!==-1};ni.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=cf(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=At(a,function(f){return f.elements.length>1&&(s=!0),f.elements.length}),s)return o[e]=cf(c).center,o;u=t[0],t=At(t,function(f){return f[r]+f[i]}),p=cf(t),o[e]=l(u,p)}return o};ni.prototype.trigger=function(e,t){var n=this._modeling,r,i=Q(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=aC[t],a=At(i,o),s=this._alignmentPosition(t,a);n.alignElements(a,s)}};var uv={__init__:["alignElements"],alignElements:["type",ni]};var sC=new or;function ri(e){this._scheduled={},e.on("diagram.destroy",()=>{Object.keys(this._scheduled).forEach(t=>{this.cancel(t)})})}ri.$inject=["eventBus"];ri.prototype.schedule=function(e,t=sC.next()){this.cancel(t);let n=this._schedule(e,t);return this._scheduled[t]=n,n.promise};ri.prototype._schedule=function(e,t){let n=cC();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}};ri.prototype.cancel=function(e){let t=this._scheduled[e];t&&(this._cancel(t),this._scheduled[e]=null)};ri.prototype._cancel=function(e){clearTimeout(e.executionId)};function cC(){let e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}var pv={scheduler:["type",ri]};N();var uC="djs-element-hidden",au=".entry",pC=1e3,lv=8,lC=300;function it(e,t,n,r){this._canvas=e,this._elementRegistry=t,this._eventBus=n,this._scheduler=r,this._current=null,this._init()}it.$inject=["canvas","elementRegistry","eventBus","scheduler"];it.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()};it.prototype._createContainer=function(){var e=ue('
      ');return this._canvas.getContainer().appendChild(e),e};it.prototype.registerProvider=function(e,t){t||(t=e,e=pC),this._eventBus.on("contextPad.getProviders",e,function(n){n.providers.push(t)})};it.prototype.getEntries=function(e){var t=this._getProviders(),n=q(e)?"getMultiElementContextPadEntries":"getContextPadEntries",r={};return E(t,function(i){if(Le(i[n])){var o=i[n](e);Le(o)?r=o(r):E(o,function(a,s){r[s]=a})}}),r};it.prototype.trigger=function(e,t,n){var r=this,i,o,a=t.delegateTarget||t.target;if(!a)return t.preventDefault();if(i=nt(a,"data-action"),o=t.originalEvent||t,e==="mouseover"){this._timeout=setTimeout(function(){r._mouseout=r.triggerEntry(i,"hover",o,n)},lC);return}else if(e==="mouseout"){clearTimeout(this._timeout),this._mouseout&&(this._mouseout(),this._mouseout=null);return}return this.triggerEntry(i,e,o,n)};it.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(Le(s)){if(t==="click")return s(n,i,r)}else if(s[t])return s[t](n,i,r);n.preventDefault()}}}};it.prototype.open=function(e,t){if(!(!t&&this.isOpen(e))){var n=this._eventBus.fire("contextPad.open.allowed",{target:e});n!==!1&&(this.close(),this._updateAndOpen(e))}};it.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers};it.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;nt(s,"data-action",o),c=_e("[data-group="+Rr(a)+"]",n),c||(c=ue('
      '),nt(c,"data-group",a),n.appendChild(c)),c.appendChild(s),i.className&&fC(s,i.className),i.title&&nt(s,"title",i.title),i.imageUrl&&(r=ue(""),nt(r,"src",i.imageUrl),r.style.width="100%",r.style.height="100%",s.appendChild(r))}),Ne(n).add("open"),this._current={entries:t,html:n,target:e},this._updatePosition(),this._updateVisibility(),this._eventBus.fire("contextPad.open",{current:this._current})};it.prototype._createHtml=function(e){var t=this,n=ue('
      ');return bt.bind(n,au,"click",function(r){t.trigger("click",r)}),bt.bind(n,au,"dragstart",function(r){t.trigger("dragstart",r)}),bt.bind(n,au,"mouseover",function(r){t.trigger("mouseover",r)}),bt.bind(n,au,"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};it.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()&&mC(this._current.target,e)?t=this._current.html:t=this._createHtml(e),{html:t}};it.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)};it.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&&ln(e,function(r){return n.includes(r)}):n===e};it.prototype.isShown=function(){return this.isOpen()&&Ne(this._current.html).has("open")};it.prototype.show=function(){this.isOpen()&&(Ne(this._current.html).add("open"),this._updatePosition(),this._eventBus.fire("contextPad.show",{current:this._current}))};it.prototype.hide=function(){this.isOpen()&&(Ne(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))};it.prototype._getPosition=function(e){if(!q(e)&&de(e)){var t=this._canvas.viewbox(),n=dC(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}};it.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")};it.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,uC)});i?t.hide():t.show()}};this._scheduler.schedule(e,"ContextPad#_updateVisibility")};it.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 fC(e,t){var n=Ne(e);t=q(t)?t:t.split(/\s+/g),t.forEach(function(r){n.add(r)})}function dC(e){return e.waypoints[e.waypoints.length-1]}function mC(e,t){return e=q(e)?e:[e],t=q(t)?t:[t],e.length===t.length&&ln(e,function(n){return t.includes(n)})}var su={__depends__:[ei,pv,Qr],contextPad:["type",it]};var mu,Ye,vv,hC,ii,fv,gv,yv,uf,uu,$a,_v,df,pf,lf,vC,lu={},fu=[],gC=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,hu=Array.isArray;function Dr(e,t){for(var n in t)e[n]=t[n];return e}function mf(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function vu(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?mu.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 pu(e,a,r,i,null)}function pu(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&&Ye.vnode!=null&&Ye.vnode(o),o}function gu(e){return e.children}function za(e,t){this.props=e,this.context=t}function Co(e,t){if(t==null)return e.__?Co(e.__,e.__i+1):null;for(var n;tt&&ii.sort(yv),e=ii.shift(),t=ii.length,yC(e)}finally{ii.length=du.__r=0}}function xv(e,t,n,r,i,o,a,s,c,u,p){var l,f,d,m,g,v,w,S=r&&r.__k||fu,x=t.length;for(c=_C(n,t,S,c,x),l=0;l0?a=e.__k[o]=pu(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=bC(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"||gC.test(t)?n:n+"px"}function cu(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[$a]=r[$a]:(n[$a]=df,e.addEventListener(t,o?lf:pf,o)):e.removeEventListener(t,o?lf:pf,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[uu]==null)t[uu]=df++;else if(t[uu]0?e:hu(e)?e.map(Sv):e.constructor!==void 0?null:Dr({},e)}function xC(e,t,n,r,i,o,a,s,c){var u,p,l,f,d,m,g,v=n.props||lu,w=t.props,S=t.type;if(S=="svg"?i="http://www.w3.org/2000/svg":S=="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 Re=Av.bind(vu);var Ro,lt,gf,Tv,Ga=0,Lv=[],_t=Ye,Mv=_t.__b,Dv=_t.__r,kv=_t.diffed,Nv=_t.__c,Ov=_t.unmount,Bv=_t.__;function bu(e,t){_t.__h&&_t.__h(lt,e,Ga||t),Ga=0;var n=lt.__H||(lt.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Va(e){return Ga=1,jv(Fv,e)}function jv(e,t,n){var r=bu(Ro++,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=lt,!lt.__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};lt.__f=!0;var o=lt.shouldComponentUpdate,a=lt.componentWillUpdate;lt.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)},lt.shouldComponentUpdate=i}return r.__N||r.__}function Po(e,t){var n=bu(Ro++,3);!_t.__s&&_f(n.__H,t)&&(n.__=e,n.u=t,lt.__H.__h.push(n))}function Ao(e,t){var n=bu(Ro++,4);!_t.__s&&_f(n.__H,t)&&(n.__=e,n.u=t,lt.__h.push(n))}function To(e){return Ga=5,Mn(function(){return{current:e}},[])}function Mn(e,t){var n=bu(Ro++,7);return _f(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ki(e,t){return Ga=8,Mn(function(){return e},t)}function wC(){for(var e;e=Lv.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(_u),t.__h.some(yf),t.__h=[]}catch(n){t.__h=[],_t.__e(n,e.__v)}}}_t.__b=function(e){lt=null,Mv&&Mv(e)},_t.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Bv&&Bv(e,t)},_t.__r=function(e){Dv&&Dv(e),Ro=0;var t=(lt=e.__c).__H;t&&(gf===lt?(t.__h=[],lt.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(_u),t.__h.some(yf),t.__h=[],Ro=0)),gf=lt},_t.diffed=function(e){kv&&kv(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Lv.push(t)!==1&&Tv===_t.requestAnimationFrame||((Tv=_t.requestAnimationFrame)||SC)(wC)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),gf=lt=null},_t.__c=function(e,t){t.some(function(n){try{n.__h.some(_u),n.__h=n.__h.filter(function(r){return!r.__||yf(r)})}catch(r){t.some(function(i){i.__h&&(i.__h=[])}),t=[],_t.__e(r,n.__v)}}),Nv&&Nv(e,t)},_t.unmount=function(e){Ov&&Ov(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{_u(r)}catch(i){t=i}}),n.__H=void 0,t&&_t.__e(t,n.__v))};var Iv=typeof requestAnimationFrame=="function";function SC(e){var t,n=function(){clearTimeout(r),Iv&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Iv&&(t=requestAnimationFrame(n))}function _u(e){var t=lt,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),lt=t}function yf(e){var t=lt;e.__c=e.__(),lt=t}function _f(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}N();function bf(e){let{navigationStack:t,setNavigationStack:n}=e,r=Mn(()=>t.length<=1?[]:t.slice(0,-1).map((a,s)=>({label:a.label,onClick:()=>n(c=>c.slice(0,s+1))})),[t,n]),i=t.length>0?()=>n([]):null,o=t.length>0?t[t.length-1].label:null;return Re`
      - ${i&&Se` + ${i&&Re` `} - ${r.map((a,s)=>Se` + ${r.map((a,s)=>Re`
      - `}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;tfS(t),[t]),s=p=>p.action&&!p.disabled,c=(p,u)=>{if(s(u))return n(p,u)};return Se` + `}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;tRC(t),[t]),s=u=>u.action&&!u.disabled,c=(u,p)=>{if(s(p))return n(u,p)};return Re`

      ${o}

      - ${a.map(p=>Se` -
        + ${a.map(u=>Re` +
          - ${p.entries.map(u=>Se` -
        • - <${s(u)?"button":"span"} - class=${dS(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=>Re` +
        • + <${s(p)?"button":"span"} + class=${PC(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&&Se``||u.imageHtml&&Se`
          `} - ${u.label?Se` - ${u.label} + ${p.imageUrl&&Re``||p.imageHtml&&Re`
          `} + ${p.label?Re` + ${p.label} `:null} - +
        • `)}
        `)}
      - `}function fS(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 dS(e,t){return Ei("entry",e.className,e.active?"active":"",e.disabled?"disabled":"",t?"selected":"")}function Jl(e){let{entry:t,selected:n,onMouseEnter:r,onMouseLeave:i,onAction:o}=e,a=(c,p)=>{if(!t.disabled)return o(c,t,p)},s=!t.entries;return Se` + `}function RC(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 PC(e,t){return Ni("entry",e.className,e.active?"active":"",e.disabled?"disabled":"",t?"selected":"")}function Ef(e){let{entry:t,selected:n,onMouseEnter:r,onMouseLeave:i,onAction:o}=e,a=(c,u)=>{if(!t.disabled)return o(c,t,u)},s=!t.entries;return Re`
    • - ${t.imageUrl&&Se``||t.imageHtml&&Se`
      `} + ${t.imageUrl&&Re``||t.imageHtml&&Re`
      `} - ${t.label?Se` + ${t.label?Re` ${t.label} `:null} - ${t.documentationRef&&Se` + ${t.documentationRef&&Re` c.stopPropagation()} @@ -112,7 +112,7 @@ `} - ${t.description&&Se` + ${t.description&&Re` @@ -120,7 +120,7 @@ `}
      - ${t.entries&&Se` + ${t.entries&&Re` `}
    • - `}function ef(e){let{selectedEntry:t,setSelectedEntry:n,groupedEntries:r,...i}=e,o=xo();return _o(()=>{let a=o.current;if(!a)return;let s=a.querySelector(".selected");s&&hS(s)},[t]),Se` + `}function wf(e){let{selectedEntry:t,setSelectedEntry:n,groupedEntries:r,...i}=e,o=To();return Ao(()=>{let a=o.current;if(!a)return;let s=a.querySelector(".selected");s&&AC(s)},[t]),Re`
      - ${r.map(a=>Se` - ${a.name&&Se` + ${r.map(a=>Re` + ${a.name&&Re`
      ${a.name}
      `}
        - ${a.entries.map(s=>Se` - <${Jl} + ${a.entries.map(s=>Re` + <${Ef} key=${s.id} entry=${s} selected=${s===t} @@ -150,35 +150,35 @@
      `)}
      - `}function hS(e){typeof e.scrollIntoViewIfNeeded=="function"?e.scrollIntoViewIfNeeded():e.scrollIntoView({scrollMode:"if-needed",block:"nearest"})}function tf(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,[y,v]=Da([]);yo(()=>{v([])},[f]);let[w,R]=Da(""),b=w.trim().length>0,x=xn(()=>vS(f),[f]),C=xn(()=>Ye(p)?x.length>5:!1,[p,x]),P=xn(()=>{let de=y.length?y[y.length-1].entries:f;return C?b?l(x.filter(({searchable:Ee})=>Ee!==!1),w,{keys:["label","search","description"]}).map(({item:Ee})=>Ee):de.filter(({rank:Ee=0})=>Ee>=0):de},[C,b,x,w,l,y,f]),O=xn(()=>b?P.length?[{id:"default",entries:P}]:[]:yS(P),[P,b]),[T,B]=Da(P[0]),I=xo(null);yo(()=>{let de=I.current;de&&P.includes(de)?B(de):B(P[0]),I.current=null},[P]);let W=bi(de=>{let Ee=gS(O),Ke=Ee.indexOf(T)+de;Ke<0&&(Ke=Ee.length-1),Ke>=Ee.length&&(Ke=0),B(Ee[Ke])},[O,T]),$=bi(de=>{de>0&&T&&T.entries&&v(Ee=>[...Ee,T]),de<0&&y.length>0&&(I.current=y[y.length+de],v(Ee=>Ee.slice(0,de)))},[T,y]),K=bi((de,Ee,Be)=>{if(!(!Ee||Ee.disabled))return Ee.entries?(de.preventDefault(),$(1)):n(de,Ee,Be)},[n,$]),he=bi(de=>{if(de.key==="Enter"&&T)return T.disabled?void 0:K(de,T);if(de.key==="Backspace"){let Ee=de.target;if(!(da(Ee,"input")&&Ee.value!==""))return $(-1),de.preventDefault()}if(de.key==="ArrowUp")return W(-1),de.preventDefault();if(de.key==="ArrowDown")return W(1),de.preventDefault();if(de.key==="ArrowRight")return $(1),de.preventDefault();if(de.key==="ArrowLeft")return $(-1),de.preventDefault()},[T,W,$,K]),Gt=bi(de=>{da(de.target,"input")&&R(()=>de.target.value)},[R]);yo(()=>(d(),()=>{h()}),[]);let De=!b&&y.length>0,ge=(a||i.length>0)&&!De;return Se` - <${zm} + `}function AC(e){typeof e.scrollIntoViewIfNeeded=="function"?e.scrollIntoViewIfNeeded():e.scrollIntoView({scrollMode:"if-needed",block:"nearest"})}N();function Sf(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,[g,v]=Va([]);Po(()=>{v([])},[f]);let[w,S]=Va(""),x=w.trim().length>0,b=Mn(()=>DC(f),[f]),R=Mn(()=>Ue(u)?b.length>5:!1,[u,b]),A=Mn(()=>{let he=g.length?g[g.length-1].entries:f;return R?x?l(b.filter(({searchable:we})=>we!==!1),w,{keys:["label","search","description"]}).map(({item:we})=>we):he.filter(({rank:we=0})=>we>=0):he},[R,x,b,w,l,g,f]),O=Mn(()=>x?A.length?[{id:"default",entries:A}]:[]:kC(A),[A,x]),[T,I]=Va(A[0]),L=To(null);Po(()=>{let he=L.current;he&&A.includes(he)?I(he):I(A[0]),L.current=null},[A]);let W=ki(he=>{let we=MC(O),Ze=we.indexOf(T)+he;Ze<0&&(Ze=we.length-1),Ze>=we.length&&(Ze=0),I(we[Ze])},[O,T]),z=ki(he=>{he>0&&T&&T.entries&&v(we=>[...we,T]),he<0&&g.length>0&&(L.current=g[g.length+he],v(we=>we.slice(0,he)))},[T,g]),K=ki((he,we,Ie)=>{if(!(!we||we.disabled))return we.entries?(he.preventDefault(),z(1)):n(he,we,Ie)},[n,z]),ve=ki(he=>{if(he.key==="Enter"&&T)return T.disabled?void 0:K(he,T);if(he.key==="Backspace"){let we=he.target;if(!(Ra(we,"input")&&we.value!==""))return z(-1),he.preventDefault()}if(he.key==="ArrowUp")return W(-1),he.preventDefault();if(he.key==="ArrowDown")return W(1),he.preventDefault();if(he.key==="ArrowRight")return z(1),he.preventDefault();if(he.key==="ArrowLeft")return z(-1),he.preventDefault()},[T,W,z,K]),Jt=ki(he=>{Ra(he.target,"input")&&S(()=>he.target.value)},[S]);Po(()=>(d(),()=>{m()}),[]);let ke=!x&&g.length>0,ye=(a||i.length>0)&&!ke;return Re` + <${$v} onClose=${t} - onKeyup=${Gt} - onKeydown=${he} + onKeyup=${Jt} + onKeydown=${ve} className=${r} position=${o} width=${s} scale=${c} > - ${ge&&Se` - <${Ql} + ${ye&&Re` + <${xf} headerEntries=${i} onSelect=${n} selectedEntry=${T} - setSelectedEntry=${B} + setSelectedEntry=${I} title=${a} /> `} - ${De&&Se` - <${Zl} - navigationStack=${y} + ${ke&&Re` + <${bf} + navigationStack=${g} setNavigationStack=${v} /> `} - ${f.length>0&&Se` + ${f.length>0&&Re`
      - ${C&&Se` + ${R&&Re` `} - ${b&&Se` + ${x&&Re`
      - ${P.length} ${P.length===1?"result":"results"} found + ${A.length} ${A.length===1?"result":"results"} found
      `} - <${ef} + <${wf} groupedEntries=${O} selectedEntry=${T} - setSelectedEntry=${B} + setSelectedEntry=${I} onAction=${K} />
      `} - ${u&&P.length===0&&Se` -
      ${Le(u)?u(w):u}
      + ${p&&A.length===0&&Re` +
      ${Le(p)?p(w):p}
      `} - - `}function zm(e){let{onClose:t,onKeydown:n,onKeyup:r,className:i,children:o,position:a}=e,s=xo();return _o(()=>{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]),_o(()=>{let c=s.current;if(!c)return;(c.querySelector("input")||c).focus()},[]),yo(()=>{let c=u=>{if(u.key==="Escape")return u.preventDefault(),t()},p=u=>{if(!Rn(u.target,".djs-popup",!0))return t()};return document.documentElement.addEventListener("keydown",c),document.body.addEventListener("click",p,!0),()=>{document.documentElement.removeEventListener("keydown",c),document.body.removeEventListener("click",p,!0)}},[]),Se` + + `}function $v(e){let{onClose:t,onKeydown:n,onKeyup:r,className:i,children:o,position:a}=e,s=To();return Ao(()=>{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]),Ao(()=>{let c=s.current;if(!c)return;(c.querySelector("input")||c).focus()},[]),Po(()=>{let c=p=>{if(p.key==="Escape")return p.preventDefault(),t()},u=p=>{if(!Bn(p.target,".djs-popup",!0))return t()};return document.documentElement.addEventListener("keydown",c),document.body.addEventListener("click",u,!0),()=>{document.documentElement.removeEventListener("keydown",c),document.body.removeEventListener("click",u,!0)}},[]),Re`
      ${o}
      - `}function mS(e){return{transform:`scale(${e.scale})`,width:`${e.width}px`,"transform-origin":"top left"}}function gS(e){let t=[];return e.forEach(n=>{n.entries.forEach(r=>{t.push(r)})}),t}function vS(e){let t=[];function n(r){r.forEach(i=>{if(i.entries){n(i.entries);return}t.push(i)})}return n(e),t}function yS(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 _S="data-id",Vm=["contextPad.close","canvas.viewbox.changing","commandStack.changed"],xS=1e3;function $e(e,t,n,r){this._eventBus=t,this._canvas=n,this._search=r,this._current=null;var i=Ye(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=Wm(n),s=Object.entries(r).map(([f,d])=>({id:f,...d})),c=e&&(f=>this._ensureVisible(f,e)),p=this._updateScale(this._current.container);ip(Se` - <${tf} + `}function TC(e){return{transform:`scale(${e.scale})`,width:`${e.width}px`,"transform-origin":"top left"}}function MC(e){let t=[];return e.forEach(n=>{n.entries.forEach(r=>{t.push(r)})}),t}function DC(e){let t=[];function n(r){r.forEach(i=>{if(i.entries){n(i.entries);return}t.push(i)})}return n(e),t}function kC(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 NC="data-id",zv=["contextPad.close","canvas.viewbox.changing","commandStack.changed"],OC=1e3;function Ve(e,t,n,r){this._eventBus=t,this._canvas=n,this._search=r,this._current=null;var i=Ue(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()})}Ve.$inject=["config.popupMenu","eventBus","canvas","search"];Ve.prototype._render=function(){let{position:e,providerId:t,entries:n,headerEntries:r,emptyPlaceholder:i,options:o}=this._current,a=Gv(n),s=Object.entries(r).map(([f,d])=>({id:f,...d})),c=e&&(f=>this._ensureVisible(f,e)),u=this._updateScale(this._current.container);yu(Re` + <${Sf} 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)};$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");var i=this._eventBus.fire("popupMenu.open.allowed",{target:e,providerId:t});if(i===!1)return;this.isOpen()&&this.close();let{entries:o,headerEntries:a,emptyPlaceholder:s}=this._getContext(e,t);this._current={position:n,providerId:t,target:e,entries:o,headerEntries:a,emptyPlaceholder:s,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;ip(null,e),Lt(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=_e(`
      `);return n.appendChild(r),r};$e.prototype._bindAutoClose=function(){this._eventBus.once(Vm,this.close,this)};$e.prototype._unbindAutoClose=function(){this._eventBus.off(Vm,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),Ye(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.yLe(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=Rn(e.delegateTarget||e.target,".entry",!0),o=Ze(i,_S);t={id:o,...this._getEntry(o)}}let r=t.action;if(this._emit("trigger",{entry:t,event:e})!==!1){if(Le(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};function Wm(e){return Object.entries(e).map(([t,n])=>{let r={id:t,...n};return r.entries&&(r.entries=Wm(r.entries)),r})}function nf(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=bS(o,i,r);return a?{item:o,tokens:a}:[]}).sort(ES(r))}function bS(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}=Ym(l,t);return{tokens:[...u.tokens,f],matchedWords:{...u.matchedWords,...d}}},{matchedWords:{},tokens:[]}):Ym(s,t);return{tokens:{...o.tokens,[a]:c},matchedWords:{...o.matchedWords,...p}}},{matchedWords:{},tokens:{}});return Object.keys(r).length!==t.length?null:i}function ES(e){return(t,n)=>{let r=0,i=1;for(let o of e){let a=wS(t.tokens[o],n.tokens[o]);if(a!==0){r+=a*i,i*=Gm;continue}let s=SS(t.item[o],n.item[o]);if(s!==0){r+=s*i,i*=Gm;continue}}return r}}function wS(e,t){return Um(t)-Um(e)}var Gm=.5,bo={FULL:131.9,START_FULL_WORD:8,START_WORD_PART:7.87,WORD_START:2.19,WORD_PART:1,NO_MATCH:-.07};function Um(e){let t=e.reduce((s,c)=>s+qm(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 qm(e){if(U(e))return Math.max(...e.map(qm));let t=Math.log(e.value.length);return e.match?(e.start?e.end?bo.FULL:e.wordEnd?bo.START_FULL_WORD:bo.START_WORD_PART:e.wordStart?bo.WORD_START:bo.WORD_PART)*t:bo.NO_MATCH*t}function Km(e=""){return U(e)?e.join(", "):e}function SS(e,t){return Km(e).localeCompare(Km(t))}function Ym(e,t){var p;if(!e)return{tokens:[],matchedWords:{}};let n=[],r={},i=t.map(CS),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,y=!!((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:y});let R=y?t:[u];for(let b of R)r[b.toLowerCase()]=!0;c=s.index+u.length}return c + `,this._current.container)};Ve.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");var i=this._eventBus.fire("popupMenu.open.allowed",{target:e,providerId:t});if(i===!1)return;this.isOpen()&&this.close();let{entries:o,headerEntries:a,emptyPlaceholder:s}=this._getContext(e,t);this._current={position:n,providerId:t,target:e,entries:o,headerEntries:a,emptyPlaceholder:s,container:this._createContainer({provider:t}),options:r},this._emit("open"),this._bindAutoClose(),this._render()};Ve.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()};Ve.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)}};Ve.prototype.close=function(){this.isOpen()&&(this._emit("close"),this.reset(),this._canvas.restoreFocus(),this._current=null)};Ve.prototype.reset=function(){let e=this._current.container;yu(null,e),Wt(e)};Ve.prototype._emit=function(e,t){this._eventBus.fire(`popupMenu.${e}`,t)};Ve.prototype._onOpened=function(){this._emit("opened")};Ve.prototype._onClosed=function(){this._emit("closed")};Ve.prototype._createContainer=function(e){var t=this._canvas,n=t.getContainer();let r=ue(`
      `);return n.appendChild(r),r};Ve.prototype._bindAutoClose=function(){this._eventBus.once(zv,this.close,this)};Ve.prototype._unbindAutoClose=function(){this._eventBus.off(zv,this.close,this)};Ve.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),Ue(n)&&er&&(i=r)),i};Ve.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.yLe(n.getEmptyPlaceholder));return t&&t.getEmptyPlaceholder()};Ve.prototype.isOpen=function(){return!!this._current};Ve.prototype.trigger=function(e,t,n="click"){if(e.preventDefault(),!t){let i=Bn(e.delegateTarget||e.target,".entry",!0),o=nt(i,NC);t={id:o,...this._getEntry(o)}}let r=t.action;if(this._emit("trigger",{entry:t,event:e})!==!1){if(Le(r)){if(n==="click")return r(e,t)}else if(r[n])return r[n](e,t)}};Ve.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 Gv(e){return Object.entries(e).map(([t,n])=>{let r={id:t,...n};return r.entries&&(r.entries=Gv(r.entries)),r})}N();function Cf(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=BC(o,i,r);return a?{item:o,tokens:a}:[]}).sort(IC(r))}function BC(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}=qv(l,t);return{tokens:[...p.tokens,f],matchedWords:{...p.matchedWords,...d}}},{matchedWords:{},tokens:[]}):qv(s,t);return{tokens:{...o.tokens,[a]:c},matchedWords:{...o.matchedWords,...u}}},{matchedWords:{},tokens:{}});return Object.keys(r).length!==t.length?null:i}function IC(e){return(t,n)=>{let r=0,i=1;for(let o of e){let a=LC(t.tokens[o],n.tokens[o]);if(a!==0){r+=a*i,i*=Vv;continue}let s=jC(t.item[o],n.item[o]);if(s!==0){r+=s*i,i*=Vv;continue}}return r}}function LC(e,t){return Wv(t)-Wv(e)}var Vv=.5,Mo={FULL:131.9,START_FULL_WORD:8,START_WORD_PART:7.87,WORD_START:2.19,WORD_PART:1,NO_MATCH:-.07};function Wv(e){let t=e.reduce((s,c)=>s+Kv(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 Kv(e){if(q(e))return Math.max(...e.map(Kv));let t=Math.log(e.value.length);return e.match?(e.start?e.end?Mo.FULL:e.wordEnd?Mo.START_FULL_WORD:Mo.START_WORD_PART:e.wordStart?Mo.WORD_START:Mo.WORD_PART)*t:Mo.NO_MATCH*t}function Uv(e=""){return q(e)?e.join(", "):e}function jC(e,t){return Uv(e).localeCompare(Uv(t))}function qv(e,t){var u;if(!e)return{tokens:[],matchedWords:{}};let n=[],r={},i=t.map(FC),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,g=!!((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:g});let S=g?t:[p];for(let x of S)r[x.toLowerCase()]=!0;c=s.index+p.length}return c @@ -259,8 +259,8 @@ - `},cp=RS;var AS=900;function Xr(e,t,n,r){e.registerProvider(AS,this),this._contextPad=e,this._popupMenu=t,this._translate=n,this._canvas=r}Xr.$inject=["contextPad","popupMenu","translate","canvas"];Xr.prototype.getMultiElementContextPadEntries=function(e){var t={};return this._isAllowed(e)&&S(t,this._getEntries(e)),t};Xr.prototype._isAllowed=function(e){return!this._popupMenu.isEmpty(e,"align-elements")};Xr.prototype._getEntries=function(){var e=this;return{"align-elements":{group:"align-elements",title:e._translate("Align elements"),html:`
      ${cp.align}
      `,action:{click:function(t,n){var r=e._getMenuPosition(n);S(r,{cursor:{x:t.x,y:t.y}}),e._popupMenu.open(n,"align-elements",r)}}}}};Xr.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 PS=["left","center","right","top","middle","bottom"];function wi(e,t,n,r){this._alignElements=t,this._translate=n,this._popupMenu=e,this._rules=r,e.registerProvider("align-elements",this)}wi.$inject=["popupMenu","alignElements","translate","rules"];wi.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&S(t,this._getEntries(e)),t};wi.prototype._isAllowed=function(e){return this._rules.allowed("elements.align",{elements:e})};wi.prototype._getEntries=function(e){var t=this._alignElements,n=this._translate,r=this._popupMenu,i={};return E(PS,function(o){i["align-elements-"+o]={group:"align",title:n("Align elements "+o),className:"bjs-align-elements-menu-entry",imageHtml:cp[o],action:function(){t.trigger(e,o),r.close()}}}),i};function At(e){k.call(this,e),this.init()}At.$inject=["eventBus"];N(At,k);At.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)})};At.prototype.init=function(){};function wo(e){At.call(this,e)}wo.$inject=["eventBus"];N(wo,At);wo.prototype.init=function(){this.addRule("elements.align",function(e){var t=e.elements,n=Q(t,function(r){return!(r.waypoints||r.host||r.labelTarget)});return n=Nr(n),n.length<2?!1:n})};var Xm={__depends__:[um,Kc,Eo],__init__:["alignElementsContextPadProvider","alignElementsMenuProvider","bpmnAlignElements"],alignElementsContextPadProvider:["type",Xr],alignElementsMenuProvider:["type",wi],bpmnAlignElements:["type",wo]};var TS=10,of=50,MS=250;function pp(e,t,n,r){for(var i;i=DS(e,n,t);)n=r(t,n,i);return n}function up(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 DS(e,t,n){var r={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height},i=kS(e);return ne(i,function(o){if(o===n)return!1;var a=je(o,r,TS);return a==="intersect"})}function Zm(e,t){t||(t={});function n(h){return h.source===e?1:-1}var r=t.defaultDistance||of,i=t.direction||"e",o=t.filter,a=t.getWeight||n,s=t.maxDistance||MS,c=t.reference||"start";o||(o=BS);function p(h,y){return i==="n"?c==="start"?X(h).top-X(y).bottom:c==="center"?X(h).top-q(y).y:X(h).top-X(y).top:i==="w"?c==="start"?X(h).left-X(y).right:c==="center"?X(h).left-q(y).x:X(h).left-X(y).left:i==="s"?c==="start"?X(y).top-X(h).bottom:c==="center"?q(y).y-X(h).bottom:X(y).bottom-X(h).bottom:c==="start"?X(y).left-X(h).right:c==="center"?q(y).x-X(h).right:X(y).right-X(h).right}var u=e.incoming.filter(o).map(function(h){var y=a(h),v=y<0?p(h.source,e):p(e,h.source);return{id:h.source.id,distance:v,weight:y}}),l=e.outgoing.filter(o).map(function(h){var y=a(h),v=y>0?p(e,h.target):p(h.target,e);return{id:h.target.id,distance:v,weight:y}}),f=u.concat(l).reduce(function(h,y){return h[y.id+"__weight_"+y.weight]=y,h},{}),d=Xe(f,function(h,y){var v=y.distance,w=y.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 Co(e){e.invoke(Dn,this)}Co.$inject=["injector"];N(Co,Dn);Co.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 Si(e){At.call(this,e);var t=this;this.addRule("element.autoResize",function(n){return t.canResize(n.elements,n.target)})}Si.$inject=["eventBus"];N(Si,At);Si.prototype.canResize=function(e,t){return!1};function Ro(e,t){Si.call(this,e),this._modeling=t}N(Ro,Si);Ro.$inject=["eventBus","modeling"];Ro.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")||J(r)){n=!1;return}}),n};var eg={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",Co],bpmnAutoResizeProvider:["type",Ro]};var tg=1500;function gp(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",tg,function(s){o(s)})}),(function(){var a,s;t.on("element.hover",function(c){a=c.gfx,s=c.element}),t.on("element.hover",tg,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),VS(c)}}gp.$inject=["elementRegistry","eventBus","injector"];function VS(e){return Rn(e,"svg, .djs-element",!0)}var ng={__init__:["hoverFix"],hoverFix:["type",gp]};var Ao=Math.round,rg="djs-drag-active";function Ci(e){e.preventDefault()}function WS(e){return typeof TouchEvent!="undefined"&&e instanceof TouchEvent}function GS(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function vp(e,t,n,r){var i={threshold:5,trapClick:!0},o;function a(b){var x=t.viewbox(),C=t._container.getBoundingClientRect();return{x:x.x+(b.x-C.left)/x.scale,y:x.y+(b.y-C.top)/x.scale}}function s(b,x){x=x||o;var C=e.createEvent(S({},x.payload,x.data,{isTouch:x.isTouch}));return e.fire("drag."+b,C)===!1?!1:e.fire(x.prefix+"."+b,C)}function c(b){var x=b.filter(function(C){return r.get(C.id)});x.length&&n.select(x)}function p(b,x){var C=o.payload,P=o.displacement,O=o.globalStart,T=yn(b),B=St(T,O),I=o.localStart,W=a(T),$=St(W,I);if(!o.active&&(x||GS(B)>o.threshold)){if(S(C,{x:Ao(I.x+P.x),y:Ao(I.y+P.y),dx:0,dy:0},{originalEvent:b}),s("start")===!1)return v();o.active=!0,o.keepSelection||(C.previousSelection=n.get(),n.select(null)),o.cursor&&xi(o.cursor),t.addMarker(t.getRootElement(),rg)}Dc(b),o.active&&(S(C,{x:Ao(W.x+P.x),y:Ao(W.y+P.y),dx:Ao($.x),dy:Ao($.y)},{originalEvent:b}),s("move"))}function u(b){var x,C=!0;o.active&&(b&&(o.payload.originalEvent=b,Dc(b)),C=s("end")),C===!1&&s("rejected"),x=w(C!==!0),s("ended",x)}function l(b){Ge("Escape",b)&&(Ci(b),v())}function f(b){var x;o.active&&(x=zc(e),setTimeout(x,400),Ci(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 y(b){s("out");var x=o.payload;x.hoverGfx=null,x.hover=null}function v(b){var x;if(o){var C=o.active;C&&s("cancel"),x=w(b),C&&s("canceled",x)}}function w(b){var x,C;s("cleanup"),$c(),o.trapClick?C=f:C=u,ae.unbind(document,"mousemove",p),ae.unbind(document,"dragstart",Ci),ae.unbind(document,"selectstart",Ci),ae.unbind(document,"mousedown",C,!0),ae.unbind(document,"mouseup",C,!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",y),t.removeMarker(t.getRootElement(),rg);var P=o.payload.previousSelection;return b!==!1&&P&&!n.get().length&&c(P),x=o,o=null,x}function R(b,x,C,P){o&&v(!1),typeof x=="string"&&(P=C,C=x,x=null),P=S({},i,P||{});var O=P.data||{},T,B,I,W,$;if(P.trapClick?W=f:W=u,b?(T=vr(b)||b,B=yn(b),Dc(b),T.type==="dragstart"&&Ci(T)):(T=null,B={x:0,y:0}),I=a(B),x||(x=I),$=WS(T),o=S({prefix:C,data:O,payload:{},globalStart:B,displacement:St(x,I),localStart:I,isTouch:$},P),P.manual||($?(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",Ci),ae.bind(document,"selectstart",Ci),ae.bind(document,"mousedown",W,!0),ae.bind(document,"mouseup",W,!0)),ae.bind(document,"keyup",l),e.on("element.hover",h),e.on("element.out",y)),s("init")===!1)return v(),!1;P.autoActivate&&p(b,!0)}e.on("diagram.destroy",v),this.init=R,this.move=p,this.hover=h,this.out=y,this.end=u,this.cancel=v,this.context=function(){return o},this.setOptions=function(b){S(i,b)}}vp.$inject=["eventBus","canvas","selection","elementRegistry"];var Ct={__depends__:[ng,Qe],dragging:["type",vp]};function Zr(e,t,n){this._canvas=n,this._opts=S({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()})}Zr.$inject=["config.autoScroll","eventBus","canvas"];Zr.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++)US(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 US(e,t,n){return tP-3&&(B=je(d.target,C),y===P-2?B==="intersect"&&(b.pop(),b[b.length-1]=C):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,mg)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(l){var f=l.context.hover;f&&n.removeMarker(f,mg)}),t.on("connectionSegment.move.cleanup",function(l){var f=l.context,d=f.connection;f.draggerGfx&&Ce(f.draggerGfx),n.removeMarker(d,gg)}),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,y=f.newSegmentStartIndex;h=h.map(function(C){return{original:C.original,x:Math.round(C.x),y:Math.round(C.y)}});var v=u(h,y),w=v.waypoints,R=s(d,w),b=v.segmentOffset,x={segmentMove:{segmentStartIndex:f.segmentStartIndex,newSegmentStartIndex:y+b}};o.updateWaypoints(d,R,x)})}Cp.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var s1=Math.abs,xg=Math.round;function bg(e,t,n){n=n===void 0?10:n;var r,i;for(r=0;ro-uf)return a-c+o}return a}function n(o,a){if(o.waypoints)return cg(a,o);if(o.width)return{x:Eg(o.width/2+o.x),y:Eg(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 y=[p[l-1],u,f,p[d+1]];return l<2&&y.unshift(n(c.source,o)),d>p.length-3&&y.unshift(n(c.target,o)),a.snapPoints=s={horizontal:[],vertical:[]},E(y,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;S(o,{dx:o.dx-l,dy:o.dy-f,x:p,y:u}),(l||a.vertical.indexOf(s)!==-1)&&He(o,"x",p),(f||a.horizontal.indexOf(c)!==-1)&&He(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);!le(s)||!c||!c.x||!c.y||(He(o,"x",c.x),He(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,y=l-d;S(o,{dx:o.dx-h,dy:o.dy-y,x:o.x-h,y:o.y-y}),(h||s.vertical.indexOf(u)!==-1)&&He(o,"x",f),(y||s.horizontal.indexOf(l)!==-1)&&He(o,"y",d)}})}Tp.$inject=["eventBus"];var wg={__depends__:[Ct,gt],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",Ep],bendpointMove:["type",Fa],bendpointMovePreview:["type",Sp],connectionSegmentMove:["type",Cp],bendpointSnapping:["type",Tp]};function Dp(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),!Tr(u)){if(u!==!1){s.source=c,s.target=p;return}u=s.canExecute=o(c,p),!Tr(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:Mp(s)?u:p,connectionEnd:Mp(s)?p:u};Pe(c)&&(d=c),s.connection=n.connect(l,f,d,h)}),this.start=function(a,s,c,p){Pe(c)||(p=c,c=q(s)),t.init(a,"connect",{autoActivate:p,data:{shape:s,context:{start:s,connectionStart:c}}})}}Dp.$inject=["eventBus","dragging","modeling","rules"];function Mp(e){var t=e.hover,n=e.source,r=e.target;return t&&n&&t===n&&n!==r}var p1=1100,u1=900,Sg="connect-ok",Cg="connect-not-ok";function kp(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,y=d;Mp(o)&&(h=d,y=f),r.drawPreview(o,a,{source:c||p,target:l||s,connectionStart:h,connectionEnd:y})}),t.on("connect.hover",u1,function(i){var o=i.context,a=i.hover,s=o.canExecute;s!==null&&n.addMarker(a,s?Sg:Cg)}),t.on(["connect.out","connect.cleanup"],p1,function(i){var o=i.hover;o&&(n.removeMarker(o,Sg),n.removeMarker(o,Cg))}),r&&t.on("connect.cleanup",function(i){r.cleanUp(i.context)})}kp.$inject=["injector","eventBus","canvas"];var Po={__depends__:[Qe,gt,Ct],__init__:["connectPreview"],connect:["type",Dp],connectPreview:["type",kp]};var l1="djs-dragger";function Nn(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)}Nn.$inject=["injector","canvas","graphicsFactory","elementFactory"];Nn.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()),cr(r),i||(i=e.getConnection=f1(function(y,v,w){return h.getConnection(y,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?q(o):c,a?q(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)"})};Nn.prototype.drawNoopPreview=function(e,t){var n=t.source,r=t.target,i=t.connectionStart||q(n),o=t.connectionEnd||q(r),a=this.cropWaypoints(i,o,n,r),s=this.createNoopConnection(a[0],a[1]);Z(e,s)};Nn.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&&jr(o,s,!0)||e,t=r&&jr(a,s,!1)||t,[e,t]};Nn.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&Ce(e.connectionPreviewGfx)};Nn.prototype.getConnection=function(e){var t=d1(e);return this._elementFactory.createConnection(t)};Nn.prototype.createConnectionPreviewGfx=function(){var e=G("g");return H(e,{pointerEvents:"none"}),ce(e).add(l1),Z(this._canvas.getActiveLayer(),e),e};Nn.prototype.createNoopConnection=function(e,t){return Hn([e,t],{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"})};function f1(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 d1(e){return Pe(e)?e:{}}var Rg={__init__:["connectionPreview"],connectionPreview:["type",Nn]};var h1=new qn("ps"),m1=["marker-start","marker-mid","marker-end"],g1=["circle","ellipse","line","path","polygon","polyline","path","rect"];function Zn(e,t,n,r){this._elementRegistry=e,this._canvas=n,this._styles=r}Zn.$inject=["elementRegistry","eventBus","canvas","styles"];Zn.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")};Zn.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)};Zn.prototype.addDragger=function(e,t,n,r="djs-dragger"){n=n||this.getGfx(e);var i=nl(n),o=n.getBoundingClientRect();return this._cloneMarkers(Pn(i),r),H(i,this._styles.cls(r,[],{x:o.top,y:o.left})),Z(t,i),H(i,"data-preview-support-element-id",e.id),i};Zn.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),H(n,"data-preview-support-element-id",e.id),n};Zn.prototype._cloneMarkers=function(e,t="djs-dragger",n=e){var r=this;e.childNodes&&e.childNodes.forEach(i=>{r._cloneMarkers(i,t,n)}),x1(e)&&m1.forEach(function(i){if(H(e,i)){var o=v1(e,i,r._canvas.getContainer());o&&r._cloneMarker(n,e,o,i,t)}})};Zn.prototype._cloneMarker=function(e,t,n,r,i="djs-dragger"){var o=[n.id,i,h1.next()].join("-"),a=ve("marker#"+n.id,e);e=e||this._canvas._svg;var s=a||nl(n);s.id=o,ce(s).add(i);var c=ve(":scope > defs",e);c||(c=G("defs"),Z(e,c)),Z(c,s);var p=_1(s.id);H(t,r,p)};function v1(e,t,n){var r=y1(H(e,t));return ve("marker#"+r,n||document)}function y1(e){return e.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]}function _1(e){return"url(#"+e+")"}function x1(e){return g1.indexOf(e.nodeName)!==-1}var bn={__init__:["previewSupport"],previewSupport:["type",Zn]};var Np="complex-preview",To=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(Np);n.filter(s=>!b1(s)).forEach(s=>{let c;le(s)?(c=this._graphicsFactory._createContainer("connection",G("g")),this._graphicsFactory.drawConnection(Pn(c),s)):(c=this._graphicsFactory._createContainer("shape",G("g")),this._graphicsFactory.drawShape(Pn(c),s),Ie(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);le(s)?Ie(p,c.x,c.y):Ie(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(Pn(p),s,{width:c.width,height:c.height}),Ie(p,c.x,c.y),this._previewSupport.addDragger(s,a,p)})}cleanUp(){cr(this._canvas.getLayer(Np)),this._markers.forEach(([t,n])=>this._canvas.removeMarker(t,n)),this._markers=[]}show(){this._canvas.showLayer(Np)}hide(){this._canvas.hideLayer(Np)}};To.$inject=["canvas","graphicsFactory","previewSupport"];function b1(e){return e.hidden}var Ag={__depends__:[bn],__init__:["complexPreview"],complexPreview:["type",To]};var lf=["top","bottom","left","right"],Op=10;function $a(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($r(i)&&!le(i)){var o=S1(i);o&&r(i,o)}}function r(i,o){var a=q(i),s=i.label,c=q(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=St(u,c);t.moveShape(s,l)}}}N($a,k);$a.$inject=["eventBus","modeling"];function E1(e){var t=e.host,n=q(e),r=je(n,t),i;r.indexOf("-")>=0?i=r.split("-"):i=[r];var o=lf.filter(function(a){return i.indexOf(a)===-1});return o}function w1(e){var t=q(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 S1(e){var t=q(e.label),n=q(e),r=Pg(n,t);if(C1(r)){var i=w1(e);if(e.host){var o=E1(e);i=i.concat(o)}var a=lf.filter(function(s){return i.indexOf(s)===-1});return a.indexOf(r)!==-1?je(e.label,e)!=="intersect"?void 0:r:a[0]}}function Pg(e,t){return je(t,e,5)}function C1(e){return lf.indexOf(e)!==-1}function za(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(za,k);za.$inject=["eventBus"];var R1=1500;function Va(e,t,n){e.invoke(k,this),this.preExecute("elements.delete",R1,function(i){var o=i.context,a=o.elements,s=r(a);s.length&&(o.elements=a.concat(s))}),t.on("shape.move.start",function(i){var o=i.context.shapes,a=r(o);a.length&&(i.context.shapes=o.concat(a))});function r(i){var o=Q(i,p=>m(p,"bpmn:Participant")||m(p,"bpmn:SubProcess"));if(!o.length)return[];var a=n.getRootElement(),s=new Set(a.children.filter(p=>m(p,"bpmn:Artifact"))),c=new Set;return E(o,p=>{let u=new Set(Sn(fi(Array.from(s),we(p))));c=c.union(u),s=s.difference(u)}),Array.from(c)}}N(Va,k);Va.$inject=["injector","eventBus","canvas"];function Wa(e,t){e.invoke(k,this),this.postExecute("shape.move",function(n){var r=n.newParent,i=n.shape,o=Q(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(Wa,k);Wa.$inject=["injector","modeling"];var Tg=500;function Mo(e,t){t.invoke(k,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",Tg,function(r){var i=r.elements;i=i.filter(function(o){var a=o.host;return Mg(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",Tg,function(r){var i=r.shapes,o=r.newHost;if(i.length===1){var a=i[0];Mg(a,o)&&(r.shapes=[n._replaceShape(a,o)])}},!0)}Mo.$inject=["bpmnReplace","injector"];N(Mo,k);Mo.prototype._replaceShape=function(e,t){var n=A1(e),r={type:"bpmn:BoundaryEvent",host:t};return n&&(r.eventDefinitionType=n.$type),this._bpmnReplace.replaceElement(e,r,{layoutConnection:!1})};function A1(e){var t=L(e),n=t.eventDefinitions;return n&&n[0]}function Mg(e,t){return!J(e)&&ee(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}function Ga(e,t){k.call(this,e);function n(r){return Q(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)})})}Ga.$inject=["eventBus","modeling"];N(Ga,k);function Ka(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,R=v.target;Do(w)&&Ua(R)&&u(R)}function i(v){let w=v.connection,R=v.source,b=v.target;Do(R)&&Bp(b)&&(p(b),f(R,[w]))}function o(v){let w=v.newTarget,R=v.oldSource,b=v.oldTarget;if(b!==w){let x=R;Ua(b)&&u(b),Do(x)&&Bp(w)&&p(w)}}function a(v){let{element:w}=v;Ua(w)?(l(w),d(w)):Bp(w)&&h(w)}function s(v){let{newData:w,oldShape:R}=v;if(Do(v.oldShape)&&w.eventDefinitionType!=="bpmn:CompensateEventDefinition"||w.type!=="bpmn:BoundaryEvent"){let b=R.outgoing.find(({target:x})=>Ua(x));b&&b.target&&(v._connectionTarget=b.target)}else if(!Do(v.oldShape)&&w.eventDefinitionType==="bpmn:CompensateEventDefinition"&&w.type==="bpmn:BoundaryEvent"){let b=R.outgoing.find(({target:x})=>Bp(x));b&&b.target&&(v._connectionTarget=b.target),y(R)}}function c(v){let{_connectionTarget:w,newShape:R}=v;w&&t.connect(R,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=>Ua(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(R=>Do(R.source));t.removeElements(w)}function y(v){let w=v.outgoing.filter(R=>m(R,"bpmn:SequenceFlow"));t.removeElements(w)}}N(Ka,k);Ka.$inject=["eventBus","modeling","bpmnRules"];function Ua(e){let t=L(e);return t&&t.get("isForCompensation")}function Do(e){return e&&m(e,"bpmn:BoundaryEvent")&&lr(e,"bpmn:CompensateEventDefinition")}function Bp(e){return e&&m(e,"bpmn:Activity")&&!qe(e)}function Ya(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=Er(r,"bpmn:Participant"))})}Ya.$inject=["injector"];N(Ya,k);function qa(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}})}qa.$inject=["eventBus","bpmnFactory"];N(qa,k);var ff=20,df=20,Dg=30,Ip=2e3;function Xa(e,t,n){k.call(this,t),t.on(["create.start","shape.move.start"],Ip,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")&&!J(l)&&!le(l)});if(c.length){var p=we(c),u=P1(a,p);S(a,u),o.createConstraints=T1(a,p)}}}),t.on("create.start",Ip,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",Ip,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",Ip,function(i){var o=i.elements,a=i.parent,s=M1(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)}Xa.$inject=["canvas","eventBus","modeling"];N(Xa,k);function P1(e,t){t={width:t.width+ff*2+Dg,height:t.height+df*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 T1(e,t){return t=X(t),{bottom:t.top+e.height/2-df,left:t.right-e.width/2+ff,top:t.bottom-e.height/2+df,right:t.left+e.width/2-ff-Dg}}function M1(e){return ne(e,function(t){return m(t,"bpmn:Participant")})}var kg="__targetRef_placeholder";function Za(e,t){k.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],Ng(o)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],Ng(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===kg});return!p&&s&&(p=t.create("bpmn:Property",{name:kg}),Re(c,p)),p}function i(a,s){var c=r(a);c&&(n(a,c,s)||Ne(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,y=h&&h.businessObject,v=c.businessObject,w;y&&y!==l&&i(y,p),d&&d!==l&&i(d,p),l?(w=r(l,!0),v.targetRef=w):v.targetRef=null}}Za.$inject=["eventBus","bpmnFactory"];N(Za,k);function Ng(e){return function(t){var n=t.context,r=n.connection;if(m(r,"bpmn:DataInputAssociation"))return e(t)}}function ko(e){this._bpmnUpdater=e}ko.$inject=["bpmnUpdater"];ko.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),[]};ko.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 Qa(e,t,n,r){k.call(this,r),t.registerHandler("dataStore.updateContainment",ko);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:k1(u,"bpmn:Participant");a(p,f)}}),this.postExecute("shape.delete",function(s){var c=s.context,p=c.shape,u=e.getRootElement();ee(p,["bpmn:Participant","bpmn:SubProcess"])&&m(u,"bpmn:Collaboration")&&o(u).filter(function(l){return D1(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)})})}Qa.$inject=["canvas","commandStack","elementRegistry","eventBus"];N(Qa,k);function D1(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 k1(e,t){for(;e.parent;){if(m(e.parent,t))return e.parent;e=e.parent}}var jp=Math.max,Fp=Math.min,N1=20;function Hp(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 Bg(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 Lp(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)?Fp:jp)(r,i)),te(o)&&(r=(/top|left/.test(e)?jp:Fp)(r,o)),r}function Ig(e,t){if(!t)return e;var n=X(e);return di({top:Lp("top",n,t),right:Lp("right",n,t),bottom:Lp("bottom",n,t),left:Lp("left",n,t)})}function Lg(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:Fp(o.top,a.top),left:Fp(o.left,a.left),bottom:jp(o.bottom,a.bottom),right:jp(o.right,a.right)};return di(s)}function Ja(e,t){return typeof e!="undefined"?e:N1}function O1(e,t){var n,r,i,o;return typeof t=="object"?(n=Ja(t.left),r=Ja(t.right),i=Ja(t.top),o=Ja(t.bottom)):n=r=i=o=Ja(t),{x:e.x-n,y:e.y-i,width:e.width+n+r,height:e.height+i+o}}function B1(e){return!(e.waypoints||e.type==="label")}function $p(e,t){var n;if(e.length===void 0?n=Q(e.children,B1):n=e,n.length)return O1(we(n),t)}var Qr=Math.abs;function I1(e,t){return Hp(X(t),X(e))}var L1=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],qt=30;function No(e,t){return t=t||[],e.children.filter(function(n){m(n,"bpmn:Lane")&&(No(n,t),t.push(n))}),t}function pn(e){return e.children.filter(function(t){return m(t,"bpmn:Lane")})}function Pt(e){return Er(e,L1)||e}function jg(e,t){var n=Pt(e),r=m(n,"bpmn:Process")?[]:[n],i=No(n,r),o=X(e),a=X(t),s=I1(e,t),c=[],p=Te(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,y=X(u);s.top&&(Qr(y.bottom-o.top)<10&&(d=a.top-y.bottom),Qr(y.top-o.top)<5&&(l=a.top-y.top)),s.left&&(Qr(y.right-o.left)<10&&(f=a.left-y.right),Qr(y.left-o.left)<5&&(h=a.left-y.left)),s.bottom&&(Qr(y.top-o.bottom)<10&&(l=a.bottom-y.top),Qr(y.bottom-o.bottom)<5&&(d=a.bottom-y.bottom)),s.right&&(Qr(y.left-o.right)<10&&(h=a.right-y.left),Qr(y.right-o.right)<5&&(f=a.right-y.right)),(l||f||d||h)&&c.push({shape:u,newBounds:Bg(u,{top:l,right:f,bottom:d,left:h})})}}),c}var j1=500;function es(e,t){k.call(this,e);function n(r,i){var o=Te(r),a=pn(i),s=[],c=[],p=[],u=[];if(An(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,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")),p.length&&(h=t.calculateAdjustments(p,"x",l,r.x-10),t.makeSpace(h.movingShapes,h.resizingShapes,{x:l,y:0},"e")),u.length&&(y=t.calculateAdjustments(u,"x",-l,r.x+r.width+10),t.makeSpace(y.movingShapes,y.resizingShapes,{x:-l,y:0},"w"))}}this.postExecuted("shape.delete",j1,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))})}es.$inject=["eventBus","spaceTool"];N(es,k);var Fg=500;function Oo(e,t){t.invoke(k,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",Fg,function(r){var i=r.elements;i.filter(function(o){var a=o.host;return Hg(o,a)}).map(function(o){return i.indexOf(o)}).forEach(function(o){r.elements[o]=n._replaceShape(i[o])})},!0),this.preExecute("elements.move",Fg,function(r){var i=r.shapes,o=r.newHost;i.forEach(function(a,s){var c=a.host;Hg(a,H1(i,c)?c:o)&&(i[s]=n._replaceShape(a))})},!0)}Oo.$inject=["bpmnReplace","injector"];N(Oo,k);Oo.prototype._replaceShape=function(e){var t=F1(e),n;return t?n={type:"bpmn:IntermediateCatchEvent",eventDefinitionType:t.$type}:n={type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,n,{layoutConnection:!1})};function F1(e){var t=L(e),n=t.eventDefinitions;return n&&n[0]}function Hg(e,t){return!J(e)&&m(e,"bpmn:BoundaryEvent")&&!t}function H1(e,t){return e.indexOf(t)!==-1}function ts(e,t,n){k.call(this,e);function r(i,o,a){var s=o.waypoints,c,p,u,l,f,d,h,y=i.outgoing.slice(),v=i.incoming.slice(),w;te(a.width)?w=q(a):w=a;var R=Na(s,w);if(R){if(c=s.slice(0,R.index),p=s.slice(R.index+(R.bendpoint?1:0)),!c.length||!p.length)return;u=R.bendpoint?s[R.index]:w,(c.length===1||!$g(i,c[c.length-1]))&&c.push(zg(u)),(p.length===1||!$g(i,p[0]))&&p.unshift(zg(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&&Q(v,function(x){return x.source===d.source})||[],h&&Q(y,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=q(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&&Na(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(ts,k);ts.$inject=["eventBus","bpmnRules","modeling"];function $g(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 zg(e){return S({},e)}function ns(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)&&Bo(i)){var c=[];m(o,"bpmn:EventBasedGateway")?c=a.incoming.filter(p=>p!==i&&Bo(p)):c=a.incoming.filter(p=>p!==i&&Bo(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(Bo).reduce(function(a,s){return a.includes(s.target)?a:a.concat(s.target)},[]);o.forEach(function(a){a.incoming.filter(Bo).forEach(function(s){let c=a.incoming.filter(Bo).filter(function(p){return p.source===i});(s.source!==i||c.length>1)&&t.removeConnection(s)})})}})}ns.$inject=["eventBus","modeling"];N(ns,k);function Bo(e){return m(e,"bpmn:SequenceFlow")}var zp=1500,Vg=2e3;function Vp(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"],zp,function(r){var i=r.context,o=i.shape||r.shape,a=r.hover;m(a,"bpmn:Lane")&&!ee(o,["bpmn:Lane","bpmn:Participant"])&&(r.hover=Pt(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"],zp,function(r){var i=r.hover;m(i,"bpmn:Lane")&&(r.hover=Pt(i)||i,r.hoverGfx=e.getGraphics(r.hover))}),t.on(["bendpoint.move.hover"],zp,function(r){var i=r.context,o=r.hover,a=i.type;m(o,"bpmn:Lane")&&/reconnect/.test(a)&&(r.hover=Pt(o)||o,r.hoverGfx=e.getGraphics(r.hover))}),t.on(["connect.start"],zp,function(r){var i=r.context,o=i.start;m(o,"bpmn:Lane")&&(i.start=Pt(o)||o)}),t.on("shape.move.start",Vg,function(r){var i=r.shape;m(i,"bpmn:Lane")&&(r.shape=Pt(i)||i)}),t.on("spaceTool.move",Vg,function(r){var i=r.hover;i&&m(i,"bpmn:Lane")&&(r.hover=Pt(i))})}Vp.$inject=["elementRegistry","eventBus","canvas"];function Wg(e){return e.create("bpmn:Category")}function Gg(e){return e.create("bpmn:CategoryValue")}function Ug(e,t,n){return Re(t.get("categoryValue"),e),e.$parent=t,Re(n.get("rootElements"),t),t.$parent=n,e}function Kg(e){var t=e.$parent;return t&&(Ne(t.get("categoryValue"),e),e.$parent=null),e}function Yg(e){var t=e.$parent;return t&&(Ne(t.get("rootElements"),e),e.$parent=null),e}var qg=770;function rs(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,y){return h.some(function(v){var w=L(v),R=w.categoryValueRef&&w.categoryValueRef.$parent;return R===y})}function c(h,y){return h.some(function(v){var w=L(v);return w.categoryValueRef===y})}function p(h,y,v){var w=a().filter(function(R){return R.businessObject!==v});y&&!s(w,y)&&Yg(y),h&&!c(w,h)&&Kg(h)}function u(h,y){return Ug(h,y,t.getDefinitions())}function l(h,y){var v=L(h),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||Wg(e)),u(w,R,t.getDefinitions())}function f(h,y){var v=y.category,w=y.categoryValue,R=L(h);w?(R.categoryValueRef=null,p(w,v,R)):p(null,R.categoryValueRef.$parent,R)}this.execute("label.create",function(h){var y=h.context,v=y.labelTarget;m(v,"bpmn:Group")&&l(v,y)}),this.revert("label.create",function(h){var y=h.context,v=y.labelTarget;m(v,"bpmn:Group")&&f(v,y)}),this.execute("shape.delete",function(h){var y=h.context,v=y.shape,w=L(v);if(!(!m(v,"bpmn:Group")||v.labelTarget)){var R=y.categoryValue=w.categoryValueRef,b;R&&(b=y.category=R.$parent,p(R,b,w),w.categoryValueRef=null)}}),this.reverted("shape.delete",function(h){var y=h.context,v=y.shape;if(!(!m(v,"bpmn:Group")||v.labelTarget)){var w=y.category,R=y.categoryValue,b=L(v);R&&(b.categoryValueRef=R,u(R,w))}}),this.execute("shape.create",function(h){var y=h.context,v=y.shape;!m(v,"bpmn:Group")||v.labelTarget||L(v).categoryValueRef&&l(v,y)}),this.reverted("shape.create",function(h){var y=h.context,v=y.shape;!m(v,"bpmn:Group")||v.labelTarget||L(v).categoryValueRef&&f(v,y)});function d(h,y){var v=e.create(h.$type);return o.copyElement(h,v,null,y)}r.on("copyPaste.copyElement",qg,function(h){var y=h.descriptor,v=h.element;if(!(!m(v,"bpmn:Group")||v.labelTarget)){var w=L(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(h){var y=h.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})}rs.$inject=["bpmnFactory","bpmnjs","elementRegistry","eventBus","injector","moddleCopy"];N(rs,k);function Io(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 Wp(e){function t(r,i,o){var a={x:o.x,y:o.y-50},s={x:o.x-50,y:o.y},c=Io(r,i,o,a),p=Io(r,i,o,s),u;c&&p?Xg(c,o)>Xg(p,o)?u=p:u=c:u=c||p,r.original=u}function n(r){var i=r.waypoints;t(i[0],i[1],q(r.source)),t(i[i.length-1],i[i.length-2],q(r.target))}e.on("bpmnElement.added",function(r){var i=r.element;i.waypoints&&n(i)})}Wp.$inject=["eventBus"];function Xg(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function is(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(ee(i,t)){var a=o.get("isHorizontal");a===void 0&&(a=!0),o.set("isHorizontal",a)}})}is.$inject=["eventBus"];N(is,k);var tv=Math.sqrt,nv=Math.min,$1=Math.max,Zg=Math.abs;function Qg(e){return Math.pow(e,2)}function os(e,t){return tv(Qg(e.x-t.x)+Qg(e.y-t.y))}function rv(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:ev(r,p[0])?n:n+1}),p.length===2&&(s=W1(p[0],p[1]),u={type:"segment",position:s,segmentIndex:n,relativeLocation:os(r,s)/os(r,i)}),l=os(u.position,e),(!d||f>l)&&(d=u,f=l)}return d}function z1(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=tv(d),y=-l+h,v=-l-h,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(b){return V1(b,e,t)})}function V1(e,t,n){return Jg(e.x,t.x,n.x)&&Jg(e.y,t.y,n.y)}function Jg(e,t,n){return e>=nv(t,n)-Gp&&e<=$1(t,n)+Gp}function W1(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}var Gp=.1;function ev(e,t){return Zg(e.x-t.x)<=Gp&&Zg(e.y-t.y)<=Gp}function ov(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=iv(n,c),l=iv(t,p),f=s.position,d=U1(u,f),h=G1(u,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{L(a.context.element)===a.context.moddleElement&&i(a)});function i(a){var s=a.context,c=s.element,p=s.properties;if(cv in p&&t.updateLabel(c,p[cv]),pv in p&&m(c,"bpmn:TextAnnotation")){var u=r.getTextAnnotationBounds({x:c.x,y:c.y,width:c.width,height:c.height},p[pv]||"");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;J(p)||!rn(p)||pt(p)&&t.updateLabel(p,pt(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=S({},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),sv(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&&rn(u)&&p.label&&c.label&&(c.label.x=p.label.x,c.label.y=p.label.y)}),this.preExecute("shape.resize",function(a){var s=a.context,c=s.shape,p=s.hints||{};if(!(!J(c)||p.autoResize)){var u=s.newBounds,l=r.getDimensions(pt(c)||"",{box:u,style:r.getExternalStyle()}),f=Math.ceil(l.height),d=u.y!==c.y,h=c.y+c.height;s.newBounds={width:u.width,height:f,x:u.x,y:d?h-f:u.y}}}),this.postExecute("shape.resize",function(a){var s=a.context,c=s.shape,p=s.newBounds,u=s.oldBounds;if($r(c)){var l=c.label,f=q(l),d=J1(u),h=Q1(f,d),y=Z1(h,u,p);t.moveShape(l,y)}})}N(as,k);as.$inject=["eventBus","modeling","bpmnFactory","textRenderer"];function Z1(e,t,n){var r=Ti(e,t,n);return gn(St(r,e))}function Q1(e,t){if(t.length){var n=eC(e,t);return Oa(e,n)}}function J1(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 eC(e,t){var n=t.map(function(i){return{line:i,distance:_p(e,i)}}),r=Rt(n,"distance");return r[0].line}function uv(e,t,n,r){return Up(e,t,n,r).point}function ss(e,t){k.call(this,e);function n(r,i){var o=r.context,a=o.connection,s=S({},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),uv(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(ss,k);ss.$inject=["eventBus","modeling"];function Jr(e,t,n){var r=Kp(e),i=fv(r,t),o=r[0];return i.length?i[i.length-1]:Ti(o.original||o,n,t)}function ei(e,t,n){var r=Kp(e),i=fv(r,t),o=r[r.length-1];return i.length?i[0]:Ti(o.original||o,n,t)}function Lo(e,t,n){var r=Kp(e),i=lv(t,n),o=r[0];return Ti(o.original||o,i,t)}function jo(e,t,n){var r=Kp(e),i=lv(t,n),o=r[r.length-1];return Ti(o.original||o,i,t)}function lv(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function Kp(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function fv(e,t){var n=Ve(e,nC);return Q(n,function(r){return tC(r,t)})}function tC(e,t){return je(t,e,1)==="intersect"}function nC(e){return e.original||e}function cs(e,t){k.call(this,e),this.postExecute("shape.replace",function(n){var r=n.oldShape,i=n.newShape;if(rC(r,i)){var o=iC(r);o.incoming.forEach(function(a){var s=ei(a,i,r);t.reconnectEnd(a,i,s)}),o.outgoing.forEach(function(a){var s=Jr(a,i,r);t.reconnectStart(a,i,s)})}},!0)}cs.$inject=["eventBus","modeling"];N(cs,k);function rC(e,t){return m(e,"bpmn:Participant")&&re(e)&&m(t,"bpmn:Participant")&&!re(t)}function iC(e){var t=$n([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 oC=["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:EscalationEventDefinition","bpmn:ConditionalEventDefinition","bpmn:SignalEventDefinition"];function Yp(e){let t=L(e);if(!m(t,"bpmn:BoundaryEvent")&&!(m(t,"bpmn:StartEvent")&&qe(t.$parent)))return!1;let n=t.get("eventDefinitions");return!n||!n.length?!1:oC.some(r=>m(n[0],r))}function qp(e){return m(e,"bpmn:BoundaryEvent")?"cancelActivity":"isInterrupting"}function ps(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(!Yp(i))return;let a=qp(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})})}ps.$inject=["injector","modeling"];N(ps,k);function us(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(us,k);us.$inject=["eventBus","modeling"];function ls(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=aC(o.waypoints,a.waypoints);n.reconnectEnd(o,a.target,s)}}})}N(ls,k);ls.$inject=["eventBus","bpmnRules","modeling"];function Fo(e){return e.original||e}function aC(e,t){var n=Io(Fo(e[e.length-2]),Fo(e[e.length-1]),Fo(t[1]),Fo(t[0]));return n?[].concat(e.slice(0,e.length-1),[n],t.slice(1)):[Fo(e[0]),Fo(t[t.length-1])]}function fs(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)}fs.$inject=["eventBus","modeling"];N(fs,k);function ds(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,bt({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(ds,k);ds.$inject=["eventBus","modeling","bpmnRules","injector"];function Ho(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=Xe(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){qe(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(Ho,k);Ho.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)};Ho.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var sC=1500,dv={width:140,height:120},Xp={width:300,height:60},Zp={width:60,height:300},hs={width:300,height:150},ms={width:150,height:300},mf={width:140,height:120},gf={width:100,height:40};function Qp(e){e.on("resize.start",sC,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=fC(r,i,o)),m(r,"bpmn:SubProcess")&&re(r)&&(n.minDimensions=mf),m(r,"bpmn:TextAnnotation")&&(n.minDimensions=gf)})}Qp.$inject=["eventBus"];var ti=Math.abs,cC=Math.min,pC=Math.max;function hv(e,t,n,r){var i=e[t];e[t]=i===void 0?n:r(n,i)}function $o(e,t,n){return hv(e,t,n,cC)}function zo(e,t,n){return hv(e,t,n,pC)}var uC={top:20,left:50,right:20,bottom:20},lC={top:50,left:20,right:20,bottom:20};function fC(e,t,n){var r=Pt(e),i=!0,o=!0,a=No(r,[r]),s=X(e),c={},p={},u=Te(e),l=u?Xp:Zp;/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 y=X(h);u?(y.tops.bottom+10&&(o=!1)):(y.lefts.right+10&&(o=!1)),/n/.test(t)&&(n&&ti(s.top-y.bottom)<10&&zo(c,"top",y.top+l.height),ti(s.top-y.top)<5&&$o(p,"top",y.bottom-l.height)),/e/.test(t)&&(n&&ti(s.right-y.left)<10&&$o(c,"right",y.right-l.width),ti(s.right-y.right)<5&&zo(p,"right",y.left+l.width)),/s/.test(t)&&(n&&ti(s.bottom-y.top)<10&&$o(c,"bottom",y.bottom-l.height),ti(s.bottom-y.bottom)<5&&zo(p,"bottom",y.top+l.height)),/w/.test(t)&&(n&&ti(s.left-y.right)<10&&zo(c,"left",y.left+l.width),ti(s.left-y.left)<5&&$o(p,"left",y.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?uC:lC;return f.forEach(function(h){var y=X(h);/n/.test(t)&&(!u||i)&&$o(p,"top",y.top-d.top),/e/.test(t)&&(u||o)&&zo(p,"right",y.right+d.right),/s/.test(t)&&(!u||o)&&zo(p,"bottom",y.bottom+d.bottom),/w/.test(t)&&(u||i)&&$o(p,"left",y.left-d.left)}),{min:p,max:c}}var mv=1001;function Jp(e,t){e.on("resize.start",mv+500,function(n){var r=n.context,i=r.shape;(m(i,"bpmn:Lane")||m(i,"bpmn:Participant"))&&(r.balanced=!yr(n))}),e.on("resize.end",mv,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=cc(a),t.resizeLane(i,a,r.balanced)),!1})}Jp.$inject=["eventBus","modeling"];var dC=500;function gs(e,t,n,r,i){n.invoke(k,this);function o(u){return ee(u,["bpmn:ReceiveTask","bpmn:SendTask"])||hC(u,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(u){var l=e.getDefinitions(),f=l.get("rootElements");return!!ne(f,bt({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(ee(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(ee(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"),Re(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");Ne(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",dC,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)})}gs.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"];N(gs,k);function hC(e,t){return U(t)||(t=[t]),It(t,function(n){return lr(e,n)})}var gv=Math.max;function eu(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]=gC(a,r,i)),m(a,"bpmn:Lane")&&(o[s]=Te(a)?Xp:Zp),m(a,"bpmn:SubProcess")&&re(a)&&(o[s]=mf),m(a,"bpmn:TextAnnotation")&&(o[s]=gf),m(a,"bpmn:Group")&&(o[s]=dv)}),o})}eu.$inject=["eventBus"];function mC(e){return e==="x"}function gC(e,t,n){var r=Te(e);if(!_C(e))return r?hs:ms;var i=mC(t),o={};return i?r?o=hs:o={width:yC(e,n,i),height:ms.height}:r?o={width:hs.width,height:vC(e,n,i)}:o=ms,o}function vC(e,t,n){var r;return r=xC(e,t,n),gv(hs.height,r)}function yC(e,t,n){var r;return r=bC(e,t,n),gv(ms.width,r)}function _C(e){return!!pn(e).length}function xC(e,t,n){var r=pn(e),i;return i=vf(r,t,n),e.height-i.height+Xp.height}function bC(e,t,n){var r=pn(e),i;return i=vf(r,t,n),e.width-i.width+Zp.width}function vf(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=pn(i),o.length?vf(o,t,n):i}var vv=400,EC=600,yv={x:180,y:160};function On(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")&&!re(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(an(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(an(d));if(!(!h||!d.children||!d.children.length)){var y=_v(d);s._showRecursively(y),s._moveChildrenToShape(y,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")||!re(f)||E(yi([f]),d=>{n.removeShape(d.annotation)})},!0),this.preExecuted("shape.delete",function(l){var f=l.shape;if(c(f)){var d=a.get(an(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(an(f)))},!0),this.postExecuted("shape.replace",function(l){var f=l.newShape,d=l.oldRoot,h=e.findRoot(an(f));if(!(!d||!h)){var y=d.children;n.moveElements(y,{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,y=h.id,v=d.id;if(y!==v){if(fo(f)){a.updateId(f,Wr(v)),a.updateId(y,v);return}var w=a.get(Wr(y));w&&a.updateId(Wr(y),Wr(v))}}},!0),this.reverted("element.updateProperties",function(l){var f=l.element;if(m(f,"bpmn:SubProcess")){var d=l.properties,h=l.oldProperties,y=h.id,v=d.id;if(y!==v){if(fo(f)){a.updateId(f,Wr(y)),a.updateId(v,y);return}var w=a.get(Wr(v));w&&a.updateId(w,Wr(y))}}},!0),t.on("element.changed",function(l){var f=l.element;if(fo(f)){var d=f,h=a.get(Bl(d));!h||h===d||t.fire("element.changed",{element:h})}}),this.executed("shape.toggleCollapse",vv,function(l){var f=l.shape;m(f,"bpmn:SubProcess")&&(re(f)?u(l):(p(l),s._showRecursively(f.children)))},!0),this.reverted("shape.toggleCollapse",vv,function(l){var f=l.shape;m(f,"bpmn:SubProcess")&&(re(f)?u(l):(p(l),s._showRecursively(f.children)))},!0),this.postExecuted("shape.toggleCollapse",EC,function(l){var f=l.shape;if(m(f,"bpmn:SubProcess")){var d=l.newRootElement;if(d)if(re(f))s._moveChildrenToShape(d.children.slice(),f),E(yi(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 h=_v(f);s._moveChildrenToShape(h,d)}}},!0),t.on("copyPaste.createTree",function(l){var f=l.element,d=l.children;if(c(f)){var h=an(f),y=a.get(h);y&&d.push.apply(d,y.children)}}),t.on("copyPaste.copyElement",function(l){var f=l.descriptor,d=l.element,h=l.elements,y=d.parent,v=m(se(y),"bpmndi:BPMNPlane");if(v){var w=Bl(y),R=ne(h,function(b){return b.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)})}N(On,k);On.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=we(r),o;if(!t.x)o={x:yv.x-i.x,y:yv.y-i.y};else{var a=q(t),s=q(i);o={x:a.x-s.x,y:a.y-s.y}}n.moveElements(e,o,t,{autoResize:!1})}};On.prototype._disconnectSharedAnnotations=function(e){var t=this._modeling,n=new Set(Dl(e).map(r=>r.annotation));n.size&&E(yi(e.children),r=>{n.has(r.annotation)&&E(r.associations,i=>{t.removeConnection(i)})})};On.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};On.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};On.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:an(e),type:e.$type,di:r,businessObject:e,collapsed:!0});return o};On.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};On.$inject=["canvas","eventBus","modeling","elementFactory","bpmnFactory","bpmnjs","elementRegistry"];function wC(e){var t=[];return E(yi(e),n=>{t.push(n.annotation),t.push.apply(t,n.associations)}),t}function _v(e){return e.children.slice().concat(wC(e.children)).concat(SC(e))}function SC(e){return ga(e.children||[],!0,-1).reduce(function(t,n){return n.label&&n.label.parent!==e&&t.push(n.label),t},[])}function vs(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"))||!re(i))){var o=CC(i);t.createShape({type:"bpmn:StartEvent"},o,i)}})}vs.$inject=["injector","modeling"];N(vs,k);function CC(e){return{x:e.x+e.width/6,y:e.y+e.height/2}}function ys(e,t){k.call(this,e),this.preExecute("connection.create",function(n){let{target:r}=n;m(r,"bpmn:TextAnnotation")&&(n.parent=r.parent)},!0),this.preExecute(["shape.create","shape.resize","elements.move"],function(n){let r=n.shapes||[n.shape];r.length===1&&m(r[0],"bpmn:TextAnnotation")&&(n.hints=n.hints||{},n.hints.autoResize=!1)},!0),this.preExecute("shape.resize",function(n){var r=n.context,i=r.shape,o=r.hints||{};if(!(!m(i,"bpmn:TextAnnotation")||o.autoResize)){var a=r.newBounds,s=t.getTextAnnotationBounds(a,pt(i)||""),c=a.y!==i.y&&Math.abs(a.y+a.height-(i.y+i.height))<=1,p=i.y+i.height;r.newBounds={width:a.width,height:s.height,x:a.x,y:c?p-s.height:a.y}}})}N(ys,k);ys.$inject=["eventBus","textRenderer"];function _s(e,t){k.call(this,e),this.postExecuted("shape.toggleCollapse",1500,function(n){var r=n.shape;if(re(r))return;var i=$n(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,q(r)):t.reconnectStart(a,r,q(r)))}},!0)}N(_s,k);_s.$inject=["eventBus","modeling"];var yf=500;function xs(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=RC(c).concat([a]),l=$p(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"],yf,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"],yf,function(a){var s=a.context,c=s.shape;c.collapsed?se(c).isExpanded=!1:se(c).isExpanded=!0}),this.postExecuted(["shape.toggleCollapse"],yf,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(xs,k);xs.$inject=["eventBus","elementFactory","modeling"];function RC(e){return e.filter(function(t){return!t.hidden})}function bs(e,t,n,r){t.invoke(k,this),this.preExecute("shape.delete",function(i){var o=i.context,a=o.shape,s=a.businessObject;J(a)||(m(a,"bpmn:Participant")&&re(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(bs,k);bs.$inject=["canvas","injector","moddle","modeling"];function Es(e,t){k.call(this,e),this.preExecute("connection.delete",function(n){var r=n.context,i=r.connection,o=i.source;AC(i,o)&&t.updateProperties(o,{default:null})})}N(Es,k);Es.$inject=["eventBus","modeling"];function AC(e,t){if(!m(e,"bpmn:SequenceFlow"))return!1;var n=L(t),r=L(e);return n.get("default")===r}var PC=500,TC=5e3;function ws(e,t){k.call(this,e);var n;function r(){return n=n||new MC,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,TC,function(s){r()}),this.postExecuted(a,PC,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))})}ws.$inject=["eventBus","modeling"];N(ws,k);function MC(){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 Ss(e,t){k.call(this,e),this.postExecuted("elements.create",function(n){let r=n.context,i=r.elements;for(let o of i)DC(o)&&!NC(o)&&t.updateProperties(o,{isForCompensation:void 0})})}N(Ss,k);Ss.$inject=["eventBus","modeling"];function DC(e){let t=L(e);return t&&t.isForCompensation}function kC(e){return e&&m(e,"bpmn:BoundaryEvent")&&lr(e,"bpmn:CompensateEventDefinition")}function NC(e){return e.incoming.filter(n=>kC(n.source)).length>0}var xv={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","artifactBehavior","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",$a],appendBehavior:["type",za],associationBehavior:["type",Wa],attachEventBehavior:["type",Mo],artifactBehavior:["type",Va],boundaryEventBehavior:["type",Ga],compensateBoundaryEventBehaviour:["type",Ka],createBehavior:["type",Ya],createDataObjectBehavior:["type",qa],createParticipantBehavior:["type",Xa],dataInputAssociationBehavior:["type",Za],dataStoreBehavior:["type",Qa],deleteLaneBehavior:["type",es],detachEventBehavior:["type",Oo],dropOnFlowBehavior:["type",ts],eventBasedGatewayBehavior:["type",ns],fixHoverBehavior:["type",Vp],groupBehavior:["type",rs],importDockingFix:["type",Wp],isHorizontalFix:["type",is],labelBehavior:["type",as],layoutConnectionBehavior:["type",ss],messageFlowBehavior:["type",cs],nonInterruptingBehavior:["type",ps],removeElementBehavior:["type",ls],removeEmbeddedLabelBoundsBehavior:["type",us],removeParticipantBehavior:["type",fs],replaceConnectionBehavior:["type",ds],replaceElementBehaviour:["type",Ho],resizeBehavior:["type",Qp],resizeLaneBehavior:["type",Jp],rootElementReferenceBehavior:["type",gs],spaceToolBehavior:["type",eu],subProcessPlaneBehavior:["type",On],subProcessStartEventBehavior:["type",vs],textAnnotationBehavior:["type",ys],toggleCollapseConnectionBehaviour:["type",_s],toggleElementCollapseBehaviour:["type",xs],unclaimIdBehavior:["type",bs],unsetDefaultFlowBehavior:["type",Es],updateFlowNodeRefsBehavior:["type",ws],setCompensationActivityAfterPasteBehavior:["type",Ss]};function tu(e,t){var n=je(e,t,-15);return n!=="intersect"?n:null}function vt(e){At.call(this,e)}N(vt,At);vt.$inject=["eventBus"];vt.prototype.init=function(){this.addRule("connection.start",function(e){var t=e.source;return OC(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 nu(t,n)}finally{i&&(n.parent=null)}}),this.addRule("connection.reconnect",function(e){var t=e.connection,n=e.source,r=e.target;return nu(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,r=e.direction;return Ov(t,n,r)}),this.addRule("elements.create",function(e){var t=e.elements,n=e.position,r=e.target;return le(r)&&!ru(t,r,n)?!1:hn(t,function(i){return le(i)?nu(i.source,i.target,i):i.host?Cs(i,i.host,null,n):bf(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:Cs(n,t,null,r)||kv(n,t,r)||Nv(n,t,r)||ru(n,t,r)}),this.addRule("shape.create",function(e){return bf(e.shape,e.target,e.source,e.position)}),this.addRule("shape.attach",function(e){return Cs(e.shape,e.target,null,e.position)}),this.addRule("element.copy",function(e){var t=e.element,n=e.elements;return Fv(n,t)})};vt.prototype.canConnectMessageFlow=Lv;vt.prototype.canConnectSequenceFlow=jv;vt.prototype.canConnectDataAssociation=wf;vt.prototype.canConnectAssociation=Bv;vt.prototype.canConnectCompensationAssociation=Iv;vt.prototype.canMove=Nv;vt.prototype.canAttach=Cs;vt.prototype.canReplace=kv;vt.prototype.canDrop=Vo;vt.prototype.canInsert=ru;vt.prototype.canCreate=bf;vt.prototype.canConnect=nu;vt.prototype.canResize=Ov;vt.prototype.canCopy=Fv;function OC(e){return _f(e)?null:ee(e,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}function _f(e){return!e||J(e)}function bv(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 xf(e){return m(e,"bpmn:TextAnnotation")}function Ef(e){return m(e,"bpmn:Group")&&!e.labelTarget}function Cv(e){return m(e,"bpmn:BoundaryEvent")&&Qn(e,"bpmn:CompensateEventDefinition")}function iu(e){return L(e).isForCompensation}function BC(e,t){var n=bv(e),r=bv(t);return n===r}function IC(e){return m(e,"bpmn:InteractionNode")&&!m(e,"bpmn:BoundaryEvent")&&(!m(e,"bpmn:Event")||m(e,"bpmn:ThrowEvent")&&Av(e,"bpmn:MessageEventDefinition"))}function LC(e){return m(e,"bpmn:InteractionNode")&&!iu(e)&&(!m(e,"bpmn:Event")||m(e,"bpmn:CatchEvent")&&Av(e,"bpmn:MessageEventDefinition"))&&!(m(e,"bpmn:BoundaryEvent")&&!Qn(e,"bpmn:MessageEventDefinition"))}function Ev(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 Rv(e,t){var n=Ev(e),r=Ev(t);return n===r}function Qn(e,t){var n=L(e);return!!ne(n.eventDefinitions||[],function(r){return m(r,t)})}function Av(e,t){var n=L(e);return(n.eventDefinitions||[]).every(function(r){return m(r,t)})}function jC(e){return m(e,"bpmn:FlowNode")&&!m(e,"bpmn:EndEvent")&&!qe(e)&&!(m(e,"bpmn:IntermediateThrowEvent")&&Qn(e,"bpmn:LinkEventDefinition"))&&!Cv(e)&&!iu(e)}function FC(e){return m(e,"bpmn:FlowNode")&&!m(e,"bpmn:StartEvent")&&!m(e,"bpmn:BoundaryEvent")&&!qe(e)&&!(m(e,"bpmn:IntermediateCatchEvent")&&Qn(e,"bpmn:LinkEventDefinition"))&&!iu(e)}function HC(e){return m(e,"bpmn:ReceiveTask")||m(e,"bpmn:IntermediateCatchEvent")&&(Qn(e,"bpmn:MessageEventDefinition")||Qn(e,"bpmn:TimerEventDefinition")||Qn(e,"bpmn:ConditionalEventDefinition")||Qn(e,"bpmn:SignalEventDefinition"))}function $C(e){for(var t=[];e;)e=e.parent,e&&t.push(e);return t}function wv(e,t){var n=$C(t);return n.indexOf(e)!==-1}function nu(e,t,n){if(_f(e)||_f(t))return null;if(!m(n,"bpmn:DataAssociation")){if(Lv(e,t))return{type:"bpmn:MessageFlow"};if(jv(e,t))return{type:"bpmn:SequenceFlow"}}var r=wf(e,t);return r||(Iv(e,t)?{type:"bpmn:Association",associationDirection:"One"}:Bv(e,t)?{type:"bpmn:Association",associationDirection:"None"}:!1)}function Vo(e,t){return J(e)||Ef(e)?!0:m(t,"bpmn:Participant")&&!re(t)?!1:m(e,"bpmn:Participant")?m(t,"bpmn:Process")||m(t,"bpmn:Collaboration"):ee(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")&&!zC(e)?!1:m(e,"bpmn:FlowElement")&&!m(e,"bpmn:DataStoreReference")?m(t,"bpmn:FlowElementsContainer")?re(t):ee(t,["bpmn:Participant","bpmn:Lane"]):m(e,"bpmn:DataStoreReference")&&m(t,"bpmn:Collaboration")?It(L(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"]):m(e,"bpmn:MessageFlow")?m(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t:!1}function zC(e){return L(e).cancelActivity&&(Tv(e)||Mv(e))}function Pv(e){return!J(e)&&m(e,"bpmn:BoundaryEvent")}function VC(e){return m(e,"bpmn:Lane")}function WC(e){return Pv(e)||m(e,"bpmn:IntermediateThrowEvent")&&Tv(e)?!0:m(e,"bpmn:IntermediateCatchEvent")&&Mv(e)}function Tv(e){var t=L(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function Mv(e){return Dv(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function Dv(e,t){return t.some(function(n){return Qn(e,n)})}function GC(e){return m(e,"bpmn:ReceiveTask")&&ne(e.incoming,function(t){return m(t.source,"bpmn:EventBasedGateway")})}function Cs(e,t,n,r){if(Array.isArray(e)||(e=[e]),e.length!==1)return!1;var i=e[0];return J(i)||!WC(i)||qe(t)||!m(t,"bpmn:Activity")||iu(t)||r&&!tu(r,t)||GC(t)?!1:"attach"}function kv(e,t,n){if(!t)return!1;var r={replacements:[]};return E(e,function(i){qe(t)||m(i,"bpmn:StartEvent")&&i.type!=="label"&&Vo(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"}),Dv(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")||Qn(i,"bpmn:CancelEventDefinition")&&i.type!=="label"&&(m(i,"bpmn:EndEvent")&&Vo(i,t)&&r.replacements.push({oldElementId:i.id,newElementType:"bpmn:EndEvent"}),m(i,"bpmn:BoundaryEvent")&&Cs(i,t,null,n)&&r.replacements.push({oldElementId:i.id,newElementType:"bpmn:BoundaryEvent"}))}),r.replacements.length?r:!1}function Nv(e,t){return It(e,VC)?!1:t?e.every(function(n){return Vo(n,t)}):!0}function bf(e,t,n,r){return t?J(e)||Ef(e)?!0:Vo(e,t,r)||ru(e,t,r):!1}function Ov(e,t,n){return m(e,"bpmn:SubProcess")?re(e)&&(!t||t.width>=100&&t.height>=80):m(e,"bpmn:Lane")||m(e,"bpmn:Participant")?!0:xf(e)?n?n==="e"||n==="w":!0:Ef(e)?!0:J(e)?n?n==="e"||n==="w":!0:!1}function UC(e,t){var n=xf(e),r=xf(t);return(n||r)&&n!==r}function Bv(e,t){return wv(t,e)||wv(e,t)?!1:UC(e,t)?!0:!!wf(e,t)}function Iv(e,t){return Rv(e,t)&&Cv(e)&&m(t,"bpmn:Activity")&&!YC(t,e)&&!qe(t)}function Lv(e,t){return Sv(e)&&!Sv(t)?!1:IC(e)&&LC(t)&&!BC(e,t)}function jv(e,t){return jC(e)&&FC(t)&&Rv(e,t)&&!(m(e,"bpmn:EventBasedGateway")&&!HC(t))}function wf(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 ru(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"])&&!J(t)&&m(e,"bpmn:FlowNode")&&!m(e,"bpmn:BoundaryEvent")&&Vo(e,t.parent,n)}function KC(e,t){return e&&t&&e.indexOf(t)!==-1}function Fv(e,t){return J(t)?!0:!(m(t,"bpmn:Lane")&&!KC(e,t.parent))}function Sv(e){return Er(e,"bpmn:Process")||Er(e,"bpmn:Collaboration")}function YC(e,t){return e.attachers.includes(t)}var Hv={__depends__:[gt],__init__:["bpmnRules"],bpmnRules:["type",vt]};var qC=2e3;function ou(e,t){e.on("saveXML.start",qC,n);function n(){var r=t.getRootElements();E(r,function(i){var o=se(i),a,s;a=$n([i],!1),a=Q(a,function(c){return c!==i&&!c.labelTarget}),s=Ve(a,se),o.set("planeElement",s)})}}ou.$inject=["eventBus","canvas"];var $v={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",ou]};function Wo(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)})}Wo.prototype.getOrdering=function(e,t){return null};N(Wo,k);function Rs(e,t){Wo.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 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 p=s;p&&!ee(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=Qs(s.children,function(l){return!a.labelTarget&&l.labelTarget?!1:c.level0&&this._modeling.removeElements(r),t};Nt.prototype._getElementIdsFromTree=function(e){var t={};return E(e,function(n){E(n,function(r){r.id&&(t[r.id]=!0)})}),t};Nt.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=we(e);return E(e,function(o){le(o)&&(o.waypoints=Ve(o.waypoints,function(a){return{x:a.x-i.x-i.width/2,y:a.y-i.y-i.height/2}})),S(o,{x:o.x-i.x-i.width/2,y:o.y-i.y-i.height/2})}),this._modeling.createElements(e,n,t,S({},r))};Nt.prototype._createElements=function(e){var t=this,n=this._eventBus,r={},i=[];return E(e,function(o,a){a=parseInt(a,10),o=Rt(o,"priority"),E(o,function(s){var c=S({},Mt(s,["priority"]));r[s.parent]?c.parent=r[s.parent]:delete c.parent,n.fire("copyPaste.pasteElement",{cache:r,descriptor:c});var p;if(le(c)){c.source=r[s.source],c.target=r[s.target],p=r[s.id]=t.createConnection(c),i.push(p);return}if(J(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};Nt.prototype.createConnection=function(e){var t=this._elementFactory.createConnection(Mt(e,["id"]));return t};Nt.prototype.createLabel=function(e){var t=this._elementFactory.createLabel(Mt(e,["id"]));return t};Nt.prototype.createShape=function(e){var t=this._elementFactory.createShape(Mt(e,["id"]));return t};Nt.prototype.hasRelations=function(e,t){var n,r,i;return!(le(e)&&(r=ne(t,bt({id:e.source.id})),i=ne(t,bt({id:e.target.id})),!r||!i)||J(e)&&(n=ne(t,bt({id:e.labelTarget.id})),!n))};Nt.prototype.createTree=function(e){var t=this._rules,n=this,r={},i=[],o=Nr(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",Cf,function(c){var p=c.cache,u=c.descriptor;a(p,s(u,p,o(p)))})}cu.$inject=["bpmnFactory","eventBus","moddleCopy"];var nR=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing","categoryValue"],rR=["errorRef","escalationRef","messageRef","signalRef","dataObjectRef"];function Di(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 Rt(i,o=>o==="extensionElements")}),e.on("moddleCopy.canCopyProperty",r=>{let{parent:i,property:o,propertyName:a}=r,s=Pe(i)&&i.$descriptor;if(a&&rR.includes(a))return o;if(a&&nR.includes(a)||a&&s&&!ne(s.properties,bt({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})}Di.$inject=["eventBus","bpmnFactory","moddle"];Di.prototype.copyElement=function(e,t,n,r=!1){n&&!U(n)&&(n=[n]),n=n||pu(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;ft(e,o)&&(a=e.get(o));let s=this.copyProperty(a,t,o,r);!Ye(s)||this._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent:t,property:s,propertyName:o})===!1||t.set(o,s)})),t};Di.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 Pe(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)?Xe(e,(a,s)=>{let c=this.copyProperty(s,t,n,r);return c?a.concat(c):a},[]):Pe(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};Di.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 pu(e,t){return Xe(e.properties,(n,r)=>t&&r.default?n:n.concat(r.name),[])}var uu={__depends__:[Jv],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",cu],moddleCopy:["type",Di]};var ey=Math.round;function Ps(e,t){this._modeling=e,this._eventBus=t}Ps.$inject=["modeling","eventBus"];Ps.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=ey(s+o/2),u=ey(c+a/2),l=r.replaceShape(e,S({},t,{x:p,y:u,width:o,height:a}),n);return i.fire("replace.end",{element:e,newElement:l,hints:n}),l};function lu(e,t){t.on("replace.end",500,function(n){let{newElement:r,hints:i={}}=n;i.select!==!1&&e.select(r)})}lu.$inject=["selection","eventBus"];var ty={__init__:["replace","replaceSelectionBehavior"],replaceSelectionBehavior:["type",lu],replace:["type",Ps]};function iR(e,t,n){U(n)||(n=[n]),E(n,function(r){Fn(e[r])||(t[r]=e[r])})}var oR=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function aR(e,t){var n=e&&ft(e,"collapsed")?e.collapsed:!re(e),r;return t&&(ft(t,"collapsed")||ft(t,"isExpanded"))?r=ft(t,"collapsed")?t.collapsed:!t.isExpanded:r=n,n!==r}function du(e,t,n,r,i,o){function a(s,c,p){p=p||{};var u=c.type,l=s.businessObject;if(fu(l)&&(u==="bpmn:SubProcess"||u==="bpmn:AdHocSubProcess")&&aR(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),iR(s.di,d.di,["fill","stroke","background-color","border-color","color"]);var h=pu(l.$descriptor),y=pu(f.$descriptor,!0),v=sR(h,y);S(f,dt(c,oR));var w=Q(v,function(x){return x==="eventDefinitions"?ny(s,c.eventDefinitionType):x==="loopCharacteristics"?!qe(f):ft(f,x)||x==="processRef"&&c.isExpanded===!1||x==="triggeredByEvent"?!1:x==="isForCompensation"?!qe(f):!0});if(f=n.copyElement(l,f,w),c.eventDefinitionType&&(ny(f,c.eventDefinitionType)||(d.eventDefinitionType=c.eventDefinitionType,d.eventDefinitionAttrs=c.eventDefinitionAttrs)),m(l,"bpmn:Activity")){if(fu(l))d.isExpanded=re(s);else if(c&&ft(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}re(s)&&!m(l,"bpmn:Task")&&d.isExpanded&&(d.width=s.width,d.height=s.height)}if(fu(l)&&!fu(f)&&(p.moveChildren=!1),m(l,"bpmn:Participant")){c.isExpanded===!0?f.processRef=e.create("bpmn:Process"):p.moveChildren=!1;var b=Te(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,ee(l,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&ee(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}du.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules"];function fu(e){return m(e,"bpmn:SubProcess")}function ny(e,t){var n=L(e);return t&&n.get("eventDefinitions").some(function(r){return m(r,t)})}function sR(e,t){return e.filter(function(n){return t.includes(n)})}var hu={__depends__:[uu,ty,Qe],bpmnReplace:["type",du]};var cR=250;function wr(e){this._eventBus=e,this._tools=[],this._active=null}wr.$inject=["eventBus"];wr.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)};wr.prototype.isActive=function(e){return e&&this._active===e};wr.prototype.length=function(e){return this._tools.length};wr.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))};wr.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,cR,function(i){this._active&&(pR(i)||this.setActive(null))},this)};function pR(e){var t=e.originalEvent&&e.originalEvent.target;return t&&Rn(t,'.group[data-group="tools"]')}var ri={__depends__:[Ct],__init__:["toolManager"],toolManager:["type",wr]};function ry(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 iy(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;(Ts(e,s)||Ts(e,c)||Ts(t,s)||Ts(t,c))&&(Ts(n,a)||n.push(a))})}),n}function Ts(e,t){return e.indexOf(t)!==-1}function oy(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 Rf=Math.abs,uR=Math.round,Sr={x:"width",y:"height"},cy="crosshair",ii={n:"top",w:"left",s:"bottom",e:"right"},lR=1500,mu={n:"s",w:"e",s:"n",e:"w"},gu=20;function zt(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",lR,function(c){var p=c.context,u=p.initialized;u||(u=p.initialized=s.init(c,p)),u&&sy(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){sy(c);var y={x:0,y:0};y[u]=uR(c["d"+u]),s.makeSpace(f,d,y,l,h),n.once("spaceTool.ended",function(v){s.activateSelection(v.originalEvent,!0,!0)})}})}zt.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"];zt.prototype.activateSelection=function(e,t,n){this._dragging.init(e,"spaceTool.selection",{autoActivate:t,cursor:cy,data:{context:{reactivate:n}},trapClick:!1})};zt.prototype.activateMakeSpace=function(e){this._dragging.init(e,"spaceTool",{autoActivate:!0,cursor:cy,data:{context:{}}})};zt.prototype.makeSpace=function(e,t,n,r,i){return this._modeling.createSpace(e,t,n,r,i)};zt.prototype.init=function(e,t){var n=Rf(e.dx)>Rf(e.dy)?"x":"y",r=e["d"+n],i=e[n]-r;if(Rf(r)<5)return!1;r<0&&(r*=-1),yr(e)&&(r*=-1);var o=ry(n,r),a=this._canvas.getRootElement();!_i(e)&&e.hover&&(a=e.hover);var s=[...$n(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=fR(c,n,o,i,p);return S(t,c,{axis:n,direction:o,spaceToolConstraints:u,start:i}),xi("resize-"+(n==="x"?"ew":"ns")),!0};zt.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||J(f))){if(le(f)){c.push(f);return}var d=f[t],h=d+f[Sr[t]];if(dR(f)&&(n>0&&q(f)[t]>r||n<0&&q(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;ki(l,d)&&p(f)}),l=o.concat(a),E(c,function(f){var d=f.source,h=f.target,y=f.label;ki(l,d)&&ki(l,h)&&y&&p(y)}),{movingShapes:o,resizingShapes:a}};zt.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)};zt.prototype.isActive=function(){var e=this._dragging.context();return e?/^spaceTool/.test(e.prefix):!1};function ay(e){return{top:e.top-gu,right:e.right+gu,bottom:e.bottom+gu,left:e.left-gu}}function sy(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 fR(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=Q(f,function(I){return!le(I)&&!J(I)&&!ki(o,I)&&!ki(a,I)}),y=Q(f,function(I){return!le(I)&&!J(I)&&ki(o,I)}),v,w,R,b=[],x=[],C,P,O,T;h.length&&(w=ay(X(we(h))),v=r-d[ii[n]]+w[ii[n]],n==="n"?s.bottom=p=te(p)?Math.min(p,v):v:n==="w"?s.right=p=te(p)?Math.min(p,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=ay(X(we(y))),v=r-R[ii[mu[n]]]+d[ii[mu[n]]],n==="n"?s.bottom=p=te(p)?Math.min(p,v):v:n==="w"?s.right=p=te(p)?Math.min(p,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){ki(o,I)?b.push(I):x.push(I)}),b.length&&(C=X(we(b.map(q))),P=d[ii[mu[n]]]-(C[ii[mu[n]]]-r)),x.length&&(O=X(we(x.map(q))),T=O[ii[n]]-(d[ii[n]]-r)),n==="n"?(v=Math.min(P||1/0,T||1/0),s.bottom=p=te(p)?Math.min(p,v):v):n==="w"?(v=Math.min(P||1/0,T||1/0),s.right=p=te(p)?Math.min(p,v):v):n==="s"?(v=Math.max(P||-1/0,T||-1/0),s.top=c=te(c)?Math.max(c,v):v):n==="e"&&(v=Math.max(P||-1/0,T||-1/0),s.left=c=te(c)?Math.max(c,v):v));var B=i&&i[u.id];B&&(n==="n"?(v=r+u[Sr[t]]-B[Sr[t]],s.bottom=p=te(p)?Math.min(p,v):v):n==="w"?(v=r+u[Sr[t]]-B[Sr[t]],s.right=p=te(p)?Math.min(p,v):v):n==="s"?(v=r-u[Sr[t]]+B[Sr[t]],s.top=c=te(c)?Math.max(c,v):v):n==="e"&&(v=r-u[Sr[t]]+B[Sr[t]],s.left=c=te(c)?Math.max(c,v):v))}),s}}function ki(e,t){return e.indexOf(t)!==-1}function dR(e){return!!e.host}var Af="djs-dragging",py="djs-resizing",hR=250,vu=Math.max;function yu(e,t,n,r,i){function o(a,s){E(a,function(c){i.addDragger(c,s),n.addMarker(c,Af)})}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");H(u,r.cls("djs-crosshair-group",["no-events"])),Z(s,u);var l=G("path");H(l,"d",p.x),ce(l).add("djs-crosshair"),Z(u,l);var f=G("path");H(f,"d",p.y),ce(f).add("djs-crosshair"),Z(u,f),c.crosshairGroup=u}),e.on("spaceTool.selection.move",function(a){var s=a.context.crosshairGroup;Ie(s,a.x,a.y)}),e.on("spaceTool.selection.cleanup",function(a){var s=a.context,c=s.crosshairGroup;c&&Ce(c)}),e.on("spaceTool.move",hR,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"),H(c,"d","M0,0 L0,0"),ce(c).add("djs-crosshair"),Z(f,c),s.line=c;var d=G("g");H(d,r.cls("djs-drag-group",["no-events"])),Z(n.getActiveLayer(),d),o(u,d);var h=s.movingConnections=t.filter(function(x){var C=!1;E(u,function(B){E(B.outgoing,function(I){x===I&&(C=!0)})});var P=!1;E(u,function(B){E(B.incoming,function(I){x===I&&(P=!0)})});var O=!1;E(l,function(B){E(B.outgoing,function(I){x===I&&(O=!0)})});var T=!1;return E(l,function(B){E(B.incoming,function(I){x===I&&(T=!0)})}),le(x)&&(C||O)&&(P||T)});o(h,d),s.dragGroup=d}if(!s.frameGroup){var y=G("g");H(y,r.cls("djs-frame-group",["no-events"])),Z(n.getActiveLayer(),y);var v=[];E(l,function(x){var C=i.addFrame(x,y),P=C.getBBox();v.push({element:C,initialBounds:P}),n.addMarker(x,py)}),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};H(c,{d:w[p]});var R={x:"y",y:"x"},b={x:a.dx,y:a.dy};b[R[s.axis]]=0,Ie(s.dragGroup,b.x,b.y),E(s.frames,function(x){var C=x.element,P=x.initialBounds,O,T;s.direction==="e"?H(C,{width:vu(P.width+b.x,5)}):(O=vu(P.width-b.x,5),H(C,{width:O,x:P.x+P.width-O})),s.direction==="s"?H(C,{height:vu(P.height+b.y,5)}):(T=vu(P.height-b.y,5),H(C,{height:T,y:P.y+P.height-T}))})}}),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,Af)}),E(p,function(h){n.removeMarker(h,Af)}),f&&(Ce(l),Ce(f)),E(u,function(h){n.removeMarker(h,py)}),d&&Ce(d)})}yu.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];var uy={__init__:["spaceToolPreview"],__depends__:[Ct,gt,ri,bn,Jn],spaceTool:["type",zt],spaceToolPreview:["type",yu]};function Go(e,t){e.invoke(zt,this),this._canvas=t}Go.$inject=["injector","canvas"];N(Go,zt);Go.prototype.calculateAdjustments=function(e,t,n,r){var i=this._canvas.getRootElement(),o=e[0]===i?null:e[0],a=[];o&&(a=Sn(fi(i.children.filter(p=>m(p,"bpmn:Artifact")),we(o))));let s=[...e,...a];var c=zt.prototype.calculateAdjustments.call(this,s,t,n,r);return c.resizingShapes=c.resizingShapes.filter(function(p){return!(m(p,"bpmn:TextAnnotation")||mR(p)&&(t==="y"&&Te(p)||t==="x"&&!Te(p)))}),c};function mR(e){return m(e,"bpmn:Participant")&&!L(e).processRef}var _u={__depends__:[uy],spaceTool:["type",Go]};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:Xu("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=U(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 ly={commandStack:["type",ze]};function En(e,t){if(typeof t!="function")throw new Error("removeFn iterator must be a function");if(!e)return[];for(var n;n=e[0];)t(n);return e}var gR=250,fy=1400;function Ms(e,t,n){k.call(this,t);var r=e.get("movePreview",!1);t.on("shape.move.start",fy,function(i){var o=i.context,a=o.shapes,s=o.validatedShapes;o.shapes=dy(a),o.validatedShapes=dy(s)}),r&&t.on("shape.move.start",gR,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",fy,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;En(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=Ji(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&&(Re(s.labels,a,c),a.labelTarget=s)})}N(Ms,k);Ms.$inject=["injector","eventBus","modeling"];function dy(e){return Q(e,function(t){return e.indexOf(t.labelTarget)===-1})}var hy={__init__:["labelSupport"],labelSupport:["type",Ms]};var vR=251,my=1401,gy="attach-ok";function Ds(e,t,n,r,i){k.call(this,t);var o=e.get("movePreview",!1);t.on("shape.move.start",my,function(a){var s=a.context,c=s.shapes,p=s.validatedShapes;s.shapes=yR(c),s.validatedShapes=_R(p)}),o&&t.on("shape.move.start",vR,function(a){var s=a.context,c=s.shapes,p=Pf(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,gy),t.once(["shape.move.out","shape.move.cleanup"],function(){n.removeMarker(u,gy)}))}}),this.preExecuted("elements.move",my,function(a){var s=a.context,c=s.closure,p=s.shapes,u=Pf(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=Q(c,function(l){var f=l.host;return xR(l)&&!bR(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;En(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=hf(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=hf(d,p,u);i.moveShape(d,h,d.parent),E(d.labels,function(y){i.moveShape(y,h,y.parent)})})}),this.preExecute("shape.delete",function(a){var s=a.context.shape;En(s.attachers,function(c){i.removeShape(c)}),s.host&&i.updateAttachment(s,null)})}N(Ds,k);Ds.$inject=["injector","eventBus","canvas","rules","modeling"];function Pf(e){return Xi(Ve(e,function(t){return t.attachers||[]}))}function yR(e){var t=Pf(e);return ed("id",e,t)}function _R(e){var t=Cn(e,"id");return Q(e,function(n){for(;n;){if(n.host&&t[n.host.id])return!1;n=n.parent}return!0})}function xR(e){return!!e.host}function bR(e,t){return e.indexOf(t)!==-1}var vy={__depends__:[gt],__init__:["attachSupport"],attachSupport:["type",Ds]};function Xt(e){this._model=e}Xt.$inject=["moddle"];Xt.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"])};Xt.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":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))};Xt.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n};Xt.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})};Xt.prototype.createDiShape=function(e,t){return this.create("bpmndi:BPMNShape",S({bpmnElement:e,bounds:this.createDiBounds()},t))};Xt.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)};Xt.prototype.createDiWaypoints=function(e){var t=this;return Ve(e,function(n){return t.createDiWaypoint(n)})};Xt.prototype.createDiWaypoint=function(e){return this.create("dc:Point",dt(e,["x","y"]))};Xt.prototype.createDiEdge=function(e,t){return this.create("bpmndi:BPMNEdge",S({bpmnElement:e,waypoint:this.createDiWaypoints([])},t))};Xt.prototype.createDiPlane=function(e,t){return this.create("bpmndi:BPMNPlane",S({bpmnElement:e},t))};function Ot(e,t,n){k.call(this,e),this._bpmnFactory=t;var r=this;function i(d){var h=d.context,y=h.hints||{},v;!h.cropped&&y.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,y=h.shape||h.connection,v=h.parent||h.newParent;r.updateParent(y,v)}this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Zt(o)),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Zt(a));function s(d){var h=d.context,y=h.oldRoot,v=y.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"],Zt(function(d){d.context.shape.type!=="label"&&c(d)})),this.reverted(["shape.move","shape.create","shape.resize"],Zt(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"],Zt(p)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],Zt(p));function u(d){r.updateConnectionWaypoints(d.context.connection)}this.executed(["connection.layout","connection.move","connection.updateWaypoints"],Zt(u)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],Zt(u)),this.executed("connection.reconnect",Zt(function(d){var h=d.context,y=h.connection,v=h.oldSource,w=h.newSource,R=L(y),b=L(v),x=L(w);R.conditionExpression&&!ee(x,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(h.oldConditionExpression=R.conditionExpression,delete R.conditionExpression),v!==w&&b.default===R&&(h.oldDefault=b.default,delete b.default)})),this.reverted("connection.reconnect",Zt(function(d){var h=d.context,y=h.connection,v=h.oldSource,w=h.newSource,R=L(y),b=L(v),x=L(w);h.oldConditionExpression&&(R.conditionExpression=h.oldConditionExpression),h.oldDefault&&(b.default=h.oldDefault,delete x.default)}));function l(d){r.updateAttachment(d.context)}this.executed(["element.updateAttachment"],Zt(l)),this.reverted(["element.updateAttachment"],Zt(l)),this.executed("element.updateLabel",Zt(f)),this.reverted("element.updateLabel",Zt(f));function f(d){let{element:h}=d.context,y=pt(h),v=se(h),w=v&&v.get("label");rn(h)||fo(h)||(y&&!w?v.set("label",t.create("bpmndi:BPMNLabel")):!y&&w&&v.set("label",void 0))}}N(Ot,k);Ot.$inject=["eventBus","bpmnFactory","connectionDocking"];Ot.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,r=t.host;n.attachedToRef=r&&r.businessObject};Ot.prototype.updateParent=function(e,t){if(!J(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)}};Ot.prototype.updateBounds=function(e){var t=se(e),n=wR(e);if(n){var r=St(n,t.get("bounds"));S(n,{x:e.x+r.x,y:e.y+r.y})}var i=J(e)?this._getLabel(t):t,o=i.bounds;o||(o=this._bpmnFactory.createDiBounds(),i.set("bounds",o)),S(o,{x:e.x,y:e.y,width:e.width,height:e.height})};Ot.prototype.updateFlowNodeRefs=function(e,t,n){if(n!==t){var r,i;m(n,"bpmn:Lane")&&(r=n.get("flowNodeRef"),Ne(r,e)),m(t,"bpmn:Lane")&&(i=t.get("flowNodeRef"),Re(i,e))}};Ot.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)};Ot.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):(Ne(n,e),e.$parent=null)}};function ER(e){for(;e&&!m(e,"bpmn:Definitions");)e=e.$parent;return e}Ot.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)};Ot.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=ER(e.$parent||t),e.$parent&&(Ne(o.get("rootElements"),i),i.$parent=null),t&&(Re(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),Ne(a,e)),t?(a=t.get(r),a.push(e),e.$parent=t):e.$parent=null,n){var s=n.get(r);Ne(a,e),t&&(s||(s=[],t.set(r,s)),s.push(e))}}};Ot.prototype.updateConnectionWaypoints=function(e){var t=se(e);t.set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))};Ot.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&&(Ne(n.sourceRef&&n.sourceRef.get("outgoing"),n),i&&i.get("outgoing")&&i.get("outgoing").push(n)),n.sourceRef=i),n.targetRef!==a&&(c&&(Ne(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)};Ot.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label};function Zt(e){return function(t){var n=t.context,r=n.shape||n.connection||n.element;m(r,"bpmn:BaseElement")&&e(t)}}function wR(e){if(m(e,"bpmn:Activity")){var t=se(e);if(t){var n=t.get("label");if(n)return n.get("bounds")}}}function er(e,t){vn.call(this),this._bpmnFactory=e,this._moddle=t}N(er,vn);er.$inject=["bpmnFactory","moddle"];er.prototype._baseCreate=vn.prototype.create;er.prototype.create=function(e,t){if(e==="label"){var n=t.di||this._bpmnFactory.createDiLabel();return this._baseCreate(e,S({type:"label",di:n},Yn,t))}return this.createElement(e,t)};er.prototype.createElement=function(e,t){t=S({},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)}if(!CR(i)){var o=S({},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=S({isFrame:!0},t)),t=SR(r,t,["processRef","isInterrupting","associationDirection","isForCompensation"]),t.isExpanded&&(t=Tf(i,t,"isExpanded")),ee(r,["bpmn:Lane","bpmn:Participant"])&&(t=Tf(i,t,"isHorizontal")),m(r,"bpmn:SubProcess")&&(t.collapsed=!re(r,i)),m(r,"bpmn:ExclusiveGateway")&&(ft(i,"isMarkerVisible")?i.isMarkerVisible===void 0&&(i.isMarkerVisible=!1):i.isMarkerVisible=!0),Ye(t.triggeredByEvent)&&(r.triggeredByEvent=t.triggeredByEvent,delete t.triggeredByEvent),Ye(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=S({id:r.id},n,t,{businessObject:r,di:i}),this._baseCreate(e,t)};er.prototype.getDefaultSize=function(e,t){var n=L(e);if(t=t||se(e),m(n,"bpmn:SubProcess"))return re(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 re(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:40}:m(n,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}};er.prototype.createParticipantShape=function(e){return Pe(e)||(e={isExpanded:e}),e=S({type:"bpmn:Participant"},e||{}),e.isExpanded!==!1&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)};function SR(e,t,n){return E(n,function(r){t=Tf(e,t,r)}),t}function Tf(e,t,n){return t[n]===void 0?t:(e[n]=t[n],Mt(t,[n]))}function CR(e){return ee(e,["bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane"])}function Uo(e,t){this._modeling=e,this._canvas=t}Uo.$inject=["modeling","canvas"];Uo.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,r=e.alignment;E(n,function(i){var o={x:0,y:0};Ye(r.left)?o.x=r.left-i.x:Ye(r.right)?o.x=r.right-i.width-i.x:Ye(r.center)?o.x=r.center-Math.round(i.width/2)-i.x:Ye(r.top)?o.y=r.top-i.y:Ye(r.bottom)?o.y=r.bottom-i.height-i.y:Ye(r.middle)&&(o.y=r.middle-Math.round(i.height/2)-i.y),t.moveElements([i],o,i.parent)})};Uo.prototype.postExecute=function(e){};function Ko(e){this._modeling=e}Ko.$inject=["modeling"];Ko.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};Ko.prototype.postExecute=function(e){var t=e.hints||{};RR(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 RR(e,t){return It(e.outgoing,function(n){return n.target===t})}function Yo(e,t){this._canvas=e,this._layouter=t}Yo.$inject=["canvas","layouter"];Yo.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};Yo.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var xu=Math.round;function ks(e){this._modeling=e}ks.$inject=["modeling"];ks.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=Q(t,function(l){return!l.hidden}),c=we(s);E(t,function(l){le(l)&&(l.waypoints=Ve(l.waypoints,function(f){return{x:xu(f.x-c.x-c.width/2+i.x),y:xu(f.y-c.y-c.height/2+i.y)}})),S(l,{x:xu(l.x-c.x-c.width/2+i.x),y:xu(l.y-c.y-c.height/2+i.y)})});var p=Nr(t),u={};E(t,function(l){if(le(l)){u[l.id]=te(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=S({},o);p.indexOf(l)===-1&&(f.autoResize=!1),J(l)&&(f=Mt(f,["attach"])),u[l.id]=te(r)?a.createShape(l,dt(l,["x","y","width","height"]),l.parent||n,r,f):a.createShape(l,dt(l,["x","y","width","height"]),l.parent||n,f)}),e.elements=Sn(u)};var yy=Math.round;function Bn(e){this._canvas=e}Bn.$inject=["canvas"];Bn.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?S(t,n):S(t,{x:n.x-yy(t.width/2),y:n.y-yy(t.height/2)}),this._canvas.addShape(t,r,i),t};Bn.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t};function Ni(e){Bn.call(this,e)}N(Ni,Bn);Ni.$inject=["canvas"];var AR=Bn.prototype.execute;Ni.prototype.execute=function(e){var t=e.shape;return TR(t),t.labelTarget=e.labelTarget,AR.call(this,e)};var PR=Bn.prototype.revert;Ni.prototype.revert=function(e){return e.shape.labelTarget=null,PR.call(this,e)};function TR(e){["width","height"].forEach(function(t){typeof e[t]=="undefined"&&(e[t]=0)})}function Oi(e,t){this._canvas=e,this._modeling=t}Oi.$inject=["canvas","modeling"];Oi.prototype.preExecute=function(e){var t=this._modeling,n=e.connection;En(n.incoming,function(r){t.removeConnection(r,{nested:!0})}),En(n.outgoing,function(r){t.removeConnection(r,{nested:!0})})};Oi.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=Ji(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t};Oi.prototype.revert=function(e){var t=e.connection,n=e.parent,r=e.parentIndex;return t.source=e.source,t.target=e.target,Re(n.children,t,r),this._canvas.addConnection(t,n),t};function Ns(e,t){this._modeling=e,this._elementRegistry=t}Ns.$inject=["modeling","elementRegistry"];Ns.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 Bi(e,t){this._canvas=e,this._modeling=t}Bi.$inject=["canvas","modeling"];Bi.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;En(n.incoming,function(r){t.removeConnection(r,{nested:!0})}),En(n.outgoing,function(r){t.removeConnection(r,{nested:!0})}),En(n.children,function(r){le(r)?t.removeConnection(r,{nested:!0}):t.removeShape(r,{nested:!0})})};Bi.prototype.execute=function(e){var t=this._canvas,n=e.shape,r=n.parent;return e.oldParent=r,e.oldParentIndex=Ji(r.children,n),t.removeShape(n),n};Bi.prototype.revert=function(e){var t=this._canvas,n=e.shape,r=e.oldParent,i=e.oldParentIndex;return Re(r.children,n,i),t.addShape(n,r),n};function qo(e){this._modeling=e}qo.$inject=["modeling"];var _y={x:"y",y:"x"};qo.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 R={y:0};R[r]=v-a(w),R[r]&&(R[_y[r]]=0,t.moveElements([w],R,w.parent))}var u=n[0],l=s(n),f=n[l],d,h,y=0;E(n,function(v,w){var R,b,x;if(v.elements.length<2){w&&w!==n.length-1&&(o(v,v.elements[0]),y+=c(v.range));return}R=Rt(v.elements,r),b=R[0],w===l&&(b=R[s(R)]),x=a(b),v.range=null,E(R,function(C){if(p(x,C),v.range===null){v.range={min:C[r],max:C[r]+C[i]};return}o(v,C)}),w&&w!==n.length-1&&(y+=c(v.range))}),h=Math.abs(f.range.min-u.range.max),d=Math.round((h-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||kR(n,Zi(r));return Ty(n,r),e.oldProperties=o,e.changed=i,i};ji.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,r=e.changed;return Ty(n,t),r};ji.prototype._getVisualReferences=function(e){var t=this._elementRegistry;return m(e,"bpmn:DataObject")?NR(e,t):[]};function kR(e,t){return Xe(t,function(n,r){return n[r]=e.get(r),n},{})}function Ty(e,t){E(t,function(n,r){e.set(r,n)})}function NR(e,t){return t.filter(function(n){return m(n,"bpmn:DataObjectReference")&&L(n).dataObjectRef===e})}var Ls="default",Rr="id",My="di",OR={width:0,height:0};function Fi(e,t,n,r){this._elementRegistry=e,this._moddle=t,this._modeling=n,this._textRenderer=r}Fi.$inject=["elementRegistry","moddle","modeling","textRenderer"];Fi.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=FR(e.properties),s=e.oldProperties||BR(t,a);return Dy(a,o)&&(i.unclaim(o[Rr]),r.updateId(t,a[Rr]),i.claim(a[Rr],o)),Ls in a&&(a[Ls]&&n.push(r.get(a[Ls].id)),o[Ls]&&n.push(r.get(o[Ls].id))),ky(t,a),e.oldProperties=s,e.changed=n,n};Fi.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,OR)}};Fi.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 ky(t,r),Dy(n,i)&&(a.unclaim(n[Rr]),o.updateId(t,r[Rr]),a.claim(r[Rr],i)),e.changed};function Dy(e,t){return Rr in e&&e[Rr]!==t[Rr]}function BR(e,t){var n=Zi(t),r=e.businessObject,i=se(e);return Xe(n,function(o,a){return a!==My?o[a]=r.get(a):o[a]=IR(i,Zi(t.di)),o},{})}function IR(e,t){return Xe(t,function(n,r){return n[r]=e&&e.get(r),n},{})}function ky(e,t){var n=e.businessObject,r=se(e);E(t,function(i,o){o!==My?n.set(o,i):r&&LR(r,i)})}function LR(e,t){E(t,function(n,r){e.set(r,n)})}var jR=["default"];function FR(e){var t=S({},e);return jR.forEach(function(n){n in e&&(t[n]=L(t[n]))}),t}function ea(e,t){this._canvas=e,this._modeling=t}ea.$inject=["canvas","modeling"];ea.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),Re(a.rootElements,r),r.$parent=a,Ne(a.rootElements,o),o.$parent=null,i.di=null,s.bpmnElement=r,n.di=s,e.oldRoot=i,[]};ea.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),Ne(a.rootElements,r),r.$parent=null,Re(a.rootElements,o),o.$parent=a,n.di=null,s.bpmnElement=o,i.di=s,[]};function js(e,t){this._modeling=e,this._spaceTool=t}js.$inject=["modeling","spaceTool"];js.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,r=e.shape,i=e.location,o=Pt(r),a=o===r,s=a?r:r.parent,c=pn(s),p=Te(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+qt,y:r.y,width:r.width-qt,height:r.height}:{x:r.x,y:r.y+qt,width:r.width,height:r.height-qt};n.createShape({type:"bpmn:Lane",isHorizontal:p},u,s)}var l=[];An(o,function(x){return l.push(x),x.label&&l.push(x.label),x===r?[]:Q(x.children,function(C){return C!==r})});var f,d,h,y,v;i==="top"?(f=-120,d=r.y,h=d+10,y="n",v="y"):i==="left"?(f=-120,d=r.x,h=d+10,y="w",v="x"):i==="bottom"?(f=120,d=r.y+r.height,h=d-10,y="s",v="y"):i==="right"&&(f=120,d=r.x+r.width,h=d-10,y="e",v="x");var w=t.calculateAdjustments(l,v,f,h),R=p?{x:0,y:f}:{x:f,y:0};t.makeSpace(w.movingShapes,w.resizingShapes,R,y,h);var b=p?{x:r.x+(a?qt:0),y:d-(i==="top"?120:0),width:r.width-(a?qt:0),height:120}:{x:d-(i==="left"?120:0),y:r.y+(a?qt:0),width:120,height:r.height-(a?qt:0)};e.newLane=n.createShape({type:"bpmn:Lane",isHorizontal:p},b,s)};function Fs(e){this._modeling=e}Fs.$inject=["modeling"];Fs.prototype.preExecute=function(e){var t=this._modeling,n=e.shape,r=e.count,i=pn(n),o=i.length;if(o>r)throw new Error(`more than <${r}> child lanes`);var a=Te(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 Hs="flowNodeRef",Mf="lanes";function $i(e){this._elementRegistry=e}$i.$inject=["elementRegistry"];$i.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(Hy(n)){var r=YR(e,t,n),i=qR(e,t,n),o=XR(r,i);return[].concat(r.waypoints,o.waypoints,i.waypoints)}return ZR(e,t,n)}function QR(e,t,n){var r=Df(e,t,n);return r.unshift(e),r.push(t),Nf(r)}function JR(e,t,n,r,i){var o=i&&i.preferredLayouts||[],a=Qf(o,"straight")[0]||"h:h",s=GR[a]||0,c=je(e,t,s),p=iA(c,a);n=n||q(e),r=r||q(t);var u=p.split(":"),l=Ly(n,e,u[0],aA(c)),f=Ly(r,t,u[1],c);return QR(l,f,p)}function Fy(e,t,n,r,i,o){U(n)&&(i=n,o=r,n=q(e),r=q(t)),o=S({preferredLayouts:[]},o),i=i||[];var a=o.preferredLayouts,s=a.indexOf("straight")!==-1,c;return c=s&&tA(e,t,n,r,o),c||(c=o.connectionEnd&&rA(t,e,r,i),c)||(c=o.connectionStart&&nA(e,t,n,i),c)?c:!o.connectionStart&&!o.connectionEnd&&i&&i.length?i:JR(e,t,n,r,o)}function eA(e,t,n){return e>=t&&e<=n}function Iy(e,t,n){var r={x:"width",y:"height"};return eA(t[e],n[e],n[e]+n[r[e]])}function tA(e,t,n,r,i){var o={},a,s;return s=je(e,t),/^(top|bottom|left|right)$/.test(s)?(/top|bottom/.test(s)&&(a="x"),/left|right/.test(s)&&(a="y"),i.preserveDocking==="target"?Iy(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:Iy(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 nA(e,t,n,r){return kf(e,t,n,r)}function rA(e,t,n,r){var i=r.slice().reverse();return i=kf(e,t,n,i),i?i.reverse():null}function kf(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&&Or(l,d)<3})}function o(u,l,f){var d=Ut(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(ll(u[d],l,Oy)||ll(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=kf(e,t,n,p)),c&&Ut(c)?null:c}function iA(e,t){if(Hy(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 oA(e){return e&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(e)}function Hy(e){return e&&/t|r|b|l/.test(e)}function aA(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 Ly(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 Nf(e){return e.reduce(function(t,n,r){var i=t[t.length-1],o=e[r+1];return eo(i,o,n,0)||t.push(n),t},[])}var sA=-10,cA=40,pA={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},uA={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},Bf={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},zs={top:"t",right:"r",bottom:"b",left:"l"};function ia(e){this._elementRegistry=e}N(ia,Eu);ia.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=$y(i&&i[0],n)),a||(a=$y(i&&i[i.length-1],r)),(m(e,"bpmn:Association")||m(e,"bpmn:DataAssociation"))&&i&&!zy(n,r))return[].concat([o],i.slice(1,-1),[a]);var u=dp(n,s)?pA:uA;return m(e,"bpmn:MessageFlow")?c=fA(n,r,u):(m(e,"bpmn:SequenceFlow")||zy(n,r))&&(n===r?c={preferredLayouts:yA(n,e,u)}:m(n,"bpmn:BoundaryEvent")?c={preferredLayouts:_A(n,r,a,u)}:Vs(n)||Vs(r)?c={preferredLayouts:u.subProcess,preserveDocking:hA(n)}:m(n,"bpmn:Gateway")?c={preferredLayouts:u.fromGateway}:m(r,"bpmn:Gateway")?c={preferredLayouts:u.toGateway}:c={preferredLayouts:u.default}),c&&(c=S(c,t),p=Nf(Fy(n,r,o,a,i,c))),p||[o,a]};function lA(e){var t=e.host;return je(q(e),t,sA)}function fA(e,t,n){return{preferredLayouts:n.messageFlow,preserveDocking:dA(e,t)}}function dA(e,t){return m(t,"bpmn:Participant")?"source":m(e,"bpmn:Participant")?"target":Vs(t)?"source":Vs(e)||m(t,"bpmn:Event")?"target":m(e,"bpmn:Event")?"source":null}function hA(e){return Vs(e)?"target":"source"}function $y(e,t){return e?e.original||e:q(t)}function zy(e,t){return m(t,"bpmn:Activity")&&m(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function Vs(e){return m(e,"bpmn:SubProcess")&&re(e)}function zi(e,t){return e===t}function mA(e,t){return t.indexOf(e)!==-1}function na(e){var t=/right|left/.exec(e);return t&&t[0]}function ra(e){var t=/top|bottom/.exec(e);return t&&t[0]}function Vy(e,t){return Bf[e]===t}function gA(e,t){var n=na(e),r=Bf[n];return t.indexOf(r)!==-1}function vA(e,t){var n=ra(e),r=Bf[n];return t.indexOf(r)!==-1}function Gy(e){return e==="right"||e==="left"}function yA(e,t,n){var r=t.waypoints,i=r&&r.length&&je(r[0],e);return i==="top"?n.loop.fromTop:i==="right"?n.loop.fromRight:i==="left"?n.loop.fromLeft:n.loop.fromBottom}function _A(e,t,n,r){var i=q(e),o=q(t),a=lA(e),s,c,p=zi(e.host,t),u=mA(a,["top","right","bottom","left"]),l=je(o,i,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return p?xA(a,u,e,t,n,r):(s=bA(a,l,u,r.isHorizontal),c=EA(a,l,u,r.isHorizontal),[s+":"+c])}function xA(e,t,n,r,i,o){var a=t?e:o.isHorizontal?ra(e):na(e),s=zs[a],c;return t?Gy(e)?c=Wy("y",n,r,i)?"h":o.boundaryLoop.alternateHorizontalSide:c=Wy("x",n,r,i)?"v":o.boundaryLoop.alternateVerticalSide:c=o.boundaryLoop.default,[s+":"+c]}function Wy(e,t,n,r){var i=cA;return!(Of(e,r,n,i)||Of(e,r,{x:n.x+n.width,y:n.y+n.height},i)||Of(e,r,q(t),i))}function Of(e,t,n,r){return Math.abs(t[e]-n[e])!Tr(d))})};oa.prototype.cleanUp=function(){this._complexPreview.cleanUp()};oa.$inject=["complexPreview","connectionDocking","elementFactory","eventBus","layouter","rules"];var Yy={__depends__:[So,Ag,Cu],__init__:["appendPreview"],appendPreview:["type",oa]};var qy=Math.min,Xy=Math.max;function If(e){e.preventDefault()}function Ws(e){e.stopPropagation()}function wA(e){return e.nodeType===Node.TEXT_NODE}function SA(e){return[].slice.call(e)}function un(e){this.container=e.container,this.parent=_e('
      '),this.content=ve("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=nt(this.autoResize,this),this.handlePaste=nt(this.handlePaste,this)}un.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=dt(t,["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);S(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=dt(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return S(a.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},p),r.centerVertically&&S(a.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},p),a.innerText=n,ae.bind(a,"keydown",this.keyHandler),ae.bind(a,"mousedown",Ws),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};un.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)}};un.prototype.insertText=function(e){e=CA(e);var t=document.execCommand("insertText",!1,e);t||this._insertTextIE(e)};un.prototype._insertTextIE=function(e){var t=this.getSelection(),n=t.startContainer,r=t.endContainer,i=t.startOffset,o=t.endOffset,a=t.commonAncestorContainer,s=SA(a.childNodes),c,p;if(wA(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,y){y===f?h.textContent=n.textContent.substring(0,i)+e+r.textContent.substring(o):y>f&&y<=d&&Lt(h)}),c=n,p=i+e.length}c&&p!==void 0&&setTimeout(function(){self.setSelection(c,p)})};un.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){If(h),Ws(h),s=h.clientX,c=h.clientY;var y=t.getBoundingClientRect();p=y.width,u=y.height,ae.bind(document,"mousemove",f),ae.bind(document,"mouseup",d)},f=function(h){If(h),Ws(h);var y=qy(Xy(p+h.clientX-s,r),o),v=qy(Xy(u+h.clientY-c,i),a);t.style.width=y+"px",t.style.height=v+"px",e.resizeHandler({width:p,height:u,dx:h.clientX-s,dy:h.clientY-c})},d=function(h){If(h),Ws(h),ae.unbind(document,"mousemove",f,!1),ae.unbind(document,"mouseup",d,!1)};ae.bind(n,"mousedown",l)}S(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)};un.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",Ws),ae.unbind(t,"input",this.autoResize),ae.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),Lt(n)),Lt(e)};un.prototype.getValue=function(){return this.content.innerText.trim()};un.prototype.getSelection=function(){var e=window.getSelection(),t=e.getRangeAt(0);return t};un.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 CA(e){return e.replace(/\r\n|\r|\n/g,` -`)}function Qt(e,t){this._eventBus=e,this._canvas=t,this._providers=[],this._textbox=new un({container:t.getContainer(),keyHandler:nt(this._handleKey,this),resizeHandler:nt(this._handleResize,this)})}Qt.$inject=["eventBus","canvas"];Qt.prototype.registerProvider=function(e){this._providers.push(e)};Qt.prototype.isActive=function(e){return!!(this._active&&(!e||this._active.element===e))};Qt.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())};Qt.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})};Qt.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0,this._canvas.restoreFocus&&this._canvas.restoreFocus()};Qt.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()}};Qt.prototype.getValue=function(){return this._textbox.getValue()};Qt.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()};Qt.prototype._handleResize=function(e){this._fire("resize",e)};Qt.prototype.activate=function(e){if(this.isActive()&&this.cancel(),this._eventBus.fire("directEditing.activate.allowed",{element:e})===!1)return!1;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 Ru={__depends__:[Gr],__init__:["directEditing"],directEditing:["type",Qt]};function Zy(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===re(e);return!o||!a||!s||!c}}var 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"}},{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"}}],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-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"}}],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 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"}}],t_=[{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"}}],n_=[{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"}}],r_=[{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}}],i_=[{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}}],Lf=[{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}}],o_=Lf,jf=[{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}}],a_=[{label:"Data store reference",actionName:"replace-with-data-store-reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}}],s_=[{label:"Data object reference",actionName:"replace-with-data-object-reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}}],c_=[{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}}],p_=[{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}}],u_=[{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"}],l_=[{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}}],f_={"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 Ff={"start-event-non-interrupting":` + `},Eu=HC;var $C=900;function oi(e,t,n,r){e.registerProvider($C,this),this._contextPad=e,this._popupMenu=t,this._translate=n,this._canvas=r}oi.$inject=["contextPad","popupMenu","translate","canvas"];oi.prototype.getMultiElementContextPadEntries=function(e){var t={};return this._isAllowed(e)&&C(t,this._getEntries(e)),t};oi.prototype._isAllowed=function(e){return!this._popupMenu.isEmpty(e,"align-elements")};oi.prototype._getEntries=function(){var e=this;return{"align-elements":{group:"align-elements",title:e._translate("Align elements"),html:`
      ${Eu.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)}}}}};oi.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};N();var zC=["left","center","right","top","middle","bottom"];function Oi(e,t,n,r){this._alignElements=t,this._translate=n,this._popupMenu=e,this._rules=r,e.registerProvider("align-elements",this)}Oi.$inject=["popupMenu","alignElements","translate","rules"];Oi.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&C(t,this._getEntries(e)),t};Oi.prototype._isAllowed=function(e){return this._rules.allowed("elements.align",{elements:e})};Oi.prototype._getEntries=function(e){var t=this._alignElements,n=this._translate,r=this._popupMenu,i={};return E(zC,function(o){i["align-elements-"+o]={group:"align",title:n("Align elements "+o),className:"bjs-align-elements-menu-entry",imageHtml:Eu[o],action:function(){t.trigger(e,o),r.close()}}}),i};function Ot(e){k.call(this,e),this.init()}Ot.$inject=["eventBus"];B(Ot,k);Ot.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)})};Ot.prototype.init=function(){};N();function ko(e){Ot.call(this,e)}ko.$inject=["eventBus"];B(ko,Ot);ko.prototype.init=function(){this.addRule("elements.align",function(e){var t=e.elements,n=Q(t,function(r){return!(r.waypoints||r.host||r.labelTarget)});return n=zr(n),n.length<2?!1:n})};var Yv={__depends__:[uv,su,Do],__init__:["alignElementsContextPadProvider","alignElementsMenuProvider","bpmnAlignElements"],alignElementsContextPadProvider:["type",oi],alignElementsMenuProvider:["type",Oi],bpmnAlignElements:["type",ko]};N();var GC=10,Pf=50,VC=250;function wu(e,t,n,r){for(var i;i=WC(e,n,t);)n=r(t,n,i);return n}function Su(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 WC(e,t,n){var r={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height},i=UC(e);return re(i,function(o){if(o===n)return!1;var a=He(o,r,GC);return a==="intersect"})}function Xv(e,t){t||(t={});function n(m){return m.source===e?1:-1}var r=t.defaultDistance||Pf,i=t.direction||"e",o=t.filter,a=t.getWeight||n,s=t.maxDistance||VC,c=t.reference||"start";o||(o=YC);function u(m,g){return i==="n"?c==="start"?Z(m).top-Z(g).bottom:c==="center"?Z(m).top-X(g).y:Z(m).top-Z(g).top:i==="w"?c==="start"?Z(m).left-Z(g).right:c==="center"?Z(m).left-X(g).x:Z(m).left-Z(g).left:i==="s"?c==="start"?Z(g).top-Z(m).bottom:c==="center"?X(g).y-Z(m).bottom:Z(g).bottom-Z(m).bottom:c==="start"?Z(g).left-Z(m).right:c==="center"?X(g).x-Z(m).right:Z(g).right-Z(m).right}var p=e.incoming.filter(o).map(function(m){var g=a(m),v=g<0?u(m.source,e):u(e,m.source);return{id:m.source.id,distance:v,weight:g}}),l=e.outgoing.filter(o).map(function(m){var g=a(m),v=g>0?u(e,m.target):u(m.target,e);return{id:m.target.id,distance:v,weight:g}}),f=p.concat(l).reduce(function(m,g){return m[g.id+"__weight_"+g.weight]=g,m},{}),d=Ge(f,function(m,g){var v=g.distance,w=g.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 Oo(e){e.invoke($n,this)}Oo.$inject=["injector"];B(Oo,$n);Oo.prototype.resize=function(e,t,n){h(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)};N();function Bi(e){Ot.call(this,e);var t=this;this.addRule("element.autoResize",function(n){return t.canResize(n.elements,n.target)})}Bi.$inject=["eventBus"];B(Bi,Ot);Bi.prototype.canResize=function(e,t){return!1};function Bo(e,t){Bi.call(this,e),this._modeling=t}B(Bo,Bi);Bo.$inject=["eventBus","modeling"];Bo.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")||ee(r)){n=!1;return}}),n};var Jv={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",Oo],bpmnAutoResizeProvider:["type",Bo]};var eg=1500;function Mu(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",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=An(a),c=document.elementFromPoint(s.x,s.y),rR(c)}}Mu.$inject=["elementRegistry","eventBus","injector"];function rR(e){return Bn(e,"svg, .djs-element",!0)}var tg={__init__:["hoverFix"],hoverFix:["type",Mu]};N();var Io=Math.round,ng="djs-drag-active";function Ii(e){e.preventDefault()}function iR(e){return typeof TouchEvent!="undefined"&&e instanceof TouchEvent}function oR(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(),R=t._container.getBoundingClientRect();return{x:b.x+(x.x-R.left)/b.scale,y:b.y+(x.y-R.top)/b.scale}}function s(x,b){b=b||o;var R=e.createEvent(C({},b.payload,b.data,{isTouch:b.isTouch}));return e.fire("drag."+x,R)===!1?!1:e.fire(b.prefix+"."+x,R)}function c(x){var b=x.filter(function(R){return r.get(R.id)});b.length&&n.select(b)}function u(x,b){var R=o.payload,A=o.displacement,O=o.globalStart,T=An(x),I=Dt(T,O),L=o.localStart,W=a(T),z=Dt(W,L);if(!o.active&&(b||oR(I)>o.threshold)){if(C(R,{x:Io(L.x+A.x),y:Io(L.y+A.y),dx:0,dy:0},{originalEvent:x}),s("start")===!1)return v();o.active=!0,o.keepSelection||(R.previousSelection=n.get(),n.select(null)),o.cursor&&Di(o.cursor),t.addMarker(t.getRootElement(),ng)}Wc(x),o.active&&(C(R,{x:Io(W.x+A.x),y:Io(W.y+A.y),dx:Io(z.x),dy:Io(z.y)},{originalEvent:x}),s("move"))}function p(x){var b,R=!0;o.active&&(x&&(o.payload.originalEvent=x,Wc(x)),R=s("end")),R===!1&&s("rejected"),b=w(R!==!0),s("ended",b)}function l(x){Ke("Escape",x)&&(Ii(x),v())}function f(x){var b;o.active&&(b=nu(e),setTimeout(b,400),Ii(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 g(x){s("out");var b=o.payload;b.hoverGfx=null,b.hover=null}function v(x){var b;if(o){var R=o.active;R&&s("cancel"),b=w(x),R&&s("canceled",b)}}function w(x){var b,R;s("cleanup"),tu(),o.trapClick?R=f:R=p,se.unbind(document,"mousemove",u),se.unbind(document,"dragstart",Ii),se.unbind(document,"selectstart",Ii),se.unbind(document,"mousedown",R,!0),se.unbind(document,"mouseup",R,!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",g),t.removeMarker(t.getRootElement(),ng);var A=o.payload.previousSelection;return x!==!1&&A&&!n.get().length&&c(A),b=o,o=null,b}function S(x,b,R,A){o&&v(!1),typeof b=="string"&&(A=R,R=b,b=null),A=C({},i,A||{});var O=A.data||{},T,I,L,W,z;if(A.trapClick?W=f:W=p,x?(T=Ar(x)||x,I=An(x),Wc(x),T.type==="dragstart"&&Ii(T)):(T=null,I={x:0,y:0}),L=a(I),b||(b=L),z=iR(T),o=C({prefix:R,data:O,payload:{},globalStart:I,displacement:Dt(b,L),localStart:L,isTouch:z},A),A.manual||(z?(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",Ii),se.bind(document,"selectstart",Ii),se.bind(document,"mousedown",W,!0),se.bind(document,"mouseup",W,!0)),se.bind(document,"keyup",l),e.on("element.hover",m),e.on("element.out",g)),s("init")===!1)return v(),!1;A.autoActivate&&u(x,!0)}e.on("diagram.destroy",v),this.init=S,this.move=u,this.hover=m,this.out=g,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 kt={__depends__:[tg,rt],dragging:["type",Du]};N();function ai(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()})}ai.$inject=["config.autoScroll","eventBus","canvas"];ai.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++)aR(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 aR(e,t,n){return tA-3&&(I=He(d.target,R),g===A-2?I==="intersect"&&(x.pop(),x[x.length-1]=R):I!=="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,mg)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(l){var f=l.context.hover;f&&n.removeMarker(f,mg)}),t.on("connectionSegment.move.cleanup",function(l){var f=l.context,d=f.connection;f.draggerGfx&&Pe(f.draggerGfx),n.removeMarker(d,hg)}),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,g=f.newSegmentStartIndex;m=m.map(function(R){return{original:R.original,x:Math.round(R.x),y:Math.round(R.y)}});var v=p(m,g),w=v.waypoints,S=s(d,w),x=v.segmentOffset,b={segmentMove:{segmentStartIndex:f.segmentStartIndex,newSegmentStartIndex:g+x}};o.updateWaypoints(d,S,b)})}Fu.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];N();var xR=Math.abs,_g=Math.round;function bg(e,t,n){n=n===void 0?10:n;var r,i;for(r=0;ro-kf)return a-c+o}return a}function n(o,a){if(o.waypoints)return sg(a,o);if(o.width)return{x:xg(o.width/2+o.x),y:xg(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 g=[u[l-1],p,f,u[d+1]];return l<2&&g.unshift(n(c.source,o)),d>u.length-3&&g.unshift(n(c.target,o)),a.snapPoints=s={horizontal:[],vertical:[]},E(g,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)&&ze(o,"x",u),(f||a.horizontal.indexOf(c)!==-1)&&ze(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);!de(s)||!c||!c.x||!c.y||(ze(o,"x",c.x),ze(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,g=l-d;C(o,{dx:o.dx-m,dy:o.dy-g,x:o.x-m,y:o.y-g}),(m||s.vertical.indexOf(p)!==-1)&&ze(o,"x",f),(g||s.horizontal.indexOf(l)!==-1)&&ze(o,"y",d)}})}Gu.$inject=["eventBus"];var Eg={__depends__:[kt,Et],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",Iu],bendpointMove:["type",Qa],bendpointMovePreview:["type",ju],connectionSegmentMove:["type",Fu],bendpointSnapping:["type",Gu]};N();function Wu(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),!Yn(p)){if(p!==!1){s.source=c,s.target=u;return}p=s.canExecute=o(c,u),!Yn(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:Vu(s)?p:u,connectionEnd:Vu(s)?u:p};Se(c)&&(d=c),s.connection=n.connect(l,f,d,m)}),this.start=function(a,s,c,u){Se(c)||(u=c,c=X(s)),t.init(a,"connect",{autoActivate:u,data:{shape:s,context:{start:s,connectionStart:c}}})}}Wu.$inject=["eventBus","dragging","modeling","rules"];function Vu(e){var t=e.hover,n=e.source,r=e.target;return t&&n&&t===n&&n!==r}var wR=1100,SR=900,wg="connect-ok",Sg="connect-not-ok";function Uu(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,g=d;Vu(o)&&(m=d,g=f),r.drawPreview(o,a,{source:c||u,target:l||s,connectionStart:m,connectionEnd:g})}),t.on("connect.hover",SR,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"],wR,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)})}Uu.$inject=["injector","eventBus","canvas"];var Lo={__depends__:[rt,Et,kt],__init__:["connectPreview"],connect:["type",Wu],connectPreview:["type",Uu]};N();var CR="djs-dragger";function Gn(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)}Gn.$inject=["injector","canvas","graphicsFactory","elementFactory"];Gn.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()),_r(r),i||(i=e.getConnection=RR(function(g,v,w){return m.getConnection(g,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?X(o):c,a?X(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)"})};Gn.prototype.drawNoopPreview=function(e,t){var n=t.source,r=t.target,i=t.connectionStart||X(n),o=t.connectionEnd||X(r),a=this.cropWaypoints(i,o,n,r),s=this.createNoopConnection(a[0],a[1]);J(e,s)};Gn.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&&qr(o,s,!0)||e,t=r&&qr(a,s,!1)||t,[e,t]};Gn.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&Pe(e.connectionPreviewGfx)};Gn.prototype.getConnection=function(e){var t=PR(e);return this._elementFactory.createConnection(t)};Gn.prototype.createConnectionPreviewGfx=function(){var e=U("g");return $(e,{pointerEvents:"none"}),pe(e).add(CR),J(this._canvas.getActiveLayer(),e),e};Gn.prototype.createNoopConnection=function(e,t){return Xn([e,t],{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"})};function RR(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 PR(e){return Se(e)?e:{}}var Cg={__init__:["connectionPreview"],connectionPreview:["type",Gn]};var AR=new or("ps"),TR=["marker-start","marker-mid","marker-end"],MR=["circle","ellipse","line","path","polygon","polyline","path","rect"];function cr(e,t,n,r){this._elementRegistry=e,this._canvas=n,this._styles=r}cr.$inject=["elementRegistry","eventBus","canvas","styles"];cr.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")};cr.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)};cr.prototype.addDragger=function(e,t,n,r="djs-dragger"){n=n||this.getGfx(e);var i=Sl(n),o=n.getBoundingClientRect();return this._cloneMarkers(Ln(i),r),$(i,this._styles.cls(r,[],{x:o.top,y:o.left})),J(t,i),$(i,"data-preview-support-element-id",e.id),i};cr.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 J(t,n),$(n,"data-preview-support-element-id",e.id),n};cr.prototype._cloneMarkers=function(e,t="djs-dragger",n=e){var r=this;e.childNodes&&e.childNodes.forEach(i=>{r._cloneMarkers(i,t,n)}),OR(e)&&TR.forEach(function(i){if($(e,i)){var o=DR(e,i,r._canvas.getContainer());o&&r._cloneMarker(n,e,o,i,t)}})};cr.prototype._cloneMarker=function(e,t,n,r,i="djs-dragger"){var o=[n.id,i,AR.next()].join("-"),a=_e("marker#"+n.id,e);e=e||this._canvas._svg;var s=a||Sl(n);s.id=o,pe(s).add(i);var c=_e(":scope > defs",e);c||(c=U("defs"),J(e,c)),J(c,s);var u=NR(s.id);$(t,r,u)};function DR(e,t,n){var r=kR($(e,t));return _e("marker#"+r,n||document)}function kR(e){return e.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]}function NR(e){return"url(#"+e+")"}function OR(e){return MR.indexOf(e.nodeName)!==-1}var Dn={__init__:["previewSupport"],previewSupport:["type",cr]};var qu="complex-preview",jo=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(qu);n.filter(s=>!BR(s)).forEach(s=>{let c;de(s)?(c=this._graphicsFactory._createContainer("connection",U("g")),this._graphicsFactory.drawConnection(Ln(c),s)):(c=this._graphicsFactory._createContainer("shape",U("g")),this._graphicsFactory.drawShape(Ln(c),s),Fe(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);de(s)?Fe(u,c.x,c.y):Fe(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(Ln(u),s,{width:c.width,height:c.height}),Fe(u,c.x,c.y),this._previewSupport.addDragger(s,a,u)})}cleanUp(){_r(this._canvas.getLayer(qu)),this._markers.forEach(([t,n])=>this._canvas.removeMarker(t,n)),this._markers=[]}show(){this._canvas.showLayer(qu)}hide(){this._canvas.hideLayer(qu)}};jo.$inject=["canvas","graphicsFactory","previewSupport"];function BR(e){return e.hidden}var Rg={__depends__:[Dn],__init__:["complexPreview"],complexPreview:["type",jo]};var Nf=["top","bottom","left","right"],Ku=10;function es(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,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(Xr(i)&&!de(i)){var o=jR(i);o&&r(i,o)}}function r(i,o){var a=X(i),s=i.label,c=X(s);if(s.parent){var u=Z(i),p;switch(o){case"top":p={x:a.x,y:u.top-Ku-s.height/2};break;case"left":p={x:u.left-Ku-s.width/2,y:a.y};break;case"bottom":p={x:a.x,y:u.bottom+Ku+s.height/2};break;case"right":p={x:u.right+Ku+s.width/2,y:a.y};break}var l=Dt(p,c);t.moveShape(s,l)}}}B(es,k);es.$inject=["eventBus","modeling"];function IR(e){var t=e.host,n=X(e),r=He(n,t),i;r.indexOf("-")>=0?i=r.split("-"):i=[r];var o=Nf.filter(function(a){return i.indexOf(a)===-1});return o}function LR(e){var t=X(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 jR(e){var t=X(e.label),n=X(e),r=Pg(n,t);if(FR(r)){var i=LR(e);if(e.host){var o=IR(e);i=i.concat(o)}var a=Nf.filter(function(s){return i.indexOf(s)===-1});return a.indexOf(r)!==-1?He(e.label,e)!=="intersect"?void 0:r:a[0]}}function Pg(e,t){return He(t,e,5)}function FR(e){return Nf.indexOf(e)!==-1}function ts(e){k.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(ts,k);ts.$inject=["eventBus"];N();var HR=1500;function ns(e,t,n){e.invoke(k,this),this.preExecute("elements.delete",HR,function(i){var o=i.context,a=o.elements,s=r(a);s.length&&(o.elements=a.concat(s))}),t.on("shape.move.start",function(i){var o=i.context.shapes,a=r(o);a.length&&(i.context.shapes=o.concat(a))});function r(i){var o=Q(i,u=>h(u,"bpmn:Participant")||h(u,"bpmn:SubProcess"));if(!o.length)return[];var a=n.getRootElement(),s=new Set(a.children.filter(u=>h(u,"bpmn:Artifact"))),c=new Set;return E(o,u=>{let p=new Set(Sn(wi(Array.from(s),Ce(u))));c=c.union(p),s=s.difference(p)}),Array.from(c)}}B(ns,k);ns.$inject=["injector","eventBus","canvas"];N();function rs(e,t){e.invoke(k,this),this.postExecute("shape.move",function(n){var r=n.newParent,i=n.shape,o=Q(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(rs,k);rs.$inject=["injector","modeling"];var Ag=500;function Fo(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)}Fo.$inject=["bpmnReplace","injector"];B(Fo,k);Fo.prototype._replaceShape=function(e,t){var n=$R(e),r={type:"bpmn:BoundaryEvent",host:t};return n&&(r.eventDefinitionType=n.$type),this._bpmnReplace.replaceElement(e,r,{layoutConnection:!1})};function $R(e){var t=j(e),n=t.eventDefinitions;return n&&n[0]}function Tg(e,t){return!ee(e)&&te(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}N();function is(e,t){k.call(this,e);function n(r){return Q(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)})})}is.$inject=["eventBus","modeling"];B(is,k);function as(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,S=v.target;Ho(w)&&os(S)&&p(S)}function i(v){let w=v.connection,S=v.source,x=v.target;Ho(S)&&Yu(x)&&(u(x),f(S,[w]))}function o(v){let w=v.newTarget,S=v.oldSource,x=v.oldTarget;if(x!==w){let b=S;os(x)&&p(x),Ho(b)&&Yu(w)&&u(w)}}function a(v){let{element:w}=v;os(w)?(l(w),d(w)):Yu(w)&&m(w)}function s(v){let{newData:w,oldShape:S}=v;if(Ho(v.oldShape)&&w.eventDefinitionType!=="bpmn:CompensateEventDefinition"||w.type!=="bpmn:BoundaryEvent"){let x=S.outgoing.find(({target:b})=>os(b));x&&x.target&&(v._connectionTarget=x.target)}else if(!Ho(v.oldShape)&&w.eventDefinitionType==="bpmn:CompensateEventDefinition"&&w.type==="bpmn:BoundaryEvent"){let x=S.outgoing.find(({target:b})=>Yu(b));x&&x.target&&(v._connectionTarget=x.target),g(S)}}function c(v){let{_connectionTarget:w,newShape:S}=v;w&&t.connect(S,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=>os(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(S=>Ho(S.source));t.removeElements(w)}function g(v){let w=v.outgoing.filter(S=>h(S,"bpmn:SequenceFlow"));t.removeElements(w)}}B(as,k);as.$inject=["eventBus","modeling","bpmnRules"];function os(e){let t=j(e);return t&&t.get("isForCompensation")}function Ho(e){return e&&h(e,"bpmn:BoundaryEvent")&&Er(e,"bpmn:CompensateEventDefinition")}function Yu(e){return e&&h(e,"bpmn:Activity")&&!Qe(e)}function ss(e){e.invoke(k,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=kr(r,"bpmn:Participant"))})}ss.$inject=["injector"];B(ss,k);function cs(e,t){k.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}})}cs.$inject=["eventBus","bpmnFactory"];B(cs,k);N();var Of=20,Bf=20,Mg=30,Xu=2e3;function us(e,t,n){k.call(this,t),t.on(["create.start","shape.move.start"],Xu,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")&&!ee(l)&&!de(l)});if(c.length){var u=Ce(c),p=zR(a,u);C(a,p),o.createConstraints=GR(a,u)}}}),t.on("create.start",Xu,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",Xu,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",Xu,function(i){var o=i.elements,a=i.parent,s=VR(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)}us.$inject=["canvas","eventBus","modeling"];B(us,k);function zR(e,t){t={width:t.width+Of*2+Mg,height:t.height+Bf*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 GR(e,t){return t=Z(t),{bottom:t.top+e.height/2-Bf,left:t.right-e.width/2+Of,top:t.bottom-e.height/2+Bf,right:t.left+e.width/2-Of-Mg}}function VR(e){return re(e,function(t){return h(t,"bpmn:Participant")})}N();var Dg="__targetRef_placeholder";function ps(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 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}),Ae(c,u)),u}function i(a,s){var c=r(a);c&&(n(a,c,s)||Oe(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,g=m&&m.businessObject,v=c.businessObject,w;g&&g!==l&&i(g,u),d&&d!==l&&i(d,u),l?(w=r(l,!0),v.targetRef=w):v.targetRef=null}}ps.$inject=["eventBus","bpmnFactory"];B(ps,k);function kg(e){return function(t){var n=t.context,r=n.connection;if(h(r,"bpmn:DataInputAssociation"))return e(t)}}function $o(e){this._bpmnUpdater=e}$o.$inject=["bpmnUpdater"];$o.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),[]};$o.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 ls(e,t,n,r){k.call(this,r),t.registerHandler("dataStore.updateContainment",$o);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:UR(p,"bpmn:Participant");a(u,f)}}),this.postExecute("shape.delete",function(s){var c=s.context,u=c.shape,p=e.getRootElement();te(u,["bpmn:Participant","bpmn:SubProcess"])&&h(p,"bpmn:Collaboration")&&o(p).filter(function(l){return WR(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)})})}ls.$inject=["canvas","commandStack","elementRegistry","eventBus"];B(ls,k);function WR(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 UR(e,t){for(;e.parent;){if(h(e.parent,t))return e.parent;e=e.parent}}N();var Qu=Math.max,Ju=Math.min,qR=20;function ep(e,t){return{top:e.top-t.top,right:e.right-t.right,bottom:e.bottom-t.bottom,left:e.left-t.left}}function Ng(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 Og(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 Zu(e,t,n){var r=t[e],i=n.min&&n.min[e],o=n.max&&n.max[e];return ne(i)&&(r=(/top|left/.test(e)?Ju:Qu)(r,i)),ne(o)&&(r=(/top|left/.test(e)?Qu:Ju)(r,o)),r}function Bg(e,t){if(!t)return e;var n=Z(e);return Si({top:Zu("top",n,t),right:Zu("right",n,t),bottom:Zu("bottom",n,t),left:Zu("left",n,t)})}function Ig(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:Ju(o.top,a.top),left:Ju(o.left,a.left),bottom:Qu(o.bottom,a.bottom),right:Qu(o.right,a.right)};return Si(s)}function fs(e,t){return typeof e!="undefined"?e:qR}function KR(e,t){var n,r,i,o;return typeof t=="object"?(n=fs(t.left),r=fs(t.right),i=fs(t.top),o=fs(t.bottom)):n=r=i=o=fs(t),{x:e.x-n,y:e.y-i,width:e.width+n+r,height:e.height+i+o}}function YR(e){return!(e.waypoints||e.type==="label")}function tp(e,t){var n;if(e.length===void 0?n=Q(e.children,YR):n=e,n.length)return KR(Ce(n),t)}var si=Math.abs;function XR(e,t){return ep(Z(t),Z(e))}var ZR=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],on=30;function zo(e,t){return t=t||[],e.children.filter(function(n){h(n,"bpmn:Lane")&&(zo(n,t),t.push(n))}),t}function yn(e){return e.children.filter(function(t){return h(t,"bpmn:Lane")})}function Bt(e){return kr(e,ZR)||e}function Lg(e,t){var n=Bt(e),r=h(n,"bpmn:Process")?[]:[n],i=zo(n,r),o=Z(e),a=Z(t),s=XR(e,t),c=[],u=Me(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,g=Z(p);s.top&&(si(g.bottom-o.top)<10&&(d=a.top-g.bottom),si(g.top-o.top)<5&&(l=a.top-g.top)),s.left&&(si(g.right-o.left)<10&&(f=a.left-g.right),si(g.left-o.left)<5&&(m=a.left-g.left)),s.bottom&&(si(g.top-o.bottom)<10&&(l=a.bottom-g.top),si(g.bottom-o.bottom)<5&&(d=a.bottom-g.bottom)),s.right&&(si(g.left-o.right)<10&&(m=a.right-g.left),si(g.right-o.right)<5&&(f=a.right-g.right)),(l||f||d||m)&&c.push({shape:p,newBounds:Og(p,{top:l,right:f,bottom:d,left:m})})}}),c}var QR=500;function ds(e,t){k.call(this,e);function n(r,i){var o=Me(r),a=yn(i),s=[],c=[],u=[],p=[];if(In(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,g;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&&(g=t.calculateAdjustments(p,"x",-l,r.x+r.width+10),t.makeSpace(g.movingShapes,g.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))})}ds.$inject=["eventBus","spaceTool"];B(ds,k);var jg=500;function Go(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,eP(i,c)?c:o)&&(i[s]=n._replaceShape(a))})},!0)}Go.$inject=["bpmnReplace","injector"];B(Go,k);Go.prototype._replaceShape=function(e){var t=JR(e),n;return t?n={type:"bpmn:IntermediateCatchEvent",eventDefinitionType:t.$type}:n={type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,n,{layoutConnection:!1})};function JR(e){var t=j(e),n=t.eventDefinitions;return n&&n[0]}function Fg(e,t){return!ee(e)&&h(e,"bpmn:BoundaryEvent")&&!t}function eP(e,t){return e.indexOf(t)!==-1}N();function ms(e,t,n){k.call(this,e);function r(i,o,a){var s=o.waypoints,c,u,p,l,f,d,m,g=i.outgoing.slice(),v=i.incoming.slice(),w;ne(a.width)?w=X(a):w=a;var S=Ua(s,w);if(S){if(c=s.slice(0,S.index),u=s.slice(S.index+(S.bendpoint?1:0)),!c.length||!u.length)return;p=S.bendpoint?s[S.index]:w,(c.length===1||!Hg(i,c[c.length-1]))&&c.push($g(p)),(u.length===1||!Hg(i,u[0]))&&u.unshift($g(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&&Q(v,function(b){return b.source===d.source})||[],m&&Q(g,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=X(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&&Ua(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(ms,k);ms.$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 hs(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)&&Vo(i)){var c=[];h(o,"bpmn:EventBasedGateway")?c=a.incoming.filter(u=>u!==i&&Vo(u)):c=a.incoming.filter(u=>u!==i&&Vo(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(Vo).reduce(function(a,s){return a.includes(s.target)?a:a.concat(s.target)},[]);o.forEach(function(a){a.incoming.filter(Vo).forEach(function(s){let c=a.incoming.filter(Vo).filter(function(u){return u.source===i});(s.source!==i||c.length>1)&&t.removeConnection(s)})})}})}hs.$inject=["eventBus","modeling"];B(hs,k);function Vo(e){return h(e,"bpmn:SequenceFlow")}var np=1500,zg=2e3;function rp(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"],np,function(r){var i=r.context,o=i.shape||r.shape,a=r.hover;h(a,"bpmn:Lane")&&!te(o,["bpmn:Lane","bpmn:Participant"])&&(r.hover=Bt(a),r.hoverGfx=e.getGraphics(r.hover));var s=n.getRootElement();a!==s&&(o.labelTarget||te(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"],np,function(r){var i=r.hover;h(i,"bpmn:Lane")&&(r.hover=Bt(i)||i,r.hoverGfx=e.getGraphics(r.hover))}),t.on(["bendpoint.move.hover"],np,function(r){var i=r.context,o=r.hover,a=i.type;h(o,"bpmn:Lane")&&/reconnect/.test(a)&&(r.hover=Bt(o)||o,r.hoverGfx=e.getGraphics(r.hover))}),t.on(["connect.start"],np,function(r){var i=r.context,o=i.start;h(o,"bpmn:Lane")&&(i.start=Bt(o)||o)}),t.on("shape.move.start",zg,function(r){var i=r.shape;h(i,"bpmn:Lane")&&(r.shape=Bt(i)||i)}),t.on("spaceTool.move",zg,function(r){var i=r.hover;i&&h(i,"bpmn:Lane")&&(r.hover=Bt(i))})}rp.$inject=["elementRegistry","eventBus","canvas"];function Gg(e){return e.create("bpmn:Category")}function Vg(e){return e.create("bpmn:CategoryValue")}function Wg(e,t,n){return Ae(t.get("categoryValue"),e),e.$parent=t,Ae(n.get("rootElements"),t),t.$parent=n,e}function Ug(e){var t=e.$parent;return t&&(Oe(t.get("categoryValue"),e),e.$parent=null),e}function qg(e){var t=e.$parent;return t&&(Oe(t.get("rootElements"),e),e.$parent=null),e}var Kg=770;function vs(e,t,n,r,i,o){i.invoke(k,this);function a(){return n.filter(function(m){return h(m,"bpmn:Group")})}function s(m,g){return m.some(function(v){var w=j(v),S=w.categoryValueRef&&w.categoryValueRef.$parent;return S===g})}function c(m,g){return m.some(function(v){var w=j(v);return w.categoryValueRef===g})}function u(m,g,v){var w=a().filter(function(S){return S.businessObject!==v});g&&!s(w,g)&&qg(g),m&&!c(w,m)&&Ug(m)}function p(m,g){return Wg(m,g,t.getDefinitions())}function l(m,g){var v=j(m),w=v.categoryValueRef;w||(w=v.categoryValueRef=g.categoryValue=g.categoryValue||Vg(e));var S=w.$parent;S||(S=w.$parent=g.category=g.category||Gg(e)),p(w,S,t.getDefinitions())}function f(m,g){var v=g.category,w=g.categoryValue,S=j(m);w?(S.categoryValueRef=null,u(w,v,S)):u(null,S.categoryValueRef.$parent,S)}this.execute("label.create",function(m){var g=m.context,v=g.labelTarget;h(v,"bpmn:Group")&&l(v,g)}),this.revert("label.create",function(m){var g=m.context,v=g.labelTarget;h(v,"bpmn:Group")&&f(v,g)}),this.execute("shape.delete",function(m){var g=m.context,v=g.shape,w=j(v);if(!(!h(v,"bpmn:Group")||v.labelTarget)){var S=g.categoryValue=w.categoryValueRef,x;S&&(x=g.category=S.$parent,u(S,x,w),w.categoryValueRef=null)}}),this.reverted("shape.delete",function(m){var g=m.context,v=g.shape;if(!(!h(v,"bpmn:Group")||v.labelTarget)){var w=g.category,S=g.categoryValue,x=j(v);S&&(x.categoryValueRef=S,p(S,w))}}),this.execute("shape.create",function(m){var g=m.context,v=g.shape;!h(v,"bpmn:Group")||v.labelTarget||j(v).categoryValueRef&&l(v,g)}),this.reverted("shape.create",function(m){var g=m.context,v=g.shape;!h(v,"bpmn:Group")||v.labelTarget||j(v).categoryValueRef&&f(v,g)});function d(m,g){var v=e.create(m.$type);return o.copyElement(m,v,null,g)}r.on("copyPaste.copyElement",Kg,function(m){var g=m.descriptor,v=m.element;if(!(!h(v,"bpmn:Group")||v.labelTarget)){var w=j(v);if(w.categoryValueRef){var S=w.categoryValueRef;g.categoryValue=d(S,!0),S.$parent&&(g.category=d(S.$parent,!0))}}}),r.on("copyPaste.pasteElement",Kg,function(m){var g=m.descriptor,v=g.businessObject,w=g.categoryValue,S=g.category;w&&(w=v.categoryValueRef=d(w)),S&&(w.$parent=d(S)),delete g.category,delete g.categoryValue})}vs.$inject=["bpmnFactory","bpmnjs","elementRegistry","eventBus","injector","moddleCopy"];B(vs,k);function Wo(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 ip(e){function t(r,i,o){var a={x:o.x,y:o.y-50},s={x:o.x-50,y:o.y},c=Wo(r,i,o,a),u=Wo(r,i,o,s),p;c&&u?Yg(c,o)>Yg(u,o)?p=u:p=c:p=c||u,r.original=p}function n(r){var i=r.waypoints;t(i[0],i[1],X(r.source)),t(i[i.length-1],i[i.length-2],X(r.target))}e.on("bpmnElement.added",function(r){var i=r.element;i.waypoints&&n(i)})}ip.$inject=["eventBus"];function Yg(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function gs(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=j(r),o=ce(r);if(te(i,t)){var a=o.get("isHorizontal");a===void 0&&(a=!0),o.set("isHorizontal",a)}})}gs.$inject=["eventBus"];B(gs,k);N();var ey=Math.sqrt,ty=Math.min,tP=Math.max,Xg=Math.abs;function Zg(e){return Math.pow(e,2)}function ys(e,t){return ey(Zg(e.x-t.x)+Zg(e.y-t.y))}function ny(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:Jg(r,u[0])?n:n+1}),u.length===2&&(s=iP(u[0],u[1]),p={type:"segment",position:s,segmentIndex:n,relativeLocation:ys(r,s)/ys(r,i)}),l=ys(p.position,e),(!d||f>l)&&(d=p,f=l)}return d}function nP(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=ey(d),g=-l+m,v=-l-m,w={x:e.x-i*g,y:e.y-o*g};if(d===0)return[w];var S={x:e.x-i*v,y:e.y-o*v};return[w,S].filter(function(x){return rP(x,e,t)})}function rP(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>=ty(t,n)-op&&e<=tP(t,n)+op}function iP(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}var op=.1;function Jg(e,t){return Xg(e.x-t.x)<=op&&Xg(e.y-t.y)<=op}function iy(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=ry(n,c),l=ry(t,u),f=s.position,d=aP(p,f),m=oP(p,l);if(s.type==="bendpoint"){var g=t.length-n.length,v=s.bendpointIndex,w=n[v];if(t.indexOf(w)!==-1)return a;if(g===0){var S=t[v];return i=S.x-s.position.x,o=S.y-s.position.y,{delta:{x:i,y:o},point:{x:e.x+i,y:e.y+o}}}g<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(sy in u&&t.updateLabel(c,u[sy]),cy in u&&h(c,"bpmn:TextAnnotation")){var p=r.getTextAnnotationBounds({x:c.x,y:c.y,width:c.width,height:c.height},u[cy]||"");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;ee(u)||!mn(u)||gt(u)&&t.updateLabel(u,gt(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),ay(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&&mn(p)&&u.label&&c.label&&(c.label.x=u.label.x,c.label.y=u.label.y)}),this.preExecute("shape.resize",function(a){var s=a.context,c=s.shape,u=s.hints||{};if(!(!ee(c)||u.autoResize)){var p=s.newBounds,l=r.getDimensions(gt(c)||"",{box:p,style:r.getExternalStyle()}),f=Math.ceil(l.height),d=p.y!==c.y,m=c.y+c.height;s.newBounds={width:p.width,height:f,x:p.x,y:d?m-f:p.y}}}),this.postExecute("shape.resize",function(a){var s=a.context,c=s.shape,u=s.newBounds,p=s.oldBounds;if(Xr(c)){var l=c.label,f=X(l),d=dP(p),m=fP(f,d),g=lP(m,p,u);t.moveShape(l,g)}})}B(_s,k);_s.$inject=["eventBus","modeling","bpmnFactory","textRenderer"];function lP(e,t,n){var r=Hi(e,t,n);return Rn(Dt(r,e))}function fP(e,t){if(t.length){var n=mP(e,t);return qa(e,n)}}function dP(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 mP(e,t){var n=t.map(function(i){return{line:i,distance:Nu(e,i)}}),r=At(n,"distance");return r[0].line}N();function uy(e,t,n,r){return ap(e,t,n,r).point}function bs(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,u=o.oldWaypoints;return typeof s.startChanged=="undefined"&&(s.startChanged=!!s.connectionStart),typeof s.endChanged=="undefined"&&(s.endChanged=!!s.connectionEnd),uy(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(bs,k);bs.$inject=["eventBus","modeling"];N();function ci(e,t,n){var r=sp(e),i=ly(r,t),o=r[0];return i.length?i[i.length-1]:Hi(o.original||o,n,t)}function ui(e,t,n){var r=sp(e),i=ly(r,t),o=r[r.length-1];return i.length?i[0]:Hi(o.original||o,n,t)}function Uo(e,t,n){var r=sp(e),i=py(t,n),o=r[0];return Hi(o.original||o,i,t)}function qo(e,t,n){var r=sp(e),i=py(t,n),o=r[r.length-1];return Hi(o.original||o,i,t)}function py(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function sp(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function ly(e,t){var n=je(e,vP);return Q(n,function(r){return hP(r,t)})}function hP(e,t){return He(t,e,1)==="intersect"}function vP(e){return e.original||e}function xs(e,t){k.call(this,e),this.postExecute("shape.replace",function(n){var r=n.oldShape,i=n.newShape;if(gP(r,i)){var o=yP(r);o.incoming.forEach(function(a){var s=ui(a,i,r);t.reconnectEnd(a,i,s)}),o.outgoing.forEach(function(a){var s=ci(a,i,r);t.reconnectStart(a,i,s)})}},!0)}xs.$inject=["eventBus","modeling"];B(xs,k);function gP(e,t){return h(e,"bpmn:Participant")&&ie(e)&&h(t,"bpmn:Participant")&&!ie(t)}function yP(e){var t=Zn([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 _P=["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:EscalationEventDefinition","bpmn:ConditionalEventDefinition","bpmn:SignalEventDefinition"];function cp(e){let t=j(e);if(!h(t,"bpmn:BoundaryEvent")&&!(h(t,"bpmn:StartEvent")&&Qe(t.$parent)))return!1;let n=t.get("eventDefinitions");return!n||!n.length?!1:_P.some(r=>h(n[0],r))}function up(e){return h(e,"bpmn:BoundaryEvent")?"cancelActivity":"isInterrupting"}function Es(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(!cp(i))return;let a=up(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})})}Es.$inject=["injector","modeling"];B(Es,k);function ws(e,t){k.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(ws,k);ws.$inject=["eventBus","modeling"];function Ss(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(!(!h(o,"bpmn:SequenceFlow")||!h(a,"bpmn:SequenceFlow"))&&t.canConnect(o.source,a.target,o)){var s=bP(o.waypoints,a.waypoints);n.reconnectEnd(o,a.target,s)}}})}B(Ss,k);Ss.$inject=["eventBus","bpmnRules","modeling"];function Ko(e){return e.original||e}function bP(e,t){var n=Wo(Ko(e[e.length-2]),Ko(e[e.length-1]),Ko(t[1]),Ko(t[0]));return n?[].concat(e.slice(0,e.length-1),[n],t.slice(1)):[Ko(e[0]),Ko(t[t.length-1])]}function Cs(e,t){k.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)}Cs.$inject=["eventBus","modeling"];B(Cs,k);N();function Rs(e,t,n,r){k.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,Ct({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(Rs,k);Rs.$inject=["eventBus","modeling","bpmnRules","injector"];N();function Yo(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,u=s.elements,p=Ge(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){Qe(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(Yo,k);Yo.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)};Yo.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var xP=1500,fy={width:140,height:120},pp={width:300,height:60},lp={width:60,height:300},Ps={width:300,height:150},As={width:150,height:300},Lf={width:140,height:120},jf={width:100,height:40};function fp(e){e.on("resize.start",xP,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=RP(r,i,o)),h(r,"bpmn:SubProcess")&&ie(r)&&(n.minDimensions=Lf),h(r,"bpmn:TextAnnotation")&&(n.minDimensions=jf)})}fp.$inject=["eventBus"];var pi=Math.abs,EP=Math.min,wP=Math.max;function dy(e,t,n,r){var i=e[t];e[t]=i===void 0?n:r(n,i)}function Xo(e,t,n){return dy(e,t,n,EP)}function Zo(e,t,n){return dy(e,t,n,wP)}var SP={top:20,left:50,right:20,bottom:20},CP={top:50,left:20,right:20,bottom:20};function RP(e,t,n){var r=Bt(e),i=!0,o=!0,a=zo(r,[r]),s=Z(e),c={},u={},p=Me(e),l=p?pp:lp;/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 g=Z(m);p?(g.tops.bottom+10&&(o=!1)):(g.lefts.right+10&&(o=!1)),/n/.test(t)&&(n&&pi(s.top-g.bottom)<10&&Zo(c,"top",g.top+l.height),pi(s.top-g.top)<5&&Xo(u,"top",g.bottom-l.height)),/e/.test(t)&&(n&&pi(s.right-g.left)<10&&Xo(c,"right",g.right-l.width),pi(s.right-g.right)<5&&Zo(u,"right",g.left+l.width)),/s/.test(t)&&(n&&pi(s.bottom-g.top)<10&&Xo(c,"bottom",g.bottom-l.height),pi(s.bottom-g.bottom)<5&&Zo(u,"bottom",g.top+l.height)),/w/.test(t)&&(n&&pi(s.left-g.right)<10&&Zo(c,"left",g.left+l.width),pi(s.left-g.left)<5&&Xo(u,"left",g.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?SP:CP;return f.forEach(function(m){var g=Z(m);/n/.test(t)&&(!p||i)&&Xo(u,"top",g.top-d.top),/e/.test(t)&&(p||o)&&Zo(u,"right",g.right+d.right),/s/.test(t)&&(!p||o)&&Zo(u,"bottom",g.bottom+d.bottom),/w/.test(t)&&(p||i)&&Xo(u,"left",g.left-d.left)}),{min:u,max:c}}var my=1001;function dp(e,t){e.on("resize.start",my+500,function(n){var r=n.context,i=r.shape;(h(i,"bpmn:Lane")||h(i,"bpmn:Participant"))&&(r.balanced=!Tr(n))}),e.on("resize.end",my,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=wc(a),t.resizeLane(i,a,r.balanced)),!1})}dp.$inject=["eventBus","modeling"];N();var PP=500;function Ts(e,t,n,r,i){n.invoke(k,this);function o(p){return te(p,["bpmn:ReceiveTask","bpmn:SendTask"])||AP(p,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(p){var l=e.getDefinitions(),f=l.get("rootElements");return!!re(f,Ct({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(te(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(te(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"),Ae(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");Oe(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",PP,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)})}Ts.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"];B(Ts,k);function AP(e,t){return q(t)||(t=[t]),Lt(t,function(n){return Er(e,n)})}N();var hy=Math.max;function mp(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]=MP(a,r,i)),h(a,"bpmn:Lane")&&(o[s]=Me(a)?pp:lp),h(a,"bpmn:SubProcess")&&ie(a)&&(o[s]=Lf),h(a,"bpmn:TextAnnotation")&&(o[s]=jf),h(a,"bpmn:Group")&&(o[s]=fy)}),o})}mp.$inject=["eventBus"];function TP(e){return e==="x"}function MP(e,t,n){var r=Me(e);if(!NP(e))return r?Ps:As;var i=TP(t),o={};return i?r?o=Ps:o={width:kP(e,n,i),height:As.height}:r?o={width:Ps.width,height:DP(e,n,i)}:o=As,o}function DP(e,t,n){var r;return r=OP(e,t,n),hy(Ps.height,r)}function kP(e,t,n){var r;return r=BP(e,t,n),hy(As.width,r)}function NP(e){return!!yn(e).length}function OP(e,t,n){var r=yn(e),i;return i=Ff(r,t,n),e.height-i.height+pp.height}function BP(e,t,n){var r=yn(e),i;return i=Ff(r,t,n),e.width-i.width+lp.width}function Ff(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=yn(i),o.length?Ff(o,t,n):i}N();var vy=400,IP=600,gy={x:180,y:160};function Vn(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 h(l,"bpmn:SubProcess")&&!ie(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(vn(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(vn(d));if(!(!m||!d.children||!d.children.length)){var g=yy(d);s._showRecursively(g),s._moveChildrenToShape(g,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")||!ie(f)||E(Ti([f]),d=>{n.removeShape(d.annotation)})},!0),this.preExecuted("shape.delete",function(l){var f=l.shape;if(c(f)){var d=a.get(vn(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(vn(f)))},!0),this.postExecuted("shape.replace",function(l){var f=l.newShape,d=l.oldRoot,m=e.findRoot(vn(f));if(!(!d||!m)){var g=d.children;n.moveElements(g,{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,g=m.id,v=d.id;if(g!==v){if(Eo(f)){a.updateId(f,Jr(v)),a.updateId(g,v);return}var w=a.get(Jr(g));w&&a.updateId(Jr(g),Jr(v))}}},!0),this.reverted("element.updateProperties",function(l){var f=l.element;if(h(f,"bpmn:SubProcess")){var d=l.properties,m=l.oldProperties,g=m.id,v=d.id;if(g!==v){if(Eo(f)){a.updateId(f,Jr(g)),a.updateId(v,g);return}var w=a.get(Jr(v));w&&a.updateId(w,Jr(g))}}},!0),t.on("element.changed",function(l){var f=l.element;if(Eo(f)){var d=f,m=a.get(rf(d));!m||m===d||t.fire("element.changed",{element:m})}}),this.executed("shape.toggleCollapse",vy,function(l){var f=l.shape;h(f,"bpmn:SubProcess")&&(ie(f)?p(l):(u(l),s._showRecursively(f.children)))},!0),this.reverted("shape.toggleCollapse",vy,function(l){var f=l.shape;h(f,"bpmn:SubProcess")&&(ie(f)?p(l):(u(l),s._showRecursively(f.children)))},!0),this.postExecuted("shape.toggleCollapse",IP,function(l){var f=l.shape;if(h(f,"bpmn:SubProcess")){var d=l.newRootElement;if(d)if(ie(f))s._moveChildrenToShape(d.children.slice(),f),E(Ti(f.children),g=>{n.moveShape(g.annotation,{x:0,y:0},f.parent),E(g.associations,v=>{n.moveConnection(v,{x:0,y:0},f.parent)})});else{s._disconnectSharedAnnotations(f);var m=yy(f);s._moveChildrenToShape(m,d)}}},!0),t.on("copyPaste.createTree",function(l){var f=l.element,d=l.children;if(c(f)){var m=vn(f),g=a.get(m);g&&d.push.apply(d,g.children)}}),t.on("copyPaste.copyElement",function(l){var f=l.descriptor,d=l.element,m=l.elements,g=d.parent,v=h(ce(g),"bpmndi:BPMNPlane");if(v){var w=rf(g),S=re(m,function(x){return x.id===w});S&&(f.parent=S.id)}}),t.on("copyPaste.pasteElement",function(l){var f=l.descriptor;f.parent&&(c(f.parent)||f.parent.hidden)&&(f.hidden=!0)})}B(Vn,k);Vn.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=Ce(r),o;if(!t.x)o={x:gy.x-i.x,y:gy.y-i.y};else{var a=X(t),s=X(i);o={x:a.x-s.x,y:a.y-s.y}}n.moveElements(e,o,t,{autoResize:!1})}};Vn.prototype._disconnectSharedAnnotations=function(e){var t=this._modeling,n=new Set(Jl(e).map(r=>r.annotation));n.size&&E(Ti(e.children),r=>{n.has(r.annotation)&&E(r.associations,i=>{t.removeConnection(i)})})};Vn.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};Vn.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};Vn.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:vn(e),type:e.$type,di:r,businessObject:e,collapsed:!0});return o};Vn.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};Vn.$inject=["canvas","eventBus","modeling","elementFactory","bpmnFactory","bpmnjs","elementRegistry"];function LP(e){var t=[];return E(Ti(e),n=>{t.push(n.annotation),t.push.apply(t,n.associations)}),t}function yy(e){return e.children.slice().concat(LP(e.children)).concat(jP(e))}function jP(e){return Ta(e.children||[],!0,-1).reduce(function(t,n){return n.label&&n.label.parent!==e&&t.push(n.label),t},[])}function Ms(e,t){e.invoke(k,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"))||!ie(i))){var o=FP(i);t.createShape({type:"bpmn:StartEvent"},o,i)}})}Ms.$inject=["injector","modeling"];B(Ms,k);function FP(e){return{x:e.x+e.width/6,y:e.y+e.height/2}}function Ds(e,t){k.call(this,e),this.preExecute("connection.create",function(n){let{target:r}=n;h(r,"bpmn:TextAnnotation")&&(n.parent=r.parent)},!0),this.preExecute(["shape.create","shape.resize","elements.move"],function(n){let r=n.shapes||[n.shape];r.length===1&&h(r[0],"bpmn:TextAnnotation")&&(n.hints=n.hints||{},n.hints.autoResize=!1)},!0),this.preExecute("shape.resize",function(n){var r=n.context,i=r.shape,o=r.hints||{};if(!(!h(i,"bpmn:TextAnnotation")||o.autoResize)){var a=r.newBounds,s=t.getTextAnnotationBounds(a,gt(i)||""),c=a.y!==i.y&&Math.abs(a.y+a.height-(i.y+i.height))<=1,u=i.y+i.height;r.newBounds={width:a.width,height:s.height,x:a.x,y:c?u-s.height:a.y}}})}B(Ds,k);Ds.$inject=["eventBus","textRenderer"];N();function ks(e,t){k.call(this,e),this.postExecuted("shape.toggleCollapse",1500,function(n){var r=n.shape;if(ie(r))return;var i=Zn(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,X(r)):t.reconnectStart(a,r,X(r)))}},!0)}B(ks,k);ks.$inject=["eventBus","modeling"];var Hf=500;function Ns(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,u=s,p,l;return p=HP(c).concat([a]),l=tp(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"],Hf,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"],Hf,function(a){var s=a.context,c=s.shape;c.collapsed?ce(c).isExpanded=!1:ce(c).isExpanded=!0}),this.postExecuted(["shape.toggleCollapse"],Hf,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(Ns,k);Ns.$inject=["eventBus","elementFactory","modeling"];function HP(e){return e.filter(function(t){return!t.hidden})}function Os(e,t,n,r){t.invoke(k,this),this.preExecute("shape.delete",function(i){var o=i.context,a=o.shape,s=a.businessObject;ee(a)||(h(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;h(i,"bpmn:Collaboration")&&n.ids.unclaim(o.id)})}B(Os,k);Os.$inject=["canvas","injector","moddle","modeling"];function Bs(e,t){k.call(this,e),this.preExecute("connection.delete",function(n){var r=n.context,i=r.connection,o=i.source;$P(i,o)&&t.updateProperties(o,{default:null})})}B(Bs,k);Bs.$inject=["eventBus","modeling"];function $P(e,t){if(!h(e,"bpmn:SequenceFlow"))return!1;var n=j(t),r=j(e);return n.get("default")===r}var zP=500,GP=5e3;function Is(e,t){k.call(this,e);var n;function r(){return n=n||new VP,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,GP,function(s){r()}),this.postExecuted(a,zP,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))})}Is.$inject=["eventBus","modeling"];B(Is,k);function VP(){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 Ls(e,t){k.call(this,e),this.postExecuted("elements.create",function(n){let r=n.context,i=r.elements;for(let o of i)WP(o)&&!qP(o)&&t.updateProperties(o,{isForCompensation:void 0})})}B(Ls,k);Ls.$inject=["eventBus","modeling"];function WP(e){let t=j(e);return t&&t.isForCompensation}function UP(e){return e&&h(e,"bpmn:BoundaryEvent")&&Er(e,"bpmn:CompensateEventDefinition")}function qP(e){return e.incoming.filter(n=>UP(n.source)).length>0}var _y={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","artifactBehavior","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",es],appendBehavior:["type",ts],associationBehavior:["type",rs],attachEventBehavior:["type",Fo],artifactBehavior:["type",ns],boundaryEventBehavior:["type",is],compensateBoundaryEventBehaviour:["type",as],createBehavior:["type",ss],createDataObjectBehavior:["type",cs],createParticipantBehavior:["type",us],dataInputAssociationBehavior:["type",ps],dataStoreBehavior:["type",ls],deleteLaneBehavior:["type",ds],detachEventBehavior:["type",Go],dropOnFlowBehavior:["type",ms],eventBasedGatewayBehavior:["type",hs],fixHoverBehavior:["type",rp],groupBehavior:["type",vs],importDockingFix:["type",ip],isHorizontalFix:["type",gs],labelBehavior:["type",_s],layoutConnectionBehavior:["type",bs],messageFlowBehavior:["type",xs],nonInterruptingBehavior:["type",Es],removeElementBehavior:["type",Ss],removeEmbeddedLabelBoundsBehavior:["type",ws],removeParticipantBehavior:["type",Cs],replaceConnectionBehavior:["type",Rs],replaceElementBehaviour:["type",Yo],resizeBehavior:["type",fp],resizeLaneBehavior:["type",dp],rootElementReferenceBehavior:["type",Ts],spaceToolBehavior:["type",mp],subProcessPlaneBehavior:["type",Vn],subProcessStartEventBehavior:["type",Ms],textAnnotationBehavior:["type",Ds],toggleCollapseConnectionBehaviour:["type",ks],toggleElementCollapseBehaviour:["type",Ns],unclaimIdBehavior:["type",Os],unsetDefaultFlowBehavior:["type",Bs],updateFlowNodeRefsBehavior:["type",Is],setCompensationActivityAfterPasteBehavior:["type",Ls]};N();function hp(e,t){var n=He(e,t,-15);return n!=="intersect"?n:null}function wt(e){Ot.call(this,e)}B(wt,Ot);wt.$inject=["eventBus"];wt.prototype.init=function(){this.addRule("connection.start",function(e){var t=e.source;return KP(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 vp(t,n)}finally{i&&(n.parent=null)}}),this.addRule("connection.reconnect",function(e){var t=e.connection,n=e.source,r=e.target;return vp(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,r=e.direction;return Ny(t,n,r)}),this.addRule("elements.create",function(e){var t=e.elements,n=e.position,r=e.target;return de(r)&&!gp(t,r,n)?!1:ln(t,function(i){return de(i)?vp(i.source,i.target,i):i.host?js(i,i.host,null,n):Gf(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 Py(a)&&!n.includes(a.host)})?!1:js(n,t,null,r)||Dy(n,t,r)||ky(n,t,r)||gp(n,t,r)}),this.addRule("shape.create",function(e){return Gf(e.shape,e.target,e.source,e.position)}),this.addRule("shape.attach",function(e){return js(e.shape,e.target,null,e.position)}),this.addRule("element.copy",function(e){var t=e.element,n=e.elements;return jy(n,t)})};wt.prototype.canConnectMessageFlow=Iy;wt.prototype.canConnectSequenceFlow=Ly;wt.prototype.canConnectDataAssociation=Wf;wt.prototype.canConnectAssociation=Oy;wt.prototype.canConnectCompensationAssociation=By;wt.prototype.canMove=ky;wt.prototype.canAttach=js;wt.prototype.canReplace=Dy;wt.prototype.canDrop=Qo;wt.prototype.canInsert=gp;wt.prototype.canCreate=Gf;wt.prototype.canConnect=vp;wt.prototype.canResize=Ny;wt.prototype.canCopy=jy;function KP(e){return $f(e)?null:te(e,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}function $f(e){return!e||ee(e)}function by(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 zf(e){return h(e,"bpmn:TextAnnotation")}function Vf(e){return h(e,"bpmn:Group")&&!e.labelTarget}function Sy(e){return h(e,"bpmn:BoundaryEvent")&&ur(e,"bpmn:CompensateEventDefinition")}function yp(e){return j(e).isForCompensation}function YP(e,t){var n=by(e),r=by(t);return n===r}function XP(e){return h(e,"bpmn:InteractionNode")&&!h(e,"bpmn:BoundaryEvent")&&(!h(e,"bpmn:Event")||h(e,"bpmn:ThrowEvent")&&Ry(e,"bpmn:MessageEventDefinition"))}function ZP(e){return h(e,"bpmn:InteractionNode")&&!yp(e)&&(!h(e,"bpmn:Event")||h(e,"bpmn:CatchEvent")&&Ry(e,"bpmn:MessageEventDefinition"))&&!(h(e,"bpmn:BoundaryEvent")&&!ur(e,"bpmn:MessageEventDefinition"))}function xy(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 Cy(e,t){var n=xy(e),r=xy(t);return n===r}function ur(e,t){var n=j(e);return!!re(n.eventDefinitions||[],function(r){return h(r,t)})}function Ry(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")&&!Qe(e)&&!(h(e,"bpmn:IntermediateThrowEvent")&&ur(e,"bpmn:LinkEventDefinition"))&&!Sy(e)&&!yp(e)}function JP(e){return h(e,"bpmn:FlowNode")&&!h(e,"bpmn:StartEvent")&&!h(e,"bpmn:BoundaryEvent")&&!Qe(e)&&!(h(e,"bpmn:IntermediateCatchEvent")&&ur(e,"bpmn:LinkEventDefinition"))&&!yp(e)}function eA(e){return h(e,"bpmn:ReceiveTask")||h(e,"bpmn:IntermediateCatchEvent")&&(ur(e,"bpmn:MessageEventDefinition")||ur(e,"bpmn:TimerEventDefinition")||ur(e,"bpmn:ConditionalEventDefinition")||ur(e,"bpmn:SignalEventDefinition"))}function tA(e){for(var t=[];e;)e=e.parent,e&&t.push(e);return t}function Ey(e,t){var n=tA(t);return n.indexOf(e)!==-1}function vp(e,t,n){if($f(e)||$f(t))return null;if(!h(n,"bpmn:DataAssociation")){if(Iy(e,t))return{type:"bpmn:MessageFlow"};if(Ly(e,t))return{type:"bpmn:SequenceFlow"}}var r=Wf(e,t);return r||(By(e,t)?{type:"bpmn:Association",associationDirection:"One"}:Oy(e,t)?{type:"bpmn:Association",associationDirection:"None"}:!1)}function Qo(e,t){return ee(e)||Vf(e)?!0:h(t,"bpmn:Participant")&&!ie(t)?!1:h(e,"bpmn:Participant")?h(t,"bpmn:Process")||h(t,"bpmn:Collaboration"):te(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")&&!nA(e)?!1:h(e,"bpmn:FlowElement")&&!h(e,"bpmn:DataStoreReference")?h(t,"bpmn:FlowElementsContainer")?ie(t):te(t,["bpmn:Participant","bpmn:Lane"]):h(e,"bpmn:DataStoreReference")&&h(t,"bpmn:Collaboration")?Lt(j(t).get("participants"),function(n){return!!n.get("processRef")}):te(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?te(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 nA(e){return j(e).cancelActivity&&(Ay(e)||Ty(e))}function Py(e){return!ee(e)&&h(e,"bpmn:BoundaryEvent")}function rA(e){return h(e,"bpmn:Lane")}function iA(e){return Py(e)||h(e,"bpmn:IntermediateThrowEvent")&&Ay(e)?!0:h(e,"bpmn:IntermediateCatchEvent")&&Ty(e)}function Ay(e){var t=j(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function Ty(e){return My(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function My(e,t){return t.some(function(n){return ur(e,n)})}function oA(e){return h(e,"bpmn:ReceiveTask")&&re(e.incoming,function(t){return h(t.source,"bpmn:EventBasedGateway")})}function js(e,t,n,r){if(Array.isArray(e)||(e=[e]),e.length!==1)return!1;var i=e[0];return ee(i)||!iA(i)||Qe(t)||!h(t,"bpmn:Activity")||yp(t)||r&&!hp(r,t)||oA(t)?!1:"attach"}function Dy(e,t,n){if(!t)return!1;var r={replacements:[]};return E(e,function(i){Qe(t)||h(i,"bpmn:StartEvent")&&i.type!=="label"&&Qo(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"}),My(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")||ur(i,"bpmn:CancelEventDefinition")&&i.type!=="label"&&(h(i,"bpmn:EndEvent")&&Qo(i,t)&&r.replacements.push({oldElementId:i.id,newElementType:"bpmn:EndEvent"}),h(i,"bpmn:BoundaryEvent")&&js(i,t,null,n)&&r.replacements.push({oldElementId:i.id,newElementType:"bpmn:BoundaryEvent"}))}),r.replacements.length?r:!1}function ky(e,t){return Lt(e,rA)?!1:t?e.every(function(n){return Qo(n,t)}):!0}function Gf(e,t,n,r){return t?ee(e)||Vf(e)?!0:Qo(e,t,r)||gp(e,t,r):!1}function Ny(e,t,n){return h(e,"bpmn:SubProcess")?ie(e)&&(!t||t.width>=100&&t.height>=80):h(e,"bpmn:Lane")||h(e,"bpmn:Participant")?!0:zf(e)?n?n==="e"||n==="w":!0:Vf(e)?!0:ee(e)?n?n==="e"||n==="w":!0:!1}function aA(e,t){var n=zf(e),r=zf(t);return(n||r)&&n!==r}function Oy(e,t){return Ey(t,e)||Ey(e,t)?!1:aA(e,t)?!0:!!Wf(e,t)}function By(e,t){return Cy(e,t)&&Sy(e)&&h(t,"bpmn:Activity")&&!cA(t,e)&&!Qe(t)}function Iy(e,t){return wy(e)&&!wy(t)?!1:XP(e)&&ZP(t)&&!YP(e,t)}function Ly(e,t){return QP(e)&&JP(t)&&Cy(e,t)&&!(h(e,"bpmn:EventBasedGateway")&&!eA(t))}function Wf(e,t){return te(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&te(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:te(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&te(e,["bpmn:Activity","bpmn:CatchEvent"])?{type:"bpmn:DataOutputAssociation"}:!1}function gp(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:te(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!ee(t)&&h(e,"bpmn:FlowNode")&&!h(e,"bpmn:BoundaryEvent")&&Qo(e,t.parent,n)}function sA(e,t){return e&&t&&e.indexOf(t)!==-1}function jy(e,t){return ee(t)?!0:!(h(t,"bpmn:Lane")&&!sA(e,t.parent))}function wy(e){return kr(e,"bpmn:Process")||kr(e,"bpmn:Collaboration")}function cA(e,t){return e.attachers.includes(t)}var Fy={__depends__:[Et],__init__:["bpmnRules"],bpmnRules:["type",wt]};N();var uA=2e3;function _p(e,t){e.on("saveXML.start",uA,n);function n(){var r=t.getRootElements();E(r,function(i){var o=ce(i),a,s;a=Zn([i],!1),a=Q(a,function(c){return c!==i&&!c.labelTarget}),s=je(a,ce),o.set("planeElement",s)})}}_p.$inject=["eventBus","canvas"];var Hy={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",_p]};function Jo(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)})}Jo.prototype.getOrdering=function(e,t){return null};B(Jo,k);N();function Fs(e,t){Jo.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 te(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&&!te(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=Sa(s.children,function(l){return!a.labelTarget&&l.labelTarget?!1:c.level0&&this._modeling.removeElements(r),t};Ht.prototype._getElementIdsFromTree=function(e){var t={};return E(e,function(n){E(n,function(r){r.id&&(t[r.id]=!0)})}),t};Ht.prototype._paste=function(e,t,n,r){E(e,function(o){ne(o.x)||(o.x=0),ne(o.y)||(o.y=0)});var i=Ce(e);return E(e,function(o){de(o)&&(o.waypoints=je(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))};Ht.prototype._createElements=function(e){var t=this,n=this._eventBus,r={},i=[];return E(e,function(o,a){a=parseInt(a,10),o=At(o,"priority"),E(o,function(s){var c=C({},Nt(s,["priority"]));r[s.parent]?c.parent=r[s.parent]:delete c.parent,n.fire("copyPaste.pasteElement",{cache:r,descriptor:c});var u;if(de(c)){c.source=r[s.source],c.target=r[s.target],u=r[s.id]=t.createConnection(c),i.push(u);return}if(ee(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};Ht.prototype.createConnection=function(e){var t=this._elementFactory.createConnection(Nt(e,["id"]));return t};Ht.prototype.createLabel=function(e){var t=this._elementFactory.createLabel(Nt(e,["id"]));return t};Ht.prototype.createShape=function(e){var t=this._elementFactory.createShape(Nt(e,["id"]));return t};Ht.prototype.hasRelations=function(e,t){var n,r,i;return!(de(e)&&(r=re(t,Ct({id:e.source.id})),i=re(t,Ct({id:e.target.id})),!r||!i)||ee(e)&&(n=re(t,Ct({id:e.labelTarget.id})),!n))};Ht.prototype.createTree=function(e){var t=this._rules,n=this,r={},i=[],o=zr(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",qf,function(c){var u=c.cache,p=c.descriptor;a(u,s(p,u,o(u)))})}Ep.$inject=["bpmnFactory","eventBus","moddleCopy"];N();var vA=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing","categoryValue"],gA=["errorRef","escalationRef","messageRef","signalRef","dataObjectRef"];function zi(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 At(i,o=>o==="extensionElements")}),e.on("moddleCopy.canCopyProperty",r=>{let{parent:i,property:o,propertyName:a}=r,s=Se(i)&&i.$descriptor;if(a&&gA.includes(a))return o;if(a&&vA.includes(a)||a&&s&&!re(s.properties,Ct({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})}zi.$inject=["eventBus","bpmnFactory","moddle"];zi.prototype.copyElement=function(e,t,n,r=!1){n&&!q(n)&&(n=[n]),n=n||wp(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;dt(e,o)&&(a=e.get(o));let s=this.copyProperty(a,t,o,r);!Ue(s)||this._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent:t,property:s,propertyName:o})===!1||t.set(o,s)})),t};zi.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 Se(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)?Ge(e,(a,s)=>{let c=this.copyProperty(s,t,n,r);return c?a.concat(c):a},[]):Se(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};zi.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 wp(e,t){return Ge(e.properties,(n,r)=>t&&r.default?n:n.concat(r.name),[])}var Sp={__depends__:[Qy],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",Ep],moddleCopy:["type",zi]};N();var Jy=Math.round;function $s(e,t){this._modeling=e,this._eventBus=t}$s.$inject=["modeling","eventBus"];$s.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=Jy(s+o/2),p=Jy(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 Cp(e,t){t.on("replace.end",500,function(n){let{newElement:r,hints:i={}}=n;i.select!==!1&&e.select(r)})}Cp.$inject=["selection","eventBus"];var e_={__init__:["replace","replaceSelectionBehavior"],replaceSelectionBehavior:["type",Cp],replace:["type",$s]};N();function yA(e,t,n){q(n)||(n=[n]),E(n,function(r){wn(e[r])||(t[r]=e[r])})}var _A=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function bA(e,t){var n=e&&dt(e,"collapsed")?e.collapsed:!ie(e),r;return t&&(dt(t,"collapsed")||dt(t,"isExpanded"))?r=dt(t,"collapsed")?t.collapsed:!t.isExpanded:r=n,n!==r}function Pp(e,t,n,r,i,o){function a(s,c,u){u=u||{};var p=c.type,l=s.businessObject;if(Rp(l)&&(p==="bpmn:SubProcess"||p==="bpmn:AdHocSubProcess")&&bA(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),yA(s.di,d.di,["fill","stroke","background-color","border-color","color"]);var m=wp(l.$descriptor),g=wp(f.$descriptor,!0),v=xA(m,g);C(f,mt(c,_A));var w=Q(v,function(b){return b==="eventDefinitions"?t_(s,c.eventDefinitionType):b==="loopCharacteristics"?!Qe(f):dt(f,b)||b==="processRef"&&c.isExpanded===!1||b==="triggeredByEvent"?!1:b==="isForCompensation"?!Qe(f):!0});if(f=n.copyElement(l,f,w),c.eventDefinitionType&&(t_(f,c.eventDefinitionType)||(d.eventDefinitionType=c.eventDefinitionType,d.eventDefinitionAttrs=c.eventDefinitionAttrs)),h(l,"bpmn:Activity")){if(Rp(l))d.isExpanded=ie(s);else if(c&&dt(c,"isExpanded")){d.isExpanded=c.isExpanded;var S=t.getDefaultSize(f,{isExpanded:d.isExpanded});d.width=S.width,d.height=S.height,d.x=s.x-(d.width-s.width)/2,d.y=s.y-(d.height-s.height)/2}ie(s)&&!h(l,"bpmn:Task")&&d.isExpanded&&(d.width=s.width,d.height=s.height)}if(Rp(l)&&!Rp(f)&&(u.moveChildren=!1),h(l,"bpmn:Participant")){c.isExpanded===!0?f.processRef=e.create("bpmn:Process"):u.moveChildren=!1;var x=Me(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,te(l,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&te(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}Pp.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules"];function Rp(e){return h(e,"bpmn:SubProcess")}function t_(e,t){var n=j(e);return t&&n.get("eventDefinitions").some(function(r){return h(r,t)})}function xA(e,t){return e.filter(function(n){return t.includes(n)})}var Ap={__depends__:[Sp,e_,rt],bpmnReplace:["type",Pp]};N();var EA=250;function Nr(e){this._eventBus=e,this._tools=[],this._active=null}Nr.$inject=["eventBus"];Nr.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)};Nr.prototype.isActive=function(e){return e&&this._active===e};Nr.prototype.length=function(e){return this._tools.length};Nr.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))};Nr.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,EA,function(i){this._active&&(wA(i)||this.setActive(null))},this)};function wA(e){var t=e.originalEvent&&e.originalEvent.target;return t&&Bn(t,'.group[data-group="tools"]')}var fi={__depends__:[kt],__init__:["toolManager"],toolManager:["type",Nr]};N();N();function n_(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 r_(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;(zs(e,s)||zs(e,c)||zs(t,s)||zs(t,c))&&(zs(n,a)||n.push(a))})}),n}function zs(e,t){return e.indexOf(t)!==-1}function i_(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 Kf=Math.abs,SA=Math.round,Or={x:"width",y:"height"},s_="crosshair",di={n:"top",w:"left",s:"bottom",e:"right"},CA=1500,Tp={n:"s",w:"e",s:"n",e:"w"},Mp=20;function Xt(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",CA,function(c){var u=c.context,p=u.initialized;p||(p=u.initialized=s.init(c,u)),p&&a_(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){a_(c);var g={x:0,y:0};g[p]=SA(c["d"+p]),s.makeSpace(f,d,g,l,m),n.once("spaceTool.ended",function(v){s.activateSelection(v.originalEvent,!0,!0)})}})}Xt.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"];Xt.prototype.activateSelection=function(e,t,n){this._dragging.init(e,"spaceTool.selection",{autoActivate:t,cursor:s_,data:{context:{reactivate:n}},trapClick:!1})};Xt.prototype.activateMakeSpace=function(e){this._dragging.init(e,"spaceTool",{autoActivate:!0,cursor:s_,data:{context:{}}})};Xt.prototype.makeSpace=function(e,t,n,r,i){return this._modeling.createSpace(e,t,n,r,i)};Xt.prototype.init=function(e,t){var n=Kf(e.dx)>Kf(e.dy)?"x":"y",r=e["d"+n],i=e[n]-r;if(Kf(r)<5)return!1;r<0&&(r*=-1),Tr(e)&&(r*=-1);var o=n_(n,r),a=this._canvas.getRootElement();!Mi(e)&&e.hover&&(a=e.hover);var s=[...Zn(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=RA(c,n,o,i,u);return C(t,c,{axis:n,direction:o,spaceToolConstraints:p,start:i}),Di("resize-"+(n==="x"?"ew":"ns")),!0};Xt.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||ee(f))){if(de(f)){c.push(f);return}var d=f[t],m=d+f[Or[t]];if(PA(f)&&(n>0&&X(f)[t]>r||n<0&&X(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;Gi(l,d)&&u(f)}),l=o.concat(a),E(c,function(f){var d=f.source,m=f.target,g=f.label;Gi(l,d)&&Gi(l,m)&&g&&u(g)}),{movingShapes:o,resizingShapes:a}};Xt.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)};Xt.prototype.isActive=function(){var e=this._dragging.context();return e?/^spaceTool/.test(e.prefix):!1};function o_(e){return{top:e.top-Mp,right:e.right+Mp,bottom:e.bottom+Mp,left:e.left-Mp}}function a_(e){var t=e.context,n=t.spaceToolConstraints;if(n){var r,i;ne(n.left)&&(r=Math.max(e.x,n.left),e.dx=e.dx+r-e.x,e.x=r),ne(n.right)&&(r=Math.min(e.x,n.right),e.dx=e.dx+r-e.x,e.x=r),ne(n.top)&&(i=Math.max(e.y,n.top),e.dy=e.dy+i-e.y,e.y=i),ne(n.bottom)&&(i=Math.min(e.y,n.bottom),e.dy=e.dy+i-e.y,e.y=i)}}function RA(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=Q(f,function(L){return!de(L)&&!ee(L)&&!Gi(o,L)&&!Gi(a,L)}),g=Q(f,function(L){return!de(L)&&!ee(L)&&Gi(o,L)}),v,w,S,x=[],b=[],R,A,O,T;m.length&&(w=o_(Z(Ce(m))),v=r-d[di[n]]+w[di[n]],n==="n"?s.bottom=u=ne(u)?Math.min(u,v):v:n==="w"?s.right=u=ne(u)?Math.min(u,v):v:n==="s"?s.top=c=ne(c)?Math.max(c,v):v:n==="e"&&(s.left=c=ne(c)?Math.max(c,v):v)),g.length&&(S=o_(Z(Ce(g))),v=r-S[di[Tp[n]]]+d[di[Tp[n]]],n==="n"?s.bottom=u=ne(u)?Math.min(u,v):v:n==="w"?s.right=u=ne(u)?Math.min(u,v):v:n==="s"?s.top=c=ne(c)?Math.max(c,v):v:n==="e"&&(s.left=c=ne(c)?Math.max(c,v):v)),l&&l.length&&(l.forEach(function(L){Gi(o,L)?x.push(L):b.push(L)}),x.length&&(R=Z(Ce(x.map(X))),A=d[di[Tp[n]]]-(R[di[Tp[n]]]-r)),b.length&&(O=Z(Ce(b.map(X))),T=O[di[n]]-(d[di[n]]-r)),n==="n"?(v=Math.min(A||1/0,T||1/0),s.bottom=u=ne(u)?Math.min(u,v):v):n==="w"?(v=Math.min(A||1/0,T||1/0),s.right=u=ne(u)?Math.min(u,v):v):n==="s"?(v=Math.max(A||-1/0,T||-1/0),s.top=c=ne(c)?Math.max(c,v):v):n==="e"&&(v=Math.max(A||-1/0,T||-1/0),s.left=c=ne(c)?Math.max(c,v):v));var I=i&&i[p.id];I&&(n==="n"?(v=r+p[Or[t]]-I[Or[t]],s.bottom=u=ne(u)?Math.min(u,v):v):n==="w"?(v=r+p[Or[t]]-I[Or[t]],s.right=u=ne(u)?Math.min(u,v):v):n==="s"?(v=r-p[Or[t]]+I[Or[t]],s.top=c=ne(c)?Math.max(c,v):v):n==="e"&&(v=r-p[Or[t]]+I[Or[t]],s.left=c=ne(c)?Math.max(c,v):v))}),s}}function Gi(e,t){return e.indexOf(t)!==-1}function PA(e){return!!e.host}N();var Yf="djs-dragging",c_="djs-resizing",AA=250,Dp=Math.max;function kp(e,t,n,r,i){function o(a,s){E(a,function(c){i.addDragger(c,s),n.addMarker(c,Yf)})}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");$(p,r.cls("djs-crosshair-group",["no-events"])),J(s,p);var l=U("path");$(l,"d",u.x),pe(l).add("djs-crosshair"),J(p,l);var f=U("path");$(f,"d",u.y),pe(f).add("djs-crosshair"),J(p,f),c.crosshairGroup=p}),e.on("spaceTool.selection.move",function(a){var s=a.context.crosshairGroup;Fe(s,a.x,a.y)}),e.on("spaceTool.selection.cleanup",function(a){var s=a.context,c=s.crosshairGroup;c&&Pe(c)}),e.on("spaceTool.move",AA,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"),$(c,"d","M0,0 L0,0"),pe(c).add("djs-crosshair"),J(f,c),s.line=c;var d=U("g");$(d,r.cls("djs-drag-group",["no-events"])),J(n.getActiveLayer(),d),o(p,d);var m=s.movingConnections=t.filter(function(b){var R=!1;E(p,function(I){E(I.outgoing,function(L){b===L&&(R=!0)})});var A=!1;E(p,function(I){E(I.incoming,function(L){b===L&&(A=!0)})});var O=!1;E(l,function(I){E(I.outgoing,function(L){b===L&&(O=!0)})});var T=!1;return E(l,function(I){E(I.incoming,function(L){b===L&&(T=!0)})}),de(b)&&(R||O)&&(A||T)});o(m,d),s.dragGroup=d}if(!s.frameGroup){var g=U("g");$(g,r.cls("djs-frame-group",["no-events"])),J(n.getActiveLayer(),g);var v=[];E(l,function(b){var R=i.addFrame(b,g),A=R.getBBox();v.push({element:R,initialBounds:A}),n.addMarker(b,c_)}),s.frameGroup=g,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[u]});var S={x:"y",y:"x"},x={x:a.dx,y:a.dy};x[S[s.axis]]=0,Fe(s.dragGroup,x.x,x.y),E(s.frames,function(b){var R=b.element,A=b.initialBounds,O,T;s.direction==="e"?$(R,{width:Dp(A.width+x.x,5)}):(O=Dp(A.width-x.x,5),$(R,{width:O,x:A.x+A.width-O})),s.direction==="s"?$(R,{height:Dp(A.height+x.y,5)}):(T=Dp(A.height-x.y,5),$(R,{height:T,y:A.y+A.height-T}))})}}),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,Yf)}),E(u,function(m){n.removeMarker(m,Yf)}),f&&(Pe(l),Pe(f)),E(p,function(m){n.removeMarker(m,c_)}),d&&Pe(d)})}kp.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];var u_={__init__:["spaceToolPreview"],__depends__:[kt,Et,fi,Dn,pr],spaceTool:["type",Xt],spaceToolPreview:["type",kp]};N();function ea(e,t){e.invoke(Xt,this),this._canvas=t}ea.$inject=["injector","canvas"];B(ea,Xt);ea.prototype.calculateAdjustments=function(e,t,n,r){var i=this._canvas.getRootElement(),o=e[0]===i?null:e[0],a=[];o&&(a=Sn(wi(i.children.filter(u=>h(u,"bpmn:Artifact")),Ce(o))));let s=[...e,...a];var c=Xt.prototype.calculateAdjustments.call(this,s,t,n,r);return c.resizingShapes=c.resizingShapes.filter(function(u){return!(h(u,"bpmn:TextAnnotation")||TA(u)&&(t==="y"&&Me(u)||t==="x"&&!Me(u)))}),c};function TA(e){return h(e,"bpmn:Participant")&&!j(e).processRef}var Np={__depends__:[u_],spaceTool:["type",ea]};N();function We(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)}We.$inject=["eventBus","injector"];We.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()};We.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};We.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,e!==!1&&this._fire("changed",{trigger:"clear"})};We.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()}};We.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()}};We.prototype.register=function(e,t){this._setHandler(e,t)};We.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)};We.prototype.canUndo=function(){return!!this._getUndoAction()};We.prototype.canRedo=function(){return!!this._getRedoAction()};We.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]};We.prototype._getUndoAction=function(){return this._stack[this._stackIdx]};We.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)})};We.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};We.prototype._createId=function(){return this._uid++};We.prototype._atomicDo=function(e){let t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}};We.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()};We.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)};We.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:mc("id",r.reverse())}),r.length=0,this._fire("changed",{trigger:t}),e.trigger=null)};We.prototype._markDirty=function(e){let t=this._currentExecution;e&&(e=q(e)?e:[e],t.dirty=t.dirty.concat(e))};We.prototype._executedAction=function(e,t){let n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)};We.prototype._revertedAction=function(e){this._stackIdx--};We.prototype._getHandler=function(e){return this._handlerMap[e]};We.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 p_={commandStack:["type",We]};N();function kn(e,t){if(typeof t!="function")throw new Error("removeFn iterator must be a function");if(!e)return[];for(var n;n=e[0];)t(n);return e}var MA=250,l_=1400;function Gs(e,t,n){k.call(this,t);var r=e.get("movePreview",!1);t.on("shape.move.start",l_,function(i){var o=i.context,a=o.shapes,s=o.validatedShapes;o.shapes=f_(a),o.validatedShapes=f_(s)}),r&&t.on("shape.move.start",MA,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",l_,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;kn(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=co(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&&(Ae(s.labels,a,c),a.labelTarget=s)})}B(Gs,k);Gs.$inject=["injector","eventBus","modeling"];function f_(e){return Q(e,function(t){return e.indexOf(t.labelTarget)===-1})}var d_={__init__:["labelSupport"],labelSupport:["type",Gs]};N();var DA=251,m_=1401,h_="attach-ok";function Vs(e,t,n,r,i){k.call(this,t);var o=e.get("movePreview",!1);t.on("shape.move.start",m_,function(a){var s=a.context,c=s.shapes,u=s.validatedShapes;s.shapes=kA(c),s.validatedShapes=NA(u)}),o&&t.on("shape.move.start",DA,function(a){var s=a.context,c=s.shapes,u=Xf(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,h_),t.once(["shape.move.out","shape.move.cleanup"],function(){n.removeMarker(p,h_)}))}}),this.preExecuted("elements.move",m_,function(a){var s=a.context,c=s.closure,u=s.shapes,p=Xf(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=Q(c,function(l){var f=l.host;return OA(l)&&!BA(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;kn(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=If(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=If(d,u,p);i.moveShape(d,m,d.parent),E(d.labels,function(g){i.moveShape(g,m,g.parent)})})}),this.preExecute("shape.delete",function(a){var s=a.context.shape;kn(s.attachers,function(c){i.removeShape(c)}),s.host&&i.updateAttachment(s,null)})}B(Vs,k);Vs.$inject=["injector","eventBus","canvas","rules","modeling"];function Xf(e){return _i(je(e,function(t){return t.attachers||[]}))}function kA(e){var t=Xf(e);return gl("id",e,t)}function NA(e){var t=Vt(e,"id");return Q(e,function(n){for(;n;){if(n.host&&t[n.host.id])return!1;n=n.parent}return!0})}function OA(e){return!!e.host}function BA(e,t){return e.indexOf(t)!==-1}var v_={__depends__:[Et],__init__:["attachSupport"],attachSupport:["type",Vs]};N();function an(e){this._model=e}an.$inject=["moddle"];an.prototype._needsId=function(e){return te(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"])};an.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":te(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))};an.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n};an.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})};an.prototype.createDiShape=function(e,t){return this.create("bpmndi:BPMNShape",C({bpmnElement:e,bounds:this.createDiBounds()},t))};an.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)};an.prototype.createDiWaypoints=function(e){var t=this;return je(e,function(n){return t.createDiWaypoint(n)})};an.prototype.createDiWaypoint=function(e){return this.create("dc:Point",mt(e,["x","y"]))};an.prototype.createDiEdge=function(e,t){return this.create("bpmndi:BPMNEdge",C({bpmnElement:e,waypoint:this.createDiWaypoints([])},t))};an.prototype.createDiPlane=function(e,t){return this.create("bpmndi:BPMNPlane",C({bpmnElement:e},t))};N();function $t(e,t,n){k.call(this,e),this._bpmnFactory=t;var r=this;function i(d){var m=d.context,g=m.hints||{},v;!m.cropped&&g.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,g=m.shape||m.connection,v=m.parent||m.newParent;r.updateParent(g,v)}this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],sn(o)),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],sn(a));function s(d){var m=d.context,g=m.oldRoot,v=g.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"],sn(function(d){d.context.shape.type!=="label"&&c(d)})),this.reverted(["shape.move","shape.create","shape.resize"],sn(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"],sn(u)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],sn(u));function p(d){r.updateConnectionWaypoints(d.context.connection)}this.executed(["connection.layout","connection.move","connection.updateWaypoints"],sn(p)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],sn(p)),this.executed("connection.reconnect",sn(function(d){var m=d.context,g=m.connection,v=m.oldSource,w=m.newSource,S=j(g),x=j(v),b=j(w);S.conditionExpression&&!te(b,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(m.oldConditionExpression=S.conditionExpression,delete S.conditionExpression),v!==w&&x.default===S&&(m.oldDefault=x.default,delete x.default)})),this.reverted("connection.reconnect",sn(function(d){var m=d.context,g=m.connection,v=m.oldSource,w=m.newSource,S=j(g),x=j(v),b=j(w);m.oldConditionExpression&&(S.conditionExpression=m.oldConditionExpression),m.oldDefault&&(x.default=m.oldDefault,delete b.default)}));function l(d){r.updateAttachment(d.context)}this.executed(["element.updateAttachment"],sn(l)),this.reverted(["element.updateAttachment"],sn(l)),this.executed("element.updateLabel",sn(f)),this.reverted("element.updateLabel",sn(f));function f(d){let{element:m}=d.context,g=gt(m),v=ce(m),w=v&&v.get("label");mn(m)||Eo(m)||(g&&!w?v.set("label",t.create("bpmndi:BPMNLabel")):!g&&w&&v.set("label",void 0))}}B($t,k);$t.$inject=["eventBus","bpmnFactory","connectionDocking"];$t.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,r=t.host;n.attachedToRef=r&&r.businessObject};$t.prototype.updateParent=function(e,t){if(!ee(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)}};$t.prototype.updateBounds=function(e){var t=ce(e),n=LA(e);if(n){var r=Dt(n,t.get("bounds"));C(n,{x:e.x+r.x,y:e.y+r.y})}var i=ee(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})};$t.prototype.updateFlowNodeRefs=function(e,t,n){if(n!==t){var r,i;h(n,"bpmn:Lane")&&(r=n.get("flowNodeRef"),Oe(r,e)),h(t,"bpmn:Lane")&&(i=t.get("flowNodeRef"),Ae(i,e))}};$t.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)};$t.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):(Oe(n,e),e.$parent=null)}};function IA(e){for(;e&&!h(e,"bpmn:Definitions");)e=e.$parent;return e}$t.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)};$t.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=IA(e.$parent||t),e.$parent&&(Oe(o.get("rootElements"),i),i.$parent=null),t&&(Ae(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),Oe(a,e)),t?(a=t.get(r),a.push(e),e.$parent=t):e.$parent=null,n){var s=n.get(r);Oe(a,e),t&&(s||(s=[],t.set(r,s)),s.push(e))}}};$t.prototype.updateConnectionWaypoints=function(e){var t=ce(e);t.set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))};$t.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&&(Oe(n.sourceRef&&n.sourceRef.get("outgoing"),n),i&&i.get("outgoing")&&i.get("outgoing").push(n)),n.sourceRef=i),n.targetRef!==a&&(c&&(Oe(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)};$t.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label};function sn(e){return function(t){var n=t.context,r=n.shape||n.connection||n.element;h(r,"bpmn:BaseElement")&&e(t)}}function LA(e){if(h(e,"bpmn:Activity")){var t=ce(e);if(t){var n=t.get("label");if(n)return n.get("bounds")}}}N();function lr(e,t){Pn.call(this),this._bpmnFactory=e,this._moddle=t}B(lr,Pn);lr.$inject=["bpmnFactory","moddle"];lr.prototype._baseCreate=Pn.prototype.create;lr.prototype.create=function(e,t){if(e==="label"){var n=t.di||this._bpmnFactory.createDiLabel();return this._baseCreate(e,C({type:"label",di:n},ir,t))}return this.createElement(e,t)};lr.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)}if(!FA(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=jA(r,t,["processRef","isInterrupting","associationDirection","isForCompensation"]),t.isExpanded&&(t=Zf(i,t,"isExpanded")),te(r,["bpmn:Lane","bpmn:Participant"])&&(t=Zf(i,t,"isHorizontal")),h(r,"bpmn:SubProcess")&&(t.collapsed=!ie(r,i)),h(r,"bpmn:ExclusiveGateway")&&(dt(i,"isMarkerVisible")?i.isMarkerVisible===void 0&&(i.isMarkerVisible=!1):i.isMarkerVisible=!0),Ue(t.triggeredByEvent)&&(r.triggeredByEvent=t.triggeredByEvent,delete t.triggeredByEvent),Ue(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)};lr.prototype.getDefaultSize=function(e,t){var n=j(e);if(t=t||ce(e),h(n,"bpmn:SubProcess"))return ie(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 ie(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:40}:h(n,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}};lr.prototype.createParticipantShape=function(e){return Se(e)||(e={isExpanded:e}),e=C({type:"bpmn:Participant"},e||{}),e.isExpanded!==!1&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)};function jA(e,t,n){return E(n,function(r){t=Zf(e,t,r)}),t}function Zf(e,t,n){return t[n]===void 0?t:(e[n]=t[n],Nt(t,[n]))}function FA(e){return te(e,["bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane"])}N();N();function ta(e,t){this._modeling=e,this._canvas=t}ta.$inject=["modeling","canvas"];ta.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,r=e.alignment;E(n,function(i){var o={x:0,y:0};Ue(r.left)?o.x=r.left-i.x:Ue(r.right)?o.x=r.right-i.width-i.x:Ue(r.center)?o.x=r.center-Math.round(i.width/2)-i.x:Ue(r.top)?o.y=r.top-i.y:Ue(r.bottom)?o.y=r.bottom-i.height-i.y:Ue(r.middle)&&(o.y=r.middle-Math.round(i.height/2)-i.y),t.moveElements([i],o,i.parent)})};ta.prototype.postExecute=function(e){};N();function na(e){this._modeling=e}na.$inject=["modeling"];na.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};na.prototype.postExecute=function(e){var t=e.hints||{};HA(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 HA(e,t){return Lt(e.outgoing,function(n){return n.target===t})}function ra(e,t){this._canvas=e,this._layouter=t}ra.$inject=["canvas","layouter"];ra.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};ra.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};N();var Op=Math.round;function Ws(e){this._modeling=e}Ws.$inject=["modeling"];Ws.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){ne(l.x)||(l.x=0),ne(l.y)||(l.y=0)});var s=Q(t,function(l){return!l.hidden}),c=Ce(s);E(t,function(l){de(l)&&(l.waypoints=je(l.waypoints,function(f){return{x:Op(f.x-c.x-c.width/2+i.x),y:Op(f.y-c.y-c.height/2+i.y)}})),C(l,{x:Op(l.x-c.x-c.width/2+i.x),y:Op(l.y-c.y-c.height/2+i.y)})});var u=zr(t),p={};E(t,function(l){if(de(l)){p[l.id]=ne(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),ee(l)&&(f=Nt(f,["attach"])),p[l.id]=ne(r)?a.createShape(l,mt(l,["x","y","width","height"]),l.parent||n,r,f):a.createShape(l,mt(l,["x","y","width","height"]),l.parent||n,f)}),e.elements=Sn(p)};N();var g_=Math.round;function Wn(e){this._canvas=e}Wn.$inject=["canvas"];Wn.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-g_(t.width/2),y:n.y-g_(t.height/2)}),this._canvas.addShape(t,r,i),t};Wn.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t};function Vi(e){Wn.call(this,e)}B(Vi,Wn);Vi.$inject=["canvas"];var $A=Wn.prototype.execute;Vi.prototype.execute=function(e){var t=e.shape;return GA(t),t.labelTarget=e.labelTarget,$A.call(this,e)};var zA=Wn.prototype.revert;Vi.prototype.revert=function(e){return e.shape.labelTarget=null,zA.call(this,e)};function GA(e){["width","height"].forEach(function(t){typeof e[t]=="undefined"&&(e[t]=0)})}function Wi(e,t){this._canvas=e,this._modeling=t}Wi.$inject=["canvas","modeling"];Wi.prototype.preExecute=function(e){var t=this._modeling,n=e.connection;kn(n.incoming,function(r){t.removeConnection(r,{nested:!0})}),kn(n.outgoing,function(r){t.removeConnection(r,{nested:!0})})};Wi.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=co(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t};Wi.prototype.revert=function(e){var t=e.connection,n=e.parent,r=e.parentIndex;return t.source=e.source,t.target=e.target,Ae(n.children,t,r),this._canvas.addConnection(t,n),t};N();function Us(e,t){this._modeling=e,this._elementRegistry=t}Us.$inject=["modeling","elementRegistry"];Us.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 Ui(e,t){this._canvas=e,this._modeling=t}Ui.$inject=["canvas","modeling"];Ui.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;kn(n.incoming,function(r){t.removeConnection(r,{nested:!0})}),kn(n.outgoing,function(r){t.removeConnection(r,{nested:!0})}),kn(n.children,function(r){de(r)?t.removeConnection(r,{nested:!0}):t.removeShape(r,{nested:!0})})};Ui.prototype.execute=function(e){var t=this._canvas,n=e.shape,r=n.parent;return e.oldParent=r,e.oldParentIndex=co(r.children,n),t.removeShape(n),n};Ui.prototype.revert=function(e){var t=this._canvas,n=e.shape,r=e.oldParent,i=e.oldParentIndex;return Ae(r.children,n,i),t.addShape(n,r),n};N();function ia(e){this._modeling=e}ia.$inject=["modeling"];var y_={x:"y",y:"x"};ia.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 S={y:0};S[r]=v-a(w),S[r]&&(S[y_[r]]=0,t.moveElements([w],S,w.parent))}var p=n[0],l=s(n),f=n[l],d,m,g=0;E(n,function(v,w){var S,x,b;if(v.elements.length<2){w&&w!==n.length-1&&(o(v,v.elements[0]),g+=c(v.range));return}S=At(v.elements,r),x=S[0],w===l&&(x=S[s(S)]),b=a(x),v.range=null,E(S,function(R){if(u(b,R),v.range===null){v.range={min:R[r],max:R[r]+R[i]};return}o(v,R)}),w&&w!==n.length-1&&(g+=c(v.range))}),m=Math.abs(f.range.min-p.range.max),d=Math.round((m-g)/(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||UA(n,bi(r));return A_(n,r),e.oldProperties=o,e.changed=i,i};Yi.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,r=e.changed;return A_(n,t),r};Yi.prototype._getVisualReferences=function(e){var t=this._elementRegistry;return h(e,"bpmn:DataObject")?qA(e,t):[]};function UA(e,t){return Ge(t,function(n,r){return n[r]=e.get(r),n},{})}function A_(e,t){E(t,function(n,r){e.set(r,n)})}function qA(e,t){return t.filter(function(n){return h(n,"bpmn:DataObjectReference")&&j(n).dataObjectRef===e})}N();var Xs="default",Ir="id",T_="di",KA={width:0,height:0};function Xi(e,t,n,r){this._elementRegistry=e,this._moddle=t,this._modeling=n,this._textRenderer=r}Xi.$inject=["elementRegistry","moddle","modeling","textRenderer"];Xi.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=JA(e.properties),s=e.oldProperties||YA(t,a);return M_(a,o)&&(i.unclaim(o[Ir]),r.updateId(t,a[Ir]),i.claim(a[Ir],o)),Xs in a&&(a[Xs]&&n.push(r.get(a[Xs].id)),o[Xs]&&n.push(r.get(o[Xs].id))),D_(t,a),e.oldProperties=s,e.changed=n,n};Xi.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,KA)}};Xi.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),M_(n,i)&&(a.unclaim(n[Ir]),o.updateId(t,r[Ir]),a.claim(r[Ir],i)),e.changed};function M_(e,t){return Ir in e&&e[Ir]!==t[Ir]}function YA(e,t){var n=bi(t),r=e.businessObject,i=ce(e);return Ge(n,function(o,a){return a!==T_?o[a]=r.get(a):o[a]=XA(i,bi(t.di)),o},{})}function XA(e,t){return Ge(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!==T_?n.set(o,i):r&&ZA(r,i)})}function ZA(e,t){E(t,function(n,r){e.set(r,n)})}var QA=["default"];function JA(e){var t=C({},e);return QA.forEach(function(n){n in e&&(t[n]=j(t[n]))}),t}function ua(e,t){this._canvas=e,this._modeling=t}ua.$inject=["canvas","modeling"];ua.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),Ae(a.rootElements,r),r.$parent=a,Oe(a.rootElements,o),o.$parent=null,i.di=null,s.bpmnElement=r,n.di=s,e.oldRoot=i,[]};ua.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),Oe(a.rootElements,r),r.$parent=null,Ae(a.rootElements,o),o.$parent=a,n.di=null,s.bpmnElement=o,i.di=s,[]};N();function Zs(e,t){this._modeling=e,this._spaceTool=t}Zs.$inject=["modeling","spaceTool"];Zs.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,r=e.shape,i=e.location,o=Bt(r),a=o===r,s=a?r:r.parent,c=yn(s),u=Me(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+on,y:r.y,width:r.width-on,height:r.height}:{x:r.x,y:r.y+on,width:r.width,height:r.height-on};n.createShape({type:"bpmn:Lane",isHorizontal:u},p,s)}var l=[];In(o,function(b){return l.push(b),b.label&&l.push(b.label),b===r?[]:Q(b.children,function(R){return R!==r})});var f,d,m,g,v;i==="top"?(f=-120,d=r.y,m=d+10,g="n",v="y"):i==="left"?(f=-120,d=r.x,m=d+10,g="w",v="x"):i==="bottom"?(f=120,d=r.y+r.height,m=d-10,g="s",v="y"):i==="right"&&(f=120,d=r.x+r.width,m=d-10,g="e",v="x");var w=t.calculateAdjustments(l,v,f,m),S=u?{x:0,y:f}:{x:f,y:0};t.makeSpace(w.movingShapes,w.resizingShapes,S,g,m);var x=u?{x:r.x+(a?on:0),y:d-(i==="top"?120:0),width:r.width-(a?on:0),height:120}:{x:d-(i==="left"?120:0),y:r.y+(a?on:0),width:120,height:r.height-(a?on: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=yn(n),o=i.length;if(o>r)throw new Error(`more than <${r}> child lanes`);var a=Me(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 Js="flowNodeRef",Qf="lanes";function Qi(e){this._elementRegistry=e}Qi.$inject=["elementRegistry"];Qi.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(F_(n)){var r=cT(e,t,n),i=uT(e,t,n),o=pT(r,i);return[].concat(r.waypoints,o.waypoints,i.waypoints)}return lT(e,t,n)}function fT(e,t,n){var r=Jf(e,t,n);return r.unshift(e),r.push(t),td(r)}function dT(e,t,n,r,i){var o=i&&i.preferredLayouts||[],a=hl(o,"straight")[0]||"h:h",s=oT[a]||0,c=He(e,t,s),u=yT(c,a);n=n||X(e),r=r||X(t);var p=u.split(":"),l=I_(n,e,p[0],bT(c)),f=I_(r,t,p[1],c);return fT(l,f,u)}function j_(e,t,n,r,i,o){q(n)&&(i=n,o=r,n=X(e),r=X(t)),o=C({preferredLayouts:[]},o),i=i||[];var a=o.preferredLayouts,s=a.indexOf("straight")!==-1,c;return c=s&&hT(e,t,n,r,o),c||(c=o.connectionEnd&&gT(t,e,r,i),c)||(c=o.connectionStart&&vT(e,t,n,i),c)?c:!o.connectionStart&&!o.connectionEnd&&i&&i.length?i:dT(e,t,n,r,o)}function mT(e,t,n){return e>=t&&e<=n}function B_(e,t,n){var r={x:"width",y:"height"};return mT(t[e],n[e],n[e]+n[r[e]])}function hT(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"?B_(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:B_(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 vT(e,t,n,r){return ed(e,t,n,r)}function gT(e,t,n,r){var i=r.slice().reverse();return i=ed(e,t,n,i),i?i.reverse():null}function ed(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&&Gr(l,d)<3})}function o(p,l,f){var d=en(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(Nl(p[d],l,N_)||Nl(p[d],f,N_))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=ed(e,t,n,u)),c&&en(c)?null:c}function yT(e,t){if(F_(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 _T(e){return e&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(e)}function F_(e){return e&&/t|r|b|l/.test(e)}function bT(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 I_(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 td(e){return e.reduce(function(t,n,r){var i=t[t.length-1],o=e[r+1];return uo(i,o,n,0)||t.push(n),t},[])}var xT=-10,ET=40,wT={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},ST={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},rd={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},tc={top:"t",right:"r",bottom:"b",left:"l"};function da(e){this._elementRegistry=e}B(da,Ip);da.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=H_(i&&i[0],n)),a||(a=H_(i&&i[i.length-1],r)),(h(e,"bpmn:Association")||h(e,"bpmn:DataAssociation"))&&i&&!$_(n,r))return[].concat([o],i.slice(1,-1),[a]);var p=Pu(n,s)?wT:ST;return h(e,"bpmn:MessageFlow")?c=RT(n,r,p):(h(e,"bpmn:SequenceFlow")||$_(n,r))&&(n===r?c={preferredLayouts:kT(n,e,p)}:h(n,"bpmn:BoundaryEvent")?c={preferredLayouts:NT(n,r,a,p)}:nc(n)||nc(r)?c={preferredLayouts:p.subProcess,preserveDocking:AT(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=td(j_(n,r,o,a,i,c))),u||[o,a]};function CT(e){var t=e.host;return He(X(e),t,xT)}function RT(e,t,n){return{preferredLayouts:n.messageFlow,preserveDocking:PT(e,t)}}function PT(e,t){return h(t,"bpmn:Participant")?"source":h(e,"bpmn:Participant")?"target":nc(t)?"source":nc(e)||h(t,"bpmn:Event")?"target":h(e,"bpmn:Event")?"source":null}function AT(e){return nc(e)?"target":"source"}function H_(e,t){return e?e.original||e:X(t)}function $_(e,t){return h(t,"bpmn:Activity")&&h(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function nc(e){return h(e,"bpmn:SubProcess")&&ie(e)}function Ji(e,t){return e===t}function TT(e,t){return t.indexOf(e)!==-1}function la(e){var t=/right|left/.exec(e);return t&&t[0]}function fa(e){var t=/top|bottom/.exec(e);return t&&t[0]}function z_(e,t){return rd[e]===t}function MT(e,t){var n=la(e),r=rd[n];return t.indexOf(r)!==-1}function DT(e,t){var n=fa(e),r=rd[n];return t.indexOf(r)!==-1}function V_(e){return e==="right"||e==="left"}function kT(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 NT(e,t,n,r){var i=X(e),o=X(t),a=CT(e),s,c,u=Ji(e.host,t),p=TT(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?OT(a,p,e,t,n,r):(s=BT(a,l,p,r.isHorizontal),c=IT(a,l,p,r.isHorizontal),[s+":"+c])}function OT(e,t,n,r,i,o){var a=t?e:o.isHorizontal?fa(e):la(e),s=tc[a],c;return t?V_(e)?c=G_("y",n,r,i)?"h":o.boundaryLoop.alternateHorizontalSide:c=G_("x",n,r,i)?"v":o.boundaryLoop.alternateVerticalSide:c=o.boundaryLoop.default,[s+":"+c]}function G_(e,t,n,r){var i=ET;return!(nd(e,r,n,i)||nd(e,r,{x:n.x+n.width,y:n.y+n.height},i)||nd(e,r,X(t),i))}function nd(e,t,n,r){return Math.abs(t[e]-n[e])!Yn(d))})};ma.prototype.cleanUp=function(){this._complexPreview.cleanUp()};ma.$inject=["complexPreview","connectionDocking","elementFactory","eventBus","layouter","rules"];var q_={__depends__:[No,Rg,Fp],__init__:["appendPreview"],appendPreview:["type",ma]};N();N();var K_=Math.min,Y_=Math.max;function id(e){e.preventDefault()}function rc(e){e.stopPropagation()}function LT(e){return e.nodeType===Node.TEXT_NODE}function jT(e){return[].slice.call(e)}function _n(e){this.container=e.container,this.parent=ue('
      '),this.content=_e("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=tt(this.autoResize,this),this.handlePaste=tt(this.handlePaste,this)}_n.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=mt(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=mt(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",rc),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};_n.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)}};_n.prototype.insertText=function(e){e=FT(e);var t=document.execCommand("insertText",!1,e);t||this._insertTextIE(e)};_n.prototype._insertTextIE=function(e){var t=this.getSelection(),n=t.startContainer,r=t.endContainer,i=t.startOffset,o=t.endOffset,a=t.commonAncestorContainer,s=jT(a.childNodes),c,u;if(LT(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,g){g===f?m.textContent=n.textContent.substring(0,i)+e+r.textContent.substring(o):g>f&&g<=d&&Wt(m)}),c=n,u=i+e.length}c&&u!==void 0&&setTimeout(function(){self.setSelection(c,u)})};_n.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){id(m),rc(m),s=m.clientX,c=m.clientY;var g=t.getBoundingClientRect();u=g.width,p=g.height,se.bind(document,"mousemove",f),se.bind(document,"mouseup",d)},f=function(m){id(m),rc(m);var g=K_(Y_(u+m.clientX-s,r),o),v=K_(Y_(p+m.clientY-c,i),a);t.style.width=g+"px",t.style.height=v+"px",e.resizeHandler({width:u,height:p,dx:m.clientX-s,dy:m.clientY-c})},d=function(m){id(m),rc(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)};_n.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",rc),se.unbind(t,"input",this.autoResize),se.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),Wt(n)),Wt(e)};_n.prototype.getValue=function(){return this.content.innerText.trim()};_n.prototype.getSelection=function(){var e=window.getSelection(),t=e.getRangeAt(0);return t};_n.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 FT(e){return e.replace(/\r\n|\r|\n/g,` +`)}function cn(e,t){this._eventBus=e,this._canvas=t,this._providers=[],this._textbox=new _n({container:t.getContainer(),keyHandler:tt(this._handleKey,this),resizeHandler:tt(this._handleResize,this)})}cn.$inject=["eventBus","canvas"];cn.prototype.registerProvider=function(e){this._providers.push(e)};cn.prototype.isActive=function(e){return!!(this._active&&(!e||this._active.element===e))};cn.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())};cn.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})};cn.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0,this._canvas.restoreFocus&&this._canvas.restoreFocus()};cn.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()}};cn.prototype.getValue=function(){return this._textbox.getValue()};cn.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()};cn.prototype._handleResize=function(e){this._fire("resize",e)};cn.prototype.activate=function(e){if(this.isActive()&&this.cancel(),this._eventBus.fire("directEditing.activate.allowed",{element:e})===!1)return!1;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 Hp={__depends__:[ei],__init__:["directEditing"],directEditing:["type",cn]};function X_(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===ie(e);return!o||!a||!s||!c}}N();var 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"}},{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"}}],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-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"}}],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 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"}}],eb=[{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"}}],tb=[{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"}}],nb=[{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}}],rb=[{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}}],od=[{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}}],ib=od,ad=[{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}}],ob=[{label:"Data store reference",actionName:"replace-with-data-store-reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}}],ab=[{label:"Data object reference",actionName:"replace-with-data-object-reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}}],sb=[{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}}],cb=[{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}}],ub=[{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"}],pb=[{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}}],lb={"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 sd={"start-event-non-interrupting":` @@ -271,7 +271,7 @@ - `};function Jt(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()}Jt.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate","moddleCopy"];Jt.prototype._register=function(){this._popupMenu.registerProvider("bpmn-replace",this)};Jt.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=Zy(e);return m(t,"bpmn:DataObjectReference")?this._createEntries(e,a_):m(t,"bpmn:DataStoreReference")&&!m(e.parent,"bpmn:Collaboration")?this._createEntries(e,s_):(m(t,"bpmn:Event")&&!m(t,"bpmn:BoundaryEvent")&&(i=(s=t.get("eventDefinitions")[0])==null?void 0:s.$type,r=f_[i]||[],!qe(t.$parent)&&m(t.$parent,"bpmn:SubProcess")&&(r=Q(r,function(c){return c.target.type!=="bpmn:StartEvent"}))),m(t,"bpmn:StartEvent")&&!m(t.$parent,"bpmn:SubProcess")?(o=Q(Qy.concat(r),a),this._createEntries(e,o)):m(t,"bpmn:Participant")?(o=Q(l_,function(c){return re(e)!==c.target.isExpanded}),this._createEntries(e,o)):m(t,"bpmn:StartEvent")&&qe(t.$parent)?(o=Q(p_.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")&&!qe(t.$parent)&&m(t.$parent,"bpmn:SubProcess")?(o=Q(Jy.concat(r),a),this._createEntries(e,o)):m(t,"bpmn:EndEvent")?(o=Q(t_.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=Q(c_,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=Q(e_.concat(r),a),this._createEntries(e,o)):m(t,"bpmn:Gateway")?(o=Q(n_,a),this._createEntries(e,o)):m(t,"bpmn:Transaction")?(o=Q(Lf,a),this._createEntries(e,o)):qe(t)&&re(e)?(o=Q(o_,a),this._createEntries(e,o)):m(t,"bpmn:AdHocSubProcess")&&re(e)?(o=Q(i_,a),this._createEntries(e,o)):m(t,"bpmn:SubProcess")&&re(e)?(o=Q(r_,a),this._createEntries(e,o)):m(t,"bpmn:SubProcess")&&!re(e)?(o=Q(jf,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,u_):m(t,"bpmn:FlowNode")?(o=Q(jf,a),this._createEntries(e,o)):{})};Jt.prototype.getPopupMenuHeaderEntries=function(e){var t={};return m(e,"bpmn:Activity")&&!qe(e)&&(t={...t,...this._getLoopCharacteristicsHeaderEntries(e)}),m(e,"bpmn:DataObjectReference")&&(t={...t,...this._getCollectionHeaderEntries(e)}),m(e,"bpmn:Participant")&&(t={...t,...this._getParticipantMultiplicityHeaderEntries(e)}),Yp(e)&&(t={...t,...this._getNonInterruptingHeaderEntries(e)}),t};Jt.prototype._createEntries=function(e,t){var n={},r=this;return E(t,function(i){n[i.actionName]=r._createEntry(i,e)}),n};Jt.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};Jt.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}};Jt.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"}}}};Jt.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}}};Jt.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}}};Jt.prototype._getNonInterruptingHeaderEntries=function(e){let t=this._translate,n=L(e),r=this,i=qp(e),o=m(e,"bpmn:BoundaryEvent")?Ff["intermediate-event-non-interrupting"]:Ff["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 d_={__depends__:[Eo,hu,So],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",Jt]};function Vi(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,y=h.shape;if(!(!yr(d)||!r.isOpen(y))){var v=r.getEntries(y);v.replace&&v.replace.action.click(d,y)}}),n.on("contextPad.close",function(){f.cleanUp()})}Vi.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate","appendPreview"];Vi.prototype.getMultiElementContextPadEntries=function(e){var t=this._modeling,n={};return this._isDeleteAllowed(e)&&S(n,{delete:{group:"edit",className:"bpmn-icon-trash",title:this._translate("Delete"),action:{click:function(r,i){t.removeElements(i.slice())}}}}),n};Vi.prototype._isDeleteAllowed=function(e){var t=this._rules.allowed("elements.delete",{elements:e});return U(t)?hn(e,n=>t.includes(n)):t};Vi.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])&&S(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 y(b){var x=5,C=t.getPad(b).html,P=C.getBoundingClientRect(),O={x:P.left,y:P.bottom+x};return O}function v(b,x,C,P){function O(I,W){var $=r.createShape(S({type:b},P));o.start(I,$,{source:W})}var T=s?function(I,W){var $=r.createShape(S({type:b},P));s.append(W,$)}:O,B=s?function(I,W){return p.create(W,b,P),()=>{p.cleanUp()}}:null;return{group:"model",className:x,title:C,action:{dragstart:O,click:T,hover:B}}}function w(b){return function(x,C){n.splitLane(C,b),t.open(C,!0)}}if(ee(l,["bpmn:Lane","bpmn:Participant"])&&re(e)){var R=pn(e);S(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")}}}}),R.length<2&&((Te(e)?e.height>=120:e.width>=120)&&S(u,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:c("Divide into two lanes"),action:{click:w(2)}}}),(Te(e)?e.height>=180:e.width>=180)&&S(u,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:c("Divide into three lanes"),action:{click:w(3)}}})),S(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")?S(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"})}):h_(l,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?S(u,{"append.compensation-activity":v("bpmn:Task","bpmn-icon-task",c("Append compensation activity"),{isForCompensation:!0})}):!m(l,"bpmn:EndEvent")&&!l.isForCompensation&&!h_(l,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")&&!qe(l)&&S(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")||S(u,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:c("Change element"),action:{click:function(b,x){var C=S(y(x),{cursor:{x:b.x,y:b.y}});a.open(x,"bpmn-replace",C,{title:c("Change element"),width:300,search:!0})}}}}),m(l,"bpmn:SequenceFlow")&&S(u,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),m(l,"bpmn:MessageFlow")&&S(u,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),ee(l,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&S(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")&&S(u,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect using association"),action:{click:f,dragstart:f}}}),ee(l,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&S(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")&&S(u,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),this._isDeleteAllowed([e])&&S(u,h()),u};function h_(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 m_={__depends__:[Yy,Ru,Kc,Qe,Po,ni,d_],__init__:["contextPadProvider"],contextPadProvider:["type",Vi]};var AA={horizontal:["x","width"],vertical:["y","height"]},g_=5;function Ln(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:[]})}Ln.$inject=["modeling","rules"];Ln.prototype.registerFilter=function(e){if(typeof e!="function")throw new Error("the filter has to be a function");this._filters.push(e)};Ln.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};Ln.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};Ln.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=Rt(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};Ln.prototype._setOrientation=function(e){var t=AA[e];this._axis=t[0],this._dimension=t[1]};Ln.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)};Ln.prototype._findRange=function(e){var t=e[this._axis],n=e[this._dimension];return{min:t+g_,max:t+n-g_}};var v_={__init__:["distributeElements"],distributeElements:["type",Ln]};function aa(e){At.call(this,e)}aa.$inject=["eventBus"];N(aa,At);aa.prototype.init=function(){this.addRule("elements.distribute",function(e){var t=e.elements;return t=Q(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=Nr(t),t.length<3?!1:t})};var PA={horizontal:` + `};function un(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()}un.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate","moddleCopy"];un.prototype._register=function(){this._popupMenu.registerProvider("bpmn-replace",this)};un.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=X_(e);return h(t,"bpmn:DataObjectReference")?this._createEntries(e,ob):h(t,"bpmn:DataStoreReference")&&!h(e.parent,"bpmn:Collaboration")?this._createEntries(e,ab):(h(t,"bpmn:Event")&&!h(t,"bpmn:BoundaryEvent")&&(i=(s=t.get("eventDefinitions")[0])==null?void 0:s.$type,r=lb[i]||[],!Qe(t.$parent)&&h(t.$parent,"bpmn:SubProcess")&&(r=Q(r,function(c){return c.target.type!=="bpmn:StartEvent"}))),h(t,"bpmn:StartEvent")&&!h(t.$parent,"bpmn:SubProcess")?(o=Q(Z_.concat(r),a),this._createEntries(e,o)):h(t,"bpmn:Participant")?(o=Q(pb,function(c){return ie(e)!==c.target.isExpanded}),this._createEntries(e,o)):h(t,"bpmn:StartEvent")&&Qe(t.$parent)?(o=Q(cb.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")&&!Qe(t.$parent)&&h(t.$parent,"bpmn:SubProcess")?(o=Q(Q_.concat(r),a),this._createEntries(e,o)):h(t,"bpmn:EndEvent")?(o=Q(eb.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=Q(sb,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=Q(J_.concat(r),a),this._createEntries(e,o)):h(t,"bpmn:Gateway")?(o=Q(tb,a),this._createEntries(e,o)):h(t,"bpmn:Transaction")?(o=Q(od,a),this._createEntries(e,o)):Qe(t)&&ie(e)?(o=Q(ib,a),this._createEntries(e,o)):h(t,"bpmn:AdHocSubProcess")&&ie(e)?(o=Q(rb,a),this._createEntries(e,o)):h(t,"bpmn:SubProcess")&&ie(e)?(o=Q(nb,a),this._createEntries(e,o)):h(t,"bpmn:SubProcess")&&!ie(e)?(o=Q(ad,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,ub):h(t,"bpmn:FlowNode")?(o=Q(ad,a),this._createEntries(e,o)):{})};un.prototype.getPopupMenuHeaderEntries=function(e){var t={};return h(e,"bpmn:Activity")&&!Qe(e)&&(t={...t,...this._getLoopCharacteristicsHeaderEntries(e)}),h(e,"bpmn:DataObjectReference")&&(t={...t,...this._getCollectionHeaderEntries(e)}),h(e,"bpmn:Participant")&&(t={...t,...this._getParticipantMultiplicityHeaderEntries(e)}),cp(e)&&(t={...t,...this._getNonInterruptingHeaderEntries(e)}),t};un.prototype._createEntries=function(e,t){var n={},r=this;return E(t,function(i){n[i.actionName]=r._createEntry(i,e)}),n};un.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};un.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}};un.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"}}}};un.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}}};un.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}}};un.prototype._getNonInterruptingHeaderEntries=function(e){let t=this._translate,n=j(e),r=this,i=up(e),o=h(e,"bpmn:BoundaryEvent")?sd["intermediate-event-non-interrupting"]:sd["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 fb={__depends__:[Do,Ap,No],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",un]};N();function eo(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,g=m.shape;if(!(!Tr(d)||!r.isOpen(g))){var v=r.getEntries(g);v.replace&&v.replace.action.click(d,g)}}),n.on("contextPad.close",function(){f.cleanUp()})}eo.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate","appendPreview"];eo.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};eo.prototype._isDeleteAllowed=function(e){var t=this._rules.allowed("elements.delete",{elements:e});return q(t)?ln(e,n=>t.includes(n)):t};eo.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 g(x){var b=5,R=t.getPad(x).html,A=R.getBoundingClientRect(),O={x:A.left,y:A.bottom+b};return O}function v(x,b,R,A){function O(L,W){var z=r.createShape(C({type:x},A));o.start(L,z,{source:W})}var T=s?function(L,W){var z=r.createShape(C({type:x},A));s.append(W,z)}:O,I=s?function(L,W){return u.create(W,x,A),()=>{u.cleanUp()}}:null;return{group:"model",className:b,title:R,action:{dragstart:O,click:T,hover:I}}}function w(x){return function(b,R){n.splitLane(R,x),t.open(R,!0)}}if(te(l,["bpmn:Lane","bpmn:Participant"])&&ie(e)){var S=yn(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")}}}}),S.length<2&&((Me(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)}}}),(Me(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"})}):db(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&&!db(l,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")&&!Qe(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 R=C(g(b),{cursor:{x:x.x,y:x.y}});a.open(b,"bpmn-replace",R,{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"))}),te(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}}}),te(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 db(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 mb={__depends__:[q_,Hp,su,rt,Lo,li,fb],__init__:["contextPadProvider"],contextPadProvider:["type",eo]};N();var $T={horizontal:["x","width"],vertical:["y","height"]},hb=5;function qn(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:[]})}qn.$inject=["modeling","rules"];qn.prototype.registerFilter=function(e){if(typeof e!="function")throw new Error("the filter has to be a function");this._filters.push(e)};qn.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};qn.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};qn.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=At(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};qn.prototype._setOrientation=function(e){var t=$T[e];this._axis=t[0],this._dimension=t[1]};qn.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)};qn.prototype._findRange=function(e){var t=e[this._axis],n=e[this._dimension];return{min:t+hb,max:t+n-hb}};var vb={__init__:["distributeElements"],distributeElements:["type",qn]};N();function ha(e){Ot.call(this,e)}ha.$inject=["eventBus"];B(ha,Ot);ha.prototype.init=function(){this.addRule("elements.distribute",function(e){var t=e.elements;return t=Q(t,function(n){var r=te(n,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(n.labelTarget||r)}),t=zr(t),t.length<3?!1:t})};var zT={horizontal:` @@ -279,7 +279,7 @@ - `},Hf=PA;var TA=900;function Wi(e,t,n,r){this._distributeElements=t,this._translate=n,this._popupMenu=e,this._rules=r,e.registerProvider("align-elements",TA,this)}Wi.$inject=["popupMenu","distributeElements","translate","rules"];Wi.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&S(t,this._getEntries(e)),t};Wi.prototype._isAllowed=function(e){return this._rules.allowed("elements.distribute",{elements:e})};Wi.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:Hf.horizontal,action:function(o,a){t.trigger(e,"horizontal"),r.close()}},"distribute-elements-vertical":{group:"distribute",title:n("Distribute elements vertically"),imageHtml:Hf.vertical,action:function(o,a){t.trigger(e,"vertical"),r.close()}}};return i};var y_={__depends__:[Eo,v_],__init__:["bpmnDistributeElements","distributeElementsMenuProvider"],bpmnDistributeElements:["type",aa],distributeElementsMenuProvider:["type",Wi]};var __="is not a registered action",MA="is already registered";function Vt(e,t){this._eventBus=e,this._actions={};var n=this;e.on("diagram.init",function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})})}Vt.$inject=["eventBus","injector"];Vt.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)})};Vt.prototype.trigger=function(e,t){if(!this._actions[e])throw $f(e,__);var n=this._eventBus.fire("editorActions.allowed",{action:e,opts:t});if(n!==!1)return this._actions[e](t)};Vt.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)})};Vt.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw $f(e,MA);this._actions[e]=t};Vt.prototype.unregister=function(e){if(!this.isRegistered(e))throw $f(e,__);this._actions[e]=void 0};Vt.prototype.getActions=function(){return Object.keys(this._actions)};Vt.prototype.isRegistered=function(e){return!!this._actions[e]};function $f(e,t){return new Error(e+" "+t)}var x_={__init__:["editorActions"],editorActions:["type",Vt]};function sa(e){e.invoke(Vt,this)}N(sa,Vt);sa.$inject=["injector"];sa.prototype._registerDefaultActions=function(e){Vt.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(),y=n.filter(function(v){return v!==h});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(h){var y=r.get(),v=h.type;y.length&&c.trigger(y,v)}),r&&p&&this._registerAction("alignElements",function(h){var y=r.get(),v=[],w=h.type;y.length&&(v=Q(y,function(R){return!m(R,"bpmn:Lane")}),p.trigger(v,w))}),r&&f&&this._registerAction("setColor",function(h){var y=r.get();y.length&&f.setColor(y,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(),y,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")}),y=we(v),f.moveElements(v,{x:-y.x,y:-y.y},h)}),r&&d&&this._registerAction("replaceElement",function(h){d.triggerEntry("replace","click",h)})};var b_={__depends__:[x_],editorActions:["type",sa]};function Au(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")})}Au.$inject=["eventBus"];function Ar(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;rt(a)?i.newBounds=n.snapComplex(c,a):i.newBounds=n.snapSimple(s,c)}})}Ar.$inject=["eventBus","gridSnapping","modeling"];N(Ar,k);Ar.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};Ar.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};Ar.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),S(e,o),e};Ar.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),S(e,o),e};var DA=2e3;function Pu(e,t){e.on(["spaceTool.move","spaceTool.end"],DA,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)}})}Pu.$inject=["eventBus","gridSnapping"];var E_={__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",Ar],gridSnappingSpaceToolBehavior:["type",Pu]};var Gs=10;function Tu(e,t,n){return n||(n="round"),Math[n](e/t)*t}var kA=1200,NA=800;function rr(e,t,n){var r=!n||n.active!==!1;this._eventBus=t;var i=this;t.on("diagram.init",NA,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"],kA,function(o){var a=o.originalEvent;if(!(!i.active||a&&mt(a))){var s=o.context,c=s.gridSnappingContext;c||(c=s.gridSnappingContext={}),["x","y"].forEach(function(p){var u={},l=BA(o,p,e);l&&(u.offset=l);var f=OA(o,p);f&&S(u,f),kn(o,p)||i.snapEvent(o,p,u)})}})}rr.prototype.snapEvent=function(e,t,n){var r=this.snapValue(e[t],n);He(e,t,r)};rr.prototype.getGridSpacing=function(){return Gs};rr.prototype.snapValue=function(e,t){var n=0;t&&t.offset&&(n=t.offset),e+=n,e=Tu(e,Gs);var r,i;return t&&t.min&&(r=t.min,te(r)&&(r=Tu(r+n,Gs,"ceil"),e=Math.max(e,r))),t&&t.max&&(i=t.max,te(i)&&(i=Tu(i+n,Gs,"floor"),e=Math.min(e,i))),e-=n,e};rr.prototype.isActive=function(){return this.active};rr.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})};rr.prototype.toggleActive=function(){this.setActive(!this.active)};rr.$inject=["elementRegistry","eventBus","config.gridSnapping"];function OA(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&&(Mu(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&&(Mu(t)?S_(s)?a.x.max=c.left:a.x.min=c.right:w_(s)?a.y.max=c.top:a.y.min=c.bottom),p&&(Mu(t)?S_(s)?a.x.min=p.left:a.x.max=p.right:w_(s)?a.y.min=p.top:a.y.max=p.bottom),a[t]}function BA(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)||(Mu(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 Mu(e){return e==="x"}function w_(e){return e.indexOf("n")!==-1}function S_(e){return e.indexOf("w")!==-1}var C_={__depends__:[E_],__init__:["gridSnapping"],gridSnapping:["type",rr]};var IA=2e3;function Du(e,t,n){e.on("autoPlace",IA,function(r){var i=r.source,o=q(i),a=r.shape,s=hp(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")&&(LA(c)?p.offset=-a.width/2:p.offset=-a.height/2),s[c]=t.snapValue(s[c],p))}),s})}Du.$inject=["eventBus","gridSnapping","elementRegistry"];function LA(e){return e==="x"}var jA=1750;function ku(e,t,n){t.on(["create.start","shape.move.start"],jA,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}))}})}ku.$inject=["canvas","eventBus","gridSnapping"];var FA=3e3;function ca(e,t,n){k.call(this,e),this._gridSnapping=t;var r=this;this.postExecuted(["connection.create","connection.layout"],FA,function(i){var o=i.context,a=o.connection,s=o.hints||{},c=a.waypoints;s.connectionStart||s.connectionEnd||s.createElementsBehavior===!1||HA(c)&&n.updateWaypoints(a,r.snapMiddleSegments(c))})}ca.$inject=["eventBus","gridSnapping","modeling"];N(ca,k);ca.prototype.snapMiddleSegments=function(e){var t=this._gridSnapping,n;e=e.slice();for(var r=1;r3}function $A(e){return e==="h"}function zA(e){return e==="v"}function VA(e,t,n){var r=Ut(t,n),i={};return $A(r)&&(i.y=e.snapValue(t.y)),zA(r)&&(i.x=e.snapValue(t.x)),("x"in i||"y"in i)&&(t=S({},t,i),n=S({},n,i)),[t,n]}var R_={__init__:["gridSnappingAutoPlaceBehavior","gridSnappingParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",Du],gridSnappingParticipantBehavior:["type",ku],gridSnappingLayoutConnectionBehavior:["type",ca]};var A_={__depends__:[C_,R_],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",Au]};var WA=30,P_=30;function Gi(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 re(i)?n._createParticipantHit(i,o):n._createDefaultHit(i,o);if(m(i,"bpmn:SubProcess"))return re(i)?n._createSubProcessHit(i,o):n._createDefaultHit(i,o)})}Gi.$inject=["eventBus","interactionEvents"];Gi.prototype._createDefaultHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createDefaultHit(e,t),!0};Gi.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=Te(e)?{width:WA,height:e.height}:{width:e.width,height:P_};return this._interactionEvents.createBoxHit(t,"all",n),!0};Gi.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 T_={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",Gi]};function pa(e){e.invoke(_r,this)}N(pa,_r);pa.$inject=["injector"];pa.prototype.registerBindings=function(e,t){_r.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 M_={__depends__:[ho],__init__:["keyboardBindings"],keyboardBindings:["type",pa]};var GA={moveSpeed:1,moveSpeedAccelerated:10},UA=1500,D_="left",k_="up",N_="right",O_="down",KA={ArrowLeft:D_,Left:D_,ArrowUp:k_,Up:k_,ArrowRight:N_,Right:N_,ArrowDown:O_,Down:O_},YA={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 Nu(e,t,n,r,i){var o=this;this._config=S({},GA,e||{}),t.addListener(UA,function(a){var s=a.keyEvent,c=KA[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=YA[a](p),l=r.allowed("elements.move",{shapes:c,hints:{keyboardMove:!0}});l&&n.moveElements(c,u)}}}Nu.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];var B_={__depends__:[ho,Qe],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",Nu]};var I_=10;function Ui(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=Ig(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=cc(l),!qA(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)})}Ui.prototype.canResize=function(e){var t=this._rules,n=dt(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)};Ui.prototype.activate=function(e,t,n){var r=this._dragging,i,o;if(typeof n=="string"&&(n={direction:n}),i=S({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,zf(t,o),"resize",{autoActivate:!0,cursor:XA(o),data:{shape:t,context:i}})};Ui.prototype.computeMinResizeBox=function(e){var t=e.shape,n=e.direction,r,i;return r=e.minDimensions||{width:I_,height:I_},i=$p(t,e.childrenBoxPadding),Lg(n,t,r,i)};Ui.$inject=["eventBus","rules","modeling","dragging"];function qA(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function zf(e,t){var n=q(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 XA(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 L_="djs-resizing",j_="resize-not-ok",ZA=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,L_)),s.width>5&&H(c,{x:s.x,width:s.width}),s.height>5&&H(c,{y:s.y,height:s.height}),o.canExecute?ce(c).remove(j_):ce(c).add(j_)}function i(o){var a=o.shape,s=o.frame;s&&Ce(o.frame),t.removeMarker(a,L_)}e.on("resize.move",ZA,function(o){r(o.context)}),e.on("resize.cleanup",function(o){i(o.context)})}Ou.$inject=["eventBus","canvas","previewSupport"];var Bu=-6,Iu=8,Lu=20,Us="djs-resizer",QA=["n","w","s","e","nw","ne","se","sw"];function ir(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,nt(i.addResizer,i))}),e.on("shape.changed",function(o){var a=o.element;n.isSelected(a)&&(i.removeResizers(),i.addResizer(a))})}ir.prototype.makeDraggable=function(e,t,n){var r=this._resize;function i(o){sn(o)&&r.activate(o,e,n)}ae.bind(t,"mousedown",i),ae.bind(t,"touchstart",i)};ir.prototype._createResizer=function(e,t,n,r){var i=this._getResizersParent(),o=JA(r),a=G("g");ce(a).add(Us),ce(a).add(Us+"-"+e.id),ce(a).add(Us+"-"+r),Z(i,a);var s=G("rect");H(s,{x:-Iu/2+o.x,y:-Iu/2+o.y,width:Iu,height:Iu}),ce(s).add(Us+"-visual"),Z(a,s);var c=G("rect");return H(c,{x:-Lu/2+o.x,y:-Lu/2+o.y,width:Lu,height:Lu}),ce(c).add(Us+"-hit"),Z(a,c),ro(a,t,n),a};ir.prototype.createResizer=function(e,t){var n=zf(e,t),r=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,r,t)};ir.prototype.addResizer=function(e){var t=this;le(e)||E(QA,function(n){t._resize.canResize({shape:e,direction:n})&&t.createResizer(e,n)})};ir.prototype.removeResizers=function(){var e=this._getResizersParent();cr(e)};ir.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")};ir.$inject=["eventBus","canvas","selection","resize"];function JA(e){var t={x:0,y:0};return e.indexOf("e")!==-1?t.x=-Bu:e.indexOf("w")!==-1&&(t.x=Bu),e.indexOf("s")!==-1?t.y=-Bu:e.indexOf("n")!==-1&&(t.y=Bu),t}var ju={__depends__:[gt,Ct,bn],__init__:["resize","resizePreview","resizeHandles"],resize:["type",Ui],resizePreview:["type",Ou],resizeHandles:["type",ir]};var eP=2e3;function Ki(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"],eP,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||ee(c,["bpmn:Activity","bpmn:Event","bpmn:TextAnnotation","bpmn:Participant"]))&&r.activate(c)}}Ki.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"];Ki.prototype.activate=function(e){var t=pt(e);if(t!==void 0){var n={text:t},r=this.getEditingBBox(e);S(n,r);var i={},o=n.style||{};return S(o,{backgroundColor:null,border:null}),(ee(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||F_(e))&&S(i,{centerVertically:!0}),rn(e)&&(S(i,{resizable:!0,autoResize:!0}),S(o,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),m(e,"bpmn:TextAnnotation")&&(S(i,{resizable:!0,autoResize:!0}),S(o,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),S(n,{options:i,style:o}),n}};Ki.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")||rP(e)){var h=Te(e),y=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};S(o,y),S(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(nP(e)){var v=Te(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};S(o,w),S(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"])||F_(e))&&(S(o,{width:r.width,height:r.height}),S(d,{fontSize:l+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"})),tP(e)&&(S(o,{width:r.width,x:r.x}),S(d,{fontSize:l+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"}));var R=1,b=r.width+2*R;if(n.labelTarget&&(S(o,{width:b,height:r.height+2*R,x:r.x-R,y:r.y-R}),S(d,{fontSize:p+"px",lineHeight:u})),rn(n)&&!$r(n)&&!J(n)){var x=Sa(e),C=t.getAbsoluteBBox({x:x.x,y:x.y,width:0,height:0}),P=p,O=Yn.width*a+2*R;S(o,{width:O,height:P+2*R,x:C.x-O/2,y:C.y-P/2-R}),S(d,{fontSize:p+"px",lineHeight:u})}return m(e,"bpmn:TextAnnotation")&&(S(o,{width:r.width+2*R,height:r.height+2*R,x:r.x-R,y:r.y-R,minWidth:30*a,minHeight:10*a}),S(d,{textAlign:"left",paddingTop:fr*a+"px",paddingBottom:fr*a+"px",paddingLeft:fr*a+"px",paddingRight:fr*a+"px",fontSize:l+"px",lineHeight:f})),{bounds:o,style:d}};Ki.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}),iP(t)&&(t=null),this._modeling.updateLabel(e,t,i)};function F_(e){return m(e,"bpmn:SubProcess")&&!re(e)}function tP(e){return m(e,"bpmn:SubProcess")&&re(e)}function nP(e){return m(e,"bpmn:Participant")&&!re(e)}function rP(e){return m(e,"bpmn:Participant")&&re(e)}function iP(e){return!e||!e.trim()}var H_="djs-element-hidden",$_="djs-label-hidden";function Fu(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");H(l,{d:u,strokeWidth:2,stroke:oP(o)}),Z(s,l),Z(i,s),Ie(s,o.x,o.y)}m(o,"bpmn:TextAnnotation")||o.labelTarget?t.addMarker(o,H_):(m(o,"bpmn:Task")||m(o,"bpmn:CallActivity")||m(o,"bpmn:SubProcess")||m(o,"bpmn:Participant")||m(o,"bpmn:Lane"))&&t.addMarker(o,$_)}),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}});H(r.path,{d:f})}}),e.on(["directEditing.complete","directEditing.cancel"],function(c){var p=c.active;p&&(t.removeMarker(p.element.label||p.element,H_),t.removeMarker(o,$_)),o=void 0,a=void 0,s&&(Ce(s),s=void 0)})}Fu.$inject=["eventBus","canvas","pathMap"];function oP(e,t){var n=se(e);return n.get("stroke")||t||"black"}var z_={__depends__:[lo,ju,Ru],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",Ki],labelEditingPreview:["type",Fu]};var aP=500,sP=1e3;function Pr(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 H(a,S({x:0,y:0,rx:4,width:100,height:100},n)),a}e.on(["shape.added","shape.changed"],aP,function(o){var a=o.element,s=o.gfx,c=ve(".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=ve(".djs-outline",s);c||(c=i(s),Z(s,c)),r.updateConnectionOutline(c,a)})}Pr.prototype.updateShapeOutline=function(e,t){var n=!1,r=this._getProviders();r.length&&E(r,function(i){n=n||i.updateOutline(t,e)}),n||H(e,{x:-this.offset,y:-this.offset,width:t.width+this.offset*2,height:t.height+this.offset*2})};Pr.prototype.updateConnectionOutline=function(e,t){var n=we(t);H(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+this.offset*2,height:n.height+this.offset*2})};Pr.prototype.registerProvider=function(e,t){t||(t=e,e=sP),this._eventBus.on("outline.getProviders",e,function(n){n.providers.push(t)})};Pr.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers};Pr.prototype.getOutline=function(e){var t,n=this._getProviders();return E(n,function(r){Le(r.getOutline)&&(t=t||r.getOutline(e))}),t};Pr.$inject=["eventBus","styles","elementRegistry"];var Hu=6;function Ks(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)})}Ks.prototype._updateMultiSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");cr(t);var n=e.length>1,r=this._canvas.getContainer();if(ce(r)[n?"add":"remove"]("djs-multi-select"),!!n){var i=cP(we(e)),o=G("rect");H(o,S({rx:3},i)),ce(o).add("djs-selection-outline"),Z(t,o)}};Ks.$inject=["eventBus","canvas","selection"];function cP(e){return{x:e.x-Hu,y:e.y-Hu,width:e.width+Hu*2,height:e.height+Hu*2}}var ua={__depends__:[Qe],__init__:["outline","multiSelectionOutline"],outline:["type",Pr],multiSelectionOutline:["type",Ks]};var V_=["bpmn:Event","bpmn:SequenceFlow","bpmn:Gateway"],W_={class:"bjs-label-link",stroke:"var(--element-selected-outline-secondary-stroke-color)",strokeDasharray:"5, 5"},pP=15,$u=2;function zu(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=>ee(h,V_));if(f.length===1){let h=f[0];J(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(J),y=f.find(v=>{var w;return(w=v.labels)==null?void 0:w.includes(h)});h&&y&&a(h,y,l)}}),e.on("shape.changed",function({element:l}){var f;!ee(l,V_)||!u(l)||(J(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=Hn([q(f),q(l)],W_),y=h.getAttribute("d"),w=d.includes(l)?c(l):p(l),R=jr(w,y);if(!R)return;let x=d.includes(f)?c(f):p(f),C=jr(x,y)||q(f);Ri(C,R)');return ct(t,{position:"absolute",width:"0",height:"0"}),e.insertBefore(t,e.firstChild),t}function fP(e,t,n){ct(e,{left:t+"px",top:n+"px"})}function Wf(e,t){e.style.display=t===!1?"none":""}var U_="djs-tooltip",Vf="."+U_;function Tt(e,t){this._eventBus=e,this._canvas=t,this._ids=uP,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=lP(t.getContainer());var n=this;ht.bind(this._tooltipRoot,Vf,"mousedown",function(r){r.stopPropagation()}),ht.bind(this._tooltipRoot,Vf,"mouseover",function(r){n.trigger("mouseover",r)}),ht.bind(this._tooltipRoot,Vf,"mouseout",function(r){n.trigger("mouseout",r)}),this._init()}Tt.$inject=["eventBus","canvas"];Tt.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=S({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t};Tt.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,r=this.get(Ze(n,"data-tooltip-id"));r&&(e==="mouseover"&&r.timeout&&this.clearTimeout(r),e==="mouseout"&&r.timeout&&(r.timeout=1e3,this.setTimeout(r)))};Tt.prototype.get=function(e){return typeof e!="string"&&(e=e.id),this._tooltips[e]};Tt.prototype.clearTimeout=function(e){if(e=this.get(e),!!e){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}};Tt.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)}};Tt.prototype.remove=function(e){var t=this.get(e);t&&(Lt(t.html),Lt(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])};Tt.prototype.show=function(){Wf(this._tooltipRoot)};Tt.prototype.hide=function(){Wf(this._tooltipRoot,!1)};Tt.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};Tt.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)),rt(n)&&(n=_e(n)),r=_e('
      '),ct(r,{position:"absolute"}),r.appendChild(n),e.type&&ke(r).add("djs-tooltip-"+e.type),e.className&&ke(r).add(e.className),e.htmlContainer=r,i.appendChild(r),this._tooltips[t]=e,this._updateTooltip(e)};Tt.prototype._updateTooltip=function(e){var t=e.position,n=e.htmlContainer;fP(n,t.x,t.y)};Tt.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(dP)):m(a,"bpmn:DataObjectReference")&&r(i,n(hP)))})}Vu.$inject=["eventBus","tooltips","translate"];var Y_={__depends__:[K_],__init__:["modelingFeedback"],modelingFeedback:["type",Vu]};var mP=500,gP=1250,vP=1500,Wu=Math.round;function yP(e){return{x:e.x+Wu(e.width/2),y:e.y+Wu(e.height/2)}}function Gu(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",vP,function(s){var c=s.context,p=s.shape,u=r.get().slice();u.indexOf(p)===-1&&(u=[p]),u=_P(u),S(c,{shapes:u,validatedShapes:u,shape:p})}),e.on("shape.move.start",gP,function(s){var c=s.context,p=c.validatedShapes,u;if(u=c.canExecute=o(p),!u)return!1}),e.on("shape.move.move",mP,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=Wu(p.x),p.y=Wu(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(sn(s)){var c=vr(s);if(!c)throw new Error("must supply DOM mousedown event");return a(c,s.element)}});function a(s,c,p,u){if(Pe(p)&&(u=p,p=!1),!(c.waypoints||!c.parent)&&!ce(s.target).has("djs-hit-no-move")){var l=yP(c),f=t.init(s,l,"shape.move",{cursor:"grabbing",autoActivate:p,data:{shape:c,context:u||{}}});if(f!==!1)return!0}}this.start=a}Gu.$inject=["eventBus","dragging","modeling","selection","rules"];function _P(e){var t=Cn(e,"id");return Q(e,function(n){for(;n=n.parent;)if(t[n.id])return!1;return!0})}var q_=499,Gf="djs-dragging",X_="drop-ok",Z_="drop-not-ok",Q_="new-parent",J_="attach-ok";function Uu(e,t,n,r){function i(c){var p=o(c),u=xP(p);return u}function o(c){var p=$n(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){[J_,X_,Z_,Q_].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,Gf),c.allDraggedElements?c.allDraggedElements.push(p):c.allDraggedElements=[p]}e.on("shape.move.start",q_,function(c){var p=c.context,u=p.shapes,l=p.allDraggedElements,f=i(u);if(!p.dragGroup){var d=G("g");H(d,n.cls("djs-drag-group",["no-events"]));var h=t.getActiveLayer();Z(h,d),p.dragGroup=d}f.forEach(function(y){r.addDragger(y,p.dragGroup)}),l?l=Xi([l,o(u)]):l=o(u),E(l,function(y){t.addMarker(y,Gf)}),p.allDraggedElements=l,p.differentParents=bP(u)}),e.on("shape.move.move",q_,function(c){var p=c.context,u=p.dragGroup,l=p.target,f=p.shape.parent,d=p.canExecute;l&&(d==="attach"?a(l,J_):p.canExecute&&f&&l.id!==f.id?a(l,Q_):a(l,p.canExecute?X_:Z_)),Ie(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,Gf)}),l&&Ce(l)}),this.makeDraggable=s}Uu.$inject=["eventBus","canvas","styles","previewSupport"];function xP(e){var t=Q(e,function(n){return le(n)?ne(e,bt({id:n.source.id}))&&ne(e,bt({id:n.target.id})):!0});return t}function bP(e){return Jf(Cn(e,function(t){return t.parent&&t.parent.id}))!==1}var ex={__depends__:[Gr,Qe,ua,gt,Ct,bn],__init__:["move","movePreview"],move:["type",Gu],movePreview:["type",Uu]};var nx=".djs-palette-toggle",rx=".entry",EP=nx+", "+rx,Uf="djs-palette-",wP="shown",Kf="open",tx="two-column",SP=1e3;function et(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()})}et.$inject=["eventBus","canvas"];et.prototype.registerProvider=function(e,t){t||(t=e,e=SP),this._eventBus.on("palette.getProviders",e,function(n){n.providers.push(t)}),this._rebuild()};et.prototype.getEntries=function(){var e=this._getProviders();return e.reduce(RP,{})};et.prototype._rebuild=function(){if(this._diagramInitialized){var e=this._getProviders();e.length&&(this._container||this._init(),this._update())}};et.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),r=this._container=_e(et.HTML_MARKUP);n.appendChild(r),ke(n).add(Uf+wP),ht.bind(r,EP,"click",function(i){var o=i.delegateTarget;if(da(o,nx))return e.toggle();e.trigger("click",i)}),ae.bind(r,"mousedown",function(i){i.stopPropagation()}),ht.bind(r,rx,"dragstart",function(i){e.trigger("dragstart",i)}),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:r})};et.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers};et.prototype._toggleState=function(e){e=e||{};var t=this._getParentContainer(),n=this._container,r=this._eventBus,i,o=ke(n),a=ke(t);"twoColumn"in e?i=e.twoColumn:i=this._needsCollapse(t.clientHeight,this._entries||{}),o.toggle(tx,i),a.toggle(Uf+tx,i),"open"in e&&(o.toggle(Kf,e.open),a.toggle(Uf+Kf,e.open)),r.fire("palette.changed",{twoColumn:i,open:this.isOpen()})};et.prototype._update=function(){var e=ve(".djs-palette-entries",this._container),t=this._entries=this.getEntries();Dr(e),E(t,function(n,r){var i=n.group||"default",o=ve("[data-group="+mr(i)+"]",e);o||(o=_e('
      '),Ze(o,"data-group",i),e.appendChild(o));var a=n.html||(n.separator?'
      ':'
      '),s=_e(a);if(o.appendChild(s),!n.separator&&(Ze(s,"data-action",r),n.title&&Ze(s,"title",n.title),n.className&&CP(s,n.className),n.imageUrl)){var c=_e("");Ze(c,"src",n.imageUrl),s.appendChild(c)}}),this.open()};et.prototype.trigger=function(e,t,n){var r,i,o=t.delegateTarget||t.target;return o?(r=Ze(o,"data-action"),i=t.originalEvent||t,this.triggerEntry(r,e,i,n)):t.preventDefault()};et.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(Le(a)){if(t==="click")return a(n,r)}else if(a[t])return a[t](n,r);n.preventDefault()}};et.prototype._layoutChanged=function(){this._toggleState({})};et.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 cx={__depends__:[ri,Jn],__init__:["lassoTool"],lassoTool:["type",or]};var Yf=1500,ux="grab";function si(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(yr(c))return a.activateMove(c.originalEvent,!0),!1}),s&&s.addListener(Yf,function(c){if(!(!px(c.keyEvent)||a.isActive())){var p=a._mouse.getLastMoveEvent();a.activateMove(p,!!p)}},"keyboard.keydown"),s&&s.addListener(Yf,function(c){!px(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!yr(c)&&u&&e.once("hand.move.ended",function(l){a.activateHand(l.originalEvent,!0,!0)}),!1})}si.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"];si.prototype.activateMove=function(e,t,n){typeof t=="object"&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:ux,data:{context:n||{}}})};si.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:ux,data:{context:{reactivate:n}}})};si.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)};si.prototype.isActive=function(){var e=this._dragging.context();return e?/^(hand|hand\.move)$/.test(e.prefix):!1};function px(e){return Ge("Space",e)}var lx={__depends__:[ri,Jn],__init__:["handTool"],handTool:["type",si]};var fx="connect-ok",dx="connect-not-ok";function ci(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?fx:dx))}),e.on(["global-connect.out","global-connect.cleanup"],function(c){var p=c.context.startTarget,u=c.context.canStartConnect;p&&r.removeMarker(p,u?fx:dx)}),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})}ci.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"];ci.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})};ci.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)};ci.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)};ci.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};var hx={__depends__:[Po,gt,Ct,ri,Jn],globalConnect:["type",ci]};function Ys(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)}Ys.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"];Ys.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,y){function v(w){var R=n.createShape(S({type:l},y));t.start(w,R)}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 S(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 mx={__depends__:[ix,ni,_u,cx,lx,hx,zr],__init__:["paletteProvider"],paletteProvider:["type",Ys]};var PP=250;function qs(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);S(l,{x:f.x,y:f.y});var d=n.createShape(l);r.addShape(d,f.parent);var h=ve('[data-element-id="'+mr(f.id)+'"]',s.dragGroup);h&&H(h,{display:"none"});var y=i.addDragger(d,s.dragGroup);s.visualReplacements[u]=y,r.removeShape(d)}})}function a(s){var c=s.visualReplacements;E(c,function(p,u){var l=ve('[data-element-id="'+mr(u)+'"]',s.dragGroup);l&&H(l,{display:"inline"}),p.remove(),c[u]&&delete c[u]})}e.on("shape.move.move",PP,function(s){var c=s.context,p=c.canExecute;c.visualReplacements||(c.visualReplacements={}),p&&p.replacements?o(c):a(c)})}qs.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"];N(qs,k);var gx={__depends__:[bn],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",qs]};var TP=1250,qf=40,MP=20,DP=10,vx=20,_x=["x","y"],kP=Math.abs;function Ku(e){e.on(["connect.hover","connect.move","connect.end"],TP,function(t){var n=t.context,r=n.canExecute,i=n.start,o=n.hover,a=n.source,s=n.target;t.originalEvent&&mt(t.originalEvent)||(n.initialConnectionStart||(n.initialConnectionStart=n.connectionStart),r&&o&&NP(t,o,LP(o)),o&&IP(r,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(n.connectionStart=Yt(i),ee(o,["bpmn:Event","bpmn:Gateway"])&&yx(t,Yt(o)),ee(o,["bpmn:Task","bpmn:SubProcess"])&&OP(t,o),m(a,"bpmn:BoundaryEvent")&&s===a.host&&BP(t)):xx(r,"bpmn:MessageFlow")?(m(i,"bpmn:Event")&&(n.connectionStart=Yt(i)),m(o,"bpmn:Event")&&yx(t,Yt(o))):n.connectionStart=n.initialConnectionStart)})}Ku.$inject=["eventBus"];function NP(e,t,n){_x.forEach(function(r){var i=bx(r,t);e[r]t[r]+i-n&&He(e,r,t[r]+i-n)})}function OP(e,t){var n=Yt(t);_x.forEach(function(r){jP(e,t,r)&&He(e,r,n[r])})}function BP(e){var t=e.context,n=t.source,r=t.target;if(!FP(t)){var i=Yt(n),o=je(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;kP(c-i[s])i[s]?p=i[s]+qf:p=i[s]-qf,He(e,s,p))})}}function yx(e,t){He(e,"x",t.x),He(e,"y",t.y)}function xx(e,t){return e&&e.type===t}function IP(e,t){return It(t,function(n){return xx(e,n)})}function bx(e,t){return e==="x"?t.width:t.height}function LP(e){return m(e,"bpmn:Task")?DP:MP}function jP(e,t,n){return e[n]>t[n]+vx&&e[n]=e.x||i&&i<=e.x)&&He(e,"x",e.x),(r&&r>=e.y||o&&o<=e.y)&&He(e,"y",e.y)}}function wx(e,t){return e.indexOf(t)!==-1}function Sx(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}var UP=1250;function qi(e,t){var n=this;e.on(["resize.start"],function(r){n.initSnap(r)}),e.on(["resize.move","resize.end"],UP,function(r){var i=r.context,o=i.shape,a=o.parent,s=i.direction,c=i.snapContext;if(!(r.originalEvent&&mt(r.originalEvent))&&!kn(r)){var p=c.pointsForTarget(a);p.initialized||(p=n.addSnapTargetPoints(p,o,a,s),p.initialized=!0),qP(s)&&He(r,"x",r.x),XP(s)&&He(r,"y",r.y),t.snap(r,p)}}),e.on(["resize.cleanup"],function(){t.hide()})}qi.prototype.initSnap=function(e){var t=e.context,n=t.shape,r=t.direction,i=t.snapContext;i||(i=t.snapContext=new jn);var o=Cx(n,r);return i.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),i};qi.prototype.addSnapTargetPoints=function(e,t,n,r){var i=this.getSnapTargets(t,n);return E(i,function(o){e.add("corner",Ap(o)),e.add("corner",Rp(o))}),e.add("corner",Cx(t,r)),e};qi.$inject=["eventBus","snapping"];qi.prototype.getSnapTargets=function(e,t){return Pp(t).filter(function(n){return!KP(n,e)&&!le(n)&&!YP(n)&&!J(n)})};function Cx(e,t){var n=q(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 KP(e,t){return e.host===t}function YP(e){return!!e.hidden}function qP(e){return e==="n"||e==="s"}function XP(e){return e==="e"||e==="w"}var ZP=7,QP=1e3;function ar(e){this._canvas=e,this._asyncHide=ec(nt(this.hide,this),QP)}ar.$inject=["canvas"];ar.prototype.snap=function(e,t){var n=e.context,r=n.snapContext,i=r.getSnapLocations(),o={x:kn(e,"x"),y:kn(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,ZP),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];Pe(s)&&He(e,a,s.originValue)})};ar.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=G("path");return H(n,{d:"M0,0 L0,0"}),ce(n).add("djs-snap-line"),Z(t,n),{update:function(r){te(r)?e==="horizontal"?H(n,{d:"M-100000,"+r+" L+100000,"+r,display:""}):H(n,{d:"M "+r+",-100000 L "+r+", +100000",display:""}):H(n,{display:"none"})}}};ar.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}};ar.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()};ar.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]};ar.prototype.hide=function(){E(this._snapLines,function(e){e.update()})};var Rx={__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",ln],resizeSnapping:["type",qi],snapping:["type",ar]};var Ax={__depends__:[Rx],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",Ku],createMoveSnapping:["type",pi]};var Tx=300;function ue(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=ve(ue.INPUT_SELECTOR,this._container),this._resultsContainer=ve(ue.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy","drag.init","elements.changed"],this.close,this)}ue.$inject=["canvas","eventBus","selection","translate"];ue.prototype._bindEvents=function(){var e=this;function t(n,r,i,o){e._eventMaps.push({el:n,type:i,listener:ht.bind(n,r,i,o)})}t(document,"html","click",function(n){e.close(!1)}),t(this._container,ue.INPUT_SELECTOR,"click",function(n){n.stopPropagation(),n.delegateTarget.focus()}),t(this._container,ue.RESULT_SELECTOR,"mouseover",function(n){n.stopPropagation(),e._scrollToNode(n.delegateTarget),e._preselect(n.delegateTarget)}),t(this._container,ue.RESULT_SELECTOR,"click",function(n){n.stopPropagation(),e._select(n.delegateTarget)}),t(this._container,ue.INPUT_SELECTOR,"keydown",function(n){Ge("ArrowUp",n)&&n.preventDefault(),Ge("ArrowDown",n)&&n.preventDefault()}),t(this._container,ue.INPUT_SELECTOR,"keyup",function(n){if(Ge("Escape",n))return e.close();if(Ge("Enter",n)){var r=e._getCurrentResult();return r?e._select(r):e.close(!1)}if(Ge("ArrowUp",n))return e._scrollToDirection(!0);if(Ge("ArrowDown",n))return e._scrollToDirection();Ge(["ArrowLeft","ArrowRight"],n)||e._search(n.delegateTarget.value)})};ue.prototype._unbindEvents=function(){this._eventMaps.forEach(function(e){ht.unbind(e.el,e.type,e.listener)})};ue.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=ve(ue.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(r),this._preselect(r)}};ue.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}};ue.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&&Px(n,e.primaryTokens,ue.RESULT_PRIMARY_HTML),Px(n,e.secondaryTokens,ue.RESULT_SECONDARY_HTML),Ze(n,ue.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n};ue.prototype.registerProvider=function(e){this._searchProvider=e};ue.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,ke(this._canvas.getContainer()).add("djs-search-open"),ke(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))};ue.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,ke(this._canvas.getContainer()).remove("djs-search-open"),ke(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._eventBus.fire("searchPad.closed"),this._canvas.restoreFocus())};ue.prototype.toggle=function(){this.isOpen()?this.close():this.open()};ue.prototype.isOpen=function(){return this._open};ue.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&ke(t).remove(ue.RESULT_SELECTED_CLASS);var n=Ze(e,ue.RESULT_ID_ATTRIBUTE),r=this._results[n].element;ke(e).add(ue.RESULT_SELECTED_CLASS),this._canvas.scrollToElement(r,{top:Tx}),this._selection.select(r),this._eventBus.fire("searchPad.preselected",r)}};ue.prototype._select=function(e){var t=Ze(e,ue.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this._cachedSelection=null,this._cachedViewbox=null,this.close(!1),this._canvas.scrollToElement(n,{top:Tx}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)};ue.prototype._getBoxHtml=function(){let e=_e(ue.BOX_HTML),t=ve(ue.INPUT_SELECTOR,e);return t&&t.setAttribute("aria-label",this._translate("Search in diagram")),e};function Px(e,t,n){var r=JP(t),i=_e(n);i.innerHTML=r,e.appendChild(i)}function JP(e){var t="";return e.forEach(function(n){var r=Ac(n.value||n.matched||n.normal),i=n.match||n.matched;i?t+=''+r+"":t+=r}),t!==""?t:null}ue.CONTAINER_SELECTOR=".djs-search-container";ue.INPUT_SELECTOR=".djs-search-input input";ue.RESULTS_CONTAINER_SELECTOR=".djs-search-results";ue.RESULT_SELECTOR=".djs-search-result";ue.RESULT_SELECTED_CLASS="djs-search-result-selected";ue.RESULT_SELECTED_SELECTOR="."+ue.RESULT_SELECTED_CLASS;ue.RESULT_ID_ATTRIBUTE="data-result-id";ue.RESULT_HIGHLIGHT_CLASS="djs-search-highlight";ue.BOX_HTML=`
      + `},cd=zT;N();var GT=900;function to(e,t,n,r){this._distributeElements=t,this._translate=n,this._popupMenu=e,this._rules=r,e.registerProvider("align-elements",GT,this)}to.$inject=["popupMenu","distributeElements","translate","rules"];to.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&C(t,this._getEntries(e)),t};to.prototype._isAllowed=function(e){return this._rules.allowed("elements.distribute",{elements:e})};to.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:cd.horizontal,action:function(o,a){t.trigger(e,"horizontal"),r.close()}},"distribute-elements-vertical":{group:"distribute",title:n("Distribute elements vertically"),imageHtml:cd.vertical,action:function(o,a){t.trigger(e,"vertical"),r.close()}}};return i};var gb={__depends__:[Do,vb],__init__:["bpmnDistributeElements","distributeElementsMenuProvider"],bpmnDistributeElements:["type",ha],distributeElementsMenuProvider:["type",to]};N();var yb="is not a registered action",VT="is already registered";function Zt(e,t){this._eventBus=e,this._actions={};var n=this;e.on("diagram.init",function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})})}Zt.$inject=["eventBus","injector"];Zt.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)})};Zt.prototype.trigger=function(e,t){if(!this._actions[e])throw ud(e,yb);var n=this._eventBus.fire("editorActions.allowed",{action:e,opts:t});if(n!==!1)return this._actions[e](t)};Zt.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)})};Zt.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw ud(e,VT);this._actions[e]=t};Zt.prototype.unregister=function(e){if(!this.isRegistered(e))throw ud(e,yb);this._actions[e]=void 0};Zt.prototype.getActions=function(){return Object.keys(this._actions)};Zt.prototype.isRegistered=function(e){return!!this._actions[e]};function ud(e,t){return new Error(e+" "+t)}var _b={__init__:["editorActions"],editorActions:["type",Zt]};N();function va(e){e.invoke(Zt,this)}B(va,Zt);va.$inject=["injector"];va.prototype._registerDefaultActions=function(e){Zt.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(),g=n.filter(function(v){return v!==m});return r.select(g),g}),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 g=r.get(),v=m.type;g.length&&c.trigger(g,v)}),r&&u&&this._registerAction("alignElements",function(m){var g=r.get(),v=[],w=m.type;g.length&&(v=Q(g,function(S){return!h(S,"bpmn:Lane")}),u.trigger(v,w))}),r&&f&&this._registerAction("setColor",function(m){var g=r.get();g.length&&f.setColor(g,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(),g,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")}),g=Ce(v),f.moveElements(v,{x:-g.x,y:-g.y},m)}),r&&d&&this._registerAction("replaceElement",function(m){d.triggerEntry("replace","click",m)})};var bb={__depends__:[_b],editorActions:["type",va]};function $p(e){e.on(["create.init","shape.move.init"],function(t){var n=t.context,r=t.shape;te(r,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}$p.$inject=["eventBus"];N();function Lr(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;st(a)?i.newBounds=n.snapComplex(c,a):i.newBounds=n.snapSimple(s,c)}})}Lr.$inject=["eventBus","gridSnapping","modeling"];B(Lr,k);Lr.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};Lr.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};Lr.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};Lr.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 WT=2e3;function zp(e,t){e.on(["spaceTool.move","spaceTool.end"],WT,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)}})}zp.$inject=["eventBus","gridSnapping"];var xb={__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",Lr],gridSnappingSpaceToolBehavior:["type",zp]};N();var ic=10;function Gp(e,t,n){return n||(n="round"),Math[n](e/t)*t}var UT=1200,qT=800;function mr(e,t,n){var r=!n||n.active!==!1;this._eventBus=t;var i=this;t.on("diagram.init",qT,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"],UT,function(o){var a=o.originalEvent;if(!(!i.active||a&&xt(a))){var s=o.context,c=s.gridSnappingContext;c||(c=s.gridSnappingContext={}),["x","y"].forEach(function(u){var p={},l=YT(o,u,e);l&&(p.offset=l);var f=KT(o,u);f&&C(p,f),zn(o,u)||i.snapEvent(o,u,p)})}})}mr.prototype.snapEvent=function(e,t,n){var r=this.snapValue(e[t],n);ze(e,t,r)};mr.prototype.getGridSpacing=function(){return ic};mr.prototype.snapValue=function(e,t){var n=0;t&&t.offset&&(n=t.offset),e+=n,e=Gp(e,ic);var r,i;return t&&t.min&&(r=t.min,ne(r)&&(r=Gp(r+n,ic,"ceil"),e=Math.max(e,r))),t&&t.max&&(i=t.max,ne(i)&&(i=Gp(i+n,ic,"floor"),e=Math.min(e,i))),e-=n,e};mr.prototype.isActive=function(){return this.active};mr.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})};mr.prototype.toggleActive=function(){this.setActive(!this.active)};mr.$inject=["elementRegistry","eventBus","config.gridSnapping"];function KT(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&&(Vp(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&&(Vp(t)?wb(s)?a.x.max=c.left:a.x.min=c.right:Eb(s)?a.y.max=c.top:a.y.min=c.bottom),u&&(Vp(t)?wb(s)?a.x.min=u.left:a.x.max=u.right:Eb(s)?a.y.min=u.top:a.y.max=u.bottom),a[t]}function YT(e,t,n){var r=e.context,i=e.shape,o=r.gridSnappingContext,a=o.snapLocation,s=o.snapOffset;return s&&ne(s[t])||(s||(s=o.snapOffset={}),ne(s[t])||(s[t]=0),!i)||(n.get(i.id)||(Vp(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 Vp(e){return e==="x"}function Eb(e){return e.indexOf("n")!==-1}function wb(e){return e.indexOf("w")!==-1}var Sb={__depends__:[xb],__init__:["gridSnapping"],gridSnapping:["type",mr]};var XT=2e3;function Wp(e,t,n){e.on("autoPlace",XT,function(r){var i=r.source,o=X(i),a=r.shape,s=Au(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")&&(ZT(c)?u.offset=-a.width/2:u.offset=-a.height/2),s[c]=t.snapValue(s[c],u))}),s})}Wp.$inject=["eventBus","gridSnapping","elementRegistry"];function ZT(e){return e==="x"}var QT=1750;function Up(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}))}})}Up.$inject=["canvas","eventBus","gridSnapping"];N();var JT=3e3;function ga(e,t,n){k.call(this,e),this._gridSnapping=t;var r=this;this.postExecuted(["connection.create","connection.layout"],JT,function(i){var o=i.context,a=o.connection,s=o.hints||{},c=a.waypoints;s.connectionStart||s.connectionEnd||s.createElementsBehavior===!1||eM(c)&&n.updateWaypoints(a,r.snapMiddleSegments(c))})}ga.$inject=["eventBus","gridSnapping","modeling"];B(ga,k);ga.prototype.snapMiddleSegments=function(e){var t=this._gridSnapping,n;e=e.slice();for(var r=1;r3}function tM(e){return e==="h"}function nM(e){return e==="v"}function rM(e,t,n){var r=en(t,n),i={};return tM(r)&&(i.y=e.snapValue(t.y)),nM(r)&&(i.x=e.snapValue(t.x)),("x"in i||"y"in i)&&(t=C({},t,i),n=C({},n,i)),[t,n]}var Cb={__init__:["gridSnappingAutoPlaceBehavior","gridSnappingParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",Wp],gridSnappingParticipantBehavior:["type",Up],gridSnappingLayoutConnectionBehavior:["type",ga]};var Rb={__depends__:[Sb,Cb],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",$p]};var iM=30,Pb=30;function no(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 ie(i)?n._createParticipantHit(i,o):n._createDefaultHit(i,o);if(h(i,"bpmn:SubProcess"))return ie(i)?n._createSubProcessHit(i,o):n._createDefaultHit(i,o)})}no.$inject=["eventBus","interactionEvents"];no.prototype._createDefaultHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createDefaultHit(e,t),!0};no.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=Me(e)?{width:iM,height:e.height}:{width:e.width,height:Pb};return this._interactionEvents.createBoxHit(t,"all",n),!0};no.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:Pb}),!0};var Ab={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",no]};function ya(e){e.invoke(Mr,this)}B(ya,Mr);ya.$inject=["injector"];ya.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 Tb={__depends__:[wo],__init__:["keyboardBindings"],keyboardBindings:["type",ya]};N();var oM={moveSpeed:1,moveSpeedAccelerated:10},aM=1500,Mb="left",Db="up",kb="right",Nb="down",sM={ArrowLeft:Mb,Left:Mb,ArrowUp:Db,Up:Db,ArrowRight:kb,Right:kb,ArrowDown:Nb,Down:Nb},cM={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 qp(e,t,n,r,i){var o=this;this._config=C({},oM,e||{}),t.addListener(aM,function(a){var s=a.keyEvent,c=sM[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=cM[a](u),l=r.allowed("elements.move",{shapes:c,hints:{keyboardMove:!0}});l&&n.moveElements(c,p)}}}qp.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];var Ob={__depends__:[wo,rt],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",qp]};N();var Bb=10;function ro(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=Ng(p,l,u),c.newBounds=Bg(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=wc(l),!uM(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)})}ro.prototype.canResize=function(e){var t=this._rules,n=mt(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)};ro.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,pd(t,o),"resize",{autoActivate:!0,cursor:pM(o),data:{shape:t,context:i}})};ro.prototype.computeMinResizeBox=function(e){var t=e.shape,n=e.direction,r,i;return r=e.minDimensions||{width:Bb,height:Bb},i=tp(t,e.childrenBoxPadding),Ig(n,t,r,i)};ro.$inject=["eventBus","rules","modeling","dragging"];function uM(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function pd(e,t){var n=X(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 pM(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 Ib="djs-resizing",Lb="resize-not-ok",lM=500;function Kp(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,Ib)),s.width>5&&$(c,{x:s.x,width:s.width}),s.height>5&&$(c,{y:s.y,height:s.height}),o.canExecute?pe(c).remove(Lb):pe(c).add(Lb)}function i(o){var a=o.shape,s=o.frame;s&&Pe(o.frame),t.removeMarker(a,Ib)}e.on("resize.move",lM,function(o){r(o.context)}),e.on("resize.cleanup",function(o){i(o.context)})}Kp.$inject=["eventBus","canvas","previewSupport"];N();var Yp=-6,Xp=8,Zp=20,oc="djs-resizer",fM=["n","w","s","e","nw","ne","se","sw"];function hr(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,tt(i.addResizer,i))}),e.on("shape.changed",function(o){var a=o.element;n.isSelected(a)&&(i.removeResizers(),i.addResizer(a))})}hr.prototype.makeDraggable=function(e,t,n){var r=this._resize;function i(o){gn(o)&&r.activate(o,e,n)}se.bind(t,"mousedown",i),se.bind(t,"touchstart",i)};hr.prototype._createResizer=function(e,t,n,r){var i=this._getResizersParent(),o=dM(r),a=U("g");pe(a).add(oc),pe(a).add(oc+"-"+e.id),pe(a).add(oc+"-"+r),J(i,a);var s=U("rect");$(s,{x:-Xp/2+o.x,y:-Xp/2+o.y,width:Xp,height:Xp}),pe(s).add(oc+"-visual"),J(a,s);var c=U("rect");return $(c,{x:-Zp/2+o.x,y:-Zp/2+o.y,width:Zp,height:Zp}),pe(c).add(oc+"-hit"),J(a,c),fo(a,t,n),a};hr.prototype.createResizer=function(e,t){var n=pd(e,t),r=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,r,t)};hr.prototype.addResizer=function(e){var t=this;de(e)||E(fM,function(n){t._resize.canResize({shape:e,direction:n})&&t.createResizer(e,n)})};hr.prototype.removeResizers=function(){var e=this._getResizersParent();_r(e)};hr.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")};hr.$inject=["eventBus","canvas","selection","resize"];function dM(e){var t={x:0,y:0};return e.indexOf("e")!==-1?t.x=-Yp:e.indexOf("w")!==-1&&(t.x=Yp),e.indexOf("s")!==-1?t.y=-Yp:e.indexOf("n")!==-1&&(t.y=Yp),t}var Qp={__depends__:[Et,kt,Dn],__init__:["resize","resizePreview","resizeHandles"],resize:["type",ro],resizePreview:["type",Kp],resizeHandles:["type",hr]};N();var mM=2e3;function io(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"],mM,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||te(c,["bpmn:Activity","bpmn:Event","bpmn:TextAnnotation","bpmn:Participant"]))&&r.activate(c)}}io.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"];io.prototype.activate=function(e){var t=gt(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}),(te(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||jb(e))&&C(i,{centerVertically:!0}),mn(e)&&(C(i,{resizable:!0,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}};io.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")||gM(e)){var m=Me(e),g=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,g),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(vM(e)){var v=Me(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)"})}(te(e,["bpmn:Task","bpmn:CallActivity"])||jb(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"})),hM(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 S=1,x=r.width+2*S;if(n.labelTarget&&(C(o,{width:x,height:r.height+2*S,x:r.x-S,y:r.y-S}),C(d,{fontSize:u+"px",lineHeight:p})),mn(n)&&!Xr(n)&&!ee(n)){var b=La(e),R=t.getAbsoluteBBox({x:b.x,y:b.y,width:0,height:0}),A=u,O=ir.width*a+2*S;C(o,{width:O,height:A+2*S,x:R.x-O/2,y:R.y-A/2-S}),C(d,{fontSize:u+"px",lineHeight:p})}return h(e,"bpmn:TextAnnotation")&&(C(o,{width:r.width+2*S,height:r.height+2*S,x:r.x-S,y:r.y-S,minWidth:30*a,minHeight:10*a}),C(d,{textAlign:"left",paddingTop:wr*a+"px",paddingBottom:wr*a+"px",paddingLeft:wr*a+"px",paddingRight:wr*a+"px",fontSize:l+"px",lineHeight:f})),{bounds:o,style:d}};io.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}),yM(t)&&(t=null),this._modeling.updateLabel(e,t,i)};function jb(e){return h(e,"bpmn:SubProcess")&&!ie(e)}function hM(e){return h(e,"bpmn:SubProcess")&&ie(e)}function vM(e){return h(e,"bpmn:Participant")&&!ie(e)}function gM(e){return h(e,"bpmn:Participant")&&ie(e)}function yM(e){return!e||!e.trim()}var Fb="djs-element-hidden",Hb="djs-label-hidden";function Jp(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");$(l,{d:p,strokeWidth:2,stroke:_M(o)}),J(s,l),J(i,s),Fe(s,o.x,o.y)}h(o,"bpmn:TextAnnotation")||o.labelTarget?t.addMarker(o,Fb):(h(o,"bpmn:Task")||h(o,"bpmn:CallActivity")||h(o,"bpmn:SubProcess")||h(o,"bpmn:Participant")||h(o,"bpmn:Lane"))&&t.addMarker(o,Hb)}),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}});$(r.path,{d:f})}}),e.on(["directEditing.complete","directEditing.cancel"],function(c){var u=c.active;u&&(t.removeMarker(u.element.label||u.element,Fb),t.removeMarker(o,Hb)),o=void 0,a=void 0,s&&(Pe(s),s=void 0)})}Jp.$inject=["eventBus","canvas","pathMap"];function _M(e,t){var n=ce(e);return n.get("stroke")||t||"black"}var $b={__depends__:[xo,Qp,Hp],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",io],labelEditingPreview:["type",Jp]};N();var bM=500,xM=1e3;function jr(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 $(a,C({x:0,y:0,rx:4,width:100,height:100},n)),a}e.on(["shape.added","shape.changed"],bM,function(o){var a=o.element,s=o.gfx,c=_e(".djs-outline",s);c||(c=r.getOutline(a)||i(s),J(s,c)),r.updateShapeOutline(c,a)}),e.on(["connection.added","connection.changed"],function(o){var a=o.element,s=o.gfx,c=_e(".djs-outline",s);c||(c=i(s),J(s,c)),r.updateConnectionOutline(c,a)})}jr.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})};jr.prototype.updateConnectionOutline=function(e,t){var n=Ce(t);$(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+this.offset*2,height:n.height+this.offset*2})};jr.prototype.registerProvider=function(e,t){t||(t=e,e=xM),this._eventBus.on("outline.getProviders",e,function(n){n.providers.push(t)})};jr.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers};jr.prototype.getOutline=function(e){var t,n=this._getProviders();return E(n,function(r){Le(r.getOutline)&&(t=t||r.getOutline(e))}),t};jr.$inject=["eventBus","styles","elementRegistry"];N();var el=6;function ac(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)})}ac.prototype._updateMultiSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");_r(t);var n=e.length>1,r=this._canvas.getContainer();if(pe(r)[n?"add":"remove"]("djs-multi-select"),!!n){var i=EM(Ce(e)),o=U("rect");$(o,C({rx:3},i)),pe(o).add("djs-selection-outline"),J(t,o)}};ac.$inject=["eventBus","canvas","selection"];function EM(e){return{x:e.x-el,y:e.y-el,width:e.width+el*2,height:e.height+el*2}}var _a={__depends__:[rt],__init__:["outline","multiSelectionOutline"],outline:["type",jr],multiSelectionOutline:["type",ac]};var zb=["bpmn:Event","bpmn:SequenceFlow","bpmn:Gateway"],Gb={class:"bjs-label-link",stroke:"var(--element-selected-outline-secondary-stroke-color)",strokeDasharray:"5, 5"},wM=15,tl=2;function nl(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=>te(m,zb));if(f.length===1){let m=f[0];ee(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(ee),g=f.find(v=>{var w;return(w=v.labels)==null?void 0:w.includes(m)});m&&g&&a(m,g,l)}}),e.on("shape.changed",function({element:l}){var f;!te(l,zb)||!p(l)||(ee(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=Xn([X(f),X(l)],Gb),g=m.getAttribute("d"),w=d.includes(l)?c(l):u(l),S=qr(w,g);if(!S)return;let b=d.includes(f)?c(f):u(f),R=qr(b,g)||X(f);Li(R,S)');return vt(t,{position:"absolute",width:"0",height:"0"}),e.insertBefore(t,e.firstChild),t}function RM(e,t,n){vt(e,{left:t+"px",top:n+"px"})}function fd(e,t){e.style.display=t===!1?"none":""}var Wb="djs-tooltip",ld="."+Wb;function It(e,t){this._eventBus=e,this._canvas=t,this._ids=SM,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=CM(t.getContainer());var n=this;bt.bind(this._tooltipRoot,ld,"mousedown",function(r){r.stopPropagation()}),bt.bind(this._tooltipRoot,ld,"mouseover",function(r){n.trigger("mouseover",r)}),bt.bind(this._tooltipRoot,ld,"mouseout",function(r){n.trigger("mouseout",r)}),this._init()}It.$inject=["eventBus","canvas"];It.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};It.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,r=this.get(nt(n,"data-tooltip-id"));r&&(e==="mouseover"&&r.timeout&&this.clearTimeout(r),e==="mouseout"&&r.timeout&&(r.timeout=1e3,this.setTimeout(r)))};It.prototype.get=function(e){return typeof e!="string"&&(e=e.id),this._tooltips[e]};It.prototype.clearTimeout=function(e){if(e=this.get(e),!!e){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}};It.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)}};It.prototype.remove=function(e){var t=this.get(e);t&&(Wt(t.html),Wt(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])};It.prototype.show=function(){fd(this._tooltipRoot)};It.prototype.hide=function(){fd(this._tooltipRoot,!1)};It.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};It.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)),st(n)&&(n=ue(n)),r=ue('
      '),vt(r,{position:"absolute"}),r.appendChild(n),e.type&&Ne(r).add("djs-tooltip-"+e.type),e.className&&Ne(r).add(e.className),e.htmlContainer=r,i.appendChild(r),this._tooltips[t]=e,this._updateTooltip(e)};It.prototype._updateTooltip=function(e){var t=e.position,n=e.htmlContainer;RM(n,t.x,t.y)};It.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(PM)):h(a,"bpmn:DataObjectReference")&&r(i,n(AM)))})}rl.$inject=["eventBus","tooltips","translate"];var qb={__depends__:[Ub],__init__:["modelingFeedback"],modelingFeedback:["type",rl]};N();var TM=500,MM=1250,DM=1500,il=Math.round;function kM(e){return{x:e.x+il(e.width/2),y:e.y+il(e.height/2)}}function ol(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",DM,function(s){var c=s.context,u=s.shape,p=r.get().slice();p.indexOf(u)===-1&&(p=[u]),p=NM(p),C(c,{shapes:p,validatedShapes:p,shape:u})}),e.on("shape.move.start",MM,function(s){var c=s.context,u=c.validatedShapes,p;if(p=c.canExecute=o(u),!p)return!1}),e.on("shape.move.move",TM,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=il(u.x),u.y=il(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(gn(s)){var c=Ar(s);if(!c)throw new Error("must supply DOM mousedown event");return a(c,s.element)}});function a(s,c,u,p){if(Se(u)&&(p=u,u=!1),!(c.waypoints||!c.parent)&&!pe(s.target).has("djs-hit-no-move")){var l=kM(c),f=t.init(s,l,"shape.move",{cursor:"grabbing",autoActivate:u,data:{shape:c,context:p||{}}});if(f!==!1)return!0}}this.start=a}ol.$inject=["eventBus","dragging","modeling","selection","rules"];function NM(e){var t=Vt(e,"id");return Q(e,function(n){for(;n=n.parent;)if(t[n.id])return!1;return!0})}N();var Kb=499,dd="djs-dragging",Yb="drop-ok",Xb="drop-not-ok",Zb="new-parent",Qb="attach-ok";function al(e,t,n,r){function i(c){var u=o(c),p=OM(u);return p}function o(c){var u=Zn(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){[Qb,Yb,Xb,Zb].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,dd),c.allDraggedElements?c.allDraggedElements.push(u):c.allDraggedElements=[u]}e.on("shape.move.start",Kb,function(c){var u=c.context,p=u.shapes,l=u.allDraggedElements,f=i(p);if(!u.dragGroup){var d=U("g");$(d,n.cls("djs-drag-group",["no-events"]));var m=t.getActiveLayer();J(m,d),u.dragGroup=d}f.forEach(function(g){r.addDragger(g,u.dragGroup)}),l?l=_i([l,o(p)]):l=o(p),E(l,function(g){t.addMarker(g,dd)}),u.allDraggedElements=l,u.differentParents=BM(p)}),e.on("shape.move.move",Kb,function(c){var u=c.context,p=u.dragGroup,l=u.target,f=u.shape.parent,d=u.canExecute;l&&(d==="attach"?a(l,Qb):u.canExecute&&f&&l.id!==f.id?a(l,Zb):a(l,u.canExecute?Yb:Xb)),Fe(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,dd)}),l&&Pe(l)}),this.makeDraggable=s}al.$inject=["eventBus","canvas","styles","previewSupport"];function OM(e){var t=Q(e,function(n){return de(n)?re(e,Ct({id:n.source.id}))&&re(e,Ct({id:n.target.id})):!0});return t}function BM(e){return vl(Vt(e,function(t){return t.parent&&t.parent.id}))!==1}var Jb={__depends__:[ei,rt,_a,Et,kt,Dn],__init__:["move","movePreview"],move:["type",ol],movePreview:["type",al]};N();var tx=".djs-palette-toggle",nx=".entry",IM=tx+", "+nx,md="djs-palette-",LM="shown",hd="open",ex="two-column",jM=1e3;function ot(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()})}ot.$inject=["eventBus","canvas"];ot.prototype.registerProvider=function(e,t){t||(t=e,e=jM),this._eventBus.on("palette.getProviders",e,function(n){n.providers.push(t)}),this._rebuild()};ot.prototype.getEntries=function(){var e=this._getProviders();return e.reduce(HM,{})};ot.prototype._rebuild=function(){if(this._diagramInitialized){var e=this._getProviders();e.length&&(this._container||this._init(),this._update())}};ot.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),r=this._container=ue(ot.HTML_MARKUP);n.appendChild(r),Ne(n).add(md+LM),bt.bind(r,IM,"click",function(i){var o=i.delegateTarget;if(Ra(o,tx))return e.toggle();e.trigger("click",i)}),se.bind(r,"mousedown",function(i){i.stopPropagation()}),bt.bind(r,nx,"dragstart",function(i){e.trigger("dragstart",i)}),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:r})};ot.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers};ot.prototype._toggleState=function(e){e=e||{};var t=this._getParentContainer(),n=this._container,r=this._eventBus,i,o=Ne(n),a=Ne(t);"twoColumn"in e?i=e.twoColumn:i=this._needsCollapse(t.clientHeight,this._entries||{}),o.toggle(ex,i),a.toggle(md+ex,i),"open"in e&&(o.toggle(hd,e.open),a.toggle(md+hd,e.open)),r.fire("palette.changed",{twoColumn:i,open:this.isOpen()})};ot.prototype._update=function(){var e=_e(".djs-palette-entries",this._container),t=this._entries=this.getEntries();Hr(e),E(t,function(n,r){var i=n.group||"default",o=_e("[data-group="+Rr(i)+"]",e);o||(o=ue('
      '),nt(o,"data-group",i),e.appendChild(o));var a=n.html||(n.separator?'
      ':'
      '),s=ue(a);if(o.appendChild(s),!n.separator&&(nt(s,"data-action",r),n.title&&nt(s,"title",n.title),n.className&&FM(s,n.className),n.imageUrl)){var c=ue("");nt(c,"src",n.imageUrl),s.appendChild(c)}}),this.open()};ot.prototype.trigger=function(e,t,n){var r,i,o=t.delegateTarget||t.target;return o?(r=nt(o,"data-action"),i=t.originalEvent||t,this.triggerEntry(r,e,i,n)):t.preventDefault()};ot.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(Le(a)){if(t==="click")return a(n,r)}else if(a[t])return a[t](n,r);n.preventDefault()}};ot.prototype._layoutChanged=function(){this._toggleState({})};ot.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 sx={__depends__:[fi,pr],__init__:["lassoTool"],lassoTool:["type",vr]};var vd=1500,ux="grab";function vi(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(Tr(c))return a.activateMove(c.originalEvent,!0),!1}),s&&s.addListener(vd,function(c){if(!(!cx(c.keyEvent)||a.isActive())){var u=a._mouse.getLastMoveEvent();a.activateMove(u,!!u)}},"keyboard.keydown"),s&&s.addListener(vd,function(c){!cx(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!Tr(c)&&p&&e.once("hand.move.ended",function(l){a.activateHand(l.originalEvent,!0,!0)}),!1})}vi.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"];vi.prototype.activateMove=function(e,t,n){typeof t=="object"&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:ux,data:{context:n||{}}})};vi.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:ux,data:{context:{reactivate:n}}})};vi.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)};vi.prototype.isActive=function(){var e=this._dragging.context();return e?/^(hand|hand\.move)$/.test(e.prefix):!1};function cx(e){return Ke("Space",e)}var px={__depends__:[fi,pr],__init__:["handTool"],handTool:["type",vi]};var lx="connect-ok",fx="connect-not-ok";function gi(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?lx:fx))}),e.on(["global-connect.out","global-connect.cleanup"],function(c){var u=c.context.startTarget,p=c.context.canStartConnect;u&&r.removeMarker(u,p?lx:fx)}),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})}gi.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"];gi.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})};gi.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)};gi.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)};gi.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};var dx={__depends__:[Lo,Et,kt,fi,pr],globalConnect:["type",gi]};N();function sc(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)}sc.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"];sc.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,g){function v(w){var S=n.createShape(C({type:l},g));t.start(w,S)}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 mx={__depends__:[rx,li,Np,sx,px,dx,Zr],__init__:["paletteProvider"],paletteProvider:["type",sc]};N();var zM=250;function cc(e,t,n,r,i){k.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=_e('[data-element-id="'+Rr(f.id)+'"]',s.dragGroup);m&&$(m,{display:"none"});var g=i.addDragger(d,s.dragGroup);s.visualReplacements[p]=g,r.removeShape(d)}})}function a(s){var c=s.visualReplacements;E(c,function(u,p){var l=_e('[data-element-id="'+Rr(p)+'"]',s.dragGroup);l&&$(l,{display:"inline"}),u.remove(),c[p]&&delete c[p]})}e.on("shape.move.move",zM,function(s){var c=s.context,u=c.canExecute;c.visualReplacements||(c.visualReplacements={}),u&&u.replacements?o(c):a(c)})}cc.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"];B(cc,k);var hx={__depends__:[Dn],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",cc]};N();var GM=1250,gd=40,VM=20,WM=10,vx=20,yx=["x","y"],UM=Math.abs;function sl(e){e.on(["connect.hover","connect.move","connect.end"],GM,function(t){var n=t.context,r=n.canExecute,i=n.start,o=n.hover,a=n.source,s=n.target;t.originalEvent&&xt(t.originalEvent)||(n.initialConnectionStart||(n.initialConnectionStart=n.connectionStart),r&&o&&qM(t,o,ZM(o)),o&&XM(r,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(n.connectionStart=rn(i),te(o,["bpmn:Event","bpmn:Gateway"])&&gx(t,rn(o)),te(o,["bpmn:Task","bpmn:SubProcess"])&&KM(t,o),h(a,"bpmn:BoundaryEvent")&&s===a.host&&YM(t)):_x(r,"bpmn:MessageFlow")?(h(i,"bpmn:Event")&&(n.connectionStart=rn(i)),h(o,"bpmn:Event")&&gx(t,rn(o))):n.connectionStart=n.initialConnectionStart)})}sl.$inject=["eventBus"];function qM(e,t,n){yx.forEach(function(r){var i=bx(r,t);e[r]t[r]+i-n&&ze(e,r,t[r]+i-n)})}function KM(e,t){var n=rn(t);yx.forEach(function(r){QM(e,t,r)&&ze(e,r,n[r])})}function YM(e){var t=e.context,n=t.source,r=t.target;if(!JM(t)){var i=rn(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;UM(c-i[s])i[s]?u=i[s]+gd:u=i[s]-gd,ze(e,s,u))})}}function gx(e,t){ze(e,"x",t.x),ze(e,"y",t.y)}function _x(e,t){return e&&e.type===t}function XM(e,t){return Lt(t,function(n){return _x(e,n)})}function bx(e,t){return e==="x"?t.width:t.height}function ZM(e){return h(e,"bpmn:Task")?WM:VM}function QM(e,t,n){return e[n]>t[n]+vx&&e[n]=e.x||i&&i<=e.x)&&ze(e,"x",e.x),(r&&r>=e.y||o&&o<=e.y)&&ze(e,"y",e.y)}}function Ex(e,t){return e.indexOf(t)!==-1}function wx(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}N();var aD=1250;function ao(e,t){var n=this;e.on(["resize.start"],function(r){n.initSnap(r)}),e.on(["resize.move","resize.end"],aD,function(r){var i=r.context,o=i.shape,a=o.parent,s=i.direction,c=i.snapContext;if(!(r.originalEvent&&xt(r.originalEvent))&&!zn(r)){var u=c.pointsForTarget(a);u.initialized||(u=n.addSnapTargetPoints(u,o,a,s),u.initialized=!0),uD(s)&&ze(r,"x",r.x),pD(s)&&ze(r,"y",r.y),t.snap(r,u)}}),e.on(["resize.cleanup"],function(){t.hide()})}ao.prototype.initSnap=function(e){var t=e.context,n=t.shape,r=t.direction,i=t.snapContext;i||(i=t.snapContext=new Kn);var o=Sx(n,r);return i.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),i};ao.prototype.addSnapTargetPoints=function(e,t,n,r){var i=this.getSnapTargets(t,n);return E(i,function(o){e.add("corner",$u(o)),e.add("corner",Hu(o))}),e.add("corner",Sx(t,r)),e};ao.$inject=["eventBus","snapping"];ao.prototype.getSnapTargets=function(e,t){return zu(t).filter(function(n){return!sD(n,e)&&!de(n)&&!cD(n)&&!ee(n)})};function Sx(e,t){var n=X(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 sD(e,t){return e.host===t}function cD(e){return!!e.hidden}function uD(e){return e==="n"||e==="s"}function pD(e){return e==="e"||e==="w"}N();var lD=7,fD=1e3;function gr(e){this._canvas=e,this._asyncHide=Ca(tt(this.hide,this),fD)}gr.$inject=["canvas"];gr.prototype.snap=function(e,t){var n=e.context,r=n.snapContext,i=r.getSnapLocations(),o={x:zn(e,"x"),y:zn(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,lD),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];Se(s)&&ze(e,a,s.originValue)})};gr.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=U("path");return $(n,{d:"M0,0 L0,0"}),pe(n).add("djs-snap-line"),J(t,n),{update:function(r){ne(r)?e==="horizontal"?$(n,{d:"M-100000,"+r+" L+100000,"+r,display:""}):$(n,{d:"M "+r+",-100000 L "+r+", +100000",display:""}):$(n,{display:"none"})}}};gr.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}};gr.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()};gr.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]};gr.prototype.hide=function(){E(this._snapLines,function(e){e.update()})};var Cx={__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",bn],resizeSnapping:["type",ao],snapping:["type",gr]};var Rx={__depends__:[Cx],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",sl],createMoveSnapping:["type",yi]};var Ax=300;function fe(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=_e(fe.INPUT_SELECTOR,this._container),this._resultsContainer=_e(fe.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy","drag.init","elements.changed"],this.close,this)}fe.$inject=["canvas","eventBus","selection","translate"];fe.prototype._bindEvents=function(){var e=this;function t(n,r,i,o){e._eventMaps.push({el:n,type:i,listener:bt.bind(n,r,i,o)})}t(document,"html","click",function(n){e.close(!1)}),t(this._container,fe.INPUT_SELECTOR,"click",function(n){n.stopPropagation(),n.delegateTarget.focus()}),t(this._container,fe.RESULT_SELECTOR,"mouseover",function(n){n.stopPropagation(),e._scrollToNode(n.delegateTarget),e._preselect(n.delegateTarget)}),t(this._container,fe.RESULT_SELECTOR,"click",function(n){n.stopPropagation(),e._select(n.delegateTarget)}),t(this._container,fe.INPUT_SELECTOR,"keydown",function(n){Ke("ArrowUp",n)&&n.preventDefault(),Ke("ArrowDown",n)&&n.preventDefault()}),t(this._container,fe.INPUT_SELECTOR,"keyup",function(n){if(Ke("Escape",n))return e.close();if(Ke("Enter",n)){var r=e._getCurrentResult();return r?e._select(r):e.close(!1)}if(Ke("ArrowUp",n))return e._scrollToDirection(!0);if(Ke("ArrowDown",n))return e._scrollToDirection();Ke(["ArrowLeft","ArrowRight"],n)||e._search(n.delegateTarget.value)})};fe.prototype._unbindEvents=function(){this._eventMaps.forEach(function(e){bt.unbind(e.el,e.type,e.listener)})};fe.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=_e(fe.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(r),this._preselect(r)}};fe.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}};fe.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&&Px(n,e.primaryTokens,fe.RESULT_PRIMARY_HTML),Px(n,e.secondaryTokens,fe.RESULT_SECONDARY_HTML),nt(n,fe.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n};fe.prototype.registerProvider=function(e){this._searchProvider=e};fe.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,Ne(this._canvas.getContainer()).add("djs-search-open"),Ne(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))};fe.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,Ne(this._canvas.getContainer()).remove("djs-search-open"),Ne(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._eventBus.fire("searchPad.closed"),this._canvas.restoreFocus())};fe.prototype.toggle=function(){this.isOpen()?this.close():this.open()};fe.prototype.isOpen=function(){return this._open};fe.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&Ne(t).remove(fe.RESULT_SELECTED_CLASS);var n=nt(e,fe.RESULT_ID_ATTRIBUTE),r=this._results[n].element;Ne(e).add(fe.RESULT_SELECTED_CLASS),this._canvas.scrollToElement(r,{top:Ax}),this._selection.select(r),this._eventBus.fire("searchPad.preselected",r)}};fe.prototype._select=function(e){var t=nt(e,fe.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this._cachedSelection=null,this._cachedViewbox=null,this.close(!1),this._canvas.scrollToElement(n,{top:Ax}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)};fe.prototype._getBoxHtml=function(){let e=ue(fe.BOX_HTML),t=_e(fe.INPUT_SELECTOR,e);return t&&t.setAttribute("aria-label",this._translate("Search in diagram")),e};function Px(e,t,n){var r=dD(t),i=ue(n);i.innerHTML=r,e.appendChild(i)}function dD(e){var t="";return e.forEach(function(n){var r=Hn(n.value||n.matched||n.normal),i=n.match||n.matched;i?t+=''+r+"":t+=r}),t!==""?t:null}fe.CONTAINER_SELECTOR=".djs-search-container";fe.INPUT_SELECTOR=".djs-search-input input";fe.RESULTS_CONTAINER_SELECTOR=".djs-search-results";fe.RESULT_SELECTOR=".djs-search-result";fe.RESULT_SELECTED_CLASS="djs-search-result-selected";fe.RESULT_SELECTED_SELECTOR="."+fe.RESULT_SELECTED_CLASS;fe.RESULT_ID_ATTRIBUTE="data-result-id";fe.RESULT_HIGHLIGHT_CLASS="djs-search-highlight";fe.BOX_HTML=`
      @@ -287,4 +287,42 @@
      -
      `;ue.RESULT_HTML='
      ';ue.RESULT_PRIMARY_HTML='
      ';ue.RESULT_SECONDARY_HTML='

      ';var Mx={__depends__:[zr,Vr,Qe],searchPad:["type",ue]};function Xs(e,t,n,r){this._elementRegistry=e,this._canvas=n,this._search=r,t.registerProvider(this)}Xs.$inject=["elementRegistry","searchPad","canvas","search"];Xs.prototype.find=function(e){var t=this._canvas.getRootElements(),n=this._elementRegistry.filter(function(r){return!J(r)&&!t.includes(r)});return this._search(n.map(r=>({element:r,label:pt(r),id:r.id})),e,{keys:["label","id"]}).map(eT)};function eT(e){let{item:{element:t},tokens:n}=e;return{element:t,primaryTokens:n.label,secondaryTokens:n.id}}var Dx={__depends__:[Mx,sp],__init__:["bpmnSearch"],bpmnSearch:["type",Xs]};var kx="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",Nx="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",Ox={width:36,height:50},Bx={width:50,height:50};function Xf(e,t,n){return G("path",{d:e,strokeWidth:2,transform:`translate(${t.x}, ${t.y})`,...n})}var wn=5;function la(e,t){this._styles=t,e.registerProvider(this)}la.$inject=["outline","styles"];la.prototype.getOutline=function(e){let t=this._styles.cls("djs-outline",["no-fill"]);var n;if(Sh(e))return n=G("rect"),H(n,S({x:-wn,y:-wn,rx:4,width:e.width+wn*2,height:e.height+wn*2},t)),n;if(!J(e))return m(e,"bpmn:Gateway")?(n=G("rect"),S(n.style,{"transform-box":"fill-box",transform:"rotate(45deg)","transform-origin":"center"}),H(n,S({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=G("rect"),H(n,S({x:-wn,y:-wn,rx:14,width:e.width+wn*2,height:e.height+wn*2},t))):m(e,"bpmn:EndEvent")?(n=G("circle"),H(n,S({cx:e.width/2,cy:e.height/2,r:e.width/2+wn+1},t))):m(e,"bpmn:Event")?(n=G("circle"),H(n,S({cx:e.width/2,cy:e.height/2,r:e.width/2+wn},t))):m(e,"bpmn:DataObjectReference")&&Ix(e,"bpmn:DataObjectReference")?n=Xf(kx,{x:-6,y:-6},t):m(e,"bpmn:DataStoreReference")&&Ix(e,"bpmn:DataStoreReference")&&(n=Xf(Nx,{x:-6,y:-6},t)),n};la.prototype.updateOutline=function(e,t){if(!J(e))return ee(e,["bpmn:SubProcess","bpmn:Group"])?(H(t,{width:e.width+wn*2,height:e.height+wn*2}),!0):!!ee(e,["bpmn:Event","bpmn:Gateway","bpmn:DataStoreReference","bpmn:DataObjectReference"])};function Ix(e,t){var n;return t==="bpmn:DataObjectReference"?n=Ox:t==="bpmn:DataStoreReference"&&(n=Bx),e.width===n.width&&e.height===n.height}var Lx={__depends__:[ua],__init__:["outlineProvider"],outlineProvider:["type",la]};var tT='';function Wt(e){vi.call(this,e)}N(Wt,vi);Wt.Viewer=cn;Wt.NavigatedViewer=xr;Wt.prototype.createDiagram=function(){return this.importXML(tT)};Wt.prototype._interactionModules=[Hc,Wc,Gc];Wt.prototype._modelingModules=[Xm,So,ig,eg,wg,Po,Rg,m_,uu,ni,y_,b_,A_,T_,M_,B_,z_,G_,Cu,Y_,ex,mx,gx,ju,Ax,Dx,Lx];Wt.prototype._modules=[].concat(cn.prototype._modules,Wt.prototype._interactionModules,Wt.prototype._modelingModules);var nT=globalThis;Object.assign(Wt,{Modeler:Wt,NavigatedViewer:xr,Viewer:cn});nT.BpmnJS=Wt;var TX=Wt;})(); +
      `;fe.RESULT_HTML='
      ';fe.RESULT_PRIMARY_HTML='
      ';fe.RESULT_SECONDARY_HTML='

      ';var Tx={__depends__:[Zr,Qr,rt],searchPad:["type",fe]};function uc(e,t,n,r){this._elementRegistry=e,this._canvas=n,this._search=r,t.registerProvider(this)}uc.$inject=["elementRegistry","searchPad","canvas","search"];uc.prototype.find=function(e){var t=this._canvas.getRootElements(),n=this._elementRegistry.filter(function(r){return!ee(r)&&!t.includes(r)});return this._search(n.map(r=>({element:r,label:gt(r),id:r.id})),e,{keys:["label","id"]}).map(mD)};function mD(e){let{item:{element:t},tokens:n}=e;return{element:t,primaryTokens:n.label,secondaryTokens:n.id}}var Mx={__depends__:[Tx,xu],__init__:["bpmnSearch"],bpmnSearch:["type",uc]};N();var Dx="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",kx="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",Nx={width:36,height:50},Ox={width:50,height:50};function yd(e,t,n){return U("path",{d:e,strokeWidth:2,transform:`translate(${t.x}, ${t.y})`,...n})}var Nn=5;function ba(e,t){this._styles=t,e.registerProvider(this)}ba.$inject=["outline","styles"];ba.prototype.getOutline=function(e){let t=this._styles.cls("djs-outline",["no-fill"]);var n;if(wh(e))return n=U("rect"),$(n,C({x:-Nn,y:-Nn,rx:4,width:e.width+Nn*2,height:e.height+Nn*2},t)),n;if(!ee(e))return h(e,"bpmn:Gateway")?(n=U("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))):te(e,["bpmn:Task","bpmn:SubProcess","bpmn:Group","bpmn:CallActivity"])?(n=U("rect"),$(n,C({x:-Nn,y:-Nn,rx:14,width:e.width+Nn*2,height:e.height+Nn*2},t))):h(e,"bpmn:EndEvent")?(n=U("circle"),$(n,C({cx:e.width/2,cy:e.height/2,r:e.width/2+Nn+1},t))):h(e,"bpmn:Event")?(n=U("circle"),$(n,C({cx:e.width/2,cy:e.height/2,r:e.width/2+Nn},t))):h(e,"bpmn:DataObjectReference")&&Bx(e,"bpmn:DataObjectReference")?n=yd(Dx,{x:-6,y:-6},t):h(e,"bpmn:DataStoreReference")&&Bx(e,"bpmn:DataStoreReference")&&(n=yd(kx,{x:-6,y:-6},t)),n};ba.prototype.updateOutline=function(e,t){if(!ee(e))return te(e,["bpmn:SubProcess","bpmn:Group"])?($(t,{width:e.width+Nn*2,height:e.height+Nn*2}),!0):!!te(e,["bpmn:Event","bpmn:Gateway","bpmn:DataStoreReference","bpmn:DataObjectReference"])};function Bx(e,t){var n;return t==="bpmn:DataObjectReference"?n=Nx:t==="bpmn:DataStoreReference"&&(n=Ox),e.width===n.width&&e.height===n.height}var Ix={__depends__:[_a],__init__:["outlineProvider"],outlineProvider:["type",ba]};var hD='';function zt(e){Ai.call(this,e)}B(zt,Ai);zt.Viewer=nn;zt.NavigatedViewer=sr;zt.prototype.createDiagram=function(){return this.importXML(hD)};zt.prototype._interactionModules=[eu,iu,ou];zt.prototype._modelingModules=[Yv,No,rg,Jv,Eg,Lo,Cg,mb,Sp,li,gb,bb,Rb,Ab,Tb,Ob,$b,Vb,Fp,qb,Jb,mx,hx,Qp,Rx,Mx,Ix];zt.prototype._modules=[].concat(nn.prototype._modules,zt.prototype._interactionModules,zt.prototype._modelingModules);var Kx=YE(Wx());N();function Yx(e,t){var n=e.get("editorActions",!1);n&&n.register({toggleLinting:function(){t.toggle()}})}Yx.$inject=["injector","linting"];var Xx=` + + + +`,Zx=` + + +`,Ux=` + + + +`,Qx=` + +`,PD=-7,AD=-7,TD=500,qx={resolver:{resolveRule:function(){return null}},config:{}},Jx={error:Xx,warning:Zx,success:Ux,info:Qx,inactive:Ux};function ct(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=qx,this._overlayIds={};var s=this;i.on(["import.done","elements.changed","linting.configChanged","linting.toggle"],TD,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()===qx)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()}ct.prototype.setLinterConfig=function(e){if(!e.config||!e.resolver)throw new Error("Expected linterConfig = { config, resolver }");this._linterConfig=e,this._eventBus.fire("linting.configChanged")};ct.prototype.getLinterConfig=function(){return this._linterConfig};ct.prototype._init=function(){this._createButton(),this._updateButton()};ct.prototype.isActive=function(){return this._active};ct.prototype._formatIssues=function(e){let t=this,n=Ge(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=je(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=Vt(n,function(o){return o.id}),n};ct.prototype.toggle=function(e){return e=typeof e=="undefined"?!this.isActive():e,this._setActive(e),e};ct.prototype._setActive=function(e){this._active!==e&&(this._active=e,this._eventBus.fire("linting.toggle",{active:e}))};ct.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)}})}};ct.prototype._fireComplete=function(e){this._eventBus.fire("linting.completed",{issues:e})};ct.prototype._createIssues=function(e){for(var t in e)this._createElementIssues(t,e[t])};ct.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:PD,left:AD});var s=Vt(t,function(L){return(L.isChildIssue?"child":"")+L.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('
      '),g=c||l?ue('
      '+Xx+"
      "):u||f?ue('
      '+Zx+"
      "):ue('
      '+Qx+"
      "),v=ue('
      '),w=ue('
      '),S=ue('
      '),x=ue('
      '),b=ue("
        ");if(m.appendChild(g),m.appendChild(v),v.appendChild(w),w.appendChild(S),S.appendChild(x),x.appendChild(b),c&&this._addErrors(b,c),u&&this._addWarnings(b,u),p&&this._addInfos(b,p),l||f||d){var R=ue('
        '),A=ue("
          "),O=this._translate("Issues for child elements"),T=ue(''+O+":");if(l&&this._addErrors(A,l),f&&this._addWarnings(A,f),d&&this._addInfos(A,d),c||u){var I=ue("
          ");R.appendChild(I)}R.appendChild(T),R.appendChild(A),S.appendChild(R)}this._overlayIds[e]=this._overlays.add(n,"linting",{position:o,html:m,scale:{min:.7}})}}};ct.prototype._addErrors=function(e,t){var n=this;t.forEach(function(r){n._addEntry(e,"error",r)})};ct.prototype._addWarnings=function(e,t){var n=this;t.forEach(function(r){n._addEntry(e,"warning",r)})};ct.prototype._addInfos=function(e,t){var n=this;t.forEach(function(r){n._addEntry(e,"info",r)})};ct.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=Jx[t],c=ue(` +
        • + ${s} + ${Hn(o)} + (${i?`${Hn(r)}`:Hn(r)}) + ${a?`${Hn(a)}`:""} +
        • + `);e.appendChild(c)};ct.prototype._clearOverlays=function(){this._overlays.remove({type:"linting"}),this._overlayIds={}};ct.prototype._clearIssues=function(){this._issues={},this._clearOverlays()};ct.prototype._setButtonState=function(e){var{errors:t,warnings:n,infos:r}=e,i=this._button,o=t&&"error"||n&&"warning"||"success",a=Jx[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};ct.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})};ct.prototype._createButton=function(){var e=this;this._button=ue(''),this._button.addEventListener("click",function(){e.toggle()}),this._canvas.getContainer().appendChild(this._button)};ct.prototype.lint=function(){var e=this._bpmnjs.getDefinitions(),t=new Kx.Linter(this._linterConfig);return t.lint(e)};ct.$inject=["bpmnjs","canvas","config.linting","elementRegistry","eventBus","overlays","translate"];var bd={__init__:["linting","lintingEditorActions"],linting:["type",ct],lintingEditorActions:["type",Yx]};/*! generated from .bpmnlintrc for dokuwiki-plugin-bpmnio — do not edit by hand */function Je(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function RE(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 PE(e,t){return t.indexOf(":")===-1&&(t="bpmn:"+t),typeof e.$instanceOf=="function"?e.$instanceOf(t):e.$type===t}function MD(e,t){return t.some(function(n){return PE(e,n)})}var DD=Object.freeze({__proto__:null,is:PE,isAny:MD}),ut=RE(DD),xa={},eE;function et(){if(eE)return xa;eE=1;let{is:e}=ut;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})}}xa.checkDiscouragedNodeType=t;function n(a,s){if(!a)return null;let c=a.$parent;return c?e(c,s)?c:n(c,s):a}xa.findParent=n;function r(a){let s=n(a,"bpmn:Process");return s&&s.isExecutable}xa.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 xa.annotateRule=o,xa}var xd,tE;function kD(){if(tE)return xd;tE=1;let{is:e}=ut,{annotateRule:t}=et();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 ND=kD(),OD=Je(ND),Ed,nE;function BD(){if(nE)return Ed;nE=1;let{annotateRule:e}=et();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 ID=BD(),LD=Je(ID),wd,rE;function jD(){if(rE)return wd;rE=1;let{is:e,isAny:t}=ut,{annotateRule:n}=et();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 FD=jD(),HD=Je(FD),Sd,iE;function $D(){if(iE)return Sd;iE=1;let{is:e}=ut,{annotateRule:t}=et();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 zD=$D(),GD=Je(zD),Cd,oE;function VD(){if(oE)return Cd;oE=1;let{is:e}=ut,{annotateRule:t}=et();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 WD=VD(),UD=Je(WD),Rd,aE;function qD(){if(aE)return Rd;aE=1;let{isAny:e}=ut,{annotateRule:t}=et();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 KD=qD(),YD=Je(KD),Pd,sE;function XD(){if(sE)return Pd;sE=1;let{is:e,isAny:t}=ut,{annotateRule:n}=et();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 ZD=XD(),QD=Je(ZD),Ad,cE;function JD(){if(cE)return Ad;cE=1;let{is:e,isAny:t}=ut,{annotateRule:n}=et();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 e2=JD(),t2=Je(e2);function n2(e){return Array.prototype.concat.apply([],e)}var pc=Object.prototype.toString,r2=Object.prototype.hasOwnProperty;function Ea(e){return e===void 0}function AE(e){return e!==void 0}function pl(e){return e==null}function ll(e){return pc.call(e)==="[object Array]"}function ul(e){return pc.call(e)==="[object Object]"}function i2(e){return pc.call(e)==="[object Number]"}function Ud(e){let t=pc.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function o2(e){return pc.call(e)==="[object String]"}function TE(e){if(!ll(e))throw new Error("must supply array")}function ME(e,t){return!pl(e)&&r2.call(e,t)}function DE(e,t){let n=dl(t),r;return Qt(e,function(i,o){if(n(i,o))return r=i,!1}),r}function a2(e,t){let n=dl(t),r=ll(e)?-1:void 0;return Qt(e,function(i,o){if(n(i,o))return r=o,!1}),r}function s2(e,t){let n=dl(t),r=[];return Qt(e,function(i,o){n(i,o)&&r.push(i)}),r}function Qt(e,t){let n,r;if(Ea(e))return;let i=ll(e)?v2:h2;for(let o in e)if(ME(e,o)&&(n=e[o],r=t(n,i(o)),r===!1))return n}function c2(e,t){if(Ea(e))return[];TE(e);let n=dl(t);return e.filter(function(r,i){return!n(r,i)})}function kE(e,t,n){return Qt(e,function(r,i){n=t(n,r,i)}),n}function NE(e,t){return!!kE(e,function(n,r,i){return n&&t(r,i)},!0)}function u2(e,t){return!!DE(e,t)}function fl(e,t){let n=[];return Qt(e,function(r,i){n.push(t(r,i))}),n}function OE(e){return e&&Object.keys(e)||[]}function p2(e){return OE(e).length}function l2(e){return fl(e,t=>t)}function BE(e,t,n={}){return t=qd(t),Qt(e,function(r){let i=t(r)||"_",o=n[i];o||(o=n[i]=[]),o.push(r)}),n}function IE(e,...t){e=qd(e);let n={};return Qt(t,i=>BE(i,e,n)),fl(n,function(i,o){return i[0]})}var f2=IE;function d2(e,t){t=qd(t);let n=[];return Qt(e,function(r,i){let o=t(r,i),a={d:o,v:r};for(var s=0;sr.v)}function m2(e){return function(t){return NE(e,function(n,r){return t[r]===n})}}function qd(e){return Ud(e)?e:t=>t[e]}function dl(e){return Ud(e)?e:t=>t===e}function h2(e){return e}function v2(e){return Number(e)}function g2(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 y2(e,t){let n=!1;return function(...r){n||(e(...r),n=!0,setTimeout(()=>{n=!1},t))}}function _2(e,t){return e.bind(t)}function b2(e,...t){return Object.assign(e,...t)}function x2(e,t,n){let r=e;return Qt(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];AE(a)&&pl(s)&&(s=r[i]=isNaN(+a)?{}:[]),Ea(a)?Ea(n)?delete r[i]:r[i]=n:r=s}),e}function E2(e,t,n){let r=e;return Qt(t,function(i){if(pl(r))return r=void 0,!1;r=r[i]}),Ea(r)?n:r}function w2(e,t){let n={},r=Object(e);return Qt(t,function(i){i in r&&(n[i]=e[i])}),n}function S2(e,t){let n={},r=Object(e);return Qt(r,function(i,o){t.indexOf(o)===-1&&(n[o]=i)}),n}function LE(e,...t){return t.length&&Qt(t,function(n){!n||!ul(n)||Qt(n,function(r,i){if(i==="__proto__")return;let o=e[i];ul(r)?(ul(o)||(o={}),e[i]=LE(o,r)):e[i]=r})}),e}var C2=Object.freeze({__proto__:null,assign:b2,bind:_2,debounce:g2,ensureArray:TE,every:NE,filter:s2,find:DE,findIndex:a2,flatten:n2,forEach:Qt,get:E2,groupBy:BE,has:ME,isArray:ll,isDefined:AE,isFunction:Ud,isNil:pl,isNumber:i2,isObject:ul,isString:o2,isUndefined:Ea,keys:OE,map:fl,matchPattern:m2,merge:LE,omit:S2,pick:w2,reduce:kE,set:x2,size:p2,some:u2,sortBy:d2,throttle:y2,unionBy:f2,uniqueBy:IE,values:l2,without:c2}),jE=RE(C2),Td,uE;function R2(){if(uE)return Td;uE=1;let{groupBy:e}=jE,{is:t}=ut,{annotateRule:n}=et();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 g=d[0];u.report(g.id,`Link ${o(g)?"catch":"throw"} event with link name <${f}> missing in scope`);continue}let m=d.filter(a);if(m.length>1)for(let g of m)u.report(g.id,`Duplicate link catch event with link name <${f}> in scope`);else if(m.length===0)for(let g of d)u.report(g.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 P2=R2(),A2=Je(P2),Md,pE;function T2(){if(pE)return Md;pE=1;let{is:e}=ut,{flatten:t}=jE,{annotateRule:n}=et();Md=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 Md}var M2=T2(),D2=Je(M2),Dd,lE;function k2(){if(lE)return Dd;lE=1;let e=et().checkDiscouragedNodeType;return Dd=e("bpmn:ComplexGateway","no-complex-gateway"),Dd}var N2=k2(),O2=Je(N2),kd,fE;function B2(){if(fE)return kd;fE=1;let{isAny:e,is:t}=ut,{annotateRule:n}=et();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 I2=B2(),L2=Je(I2),Nd,dE;function j2(){if(dE)return Nd;dE=1;let{is:e}=ut,{annotateRule:t}=et();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 F2=j2(),H2=Je(F2),Od,mE;function $2(){if(mE)return Od;mE=1;let{is:e}=ut,{annotateRule:t}=et();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 z2=$2(),G2=Je(z2),Bd,hE;function V2(){if(hE)return Bd;hE=1;let{isAny:e}=ut,{annotateRule:t}=et();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 W2=V2(),U2=Je(W2),Id,vE;function q2(){if(vE)return Id;vE=1;let{is:e,isAny:t}=ut,{findParent:n,annotateRule:r}=et();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 K2=q2(),Y2=Je(K2),Ld,gE;function X2(){if(gE)return Ld;gE=1;let{is:e,isAny:t}=ut,{annotateRule:n}=et();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 Z2=X2(),Q2=Je(Z2),jd,yE;function J2(){if(yE)return jd;yE=1;let e=et().checkDiscouragedNodeType;return jd=e("bpmn:InclusiveGateway","no-inclusive-gateway"),jd}var ek=J2(),tk=Je(ek),Fd,_E;function nk(){if(_E)return Fd;_E=1;let{is:e}=ut,{annotateRule:t}=et();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),g=new Map;l.filter(v=>e(v,"bpmn:Collaboration")).forEach(v=>{let w=v.participants||[];r(w,f,m),w.forEach(S=>{g.set(S.processRef,m.get(S))})}),l.filter(v=>e(v,"bpmn:Process")).forEach(v=>{let w=g.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)||{},S=w.isExpanded?w:{};n(v,u,p,l,S)})}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 rk=nk(),ik=Je(rk),Hd,bE;function ok(){if(bE)return Hd;bE=1;let{is:e}=ut,{annotateRule:t}=et();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 ak=ok(),sk=Je(ak),$d,xE;function ck(){if(xE)return $d;xE=1;let{is:e}=ut,{annotateRule:t}=et();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 uk=ck(),pk=Je(uk),zd,EE;function lk(){if(EE)return zd;EE=1;let{is:e,isAny:t}=ut,{annotateRule:n}=et();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 fk=lk(),dk=Je(fk),Gd,wE;function mk(){if(wE)return Gd;wE=1;let{is:e}=ut,{annotateRule:t}=et();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 hk=mk(),vk=Je(hk),Vd,SE;function gk(){if(SE)return Vd;SE=1;let{is:e}=ut,{annotateRule:t}=et();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 yk=gk(),_k=Je(yk),Wd,CE;function bk(){if(CE)return Wd;CE=1;let{is:e,isAny:t}=ut,{annotateRule:n}=et();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 xk=bk(),Ek=Je(xk),Xe={};function Kd(){}Kd.prototype.resolveRule=function(e,t){let n=Xe[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 FE=new Kd,wk={"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"},HE={rules:wk};Xe["bpmnlint/ad-hoc-sub-process"]=OD;Xe["bpmnlint/conditional-flows"]=LD;Xe["bpmnlint/end-event-required"]=HD;Xe["bpmnlint/event-based-gateway"]=GD;Xe["bpmnlint/event-sub-process-typed-start-event"]=UD;Xe["bpmnlint/fake-join"]=YD;Xe["bpmnlint/global"]=QD;Xe["bpmnlint/label-required"]=t2;Xe["bpmnlint/link-event"]=A2;Xe["bpmnlint/no-bpmndi"]=D2;Xe["bpmnlint/no-complex-gateway"]=O2;Xe["bpmnlint/no-disconnected"]=L2;Xe["bpmnlint/no-duplicate-sequence-flows"]=H2;Xe["bpmnlint/no-gateway-join-fork"]=G2;Xe["bpmnlint/no-implicit-split"]=U2;Xe["bpmnlint/no-implicit-end"]=Y2;Xe["bpmnlint/no-implicit-start"]=Q2;Xe["bpmnlint/no-inclusive-gateway"]=tk;Xe["bpmnlint/no-overlapping-elements"]=ik;Xe["bpmnlint/single-blank-start-event"]=sk;Xe["bpmnlint/single-event-definition"]=pk;Xe["bpmnlint/start-event-required"]=dk;Xe["bpmnlint/sub-process-blank-start-event"]=vk;Xe["bpmnlint/superfluous-gateway"]=_k;Xe["bpmnlint/superfluous-termination"]=Ek;var Yd=globalThis;Object.assign(zt,{Modeler:zt,NavigatedViewer:sr,Viewer:nn});Yd.BpmnJS=zt;var $E={config:HE,resolver:FE};Yd.BpmnLintModule=bd;Yd.BpmnLintConfig=$E;for(let e of[zt,sr,nn])e.lintModule=bd,e.lintConfig=$E;var cte=zt;})(); diff --git a/vendor/bpmn-js/dist/bpmn-viewer.production.min.js b/vendor/bpmn-js/dist/bpmn-viewer.production.min.js index 03d7f4e..1e75b91 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.18.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 Wt=Object.prototype.toString,wo=Object.prototype.hasOwnProperty;function er(e){return e===void 0}function Et(e){return e!==void 0}function Vr(e){return e==null}function ye(e){return Wt.call(e)==="[object Array]"}function Ae(e){return Wt.call(e)==="[object Object]"}function Te(e){return Wt.call(e)==="[object Number]"}function it(e){let t=Wt.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function ke(e){return Wt.call(e)==="[object String]"}function ot(e,t){return!Vr(e)&&wo.call(e,t)}function he(e,t){let r=zr(t),n;return R(e,function(i,o){if(r(i,o))return n=i,!1}),n}function Tn(e,t){let r=zr(t),n=ye(e)?-1:void 0;return R(e,function(i,o){if(r(i,o))return n=o,!1}),n}function Ge(e,t){let r=zr(t),n=[];return R(e,function(i,o){r(i,o)&&n.push(i)}),n}function R(e,t){let r,n;if(er(e))return;let i=ye(e)?bo:_o;for(let o in e)if(ot(e,o)&&(r=e[o],n=t(r,i(o)),n===!1))return r}function Xe(e,t,r){return R(e,function(n,i){r=t(r,n,i)}),r}function Wr(e,t){return!!Xe(e,function(r,n,i){return r&&t(n,i)},!0)}function tr(e,t){return!!he(e,t)}function kn(e,t){let r=[];return R(e,function(n,i){r.push(t(n,i))}),r}function $r(e){return function(t){return Wr(e,function(r,n){return t[n]===r})}}function zr(e){return it(e)?e:t=>t===e}function _o(e){return e}function bo(e){return Number(e)}function Mn(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 Ue(e,t){return e.bind(t)}function T(e,...t){return Object.assign(e,...t)}function Dn(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)&&Vr(l)&&(l=n[i]=isNaN(+u)?{}:[]),er(u)?er(r)?delete n[i]:n[i]=r:n=l}),e}function Nn(e,t){let r={},n=Object(e);return R(t,function(i){i in n&&(r[i]=e[i])}),r}function Bn(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 On(e,t){return tr(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 Hr(e){if(!(!D(e,"bpmn:Participant")&&!D(e,"bpmn:Lane"))){var t=$e(e).isHorizontal;return t===void 0?!0:t}}function Ln(e){return e&&!!re(e).triggeredByEvent}function In(e){return Ae(e)&&ot(e,"waypoints")}function Ur(e){return Ae(e)&&ot(e,"labelTarget")}var Ct={width:90,height:20},Fn=15;function jn(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)i||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 rr(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function nr(e){return!!(e&&e.isFrame)}var ir=7;function ko(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch{}return e}function Hn(e,t){return t.appendChild(ko(e,t))}function ae(e,t){return Hn(t,e),e}var Yr=2,Un={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":Yr,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":Yr,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function Mo(e,t){return Un[t]?e.style[t]:e.getAttributeNS(null,t)}function qn(e,t,r){var n=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=Un[n];i?(i===Yr&&typeof r=="number"&&(r=String(r)+"px"),e.style[n]=r):e.setAttributeNS(null,t,r)}function Do(e,t){var r=Object.keys(t),n,i;for(n=0,i;i=r[n];n++)qn(e,i,t[i])}function Q(e,t,r){if(typeof t=="string")if(r!==void 0)qn(e,t,r);else return Mo(e,t);else Do(e,t);return e}var No=Object.prototype.toString;function Be(e){return new pt(e)}function pt(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}pt.prototype.add=function(e){return this.list.add(e),this};pt.prototype.remove=function(e){return No.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)};pt.prototype.removeMatching=function(e){let t=this.array();for(let r=0;r"+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=Kn(e).firstChild,r=document.importNode(r,!0)):r=document.createElementNS(Xr.svg,e),t&&Q(r,t),r}var qr=null;function Gr(){return qr===null&&(qr=J("svg")),qr}function $n(e,t){var r,n,i=Object.keys(t);for(r=0;n=i[r];r++)e[n]=t[n];return e}function Yn(e,t,r,n,i,o){var u=Gr().createSVGMatrix();switch(arguments.length){case 0:return u;case 1:return $n(u,e);case 6:return $n(u,{a:e,b:t,c:r,d:n,e:i,f:o})}}function Tt(e){return e?Gr().createSVGTransformFromMatrix(e):Gr().createSVGTransform()}var zn=/([&<>]{1})/g,Lo=/([&<>\n\r"]{1})/g,Io={"&":"&","<":"<",">":">",'"':"'"};function Kr(e,t){function r(n,i){return Io[i]||i}return e.replace(t,r)}function Gn(e,t){var r,n,i,o,u;switch(e.nodeType){case 3:t.push(Kr(e.textContent,zn));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=Kn(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 ur(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 bt(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},rn.exports}var ia=na(),oa=ra(ia);function Ze(e){if(!(this instanceof Ze))return new Ze(e);e=e||[128,36,1],this._seed=e.length?oa.rack(e[0],e[1],e[2]):e}Ze.prototype.next=function(e){return this._seed(e||!0)};Ze.prototype.nextPrefixed=function(e,t){var r;do r=e+this.next(!0);while(this.assigned(r));return this.claim(r,t),r};Ze.prototype.claim=function(e,t){this._seed.set(e,t||!0)};Ze.prototype.assigned=function(e){return this._seed.get(e)||!1};Ze.prototype.unclaim=function(e){delete this._seed.hats[e]};Ze.prototype.clear=function(){var e=this._seed.hats,t;for(t in e)this.unclaim(t)};var aa=new Ze,sa=10,hr=3,ua=1.5,dr=10,la=4,Bt=.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:ar,strokeWidth:2,fill:"white"})}function A(c){return r.computeStyle(c,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:ar,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=kt(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,T({"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 oi(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 k(c,s,a={},p){var h=re(c),y=Xn(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):qe(h,"bpmn:MessageEventDefinition")?v["bpmn:MessageEventDefinition"](s,w,a,y):qe(h,"bpmn:TimerEventDefinition")?v["bpmn:TimerEventDefinition"](s,w,a,y):qe(h,"bpmn:ConditionalEventDefinition")?v["bpmn:ConditionalEventDefinition"](s,w,a,y):qe(h,"bpmn:SignalEventDefinition")?v["bpmn:SignalEventDefinition"](s,w,a,y):qe(h,"bpmn:EscalationEventDefinition")?v["bpmn:EscalationEventDefinition"](s,w,a,y):qe(h,"bpmn:LinkEventDefinition")?v["bpmn:LinkEventDefinition"](s,w,a,y):qe(h,"bpmn:ErrorEventDefinition")?v["bpmn:ErrorEventDefinition"](s,w,a,y):qe(h,"bpmn:CancelEventDefinition")?v["bpmn:CancelEventDefinition"](s,w,a,y):qe(h,"bpmn:CompensateEventDefinition")?v["bpmn:CompensateEventDefinition"](s,w,a,y):qe(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)});pr(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||T(p,{compensation:p.compensation-18}));var w=h.get("loopCharacteristics"),O=w&&w.get("isSequential");w&&(T(p,{compensation:p.compensation-18}),a.includes("AdhocMarker")&&T(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&&T(p,{compensation:-8}),R(a,function(U){B(U,c,s,p)})}function N(c,s,a={}){a=T({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=Dt({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:Mt(s,d,f,p.stroke)}})}function Ye(c,s,a={}){var p={width:s.width,height:s.height,x:s.width/2+s.x,y:s.height/2+s.y};return N(c,Pt(s),{box:p,style:T({},o.getExternalStyle(),{fill:Mt(s,d,f,a.stroke)})})}function ie(c,s,a,p={}){var h=Hr(a),y=N(c,s,{box:{height:30,width:h?Se(a,p):Oe(a,p)},align:"center-middle",style:{fill:Mt(a,d,f,p.stroke)}});if(h){var w=-1*Se(a,p);fr(y,0,-w,270)}}function G(c,s,a={}){var{width:p,height:h}=Dt(s,a);return q(c,p,h,dr,{...a,fill:z(s,l,a.fill),fillOpacity:Bt,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:Bt,stroke:h}),O=re(s);if(Zn(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:Bt,...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:Bt,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||Bt,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(Ln(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}),k(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,hr,{...a,fill:"none"}),p&&k(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:C(s,f,a.stroke),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:Bt,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&&k(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,dr,{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,hr,{fill:"none",stroke:C(s,f,a.stroke),strokeWidth:1.5}),p&&k(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"),nt=N(c,te,{align:"center-top",fitBox:!0,style:{fill:w}}),Jt=de.getBBox(),Ne=nt.getBBox(),W=U.x-Ne.width/2,X=U.y+Jt.height/2+sa;fr(nt,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=Hr(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=Dt(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:Mt(s,d,f,a.stroke)}});if(!y){var de=-1*Se(s,a);fr(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&&k(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"]);var{width:p,height:h}=Dt(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:Dt(s,a),padding:ir,style:{fill:Mt(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),dr-hr,hr,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 Ye(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 Ur(e)?tn(e,la):D(e,"bpmn:Event")?Qn(e):D(e,"bpmn:Activity")?tn(e,dr):D(e,"bpmn:Gateway")?Jn(e):ei(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)?T({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}var nn=null;function ya(){return nn||(nn=document.createElement("canvas").getContext("2d")),nn}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(ui(e.fontSize)||"12px"),t.push(e.fontFamily||"sans-serif"),t.join(" ")}function ui(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=ui(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=40;function mr(e){var t=T({fontFamily:"Arial, sans-serif",fontSize:Aa,fontWeight:"normal",lineHeight:Sa},e&&e.defaultStyle||{}),r=parseInt(t.fontSize,10)-1,n=T({},t,{fontSize:r},e&&e.externalStyle||{}),i=new Ot({style:t});this.getExternalLabelBounds=function(u,l){var f={width:Math.max(u.width,Ct.width),height:30},d=o(l,f,{style:n});return{x:Math.round(u.x+u.width/2-d.width/2),y:u.y,width:Math.ceil(d.width),height:Math.ceil(d.height)}},this.getTextAnnotationBounds=function(u,l){var f=o(l,u,{style:t,align:"left-top",padding:ir});return{x:u.x,y:u.y,width:u.width,height:Math.max(Ra,Math.round(f.height))}},this.getDimensions=function(u,l){return i.getDimensions(u,l||{})};function o(u,l,f){return i.getDimensions(u,T({box:l},f))}this.createText=function(u,l){return i.createText(u,l||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return n}}mr.$inject=["config.textRenderer"];function on(){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 vr(e,t,r){return T({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?[gr(t),gr(r)]:n.map(function(i){return{x:i.x,y:i.y}})}function fi(e,t,r){return new Error(`element ${me(t)} referenced by ${me(e)}#${r} not yet drawn`)}function Ke(e,t,r,n,i){this._eventBus=e,this._canvas=t,this._elementFactory=r,this._elementRegistry=n,this._textRenderer=i}Ke.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"];Ke.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(vr(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(vr(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,gr(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(vr(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 jn(e)&&Pt(n)&&this.addLabel(e,t,n),this._eventBus.fire("bpmnElement.added",{element:n}),n};Ke.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 fi(e,r,"attachedToRef");t.host=n,i||(n.attachers=i=[]),i.indexOf(t)===-1&&i.push(t)};Ke.prototype.addLabel=function(e,t,r){var n,i,o;return n=Vn(t,r),i=Pt(r),i&&(n=this._textRenderer.getExternalLabelBounds(n,i)),o=this._elementFactory.createLabel(vr(e,t,{id:e.id+"_label",labelTarget:r,type:"label",hidden:r.hidden||!Pt(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)};Ke.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?fi(e,n,t+"Ref"):new Error(`${me(e)}#${t} Ref not specified`)};Ke.prototype._getSource=function(e){return this._getConnectedElement(e,"source")};Ke.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")};Ke.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 pi={__depends__:[yr],bpmnImporter:["type",Ke]};var hi={__depends__:[li,pi]};function Er(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}Er.prototype.next=function(){return this._prefix+ ++this._counter};var Fa=new Er("ov"),ja=500;function pe(e,t,r,n){this._eventBus=t,this._canvas=r,this._elementRegistry=n,this._ids=Fa,this._overlayDefaults=T({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?Ge(t.overlays,$r({type:e.type})):t.overlays.slice():[]}else return e.type?Ge(this._overlays,$r({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=T({},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&&(Nt(n.html),Nt(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(){xr(this._overlayRoot)};pe.prototype.hide=function(){xr(this._overlayRoot,!1)};pe.prototype.clear=function(){this._overlays={},this._overlayContainers=[],lr(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=xt(t);n=o.x,i=o.y}di(r,n,i),ur(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=xt(n).width:u=n.width,i=t.right*-1+u}if(t.bottom!==void 0){var l;n.waypoints?l=xt(n).height:l=n.height,o=t.bottom*-1+l}di(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(",")+")";mi(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&&bt(i).add("djs-overlay-"+e.type);var u=this._canvas.findRoot(r),l=this._canvas.getRootElement();xr(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+")"),mi(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){Nt(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&&bt(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 di(e,t,r){we(e,{left:t+"px",top:r+"px"})}function xr(e,t){e.style.display=t===!1?"none":""}function mi(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(r){e.style[r+"transform"]=t})}var wr={__init__:["overlays"],overlays:["type",pe]};function _r(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(rr(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)})}_r.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var yi={__init__:["changeSupport"],changeSupport:["type",_r]};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((it(t)||Te(t))&&(o=i,i=n,n=r,r=t,t=null),it(r)&&(o=i,i=n,n=r,r=Wa),Ae(i)&&(o=i,i=!1),!it(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){(it(r)||Te(r))&&(u=o,o=i,i=n,n=r,r=null),this.on(r,e,n,i,o,u)}}function Ut(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(Ut,ge);Ut.$inject=["canvas","injector"];var gi={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",Ut]};var za={"&":"&","<":"<",">":">",'"':""","'":"'"};function vi(e){return e=""+e,e&&e.replace(/[&<>"']/g,function(t){return za[t]})}var Ha="_plane";function qt(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 br(e,t,r){var n=xe('
            '),i=r.getContainer(),o=bt(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(qt(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=vi(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)})}br.$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 Ar(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})}Ar.$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 Ei={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-Ei.x,y:r.y-Ei.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=xi(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 xi(e){return D(e,"bpmndi:BPMNDiagram")?e:xi(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=Ht(r.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}}),ci(t)}function Xa(e,t){var r=e.$parent;return!(!D(r,"bpmn:SubProcess")||r===t.bpmnElement||On(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))}var Sr=250,Za='',Qa="bjs-drilldown-empty";function Qe(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",Sr,function(u){var l=u.shape;o._canDrillDown(l)?o._addOverlay(l):o._removeOverlay(l)},!0),this.reverted("shape.toggleCollapse",Sr,function(u){var l=u.shape;o._canDrillDown(l)?o._addOverlay(l):o._removeOverlay(l)},!0),this.executed(["shape.create","shape.move","shape.delete"],Sr,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"],Sr,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(Qe,ge);Qe.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var r=t.findRoot(e);r&&this._updateOverlayVisibility(r)}};Qe.prototype._canDrillDown=function(e){var t=this._canvas;return D(e,"bpmn:SubProcess")&&t.findRoot(qt(e))};Qe.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;bt(n.html).toggle(Qa,!i)}};Qe.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(qt(e)))}),r.add(e,"drilldown",{position:{bottom:-7,right:-8},html:o}),this._updateOverlayVisibility(e)};Qe.prototype._removeOverlay=function(e){var t=this._overlays;t.remove({element:e,type:"drilldown"})};Qe.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];var wi={__depends__:[wr,yi,gi],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",br],drilldownCentering:["type",Ar],drilldownOverlayBehavior:["type",Qe],subprocessCompatibility:["type",ct]};function sn(e){return e.originalEvent||e.srcEvent}function _i(e,t){return(sn(e)||e).button===t}function Lt(e){return _i(e,0)}function bi(e){return _i(e,1)}function Ai(e){var t=sn(e)||e;return Lt(e)&&t.shiftKey}function Ja(e){return!0}function Rr(e){return Lt(e)||bi(e)}var Si=500;function Cr(e,t,r){var n=this;function i(v,k,b){if(!l(v,k)){var B,M,N;b?M=t.getGraphics(b):(B=k.delegateTarget||k.target,B&&(M=B,b=t.get(M))),!(!M||!b)&&(N=e.fire(v,{element:b,gfx:M,originalEvent:k}),N===!1&&(k.stopPropagation(),k.preventDefault()))}}var o={};function u(v){return o[v]}function l(v,k){var b=d[v]||Lt;return!b(k)}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":Rr,"element.mouseup":Rr,"element.click":Rr,"element.dblclick":Rr};function g(v,k,b){var B=f[v];if(!B)throw new Error("unmapped DOM event name <"+v+">");return i(B,k,b)}var A="svg, .djs-element";function j(v,k,b,B){var M=o[b]=function(N){i(b,N)};B&&(d[b]=B),M.$delegate=$t.bind(v,A,k,M)}function $(v,k,b){var B=u(b);B&&$t.unbind(v,k,B.$delegate)}function ne(v){R(f,function(k,b){j(v,b,k)})}function V(v){R(f,function(k,b){$(v,b,k)})}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 k=v.element,b=v.gfx;e.fire("interactionEvents.createHit",{element:k,gfx:b})}),e.on(["shape.changed","connection.changed"],Si,function(v){var k=v.element,b=v.gfx;e.fire("interactionEvents.updateHit",{element:k,gfx:b})}),e.on("interactionEvents.createHit",Si,function(v){var k=v.element,b=v.gfx;n.createDefaultHit(k,b)}),e.on("interactionEvents.updateHit",function(v){var k=v.element,b=v.gfx;n.updateDefaultHit(k,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,k){return k=T({stroke:"white",strokeWidth:15},k||{}),r.cls(v,["no-fill","no-border"],k)}function S(v,k){var b=m[k];if(!b)throw new Error("invalid hit type <"+k+">");return Q(v,b),v}function F(v,k){ae(v,k)}this.removeHits=function(v){var k=ii(".djs-hit",v);R(k,wt)},this.createDefaultHit=function(v,k){var b=v.waypoints,B=v.isFrame,M;return b?this.createWaypointsHit(k,b):(M=B?"stroke":"all",this.createBoxHit(k,M,{width:v.width,height:v.height}))},this.createWaypointsHit=function(v,k){var b=kt(k);return S(b,"stroke"),F(v,b),b},this.createBoxHit=function(v,k,b){b=T({x:0,y:0},b);var B=J("rect");return S(B,k),Q(B,b),F(v,B),B},this.updateDefaultHit=function(v,k){var b=Le(".djs-hit",k);if(b)return v.waypoints?en(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=$}Cr.$inject=["eventBus","elementRegistry","styles"];var Ri={__init__:["interactionEvents"],interactionEvents:["type",Cr]};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 Ci="hover",Pi="selected";function Pr(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,Ci)}),t.on("element.out",function(i){n(i.element,Ci)}),t.on("selection.changed",function(i){function o(d){n(d,Pi)}function u(d){r(d,Pi)}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)})})}Pr.$inject=["canvas","eventBus"];function Tr(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(Lt(i)){var o=i.element;o===r.getRootElement()&&(o=null);var u=t.isSelected(o),l=t.get().length>1,f=Ai(i);if(u&&l)return f?t.deselect(o):t.select(o);u?t.deselect(o):t.select(o,f)}})}Tr.$inject=["eventBus","selection","canvas","elementRegistry"];function es(e){return!e.hidden}var Ti={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Ri],selection:["type",dt],selectionVisuals:["type",Pr],selectionBehavior:["type",Tr]};var ts=/^class[ {]/;function rs(e){return ts.test(e.toString())}function ln(e){return Array.isArray(e)}function un(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function kr(...e){e.length===1&&ln(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 cn(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(un(o,P))return o[P];if(un(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(ln(P))P=kr(P.slice());else throw l(`Cannot invoke "${P}". Expected a function!`);let S=(P.$inject||as(P)).map(F=>un(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 kr(m=>P.get(m))}function $(P,m){if(m&&m.length){let _=Object.create(null),S=Object.create(null),F=[],v=[],k=[],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),k.push(N),_[H]=[N,H,"private",M]):_[H]=[k[B],H,"private",v[B]]):_[H]=[b[2],b[1]],S[H]=!0),(b[2]==="factory"||b[2]==="type")&&b[1].$scope&&m.forEach(Ye=>{b[1].$scope.indexOf(Ye)!==-1&&(_[H]=[b[2],b[1]],S[Ye]=!0)});m.forEach(H=>{if(!S[H])throw new Error('No provider for "'+H+'". Cannot use provider from the parent!')}),P.unshift(_)}return new cn(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),k=kr(function(B){return v.get(B)});m.forEach(function(B){i[B]=[k,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"&&ln(t)&&(t=kr(t.slice())),t}var us=1;function Je(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(Je,We);Je.prototype.canRender=function(){return!0};Je.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}),nr(r)?Q(i,T({},this.FRAME_STYLE,n||{})):Q(i,T({},this.SHAPE_STYLE,n||{})),ae(t,i),i};Je.prototype.drawConnection=function(t,r,n){var i=kt(r.waypoints,T({},this.CONNECTION_STYLE,n||{}));return ae(t,i),i};Je.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)};Je.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)};Je.$inject=["eventBus","styles"];function fn(){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 T(o,{class:r})},this.style=function(r,n){!ye(r)&&!n&&(n=r,r=[]);var i=Xe(r,function(o,u){return T(o,e[u]||{})},{});return n?T(i,n):i},this.computeStyle=function(r,n,i){return ye(n)||(i=n,n=[]),t.style(n||[],T({},i,r||{}))}}var ki={__init__:["defaultRenderer"],defaultRenderer:["type",Je],styles:["type",fn]};function Mi(e,t){if(!e||!t)return-1;var r=e.indexOf(t);return r!==-1&&e.splice(r,1),r}function Di(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 Mr(e,t){return Math.round(e*t)/t}function Ni(e){return Te(e)?e+"px":e}function ls(e){for(;e.parent;)e=e.parent;return e}function cs(e){e=T({},{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:Ni(e.width),height:Ni(e.height)}),t.appendChild(r),r}function Bi(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",Oi=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%"}),ur(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=Bi(n,"viewport");e.deferUpdate&&(this._viewboxChanged=Mn(Ue(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=rr(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,Oi)};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 Xe(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:Bi(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&&(wt(r),t.visible=!1),r};I.prototype._removeLayer=function(e){let t=this._layers[e];t&&(delete this._layers[e],wt(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,Oi);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(!Wr(r,function(i){return typeof t[i]!="undefined"}))throw new Error("must supply { "+r.join(", ")+" } with "+e)};I.prototype._setParent=function(e,t,r){Di(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),Mi(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);_t(t,g)});else return o=this._rootElement?this.getActiveLayer():null,n=o&&o.getBBox()||{},u=_t(t),i=u?u.matrix:Yn(),l=Mr(i.a,1e3),f=Mr(-i.e||0,1e3),d=Mr(-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=T({dx:0,dy:0},e||{}),r=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(r),Li(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=xt(e),o=Ht(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=Ht(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=T(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),Li(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 It="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,It,n),r&&Q(r,It,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,It,""),n.secondaryGfx&&Q(n.secondaryGfx,It,""),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,It,n),t};Re.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&Q(e,It);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?Ii(this,t,e):gs(this,t,e)};Ie.prototype.ensureRefsCollection=function(e,t){var r=e[t.name];return ms(r)||Ii(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 pn=new Ie({name:"children",enumerable:!0,collection:!0},{name:"parent"}),ji=new Ie({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Fi=new Ie({name:"attachers",collection:!0},{name:"host"}),Vi=new Ie({name:"outgoing",collection:!0},{name:"source"}),Wi=new Ie({name:"incoming",collection:!0},{name:"target"});function Kt(){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)}}),pn.bind(this,"parent"),ji.bind(this,"labels"),Vi.bind(this,"outgoing"),Wi.bind(this,"incoming")}function Yt(){Kt.call(this),pn.bind(this,"children"),Fi.bind(this,"host"),Fi.bind(this,"attachers")}Ee(Yt,Kt);function $i(){Kt.call(this),pn.bind(this,"children")}Ee($i,Yt);function zi(){Yt.call(this),ji.bind(this,"labelTarget")}Ee(zi,Yt);function Hi(){Kt.call(this),Vi.bind(this,"source"),Wi.bind(this,"target")}Ee(Hi,Kt);var vs={connection:Hi,shape:Yt,label:zi,root:$i};function Ui(e,t){var r=vs[e];if(!r)throw new Error("unknown type: <"+e+">");return T(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=T({},t||{}),t.id||(t.id=e+"_"+this._uid++),Ui(e,t)};var Dr="__fn",qi=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],it(t)&&(n=r,r=t,t=qi),!Te(t))throw new Error("priority must be a number");var i=r;n&&(i=Ue(r,n),i[Dr]=r[Dr]||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(it(t)&&(n=r,r=t,t=qi),!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[Dr]=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 Gt;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 Gt?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 Nn(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,Ue(function(o){o=T({},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,Ue(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=T({},e);var t=this.packageMap;Zi(t,e,"prefix"),Zi(t,e,"uri"),R(e.types,Ue(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=T({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:T(e.meta||{})});var r=ve(e.name,t.prefix),n=r.name,i={};R(e.properties,Ue(function(o){var u=ve(o.name,r.prefix),l=u.name;hn(o.type)||(o.type=ve(o.type,u.prefix).name),T(o,{ns:u,name:l}),i[l]=o},this)),T(e,{ns:r,name:n,propertiesByName:i}),R(e.extends,Ue(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=hn(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(f,d){var g=ve(f,hn(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 Zi(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[dn(t)]:n?i in e?e[i]=r:eo(e,n,r):e.$attrs[dn(t)]=r};At.prototype.get=function(e,t){var r=this.getProperty(e,t);if(!r)return e.$attrs[dn(t)];var n=r.name;return!e[n]&&r.isMany&&eo(e,r,[]),e[n]};At.prototype.define=function(e,t,r){if(!r.writable){var n=r.value;r=T({},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 eo(e,t,r){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:r,configurable:!0})}function dn(e){return e.replace(/^:/,"")}function Me(e,t={}){this.properties=new At(this),this.factory=new Qi(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){Dn(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 to=String.fromCharCode,Ss=Object.prototype.hasOwnProperty,Rs=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,Xt={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(Xt).forEach(function(e){Xt[e.toUpperCase()]=Xt[e]});function Cs(e,t,r,n){return n?Ss.call(Xt,n)?Xt[n]:"&"+n+";":to(t||parseInt(r,16))}function St(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(Rs,Cs):e}var ro="non-whitespace outside of root node";function Ft(e){return new Error(e)}function no(e){return"missing namespace for prefix <"+e+">"}function Br(e){return{get:e,enumerable:!0}}function Ps(e){var t={},r;for(r in e)t[r]=e[r];return t}function gn(e){return e+"$uri"}function Ts(e){var t={},r,n;for(r in e)n=e[r],t[n]=n,t[gn(n)]=r;return t}function io(){return{line:0,column:0}}function ks(e){throw e}function vn(e){if(!this)return new vn(e);var t=e&&e.proxy,r,n,i,o,u=ks,l,f,d,g,A=io,j=!1,$=!1,ne=null,V=!1,q;function Y(m){m instanceof Error||(m=Ft(m)),ne=m,u(m,A)}function Z(m){l&&(m instanceof Error||(m=Ft(m)),l(m,A))}this.on=function(m,_){if(typeof _!="function")throw Ft("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 Ft("unsupported event: "+m)}return this},this.ns=function(m){if(typeof m=="undefined"&&(m={}),typeof m!="object")throw Ft("required args ");var _={},S;for(S in m)_[S]=m[S];return $=!0,q=_,this},this.parse=function(m){if(typeof m!="string")throw Ft("required args ");return ne=null,P(m),A=io,V=!1,ne},this.stop=function(){V=!0};function P(m){var _=$?[]:null,S=$?Ts(q):null,F,v=[],k=0,b=!1,B=!1,M=0,N=0,H,Ye,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,nt={},Jt={},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 Jt){Z("attribute <"+te+"> already defined");continue}if(Jt[te]=!0,!$){nt[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=gn(ue),Ve=q[s],!Ve){if(ue==="xmlns"||a in S&&S[a]!==s)do Ve="ns"+k++;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[gn(Ve)]=s,h=Ve),S[a]=s),nt[te]=de;continue}y.push(te,de);continue}if(W=te.indexOf(":"),W===-1){nt[te]=de;continue}if(!(p=S[te.substring(0,W)])){Z(no(te.substring(0,W)));continue}te=h===p?te.substr(W+1):p+te.substr(W),nt[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:Br(function(){return le}),originalName:Br(function(){return je}),attrs:Br(De),ns:Br(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,Ye=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 oo(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var En={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},ao="property";function so(e){return e.xml&&e.xml.serialize}function Ms(e){let t=so(e);return t!==ao&&(t||null)}function Ds(e){return e.charAt(0).toUpperCase()+e.slice(1)}function uo(e,t){return oo(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){T(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 Zt(){}Zt.prototype.handleEnd=function(){};Zt.prototype.handleText=function(){};Zt.prototype.handleNode=function(){};function xn(){}xn.prototype=Object.create(Zt.prototype);xn.prototype.handleNode=function(){return this};function Vt(){}Vt.prototype=Object.create(Zt.prototype);Vt.prototype.handleText=function(e){this.body=(this.body||"")+e};function Qt(e,t){this.property=e,this.context=t}Qt.prototype=Object.create(Vt.prototype);Qt.prototype.handleNode=function(e){if(this.element)throw gt("expected no sub nodes");return this.element=this.createReference(e),this};Qt.prototype.handleEnd=function(){this.element.id=this.body};Qt.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}};function wn(e,t){this.element=t,this.propertyDesc=e}wn.prototype=Object.create(Vt.prototype);wn.prototype.handleEnd=function(){var e=this.body||"",t=this.element,r=this.propertyDesc;e=Nr(r.type,e),r.isMany?t.get(r.name).push(e):t.set(r.name,e)};function Or(){}Or.prototype=Object.create(Vt.prototype);Or.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(Or.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+">");Vt.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=Nr(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=Nr(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 T({},l,{effectiveType:ft(j).name})}}return l}var f=i.getPackage(r.prefix);if(f){let d=uo(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 T({},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 wn(e,t)};be.prototype.referenceHandler=function(e){return new Qt(e,this.context)};be.prototype.handler=function(e){return e==="Element"?new jt(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,yn(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?(T(o,{element:n}),this.context.addReference(o)):o.$parent=n),i};function _n(e,t,r){be.call(this,e,t,r)}_n.prototype=Object.create(be.prototype);_n.prototype.createElement=function(e){var t=e.name,r=ve(t),n=this.model,i=this.type,o=n.getPackage(r.prefix),u=o&&uo(r,o)||t;if(!i.hasType(u))throw gt("unexpected element <"+e.originalName+">");return be.prototype.createElement.call(this,e)};function jt(e,t,r){this.model=e,this.context=r}jt.prototype=Object.create(Or.prototype);jt.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)};jt.prototype.handleChild=function(e){var t=new jt(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};jt.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function Lr(e){e instanceof Me&&(e={model:e}),T(this,{lax:!1},e)}Lr.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(T({},t,{rootHandler:n})),l=new vn({proxy:!0}),f=Ls();n.context=u,f.push(n);function d(_,S,F){var v=S(),k=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: `+k+` - 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 k=v.element,b=_[v.id],B=ft(k).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=k.get(B.name),N=M.indexOf(v);N===-1&&(N=M.length),b?M[N]=b:M.splice(N,1)}else k.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 xn)}}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(En).reduce(function(_,[S,F]){return _[F]=S,_},i.config&&i.config.nsMap||{}));return l.ns(m).on("openTag",function(_,S,F,v){var k=_.attrs||{},b=Object.keys(k).reduce(function(M,N){var H=S(k[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 k=u.warnings,b=u.references,B=u.elementsById;return F?(F.warnings=k,S(F)):_({rootElement:v,elementsById:B,references:b,warnings:k})})};Lr.prototype.handler=function(e){return new _n(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,lo=/<|>|&/g;function tt(e){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=e,this.defaultPrefixMap=e&&e.defaultPrefixMap||{}}tt.prototype.mapDefaultPrefixes=function(e){this.defaultPrefixMap=e};tt.prototype.defaultUriByPrefix=function(e){return this.defaultPrefixMap[e]};tt.prototype.byUri=function(e){return this.uriMap[e]||this.parent&&this.parent.byUri(e)};tt.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)};tt.prototype.uriByPrefix=function(e){return this.prefixMap[e||"xmlns"]||this.parent&&this.parent.uriByPrefix(e)};tt.prototype.mapPrefix=function(e,t){this.prefixMap[e||"xmlns"]=t};tt.prototype.getNSKey=function(e){return e.prefix!==void 0?e.uri+"|"+e.prefix:e.uri};tt.prototype.logUsed=function(e){var t=e.uri,r=this.getNSKey(e);this.used[r]=this.byUri(t),this.parent&&this.parent.logUsed(e)};tt.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 oo(t)?js(e):e}function co(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function fo(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?T({localName:t.ns.localName},e):T({localName:Vs(t.ns.localName,t.$pkg)},e)}function zs(e,t){return T({localName:t.ns.localName},e)}function Hs(e){var t=e.$descriptor;return Ge(t.properties,function(r){var n=r.name;if(r.isVirtual||!ot(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 po(e,t,r){return e=ke(e)?e:""+e,e.replace(t,function(n){return"&"+r[n]+";"})}function Ks(e){return po(e,Fs,Us)}function Ys(e){return po(e,lo,qs)}function Gs(e){return Ge(e,function(t){return t.isAttr})}function Xs(e){return Ge(e,function(t){return!t.isAttr})}function bn(e){this.tagName=e}bn.prototype.build=function(e){return this.element=e,this};bn.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(lo)!==-1&&(this.escape=!0),this};function An(e){this.tagName=e}co(An,Rt);An.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}:T({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(yn(i.type))R(o,function(d){r.push(new An(t.addTagName(t.nsPropertyTagName(i))).build(i,d))});else if(u)R(o,function(d){r.push(new bn(t.addTagName(t.nsPropertyTagName(i))).build(d))});else{var f=so(i);R(o,function(d){var g;f?f===ao?g=new oe(t,i):g=new Ir(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 tt(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),fo(e)};oe.prototype.addAttribute=function(e,t){var r=this.attrs;ke(t)&&(t=Ks(t));var n=Tn(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(fo(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 Ir(e,t,r){oe.call(this,e,t),this.serialization=r}co(Ir,oe);Ir.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};Ir.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 ho(e){e=T({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 En)r[n]=En[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 Fr(e,t){Me.call(this,e,t)}Fr.prototype=Object.create(Me.prototype);Fr.prototype.fromXML=function(e,t,r){ke(t)||(r=t,t="bpmn:Definitions");var n=new Lr(T({model:this,lax:!0},r)),i=n.handler(t);return n.fromXML(e,i)};Fr.prototype.toXML=function(e,t){var r=new ho(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 mo(e,t){let r=T({},$u,e);return new Fr(r,t)}function Pe(e,t){return e.$instanceOf(t)}function zu(e){return he(e.rootElements,function(t){return Pe(t,"bpmn:Process")||Pe(t,"bpmn:Collaboration")})}function Sn(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: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=zu(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),k(E.ioSpecification,x),v(E.artifacts,x),o(E)}function Y(E,x){var L=Ge(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 k(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")&&k(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&&Ye(E.childLaneSet,L||x),je(E)})}function Ye(E,x){R(E.lanes,i(H,x))}function ie(E,x){R(E,i(Ye,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 Sn(A);g=g||d.diagrams&&d.diagrams[0];var $=Hu(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 Hu(e,t){if(!(!t||!t.plane)){var r=t.plane.bpmnElement,n=r;!D(r,"bpmn:Process")&&!D(r,"bpmn:Collaboration")&&(n=Uu(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=kn(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 Uu(e){for(var t=e;t;){if(D(t,"bpmn:Process"))return t;t=t.$parent}}var qu='',Rn=qu,Cn={verticalAlign:"middle"},Pn={color:"#404040"},Ku={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},Yu={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},Gu={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"},Xu='
            '+Rn+'Web-based tooling for BPMN, DMN and forms powered by bpmn.io.
            ',rt;function Zu(){rt=xe(Xu),we(rt,Ku),we(Le("svg",rt),Cn),we(Le(".backdrop",rt),Yu),we(Le(".notice",rt),Gu),we(Le(".link",rt),Pn,{margin:"15px 20px 15px 10px",alignSelf:"center"})}function vo(){rt||(Zu(),$t.bind(rt,".backdrop","click",function(e){document.body.removeChild(rt)})),document.body.appendChild(rt)}function se(e){e=T({},Ju,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),this._init(this._container,this._moddle,e),tl(this._container)}Ee(se,et);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||[]),jr(l,o),l=Qu(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 jr(o,[]),o}if(typeof t=="string"&&(n=el(r,t),!n)){let o=new Error("BPMNDiagram <"+t+"> not found");throw jr(o,[]),o}try{this.clear()}catch(o){throw jr(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=Zr(i),l=o?""+Zr(o)+"":"",f=i.getBBox();t=` +(()=>{var Ps=Object.create;var vn=Object.defineProperty;var ks=Object.getOwnPropertyDescriptor;var Ts=Object.getOwnPropertyNames;var Ms=Object.getPrototypeOf,Ds=Object.prototype.hasOwnProperty;var Ns=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var En=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Bs=(e,t)=>{for(var n in t)vn(e,n,{get:t[n],enumerable:!0})},Ni=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ts(t))!Ds.call(e,i)&&i!==n&&vn(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)):{},Ni(t||!e||!e.__esModule?vn(n,"default",{value:e,enumerable:!0}):n,e)),Ls=e=>Ni(vn({},"__esModule",{value:!0}),e);var Fi={};Bs(Fi,{assign:()=>M,bind:()=>Ye,debounce:()=>dr,ensureArray:()=>Bi,every:()=>bn,filter:()=>nt,find:()=>ve,findIndex:()=>hr,flatten:()=>Is,forEach:()=>P,get:()=>Gs,groupBy:()=>Ft,has:()=>at,isArray:()=>xe,isDefined:()=>wt,isFunction:()=>tt,isNil:()=>nn,isNumber:()=>Me,isObject:()=>_e,isString:()=>De,isUndefined:()=>Tt,keys:()=>Oi,map:()=>_t,matchPattern:()=>xn,merge:()=>Ii,omit:()=>vr,pick:()=>gr,reduce:()=>Ve,set:()=>yr,size:()=>$s,some:()=>rn,sortBy:()=>Ws,throttle:()=>Us,unionBy:()=>qs,uniqueBy:()=>Li,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 nn(e){return e==null}function xe(e){return tn.call(e)==="[object Array]"}function _e(e){return tn.call(e)==="[object Object]"}function Me(e){return tn.call(e)==="[object Number]"}function tt(e){let t=tn.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function De(e){return tn.call(e)==="[object String]"}function Bi(e){if(!xe(e))throw new Error("must supply array")}function at(e,t){return!nn(e)&&Fs.call(e,t)}function ve(e,t){let n=wn(t),r;return P(e,function(i,o){if(n(i,o))return r=i,!1}),r}function hr(e,t){let n=wn(t),r=xe(e)?-1:void 0;return P(e,function(i,o){if(n(i,o))return r=o,!1}),r}function nt(e,t){let n=wn(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(at(e,o)&&(n=e[o],r=t(n,i(o)),r===!1))return n}function js(e,t){if(Tt(e))return[];Bi(e);let n=wn(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 bn(e,t){return!!Ve(e,function(n,r,i){return n&&t(r,i)},!0)}function rn(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 Oi(e){return e&&Object.keys(e)||[]}function $s(e){return Oi(e).length}function Vs(e){return _t(e,t=>t)}function Ft(e,t,n={}){return t=mr(t),P(e,function(r){let i=t(r)||"_",o=n[i];o||(o=n[i]=[]),o.push(r)}),n}function Li(e,...t){e=mr(e);let n={};return P(t,i=>Ft(i,e,n)),_t(n,function(i,o){return i[0]})}function Ws(e,t){t=mr(t);let n=[];return P(e,function(r,i){let o=t(r,i),a={d:o,v:r};for(var s=0;sr.v)}function xn(e){return function(t){return bn(e,function(n,r){return t[r]===n})}}function mr(e){return tt(e)?e:t=>t[e]}function wn(e){return tt(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(),A=y?0:o+t-v;if(A>0)return s(A);e.apply(i,r),c()}function s(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||s(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 Ye(e,t){return e.bind(t)}function M(e,...t){return Object.assign(e,...t)}function yr(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],s=r[i];wt(a)&&nn(s)&&(s=r[i]=isNaN(+a)?{}:[]),Tt(a)?Tt(n)?delete r[i]:r[i]=n:r=s}),e}function Gs(e,t,n){let r=e;return P(t,function(i){if(nn(r))return r=void 0,!1;r=r[i]}),Tt(r)?n:r}function gr(e,t){let n={},r=Object(e);return P(t,function(i){i in r&&(n[i]=e[i])}),n}function vr(e,t){let n={},r=Object(e);return P(r,function(i,o){t.indexOf(o)===-1&&(n[o]=i)}),n}function Ii(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]=Ii(o,r)):e[i]=r})}),e}var tn,Fs,qs,Q=Ns(()=>{tn=Object.prototype.toString,Fs=Object.prototype.hasOwnProperty;qs=Li});var Sa=En((fv,_a)=>{function Cf(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&&!Cf(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 Ra=En((pv,Aa)=>{var Pf=Sa(),{isArray:kf,isObject:Tf,isFunction:Mf}=(Q(),Ls(Fi)),ri=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&&kf(r)&&(i={...i,path:r}),r&&Tf(r)&&(i={...i,...r}),this.messages.push(i)}};Aa.exports=function({moddleRoot:t,rule:n}){let r=new ri({rule:n,moddleRoot:t}),i=n.check||{},o="leave"in i?i.leave:void 0,a="enter"in i?i.enter:Mf(i)?i:void 0;if(!a&&!o)throw new Error("no check implemented");return Pf(t,{enter:a?s=>a(s,r):void 0,leave:o?s=>o(s,r):void 0}),r.messages}});var ka=En((hv,Pa)=>{var Df=Ra(),Nf=(e,t)=>e,Bf={0:"off",1:"warn",2:"error",3:"info"},Of="rule-error";function Qe(e){let{config:t={},resolver:n,transformRule:r=Nf}=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=Qe;Qe.prototype.applyRule=function(t,n){let{config:r,rule:i,category:o,name:a}=n;try{return Df({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:Of}]}};Qe.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})})};Qe.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)})};Qe.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)})};Qe.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}),{})})};Qe.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})};Qe.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=Bf[t]||t,{config:n,category:t}};Qe.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}};Qe.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}};Qe.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+"/":""}${Lf(i)}`};Qe.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),f=s==="bpmnlint"?c:`${this.getSimplePackageName(s)}/${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 Lf(e){return e.startsWith("bpmnlint-plugin-")?e.substring(16):e}});var Ma=En((mv,Ta)=>{var If=ka();Ta.exports={Linter:If}});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 Xe(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,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)})}Xe.prototype.canRender=function(e){};Xe.prototype.drawShape=function(e,t){};Xe.prototype.drawConnection=function(e,t){};Xe.prototype.getShapePath=function(e){};Xe.prototype.getConnectionPath=function(e){};Q();function N(e,t){var n=oe(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)}function ji(e,t){return rn(t,function(n){return N(e,n)})}function oe(e){return e&&e.businessObject||e}function Ze(e){return e&&e.di}function dt(e,t){return N(e,"bpmn:CallActivity")?!1:N(e,"bpmn:SubProcess")?(t=t||Ze(e),t&&N(t,"bpmndi:BPMNPlane")?!0:t&&!!t.isExpanded):N(e,"bpmn:Participant")?!!oe(e).processRef:!0}function Er(e){if(!(!N(e,"bpmn:Participant")&&!N(e,"bpmn:Lane"))){var t=Ze(e).isHorizontal;return t===void 0?!0:t}}function $i(e){return e&&!!oe(e).triggeredByEvent}Q();Q();function Vi(e){return _e(e)&&at(e,"waypoints")}function br(e){return _e(e)&&at(e,"labelTarget")}var jt={width:90,height:20},qi=15;function Wi(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,s=i.y;return Math.abs(o)i||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 _n(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function Sn(e){return!!(e&&e.isFrame)}var An=7;Q();function eu(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch{}return e}function Ki(e,t){return t.appendChild(eu(e,t))}function fe(e,t){return Ki(t,e),e}var _r=2,Yi={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":_r,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":_r,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function tu(e,t){return Yi[t]?e.style[t]:e.getAttributeNS(null,t)}function Xi(e,t,n){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=Yi[r];i?(i===_r&&typeof n=="number"&&(n=String(n)+"px"),e.style[r]=n):e.setAttributeNS(null,t,n)}function nu(e,t){var n=Object.keys(t),r,i;for(r=0,i;i=n[r];r++)Xi(e,i,t[i])}function te(e,t,n){if(typeof t=="string")if(n!==void 0)Xi(e,t,n);else return tu(e,t);else nu(e,t);return e}var ru=Object.prototype.toString;function qe(e){return new St(e)}function St(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}St.prototype.add=function(e){return this.list.add(e),this};St.prototype.remove=function(e){return ru.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)};St.prototype.removeMatching=function(e){let t=this.array();for(let n=0;n"+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=Zi(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Ar.svg,e),t&&te(n,t),n}var xr=null;function Sr(){return xr===null&&(xr=ne("svg")),xr}function Ui(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)e[r]=t[r];return e}function Qi(e,t,n,r,i,o){var a=Sr().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return Ui(a,e);case 6:return Ui(a,{a:e,b:t,c:n,d:r,e:i,f:o})}}function Vt(e){return e?Sr().createSVGTransformFromMatrix(e):Sr().createSVGTransform()}var Gi=/([&<>]{1})/g,au=/([&<>\n\r"]{1})/g,su={"&":"&","<":"<",">":">",'"':"'"};function wr(e,t){function n(r,i){return su[i]||i}return e.replace(t,n)}function Ji(e,t){var n,r,i,o,a;switch(e.nodeType){case 3:t.push(wr(e.textContent,Gi));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=Zi(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,s=t.createElement("div");for(s.innerHTML=o+e+a;i--;)s=s.lastChild;if(s.firstChild===s.lastChild){let{firstChild:h}=s;return h.remove(),h}let c=t.createDocumentFragment();return c.append(...s.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 kn(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 Bt(e){return new At(e)}function At(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}At.prototype.add=function(e){return this.list.add(e),this};At.prototype.remove=function(e){return Eu.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)};At.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 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},Mr.exports}var Pu=Cu(),ku=Ru(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,Bn=3,Du=1.5,On=10,Nu=4,Ut=.95,Bu=1,Ou=.25;function gt(e,t,n,r,i,o,a){Xe.call(this,t,a);var s=e&&e.defaultFillColor,c=e&&e.defaultStrokeColor,f=e&&e.defaultLabelColor;function h(p){return n.computeStyle(p,{strokeLinecap:"round",strokeLinejoin:"round",stroke:Cn,strokeWidth:2,fill:"white"})}function y(p){return n.computeStyle(p,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:Cn,strokeWidth:2})}function v(p,l){var{ref:u={x:0,y:0},scale:m=1,element:d,parentGfx:E=i._svg}=l,S=ne("marker",{id:p,viewBox:"0 0 20 20",refX:u.x,refY:u.y,markerWidth:20*m,markerHeight:20*m,orient:"auto"});fe(S,d);var j=He(":scope > defs",E);j||(j=ne("defs"),fe(E,j)),fe(j,S)}function A(p,l,u,m){var d=Tu.nextPrefixed("marker-");return W(p,d,l,u,m),"url(#"+d+")"}function W(p,l,u,m,d){if(u==="sequenceflow-end"){var E=ne("path",{d:"M 1 5 L 11 10 L 1 15 Z",...h({fill:d,stroke:d,strokeWidth:1})});v(l,{element:E,ref:{x:11,y:10},scale:.5,parentGfx:p})}if(u==="messageflow-start"){var S=ne("circle",{cx:6,cy:6,r:3.5,...h({fill:m,stroke:d,strokeWidth:1,strokeDasharray:[1e4,1]})});v(l,{element:S,ref:{x:6,y:6},parentGfx:p})}if(u==="messageflow-end"){var j=ne("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...h({fill:m,stroke:d,strokeWidth:1,strokeDasharray:[1e4,1]})});v(l,{element:j,ref:{x:8.5,y:5},parentGfx:p})}if(u==="association-start"){var Y=ne("path",{d:"M 11 5 L 1 10 L 11 15",...y({fill:"none",stroke:d,strokeWidth:1.5,strokeDasharray:[1e4,1]})});v(l,{element:Y,ref:{x:1,y:10},scale:.5,parentGfx:p})}if(u==="association-end"){var ge=ne("path",{d:"M 1 5 L 11 10 L 1 15",...y({fill:"none",stroke:d,strokeWidth:1.5,strokeDasharray:[1e4,1]})});v(l,{element:ge,ref:{x:11,y:10},scale:.5,parentGfx:p})}if(u==="conditional-flow-marker"){var he=ne("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...h({fill:m,stroke:d})});v(l,{element:he,ref:{x:-1,y:10},scale:.5,parentGfx:p})}if(u==="conditional-default-flow-marker"){var we=ne("path",{d:"M 6 4 L 10 16",...h({stroke:d,fill:"none"})});v(l,{element:we,ref:{x:0,y:10},scale:.5,parentGfx:p})}}function L(p,l,u,m,d={}){_e(m)&&(d=m,m=0),m=m||0,d=h(d);var E=l/2,S=u/2,j=ne("circle",{cx:E,cy:S,r:Math.round((l+u)/4-m),...d});return fe(p,j),j}function O(p,l,u,m,d,E){_e(d)&&(E=d,d=0),d=d||0,E=h(E);var S=ne("rect",{x:d,y:d,width:l-d*2,height:u-d*2,rx:m,ry:m,...E});return fe(p,S),S}function H(p,l,u,m){var d=l/2,E=u/2,S=[{x:d,y:0},{x:l,y:E},{x:d,y:u},{x:0,y:E}],j=S.map(function(ge){return ge.x+","+ge.y}).join(" ");m=h(m);var Y=ne("polygon",{...m,points:j});return fe(p,Y),Y}function G(p,l,u,m){u=y(u);var d=qt(l,u,m);return fe(p,d),d}function T(p,l,u){return G(p,l,u,5)}function g(p,l,u){u=y(u);var m=ne("path",{...u,d:l});return fe(p,m),m}function w(p,l,u,m){return g(l,u,M({"data-marker":p},m))}function C(p){return je[p]}function V(p){return function(l,u,m){return C(p)(l,u,m)}}var b={"bpmn:MessageEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.235,my:.315}}),E=m?k(l,c,u.stroke):U(l,s,u.fill),S=m?U(l,s,u.fill):k(l,c,u.stroke),j=g(p,d,{fill:E,stroke:S,strokeWidth:1});return j},"bpmn:TimerEventDefinition":function(p,l,u={}){var m=u.width||l.width,d=u.height||l.height,E=u.width?1:2,S=L(p,m,d,.2*d,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:E}),j=r.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:m,containerHeight:d,position:{mx:.5,my:.5}});g(p,j,{stroke:k(l,c,u.stroke),strokeWidth:E});for(var Y=0;Y<12;Y++){var ge=r.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:m,containerHeight:d,position:{mx:.5,my:.5}}),he=m/2,we=d/2;g(p,ge,{strokeWidth:1,stroke:k(l,c,u.stroke),transform:"rotate("+Y*30+","+we+","+he+")"})}return S},"bpmn:EscalationEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.5,my:.2}}),E=m?k(l,c,u.stroke):U(l,s,u.fill);return g(p,d,{fill:E,stroke:k(l,c,u.stroke),strokeWidth:1})},"bpmn:ConditionalEventDefinition":function(p,l,u={}){var m=r.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.5,my:.222}});return g(p,m,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:1})},"bpmn:LinkEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:.57,my:.263}}),E=m?k(l,c,u.stroke):U(l,s,u.fill);return g(p,d,{fill:E,stroke:k(l,c,u.stroke),strokeWidth:1})},"bpmn:ErrorEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.2,my:.722}}),E=m?k(l,c,u.stroke):U(l,s,u.fill);return g(p,d,{fill:E,stroke:k(l,c,u.stroke),strokeWidth:1})},"bpmn:CancelEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:.638,my:-.055}}),E=m?k(l,c,u.stroke):"none",S=g(p,d,{fill:E,stroke:k(l,c,u.stroke),strokeWidth:1});return lo(S,45),S},"bpmn:CompensateEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.22,my:.5}}),E=m?k(l,c,u.stroke):U(l,s,u.fill);return g(p,d,{fill:E,stroke:k(l,c,u.stroke),strokeWidth:1})},"bpmn:SignalEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.5,my:.2}}),E=m?k(l,c,u.stroke):U(l,s,u.fill);return g(p,d,{strokeWidth:1,fill:E,stroke:k(l,c,u.stroke)})},"bpmn:MultipleEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.211,my:.36}}),E=m?k(l,c,u.stroke):U(l,s,u.fill);return g(p,d,{fill:E,stroke:k(l,c,u.stroke),strokeWidth:1})},"bpmn:ParallelMultipleEventDefinition":function(p,l,u={}){var m=r.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.458,my:.194}});return g(p,m,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:1})},"bpmn:TerminateEventDefinition":function(p,l,u={}){var m=L(p,l.width,l.height,8,{fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke),strokeWidth:4});return m}};function D(p,l,u={},m){var d=oe(p),E=eo(d),S=m||p;return d.get("eventDefinitions")&&d.get("eventDefinitions").length>1?d.get("parallelMultiple")?b["bpmn:ParallelMultipleEventDefinition"](l,S,u,E):b["bpmn:MultipleEventDefinition"](l,S,u,E):rt(d,"bpmn:MessageEventDefinition")?b["bpmn:MessageEventDefinition"](l,S,u,E):rt(d,"bpmn:TimerEventDefinition")?b["bpmn:TimerEventDefinition"](l,S,u,E):rt(d,"bpmn:ConditionalEventDefinition")?b["bpmn:ConditionalEventDefinition"](l,S,u,E):rt(d,"bpmn:SignalEventDefinition")?b["bpmn:SignalEventDefinition"](l,S,u,E):rt(d,"bpmn:EscalationEventDefinition")?b["bpmn:EscalationEventDefinition"](l,S,u,E):rt(d,"bpmn:LinkEventDefinition")?b["bpmn:LinkEventDefinition"](l,S,u,E):rt(d,"bpmn:ErrorEventDefinition")?b["bpmn:ErrorEventDefinition"](l,S,u,E):rt(d,"bpmn:CancelEventDefinition")?b["bpmn:CancelEventDefinition"](l,S,u,E):rt(d,"bpmn:CompensateEventDefinition")?b["bpmn:CompensateEventDefinition"](l,S,u,E):rt(d,"bpmn:TerminateEventDefinition")?b["bpmn:TerminateEventDefinition"](l,S,u,E):null}var R={ParticipantMultiplicityMarker:function(p,l,u={}){var m=We(l,u),d=Ne(l,u),E=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:m,containerHeight:d,position:{mx:(m/2-6)/m,my:(d-15)/d}});w("participant-multiplicity",p,E,{strokeWidth:2,fill:U(l,s,u.fill),stroke:k(l,c,u.stroke)})},SubProcessMarker:function(p,l,u={}){var m=O(p,14,14,0,{strokeWidth:1,fill:U(l,s,u.fill),stroke:k(l,c,u.stroke)});Nn(m,l.width/2-7.5,l.height-20);var d=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,d,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke)})},ParallelMarker:function(p,l,u){var m=We(l,u),d=Ne(l,u),E=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:m,containerHeight:d,position:{mx:(m/2+u.parallel)/m,my:(d-20)/d}});w("parallel",p,E,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke)})},SequentialMarker:function(p,l,u){var m=r.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:(l.width/2+u.seq)/l.width,my:(l.height-19)/l.height}});w("sequential",p,m,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke)})},CompensationMarker:function(p,l,u){var m=r.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:(l.width/2+u.compensation)/l.width,my:(l.height-13)/l.height}});w("compensation",p,m,{strokeWidth:1,fill:U(l,s,u.fill),stroke:k(l,c,u.stroke)})},LoopMarker:function(p,l,u){var m=We(l,u),d=Ne(l,u),E=r.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:m,containerHeight:d,position:{mx:(m/2+u.loop)/m,my:(d-7)/d}});w("loop",p,E,{strokeWidth:1.5,fill:"none",stroke:k(l,c,u.stroke),strokeMiterlimit:.5})},AdhocMarker:function(p,l,u){var m=We(l,u),d=Ne(l,u),E=r.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:m,containerHeight:d,position:{mx:(m/2+u.adhoc)/m,my:(d-15)/d}});w("adhoc",p,E,{strokeWidth:1,fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke)})}};function F(p,l,u,m){R[p](l,u,m)}function B(p,l,u=[],m={}){m={fill:m.fill,stroke:m.stroke,width:We(l,m),height:Ne(l,m)};var d=oe(l),E=u.includes("SubProcessMarker");E?m={...m,seq:-21,parallel:-22,compensation:-25,loop:-18,adhoc:10}:m={...m,seq:-5,parallel:-6,compensation:-7,loop:0,adhoc:-8},d.get("isForCompensation")&&u.push("CompensationMarker"),N(d,"bpmn:AdHocSubProcess")&&(u.push("AdhocMarker"),E||M(m,{compensation:m.compensation-18}));var S=d.get("loopCharacteristics"),j=S&&S.get("isSequential");S&&(M(m,{compensation:m.compensation-18}),u.includes("AdhocMarker")&&M(m,{seq:-23,loop:-18,parallel:-24}),j===void 0&&u.push("LoopMarker"),j===!1&&u.push("ParallelMarker"),j===!0&&u.push("SequentialMarker")),u.includes("CompensationMarker")&&u.length===1&&M(m,{compensation:-8}),P(u,function(Y){F(Y,p,l,m)})}function I(p,l,u={}){u=M({size:{width:100}},u);var m=o.createText(l||"",u);return qe(m).add("djs-label"),fe(p,m),m}function K(p,l,u,m={}){var d=oe(l),E=Ht({x:l.x,y:l.y,width:l.width,height:l.height},m);return I(p,d.name,{align:u,box:E,padding:7,style:{fill:Wt(l,f,c,m.stroke)}})}function ot(p,l,u={}){var m={width:l.width,height:l.height,x:l.width/2+l.x,y:l.height/2+l.y};return I(p,$t(l),{box:m,style:M({},o.getExternalStyle(),{fill:Wt(l,f,c,u.stroke)})})}function ae(p,l,u,m={}){var d=Er(u),E=I(p,l,{box:{height:30,width:d?Ne(u,m):We(u,m)},align:"center-middle",style:{fill:Wt(u,f,c,m.stroke)}});if(d){var S=-1*Ne(u,m);Dn(E,0,-S,270)}}function Z(p,l,u={}){var{width:m,height:d}=Ht(l,u);return O(p,m,d,On,{...u,fill:U(l,s,u.fill),fillOpacity:Ut,stroke:k(l,c,u.stroke)})}function Je(p,l,u={}){var m=oe(l),d=U(l,s,u.fill),E=k(l,c,u.stroke);return(m.get("associationDirection")==="One"||m.get("associationDirection")==="Both")&&(u.markerEnd=A(p,"association-end",d,E)),m.get("associationDirection")==="Both"&&(u.markerStart=A(p,"association-start",d,E)),u=X(u,["markerStart","markerEnd"]),T(p,l.waypoints,{...u,stroke:E,strokeDasharray:"0, 5"})}function et(p,l,u={}){var m=U(l,s,u.fill),d=k(l,c,u.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:m,fillOpacity:Ut,stroke:d}),j=oe(l);if(to(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:m,stroke:d})}return S}function ye(p,l,u={}){return L(p,l.width,l.height,{fillOpacity:Ut,...u,fill:U(l,s,u.fill),stroke:k(l,c,u.stroke)})}function Ge(p,l,u={}){return H(p,l.width,l.height,{fill:U(l,s,u.fill),fillOpacity:Ut,stroke:k(l,c,u.stroke)})}function x(p,l,u={}){var m=O(p,We(l,u),Ne(l,u),0,{fill:U(l,s,u.fill),fillOpacity:u.fillOpacity||Ut,stroke:k(l,c,u.stroke),strokeWidth:1.5}),d=oe(l);if(N(d,"bpmn:Lane")){var E=d.get("name");ae(p,E,l,u)}return m}function _(p,l,u={}){var m=Z(p,l,u),d=dt(l);if($i(l)&&(te(m,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!d)){var E=oe(l).flowElements||[],S=E.filter(j=>N(j,"bpmn:StartEvent"));S.length===1&&$(S[0],p,u,l)}return K(p,l,d?"center-top":"center-middle",u),d?B(p,l,void 0,u):B(p,l,["SubProcessMarker"],u),m}function $(p,l,u,m){var d=22,E={fill:U(m,s,u.fill),stroke:k(m,c,u.stroke),width:d,height:d},S=oe(p).isInterrupting,j=S?0:3,Y=S?1:1.2,ge=20,he=(d-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,m)}function re(p,l,u={}){var m=Z(p,l,u);return K(p,l,"center-middle",u),B(p,l,void 0,u),m}var je=this.handlers={"bpmn:AdHocSubProcess":function(p,l,u={}){return dt(l)?u=X(u,["fill","stroke","width","height"]):u=X(u,["fill","stroke"]),_(p,l,u)},"bpmn:Association":function(p,l,u={}){return u=X(u,["fill","stroke"]),Je(p,l,u)},"bpmn:BoundaryEvent":function(p,l,u={}){var{renderIcon:m=!0}=u;u=X(u,["fill","stroke"]);var d=oe(l),E=d.get("cancelActivity");u={strokeWidth:1.5,fill:U(l,s,u.fill),fillOpacity:Bu,stroke:k(l,c,u.stroke)},E||(u.strokeDasharray="6");var S=ye(p,l,u);return L(p,l.width,l.height,Bn,{...u,fill:"none"}),m&&D(l,p,u),S},"bpmn:BusinessRuleTask":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=re(p,l,u),d=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),E=g(p,d);te(E,{fill:U(l,s,u.fill),stroke:k(l,c,u.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:k(l,c,u.stroke),stroke:k(l,c,u.stroke),strokeWidth:1}),m},"bpmn:CallActivity":function(p,l,u={}){return u=X(u,["fill","stroke"]),_(p,l,{strokeWidth:5,...u})},"bpmn:ComplexGateway":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=Ge(p,l,u),d=r.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:l.width,containerHeight:l.height,position:{mx:.46,my:.26}});return g(p,d,{fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke),strokeWidth:1}),m},"bpmn:DataInput":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=r.getRawPath("DATA_ARROW"),d=et(p,l,u);return g(p,m,{fill:"none",stroke:k(l,c,u.stroke),strokeWidth:1}),d},"bpmn:DataInputAssociation":function(p,l,u={}){return u=X(u,["fill","stroke"]),Je(p,l,{...u,markerEnd:A(p,"association-end",U(l,s,u.fill),k(l,c,u.stroke))})},"bpmn:DataObject":function(p,l,u={}){return u=X(u,["fill","stroke"]),et(p,l,u)},"bpmn:DataObjectReference":V("bpmn:DataObject"),"bpmn:DataOutput":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=r.getRawPath("DATA_ARROW"),d=et(p,l,u);return g(p,m,{strokeWidth:1,fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke)}),d},"bpmn:DataOutputAssociation":function(p,l,u={}){return u=X(u,["fill","stroke"]),Je(p,l,{...u,markerEnd:A(p,"association-end",U(l,s,u.fill),k(l,c,u.stroke))})},"bpmn:DataStoreReference":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=r.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:0,my:.133}});return g(p,m,{fill:U(l,s,u.fill),fillOpacity:Ut,stroke:k(l,c,u.stroke),strokeWidth:2})},"bpmn:EndEvent":function(p,l,u={}){var{renderIcon:m=!0}=u;u=X(u,["fill","stroke"]);var d=ye(p,l,{...u,strokeWidth:4});return m&&D(l,p,u),d},"bpmn:EventBasedGateway":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=oe(l),d=Ge(p,l,u);L(p,l.width,l.height,l.height*.2,{fill:U(l,"none",u.fill),stroke:k(l,c,u.stroke),strokeWidth:1});var E=m.get("eventGatewayType"),S=!!m.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:k(l,c,u.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:k(l,c,u.stroke),strokeWidth:1})}else E==="Exclusive"&&(S||L(p,l.width,l.height,l.height*.26,{fill:"none",stroke:k(l,c,u.stroke),strokeWidth:1}),j());return d},"bpmn:ExclusiveGateway":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=Ge(p,l,u),d=r.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:l.width,containerHeight:l.height,position:{mx:.32,my:.3}}),E=Ze(l);return E.get("isMarkerVisible")&&g(p,d,{fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke),strokeWidth:1}),m},"bpmn:Gateway":function(p,l,u={}){return u=X(u,["fill","stroke"]),Ge(p,l,u)},"bpmn:Group":function(p,l,u={}){return u=X(u,["fill","stroke","width","height"]),O(p,l.width,l.height,On,{stroke:k(l,c,u.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:We(l,u),height:Ne(l,u)})},"bpmn:InclusiveGateway":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=Ge(p,l,u);return L(p,l.width,l.height,l.height*.24,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:2.5}),m},"bpmn:IntermediateEvent":function(p,l,u={}){var{renderIcon:m=!0}=u;u=X(u,["fill","stroke"]);var d=ye(p,l,{...u,strokeWidth:1.5});return L(p,l.width,l.height,Bn,{fill:"none",stroke:k(l,c,u.stroke),strokeWidth:1.5}),m&&D(l,p,u),d},"bpmn:IntermediateCatchEvent":V("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":V("bpmn:IntermediateEvent"),"bpmn:Lane":function(p,l,u={}){return u=X(u,["fill","stroke","width","height"]),x(p,l,{...u,fillOpacity:Ou})},"bpmn:ManualTask":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=re(p,l,u),d=r.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return g(p,d,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:.5}),m},"bpmn:MessageFlow":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=oe(l),d=Ze(l),E=U(l,s,u.fill),S=k(l,c,u.stroke),j=T(p,l.waypoints,{markerEnd:A(p,"messageflow-end",E,S),markerStart:A(p,"messageflow-start",E,S),stroke:S,strokeDasharray:"10, 11",strokeWidth:1.5});if(m.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};d.get("messageVisibleKind")==="initiating"?(he.fill=E,he.stroke=S):(he.fill=S,he.stroke=E);var we=g(p,ge,he),Ke=m.get("messageRef"),ie=Ke.get("name"),mt=I(p,ie,{align:"center-top",fitBox:!0,style:{fill:S}}),gn=we.getBBox(),$e=mt.getBBox(),z=Y.x-$e.width/2,J=Y.y+gn.height/2+Mu;Dn(mt,z,J,0)}return j},"bpmn:ParallelGateway":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=Ge(p,l,u),d=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:l.width,containerHeight:l.height,position:{mx:.46,my:.2}});return g(p,d,{fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke),strokeWidth:1}),m},"bpmn:Participant":function(p,l,u={}){u=X(u,["fill","stroke","width","height"]);var m=x(p,l,u),d=dt(l),E=Er(l),S=oe(l),j=S.get("name");if(d){var Y=E?[{x:30,y:0},{x:30,y:Ne(l,u)}]:[{x:0,y:30},{x:We(l,u),y:30}];G(p,Y,{stroke:k(l,c,u.stroke),strokeWidth:Du}),ae(p,j,l,u)}else{var ge=Ht(l,u);E||(ge.height=We(l,u),ge.width=Ne(l,u));var he=I(p,j,{box:ge,align:"center-middle",style:{fill:Wt(l,f,c,u.stroke)}});if(!E){var we=-1*Ne(l,u);Dn(he,0,-we,270)}}return S.get("participantMultiplicity")&&F("ParticipantMultiplicityMarker",p,l,u),m},"bpmn:ReceiveTask":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=oe(l),d=re(p,l,u),E;return m.get("instantiate")?(L(p,28,28,20*.22,{fill:U(l,s,u.fill),stroke:k(l,c,u.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,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:1}),d},"bpmn:ScriptTask":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=re(p,l,u),d=r.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return g(p,d,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:1}),m},"bpmn:SendTask":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=re(p,l,u),d=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return g(p,d,{fill:k(l,c,u.stroke),stroke:U(l,s,u.fill),strokeWidth:1}),m},"bpmn:SequenceFlow":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=U(l,s,u.fill),d=k(l,c,u.stroke),E=T(p,l.waypoints,{markerEnd:A(p,"sequenceflow-end",m,d),stroke:d}),S=oe(l),{source:j}=l;if(j){var Y=oe(j);S.get("conditionExpression")&&N(Y,"bpmn:Activity")&&te(E,{markerStart:A(p,"conditional-flow-marker",m,d)}),Y.get("default")&&(N(Y,"bpmn:Gateway")||N(Y,"bpmn:Activity"))&&Y.get("default")===S&&te(E,{markerStart:A(p,"conditional-default-flow-marker",m,d)})}return E},"bpmn:ServiceTask":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=re(p,l,u);L(p,10,10,{fill:U(l,s,u.fill),stroke:"none",transform:"translate(6, 6)"});var d=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});g(p,d,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:1}),L(p,10,10,{fill:U(l,s,u.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,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:1}),m},"bpmn:StartEvent":function(p,l,u={}){var{renderIcon:m=!0}=u;u=X(u,["fill","stroke"]);var d=oe(l);d.get("isInterrupting")||(u={...u,strokeDasharray:"6"});var E=ye(p,l,u);return m&&D(l,p,u),E},"bpmn:SubProcess":function(p,l,u={}){return dt(l)?u=X(u,["fill","stroke","width","height"]):u=X(u,["fill","stroke"]),_(p,l,u)},"bpmn:Task":function(p,l,u={}){return u=X(u,["fill","stroke"]),re(p,l,u)},"bpmn:TextAnnotation":function(p,l,u={}){u=X(u,["fill","stroke"]);var{width:m,height:d}=Ht(l,u),E=O(p,m,d,0,0,{fill:"none",stroke:"none"}),S=r.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:m,containerHeight:d,position:{mx:0,my:0}});g(p,S,{stroke:k(l,c,u.stroke)});var j=oe(l),Y=j.get("text")||"";return I(p,Y,{align:"left-top",box:Ht(l,u),padding:An,style:{fill:Wt(l,f,c,u.stroke)}}),E},"bpmn:Transaction":function(p,l,u={}){dt(l)?u=X(u,["fill","stroke","width","height"]):u=X(u,["fill","stroke"]);var m=_(p,l,{strokeWidth:1.5,...u}),d=n.style(["no-fill","no-events"],{stroke:k(l,c,u.stroke),strokeWidth:1.5}),E=dt(l);return E||(u={}),O(p,We(l,u),Ne(l,u),On-Bn,Bn,d),m},"bpmn:UserTask":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=re(p,l,u),d=15,E=12,S=r.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:d,y:E}});g(p,S,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:.5});var j=r.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:d,y:E}});g(p,j,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:.5});var Y=r.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:d,y:E}});return g(p,Y,{fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke),strokeWidth:.5}),m},label:function(p,l,u={}){return ot(p,l,u)}};this._drawPath=g,this._renderer=C}Ce(gt,Xe);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 br(e)?Tr(e,Nu):N(e,"bpmn:Event")?no(e):N(e,"bpmn:Activity")?Tr(e,On):N(e,"bpmn:Gateway")?ro(e):io(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 Dr=null;function $u(){return Dr||(Dr=document.createElement("canvas").getContext("2d")),Dr}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(po(e.fontSize)||"12px"),t.push(e.fontFamily||"sans-serif"),t.join(" ")}function po(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=po(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),A=o.top;i.vertical==="middle"&&(A+=(n.height-y)/2),A-=(s||f[0].height)/4;var W=ne("text");te(W,r),P(f,function(O){var H;switch(A+=s||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:A}),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=40;function Ln(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 Gt({style:t});this.getExternalLabelBounds=function(a,s){var c={width:Math.max(a.width,jt.width),height:30},f=o(s,c,{style:r});return{x:Math.round(a.x+a.width/2-f.width/2),y:a.y,width:Math.ceil(f.width),height:Math.ceil(f.height)}},this.getTextAnnotationBounds=function(a,s){var c=o(s,a,{style:t,align:"left-top",padding:An});return{x:a.x,y:a.y,width:a.width,height:Math.max(Xu,Math.round(c.height))}},this.getDimensions=function(a,s){return i.getDimensions(a,s||{})};function o(a,s,c){return i.getDimensions(a,M({box:s},c))}this.createText=function(a,s){return i.createText(a,s||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return r}}Ln.$inject=["config.textRenderer"];function Nr(){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,f=0;f':""}function jn(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?[Fn(t),Fn(n)]:r.map(function(i){return{x:i.x,y:i.y}})}function yo(e,t,n){return new Error(`element ${Se(t)} referenced by ${Se(e)}#${n} not yet drawn`)}function it(e,t,n,r,i){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=r,this._textRenderer=i}it.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"];it.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(jn(e,t,a)),this._canvas.addRootElement(r)}else if(N(t,"bpmndi:BPMNShape")){var s=!dt(e,t),c=sl(e);i=n&&(n.hidden||n.collapsed);var f=t.bounds;r=this._elementFactory.createShape(jn(e,t,{collapsed:s,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,Fn(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(jn(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 Wi(e)&&$t(r)&&this.addLabel(e,t,r),this._eventBus.fire("bpmnElement.added",{element:r}),r};it.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 yo(e,n,"attachedToRef");t.host=r,i||(r.attachers=i=[]),i.indexOf(t)===-1&&i.push(t)};it.prototype.addLabel=function(e,t,n){var r,i,o;return r=Hi(t,n),i=$t(n),i&&(r=this._textRenderer.getExternalLabelBounds(r,i)),o=this._elementFactory.createLabel(jn(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!$t(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)};it.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?yo(e,r,t+"Ref"):new Error(`${Se(e)}#${t} Ref not specified`)};it.prototype._getSource=function(e){return this._getConnectedElement(e,"source")};it.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")};it.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 go={__depends__:[In],bpmnImporter:["type",it]};var vo={__depends__:[ho,go]};Q();function $n(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}$n.prototype.next=function(){return this._prefix+ ++this._counter};var ul=new $n("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?nt(t.overlays,xn({type:e.type})):t.overlays.slice():[]}else return e.type?nt(this._overlays,xn({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&&(zt(r.html),zt(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(){Vn(this._overlayRoot)};be.prototype.hide=function(){Vn(this._overlayRoot,!1)};be.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Tn(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=Mt(t);r=o.x,i=o.y}Eo(n,r,i),kn(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=Mt(r).width:a=r.width,i=t.right*-1+a}if(t.bottom!==void 0){var s;r.waypoints?s=Mt(r).height:s=r.height,o=t.bottom*-1+s}Eo(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(",")+")";bo(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&&Bt(i).add("djs-overlay-"+e.type);var a=this._canvas.findRoot(n),s=this._canvas.getRootElement();Vn(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())};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,s=this._canvas.getRootElement(),c=!0;(r!==s||n&&(wt(i)&&i>t.scale||wt(o)&&oi&&(a=(1/t.scale||1)*i)),wt(a)&&(s="scale("+a+","+a+")"),bo(o,s)};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){zt(a.html);var s=t._overlayContainers.indexOf(a);s!==-1&&t._overlayContainers.splice(s,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&&Bt(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 Eo(e,t,n){Pe(e,{left:t+"px",top:n+"px"})}function Vn(e,t){e.style.display=t===!1?"none":""}function bo(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}var qn={__init__:["overlays"],overlays:["type",be]};function Wn(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(_n(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)})}Wn.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var xo={__init__:["changeSupport"],changeSupport:["type",Wn]};Q();var fl=1e3;function Ae(e){this._eventBus=e}Ae.$inject=["eventBus"];function pl(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}Ae.prototype.on=function(e,t,n,r,i,o){if((tt(t)||Me(t))&&(o=i,i=r,r=n,n=t,t=null),tt(n)&&(o=i,i=r,r=n,n=fl),_e(i)&&(o=i,i=!1),!tt(r))throw new Error("handlerFn must be a function");xe(e)||(e=[e]);var a=this._eventBus;P(e,function(s){var c=["commandStack",s,t].filter(function(f){return f}).join(".");a.on(c,n,i?pl(r,o):r,o)})};Ae.prototype.canExecute=vt("canExecute");Ae.prototype.preExecute=vt("preExecute");Ae.prototype.preExecuted=vt("preExecuted");Ae.prototype.execute=vt("execute");Ae.prototype.executed=vt("executed");Ae.prototype.postExecute=vt("postExecute");Ae.prototype.postExecuted=vt("postExecuted");Ae.prototype.revert=vt("revert");Ae.prototype.reverted=vt("reverted");function vt(e){return function(n,r,i,o,a){(tt(n)||Me(n))&&(a=o,o=i,i=r,r=n,n=null),this.on(n,e,r,i,o,a)}}function un(e,t){t.invoke(Ae,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(un,Ae);un.$inject=["canvas","injector"];var wo={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",un]};Q();var hl={"&":"&","<":"<",">":">",'"':""","'":"'"};function Et(e){return e=""+e,e&&e.replace(/[&<>"']/g,function(t){return hl[t]})}var ml="_plane";function ln(e){var t=e.id;return N(e,"bpmn:SubProcess")?dl(t):t}function dl(e){return e+ml}var yl="bjs-breadcrumbs-shown";function Hn(e,t,n){var r=ee('
              '),i=n.getContainer(),o=Bt(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&&s()});function s(c){c&&(a=gl(c));var f=a.flatMap(function(y){var v=n.findRoot(ln(y))||n.findRoot(y.id);if(!v&&N(y,"bpmn:Process")){var A=t.find(function(O){var H=oe(O);return H&&H.get("processRef")===y});v=A&&n.findRoot(A.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){s(c.element)})}Hn.$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 zn(e,t){var n=null,r=new vl;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,!(!N(o,"bpmn:SubProcess")&&!s)){s=s||{x:0,y:0,zoom:1};var c=(a.x-s.x)*a.scale,f=(a.y-s.y)*a.scale;(c!==0||f!==0)&&t.scroll({dx:c,dy:f}),s.zoom!==a.scale&&t.zoom(s.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){r.clear(),n=null})}zn.$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 _o={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 s=a.$parent;N(a,"bpmn:SubProcess")&&!o.isExpanded&&n.push(a),bl(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};bt.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=El(e),r={x:n.x-_o.x,y:n.y-_o.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=So(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 So(e){return N(e,"bpmndi:BPMNDiagram")?e:So(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=sn(n.bounds);t.top=Math.min(r.top,t.top),t.left=Math.min(r.left,t.left)}}),mo(t)}function bl(e,t){var n=e.$parent;return!(!N(n,"bpmn:SubProcess")||n===t.bpmnElement||ji(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))}var Un=250,xl='',wl="bjs-drilldown-empty";function ut(e,t,n,r,i){Ae.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",Un,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.reverted("shape.toggleCollapse",Un,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.executed(["shape.create","shape.move","shape.delete"],Un,function(a){var s=a.oldParent,c=a.newParent||a.parent,f=a.shape;o._canDrillDown(f)&&o._addOverlay(f),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(f)},!0),this.reverted(["shape.create","shape.move","shape.delete"],Un,function(a){var s=a.oldParent,c=a.newParent||a.parent,f=a.shape;o._canDrillDown(f)&&o._addOverlay(f),o._updateDrilldownOverlay(s),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,Ae);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(ln(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;Bt(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"),s=this._translate("Open {element}",{element:a});o.setAttribute("title",s),o.addEventListener("click",function(){t.setRootElement(t.findRoot(ln(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 Ao={__depends__:[qn,xo,wo],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Hn],drilldownCentering:["type",zn],drilldownOverlayBehavior:["type",ut],subprocessCompatibility:["type",bt]};Q();function Or(e){return e.originalEvent||e.srcEvent}function Ro(e,t){return(Or(e)||e).button===t}function Kt(e){return Ro(e,0)}function Co(e){return Ro(e,1)}function Po(e){var t=Or(e)||e;return Kt(e)&&t.shiftKey}function _l(e){return!0}function Gn(e){return Kt(e)||Co(e)}var ko=500;function Kn(e,t,n){var r=this;function i(b,D,R){if(!s(b,D)){var F,B,I;R?B=t.getGraphics(R):(F=D.delegateTarget||D.target,F&&(B=F,R=t.get(B))),!(!B||!R)&&(I=e.fire(b,{element:R,gfx:B,originalEvent:D}),I===!1&&(D.stopPropagation(),D.preventDefault()))}}var o={};function a(b){return o[b]}function s(b,D){var R=f[b]||Kt;return!R(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":Gn,"element.mouseup":Gn,"element.click":Gn,"element.dblclick":Gn};function h(b,D,R){var F=c[b];if(!F)throw new Error("unmapped DOM event name <"+b+">");return i(F,D,R)}var y="svg, .djs-element";function v(b,D,R,F){var B=o[R]=function(I){i(R,I)};F&&(f[R]=F),B.$delegate=on.bind(b,y,D,B)}function A(b,D,R){var F=a(R);F&&on.unbind(b,D,F.$delegate)}function W(b){P(c,function(D,R){v(b,R,D)})}function L(b){P(c,function(D,R){A(b,R,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,R=b.gfx;e.fire("interactionEvents.createHit",{element:D,gfx:R})}),e.on(["shape.changed","connection.changed"],ko,function(b){var D=b.element,R=b.gfx;e.fire("interactionEvents.updateHit",{element:D,gfx:R})}),e.on("interactionEvents.createHit",ko,function(b){var D=b.element,R=b.gfx;r.createDefaultHit(D,R)}),e.on("interactionEvents.updateHit",function(b){var D=b.element,R=b.gfx;r.updateDefaultHit(D,R)});var O=w("djs-hit djs-hit-stroke"),H=w("djs-hit djs-hit-click-stroke"),G=w("djs-hit djs-hit-all"),T=w("djs-hit djs-hit-no-move"),g={all:G,"click-stroke":H,stroke:O,"no-move":T};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 R=g[D];if(!R)throw new Error("invalid hit type <"+D+">");return te(b,R),b}function V(b,D){fe(b,D)}this.removeHits=function(b){var D=uo(".djs-hit",b);P(D,Dt)},this.createDefaultHit=function(b,D){var R=b.waypoints,F=b.isFrame,B;return R?this.createWaypointsHit(D,R):(B=F?"stroke":"all",this.createBoxHit(D,B,{width:b.width,height:b.height}))},this.createWaypointsHit=function(b,D){var R=qt(D);return C(R,"stroke"),V(b,R),R},this.createBoxHit=function(b,D,R){R=M({x:0,y:0},R);var F=ne("rect");return C(F,D),te(F,R),V(b,F),F},this.updateDefaultHit=function(b,D){var R=He(".djs-hit",D);if(R)return b.waypoints?kr(R,b.waypoints):te(R,{width:b.width,height:b.height}),R},this.fire=i,this.triggerMouseEvent=h,this.mouseHandler=a,this.registerEvent=v,this.unregisterEvent=A}Kn.$inject=["eventBus","elementRegistry","styles"];var To={__init__:["interactionEvents"],interactionEvents:["type",Kn]};Q();function Rt(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)})}Rt.$inject=["eventBus","canvas"];Rt.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})}};Rt.prototype.get=function(){return this._selectedElements};Rt.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1};Rt.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 s=i.findRoot(a);return o===s}),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 Mo="hover",Do="selected";function Yn(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,Mo)}),t.on("element.out",function(i){r(i.element,Mo)}),t.on("selection.changed",function(i){function o(f){r(f,Do)}function a(f){n(f,Do)}var s=i.oldSelection,c=i.newSelection;P(s,function(f){c.indexOf(f)===-1&&o(f)}),P(c,function(f){s.indexOf(f)===-1&&a(f)})})}Yn.$inject=["canvas","eventBus"];Q();function Xn(e,t,n,r){e.on("create.end",500,function(i){var o=i.context,a=o.canExecute,s=o.elements,c=o.hints||{},f=c.autoSelect;if(a){if(f===!1)return;xe(f)?t.select(f):t.select(s.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),s=ve(o,function(c){return a.id===c.id});s||t.select(a)}),e.on("element.click",function(i){if(Kt(i)){var o=i.element;o===n.getRootElement()&&(o=null);var a=t.isSelected(o),s=t.get().length>1,c=Po(i);if(a&&s)return c?t.deselect(o):t.select(o);a?t.deselect(o):t.select(o,c)}})}Xn.$inject=["eventBus","selection","canvas","elementRegistry"];function Sl(e){return!e.hidden}var No={__init__:["selectionVisuals","selectionBehavior"],__depends__:[To],selection:["type",Rt],selectionVisuals:["type",Yn],selectionBehavior:["type",Xn]};Q();var Al=/^class[ {]/;function Rl(e){return Al.test(e.toString())}function Ir(e){return Array.isArray(e)}function Lr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Zn(...e){e.length===1&&Ir(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(Rl(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 Fr(e,t){let n=t||{get:function(T,g){if(r.push(T),g===!1)return null;throw s(`No provider for "${T}"!`)}},r=[],i=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),a=o.injector=this,s=function(T){let g=r.join(" -> ");return r.length=0,new Error(g?`${T} (Resolving: ${g})`:T)};function c(T,g){if(!i[T]&&T.includes(".")){let w=T.split("."),C=c(w.shift());for(;w.length;)C=C[w.shift()];return C}if(Lr(o,T))return o[T];if(Lr(i,T)){if(r.indexOf(T)!==-1)throw r.push(T),s("Cannot resolve circular dependency!");return r.push(T),o[T]=i[T][0](i[T][1]),r.pop(),o[T]}return n.get(T,g)}function f(T,g){if(typeof g=="undefined"&&(g={}),typeof T!="function")if(Ir(T))T=Zn(T.slice());else throw s(`Cannot invoke "${T}". Expected a function!`);let C=(T.$inject||Tl(T)).map(V=>Lr(g,V)?g[V]:c(V));return{fn:T,dependencies:C}}function h(T){let{fn:g,dependencies:w}=f(T),C=Function.prototype.bind.call(g,null,...w);return new C}function y(T,g,w){let{fn:C,dependencies:V}=f(T,w);return C.apply(g,V)}function v(T){return Zn(g=>T.get(g))}function A(T,g){if(g&&g.length){let w=Object.create(null),C=Object.create(null),V=[],b=[],D=[],R,F,B,I;for(let K in i)R=i[K],g.indexOf(K)!==-1&&(R[2]==="private"?(F=V.indexOf(R[3]),F===-1?(B=R[3].createChild([],g),I=v(B),V.push(R[3]),b.push(B),D.push(I),w[K]=[I,K,"private",B]):w[K]=[D[F],K,"private",b[F]]):w[K]=[R[2],R[1]],C[K]=!0),(R[2]==="factory"||R[2]==="type")&&R[1].$scope&&g.forEach(ot=>{R[1].$scope.indexOf(ot)!==-1&&(w[K]=[R[2],R[1]],C[ot]=!0)});g.forEach(K=>{if(!C[K])throw new Error('No provider for "'+K+'". Cannot use provider from the parent!')}),T.unshift(w)}return new Fr(T,a)}let W={factory:y,type:h,value:function(T){return T}};function L(T,g){let w=T.__init__||[];return function(){w.forEach(C=>{typeof C=="string"?g.get(C):g.invoke(C)})}}function O(T){let g=T.__exports__;if(g){let w=T.__modules__,C=Object.keys(T).reduce((F,B)=>(B!=="__exports__"&&B!=="__modules__"&&B!=="__init__"&&B!=="__depends__"&&(F[B]=T[B]),F),Object.create(null)),V=(w||[]).concat(C),b=A(V),D=Zn(function(F){return b.get(F)});g.forEach(function(F){i[F]=[D,F,"private",b]});let R=(T.__init__||[]).slice();return R.unshift(function(){b.init()}),T=Object.assign({},T,{__init__:R}),L(T,b)}return Object.keys(T).forEach(function(w){if(w==="__init__"||w==="__depends__")return;let C=T[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(T,a)}function H(T,g){return T.indexOf(g)!==-1||(T=(g.__depends__||[]).reduce(H,T),T.indexOf(g)!==-1)?T:T.concat(g)}function G(T){let g=T.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=A,this.init=G(e)}function Ml(e,t){return e!=="value"&&Ir(t)&&(t=Zn(t.slice())),t}Q();var Dl=1;function lt(e,t){Xe.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,Xe);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}),Sn(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=qt(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 jr(){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 Bo={__init__:["defaultRenderer"],defaultRenderer:["type",lt],styles:["type",jr]};Q();function Oo(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return n!==-1&&e.splice(n,1),n}function Lo(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 Qn(e,t){return Math.round(e*t)/t}function Io(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:Io(e.width),height:Io(e.height)}),t.appendChild(n),n}function Fo(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",jo=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%"}),kn(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=Fo(r,"viewport");e.deferUpdate&&(this._viewboxChanged=dr(Ye(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=_n(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,jo)};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:Fo(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&&(Dt(n),t.visible=!1),n};q.prototype._removeLayer=function(e){let t=this._layers[e];t&&(delete this._layers[e],Dt(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,jo);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(!bn(n,function(i){return typeof t[i]!="undefined"}))throw new Error("must supply { "+n.join(", ")+" } with "+e)};q.prototype._setParent=function(e,t,n){Lo(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),Oo(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,s,c,f;if(e)this._changeViewbox(function(){s=Math.min(n.width/e.width,n.height/e.height);let h=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);Nt(t,h)});else return o=this._rootElement?this.getActiveLayer():null,r=o&&o.getBBox()||{},a=Nt(t),i=a?a.matrix:Qi(),s=Qn(i.a,1e3),c=Qn(-i.e||0,1e3),f=Qn(-i.f||0,1e3),e=this._cachedViewbox={x:c?c/s:0,y:f?f/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};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),$o(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=Mt(e),o=sn(i),a=this.viewbox(),s=this.zoom(),c,f;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 h=sn(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,s,c,f,h;c=r.getCTM();let y=c.a;return t?(a=M(o,t),s=a.matrixTransform(c.inverse()),f=i.translate(s.x,s.y).scale(1/y*e).translate(-s.x,-s.y),h=c.multiply(f)):h=i.scale(e),$o(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 Yt="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,Yt,r),n&&te(n,Yt,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,Yt,""),r.secondaryGfx&&te(r.secondaryGfx,Yt,""),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,Yt,r),t};Be.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&te(e,Yt);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?Vo(this,t,e):Vl(this,t,e)};ze.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return jl(n)||Vo(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 $r=new ze({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Wo=new ze({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),qo=new ze({name:"attachers",collection:!0},{name:"host"}),Ho=new ze({name:"outgoing",collection:!0},{name:"source"}),zo=new ze({name:"incoming",collection:!0},{name:"target"});function cn(){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)}}),$r.bind(this,"parent"),Wo.bind(this,"labels"),Ho.bind(this,"outgoing"),zo.bind(this,"incoming")}function fn(){cn.call(this),$r.bind(this,"children"),qo.bind(this,"host"),qo.bind(this,"attachers")}Ce(fn,cn);function Uo(){cn.call(this),$r.bind(this,"children")}Ce(Uo,fn);function Go(){fn.call(this),Wo.bind(this,"labelTarget")}Ce(Go,fn);function Ko(){cn.call(this),Ho.bind(this,"source"),zo.bind(this,"target")}Ce(Ko,cn);var ql={connection:Ko,shape:fn,label:Go,root:Uo};function Yo(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++),Yo(e,t)};Q();var Jn="__fn",Xo=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],tt(t)&&(r=n,n=t,t=Xo),!Me(t))throw new Error("priority must be a number");var i=n;r&&(i=Ye(n,r),i[Jn]=n[Jn]||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(tt(t)&&(r=n,n=t,t=Xo),!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[Jn]=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 pn;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 pn?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 gr(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 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};Ue.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,i=t.split("#"),o=Re(i[0],r),a=Re(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};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,Ye(function(o){o=M({},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 Pt(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,P(e,Ye(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;ta(t,e,"prefix"),ta(t,e,"uri"),P(e.types,Ye(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=Re(e.name,t.prefix),r=n.name,i={};P(e.properties,Ye(function(o){var a=Re(o.name,n.prefix),s=a.name;Vr(o.type)||(o.type=Re(o.type,a.prefix).name),M(o,{ns:a,name:s}),i[s]=o},this)),M(e,{ns:n,name:r,propertiesByName:i}),P(e.extends,Ye(function(o){var a=Re(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};Pt.prototype.mapTypes=function(e,t,n){var r=Vr(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(c,f){var h=Re(c,Vr(c)?"":e.prefix);i.mapTypes(h,t,f)}function a(c){return o(c,!0)}function s(c){return o(c,!1)}if(!r)throw new Error("unknown type <"+e.name+">");P(r.superClass,n?a:s),t(r,!n),P(r.traits,a)};Pt.prototype.getEffectiveDescriptor=function(e){var t=Re(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 ta(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[qr(t)]:r?i in e?e[i]=n:ia(e,r,n):e.$attrs[qr(t)]=n};Ot.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[qr(t)];var r=n.name;return!e[r]&&n.isMany&&ia(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 ia(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function qr(e){return e.replace(/^:/,"")}function Fe(e,t={}){this.properties=new Ot(this),this.factory=new na(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=Re(e),i={$type:e,$instanceOf:function(a){return a===this.$type},get:function(a){return this[a]},set:function(a,s){yr(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}),P(n,function(a,s){_e(a)&&a.value!==void 0?i[a.name]=a.value:i[s]=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 oa=String.fromCharCode,Yl=Object.prototype.hasOwnProperty,Xl=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,hn={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(hn).forEach(function(e){hn[e.toUpperCase()]=hn[e]});function Zl(e,t,n,r){return r?Yl.call(hn,r)?hn[r]:"&"+r+";":oa(t||parseInt(n,16))}function Lt(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(Xl,Zl):e}var aa="non-whitespace outside of root node";function Xt(e){return new Error(e)}function sa(e){return"missing namespace for prefix <"+e+">"}function tr(e){return{get:e,enumerable:!0}}function Ql(e){var t={},n;for(n in e)t[n]=e[n];return t}function zr(e){return e+"$uri"}function Jl(e){var t={},n,r;for(n in e)r=e[n],t[r]=r,t[zr(r)]=n;return t}function ua(){return{line:0,column:0}}function ec(e){throw e}function Ur(e){if(!this)return new Ur(e);var t=e&&e.proxy,n,r,i,o,a=ec,s,c,f,h,y=ua,v=!1,A=!1,W=null,L=!1,O;function H(g){g instanceof Error||(g=Xt(g)),W=g,a(g,y)}function G(g){s&&(g instanceof Error||(g=Xt(g)),s(g,y))}this.on=function(g,w){if(typeof w!="function")throw Xt("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":s=w;break;case"cdata":o=w;break;case"attention":h=w;break;case"question":f=w;break;case"comment":c=w;break;default:throw Xt("unsupported event: "+g)}return this},this.ns=function(g){if(typeof g=="undefined"&&(g={}),typeof g!="object")throw Xt("required args ");var w={},C;for(C in g)w[C]=g[C];return A=!0,O=w,this},this.parse=function(g){if(typeof g!="string")throw Xt("required args ");return W=null,T(g),y=ua,L=!1,W},this.stop=function(){L=!0};function T(g){var w=A?[]:null,C=A?Jl(O):null,V,b=[],D=0,R=!1,F=!1,B=0,I=0,K,ot,ae,Z,Je,et,ye,Ge,x,_="",$=0,re;function je(){if(re!==null)return re;var l,u,m,d=A&&C.xmlns,E=A&&v?[]:null,S=$,j=_,Y=j.length,ge,he,we,Ke,ie,mt={},gn={},$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 gn){G("attribute <"+ie+"> already defined");continue}if(gn[ie]=!0,!A){mt[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),u=zr(he),Ke=O[l],!Ke){if(he==="xmlns"||u in C&&C[u]!==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[zr(Ke)]=l,d=Ke),C[u]=l),mt[ie]=we;continue}E.push(ie,we);continue}if(z=ie.indexOf(":"),z===-1){mt[ie]=we;continue}if(!(m=C[ie.substring(0,z)])){G(sa(ie.substring(0,z)));continue}ie=d===m?ie.substr(z+1):m+ie.substr(z),mt[ie]=we}if(v)for(S=0,Y=E.length;S=d&&(S=l.exec(g),!(!S||(E=S[0].length+S.index,E>B)));)u+=1,d=E;return B==-1?(m=E,j=g.substring(I)):I===0?j=g.substring(I,B):(m=B-d,j=I==-1?g.substring(B):g.substring(B,I+1)),{data:j,line:u,column:m}}for(y=p,t&&(x=Object.create({},{name:tr(function(){return ye}),originalName:tr(function(){return Ge}),attrs:tr(je),ns:tr(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(Je=g.charCodeAt(K),isNaN(Je))return I=-1,H("unclosed tag");if(Je===34)ae=g.indexOf('"',K+1),K=ae!==-1?ae:K;else if(Je===39)ae=g.indexOf("'",K+1),K=ae!==-1?ae:K;else if(Je===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(R=!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),R=!0,F=!0):(K=ye=g.substring(B+1,I),R=!0,F=!1),!(Z>96&&Z<123||Z>64&&Z<91||Z===95||Z===58))return H("illegal first char nodeName");for(ae=1,ot=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(A){if(V=C,R&&(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(et=C[ye.substring(0,Z)],!et)return H("missing namespace on <"+Ge+">");ye=ye.substr(Z+1)}else et=C.xmlns;et&&(ye=et+":"+ye)}if(R&&($=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,R,y),L))return;A&&(R?C=V:C=w.pop())}I+=1}}}function la(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var Gr={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},ca="property";function fa(e){return e.xml&&e.xml.serialize}function tc(e){let t=fa(e);return t!==ca&&(t||null)}function nc(e){return e.charAt(0).toUpperCase()+e.slice(1)}function pa(e,t){return la(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=Re(e,t.xmlns),i=`${t[r.prefix]||r.prefix}:${r.localName}`,o=Re(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 mn(){}mn.prototype.handleEnd=function(){};mn.prototype.handleText=function(){};mn.prototype.handleNode=function(){};function Kr(){}Kr.prototype=Object.create(mn.prototype);Kr.prototype.handleNode=function(){return this};function Qt(){}Qt.prototype=Object.create(mn.prototype);Qt.prototype.handleText=function(e){this.body=(this.body||"")+e};function dn(e,t){this.property=e,this.context=t}dn.prototype=Object.create(Qt.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 Yr(e,t){this.element=t,this.propertyDesc=e}Yr.prototype=Object.create(Qt.prototype);Yr.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=er(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)};function nr(){}nr.prototype=Object.create(Qt.prototype);nr.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(nr.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+">");Qt.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=er(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,s;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=er(h.type,c):f==="xmlns"?f=":"+f:(s=Re(f,r.ns.prefix),a.getPackage(s.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=Re(t),r=this.type,i=this.model,o=xt(r),a=n.name,s=o.propertiesByName[a];if(s&&!s.isAttr){let f=tc(s);if(f){let h=e.attributes[f];if(h){let y=ic(h,e.ns,i),v=i.getType(y);return M({},s,{effectiveType:xt(v).name})}}return s}var c=i.getPackage(n.prefix);if(c){let f=pa(n,c),h=i.getType(f);if(s=ve(o.properties,function(y){return!y.isVirtual&&!y.isReference&&!y.isAttribute&&h.hasType(y.type)}),s)return M({},s,{effectiveType:xt(h).name})}else if(s=ve(o.properties,function(f){return!f.isReference&&!f.isAttribute&&f.type==="Element"}),s)return s;throw kt("unrecognized element <"+n.name+">")};Te.prototype.toString=function(){return"ElementDescriptor["+xt(this.type).name+"]"};Te.prototype.valueHandler=function(e,t){return new Yr(e,t)};Te.prototype.referenceHandler=function(e){return new dn(e,this.context)};Te.prototype.handler=function(e){return e==="Element"?new Zt(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,Hr(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 Xr(e,t,n){Te.call(this,e,t,n)}Xr.prototype=Object.create(Te.prototype);Xr.prototype.createElement=function(e){var t=e.name,n=Re(t),r=this.model,i=this.type,o=r.getPackage(n.prefix),a=o&&pa(n,o)||t;if(!i.hasType(a))throw kt("unexpected element <"+e.originalName+">");return Te.prototype.createElement.call(this,e)};function Zt(e,t,n){this.model=e,this.context=n}Zt.prototype=Object.create(nr.prototype);Zt.prototype.createElement=function(e){var t=e.name,n=Re(t),r=n.prefix,i=e.ns[r+"$uri"],o=e.attributes;return this.model.createAny(t,i,o)};Zt.prototype.handleChild=function(e){var t=new Zt(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};Zt.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function rr(e){e instanceof Fe&&(e={model:e}),M(this,{lax:!1},e)}rr.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})),s=new Ur({proxy:!0}),c=ac();r.context=a,c.push(r);function f(w,C,V){var b=C(),D=b.line,R=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: `+R+` + 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,R=w[b.id],F=xt(D).propertiesByName[b.property];if(R||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),R?B[I]=R:B.splice(I,1)}else D.set(F.name,R)}}function v(){c.pop().handleEnd()}var A=/^<\?xml /i,W=/ encoding="([^"]+)"/i,L=/^utf-8$/i;function O(w){if(A.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 Kr)}}function G(w,C){try{c.peek().handleText(w)}catch(V){h(V,C)}}function T(w,C){w.trim()&&G(w,C)}var g=i.getPackages().reduce(function(w,C){return w[C.uri]=C.prefix,w},Object.entries(Gr).reduce(function(w,[C,V]){return w[V]=C,w},i.config&&i.config.nsMap||{}));return s.ns(g).on("openTag",function(w,C,V,b){var D=w.attrs||{},R=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:R,ns:w.ns};H(F,b)}).on("question",O).on("closeTag",v).on("cdata",G).on("text",function(w,C,V){T(C(w),V)}).on("error",f).on("warn",h),new Promise(function(w,C){var V;try{s.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,R=a.references,F=a.elementsById;return V?(V.warnings=D,C(V)):w({rootElement:b,elementsById:F,references:R,warnings:D})})};rr.prototype.handler=function(e){return new Xr(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,ha=/<|>|&/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 la(t)?lc(e):e}function ma(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 mc(e){var t=e.$descriptor;return nt(t.properties,function(n){var r=n.name;if(n.isVirtual||!at(e,r))return!1;var i=e[r];return i===n.default||i===null?!1:n.isMany?i.length:!0})}var dc={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},yc={"<":"lt",">":"gt","&":"amp"};function ya(e,t,n){return e=De(e)?e:""+e,e.replace(t,function(r){return"&"+n[r]+";"})}function gc(e){return ya(e,uc,dc)}function vc(e){return ya(e,ha,yc)}function Ec(e){return nt(e,function(t){return t.isAttr})}function bc(e){return nt(e,function(t){return!t.isAttr})}function Zr(e){this.tagName=e}Zr.prototype.build=function(e){return this.element=e,this};Zr.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(ha)!==-1&&(this.escape=!0),this};function Qr(e){this.tagName=e}ma(Qr,It);Qr.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=mc(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=Re(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=Re(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,s=i.isMany;if(s||(o=[o]),i.isBody)n.push(new It().build(i,o[0]));else if(Hr(i.type))P(o,function(f){n.push(new Qr(t.addTagName(t.nsPropertyTagName(i))).build(i,f))});else if(a)P(o,function(f){n.push(new Zr(t.addTagName(t.nsPropertyTagName(i))).build(f))});else{var c=fa(i);P(o,function(f){var h;c?c===ca?h=new se(t,i):h=new ir(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,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};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=hr(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 ir(e,t,n){se.call(this,e,t),this.serialization=n}ma(ir,se);ir.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};ir.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 ga(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,s=n.$model;if(a.getNamespaces().mapDefaultPrefixes(_c(s)),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 Gr)n[r]=Gr[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 or(e,t){Fe.call(this,e,t)}or.prototype=Object.create(Fe.prototype);or.prototype.fromXML=function(e,t,n){De(t)||(n=t,t="bpmn:Definitions");var r=new rr(M({model:this,lax:!0},n)),i=r.handler(t);return r.fromXML(e,i)};or.prototype.toXML=function(e,t){var n=new ga(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",Ac="http://www.omg.org/spec/BPMN/20100524/MODEL",Rc="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:Ac,prefix:Rc,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 va(e,t){let n=M({},hf,e);return new or(n,t)}Q();Q();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 Jr(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 s(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]&&s(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]=_:h(`no bpmnElement referenced in ${Se(_)}`,{element:_})};function v(x){A(x.plane)}function A(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 $=nt(x,function(re){return!a(re)&&Le(re,"bpmn:Process")&&re.laneSets});$.forEach(i(O,_))}function G(x,_){f(x,_)}function T(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 R=this.handleSubProcess=function(_,$){Z(_,$),b(_.artifacts,$)};function F(x,_){var $=f(x,_);Le(x,"bpmn:SubProcess")&&R(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&&ot(x.childLaneSet,$||_),Ge(x)})}function ot(x,_){P(x.lanes,i(K,_))}function ae(x,_){P(x,i(ot,_))}function Z(x,_){Je(x.flowElements,_),x.laneSets&&ae(x.laneSets,_)}function Je(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 et(x,_){var $=f(x,_),re=x.processRef;re&&O(re,$||_)}function ye(x,_){P(x.participants,i(et,_)),n.push(function(){T(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,s=[];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){s.push({message:L,context:O})}},v=new Jr(y);h=h||f.diagrams&&f.diagrams[0];var A=df(f,h);if(!A)throw new Error("no diagram to display");P(A,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:s}),f({warnings:s})}catch(y){return y.warnings=s,h(y)}})}function df(e,t){if(!(!t||!t.plane)){var n=t.plane.bpmnElement,r=n;!N(n,"bpmn:Process")&&!N(n,"bpmn:Collaboration")&&(r=yf(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),s=[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&&(s.push(f),c.push(h))}}),s}}function ba(e){var t=[];return P(e,function(n){n&&(t.push(n),t=t.concat(ba(n.flowElements)))}),t}function yf(e){for(var t=e;t;){if(N(t,"bpmn:Process"))return t;t=t.$parent}}var gf='',ei=gf,ti={verticalAlign:"middle"},ni={color:"#404040"},vf={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},Ef={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},bf={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"},xf='
              '+ei+'Web-based tooling for BPMN, DMN and forms powered by bpmn.io.
              ',pt;function wf(){pt=ee(xf),Pe(pt,vf),Pe(He("svg",pt),ti),Pe(He(".backdrop",pt),Ef),Pe(He(".notice",pt),bf),Pe(He(".link",pt),ni,{margin:"15px 20px 15px 10px",alignSelf:"center"})}function xa(){pt||(wf(),on.bind(pt,".backdrop","click",function(e){document.body.removeChild(pt)})),document.body.appendChild(pt)}function pe(e){e=M({},Sf,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),this._init(this._container,this._moddle,e),Rf(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 s=a.rootElement,c=a.references,f=a.warnings,h=a.elementsById;o=o.concat(f),s=this._emit("import.parse.complete",i({error:null,definitions:s,elementsById:h,references:c,warnings:o}))||s;let y=await this.importDefinitions(s,n);return o=o.concat(y.warnings),this._emit("import.done",{error:null,warnings:o}),{warnings:o}}catch(a){let s=a;throw o=o.concat(s.warnings||[]),ar(s,o),s=_f(s),this._emit("import.done",{error:s,warnings:s.warnings}),s}};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 ar(o,[]),o}if(typeof t=="string"&&(r=Af(n,t),!r)){let o=new Error("BPMNDiagram <"+t+"> not found");throw ar(o,[]),o}try{this.clear()}catch(o){throw ar(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),s=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()&&et.prototype.clear.call(this)};se.prototype.destroy=function(){et.prototype.destroy.call(this),Nt(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=T(Bn(r,["additionalModules"]),{canvas:T({},r.canvas,{container:e}),modules:u});et.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=T({},this._moddleExtensions,e.moddleExtensions);return new mo(t)};se.prototype._modules=[];function jr(e,t){return e.warnings=t,e}function Qu(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 Ju={width:"100%",height:"100%",position:"relative"};function Eo(e){return e+(Te(e)?"px":"")}function el(e,t){return t&&he(e.diagrams,function(r){return r.id===t})||null}function tl(e){let r=''+Rn+"",n=xe(r);we(Le("svg",n),Cn),we(n,Pn,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(n),cr.bind(n,"click",function(i){vo(),i.preventDefault()})}function vt(e){se.call(this,e)}Ee(vt,se);vt.prototype._modules=[hi,wi,wr,Ti,yr];vt.prototype._moddleExtensions={};var xo=globalThis;xo.BpmnJS=vt;xo.BpmnJS.Viewer=vt;var Oh=vt;})(); +'+s+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),zt(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),s=M(vr(n,["additionalModules"]),{canvas:M({},n.canvas,{container:e}),modules:a});ct.call(this,s),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 va(t)};pe.prototype._modules=[];function ar(e,t){return e.warnings=t,e}function _f(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 Sf={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 Rf(e){let n=''+ei+"",r=ee(n);Pe(He("svg",r),ti),Pe(r,ni,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(r),Mn.bind(r,"click",function(i){xa(),i.preventDefault()})}function ht(e){pe.call(this,e)}Ce(ht,pe);ht.prototype._modules=[vo,Ao,qn,No,In];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=` + +`,Ff=-7,jf=-7,$f=500,Na={resolver:{resolveRule:function(){return null}},config:{}},ja={error:La,warning:Ia,success:Da,info:Fa,inactive:Da};function me(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 s=this;i.on(["import.done","elements.changed","linting.configChanged","linting.toggle"],$f,function(f){s.update()}),i.on("linting.toggle",function(f){f.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()===Na)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()}me.prototype.setLinterConfig=function(e){if(!e.config||!e.resolver)throw new Error("Expected linterConfig = { config, resolver }");this._linterConfig=e,this._eventBus.fire("linting.configChanged")};me.prototype.getLinterConfig=function(){return this._linterConfig};me.prototype._init=function(){this._createButton(),this._updateButton()};me.prototype.isActive=function(){return this._active};me.prototype._formatIssues=function(e){let t=this,n=Ve(e,function(o,a,s){return o.concat(a.map(function(c){return c.rule=s,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 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=Ft(n,function(o){return o.id}),n};me.prototype.toggle=function(e){return e=typeof e=="undefined"?!this.isActive():e,this._setActive(e),e};me.prototype._setActive=function(e){this._active!==e&&(this._active=e,this._eventBus.fire("linting.toggle",{active:e}))};me.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=M(i,o),a=M(a,o),e._clearOverlays(),e.isActive()&&e._createIssues(a),e._issues=r,e._updateButton(),e._fireComplete(r)}})}};me.prototype._fireComplete=function(e){this._eventBus.fire("linting.completed",{issues:e})};me.prototype._createIssues=function(e){for(var t in e)this._createElementIssues(t,e[t])};me.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:Ff,left:jf});var s=Ft(t,function(R){return(R.isChildIssue?"child":"")+R.category}),c=s.error,f=s.warn,h=s.info,y=s.childerror,v=s.childwarn,A=s.childinfo;if(!(!h&&!c&&!f&&!y&&!v&&!A)){var W=ee('
              '),L=c||y?ee('
              '+La+"
              "):f||v?ee('
              '+Ia+"
              "):ee('
              '+Fa+"
              "),O=ee('
              '),H=ee('
              '),G=ee('
              '),T=ee('
              '),g=ee("
                ");if(W.appendChild(L),W.appendChild(O),O.appendChild(H),H.appendChild(G),G.appendChild(T),T.appendChild(g),c&&this._addErrors(g,c),f&&this._addWarnings(g,f),h&&this._addInfos(g,h),y||v||A){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),A&&this._addInfos(C,A),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}})}}};me.prototype._addErrors=function(e,t){var n=this;t.forEach(function(r){n._addEntry(e,"error",r)})};me.prototype._addWarnings=function(e,t){var n=this;t.forEach(function(r){n._addEntry(e,"warning",r)})};me.prototype._addInfos=function(e,t){var n=this;t.forEach(function(r){n._addEntry(e,"info",r)})};me.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,s=ja[t],c=ee(` +
                • + ${s} + ${Et(o)} + (${i?`${Et(r)}`:Et(r)}) + ${a?`${Et(a)}`:""} +
                • + `);e.appendChild(c)};me.prototype._clearOverlays=function(){this._overlays.remove({type:"linting"}),this._overlayIds={}};me.prototype._clearIssues=function(){this._issues={},this._clearOverlays()};me.prototype._setButtonState=function(e){var{errors:t,warnings:n,infos:r}=e,i=this._button,o=t&&"error"||n&&"warning"||"success",a=ja[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(f){o===f?i.classList.add("bjsl-button-"+f):i.classList.remove("bjsl-button-"+f)}),i.innerHTML=c};me.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})};me.prototype._createButton=function(){var e=this;this._button=ee(''),this._button.addEventListener("click",function(){e.toggle()}),this._canvas.getContainer().appendChild(this._button)};me.prototype.lint=function(){var e=this._bpmnjs.getDefinitions(),t=new Ba.Linter(this._linterConfig);return t.lint(e)};me.$inject=["bpmnjs","canvas","config.linting","elementRegistry","eventBus","overlays","translate"];var ii={__init__:["linting","lintingEditorActions"],linting:["type",me],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 Vf(e,t){return t.some(function(n){return hs(e,n)})}var qf=Object.freeze({__proto__:null,is:hs,isAny:Vf}),de=ps(qf),Jt={},$a;function ce(){if($a)return Jt;$a=1;let{is:e}=de;function t(a,s){return function(){function c(f,h){e(f,a)&&h.report(f.id,"Element type <"+a+"> is discouraged")}return o(s,{check:c})}}Jt.checkDiscouragedNodeType=t;function n(a,s){if(!a)return null;let c=a.$parent;return c?e(c,s)?c:n(c,s):a}Jt.findParent=n;function r(a){let s=n(a,"bpmn:Process");return s&&s.isExecutable}Jt.isInExecutableProcess=r;let i="https://github.com/bpmn-io/bpmnlint/blob/main/docs/rules";function o(a,s){let{meta:{documentation:c={},...f}={},...h}=s;return{meta:{documentation:{url:`${i}/${a}.md`,...c},...f},...h}}return Jt.annotateRule=o,Jt}var oi,Va;function Wf(){if(Va)return oi;Va=1;let{is:e}=de,{annotateRule:t}=ce();return oi=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})},oi}var Hf=Wf(),zf=le(Hf),ai,qa;function Uf(){if(qa)return ai;qa=1;let{annotateRule:e}=ce();ai=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 ai}var Gf=Uf(),Kf=le(Gf),si,Wa;function Yf(){if(Wa)return si;Wa=1;let{is:e,isAny:t}=de,{annotateRule:n}=ce();return si=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})},si}var Xf=Yf(),Zf=le(Xf),ui,Ha;function Qf(){if(Ha)return ui;Ha=1;let{is:e}=de,{annotateRule:t}=ce();ui=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 ui}var Jf=Qf(),ep=le(Jf),li,za;function tp(){if(za)return li;za=1;let{is:e}=de,{annotateRule:t}=ce();return li=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})},li}var np=tp(),rp=le(np),ci,Ua;function ip(){if(Ua)return ci;Ua=1;let{isAny:e}=de,{annotateRule:t}=ce();return ci=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})},ci}var op=ip(),ap=le(op),fi,Ga;function sp(){if(Ga)return fi;Ga=1;let{is:e,isAny:t}=de,{annotateRule:n}=ce();return fi=function(){function r(f,h){if(!e(f,"bpmn:Definitions"))return!1;let y=i(f),v=o(f);y.forEach(A=>{a(A)||h.report(A.id,"Element is missing name"),s(A,v)||h.report(A.id,"Element is unused"),c(A,y)||h.report(A.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(A=>h.push(A)),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 s(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}},fi}var up=sp(),lp=le(up),pi,Ka;function cp(){if(Ka)return pi;Ka=1;let{is:e,isAny:t}=de,{annotateRule:n}=ce();pi=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 pi}var fp=cp(),pp=le(fp);function hp(e){return Array.prototype.concat.apply([],e)}var yn=Object.prototype.toString,mp=Object.prototype.hasOwnProperty;function en(e){return e===void 0}function ms(e){return e!==void 0}function ur(e){return e==null}function lr(e){return yn.call(e)==="[object Array]"}function sr(e){return yn.call(e)==="[object Object]"}function dp(e){return yn.call(e)==="[object Number]"}function Ti(e){let t=yn.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function yp(e){return yn.call(e)==="[object String]"}function ds(e){if(!lr(e))throw new Error("must supply array")}function ys(e,t){return!ur(e)&&mp.call(e,t)}function gs(e,t){let n=fr(t),r;return Ie(e,function(i,o){if(n(i,o))return r=i,!1}),r}function gp(e,t){let n=fr(t),r=lr(e)?-1:void 0;return Ie(e,function(i,o){if(n(i,o))return r=o,!1}),r}function vp(e,t){let n=fr(t),r=[];return Ie(e,function(i,o){n(i,o)&&r.push(i)}),r}function Ie(e,t){let n,r;if(en(e))return;let i=lr(e)?Cp:Rp;for(let o in e)if(ys(e,o)&&(n=e[o],r=t(n,i(o)),r===!1))return n}function Ep(e,t){if(en(e))return[];ds(e);let n=fr(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 bp(e,t){return!!gs(e,t)}function cr(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 xp(e){return bs(e).length}function wp(e){return cr(e,t=>t)}function xs(e,t,n={}){return t=Mi(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=Mi(e);let n={};return Ie(t,i=>xs(i,e,n)),cr(n,function(i,o){return i[0]})}var _p=ws;function Sp(e,t){t=Mi(t);let n=[];return Ie(e,function(r,i){let o=t(r,i),a={d:o,v:r};for(var s=0;sr.v)}function Ap(e){return function(t){return Es(e,function(n,r){return t[r]===n})}}function Mi(e){return Ti(e)?e:t=>t[e]}function fr(e){return Ti(e)?e:t=>t===e}function Rp(e){return e}function Cp(e){return Number(e)}function Pp(e,t){let n,r,i,o;function a(y){let v=Date.now(),A=y?0:o+t-v;if(A>0)return s(A);e.apply(i,r),c()}function s(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||s(t)}return h.flush=f,h.cancel=c,h}function kp(e,t){let n=!1;return function(...r){n||(e(...r),n=!0,setTimeout(()=>{n=!1},t))}}function Tp(e,t){return e.bind(t)}function Mp(e,...t){return Object.assign(e,...t)}function Dp(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],s=r[i];ms(a)&&ur(s)&&(s=r[i]=isNaN(+a)?{}:[]),en(a)?en(n)?delete r[i]:r[i]=n:r=s}),e}function Np(e,t,n){let r=e;return Ie(t,function(i){if(ur(r))return r=void 0,!1;r=r[i]}),en(r)?n:r}function Bp(e,t){let n={},r=Object(e);return Ie(t,function(i){i in r&&(n[i]=e[i])}),n}function Op(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||!sr(n)||Ie(n,function(r,i){if(i==="__proto__")return;let o=e[i];sr(r)?(sr(o)||(o={}),e[i]=_s(o,r)):e[i]=r})}),e}var Lp=Object.freeze({__proto__:null,assign:Mp,bind:Tp,debounce:Pp,ensureArray:ds,every:Es,filter:vp,find:gs,findIndex:gp,flatten:hp,forEach:Ie,get:Np,groupBy:xs,has:ys,isArray:lr,isDefined:ms,isFunction:Ti,isNil:ur,isNumber:dp,isObject:sr,isString:yp,isUndefined:en,keys:bs,map:cr,matchPattern:Ap,merge:_s,omit:Op,pick:Bp,reduce:vs,set:Dp,size:xp,some:bp,sortBy:Sp,throttle:kp,unionBy:_p,uniqueBy:ws,values:wp,without:Ep}),Ss=ps(Lp),hi,Ya;function Ip(){if(Ya)return hi;Ya=1;let{groupBy:e}=Ss,{is:t}=de,{annotateRule:n}=ce();hi=function(){function s(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,A]of Object.entries(y)){if(!v)continue;if(A.length===1){let L=A[0];f.report(L.id,`Link ${o(L)?"catch":"throw"} event with link name <${v}> missing in scope`);continue}let W=A.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 A)f.report(L.id,`Link catch event with link name <${v}> missing in scope`)}}return n("link-event",{check:s})};function r(s){var c=s.eventDefinitions||[];return t(s,"bpmn:Event")?c.some(f=>t(f,"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 hi}var Fp=Ip(),jp=le(Fp),mi,Xa;function $p(){if(Xa)return mi;Xa=1;let{is:e}=de,{flatten:t}=Ss,{annotateRule:n}=ce();mi=function(){function c(f,h){if(!e(f,"bpmn:Definitions"))return!1;let v=r(f.rootElements).filter(o),A=i(f);v.forEach(W=>{A.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(s))||[],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 s(c){return!!c.childLaneSet}return mi}var Vp=$p(),qp=le(Vp),di,Za;function Wp(){if(Za)return di;Za=1;let e=ce().checkDiscouragedNodeType;return di=e("bpmn:ComplexGateway","no-complex-gateway"),di}var Hp=Wp(),zp=le(Hp),yi,Qa;function Up(){if(Qa)return yi;Qa=1;let{isAny:e,is:t}=de,{annotateRule:n}=ce();yi=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 f=s.incoming||[],h=s.outgoing||[];!f.length&&!h.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 yi}var Gp=Up(),Kp=le(Gp),gi,Ja;function Yp(){if(Ja)return gi;Ja=1;let{is:e}=de,{annotateRule:t}=ce();gi=function(){let r={},i={},o={};function a(s,c){if(!e(s,"bpmn:SequenceFlow"))return;let f=n(s);if(f in r){c.report(s.id,"SequenceFlow is a duplicate");let h=s.sourceRef.id,y=s.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]=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 gi}var Xp=Yp(),Zp=le(Xp),vi,es;function Qp(){if(es)return vi;es=1;let{is:e}=de,{annotateRule:t}=ce();return vi=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})},vi}var Jp=Qp(),eh=le(Jp),Ei,ts;function th(){if(ts)return Ei;ts=1;let{isAny:e}=de,{annotateRule:t}=ce();Ei=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 Ei}var nh=th(),rh=le(nh),bi,ns;function ih(){if(ns)return bi;ns=1;let{is:e,isAny:t}=de,{findParent:n,annotateRule:r}=ce();return bi=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(A=>e(A,"bpmn:Association")?A.sourceRef.id===h.id:!1)}function s(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")&&s(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})},bi}var oh=ih(),ah=le(oh),xi,rs;function sh(){if(rs)return xi;rs=1;let{is:e,isAny:t}=de,{annotateRule:n}=ce();return xi=function(){function r(s){let c=s.eventDefinitions||[];return c.length&&c.every(f=>e(f,"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})},xi}var uh=sh(),lh=le(uh),wi,is;function ch(){if(is)return wi;is=1;let e=ce().checkDiscouragedNodeType;return wi=e("bpmn:InclusiveGateway","no-inclusive-gateway"),wi}var fh=ch(),ph=le(fh),_i,os;function hh(){if(os)return _i;os=1;let{is:e}=de,{annotateRule:t}=ce();_i=function(){function c(f,h){if(!e(f,"bpmn:Definitions"))return;let y=f.rootElements||[],v=new Set,A=new Set,W=s(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,A,W,H)}),v.forEach(O=>h.report(O.id,"Element overlaps with other element")),A.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 A=c.flowElements||[],W=A.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)}),A.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 A=0;A=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 s(c){let f=new Map;return(c.diagrams||[]).filter(y=>!!y.plane).forEach(y=>{(y.plane.planeElement||[]).filter(A=>!!A.bpmnElement).forEach(A=>{f.set(A.bpmnElement,A)})}),f}return _i}var mh=hh(),dh=le(mh),Si,as;function yh(){if(as)return Si;as=1;let{is:e}=de,{annotateRule:t}=ce();return Si=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})},Si}var gh=yh(),vh=le(gh),Ai,ss;function Eh(){if(ss)return Ai;ss=1;let{is:e}=de,{annotateRule:t}=ce();return Ai=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})},Ai}var bh=Eh(),xh=le(bh),Ri,us;function wh(){if(us)return Ri;us=1;let{is:e,isAny:t}=de,{annotateRule:n}=ce();return Ri=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})},Ri}var _h=wh(),Sh=le(_h),Ci,ls;function Ah(){if(ls)return Ci;ls=1;let{is:e}=de,{annotateRule:t}=ce();return Ci=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})},Ci}var Rh=Ah(),Ch=le(Rh),Pi,cs;function Ph(){if(cs)return Pi;cs=1;let{is:e}=de,{annotateRule:t}=ce();return Pi=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})},Pi}var kh=Ph(),Th=le(kh),ki,fs;function Mh(){if(fs)return ki;fs=1;let{is:e,isAny:t}=de,{annotateRule:n}=ce();ki=function(){function o(a,s){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)s.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(s=>e(s,"bpmn:StartEvent")&&s.isInterrupting)}return ki}var Dh=Mh(),Nh=le(Dh),ue={};function Di(){}Di.prototype.resolveRule=function(e,t){let n=ue[e+"/"+t];if(!n)throw new Error("cannot resolve rule <"+e+"/"+t+">: not bundled");return n};Di.prototype.resolveConfig=function(e,t){throw new Error("cannot resolve config <"+t+"> in <"+e+">: not bundled")};var As=new Di,Bh={"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"},Rs={rules:Bh};ue["bpmnlint/ad-hoc-sub-process"]=zf;ue["bpmnlint/conditional-flows"]=Kf;ue["bpmnlint/end-event-required"]=Zf;ue["bpmnlint/event-based-gateway"]=ep;ue["bpmnlint/event-sub-process-typed-start-event"]=rp;ue["bpmnlint/fake-join"]=ap;ue["bpmnlint/global"]=lp;ue["bpmnlint/label-required"]=pp;ue["bpmnlint/link-event"]=jp;ue["bpmnlint/no-bpmndi"]=qp;ue["bpmnlint/no-complex-gateway"]=zp;ue["bpmnlint/no-disconnected"]=Kp;ue["bpmnlint/no-duplicate-sequence-flows"]=Zp;ue["bpmnlint/no-gateway-join-fork"]=eh;ue["bpmnlint/no-implicit-split"]=rh;ue["bpmnlint/no-implicit-end"]=ah;ue["bpmnlint/no-implicit-start"]=lh;ue["bpmnlint/no-inclusive-gateway"]=ph;ue["bpmnlint/no-overlapping-elements"]=dh;ue["bpmnlint/single-blank-start-event"]=vh;ue["bpmnlint/single-event-definition"]=xh;ue["bpmnlint/start-event-required"]=Sh;ue["bpmnlint/sub-process-blank-start-event"]=Ch;ue["bpmnlint/superfluous-gateway"]=Th;ue["bpmnlint/superfluous-termination"]=Nh;var pr=globalThis;pr.BpmnJS=ht;pr.BpmnJS.Viewer=ht;var Cs={config:Rs,resolver:As};pr.BpmnLintModule=ii;pr.BpmnLintConfig=Cs;ht.lintModule=ii;ht.lintConfig=Cs;var Sv=ht;})(); diff --git a/vendor/build-manifest.json b/vendor/build-manifest.json index 39dfd55..ac945db 100644 --- a/vendor/build-manifest.json +++ b/vendor/build-manifest.json @@ -1,7 +1,10 @@ { - "generatedAt": "2026-06-14T15:26:40.625Z", + "generatedAt": "2026-06-14T17:06:46.738Z", "packages": { "bpmn-js": "18.18.0", - "dmn-js": "17.8.1" + "dmn-js": "17.8.1", + "bpmn-js-bpmnlint": "0.24.0", + "bpmnlint": "11.12.1", + "bpmnlint-pack-config": "0.9.0" } } From 738a44ff661500d783f23960888bd3ae2818f44c Mon Sep 17 00:00:00 2001 From: Jaap de Haan <261428+jdehaan@users.noreply.github.com> Date: Sun, 14 Jun 2026 19:49:42 +0200 Subject: [PATCH 2/2] feat: Lint setting and defaults --- .phpstan/dokuwiki.stub | 8 ++++ README.md | 34 ++++++++------- _test/syntax_plugin_bpmnio_bpmnio.test.php | 50 +++++++++++++++++++++- action/editor.php | 19 +++++++- conf/default.php | 7 +++ conf/metadata.php | 7 +++ lang/de/settings.php | 5 +++ lang/en/settings.php | 5 +++ lang/es/settings.php | 5 +++ lang/fr/settings.php | 5 +++ lang/it/settings.php | 5 +++ lang/jp/settings.php | 5 +++ lang/nl/settings.php | 5 +++ plugin.info.txt | 2 +- script/bpmnio_render.js | 24 +++++------ syntax/bpmnio.php | 30 ++++++++++--- 16 files changed, 176 insertions(+), 40 deletions(-) create mode 100644 conf/default.php create mode 100644 conf/metadata.php create mode 100644 lang/de/settings.php create mode 100644 lang/en/settings.php create mode 100644 lang/es/settings.php create mode 100644 lang/fr/settings.php create mode 100644 lang/it/settings.php create mode 100644 lang/jp/settings.php create mode 100644 lang/nl/settings.php diff --git a/.phpstan/dokuwiki.stub b/.phpstan/dokuwiki.stub index 0976655..6411ae2 100644 --- a/.phpstan/dokuwiki.stub +++ b/.phpstan/dokuwiki.stub @@ -13,6 +13,14 @@ namespace dokuwiki\Extension { { return ''; } + + /** + * @return mixed + */ + public function getConf(string $key) + { + return ''; + } } class ActionPlugin extends Plugin diff --git a/README.md b/README.md index d880502..76d651f 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ Renders using the bpmn.io js libraries within dokuwiki: -* BPMN v2.0 diagrams -* DMN v1.3 decision requirement diagrams, decision tables and literal expressions +- BPMN v2.0 diagrams +- DMN v1.3 decision requirement diagrams, decision tables and literal expressions Refer to this page for details: @@ -22,12 +22,12 @@ Embed a diagram by wrapping inline XML (or referencing a media file) in a ### 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). | +| 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 @@ -40,19 +40,21 @@ 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. +- `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 — falls back to the global plugin setting `lint` (configurable in the + DokuWiki admin under _Configuration Settings → Plugins → bpmnio_). The + shipped default is `off`, which applies to both rendered pages and the + editor. ## Development ### Prerequisites -* PHP 8.1+ -* [Composer](https://getcomposer.org/) -* Node.js 20+ and npm +- PHP +- [Composer](https://getcomposer.org/) +- Node.js and npm ### Setup diff --git a/_test/syntax_plugin_bpmnio_bpmnio.test.php b/_test/syntax_plugin_bpmnio_bpmnio.test.php index 099ce5c..2a278a8 100644 --- a/_test/syntax_plugin_bpmnio_bpmnio.test.php +++ b/_test/syntax_plugin_bpmnio_bpmnio.test.php @@ -8,6 +8,13 @@ class syntax_plugin_bpmnio_test extends DokuWikiTest { protected $pluginsEnabled = array('bpmnio'); + public function setUp(): void + { + parent::setUp(); + global $conf; + $conf['plugin']['bpmnio']['lint'] = 'inactive'; + } + public function test_syntax_bpmn() { $info = array(); @@ -18,7 +25,7 @@ public function test_syntax_bpmn()
                  -
                  +
                  OUT; @@ -255,8 +262,11 @@ public function test_syntax_lint_off_attribute() $this->assertStringContainsString('data-lint="off"', $xhtml); } - public function test_syntax_ignores_invalid_lint_attribute() + public function test_syntax_invalid_lint_attribute_falls_back_to_default() { + global $conf; + $conf['plugin']['bpmnio']['lint'] = 'inactive'; + $info = array(); $input = << fall back to the global plugin default. + $this->assertStringContainsString('data-lint="inactive"', $xhtml); + } + + public function test_syntax_missing_lint_attribute_uses_plugin_default() + { + global $conf; + $conf['plugin']['bpmnio']['lint'] = 'inactive'; + + $info = array(); + + $input = << + XML... + + IN; + + $instructions = p_get_instructions($input); + $xhtml = p_render('xhtml', $instructions, $info); + + $this->assertStringContainsString('data-lint="inactive"', $xhtml); + } + + public function test_syntax_lint_attribute_is_ignored_for_dmn() + { + $info = array(); + + $input = << + XML... + + IN; + + $instructions = p_get_instructions($input); + $xhtml = p_render('xhtml', $instructions, $info); + $this->assertStringNotContainsString('data-lint=', $xhtml); } diff --git a/action/editor.php b/action/editor.php index 90a69ab..6d44478 100644 --- a/action/editor.php +++ b/action/editor.php @@ -75,12 +75,29 @@ public function handleForm(Event $event) $form->setHiddenField('plugin_bpmnio_data', $data); $form->setHiddenField('plugin_bpmnio_links', $linkData); + + $lintAttr = ''; + if ($type === 'bpmn') { + $allowed = ['on', 'off', 'inactive']; + $lint = strtolower((string) $this->getConf('lint')); + if (!in_array($lint, $allowed, true)) { + $lint = 'inactive'; + } + // In the editor the linter toggle must always be available so authors + // can inspect issues. "off" is promoted to "inactive" (button present + // but overlays start hidden); "inactive" and "on" pass through as-is. + if ($lint === 'off') { + $lint = 'inactive'; + } + $lintAttr = " data-lint=\"{$lint}\""; + } + $form->addHTML(<<
                  {$renderData}
                  -
                  +
                  HTML); diff --git a/conf/default.php b/conf/default.php new file mode 100644 index 0000000..f9af278 --- /dev/null +++ b/conf/default.php @@ -0,0 +1,7 @@ + ['off', 'inactive', 'on']]; diff --git a/lang/de/settings.php b/lang/de/settings.php new file mode 100644 index 0000000..a68b8a0 --- /dev/null +++ b/lang/de/settings.php @@ -0,0 +1,5 @@ +lint-Attribut überschreibbar).'; +$lang['lint_o_off'] = 'aus — Linter nicht geladen, keine Umschaltfläche'; +$lang['lint_o_inactive'] = 'inaktiv — Umschaltfläche vorhanden, Overlays ausgeblendet'; +$lang['lint_o_on'] = 'an — Overlays sofort eingeblendet'; diff --git a/lang/en/settings.php b/lang/en/settings.php new file mode 100644 index 0000000..55f933d --- /dev/null +++ b/lang/en/settings.php @@ -0,0 +1,5 @@ +lint attribute).'; +$lang['lint_o_off'] = 'off — linter not loaded, no toggle button'; +$lang['lint_o_inactive'] = 'inactive — toggle button present, overlays hidden'; +$lang['lint_o_on'] = 'on — overlays visible immediately'; diff --git a/lang/es/settings.php b/lang/es/settings.php new file mode 100644 index 0000000..5192369 --- /dev/null +++ b/lang/es/settings.php @@ -0,0 +1,5 @@ +lint).'; +$lang['lint_o_off'] = 'desactivado — linter no cargado, sin botón para alternar'; +$lang['lint_o_inactive'] = 'inactivo — botón para alternar disponible, superposiciones ocultas'; +$lang['lint_o_on'] = 'activado — superposiciones visibles inmediatamente'; diff --git a/lang/fr/settings.php b/lang/fr/settings.php new file mode 100644 index 0000000..87f6907 --- /dev/null +++ b/lang/fr/settings.php @@ -0,0 +1,5 @@ +lint).'; +$lang['lint_o_off'] = 'désactivé — linter non chargé, pas de bouton de bascule'; +$lang['lint_o_inactive'] = 'inactif — bouton de bascule présent, superpositions masquées'; +$lang['lint_o_on'] = 'activé — superpositions visibles immédiatement'; diff --git a/lang/it/settings.php b/lang/it/settings.php new file mode 100644 index 0000000..91f591c --- /dev/null +++ b/lang/it/settings.php @@ -0,0 +1,5 @@ +lint).'; +$lang['lint_o_off'] = 'disattivato — linter non caricato, nessun pulsante di attivazione/disattivazione'; +$lang['lint_o_inactive'] = 'inattivo — pulsante di attivazione/disattivazione presente, sovrapposizioni nascoste'; +$lang['lint_o_on'] = 'attivato — sovrapposizioni visibili immediatamente'; diff --git a/lang/jp/settings.php b/lang/jp/settings.php new file mode 100644 index 0000000..1493606 --- /dev/null +++ b/lang/jp/settings.php @@ -0,0 +1,5 @@ +lint属性でダイアグラムごとに上書き可能)。'; +$lang['lint_o_off'] = 'オフ — リンターは読み込まれず、トグルボタンなし'; +$lang['lint_o_inactive'] = '非アクティブ — トグルボタンあり、オーバーレイ非表示'; +$lang['lint_o_on'] = 'オン — オーバーレイが即座に表示'; diff --git a/lang/nl/settings.php b/lang/nl/settings.php new file mode 100644 index 0000000..3c69597 --- /dev/null +++ b/lang/nl/settings.php @@ -0,0 +1,5 @@ +lint-attribuut).'; +$lang['lint_o_off'] = 'uit — linter niet geladen, geen wisselknop'; +$lang['lint_o_inactive'] = 'inactief — wisselknop aanwezig, overlays verborgen'; +$lang['lint_o_on'] = 'aan — overlays direct zichtbaar'; diff --git a/plugin.info.txt b/plugin.info.txt index 0958d11..ebad91a 100644 --- a/plugin.info.txt +++ b/plugin.info.txt @@ -1,7 +1,7 @@ base bpmnio author Jaap de Haan email ColorOfCode@googlemail.com -date 2026-06-14 +date 2026-06-15 name BPMN.io Plugin desc Renders BPMN or DMN xml using the bpmn.io js library url http://www.dokuwiki.org/plugin:bpmnio diff --git a/script/bpmnio_render.js b/script/bpmnio_render.js index c87dcfa..e5ab4e2 100644 --- a/script/bpmnio_render.js +++ b/script/bpmnio_render.js @@ -357,12 +357,15 @@ function resolveBpmnLint() { // "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) { +// absent / other -> linter not loaded (treated as "off") +// The PHP renderer always emits data-lint for BPMN diagrams (resolved from the +// per-diagram attribute or the global plugin config), so no client-side default +// is needed. When the linter module cannot be resolved the diagram renders +// exactly as before. +function buildBpmnLintOptions(container) { const mode = (container?.dataset?.lint ?? "").trim().toLowerCase(); - if (mode === "off") { + if (mode !== "on" && mode !== "inactive") { return { additionalModules: [], linting: undefined }; } @@ -371,16 +374,9 @@ function buildBpmnLintOptions(container, defaultActive) { 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 }, + linting: { bpmnlint: resolved.lintConfig, active: mode === "on" }, }; } @@ -390,7 +386,7 @@ async function renderBpmnDiagram(xml, container) { throw new Error("BPMN viewer library is unavailable."); } - const { additionalModules, linting } = buildBpmnLintOptions(container, false); + const { additionalModules, linting } = buildBpmnLintOptions(container); const viewer = new BpmnViewer({ container, additionalModules, linting }); const root = jQuery(container).closest(".plugin-bpmnio"); const linkMap = parseLinkMap(root, "bpmn"); @@ -487,7 +483,7 @@ async function renderBpmnEditor(xml, container) { throw new Error("BPMN editor library is unavailable."); } - const { additionalModules, linting } = buildBpmnLintOptions(container, true); + const { additionalModules, linting } = buildBpmnLintOptions(container); 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 082147d..b61abf4 100644 --- a/syntax/bpmnio.php +++ b/syntax/bpmnio.php @@ -69,7 +69,7 @@ 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); + $this->lint = $this->resolveLint($attrs['lint'] ?? null, $this->type); return [$state, $this->type, '', $pos, '', false, $this->zoom, $this->lint]; @@ -91,7 +91,7 @@ public function handle($match, $state, $pos, Doku_Handler $handler): array $this->src = ''; $this->zoom = ''; $this->lint = ''; - return [$state, '', '', '', '', '', '', '']; + return [$state, '', '', '', '', false, '', '']; } return []; } @@ -124,15 +124,33 @@ private function normalizeZoom($zoom): ?string return rtrim(rtrim(number_format($zoom, 4, '.', ''), '0'), '.'); } - private function normalizeLint($lint): string + /** + * Resolve the effective bpmnlint mode for the diagram. + * + * Per-diagram `lint` attribute wins when valid; otherwise the global plugin + * setting is used. Linting only applies to BPMN diagrams; for any other + * type the result is an empty string and no data-lint attribute is emitted. + * + * @param mixed $lint Raw attribute value (string|null|other) + * @param string $type Diagram type (`bpmn` or `dmn`) + */ + private function resolveLint($lint, string $type): string { - if (!is_string($lint)) { + if ($type !== 'bpmn') { return ''; } - $lint = strtolower(trim($lint)); + $allowed = ['on', 'off', 'inactive']; - return in_array($lint, ['on', 'off', 'inactive'], true) ? $lint : ''; + if (is_string($lint)) { + $normalized = strtolower(trim($lint)); + if (in_array($normalized, $allowed, true)) { + return $normalized; + } + } + + $default = strtolower((string) $this->getConf('lint')); + return in_array($default, $allowed, true) ? $default : 'off'; } private function getMedia($src)