Home
last modified time | relevance | path

Searched refs:getPropertyForNode (Results 1 – 6 of 6) sorted by relevance

/plugin/bpmnio/vendor/bpmn-js/dist/
H A Dbpmn-viewer.production.min.js2 (()=>{var Ps=Object.create;var vn=Object.defineProperty;var ks=Object.getOwnPropertyDescriptor;var Ts=Object.getOwnPropertyNames;var Ms=Object.getPrototypeOf,Ds=Object.prototype.hasOwnProperty;var Ns=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var En=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Bs=(e,t)=>{for(var n in t)vn(e,n,{get:t[n],enumerable:!0})},Ni=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ts(t))!Ds.call(e,i)&&i!==n&&vn(e,i,{get:()=>t[i],enumerable:!(r=ks(t,i))||r.enumerable});return e};var Os=(e,t,n)=>(n=e!=null?Ps(Ms(e)):{},Ni(t||!e||!e.__esModule?vn(n,"default",{value:e,enumerable:!0}):n,e)),Ls=e=>Ni(vn({},"__esModule",{value:!0}),e);var Fi={};Bs(Fi,{assign:()=>M,bind:()=>Ye,debounce:()=>dr,ensureArray:()=>Bi,every:()=>bn,filter:()=>nt,find:()=>ve,findIndex:()=>hr,flatten:()=>Is,forEach:()=>P,get:()=>Gs,groupBy:()=>Ft,has:()=>at,isArray:()=>xe,isDefined:()=>wt,isFunction:()=>tt,isNil:()=>nn,isNumber:()=>Me,isObject:()=>_e,isString:()=>De,isUndefined:()=>Tt,keys:()=>Oi,map:()=>_t,matchPattern:()=>xn,merge:()=>Ii,omit:()=>vr,pick:()=>gr,reduce:()=>Ve,set:()=>yr,size:()=>$s,some:()=>rn,sortBy:()=>Ws,throttle:()=>Us,unionBy:()=>qs,uniqueBy:()=>Li,values:()=>Vs,without:()=>js});function Is(e){return Array.prototype.concat.apply([],e)}function Tt(e){return e===void 0}function wt(e){return e!==void 0}function nn(e){return e==null}function xe(e){return tn.call(e)==="[object Array]"}function _e(e){return tn.call(e)==="[object Object]"}function Me(e){return tn.call(e)==="[object Number]"}function tt(e){let t=tn.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function De(e){return tn.call(e)==="[object String]"}function Bi(e){if(!xe(e))throw new Error("must supply array")}function at(e,t){return!nn(e)&&Fs.call(e,t)}function ve(e,t){let n=wn(t),r;return P(e,function(i,o){if(n(i,o))return r=i,!1}),r}function hr(e,t){let n=wn(t),r=xe(e)?-1:void 0;return P(e,function(i,o){if(n(i,o))return r=o,!1}),r}function nt(e,t){let n=wn(t),r=[];return P(e,function(i,o){n(i,o)&&r.push(i)}),r}function P(e,t){let n,r;if(Tt(e))return;let i=xe(e)?zs:Hs;for(let o in e)if(at(e,o)&&(n=e[o],r=t(n,i(o)),r===!1))return n}function js(e,t){if(Tt(e))return[];Bi(e);let n=wn(t);return e.filter(function(r,i){return!n(r,i)})}function Ve(e,t,n){return P(e,function(r,i){n=t(n,r,i)}),n}function bn(e,t){return!!Ve(e,function(n,r,i){return n&&t(r,i)},!0)}function rn(e,t){return!!ve(e,t)}function _t(e,t){let n=[];return P(e,function(r,i){n.push(t(r,i))}),n}function Oi(e){return e&&Object.keys(e)||[]}function $s(e){return Oi(e).length}function Vs(e){return _t(e,t=>t)}function Ft(e,t,n={}){return t=mr(t),P(e,function(r){let i=t(r)||"_",o=n[i];o||(o=n[i]=[]),o.push(r)}),n}function Li(e,...t){e=mr(e);let n={};return P(t,i=>Ft(i,e,n)),_t(n,function(i,o){return i[0]})}function Ws(e,t){t=mr(t);let n=[];return P(e,function(r,i){let o=t(r,i),a={d:o,v:r};for(var s=0;s<n.length;s++){let{d:c}=n[s];if(o<c){n.splice(s,0,a);return}}n.push(a)}),_t(n,r=>r.v)}function xn(e){return function(t){return bn(e,function(n,r){return t[r]===n})}}function mr(e){return tt(e)?e:t=>t[e]}function wn(e){return tt(e)?e:t=>t===e}function Hs(e){return e}function zs(e){return Number(e)}function dr(e,t){let n,r,i,o;function a(y){let v=Date.now(),A=y?0:o+t-v;if(A>0)return s(A);e.apply(i,r),c()}function s(y){n=setTimeout(a,y)}function c(){n&&clearTimeout(n),n=o=r=i=void 0}function f(){n&&a(!0),c()}function h(...y){o=Date.now(),r=y,i=this,n||s(t)}return h.flush=f,h.cancel=c,h}function Us(e,t){let n=!1;return function(...r){n||(e(...r),n=!0,setTimeout(()=>{n=!1},t))}}function Ye(e,t){return e.bind(t)}function M(e,...t){return Object.assign(e,...t)}function yr(e,t,n){let r=e;return P(t,function(i,o){if(typeof i!="number"&&typeof i!="string")throw new Error("illegal key type: "+typeof i+". Key should be of type number or string.");if(i==="constructor")throw new Error("illegal key: constructor");if(i==="__proto__")throw new Error("illegal key: __proto__");let a=t[o+1],s=r[i];wt(a)&&nn(s)&&(s=r[i]=isNaN(+a)?{}:[]),Tt(a)?Tt(n)?delete r[i]:r[i]=n:r=s}),e}function Gs(e,t,n){let r=e;return P(t,function(i){if(nn(r))return r=void 0,!1;r=r[i]}),Tt(r)?n:r}function gr(e,t){let n={},r=Object(e);return P(t,function(i){i in r&&(n[i]=e[i])}),n}function vr(e,t){let n={},r=Object(e);return P(r,function(i,o){t.indexOf(o)===-1&&(n[o]=i)}),n}function Ii(e,...t){return t.length&&P(t,function(n){!n||!_e(n)||P(n,function(r,i){if(i==="__proto__")return;let o=e[i];_e(r)?(_e(o)||(o={}),e[i]=Ii(o,r)):e[i]=r})}),e}var tn,Fs,qs,Q=Ns(()=>{tn=Object.prototype.toString,Fs=Object.prototype.hasOwnProperty;qs=Li});var Sa=En((fv,_a)=>{function Cf(e){return["String","Boolean","Integer","Real"].includes(e)}_a.exports=function e(t,n){let r=n.enter,i=n.leave,o=r&&r(t),a=t.$descriptor;o!==!1&&!a.isGeneric&&a.properties.filter(c=>!c.isAttr&&!c.isReference&&!Cf(c.type)).forEach(c=>{if(c.name in t){let f=t[c.name];c.isMany?f.forEach(h=>{e(h,n)}):e(f,n)}}),i&&i(t)}});var Ra=En((pv,Aa)=>{var Pf=Sa(),{isArray:kf,isObject:Tf,isFunction:Mf}=(Q(),Ls(Fi)),ri=class{constructor({moddleRoot:t,rule:n}){this.rule=n,this.moddleRoot=t,this.messages=[],this.report=this.report.bind(this)}report(t,n,r){let i={id:t,message:n};r&&kf(r)&&(i={...i,path:r}),r&&Tf(r)&&(i={...i,...r}),this.messages.push(i)}};Aa.exports=function({moddleRoot:t,rule:n}){let r=new ri({rule:n,moddleRoot:t}),i=n.check||{},o="leave"in i?i.leave:void 0,a="enter"in i?i.enter:Mf(i)?i:void 0;if(!a&&!o)throw new Error("no check implemented");return Pf(t,{enter:a?s=>a(s,r):void 0,leave:o?s=>o(s,r):void 0}),r.messages}});var ka=En((hv,Pa)=>{var Df=Ra(),Nf=(e,t)=>e,Bf={0:"off",1:"warn",2:"error",3:"info"},Of="rule-error";function Qe(e){let{config:t={},resolver:n,transformRule:r=Nf}=e||{};if(typeof n=="undefined")throw new Error("must provide <options.resolver>");this.config=t,this.resolver=n,this.transformRule=r,this.cachedRules={},this.cachedConfigs={}}Pa.exports=Qe;Qe.prototype.applyRule=function(t,n){let{config:r,rule:i,category:o,name:a}=n;try{return Df({moddleRoot:t,rule:i,config:r}).map(function(c){return{...c,meta:i.meta,category:o}})}catch(s){return console.error("rule <"+a+"> failed with error: ",s),[{message:s.message,category:Of}]}};Qe.prototype.resolveRule=function(e,t){let{pkg:n,ruleName:r}=this.parseRuleName(e),i=`${n}-${r}`,o=this.cachedRules[i];return o?Promise.resolve(o):Promise.resolve(this.resolver.resolveRule(n,r)).then(a=>{if(!a)throw new Error(`unknown rule <${e}>`);return this.cachedRules[i]=this.transformRule(a(t),{pkg:n,ruleName:r})})};Qe.prototype.resolveConfig=function(e){let{pkg:t,configName:n}=this.parseConfigName(e),r=`${t}-${n}`,i=this.cachedConfigs[r];return i?Promise.resolve(i):Promise.resolve(this.resolver.resolveConfig(t,n)).then(o=>{if(!o)throw new Error(`unknown config <${e}>`);return this.cachedConfigs[r]=this.normalizeConfig(o,t)})};Qe.prototype.resolveRules=function(e){return this.resolveConfiguredRules(e).then(t=>{let i=Object.entries(t).map(([o,a])=>{let{category:s,config:c}=this.parseRuleValue(a);return{name:o,category:s,config:c}}).filter(o=>o.category!=="off").map(o=>{let{name:a,config:s}=o;return this.resolveRule(a,s).then(function(c){return{...o,rule:c}})});return Promise.all(i)})};Qe.prototype.resolveConfiguredRules=function(e){let t=e.extends;return typeof t=="string"&&(t=[t]),typeof t=="undefined"&&(t=[]),Promise.all(t.map(n=>this.resolveConfig(n).then(r=>this.resolveConfiguredRules(r)))).then(n=>{let r=this.normalizeConfig(e,"bpmnlint").rules;return[...n,r].reduce((o,a)=>({...o,...a}),{})})};Qe.prototype.lint=function(e,t){return t=t||this.config,this.resolveRules(t).then(n=>{let r={};return n.forEach(i=>{let{name:o}=i,a=this.applyRule(e,i);a.length&&(r[o]=a)}),r})};Qe.prototype.parseRuleValue=function(e){let t,n;return Array.isArray(e)?(t=e[0],n=e[1]):(t=e,n={}),typeof t=="string"&&(t=t.toLowerCase()),t=Bf[t]||t,{config:n,category:t}};Qe.prototype.parseRuleName=function(e,t="bpmnlint"){let n=/^(?:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)?([^/]+)$/.exec(e);if(!n)throw new Error(`unparseable rule name <${e}>`);let[r,i,o,a]=n;return o?{pkg:`${i?i+"/":""}${Ca(o)}`,ruleName:a}:{pkg:t,ruleName:a}};Qe.prototype.parseConfigName=function(e){let t=/^(?:(?:plugin:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)|bpmnlint:)([^/]+)$/.exec(e);if(!t)throw new Error(`unparseable config name <${e}>`);let[n,r,i,o]=t;return i?{pkg:`${r?r+"/":""}${Ca(i)}`,configName:o}:{pkg:"bpmnlint",configName:o}};Qe.prototype.getSimplePackageName=function(e){let t=/^(?:(@[^/]+)\/)?([^/]+)$/.exec(e);if(!t)throw new Error(`unparseable package name <${e}>`);let[n,r,i]=t;return`${r?r+"/":""}${Lf(i)}`};Qe.prototype.normalizeConfig=function(e,t){let n=e.rules||{},r=Object.keys(n).reduce((i,o)=>{let a=n[o],{pkg:s,ruleName:c}=this.parseRuleName(o,t),f=s==="bpmnlint"?c:`${this.getSimplePackageName(s)}/${c}`;return i[f]=a,i},{});return{...e,rules:r}};function Ca(e){return e==="bpmnlint"?"bpmnlint":e.startsWith("bpmnlint-plugin-")?e:`bpmnlint-plugin-${e}`}function Lf(e){return e.startsWith("bpmnlint-plugin-")?e.substring(16):e}});var Ma=En((mv,Ta)=>{var If=ka();Ta.exports={Linter:If}});function Ce(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}Q();var Ks=1e3;function Xe(e,t){var n=this;t=t||Ks,e.on(["render.shape","render.connection"],t,function(r,i){var o=r.type,a=i.element,s=i.gfx,c=i.attrs;if(n.canRender(a))return o==="render.shape"?n.drawShape(s,a,c):n.drawConnection(s,a,c)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(r,i){if(n.canRender(i))return r.type==="render.getShapePath"?n.getShapePath(i):n.getConnectionPath(i)})}Xe.prototype.canRender=function(e){};Xe.prototype.drawShape=function(e,t){};Xe.prototype.drawConnection=function(e,t){};Xe.prototype.getShapePath=function(e){};Xe.prototype.getConnectionPath=function(e){};Q();function N(e,t){var n=oe(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)}function ji(e,t){return rn(t,function(n){return N(e,n)})}function oe(e){return e&&e.businessObject||e}function Ze(e){return e&&e.di}function dt(e,t){return N(e,"bpmn:CallActivity")?!1:N(e,"bpmn:SubProcess")?(t=t||Ze(e),t&&N(t,"bpmndi:BPMNPlane")?!0:t&&!!t.isExpanded):N(e,"bpmn:Participant")?!!oe(e).processRef:!0}function Er(e){if(!(!N(e,"bpmn:Participant")&&!N(e,"bpmn:Lane"))){var t=Ze(e).isHorizontal;return t===void 0?!0:t}}function $i(e){return e&&!!oe(e).triggeredByEvent}Q();Q();function Vi(e){return _e(e)&&at(e,"waypoints")}function br(e){return _e(e)&&at(e,"labelTarget")}var jt={width:90,height:20},qi=15;function Wi(e){return N(e,"bpmn:Event")||N(e,"bpmn:Gateway")||N(e,"bpmn:DataStoreReference")||N(e,"bpmn:DataObjectReference")||N(e,"bpmn:DataInput")||N(e,"bpmn:DataOutput")||N(e,"bpmn:SequenceFlow")||N(e,"bpmn:MessageFlow")||N(e,"bpmn:Group")}function Ys(e){var t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)],i=Xs(e),o=Math.atan((r.y-n.y)/(r.x-n.x)),a=i.x,s=i.y;return Math.abs(o)<Math.PI/2?s-=qi:a+=qi,{x:a,y:s}}function Xs(e){var t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)];return{x:n.x+(r.x-n.x)/2,y:n.y+(r.y-n.y)/2}}function Zs(e){return e.waypoints?Ys(e.waypoints):N(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+jt.height/2}:{x:e.x+e.width/2,y:e.y+e.height+jt.height/2}}function Hi(e,t){var n,r,i,o=e.label;return o&&o.bounds?(i=o.bounds,r={width:Math.max(jt.width,i.width),height:i.height},n={x:i.x+i.width/2,y:i.y+i.height/2}):(n=Zs(t),r=jt),M({x:n.x-r.width/2,y:n.y-r.height/2},r)}function Qs(e){if(N(e,"bpmn:FlowElement")||N(e,"bpmn:Participant")||N(e,"bpmn:Lane")||N(e,"bpmn:SequenceFlow")||N(e,"bpmn:MessageFlow")||N(e,"bpmn:DataInput")||N(e,"bpmn:DataOutput"))return"name";if(N(e,"bpmn:TextAnnotation"))return"text";if(N(e,"bpmn:Group"))return"categoryValueRef"}function Js(e){var t=e.categoryValueRef;return t&&t.value||""}function $t(e){var t=e.businessObject,n=Qs(t);if(n)return n==="categoryValueRef"?Js(t):t[n]||""}Q();function Mt(e,t){t=!!t,xe(e)||(e=[e]);var n,r,i,o;return P(e,function(a){var s=a;a.waypoints&&!t&&(s=Mt(a.waypoints,!0));var c=s.x,f=s.y,h=s.height||0,y=s.width||0;(c<n||n===void 0)&&(n=c),(f<r||r===void 0)&&(r=f),(c+y>i||i===void 0)&&(i=c+y),(f+h>o||o===void 0)&&(o=f+h)}),{x:n,y:r,height:o-r,width:i-n}}function _n(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function Sn(e){return!!(e&&e.isFrame)}var An=7;Q();function eu(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch{}return e}function Ki(e,t){return t.appendChild(eu(e,t))}function fe(e,t){return Ki(t,e),e}var _r=2,Yi={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":_r,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":_r,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function tu(e,t){return Yi[t]?e.style[t]:e.getAttributeNS(null,t)}function Xi(e,t,n){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=Yi[r];i?(i===_r&&typeof n=="number"&&(n=String(n)+"px"),e.style[r]=n):e.setAttributeNS(null,t,n)}function nu(e,t){var n=Object.keys(t),r,i;for(r=0,i;i=n[r];r++)Xi(e,i,t[i])}function te(e,t,n){if(typeof t=="string")if(n!==void 0)Xi(e,t,n);else return tu(e,t);else nu(e,t);return e}var ru=Object.prototype.toString;function qe(e){return new St(e)}function St(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}St.prototype.add=function(e){return this.list.add(e),this};St.prototype.remove=function(e){return ru.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)};St.prototype.removeMatching=function(e){let t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this};St.prototype.toggle=function(e,t){return typeof t!="undefined"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this};St.prototype.array=function(){return Array.from(this.list)};St.prototype.has=St.prototype.contains=function(e){return this.list.contains(e)};function iu(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}var Ar={svg:"http://www.w3.org/2000/svg"},zi='<svg xmlns="'+Ar.svg+'"';function Zi(e){var t=!1;e.substring(0,4)==="<svg"?e.indexOf(Ar.svg)===-1&&(e=zi+e.substring(4)):(e=zi+">"+e+"</svg>",t=!0);var n=ou(e);if(!t)return n;for(var r=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)r.appendChild(i.firstChild);return r}function ou(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function ne(e,t){var n;return e=e.trim(),e.charAt(0)==="<"?(n=Zi(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Ar.svg,e),t&&te(n,t),n}var xr=null;function Sr(){return xr===null&&(xr=ne("svg")),xr}function Ui(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)e[r]=t[r];return e}function Qi(e,t,n,r,i,o){var a=Sr().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return Ui(a,e);case 6:return Ui(a,{a:e,b:t,c:n,d:r,e:i,f:o})}}function Vt(e){return e?Sr().createSVGTransformFromMatrix(e):Sr().createSVGTransform()}var Gi=/([&<>]{1})/g,au=/([&<>\n\r"]{1})/g,su={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function wr(e,t){function n(r,i){return su[i]||i}return e.replace(t,n)}function Ji(e,t){var n,r,i,o,a;switch(e.nodeType){case 3:t.push(wr(e.textContent,Gi));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(i=e.attributes,n=0,r=i.length;n<r;++n)o=i.item(n),t.push(" ",o.name,'="',wr(o.value,au),'"');if(e.hasChildNodes()){for(t.push(">"),a=e.childNodes,n=0,r=a.length;n<r;++n)Ji(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("<!--",wr(e.nodeValue,Gi),"-->");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function uu(e,t){var n=Zi(t);if(iu(e),!!t){cu(n)||(n=n.documentElement);for(var r=fu(n.childNodes),i=0;i<r.length;i++)Ki(r[i],e)}}function lu(e){for(var t=e.firstChild,n=[];t;)Ji(t,n),t=t.nextSibling;return n.join("")}function cu(e){return e.nodeName==="#document-fragment"}function Rr(e,t){if(t!==void 0){try{uu(e,t)}catch(n){throw new Error("error parsing SVG: "+n.message)}return e}else return lu(e)}function fu(e){return Array.prototype.slice.call(e)}function Dt(e){var t=e.parentNode;return t&&t.removeChild(e),e}function pu(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function hu(e,t){var n,r;for(e.clear(),n=0;r=t[n];n++)e.appendItem(pu(e,r))}function Nt(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),hu(n,t)),n.consolidate()}function yt(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function mu(e){return["M",e.x,e.y]}function Cr(e){return["L",e.x,e.y]}function du(e,t,n){return["C",e.x,e.y,t.x,t.y,n.x,n.y]}function yu(e,t){let n=e.length,r=[mu(e[0])];for(let i=1;i<n;i++){let o=e[i-1],a=e[i],s=e[i+1];if(!s||!t){r.push(Cr(a));continue}let c=Math.min(t,Pr(a.x-o.x,a.y-o.y),Pr(s.x-a.x,s.y-a.y));if(!c){r.push(Cr(a));continue}let f=Rn(a,o,c),h=Rn(a,o,c*.5),y=Rn(a,s,c),v=Rn(a,s,c*.5);r.push(Cr(f)),r.push(du(h,v,y))}return r}function Rn(e,t,n){let r=t.x-e.x,i=t.y-e.y,o=Pr(r,i),a=n/o;return{x:e.x+r*a,y:e.y+i*a}}function Pr(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function qt(e,t,n){Me(t)&&(n=t,t=null),t||(t={});let r=ne("path",t);return Me(n)&&(r.dataset.cornerRadius=String(n)),kr(r,e)}function kr(e,t){let n=parseInt(e.dataset.cornerRadius,10)||0;return te(e,{d:yt(yu(t,n))}),e}Q();var Cn="hsl(225, 10%, 15%)",gu="white";function rt(e,t){return rn(e.eventDefinitions,function(n){return n.$type===t})}function eo(e){return e.$type==="bpmn:IntermediateThrowEvent"||e.$type==="bpmn:EndEvent"}function to(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}function U(e,t,n){var r=Ze(e);return n||r.get("color:background-color")||r.get("bioc:fill")||t||gu}function k(e,t,n){var r=Ze(e);return n||r.get("color:border-color")||r.get("bioc:stroke")||t||Cn}function Wt(e,t,n,r){var i=Ze(e),o=i.get("label");return r||o&&o.get("color:color")||t||k(e,n)}function no(e){var t=e.x+e.width/2,n=e.y+e.height/2,r=e.width/2,i=[["M",t,n],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]];return yt(i)}function Tr(e,t){var n=e.x,r=e.y,i=e.width,o=e.height,a=[["M",n+t,r],["l",i-t*2,0],["a",t,t,0,0,1,t,t],["l",0,o-t*2],["a",t,t,0,0,1,-t,t],["l",t*2-i,0],["a",t,t,0,0,1,-t,-t],["l",0,t*2-o],["a",t,t,0,0,1,t,-t],["z"]];return yt(a)}function ro(e){var t=e.width,n=e.height,r=e.x,i=e.y,o=t/2,a=n/2,s=[["M",r+o,i],["l",o,a],["l",-o,a],["l",-o,-a],["z"]];return yt(s)}function io(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=[["M",t,n],["l",r,0],["l",0,i],["l",-r,0],["z"]];return yt(o)}function Ht(e,t={}){return{width:We(e,t),height:Ne(e,t)}}function We(e,t={}){return at(t,"width")?t.width:e.width}function Ne(e,t={}){return at(t,"height")?t.height:e.height}Q();var Ee={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:[0,"",""]};Ee.td=Ee.th=[3,"<table><tbody><tr>","</tr></tbody></table>"];Ee.option=Ee.optgroup=[1,'<select multiple="multiple">',"</select>"];Ee.thead=Ee.tbody=Ee.colgroup=Ee.caption=Ee.tfoot=[1,"<table>","</table>"];Ee.polyline=Ee.ellipse=Ee.polygon=Ee.circle=Ee.text=Ee.line=Ee.path=Ee.rect=Ee.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];function ee(e,t=globalThis.document){var f;if(typeof e!="string")throw new TypeError("String expected");let n=/^<!--(.*?)-->$/s.exec(e);if(n)return t.createComment(n[1]);let r=(f=/<([\w:]+)/.exec(e))==null?void 0:f[1];if(!r)return t.createTextNode(e);if(e=e.trim(),r==="body"){let h=t.createElement("html");h.innerHTML=e;let{lastChild:y}=h;return y.remove(),y}let[i,o,a]=Object.hasOwn(Ee,r)?Ee[r]:Ee._default,s=t.createElement("div");for(s.innerHTML=o+e+a;i--;)s=s.lastChild;if(s.firstChild===s.lastChild){let{firstChild:h}=s;return h.remove(),h}let c=t.createDocumentFragment();return c.append(...s.childNodes),c}function vu(e,t){return t.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(r){if(r!=="default"&&!(r in e)){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}})}),Object.freeze(e)}function Pe(e,...t){let n=e.style;return P(t,function(r){r&&P(r,function(i,o){n[o]=i})}),e}function kn(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}var Eu=Object.prototype.toString;function Bt(e){return new At(e)}function At(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}At.prototype.add=function(e){return this.list.add(e),this};At.prototype.remove=function(e){return Eu.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)};At.prototype.removeMatching=function(e){let t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this};At.prototype.toggle=function(e,t){return typeof t!="undefined"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this};At.prototype.array=function(){return Array.from(this.list)};At.prototype.has=At.prototype.contains=function(e){return this.list.contains(e)};function Tn(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function bu(e,t,n){var r=n?e:e.parentNode;return r&&typeof r.closest=="function"&&r.closest(t)||null}function xu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pn={},oo;function wu(){if(oo)return Pn;oo=1;var e,t,n;function r(){e=window.addEventListener?"addEventListener":"attachEvent",t=window.removeEventListener?"removeEventListener":"detachEvent",n=e!=="addEventListener"?"on":""}return Pn.bind=function(i,o,a,s){return e||r(),i[e](n+o,a,s||!1),a},Pn.unbind=function(i,o,a,s){return t||r(),i[t](n+o,a,s||!1),a},Pn}var ao=wu(),_u=xu(ao),Mn=vu({__proto__:null,default:_u},[ao]),so=["focus","blur"];function Su(e,t,n,r,i){return so.indexOf(n)!==-1&&(i=!0),Mn.bind(e,n,function(o){var a=o.target||o.srcElement;o.delegateTarget=bu(a,t,!0),o.delegateTarget&&r.call(e,o)},i)}function Au(e,t,n,r){return so.indexOf(t)!==-1&&(r=!0),Mn.unbind(e,t,n,r)}var on={bind:Su,unbind:Au};function He(e,t){return t=t||document,t.querySelector(e)}function uo(e,t){return t=t||document,t.querySelectorAll(e)}function zt(e){e.parentNode&&e.parentNode.removeChild(e)}function Dn(e,t,n,r,i){var o=Vt();o.setTranslate(t,n);var a=Vt();a.setRotate(r||0,0,0);var s=Vt();s.setScale(i||1,i||1),Nt(e,[o,a,s])}function Nn(e,t,n){var r=Vt();r.setTranslate(t,n),Nt(e,r)}function lo(e,t){var n=Vt();n.setRotate(t,0,0),Nt(e,n)}function Ru(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mr={exports:{}},co;function Cu(){if(co)return Mr.exports;co=1;var e=Mr.exports=function(t,n){if(n||(n=16),t===void 0&&(t=128),t<=0)return"0";for(var r=Math.log(Math.pow(2,t))/Math.log(n),i=2;r===1/0;i*=2)r=Math.log(Math.pow(2,t/i))/Math.log(n)*i;for(var o=r-Math.floor(r),a="",i=0;i<Math.floor(r);i++){var s=Math.floor(Math.random()*n).toString(n);a=s+a}if(o){var c=Math.pow(n,o),s=Math.floor(Math.random()*c).toString(n);a=s+a}var f=parseInt(a,n);return f!==1/0&&f>=Math.pow(2,t)?e(t,n):a};return e.rack=function(t,n,r){var i=function(a){var s=0;do{if(s++>10)if(r)t+=r;else throw new Error("too many ID collisions, use more bits");var c=e(t,n)}while(Object.hasOwnProperty.call(o,c));return o[c]=a,c},o=i.hats={};return i.get=function(a){return i.hats[a]},i.set=function(a,s){return i.hats[a]=s,i},i.bits=t||128,i.base=n||16,i},Mr.exports}var Pu=Cu(),ku=Ru(Pu);function st(e){if(!(this instanceof st))return new st(e);e=e||[128,36,1],this._seed=e.length?ku.rack(e[0],e[1],e[2]):e}st.prototype.next=function(e){return this._seed(e||!0)};st.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n};st.prototype.claim=function(e,t){this._seed.set(e,t||!0)};st.prototype.assigned=function(e){return this._seed.get(e)||!1};st.prototype.unclaim=function(e){delete this._seed.hats[e]};st.prototype.clear=function(){var e=this._seed.hats,t;for(t in e)this.unclaim(t)};var Tu=new st,Mu=10,Bn=3,Du=1.5,On=10,Nu=4,Ut=.95,Bu=1,Ou=.25;function gt(e,t,n,r,i,o,a){Xe.call(this,t,a);var s=e&&e.defaultFillColor,c=e&&e.defaultStrokeColor,f=e&&e.defaultLabelColor;function h(p){return n.computeStyle(p,{strokeLinecap:"round",strokeLinejoin:"round",stroke:Cn,strokeWidth:2,fill:"white"})}function y(p){return n.computeStyle(p,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:Cn,strokeWidth:2})}function v(p,l){var{ref:u={x:0,y:0},scale:m=1,element:d,parentGfx:E=i._svg}=l,S=ne("marker",{id:p,viewBox:"0 0 20 20",refX:u.x,refY:u.y,markerWidth:20*m,markerHeight:20*m,orient:"auto"});fe(S,d);var j=He(":scope > defs",E);j||(j=ne("defs"),fe(E,j)),fe(j,S)}function A(p,l,u,m){var d=Tu.nextPrefixed("marker-");return W(p,d,l,u,m),"url(#"+d+")"}function W(p,l,u,m,d){if(u==="sequenceflow-end"){var E=ne("path",{d:"M 1 5 L 11 10 L 1 15 Z",...h({fill:d,stroke:d,strokeWidth:1})});v(l,{element:E,ref:{x:11,y:10},scale:.5,parentGfx:p})}if(u==="messageflow-start"){var S=ne("circle",{cx:6,cy:6,r:3.5,...h({fill:m,stroke:d,strokeWidth:1,strokeDasharray:[1e4,1]})});v(l,{element:S,ref:{x:6,y:6},parentGfx:p})}if(u==="messageflow-end"){var j=ne("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...h({fill:m,stroke:d,strokeWidth:1,strokeDasharray:[1e4,1]})});v(l,{element:j,ref:{x:8.5,y:5},parentGfx:p})}if(u==="association-start"){var Y=ne("path",{d:"M 11 5 L 1 10 L 11 15",...y({fill:"none",stroke:d,strokeWidth:1.5,strokeDasharray:[1e4,1]})});v(l,{element:Y,ref:{x:1,y:10},scale:.5,parentGfx:p})}if(u==="association-end"){var ge=ne("path",{d:"M 1 5 L 11 10 L 1 15",...y({fill:"none",stroke:d,strokeWidth:1.5,strokeDasharray:[1e4,1]})});v(l,{element:ge,ref:{x:11,y:10},scale:.5,parentGfx:p})}if(u==="conditional-flow-marker"){var he=ne("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...h({fill:m,stroke:d})});v(l,{element:he,ref:{x:-1,y:10},scale:.5,parentGfx:p})}if(u==="conditional-default-flow-marker"){var we=ne("path",{d:"M 6 4 L 10 16",...h({stroke:d,fill:"none"})});v(l,{element:we,ref:{x:0,y:10},scale:.5,parentGfx:p})}}function L(p,l,u,m,d={}){_e(m)&&(d=m,m=0),m=m||0,d=h(d);var E=l/2,S=u/2,j=ne("circle",{cx:E,cy:S,r:Math.round((l+u)/4-m),...d});return fe(p,j),j}function O(p,l,u,m,d,E){_e(d)&&(E=d,d=0),d=d||0,E=h(E);var S=ne("rect",{x:d,y:d,width:l-d*2,height:u-d*2,rx:m,ry:m,...E});return fe(p,S),S}function H(p,l,u,m){var d=l/2,E=u/2,S=[{x:d,y:0},{x:l,y:E},{x:d,y:u},{x:0,y:E}],j=S.map(function(ge){return ge.x+","+ge.y}).join(" ");m=h(m);var Y=ne("polygon",{...m,points:j});return fe(p,Y),Y}function G(p,l,u,m){u=y(u);var d=qt(l,u,m);return fe(p,d),d}function T(p,l,u){return G(p,l,u,5)}function g(p,l,u){u=y(u);var m=ne("path",{...u,d:l});return fe(p,m),m}function w(p,l,u,m){return g(l,u,M({"data-marker":p},m))}function C(p){return je[p]}function V(p){return function(l,u,m){return C(p)(l,u,m)}}var b={"bpmn:MessageEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.235,my:.315}}),E=m?k(l,c,u.stroke):U(l,s,u.fill),S=m?U(l,s,u.fill):k(l,c,u.stroke),j=g(p,d,{fill:E,stroke:S,strokeWidth:1});return j},"bpmn:TimerEventDefinition":function(p,l,u={}){var m=u.width||l.width,d=u.height||l.height,E=u.width?1:2,S=L(p,m,d,.2*d,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:E}),j=r.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:m,containerHeight:d,position:{mx:.5,my:.5}});g(p,j,{stroke:k(l,c,u.stroke),strokeWidth:E});for(var Y=0;Y<12;Y++){var ge=r.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:m,containerHeight:d,position:{mx:.5,my:.5}}),he=m/2,we=d/2;g(p,ge,{strokeWidth:1,stroke:k(l,c,u.stroke),transform:"rotate("+Y*30+","+we+","+he+")"})}return S},"bpmn:EscalationEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.5,my:.2}}),E=m?k(l,c,u.stroke):U(l,s,u.fill);return g(p,d,{fill:E,stroke:k(l,c,u.stroke),strokeWidth:1})},"bpmn:ConditionalEventDefinition":function(p,l,u={}){var m=r.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.5,my:.222}});return g(p,m,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:1})},"bpmn:LinkEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:.57,my:.263}}),E=m?k(l,c,u.stroke):U(l,s,u.fill);return g(p,d,{fill:E,stroke:k(l,c,u.stroke),strokeWidth:1})},"bpmn:ErrorEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.2,my:.722}}),E=m?k(l,c,u.stroke):U(l,s,u.fill);return g(p,d,{fill:E,stroke:k(l,c,u.stroke),strokeWidth:1})},"bpmn:CancelEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:.638,my:-.055}}),E=m?k(l,c,u.stroke):"none",S=g(p,d,{fill:E,stroke:k(l,c,u.stroke),strokeWidth:1});return lo(S,45),S},"bpmn:CompensateEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.22,my:.5}}),E=m?k(l,c,u.stroke):U(l,s,u.fill);return g(p,d,{fill:E,stroke:k(l,c,u.stroke),strokeWidth:1})},"bpmn:SignalEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.5,my:.2}}),E=m?k(l,c,u.stroke):U(l,s,u.fill);return g(p,d,{strokeWidth:1,fill:E,stroke:k(l,c,u.stroke)})},"bpmn:MultipleEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.211,my:.36}}),E=m?k(l,c,u.stroke):U(l,s,u.fill);return g(p,d,{fill:E,stroke:k(l,c,u.stroke),strokeWidth:1})},"bpmn:ParallelMultipleEventDefinition":function(p,l,u={}){var m=r.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.458,my:.194}});return g(p,m,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:1})},"bpmn:TerminateEventDefinition":function(p,l,u={}){var m=L(p,l.width,l.height,8,{fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke),strokeWidth:4});return m}};function D(p,l,u={},m){var d=oe(p),E=eo(d),S=m||p;return d.get("eventDefinitions")&&d.get("eventDefinitions").length>1?d.get("parallelMultiple")?b["bpmn:ParallelMultipleEventDefinition"](l,S,u,E):b["bpmn:MultipleEventDefinition"](l,S,u,E):rt(d,"bpmn:MessageEventDefinition")?b["bpmn:MessageEventDefinition"](l,S,u,E):rt(d,"bpmn:TimerEventDefinition")?b["bpmn:TimerEventDefinition"](l,S,u,E):rt(d,"bpmn:ConditionalEventDefinition")?b["bpmn:ConditionalEventDefinition"](l,S,u,E):rt(d,"bpmn:SignalEventDefinition")?b["bpmn:SignalEventDefinition"](l,S,u,E):rt(d,"bpmn:EscalationEventDefinition")?b["bpmn:EscalationEventDefinition"](l,S,u,E):rt(d,"bpmn:LinkEventDefinition")?b["bpmn:LinkEventDefinition"](l,S,u,E):rt(d,"bpmn:ErrorEventDefinition")?b["bpmn:ErrorEventDefinition"](l,S,u,E):rt(d,"bpmn:CancelEventDefinition")?b["bpmn:CancelEventDefinition"](l,S,u,E):rt(d,"bpmn:CompensateEventDefinition")?b["bpmn:CompensateEventDefinition"](l,S,u,E):rt(d,"bpmn:TerminateEventDefinition")?b["bpmn:TerminateEventDefinition"](l,S,u,E):null}var R={ParticipantMultiplicityMarker:function(p,l,u={}){var m=We(l,u),d=Ne(l,u),E=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:m,containerHeight:d,position:{mx:(m/2-6)/m,my:(d-15)/d}});w("participant-multiplicity",p,E,{strokeWidth:2,fill:U(l,s,u.fill),stroke:k(l,c,u.stroke)})},SubProcessMarker:function(p,l,u={}){var m=O(p,14,14,0,{strokeWidth:1,fill:U(l,s,u.fill),stroke:k(l,c,u.stroke)});Nn(m,l.width/2-7.5,l.height-20);var d=r.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:l.width,containerHeight:l.height,position:{mx:(l.width/2-7.5)/l.width,my:(l.height-20)/l.height}});w("sub-process",p,d,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke)})},ParallelMarker:function(p,l,u){var m=We(l,u),d=Ne(l,u),E=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:m,containerHeight:d,position:{mx:(m/2+u.parallel)/m,my:(d-20)/d}});w("parallel",p,E,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke)})},SequentialMarker:function(p,l,u){var m=r.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:(l.width/2+u.seq)/l.width,my:(l.height-19)/l.height}});w("sequential",p,m,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke)})},CompensationMarker:function(p,l,u){var m=r.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:(l.width/2+u.compensation)/l.width,my:(l.height-13)/l.height}});w("compensation",p,m,{strokeWidth:1,fill:U(l,s,u.fill),stroke:k(l,c,u.stroke)})},LoopMarker:function(p,l,u){var m=We(l,u),d=Ne(l,u),E=r.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:m,containerHeight:d,position:{mx:(m/2+u.loop)/m,my:(d-7)/d}});w("loop",p,E,{strokeWidth:1.5,fill:"none",stroke:k(l,c,u.stroke),strokeMiterlimit:.5})},AdhocMarker:function(p,l,u){var m=We(l,u),d=Ne(l,u),E=r.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:m,containerHeight:d,position:{mx:(m/2+u.adhoc)/m,my:(d-15)/d}});w("adhoc",p,E,{strokeWidth:1,fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke)})}};function F(p,l,u,m){R[p](l,u,m)}function B(p,l,u=[],m={}){m={fill:m.fill,stroke:m.stroke,width:We(l,m),height:Ne(l,m)};var d=oe(l),E=u.includes("SubProcessMarker");E?m={...m,seq:-21,parallel:-22,compensation:-25,loop:-18,adhoc:10}:m={...m,seq:-5,parallel:-6,compensation:-7,loop:0,adhoc:-8},d.get("isForCompensation")&&u.push("CompensationMarker"),N(d,"bpmn:AdHocSubProcess")&&(u.push("AdhocMarker"),E||M(m,{compensation:m.compensation-18}));var S=d.get("loopCharacteristics"),j=S&&S.get("isSequential");S&&(M(m,{compensation:m.compensation-18}),u.includes("AdhocMarker")&&M(m,{seq:-23,loop:-18,parallel:-24}),j===void 0&&u.push("LoopMarker"),j===!1&&u.push("ParallelMarker"),j===!0&&u.push("SequentialMarker")),u.includes("CompensationMarker")&&u.length===1&&M(m,{compensation:-8}),P(u,function(Y){F(Y,p,l,m)})}function I(p,l,u={}){u=M({size:{width:100}},u);var m=o.createText(l||"",u);return qe(m).add("djs-label"),fe(p,m),m}function K(p,l,u,m={}){var d=oe(l),E=Ht({x:l.x,y:l.y,width:l.width,height:l.height},m);return I(p,d.name,{align:u,box:E,padding:7,style:{fill:Wt(l,f,c,m.stroke)}})}function ot(p,l,u={}){var m={width:l.width,height:l.height,x:l.width/2+l.x,y:l.height/2+l.y};return I(p,$t(l),{box:m,style:M({},o.getExternalStyle(),{fill:Wt(l,f,c,u.stroke)})})}function ae(p,l,u,m={}){var d=Er(u),E=I(p,l,{box:{height:30,width:d?Ne(u,m):We(u,m)},align:"center-middle",style:{fill:Wt(u,f,c,m.stroke)}});if(d){var S=-1*Ne(u,m);Dn(E,0,-S,270)}}function Z(p,l,u={}){var{width:m,height:d}=Ht(l,u);return O(p,m,d,On,{...u,fill:U(l,s,u.fill),fillOpacity:Ut,stroke:k(l,c,u.stroke)})}function Je(p,l,u={}){var m=oe(l),d=U(l,s,u.fill),E=k(l,c,u.stroke);return(m.get("associationDirection")==="One"||m.get("associationDirection")==="Both")&&(u.markerEnd=A(p,"association-end",d,E)),m.get("associationDirection")==="Both"&&(u.markerStart=A(p,"association-start",d,E)),u=X(u,["markerStart","markerEnd"]),T(p,l.waypoints,{...u,stroke:E,strokeDasharray:"0, 5"})}function et(p,l,u={}){var m=U(l,s,u.fill),d=k(l,c,u.stroke),E=r.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:.474,my:.296}}),S=g(p,E,{fill:m,fillOpacity:Ut,stroke:d}),j=oe(l);if(to(j)){var Y=r.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:.33,my:(l.height-18)/l.height}});g(p,Y,{strokeWidth:2,fill:m,stroke:d})}return S}function ye(p,l,u={}){return L(p,l.width,l.height,{fillOpacity:Ut,...u,fill:U(l,s,u.fill),stroke:k(l,c,u.stroke)})}function Ge(p,l,u={}){return H(p,l.width,l.height,{fill:U(l,s,u.fill),fillOpacity:Ut,stroke:k(l,c,u.stroke)})}function x(p,l,u={}){var m=O(p,We(l,u),Ne(l,u),0,{fill:U(l,s,u.fill),fillOpacity:u.fillOpacity||Ut,stroke:k(l,c,u.stroke),strokeWidth:1.5}),d=oe(l);if(N(d,"bpmn:Lane")){var E=d.get("name");ae(p,E,l,u)}return m}function _(p,l,u={}){var m=Z(p,l,u),d=dt(l);if($i(l)&&(te(m,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!d)){var E=oe(l).flowElements||[],S=E.filter(j=>N(j,"bpmn:StartEvent"));S.length===1&&$(S[0],p,u,l)}return K(p,l,d?"center-top":"center-middle",u),d?B(p,l,void 0,u):B(p,l,["SubProcessMarker"],u),m}function $(p,l,u,m){var d=22,E={fill:U(m,s,u.fill),stroke:k(m,c,u.stroke),width:d,height:d},S=oe(p).isInterrupting,j=S?0:3,Y=S?1:1.2,ge=20,he=(d-ge)/2,we="translate("+he+","+he+")";L(l,ge,ge,{fill:E.fill,stroke:E.stroke,strokeWidth:Y,strokeDasharray:j,transform:we}),D(p,l,E,m)}function re(p,l,u={}){var m=Z(p,l,u);return K(p,l,"center-middle",u),B(p,l,void 0,u),m}var je=this.handlers={"bpmn:AdHocSubProcess":function(p,l,u={}){return dt(l)?u=X(u,["fill","stroke","width","height"]):u=X(u,["fill","stroke"]),_(p,l,u)},"bpmn:Association":function(p,l,u={}){return u=X(u,["fill","stroke"]),Je(p,l,u)},"bpmn:BoundaryEvent":function(p,l,u={}){var{renderIcon:m=!0}=u;u=X(u,["fill","stroke"]);var d=oe(l),E=d.get("cancelActivity");u={strokeWidth:1.5,fill:U(l,s,u.fill),fillOpacity:Bu,stroke:k(l,c,u.stroke)},E||(u.strokeDasharray="6");var S=ye(p,l,u);return L(p,l.width,l.height,Bn,{...u,fill:"none"}),m&&D(l,p,u),S},"bpmn:BusinessRuleTask":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=re(p,l,u),d=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),E=g(p,d);te(E,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:1});var S=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),j=g(p,S);return te(j,{fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke),strokeWidth:1}),m},"bpmn:CallActivity":function(p,l,u={}){return u=X(u,["fill","stroke"]),_(p,l,{strokeWidth:5,...u})},"bpmn:ComplexGateway":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=Ge(p,l,u),d=r.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:l.width,containerHeight:l.height,position:{mx:.46,my:.26}});return g(p,d,{fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke),strokeWidth:1}),m},"bpmn:DataInput":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=r.getRawPath("DATA_ARROW"),d=et(p,l,u);return g(p,m,{fill:"none",stroke:k(l,c,u.stroke),strokeWidth:1}),d},"bpmn:DataInputAssociation":function(p,l,u={}){return u=X(u,["fill","stroke"]),Je(p,l,{...u,markerEnd:A(p,"association-end",U(l,s,u.fill),k(l,c,u.stroke))})},"bpmn:DataObject":function(p,l,u={}){return u=X(u,["fill","stroke"]),et(p,l,u)},"bpmn:DataObjectReference":V("bpmn:DataObject"),"bpmn:DataOutput":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=r.getRawPath("DATA_ARROW"),d=et(p,l,u);return g(p,m,{strokeWidth:1,fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke)}),d},"bpmn:DataOutputAssociation":function(p,l,u={}){return u=X(u,["fill","stroke"]),Je(p,l,{...u,markerEnd:A(p,"association-end",U(l,s,u.fill),k(l,c,u.stroke))})},"bpmn:DataStoreReference":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=r.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:0,my:.133}});return g(p,m,{fill:U(l,s,u.fill),fillOpacity:Ut,stroke:k(l,c,u.stroke),strokeWidth:2})},"bpmn:EndEvent":function(p,l,u={}){var{renderIcon:m=!0}=u;u=X(u,["fill","stroke"]);var d=ye(p,l,{...u,strokeWidth:4});return m&&D(l,p,u),d},"bpmn:EventBasedGateway":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=oe(l),d=Ge(p,l,u);L(p,l.width,l.height,l.height*.2,{fill:U(l,"none",u.fill),stroke:k(l,c,u.stroke),strokeWidth:1});var E=m.get("eventGatewayType"),S=!!m.get("instantiate");function j(){var ge=r.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:l.width,containerHeight:l.height,position:{mx:.36,my:.44}});g(p,ge,{fill:"none",stroke:k(l,c,u.stroke),strokeWidth:2})}if(E==="Parallel"){var Y=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:l.width,containerHeight:l.height,position:{mx:.474,my:.296}});g(p,Y,{fill:"none",stroke:k(l,c,u.stroke),strokeWidth:1})}else E==="Exclusive"&&(S||L(p,l.width,l.height,l.height*.26,{fill:"none",stroke:k(l,c,u.stroke),strokeWidth:1}),j());return d},"bpmn:ExclusiveGateway":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=Ge(p,l,u),d=r.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:l.width,containerHeight:l.height,position:{mx:.32,my:.3}}),E=Ze(l);return E.get("isMarkerVisible")&&g(p,d,{fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke),strokeWidth:1}),m},"bpmn:Gateway":function(p,l,u={}){return u=X(u,["fill","stroke"]),Ge(p,l,u)},"bpmn:Group":function(p,l,u={}){return u=X(u,["fill","stroke","width","height"]),O(p,l.width,l.height,On,{stroke:k(l,c,u.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:We(l,u),height:Ne(l,u)})},"bpmn:InclusiveGateway":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=Ge(p,l,u);return L(p,l.width,l.height,l.height*.24,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:2.5}),m},"bpmn:IntermediateEvent":function(p,l,u={}){var{renderIcon:m=!0}=u;u=X(u,["fill","stroke"]);var d=ye(p,l,{...u,strokeWidth:1.5});return L(p,l.width,l.height,Bn,{fill:"none",stroke:k(l,c,u.stroke),strokeWidth:1.5}),m&&D(l,p,u),d},"bpmn:IntermediateCatchEvent":V("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":V("bpmn:IntermediateEvent"),"bpmn:Lane":function(p,l,u={}){return u=X(u,["fill","stroke","width","height"]),x(p,l,{...u,fillOpacity:Ou})},"bpmn:ManualTask":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=re(p,l,u),d=r.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return g(p,d,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:.5}),m},"bpmn:MessageFlow":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=oe(l),d=Ze(l),E=U(l,s,u.fill),S=k(l,c,u.stroke),j=T(p,l.waypoints,{markerEnd:A(p,"messageflow-end",E,S),markerStart:A(p,"messageflow-start",E,S),stroke:S,strokeDasharray:"10, 11",strokeWidth:1.5});if(m.get("messageRef")){var Y=j.getPointAtLength(j.getTotalLength()/2),ge=r.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:Y.x,y:Y.y}}),he={strokeWidth:1};d.get("messageVisibleKind")==="initiating"?(he.fill=E,he.stroke=S):(he.fill=S,he.stroke=E);var we=g(p,ge,he),Ke=m.get("messageRef"),ie=Ke.get("name"),mt=I(p,ie,{align:"center-top",fitBox:!0,style:{fill:S}}),gn=we.getBBox(),$e=mt.getBBox(),z=Y.x-$e.width/2,J=Y.y+gn.height/2+Mu;Dn(mt,z,J,0)}return j},"bpmn:ParallelGateway":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=Ge(p,l,u),d=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:l.width,containerHeight:l.height,position:{mx:.46,my:.2}});return g(p,d,{fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke),strokeWidth:1}),m},"bpmn:Participant":function(p,l,u={}){u=X(u,["fill","stroke","width","height"]);var m=x(p,l,u),d=dt(l),E=Er(l),S=oe(l),j=S.get("name");if(d){var Y=E?[{x:30,y:0},{x:30,y:Ne(l,u)}]:[{x:0,y:30},{x:We(l,u),y:30}];G(p,Y,{stroke:k(l,c,u.stroke),strokeWidth:Du}),ae(p,j,l,u)}else{var ge=Ht(l,u);E||(ge.height=We(l,u),ge.width=Ne(l,u));var he=I(p,j,{box:ge,align:"center-middle",style:{fill:Wt(l,f,c,u.stroke)}});if(!E){var we=-1*Ne(l,u);Dn(he,0,-we,270)}}return S.get("participantMultiplicity")&&F("ParticipantMultiplicityMarker",p,l,u),m},"bpmn:ReceiveTask":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=oe(l),d=re(p,l,u),E;return m.get("instantiate")?(L(p,28,28,20*.22,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:1}),E=r.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):E=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),g(p,E,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:1}),d},"bpmn:ScriptTask":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=re(p,l,u),d=r.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return g(p,d,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:1}),m},"bpmn:SendTask":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=re(p,l,u),d=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return g(p,d,{fill:k(l,c,u.stroke),stroke:U(l,s,u.fill),strokeWidth:1}),m},"bpmn:SequenceFlow":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=U(l,s,u.fill),d=k(l,c,u.stroke),E=T(p,l.waypoints,{markerEnd:A(p,"sequenceflow-end",m,d),stroke:d}),S=oe(l),{source:j}=l;if(j){var Y=oe(j);S.get("conditionExpression")&&N(Y,"bpmn:Activity")&&te(E,{markerStart:A(p,"conditional-flow-marker",m,d)}),Y.get("default")&&(N(Y,"bpmn:Gateway")||N(Y,"bpmn:Activity"))&&Y.get("default")===S&&te(E,{markerStart:A(p,"conditional-default-flow-marker",m,d)})}return E},"bpmn:ServiceTask":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=re(p,l,u);L(p,10,10,{fill:U(l,s,u.fill),stroke:"none",transform:"translate(6, 6)"});var d=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});g(p,d,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:1}),L(p,10,10,{fill:U(l,s,u.fill),stroke:"none",transform:"translate(11, 10)"});var E=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return g(p,E,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:1}),m},"bpmn:StartEvent":function(p,l,u={}){var{renderIcon:m=!0}=u;u=X(u,["fill","stroke"]);var d=oe(l);d.get("isInterrupting")||(u={...u,strokeDasharray:"6"});var E=ye(p,l,u);return m&&D(l,p,u),E},"bpmn:SubProcess":function(p,l,u={}){return dt(l)?u=X(u,["fill","stroke","width","height"]):u=X(u,["fill","stroke"]),_(p,l,u)},"bpmn:Task":function(p,l,u={}){return u=X(u,["fill","stroke"]),re(p,l,u)},"bpmn:TextAnnotation":function(p,l,u={}){u=X(u,["fill","stroke"]);var{width:m,height:d}=Ht(l,u),E=O(p,m,d,0,0,{fill:"none",stroke:"none"}),S=r.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:m,containerHeight:d,position:{mx:0,my:0}});g(p,S,{stroke:k(l,c,u.stroke)});var j=oe(l),Y=j.get("text")||"";return I(p,Y,{align:"left-top",box:Ht(l,u),padding:An,style:{fill:Wt(l,f,c,u.stroke)}}),E},"bpmn:Transaction":function(p,l,u={}){dt(l)?u=X(u,["fill","stroke","width","height"]):u=X(u,["fill","stroke"]);var m=_(p,l,{strokeWidth:1.5,...u}),d=n.style(["no-fill","no-events"],{stroke:k(l,c,u.stroke),strokeWidth:1.5}),E=dt(l);return E||(u={}),O(p,We(l,u),Ne(l,u),On-Bn,Bn,d),m},"bpmn:UserTask":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=re(p,l,u),d=15,E=12,S=r.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:d,y:E}});g(p,S,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:.5});var j=r.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:d,y:E}});g(p,j,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:.5});var Y=r.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:d,y:E}});return g(p,Y,{fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke),strokeWidth:.5}),m},label:function(p,l,u={}){return ot(p,l,u)}};this._drawPath=g,this._renderer=C}Ce(gt,Xe);gt.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"];gt.prototype.canRender=function(e){return N(e,"bpmn:BaseElement")};gt.prototype.drawShape=function(e,t,n={}){var{type:r}=t,i=this._renderer(r);return i(e,t,n)};gt.prototype.drawConnection=function(e,t,n={}){var{type:r}=t,i=this._renderer(r);return i(e,t,n)};gt.prototype.getShapePath=function(e){return br(e)?Tr(e,Nu):N(e,"bpmn:Event")?no(e):N(e,"bpmn:Activity")?Tr(e,On):N(e,"bpmn:Gateway")?ro(e):io(e)};function X(e,t=[]){return t.reduce((n,r)=>(e[r]&&(n[r]=e[r]),n),{})}Q();Q();var Lu=0,Iu={width:150,height:50};function Fu(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function ju(e){return _e(e)?M({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}var Dr=null;function $u(){return Dr||(Dr=document.createElement("canvas").getContext("2d")),Dr}function Vu(e){var t=[];return e.fontStyle&&t.push(e.fontStyle),e.fontVariant&&t.push(e.fontVariant),e.fontWeight&&t.push(e.fontWeight),e.fontStretch&&t.push(e.fontStretch),t.push(po(e.fontSize)||"12px"),t.push(e.fontFamily||"sans-serif"),t.join(" ")}function po(e){if(e!=null)return typeof e=="number"||/^-?\d+(\.\d+)?$/.test(e)?e+"px":e}function qu(e,t){var n=$u();if(!n)return{width:0,height:0};n.font=Vu(t),"letterSpacing"in n&&(n.letterSpacing=po(t.letterSpacing)||"0px");var r=e==="",i=r?"dummy":e.replace(/\s+$/,""),o=n.measureText(i);return{width:r?0:o.width,height:"fontBoundingBoxAscent"in o?o.fontBoundingBoxAscent+o.fontBoundingBoxDescent:o.actualBoundingBoxAscent+o.actualBoundingBoxDescent}}function Wu(e,t,n){for(var r=e.shift(),i=r,o;;){if(o=qu(i,n),o.width=i?o.width:0,i===" "||i===""||o.width<Math.round(t)||i.length<2)return Hu(e,i,r,o);i=Uu(i,o.width,t)}}function Hu(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 fo="\xAD";function zu(e,t){var n=e.split(/(\s|-|\u00AD)/g),r,i=[],o=0;if(n.length>1)for(;r=n.shift();)if(r.length+o<t)i.push(r),o+=r.length;else{(r==="-"||r===fo)&&i.pop();break}var a=i[i.length-1];return a&&a===fo&&(i[i.length-1]="-"),i.join("")}function Uu(e,t,n){var r=Math.max(e.length*(n/t),1),i=zu(e,r);return i||(i=e.slice(0,Math.max(Math.round(r-1),1))),i}function Gt(e){this._config=M({},{size:Iu,padding:Lu,style:{},align:"center-top"},e||{})}Gt.prototype.createText=function(e,t){return this.layoutText(e,t).element};Gt.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions};Gt.prototype.layoutText=function(e,t){for(var n=M({},this._config.size,t.box),r=M({},this._config.style,t.style),i=Fu(t.align||this._config.align),o=ju(t.padding!==void 0?t.padding:this._config.padding),a=t.fitBox||!1,s=Gu(r),c=e.split(/\u00AD?\r?\n/),f=[],h=n.width-o.left-o.right;c.length;)f.push(Wu(c,h,r));i.vertical==="middle"&&(o.top=o.bottom=0);var y=Ve(f,function(O,H,G){return O+(s||H.height)},0)+o.top+o.bottom,v=Ve(f,function(O,H,G){return H.width>O?H.width:O},0),A=o.top;i.vertical==="middle"&&(A+=(n.height-y)/2),A-=(s||f[0].height)/4;var W=ne("text");te(W,r),P(f,function(O){var H;switch(A+=s||O.height,i.horizontal){case"left":H=o.left;break;case"right":H=(a?v:h)-o.right-O.width;break;default:H=Math.max(((a?v:h)-O.width)/2+o.left,0)}var G=ne("tspan");te(G,{x:H,y:A}),G.textContent=O.text,fe(W,G)});var L={width:v,height:y};return{dimensions:L,element:W}};function Gu(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}var Ku=12,Yu=1.2,Xu=40;function Ln(e){var t=M({fontFamily:"Arial, sans-serif",fontSize:Ku,fontWeight:"normal",lineHeight:Yu},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,r=M({},t,{fontSize:n},e&&e.externalStyle||{}),i=new Gt({style:t});this.getExternalLabelBounds=function(a,s){var c={width:Math.max(a.width,jt.width),height:30},f=o(s,c,{style:r});return{x:Math.round(a.x+a.width/2-f.width/2),y:a.y,width:Math.ceil(f.width),height:Math.ceil(f.height)}},this.getTextAnnotationBounds=function(a,s){var c=o(s,a,{style:t,align:"left-top",padding:An});return{x:a.x,y:a.y,width:a.width,height:Math.max(Xu,Math.round(c.height))}},this.getDimensions=function(a,s){return i.getDimensions(a,s||{})};function o(a,s,c){return i.getDimensions(a,M({box:s},c))}this.createText=function(a,s){return i.createText(a,s||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return r}}Ln.$inject=["config.textRenderer"];function Nr(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(t){return this.pathMap[t].d},this.getScaledPath=function(t,n){var r=this.pathMap[t],i,o;n.abspos?(i=n.abspos.x,o=n.abspos.y):(i=n.containerWidth*n.position.mx,o=n.containerHeight*n.position.my);var a={};if(n.position){for(var s=n.containerHeight/r.height*n.yScaleFactor,c=n.containerWidth/r.width*n.xScaleFactor,f=0;f<r.heightElements.length;f++)a["y"+f]=r.heightElements[f]*s;for(var h=0;h<r.widthElements.length;h++)a["x"+h]=r.widthElements[h]*c}var y=el(r.d,{mx:i,my:o,e:a});return y}}var Zu=/\{([^{}]+)\}/g,Qu=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;function Ju(e,t,n){var r=n;return t.replace(Qu,function(i,o,a,s,c){o=o||s,r&&(o in r&&(r=r[o]),typeof r=="function"&&c&&(r=r()))}),r=(r==null||r==n?e:r)+"",r}function el(e,t){return String(e).replace(Zu,function(n,r){return Ju(n,r,t)})}var ho={__init__:["bpmnRenderer"],bpmnRenderer:["type",gt],textRenderer:["type",Ln],pathMap:["type",Nr]};function Br(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(n,r){return t[r]||"{"+r+"}"})}var In={translate:["value",Br]};Q();var an=Math,Hm=an.PI,zm=an.min,Um=an.max,Gm=an.pow,Km=an.abs;function tl(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function sn(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function mo(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function nl(e){return tl({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function rl(e){for(var t=e.waypoints,n=t.reduce(function(f,h,y){var v=t[y-1];if(v){var A=f[f.length-1],W=A&&A.endLength||0,L=il(v,h);f.push({start:v,end:h,startLength:W,endLength:W+L,length:L})}return f},[]),r=n.reduce(function(f,h){return f+h.length},0),i=r/2,o=0,a=n[o];a.endLength<i;)a=n[++o];var s=(i-a.startLength)/a.length,c={x:a.start.x+(a.end.x-a.start.x)*s,y:a.start.y+(a.end.y-a.start.y)*s};return c}function Fn(e){return Vi(e)?rl(e):nl(e)}function il(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Se(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}function jn(e,t,n){return M({id:e.id,type:e.$type,businessObject:e,di:t},n)}function ol(e,t,n){var r=e.waypoint;return!r||r.length<2?[Fn(t),Fn(n)]:r.map(function(i){return{x:i.x,y:i.y}})}function yo(e,t,n){return new Error(`element ${Se(t)} referenced by ${Se(e)}#${n} not yet drawn`)}function it(e,t,n,r,i){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=r,this._textRenderer=i}it.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"];it.prototype.add=function(e,t,n){var r,i,o;if(N(t,"bpmndi:BPMNPlane")){var a=N(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};r=this._elementFactory.createRoot(jn(e,t,a)),this._canvas.addRootElement(r)}else if(N(t,"bpmndi:BPMNShape")){var s=!dt(e,t),c=sl(e);i=n&&(n.hidden||n.collapsed);var f=t.bounds;r=this._elementFactory.createShape(jn(e,t,{collapsed:s,hidden:i,x:Math.round(f.x),y:Math.round(f.y),width:Math.round(f.width),height:Math.round(f.height),isFrame:c})),N(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,r),N(e,"bpmn:Lane")&&(o=0),N(e,"bpmn:DataStoreReference")&&(al(n,Fn(f))||(n=this._canvas.findRoot(n))),this._canvas.addShape(r,n,o)}else if(N(t,"bpmndi:BPMNEdge")){var h=this._getSource(e),y=this._getTarget(e);i=n&&(n.hidden||n.collapsed),r=this._elementFactory.createConnection(jn(e,t,{hidden:i,source:h,target:y,waypoints:ol(t,h,y)})),N(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(r,n,o)}else throw new Error(`unknown di ${Se(t)} for element ${Se(e)}`);return Wi(e)&&$t(r)&&this.addLabel(e,t,r),this._eventBus.fire("bpmnElement.added",{element:r}),r};it.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${Se(e)}#attachedToRef`);var r=this._elementRegistry.get(n.id),i=r&&r.attachers;if(!r)throw yo(e,n,"attachedToRef");t.host=r,i||(r.attachers=i=[]),i.indexOf(t)===-1&&i.push(t)};it.prototype.addLabel=function(e,t,n){var r,i,o;return r=Hi(t,n),i=$t(n),i&&(r=this._textRenderer.getExternalLabelBounds(r,i)),o=this._elementFactory.createLabel(jn(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!$t(n),x:Math.round(r.x),y:Math.round(r.y),width:Math.round(r.width),height:Math.round(r.height)})),this._canvas.addShape(o,n.parent)};it.prototype._getConnectedElement=function(e,t){var n,r,i=e.$type;if(r=e[t+"Ref"],t==="source"&&i==="bpmn:DataInputAssociation"&&(r=r&&r[0]),(t==="source"&&i==="bpmn:DataOutputAssociation"||t==="target"&&i==="bpmn:DataInputAssociation")&&(r=e.$parent),n=r&&this._getElement(r),n)return n;throw r?yo(e,r,t+"Ref"):new Error(`${Se(e)}#${t} Ref not specified`)};it.prototype._getSource=function(e){return this._getConnectedElement(e,"source")};it.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")};it.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};function al(e,t){var n=t.x,r=t.y;return n>=e.x&&n<=e.x+e.width&&r>=e.y&&r<=e.y+e.height}function sl(e){return N(e,"bpmn:Group")}var go={__depends__:[In],bpmnImporter:["type",it]};var vo={__depends__:[ho,go]};Q();function $n(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}$n.prototype.next=function(){return this._prefix+ ++this._counter};var ul=new $n("ov"),ll=500;function be(e,t,n,r){this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=ul,this._overlayDefaults=M({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=cl(n.getContainer()),this._init()}be.$inject=["config.overlays","eventBus","canvas","elementRegistry"];be.prototype.get=function(e){if(De(e)&&(e={id:e}),De(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?nt(t.overlays,xn({type:e.type})):t.overlays.slice():[]}else return e.type?nt(this._overlays,xn({type:e.type})):e.id?this._overlays[e.id]:null};be.prototype.add=function(e,t,n){if(_e(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var r=this._ids.next();return n=M({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r};be.prototype.remove=function(e){var t=this.get(e)||[];xe(t)||(t=[t]);var n=this;P(t,function(r){var i=n._getOverlayContainer(r.element,!0);if(r&&(zt(r.html),zt(r.htmlContainer),delete r.htmlContainer,delete r.element,delete n._overlays[r.id]),i){var o=i.overlays.indexOf(r);o!==-1&&i.overlays.splice(o,1)}})};be.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"};be.prototype.show=function(){Vn(this._overlayRoot)};be.prototype.hide=function(){Vn(this._overlayRoot,!1)};be.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Tn(this._overlayRoot)};be.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,i=t.y;if(t.waypoints){var o=Mt(t);r=o.x,i=o.y}Eo(n,r,i),kn(e.html,"data-container-id",t.id)};be.prototype._updateOverlay=function(e){var t=e.position,n=e.htmlContainer,r=e.element,i=t.left,o=t.top;if(t.right!==void 0){var a;r.waypoints?a=Mt(r).width:a=r.width,i=t.right*-1+a}if(t.bottom!==void 0){var s;r.waypoints?s=Mt(r).height:s=r.height,o=t.bottom*-1+s}Eo(n,i||0,o||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())};be.prototype._createOverlayContainer=function(e){var t=ee('<div class="djs-overlays" />');Pe(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n};be.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";bo(this._overlayRoot,n)};be.prototype._getOverlayContainer=function(e,t){var n=ve(this._overlayContainers,function(r){return r.element===e});return!n&&!t?this._createOverlayContainer(e):n};be.prototype._addOverlay=function(e){var t=e.id,n=e.element,r=e.html,i,o;r.get&&r.constructor.prototype.jquery&&(r=r.get(0)),De(r)&&(r=ee(r)),o=this._getOverlayContainer(n),i=ee('<div class="djs-overlay" data-overlay-id="'+t+'">'),Pe(i,{position:"absolute"}),i.appendChild(r),e.type&&Bt(i).add("djs-overlay-"+e.type);var a=this._canvas.findRoot(n),s=this._canvas.getRootElement();Vn(i,a===s),e.htmlContainer=i,o.overlays.push(e),o.html.appendChild(i),this._overlays[t]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())};be.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=this._canvas.findRoot(e.element),i=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,s=this._canvas.getRootElement(),c=!0;(r!==s||n&&(wt(i)&&i>t.scale||wt(o)&&o<t.scale))&&(c=!1),Vn(a,c),this._updateOverlayScale(e,t)};be.prototype._updateOverlayScale=function(e,t){var n=e.scale,r,i,o=e.htmlContainer,a,s="";n!==!0&&(n===!1?(r=1,i=1):(r=n.min,i=n.max),wt(r)&&t.scale<r&&(a=(1/t.scale||1)*r),wt(i)&&t.scale>i&&(a=(1/t.scale||1)*i)),wt(a)&&(s="scale("+a+","+a+")"),bo(o,s)};be.prototype._updateOverlaysVisibilty=function(e){var t=this;P(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})};be.prototype._init=function(){var e=this._eventBus,t=this;function n(r){t._updateRoot(r),t._updateOverlaysVisibilty(r),t.show()}e.on("canvas.viewbox.changing",function(r){t.hide()}),e.on("canvas.viewbox.changed",function(r){n(r.viewbox)}),e.on(["shape.remove","connection.remove"],function(r){var i=r.element,o=t.get({element:i});P(o,function(c){t.remove(c.id)});var a=t._getOverlayContainer(i);if(a){zt(a.html);var s=t._overlayContainers.indexOf(a);s!==-1&&t._overlayContainers.splice(s,1)}}),e.on("element.changed",ll,function(r){var i=r.element,o=t._getOverlayContainer(i,!0);o&&(P(o.overlays,function(a){t._updateOverlay(a)}),t._updateOverlayContainer(o))}),e.on("element.marker.update",function(r){var i=t._getOverlayContainer(r.element,!0);i&&Bt(i.html)[r.add?"add":"remove"](r.marker)}),e.on("root.set",function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};function cl(e){var t=ee('<div class="djs-overlay-container" />');return Pe(t,{position:"absolute",width:0,height:0}),e.insertBefore(t,e.firstChild),t}function Eo(e,t,n){Pe(e,{left:t+"px",top:n+"px"})}function Vn(e,t){e.style.display=t===!1?"none":""}function bo(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}var qn={__init__:["overlays"],overlays:["type",be]};function Wn(e,t,n,r){e.on("element.changed",function(i){var o=i.element;(o.parent||o===t.getRootElement())&&(i.gfx=n.getGraphics(o)),i.gfx&&e.fire(_n(o)+".changed",i)}),e.on("elements.changed",function(i){var o=i.elements;o.forEach(function(a){e.fire("element.changed",{element:a})}),r.updateContainments(o)}),e.on("shape.changed",function(i){r.update("shape",i.element,i.gfx)}),e.on("connection.changed",function(i){r.update("connection",i.element,i.gfx)})}Wn.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var xo={__init__:["changeSupport"],changeSupport:["type",Wn]};Q();var fl=1e3;function Ae(e){this._eventBus=e}Ae.$inject=["eventBus"];function pl(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}Ae.prototype.on=function(e,t,n,r,i,o){if((tt(t)||Me(t))&&(o=i,i=r,r=n,n=t,t=null),tt(n)&&(o=i,i=r,r=n,n=fl),_e(i)&&(o=i,i=!1),!tt(r))throw new Error("handlerFn must be a function");xe(e)||(e=[e]);var a=this._eventBus;P(e,function(s){var c=["commandStack",s,t].filter(function(f){return f}).join(".");a.on(c,n,i?pl(r,o):r,o)})};Ae.prototype.canExecute=vt("canExecute");Ae.prototype.preExecute=vt("preExecute");Ae.prototype.preExecuted=vt("preExecuted");Ae.prototype.execute=vt("execute");Ae.prototype.executed=vt("executed");Ae.prototype.postExecute=vt("postExecute");Ae.prototype.postExecuted=vt("postExecuted");Ae.prototype.revert=vt("revert");Ae.prototype.reverted=vt("reverted");function vt(e){return function(n,r,i,o,a){(tt(n)||Me(n))&&(a=o,o=i,i=r,r=n,n=null),this.on(n,e,r,i,o,a)}}function un(e,t){t.invoke(Ae,this),this.executed(function(n){var r=n.context;r.rootElement?e.setRootElement(r.rootElement):r.rootElement=e.getRootElement()}),this.revert(function(n){var r=n.context;r.rootElement&&e.setRootElement(r.rootElement)})}Ce(un,Ae);un.$inject=["canvas","injector"];var wo={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",un]};Q();var hl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Et(e){return e=""+e,e&&e.replace(/[&<>"']/g,function(t){return hl[t]})}var ml="_plane";function ln(e){var t=e.id;return N(e,"bpmn:SubProcess")?dl(t):t}function dl(e){return e+ml}var yl="bjs-breadcrumbs-shown";function Hn(e,t,n){var r=ee('<ul class="bjs-breadcrumbs"></ul>'),i=n.getContainer(),o=Bt(i);i.appendChild(r);var a=[];e.on("element.changed",function(c){var f=c.element,h=oe(f),y=ve(a,function(v){return v===h});y&&s()});function s(c){c&&(a=gl(c));var f=a.flatMap(function(y){var v=n.findRoot(ln(y))||n.findRoot(y.id);if(!v&&N(y,"bpmn:Process")){var A=t.find(function(O){var H=oe(O);return H&&H.get("processRef")===y});v=A&&n.findRoot(A.id)}if(!v)return[];var W=Et(y.name||y.id),L=ee('<li><span class="bjs-crumb"><a title="'+W+'">'+W+"</a></span></li>");return L.addEventListener("click",function(){n.setRootElement(v)}),L});r.innerHTML="";var h=f.length>1;o.toggle(yl,h),f.forEach(function(y){r.appendChild(y)})}e.on("root.set",function(c){s(c.element)})}Hn.$inject=["eventBus","elementRegistry","canvas"];function gl(e){for(var t=oe(e),n=[],r=t;r;r=r.$parent)(N(r,"bpmn:SubProcess")||N(r,"bpmn:Process"))&&n.push(r);return n.reverse()}function zn(e,t){var n=null,r=new vl;e.on("root.set",function(i){var o=i.element,a=t.viewbox(),s=r.get(o);if(r.set(n,{x:a.x,y:a.y,zoom:a.scale}),n=o,!(!N(o,"bpmn:SubProcess")&&!s)){s=s||{x:0,y:0,zoom:1};var c=(a.x-s.x)*a.scale,f=(a.y-s.y)*a.scale;(c!==0||f!==0)&&t.scroll({dx:c,dy:f}),s.zoom!==a.scale&&t.zoom(s.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){r.clear(),n=null})}zn.$inject=["eventBus","canvas"];function vl(){this._entries=[],this.set=function(e,t){var n=!1;for(var r in this._entries)if(this._entries[r][0]===e){this._entries[r][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}t!==-1&&this._entries.splice(t,1)}}var _o={x:180,y:160};function bt(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,function(r,i){n._handleImport(i.definitions)})}bt.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach(function(r){!r.plane||!r.plane.bpmnElement||(t._processToDiagramMap[r.plane.bpmnElement.id]=r)});var n=e.diagrams.filter(r=>r.plane).flatMap(r=>t._createNewDiagrams(r.plane));n.forEach(function(r){t._movePlaneElementsToOrigin(r.plane)})}};bt.prototype._createNewDiagrams=function(e){var t=this,n=[],r=[];e.get("planeElement").forEach(function(o){var a=o.bpmnElement;if(a){var s=a.$parent;N(a,"bpmn:SubProcess")&&!o.isExpanded&&n.push(a),bl(a,e)&&r.push({diElement:o,parent:s})}});var i=[];return n.forEach(function(o){if(!t._processToDiagramMap[o.id]){var a=t._createDiagram(o);t._processToDiagramMap[o.id]=a,i.push(a)}}),r.forEach(function(o){for(var a=o.diElement,s=o.parent;s&&n.indexOf(s)===-1;)s=s.$parent;if(s){var c=t._processToDiagramMap[s.id];t._moveToDiPlane(a,c.plane)}}),i};bt.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=El(e),r={x:n.x-_o.x,y:n.y-_o.y};t.forEach(function(i){i.waypoint?i.waypoint.forEach(function(o){o.x=o.x-r.x,o.y=o.y-r.y}):i.bounds&&(i.bounds.x=i.bounds.x-r.x,i.bounds.y=i.bounds.y-r.y)})};bt.prototype._moveToDiPlane=function(e,t){var n=So(e),r=n.plane.get("planeElement");r.splice(r.indexOf(e),1),t.get("planeElement").push(e)};bt.prototype._createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n};bt.$inject=["eventBus","moddle"];function So(e){return N(e,"bpmndi:BPMNDiagram")?e:So(e.$parent)}function El(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach(function(n){if(n.bounds){var r=sn(n.bounds);t.top=Math.min(r.top,t.top),t.left=Math.min(r.left,t.left)}}),mo(t)}function bl(e,t){var n=e.$parent;return!(!N(n,"bpmn:SubProcess")||n===t.bpmnElement||ji(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))}var Un=250,xl='<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>',wl="bjs-drilldown-empty";function ut(e,t,n,r,i){Ae.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=r,this._translate=i;var o=this;this.executed("shape.toggleCollapse",Un,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.reverted("shape.toggleCollapse",Un,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.executed(["shape.create","shape.move","shape.delete"],Un,function(a){var s=a.oldParent,c=a.newParent||a.parent,f=a.shape;o._canDrillDown(f)&&o._addOverlay(f),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(f)},!0),this.reverted(["shape.create","shape.move","shape.delete"],Un,function(a){var s=a.oldParent,c=a.newParent||a.parent,f=a.shape;o._canDrillDown(f)&&o._addOverlay(f),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(f)},!0),t.on("import.render.complete",function(){n.filter(function(a){return o._canDrillDown(a)}).map(function(a){o._addOverlay(a)})})}Ce(ut,Ae);ut.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}};ut.prototype._canDrillDown=function(e){var t=this._canvas;return N(e,"bpmn:SubProcess")&&t.findRoot(ln(e))};ut.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=oe(e),r=t.get({element:n.id,type:"drilldown"})[0];if(r){var i=n&&n.get("flowElements")&&n.get("flowElements").length;Bt(r.html).toggle(wl,!i)}};ut.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,r=oe(e),i=n.get({element:e,type:"drilldown"});i.length&&this._removeOverlay(e);var o=ee('<button type="button" class="bjs-drilldown">'+xl+"</button>"),a=r.get("name")||r.get("id"),s=this._translate("Open {element}",{element:a});o.setAttribute("title",s),o.addEventListener("click",function(){t.setRootElement(t.findRoot(ln(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:o}),this._updateOverlayVisibility(e)};ut.prototype._removeOverlay=function(e){var t=this._overlays;t.remove({element:e,type:"drilldown"})};ut.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];var Ao={__depends__:[qn,xo,wo],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Hn],drilldownCentering:["type",zn],drilldownOverlayBehavior:["type",ut],subprocessCompatibility:["type",bt]};Q();function Or(e){return e.originalEvent||e.srcEvent}function Ro(e,t){return(Or(e)||e).button===t}function Kt(e){return Ro(e,0)}function Co(e){return Ro(e,1)}function Po(e){var t=Or(e)||e;return Kt(e)&&t.shiftKey}function _l(e){return!0}function Gn(e){return Kt(e)||Co(e)}var ko=500;function Kn(e,t,n){var r=this;function i(b,D,R){if(!s(b,D)){var F,B,I;R?B=t.getGraphics(R):(F=D.delegateTarget||D.target,F&&(B=F,R=t.get(B))),!(!B||!R)&&(I=e.fire(b,{element:R,gfx:B,originalEvent:D}),I===!1&&(D.stopPropagation(),D.preventDefault()))}}var o={};function a(b){return o[b]}function s(b,D){var R=f[b]||Kt;return!R(D)}var c={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},f={"element.contextmenu":_l,"element.mousedown":Gn,"element.mouseup":Gn,"element.click":Gn,"element.dblclick":Gn};function h(b,D,R){var F=c[b];if(!F)throw new Error("unmapped DOM event name <"+b+">");return i(F,D,R)}var y="svg, .djs-element";function v(b,D,R,F){var B=o[R]=function(I){i(R,I)};F&&(f[R]=F),B.$delegate=on.bind(b,y,D,B)}function A(b,D,R){var F=a(R);F&&on.unbind(b,D,F.$delegate)}function W(b){P(c,function(D,R){v(b,R,D)})}function L(b){P(c,function(D,R){A(b,R,D)})}e.on("canvas.destroy",function(b){L(b.svg)}),e.on("canvas.init",function(b){W(b.svg)}),e.on(["shape.added","connection.added"],function(b){var D=b.element,R=b.gfx;e.fire("interactionEvents.createHit",{element:D,gfx:R})}),e.on(["shape.changed","connection.changed"],ko,function(b){var D=b.element,R=b.gfx;e.fire("interactionEvents.updateHit",{element:D,gfx:R})}),e.on("interactionEvents.createHit",ko,function(b){var D=b.element,R=b.gfx;r.createDefaultHit(D,R)}),e.on("interactionEvents.updateHit",function(b){var D=b.element,R=b.gfx;r.updateDefaultHit(D,R)});var O=w("djs-hit djs-hit-stroke"),H=w("djs-hit djs-hit-click-stroke"),G=w("djs-hit djs-hit-all"),T=w("djs-hit djs-hit-no-move"),g={all:G,"click-stroke":H,stroke:O,"no-move":T};function w(b,D){return D=M({stroke:"white",strokeWidth:15},D||{}),n.cls(b,["no-fill","no-border"],D)}function C(b,D){var R=g[D];if(!R)throw new Error("invalid hit type <"+D+">");return te(b,R),b}function V(b,D){fe(b,D)}this.removeHits=function(b){var D=uo(".djs-hit",b);P(D,Dt)},this.createDefaultHit=function(b,D){var R=b.waypoints,F=b.isFrame,B;return R?this.createWaypointsHit(D,R):(B=F?"stroke":"all",this.createBoxHit(D,B,{width:b.width,height:b.height}))},this.createWaypointsHit=function(b,D){var R=qt(D);return C(R,"stroke"),V(b,R),R},this.createBoxHit=function(b,D,R){R=M({x:0,y:0},R);var F=ne("rect");return C(F,D),te(F,R),V(b,F),F},this.updateDefaultHit=function(b,D){var R=He(".djs-hit",D);if(R)return b.waypoints?kr(R,b.waypoints):te(R,{width:b.width,height:b.height}),R},this.fire=i,this.triggerMouseEvent=h,this.mouseHandler=a,this.registerEvent=v,this.unregisterEvent=A}Kn.$inject=["eventBus","elementRegistry","styles"];var To={__init__:["interactionEvents"],interactionEvents:["type",Kn]};Q();function Rt(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],function(r){var i=r.element;n.deselect(i)}),e.on(["diagram.clear","root.set"],function(r){n.select(null)})}Rt.$inject=["eventBus","canvas"];Rt.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(n!==-1){var r=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:t})}};Rt.prototype.get=function(){return this._selectedElements};Rt.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1};Rt.prototype.select=function(e,t){var n=this._selectedElements,r=n.slice();xe(e)||(e=e?[e]:[]);var i=this._canvas,o=i.getRootElement();e=e.filter(function(a){var s=i.findRoot(a);return o===s}),t?P(e,function(a){n.indexOf(a)===-1&&n.push(a)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:n})};Q();var Mo="hover",Do="selected";function Yn(e,t){this._canvas=e;function n(i,o){e.addMarker(i,o)}function r(i,o){e.removeMarker(i,o)}t.on("element.hover",function(i){n(i.element,Mo)}),t.on("element.out",function(i){r(i.element,Mo)}),t.on("selection.changed",function(i){function o(f){r(f,Do)}function a(f){n(f,Do)}var s=i.oldSelection,c=i.newSelection;P(s,function(f){c.indexOf(f)===-1&&o(f)}),P(c,function(f){s.indexOf(f)===-1&&a(f)})})}Yn.$inject=["canvas","eventBus"];Q();function Xn(e,t,n,r){e.on("create.end",500,function(i){var o=i.context,a=o.canExecute,s=o.elements,c=o.hints||{},f=c.autoSelect;if(a){if(f===!1)return;xe(f)?t.select(f):t.select(s.filter(Sl))}}),e.on("connect.end",500,function(i){var o=i.context,a=o.connection;a&&t.select(a)}),e.on("shape.move.end",500,function(i){var o=i.previousSelection||[],a=r.get(i.context.shape.id),s=ve(o,function(c){return a.id===c.id});s||t.select(a)}),e.on("element.click",function(i){if(Kt(i)){var o=i.element;o===n.getRootElement()&&(o=null);var a=t.isSelected(o),s=t.get().length>1,c=Po(i);if(a&&s)return c?t.deselect(o):t.select(o);a?t.deselect(o):t.select(o,c)}})}Xn.$inject=["eventBus","selection","canvas","elementRegistry"];function Sl(e){return!e.hidden}var No={__init__:["selectionVisuals","selectionBehavior"],__depends__:[To],selection:["type",Rt],selectionVisuals:["type",Yn],selectionBehavior:["type",Xn]};Q();var Al=/^class[ {]/;function Rl(e){return Al.test(e.toString())}function Ir(e){return Array.isArray(e)}function Lr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Zn(...e){e.length===1&&Ir(e[0])&&(e=e[0]),e=[...e];let t=e.pop();return t.$inject=e,t}var Cl=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Pl=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,kl=/\/\*([^*]*)\*\//m;function Tl(e){if(typeof e!="function")throw new Error(`Cannot annotate "${e}". Expected a function!`);let t=e.toString().match(Rl(e)?Cl:Pl);if(!t)return[];let n=t[1]||t[2];return n&&n.split(",").map(r=>{let i=r.match(kl);return(i&&i[1]||r).trim()})||[]}function Fr(e,t){let n=t||{get:function(T,g){if(r.push(T),g===!1)return null;throw s(`No provider for "${T}"!`)}},r=[],i=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),a=o.injector=this,s=function(T){let g=r.join(" -> ");return r.length=0,new Error(g?`${T} (Resolving: ${g})`:T)};function c(T,g){if(!i[T]&&T.includes(".")){let w=T.split("."),C=c(w.shift());for(;w.length;)C=C[w.shift()];return C}if(Lr(o,T))return o[T];if(Lr(i,T)){if(r.indexOf(T)!==-1)throw r.push(T),s("Cannot resolve circular dependency!");return r.push(T),o[T]=i[T][0](i[T][1]),r.pop(),o[T]}return n.get(T,g)}function f(T,g){if(typeof g=="undefined"&&(g={}),typeof T!="function")if(Ir(T))T=Zn(T.slice());else throw s(`Cannot invoke "${T}". Expected a function!`);let C=(T.$inject||Tl(T)).map(V=>Lr(g,V)?g[V]:c(V));return{fn:T,dependencies:C}}function h(T){let{fn:g,dependencies:w}=f(T),C=Function.prototype.bind.call(g,null,...w);return new C}function y(T,g,w){let{fn:C,dependencies:V}=f(T,w);return C.apply(g,V)}function v(T){return Zn(g=>T.get(g))}function A(T,g){if(g&&g.length){let w=Object.create(null),C=Object.create(null),V=[],b=[],D=[],R,F,B,I;for(let K in i)R=i[K],g.indexOf(K)!==-1&&(R[2]==="private"?(F=V.indexOf(R[3]),F===-1?(B=R[3].createChild([],g),I=v(B),V.push(R[3]),b.push(B),D.push(I),w[K]=[I,K,"private",B]):w[K]=[D[F],K,"private",b[F]]):w[K]=[R[2],R[1]],C[K]=!0),(R[2]==="factory"||R[2]==="type")&&R[1].$scope&&g.forEach(ot=>{R[1].$scope.indexOf(ot)!==-1&&(w[K]=[R[2],R[1]],C[ot]=!0)});g.forEach(K=>{if(!C[K])throw new Error('No provider for "'+K+'". Cannot use provider from the parent!')}),T.unshift(w)}return new Fr(T,a)}let W={factory:y,type:h,value:function(T){return T}};function L(T,g){let w=T.__init__||[];return function(){w.forEach(C=>{typeof C=="string"?g.get(C):g.invoke(C)})}}function O(T){let g=T.__exports__;if(g){let w=T.__modules__,C=Object.keys(T).reduce((F,B)=>(B!=="__exports__"&&B!=="__modules__"&&B!=="__init__"&&B!=="__depends__"&&(F[B]=T[B]),F),Object.create(null)),V=(w||[]).concat(C),b=A(V),D=Zn(function(F){return b.get(F)});g.forEach(function(F){i[F]=[D,F,"private",b]});let R=(T.__init__||[]).slice();return R.unshift(function(){b.init()}),T=Object.assign({},T,{__init__:R}),L(T,b)}return Object.keys(T).forEach(function(w){if(w==="__init__"||w==="__depends__")return;let C=T[w];if(C[2]==="private"){i[w]=C;return}let V=C[0],b=C[1];i[w]=[W[V],Ml(V,b),V]}),L(T,a)}function H(T,g){return T.indexOf(g)!==-1||(T=(g.__depends__||[]).reduce(H,T),T.indexOf(g)!==-1)?T:T.concat(g)}function G(T){let g=T.reduce(H,[]).map(O),w=!1;return function(){w||(w=!0,g.forEach(C=>C()))}}this.get=c,this.invoke=y,this.instantiate=h,this.createChild=A,this.init=G(e)}function Ml(e,t){return e!=="value"&&Ir(t)&&(t=Zn(t.slice())),t}Q();var Dl=1;function lt(e,t){Xe.call(this,e,Dl),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}Ce(lt,Xe);lt.prototype.canRender=function(){return!0};lt.prototype.drawShape=function(t,n,r){var i=ne("rect");return te(i,{x:0,y:0,width:n.width||0,height:n.height||0}),Sn(n)?te(i,M({},this.FRAME_STYLE,r||{})):te(i,M({},this.SHAPE_STYLE,r||{})),fe(t,i),i};lt.prototype.drawConnection=function(t,n,r){var i=qt(n.waypoints,M({},this.CONNECTION_STYLE,r||{}));return fe(t,i),i};lt.prototype.getShapePath=function(t){var n=t.x,r=t.y,i=t.width,o=t.height,a=[["M",n,r],["l",i,0],["l",0,o],["l",-i,0],["z"]];return yt(a)};lt.prototype.getConnectionPath=function(t){var n=t.waypoints,r,i,o=[];for(r=0;i=n[r];r++)i=i.original||i,o.push([r===0?"M":"L",i.x,i.y]);return yt(o)};lt.$inject=["eventBus","styles"];Q();function jr(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(n,r,i){var o=this.style(r,i);return M(o,{class:n})},this.style=function(n,r){!xe(n)&&!r&&(r=n,n=[]);var i=Ve(n,function(o,a){return M(o,e[a]||{})},{});return r?M(i,r):i},this.computeStyle=function(n,r,i){return xe(r)||(i=r,r=[]),t.style(r||[],M({},i,n||{}))}}var Bo={__init__:["defaultRenderer"],defaultRenderer:["type",lt],styles:["type",jr]};Q();function Oo(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return n!==-1&&e.splice(n,1),n}function Lo(e,t,n){if(!(!e||!t)){typeof n!="number"&&(n=-1);var r=e.indexOf(t);if(r!==-1){if(r===n)return;if(n!==-1)e.splice(r,1);else return}n!==-1?e.splice(n,0,t):e.push(t)}}function Qn(e,t){return Math.round(e*t)/t}function Io(e){return Me(e)?e+"px":e}function Nl(e){for(;e.parent;)e=e.parent;return e}function Bl(e){e=M({},{width:"100%",height:"100%"},e);let t=e.container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),Pe(n,{position:"relative",overflow:"hidden",width:Io(e.width),height:Io(e.height)}),t.appendChild(n),n}function Fo(e,t,n){let r=ne("g");qe(r).add(t);let i=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(r,e.childNodes[i]||null),r}var Ol="base",jo=0,Ll=1,Il={shape:["x","y","width","height"],connection:["waypoints"]};function q(e,t,n,r){this._eventBus=t,this._elementRegistry=r,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}q.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"];q.prototype._init=function(e){let t=this._eventBus,n=this._container=Bl(e),r=this._svg=ne("svg");te(r,{width:"100%",height:"100%"}),kn(r,"tabindex",0),e.autoFocus&&t.on("element.hover",()=>{this.restoreFocus()}),t.on("element.mousedown",500,o=>{this.focus()}),r.addEventListener("focusin",()=>{this._setFocused(!0)}),r.addEventListener("focusout",()=>{this._setFocused(!1)}),r.addEventListener("mouseover",()=>{this._eventBus.fire("canvas.mouseover")}),r.addEventListener("mouseout",()=>{this._eventBus.fire("canvas.mouseout")}),fe(n,r);let i=this._viewport=Fo(r,"viewport");e.deferUpdate&&(this._viewboxChanged=dr(Ye(this._viewboxChanged,this),300)),t.on("diagram.init",()=>{t.fire("canvas.init",{svg:r,viewport:i})}),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)};q.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});let e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport};q.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))};q.prototype._clear=function(){this._elementRegistry.getAll().forEach(t=>{let n=_n(t);n==="root"?this.removeRootElement(t):this._removeElement(t,n)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox};q.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)};q.prototype.restoreFocus=function(){document.activeElement===document.body&&this.focus()};q.prototype.isFocused=function(){return this._focused};q.prototype.getDefaultLayer=function(){return this.getLayer(Ol,jo)};q.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),typeof t!="undefined"&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group};q.prototype._getChildIndex=function(e){return Ve(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)};q.prototype._createLayer=function(e,t){typeof t=="undefined"&&(t=Ll);let n=this._getChildIndex(t);return{group:Fo(this._viewport,"layer-"+e,n),index:t,visible:!0}};q.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");let t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");let n=this._viewport,r=t.group,i=t.index;if(t.visible)return r;let o=this._getChildIndex(i);return n.insertBefore(r,n.childNodes[o]||null),t.visible=!0,r};q.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");let t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");let n=t.group;return t.visible&&(Dt(n),t.visible=!1),n};q.prototype._removeLayer=function(e){let t=this._layers[e];t&&(delete this._layers[e],Dt(t.group))};q.prototype.getActiveLayer=function(){let e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null};q.prototype.findRoot=function(e){return typeof e=="string"&&(e=this._elementRegistry.get(e)),e?(this._findPlaneForRoot(Nl(e))||{}).rootElement:void 0};q.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})};q.prototype._findPlaneForRoot=function(e){return ve(this._planes,function(t){return t.rootElement===e})};q.prototype.getContainer=function(){return this._container};q.prototype._updateMarker=function(e,t,n){let r;e.id||(e=this._elementRegistry.get(e)),e.markers=e.markers||new Set,r=this._elementRegistry._elements[e.id],r&&(P([r.gfx,r.secondaryGfx],function(i){i&&(n?(e.markers.add(t),qe(i).add(t)):(e.markers.delete(t),qe(i).remove(t)))}),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))};q.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)};q.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)};q.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),e.markers?e.markers.has(t):!1};q.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)};q.prototype.getRootElement=function(){let e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))};q.prototype.addRootElement=function(e){let t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});let n=e.layer="root-"+t;this._ensureValid("root",e);let r=this.getLayer(n,jo);return this.hideLayer(n),this._addRoot(e,r),this._planes.push({rootElement:e,layer:r}),e};q.prototype.removeRootElement=function(e){if(typeof e=="string"&&(e=this._elementRegistry.get(e)),!!this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter(function(n){return n.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e};q.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e};q.prototype._removeRoot=function(e){let t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)};q.prototype._addRoot=function(e,t){let n=this._elementRegistry,r=this._eventBus;r.fire("root.add",{element:e}),n.add(e,t),r.fire("root.added",{element:e,gfx:t})};q.prototype._setRoot=function(e,t){let n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})};q.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");let n=Il[e];if(!bn(n,function(i){return typeof t[i]!="undefined"}))throw new Error("must supply { "+n.join(", ")+" } with "+e)};q.prototype._setParent=function(e,t,n){Lo(t.children,e,n),e.parent=t};q.prototype._addElement=function(e,t,n,r){n=n||this.getRootElement();let i=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),i.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,r);let a=o.create(e,t,r);return this._elementRegistry.add(t,a),o.update(e,t,a),i.fire(e+".added",{element:t,gfx:a}),t};q.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)};q.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)};q.prototype._removeElement=function(e,t){let n=this._elementRegistry,r=this._graphicsFactory,i=this._eventBus;if(e=n.get(e.id||e),!!e)return i.fire(t+".remove",{element:e}),r.remove(e),Oo(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+".removed",{element:e}),n.remove(e),e};q.prototype.removeShape=function(e){return this._removeElement(e,"shape")};q.prototype.removeConnection=function(e){return this._removeElement(e,"connection")};q.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)};q.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()};q.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})};q.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);let t=this._viewport,n=this.getSize(),r,i,o,a,s,c,f;if(e)this._changeViewbox(function(){s=Math.min(n.width/e.width,n.height/e.height);let h=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);Nt(t,h)});else return o=this._rootElement?this.getActiveLayer():null,r=o&&o.getBBox()||{},a=Nt(t),i=a?a.matrix:Qi(),s=Qn(i.a,1e3),c=Qn(-i.e||0,1e3),f=Qn(-i.f||0,1e3),e=this._cachedViewbox={x:c?c/s:0,y:f?f/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:r.width||0,height:r.height||0,x:r.x||0,y:r.y||0},outer:n},e;return e};q.prototype.scroll=function(e){let t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=M({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),$o(t,n)}),{x:n.e,y:n.f}};q.prototype.scrollToElement=function(e,t){let n=100;typeof e=="string"&&(e=this._elementRegistry.get(e));let r=this.findRoot(e);if(r!==this.getRootElement()&&this.setRootElement(r),r===e)return;t||(t={}),typeof t=="number"&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};let i=Mt(e),o=sn(i),a=this.viewbox(),s=this.zoom(),c,f;a.y+=t.top/s,a.x+=t.left/s,a.width-=(t.right+t.left)/s,a.height-=(t.bottom+t.top)/s;let h=sn(a);if(!(i.width<a.width&&i.height<a.height))c=i.x-a.x,f=i.y-a.y;else{let v=Math.max(0,o.right-h.right),A=Math.min(0,o.left-h.left),W=Math.max(0,o.bottom-h.bottom),L=Math.min(0,o.top-h.top);c=v||A,f=W||L}this.scroll({dx:-c*s,dy:-f*s})};q.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)}),Qn(r.a,1e3)};function $o(e,t){let n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}q.prototype._fitViewport=function(e){let t=this.viewbox(),n=t.outer,r=t.inner,i,o;return r.x>=0&&r.y>=0&&r.x+r.width<=n.width&&r.y+r.height<=n.height&&!e?o={x:0,y:0,width:Math.max(r.width+r.x,n.width),height:Math.max(r.height+r.y,n.height)}:(i=Math.min(1,n.width/r.width,n.height/r.height),o={x:r.x+(e?r.width/2-n.width/i/2:0),y:r.y+(e?r.height/2-n.height/i/2:0),width:n.width/i,height:n.height/i}),this.viewbox(o),this.viewbox(!1).scale};q.prototype._setZoom=function(e,t){let n=this._svg,r=this._viewport,i=n.createSVGMatrix(),o=n.createSVGPoint(),a,s,c,f,h;c=r.getCTM();let y=c.a;return t?(a=M(o,t),s=a.matrixTransform(c.inverse()),f=i.translate(s.x,s.y).scale(1/y*e).translate(-s.x,-s.y),h=c.multiply(f)):h=i.scale(e),$o(this._viewport,h),h};q.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}};q.prototype.getAbsoluteBBox=function(e){let t=this.viewbox(),n;e.waypoints?n=this.getGraphics(e).getBBox():n=e;let r=n.x*t.scale-t.x*t.scale,i=n.y*t.scale-t.y*t.scale,o=n.width*t.scale,a=n.height*t.scale;return{x:r,y:i,width:o,height:a}};q.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Yt="data-element-id";function Be(e){this._elements={},this._eventBus=e}Be.$inject=["eventBus"];Be.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),te(t,Yt,r),n&&te(n,Yt,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}};Be.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&(te(r.gfx,Yt,""),r.secondaryGfx&&te(r.secondaryGfx,Yt,""),delete t[n])};Be.prototype.updateId=function(e,t){this._validateId(t),typeof e=="string"&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),r=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,r)};Be.prototype.updateGraphics=function(e,t,n){var r=e.id||e,i=this._elements[r];return n?i.secondaryGfx=t:i.gfx=t,t&&te(t,Yt,r),t};Be.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&te(e,Yt);var n=this._elements[t];return n&&n.element};Be.prototype.filter=function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(n)}),t};Be.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),r=0;r<n.length;r++){var i=n[r],o=t[i],a=o.element,s=o.gfx;if(e(a,s))return a}};Be.prototype.getAll=function(){return this.filter(function(e){return e})};Be.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var r=t[n],i=r.element,o=r.gfx;return e(i,o)})};Be.prototype.getGraphics=function(e,t){var n=e.id||e,r=this._elements[n];return r&&(t?r.secondaryGfx:r.gfx)};Be.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};Q();function Fl(e,t,n,r){var i=n.inverse;return Object.defineProperty(e,"remove",{value:function(o){var a=this.indexOf(o);return a!==-1&&(this.splice(a,1),t.unset(o,i,r)),o}}),Object.defineProperty(e,"contains",{value:function(o){return this.indexOf(o)!==-1}}),Object.defineProperty(e,"add",{value:function(o,a){var s=this.indexOf(o);if(typeof a=="undefined"){if(s!==-1)return;a=this.length}s!==-1&&this.splice(s,1),this.splice(a,0,o),s===-1&&t.set(o,i,r)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}function jl(e){return e.__refs_collection===!0}function $l(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)}function Vo(e,t,n){var r=Fl(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:r}),r.length&&r.forEach(function(i){e.set(i,t.inverse,n)})}function Vl(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(o){if(o!==i){var a=i;i=null,a&&e.unset(a,r,n),i=o,e.set(i,r,n)}}})}function ze(e,t){if(!(this instanceof ze))return new ze(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}ze.prototype.bind=function(e,t){if(typeof t=="string"){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?Vo(this,t,e):Vl(this,t,e)};ze.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return jl(n)||Vo(this,t,e),n};ze.prototype.ensureBound=function(e,t){$l(e,t)||this.bind(e,t)};ze.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)};ze.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var $r=new ze({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Wo=new ze({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),qo=new ze({name:"attachers",collection:!0},{name:"host"}),Ho=new ze({name:"outgoing",collection:!0},{name:"source"}),zo=new ze({name:"incoming",collection:!0},{name:"target"});function cn(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),$r.bind(this,"parent"),Wo.bind(this,"labels"),Ho.bind(this,"outgoing"),zo.bind(this,"incoming")}function fn(){cn.call(this),$r.bind(this,"children"),qo.bind(this,"host"),qo.bind(this,"attachers")}Ce(fn,cn);function Uo(){cn.call(this),$r.bind(this,"children")}Ce(Uo,fn);function Go(){fn.call(this),Wo.bind(this,"labelTarget")}Ce(Go,fn);function Ko(){cn.call(this),Ho.bind(this,"source"),zo.bind(this,"target")}Ce(Ko,cn);var ql={connection:Ko,shape:fn,label:Go,root:Uo};function Yo(e,t){var n=ql[e];if(!n)throw new Error("unknown type: <"+e+">");return M(new n,t)}Q();function Ct(){this._uid=12}Ct.prototype.createRoot=function(e){return this.create("root",e)};Ct.prototype.createLabel=function(e){return this.create("label",e)};Ct.prototype.createShape=function(e){return this.create("shape",e)};Ct.prototype.createConnection=function(e){return this.create("connection",e)};Ct.prototype.create=function(e,t){return t=M({},t||{}),t.id||(t.id=e+"_"+this._uid++),Yo(e,t)};Q();var Jn="__fn",Xo=1e3,Wl=Array.prototype.slice;function ke(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}ke.prototype.on=function(e,t,n,r){if(e=xe(e)?e:[e],tt(t)&&(r=n,n=t,t=Xo),!Me(t))throw new Error("priority must be a number");var i=n;r&&(i=Ye(n,r),i[Jn]=n[Jn]||n);var o=this;e.forEach(function(a){o._addListener(a,{priority:t,callback:i,next:null})})};ke.prototype.once=function(e,t,n,r){var i=this;if(tt(t)&&(r=n,n=t,t=Xo),!Me(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var a=n.apply(r,arguments);return i.off(e,o),a}o[Jn]=n,this.on(e,t,o)};ke.prototype.off=function(e,t){e=xe(e)?e:[e];var n=this;e.forEach(function(r){n._removeListener(r,t)})};ke.prototype.createEvent=function(e){var t=new pn;return t.init(e),t};ke.prototype.fire=function(e,t){var n,r,i,o;if(o=Wl.call(arguments),typeof e=="object"&&(t=e,e=t.type),!e)throw new Error("no event type specified");if(r=this._listeners[e],!!r){t instanceof pn?n=t:n=this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{i=this._invokeListeners(n,o,r)}finally{e!==a&&(n.type=a)}return i===void 0&&n.defaultPrevented&&(i=!1),i}};ke.prototype.handleError=function(e){return this.fire("error",{error:e})===!1};ke.prototype._destroy=function(){this._listeners={}};ke.prototype._invokeListeners=function(e,t,n){for(var r;n&&!e.cancelBubble;)r=this._invokeListener(e,t,n),n=n.next;return r};ke.prototype._invokeListener=function(e,t,n){var r;if(n.callback.__isTomb)return r;try{r=Hl(n.callback,t),r!==void 0&&(e.returnValue=r,e.stopPropagation()),r===!1&&e.preventDefault()}catch(i){if(!this.handleError(i))throw console.error("unhandled error in event listener",i),i}return r};ke.prototype._addListener=function(e,t){var n=this._getListeners(e),r;if(!n){this._setListeners(e,t);return}for(;n;){if(n.priority<t.priority){t.next=n,r?r.next=t:this._setListeners(e,t);return}r=n,n=n.next}r.next=t};ke.prototype._getListeners=function(e){return this._listeners[e]};ke.prototype._setListeners=function(e,t){this._listeners[e]=t};ke.prototype._removeListener=function(e,t){var n=this._getListeners(e),r,i,o;if(!t){this._setListeners(e,null);return}for(;n;)r=n.next,o=n.callback,(o===t||o[Jn]===t)&&(i?i.next=r:this._setListeners(e,r)),i=n,n=r};function pn(){}pn.prototype.stopPropagation=function(){this.cancelBubble=!0};pn.prototype.preventDefault=function(){this.defaultPrevented=!0};pn.prototype.init=function(e){M(this,e||{})};function Hl(e,t){return e.apply(null,t)}Q();function Zo(e){return e.childNodes[0]}function Qo(e){return e.parentNode.childNodes[1]}function Oe(e,t){this._eventBus=e,this._elementRegistry=t}Oe.$inject=["eventBus","elementRegistry"];Oe.prototype._getChildrenContainer=function(e){var t=this._elementRegistry.getGraphics(e),n;return e.parent?(n=Qo(t),n||(n=ne("g"),qe(n).add("djs-children"),fe(t.parentNode,n))):n=t,n};Oe.prototype._clear=function(e){var t=Zo(e);return Tn(t),t};Oe.prototype._createContainer=function(e,t,n,r){var i=ne("g");qe(i).add("djs-group"),typeof n!="undefined"?Jo(i,t,t.childNodes[n]):fe(t,i);var o=ne("g");qe(o).add("djs-element"),qe(o).add("djs-"+e),r&&qe(o).add("djs-frame"),fe(i,o);var a=ne("g");return qe(a).add("djs-visual"),fe(o,a),o};Oe.prototype.create=function(e,t,n){var r=this._getChildrenContainer(t.parent);return this._createContainer(e,r,n,Sn(t))};Oe.prototype.updateContainments=function(e){var t=this,n=this._elementRegistry,r;r=Ve(e,function(i,o){return o.parent&&(i[o.parent.id]=o.parent),i},{}),P(r,function(i){var o=i.children;if(o){var a=t._getChildrenContainer(i);P(o.slice().reverse(),function(s){var c=n.getGraphics(s);Jo(c.parentNode,a)})}})};Oe.prototype.drawShape=function(e,t,n={}){var r=this._eventBus;return r.fire("render.shape",{gfx:e,element:t,attrs:n})};Oe.prototype.getShapePath=function(e){var t=this._eventBus;return t.fire("render.getShapePath",e)};Oe.prototype.drawConnection=function(e,t,n={}){var r=this._eventBus;return r.fire("render.connection",{gfx:e,element:t,attrs:n})};Oe.prototype.getConnectionPath=function(e){var t=this._eventBus;return t.fire("render.getConnectionPath",e)};Oe.prototype.update=function(e,t,n){if(t.parent){var r=this._clear(n);if(e==="shape")this.drawShape(r,t),Nn(n,t.x,t.y);else if(e==="connection")this.drawConnection(r,t);else throw new Error("unknown type: "+e);t.hidden?te(n,"display","none"):te(n,"display","block")}};Oe.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);Dt(t.parentNode)};function Jo(e,t,n){var r=n||t.firstChild;e!==r&&t.insertBefore(e,r)}var ea={__depends__:[Bo],__init__:["canvas"],canvas:["type",q],elementRegistry:["type",Be],elementFactory:["type",Ct],eventBus:["type",ke],graphicsFactory:["type",Oe]};function zl(e){var t=new Fr(e);return t.init(),t}function Ul(e){e=e||{};var t={config:["value",e]},n=[t,ea].concat(e.modules||[]);return zl(n)}function ct(e,t){this._injector=t||Ul(e),this.get("eventBus").fire("diagram.init")}ct.prototype.get=function(e,t){return this._injector.get(e,t)};ct.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)};ct.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")};ct.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};Q();Q();function Wr(){}Wr.prototype.get=function(e){return this.$model.properties.get(this,e)};Wr.prototype.set=function(e,t){this.$model.properties.set(this,e,t)};function na(e,t){this.model=e,this.properties=t}na.prototype.createType=function(e){var t=this.model,n=this.properties,r=Object.create(Wr.prototype);P(e.properties,function(a){!a.isMany&&a.default!==void 0&&(r[a.name]=a.default)}),n.defineModel(r,t),n.defineDescriptor(r,e);var i=e.ns.name;function o(a){n.define(this,"$type",{value:i,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),P(a,Ye(function(s,c){this.set(c,s)},this))}return o.prototype=r,o.hasType=r.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var Gl={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},ra={String:function(e){return e},Boolean:function(e){return e==="true"},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function er(e,t){var n=ra[e];return n?n(t):t}function Vr(e){return!!Gl[e]}function Hr(e){return!!ra[e]}function Re(e,t){var n=e.split(/:/),r,i;if(n.length===1)r=e,i=t;else if(n.length===2)r=n[1],i=n[0];else throw new Error("expected <prefix:localName> or <localName>, got "+e);return e=(i?i+":":"")+r,{name:e,prefix:i,localName:r}}function Ue(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}Ue.prototype.build=function(){return gr(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])};Ue.prototype.addProperty=function(e,t,n){typeof t=="boolean"&&(n=t,t=void 0),this.addNamedProperty(e,n!==!1);var r=this.properties;t!==void 0?r.splice(t,0,e):r.push(e)};Ue.prototype.replaceProperty=function(e,t,n){var r=e.ns,i=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var s=i.indexOf(e);if(s===-1)throw new Error("property <"+r.name+"> not found in property list");i.splice(s,1),this.addProperty(t,n?void 0:s,a),o[r.name]=o[r.localName]=t};Ue.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,i=t.split("#"),o=Re(i[0],r),a=Re(i[1],o.prefix).name,s=this.propertiesByName[a];if(s)this.replaceProperty(s,e,n);else throw new Error("refined property <"+a+"> not found");delete e.redefines};Ue.prototype.addNamedProperty=function(e,t){var n=e.ns,r=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),r[n.name]=r[n.localName]=e};Ue.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]};Ue.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e};Ue.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e};Ue.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)};Ue.prototype.assertNotDefined=function(e,t){var n=e.name,r=this.propertiesByName[n];if(r)throw new Error("property <"+n+"> already defined; override of <"+r.definedBy.ns.name+"#"+r.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")};Ue.prototype.hasProperty=function(e){return this.propertiesByName[e]};Ue.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,r=this.allTypes,i=e.name;i in n||(P(e.properties,Ye(function(o){o=M({},o,{name:o.ns.localName,inherited:t}),Object.defineProperty(o,"definedBy",{value:e});var a=o.replaces,s=o.redefines;a||s?this.redefineProperty(o,a||s,a):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),r.push(e),n[i]=e)};function Pt(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,P(e,Ye(this.registerPackage,this))}Pt.prototype.getPackage=function(e){return this.packageMap[e]};Pt.prototype.getPackages=function(){return this.packages};Pt.prototype.registerPackage=function(e){e=M({},e);var t=this.packageMap;ta(t,e,"prefix"),ta(t,e,"uri"),P(e.types,Ye(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)};Pt.prototype.registerType=function(e,t){e=M({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:M(e.meta||{})});var n=Re(e.name,t.prefix),r=n.name,i={};P(e.properties,Ye(function(o){var a=Re(o.name,n.prefix),s=a.name;Vr(o.type)||(o.type=Re(o.type,a.prefix).name),M(o,{ns:a,name:s}),i[s]=o},this)),M(e,{ns:n,name:r,propertiesByName:i}),P(e.extends,Ye(function(o){var a=Re(o,n.prefix),s=this.typeMap[a.name];s.traits=s.traits||[],s.traits.push(r)},this)),this.definePackage(e,t),this.typeMap[r]=e};Pt.prototype.mapTypes=function(e,t,n){var r=Vr(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(c,f){var h=Re(c,Vr(c)?"":e.prefix);i.mapTypes(h,t,f)}function a(c){return o(c,!0)}function s(c){return o(c,!1)}if(!r)throw new Error("unknown type <"+e.name+">");P(r.superClass,n?a:s),t(r,!n),P(r.traits,a)};Pt.prototype.getEffectiveDescriptor=function(e){var t=Re(e),n=new Ue(t);this.mapTypes(t,function(i,o){n.addTrait(i,o)});var r=n.build();return this.definePackage(r,r.allTypes[r.allTypes.length-1].$pkg),r};Pt.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};function ta(e,t,n){var r=t[n];if(r in e)throw new Error("package with "+n+" <"+r+"> already defined")}function Ot(e){this.model=e}Ot.prototype.set=function(e,t,n){if(!De(t)||!t.length)throw new TypeError("property name must be a non-empty string");var r=this.getProperty(e,t),i=r&&r.name;Kl(n)?r?delete e[i]:delete e.$attrs[qr(t)]:r?i in e?e[i]=n:ia(e,r,n):e.$attrs[qr(t)]=n};Ot.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[qr(t)];var r=n.name;return!e[r]&&n.isMany&&ia(e,n,[]),e[r]};Ot.prototype.define=function(e,t,n){if(!n.writable){var r=n.value;n=M({},n,{get:function(){return r}}),delete n.value}Object.defineProperty(e,t,n)};Ot.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})};Ot.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})};Ot.prototype.getProperty=function(e,t){var n=this.model,r=n.getPropertyDescriptor(e,t);if(r)return r;if(t.includes(":"))return null;let i=n.config.strict;if(typeof i!="undefined"){let o=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(i)throw o;typeof console!="undefined"&&console.warn(o)}return null};function Kl(e){return typeof e=="undefined"}function ia(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function qr(e){return e.replace(/^:/,"")}function Fe(e,t={}){this.properties=new Ot(this),this.factory=new na(this,this.properties),this.registry=new Pt(e,this.properties),this.typeCache={},this.config=t}Fe.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)};Fe.prototype.getType=function(e){var t=this.typeCache,n=De(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r};Fe.prototype.createAny=function(e,t,n){var r=Re(e),i={$type:e,$instanceOf:function(a){return a===this.$type},get:function(a){return this[a]},set:function(a,s){yr(this,[a],s)}},o={name:e,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:t}};return this.properties.defineDescriptor(i,o),this.properties.defineModel(i,this),this.properties.define(i,"get",{enumerable:!1,writable:!0}),this.properties.define(i,"set",{enumerable:!1,writable:!0}),this.properties.define(i,"$parent",{enumerable:!1,writable:!0}),this.properties.define(i,"$instanceOf",{enumerable:!1,writable:!0}),P(n,function(a,s){_e(a)&&a.value!==void 0?i[a.name]=a.value:i[s]=a}),i};Fe.prototype.getPackage=function(e){return this.registry.getPackage(e)};Fe.prototype.getPackages=function(){return this.registry.getPackages()};Fe.prototype.getElementDescriptor=function(e){return e.$descriptor};Fe.prototype.hasType=function(e,t){t===void 0&&(t=e,e=this);var n=e.$model.getElementDescriptor(e);return t in n.allTypesByName};Fe.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]};Fe.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};Q();var oa=String.fromCharCode,Yl=Object.prototype.hasOwnProperty,Xl=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,hn={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(hn).forEach(function(e){hn[e.toUpperCase()]=hn[e]});function Zl(e,t,n,r){return r?Yl.call(hn,r)?hn[r]:"&"+r+";":oa(t||parseInt(n,16))}function Lt(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(Xl,Zl):e}var aa="non-whitespace outside of root node";function Xt(e){return new Error(e)}function sa(e){return"missing namespace for prefix <"+e+">"}function tr(e){return{get:e,enumerable:!0}}function Ql(e){var t={},n;for(n in e)t[n]=e[n];return t}function zr(e){return e+"$uri"}function Jl(e){var t={},n,r;for(n in e)r=e[n],t[r]=r,t[zr(r)]=n;return t}function ua(){return{line:0,column:0}}function ec(e){throw e}function Ur(e){if(!this)return new Ur(e);var t=e&&e.proxy,n,r,i,o,a=ec,s,c,f,h,y=ua,v=!1,A=!1,W=null,L=!1,O;function H(g){g instanceof Error||(g=Xt(g)),W=g,a(g,y)}function G(g){s&&(g instanceof Error||(g=Xt(g)),s(g,y))}this.on=function(g,w){if(typeof w!="function")throw Xt("required args <name, cb>");switch(g){case"openTag":r=w;break;case"text":n=w;break;case"closeTag":i=w;break;case"error":a=w;break;case"warn":s=w;break;case"cdata":o=w;break;case"attention":h=w;break;case"question":f=w;break;case"comment":c=w;break;default:throw Xt("unsupported event: "+g)}return this},this.ns=function(g){if(typeof g=="undefined"&&(g={}),typeof g!="object")throw Xt("required args <nsMap={}>");var w={},C;for(C in g)w[C]=g[C];return A=!0,O=w,this},this.parse=function(g){if(typeof g!="string")throw Xt("required args <xml=string>");return W=null,T(g),y=ua,L=!1,W},this.stop=function(){L=!0};function T(g){var w=A?[]:null,C=A?Jl(O):null,V,b=[],D=0,R=!1,F=!1,B=0,I=0,K,ot,ae,Z,Je,et,ye,Ge,x,_="",$=0,re;function je(){if(re!==null)return re;var l,u,m,d=A&&C.xmlns,E=A&&v?[]:null,S=$,j=_,Y=j.length,ge,he,we,Ke,ie,mt={},gn={},$e,z,J;e:for(;S<Y;S++)if($e=!1,z=j.charCodeAt(S),!(z===32||z<14&&z>8)){for((z<65||z>122||z>90&&z<97)&&z!==95&&z!==58&&(G("illegal first char attribute name"),$e=!0),J=S+1;J<Y;J++)if(z=j.charCodeAt(J),!(z>96&&z<123||z>64&&z<91||z>47&&z<59||z===46||z===45||z===95)){if(z===32||z<14&&z>8){G("missing attribute value"),S=J;continue e}if(z===61)break;G("illegal attribute name char"),$e=!0}if(ie=j.substring(S,J),ie==="xmlns:xmlns"&&(G("illegal declaration of xmlns"),$e=!0),z=j.charCodeAt(J+1),z===34)J=j.indexOf('"',S=J+2),J===-1&&(J=j.indexOf("'",S),J!==-1&&(G("attribute value quote missmatch"),$e=!0));else if(z===39)J=j.indexOf("'",S=J+2),J===-1&&(J=j.indexOf('"',S),J!==-1&&(G("attribute value quote missmatch"),$e=!0));else for(G("missing attribute value quotes"),$e=!0,J=J+1;J<Y&&(z=j.charCodeAt(J+1),!(z===32||z<14&&z>8));J++);for(J===-1&&(G("missing closing quotes"),J=Y,$e=!0),$e||(we=j.substring(S,J)),S=J;J+1<Y&&(z=j.charCodeAt(J+1),!(z===32||z<14&&z>8));J++)S===J&&(G("illegal character after attribute end"),$e=!0);if(S=J+1,$e)continue e;if(ie in gn){G("attribute <"+ie+"> already defined");continue}if(gn[ie]=!0,!A){mt[ie]=we;continue}if(v){if(he=ie==="xmlns"?"xmlns":ie.charCodeAt(0)===120&&ie.substr(0,6)==="xmlns:"?ie.substr(6):null,he!==null){if(l=Lt(we),u=zr(he),Ke=O[l],!Ke){if(he==="xmlns"||u in C&&C[u]!==l)do Ke="ns"+D++;while(typeof C[Ke]!="undefined");else Ke=he;O[l]=Ke}C[he]!==Ke&&(ge||(C=Ql(C),ge=!0),C[he]=Ke,he==="xmlns"&&(C[zr(Ke)]=l,d=Ke),C[u]=l),mt[ie]=we;continue}E.push(ie,we);continue}if(z=ie.indexOf(":"),z===-1){mt[ie]=we;continue}if(!(m=C[ie.substring(0,z)])){G(sa(ie.substring(0,z)));continue}ie=d===m?ie.substr(z+1):m+ie.substr(z),mt[ie]=we}if(v)for(S=0,Y=E.length;S<Y;S++){if(ie=E[S++],we=E[S],z=ie.indexOf(":"),z!==-1){if(!(m=C[ie.substring(0,z)])){G(sa(ie.substring(0,z)));continue}ie=d===m?ie.substr(z+1):m+ie.substr(z)}mt[ie]=we}return re=mt}function p(){for(var l=/(\r\n|\r|\n)/g,u=0,m=0,d=0,E=I,S,j;B>=d&&(S=l.exec(g),!(!S||(E=S[0].length+S.index,E>B)));)u+=1,d=E;return B==-1?(m=E,j=g.substring(I)):I===0?j=g.substring(I,B):(m=B-d,j=I==-1?g.substring(B):g.substring(B,I+1)),{data:j,line:u,column:m}}for(y=p,t&&(x=Object.create({},{name:tr(function(){return ye}),originalName:tr(function(){return Ge}),attrs:tr(je),ns:tr(function(){return C})}));I!==-1;){if(g.charCodeAt(I)===60?B=I:B=g.indexOf("<",I),B===-1){if(b.length)return H("unexpected end of file");if(I===0)return H("missing start tag");I<g.length&&g.substring(I).trim()&&G(aa);return}if(I!==B){if(b.length){if(n&&(n(g.substring(I,B),Lt,y),L))return}else if(g.substring(I,B).trim()&&(G(aa),L))return}if(Z=g.charCodeAt(B+1),Z===33){if(ae=g.charCodeAt(B+2),ae===91&&g.substr(B+3,6)==="CDATA["){if(I=g.indexOf("]]>",B),I===-1)return H("unclosed cdata");if(o&&(o(g.substring(B+9,I),y),L))return;I+=3;continue}if(ae===45&&g.charCodeAt(B+3)===45){if(I=g.indexOf("-->",B),I===-1)return H("unclosed comment");if(c&&(c(g.substring(B+4,I),Lt,y),L))return;I+=3;continue}}if(Z===63){if(I=g.indexOf("?>",B),I===-1)return H("unclosed question");if(f&&(f(g.substring(B,I+2),y),L))return;I+=2;continue}for(K=B+1;;K++){if(Je=g.charCodeAt(K),isNaN(Je))return I=-1,H("unclosed tag");if(Je===34)ae=g.indexOf('"',K+1),K=ae!==-1?ae:K;else if(Je===39)ae=g.indexOf("'",K+1),K=ae!==-1?ae:K;else if(Je===62){I=K;break}}if(Z===33){if(h&&(h(g.substring(B,I+1),Lt,y),L))return;I+=1;continue}if(re={},Z===47){if(R=!1,F=!0,!b.length)return H("missing open tag");if(K=ye=b.pop(),ae=B+2+K.length,g.substring(B+2,ae)!==K)return H("closing tag mismatch");for(;ae<I;ae++)if(Z=g.charCodeAt(ae),!(Z===32||Z>8&&Z<14))return H("close tag")}else{if(g.charCodeAt(I-1)===47?(K=ye=g.substring(B+1,I-1),R=!0,F=!0):(K=ye=g.substring(B+1,I),R=!0,F=!1),!(Z>96&&Z<123||Z>64&&Z<91||Z===95||Z===58))return H("illegal first char nodeName");for(ae=1,ot=K.length;ae<ot;ae++)if(Z=K.charCodeAt(ae),!(Z>96&&Z<123||Z>64&&Z<91||Z>47&&Z<59||Z===45||Z===95||Z==46)){if(Z===32||Z<14&&Z>8){ye=K.substring(0,ae),re=null;break}return H("invalid nodeName")}F||b.push(ye)}if(A){if(V=C,R&&(F||w.push(V),re===null&&(v=K.indexOf("xmlns",ae)!==-1)&&($=ae,_=K,je(),v=!1)),Ge=ye,Z=ye.indexOf(":"),Z!==-1){if(et=C[ye.substring(0,Z)],!et)return H("missing namespace on <"+Ge+">");ye=ye.substr(Z+1)}else et=C.xmlns;et&&(ye=et+":"+ye)}if(R&&($=ae,_=K,r&&(t?r(x,Lt,F,y):r(ye,je,Lt,F,y),L)))return;if(F){if(i&&(i(t?x:ye,Lt,R,y),L))return;A&&(R?C=V:C=w.pop())}I+=1}}}function la(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var Gr={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},ca="property";function fa(e){return e.xml&&e.xml.serialize}function tc(e){let t=fa(e);return t!==ca&&(t||null)}function nc(e){return e.charAt(0).toUpperCase()+e.slice(1)}function pa(e,t){return la(t)?e.prefix+":"+nc(e.localName):e.name}function rc(e,t){var n=e.name,r=e.localName,i=t&&t.xml&&t.xml.typePrefix;return i&&r.indexOf(i)===0?e.prefix+":"+r.slice(i.length):n}function ic(e,t,n){let r=Re(e,t.xmlns),i=`${t[r.prefix]||r.prefix}:${r.localName}`,o=Re(i);var a=n.getPackage(o.prefix);return rc(o,a)}function kt(e){return new Error(e)}function xt(e){return e.$descriptor}function oc(e){M(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw kt("expected element");var n=this.elementsById,r=xt(t),i=r.idProperty,o;if(i&&(o=t.get(i.name),o)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(o))throw new Error("illegal ID <"+o+">");if(n[o])throw kt("duplicate ID <"+o+">");n[o]=t}},this.addWarning=function(t){this.warnings.push(t)}}function mn(){}mn.prototype.handleEnd=function(){};mn.prototype.handleText=function(){};mn.prototype.handleNode=function(){};function Kr(){}Kr.prototype=Object.create(mn.prototype);Kr.prototype.handleNode=function(){return this};function Qt(){}Qt.prototype=Object.create(mn.prototype);Qt.prototype.handleText=function(e){this.body=(this.body||"")+e};function dn(e,t){this.property=e,this.context=t}dn.prototype=Object.create(Qt.prototype);dn.prototype.handleNode=function(e){if(this.element)throw kt("expected no sub nodes");return this.element=this.createReference(e),this};dn.prototype.handleEnd=function(){this.element.id=this.body};dn.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}};function Yr(e,t){this.element=t,this.propertyDesc=e}Yr.prototype=Object.create(Qt.prototype);Yr.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=er(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)};function nr(){}nr.prototype=Object.create(Qt.prototype);nr.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t};function Te(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}Te.prototype=Object.create(nr.prototype);Te.prototype.addReference=function(e){this.context.addReference(e)};Te.prototype.handleText=function(e){var t=this.element,n=xt(t),r=n.bodyProperty;if(!r)throw kt("unexpected body text <"+e+">");Qt.prototype.handleText.call(this,e)};Te.prototype.handleEnd=function(){var e=this.body,t=this.element,n=xt(t),r=n.bodyProperty;r&&e!==void 0&&(e=er(r.type,e),t.set(r.name,e))};Te.prototype.createElement=function(e){var t=e.attributes,n=this.type,r=xt(n),i=this.context,o=new n({}),a=this.model,s;return P(t,function(c,f){var h=r.propertiesByName[f],y;h&&h.isReference?h.isMany?(y=c.split(" "),P(y,function(v){i.addReference({element:o,property:h.ns.name,id:v})})):i.addReference({element:o,property:h.ns.name,id:c}):(h?c=er(h.type,c):f==="xmlns"?f=":"+f:(s=Re(f,r.ns.prefix),a.getPackage(s.prefix)&&i.addWarning({message:"unknown attribute <"+f+">",element:o,property:f,value:c})),o.set(f,c))}),o};Te.prototype.getPropertyForNode=function(e){var t=e.name,n=Re(t),r=this.type,i=this.model,o=xt(r),a=n.name,s=o.propertiesByName[a];if(s&&!s.isAttr){let f=tc(s);if(f){let h=e.attributes[f];if(h){let y=ic(h,e.ns,i),v=i.getType(y);return M({},s,{effectiveType:xt(v).name})}}return s}var c=i.getPackage(n.prefix);if(c){let f=pa(n,c),h=i.getType(f);if(s=ve(o.properties,function(y){return!y.isVirtual&&!y.isReference&&!y.isAttribute&&h.hasType(y.type)}),s)return M({},s,{effectiveType:xt(h).name})}else if(s=ve(o.properties,function(f){return!f.isReference&&!f.isAttribute&&f.type==="Element"}),s)return s;throw kt("unrecognized element <"+n.name+">")};Te.prototype.toString=function(){return"ElementDescriptor["+xt(this.type).name+"]"};Te.prototype.valueHandler=function(e,t){return new Yr(e,t)};Te.prototype.referenceHandler=function(e){return new dn(e,this.context)};Te.prototype.handler=function(e){return e==="Element"?new Zt(this.model,e,this.context):new Te(this.model,e,this.context)};Te.prototype.handleChild=function(e){var t,n,r,i;if(t=this.getPropertyForNode(e),r=this.element,n=t.effectiveType||t.type,Hr(n))return this.valueHandler(t,r);t.isReference?i=this.referenceHandler(t).handleNode(e):i=this.handler(n).handleNode(e);var o=i.element;return o!==void 0&&(t.isMany?r.get(t.name).push(o):r.set(t.name,o),t.isReference?(M(o,{element:r}),this.context.addReference(o)):o.$parent=r),i};function Xr(e,t,n){Te.call(this,e,t,n)}Xr.prototype=Object.create(Te.prototype);Xr.prototype.createElement=function(e){var t=e.name,n=Re(t),r=this.model,i=this.type,o=r.getPackage(n.prefix),a=o&&pa(n,o)||t;if(!i.hasType(a))throw kt("unexpected element <"+e.originalName+">");return Te.prototype.createElement.call(this,e)};function Zt(e,t,n){this.model=e,this.context=n}Zt.prototype=Object.create(nr.prototype);Zt.prototype.createElement=function(e){var t=e.name,n=Re(t),r=n.prefix,i=e.ns[r+"$uri"],o=e.attributes;return this.model.createAny(t,i,o)};Zt.prototype.handleChild=function(e){var t=new Zt(this.model,"Element",this.context).handleNode(e),n=this.element,r=t.element,i;return r!==void 0&&(i=n.$children=n.$children||[],i.push(r),r.$parent=n),t};Zt.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function rr(e){e instanceof Fe&&(e={model:e}),M(this,{lax:!1},e)}rr.prototype.fromXML=function(e,t,n){var r=t.rootHandler;t instanceof Te?(r=t,t={}):typeof t=="string"?(r=this.handler(t),t={}):typeof r=="string"&&(r=this.handler(r));var i=this.model,o=this.lax,a=new oc(M({},t,{rootHandler:r})),s=new Ur({proxy:!0}),c=ac();r.context=a,c.push(r);function f(w,C,V){var b=C(),D=b.line,R=b.column,F=b.data;F.charAt(0)==="<"&&F.indexOf(" ")!==-1&&(F=F.slice(0,F.indexOf(" "))+">");var B="unparsable content "+(F?F+" ":"")+`detected
H A Dbpmn-modeler.production.min.js2 (()=>{var zE=Object.create;var fc=Object.defineProperty;var GE=Object.getOwnPropertyDescriptor;var VE=Object.getOwnPropertyNames;var WE=Object.getPrototypeOf,UE=Object.prototype.hasOwnProperty;var qE=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var dc=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},KE=(e,t)=>{for(var n in t)fc(e,n,{get:t[n],enumerable:!0})},Xd=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of VE(t))!UE.call(e,i)&&i!==n&&fc(e,i,{get:()=>t[i],enumerable:!(r=GE(t,i))||r.enumerable});return e};var YE=(e,t,n)=>(n=e!=null?zE(WE(e)):{},Xd(t||!e||!e.__esModule?fc(n,"default",{value:e,enumerable:!0}):n,e)),XE=e=>Xd(fc({},"__esModule",{value:!0}),e);var em={};KE(em,{assign:()=>C,bind:()=>tt,debounce:()=>Ca,ensureArray:()=>Qd,every:()=>ln,filter:()=>Q,find:()=>re,findIndex:()=>Sa,flatten:()=>_i,forEach:()=>E,get:()=>o0,groupBy:()=>Vt,has:()=>dt,isArray:()=>q,isDefined:()=>Ue,isFunction:()=>Le,isNil:()=>Yn,isNumber:()=>ne,isObject:()=>Se,isString:()=>st,isUndefined:()=>wn,keys:()=>bi,map:()=>je,matchPattern:()=>Ct,merge:()=>Jd,omit:()=>Nt,pick:()=>mt,reduce:()=>Ge,set:()=>_l,size:()=>vl,some:()=>Lt,sortBy:()=>At,throttle:()=>i0,unionBy:()=>gl,uniqueBy:()=>mc,values:()=>Sn,without:()=>hl});function _i(e){return Array.prototype.concat.apply([],e)}function wn(e){return e===void 0}function Ue(e){return e!==void 0}function Yn(e){return e==null}function q(e){return wa.call(e)==="[object Array]"}function Se(e){return wa.call(e)==="[object Object]"}function ne(e){return wa.call(e)==="[object Number]"}function Le(e){let t=wa.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function st(e){return wa.call(e)==="[object String]"}function Qd(e){if(!q(e))throw new Error("must supply array")}function dt(e,t){return!Yn(e)&&t0.call(e,t)}function re(e,t){let n=hc(t),r;return E(e,function(i,o){if(n(i,o))return r=i,!1}),r}function Sa(e,t){let n=hc(t),r=q(e)?-1:void 0;return E(e,function(i,o){if(n(i,o))return r=o,!1}),r}function Q(e,t){let n=hc(t),r=[];return E(e,function(i,o){n(i,o)&&r.push(i)}),r}function E(e,t){let n,r;if(wn(e))return;let i=q(e)?r0:n0;for(let o in e)if(dt(e,o)&&(n=e[o],r=t(n,i(o)),r===!1))return n}function hl(e,t){if(wn(e))return[];Qd(e);let n=hc(t);return e.filter(function(r,i){return!n(r,i)})}function Ge(e,t,n){return E(e,function(r,i){n=t(n,r,i)}),n}function ln(e,t){return!!Ge(e,function(n,r,i){return n&&t(r,i)},!0)}function Lt(e,t){return!!re(e,t)}function je(e,t){let n=[];return E(e,function(r,i){n.push(t(r,i))}),n}function bi(e){return e&&Object.keys(e)||[]}function vl(e){return bi(e).length}function Sn(e){return je(e,t=>t)}function Vt(e,t,n={}){return t=yl(t),E(e,function(r){let i=t(r)||"_",o=n[i];o||(o=n[i]=[]),o.push(r)}),n}function mc(e,...t){e=yl(e);let n={};return E(t,i=>Vt(i,e,n)),je(n,function(i,o){return i[0]})}function At(e,t){t=yl(t);let n=[];return E(e,function(r,i){let o=t(r,i),a={d:o,v:r};for(var s=0;s<n.length;s++){let{d:c}=n[s];if(o<c){n.splice(s,0,a);return}}n.push(a)}),je(n,r=>r.v)}function Ct(e){return function(t){return ln(e,function(n,r){return t[r]===n})}}function yl(e){return Le(e)?e:t=>t[e]}function hc(e){return Le(e)?e:t=>t===e}function n0(e){return e}function r0(e){return Number(e)}function Ca(e,t){let n,r,i,o;function a(l){let f=Date.now(),d=l?0:o+t-f;if(d>0)return s(d);e.apply(i,r),c()}function s(l){n=setTimeout(a,l)}function c(){n&&clearTimeout(n),n=o=r=i=void 0}function u(){n&&a(!0),c()}function p(...l){o=Date.now(),r=l,i=this,n||s(t)}return p.flush=u,p.cancel=c,p}function i0(e,t){let n=!1;return function(...r){n||(e(...r),n=!0,setTimeout(()=>{n=!1},t))}}function tt(e,t){return e.bind(t)}function C(e,...t){return Object.assign(e,...t)}function _l(e,t,n){let r=e;return E(t,function(i,o){if(typeof i!="number"&&typeof i!="string")throw new Error("illegal key type: "+typeof i+". Key should be of type number or string.");if(i==="constructor")throw new Error("illegal key: constructor");if(i==="__proto__")throw new Error("illegal key: __proto__");let a=t[o+1],s=r[i];Ue(a)&&Yn(s)&&(s=r[i]=isNaN(+a)?{}:[]),wn(a)?wn(n)?delete r[i]:r[i]=n:r=s}),e}function o0(e,t,n){let r=e;return E(t,function(i){if(Yn(r))return r=void 0,!1;r=r[i]}),wn(r)?n:r}function mt(e,t){let n={},r=Object(e);return E(t,function(i){i in r&&(n[i]=e[i])}),n}function Nt(e,t){let n={},r=Object(e);return E(r,function(i,o){t.indexOf(o)===-1&&(n[o]=i)}),n}function Jd(e,...t){return t.length&&E(t,function(n){!n||!Se(n)||E(n,function(r,i){if(i==="__proto__")return;let o=e[i];Se(r)?(Se(o)||(o={}),e[i]=Jd(o,r)):e[i]=r})}),e}var wa,t0,gl,N=qE(()=>{wa=Object.prototype.toString,t0=Object.prototype.hasOwnProperty;gl=mc});var jx=dc((qee,Lx)=>{function vD(e){return["String","Boolean","Integer","Real"].includes(e)}Lx.exports=function e(t,n){let r=n.enter,i=n.leave,o=r&&r(t),a=t.$descriptor;o!==!1&&!a.isGeneric&&a.properties.filter(c=>!c.isAttr&&!c.isReference&&!vD(c.type)).forEach(c=>{if(c.name in t){let u=t[c.name];c.isMany?u.forEach(p=>{e(p,n)}):e(u,n)}}),i&&i(t)}});var Hx=dc((Kee,Fx)=>{var gD=jx(),{isArray:yD,isObject:_D,isFunction:bD}=(N(),XE(em)),_d=class{constructor({moddleRoot:t,rule:n}){this.rule=n,this.moddleRoot=t,this.messages=[],this.report=this.report.bind(this)}report(t,n,r){let i={id:t,message:n};r&&yD(r)&&(i={...i,path:r}),r&&_D(r)&&(i={...i,...r}),this.messages.push(i)}};Fx.exports=function({moddleRoot:t,rule:n}){let r=new _d({rule:n,moddleRoot:t}),i=n.check||{},o="leave"in i?i.leave:void 0,a="enter"in i?i.enter:bD(i)?i:void 0;if(!a&&!o)throw new Error("no check implemented");return gD(t,{enter:a?s=>a(s,r):void 0,leave:o?s=>o(s,r):void 0}),r.messages}});var Gx=dc((Yee,zx)=>{var xD=Hx(),ED=(e,t)=>e,wD={0:"off",1:"warn",2:"error",3:"info"},SD="rule-error";function On(e){let{config:t={},resolver:n,transformRule:r=ED}=e||{};if(typeof n=="undefined")throw new Error("must provide <options.resolver>");this.config=t,this.resolver=n,this.transformRule=r,this.cachedRules={},this.cachedConfigs={}}zx.exports=On;On.prototype.applyRule=function(t,n){let{config:r,rule:i,category:o,name:a}=n;try{return xD({moddleRoot:t,rule:i,config:r}).map(function(c){return{...c,meta:i.meta,category:o}})}catch(s){return console.error("rule <"+a+"> failed with error: ",s),[{message:s.message,category:SD}]}};On.prototype.resolveRule=function(e,t){let{pkg:n,ruleName:r}=this.parseRuleName(e),i=`${n}-${r}`,o=this.cachedRules[i];return o?Promise.resolve(o):Promise.resolve(this.resolver.resolveRule(n,r)).then(a=>{if(!a)throw new Error(`unknown rule <${e}>`);return this.cachedRules[i]=this.transformRule(a(t),{pkg:n,ruleName:r})})};On.prototype.resolveConfig=function(e){let{pkg:t,configName:n}=this.parseConfigName(e),r=`${t}-${n}`,i=this.cachedConfigs[r];return i?Promise.resolve(i):Promise.resolve(this.resolver.resolveConfig(t,n)).then(o=>{if(!o)throw new Error(`unknown config <${e}>`);return this.cachedConfigs[r]=this.normalizeConfig(o,t)})};On.prototype.resolveRules=function(e){return this.resolveConfiguredRules(e).then(t=>{let i=Object.entries(t).map(([o,a])=>{let{category:s,config:c}=this.parseRuleValue(a);return{name:o,category:s,config:c}}).filter(o=>o.category!=="off").map(o=>{let{name:a,config:s}=o;return this.resolveRule(a,s).then(function(c){return{...o,rule:c}})});return Promise.all(i)})};On.prototype.resolveConfiguredRules=function(e){let t=e.extends;return typeof t=="string"&&(t=[t]),typeof t=="undefined"&&(t=[]),Promise.all(t.map(n=>this.resolveConfig(n).then(r=>this.resolveConfiguredRules(r)))).then(n=>{let r=this.normalizeConfig(e,"bpmnlint").rules;return[...n,r].reduce((o,a)=>({...o,...a}),{})})};On.prototype.lint=function(e,t){return t=t||this.config,this.resolveRules(t).then(n=>{let r={};return n.forEach(i=>{let{name:o}=i,a=this.applyRule(e,i);a.length&&(r[o]=a)}),r})};On.prototype.parseRuleValue=function(e){let t,n;return Array.isArray(e)?(t=e[0],n=e[1]):(t=e,n={}),typeof t=="string"&&(t=t.toLowerCase()),t=wD[t]||t,{config:n,category:t}};On.prototype.parseRuleName=function(e,t="bpmnlint"){let n=/^(?:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)?([^/]+)$/.exec(e);if(!n)throw new Error(`unparseable rule name <${e}>`);let[r,i,o,a]=n;return o?{pkg:`${i?i+"/":""}${$x(o)}`,ruleName:a}:{pkg:t,ruleName:a}};On.prototype.parseConfigName=function(e){let t=/^(?:(?:plugin:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)|bpmnlint:)([^/]+)$/.exec(e);if(!t)throw new Error(`unparseable config name <${e}>`);let[n,r,i,o]=t;return i?{pkg:`${r?r+"/":""}${$x(i)}`,configName:o}:{pkg:"bpmnlint",configName:o}};On.prototype.getSimplePackageName=function(e){let t=/^(?:(@[^/]+)\/)?([^/]+)$/.exec(e);if(!t)throw new Error(`unparseable package name <${e}>`);let[n,r,i]=t;return`${r?r+"/":""}${CD(i)}`};On.prototype.normalizeConfig=function(e,t){let n=e.rules||{},r=Object.keys(n).reduce((i,o)=>{let a=n[o],{pkg:s,ruleName:c}=this.parseRuleName(o,t),u=s==="bpmnlint"?c:`${this.getSimplePackageName(s)}/${c}`;return i[u]=a,i},{});return{...e,rules:r}};function $x(e){return e==="bpmnlint"?"bpmnlint":e.startsWith("bpmnlint-plugin-")?e:`bpmnlint-plugin-${e}`}function CD(e){return e.startsWith("bpmnlint-plugin-")?e.substring(16):e}});var Wx=dc((Xee,Vx)=>{var RD=Gx();Vx.exports={Linter:RD}});function B(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function ZE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ml={exports:{}},Zd;function QE(){if(Zd)return ml.exports;Zd=1;var e=ml.exports=function(t,n){if(n||(n=16),t===void 0&&(t=128),t<=0)return"0";for(var r=Math.log(Math.pow(2,t))/Math.log(n),i=2;r===1/0;i*=2)r=Math.log(Math.pow(2,t/i))/Math.log(n)*i;for(var o=r-Math.floor(r),a="",i=0;i<Math.floor(r);i++){var s=Math.floor(Math.random()*n).toString(n);a=s+a}if(o){var c=Math.pow(n,o),s=Math.floor(Math.random()*c).toString(n);a=s+a}var u=parseInt(a,n);return u!==1/0&&u>=Math.pow(2,t)?e(t,n):a};return e.rack=function(t,n,r){var i=function(a){var s=0;do{if(s++>10)if(r)t+=r;else throw new Error("too many ID collisions, use more bits");var c=e(t,n)}while(Object.hasOwnProperty.call(o,c));return o[c]=a,c},o=i.hats={};return i.get=function(a){return i.hats[a]},i.set=function(a,s){return i.hats[a]=s,i},i.bits=t||128,i.base=n||16,i},ml.exports}var JE=QE(),e0=ZE(JE);function En(e){if(!(this instanceof En))return new En(e);e=e||[128,36,1],this._seed=e.length?e0.rack(e[0],e[1],e[2]):e}En.prototype.next=function(e){return this._seed(e||!0)};En.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n};En.prototype.claim=function(e,t){this._seed.set(e,t||!0)};En.prototype.assigned=function(e){return this._seed.get(e)||!1};En.prototype.unclaim=function(e){delete this._seed.hats[e]};En.prototype.clear=function(){var e=this._seed.hats,t;for(t in e)this.unclaim(t)};N();N();var ht={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:[0,"",""]};ht.td=ht.th=[3,"<table><tbody><tr>","</tr></tbody></table>"];ht.option=ht.optgroup=[1,'<select multiple="multiple">',"</select>"];ht.thead=ht.tbody=ht.colgroup=ht.caption=ht.tfoot=[1,"<table>","</table>"];ht.polyline=ht.ellipse=ht.polygon=ht.circle=ht.text=ht.line=ht.path=ht.rect=ht.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];function ue(e,t=globalThis.document){var u;if(typeof e!="string")throw new TypeError("String expected");let n=/^<!--(.*?)-->$/s.exec(e);if(n)return t.createComment(n[1]);let r=(u=/<([\w:]+)/.exec(e))==null?void 0:u[1];if(!r)return t.createTextNode(e);if(e=e.trim(),r==="body"){let p=t.createElement("html");p.innerHTML=e;let{lastChild:l}=p;return l.remove(),l}let[i,o,a]=Object.hasOwn(ht,r)?ht[r]:ht._default,s=t.createElement("div");for(s.innerHTML=o+e+a;i--;)s=s.lastChild;if(s.firstChild===s.lastChild){let{firstChild:p}=s;return p.remove(),p}let c=t.createDocumentFragment();return c.append(...s.childNodes),c}function a0(e,t){return t.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(r){if(r!=="default"&&!(r in e)){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}})}),Object.freeze(e)}function vt(e,...t){let n=e.style;return E(t,function(r){r&&E(r,function(i,o){n[o]=i})}),e}function nt(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}var s0=Object.prototype.toString;function Ne(e){return new Fr(e)}function Fr(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Fr.prototype.add=function(e){return this.list.add(e),this};Fr.prototype.remove=function(e){return s0.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)};Fr.prototype.removeMatching=function(e){let t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this};Fr.prototype.toggle=function(e,t){return typeof t!="undefined"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this};Fr.prototype.array=function(){return Array.from(this.list)};Fr.prototype.has=Fr.prototype.contains=function(e){return this.list.contains(e)};function Hr(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function Bn(e,t,n){var r=n?e:e.parentNode;return r&&typeof r.closest=="function"&&r.closest(t)||null}function c0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vc={},tm;function u0(){if(tm)return vc;tm=1;var e,t,n;function r(){e=window.addEventListener?"addEventListener":"attachEvent",t=window.removeEventListener?"removeEventListener":"detachEvent",n=e!=="addEventListener"?"on":""}return vc.bind=function(i,o,a,s){return e||r(),i[e](n+o,a,s||!1),a},vc.unbind=function(i,o,a,s){return t||r(),i[t](n+o,a,s||!1),a},vc}var nm=u0(),p0=c0(nm),se=a0({__proto__:null,default:p0},[nm]),rm=["focus","blur"];function l0(e,t,n,r,i){return rm.indexOf(n)!==-1&&(i=!0),se.bind(e,n,function(o){var a=o.target||o.srcElement;o.delegateTarget=Bn(a,t,!0),o.delegateTarget&&r.call(e,o)},i)}function f0(e,t,n,r){return rm.indexOf(t)!==-1&&(r=!0),se.unbind(e,t,n,r)}var bt={bind:l0,unbind:f0};function Ra(e,t){return e&&typeof e.matches=="function"&&e.matches(t)||!1}function _e(e,t){return t=t||document,t.querySelector(e)}function xi(e,t){return t=t||document,t.querySelectorAll(e)}function Wt(e){e.parentNode&&e.parentNode.removeChild(e)}function d0(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch{}return e}function sm(e,t){return t.appendChild(d0(e,t))}function J(e,t){return sm(t,e),e}var El=2,cm={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":El,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":El,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function m0(e,t){return cm[t]?e.style[t]:e.getAttributeNS(null,t)}function um(e,t,n){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=cm[r];i?(i===El&&typeof n=="number"&&(n=String(n)+"px"),e.style[r]=n):e.setAttributeNS(null,t,n)}function h0(e,t){var n=Object.keys(t),r,i;for(r=0,i;i=n[r];r++)um(e,i,t[i])}function $(e,t,n){if(typeof t=="string")if(n!==void 0)um(e,t,n);else return m0(e,t);else h0(e,t);return e}var v0=Object.prototype.toString;function pe(e){return new $r(e)}function $r(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}$r.prototype.add=function(e){return this.list.add(e),this};$r.prototype.remove=function(e){return v0.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)};$r.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};$r.prototype.toggle=function(e,t){return typeof t!="undefined"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this};$r.prototype.array=function(){return Array.from(this.list)};$r.prototype.has=$r.prototype.contains=function(e){return this.list.contains(e)};function _r(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function Sl(e){return e.cloneNode(!0)}var Cl={svg:"http://www.w3.org/2000/svg"},im='<svg xmlns="'+Cl.svg+'"';function pm(e){var t=!1;e.substring(0,4)==="<svg"?e.indexOf(Cl.svg)===-1&&(e=im+e.substring(4)):(e=im+">"+e+"</svg>",t=!0);var n=g0(e);if(!t)return n;for(var r=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)r.appendChild(i.firstChild);return r}function g0(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function U(e,t){var n;return e=e.trim(),e.charAt(0)==="<"?(n=pm(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Cl.svg,e),t&&$(n,t),n}var bl=null;function wl(){return bl===null&&(bl=U("svg")),bl}function om(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)e[r]=t[r];return e}function lm(e,t,n,r,i,o){var a=wl().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return om(a,e);case 6:return om(a,{a:e,b:t,c:n,d:r,e:i,f:o})}}function so(e){return e?wl().createSVGTransformFromMatrix(e):wl().createSVGTransform()}var am=/([&<>]{1})/g,y0=/([&<>\n\r"]{1})/g,_0={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function xl(e,t){function n(r,i){return _0[i]||i}return e.replace(t,n)}function fm(e,t){var n,r,i,o,a;switch(e.nodeType){case 3:t.push(xl(e.textContent,am));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(i=e.attributes,n=0,r=i.length;n<r;++n)o=i.item(n),t.push(" ",o.name,'="',xl(o.value,y0),'"');if(e.hasChildNodes()){for(t.push(">"),a=e.childNodes,n=0,r=a.length;n<r;++n)fm(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("<!--",xl(e.nodeValue,am),"-->");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function b0(e,t){var n=pm(t);if(_r(e),!!t){E0(n)||(n=n.documentElement);for(var r=w0(n.childNodes),i=0;i<r.length;i++)sm(r[i],e)}}function x0(e){for(var t=e.firstChild,n=[];t;)fm(t,n),t=t.nextSibling;return n.join("")}function E0(e){return e.nodeName==="#document-fragment"}function Rl(e,t){if(t!==void 0){try{b0(e,t)}catch(n){throw new Error("error parsing SVG: "+n.message)}return e}else return x0(e)}function w0(e){return Array.prototype.slice.call(e)}function Pe(e){var t=e.parentNode;return t&&t.removeChild(e),e}function S0(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function C0(e,t){var n,r;for(e.clear(),n=0;r=t[n];n++)e.appendItem(S0(e,r))}function Ei(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),C0(n,t)),n.consolidate()}var R0=/^class[ {]/;function P0(e){return R0.test(e.toString())}function Al(e){return Array.isArray(e)}function Pl(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function gc(...e){e.length===1&&Al(e[0])&&(e=e[0]),e=[...e];let t=e.pop();return t.$inject=e,t}var A0=/constructor\s*[^(]*\(\s*([^)]*)\)/m,T0=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,M0=/\/\*([^*]*)\*\//m;function D0(e){if(typeof e!="function")throw new Error(`Cannot annotate "${e}". Expected a function!`);let t=e.toString().match(P0(e)?A0:T0);if(!t)return[];let n=t[1]||t[2];return n&&n.split(",").map(r=>{let i=r.match(M0);return(i&&i[1]||r).trim()})||[]}function Tl(e,t){let n=t||{get:function(x,b){if(r.push(x),b===!1)return null;throw s(`No provider for "${x}"!`)}},r=[],i=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),a=o.injector=this,s=function(x){let b=r.join(" -> ");return r.length=0,new Error(b?`${x} (Resolving: ${b})`:x)};function c(x,b){if(!i[x]&&x.includes(".")){let R=x.split("."),A=c(R.shift());for(;R.length;)A=A[R.shift()];return A}if(Pl(o,x))return o[x];if(Pl(i,x)){if(r.indexOf(x)!==-1)throw r.push(x),s("Cannot resolve circular dependency!");return r.push(x),o[x]=i[x][0](i[x][1]),r.pop(),o[x]}return n.get(x,b)}function u(x,b){if(typeof b=="undefined"&&(b={}),typeof x!="function")if(Al(x))x=gc(x.slice());else throw s(`Cannot invoke "${x}". Expected a function!`);let A=(x.$inject||D0(x)).map(O=>Pl(b,O)?b[O]:c(O));return{fn:x,dependencies:A}}function p(x){let{fn:b,dependencies:R}=u(x),A=Function.prototype.bind.call(b,null,...R);return new A}function l(x,b,R){let{fn:A,dependencies:O}=u(x,R);return A.apply(b,O)}function f(x){return gc(b=>x.get(b))}function d(x,b){if(b&&b.length){let R=Object.create(null),A=Object.create(null),O=[],T=[],I=[],L,W,z,K;for(let ve in i)L=i[ve],b.indexOf(ve)!==-1&&(L[2]==="private"?(W=O.indexOf(L[3]),W===-1?(z=L[3].createChild([],b),K=f(z),O.push(L[3]),T.push(z),I.push(K),R[ve]=[K,ve,"private",z]):R[ve]=[I[W],ve,"private",T[W]]):R[ve]=[L[2],L[1]],A[ve]=!0),(L[2]==="factory"||L[2]==="type")&&L[1].$scope&&b.forEach(Jt=>{L[1].$scope.indexOf(Jt)!==-1&&(R[ve]=[L[2],L[1]],A[Jt]=!0)});b.forEach(ve=>{if(!A[ve])throw new Error('No provider for "'+ve+'". Cannot use provider from the parent!')}),x.unshift(R)}return new Tl(x,a)}let m={factory:l,type:p,value:function(x){return x}};function g(x,b){let R=x.__init__||[];return function(){R.forEach(A=>{typeof A=="string"?b.get(A):b.invoke(A)})}}function v(x){let b=x.__exports__;if(b){let R=x.__modules__,A=Object.keys(x).reduce((W,z)=>(z!=="__exports__"&&z!=="__modules__"&&z!=="__init__"&&z!=="__depends__"&&(W[z]=x[z]),W),Object.create(null)),O=(R||[]).concat(A),T=d(O),I=gc(function(W){return T.get(W)});b.forEach(function(W){i[W]=[I,W,"private",T]});let L=(x.__init__||[]).slice();return L.unshift(function(){T.init()}),x=Object.assign({},x,{__init__:L}),g(x,T)}return Object.keys(x).forEach(function(R){if(R==="__init__"||R==="__depends__")return;let A=x[R];if(A[2]==="private"){i[R]=A;return}let O=A[0],T=A[1];i[R]=[m[O],k0(O,T),O]}),g(x,a)}function w(x,b){return x.indexOf(b)!==-1||(x=(b.__depends__||[]).reduce(w,x),x.indexOf(b)!==-1)?x:x.concat(b)}function S(x){let b=x.reduce(w,[]).map(v),R=!1;return function(){R||(R=!0,b.forEach(A=>A()))}}this.get=c,this.invoke=l,this.instantiate=p,this.createChild=d,this.init=S(e)}function k0(e,t){return e!=="value"&&Al(t)&&(t=gc(t.slice())),t}var N0=1e3;function Cn(e,t){var n=this;t=t||N0,e.on(["render.shape","render.connection"],t,function(r,i){var o=r.type,a=i.element,s=i.gfx,c=i.attrs;if(n.canRender(a))return o==="render.shape"?n.drawShape(s,a,c):n.drawConnection(s,a,c)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(r,i){if(n.canRender(i))return r.type==="render.getShapePath"?n.getShapePath(i):n.getConnectionPath(i)})}Cn.prototype.canRender=function(e){};Cn.prototype.drawShape=function(e,t){};Cn.prototype.drawConnection=function(e,t){};Cn.prototype.getShapePath=function(e){};Cn.prototype.getConnectionPath=function(e){};N();function br(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function O0(e){return["M",e.x,e.y]}function Ml(e){return["L",e.x,e.y]}function B0(e,t,n){return["C",e.x,e.y,t.x,t.y,n.x,n.y]}function I0(e,t){let n=e.length,r=[O0(e[0])];for(let i=1;i<n;i++){let o=e[i-1],a=e[i],s=e[i+1];if(!s||!t){r.push(Ml(a));continue}let c=Math.min(t,Dl(a.x-o.x,a.y-o.y),Dl(s.x-a.x,s.y-a.y));if(!c){r.push(Ml(a));continue}let u=yc(a,o,c),p=yc(a,o,c*.5),l=yc(a,s,c),f=yc(a,s,c*.5);r.push(Ml(u)),r.push(B0(p,f,l))}return r}function yc(e,t,n){let r=t.x-e.x,i=t.y-e.y,o=Dl(r,i),a=n/o;return{x:e.x+r*a,y:e.y+i*a}}function Dl(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function Xn(e,t,n){ne(t)&&(n=t,t=null),t||(t={});let r=U("path",t);return ne(n)&&(r.dataset.cornerRadius=String(n)),Pa(r,e)}function Pa(e,t){let n=parseInt(e.dataset.cornerRadius,10)||0;return $(e,{d:br(I0(t,n))}),e}N();N();function zr(e){return Q(e,function(t){return!re(e,function(n){return n!==t&&mm(t,n)})})}function mm(e,t){if(t){if(e===t)return t;if(e.parent)return mm(e.parent,t)}}function dm(e,t,n){var r=!n||e.indexOf(t)===-1;return r&&e.push(t),r}function In(e,t,n){n=n||0,q(e)||(e=[e]),E(e,function(r,i){var o=t(r,i,n);q(o)&&o.length&&In(o,t,n+1)})}function Ta(e,t,n){var r=[],i=[];return In(e,function(o,a,s){dm(r,o,t);var c=o.children;if((n===-1||s<n)&&c&&dm(i,c,t))return c}),r}function Zn(e,t){return Ta(e,!t,-1)}function hm(e,t,n){wn(t)&&(t=!0),Se(t)&&(n=t,t=!0),n=n||{};var r=Aa(n.allShapes),i=Aa(n.allConnections),o=Aa(n.enclosedElements),a=Aa(n.enclosedConnections),s=Aa(n.topLevel,t&&Vt(e,function(p){return p.id}));function c(p){s[p.source.id]&&s[p.target.id]&&(s[p.id]=[p]),r[p.source.id]&&r[p.target.id]&&(a[p.id]=o[p.id]=p),i[p.id]=p}function u(p){if(o[p.id]=p,p.waypoints)a[p.id]=i[p.id]=p;else return r[p.id]=p,E(p.incoming,c),E(p.outgoing,c),p.children}return In(e,u),{allShapes:r,allConnections:i,topLevel:s,enclosedConnections:a,enclosedElements:o}}function Ce(e,t){t=!!t,q(e)||(e=[e]);var n,r,i,o;return E(e,function(a){var s=a;a.waypoints&&!t&&(s=Ce(a.waypoints,!0));var c=s.x,u=s.y,p=s.height||0,l=s.width||0;(c<n||n===void 0)&&(n=c),(u<r||r===void 0)&&(r=u),(c+l>i||i===void 0)&&(i=c+l),(u+p>o||o===void 0)&&(o=u+p)}),{x:n,y:r,height:o-r,width:i-n}}function wi(e,t){var n={};return E(e,function(r){var i=r;i.waypoints&&(i=Ce(i)),!ne(t.y)&&i.x>t.x&&(n[r.id]=r),!ne(t.x)&&i.y>t.y&&(n[r.id]=r),i.x>t.x&&i.y>t.y&&(ne(t.width)&&ne(t.height)&&i.width+i.x<t.width+t.x&&i.height+i.y<t.height+t.y||!ne(t.width)||!ne(t.height))&&(n[r.id]=r)}),n}function _c(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function bc(e){return!!(e&&e.isFrame)}function Aa(e,t){return C({},e||{},t||{})}var L0=1;function Qn(e,t){Cn.call(this,e,L0),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})}B(Qn,Cn);Qn.prototype.canRender=function(){return!0};Qn.prototype.drawShape=function(t,n,r){var i=U("rect");return $(i,{x:0,y:0,width:n.width||0,height:n.height||0}),bc(n)?$(i,C({},this.FRAME_STYLE,r||{})):$(i,C({},this.SHAPE_STYLE,r||{})),J(t,i),i};Qn.prototype.drawConnection=function(t,n,r){var i=Xn(n.waypoints,C({},this.CONNECTION_STYLE,r||{}));return J(t,i),i};Qn.prototype.getShapePath=function(t){var n=t.x,r=t.y,i=t.width,o=t.height,a=[["M",n,r],["l",i,0],["l",0,o],["l",-i,0],["z"]];return br(a)};Qn.prototype.getConnectionPath=function(t){var n=t.waypoints,r,i,o=[];for(r=0;i=n[r];r++)i=i.original||i,o.push([r===0?"M":"L",i.x,i.y]);return br(o)};Qn.$inject=["eventBus","styles"];N();function kl(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(n,r,i){var o=this.style(r,i);return C(o,{class:n})},this.style=function(n,r){!q(n)&&!r&&(r=n,n=[]);var i=Ge(n,function(o,a){return C(o,e[a]||{})},{});return r?C(i,r):i},this.computeStyle=function(n,r,i){return q(r)||(i=r,r=[]),t.style(r||[],C({},i,n||{}))}}var vm={__init__:["defaultRenderer"],defaultRenderer:["type",Qn],styles:["type",kl]};N();function Oe(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return n!==-1&&e.splice(n,1),n}function Ae(e,t,n){if(!(!e||!t)){typeof n!="number"&&(n=-1);var r=e.indexOf(t);if(r!==-1){if(r===n)return;if(n!==-1)e.splice(r,1);else return}n!==-1?e.splice(n,0,t):e.push(t)}}function co(e,t){return!e||!t?-1:e.indexOf(t)}N();N();function Gr(e,t){return!e||!t?-1:Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function uo(e,t,n,r){if(typeof r=="undefined"&&(r=5),!e||!t||!n)return!1;var i=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=Gr(e,t);return Math.abs(i/o)<=r}var j0=2;function en(e,t){var n=Array.from(arguments).flat();let r={x:"v",y:"h"};for(let[i,o]of Object.entries(r))if(F0(i,n))return o;return!1}function F0(e,t){let n=t[0];return ln(t,function(r){return Math.abs(n[e]-r[e])<=j0})}function Nl(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x<t.x+t.width+n&&e.y<t.y+t.height+n}function Ma(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}var H0=/,?([a-z]),?/gi,gm=parseFloat,pt=Math,Vr=pt.PI,Jn=pt.min,er=pt.max,ym=pt.pow,Ur=pt.abs,$0=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/ig,z0=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/ig,_m=Array.isArray||function(e){return e instanceof Array};function G0(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function V0(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return e.push(e.splice(n,1)[0])}function W0(e){function t(){var n=Array.prototype.slice.call(arguments,0),r=n.join("\u2400"),i=t.cache=t.cache||{},o=t.count=t.count||[];return G0(i,r)?(V0(o,r),i[r]):(o.length>=1e3&&delete i[o.shift()],o.push(r),i[r]=e(...arguments),i[r])}return t}function U0(e){if(!e)return null;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},n=[];return String(e).replace($0,function(r,i,o){var a=[],s=i.toLowerCase();for(o.replace(z0,function(c,u){u&&a.push(+u)}),s=="m"&&a.length>2&&(n.push([i,...a.splice(0,2)]),s="l",i=i=="m"?"l":"L");a.length>=t[s]&&(n.push([i,...a.splice(0,t[s])]),!!t[s]););}),n.toString=Bl,n}function q0(e){for(var t=0,n=e.length;t<n;t++){var r=e[t][0];if(typeof r=="string"&&r!==r.toUpperCase())return!1}return!0}function K0(e){for(var t=0,n=e.length;t<n;t++){var r=e[t][0];if(r!=="M"&&r!=="C")return!1}return!0}function Ol(e,t,n,r){return arguments.length===1&&(t=e.y,n=e.width,r=e.height,e=e.x),{x:e,y:t,width:n,height:r,x2:e+n,y2:t+r}}function Bl(){return this.join(",").replace(H0,"$1")}function Y0(e){for(var t=new Array(e.length),n=0,r=e.length;n<r;n++)for(var i=e[n],o=t[n]=new Array(i.length),a=0,s=i.length;a<s;a++)o[a]=i[a];return t.toString=Bl,t}function bm(e,t,n,r,i,o,a,s,c){var u=1-c,p=ym(u,3),l=ym(u,2),f=c*c,d=f*c,m=p*e+l*3*c*n+u*3*c*c*i+d*a,g=p*t+l*3*c*r+u*3*c*c*o+d*s;return{x:Ec(m),y:Ec(g)}}function xm(e){var t=tw(...e);return Ol(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function Wr(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function X0(e,t){return e=Ol(e),t=Ol(t),Wr(t,e.x,e.y)||Wr(t,e.x2,e.y)||Wr(t,e.x,e.y2)||Wr(t,e.x2,e.y2)||Wr(e,t.x,t.y)||Wr(e,t.x2,t.y)||Wr(e,t.x,t.y2)||Wr(e,t.x2,t.y2)||(e.x<t.x2&&e.x>t.x||t.x<e.x2&&t.x>e.x)&&(e.y<t.y2&&e.y>t.y||t.y<e.y2&&t.y>e.y)}function Em(e,t,n,r,i){var o=-3*t+9*n-9*r+3*i,a=e*o+6*t-12*n+6*r;return e*a-3*t+3*n}function wm(e,t,n,r,i,o,a,s,c){c==null&&(c=1),c=c>1?1:c<0?0:c;for(var u=c/2,p=12,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,m=0;m<p;m++){var g=u*l[m]+u,v=Em(g,e,n,i,a),w=Em(g,t,r,o,s),S=v*v+w*w;d+=f[m]*pt.sqrt(S)}return u*d}function Z0(e,t,n,r,i,o,a,s){if(!(er(e,n)<Jn(i,a)||Jn(e,n)>er(i,a)||er(t,r)<Jn(o,s)||Jn(t,r)>er(o,s))){var c=(e*r-t*n)*(i-a)-(e-n)*(i*s-o*a),u=(e*r-t*n)*(o-s)-(t-r)*(i*s-o*a),p=(e-n)*(o-s)-(t-r)*(i-a);if(p){var l=Ec(c/p),f=Ec(u/p),d=+l.toFixed(2),m=+f.toFixed(2);if(!(d<+Jn(e,n).toFixed(2)||d>+er(e,n).toFixed(2)||d<+Jn(i,a).toFixed(2)||d>+er(i,a).toFixed(2)||m<+Jn(t,r).toFixed(2)||m>+er(t,r).toFixed(2)||m<+Jn(o,s).toFixed(2)||m>+er(o,s).toFixed(2)))return{x:l,y:f}}}}function Ec(e){return Math.round(e*1e11)/1e11}function Q0(e,t,n){var r=xm(e),i=xm(t);if(!X0(r,i))return n?0:[];var o=wm(...e),a=wm(...t),s=Sm(e)?1:~~(o/5)||1,c=Sm(t)?1:~~(a/5)||1,u=new Array(s+1),p=new Array(c+1),l={},f=n?0:[],d,m;for(d=0;d<s+1;d++){var g=bm(...e,d/s);u[d]={x:g.x,y:g.y,t:d/s}}for(d=0;d<c+1;d++)g=bm(...t,d/c),p[d]={x:g.x,y:g.y,t:d/c};for(d=0;d<s;d++)for(m=0;m<c;m++){var v=u[d],w=u[d+1],S=p[m],x=p[m+1],b=Ur(w.x-v.x)<.01?"y":"x",R=Ur(x.x-S.x)<.01?"y":"x",A=Z0(v.x,v.y,w.x,w.y,S.x,S.y,x.x,x.y),O;if(A){if(O=A.x.toFixed(9)+"#"+A.y.toFixed(9),l[O])continue;l[O]=!0;var T=v.t+Ur((A[b]-v[b])/(w[b]-v[b]))*(w.t-v.t),I=S.t+Ur((A[R]-S[R])/(x[R]-S[R]))*(x.t-S.t);T>=0&&T<=1&&I>=0&&I<=1&&(n?f++:f.push({x:A.x,y:A.y,t1:T,t2:I}))}}return f}function Da(e,t,n){e=Rm(e),t=Rm(t);for(var r,i,o,a,s,c,u,p,l,f,d=n?0:[],m=0,g=e.length;m<g;m++){var v=e[m];if(v[0]=="M")r=s=v[1],i=c=v[2];else{v[0]=="C"?(l=[r,i,...v.slice(1)],r=l[6],i=l[7]):(l=[r,i,r,i,s,c,s,c],r=s,i=c);for(var w=0,S=t.length;w<S;w++){var x=t[w];if(x[0]=="M")o=u=x[1],a=p=x[2];else{x[0]=="C"?(f=[o,a,...x.slice(1)],o=f[6],a=f[7]):(f=[o,a,o,a,u,p,u,p],o=u,a=p);var b=Q0(l,f,n);if(n)d+=b;else{for(var R=0,A=b.length;R<A;R++)b[R].segment1=m,b[R].segment2=w,b[R].bez1=l,b[R].bez2=f;d=d.concat(b)}}}}}return d}function J0(e){return _m(e)&&_m(e[0])}function ew(e){if(q0(e))return e;var t=new Array(e.length),n=0,r=0,i=0,o=0,a=0,s;e[0][0]=="M"&&(n=+e[0][1],r=+e[0][2],i=n,o=r,a++,t[0]=["M",n,r]);for(var c,u,p=a,l=e.length;p<l;p++){if(u=e[p],s=u[0],t[p]=c=new Array(u.length),s!=s.toUpperCase())switch(c[0]=s.toUpperCase(),c[0]){case"A":c[1]=u[1],c[2]=u[2],c[3]=u[3],c[4]=u[4],c[5]=u[5],c[6]=+u[6]+n,c[7]=+u[7]+r;break;case"V":c[1]=+u[1]+r;break;case"H":c[1]=+u[1]+n;break;case"M":i=+u[1]+n,o=+u[2]+r;default:for(var f=1,d=u.length;f<d;f++)c[f]=+u[f]+(f%2?n:r)}else for(var m=0,g=u.length;m<g;m++)c[m]=u[m];switch(s=s.toUpperCase(),c[0]){case"Z":n=+i,r=+o;break;case"H":n=c[1];break;case"V":r=c[1];break;case"M":i=c[c.length-2],o=c[c.length-1];default:n=c[c.length-2],r=c[c.length-1]}}return t.toString=Bl,t}function Sm(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function xc(e,t,n,r){return[e,t,n,r,n,r]}function Cm(e,t,n,r,i,o){var a=.3333333333333333,s=2/3;return[a*e+s*n,a*t+s*r,a*i+s*n,a*o+s*r,i,o]}function Pm(e,t,n,r,i,o,a,s,c,u){var p=Vr*120/180,l=Vr/180*(+i||0),f=[],d,m=W0(function(P,_,y){var M=P*pt.cos(y)-_*pt.sin(y),D=P*pt.sin(y)+_*pt.cos(y);return{x:M,y:D}});if(u)O=u[0],T=u[1],R=u[2],A=u[3];else{d=m(e,t,-l),e=d.x,t=d.y,d=m(s,c,-l),s=d.x,c=d.y;var g=(e-s)/2,v=(t-c)/2,w=g*g/(n*n)+v*v/(r*r);w>1&&(w=pt.sqrt(w),n=w*n,r=w*r);var S=n*n,x=r*r,b=(o==a?-1:1)*pt.sqrt(Ur((S*x-S*v*v-x*g*g)/(S*v*v+x*g*g))),R=b*n*v/r+(e+s)/2,A=b*-r*g/n+(t+c)/2,O=pt.asin(((t-A)/r).toFixed(9)),T=pt.asin(((c-A)/r).toFixed(9));O=e<R?Vr-O:O,T=s<R?Vr-T:T,O<0&&(O=Vr*2+O),T<0&&(T=Vr*2+T),a&&O>T&&(O=O-Vr*2),!a&&T>O&&(T=T-Vr*2)}var I=T-O;if(Ur(I)>p){var L=T,W=s,z=c;T=O+p*(a&&T>O?1:-1),s=R+n*pt.cos(T),c=A+r*pt.sin(T),f=Pm(s,c,n,r,i,0,a,W,z,[T,L,R,A])}I=T-O;var K=pt.cos(O),ve=pt.sin(O),Jt=pt.cos(T),ke=pt.sin(T),ye=pt.tan(I/4),he=4/3*n*ye,we=4/3*r*ye,Ie=[e,t],Ze=[e+he*ve,t-we*K],H=[s+he*ke,c-we*Jt],G=[s,c];if(Ze[0]=2*Ie[0]-Ze[0],Ze[1]=2*Ie[1]-Ze[1],u)return[Ze,H,G].concat(f);f=[Ze,H,G].concat(f).join().split(",");for(var oe=[],xe=0,Gt=f.length;xe<Gt;xe++)oe[xe]=xe%2?m(f[xe-1],f[xe],l).y:m(f[xe],f[xe+1],l).x;return oe}function tw(e,t,n,r,i,o,a,s){for(var c=[],u=[[],[]],p,l,f,d,m,g,v,w,S=0;S<2;++S){if(S==0?(l=6*e-12*n+6*i,p=-3*e+9*n-9*i+3*a,f=3*n-3*e):(l=6*t-12*r+6*o,p=-3*t+9*r-9*o+3*s,f=3*r-3*t),Ur(p)<1e-12){if(Ur(l)<1e-12)continue;d=-f/l,0<d&&d<1&&c.push(d);continue}v=l*l-4*f*p,w=pt.sqrt(v),!(v<0)&&(m=(-l+w)/(2*p),0<m&&m<1&&c.push(m),g=(-l-w)/(2*p),0<g&&g<1&&c.push(g))}for(var x=c.length,b=x,R;x--;)d=c[x],R=1-d,u[0][x]=R*R*R*e+3*R*R*d*n+3*R*d*d*i+d*d*d*a,u[1][x]=R*R*R*t+3*R*R*d*r+3*R*d*d*o+d*d*d*s;return u[0][b]=e,u[1][b]=t,u[0][b+1]=a,u[1][b+1]=s,u[0].length=u[1].length=b+2,{x0:Jn(...u[0]),y0:Jn(...u[1]),x1:er(...u[0]),y1:er(...u[1])}}function Rm(e){if(J0(e)||(e=U0(e)),K0(e))return e;for(var t=Y0(ew(e)),n={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},r=function(f,d,m){var g,v;if(!f)return["C",d.x,d.y,d.x,d.y,d.x,d.y];switch(!(f[0]in{T:1,Q:1})&&(d.qx=d.qy=null),f[0]){case"M":d.X=f[1],d.Y=f[2];break;case"A":f=["C",...Pm(d.x,d.y,...f.slice(1))];break;case"S":m=="C"||m=="S"?(g=d.x*2-d.bx,v=d.y*2-d.by):(g=d.x,v=d.y),f=["C",g,v,...f.slice(1)];break;case"T":m=="Q"||m=="T"?(d.qx=d.x*2-d.qx,d.qy=d.y*2-d.qy):(d.qx=d.x,d.qy=d.y),f=["C",...Cm(d.x,d.y,d.qx,d.qy,f[1],f[2])];break;case"Q":d.qx=f[1],d.qy=f[2],f=["C",...Cm(d.x,d.y,f[1],f[2],f[3],f[4])];break;case"L":f=["C",...xc(d.x,d.y,f[1],f[2])];break;case"H":f=["C",...xc(d.x,d.y,f[1],d.y)];break;case"V":f=["C",...xc(d.x,d.y,d.x,f[1])];break;case"Z":f=["C",...xc(d.x,d.y,d.X,d.Y)];break}return f},i=function(f,d){if(f[d].length>7){f[d].shift();for(var m=f[d];m.length;)o[d]="A",f.splice(d++,0,["C",...m.splice(0,6)]);f.splice(d,1),u=t.length}},o=[],a="",s="",c=0,u=t.length;c<u;c++){t[c]&&(a=t[c][0]),a!="C"&&(o[c]=a,c&&(s=o[c-1])),t[c]=r(t[c],n,s),o[c]!="A"&&a=="C"&&(o[c]="C"),i(t,c);var p=t[c],l=p.length;n.x=p[l-2],n.y=p[l-1],n.bx=gm(p[l-4])||n.x,n.by=gm(p[l-3])||n.y}return t}N();function de(e){return Se(e)&&dt(e,"waypoints")}function ee(e){return Se(e)&&dt(e,"labelTarget")}function wc(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function Rn(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function Z(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function Si(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function nw(e){return Rn({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function rw(e){for(var t=e.waypoints,n=t.reduce(function(u,p,l){var f=t[l-1];if(f){var d=u[u.length-1],m=d&&d.endLength||0,g=ow(f,p);u.push({start:f,end:p,startLength:m,endLength:m+g,length:g})}return u},[]),r=n.reduce(function(u,p){return u+p.length},0),i=r/2,o=0,a=n[o];a.endLength<i;)a=n[++o];var s=(i-a.startLength)/a.length,c={x:a.start.x+(a.end.x-a.start.x)*s,y:a.start.y+(a.end.y-a.start.y)*s};return c}function X(e){return de(e)?rw(e):nw(e)}function He(e,t,n){n=n||0,Se(n)||(n={x:n,y:n});var r=Z(e),i=Z(t),o=r.bottom+n.y<=i.top,a=r.left-n.x>=i.right,s=r.top-n.y>=i.bottom,c=r.right+n.x<=i.left,u=o?"top":s?"bottom":null,p=c?"left":a?"right":null;return p&&u?u+"-"+p:p||u||"intersect"}function qr(e,t,n){var r=iw(e,t);return r.length===1||r.length===2&&Gr(r[0],r[1])<1?Rn(r[0]):r.length>1?(r=At(r,function(i){var o=Math.floor(i.t2*100)||1;return o=100-o,o=(o<10?"0":"")+o,i.segment2+"#"+o}),Rn(r[n?0:r.length-1])):null}function iw(e,t){return Da(e,t)}function Am(e){e=e.slice();for(var t=0,n,r,i;e[t];)n=e[t],r=e[t-1],i=e[t+1],Gr(n,i)===0||uo(r,i,n)?e.splice(t,1):t++;return e}function ow(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Sc(e,t){return Math.round(e*t)/t}function Tm(e){return ne(e)?e+"px":e}function aw(e){for(;e.parent;)e=e.parent;return e}function sw(e){e=C({},{width:"100%",height:"100%"},e);let t=e.container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),vt(n,{position:"relative",overflow:"hidden",width:Tm(e.width),height:Tm(e.height)}),t.appendChild(n),n}function Mm(e,t,n){let r=U("g");pe(r).add(t);let i=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(r,e.childNodes[i]||null),r}var cw="base",Dm=0,uw=1,pw={shape:["x","y","width","height"],connection:["waypoints"]};function le(e,t,n,r){this._eventBus=t,this._elementRegistry=r,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}le.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"];le.prototype._init=function(e){let t=this._eventBus,n=this._container=sw(e),r=this._svg=U("svg");$(r,{width:"100%",height:"100%"}),nt(r,"tabindex",0),e.autoFocus&&t.on("element.hover",()=>{this.restoreFocus()}),t.on("element.mousedown",500,o=>{this.focus()}),r.addEventListener("focusin",()=>{this._setFocused(!0)}),r.addEventListener("focusout",()=>{this._setFocused(!1)}),r.addEventListener("mouseover",()=>{this._eventBus.fire("canvas.mouseover")}),r.addEventListener("mouseout",()=>{this._eventBus.fire("canvas.mouseout")}),J(n,r);let i=this._viewport=Mm(r,"viewport");e.deferUpdate&&(this._viewboxChanged=Ca(tt(this._viewboxChanged,this),300)),t.on("diagram.init",()=>{t.fire("canvas.init",{svg:r,viewport:i})}),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)};le.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});let e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport};le.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))};le.prototype._clear=function(){this._elementRegistry.getAll().forEach(t=>{let n=_c(t);n==="root"?this.removeRootElement(t):this._removeElement(t,n)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox};le.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)};le.prototype.restoreFocus=function(){document.activeElement===document.body&&this.focus()};le.prototype.isFocused=function(){return this._focused};le.prototype.getDefaultLayer=function(){return this.getLayer(cw,Dm)};le.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),typeof t!="undefined"&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group};le.prototype._getChildIndex=function(e){return Ge(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)};le.prototype._createLayer=function(e,t){typeof t=="undefined"&&(t=uw);let n=this._getChildIndex(t);return{group:Mm(this._viewport,"layer-"+e,n),index:t,visible:!0}};le.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");let t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");let n=this._viewport,r=t.group,i=t.index;if(t.visible)return r;let o=this._getChildIndex(i);return n.insertBefore(r,n.childNodes[o]||null),t.visible=!0,r};le.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");let t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");let n=t.group;return t.visible&&(Pe(n),t.visible=!1),n};le.prototype._removeLayer=function(e){let t=this._layers[e];t&&(delete this._layers[e],Pe(t.group))};le.prototype.getActiveLayer=function(){let e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null};le.prototype.findRoot=function(e){return typeof e=="string"&&(e=this._elementRegistry.get(e)),e?(this._findPlaneForRoot(aw(e))||{}).rootElement:void 0};le.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})};le.prototype._findPlaneForRoot=function(e){return re(this._planes,function(t){return t.rootElement===e})};le.prototype.getContainer=function(){return this._container};le.prototype._updateMarker=function(e,t,n){let r;e.id||(e=this._elementRegistry.get(e)),e.markers=e.markers||new Set,r=this._elementRegistry._elements[e.id],r&&(E([r.gfx,r.secondaryGfx],function(i){i&&(n?(e.markers.add(t),pe(i).add(t)):(e.markers.delete(t),pe(i).remove(t)))}),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))};le.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)};le.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)};le.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),e.markers?e.markers.has(t):!1};le.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)};le.prototype.getRootElement=function(){let e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))};le.prototype.addRootElement=function(e){let t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});let n=e.layer="root-"+t;this._ensureValid("root",e);let r=this.getLayer(n,Dm);return this.hideLayer(n),this._addRoot(e,r),this._planes.push({rootElement:e,layer:r}),e};le.prototype.removeRootElement=function(e){if(typeof e=="string"&&(e=this._elementRegistry.get(e)),!!this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter(function(n){return n.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e};le.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e};le.prototype._removeRoot=function(e){let t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)};le.prototype._addRoot=function(e,t){let n=this._elementRegistry,r=this._eventBus;r.fire("root.add",{element:e}),n.add(e,t),r.fire("root.added",{element:e,gfx:t})};le.prototype._setRoot=function(e,t){let n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})};le.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");let n=pw[e];if(!ln(n,function(i){return typeof t[i]!="undefined"}))throw new Error("must supply { "+n.join(", ")+" } with "+e)};le.prototype._setParent=function(e,t,n){Ae(t.children,e,n),e.parent=t};le.prototype._addElement=function(e,t,n,r){n=n||this.getRootElement();let i=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),i.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,r);let a=o.create(e,t,r);return this._elementRegistry.add(t,a),o.update(e,t,a),i.fire(e+".added",{element:t,gfx:a}),t};le.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)};le.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)};le.prototype._removeElement=function(e,t){let n=this._elementRegistry,r=this._graphicsFactory,i=this._eventBus;if(e=n.get(e.id||e),!!e)return i.fire(t+".remove",{element:e}),r.remove(e),Oe(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+".removed",{element:e}),n.remove(e),e};le.prototype.removeShape=function(e){return this._removeElement(e,"shape")};le.prototype.removeConnection=function(e){return this._removeElement(e,"connection")};le.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)};le.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()};le.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})};le.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);let t=this._viewport,n=this.getSize(),r,i,o,a,s,c,u;if(e)this._changeViewbox(function(){s=Math.min(n.width/e.width,n.height/e.height);let p=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);Ei(t,p)});else return o=this._rootElement?this.getActiveLayer():null,r=o&&o.getBBox()||{},a=Ei(t),i=a?a.matrix:lm(),s=Sc(i.a,1e3),c=Sc(-i.e||0,1e3),u=Sc(-i.f||0,1e3),e=this._cachedViewbox={x:c?c/s:0,y:u?u/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:r.width||0,height:r.height||0,x:r.x||0,y:r.y||0},outer:n},e;return e};le.prototype.scroll=function(e){let t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=C({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),km(t,n)}),{x:n.e,y:n.f}};le.prototype.scrollToElement=function(e,t){let n=100;typeof e=="string"&&(e=this._elementRegistry.get(e));let r=this.findRoot(e);if(r!==this.getRootElement()&&this.setRootElement(r),r===e)return;t||(t={}),typeof t=="number"&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};let i=Ce(e),o=Z(i),a=this.viewbox(),s=this.zoom(),c,u;a.y+=t.top/s,a.x+=t.left/s,a.width-=(t.right+t.left)/s,a.height-=(t.bottom+t.top)/s;let p=Z(a);if(!(i.width<a.width&&i.height<a.height))c=i.x-a.x,u=i.y-a.y;else{let f=Math.max(0,o.right-p.right),d=Math.min(0,o.left-p.left),m=Math.max(0,o.bottom-p.bottom),g=Math.min(0,o.top-p.top);c=f||d,u=m||g}this.scroll({dx:-c*s,dy:-u*s})};le.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)}),Sc(r.a,1e3)};function km(e,t){let n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}le.prototype._fitViewport=function(e){let t=this.viewbox(),n=t.outer,r=t.inner,i,o;return r.x>=0&&r.y>=0&&r.x+r.width<=n.width&&r.y+r.height<=n.height&&!e?o={x:0,y:0,width:Math.max(r.width+r.x,n.width),height:Math.max(r.height+r.y,n.height)}:(i=Math.min(1,n.width/r.width,n.height/r.height),o={x:r.x+(e?r.width/2-n.width/i/2:0),y:r.y+(e?r.height/2-n.height/i/2:0),width:n.width/i,height:n.height/i}),this.viewbox(o),this.viewbox(!1).scale};le.prototype._setZoom=function(e,t){let n=this._svg,r=this._viewport,i=n.createSVGMatrix(),o=n.createSVGPoint(),a,s,c,u,p;c=r.getCTM();let l=c.a;return t?(a=C(o,t),s=a.matrixTransform(c.inverse()),u=i.translate(s.x,s.y).scale(1/l*e).translate(-s.x,-s.y),p=c.multiply(u)):p=i.scale(e),km(this._viewport,p),p};le.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}};le.prototype.getAbsoluteBBox=function(e){let t=this.viewbox(),n;e.waypoints?n=this.getGraphics(e).getBBox():n=e;let r=n.x*t.scale-t.x*t.scale,i=n.y*t.scale-t.y*t.scale,o=n.width*t.scale,a=n.height*t.scale;return{x:r,y:i,width:o,height:a}};le.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var po="data-element-id";function Ut(e){this._elements={},this._eventBus=e}Ut.$inject=["eventBus"];Ut.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),$(t,po,r),n&&$(n,po,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}};Ut.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&($(r.gfx,po,""),r.secondaryGfx&&$(r.secondaryGfx,po,""),delete t[n])};Ut.prototype.updateId=function(e,t){this._validateId(t),typeof e=="string"&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),r=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,r)};Ut.prototype.updateGraphics=function(e,t,n){var r=e.id||e,i=this._elements[r];return n?i.secondaryGfx=t:i.gfx=t,t&&$(t,po,r),t};Ut.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&$(e,po);var n=this._elements[t];return n&&n.element};Ut.prototype.filter=function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(n)}),t};Ut.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),r=0;r<n.length;r++){var i=n[r],o=t[i],a=o.element,s=o.gfx;if(e(a,s))return a}};Ut.prototype.getAll=function(){return this.filter(function(e){return e})};Ut.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var r=t[n],i=r.element,o=r.gfx;return e(i,o)})};Ut.prototype.getGraphics=function(e,t){var n=e.id||e,r=this._elements[n];return r&&(t?r.secondaryGfx:r.gfx)};Ut.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};N();function lw(e,t,n,r){var i=n.inverse;return Object.defineProperty(e,"remove",{value:function(o){var a=this.indexOf(o);return a!==-1&&(this.splice(a,1),t.unset(o,i,r)),o}}),Object.defineProperty(e,"contains",{value:function(o){return this.indexOf(o)!==-1}}),Object.defineProperty(e,"add",{value:function(o,a){var s=this.indexOf(o);if(typeof a=="undefined"){if(s!==-1)return;a=this.length}s!==-1&&this.splice(s,1),this.splice(a,0,o),s===-1&&t.set(o,i,r)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}function fw(e){return e.__refs_collection===!0}function dw(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)}function Nm(e,t,n){var r=lw(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:r}),r.length&&r.forEach(function(i){e.set(i,t.inverse,n)})}function mw(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(o){if(o!==i){var a=i;i=null,a&&e.unset(a,r,n),i=o,e.set(i,r,n)}}})}function fn(e,t){if(!(this instanceof fn))return new fn(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}fn.prototype.bind=function(e,t){if(typeof t=="string"){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?Nm(this,t,e):mw(this,t,e)};fn.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return fw(n)||Nm(this,t,e),n};fn.prototype.ensureBound=function(e,t){dw(e,t)||this.bind(e,t)};fn.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)};fn.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Il=new fn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Bm=new fn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Om=new fn({name:"attachers",collection:!0},{name:"host"}),Im=new fn({name:"outgoing",collection:!0},{name:"source"}),Lm=new fn({name:"incoming",collection:!0},{name:"target"});function lo(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),Il.bind(this,"parent"),Bm.bind(this,"labels"),Im.bind(this,"outgoing"),Lm.bind(this,"incoming")}function ka(){lo.call(this),Il.bind(this,"children"),Om.bind(this,"host"),Om.bind(this,"attachers")}B(ka,lo);function jm(){lo.call(this),Il.bind(this,"children")}B(jm,ka);function Fm(){ka.call(this),Bm.bind(this,"labelTarget")}B(Fm,ka);function Hm(){lo.call(this),Im.bind(this,"source"),Lm.bind(this,"target")}B(Hm,lo);var hw={connection:Hm,shape:ka,label:Fm,root:jm};function $m(e,t){var n=hw[e];if(!n)throw new Error("unknown type: <"+e+">");return C(new n,t)}function zm(e){return e instanceof lo}N();function Pn(){this._uid=12}Pn.prototype.createRoot=function(e){return this.create("root",e)};Pn.prototype.createLabel=function(e){return this.create("label",e)};Pn.prototype.createShape=function(e){return this.create("shape",e)};Pn.prototype.createConnection=function(e){return this.create("connection",e)};Pn.prototype.create=function(e,t){return t=C({},t||{}),t.id||(t.id=e+"_"+this._uid++),$m(e,t)};N();var Cc="__fn",Gm=1e3,vw=Array.prototype.slice;function jt(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}jt.prototype.on=function(e,t,n,r){if(e=q(e)?e:[e],Le(t)&&(r=n,n=t,t=Gm),!ne(t))throw new Error("priority must be a number");var i=n;r&&(i=tt(n,r),i[Cc]=n[Cc]||n);var o=this;e.forEach(function(a){o._addListener(a,{priority:t,callback:i,next:null})})};jt.prototype.once=function(e,t,n,r){var i=this;if(Le(t)&&(r=n,n=t,t=Gm),!ne(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var a=n.apply(r,arguments);return i.off(e,o),a}o[Cc]=n,this.on(e,t,o)};jt.prototype.off=function(e,t){e=q(e)?e:[e];var n=this;e.forEach(function(r){n._removeListener(r,t)})};jt.prototype.createEvent=function(e){var t=new Na;return t.init(e),t};jt.prototype.fire=function(e,t){var n,r,i,o;if(o=vw.call(arguments),typeof e=="object"&&(t=e,e=t.type),!e)throw new Error("no event type specified");if(r=this._listeners[e],!!r){t instanceof Na?n=t:n=this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{i=this._invokeListeners(n,o,r)}finally{e!==a&&(n.type=a)}return i===void 0&&n.defaultPrevented&&(i=!1),i}};jt.prototype.handleError=function(e){return this.fire("error",{error:e})===!1};jt.prototype._destroy=function(){this._listeners={}};jt.prototype._invokeListeners=function(e,t,n){for(var r;n&&!e.cancelBubble;)r=this._invokeListener(e,t,n),n=n.next;return r};jt.prototype._invokeListener=function(e,t,n){var r;if(n.callback.__isTomb)return r;try{r=gw(n.callback,t),r!==void 0&&(e.returnValue=r,e.stopPropagation()),r===!1&&e.preventDefault()}catch(i){if(!this.handleError(i))throw console.error("unhandled error in event listener",i),i}return r};jt.prototype._addListener=function(e,t){var n=this._getListeners(e),r;if(!n){this._setListeners(e,t);return}for(;n;){if(n.priority<t.priority){t.next=n,r?r.next=t:this._setListeners(e,t);return}r=n,n=n.next}r.next=t};jt.prototype._getListeners=function(e){return this._listeners[e]};jt.prototype._setListeners=function(e,t){this._listeners[e]=t};jt.prototype._removeListener=function(e,t){var n=this._getListeners(e),r,i,o;if(!t){this._setListeners(e,null);return}for(;n;)r=n.next,o=n.callback,(o===t||o[Cc]===t)&&(i?i.next=r:this._setListeners(e,r)),i=n,n=r};function Na(){}Na.prototype.stopPropagation=function(){this.cancelBubble=!0};Na.prototype.preventDefault=function(){this.defaultPrevented=!0};Na.prototype.init=function(e){C(this,e||{})};function gw(e,t){return e.apply(null,t)}N();function Ln(e){return e.childNodes[0]}function Vm(e){return e.parentNode.childNodes[1]}function fo(e,t,n,r,i){var o=so();o.setTranslate(t,n);var a=so();a.setRotate(r||0,0,0);var s=so();s.setScale(i||1,i||1),Ei(e,[o,a,s])}function Fe(e,t,n){var r=so();r.setTranslate(t,n),Ei(e,r)}function Rc(e,t){var n=so();n.setRotate(t,0,0),Ei(e,n)}function qt(e,t){this._eventBus=e,this._elementRegistry=t}qt.$inject=["eventBus","elementRegistry"];qt.prototype._getChildrenContainer=function(e){var t=this._elementRegistry.getGraphics(e),n;return e.parent?(n=Vm(t),n||(n=U("g"),pe(n).add("djs-children"),J(t.parentNode,n))):n=t,n};qt.prototype._clear=function(e){var t=Ln(e);return Hr(t),t};qt.prototype._createContainer=function(e,t,n,r){var i=U("g");pe(i).add("djs-group"),typeof n!="undefined"?Wm(i,t,t.childNodes[n]):J(t,i);var o=U("g");pe(o).add("djs-element"),pe(o).add("djs-"+e),r&&pe(o).add("djs-frame"),J(i,o);var a=U("g");return pe(a).add("djs-visual"),J(o,a),o};qt.prototype.create=function(e,t,n){var r=this._getChildrenContainer(t.parent);return this._createContainer(e,r,n,bc(t))};qt.prototype.updateContainments=function(e){var t=this,n=this._elementRegistry,r;r=Ge(e,function(i,o){return o.parent&&(i[o.parent.id]=o.parent),i},{}),E(r,function(i){var o=i.children;if(o){var a=t._getChildrenContainer(i);E(o.slice().reverse(),function(s){var c=n.getGraphics(s);Wm(c.parentNode,a)})}})};qt.prototype.drawShape=function(e,t,n={}){var r=this._eventBus;return r.fire("render.shape",{gfx:e,element:t,attrs:n})};qt.prototype.getShapePath=function(e){var t=this._eventBus;return t.fire("render.getShapePath",e)};qt.prototype.drawConnection=function(e,t,n={}){var r=this._eventBus;return r.fire("render.connection",{gfx:e,element:t,attrs:n})};qt.prototype.getConnectionPath=function(e){var t=this._eventBus;return t.fire("render.getConnectionPath",e)};qt.prototype.update=function(e,t,n){if(t.parent){var r=this._clear(n);if(e==="shape")this.drawShape(r,t),Fe(n,t.x,t.y);else if(e==="connection")this.drawConnection(r,t);else throw new Error("unknown type: "+e);t.hidden?$(n,"display","none"):$(n,"display","block")}};qt.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);Pe(t.parentNode)};function Wm(e,t,n){var r=n||t.firstChild;e!==r&&t.insertBefore(e,r)}var Um={__depends__:[vm],__init__:["canvas"],canvas:["type",le],elementRegistry:["type",Ut],elementFactory:["type",Pn],eventBus:["type",jt],graphicsFactory:["type",qt]};function yw(e){var t=new Tl(e);return t.init(),t}function _w(e){e=e||{};var t={config:["value",e]},n=[t,Um].concat(e.modules||[]);return yw(n)}function tr(e,t){this._injector=t||_w(e),this.get("eventBus").fire("diagram.init")}tr.prototype.get=function(e,t){return this._injector.get(e,t)};tr.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)};tr.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")};tr.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};N();N();function Fl(){}Fl.prototype.get=function(e){return this.$model.properties.get(this,e)};Fl.prototype.set=function(e,t){this.$model.properties.set(this,e,t)};function Km(e,t){this.model=e,this.properties=t}Km.prototype.createType=function(e){var t=this.model,n=this.properties,r=Object.create(Fl.prototype);E(e.properties,function(a){!a.isMany&&a.default!==void 0&&(r[a.name]=a.default)}),n.defineModel(r,t),n.defineDescriptor(r,e);var i=e.ns.name;function o(a){n.define(this,"$type",{value:i,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),E(a,tt(function(s,c){this.set(c,s)},this))}return o.prototype=r,o.hasType=r.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var bw={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Ym={String:function(e){return e},Boolean:function(e){return e==="true"},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function Pc(e,t){var n=Ym[e];return n?n(t):t}function Ll(e){return!!bw[e]}function Hl(e){return!!Ym[e]}function Tt(e,t){var n=e.split(/:/),r,i;if(n.length===1)r=e,i=t;else if(n.length===2)r=n[1],i=n[0];else throw new Error("expected <prefix:localName> or <localName>, got "+e);return e=(i?i+":":"")+r,{name:e,prefix:i,localName:r}}function dn(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}dn.prototype.build=function(){return mt(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])};dn.prototype.addProperty=function(e,t,n){typeof t=="boolean"&&(n=t,t=void 0),this.addNamedProperty(e,n!==!1);var r=this.properties;t!==void 0?r.splice(t,0,e):r.push(e)};dn.prototype.replaceProperty=function(e,t,n){var r=e.ns,i=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var s=i.indexOf(e);if(s===-1)throw new Error("property <"+r.name+"> not found in property list");i.splice(s,1),this.addProperty(t,n?void 0:s,a),o[r.name]=o[r.localName]=t};dn.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,i=t.split("#"),o=Tt(i[0],r),a=Tt(i[1],o.prefix).name,s=this.propertiesByName[a];if(s)this.replaceProperty(s,e,n);else throw new Error("refined property <"+a+"> not found");delete e.redefines};dn.prototype.addNamedProperty=function(e,t){var n=e.ns,r=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),r[n.name]=r[n.localName]=e};dn.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]};dn.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e};dn.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e};dn.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)};dn.prototype.assertNotDefined=function(e,t){var n=e.name,r=this.propertiesByName[n];if(r)throw new Error("property <"+n+"> already defined; override of <"+r.definedBy.ns.name+"#"+r.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")};dn.prototype.hasProperty=function(e){return this.propertiesByName[e]};dn.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,r=this.allTypes,i=e.name;i in n||(E(e.properties,tt(function(o){o=C({},o,{name:o.ns.localName,inherited:t}),Object.defineProperty(o,"definedBy",{value:e});var a=o.replaces,s=o.redefines;a||s?this.redefineProperty(o,a||s,a):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),r.push(e),n[i]=e)};function Kr(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,E(e,tt(this.registerPackage,this))}Kr.prototype.getPackage=function(e){return this.packageMap[e]};Kr.prototype.getPackages=function(){return this.packages};Kr.prototype.registerPackage=function(e){e=C({},e);var t=this.packageMap;qm(t,e,"prefix"),qm(t,e,"uri"),E(e.types,tt(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)};Kr.prototype.registerType=function(e,t){e=C({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:C(e.meta||{})});var n=Tt(e.name,t.prefix),r=n.name,i={};E(e.properties,tt(function(o){var a=Tt(o.name,n.prefix),s=a.name;Ll(o.type)||(o.type=Tt(o.type,a.prefix).name),C(o,{ns:a,name:s}),i[s]=o},this)),C(e,{ns:n,name:r,propertiesByName:i}),E(e.extends,tt(function(o){var a=Tt(o,n.prefix),s=this.typeMap[a.name];s.traits=s.traits||[],s.traits.push(r)},this)),this.definePackage(e,t),this.typeMap[r]=e};Kr.prototype.mapTypes=function(e,t,n){var r=Ll(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(c,u){var p=Tt(c,Ll(c)?"":e.prefix);i.mapTypes(p,t,u)}function a(c){return o(c,!0)}function s(c){return o(c,!1)}if(!r)throw new Error("unknown type <"+e.name+">");E(r.superClass,n?a:s),t(r,!n),E(r.traits,a)};Kr.prototype.getEffectiveDescriptor=function(e){var t=Tt(e),n=new dn(t);this.mapTypes(t,function(i,o){n.addTrait(i,o)});var r=n.build();return this.definePackage(r,r.allTypes[r.allTypes.length-1].$pkg),r};Kr.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};function qm(e,t,n){var r=t[n];if(r in e)throw new Error("package with "+n+" <"+r+"> already defined")}function Ci(e){this.model=e}Ci.prototype.set=function(e,t,n){if(!st(t)||!t.length)throw new TypeError("property name must be a non-empty string");var r=this.getProperty(e,t),i=r&&r.name;xw(n)?r?delete e[i]:delete e.$attrs[jl(t)]:r?i in e?e[i]=n:Xm(e,r,n):e.$attrs[jl(t)]=n};Ci.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[jl(t)];var r=n.name;return!e[r]&&n.isMany&&Xm(e,n,[]),e[r]};Ci.prototype.define=function(e,t,n){if(!n.writable){var r=n.value;n=C({},n,{get:function(){return r}}),delete n.value}Object.defineProperty(e,t,n)};Ci.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})};Ci.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})};Ci.prototype.getProperty=function(e,t){var n=this.model,r=n.getPropertyDescriptor(e,t);if(r)return r;if(t.includes(":"))return null;let i=n.config.strict;if(typeof i!="undefined"){let o=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(i)throw o;typeof console!="undefined"&&console.warn(o)}return null};function xw(e){return typeof e=="undefined"}function Xm(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function jl(e){return e.replace(/^:/,"")}function tn(e,t={}){this.properties=new Ci(this),this.factory=new Km(this,this.properties),this.registry=new Kr(e,this.properties),this.typeCache={},this.config=t}tn.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)};tn.prototype.getType=function(e){var t=this.typeCache,n=st(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r};tn.prototype.createAny=function(e,t,n){var r=Tt(e),i={$type:e,$instanceOf:function(a){return a===this.$type},get:function(a){return this[a]},set:function(a,s){_l(this,[a],s)}},o={name:e,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:t}};return this.properties.defineDescriptor(i,o),this.properties.defineModel(i,this),this.properties.define(i,"get",{enumerable:!1,writable:!0}),this.properties.define(i,"set",{enumerable:!1,writable:!0}),this.properties.define(i,"$parent",{enumerable:!1,writable:!0}),this.properties.define(i,"$instanceOf",{enumerable:!1,writable:!0}),E(n,function(a,s){Se(a)&&a.value!==void 0?i[a.name]=a.value:i[s]=a}),i};tn.prototype.getPackage=function(e){return this.registry.getPackage(e)};tn.prototype.getPackages=function(){return this.registry.getPackages()};tn.prototype.getElementDescriptor=function(e){return e.$descriptor};tn.prototype.hasType=function(e,t){t===void 0&&(t=e,e=this);var n=e.$model.getElementDescriptor(e);return t in n.allTypesByName};tn.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]};tn.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};N();var Zm=String.fromCharCode,Ew=Object.prototype.hasOwnProperty,ww=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,Oa={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(Oa).forEach(function(e){Oa[e.toUpperCase()]=Oa[e]});function Sw(e,t,n,r){return r?Ew.call(Oa,r)?Oa[r]:"&"+r+";":Zm(t||parseInt(n,16))}function Ri(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(ww,Sw):e}var Qm="non-whitespace outside of root node";function mo(e){return new Error(e)}function Jm(e){return"missing namespace for prefix <"+e+">"}function Ac(e){return{get:e,enumerable:!0}}function Cw(e){var t={},n;for(n in e)t[n]=e[n];return t}function $l(e){return e+"$uri"}function Rw(e){var t={},n,r;for(n in e)r=e[n],t[r]=r,t[$l(r)]=n;return t}function eh(){return{line:0,column:0}}function Pw(e){throw e}function zl(e){if(!this)return new zl(e);var t=e&&e.proxy,n,r,i,o,a=Pw,s,c,u,p,l=eh,f=!1,d=!1,m=null,g=!1,v;function w(b){b instanceof Error||(b=mo(b)),m=b,a(b,l)}function S(b){s&&(b instanceof Error||(b=mo(b)),s(b,l))}this.on=function(b,R){if(typeof R!="function")throw mo("required args <name, cb>");switch(b){case"openTag":r=R;break;case"text":n=R;break;case"closeTag":i=R;break;case"error":a=R;break;case"warn":s=R;break;case"cdata":o=R;break;case"attention":p=R;break;case"question":u=R;break;case"comment":c=R;break;default:throw mo("unsupported event: "+b)}return this},this.ns=function(b){if(typeof b=="undefined"&&(b={}),typeof b!="object")throw mo("required args <nsMap={}>");var R={},A;for(A in b)R[A]=b[A];return d=!0,v=R,this},this.parse=function(b){if(typeof b!="string")throw mo("required args <xml=string>");return m=null,x(b),l=eh,g=!1,m},this.stop=function(){g=!0};function x(b){var R=d?[]:null,A=d?Rw(v):null,O,T=[],I=0,L=!1,W=!1,z=0,K=0,ve,Jt,ke,ye,he,we,Ie,Ze,H,G="",oe=0,xe;function Gt(){if(xe!==null)return xe;var _,y,M,D=d&&A.xmlns,F=d&&f?[]:null,V=oe,ae=G,be=ae.length,ft,at,St,xn,Be,yr={},lc={},pn,me,Te;e:for(;V<be;V++)if(pn=!1,me=ae.charCodeAt(V),!(me===32||me<14&&me>8)){for((me<65||me>122||me>90&&me<97)&&me!==95&&me!==58&&(S("illegal first char attribute name"),pn=!0),Te=V+1;Te<be;Te++)if(me=ae.charCodeAt(Te),!(me>96&&me<123||me>64&&me<91||me>47&&me<59||me===46||me===45||me===95)){if(me===32||me<14&&me>8){S("missing attribute value"),V=Te;continue e}if(me===61)break;S("illegal attribute name char"),pn=!0}if(Be=ae.substring(V,Te),Be==="xmlns:xmlns"&&(S("illegal declaration of xmlns"),pn=!0),me=ae.charCodeAt(Te+1),me===34)Te=ae.indexOf('"',V=Te+2),Te===-1&&(Te=ae.indexOf("'",V),Te!==-1&&(S("attribute value quote missmatch"),pn=!0));else if(me===39)Te=ae.indexOf("'",V=Te+2),Te===-1&&(Te=ae.indexOf('"',V),Te!==-1&&(S("attribute value quote missmatch"),pn=!0));else for(S("missing attribute value quotes"),pn=!0,Te=Te+1;Te<be&&(me=ae.charCodeAt(Te+1),!(me===32||me<14&&me>8));Te++);for(Te===-1&&(S("missing closing quotes"),Te=be,pn=!0),pn||(St=ae.substring(V,Te)),V=Te;Te+1<be&&(me=ae.charCodeAt(Te+1),!(me===32||me<14&&me>8));Te++)V===Te&&(S("illegal character after attribute end"),pn=!0);if(V=Te+1,pn)continue e;if(Be in lc){S("attribute <"+Be+"> already defined");continue}if(lc[Be]=!0,!d){yr[Be]=St;continue}if(f){if(at=Be==="xmlns"?"xmlns":Be.charCodeAt(0)===120&&Be.substr(0,6)==="xmlns:"?Be.substr(6):null,at!==null){if(_=Ri(St),y=$l(at),xn=v[_],!xn){if(at==="xmlns"||y in A&&A[y]!==_)do xn="ns"+I++;while(typeof A[xn]!="undefined");else xn=at;v[_]=xn}A[at]!==xn&&(ft||(A=Cw(A),ft=!0),A[at]=xn,at==="xmlns"&&(A[$l(xn)]=_,D=xn),A[y]=_),yr[Be]=St;continue}F.push(Be,St);continue}if(me=Be.indexOf(":"),me===-1){yr[Be]=St;continue}if(!(M=A[Be.substring(0,me)])){S(Jm(Be.substring(0,me)));continue}Be=D===M?Be.substr(me+1):M+Be.substr(me),yr[Be]=St}if(f)for(V=0,be=F.length;V<be;V++){if(Be=F[V++],St=F[V],me=Be.indexOf(":"),me!==-1){if(!(M=A[Be.substring(0,me)])){S(Jm(Be.substring(0,me)));continue}Be=D===M?Be.substr(me+1):M+Be.substr(me)}yr[Be]=St}return xe=yr}function P(){for(var _=/(\r\n|\r|\n)/g,y=0,M=0,D=0,F=K,V,ae;z>=D&&(V=_.exec(b),!(!V||(F=V[0].length+V.index,F>z)));)y+=1,D=F;return z==-1?(M=F,ae=b.substring(K)):K===0?ae=b.substring(K,z):(M=z-D,ae=K==-1?b.substring(z):b.substring(z,K+1)),{data:ae,line:y,column:M}}for(l=P,t&&(H=Object.create({},{name:Ac(function(){return Ie}),originalName:Ac(function(){return Ze}),attrs:Ac(Gt),ns:Ac(function(){return A})}));K!==-1;){if(b.charCodeAt(K)===60?z=K:z=b.indexOf("<",K),z===-1){if(T.length)return w("unexpected end of file");if(K===0)return w("missing start tag");K<b.length&&b.substring(K).trim()&&S(Qm);return}if(K!==z){if(T.length){if(n&&(n(b.substring(K,z),Ri,l),g))return}else if(b.substring(K,z).trim()&&(S(Qm),g))return}if(ye=b.charCodeAt(z+1),ye===33){if(ke=b.charCodeAt(z+2),ke===91&&b.substr(z+3,6)==="CDATA["){if(K=b.indexOf("]]>",z),K===-1)return w("unclosed cdata");if(o&&(o(b.substring(z+9,K),l),g))return;K+=3;continue}if(ke===45&&b.charCodeAt(z+3)===45){if(K=b.indexOf("-->",z),K===-1)return w("unclosed comment");if(c&&(c(b.substring(z+4,K),Ri,l),g))return;K+=3;continue}}if(ye===63){if(K=b.indexOf("?>",z),K===-1)return w("unclosed question");if(u&&(u(b.substring(z,K+2),l),g))return;K+=2;continue}for(ve=z+1;;ve++){if(he=b.charCodeAt(ve),isNaN(he))return K=-1,w("unclosed tag");if(he===34)ke=b.indexOf('"',ve+1),ve=ke!==-1?ke:ve;else if(he===39)ke=b.indexOf("'",ve+1),ve=ke!==-1?ke:ve;else if(he===62){K=ve;break}}if(ye===33){if(p&&(p(b.substring(z,K+1),Ri,l),g))return;K+=1;continue}if(xe={},ye===47){if(L=!1,W=!0,!T.length)return w("missing open tag");if(ve=Ie=T.pop(),ke=z+2+ve.length,b.substring(z+2,ke)!==ve)return w("closing tag mismatch");for(;ke<K;ke++)if(ye=b.charCodeAt(ke),!(ye===32||ye>8&&ye<14))return w("close tag")}else{if(b.charCodeAt(K-1)===47?(ve=Ie=b.substring(z+1,K-1),L=!0,W=!0):(ve=Ie=b.substring(z+1,K),L=!0,W=!1),!(ye>96&&ye<123||ye>64&&ye<91||ye===95||ye===58))return w("illegal first char nodeName");for(ke=1,Jt=ve.length;ke<Jt;ke++)if(ye=ve.charCodeAt(ke),!(ye>96&&ye<123||ye>64&&ye<91||ye>47&&ye<59||ye===45||ye===95||ye==46)){if(ye===32||ye<14&&ye>8){Ie=ve.substring(0,ke),xe=null;break}return w("invalid nodeName")}W||T.push(Ie)}if(d){if(O=A,L&&(W||R.push(O),xe===null&&(f=ve.indexOf("xmlns",ke)!==-1)&&(oe=ke,G=ve,Gt(),f=!1)),Ze=Ie,ye=Ie.indexOf(":"),ye!==-1){if(we=A[Ie.substring(0,ye)],!we)return w("missing namespace on <"+Ze+">");Ie=Ie.substr(ye+1)}else we=A.xmlns;we&&(Ie=we+":"+Ie)}if(L&&(oe=ke,G=ve,r&&(t?r(H,Ri,W,l):r(Ie,Gt,Ri,W,l),g)))return;if(W){if(i&&(i(t?H:Ie,Ri,L,l),g))return;d&&(L?A=O:A=R.pop())}K+=1}}}function th(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var Gl={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},nh="property";function rh(e){return e.xml&&e.xml.serialize}function Aw(e){let t=rh(e);return t!==nh&&(t||null)}function Tw(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ih(e,t){return th(t)?e.prefix+":"+Tw(e.localName):e.name}function Mw(e,t){var n=e.name,r=e.localName,i=t&&t.xml&&t.xml.typePrefix;return i&&r.indexOf(i)===0?e.prefix+":"+r.slice(i.length):n}function Dw(e,t,n){let r=Tt(e,t.xmlns),i=`${t[r.prefix]||r.prefix}:${r.localName}`,o=Tt(i);var a=n.getPackage(o.prefix);return Mw(o,a)}function Yr(e){return new Error(e)}function xr(e){return e.$descriptor}function kw(e){C(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw Yr("expected element");var n=this.elementsById,r=xr(t),i=r.idProperty,o;if(i&&(o=t.get(i.name),o)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(o))throw new Error("illegal ID <"+o+">");if(n[o])throw Yr("duplicate ID <"+o+">");n[o]=t}},this.addWarning=function(t){this.warnings.push(t)}}function Ba(){}Ba.prototype.handleEnd=function(){};Ba.prototype.handleText=function(){};Ba.prototype.handleNode=function(){};function Vl(){}Vl.prototype=Object.create(Ba.prototype);Vl.prototype.handleNode=function(){return this};function vo(){}vo.prototype=Object.create(Ba.prototype);vo.prototype.handleText=function(e){this.body=(this.body||"")+e};function Ia(e,t){this.property=e,this.context=t}Ia.prototype=Object.create(vo.prototype);Ia.prototype.handleNode=function(e){if(this.element)throw Yr("expected no sub nodes");return this.element=this.createReference(e),this};Ia.prototype.handleEnd=function(){this.element.id=this.body};Ia.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}};function Wl(e,t){this.element=t,this.propertyDesc=e}Wl.prototype=Object.create(vo.prototype);Wl.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=Pc(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)};function Tc(){}Tc.prototype=Object.create(vo.prototype);Tc.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t};function Ft(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}Ft.prototype=Object.create(Tc.prototype);Ft.prototype.addReference=function(e){this.context.addReference(e)};Ft.prototype.handleText=function(e){var t=this.element,n=xr(t),r=n.bodyProperty;if(!r)throw Yr("unexpected body text <"+e+">");vo.prototype.handleText.call(this,e)};Ft.prototype.handleEnd=function(){var e=this.body,t=this.element,n=xr(t),r=n.bodyProperty;r&&e!==void 0&&(e=Pc(r.type,e),t.set(r.name,e))};Ft.prototype.createElement=function(e){var t=e.attributes,n=this.type,r=xr(n),i=this.context,o=new n({}),a=this.model,s;return E(t,function(c,u){var p=r.propertiesByName[u],l;p&&p.isReference?p.isMany?(l=c.split(" "),E(l,function(f){i.addReference({element:o,property:p.ns.name,id:f})})):i.addReference({element:o,property:p.ns.name,id:c}):(p?c=Pc(p.type,c):u==="xmlns"?u=":"+u:(s=Tt(u,r.ns.prefix),a.getPackage(s.prefix)&&i.addWarning({message:"unknown attribute <"+u+">",element:o,property:u,value:c})),o.set(u,c))}),o};Ft.prototype.getPropertyForNode=function(e){var t=e.name,n=Tt(t),r=this.type,i=this.model,o=xr(r),a=n.name,s=o.propertiesByName[a];if(s&&!s.isAttr){let u=Aw(s);if(u){let p=e.attributes[u];if(p){let l=Dw(p,e.ns,i),f=i.getType(l);return C({},s,{effectiveType:xr(f).name})}}return s}var c=i.getPackage(n.prefix);if(c){let u=ih(n,c),p=i.getType(u);if(s=re(o.properties,function(l){return!l.isVirtual&&!l.isReference&&!l.isAttribute&&p.hasType(l.type)}),s)return C({},s,{effectiveType:xr(p).name})}else if(s=re(o.properties,function(u){return!u.isReference&&!u.isAttribute&&u.type==="Element"}),s)return s;throw Yr("unrecognized element <"+n.name+">")};Ft.prototype.toString=function(){return"ElementDescriptor["+xr(this.type).name+"]"};Ft.prototype.valueHandler=function(e,t){return new Wl(e,t)};Ft.prototype.referenceHandler=function(e){return new Ia(e,this.context)};Ft.prototype.handler=function(e){return e==="Element"?new ho(this.model,e,this.context):new Ft(this.model,e,this.context)};Ft.prototype.handleChild=function(e){var t,n,r,i;if(t=this.getPropertyForNode(e),r=this.element,n=t.effectiveType||t.type,Hl(n))return this.valueHandler(t,r);t.isReference?i=this.referenceHandler(t).handleNode(e):i=this.handler(n).handleNode(e);var o=i.element;return o!==void 0&&(t.isMany?r.get(t.name).push(o):r.set(t.name,o),t.isReference?(C(o,{element:r}),this.context.addReference(o)):o.$parent=r),i};function Ul(e,t,n){Ft.call(this,e,t,n)}Ul.prototype=Object.create(Ft.prototype);Ul.prototype.createElement=function(e){var t=e.name,n=Tt(t),r=this.model,i=this.type,o=r.getPackage(n.prefix),a=o&&ih(n,o)||t;if(!i.hasType(a))throw Yr("unexpected element <"+e.originalName+">");return Ft.prototype.createElement.call(this,e)};function ho(e,t,n){this.model=e,this.context=n}ho.prototype=Object.create(Tc.prototype);ho.prototype.createElement=function(e){var t=e.name,n=Tt(t),r=n.prefix,i=e.ns[r+"$uri"],o=e.attributes;return this.model.createAny(t,i,o)};ho.prototype.handleChild=function(e){var t=new ho(this.model,"Element",this.context).handleNode(e),n=this.element,r=t.element,i;return r!==void 0&&(i=n.$children=n.$children||[],i.push(r),r.$parent=n),t};ho.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function Mc(e){e instanceof tn&&(e={model:e}),C(this,{lax:!1},e)}Mc.prototype.fromXML=function(e,t,n){var r=t.rootHandler;t instanceof Ft?(r=t,t={}):typeof t=="string"?(r=this.handler(t),t={}):typeof r=="string"&&(r=this.handler(r));var i=this.model,o=this.lax,a=new kw(C({},t,{rootHandler:r})),s=new zl({proxy:!0}),c=Nw();r.context=a,c.push(r);function u(R,A,O){var T=A(),I=T.line,L=T.column,W=T.data;W.charAt(0)==="<"&&W.indexOf(" ")!==-1&&(W=W.slice(0,W.indexOf(" "))+">");var z="unparsable content "+(W?W+" ":"")+`detected
/plugin/bpmnio/vendor/dmn-js/dist/
H A Ddmn-viewer.production.min.js8 */var kC=/["'&<>]/;Ng.exports=CC;function CC(n){var e=""+n,t=kC.exec(e);if(!t)return e;var i,r="",s=0,o=0;for(s=t.index;s<e.length;s++){switch(e.charCodeAt(s)){case 34:i="&quot;";break;case 38:i="&amp;";break;case 39:i="&#39;";break;case 60:i="&lt;";break;case 62:i="&gt;";break;default:continue}o!==s&&(r+=e.substring(o,s)),o=s+1,r+=i}return o!==s?r+e.substring(o,s):r}});var Cs=Object.prototype.toString,Db=Object.prototype.hasOwnProperty;function fa(n){return n===void 0}function ht(n){return n!==void 0}function ha(n){return n==null}function _e(n){return Cs.call(n)==="[object Array]"}function dt(n){return Cs.call(n)==="[object Object]"}function Ce(n){return Cs.call(n)==="[object Number]"}function Ie(n){let e=Cs.call(n);return e==="[object Function]"||e==="[object AsyncFunction]"||e==="[object GeneratorFunction]"||e==="[object AsyncGeneratorFunction]"||e==="[object Proxy]"}function tt(n){return Cs.call(n)==="[object String]"}function Ss(n,e){return!ha(n)&&Db.call(n,e)}function we(n,e){let t=Sc(e),i;return B(n,function(r,s){if(t(r,s))return i=r,!1}),i}function Qd(n,e){let t=Sc(e),i=_e(n)?-1:void 0;return B(n,function(r,s){if(t(r,s))return i=s,!1}),i}function Qn(n,e){let t=Sc(e),i=[];return B(n,function(r,s){t(r,s)&&i.push(r)}),i}function B(n,e){let t,i;if(fa(n))return;let r=_e(n)?Ib:Bb;for(let s in n)if(Ss(n,s)&&(t=n[s],i=e(t,r(s)),i===!1))return t}function wt(n,e,t){return B(n,function(i,r){t=e(t,i,r)}),t}function Es(n,e){return!!wt(n,function(t,i,r){return t&&e(i,r)},!0)}function zd(n,e){let t=[];return B(n,function(i,r){t.push(e(i,r))}),t}function Cc(n){return function(e){return Es(n,function(t,i){return e[i]===t})}}function Sc(n){return Ie(n)?n:e=>e===n}function Bb(n){return n}function Ib(n){return Number(n)}function Gi(n,e){let t,i,r,s;function o(f){let h=Date.now(),d=f?0:s+e-h;if(d>0)return a(d);n.apply(r,i),l()}function a(f){t=setTimeout(o,f)}function l(){t&&clearTimeout(t),t=s=i=r=void 0}function c(){t&&o(!0),l()}function u(...f){s=Date.now(),i=f,r=this,t||a(e)}return u.flush=c,u.cancel=l,u}function Wd(n,e){let t=!1;return function(...i){t||(n(...i),t=!0,setTimeout(()=>{t=!1},e))}}function Ft(n,e){return n.bind(e)}function D(n,...e){return Object.assign(n,...e)}function Hd(n,e,t){let i=n;return B(e,function(r,s){if(typeof r!="number"&&typeof r!="string")throw new Error("illegal key type: "+typeof r+". Key should be of type number or string.");if(r==="constructor")throw new Error("illegal key: constructor");if(r==="__proto__")throw new Error("illegal key: __proto__");let o=e[s+1],a=i[r];ht(o)&&ha(a)&&(a=i[r]=isNaN(+o)?{}:[]),fa(o)?fa(t)?delete i[r]:i[r]=t:i=a}),n}function Xd(n,e){let t={},i=Object(n);return B(e,function(r){r in i&&(t[r]=n[r])}),t}var da="__fn",Ud=1e3,$b=Array.prototype.slice;function ye(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}ye.prototype.on=function(n,e,t,i){if(n=_e(n)?n:[n],Ie(e)&&(i=t,t=e,e=Ud),!Ce(e))throw new Error("priority must be a number");var r=t;i&&(r=Ft(t,i),r[da]=t[da]||t);var s=this;n.forEach(function(o){s._addListener(o,{priority:e,callback:r,next:null})})};ye.prototype.once=function(n,e,t,i){var r=this;if(Ie(e)&&(i=t,t=e,e=Ud),!Ce(e))throw new Error("priority must be a number");function s(){s.__isTomb=!0;var o=t.apply(i,arguments);return r.off(n,s),o}s[da]=t,this.on(n,e,s)};ye.prototype.off=function(n,e){n=_e(n)?n:[n];var t=this;n.forEach(function(i){t._removeListener(i,e)})};ye.prototype.createEvent=function(n){var e=new As;return e.init(n),e};ye.prototype.fire=function(n,e){var t,i,r,s;if(s=$b.call(arguments),typeof n=="object"&&(e=n,n=e.type),!n)throw new Error("no event type specified");if(i=this._listeners[n],!!i){e instanceof As?t=e:t=this.createEvent(e),s[0]=t;var o=t.type;n!==o&&(t.type=n);try{r=this._invokeListeners(t,s,i)}finally{n!==o&&(t.type=o)}return r===void 0&&t.defaultPrevented&&(r=!1),r}};ye.prototype.handleError=function(n){return this.fire("error",{error:n})===!1};ye.prototype._destroy=function(){this._listeners={}};ye.prototype._invokeListeners=function(n,e,t){for(var i;t&&!n.cancelBubble;)i=this._invokeListener(n,e,t),t=t.next;return i};ye.prototype._invokeListener=function(n,e,t){var i;if(t.callback.__isTomb)return i;try{i=Lb(t.callback,e),i!==void 0&&(n.returnValue=i,n.stopPropagation()),i===!1&&n.preventDefault()}catch(r){if(!this.handleError(r))throw console.error("unhandled error in event listener",r),r}return i};ye.prototype._addListener=function(n,e){var t=this._getListeners(n),i;if(!t){this._setListeners(n,e);return}for(;t;){if(t.priority<e.priority){e.next=t,i?i.next=e:this._setListeners(n,e);return}i=t,t=t.next}i.next=e};ye.prototype._getListeners=function(n){return this._listeners[n]};ye.prototype._setListeners=function(n,e){this._listeners[n]=e};ye.prototype._removeListener=function(n,e){var t=this._getListeners(n),i,r,s;if(!e){this._setListeners(n,null);return}for(;t;)i=t.next,s=t.callback,(s===e||s[da]===e)&&(r?r.next=i:this._setListeners(n,i)),r=t,t=i};function As(){}As.prototype.stopPropagation=function(){this.cancelBubble=!0};As.prototype.preventDefault=function(){this.defaultPrevented=!0};As.prototype.init=function(n){D(this,n||{})};function Lb(n,e){return n.apply(null,e)}function _c(){}_c.prototype.get=function(n){return this.$model.properties.get(this,n)};_c.prototype.set=function(n,e){this.$model.properties.set(this,n,e)};function Kd(n,e){this.model=n,this.properties=e}Kd.prototype.createType=function(n){var e=this.model,t=this.properties,i=Object.create(_c.prototype);B(n.properties,function(o){!o.isMany&&o.default!==void 0&&(i[o.name]=o.default)}),t.defineModel(i,e),t.defineDescriptor(i,n);var r=n.ns.name;function s(o){t.define(this,"$type",{value:r,enumerable:!0}),t.define(this,"$attrs",{value:{}}),t.define(this,"$parent",{writable:!0}),B(o,Ft(function(a,l){this.set(l,a)},this))}return s.prototype=i,s.hasType=i.$instanceOf=this.model.hasType,t.defineModel(s,e),t.defineDescriptor(s,n),s};var Nb={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Gd={String:function(n){return n},Boolean:function(n){return n==="true"},Integer:function(n){return parseInt(n,10)},Real:function(n){return parseFloat(n)}};function pa(n,e){var t=Gd[n];return t?t(e):e}function Ec(n){return!!Nb[n]}function Tc(n){return!!Gd[n]}function Te(n,e){var t=n.split(/:/),i,r;if(t.length===1)i=n,r=e;else if(t.length===2)i=t[1],r=t[0];else throw new Error("expected <prefix:localName> or <localName>, got "+n);return n=(r?r+":":"")+i,{name:n,prefix:r,localName:i}}function pt(n){this.ns=n,this.name=n.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}pt.prototype.build=function(){return Xd(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])};pt.prototype.addProperty=function(n,e,t){typeof e=="boolean"&&(t=e,e=void 0),this.addNamedProperty(n,t!==!1);var i=this.properties;e!==void 0?i.splice(e,0,n):i.push(n)};pt.prototype.replaceProperty=function(n,e,t){var i=n.ns,r=this.properties,s=this.propertiesByName,o=n.name!==e.name;if(n.isId){if(!e.isId)throw new Error("property <"+e.ns.name+"> must be id property to refine <"+n.ns.name+">");this.setIdProperty(e,!1)}if(n.isBody){if(!e.isBody)throw new Error("property <"+e.ns.name+"> must be body property to refine <"+n.ns.name+">");this.setBodyProperty(e,!1)}var a=r.indexOf(n);if(a===-1)throw new Error("property <"+i.name+"> not found in property list");r.splice(a,1),this.addProperty(e,t?void 0:a,o),s[i.name]=s[i.localName]=e};pt.prototype.redefineProperty=function(n,e,t){var i=n.ns.prefix,r=e.split("#"),s=Te(r[0],i),o=Te(r[1],s.prefix).name,a=this.propertiesByName[o];if(a)this.replaceProperty(a,n,t);else throw new Error("refined property <"+o+"> not found");delete n.redefines};pt.prototype.addNamedProperty=function(n,e){var t=n.ns,i=this.propertiesByName;e&&(this.assertNotDefined(n,t.name),this.assertNotDefined(n,t.localName)),i[t.name]=i[t.localName]=n};pt.prototype.removeNamedProperty=function(n){var e=n.ns,t=this.propertiesByName;delete t[e.name],delete t[e.localName]};pt.prototype.setBodyProperty=function(n,e){if(e&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+n.ns.name+">)");this.bodyProperty=n};pt.prototype.setIdProperty=function(n,e){if(e&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+n.ns.name+">)");this.idProperty=n};pt.prototype.assertNotTrait=function(n){if((n.extends||[]).length)throw new Error(`cannot create <${n.name}> extending <${n.extends}>`)};pt.prototype.assertNotDefined=function(n,e){var t=n.name,i=this.propertiesByName[t];if(i)throw new Error("property <"+t+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+n.definedBy.ns.name+"#"+n.ns.name+"> not allowed without redefines")};pt.prototype.hasProperty=function(n){return this.propertiesByName[n]};pt.prototype.addTrait=function(n,e){e&&this.assertNotTrait(n);var t=this.allTypesByName,i=this.allTypes,r=n.name;r in t||(B(n.properties,Ft(function(s){s=D({},s,{name:s.ns.localName,inherited:e}),Object.defineProperty(s,"definedBy",{value:n});var o=s.replaces,a=s.redefines;o||a?this.redefineProperty(s,o||a,o):(s.isBody&&this.setBodyProperty(s),s.isId&&this.setIdProperty(s),this.addProperty(s))},this)),i.push(n),t[r]=n)};function zn(n,e){this.packageMap={},this.typeMap={},this.packages=[],this.properties=e,B(n,Ft(this.registerPackage,this))}zn.prototype.getPackage=function(n){return this.packageMap[n]};zn.prototype.getPackages=function(){return this.packages};zn.prototype.registerPackage=function(n){n=D({},n);var e=this.packageMap;Yd(e,n,"prefix"),Yd(e,n,"uri"),B(n.types,Ft(function(t){this.registerType(t,n)},this)),e[n.uri]=e[n.prefix]=n,this.packages.push(n)};zn.prototype.registerType=function(n,e){n=D({},n,{superClass:(n.superClass||[]).slice(),extends:(n.extends||[]).slice(),properties:(n.properties||[]).slice(),meta:D(n.meta||{})});var t=Te(n.name,e.prefix),i=t.name,r={};B(n.properties,Ft(function(s){var o=Te(s.name,t.prefix),a=o.name;Ec(s.type)||(s.type=Te(s.type,o.prefix).name),D(s,{ns:o,name:a}),r[a]=s},this)),D(n,{ns:t,name:i,propertiesByName:r}),B(n.extends,Ft(function(s){var o=Te(s,t.prefix),a=this.typeMap[o.name];a.traits=a.traits||[],a.traits.push(i)},this)),this.definePackage(n,e),this.typeMap[i]=n};zn.prototype.mapTypes=function(n,e,t){var i=Ec(n.name)?{name:n.name}:this.typeMap[n.name],r=this;function s(l,c){var u=Te(l,Ec(l)?"":n.prefix);r.mapTypes(u,e,c)}function o(l){return s(l,!0)}function a(l){return s(l,!1)}if(!i)throw new Error("unknown type <"+n.name+">");B(i.superClass,t?o:a),e(i,!t),B(i.traits,o)};zn.prototype.getEffectiveDescriptor=function(n){var e=Te(n),t=new pt(e);this.mapTypes(e,function(r,s){t.addTrait(r,s)});var i=t.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i};zn.prototype.definePackage=function(n,e){this.properties.define(n,"$pkg",{value:e})};function Yd(n,e,t){var i=e[t];if(i in n)throw new Error("package with "+t+" <"+i+"> already defined")}function pi(n){this.model=n}pi.prototype.set=function(n,e,t){if(!tt(e)||!e.length)throw new TypeError("property name must be a non-empty string");var i=this.getProperty(n,e),r=i&&i.name;qb(t)?i?delete n[r]:delete n.$attrs[Ac(e)]:i?r in n?n[r]=t:Jd(n,i,t):n.$attrs[Ac(e)]=t};pi.prototype.get=function(n,e){var t=this.getProperty(n,e);if(!t)return n.$attrs[Ac(e)];var i=t.name;return!n[i]&&t.isMany&&Jd(n,t,[]),n[i]};pi.prototype.define=function(n,e,t){if(!t.writable){var i=t.value;t=D({},t,{get:function(){return i}}),delete t.value}Object.defineProperty(n,e,t)};pi.prototype.defineDescriptor=function(n,e){this.define(n,"$descriptor",{value:e})};pi.prototype.defineModel=function(n,e){this.define(n,"$model",{value:e})};pi.prototype.getProperty=function(n,e){var t=this.model,i=t.getPropertyDescriptor(n,e);if(i)return i;if(e.includes(":"))return null;let r=t.config.strict;if(typeof r!="undefined"){let s=new TypeError(`unknown property <${e}> on <${n.$type}>`);if(r)throw s;typeof console!="undefined"&&console.warn(s)}return null};function qb(n){return typeof n=="undefined"}function Jd(n,e,t){Object.defineProperty(n,e.name,{enumerable:!e.isReference,writable:!0,value:t,configurable:!0})}function Ac(n){return n.replace(/^:/,"")}function nt(n,e={}){this.properties=new pi(this),this.factory=new Kd(this,this.properties),this.registry=new zn(n,this.properties),this.typeCache={},this.config=e}nt.prototype.create=function(n,e){var t=this.getType(n);if(!t)throw new Error("unknown type <"+n+">");return new t(e)};nt.prototype.getType=function(n){var e=this.typeCache,t=tt(n)?n:n.ns.name,i=e[t];return i||(n=this.registry.getEffectiveDescriptor(t),i=e[t]=this.factory.createType(n)),i};nt.prototype.createAny=function(n,e,t){var i=Te(n),r={$type:n,$instanceOf:function(o){return o===this.$type},get:function(o){return this[o]},set:function(o,a){Hd(this,[o],a)}},s={name:n,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:e}};return this.properties.defineDescriptor(r,s),this.properties.defineModel(r,this),this.properties.define(r,"get",{enumerable:!1,writable:!0}),this.properties.define(r,"set",{enumerable:!1,writable:!0}),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),B(t,function(o,a){dt(o)&&o.value!==void 0?r[o.name]=o.value:r[a]=o}),r};nt.prototype.getPackage=function(n){return this.registry.getPackage(n)};nt.prototype.getPackages=function(){return this.registry.getPackages()};nt.prototype.getElementDescriptor=function(n){return n.$descriptor};nt.prototype.hasType=function(n,e){e===void 0&&(e=n,n=this);var t=n.$model.getElementDescriptor(n);return e in t.allTypesByName};nt.prototype.getPropertyDescriptor=function(n,e){return this.getElementDescriptor(n).propertiesByName[e]};nt.prototype.getTypeDescriptor=function(n){return this.registry.typeMap[n]};var Zd=String.fromCharCode,Fb=Object.prototype.hasOwnProperty,jb=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,_s={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(_s).forEach(function(n){_s[n.toUpperCase()]=_s[n]});function Vb(n,e,t,i){return i?Fb.call(_s,i)?_s[i]:"&"+i+";":Zd(e||parseInt(t,16))}function mi(n){return n.length>3&&n.indexOf("&")!==-1?n.replace(jb,Vb):n}var ep="non-whitespace outside of root node";function Ji(n){return new Error(n)}function tp(n){return"missing namespace for prefix <"+n+">"}function ma(n){return{get:n,enumerable:!0}}function Qb(n){var e={},t;for(t in n)e[t]=n[t];return e}function Mc(n){return n+"$uri"}function zb(n){var e={},t,i;for(t in n)i=n[t],e[i]=i,e[Mc(i)]=t;return e}function np(){return{line:0,column:0}}function Wb(n){throw n}function Rc(n){if(!this)return new Rc(n);var e=n&&n.proxy,t,i,r,s,o=Wb,a,l,c,u,f=np,h=!1,d=!1,p=null,m=!1,y;function g(b){b instanceof Error||(b=Ji(b)),p=b,o(b,f)}function w(b){a&&(b instanceof Error||(b=Ji(b)),a(b,f))}this.on=function(b,C){if(typeof C!="function")throw Ji("required args <name, cb>");switch(b){case"openTag":i=C;break;case"text":t=C;break;case"closeTag":r=C;break;case"error":o=C;break;case"warn":a=C;break;case"cdata":s=C;break;case"attention":u=C;break;case"question":c=C;break;case"comment":l=C;break;default:throw Ji("unsupported event: "+b)}return this},this.ns=function(b){if(typeof b=="undefined"&&(b={}),typeof b!="object")throw Ji("required args <nsMap={}>");var C={},k;for(k in b)C[k]=b[k];return d=!0,y=C,this},this.parse=function(b){if(typeof b!="string")throw Ji("required args <xml=string>");return p=null,x(b),f=np,m=!1,p},this.stop=function(){m=!0};function x(b){var C=d?[]:null,k=d?zb(y):null,O,v=[],A=0,S=!1,M=!1,_=0,P=0,j,oe,ee,Y,Zt,ct,Ae,ut,qe,et="",Nt=0,ft;function Fn(){if(ft!==null)return ft;var jn,fi,en,hi=d&&k.xmlns,xn=d&&h?[]:null,de=Nt,Be=et,di=Be.length,jd,Vn,bn,tn,ne,Ki={},Vd={},qt,W,te;e:for(;de<di;de++)if(qt=!1,W=Be.charCodeAt(de),!(W===32||W<14&&W>8)){for((W<65||W>122||W>90&&W<97)&&W!==95&&W!==58&&(w("illegal first char attribute name"),qt=!0),te=de+1;te<di;te++)if(W=Be.charCodeAt(te),!(W>96&&W<123||W>64&&W<91||W>47&&W<59||W===46||W===45||W===95)){if(W===32||W<14&&W>8){w("missing attribute value"),de=te;continue e}if(W===61)break;w("illegal attribute name char"),qt=!0}if(ne=Be.substring(de,te),ne==="xmlns:xmlns"&&(w("illegal declaration of xmlns"),qt=!0),W=Be.charCodeAt(te+1),W===34)te=Be.indexOf('"',de=te+2),te===-1&&(te=Be.indexOf("'",de),te!==-1&&(w("attribute value quote missmatch"),qt=!0));else if(W===39)te=Be.indexOf("'",de=te+2),te===-1&&(te=Be.indexOf('"',de),te!==-1&&(w("attribute value quote missmatch"),qt=!0));else for(w("missing attribute value quotes"),qt=!0,te=te+1;te<di&&(W=Be.charCodeAt(te+1),!(W===32||W<14&&W>8));te++);for(te===-1&&(w("missing closing quotes"),te=di,qt=!0),qt||(bn=Be.substring(de,te)),de=te;te+1<di&&(W=Be.charCodeAt(te+1),!(W===32||W<14&&W>8));te++)de===te&&(w("illegal character after attribute end"),qt=!0);if(de=te+1,qt)continue e;if(ne in Vd){w("attribute <"+ne+"> already defined");continue}if(Vd[ne]=!0,!d){Ki[ne]=bn;continue}if(h){if(Vn=ne==="xmlns"?"xmlns":ne.charCodeAt(0)===120&&ne.substr(0,6)==="xmlns:"?ne.substr(6):null,Vn!==null){if(jn=mi(bn),fi=Mc(Vn),tn=y[jn],!tn){if(Vn==="xmlns"||fi in k&&k[fi]!==jn)do tn="ns"+A++;while(typeof k[tn]!="undefined");else tn=Vn;y[jn]=tn}k[Vn]!==tn&&(jd||(k=Qb(k),jd=!0),k[Vn]=tn,Vn==="xmlns"&&(k[Mc(tn)]=jn,hi=tn),k[fi]=jn),Ki[ne]=bn;continue}xn.push(ne,bn);continue}if(W=ne.indexOf(":"),W===-1){Ki[ne]=bn;continue}if(!(en=k[ne.substring(0,W)])){w(tp(ne.substring(0,W)));continue}ne=hi===en?ne.substr(W+1):en+ne.substr(W),Ki[ne]=bn}if(h)for(de=0,di=xn.length;de<di;de++){if(ne=xn[de++],bn=xn[de],W=ne.indexOf(":"),W!==-1){if(!(en=k[ne.substring(0,W)])){w(tp(ne.substring(0,W)));continue}ne=hi===en?ne.substr(W+1):en+ne.substr(W)}Ki[ne]=bn}return ft=Ki}function ua(){for(var jn=/(\r\n|\r|\n)/g,fi=0,en=0,hi=0,xn=P,de,Be;_>=hi&&(de=jn.exec(b),!(!de||(xn=de[0].length+de.index,xn>_)));)fi+=1,hi=xn;return _==-1?(en=xn,Be=b.substring(P)):P===0?Be=b.substring(P,_):(en=_-hi,Be=P==-1?b.substring(_):b.substring(_,P+1)),{data:Be,line:fi,column:en}}for(f=ua,e&&(qe=Object.create({},{name:ma(function(){return Ae}),originalName:ma(function(){return ut}),attrs:ma(Fn),ns:ma(function(){return k})}));P!==-1;){if(b.charCodeAt(P)===60?_=P:_=b.indexOf("<",P),_===-1){if(v.length)return g("unexpected end of file");if(P===0)return g("missing start tag");P<b.length&&b.substring(P).trim()&&w(ep);return}if(P!==_){if(v.length){if(t&&(t(b.substring(P,_),mi,f),m))return}else if(b.substring(P,_).trim()&&(w(ep),m))return}if(Y=b.charCodeAt(_+1),Y===33){if(ee=b.charCodeAt(_+2),ee===91&&b.substr(_+3,6)==="CDATA["){if(P=b.indexOf("]]>",_),P===-1)return g("unclosed cdata");if(s&&(s(b.substring(_+9,P),f),m))return;P+=3;continue}if(ee===45&&b.charCodeAt(_+3)===45){if(P=b.indexOf("-->",_),P===-1)return g("unclosed comment");if(l&&(l(b.substring(_+4,P),mi,f),m))return;P+=3;continue}}if(Y===63){if(P=b.indexOf("?>",_),P===-1)return g("unclosed question");if(c&&(c(b.substring(_,P+2),f),m))return;P+=2;continue}for(j=_+1;;j++){if(Zt=b.charCodeAt(j),isNaN(Zt))return P=-1,g("unclosed tag");if(Zt===34)ee=b.indexOf('"',j+1),j=ee!==-1?ee:j;else if(Zt===39)ee=b.indexOf("'",j+1),j=ee!==-1?ee:j;else if(Zt===62){P=j;break}}if(Y===33){if(u&&(u(b.substring(_,P+1),mi,f),m))return;P+=1;continue}if(ft={},Y===47){if(S=!1,M=!0,!v.length)return g("missing open tag");if(j=Ae=v.pop(),ee=_+2+j.length,b.substring(_+2,ee)!==j)return g("closing tag mismatch");for(;ee<P;ee++)if(Y=b.charCodeAt(ee),!(Y===32||Y>8&&Y<14))return g("close tag")}else{if(b.charCodeAt(P-1)===47?(j=Ae=b.substring(_+1,P-1),S=!0,M=!0):(j=Ae=b.substring(_+1,P),S=!0,M=!1),!(Y>96&&Y<123||Y>64&&Y<91||Y===95||Y===58))return g("illegal first char nodeName");for(ee=1,oe=j.length;ee<oe;ee++)if(Y=j.charCodeAt(ee),!(Y>96&&Y<123||Y>64&&Y<91||Y>47&&Y<59||Y===45||Y===95||Y==46)){if(Y===32||Y<14&&Y>8){Ae=j.substring(0,ee),ft=null;break}return g("invalid nodeName")}M||v.push(Ae)}if(d){if(O=k,S&&(M||C.push(O),ft===null&&(h=j.indexOf("xmlns",ee)!==-1)&&(Nt=ee,et=j,Fn(),h=!1)),ut=Ae,Y=Ae.indexOf(":"),Y!==-1){if(ct=k[Ae.substring(0,Y)],!ct)return g("missing namespace on <"+ut+">");Ae=Ae.substr(Y+1)}else ct=k.xmlns;ct&&(Ae=ct+":"+Ae)}if(S&&(Nt=ee,et=j,i&&(e?i(qe,mi,M,f):i(Ae,Fn,mi,M,f),m)))return;if(M){if(r&&(r(e?qe:Ae,mi,S,f),m))return;d&&(S?k=O:k=C.pop())}P+=1}}}function ip(n){return n.xml&&n.xml.tagAlias==="lowerCase"}var Pc={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},rp="property";function sp(n){return n.xml&&n.xml.serialize}function Hb(n){let e=sp(n);return e!==rp&&(e||null)}function Xb(n){return n.charAt(0).toUpperCase()+n.slice(1)}function op(n,e){return ip(e)?n.prefix+":"+Xb(n.localName):n.name}function Ub(n,e){var t=n.name,i=n.localName,r=e&&e.xml&&e.xml.typePrefix;return r&&i.indexOf(r)===0?n.prefix+":"+i.slice(r.length):t}function Yb(n,e,t){let i=Te(n,e.xmlns),r=`${e[i.prefix]||i.prefix}:${i.localName}`,s=Te(r);var o=t.getPackage(s.prefix);return Ub(s,o)}function Wn(n){return new Error(n)}function wn(n){return n.$descriptor}function Kb(n){D(this,n),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw Wn("expected element");var t=this.elementsById,i=wn(e),r=i.idProperty,s;if(r&&(s=e.get(r.name),s)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(s))throw new Error("illegal ID <"+s+">");if(t[s])throw Wn("duplicate ID <"+s+">");t[s]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Ts(){}Ts.prototype.handleEnd=function(){};Ts.prototype.handleText=function(){};Ts.prototype.handleNode=function(){};function Dc(){}Dc.prototype=Object.create(Ts.prototype);Dc.prototype.handleNode=function(){return this};function er(){}er.prototype=Object.create(Ts.prototype);er.prototype.handleText=function(n){this.body=(this.body||"")+n};function Ms(n,e){this.property=n,this.context=e}Ms.prototype=Object.create(er.prototype);Ms.prototype.handleNode=function(n){if(this.element)throw Wn("expected no sub nodes");return this.element=this.createReference(n),this};Ms.prototype.handleEnd=function(){this.element.id=this.body};Ms.prototype.createReference=function(n){return{property:this.property.ns.name,id:""}};function Bc(n,e){this.element=e,this.propertyDesc=n}Bc.prototype=Object.create(er.prototype);Bc.prototype.handleEnd=function(){var n=this.body||"",e=this.element,t=this.propertyDesc;n=pa(t.type,n),t.isMany?e.get(t.name).push(n):e.set(t.name,n)};function ga(){}ga.prototype=Object.create(er.prototype);ga.prototype.handleNode=function(n){var e=this,t=this.element;return t?e=this.handleChild(n):(t=this.element=this.createElement(n),this.context.addElement(t)),e};function Fe(n,e,t){this.model=n,this.type=n.getType(e),this.context=t}Fe.prototype=Object.create(ga.prototype);Fe.prototype.addReference=function(n){this.context.addReference(n)};Fe.prototype.handleText=function(n){var e=this.element,t=wn(e),i=t.bodyProperty;if(!i)throw Wn("unexpected body text <"+n+">");er.prototype.handleText.call(this,n)};Fe.prototype.handleEnd=function(){var n=this.body,e=this.element,t=wn(e),i=t.bodyProperty;i&&n!==void 0&&(n=pa(i.type,n),e.set(i.name,n))};Fe.prototype.createElement=function(n){var e=n.attributes,t=this.type,i=wn(t),r=this.context,s=new t({}),o=this.model,a;return B(e,function(l,c){var u=i.propertiesByName[c],f;u&&u.isReference?u.isMany?(f=l.split(" "),B(f,function(h){r.addReference({element:s,property:u.ns.name,id:h})})):r.addReference({element:s,property:u.ns.name,id:l}):(u?l=pa(u.type,l):c==="xmlns"?c=":"+c:(a=Te(c,i.ns.prefix),o.getPackage(a.prefix)&&r.addWarning({message:"unknown attribute <"+c+">",element:s,property:c,value:l})),s.set(c,l))}),s};Fe.prototype.getPropertyForNode=function(n){var e=n.name,t=Te(e),i=this.type,r=this.model,s=wn(i),o=t.name,a=s.propertiesByName[o];if(a&&!a.isAttr){let c=Hb(a);if(c){let u=n.attributes[c];if(u){let f=Yb(u,n.ns,r),h=r.getType(f);return D({},a,{effectiveType:wn(h).name})}}return a}var l=r.getPackage(t.prefix);if(l){let c=op(t,l),u=r.getType(c);if(a=we(s.properties,function(f){return!f.isVirtual&&!f.isReference&&!f.isAttribute&&u.hasType(f.type)}),a)return D({},a,{effectiveType:wn(u).name})}else if(a=we(s.properties,function(c){return!c.isReference&&!c.isAttribute&&c.type==="Element"}),a)return a;throw Wn("unrecognized element <"+t.name+">")};Fe.prototype.toString=function(){return"ElementDescriptor["+wn(this.type).name+"]"};Fe.prototype.valueHandler=function(n,e){return new Bc(n,e)};Fe.prototype.referenceHandler=function(n){return new Ms(n,this.context)};Fe.prototype.handler=function(n){return n==="Element"?new Zi(this.model,n,this.context):new Fe(this.model,n,this.context)};Fe.prototype.handleChild=function(n){var e,t,i,r;if(e=this.getPropertyForNode(n),i=this.element,t=e.effectiveType||e.type,Tc(t))return this.valueHandler(e,i);e.isReference?r=this.referenceHandler(e).handleNode(n):r=this.handler(t).handleNode(n);var s=r.element;return s!==void 0&&(e.isMany?i.get(e.name).push(s):i.set(e.name,s),e.isReference?(D(s,{element:i}),this.context.addReference(s)):s.$parent=i),r};function Ic(n,e,t){Fe.call(this,n,e,t)}Ic.prototype=Object.create(Fe.prototype);Ic.prototype.createElement=function(n){var e=n.name,t=Te(e),i=this.model,r=this.type,s=i.getPackage(t.prefix),o=s&&op(t,s)||e;if(!r.hasType(o))throw Wn("unexpected element <"+n.originalName+">");return Fe.prototype.createElement.call(this,n)};function Zi(n,e,t){this.model=n,this.context=t}Zi.prototype=Object.create(ga.prototype);Zi.prototype.createElement=function(n){var e=n.name,t=Te(e),i=t.prefix,r=n.ns[i+"$uri"],s=n.attributes;return this.model.createAny(e,r,s)};Zi.prototype.handleChild=function(n){var e=new Zi(this.model,"Element",this.context).handleNode(n),t=this.element,i=e.element,r;return i!==void 0&&(r=t.$children=t.$children||[],r.push(i),i.$parent=t),e};Zi.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function ya(n){n instanceof nt&&(n={model:n}),D(this,{lax:!1},n)}ya.prototype.fromXML=function(n,e,t){var i=e.rootHandler;e instanceof Fe?(i=e,e={}):typeof e=="string"?(i=this.handler(e),e={}):typeof i=="string"&&(i=this.handler(i));var r=this.model,s=this.lax,o=new Kb(D({},e,{rootHandler:i})),a=new Rc({proxy:!0}),l=Gb();i.context=o,l.push(i);function c(C,k,O){var v=k(),A=v.line,S=v.column,M=v.data;M.charAt(0)==="<"&&M.indexOf(" ")!==-1&&(M=M.slice(0,M.indexOf(" "))+">");var _="unparsable content "+(M?M+" ":"")+`detected
H A Ddmn-modeler.production.min.js8 */var R5=/["'&<>]/;TR.exports=T5;function T5(n){var e=""+n,t=R5.exec(e);if(!t)return e;var i,r="",o=0,s=0;for(o=t.index;o<e.length;o++){switch(e.charCodeAt(o)){case 34:i="&quot;";break;case 38:i="&amp;";break;case 39:i="&#39;";break;case 60:i="&lt;";break;case 62:i="&gt;";break;default:continue}s!==o&&(r+=e.substring(s,o)),s=o+1,r+=i}return s!==o?r+e.substring(s,o):r}});function Dw(n){return Array.prototype.concat.apply([],n)}var zu=Object.prototype.toString,KD=Object.prototype.hasOwnProperty;function Hu(n){return n===void 0}function Me(n){return n!==void 0}function Yr(n){return n==null}function F(n){return zu.call(n)==="[object Array]"}function Pe(n){return zu.call(n)==="[object Object]"}function se(n){return zu.call(n)==="[object Number]"}function ge(n){let e=zu.call(n);return e==="[object Function]"||e==="[object AsyncFunction]"||e==="[object GeneratorFunction]"||e==="[object AsyncGeneratorFunction]"||e==="[object Proxy]"}function Ie(n){return zu.call(n)==="[object String]"}function Zr(n,e){return!Yr(n)&&KD.call(n,e)}function ye(n,e){let t=Xy(e),i;return k(n,function(r,o){if(t(r,o))return i=r,!1}),i}function Iw(n,e){let t=Xy(e),i=F(n)?-1:void 0;return k(n,function(r,o){if(t(r,o))return i=o,!1}),i}function Ee(n,e){let t=Xy(e),i=[];return k(n,function(r,o){t(r,o)&&i.push(r)}),i}function k(n,e){let t,i;if(Hu(n))return;let r=F(n)?XD:GD;for(let o in n)if(Zr(n,o)&&(t=n[o],i=e(t,r(o)),i===!1))return t}function st(n,e,t){return k(n,function(i,r){t=e(t,i,r)}),t}function kt(n,e){return!!st(n,function(t,i,r){return t&&e(i,r)},!0)}function zd(n,e){return!!ye(n,e)}function Vt(n,e){let t=[];return k(n,function(i,r){t.push(e(i,r))}),t}function di(n){return n&&Object.keys(n)||[]}function Lw(n){return di(n).length}function Wu(n){return Vt(n,e=>e)}function ur(n,e,t={}){return e=Gy(e),k(n,function(i){let r=e(i)||"_",o=t[r];o||(o=t[r]=[]),o.push(i)}),t}function Bw(n,...e){n=Gy(n);let t={};return k(e,r=>ur(r,n,t)),Vt(t,function(r,o){return r[0]})}function Fn(n,e){e=Gy(e);let t=[];return k(n,function(i,r){let o=e(i,r),s={d:o,v:i};for(var a=0;a<t.length;a++){let{d:l}=t[a];if(o<l){t.splice(a,0,s);return}}t.push(s)}),Vt(t,i=>i.v)}function la(n){return function(e){return kt(n,function(t,i){return e[i]===t})}}function Gy(n){return ge(n)?n:e=>e[n]}function Xy(n){return ge(n)?n:e=>e===n}function GD(n){return n}function XD(n){return Number(n)}function Mi(n,e){let t,i,r,o;function s(f){let h=Date.now(),d=f?0:o+e-h;if(d>0)return a(d);n.apply(r,i),l()}function a(f){t=setTimeout(s,f)}function l(){t&&clearTimeout(t),t=o=i=r=void 0}function c(){t&&s(!0),l()}function u(...f){o=Date.now(),i=f,r=this,t||a(e)}return u.flush=c,u.cancel=l,u}function Nw(n,e){let t=!1;return function(...i){t||(n(...i),t=!0,setTimeout(()=>{t=!1},e))}}function at(n,e){return n.bind(e)}function T(n,...e){return Object.assign(n,...e)}function $w(n,e,t){let i=n;return k(e,function(r,o){if(typeof r!="number"&&typeof r!="string")throw new Error("illegal key type: "+typeof r+". Key should be of type number or string.");if(r==="constructor")throw new Error("illegal key: constructor");if(r==="__proto__")throw new Error("illegal key: __proto__");let s=e[o+1],a=i[r];Me(s)&&Yr(a)&&(a=i[r]=isNaN(+s)?{}:[]),Hu(s)?Hu(t)?delete i[r]:i[r]=t:i=a}),n}function hn(n,e){let t={},i=Object(n);return k(e,function(r){r in i&&(t[r]=n[r])}),t}function Uu(n,e){let t={},i=Object(n);return k(i,function(r,o){e.indexOf(o)===-1&&(t[o]=r)}),t}var Wd="__fn",jw=1e3,YD=Array.prototype.slice;function ut(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}ut.prototype.on=function(n,e,t,i){if(n=F(n)?n:[n],ge(e)&&(i=t,t=e,e=jw),!se(e))throw new Error("priority must be a number");var r=t;i&&(r=at(t,i),r[Wd]=t[Wd]||t);var o=this;n.forEach(function(s){o._addListener(s,{priority:e,callback:r,next:null})})};ut.prototype.once=function(n,e,t,i){var r=this;if(ge(e)&&(i=t,t=e,e=jw),!se(e))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var s=t.apply(i,arguments);return r.off(n,o),s}o[Wd]=t,this.on(n,e,o)};ut.prototype.off=function(n,e){n=F(n)?n:[n];var t=this;n.forEach(function(i){t._removeListener(i,e)})};ut.prototype.createEvent=function(n){var e=new Qu;return e.init(n),e};ut.prototype.fire=function(n,e){var t,i,r,o;if(o=YD.call(arguments),typeof n=="object"&&(e=n,n=e.type),!n)throw new Error("no event type specified");if(i=this._listeners[n],!!i){e instanceof Qu?t=e:t=this.createEvent(e),o[0]=t;var s=t.type;n!==s&&(t.type=n);try{r=this._invokeListeners(t,o,i)}finally{n!==s&&(t.type=s)}return r===void 0&&t.defaultPrevented&&(r=!1),r}};ut.prototype.handleError=function(n){return this.fire("error",{error:n})===!1};ut.prototype._destroy=function(){this._listeners={}};ut.prototype._invokeListeners=function(n,e,t){for(var i;t&&!n.cancelBubble;)i=this._invokeListener(n,e,t),t=t.next;return i};ut.prototype._invokeListener=function(n,e,t){var i;if(t.callback.__isTomb)return i;try{i=ZD(t.callback,e),i!==void 0&&(n.returnValue=i,n.stopPropagation()),i===!1&&n.preventDefault()}catch(r){if(!this.handleError(r))throw console.error("unhandled error in event listener",r),r}return i};ut.prototype._addListener=function(n,e){var t=this._getListeners(n),i;if(!t){this._setListeners(n,e);return}for(;t;){if(t.priority<e.priority){e.next=t,i?i.next=e:this._setListeners(n,e);return}i=t,t=t.next}i.next=e};ut.prototype._getListeners=function(n){return this._listeners[n]};ut.prototype._setListeners=function(n,e){this._listeners[n]=e};ut.prototype._removeListener=function(n,e){var t=this._getListeners(n),i,r,o;if(!e){this._setListeners(n,null);return}for(;t;)i=t.next,o=t.callback,(o===e||o[Wd]===e)&&(r?r.next=i:this._setListeners(n,i)),r=t,t=i};function Qu(){}Qu.prototype.stopPropagation=function(){this.cancelBubble=!0};Qu.prototype.preventDefault=function(){this.defaultPrevented=!0};Qu.prototype.init=function(n){T(this,n||{})};function ZD(n,e){return n.apply(null,e)}function Jy(){}Jy.prototype.get=function(n){return this.$model.properties.get(this,n)};Jy.prototype.set=function(n,e){this.$model.properties.set(this,n,e)};function qw(n,e){this.model=n,this.properties=e}qw.prototype.createType=function(n){var e=this.model,t=this.properties,i=Object.create(Jy.prototype);k(n.properties,function(s){!s.isMany&&s.default!==void 0&&(i[s.name]=s.default)}),t.defineModel(i,e),t.defineDescriptor(i,n);var r=n.ns.name;function o(s){t.define(this,"$type",{value:r,enumerable:!0}),t.define(this,"$attrs",{value:{}}),t.define(this,"$parent",{writable:!0}),k(s,at(function(a,l){this.set(l,a)},this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,t.defineModel(o,e),t.defineDescriptor(o,n),o};var JD={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Vw={String:function(n){return n},Boolean:function(n){return n==="true"},Integer:function(n){return parseInt(n,10)},Real:function(n){return parseFloat(n)}};function Ud(n,e){var t=Vw[n];return t?t(e):e}function Yy(n){return!!JD[n]}function ev(n){return!!Vw[n]}function Rt(n,e){var t=n.split(/:/),i,r;if(t.length===1)i=n,r=e;else if(t.length===2)i=t[1],r=t[0];else throw new Error("expected <prefix:localName> or <localName>, got "+n);return n=(r?r+":":"")+i,{name:n,prefix:r,localName:i}}function Cn(n){this.ns=n,this.name=n.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}Cn.prototype.build=function(){return hn(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])};Cn.prototype.addProperty=function(n,e,t){typeof e=="boolean"&&(t=e,e=void 0),this.addNamedProperty(n,t!==!1);var i=this.properties;e!==void 0?i.splice(e,0,n):i.push(n)};Cn.prototype.replaceProperty=function(n,e,t){var i=n.ns,r=this.properties,o=this.propertiesByName,s=n.name!==e.name;if(n.isId){if(!e.isId)throw new Error("property <"+e.ns.name+"> must be id property to refine <"+n.ns.name+">");this.setIdProperty(e,!1)}if(n.isBody){if(!e.isBody)throw new Error("property <"+e.ns.name+"> must be body property to refine <"+n.ns.name+">");this.setBodyProperty(e,!1)}var a=r.indexOf(n);if(a===-1)throw new Error("property <"+i.name+"> not found in property list");r.splice(a,1),this.addProperty(e,t?void 0:a,s),o[i.name]=o[i.localName]=e};Cn.prototype.redefineProperty=function(n,e,t){var i=n.ns.prefix,r=e.split("#"),o=Rt(r[0],i),s=Rt(r[1],o.prefix).name,a=this.propertiesByName[s];if(a)this.replaceProperty(a,n,t);else throw new Error("refined property <"+s+"> not found");delete n.redefines};Cn.prototype.addNamedProperty=function(n,e){var t=n.ns,i=this.propertiesByName;e&&(this.assertNotDefined(n,t.name),this.assertNotDefined(n,t.localName)),i[t.name]=i[t.localName]=n};Cn.prototype.removeNamedProperty=function(n){var e=n.ns,t=this.propertiesByName;delete t[e.name],delete t[e.localName]};Cn.prototype.setBodyProperty=function(n,e){if(e&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+n.ns.name+">)");this.bodyProperty=n};Cn.prototype.setIdProperty=function(n,e){if(e&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+n.ns.name+">)");this.idProperty=n};Cn.prototype.assertNotTrait=function(n){if((n.extends||[]).length)throw new Error(`cannot create <${n.name}> extending <${n.extends}>`)};Cn.prototype.assertNotDefined=function(n,e){var t=n.name,i=this.propertiesByName[t];if(i)throw new Error("property <"+t+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+n.definedBy.ns.name+"#"+n.ns.name+"> not allowed without redefines")};Cn.prototype.hasProperty=function(n){return this.propertiesByName[n]};Cn.prototype.addTrait=function(n,e){e&&this.assertNotTrait(n);var t=this.allTypesByName,i=this.allTypes,r=n.name;r in t||(k(n.properties,at(function(o){o=T({},o,{name:o.ns.localName,inherited:e}),Object.defineProperty(o,"definedBy",{value:n});var s=o.replaces,a=o.redefines;s||a?this.redefineProperty(o,s||a,s):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),i.push(n),t[r]=n)};function Jr(n,e){this.packageMap={},this.typeMap={},this.packages=[],this.properties=e,k(n,at(this.registerPackage,this))}Jr.prototype.getPackage=function(n){return this.packageMap[n]};Jr.prototype.getPackages=function(){return this.packages};Jr.prototype.registerPackage=function(n){n=T({},n);var e=this.packageMap;Fw(e,n,"prefix"),Fw(e,n,"uri"),k(n.types,at(function(t){this.registerType(t,n)},this)),e[n.uri]=e[n.prefix]=n,this.packages.push(n)};Jr.prototype.registerType=function(n,e){n=T({},n,{superClass:(n.superClass||[]).slice(),extends:(n.extends||[]).slice(),properties:(n.properties||[]).slice(),meta:T(n.meta||{})});var t=Rt(n.name,e.prefix),i=t.name,r={};k(n.properties,at(function(o){var s=Rt(o.name,t.prefix),a=s.name;Yy(o.type)||(o.type=Rt(o.type,s.prefix).name),T(o,{ns:s,name:a}),r[a]=o},this)),T(n,{ns:t,name:i,propertiesByName:r}),k(n.extends,at(function(o){var s=Rt(o,t.prefix),a=this.typeMap[s.name];a.traits=a.traits||[],a.traits.push(i)},this)),this.definePackage(n,e),this.typeMap[i]=n};Jr.prototype.mapTypes=function(n,e,t){var i=Yy(n.name)?{name:n.name}:this.typeMap[n.name],r=this;function o(l,c){var u=Rt(l,Yy(l)?"":n.prefix);r.mapTypes(u,e,c)}function s(l){return o(l,!0)}function a(l){return o(l,!1)}if(!i)throw new Error("unknown type <"+n.name+">");k(i.superClass,t?s:a),e(i,!t),k(i.traits,s)};Jr.prototype.getEffectiveDescriptor=function(n){var e=Rt(n),t=new Cn(e);this.mapTypes(e,function(r,o){t.addTrait(r,o)});var i=t.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i};Jr.prototype.definePackage=function(n,e){this.properties.define(n,"$pkg",{value:e})};function Fw(n,e,t){var i=e[t];if(i in n)throw new Error("package with "+t+" <"+i+"> already defined")}function es(n){this.model=n}es.prototype.set=function(n,e,t){if(!Ie(e)||!e.length)throw new TypeError("property name must be a non-empty string");var i=this.getProperty(n,e),r=i&&i.name;eI(t)?i?delete n[r]:delete n.$attrs[Zy(e)]:i?r in n?n[r]=t:Hw(n,i,t):n.$attrs[Zy(e)]=t};es.prototype.get=function(n,e){var t=this.getProperty(n,e);if(!t)return n.$attrs[Zy(e)];var i=t.name;return!n[i]&&t.isMany&&Hw(n,t,[]),n[i]};es.prototype.define=function(n,e,t){if(!t.writable){var i=t.value;t=T({},t,{get:function(){return i}}),delete t.value}Object.defineProperty(n,e,t)};es.prototype.defineDescriptor=function(n,e){this.define(n,"$descriptor",{value:e})};es.prototype.defineModel=function(n,e){this.define(n,"$model",{value:e})};es.prototype.getProperty=function(n,e){var t=this.model,i=t.getPropertyDescriptor(n,e);if(i)return i;if(e.includes(":"))return null;let r=t.config.strict;if(typeof r!="undefined"){let o=new TypeError(`unknown property <${e}> on <${n.$type}>`);if(r)throw o;typeof console!="undefined"&&console.warn(o)}return null};function eI(n){return typeof n=="undefined"}function Hw(n,e,t){Object.defineProperty(n,e.name,{enumerable:!e.isReference,writable:!0,value:t,configurable:!0})}function Zy(n){return n.replace(/^:/,"")}function dn(n,e={}){this.properties=new es(this),this.factory=new qw(this,this.properties),this.registry=new Jr(n,this.properties),this.typeCache={},this.config=e}dn.prototype.create=function(n,e){var t=this.getType(n);if(!t)throw new Error("unknown type <"+n+">");return new t(e)};dn.prototype.getType=function(n){var e=this.typeCache,t=Ie(n)?n:n.ns.name,i=e[t];return i||(n=this.registry.getEffectiveDescriptor(t),i=e[t]=this.factory.createType(n)),i};dn.prototype.createAny=function(n,e,t){var i=Rt(n),r={$type:n,$instanceOf:function(s){return s===this.$type},get:function(s){return this[s]},set:function(s,a){$w(this,[s],a)}},o={name:n,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:e}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"get",{enumerable:!1,writable:!0}),this.properties.define(r,"set",{enumerable:!1,writable:!0}),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),k(t,function(s,a){Pe(s)&&s.value!==void 0?r[s.name]=s.value:r[a]=s}),r};dn.prototype.getPackage=function(n){return this.registry.getPackage(n)};dn.prototype.getPackages=function(){return this.registry.getPackages()};dn.prototype.getElementDescriptor=function(n){return n.$descriptor};dn.prototype.hasType=function(n,e){e===void 0&&(e=n,n=this);var t=n.$model.getElementDescriptor(n);return e in t.allTypesByName};dn.prototype.getPropertyDescriptor=function(n,e){return this.getElementDescriptor(n).propertiesByName[e]};dn.prototype.getTypeDescriptor=function(n){return this.registry.typeMap[n]};var zw=String.fromCharCode,tI=Object.prototype.hasOwnProperty,nI=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,Ku={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(Ku).forEach(function(n){Ku[n.toUpperCase()]=Ku[n]});function iI(n,e,t,i){return i?tI.call(Ku,i)?Ku[i]:"&"+i+";":zw(e||parseInt(t,16))}function ts(n){return n.length>3&&n.indexOf("&")!==-1?n.replace(nI,iI):n}var Ww="non-whitespace outside of root node";function ca(n){return new Error(n)}function Uw(n){return"missing namespace for prefix <"+n+">"}function Qd(n){return{get:n,enumerable:!0}}function rI(n){var e={},t;for(t in n)e[t]=n[t];return e}function tv(n){return n+"$uri"}function oI(n){var e={},t,i;for(t in n)i=n[t],e[i]=i,e[tv(i)]=t;return e}function Qw(){return{line:0,column:0}}function sI(n){throw n}function nv(n){if(!this)return new nv(n);var e=n&&n.proxy,t,i,r,o,s=sI,a,l,c,u,f=Qw,h=!1,d=!1,p=null,m=!1,g;function b(x){x instanceof Error||(x=ca(x)),p=x,s(x,f)}function _(x){a&&(x instanceof Error||(x=ca(x)),a(x,f))}this.on=function(x,C){if(typeof C!="function")throw ca("required args <name, cb>");switch(x){case"openTag":i=C;break;case"text":t=C;break;case"closeTag":r=C;break;case"error":s=C;break;case"warn":a=C;break;case"cdata":o=C;break;case"attention":u=C;break;case"question":c=C;break;case"comment":l=C;break;default:throw ca("unsupported event: "+x)}return this},this.ns=function(x){if(typeof x=="undefined"&&(x={}),typeof x!="object")throw ca("required args <nsMap={}>");var C={},E;for(E in x)C[E]=x[E];return d=!0,g=C,this},this.parse=function(x){if(typeof x!="string")throw ca("required args <xml=string>");return p=null,v(x),f=Qw,m=!1,p},this.stop=function(){m=!0};function v(x){var C=d?[]:null,E=d?oI(g):null,S,w=[],R=0,A=!1,I=!1,D=0,N=0,W,Re,_e,ue,re,me,Ue,$e,Ct,Nt="",fn=0,ct;function Ti(){if(ct!==null)return ct;var fi,$n,jn,ar=d&&E.xmlns,lr=d&&h?[]:null,Je=fn,$t=Nt,Jo=$t.length,Tw,Xr,cr,Ai,Ae,aa={},Aw={},hi,oe,Oe;e:for(;Je<Jo;Je++)if(hi=!1,oe=$t.charCodeAt(Je),!(oe===32||oe<14&&oe>8)){for((oe<65||oe>122||oe>90&&oe<97)&&oe!==95&&oe!==58&&(_("illegal first char attribute name"),hi=!0),Oe=Je+1;Oe<Jo;Oe++)if(oe=$t.charCodeAt(Oe),!(oe>96&&oe<123||oe>64&&oe<91||oe>47&&oe<59||oe===46||oe===45||oe===95)){if(oe===32||oe<14&&oe>8){_("missing attribute value"),Je=Oe;continue e}if(oe===61)break;_("illegal attribute name char"),hi=!0}if(Ae=$t.substring(Je,Oe),Ae==="xmlns:xmlns"&&(_("illegal declaration of xmlns"),hi=!0),oe=$t.charCodeAt(Oe+1),oe===34)Oe=$t.indexOf('"',Je=Oe+2),Oe===-1&&(Oe=$t.indexOf("'",Je),Oe!==-1&&(_("attribute value quote missmatch"),hi=!0));else if(oe===39)Oe=$t.indexOf("'",Je=Oe+2),Oe===-1&&(Oe=$t.indexOf('"',Je),Oe!==-1&&(_("attribute value quote missmatch"),hi=!0));else for(_("missing attribute value quotes"),hi=!0,Oe=Oe+1;Oe<Jo&&(oe=$t.charCodeAt(Oe+1),!(oe===32||oe<14&&oe>8));Oe++);for(Oe===-1&&(_("missing closing quotes"),Oe=Jo,hi=!0),hi||(cr=$t.substring(Je,Oe)),Je=Oe;Oe+1<Jo&&(oe=$t.charCodeAt(Oe+1),!(oe===32||oe<14&&oe>8));Oe++)Je===Oe&&(_("illegal character after attribute end"),hi=!0);if(Je=Oe+1,hi)continue e;if(Ae in Aw){_("attribute <"+Ae+"> already defined");continue}if(Aw[Ae]=!0,!d){aa[Ae]=cr;continue}if(h){if(Xr=Ae==="xmlns"?"xmlns":Ae.charCodeAt(0)===120&&Ae.substr(0,6)==="xmlns:"?Ae.substr(6):null,Xr!==null){if(fi=ts(cr),$n=tv(Xr),Ai=g[fi],!Ai){if(Xr==="xmlns"||$n in E&&E[$n]!==fi)do Ai="ns"+R++;while(typeof E[Ai]!="undefined");else Ai=Xr;g[fi]=Ai}E[Xr]!==Ai&&(Tw||(E=rI(E),Tw=!0),E[Xr]=Ai,Xr==="xmlns"&&(E[tv(Ai)]=fi,ar=Ai),E[$n]=fi),aa[Ae]=cr;continue}lr.push(Ae,cr);continue}if(oe=Ae.indexOf(":"),oe===-1){aa[Ae]=cr;continue}if(!(jn=E[Ae.substring(0,oe)])){_(Uw(Ae.substring(0,oe)));continue}Ae=ar===jn?Ae.substr(oe+1):jn+Ae.substr(oe),aa[Ae]=cr}if(h)for(Je=0,Jo=lr.length;Je<Jo;Je++){if(Ae=lr[Je++],cr=lr[Je],oe=Ae.indexOf(":"),oe!==-1){if(!(jn=E[Ae.substring(0,oe)])){_(Uw(Ae.substring(0,oe)));continue}Ae=ar===jn?Ae.substr(oe+1):jn+Ae.substr(oe)}aa[Ae]=cr}return ct=aa}function Zo(){for(var fi=/(\r\n|\r|\n)/g,$n=0,jn=0,ar=0,lr=N,Je,$t;D>=ar&&(Je=fi.exec(x),!(!Je||(lr=Je[0].length+Je.index,lr>D)));)$n+=1,ar=lr;return D==-1?(jn=lr,$t=x.substring(N)):N===0?$t=x.substring(N,D):(jn=D-ar,$t=N==-1?x.substring(D):x.substring(D,N+1)),{data:$t,line:$n,column:jn}}for(f=Zo,e&&(Ct=Object.create({},{name:Qd(function(){return Ue}),originalName:Qd(function(){return $e}),attrs:Qd(Ti),ns:Qd(function(){return E})}));N!==-1;){if(x.charCodeAt(N)===60?D=N:D=x.indexOf("<",N),D===-1){if(w.length)return b("unexpected end of file");if(N===0)return b("missing start tag");N<x.length&&x.substring(N).trim()&&_(Ww);return}if(N!==D){if(w.length){if(t&&(t(x.substring(N,D),ts,f),m))return}else if(x.substring(N,D).trim()&&(_(Ww),m))return}if(ue=x.charCodeAt(D+1),ue===33){if(_e=x.charCodeAt(D+2),_e===91&&x.substr(D+3,6)==="CDATA["){if(N=x.indexOf("]]>",D),N===-1)return b("unclosed cdata");if(o&&(o(x.substring(D+9,N),f),m))return;N+=3;continue}if(_e===45&&x.charCodeAt(D+3)===45){if(N=x.indexOf("-->",D),N===-1)return b("unclosed comment");if(l&&(l(x.substring(D+4,N),ts,f),m))return;N+=3;continue}}if(ue===63){if(N=x.indexOf("?>",D),N===-1)return b("unclosed question");if(c&&(c(x.substring(D,N+2),f),m))return;N+=2;continue}for(W=D+1;;W++){if(re=x.charCodeAt(W),isNaN(re))return N=-1,b("unclosed tag");if(re===34)_e=x.indexOf('"',W+1),W=_e!==-1?_e:W;else if(re===39)_e=x.indexOf("'",W+1),W=_e!==-1?_e:W;else if(re===62){N=W;break}}if(ue===33){if(u&&(u(x.substring(D,N+1),ts,f),m))return;N+=1;continue}if(ct={},ue===47){if(A=!1,I=!0,!w.length)return b("missing open tag");if(W=Ue=w.pop(),_e=D+2+W.length,x.substring(D+2,_e)!==W)return b("closing tag mismatch");for(;_e<N;_e++)if(ue=x.charCodeAt(_e),!(ue===32||ue>8&&ue<14))return b("close tag")}else{if(x.charCodeAt(N-1)===47?(W=Ue=x.substring(D+1,N-1),A=!0,I=!0):(W=Ue=x.substring(D+1,N),A=!0,I=!1),!(ue>96&&ue<123||ue>64&&ue<91||ue===95||ue===58))return b("illegal first char nodeName");for(_e=1,Re=W.length;_e<Re;_e++)if(ue=W.charCodeAt(_e),!(ue>96&&ue<123||ue>64&&ue<91||ue>47&&ue<59||ue===45||ue===95||ue==46)){if(ue===32||ue<14&&ue>8){Ue=W.substring(0,_e),ct=null;break}return b("invalid nodeName")}I||w.push(Ue)}if(d){if(S=E,A&&(I||C.push(S),ct===null&&(h=W.indexOf("xmlns",_e)!==-1)&&(fn=_e,Nt=W,Ti(),h=!1)),$e=Ue,ue=Ue.indexOf(":"),ue!==-1){if(me=E[Ue.substring(0,ue)],!me)return b("missing namespace on <"+$e+">");Ue=Ue.substr(ue+1)}else me=E.xmlns;me&&(Ue=me+":"+Ue)}if(A&&(fn=_e,Nt=W,i&&(e?i(Ct,ts,I,f):i(Ue,Ti,ts,I,f),m)))return;if(I){if(r&&(r(e?Ct:Ue,ts,A,f),m))return;d&&(A?E=S:E=C.pop())}N+=1}}}function Kw(n){return n.xml&&n.xml.tagAlias==="lowerCase"}var iv={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},Gw="property";function Xw(n){return n.xml&&n.xml.serialize}function aI(n){let e=Xw(n);return e!==Gw&&(e||null)}function lI(n){return n.charAt(0).toUpperCase()+n.slice(1)}function Yw(n,e){return Kw(e)?n.prefix+":"+lI(n.localName):n.name}function cI(n,e){var t=n.name,i=n.localName,r=e&&e.xml&&e.xml.typePrefix;return r&&i.indexOf(r)===0?n.prefix+":"+i.slice(r.length):t}function uI(n,e,t){let i=Rt(n,e.xmlns),r=`${e[i.prefix]||i.prefix}:${i.localName}`,o=Rt(r);var s=t.getPackage(o.prefix);return cI(o,s)}function eo(n){return new Error(n)}function fr(n){return n.$descriptor}function fI(n){T(this,n),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw eo("expected element");var t=this.elementsById,i=fr(e),r=i.idProperty,o;if(r&&(o=e.get(r.name),o)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(o))throw new Error("illegal ID <"+o+">");if(t[o])throw eo("duplicate ID <"+o+">");t[o]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Gu(){}Gu.prototype.handleEnd=function(){};Gu.prototype.handleText=function(){};Gu.prototype.handleNode=function(){};function rv(){}rv.prototype=Object.create(Gu.prototype);rv.prototype.handleNode=function(){return this};function fa(){}fa.prototype=Object.create(Gu.prototype);fa.prototype.handleText=function(n){this.body=(this.body||"")+n};function Xu(n,e){this.property=n,this.context=e}Xu.prototype=Object.create(fa.prototype);Xu.prototype.handleNode=function(n){if(this.element)throw eo("expected no sub nodes");return this.element=this.createReference(n),this};Xu.prototype.handleEnd=function(){this.element.id=this.body};Xu.prototype.createReference=function(n){return{property:this.property.ns.name,id:""}};function ov(n,e){this.element=e,this.propertyDesc=n}ov.prototype=Object.create(fa.prototype);ov.prototype.handleEnd=function(){var n=this.body||"",e=this.element,t=this.propertyDesc;n=Ud(t.type,n),t.isMany?e.get(t.name).push(n):e.set(t.name,n)};function Kd(){}Kd.prototype=Object.create(fa.prototype);Kd.prototype.handleNode=function(n){var e=this,t=this.element;return t?e=this.handleChild(n):(t=this.element=this.createElement(n),this.context.addElement(t)),e};function Ht(n,e,t){this.model=n,this.type=n.getType(e),this.context=t}Ht.prototype=Object.create(Kd.prototype);Ht.prototype.addReference=function(n){this.context.addReference(n)};Ht.prototype.handleText=function(n){var e=this.element,t=fr(e),i=t.bodyProperty;if(!i)throw eo("unexpected body text <"+n+">");fa.prototype.handleText.call(this,n)};Ht.prototype.handleEnd=function(){var n=this.body,e=this.element,t=fr(e),i=t.bodyProperty;i&&n!==void 0&&(n=Ud(i.type,n),e.set(i.name,n))};Ht.prototype.createElement=function(n){var e=n.attributes,t=this.type,i=fr(t),r=this.context,o=new t({}),s=this.model,a;return k(e,function(l,c){var u=i.propertiesByName[c],f;u&&u.isReference?u.isMany?(f=l.split(" "),k(f,function(h){r.addReference({element:o,property:u.ns.name,id:h})})):r.addReference({element:o,property:u.ns.name,id:l}):(u?l=Ud(u.type,l):c==="xmlns"?c=":"+c:(a=Rt(c,i.ns.prefix),s.getPackage(a.prefix)&&r.addWarning({message:"unknown attribute <"+c+">",element:o,property:c,value:l})),o.set(c,l))}),o};Ht.prototype.getPropertyForNode=function(n){var e=n.name,t=Rt(e),i=this.type,r=this.model,o=fr(i),s=t.name,a=o.propertiesByName[s];if(a&&!a.isAttr){let c=aI(a);if(c){let u=n.attributes[c];if(u){let f=uI(u,n.ns,r),h=r.getType(f);return T({},a,{effectiveType:fr(h).name})}}return a}var l=r.getPackage(t.prefix);if(l){let c=Yw(t,l),u=r.getType(c);if(a=ye(o.properties,function(f){return!f.isVirtual&&!f.isReference&&!f.isAttribute&&u.hasType(f.type)}),a)return T({},a,{effectiveType:fr(u).name})}else if(a=ye(o.properties,function(c){return!c.isReference&&!c.isAttribute&&c.type==="Element"}),a)return a;throw eo("unrecognized element <"+t.name+">")};Ht.prototype.toString=function(){return"ElementDescriptor["+fr(this.type).name+"]"};Ht.prototype.valueHandler=function(n,e){return new ov(n,e)};Ht.prototype.referenceHandler=function(n){return new Xu(n,this.context)};Ht.prototype.handler=function(n){return n==="Element"?new ua(this.model,n,this.context):new Ht(this.model,n,this.context)};Ht.prototype.handleChild=function(n){var e,t,i,r;if(e=this.getPropertyForNode(n),i=this.element,t=e.effectiveType||e.type,ev(t))return this.valueHandler(e,i);e.isReference?r=this.referenceHandler(e).handleNode(n):r=this.handler(t).handleNode(n);var o=r.element;return o!==void 0&&(e.isMany?i.get(e.name).push(o):i.set(e.name,o),e.isReference?(T(o,{element:i}),this.context.addReference(o)):o.$parent=i),r};function sv(n,e,t){Ht.call(this,n,e,t)}sv.prototype=Object.create(Ht.prototype);sv.prototype.createElement=function(n){var e=n.name,t=Rt(e),i=this.model,r=this.type,o=i.getPackage(t.prefix),s=o&&Yw(t,o)||e;if(!r.hasType(s))throw eo("unexpected element <"+n.originalName+">");return Ht.prototype.createElement.call(this,n)};function ua(n,e,t){this.model=n,this.context=t}ua.prototype=Object.create(Kd.prototype);ua.prototype.createElement=function(n){var e=n.name,t=Rt(e),i=t.prefix,r=n.ns[i+"$uri"],o=n.attributes;return this.model.createAny(e,r,o)};ua.prototype.handleChild=function(n){var e=new ua(this.model,"Element",this.context).handleNode(n),t=this.element,i=e.element,r;return i!==void 0&&(r=t.$children=t.$children||[],r.push(i),i.$parent=t),e};ua.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function Gd(n){n instanceof dn&&(n={model:n}),T(this,{lax:!1},n)}Gd.prototype.fromXML=function(n,e,t){var i=e.rootHandler;e instanceof Ht?(i=e,e={}):typeof e=="string"?(i=this.handler(e),e={}):typeof i=="string"&&(i=this.handler(i));var r=this.model,o=this.lax,s=new fI(T({},e,{rootHandler:i})),a=new nv({proxy:!0}),l=hI();i.context=s,l.push(i);function c(C,E,S){var w=E(),R=w.line,A=w.column,I=w.data;I.charAt(0)==="<"&&I.indexOf(" ")!==-1&&(I=I.slice(0,I.indexOf(" "))+">");var D="unparsable content "+(I?I+" ":"")+`detected
[all...]
/plugin/bpmnioeditor/vendor/bpmnio-js/
Dbpmn-modeler.production.min.js7getPropertyForNode=function(e){var t,n,i=oi(e.name),r=this.type,o=this.model,a=Oi(r),s=i.name,c=a.… method in Hi
Dbpmn-modeler.development.js9791 ElementHandler.prototype.getPropertyForNode = function(node) {
9891 propertyDesc = this.getPropertyForNode(node);