@sentropic/design-system-elements 0.2.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/LICENSE.THIRD-PARTY.md +44 -1
  2. package/README.md +81 -13
  3. package/catalog.json +401 -7
  4. package/dist/browser/chunks/{Modeler-BfAmwsmK.js → Modeler-D87tL_OJ.js} +4 -4
  5. package/dist/browser/chunks/Viewer-D9zjRrp2.js +4 -0
  6. package/dist/browser/chunks/bpmn-canvas-BevbP_6a.js +1 -0
  7. package/dist/browser/chunks/bpmn-mount-BhO_zb0S.js +2202 -0
  8. package/dist/browser/chunks/dist-DRauAwm2.js +6 -0
  9. package/dist/browser/chunks/{entropic-CM5BHERN.js → entropic-MwNVEq6w.js} +639 -0
  10. package/dist/browser/chunks/focus-renderer-BWm7DlQD.js +55 -0
  11. package/dist/browser/chunks/{forge-B8hrW4lA.js → forge-CzwO8Hbe.js} +639 -0
  12. package/dist/browser/chunks/layout-T3X333Za.js +1 -0
  13. package/dist/browser/elements.js +671 -6
  14. package/dist/browser/sri.json +52 -45
  15. package/dist/contracts/bar-chart.js +2 -2
  16. package/dist/contracts/decision-dossier.d.ts +4 -8
  17. package/dist/contracts/decision-dossier.js +8 -12
  18. package/dist/contracts/index.d.ts +1 -0
  19. package/dist/contracts/index.js +2 -0
  20. package/dist/contracts/time-series-chart.d.ts +49 -0
  21. package/dist/contracts/time-series-chart.js +37 -0
  22. package/dist/dossier/dossier-mount.js +845 -0
  23. package/dist/dossier/renderer/dossier.css +2 -0
  24. package/dist/element/bpmn-mount.d.ts +11 -0
  25. package/dist/element/bpmn-mount.js +56 -0
  26. package/dist/element/bpmn-types.d.ts +27 -0
  27. package/dist/element/bpmn-types.js +12 -0
  28. package/dist/element/bpmn.d.ts +10 -0
  29. package/dist/element/bpmn.js +39 -0
  30. package/dist/element/dom/dossier-mount.d.ts +25 -0
  31. package/dist/element/dom/dossier-review-mount.d.ts +25 -0
  32. package/dist/element/dom/dossier-review-state.svelte.d.ts +13 -0
  33. package/dist/element/dom/engines/bpmn-canvas.d.ts +11 -0
  34. package/dist/element/dom/engines/bpmn-canvas.js +11 -0
  35. package/dist/element/dom/engines/dossier-diagrams.d.ts +5 -0
  36. package/dist/element/dom/engines/dossier-evidence.d.ts +9 -0
  37. package/dist/element/dom/engines/dossier-styles.d.ts +21 -0
  38. package/dist/element/dom/engines/focus-renderer.d.ts +60 -0
  39. package/dist/element/dom/engines/focus-snapshot.d.ts +3 -0
  40. package/dist/element/dom/intents.d.ts +20 -0
  41. package/dist/element/markdown/minimal-markdown.d.ts +1 -2
  42. package/dist/element/markdown/minimal-markdown.js +19 -1
  43. package/dist/element/validator.d.ts +26 -0
  44. package/dist/element/validator.js +54 -0
  45. package/dist/focus-diagrams/diagram-layout.d.ts +140 -0
  46. package/dist/focus-diagrams/diagram-layout.js +190 -0
  47. package/dist/focus-diagrams/diagram-source.d.ts +11 -0
  48. package/dist/focus-diagrams/diagram-source.js +147 -0
  49. package/dist/focus-diagrams/dossier-views.d.ts +21 -0
  50. package/dist/focus-diagrams/dossier-views.js +57 -0
  51. package/dist/focus-diagrams/ecosystem.json +853 -0
  52. package/dist/focus-kit/index.html +13 -0
  53. package/dist/focus-kit/renderer/dossier.css +2 -0
  54. package/dist/focus-kit/renderer/dossier.js +845 -0
  55. package/dist/focus-kit-manifest.json +1 -0
  56. package/dist/focus-kit.d.ts +9 -0
  57. package/dist/focus-kit.js +30 -0
  58. package/dist/format-time-series-markdown.d.ts +5 -0
  59. package/dist/format-time-series-markdown.js +24 -0
  60. package/dist/generator/parity.js +6 -1
  61. package/dist/index.d.ts +2 -0
  62. package/dist/index.js +1 -0
  63. package/dist/ports/dossier-views.d.ts +3 -0
  64. package/dist/ports/dossier-views.js +3 -0
  65. package/dist/ports/focus.d.ts +0 -1
  66. package/dist/ports/types.d.ts +0 -1
  67. package/dist/shells/BarChart.html +8494 -0
  68. package/dist/shells/BarChart.js +8482 -0
  69. package/dist/shells/DecisionDossier.html +8502 -0
  70. package/dist/shells/DecisionDossier.js +8490 -0
  71. package/dist/shells/TimeSeriesChart.html +8475 -0
  72. package/dist/shells/TimeSeriesChart.js +8463 -0
  73. package/dist/shells/manifest.json +108 -0
  74. package/dist/structure/interpreter.d.ts +1 -1
  75. package/dist/structure/interpreter.js +14 -4
  76. package/dist/time-series.d.ts +13 -0
  77. package/dist/time-series.js +15 -0
  78. package/dist/validate/envelope.js +5 -1
  79. package/dist/validate/time-series.d.ts +5 -0
  80. package/dist/validate/time-series.js +28 -0
  81. package/fixtures/time-series-multi.json +46 -0
  82. package/fixtures/time-series-single.json +28 -0
  83. package/fixtures/time-series-thresholds.json +52 -0
  84. package/package.json +40 -6
  85. package/schemas/BarChart.v1.json +2 -2
  86. package/schemas/DecisionDossier.v1.json +155 -5
  87. package/schemas/TimeSeriesChart.v1.json +287 -0
  88. package/skill/SKILL.md +27 -0
  89. package/dist/browser/chunks/Viewer-eYLzc3fD.js +0 -4
  90. package/dist/browser/chunks/bpmn-canvas-DeAWdJFy.js +0 -2207
  91. package/dist/browser/chunks/dist-O6_2ByYB.js +0 -1
  92. package/dist/browser/chunks/focus-renderer-0elVToA2.js +0 -10
  93. package/dist/browser/chunks/layout-q0TR9-aY.js +0 -1
@@ -1,4 +0,0 @@
1
- import{C as e,S as t,T as n,_ as r,a as i,f as a,g as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,t as m,u as h,v as g,x as _,y as v}from"./dist-Co2MgHWm.js";import{i as y,n as ee,r as b,t as x}from"./ModelUtil-CMh7LuN4.js";import{i as te,n as ne,s as re,t as ie,u as S}from"./LabelUtil-7QpE43Ed.js";import{a as C,n as ae,t as oe}from"./LayoutUtil-hAMJmJFU.js";import{c as w,l as se,m as ce,n as T,o as E,p as le,r as D,s as ue,t as O,u as de}from"./dist-kvAYI1vo.js";import{D as fe,N as pe,O as me,P as k,_ as he,a as A,c as ge,d as j,f as _e,g as ve,h as ye,i as be,j as xe,k as Se,l as Ce,m as M,n as we,o as N,p as Te,r as Ee,s as De,t as Oe,u as P,v as ke,y as Ae}from"./BpmnRenderUtil-WMCgqGDs.js";import{g as je}from"./bpmn-canvas-DeAWdJFy.js";function F(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var Me={exports:{}},Ne;function Pe(){if(Ne)return Me.exports;Ne=1;var e=Me.exports=function(t,n){if(n||=16,t===void 0&&(t=128),t<=0)return`0`;for(var r=Math.log(2**t)/Math.log(n),i=2;r===1/0;i*=2)r=Math.log(2**(t/i))/Math.log(n)*i;for(var a=r-Math.floor(r),o=``,i=0;i<Math.floor(r);i++){var s=Math.floor(Math.random()*n).toString(n);o=s+o}if(a){var c=n**+a,s=Math.floor(Math.random()*c).toString(n);o=s+o}var l=parseInt(o,n);return l!==1/0&&l>=2**t?e(t,n):o};return e.rack=function(t,n,r){var i=function(i){var o=0;do{if(o++>10){if(r)t+=r;else throw Error(`too many ID collisions, use more bits`)}var s=e(t,n)}while(Object.hasOwnProperty.call(a,s));return a[s]=i,s},a=i.hats={};return i.get=function(e){return i.hats[e]},i.set=function(e,t){return i.hats[e]=t,i},i.bits=t||128,i.base=n||16,i},Me.exports}var Fe=F(Pe());function I(e){if(!(this instanceof I))return new I(e);e||=[128,36,1],this._seed=e.length?Fe.rack(e[0],e[1],e[2]):e}I.prototype.next=function(e){return this._seed(e||!0)},I.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n},I.prototype.claim=function(e,t){this._seed.set(e,t||!0)},I.prototype.assigned=function(e){return this._seed.get(e)||!1},I.prototype.unclaim=function(e){delete this._seed.hats[e]},I.prototype.clear=function(){var e=this._seed.hats,t;for(t in e)this.unclaim(t)};var L={legend:[1,`<fieldset>`,`</fieldset>`],tr:[2,`<table><tbody>`,`</tbody></table>`],col:[2,`<table><tbody></tbody><colgroup>`,`</colgroup></table>`],_default:[0,``,``]};L.td=L.th=[3,`<table><tbody><tr>`,`</tr></tbody></table>`],L.option=L.optgroup=[1,`<select multiple="multiple">`,`</select>`],L.thead=L.tbody=L.colgroup=L.caption=L.tfoot=[1,`<table>`,`</table>`],L.polyline=L.ellipse=L.polygon=L.circle=L.text=L.line=L.path=L.rect=L.g=[1,`<svg xmlns="http://www.w3.org/2000/svg" version="1.1">`,`</svg>`];function R(e,t=globalThis.document){if(typeof e!=`string`)throw TypeError(`String expected`);let n=/^<!--(.*?)-->$/s.exec(e);if(n)return t.createComment(n[1]);let r=/<([\w:]+)/.exec(e)?.[1];if(!r)return t.createTextNode(e);if(e=e.trim(),r===`body`){let n=t.createElement(`html`);n.innerHTML=e;let{lastChild:r}=n;return r.remove(),r}let[i,a,o]=Object.hasOwn(L,r)?L[r]:L._default,s=t.createElement(`div`);for(s.innerHTML=a+e+o;i--;)s=s.lastChild;if(s.firstChild===s.lastChild){let{firstChild:e}=s;return e.remove(),e}let c=t.createDocumentFragment();return c.append(...s.childNodes),c}function Ie(e,t){return t.forEach(function(t){t&&typeof t!=`string`&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if(n!=="default"&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}function z(e,...t){let n=e.style;return c(t,function(e){e&&c(e,function(e,t){n[t]=e})}),e}function Le(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}var Re=Object.prototype.toString;function ze(e){return new Be(e)}function Be(e){if(!e||!e.nodeType)throw Error(`A DOM element reference is required`);this.el=e,this.list=e.classList}Be.prototype.add=function(e){return this.list.add(e),this},Be.prototype.remove=function(e){return Re.call(e)==`[object RegExp]`?this.removeMatching(e):(this.list.remove(e),this)},Be.prototype.removeMatching=function(e){let t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Be.prototype.toggle=function(e,t){return(t===void 0||t!==this.list.toggle(e,t))&&this.list.toggle(e),this},Be.prototype.array=function(){return Array.from(this.list)},Be.prototype.has=Be.prototype.contains=function(e){return this.list.contains(e)};function Ve(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function He(e,t,n){var r=n?e:e.parentNode;return r&&typeof r.closest==`function`&&r.closest(t)||null}function Ue(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var We={},Ge;function Ke(){if(Ge)return We;Ge=1;var e,t,n;function r(){e=window.addEventListener?`addEventListener`:`attachEvent`,t=window.removeEventListener?`removeEventListener`:`detachEvent`,n=e===`addEventListener`?``:`on`}return We.bind=function(t,i,a,o){return e||r(),t[e](n+i,a,o||!1),a},We.unbind=function(e,i,a,o){return t||r(),e[t](n+i,a,o||!1),a},We}var qe=Ke(),Je=Ie({__proto__:null,default:Ue(qe)},[qe]),Ye=[`focus`,`blur`];function Xe(e,t,n,r,i){return Ye.indexOf(n)!==-1&&(i=!0),Je.bind(e,n,function(n){n.delegateTarget=He(n.target||n.srcElement,t,!0),n.delegateTarget&&r.call(e,n)},i)}function Ze(e,t,n,r){return Ye.indexOf(t)!==-1&&(r=!0),Je.unbind(e,t,n,r)}var Qe={bind:Xe,unbind:Ze};function $e(e,t){return e&&typeof e.matches==`function`&&e.matches(t)||!1}function B(e,t){return t||=document,t.querySelector(e)}function et(e,t){return t||=document,t.querySelectorAll(e)}function tt(e){e.parentNode&&e.parentNode.removeChild(e)}var nt=/^class[ {]/;function rt(e){return nt.test(e.toString())}function it(e){return Array.isArray(e)}function at(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ot(...e){e.length===1&&it(e[0])&&(e=e[0]),e=[...e];let t=e.pop();return t.$inject=e,t}var st=/constructor\s*[^(]*\(\s*([^)]*)\)/m,ct=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,lt=/\/\*([^*]*)\*\//m;function ut(e){if(typeof e!=`function`)throw Error(`Cannot annotate "${e}". Expected a function!`);let t=e.toString().match(rt(e)?st:ct);if(!t)return[];let n=t[1]||t[2];return n&&n.split(`,`).map(e=>{let t=e.match(lt);return(t&&t[1]||e).trim()})||[]}function dt(e,t){let n=t||{get:function(e,t){if(t===!1)return null;throw r.push(e),s(`No provider for "${e}"!`)}},r=[],i=this._providers=Object.create(n._providers||null),a=this._instances=Object.create(null),o=a.injector=this,s=function(e){let t=r.join(` -> `);return r.length=0,Error(t?`${e} (Resolving: ${t})`:e)};function c(e,t){if(!i[e]&&e.includes(`.`)){let t=e.split(`.`),n=c(t.shift());for(;t.length;)n=n[t.shift()];return n}if(at(a,e))return a[e];if(at(i,e)){if(r.indexOf(e)!==-1)throw r.push(e),s(`Cannot resolve circular dependency!`);return r.push(e),a[e]=i[e][0](i[e][1]),r.pop(),a[e]}return n.get(e,t)}function l(e,t){if(t===void 0&&(t={}),typeof e!=`function`){if(it(e))e=ot(e.slice());else throw s(`Cannot invoke "${e}". Expected a function!`)}let n=(e.$inject||ut(e)).map(e=>at(t,e)?t[e]:c(e));return{fn:e,dependencies:n}}function u(e){let{fn:t,dependencies:n}=l(e);return new(Function.prototype.bind.call(t,null,...n))}function d(e,t,n){let{fn:r,dependencies:i}=l(e,n);return r.apply(t,i)}function f(e){return ot(t=>e.get(t))}function p(e,t){if(t&&t.length){let n=Object.create(null),r=Object.create(null),a=[],o=[],s=[],c,l,u,d;for(let e in i)c=i[e],t.indexOf(e)!==-1&&(c[2]===`private`?(l=a.indexOf(c[3]),l===-1?(u=c[3].createChild([],t),d=f(u),a.push(c[3]),o.push(u),s.push(d),n[e]=[d,e,`private`,u]):n[e]=[s[l],e,`private`,o[l]]):n[e]=[c[2],c[1]],r[e]=!0),(c[2]===`factory`||c[2]===`type`)&&c[1].$scope&&t.forEach(t=>{c[1].$scope.indexOf(t)!==-1&&(n[e]=[c[2],c[1]],r[t]=!0)});t.forEach(e=>{if(!r[e])throw Error(`No provider for "`+e+`". Cannot use provider from the parent!`)}),e.unshift(n)}return new dt(e,o)}let m={factory:d,type:u,value:function(e){return e}};function h(e,t){let n=e.__init__||[];return function(){n.forEach(e=>{typeof e==`string`?t.get(e):t.invoke(e)})}}function g(e){let t=e.__exports__;if(t){let n=e.__modules__,r=Object.keys(e).reduce((t,n)=>(n!==`__exports__`&&n!==`__modules__`&&n!==`__init__`&&n!==`__depends__`&&(t[n]=e[n]),t),Object.create(null)),a=p((n||[]).concat(r)),o=ot(function(e){return a.get(e)});t.forEach(function(e){i[e]=[o,e,`private`,a]});let s=(e.__init__||[]).slice();return s.unshift(function(){a.init()}),e=Object.assign({},e,{__init__:s}),h(e,a)}return Object.keys(e).forEach(function(t){if(t===`__init__`||t===`__depends__`)return;let n=e[t];if(n[2]===`private`){i[t]=n;return}let r=n[0],a=n[1];i[t]=[m[r],ft(r,a),r]}),h(e,o)}function _(e,t){return e.indexOf(t)!==-1||(e=(t.__depends__||[]).reduce(_,e),e.indexOf(t)!==-1)?e:e.concat(t)}function v(e){let t=e.reduce(_,[]).map(g),n=!1;return function(){n||(n=!0,t.forEach(e=>e()))}}this.get=c,this.invoke=d,this.instantiate=u,this.createChild=p,this.init=v(e)}function ft(e,t){return e!==`value`&&it(t)&&(t=ot(t.slice())),t}function pt(e){var t=new Set(e);return i(e,function(e){for(var n=e.parent;n;){if(t.has(n))return!1;n=n.parent}return!0})}function mt(e,t,n){n||=0,a(e)||(e=[e]),c(e,function(e,r){var i=t(e,r,n);a(i)&&i.length&&mt(i,t,n+1)})}function ht(e,t,n){var r=new Set,i=new Set;return mt(e,function(e,t,a){r.add(e);var o=e.children;if((n===-1||a<n)&&o&&!i.has(o))return i.add(o),o}),Array.from(r)}function gt(e,t){return ht(e,!0,-1)}function _t(e,t,n){v(t)&&(t=!0),r(t)&&(n=t,t=!0),n||={};var i=St(n.allShapes),a=St(n.allConnections),o=St(n.enclosedElements),s=St(n.enclosedConnections),l=St(n.topLevel,t&&h(e,function(e){return e.id}));function u(e){l[e.source.id]&&l[e.target.id]&&(l[e.id]=[e]),i[e.source.id]&&i[e.target.id]&&(s[e.id]=o[e.id]=e),a[e.id]=e}function d(e){if(o[e.id]=e,e.waypoints)s[e.id]=a[e.id]=e;else return i[e.id]=e,c(e.incoming,u),c(e.outgoing,u),e.children}return mt(e,d),{allShapes:i,allConnections:a,topLevel:l,enclosedConnections:s,enclosedElements:o}}function vt(e,t){t=!!t,a(e)||(e=[e]);var n,r,i,o;return c(e,function(e){var a=e;e.waypoints&&!t&&(a=vt(e.waypoints,!0));var s=a.x,c=a.y,l=a.height||0,u=a.width||0;(s<n||n===void 0)&&(n=s),(c<r||r===void 0)&&(r=c),(s+u>i||i===void 0)&&(i=s+u),(c+l>o||o===void 0)&&(o=c+l)}),{x:n,y:r,height:o-r,width:i-n}}function yt(e,t){var n={};return c(e,function(e){var r=e;r.waypoints&&(r=vt(r)),!o(t.y)&&r.x>t.x&&(n[e.id]=e),!o(t.x)&&r.y>t.y&&(n[e.id]=e),r.x>t.x&&r.y>t.y&&(o(t.width)&&o(t.height)&&r.width+r.x<t.width+t.x&&r.height+r.y<t.height+t.y||!o(t.width)||!o(t.height))&&(n[e.id]=e)}),n}function bt(e){return`waypoints`in e?`connection`:`x`in e?`shape`:`root`}function xt(e){return!!(e&&e.isFrame)}function St(e,t){return m({},e||{},t||{})}var Ct=1;function wt(e,t){ce.call(this,e,Ct),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})}k(wt,ce),wt.prototype.canRender=function(){return!0},wt.prototype.drawShape=function(e,t,n){var r=E(`rect`);return T(r,{x:0,y:0,width:t.width||0,height:t.height||0}),xt(t)?T(r,m({},this.FRAME_STYLE,n||{})):T(r,m({},this.SHAPE_STYLE,n||{})),O(e,r),r},wt.prototype.drawConnection=function(e,t,n){var r=ve(t.waypoints,m({},this.CONNECTION_STYLE,n||{}));return O(e,r),r},wt.prototype.getShapePath=function(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=[[`M`,t,n],[`l`,r,0],[`l`,0,i],[`l`,-r,0],[`z`]];return ye(a)},wt.prototype.getConnectionPath=function(e){var t=e.waypoints,n,r,i=[];for(n=0;r=t[n];n++)r=r.original||r,i.push([n===0?`M`:`L`,r.x,r.y]);return ye(i)},wt.$inject=[`eventBus`,`styles`];function Tt(){var e={"no-fill":{fill:`none`},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:`none`}},t=this;this.cls=function(e,t,n){var r=this.style(t,n);return m(r,{class:e})},this.style=function(t,r){!a(t)&&!r&&(r=t,t=[]);var i=n(t,function(t,n){return m(t,e[n]||{})},{});return r?m(i,r):i},this.computeStyle=function(e,n,r){return a(n)||(r=n,n=[]),t.style(n||[],m({},r,e||{}))}}var Et={__init__:[`defaultRenderer`],defaultRenderer:[`type`,wt],styles:[`type`,Tt]};function Dt(e,t){return Math.round(e*t)/t}function Ot(e){return o(e)?e+`px`:e}function kt(e){for(;e.parent;)e=e.parent;return e}function At(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 bio-theme-parent`),z(n,{position:`relative`,overflow:`hidden`,width:Ot(e.width),height:Ot(e.height)}),t.appendChild(n),n}function jt(e,t,n){let r=E(`g`);D(r).add(t);let i=n===void 0?e.childNodes.length-1:n;return e.insertBefore(r,e.childNodes[i]||null),r}var Mt=`base`,Nt=0,Pt=1,Ft={shape:[`x`,`y`,`width`,`height`],connection:[`waypoints`]};function V(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||{})}V.$inject=[`config.canvas`,`eventBus`,`graphicsFactory`,`elementRegistry`],V.prototype._init=function(e){let t=this._eventBus,n=this._container=At(e),r=this._svg=E(`svg`);T(r,{width:`100%`,height:`100%`}),Le(r,`tabindex`,0),e.autoFocus&&t.on(`element.hover`,()=>{this.restoreFocus()}),t.on(`element.mousedown`,500,e=>{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`)}),O(n,r);let i=this._viewport=jt(r,`viewport`);e.deferUpdate&&(this._viewboxChanged=p(this._viewboxChanged,300)),this._restoreFocus=p(this._restoreFocus,0),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)},V.prototype._destroy=function(){this._restoreFocus.cancel(),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},V.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire(`canvas.focus.changed`,{focused:e}))},V.prototype._clear=function(){this._elementRegistry.getAll().forEach(e=>{let t=bt(e);t===`root`?this.removeRootElement(e):this._removeElement(e,t)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox},V.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)},V.prototype.restoreFocus=function(){this._restoreFocus()},V.prototype._restoreFocus=function(){document.activeElement===document.body&&this.focus()},V.prototype.isFocused=function(){return this._focused},V.prototype.getDefaultLayer=function(){return this.getLayer(Mt,Nt)},V.prototype.getLayer=function(e,t){if(!e)throw Error(`must specify a name`);let n=this._layers[e];if(n||=this._layers[e]=this._createLayer(e,t),t!==void 0&&n.index!==t)throw Error(`layer <`+e+`> already created at index <`+t+`>`);return n.group},V.prototype._getChildIndex=function(e){return n(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)},V.prototype._createLayer=function(e,t){t===void 0&&(t=Pt);let n=this._getChildIndex(t);return{group:jt(this._viewport,`layer-`+e,n),index:t,visible:!0}},V.prototype.showLayer=function(e){if(!e)throw Error(`must specify a name`);let t=this._layers[e];if(!t)throw Error(`layer <`+e+`> does not exist`);let n=this._viewport,r=t.group,i=t.index;if(t.visible)return r;let a=this._getChildIndex(i);return n.insertBefore(r,n.childNodes[a]||null),t.visible=!0,r},V.prototype.hideLayer=function(e){if(!e)throw Error(`must specify a name`);let t=this._layers[e];if(!t)throw Error(`layer <`+e+`> does not exist`);let n=t.group;return t.visible&&=(de(n),!1),n},V.prototype._removeLayer=function(e){let t=this._layers[e];t&&(delete this._layers[e],de(t.group))},V.prototype.getActiveLayer=function(){let e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},V.prototype.findRoot=function(e){let t=this._resolveElements(e),n;for(let e of t){let t=this._findPlaneForRoot(kt(e));if(!t||n&&t.rootElement!==n)return;n=t.rootElement}return n},V.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})},V.prototype._findPlaneForRoot=function(e){return d(this._planes,function(t){return t.rootElement===e})},V.prototype._resolveElement=function(e){return typeof e==`string`?this._elementRegistry.get(e):e},V.prototype._resolveElements=function(e){return a(e)||(e=[e]),e.map(e=>this._resolveElement(e)).filter(Boolean)},V.prototype.getContainer=function(){return this._container},V.prototype._updateMarker=function(e,t,n){let r;e=this._resolveElement(e),e.markers=e.markers||new Set,r=this._elementRegistry._elements[e.id],r&&(c([r.gfx,r.secondaryGfx],function(r){r&&(n?(e.markers.add(t),D(r).add(t)):(e.markers.delete(t),D(r).remove(t)))}),this._eventBus.fire(`element.marker.update`,{element:e,gfx:r.gfx,marker:t,add:!!n}))},V.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},V.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},V.prototype.hasMarker=function(e,t){return e=this._resolveElement(e),e.markers?e.markers.has(t):!1},V.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},V.prototype.getRootElement=function(){let e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},V.prototype.addRootElement=function(e){let t=this._rootsIdx++;e||={id:`__implicitroot_`+t,children:[],isImplicit:!0};let n=e.layer=`root-`+t;this._ensureValid(`root`,e);let r=this.getLayer(n,Nt);return this.hideLayer(n),this._addRoot(e,r),this._planes.push({rootElement:e,layer:r}),e},V.prototype.removeRootElement=function(e){if(e=this._resolveElement(e),this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter(function(t){return t.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e},V.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw Error(`rootElement required`);return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e},V.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)},V.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})},V.prototype._setRoot=function(e,t){let n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(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})},V.prototype._ensureValid=function(e,t){if(!t.id)throw Error(`element must have an id`);if(this._elementRegistry.get(t.id))throw Error(`element <`+t.id+`> already exists`);let n=Ft[e];if(!s(n,function(e){return t[e]!==void 0}))throw Error(`must supply { `+n.join(`, `)+` } with `+e)},V.prototype._setParent=function(e,t,n){xe(t.children,e,n),e.parent=t},V.prototype._addElement=function(e,t,n,r){n||=this.getRootElement();let i=this._eventBus,a=this._graphicsFactory;this._ensureValid(e,t),i.fire(e+`.add`,{element:t,parent:n}),this._setParent(t,n,r);let o=a.create(e,t,r);return this._elementRegistry.add(t,o),a.update(e,t,o),i.fire(e+`.added`,{element:t,gfx:o}),t},V.prototype.addShape=function(e,t,n){return this._addElement(`shape`,e,t,n)},V.prototype.addConnection=function(e,t,n){return this._addElement(`connection`,e,t,n)},V.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),pe(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+`.removed`,{element:e}),n.remove(e),e},V.prototype.removeShape=function(e){return this._removeElement(e,`shape`)},V.prototype.removeConnection=function(e){return this._removeElement(e,`connection`)},V.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},V.prototype._changeViewbox=function(e){this._eventBus.fire(`canvas.viewbox.changing`),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},V.prototype._viewboxChanged=function(){this._eventBus.fire(`canvas.viewbox.changed`,{viewbox:this.viewbox()})},V.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);let t=this._viewport,n=this.getSize(),r,i,a,o,s,c,l;if(e)this._changeViewbox(function(){s=Math.min(n.width/e.width,n.height/e.height);let r=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);le(t,r)});else return a=this._rootElement?this.getActiveLayer():null,r=a&&a.getBBox()||{},o=le(t),i=o?o.matrix:ue(),s=Dt(i.a,1e3),c=Dt(-i.e||0,1e3),l=Dt(-i.f||0,1e3),e=this._cachedViewbox={x:c?c/s:0,y:l?l/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},V.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),It(t,n)}),{x:n.e,y:n.f}},V.prototype.scrollToElement=function(e,t){let n=100,r=this._resolveElements(e);if(!r.length)return;let i=this.findRoot(r);if(!i)return;i!==this.getRootElement()&&this.setRootElement(i);let a=r.filter(e=>e!=i);if(!a.length)return;t||={},typeof t==`number`&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};let o=vt(a),s=ae(o),c=this.viewbox(),l=this.zoom(),u,d;c.y+=t.top/l,c.x+=t.left/l,c.width-=(t.right+t.left)/l,c.height-=(t.bottom+t.top)/l;let f=ae(c);if(!(o.width<c.width&&o.height<c.height))u=o.x-c.x,d=o.y-c.y;else{let e=Math.max(0,s.right-f.right),t=Math.min(0,s.left-f.left),n=Math.max(0,s.bottom-f.bottom),r=Math.min(0,s.top-f.top);u=e||t,d=n||r}this.scroll({dx:-u*l,dy:-d*l})},V.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if(e===`fit-viewport`)return this._fitViewport(t);let n,r;return this._changeViewbox(function(){typeof t!=`object`&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),r=this._setZoom(e,t)}),Dt(r.a,1e3)};function It(e,t){let n=`matrix(`+t.a+`,`+t.b+`,`+t.c+`,`+t.d+`,`+t.e+`,`+t.f+`)`;e.setAttribute(`transform`,n)}V.prototype._fitViewport=function(e){let t=this.viewbox(),n=t.outer,r=t.inner,i,a;return r.x>=0&&r.y>=0&&r.x+r.width<=n.width&&r.y+r.height<=n.height&&!e?a={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),a={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(a),this.viewbox(!1).scale},V.prototype._setZoom=function(e,t){let n=this._svg,r=this._viewport,i=n.createSVGMatrix(),a=n.createSVGPoint(),o,s,c,l,u;c=r.getCTM();let d=c.a;return t?(o=m(a,t),s=o.matrixTransform(c.inverse()),l=i.translate(s.x,s.y).scale(1/d*e).translate(-s.x,-s.y),u=c.multiply(l)):u=i.scale(e),It(this._viewport,u),u},V.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},V.prototype.getAbsoluteBBox=function(e){let t=this.viewbox(),n;return n=e.waypoints?this.getGraphics(e).getBBox():e,{x:n.x*t.scale-t.x*t.scale,y:n.y*t.scale-t.y*t.scale,width:n.width*t.scale,height:n.height*t.scale}},V.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire(`canvas.resized`)};var Lt=`data-element-id`;function H(e){this._elements={},this._eventBus=e}H.$inject=[`eventBus`],H.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),T(t,Lt,r),n&&T(n,Lt,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}},H.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&(T(r.gfx,Lt,``),r.secondaryGfx&&T(r.secondaryGfx,Lt,``),delete t[n])},H.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)},H.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(t,Lt,r),t},H.prototype.get=function(e){var t=typeof e==`string`?e:e&&T(e,Lt),n=this._elements[t];return n&&n.element},H.prototype.filter=function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(n)}),t},H.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),r=0;r<n.length;r++){var i=t[n[r]],a=i.element,o=i.gfx;if(e(a,o))return a}},H.prototype.getAll=function(){return this.filter(function(e){return e})},H.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var r=t[n],i=r.element,a=r.gfx;return e(i,a)})},H.prototype.getGraphics=function(e,t){var n=e.id||e,r=this._elements[n];return r&&(t?r.secondaryGfx:r.gfx)},H.prototype._validateId=function(e){if(!e)throw Error(`element must have an id`);if(this._elements[e])throw Error(`element with id `+e+` already added`)};function Rt(e,t,n,r){var i=n.inverse;return Object.defineProperty(e,"remove",{value:function(e){var n=this.indexOf(e);return n!==-1&&(this.splice(n,1),t.unset(e,i,r)),e}}),Object.defineProperty(e,"contains",{value:function(e){return this.indexOf(e)!==-1}}),Object.defineProperty(e,"add",{value:function(e,n){var a=this.indexOf(e);if(n===void 0){if(a!==-1)return;n=this.length}a!==-1&&this.splice(a,1),this.splice(n,0,e),a===-1&&t.set(e,i,r)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}function zt(e){return e.__refs_collection===!0}function Bt(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)}function Vt(e,t,n){var r=Rt(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:r}),r.length&&r.forEach(function(r){e.set(r,t.inverse,n)})}function Ht(e,t,n){var r=t.inverse,i=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return i},set:function(t){if(t!==i){var a=i;i=null,a&&e.unset(a,r,n),i=t,e.set(i,r,n)}}})}function U(e,t){if(!(this instanceof U))return new U(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}U.prototype.bind=function(e,t){if(typeof t==`string`){if(!this.props[t])throw Error(`no property <`+t+`> in ref`);t=this.props[t]}t.collection?Vt(this,t,e):Ht(this,t,e)},U.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return zt(n)||Vt(this,t,e),n},U.prototype.ensureBound=function(e,t){Bt(e,t)||this.bind(e,t)},U.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},U.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Ut=new U({name:`children`,enumerable:!0,collection:!0},{name:`parent`}),Wt=new U({name:`labels`,enumerable:!0,collection:!0},{name:`labelTarget`}),Gt=new U({name:`attachers`,collection:!0},{name:`host`}),Kt=new U({name:`outgoing`,collection:!0},{name:`source`}),qt=new U({name:`incoming`,collection:!0},{name:`target`});function Jt(){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)}}),Ut.bind(this,`parent`),Wt.bind(this,`labels`),Kt.bind(this,`outgoing`),qt.bind(this,`incoming`)}function Yt(){Jt.call(this),Ut.bind(this,`children`),Gt.bind(this,`host`),Gt.bind(this,`attachers`)}k(Yt,Jt);function Xt(){Jt.call(this),Ut.bind(this,`children`)}k(Xt,Yt);function Zt(){Yt.call(this),Wt.bind(this,`labelTarget`)}k(Zt,Yt);function Qt(){Jt.call(this),Kt.bind(this,`source`),qt.bind(this,`target`)}k(Qt,Jt);var $t={connection:Qt,shape:Yt,label:Zt,root:Xt};function en(e,t){var n=$t[e];if(!n)throw Error(`unknown type: <`+e+`>`);return m(new n,t)}function tn(e){return e instanceof Jt}function nn(){this._uid=12}nn.prototype.createRoot=function(e){return this.create(`root`,e)},nn.prototype.createLabel=function(e){return this.create(`label`,e)},nn.prototype.createShape=function(e){return this.create(`shape`,e)},nn.prototype.createConnection=function(e){return this.create(`connection`,e)},nn.prototype.create=function(e,t){return t=m({},t||{}),t.id||(t.id=e+`_`+this._uid++),en(e,t)};var rn=`__fn`,an=1e3,on=Array.prototype.slice;function W(){this._listeners={},this.on(`diagram.destroy`,1,this._destroy,this)}W.prototype.on=function(e,t,n,r){if(e=a(e)?e:[e],l(t)&&(r=n,n=t,t=an),!o(t))throw Error(`priority must be a number`);var i=n;r&&(i=u(n,r),i[rn]=n[rn]||n);var s=this;e.forEach(function(e){s._addListener(e,{priority:t,callback:i,next:null})})},W.prototype.once=function(e,t,n,r){var i=this;if(l(t)&&(r=n,n=t,t=an),!o(t))throw Error(`priority must be a number`);function a(){a.__isTomb=!0;var t=n.apply(r,arguments);return i.off(e,a),t}a[rn]=n,this.on(e,t,a)},W.prototype.off=function(e,t){e=a(e)?e:[e];var n=this;e.forEach(function(e){n._removeListener(e,t)})},W.prototype.createEvent=function(e){var t=new sn;return t.init(e),t},W.prototype.fire=function(e,t){var n,r,i,a=on.call(arguments);if(typeof e==`object`&&(t=e,e=t.type),!e)throw Error(`no event type specified`);if(r=this._listeners[e],r){n=t instanceof sn?t:this.createEvent(t),a[0]=n;var o=n.type;e!==o&&(n.type=e);try{i=this._invokeListeners(n,a,r)}finally{e!==o&&(n.type=o)}return i===void 0&&n.defaultPrevented&&(i=!1),i}},W.prototype.handleError=function(e){return this.fire(`error`,{error:e})===!1},W.prototype._destroy=function(){this._listeners={}},W.prototype._invokeListeners=function(e,t,n){for(var r;n&&!e.cancelBubble;)r=this._invokeListener(e,t,n),n=n.next;return r},W.prototype._invokeListener=function(e,t,n){var r;if(n.callback.__isTomb)return r;try{r=cn(n.callback,t),r!==void 0&&(e.returnValue=r,e.stopPropagation()),r===!1&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error(`unhandled error in event listener`,e),e}return r},W.prototype._addListener=function(e,t){var n=this._getListeners(e),r;if(!n)this._setListeners(e,t);else{for(;n;){if(n.priority<t.priority){t.next=n,r?r.next=t:this._setListeners(e,t);return}r=n,n=n.next}r.next=t}},W.prototype._getListeners=function(e){return this._listeners[e]},W.prototype._setListeners=function(e,t){this._listeners[e]=t},W.prototype._removeListener=function(e,t){var n=this._getListeners(e),r,i,a;if(!t)this._setListeners(e,null);else for(;n;)r=n.next,a=n.callback,(a===t||a[rn]===t)&&(i?i.next=r:this._setListeners(e,r)),i=n,n=r};function sn(){}sn.prototype.stopPropagation=function(){this.cancelBubble=!0},sn.prototype.preventDefault=function(){this.defaultPrevented=!0},sn.prototype.init=function(e){m(this,e||{})};function cn(e,t){return e.apply(null,t)}function ln(e){return e.childNodes[0]}function un(e){return e.parentNode.childNodes[1]}function dn(e,t,n,r,i){var a=w();a.setTranslate(t,n);var o=w();o.setRotate(r||0,0,0);var s=w();s.setScale(i||1,i||1),le(e,[a,o,s])}function fn(e,t,n){var r=w();r.setTranslate(t,n),le(e,r)}function pn(e,t){var n=w();n.setRotate(t,0,0),le(e,n)}function G(e,t){this._eventBus=e,this._elementRegistry=t}G.$inject=[`eventBus`,`elementRegistry`],G.prototype._getChildrenContainer=function(e){var t=this._elementRegistry.getGraphics(e),n;return e.parent?(n=un(t),n||(n=E(`g`),D(n).add(`djs-children`),O(t.parentNode,n))):n=t,n},G.prototype._clear=function(e){var t=ln(e);return Ve(t),t},G.prototype._createContainer=function(e,t,n,r){var i=E(`g`);D(i).add(`djs-group`),n===void 0?O(t,i):mn(i,t,t.childNodes[n]);var a=E(`g`);D(a).add(`djs-element`),D(a).add(`djs-`+e),r&&D(a).add(`djs-frame`),O(i,a);var o=E(`g`);return D(o).add(`djs-visual`),O(a,o),a},G.prototype.create=function(e,t,n){var r=this._getChildrenContainer(t.parent);return this._createContainer(e,r,n,xt(t))},G.prototype.updateContainments=function(e){var t=this,r=this._elementRegistry,i=n(e,function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e},{});c(i,function(e){var n=e.children;if(n){var i=t._getChildrenContainer(e),a=i.firstChild;c(n,function(e){var t=r.getGraphics(e).parentNode;t===a?a=a.nextSibling:i.insertBefore(t,a)})}})},G.prototype.drawShape=function(e,t,n={}){return this._eventBus.fire(`render.shape`,{gfx:e,element:t,attrs:n})},G.prototype.getShapePath=function(e){return this._eventBus.fire(`render.getShapePath`,e)},G.prototype.drawConnection=function(e,t,n={}){return this._eventBus.fire(`render.connection`,{gfx:e,element:t,attrs:n})},G.prototype.getConnectionPath=function(e){return this._eventBus.fire(`render.getConnectionPath`,e)},G.prototype.update=function(e,t,n){if(t.parent){var r=this._clear(n);if(e===`shape`)this.drawShape(r,t),fn(n,t.x,t.y);else if(e===`connection`)this.drawConnection(r,t);else throw Error(`unknown type: `+e);t.hidden?T(n,`display`,`none`):T(n,`display`,`block`)}},G.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);de(t.parentNode)};function mn(e,t,n){var r=n||t.firstChild;e!==r&&t.insertBefore(e,r)}var hn={__depends__:[Et],__init__:[`canvas`],canvas:[`type`,V],elementRegistry:[`type`,H],elementFactory:[`type`,nn],eventBus:[`type`,W],graphicsFactory:[`type`,G]};function gn(e){var t=new dt(e);return t.init(),t}function _n(e){return e||={},gn([{config:[`value`,e]},hn].concat(e.modules||[]))}function vn(e,t){this._injector=t||_n(e),this.get(`eventBus`).fire(`diagram.init`)}vn.prototype.get=function(e,t){return this._injector.get(e,t)},vn.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)},vn.prototype.destroy=function(){this.get(`eventBus`).fire(`diagram.destroy`)},vn.prototype.clear=function(){this.get(`eventBus`).fire(`diagram.clear`)};function K(e){return e?`<`+e.$type+(e.id?` id="`+e.id:``)+`" />`:`<null>`}function q(e,t){return e.$instanceOf(t)}function yn(e){return d(e.rootElements,function(e){return q(e,`bpmn:Process`)||q(e,`bpmn:Collaboration`)})}function bn(e){var t={},n=[],r={};function a(e,t){return function(n){e(n,t)}}function o(e){t[e.id]=e}function s(e){return t[e.id]}function l(t,n){if(t.gfx)throw Error(`already rendered ${K(t)}`);return e.element(t,r[t.id],n)}function u(t,n){return e.root(t,r[t.id],n)}function d(e,t){try{var n=r[e.id]&&l(e,t);return o(e),n}catch(t){f(t.message,{element:e,error:t}),console.error(`failed to import ${K(e)}`,t)}}function f(t,n){e.error(t,n)}var p=this.registerDi=function(e){var t=e.bpmnElement;t?r[t.id]?f(`multiple DI elements defined for ${K(t)}`,{element:t}):r[t.id]=e:f(`no bpmnElement referenced in ${K(e)}`,{element:e})};function m(e){h(e.plane)}function h(e){p(e),c(e.planeElement,g)}function g(e){p(e)}this.handleDefinitions=function(e,t){var i=e.diagrams;if(t&&i.indexOf(t)===-1)throw Error(`diagram not part of <bpmn:Definitions />`);if(!t&&i&&i.length&&(t=i[0]),!t)throw Error(`no diagram to display`);r={},m(t);var a=t.plane;if(!a)throw Error(`no plane for ${K(t)}`);var o=a.bpmnElement;if(!o){if(o=yn(e),o)f(`correcting missing bpmnElement on ${K(a)} to ${K(o)}`),a.bpmnElement=o,p(a);else throw Error(`no process or collaboration to display`)}var s=u(o,a);if(q(o,`bpmn:Process`)||q(o,`bpmn:SubProcess`))v(o,s);else if(q(o,`bpmn:Collaboration`))ue(o,s),y(e.rootElements,s);else throw Error(`unsupported bpmnElement for ${K(a)}: ${K(o)}`);_(n)};var _=this.handleDeferred=function(){for(var e;n.length;)e=n.shift(),e()};function v(e,t){E(e,t),S(e.ioSpecification,t),ie(e.artifacts,t),o(e)}function y(e,t){i(e,function(e){return!s(e)&&q(e,`bpmn:Process`)&&e.laneSets}).forEach(a(v,t))}function ee(e,t){d(e,t)}function b(e,t){c(e,a(ee,t))}function x(e,t){d(e,t)}function te(e,t){d(e,t)}function ne(e,t){d(e,t)}function re(e,t){d(e,t)}function ie(e,t){c(e,function(e){q(e,`bpmn:Association`)?n.push(function(){re(e,t)}):re(e,t)})}function S(e,t){e&&(c(e.dataInputs,a(te,t)),c(e.dataOutputs,a(ne,t)))}var C=this.handleSubProcess=function(e,t){E(e,t),ie(e.artifacts,t)};function ae(e,t){var r=d(e,t);q(e,`bpmn:SubProcess`)&&C(e,r||t),q(e,`bpmn:Activity`)&&S(e.ioSpecification,t),n.push(function(){c(e.dataInputAssociations,a(x,t)),c(e.dataOutputAssociations,a(x,t))})}function oe(e,t){d(e,t)}function w(e,t){d(e,t)}function se(e,t){n.push(function(){var n=d(e,t);e.childLaneSet&&ce(e.childLaneSet,n||t),O(e)})}function ce(e,t){c(e.lanes,a(se,t))}function T(e,t){c(e,a(ce,t))}function E(e,t){le(e.flowElements,t),e.laneSets&&T(e.laneSets,t)}function le(e,t){c(e,function(e){q(e,`bpmn:SequenceFlow`)?n.push(function(){oe(e,t)}):q(e,`bpmn:BoundaryEvent`)?n.unshift(function(){ae(e,t)}):q(e,`bpmn:FlowNode`)?ae(e,t):q(e,`bpmn:DataObject`)||(q(e,`bpmn:DataStoreReference`)||q(e,`bpmn:DataObjectReference`)?w(e,t):f(`unrecognized flowElement ${K(e)} in context ${K(t&&t.businessObject)}`,{element:e,context:t}))})}function D(e,t){var n=d(e,t),r=e.processRef;r&&v(r,n||t)}function ue(e,t){c(e.participants,a(D,t)),n.push(function(){b(e.messageFlows,t)}),ie(e.artifacts,t)}function O(e){c(e.flowNodeRef,function(t){var n=t.get(`lanes`);n&&n.push(e)})}}function xn(e,t,n){var r,i,a,o,s=[];function l(e,t){var n=new bn({root:function(e,t){return r.add(e,t)},element:function(e,t,n){return r.add(e,t,n)},error:function(e,t){s.push({message:e,context:t})}});t||=e.diagrams&&e.diagrams[0];var i=Sn(e,t);if(!i)throw Error(`no diagram to display`);c(i,function(t){n.handleDefinitions(e,t)});var o=t.plane.bpmnElement.id;a.setRootElement(a.findRoot(o+`_plane`)||a.findRoot(o))}return new Promise(function(c,u){try{return r=e.get(`bpmnImporter`),i=e.get(`eventBus`),a=e.get(`canvas`),i.fire(`import.render.start`,{definitions:t}),l(t,n),i.fire(`import.render.complete`,{error:o,warnings:s}),c({warnings:s})}catch(e){return e.warnings=s,u(e)}})}function Sn(e,t){if(t&&t.plane){var n=t.plane.bpmnElement,r=n;!b(n,`bpmn:Process`)&&!b(n,`bpmn:Collaboration`)&&(r=wn(n));var i=b(r,`bpmn:Collaboration`)?r:d(e.rootElements,function(e){if(b(e,`bpmn:Collaboration`))return d(e.participants,function(e){return e.processRef===r})}),a=[r];i&&(a=_(i.participants,function(e){return e.processRef}),a.push(i));var o=Cn(a),s=[t],l=[n];return c(e.diagrams,function(e){if(e.plane){var t=e.plane.bpmnElement;o.indexOf(t)!==-1&&l.indexOf(t)===-1&&(s.push(e),l.push(t))}}),s}}function Cn(e){var t=[];return c(e,function(e){e&&(t.push(e),t=t.concat(Cn(e.flowElements)))}),t}function wn(e){for(var t=e;t;){if(b(t,`bpmn:Process`))return t;t=t.$parent}}var Tn=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>`,En={verticalAlign:`middle`},Dn={color:`#404040`},On={zIndex:`1001`,position:`fixed`,top:`0`,left:`0`,right:`0`,bottom:`0`},kn={width:`100%`,height:`100%`,background:`rgba(40,40,40,0.2)`},An={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`},jn=`<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link">`+Tn+`</a><span>Web-based tooling for BPMN, DMN and forms powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>`,J;function Mn(){J=R(jn),z(J,On),z(B(`svg`,J),En),z(B(`.backdrop`,J),kn),z(B(`.notice`,J),An),z(B(`.link`,J),Dn,{margin:`15px 20px 15px 10px`,alignSelf:`center`})}function Nn(){J||(Mn(),Qe.bind(J,`.backdrop`,`click`,function(e){document.body.removeChild(J)})),document.body.appendChild(J)}var Pn=5,Fn=`djs-outline-hidden`;function Y(e){e=m({},Rn,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),this._init(this._container,this._moddle,e),Vn(this._container)}k(Y,vn),Y.prototype.importXML=async function(e,t){let n=this;function r(e){return n.get(`eventBus`).createEvent(e)}let i=[];try{e=this._emit(`import.parse.start`,{xml:e})||e;let n;try{n=await this._moddle.fromXML(e,`bpmn:Definitions`)}catch(e){throw this._emit(`import.parse.complete`,{error:e}),e}let a=n.rootElement,o=n.references,s=n.warnings,c=n.elementsById;i=i.concat(s),a=this._emit(`import.parse.complete`,r({error:null,definitions:a,elementsById:c,references:o,warnings:i}))||a;let l=await this.importDefinitions(a,t);return i=i.concat(l.warnings),this._emit(`import.done`,{error:null,warnings:i}),{warnings:i}}catch(e){let t=e;throw i=i.concat(t.warnings||[]),In(t,i),t=Ln(t),this._emit(`import.done`,{error:t,warnings:t.warnings}),t}},Y.prototype.importDefinitions=async function(e,t){return this._setDefinitions(e),{warnings:(await this.open(t)).warnings}},Y.prototype.open=async function(e){let t=this._definitions,n=e;if(!t){let e=Error(`no XML imported`);throw In(e,[]),e}if(typeof e==`string`&&(n=Bn(t,e),!n)){let t=Error(`BPMNDiagram <`+e+`> not found`);throw In(t,[]),t}try{this.clear()}catch(e){throw In(e,[]),e}let{warnings:r}=await xn(this,t,n);return{warnings:r}},Y.prototype.saveXML=async function(e){e||={};let t=this._definitions,n,r;try{if(!t)throw Error(`no definitions loaded`);t=this._emit(`saveXML.start`,{definitions:t})||t,r=(await this._moddle.toXML(t,e)).xml,r=this._emit(`saveXML.serialized`,{xml:r})||r}catch(e){n=e}let i=n?{error:n}:{xml:r};if(this._emit(`saveXML.done`,i),n)throw n;return i},Y.prototype.saveSVG=async function(){this._emit(`saveSVG.start`);let e,t;try{let t=this.get(`canvas`),n=t.getActiveLayer(),r=B(`:scope > defs`,t._svg),i=se(n),a=r?`<defs>`+se(r)+`</defs>`:``,o=t.getContainer();ze(o).add(Fn);let s;try{s=n.getBBox()}finally{ze(o).remove(Fn)}let c=s.x-Pn,l=s.y-Pn,u=s.width+Pn*2,d=s.height+Pn*2;e=`<?xml version="1.0" encoding="utf-8"?>
2
- <!-- created with bpmn-js / http://bpmn.io -->
3
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="`+u+`" height="`+d+`" viewBox="`+c+` `+l+` `+u+` `+d+`" version="1.1">`+a+i+`</svg>`}catch(e){t=e}if(this._emit(`saveSVG.done`,{error:t,svg:e}),t)throw t;return{svg:e}},Y.prototype._setDefinitions=function(e){this._definitions=e},Y.prototype.getModules=function(){return this._modules},Y.prototype.clear=function(){this.getDefinitions()&&vn.prototype.clear.call(this)},Y.prototype.destroy=function(){vn.prototype.destroy.call(this),tt(this._container)},Y.prototype.on=function(e,t,n,r){return this.get(`eventBus`).on(e,t,n,r)},Y.prototype.off=function(e,t){this.get(`eventBus`).off(e,t)},Y.prototype.attachTo=function(e){if(!e)throw Error(`parentNode required`);this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),typeof e==`string`&&(e=B(e)),e.appendChild(this._container),this._emit(`attach`,{}),this.get(`canvas`).resized()},Y.prototype.getDefinitions=function(){return this._definitions},Y.prototype.detach=function(){let e=this._container,t=e.parentNode;t&&(this._emit(`detach`,{}),t.removeChild(e))},Y.prototype._init=function(t,n,r){let i=r.modules||this.getModules(r),a=r.additionalModules||[],o=[{bpmnjs:[`value`,this],moddle:[`value`,n]}],s=[].concat(o,i,a),c=m(e(r,[`additionalModules`]),{canvas:m({},r.canvas,{container:t}),modules:s});vn.call(this,c),r&&r.container&&this.attachTo(r.container)},Y.prototype._emit=function(e,t){return this.get(`eventBus`).fire(e,t)},Y.prototype._createContainer=function(e){let t=R(`<div class="bjs-container bio-theme-parent"></div>`);return z(t,{width:zn(e.width),height:zn(e.height),position:e.position}),t},Y.prototype._createModdle=function(e){let t=m({},this._moddleExtensions,e.moddleExtensions);return new je(t)},Y.prototype._modules=[];function In(e,t){return e.warnings=t,e}function Ln(e){let t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return t&&(e.message=`unparsable content <`+t[1]+`> detected; this may indicate an invalid BPMN 2.0 diagram file`+t[2]),e}var Rn={width:`100%`,height:`100%`,position:`relative`};function zn(e){return e+(o(e)?`px`:``)}function Bn(e,t){return t&&d(e.diagrams,function(e){return e.id===t})||null}function Vn(e){let t=R(`<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >`+Tn+`</a>`);z(B(`svg`,t),En),z(t,Dn,{position:`absolute`,bottom:`15px`,right:`15px`,zIndex:`100`}),e.appendChild(t),Je.bind(t,`click`,function(e){Nn(),e.preventDefault()})}function Hn(e){let t=[];return c(e.incoming,e=>{b(e,`bpmn:Association`)&&b(e.source,`bpmn:TextAnnotation`)&&t.push({annotation:e.source,association:e})}),c(e.outgoing,e=>{b(e,`bpmn:Association`)&&b(e.target,`bpmn:TextAnnotation`)&&t.push({annotation:e.target,association:e})}),t}function Un(e){let t=new Map;return c(ht(e,!0,-1),e=>{c(Hn(e),e=>{t.has(e.annotation)||t.set(e.annotation,{annotation:e.annotation,associations:[]}),t.get(e.annotation).associations.push(e.association)})}),[...t.values()]}var Wn=new I,Gn=10,Kn=3,qn=1.5,Jn=10,Yn=4,Xn=.95,Zn=1,Qn=.25;function $n(e,t,n,i,a,o,s){ce.call(this,t,s);var l=e&&e.defaultFillColor,u=e&&e.defaultStrokeColor,d=e&&e.defaultLabelColor;function f(e){return n.computeStyle(e,{strokeLinecap:`round`,strokeLinejoin:`round`,stroke:Oe,strokeWidth:2,fill:`white`})}function p(e){return n.computeStyle(e,[`no-fill`],{strokeLinecap:`round`,strokeLinejoin:`round`,stroke:Oe,strokeWidth:2})}function h(e,t){var{ref:n={x:0,y:0},scale:r=1,element:i,parentGfx:o=a._svg}=t,s=E(`marker`,{id:e,viewBox:`0 0 20 20`,refX:n.x,refY:n.y,markerWidth:20*r,markerHeight:20*r,orient:`auto`});O(s,i);var c=B(`:scope > defs`,o);c||(c=E(`defs`),O(o,c)),O(c,s)}function g(e,t,n,r){var i=Wn.nextPrefixed(`marker-`);return _(e,i,t,n,r),`url(#`+i+`)`}function _(e,t,n,r,i){n===`sequenceflow-end`&&h(t,{element:E(`path`,{d:`M 1 5 L 11 10 L 1 15 Z`,...f({fill:i,stroke:i,strokeWidth:1})}),ref:{x:11,y:10},scale:.5,parentGfx:e}),n===`messageflow-start`&&h(t,{element:E(`circle`,{cx:6,cy:6,r:3.5,...f({fill:r,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:6,y:6},parentGfx:e}),n===`messageflow-end`&&h(t,{element:E(`path`,{d:`m 1 5 l 0 -3 l 7 3 l -7 3 z`,...f({fill:r,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:8.5,y:5},parentGfx:e}),n===`association-start`&&h(t,{element:E(`path`,{d:`M 11 5 L 1 10 L 11 15`,...p({fill:`none`,stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:1,y:10},scale:.5,parentGfx:e}),n===`association-end`&&h(t,{element:E(`path`,{d:`M 1 5 L 11 10 L 1 15`,...p({fill:`none`,stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:11,y:10},scale:.5,parentGfx:e}),n===`conditional-flow-marker`&&h(t,{element:E(`path`,{d:`M 0 10 L 8 6 L 16 10 L 8 14 Z`,...f({fill:r,stroke:i})}),ref:{x:-1,y:10},scale:.5,parentGfx:e}),n===`conditional-default-flow-marker`&&h(t,{element:E(`path`,{d:`M 6 4 L 10 16`,...f({stroke:i,fill:`none`})}),ref:{x:0,y:10},scale:.5,parentGfx:e})}function v(e,t,n,i,a={}){r(i)&&(a=i,i=0),i||=0,a=f(a);var o=t/2,s=n/2,c=E(`circle`,{cx:o,cy:s,r:Math.round((t+n)/4-i),...a});return O(e,c),c}function y(e,t,n,i,a,o){r(a)&&(o=a,a=0),a||=0,o=f(o);var s=E(`rect`,{x:a,y:a,width:t-a*2,height:n-a*2,rx:i,ry:i,...o});return O(e,s),s}function ne(e,t,n,r){var i=t/2,a=n/2,o=[{x:i,y:0},{x:t,y:a},{x:i,y:n},{x:0,y:a}].map(function(e){return e.x+`,`+e.y}).join(` `);r=f(r);var s=E(`polygon`,{...r,points:o});return O(e,s),s}function re(e,t,n,r){n=p(n);var i=ve(t,n,r);return O(e,i),i}function ie(e,t,n){return re(e,t,n,5)}function S(e,t,n){n=p(n);var r=E(`path`,{...n,d:t});return O(e,r),r}function C(e,t,n,r){return S(t,n,m({"data-marker":e},r))}function ae(e){return Me[e]}function oe(e){return function(t,n,r){return ae(e)(t,n,r)}}var w={"bpmn:MessageEventDefinition":function(e,t,n={},r){return S(e,i.getScaledPath(`EVENT_MESSAGE`,{xScaleFactor:.9,yScaleFactor:.9,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.235,my:.315}}),{fill:r?P(t,u,n.stroke):A(t,l,n.fill),stroke:r?A(t,l,n.fill):P(t,u,n.stroke),strokeWidth:1})},"bpmn:TimerEventDefinition":function(e,t,n={}){var r=n.width||t.width,a=n.height||t.height,o=n.width?1:2,s=v(e,r,a,.2*a,{fill:A(t,l,n.fill),stroke:P(t,u,n.stroke),strokeWidth:o});S(e,i.getScaledPath(`EVENT_TIMER_WH`,{xScaleFactor:.75,yScaleFactor:.75,containerWidth:r,containerHeight:a,position:{mx:.5,my:.5}}),{stroke:P(t,u,n.stroke),strokeWidth:o});for(var c=0;c<12;c++){var d=i.getScaledPath(`EVENT_TIMER_LINE`,{xScaleFactor:.75,yScaleFactor:.75,containerWidth:r,containerHeight:a,position:{mx:.5,my:.5}}),f=r/2,p=a/2;S(e,d,{strokeWidth:1,stroke:P(t,u,n.stroke),transform:`rotate(`+c*30+`,`+p+`,`+f+`)`})}return s},"bpmn:EscalationEventDefinition":function(e,t,n={},r){return S(e,i.getScaledPath(`EVENT_ESCALATION`,{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.2}}),{fill:r?P(t,u,n.stroke):A(t,l,n.fill),stroke:P(t,u,n.stroke),strokeWidth:1})},"bpmn:ConditionalEventDefinition":function(e,t,n={}){return S(e,i.getScaledPath(`EVENT_CONDITIONAL`,{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.222}}),{fill:A(t,l,n.fill),stroke:P(t,u,n.stroke),strokeWidth:1})},"bpmn:LinkEventDefinition":function(e,t,n={},r){return S(e,i.getScaledPath(`EVENT_LINK`,{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{fill:r?P(t,u,n.stroke):A(t,l,n.fill),stroke:P(t,u,n.stroke),strokeWidth:1})},"bpmn:ErrorEventDefinition":function(e,t,n={},r){return S(e,i.getScaledPath(`EVENT_ERROR`,{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.2,my:.722}}),{fill:r?P(t,u,n.stroke):A(t,l,n.fill),stroke:P(t,u,n.stroke),strokeWidth:1})},"bpmn:CancelEventDefinition":function(e,t,n={},r){var a=S(e,i.getScaledPath(`EVENT_CANCEL_45`,{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{fill:r?P(t,u,n.stroke):`none`,stroke:P(t,u,n.stroke),strokeWidth:1});return pn(a,45),a},"bpmn:CompensateEventDefinition":function(e,t,n={},r){return S(e,i.getScaledPath(`EVENT_COMPENSATION`,{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.22,my:.5}}),{fill:r?P(t,u,n.stroke):A(t,l,n.fill),stroke:P(t,u,n.stroke),strokeWidth:1})},"bpmn:SignalEventDefinition":function(e,t,n={},r){return S(e,i.getScaledPath(`EVENT_SIGNAL`,{xScaleFactor:.9,yScaleFactor:.9,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:r?P(t,u,n.stroke):A(t,l,n.fill),stroke:P(t,u,n.stroke)})},"bpmn:MultipleEventDefinition":function(e,t,n={},r){return S(e,i.getScaledPath(`EVENT_MULTIPLE`,{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.211,my:.36}}),{fill:r?P(t,u,n.stroke):A(t,l,n.fill),stroke:P(t,u,n.stroke),strokeWidth:1})},"bpmn:ParallelMultipleEventDefinition":function(e,t,n={}){return S(e,i.getScaledPath(`EVENT_PARALLEL_MULTIPLE`,{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.458,my:.194}}),{fill:A(t,l,n.fill),stroke:P(t,u,n.stroke),strokeWidth:1})},"bpmn:TerminateEventDefinition":function(e,t,n={}){return v(e,t.width,t.height,8,{fill:P(t,u,n.stroke),stroke:P(t,u,n.stroke),strokeWidth:4})}};function se(e,t,n={},r){var i=x(e),a=Te(i),o=r||e;return i.get(`eventDefinitions`)&&i.get(`eventDefinitions`).length>1?i.get(`parallelMultiple`)?w[`bpmn:ParallelMultipleEventDefinition`](t,o,n,a):w[`bpmn:MultipleEventDefinition`](t,o,n,a):M(i,`bpmn:MessageEventDefinition`)?w[`bpmn:MessageEventDefinition`](t,o,n,a):M(i,`bpmn:TimerEventDefinition`)?w[`bpmn:TimerEventDefinition`](t,o,n,a):M(i,`bpmn:ConditionalEventDefinition`)?w[`bpmn:ConditionalEventDefinition`](t,o,n,a):M(i,`bpmn:SignalEventDefinition`)?w[`bpmn:SignalEventDefinition`](t,o,n,a):M(i,`bpmn:EscalationEventDefinition`)?w[`bpmn:EscalationEventDefinition`](t,o,n,a):M(i,`bpmn:LinkEventDefinition`)?w[`bpmn:LinkEventDefinition`](t,o,n,a):M(i,`bpmn:ErrorEventDefinition`)?w[`bpmn:ErrorEventDefinition`](t,o,n,a):M(i,`bpmn:CancelEventDefinition`)?w[`bpmn:CancelEventDefinition`](t,o,n,a):M(i,`bpmn:CompensateEventDefinition`)?w[`bpmn:CompensateEventDefinition`](t,o,n,a):M(i,`bpmn:TerminateEventDefinition`)?w[`bpmn:TerminateEventDefinition`](t,o,n,a):null}var le={ParticipantMultiplicityMarker:function(e,t,n={}){var r=j(t,n),a=N(t,n);C(`participant-multiplicity`,e,i.getScaledPath(`MARKER_PARALLEL`,{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:a,position:{mx:(r/2-6)/r,my:(a-15)/a}}),{strokeWidth:2,fill:A(t,l,n.fill),stroke:P(t,u,n.stroke)})},SubProcessMarker:function(e,t,n={}){fn(y(e,14,14,0,{strokeWidth:1,fill:A(t,l,n.fill),stroke:P(t,u,n.stroke)}),t.width/2-7.5,t.height-20),C(`sub-process`,e,i.getScaledPath(`MARKER_SUB_PROCESS`,{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7.5)/t.width,my:(t.height-20)/t.height}}),{fill:A(t,l,n.fill),stroke:P(t,u,n.stroke)})},ParallelMarker:function(e,t,n){var r=j(t,n),a=N(t,n);C(`parallel`,e,i.getScaledPath(`MARKER_PARALLEL`,{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:a,position:{mx:(r/2+n.parallel)/r,my:(a-20)/a}}),{fill:A(t,l,n.fill),stroke:P(t,u,n.stroke)})},SequentialMarker:function(e,t,n){C(`sequential`,e,i.getScaledPath(`MARKER_SEQUENTIAL`,{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.seq)/t.width,my:(t.height-19)/t.height}}),{fill:A(t,l,n.fill),stroke:P(t,u,n.stroke)})},CompensationMarker:function(e,t,n){C(`compensation`,e,i.getScaledPath(`MARKER_COMPENSATION`,{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.compensation)/t.width,my:(t.height-13)/t.height}}),{strokeWidth:1,fill:A(t,l,n.fill),stroke:P(t,u,n.stroke)})},LoopMarker:function(e,t,n){var r=j(t,n),a=N(t,n);C(`loop`,e,i.getScaledPath(`MARKER_LOOP`,{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:a,position:{mx:(r/2+n.loop)/r,my:(a-7)/a}}),{strokeWidth:1.5,fill:`none`,stroke:P(t,u,n.stroke),strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){var r=j(t,n),a=N(t,n);C(`adhoc`,e,i.getScaledPath(`MARKER_ADHOC`,{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:a,position:{mx:(r/2+n.adhoc)/r,my:(a-15)/a}}),{strokeWidth:1,fill:P(t,u,n.stroke),stroke:P(t,u,n.stroke)})}};function ue(e,t,n,r){le[e](t,n,r)}function de(e,t,n=[],r={}){r={fill:r.fill,stroke:r.stroke,width:j(t,r),height:N(t,r)};var i=x(t),a=n.includes(`SubProcessMarker`);r=a?{...r,seq:-21,parallel:-22,compensation:-25,loop:-18,adhoc:10}:{...r,seq:-5,parallel:-6,compensation:-7,loop:0,adhoc:-8},i.get(`isForCompensation`)&&n.push(`CompensationMarker`),b(i,`bpmn:AdHocSubProcess`)&&(n.push(`AdhocMarker`),a||m(r,{compensation:r.compensation-18}));var o=i.get(`loopCharacteristics`),s=o&&o.get(`isSequential`);o&&(m(r,{compensation:r.compensation-18}),n.includes(`AdhocMarker`)&&m(r,{seq:-23,loop:-18,parallel:-24}),s===void 0&&n.push(`LoopMarker`),s===!1&&n.push(`ParallelMarker`),s===!0&&n.push(`SequentialMarker`)),n.includes(`CompensationMarker`)&&n.length===1&&m(r,{compensation:-8}),c(n,function(n){ue(n,e,t,r)})}function pe(e,t,n={}){n=m({size:{width:100}},n);var r=o.createText(t||``,n);return D(r).add(`djs-label`),O(e,r),r}function k(e,t,n,r={}){var i=x(t),a=we({x:t.x,y:t.y,width:t.width,height:t.height},r);return pe(e,i.name,{align:n,box:a,padding:7,style:{fill:De(t,d,u,r.stroke)}})}function he(e,t,n={}){var r={width:t.width,height:t.height,x:t.width/2+t.x,y:t.height/2+t.y};return pe(e,te(t),{box:r,style:m({},o.getExternalStyle(),{fill:De(t,d,u,n.stroke)})})}function ge(e,t,n,r={}){var i=Se(n),a=pe(e,t,{box:{height:30,width:i?N(n,r):j(n,r)},align:`center-middle`,style:{fill:De(n,d,u,r.stroke)}});i&&dn(a,0,-(-1*N(n,r)),270)}function ye(e,t,n={}){var{width:r,height:i}=we(t,n);return y(e,r,i,Jn,{...n,fill:A(t,l,n.fill),fillOpacity:Xn,stroke:P(t,u,n.stroke)})}function be(e,t,n={}){var r=x(t),i=A(t,l,n.fill),a=P(t,u,n.stroke);return(r.get(`associationDirection`)===`One`||r.get(`associationDirection`)===`Both`)&&(n.markerEnd=g(e,`association-end`,i,a)),r.get(`associationDirection`)===`Both`&&(n.markerStart=g(e,`association-start`,i,a)),n=X(n,[`markerStart`,`markerEnd`]),ie(e,t.waypoints,{...n,stroke:a,strokeDasharray:`0, 5`})}function xe(e,t,n={}){var r=A(t,l,n.fill),a=P(t,u,n.stroke),o=S(e,i.getScaledPath(`DATA_OBJECT_PATH`,{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:r,fillOpacity:Xn,stroke:a}),s=x(t);return _e(s)&&S(e,i.getScaledPath(`DATA_OBJECT_COLLECTION_PATH`,{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.33,my:(t.height-18)/t.height}}),{strokeWidth:2,fill:r,stroke:a}),o}function Ce(e,t,n={}){return v(e,t.width,t.height,{fillOpacity:Xn,...n,fill:A(t,l,n.fill),stroke:P(t,u,n.stroke)})}function Ee(e,t,n={}){return ne(e,t.width,t.height,{fill:A(t,l,n.fill),fillOpacity:Xn,stroke:P(t,u,n.stroke)})}function ke(e,t,n={}){var r=y(e,j(t,n),N(t,n),0,{fill:A(t,l,n.fill),fillOpacity:n.fillOpacity||Xn,stroke:P(t,u,n.stroke),strokeWidth:1.5}),i=x(t);return b(i,`bpmn:Lane`)&&ge(e,i.get(`name`),t,n),r}function Ae(e,t,n={}){var r=ye(e,t,n),i=me(t);if(fe(t)&&(T(r,{strokeDasharray:`0, 5.5`,strokeWidth:2.5}),!i)){var a=(x(t).flowElements||[]).filter(e=>b(e,`bpmn:StartEvent`));a.length===1&&je(a[0],e,n,t)}return k(e,t,i?`center-top`:`center-middle`,n),i?de(e,t,void 0,n):de(e,t,[`SubProcessMarker`],n),r}function je(e,t,n,r){var i=22,a={fill:A(r,l,n.fill),stroke:P(r,u,n.stroke),width:i,height:i},o=x(e).isInterrupting,s=o?0:3,c=o?1:1.2,d=20,f=(i-d)/2,p=`translate(`+f+`,`+f+`)`;v(t,d,d,{fill:a.fill,stroke:a.stroke,strokeWidth:c,strokeDasharray:s,transform:p}),se(e,t,a,r)}function F(e,t,n={}){var r=ye(e,t,n);return k(e,t,`center-middle`,n),de(e,t,void 0,n),r}var Me=this.handlers={"bpmn:AdHocSubProcess":function(e,t,n={}){return n=me(t)?X(n,[`fill`,`stroke`,`width`,`height`]):X(n,[`fill`,`stroke`]),Ae(e,t,n)},"bpmn:Association":function(e,t,n={}){return n=X(n,[`fill`,`stroke`]),be(e,t,n)},"bpmn:BoundaryEvent":function(e,t,n={}){var{renderIcon:r=!0}=n;n=X(n,[`fill`,`stroke`]);var i=x(t).get(`cancelActivity`);n={strokeWidth:1.5,fill:A(t,l,n.fill),fillOpacity:Zn,stroke:P(t,u,n.stroke)},i||(n.strokeDasharray=`6`);var a=Ce(e,t,n);return v(e,t.width,t.height,Kn,{...n,fill:`none`}),r&&se(t,e,n),a},"bpmn:BusinessRuleTask":function(e,t,n={}){n=X(n,[`fill`,`stroke`]);var r=F(e,t,n),a=S(e,i.getScaledPath(`TASK_TYPE_BUSINESS_RULE_MAIN`,{abspos:{x:8,y:8}}));T(a,{fill:A(t,l,n.fill),stroke:P(t,u,n.stroke),strokeWidth:1});var o=S(e,i.getScaledPath(`TASK_TYPE_BUSINESS_RULE_HEADER`,{abspos:{x:8,y:8}}));return T(o,{fill:P(t,u,n.stroke),stroke:P(t,u,n.stroke),strokeWidth:1}),r},"bpmn:CallActivity":function(e,t,n={}){return n=X(n,[`fill`,`stroke`]),Ae(e,t,{strokeWidth:5,...n})},"bpmn:ComplexGateway":function(e,t,n={}){n=X(n,[`fill`,`stroke`]);var r=Ee(e,t,n);return S(e,i.getScaledPath(`GATEWAY_COMPLEX`,{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{fill:P(t,u,n.stroke),stroke:P(t,u,n.stroke),strokeWidth:1}),r},"bpmn:DataInput":function(e,t,n={}){n=X(n,[`fill`,`stroke`]);var r=i.getRawPath(`DATA_ARROW`),a=xe(e,t,n);return S(e,r,{fill:`none`,stroke:P(t,u,n.stroke),strokeWidth:1}),a},"bpmn:DataInputAssociation":function(e,t,n={}){return n=X(n,[`fill`,`stroke`]),be(e,t,{...n,markerEnd:g(e,`association-end`,A(t,l,n.fill),P(t,u,n.stroke))})},"bpmn:DataObject":function(e,t,n={}){return n=X(n,[`fill`,`stroke`]),xe(e,t,n)},"bpmn:DataObjectReference":oe(`bpmn:DataObject`),"bpmn:DataOutput":function(e,t,n={}){n=X(n,[`fill`,`stroke`]);var r=i.getRawPath(`DATA_ARROW`),a=xe(e,t,n);return S(e,r,{strokeWidth:1,fill:P(t,u,n.stroke),stroke:P(t,u,n.stroke)}),a},"bpmn:DataOutputAssociation":function(e,t,n={}){return n=X(n,[`fill`,`stroke`]),be(e,t,{...n,markerEnd:g(e,`association-end`,A(t,l,n.fill),P(t,u,n.stroke))})},"bpmn:DataStoreReference":function(e,t,n={}){return n=X(n,[`fill`,`stroke`]),S(e,i.getScaledPath(`DATA_STORE`,{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{fill:A(t,l,n.fill),fillOpacity:Xn,stroke:P(t,u,n.stroke),strokeWidth:2})},"bpmn:EndEvent":function(e,t,n={}){var{renderIcon:r=!0}=n;n=X(n,[`fill`,`stroke`]);var i=Ce(e,t,{...n,strokeWidth:4});return r&&se(t,e,n),i},"bpmn:EventBasedGateway":function(e,t,n={}){n=X(n,[`fill`,`stroke`]);var r=x(t),a=Ee(e,t,n);v(e,t.width,t.height,t.height*.2,{fill:A(t,`none`,n.fill),stroke:P(t,u,n.stroke),strokeWidth:1});var o=r.get(`eventGatewayType`),s=!!r.get(`instantiate`);function c(){S(e,i.getScaledPath(`GATEWAY_EVENT_BASED`,{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}}),{fill:`none`,stroke:P(t,u,n.stroke),strokeWidth:2})}return o===`Parallel`?S(e,i.getScaledPath(`GATEWAY_PARALLEL`,{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:`none`,stroke:P(t,u,n.stroke),strokeWidth:1}):o===`Exclusive`&&(s||v(e,t.width,t.height,t.height*.26,{fill:`none`,stroke:P(t,u,n.stroke),strokeWidth:1}),c()),a},"bpmn:ExclusiveGateway":function(e,t,n={}){n=X(n,[`fill`,`stroke`]);var r=Ee(e,t,n),a=i.getScaledPath(`GATEWAY_EXCLUSIVE`,{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return ee(t).get(`isMarkerVisible`)&&S(e,a,{fill:P(t,u,n.stroke),stroke:P(t,u,n.stroke),strokeWidth:1}),r},"bpmn:Gateway":function(e,t,n={}){return n=X(n,[`fill`,`stroke`]),Ee(e,t,n)},"bpmn:Group":function(e,t,n={}){return n=X(n,[`fill`,`stroke`,`width`,`height`]),y(e,t.width,t.height,Jn,{stroke:P(t,u,n.stroke),strokeWidth:1.5,strokeDasharray:`10, 6, 0, 6`,fill:`none`,pointerEvents:`none`,width:j(t,n),height:N(t,n)})},"bpmn:InclusiveGateway":function(e,t,n={}){n=X(n,[`fill`,`stroke`]);var r=Ee(e,t,n);return v(e,t.width,t.height,t.height*.24,{fill:A(t,l,n.fill),stroke:P(t,u,n.stroke),strokeWidth:2.5}),r},"bpmn:IntermediateEvent":function(e,t,n={}){var{renderIcon:r=!0}=n;n=X(n,[`fill`,`stroke`]);var i=Ce(e,t,{...n,strokeWidth:1.5});return v(e,t.width,t.height,Kn,{fill:`none`,stroke:P(t,u,n.stroke),strokeWidth:1.5}),r&&se(t,e,n),i},"bpmn:IntermediateCatchEvent":oe(`bpmn:IntermediateEvent`),"bpmn:IntermediateThrowEvent":oe(`bpmn:IntermediateEvent`),"bpmn:Lane":function(e,t,n={}){return n=X(n,[`fill`,`stroke`,`width`,`height`]),ke(e,t,{...n,fillOpacity:Qn})},"bpmn:ManualTask":function(e,t,n={}){n=X(n,[`fill`,`stroke`]);var r=F(e,t,n);return S(e,i.getScaledPath(`TASK_TYPE_MANUAL`,{abspos:{x:17,y:15}}),{fill:A(t,l,n.fill),stroke:P(t,u,n.stroke),strokeWidth:.5}),r},"bpmn:MessageFlow":function(e,t,n={}){n=X(n,[`fill`,`stroke`]);var r=x(t),a=ee(t),o=A(t,l,n.fill),s=P(t,u,n.stroke),c=ie(e,t.waypoints,{markerEnd:g(e,`messageflow-end`,o,s),markerStart:g(e,`messageflow-start`,o,s),stroke:s,strokeDasharray:`10, 11`,strokeWidth:1.5});if(r.get(`messageRef`)){var d=c.getPointAtLength(c.getTotalLength()/2),f=i.getScaledPath(`MESSAGE_FLOW_MARKER`,{abspos:{x:d.x,y:d.y}}),p={strokeWidth:1};a.get(`messageVisibleKind`)===`initiating`?(p.fill=o,p.stroke=s):(p.fill=s,p.stroke=o);var m=S(e,f,p),h=pe(e,r.get(`messageRef`).get(`name`),{align:`center-top`,fitBox:!0,style:{fill:s}}),_=m.getBBox(),v=h.getBBox();dn(h,d.x-v.width/2,d.y+_.height/2+Gn,0)}return c},"bpmn:ParallelGateway":function(e,t,n={}){n=X(n,[`fill`,`stroke`]);var r=Ee(e,t,n);return S(e,i.getScaledPath(`GATEWAY_PARALLEL`,{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{fill:P(t,u,n.stroke),stroke:P(t,u,n.stroke),strokeWidth:1}),r},"bpmn:Participant":function(e,t,n={}){n=X(n,[`fill`,`stroke`,`width`,`height`]);var r=ke(e,t,n),i=me(t),a=Se(t),o=x(t),s=o.get(`name`);if(i)re(e,a?[{x:30,y:0},{x:30,y:N(t,n)}]:[{x:0,y:30},{x:j(t,n),y:30}],{stroke:P(t,u,n.stroke),strokeWidth:qn}),ge(e,s,t,n);else{var c=we(t,n);a||(c.height=j(t,n),c.width=N(t,n));var l=pe(e,s,{box:c,align:`center-middle`,style:{fill:De(t,d,u,n.stroke)}});a||dn(l,0,-(-1*N(t,n)),270)}return o.get(`participantMultiplicity`)&&ue(`ParticipantMultiplicityMarker`,e,t,n),r},"bpmn:ReceiveTask":function(e,t,n={}){n=X(n,[`fill`,`stroke`]);var r=x(t),a=F(e,t,n),o;return r.get(`instantiate`)?(v(e,28,28,4.4,{fill:A(t,l,n.fill),stroke:P(t,u,n.stroke),strokeWidth:1}),o=i.getScaledPath(`TASK_TYPE_INSTANTIATING_SEND`,{abspos:{x:7.77,y:9.52}})):o=i.getScaledPath(`TASK_TYPE_SEND`,{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),S(e,o,{fill:A(t,l,n.fill),stroke:P(t,u,n.stroke),strokeWidth:1}),a},"bpmn:ScriptTask":function(e,t,n={}){n=X(n,[`fill`,`stroke`]);var r=F(e,t,n);return S(e,i.getScaledPath(`TASK_TYPE_SCRIPT`,{abspos:{x:15,y:20}}),{fill:A(t,l,n.fill),stroke:P(t,u,n.stroke),strokeWidth:1}),r},"bpmn:SendTask":function(e,t,n={}){n=X(n,[`fill`,`stroke`]);var r=F(e,t,n);return S(e,i.getScaledPath(`TASK_TYPE_SEND`,{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{fill:P(t,u,n.stroke),stroke:A(t,l,n.fill),strokeWidth:1}),r},"bpmn:SequenceFlow":function(e,t,n={}){n=X(n,[`fill`,`stroke`]);var r=A(t,l,n.fill),i=P(t,u,n.stroke),a=ie(e,t.waypoints,{markerEnd:g(e,`sequenceflow-end`,r,i),stroke:i}),o=x(t),{source:s}=t;if(s){var c=x(s);o.get(`conditionExpression`)&&b(c,`bpmn:Activity`)&&T(a,{markerStart:g(e,`conditional-flow-marker`,r,i)}),c.get(`default`)&&(b(c,`bpmn:Gateway`)||b(c,`bpmn:Activity`))&&c.get(`default`)===o&&T(a,{markerStart:g(e,`conditional-default-flow-marker`,r,i)})}return a},"bpmn:ServiceTask":function(e,t,n={}){n=X(n,[`fill`,`stroke`]);var r=F(e,t,n);return v(e,10,10,{fill:A(t,l,n.fill),stroke:`none`,transform:`translate(6, 6)`}),S(e,i.getScaledPath(`TASK_TYPE_SERVICE`,{abspos:{x:12,y:18}}),{fill:A(t,l,n.fill),stroke:P(t,u,n.stroke),strokeWidth:1}),v(e,10,10,{fill:A(t,l,n.fill),stroke:`none`,transform:`translate(11, 10)`}),S(e,i.getScaledPath(`TASK_TYPE_SERVICE`,{abspos:{x:17,y:22}}),{fill:A(t,l,n.fill),stroke:P(t,u,n.stroke),strokeWidth:1}),r},"bpmn:StartEvent":function(e,t,n={}){var{renderIcon:r=!0}=n;n=X(n,[`fill`,`stroke`]),x(t).get(`isInterrupting`)||(n={...n,strokeDasharray:`6`});var i=Ce(e,t,n);return r&&se(t,e,n),i},"bpmn:SubProcess":function(e,t,n={}){return n=me(t)?X(n,[`fill`,`stroke`,`width`,`height`]):X(n,[`fill`,`stroke`]),Ae(e,t,n)},"bpmn:Task":function(e,t,n={}){return n=X(n,[`fill`,`stroke`]),F(e,t,n)},"bpmn:TextAnnotation":function(e,t,n={}){n=X(n,[`fill`,`stroke`]);var{width:r,height:a}=we(t,n),o=y(e,r,a,0,0,{fill:`none`,stroke:`none`});return S(e,i.getScaledPath(`TEXT_ANNOTATION`,{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:a,position:{mx:0,my:0}}),{stroke:P(t,u,n.stroke)}),pe(e,x(t).get(`text`)||``,{align:`left-top`,box:we(t,n),padding:7,style:{fill:De(t,d,u,n.stroke)}}),o},"bpmn:Transaction":function(e,t,r={}){r=me(t)?X(r,[`fill`,`stroke`,`width`,`height`]):X(r,[`fill`,`stroke`]);var i=Ae(e,t,{strokeWidth:1.5,...r}),a=n.style([`no-fill`,`no-events`],{stroke:P(t,u,r.stroke),strokeWidth:1.5});return me(t)||(r={}),y(e,j(t,r),N(t,r),Jn-Kn,Kn,a),i},"bpmn:UserTask":function(e,t,n={}){n=X(n,[`fill`,`stroke`]);var r=F(e,t,n),a=15,o=12;return S(e,i.getScaledPath(`TASK_TYPE_USER_1`,{abspos:{x:a,y:o}}),{fill:A(t,l,n.fill),stroke:P(t,u,n.stroke),strokeWidth:.5}),S(e,i.getScaledPath(`TASK_TYPE_USER_2`,{abspos:{x:a,y:o}}),{fill:A(t,l,n.fill),stroke:P(t,u,n.stroke),strokeWidth:.5}),S(e,i.getScaledPath(`TASK_TYPE_USER_3`,{abspos:{x:a,y:o}}),{fill:P(t,u,n.stroke),stroke:P(t,u,n.stroke),strokeWidth:.5}),r},label:function(e,t,n={}){return he(e,t,n)}};this._drawPath=S,this._renderer=ae}k($n,ce),$n.$inject=[`config.bpmnRenderer`,`eventBus`,`styles`,`pathMap`,`canvas`,`textRenderer`],$n.prototype.canRender=function(e){return b(e,`bpmn:BaseElement`)},$n.prototype.drawShape=function(e,t,n={}){var{type:r}=t;return this._renderer(r)(e,t,n)},$n.prototype.drawConnection=function(e,t,n={}){var{type:r}=t;return this._renderer(r)(e,t,n)},$n.prototype.getShapePath=function(e){return S(e)?Ce(e,Yn):b(e,`bpmn:Event`)?Ee(e):b(e,`bpmn:Activity`)?Ce(e,Jn):b(e,`bpmn:Gateway`)?be(e):ge(e)};function X(e,t=[]){return t.reduce((t,n)=>(e[n]&&(t[n]=e[n]),t),{})}var er=0,tr={width:150,height:50};function nr(e){var t=e.split(`-`);return{horizontal:t[0]||`center`,vertical:t[1]||`top`}}function rr(e){return r(e)?m({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}var ir=null;function ar(){return ir||=document.createElement(`canvas`).getContext(`2d`),ir}function or(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(sr(e.fontSize)||`12px`),t.push(e.fontFamily||`sans-serif`),t.join(` `)}function sr(e){if(e!=null)return typeof e==`number`||/^-?\d+(\.\d+)?$/.test(e)?e+`px`:e}function cr(e,t){var n=ar();if(!n)return{width:0,height:0};n.font=or(t),`letterSpacing`in n&&(n.letterSpacing=sr(t.letterSpacing)||`0px`);var r=e===``,i=r?`dummy`:e.replace(/\s+$/,``),a=n.measureText(i);return{width:r?0:a.width,height:`fontBoundingBoxAscent`in a?a.fontBoundingBoxAscent+a.fontBoundingBoxDescent:a.actualBoundingBoxAscent+a.actualBoundingBoxDescent}}function lr(e,t,n){for(var r=e.shift(),i=r,a;;){if(a=cr(i,n),a.width=i?a.width:0,i===` `||i===``||a.width<=t||i.length<2)return ur(e,i,r,a);i=pr(i,a.width,t)}}function ur(e,t,n,r){if(t.length<n.length){var i=n.slice(t.length).trim();e.unshift(i)}return{width:r.width,height:r.height,text:t}}var dr=`­`;function fr(e,t){var n=e.split(/(\s|-|\u00AD)/g),r,i=[],a=0;if(n.length>1)for(;r=n.shift();)if(r.length+a<t)i.push(r),a+=r.length;else{(r===`-`||r===dr)&&i.pop();break}var o=i[i.length-1];return o&&o===dr&&(i[i.length-1]=`-`),i.join(``)}function pr(e,t,n){var r=Math.max(e.length*(n/t),1),i=fr(e,r);return i||=e.slice(0,Math.max(Math.round(r-1),1)),i}function mr(e){this._config=m({},{size:tr,padding:er,style:{},align:`center-top`},e||{})}mr.prototype.createText=function(e,t){return this.layoutText(e,t).element},mr.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},mr.prototype.layoutText=function(e,t){for(var r=m({},this._config.size,t.box),i=m({},this._config.style,t.style),a=nr(t.align||this._config.align),o=rr(t.padding===void 0?this._config.padding:t.padding),s=t.fitBox||!1,l=hr(i),u=e.split(/\u00AD?\r?\n/),d=[],f=r.width-o.left-o.right;u.length;)d.push(lr(u,f,i));a.vertical===`middle`&&(o.top=o.bottom=0);var p=n(d,function(e,t,n){return e+(l||t.height)},0)+o.top+o.bottom,h=n(d,function(e,t,n){return t.width>e?t.width:e},0),g=o.top;a.vertical===`middle`&&(g+=(r.height-p)/2),g-=(l||d[0].height)/4;var _=E(`text`);return T(_,i),c(d,function(e){var t;switch(g+=l||e.height,a.horizontal){case`left`:t=o.left;break;case`right`:t=(s?h:f)-o.right-e.width;break;default:t=Math.max(((s?h:f)-e.width)/2+o.left,0)}var n=E(`tspan`);T(n,{x:t,y:g}),n.textContent=e.text,O(_,n)}),{dimensions:{width:h,height:p},element:_}};function hr(e){if(`fontSize`in e&&`lineHeight`in e)return e.lineHeight*parseInt(e.fontSize,10)}var gr=12,_r=1.2,vr=40;function yr(e){var t=m({fontFamily:`Arial, sans-serif`,fontSize:gr,fontWeight:`normal`,lineHeight:_r},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,r=m({},t,{fontSize:n},e&&e.externalStyle||{}),i=new mr({style:t});this.getExternalLabelBounds=function(e,t){var n=a(t,{width:Math.max(e.width,ie.width),height:30},{style:r});return{x:Math.round(e.x+e.width/2-n.width/2),y:e.y,width:Math.ceil(n.width),height:Math.ceil(n.height)}},this.getTextAnnotationBounds=function(e,n){var r=a(n,e,{style:t,align:`left-top`,padding:7});return{x:e.x,y:e.y,width:e.width,height:Math.max(vr,Math.round(r.height))}},this.getDimensions=function(e,t){return i.getDimensions(e,t||{})};function a(e,t,n){return i.getDimensions(e,m({box:t},n))}this.createText=function(e,t){return i.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return r}}yr.$inject=[`config.textRenderer`];function br(){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(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n=this.pathMap[e],r,i;t.abspos?(r=t.abspos.x,i=t.abspos.y):(r=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var a={};if(t.position){for(var o=t.containerHeight/n.height*t.yScaleFactor,s=t.containerWidth/n.width*t.xScaleFactor,c=0;c<n.heightElements.length;c++)a[`y`+c]=n.heightElements[c]*o;for(var l=0;l<n.widthElements.length;l++)a[`x`+l]=n.widthElements[l]*s}return wr(n.d,{mx:r,my:i,e:a})}}var xr=/\{([^{}]+)\}/g,Sr=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;function Cr(e,t,n){var r=n;return t.replace(Sr,function(e,t,n,i,a){t||=i,r&&(t in r&&(r=r[t]),typeof r==`function`&&a&&(r=r()))}),r=(r==null||r==n?e:r)+``,r}function wr(e,t){return String(e).replace(xr,function(e,n){return Cr(e,n,t)})}var Tr={__init__:[`bpmnRenderer`],bpmnRenderer:[`type`,$n],textRenderer:[`type`,yr],pathMap:[`type`,br]};function Er(e,t){return t||={},e.replace(/{([^}]+)}/g,function(e,n){return t[n]||`{`+n+`}`})}var Dr={translate:[`value`,Er]};function Or(e,t,n){return m({id:e.id,type:e.$type,businessObject:e,di:t},n)}function kr(e,t,n){var r=e.waypoint;return!r||r.length<2?[C(t),C(n)]:r.map(function(e){return{x:e.x,y:e.y}})}function Ar(e,t,n){return Error(`element ${K(t)} referenced by ${K(e)}#${n} not yet drawn`)}function Z(e,t,n,r,i){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=r,this._textRenderer=i}Z.$inject=[`eventBus`,`canvas`,`elementFactory`,`elementRegistry`,`textRenderer`],Z.prototype.add=function(e,t,n){var r,i,a;if(b(t,`bpmndi:BPMNPlane`)){var o=b(e,`bpmn:SubProcess`)?{id:e.id+`_plane`}:{};r=this._elementFactory.createRoot(Or(e,t,o)),this._canvas.addRootElement(r)}else if(b(t,`bpmndi:BPMNShape`)){var s=!me(e,t),c=Mr(e);i=n&&(n.hidden||n.collapsed);var l=t.bounds;r=this._elementFactory.createShape(Or(e,t,{collapsed:s,hidden:i,x:Math.round(l.x),y:Math.round(l.y),width:Math.round(l.width),height:Math.round(l.height),isFrame:c})),b(e,`bpmn:BoundaryEvent`)&&this._attachBoundary(e,r),b(e,`bpmn:Lane`)&&(a=0),b(e,`bpmn:DataStoreReference`)&&(jr(n,C(l))||(n=this._canvas.findRoot(n))),this._canvas.addShape(r,n,a)}else if(b(t,`bpmndi:BPMNEdge`)){var u=this._getSource(e),d=this._getTarget(e);i=n&&(n.hidden||n.collapsed),r=this._elementFactory.createConnection(Or(e,t,{hidden:i,source:u,target:d,waypoints:kr(t,u,d)})),b(e,`bpmn:DataAssociation`)&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(r,n,a)}else throw Error(`unknown di ${K(t)} for element ${K(e)}`);return re(e)&&te(r)&&this.addLabel(e,t,r),this._eventBus.fire(`bpmnElement.added`,{element:r}),r},Z.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw Error(`missing ${K(e)}#attachedToRef`);var r=this._elementRegistry.get(n.id),i=r&&r.attachers;if(!r)throw Ar(e,n,`attachedToRef`);t.host=r,i||(r.attachers=i=[]),i.indexOf(t)===-1&&i.push(t)},Z.prototype.addLabel=function(e,t,n){var r=ne(t,n),i=te(n),a;return i&&(r=this._textRenderer.getExternalLabelBounds(r,i)),a=this._elementFactory.createLabel(Or(e,t,{id:e.id+`_label`,labelTarget:n,type:`label`,hidden:n.hidden||!te(n),x:Math.round(r.x),y:Math.round(r.y),width:Math.round(r.width),height:Math.round(r.height)})),this._canvas.addShape(a,n.parent)},Z.prototype._getConnectedElement=function(e,t){var n,r,i=e.$type;if(r=e[t+`Ref`],t===`source`&&i===`bpmn:DataInputAssociation`&&(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?Ar(e,r,t+`Ref`):Error(`${K(e)}#${t} Ref not specified`)},Z.prototype._getSource=function(e){return this._getConnectedElement(e,`source`)},Z.prototype._getTarget=function(e){return this._getConnectedElement(e,`target`)},Z.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};function jr(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 Mr(e){return b(e,`bpmn:Group`)}var Nr={__depends__:[Tr,{__depends__:[Dr],bpmnImporter:[`type`,Z]}]};function Pr(e){this._counter=0,this._prefix=(e?e+`-`:``)+Math.floor(Math.random()*1e9)+`-`}Pr.prototype.next=function(){return this._prefix+ ++this._counter};var Fr=new Pr(`ov`),Ir=500;function Q(e,t,n,r){this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=Fr,this._overlayDefaults=m({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=Lr(n.getContainer()),this._init()}Q.$inject=[`config.overlays`,`eventBus`,`canvas`,`elementRegistry`],Q.prototype.get=function(e){if(g(e)&&(e={id:e}),g(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var n=this._getOverlayContainer(e.element,!0);return n?e.type?i(n.overlays,t({type:e.type})):n.overlays.slice():[]}return e.type?i(this._overlays,t({type:e.type})):e.id?this._overlays[e.id]:null},Q.prototype.add=function(e,t,n){if(r(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw Error(`must specifiy overlay position`);if(!n.html)throw Error(`must specifiy overlay html`);if(!e)throw Error(`invalid element specified`);var i=this._ids.next();return n=m({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},Q.prototype.remove=function(e){var t=this.get(e)||[];a(t)||(t=[t]);var n=this;c(t,function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(tt(e.html),tt(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var r=t.overlays.indexOf(e);r!==-1&&t.overlays.splice(r,1)}})},Q.prototype.isShown=function(){return this._overlayRoot.style.display!==`none`},Q.prototype.show=function(){zr(this._overlayRoot)},Q.prototype.hide=function(){zr(this._overlayRoot,!1)},Q.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Ve(this._overlayRoot)},Q.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,i=t.y;if(t.waypoints){var a=vt(t);r=a.x,i=a.y}Rr(n,r,i),Le(e.html,`data-container-id`,t.id)},Q.prototype._updateOverlay=function(e){var t=e.position,n=e.htmlContainer,r=e.element,i=t.left,a=t.top;if(t.right!==void 0){var o=r.waypoints?vt(r).width:r.width;i=t.right*-1+o}if(t.bottom!==void 0){var s=r.waypoints?vt(r).height:r.height;a=t.bottom*-1+s}Rr(n,i||0,a||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Q.prototype._createOverlayContainer=function(e){var t=R(`<div class="djs-overlays" />`);z(t,{position:`absolute`}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},Q.prototype._updateRoot=function(e){var t=e.scale||1,n=`matrix(`+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(`,`)+`)`;Br(this._overlayRoot,n)},Q.prototype._getOverlayContainer=function(e,t){var n=d(this._overlayContainers,function(t){return t.element===e});return!n&&!t?this._createOverlayContainer(e):n},Q.prototype._addOverlay=function(e){var t=e.id,n=e.element,r=e.html,i,a;r.get&&r.constructor.prototype.jquery&&(r=r.get(0)),g(r)&&(r=R(r)),a=this._getOverlayContainer(n),i=R(`<div class="djs-overlay" data-overlay-id="`+t+`">`),z(i,{position:`absolute`}),i.appendChild(r),e.type&&ze(i).add(`djs-overlay-`+e.type);var o=this._canvas.findRoot(n),s=this._canvas.getRootElement();zr(i,o===s),e.htmlContainer=i,a.overlays.push(e),a.html.appendChild(i),this._overlays[t]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Q.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=this._canvas.findRoot(e.element),i=n&&n.minZoom,a=n&&n.maxZoom,o=e.htmlContainer,s=this._canvas.getRootElement(),c=!0;r===s?n&&(f(i)&&i>t.scale||f(a)&&a<t.scale)&&(c=!1):c=!1,zr(o,c),this._updateOverlayScale(e,t)},Q.prototype._updateOverlayScale=function(e,t){var n=e.scale,r,i,a=e.htmlContainer,o,s=``;n!==!0&&(n===!1?(r=1,i=1):(r=n.min,i=n.max),f(r)&&t.scale<r&&(o=(1/t.scale||1)*r),f(i)&&t.scale>i&&(o=(1/t.scale||1)*i)),f(o)&&(s=`scale(`+o+`,`+o+`)`),Br(a,s)},Q.prototype._updateOverlaysVisibilty=function(e){var t=this;c(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},Q.prototype._init=function(){var e=this._eventBus,t=this;function n(e){t._updateRoot(e),t._updateOverlaysVisibilty(e),t.show()}e.on(`canvas.viewbox.changing`,function(e){t.hide()}),e.on(`canvas.viewbox.changed`,function(e){n(e.viewbox)}),e.on([`shape.remove`,`connection.remove`],function(e){var n=e.element,r=t.get({element:n});c(r,function(e){t.remove(e.id)});var i=t._getOverlayContainer(n);if(i){tt(i.html);var a=t._overlayContainers.indexOf(i);a!==-1&&t._overlayContainers.splice(a,1)}}),e.on(`element.changed`,Ir,function(e){var n=e.element,r=t._getOverlayContainer(n,!0);r&&(c(r.overlays,function(e){t._updateOverlay(e)}),t._updateOverlayContainer(r))}),e.on(`element.marker.update`,function(e){var n=t._getOverlayContainer(e.element,!0);n&&ze(n.html)[e.add?`add`:`remove`](e.marker)}),e.on(`root.set`,function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on(`diagram.clear`,this.clear,this)};function Lr(e){var t=R(`<div class="djs-overlay-container" />`);return z(t,{position:`absolute`,width:0,height:0}),e.insertBefore(t,e.firstChild),t}function Rr(e,t,n){z(e,{left:t+`px`,top:n+`px`})}function zr(e,t){e.style.display=t===!1?`none`:``}function Br(e,t){e.style[`transform-origin`]=`top left`,[``,`-ms-`,`-webkit-`].forEach(function(n){e.style[n+`transform`]=t})}var Vr={__init__:[`overlays`],overlays:[`type`,Q]};function Hr(e,t,n,r){e.on(`element.changed`,function(r){var i=r.element;(i.parent||i===t.getRootElement())&&(r.gfx=n.getGraphics(i)),r.gfx&&e.fire(bt(i)+`.changed`,r)}),e.on(`elements.changed`,function(t){var n=t.elements;n.forEach(function(t){e.fire(`element.changed`,{element:t})}),r.updateContainments(n)}),e.on(`shape.changed`,function(e){r.update(`shape`,e.element,e.gfx)}),e.on(`connection.changed`,function(e){r.update(`connection`,e.element,e.gfx)})}Hr.$inject=[`eventBus`,`canvas`,`elementRegistry`,`graphicsFactory`];var Ur={__init__:[`changeSupport`],changeSupport:[`type`,Hr]};function Wr(e,t){t.invoke(ke,this),this.executed(function(t){var n=t.context;n.rootElement?e.setRootElement(n.rootElement):n.rootElement=e.getRootElement()}),this.revert(function(t){var n=t.context;n.rootElement&&e.setRootElement(n.rootElement)})}k(Wr,ke),Wr.$inject=[`canvas`,`injector`];var Gr={__init__:[`rootElementsBehavior`],rootElementsBehavior:[`type`,Wr]};function Kr(e){return CSS.escape(e)}var qr={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`};function Jr(e){return e=``+e,e&&e.replace(/[&<>"']/g,function(e){return qr[e]})}var Yr=`bjs-breadcrumbs-shown`;function Xr(e,t,n){var r=R(`<ul class="bjs-breadcrumbs"></ul>`),i=n.getContainer(),a=ze(i);i.appendChild(r);var o=[];e.on(`element.changed`,function(e){var t=e.element,n=x(t);d(o,function(e){return e===n})&&s()});function s(e){e&&(o=Zr(e));var i=o.flatMap(function(e){var r=n.findRoot(Ae(e))||n.findRoot(e.id);if(!r&&b(e,`bpmn:Process`)){var i=t.find(function(t){var n=x(t);return n&&n.get(`processRef`)===e});r=i&&n.findRoot(i.id)}return r?[{parent:e,parentPlane:r}]:[]});r.innerHTML=``;var s=i.length>1;a.toggle(Yr,s),i.forEach(function(e,t){var a=e.parent,o=e.parentPlane,s=Jr(a.name||a.id),c=t===i.length-1,l;c?l=R(`<li><span class="bjs-crumb" title="`+s+`">`+s+`</span></li>`):(l=R(`<li><a class="bjs-crumb" href="`+(`#`+Jr(a.id))+`" title="`+s+`">`+s+`</a></li>`),l.addEventListener(`click`,function(e){e.preventDefault(),n.setRootElement(o)})),r.appendChild(l)})}e.on(`root.set`,function(e){s(e.element)})}Xr.$inject=[`eventBus`,`elementRegistry`,`canvas`];function Zr(e){for(var t=x(e),n=[],r=t;r;r=r.$parent)(b(r,`bpmn:SubProcess`)||b(r,`bpmn:Process`))&&n.push(r);return n.reverse()}function Qr(e,t){var n=null,r=new $r;e.on(`root.set`,function(e){var i=e.element,a=t.viewbox(),o=r.get(i);if(r.set(n,{x:a.x,y:a.y,zoom:a.scale}),n=i,b(i,`bpmn:SubProcess`)||o){o||={x:0,y:0,zoom:1};var s=(a.x-o.x)*a.scale,c=(a.y-o.y)*a.scale;(s!==0||c!==0)&&t.scroll({dx:s,dy:c}),o.zoom!==a.scale&&t.zoom(o.zoom,{x:0,y:0})}}),e.on(`diagram.clear`,function(){r.clear(),n=null})}Qr.$inject=[`eventBus`,`canvas`];function $r(){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 ei={x:180,y:160};function ti(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on(`import.render.start`,1500,function(e,t){n._handleImport(t.definitions)})}ti.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach(function(e){e.plane&&e.plane.bpmnElement&&(t._processToDiagramMap[e.plane.bpmnElement.id]=e)}),e.diagrams.filter(e=>e.plane).flatMap(e=>t._createNewDiagrams(e.plane)).forEach(function(e){t._movePlaneElementsToOrigin(e.plane)})}},ti.prototype._createNewDiagrams=function(e){var t=this,n=[],r=[];e.get(`planeElement`).forEach(function(t){var i=t.bpmnElement;if(i){var a=i.$parent;b(i,`bpmn:SubProcess`)&&!t.isExpanded&&n.push(i),ii(i,e)&&r.push({diElement:t,parent:a})}});var i=[];return n.forEach(function(e){if(!t._processToDiagramMap[e.id]){var n=t._createDiagram(e);t._processToDiagramMap[e.id]=n,i.push(n)}}),r.forEach(function(e){for(var r=e.diElement,i=e.parent;i&&n.indexOf(i)===-1;)i=i.$parent;if(i){var a=t._processToDiagramMap[i.id];t._moveToDiPlane(r,a.plane)}}),i},ti.prototype._movePlaneElementsToOrigin=function(e){var t=e.get(`planeElement`),n=ri(e),r={x:n.x-ei.x,y:n.y-ei.y};t.forEach(function(e){e.waypoint?e.waypoint.forEach(function(e){e.x-=r.x,e.y-=r.y}):e.bounds&&(e.bounds.x=e.bounds.x-r.x,e.bounds.y=e.bounds.y-r.y)})},ti.prototype._moveToDiPlane=function(e,t){var n=ni(e).plane.get(`planeElement`);n.splice(n.indexOf(e),1),t.get(`planeElement`).push(e)},ti.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},ti.$inject=[`eventBus`,`moddle`];function ni(e){return b(e,`bpmndi:BPMNDiagram`)?e:ni(e.$parent)}function ri(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach(function(e){if(e.bounds){var n=ae(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}}),oe(t)}function ii(e,t){var n=e.$parent;return!(!b(n,`bpmn:SubProcess`)||n===t.bpmnElement||y(e,[`bpmn:DataInputAssociation`,`bpmn:DataOutputAssociation`]))}var ai=250,oi=`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg>`,si=`bjs-drilldown-empty`;function $(e,t,n,r,i){ke.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=r,this._translate=i;var a=this;this.executed(`shape.toggleCollapse`,ai,function(e){var t=e.shape;a._canDrillDown(t)?a._addOverlay(t):a._removeOverlay(t)},!0),this.reverted(`shape.toggleCollapse`,ai,function(e){var t=e.shape;a._canDrillDown(t)?a._addOverlay(t):a._removeOverlay(t)},!0),this.executed([`shape.create`,`shape.move`,`shape.delete`],ai,function(e){var t=e.oldParent,n=e.newParent||e.parent,r=e.shape;a._canDrillDown(r)&&a._addOverlay(r),a._updateDrilldownOverlay(t),a._updateDrilldownOverlay(n),a._updateDrilldownOverlay(r)},!0),this.reverted([`shape.create`,`shape.move`,`shape.delete`],ai,function(e){var t=e.oldParent,n=e.newParent||e.parent,r=e.shape;a._canDrillDown(r)&&a._addOverlay(r),a._updateDrilldownOverlay(t),a._updateDrilldownOverlay(n),a._updateDrilldownOverlay(r)},!0),t.on(`import.render.complete`,function(){n.filter(function(e){return a._canDrillDown(e)}).map(function(e){a._addOverlay(e)})})}k($,ke),$.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},$.prototype._canDrillDown=function(e){var t=this._canvas;return b(e,`bpmn:SubProcess`)&&t.findRoot(Ae(e))},$.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=x(e),r=t.get({element:n.id,type:`drilldown`})[0];if(r){var i=n&&n.get(`flowElements`)&&n.get(`flowElements`).length;ze(r.html).toggle(si,!i)}},$.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,r=x(e);n.get({element:e,type:`drilldown`}).length&&this._removeOverlay(e);var i=R(`<button type="button" class="bjs-drilldown">`+oi+`</button>`),a=r.get(`name`)||r.get(`id`),o=this._translate(`Open {element}`,{element:a});i.setAttribute(`title`,o),i.addEventListener(`click`,function(){t.setRootElement(t.findRoot(Ae(e)))}),n.add(e,`drilldown`,{position:{bottom:-7,right:-8},html:i}),this._updateOverlayVisibility(e)},$.prototype._removeOverlay=function(e){this._overlays.remove({element:e,type:`drilldown`})},$.$inject=[`canvas`,`eventBus`,`elementRegistry`,`overlays`,`translate`];var ci={__depends__:[Vr,Ur,Gr],__init__:[`drilldownBreadcrumbs`,`drilldownOverlayBehavior`,`drilldownCentering`,`subprocessCompatibility`],drilldownBreadcrumbs:[`type`,Xr],drilldownCentering:[`type`,Qr],drilldownOverlayBehavior:[`type`,$],subprocessCompatibility:[`type`,ti]};function li(e){e&&typeof e.stopPropagation==`function`&&e.stopPropagation()}function ui(e){return e.originalEvent||e.srcEvent}function di(e){li(e),li(ui(e))}function fi(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 pi(){return/mac/i.test(navigator.platform)}function mi(e,t){return(ui(e)||e).button===t}function hi(e){return mi(e,0)}function gi(e){return mi(e,1)}function _i(e){var t=ui(e)||e;return hi(e)?pi()?t.metaKey:t.ctrlKey:!1}function vi(e){var t=ui(e)||e;return hi(e)&&t.shiftKey}function yi(e){return!0}function bi(e){return hi(e)||gi(e)}var xi=500;function Si(e,t,n){var r=this;function i(n,r,i){if(!s(n,r)){var a,o,c;i?o=t.getGraphics(i):(a=r.delegateTarget||r.target,a&&(o=a,i=t.get(o))),o&&i&&(c=e.fire(n,{element:i,gfx:o,originalEvent:r}),c===!1&&(r.stopPropagation(),r.preventDefault()))}}var a={};function o(e){return a[e]}function s(e,t){return!(u[e]||hi)(t)}var l={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":yi,"element.mousedown":bi,"element.mouseup":bi,"element.click":bi,"element.dblclick":bi};function d(e,t,n){var r=l[e];if(!r)throw Error(`unmapped DOM event name <`+e+`>`);return i(r,t,n)}var f=`svg, .djs-element`;function p(e,t,n,r){var o=a[n]=function(e){i(n,e)};r&&(u[n]=r),o.$delegate=Qe.bind(e,f,t,o)}function h(e,t,n){var r=o(n);r&&Qe.unbind(e,t,r.$delegate)}function g(e){c(l,function(t,n){p(e,n,t)})}function _(e){c(l,function(t,n){h(e,n,t)})}e.on(`canvas.destroy`,function(e){_(e.svg)}),e.on(`canvas.init`,function(e){g(e.svg)}),e.on([`shape.added`,`connection.added`],function(t){var n=t.element,r=t.gfx;e.fire(`interactionEvents.createHit`,{element:n,gfx:r})}),e.on([`shape.changed`,`connection.changed`],xi,function(t){var n=t.element,r=t.gfx;e.fire(`interactionEvents.updateHit`,{element:n,gfx:r})}),e.on(`interactionEvents.createHit`,xi,function(e){var t=e.element,n=e.gfx;r.createDefaultHit(t,n)}),e.on(`interactionEvents.updateHit`,function(e){var t=e.element,n=e.gfx;r.updateDefaultHit(t,n)});var v=b(`djs-hit djs-hit-stroke`),y=b(`djs-hit djs-hit-click-stroke`),ee={all:b(`djs-hit djs-hit-all`),"click-stroke":y,stroke:v,"no-move":b(`djs-hit djs-hit-no-move`)};function b(e,t){return t=m({stroke:`white`,strokeWidth:15},t||{}),n.cls(e,[`no-fill`,`no-border`],t)}function x(e,t){var n=ee[t];if(!n)throw Error(`invalid hit type <`+t+`>`);return T(e,n),e}function te(e,t){O(e,t)}this.removeHits=function(e){var t=et(`.djs-hit`,e);c(t,de)},this.createDefaultHit=function(e,t){var n=e.waypoints,r=e.isFrame,i;return n?this.createWaypointsHit(t,n):(i=r?`stroke`:`all`,this.createBoxHit(t,i,{width:e.width,height:e.height}))},this.createWaypointsHit=function(e,t){var n=ve(t);return x(n,`stroke`),te(e,n),n},this.createBoxHit=function(e,t,n){n=m({x:0,y:0},n);var r=E(`rect`);return x(r,t),T(r,n),te(e,r),r},this.updateDefaultHit=function(e,t){var n=B(`.djs-hit`,t);if(n)return e.waypoints?he(n,e.waypoints):T(n,{width:e.width,height:e.height}),n},this.fire=i,this.triggerMouseEvent=d,this.mouseHandler=o,this.registerEvent=p,this.unregisterEvent=h}Si.$inject=[`eventBus`,`elementRegistry`,`styles`];var Ci={__init__:[`interactionEvents`],interactionEvents:[`type`,Si]};function wi(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=new Set;var n=this;e.on([`shape.remove`,`connection.remove`],function(e){var t=e.element;n.deselect(t)}),e.on([`diagram.clear`,`root.set`],function(e){n.select(null)})}wi.$inject=[`eventBus`,`canvas`],wi.prototype.deselect=function(e){if(this._selectedElements.has(e)){var t=this.get();this._selectedElements.delete(e),this._eventBus.fire(`selection.changed`,{oldSelection:t,newSelection:this.get()})}},wi.prototype.get=function(){return Array.from(this._selectedElements)},wi.prototype.isSelected=function(e){return this._selectedElements.has(e)},wi.prototype.select=function(e,t){var n=this.get();a(e)||(e=e?[e]:[]);var r=this._canvas,i=r.getRootElement();e=e.filter(function(e){return i===r.findRoot(e)}),t?c(e,e=>{this._selectedElements.add(e)}):this._selectedElements=new Set(e),this._eventBus.fire(`selection.changed`,{oldSelection:n,newSelection:this.get()})};var Ti=`hover`,Ei=`selected`;function Di(e,t){this._canvas=e;function n(t,n){e.addMarker(t,n)}function r(t,n){e.removeMarker(t,n)}t.on(`element.hover`,function(e){n(e.element,Ti)}),t.on(`element.out`,function(e){r(e.element,Ti)}),t.on(`selection.changed`,function(e){function t(e){r(e,Ei)}function i(e){n(e,Ei)}var a=new Set(e.oldSelection),o=new Set(e.newSelection);for(let e of a)o.has(e)||t(e);for(let e of o)a.has(e)||i(e)})}Di.$inject=[`canvas`,`eventBus`];function Oi(e,t,n,r){e.on(`create.end`,500,function(e){var n=e.context,r=n.canExecute,i=n.elements,o=(n.hints||{}).autoSelect;if(r){if(o===!1)return;a(o)?t.select(o):t.select(i.filter(ki))}}),e.on(`connect.end`,500,function(e){var n=e.context.connection;n&&t.select(n)}),e.on(`shape.move.end`,500,function(e){var n=e.previousSelection||[],i=r.get(e.context.shape.id);d(n,function(e){return i.id===e.id})||t.select(i)}),e.on(`element.click`,function(e){if(hi(e)){var r=e.element;r===n.getRootElement()&&(r=null);var i=t.isSelected(r),a=t.get().length>1,o=vi(e);if(i&&a)return o?t.deselect(r):t.select(r);i?t.deselect(r):t.select(r,o)}})}Oi.$inject=[`eventBus`,`selection`,`canvas`,`elementRegistry`];function ki(e){return!e.hidden}var Ai={__init__:[`selectionVisuals`,`selectionBehavior`],__depends__:[Ci],selection:[`type`,wi],selectionVisuals:[`type`,Di],selectionBehavior:[`type`,Oi]};function ji(e){Y.call(this,e)}k(ji,Y),ji.prototype._modules=[Nr,ci,Vr,Ai,Dr],ji.prototype._moddleExtensions={};export{gt as A,$e as B,nn as C,_t as D,vt as E,ze as F,tt as H,Ve as I,He as L,et as M,z as N,yt as O,Le as P,Qe as R,ln as S,mt as T,R as U,B as V,I as W,Hn as _,hi as a,dn as b,di as c,Jr as d,ji as default,Ur as f,Un as g,Dr as h,vi as i,ht as j,pt as k,fi as l,Pr as m,Ci as n,pi as o,Vr as p,_i as r,ui as s,Ai as t,Kr as u,Y as v,tn as w,fn as x,pn as y,Je as z};