| /plugin/bpmnioeditor/ |
| D | script.js | 171 zoomScroll: { enabled: false } property
|
| /plugin/bpmnioeditor/vendor/bpmnio-js/ |
| D | bpmn-modeler.development.js | 22700 zoomScroll: [ 'type', ZoomScroll ] property 36850 var zoomScroll = injector.get('zoomScroll', false); 36883 if (zoomScroll) { 36885 zoomScroll.stepZoom(opts.value);
|
| D | bpmn-modeler.production.min.js | 28 …type._init=function(e){this.toggle(e)};var ya={__init__:["zoomScroll"],zoomScroll:["type",va]};fun… property
|
| /plugin/bpmnio/vendor/dmn-js/dist/ |
| H A D | dmn-modeler.production.min.js | 16 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="`+l.width+'" height="'+l.height+'" viewBox="'+l.x+" "+l.y+" "+l.width+" "+l.height+'" version="1.1">'+a+s+"</svg>";t({svg:c})})});Et.prototype.getModules=function(){return this._modules};Et.prototype.destroy=function(){mr.prototype.destroy.call(this),Qe(this._container)};Et.prototype.on=function(n,e,t,i){return this.get("eventBus").on(n,e,t,i)};Et.prototype.off=function(n,e){this.get("eventBus").off(n,e)};Et.prototype._init=function(n,e){var{additionalModules:t,canvas:i,...r}=e,o=e.modules||this.getModules(),s=[{drd:["value",this]}],a=[...s,...o,...t||[]],l={...r,canvas:{...i,container:n},modules:a};mr.call(this,l),e&&e.container&&this.attachTo(e.container)};Et.prototype._emit=function(n,e){return this.get("eventBus").fire(n,e)};Et.prototype._createContainer=function(){return te('<div class="dmn-drd-container"></div>')};Et.prototype.open=function(n){var e=this;return new Promise((t,i)=>{var r;try{return e._definitions&&e.clear(),e._definitions=n,aC(e,n,function(o,s){o?(o.warnings=s||[],i(o)):t({warnings:s||[]})})}catch(o){r=o}r?(r.warnings=r.warnings||[],i(r)):t({warnings:[]})})};Et.prototype.attachTo=function(n){if(!n)throw new Error("parentNode required");this.detach();var e=this._container;n.appendChild(e),this._emit("attach",{}),this.get("canvas").resized()};Et.prototype.detach=function(){var n=this._container,e=n.parentNode;e&&(this._emit("detach",{}),e.removeChild(n))};Et.prototype._modules=[HC,qe,ht,mo,Ca,JC];function Yv(n){return{x:n.x+n.width/2,y:n.y+n.height/2}}function xr(n,e){return{x:n.x-e.x,y:n.y-e.y}}function pf(n){return Math.log(n)/Math.log(10)}function Zv(n,e){var t=pf(n.min),i=pf(n.max),r=Math.abs(t)+Math.abs(i);return r/e}function eE(n,e){return Math.max(n.min,Math.min(n.max,e))}var e$=Math.sign||function(n){return n>=0?1:-1},Jv={min:.2,max:4},tE=10,t$=.1,n$=.75;function Qn(n,e,t){n=n||{},this._enabled=!1,this._canvas=t,this._container=t._container,this._handleWheel=at(this._handleWheel,this),this._totalDelta=0,this._scale=n.scale||n$;var i=this;e.on("canvas.mouseover",function(){i._init(n.enabled!==!1)}),e.on("canvas.mouseout",function(){i._init(!1)})}Qn.$inject=["config.zoomScroll","eventBus","canvas"];Qn.prototype.scroll=function(e){this._canvas.scroll(e)};Qn.prototype.reset=function(){this._canvas.zoom("fit-viewport")};Qn.prototype.zoom=function(e,t){var i=Zv(Jv,tE*2);this._totalDelta+=e,Math.abs(this._totalDelta)>t$&&(this._zoom(e,t,i),this._totalDelta=0)};Qn.prototype._handleWheel=function(e){if(this._enabled){var t=this._container;e.preventDefault();var i=e.ctrlKey||xp()&&e.metaKey,r=e.shiftKey,o=-1*this._scale,s;if(i?o*=e.deltaMode===0?.02:.32:o*=e.deltaMode===0?1:16,i){var a=t.getBoundingClientRect(),l={x:e.clientX-a.left,y:e.clientY-a.top};s=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*e$(e.deltaY)*o,this.zoom(s,l)}else r?s={dx:o*e.deltaY,dy:0}:s={dx:o*e.deltaX,dy:o*e.deltaY},this.scroll(s)}};Qn.prototype.stepZoom=function(e,t){var i=Zv(Jv,tE);this._zoom(e,t,i)};Qn.prototype._zoom=function(n,e,t){var i=this._canvas,r=n>0?1:-1,o=pf(i.zoom()),s=Math.round(o/t)*t;s+=t*r;var a=Math.pow(10,s);i.zoom(eE(Jv,a),e)};Qn.prototype.toggle=function(e){var t=this._container,i=this._handleWheel,r=this._enabled;return typeof e=="undefined"&&(e=!r),r!==e&&q[e?"bind":"unbind"](t,"wheel",i,!1),this._enabled=e,e};Qn.prototype._init=function(n){this.toggle(n)};var nE={__init__:["zoomScroll"],zoomScroll:["type",Qn]};var i$=/^djs-cursor-.*$/;function mf(n){var e=ee(document.body);e.removeMatching(i$),n&&e.add("djs-cursor-"+n)}function Sp(){mf(null)}var r$=5e3;function Op(n,e){e=e||"element.click";function t(){return!1}return n.once(e,r$,t),function(){n.off(e,t)}}var o$=15;function kp(n,e){var t;function i(a){return s(a.originalEvent)}n.on("canvas.focus.changed",function(a){a.focused?n.on("element.mousedown",500,i):n.off("element.mousedown",i)});function r(a){var l=t.start,c=t.button,u=Un(a),f=xr(u,l);if(!t.dragging&&s$(f)>o$&&(t.dragging=!0,c===0&&Op(n),mf("grab")),t.dragging){var h=t.last||t.start;f=xr(u,h),e.scroll({dx:f.x,dy:f.y}),t.last=u}a.preventDefault()}function o(a){q.unbind(document,"mousemove",r),q.unbind(document,"mouseup",o),t=null,Sp()}function s(a){if(!De(a.target,".djs-draggable")){var l=a.button;if(!(l>=2||a.ctrlKey||a.shiftKey||a.altKey))return t={button:l,start:Un(a)},q.bind(document,"mousemove",r),q.bind(document,"mouseup",o),!0}}this.isActive=function(){return!!t}}kp.$inject=["eventBus","canvas"];function s$(n){return Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2))}var iE={__init__:["moveCanvas"],moveCanvas:["type",kp]};function Sa(n){return CSS.escape(n)}var a$={"&":"&","<":"<",">":">",'"':""","'":"'"};function rE(n){return n=""+n,n&&n.replace(/[&<>"']/g,function(e){return a$[e]})}var oE=["c","C"],sE=["v","V"],l$=["d","D"],c$=["x","X"],aE=["y","Y"],ex=["z","Z"];function lE(n){return n.ctrlKey||n.metaKey||n.shiftKey||n.altKey}function Mt(n){return n.altKey?!1:n.ctrlKey||n.metaKey}function Ve(n,e){return n=F(n)?n:[n],n.indexOf(e.key)!==-1||n.indexOf(e.code)!==-1}function Rp(n){return n.shiftKey}function cE(n){return Mt(n)&&Ve(oE,n)}function uE(n){return Mt(n)&&Ve(sE,n)}function fE(n){return Mt(n)&&Ve(l$,n)}function hE(n){return Mt(n)&&Ve(c$,n)}function Tp(n){return Mt(n)&&!Rp(n)&&Ve(ex,n)}function Ap(n){return Mt(n)&&(Ve(aE,n)||Ve(ex,n)&&Rp(n))}var pE=300;function J(n,e,t,i){this._open=!1,this._results={},this._eventMaps=[],this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._canvas=n,this._eventBus=e,this._selection=t,this._translate=i,this._container=this._getBoxHtml(),this._searchInput=X(J.INPUT_SELECTOR,this._container),this._resultsContainer=X(J.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),e.on(["canvas.destroy","diagram.destroy","drag.init","elements.changed"],this.close,this)}J.$inject=["canvas","eventBus","selection","translate"];J.prototype._bindEvents=function(){var n=this;function e(t,i,r,o){n._eventMaps.push({el:t,type:r,listener:_t.bind(t,i,r,o)})}e(document,"html","click",function(t){n.close(!1)}),e(this._container,J.INPUT_SELECTOR,"click",function(t){t.stopPropagation(),t.delegateTarget.focus()}),e(this._container,J.RESULT_SELECTOR,"mouseover",function(t){t.stopPropagation(),n._scrollToNode(t.delegateTarget),n._preselect(t.delegateTarget)}),e(this._container,J.RESULT_SELECTOR,"click",function(t){t.stopPropagation(),n._select(t.delegateTarget)}),e(this._container,J.INPUT_SELECTOR,"keydown",function(t){Ve("ArrowUp",t)&&t.preventDefault(),Ve("ArrowDown",t)&&t.preventDefault()}),e(this._container,J.INPUT_SELECTOR,"keyup",function(t){if(Ve("Escape",t))return n.close();if(Ve("Enter",t)){var i=n._getCurrentResult();return i?n._select(i):n.close(!1)}if(Ve("ArrowUp",t))return n._scrollToDirection(!0);if(Ve("ArrowDown",t))return n._scrollToDirection();Ve(["ArrowLeft","ArrowRight"],t)||n._search(t.delegateTarget.value)})};J.prototype._unbindEvents=function(){this._eventMaps.forEach(function(n){_t.unbind(n.el,n.type,n.listener)})};J.prototype._search=function(n){var e=this;if(this._clearResults(),!!n.trim()){var t=this._searchProvider.find(n);if(t=t.filter(function(r){return!e._canvas.getRootElements().includes(r.element)}),!t.length){this._selection.select(null);return}t.forEach(function(r){var o=r.element.id,s=e._createResultNode(r,o);e._results[o]={element:r.element,node:s}});var i=X(J.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(i),this._preselect(i)}};J.prototype._scrollToDirection=function(n){var e=this._getCurrentResult();if(e){var t=n?e.previousElementSibling:e.nextElementSibling;t&&(this._scrollToNode(t),this._preselect(t))}};J.prototype._scrollToNode=function(n){if(!(!n||n===this._getCurrentResult())){var e=n.offsetTop,t=this._resultsContainer.scrollTop,i=e-this._resultsContainer.clientHeight+n.clientHeight;e<t?this._resultsContainer.scrollTop=e:t<i&&(this._resultsContainer.scrollTop=i)}};J.prototype._clearResults=function(){no(this._resultsContainer),this._results={},this._eventBus.fire("searchPad.cleared")};J.prototype._getCurrentResult=function(){return X(J.RESULT_SELECTED_SELECTOR,this._resultsContainer)};J.prototype._createResultNode=function(n,e){var t=te(J.RESULT_HTML);return n.primaryTokens.length>0&&dE(t,n.primaryTokens,J.RESULT_PRIMARY_HTML),dE(t,n.secondaryTokens,J.RESULT_SECONDARY_HTML),et(t,J.RESULT_ID_ATTRIBUTE,e),this._resultsContainer.appendChild(t),t};J.prototype.registerProvider=function(n){this._searchProvider=n};J.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._cachedRootElement=this._canvas.getRootElement(),this._cachedSelection=this._selection.get(),this._cachedViewbox=this._canvas.viewbox(),this._selection.select(null),this._bindEvents(),this._open=!0,ee(this._canvas.getContainer()).add("djs-search-open"),ee(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))};J.prototype.close=function(n=!0){this.isOpen()&&(n&&(this._cachedRootElement&&this._canvas.setRootElement(this._cachedRootElement),this._cachedSelection&&this._selection.select(this._cachedSelection),this._cachedViewbox&&this._canvas.viewbox(this._cachedViewbox),this._eventBus.fire("searchPad.restored")),this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._unbindEvents(),this._open=!1,ee(this._canvas.getContainer()).remove("djs-search-open"),ee(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._eventBus.fire("searchPad.closed"),this._canvas.restoreFocus())};J.prototype.toggle=function(){this.isOpen()?this.close():this.open()};J.prototype.isOpen=function(){return this._open};J.prototype._preselect=function(n){var e=this._getCurrentResult();if(n!==e){e&&ee(e).remove(J.RESULT_SELECTED_CLASS);var t=et(n,J.RESULT_ID_ATTRIBUTE),i=this._results[t].element;ee(n).add(J.RESULT_SELECTED_CLASS),this._canvas.scrollToElement(i,{top:pE}),this._selection.select(i),this._eventBus.fire("searchPad.preselected",i)}};J.prototype._select=function(n){var e=et(n,J.RESULT_ID_ATTRIBUTE),t=this._results[e].element;this._cachedSelection=null,this._cachedViewbox=null,this.close(!1),this._canvas.scrollToElement(t,{top:pE}),this._selection.select(t),this._eventBus.fire("searchPad.selected",t)};J.prototype._getBoxHtml=function(){let n=te(J.BOX_HTML),e=X(J.INPUT_SELECTOR,n);return e&&e.setAttribute("aria-label",this._translate("Search in diagram")),n};function dE(n,e,t){var i=u$(e),r=te(t);r.innerHTML=i,n.appendChild(r)}function u$(n){var e="";return n.forEach(function(t){var i=rE(t.value||t.matched||t.normal),r=t.match||t.matched;r?e+='<b class="'+J.RESULT_HIGHLIGHT_CLASS+'">'+i+"</b>":e+=i}),e!==""?e:null}J.CONTAINER_SELECTOR=".djs-search-container";J.INPUT_SELECTOR=".djs-search-input input";J.RESULTS_CONTAINER_SELECTOR=".djs-search-results";J.RESULT_SELECTOR=".djs-search-result";J.RESULT_SELECTED_CLASS="djs-search-result-selected";J.RESULT_SELECTED_SELECTOR="."+J.RESULT_SELECTED_CLASS;J.RESULT_ID_ATTRIBUTE="data-result-id";J.RESULT_HIGHLIGHT_CLASS="djs-search-highlight";J.BOX_HTML=`<div class="djs-search-container djs-scrollable"> property 248 `,this._current.container)};Le.prototype.open=function(n,e,t,i){if(!n)throw new Error("target is missing");if(!e)throw new Error("providers for <"+e+"> not found");if(!t)throw new Error("position is missing");var r=this._eventBus.fire("popupMenu.open.allowed",{target:n,providerId:e});if(r===!1)return;this.isOpen()&&this.close();let{entries:o,headerEntries:s,emptyPlaceholder:a}=this._getContext(n,e);this._current={position:t,providerId:e,target:n,entries:o,headerEntries:s,emptyPlaceholder:a,container:this._createContainer({provider:e}),options:i},this._emit("open"),this._bindAutoClose(),this._render()};Le.prototype.refresh=function(){if(!this.isOpen())return;let{target:n,providerId:e}=this._current,{entries:t,headerEntries:i,emptyPlaceholder:r}=this._getContext(n,e);this._current={...this._current,entries:t,headerEntries:i,emptyPlaceholder:r},this._emit("refresh"),this._render()};Le.prototype._getContext=function(n,e){let t=this._getProviders(e);if(!t||!t.length)throw new Error("provider for <"+e+"> not found");let i=this._getEntries(n,t),r=this._getHeaderEntries(n,t),o=this._getEmptyPlaceholder(t);return{entries:i,headerEntries:r,emptyPlaceholder:o,empty:!(Object.keys(i).length||Object.keys(r).length)}};Le.prototype.close=function(){this.isOpen()&&(this._emit("close"),this.reset(),this._canvas.restoreFocus(),this._current=null)};Le.prototype.reset=function(){let n=this._current.container;cm(null,n),Qe(n)};Le.prototype._emit=function(n,e){this._eventBus.fire(`popupMenu.${n}`,e)};Le.prototype._onOpened=function(){this._emit("opened")};Le.prototype._onClosed=function(){this._emit("closed")};Le.prototype._createContainer=function(n){var e=this._canvas,t=e.getContainer();let i=te(`<div class="djs-popup-parent djs-scrollable" data-popup=${n.provider}></div>`);return t.appendChild(i),i};Le.prototype._bindAutoClose=function(){this._eventBus.once(WS,this.close,this)};Le.prototype._unbindAutoClose=function(){this._eventBus.off(WS,this.close,this)};Le.prototype._updateScale=function(){var n=this._canvas.zoom(),e=this._config.scale,t,i,r=n;return e!==!0&&(e===!1?(t=1,i=1):(t=e.min,i=e.max),Me(t)&&n<t&&(r=t),Me(i)&&n>i&&(r=i)),r};Le.prototype._ensureVisible=function(n,e){var t=document.documentElement.getBoundingClientRect(),i=n.getBoundingClientRect(),r={},o=e.x,s=e.y;return e.x+i.width>t.width&&(r.x=!0),e.y+i.height>t.height&&(r.y=!0),r.x&&r.y?(o=e.x-i.width,s=e.y-i.height):r.x?(o=e.x-i.width,s=e.y):r.y&&e.y<i.height?(o=e.x,s=10):r.y&&(o=e.x,s=e.y-i.height),e.y<t.top&&(s=e.y+i.height),{x:o,y:s}};Le.prototype.isEmpty=function(n,e){if(!n)throw new Error("target is missing");if(!e)throw new Error("provider ID is missing");let t=this._getProviders(e);return!t||!t.length?!0:this._getContext(n,e).empty};Le.prototype.registerProvider=function(n,e,t){t||(t=e,e=Ij),this._eventBus.on("popupMenu.getProviders."+n,e,function(i){i.providers.push(t)})};Le.prototype._getProviders=function(n){var e=this._eventBus.createEvent({type:"popupMenu.getProviders."+n,providers:[]});return this._eventBus.fire(e),e.providers};Le.prototype._getEntries=function(n,e){var t={};return k(e,function(i){if(!i.getPopupMenuEntries){k(i.getEntries(n),function(o){var s=o.id;if(!s)throw new Error("entry ID is missing");t[s]=Uu(o,["id"])});return}var r=i.getPopupMenuEntries(n);ge(r)?t=r(t):k(r,function(o,s){t[s]=o})}),t};Le.prototype._getHeaderEntries=function(n,e){var t={};return k(e,function(i){if(!i.getPopupMenuHeaderEntries){if(!i.getHeaderEntries)return;k(i.getHeaderEntries(n),function(o){var s=o.id;if(!s)throw new Error("entry ID is missing");t[s]=Uu(o,["id"])});return}var r=i.getPopupMenuHeaderEntries(n);ge(r)?t=r(t):k(r,function(o,s){t[s]=o})}),t};Le.prototype._getEmptyPlaceholder=function(n){let e=n.find(t=>ge(t.getEmptyPlaceholder));return e&&e.getEmptyPlaceholder()};Le.prototype.isOpen=function(){return!!this._current};Le.prototype.trigger=function(n,e,t="click"){if(n.preventDefault(),!e){let r=De(n.delegateTarget||n.target,".entry",!0),o=et(r,Dj);e={id:o,...this._getEntry(o)}}let i=e.action;if(this._emit("trigger",{entry:e,event:n})!==!1){if(ge(i)){if(t==="click")return i(n,e)}else if(i[t])return i[t](n,e)}};Le.prototype._getEntry=function(n){var e=this._current.entries[n]||this._current.headerEntries[n];if(!e)throw new Error("entry not found");return e};function US(n){return Object.entries(n).map(([e,t])=>{let i={id:e,...t};return i.entries&&(i.entries=US(i.entries)),i})}function Rx(n,e,t){let{keys:i}=t;if(e=e.trim().toLowerCase(),!e)throw new Error("<pattern> must not be empty");let r=e.trim().toLowerCase().split(/\s+/);return n.flatMap(o=>{let s=Lj(o,r,i);return s?{item:o,tokens:s}:[]}).sort(Bj(i))}function Lj(n,e,t){let{matchedWords:i,tokens:r}=t.reduce((o,s)=>{let a=n[s],{tokens:l,matchedWords:c}=F(a)?a.reduce((u,f)=>{let{tokens:h,matchedWords:d}=XS(f,e);return{tokens:[...u.tokens,h],matchedWords:{...u.matchedWords,...d}}},{matchedWords:{},tokens:[]}):XS(a,e);return{tokens:{...o.tokens,[s]:l},matchedWords:{...o.matchedWords,...c}}},{matchedWords:{},tokens:{}});return Object.keys(i).length!==e.length?null:r}function Bj(n){return(e,t)=>{let i=0,r=1;for(let o of n){let s=Nj(e.tokens[o],t.tokens[o]);if(s!==0){i+=s*r,r*=QS;continue}let a=$j(e.item[o],t.item[o]);if(a!==0){i+=a*r,r*=QS;continue}}return i}}function Nj(n,e){return KS(e)-KS(n)}var QS=.5,Da={FULL:131.9,START_FULL_WORD:8,START_WORD_PART:7.87,WORD_START:2.19,WORD_PART:1,NO_MATCH:-.07};function KS(n){let e=n.reduce((a,l)=>a+YS(l),0),t=n.flat(),i=t.reduce((a,l)=>a+l.value.length,0),r=t.reduce((a,l)=>a+(l.match?l.value.length:0),0),o=i?r/i:0;return e*(1+o)}function YS(n){if(F(n))return Math.max(...n.map(YS));let e=Math.log(n.value.length);return n.match?(n.start?n.end?Da.FULL:n.wordEnd?Da.START_FULL_WORD:Da.START_WORD_PART:n.wordStart?Da.WORD_START:Da.WORD_PART)*e:Da.NO_MATCH*e}function GS(n=""){return F(n)?n.join(", "):n}function $j(n,e){return GS(n).localeCompare(GS(e))}function XS(n,e){var c;if(!n)return{tokens:[],matchedWords:{}};let t=[],i={},r=e.map(jj),o=[`(?<all>${r.join("\\s+")})`,...r].join("|"),s=new RegExp(o,"ig"),a,l=0;for(;a=s.exec(n);){let[u]=a,f=a.index,h=a.index+u.length,d=f===0,p=h===n.length,m=!!((c=a.groups)!=null&&c.all),g=d||/\s/.test(n.charAt(f-1)),b=p||/\s/.test(n.charAt(h));a.index>l&&t.push({value:n.slice(l,a.index),index:l}),t.push({value:u,index:a.index,match:!0,wordStart:g,wordEnd:b,start:d,end:p,all:m});let _=m?e:[u];for(let v of _)i[v.toLowerCase()]=!0;l=a.index+u.length}return l<n.length&&t.push({value:n.slice(l),index:l}),{tokens:t,matchedWords:i}}function jj(n){return n.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&")}var ZS={search:["value",Rx]};var JS={__depends__:[ZS],__init__:["popupMenu"],popupMenu:["type",Le]};var eO=Math.round;function Rf(n,e){this._modeling=n,this._eventBus=e}Rf.$inject=["modeling","eventBus"];Rf.prototype.replaceElement=function(n,e,t){if(n.waypoints)return null;var i=this._modeling,r=this._eventBus;r.fire("replace.start",{element:n,attrs:e,hints:t});var o=e.width||n.width,s=e.height||n.height,a=e.x||n.x,l=e.y||n.y,c=eO(a+o/2),u=eO(l+s/2),f=i.replaceShape(n,T({},e,{x:c,y:u,width:o,height:s}),t);return r.fire("replace.end",{element:n,newElement:f,hints:t}),f};function hm(n,e){e.on("replace.end",500,function(t){let{newElement:i,hints:r={}}=t;r.select!==!1&&n.select(i)})}hm.$inject=["selection","eventBus"];var tO={__init__:["replace","replaceSelectionBehavior"],replaceSelectionBehavior:["type",hm],replace:["type",Rf]};function dm(n,e,t,i){function r(o,s,a){a=a||{};var l=s.type,c=o.businessObject,u=n.create(l),f={type:l,businessObject:u};if(f.width=o.width,f.height=o.height,u.name=c.name,s.table){var h=n.create("dmn:DecisionTable");h.$parent=u;var d=n.create("dmn:OutputClause");d.typeRef="string",d.$parent=h,h.output=[d];var p=n.create("dmn:InputClause");p.$parent=h;var m=n.create("dmn:LiteralExpression",{typeRef:"string"});p.inputExpression=m,m.$parent=p,h.input=[p],nO(u,h,n)}if(s.expression){var g=n.create("dmn:LiteralExpression"),b=n.create("dmn:InformationItem",{name:c.name});nO(u,g,n,b)}return e.replaceElement(o,f,a)}this.replaceElement=r}dm.$inject=["drdFactory","replace","selection","modeling"];function nO(n,e,t,i){if(O(n,"dmn:Decision"))n.decisionLogic=e,e.$parent=n;else if(O(n,"dmn:BusinessKnowledgeModel")){var r=t.create("dmn:FunctionDefinition",{body:e});n.encapsulatedLogic=r,r.$parent=n,e.$parent=r}i&&(n.variable=i,i.$parent=n)}var iO={__depends__:[tO,ht],drdReplace:["type",dm]};var Tx={DECISION:[{label:"Empty",actionName:"replace-with-empty-decision",className:"dmn-icon-clear",target:{type:"dmn:Decision",table:!1,expression:!1}},{label:"Decision table",actionName:"replace-with-decision-table",className:"dmn-icon-decision-table",target:{type:"dmn:Decision",table:!0,expression:!1}},{label:"Literal expression",actionName:"replace-with-literal-expression",className:"dmn-icon-literal-expression",target:{type:"dmn:Decision",table:!1,expression:!0}}],BKM:[{label:"Empty",actionName:"replace-with-empty",className:"dmn-icon-clear",target:{type:"dmn:BusinessKnowledgeModel",table:!1,expression:!1}},{label:"Literal Expression",actionName:"replace-with-literal-expression",className:"dmn-icon-literal-expression",target:{type:"dmn:BusinessKnowledgeModel",table:!1,expression:!0}}]};function Er(n,e,t,i,r,o){this._popupMenu=n,this._modeling=e,this._moddle=t,this._drdReplace=i,this._rules=r,this._translate=o,this.register()}Er.$inject=["popupMenu","modeling","moddle","drdReplace","rules","translate"];Er.prototype.register=function(){this._popupMenu.registerProvider("dmn-replace",this)};Er.prototype.getEntries=function(n){var e=n.businessObject,t=this._rules,i,r;return t.allowed("shape.replace",{element:n})?O(e,"dmn:Decision")?(r=dr(e),i=Ee(Tx.DECISION,function(o){var s=o.actionName==="replace-with-empty-decision"&&r,a=o.actionName==="replace-with-decision-table"&&!O(r,"dmn:DecisionTable"),l=o.actionName==="replace-with-literal-expression"&&!O(r,"dmn:LiteralExpression");return s||a||l}),this._createEntries(n,i)):O(e,"dmn:BusinessKnowledgeModel")?(r=dr(e),i=Ee(Tx.BKM,function(o){var s=o.actionName==="replace-with-empty"&&r,a=o.actionName==="replace-with-decision-table"&&!O(r,"dmn:DecisionTable"),l=o.actionName==="replace-with-literal-expression"&&!O(r,"dmn:LiteralExpression");return s||a||l}),this._createEntries(n,i)):[]:[]};Er.prototype._createEntries=function(n,e){var t=[],i=this;return k(e,function(r){var o=i._createMenuEntry(r,n);t.push(o)}),t};Er.prototype._createMenuEntry=function(n,e,t){var i=this._drdReplace.replaceElement,r=this._translate,o=function(){return i(e,n.target)};t=t||o;var s={label:r(n.label),className:n.className,id:n.actionName,action:t};return s};Er.prototype.getHeaderEntries=function(n){return[]};var rO={__depends__:[qe,JS,iO],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",Er]};function vs(n,e,t,i,r,o,s,a,l,c,u,f){u=u||{},e.registerProvider(this),this._contextPad=e,this._modeling=t,this._elementFactory=i,this._connect=r,this._create=o,this._rules=s,this._popupMenu=a,this._canvas=l,this._translate=c,u.autoPlace!==!1&&(this._autoPlace=f.get("autoPlace",!1)),n.on("create.end",250,function(h){var d=h.context.shape;if(hf(h)){var p=e.getEntries(d);p.replace&&p.replace.action.click(h,d)}})}vs.$inject=["eventBus","contextPad","modeling","elementFactory","connect","create","rules","popupMenu","canvas","translate","config.contextPad","injector"];vs.prototype.getContextPadEntries=function(n){var e=this._modeling,t=this._elementFactory,i=this._connect,r=this._create,o=this._popupMenu,s=this._contextPad,a=this._rules,l=this._translate,c=this._autoPlace,u={};if(n.type==="label")return u;var f=n.businessObject;function h(b,_,v){i.start(b,_,v)}function d(b){e.removeElements([n])}function p(b){var _=5,v=s.getPad(b).html,x=v.getBoundingClientRect(),C={x:x.left,y:x.bottom+_};return C}function m(b,_,v,x){function C(S,w){var R=t.createShape(T({type:b},x));r.start(S,R,{source:w,hints:{connectionTarget:w}})}var E=c?function(S,w){var R=t.createShape(T({type:b},x));c.append(w,R,{connectionTarget:w})}:C;return{group:"model",className:_,title:v,action:{dragstart:C,click:E}}}O(f,"dmn:Decision")&&T(u,{"append.decision":m("dmn:Decision","dmn-icon-decision",l("Append decision"))}),Ge(f,["dmn:BusinessKnowledgeModel","dmn:Decision","dmn:KnowledgeSource"])&&T(u,{"append.knowledge-source":m("dmn:KnowledgeSource","dmn-icon-knowledge-source",l("Append knowledge source"))}),Ge(f,["dmn:BusinessKnowledgeModel","dmn:Decision"])&&T(u,{"append.business-knowledge-model":m("dmn:BusinessKnowledgeModel","dmn-icon-business-knowledge",l("Append business knowledge model"))}),Ge(f,["dmn:Decision","dmn:KnowledgeSource"])&&T(u,{"append.input-data":m("dmn:InputData","dmn-icon-input-data",l("Append input data"))}),O(f,"dmn:DRGElement")&&T(u,{"append.text-annotation":m("dmn:TextAnnotation","dmn-icon-text-annotation",l("Add text annotation")),connect:{group:"connect",className:"dmn-icon-connection-multi",title:l("Connect to other element"),action:{click:h,dragstart:h}}}),O(f,"dmn:TextAnnotation")&&T(u,{connect:{group:"connect",className:"dmn-icon-connection-multi",title:l("Connect to other element"),action:{click:h,dragstart:h}}}),o.isEmpty(n,"dmn-replace")||T(u,{replace:{group:"edit",className:"dmn-icon-screw-wrench",title:l("Change type"),action:{click:function(b,_){var v=T(p(_),{cursor:{x:b.x,y:b.y}});o.open(_,"dmn-replace",v)}}}});var g=a.allowed("elements.delete",{elements:[n]});return F(g)&&(g=g[0]===n),g&&T(u,{delete:{group:"edit",className:"dmn-icon-trash",title:l("Delete"),action:{click:d}}}),u};vs.prototype.getMultiElementContextPadEntries=function(n){var e=this._modeling,t=this._translate,i={};return this._isDeleteAllowed(n)&&T(i,{delete:{group:"edit",className:"dmn-icon-trash",title:t("Delete"),action:{click:(r,o)=>e.removeElements(o.slice())}}}),i};vs.prototype._isDeleteAllowed=function(n){var e=this._rules.allowed("elements.delete",{elements:n});return F(e)?kt(n,t=>e.includes(t)):e};var oO={__depends__:[qe,oS,ht,lS,Zp,rO],__init__:["contextPadProvider"],contextPadProvider:["type",vs]};var Fj="djs-dragger";function pi(n,e,t,i){this._canvas=e,this._graphicsFactory=t,this._elementFactory=i,this._connectionDocking=n.get("connectionDocking",!1),this._layouter=n.get("layouter",!1)}pi.$inject=["injector","canvas","graphicsFactory","elementFactory"];pi.prototype.drawPreview=function(n,e,t){t=t||{};var i=n.connectionPreviewGfx,r=n.getConnection,o=t.source,s=t.target,a=t.waypoints,l=t.connectionStart,c=t.connectionEnd,u=t.noLayout,f=t.noCropping,h=t.noNoop,d,p=this;if(i||(i=n.connectionPreviewGfx=this.createConnectionPreviewGfx()),ss(i),r||(r=n.getConnection=qj(function(m,g,b){return p.getConnection(m,g,b)})),e&&(d=r(e,o,s)),!d){!h&&this.drawNoopPreview(i,t);return}d.waypoints=a||[],this._layouter&&!u&&(d.waypoints=this._layouter.layoutConnection(d,{source:o,target:s,connectionStart:l,connectionEnd:c,waypoints:t.waypoints||d.waypoints})),(!d.waypoints||!d.waypoints.length)&&(d.waypoints=[o?le(o):l,s?le(s):c]),this._connectionDocking&&(o||s)&&!f&&(d.waypoints=this._connectionDocking.getCroppedWaypoints(d,o,s)),this._graphicsFactory.drawConnection(i,d,{stroke:"var(--element-dragger-color)"})};pi.prototype.drawNoopPreview=function(n,e){var t=e.source,i=e.target,r=e.connectionStart||le(t),o=e.connectionEnd||le(i),s=this.cropWaypoints(r,o,t,i),a=this.createNoopConnection(s[0],s[1]);K(n,a)};pi.prototype.cropWaypoints=function(n,e,t,i){var r=this._graphicsFactory,o=t&&r.getShapePath(t),s=i&&r.getShapePath(i),a=r.getConnectionPath({waypoints:[n,e]});return n=t&&tf(o,a,!0)||n,e=i&&tf(s,a,!1)||e,[n,e]};pi.prototype.cleanUp=function(n){n&&n.connectionPreviewGfx&&Fe(n.connectionPreviewGfx)};pi.prototype.getConnection=function(n){var e=Vj(n);return this._elementFactory.createConnection(e)};pi.prototype.createConnectionPreviewGfx=function(){var n=Q("g");return j(n,{pointerEvents:"none"}),ne(n).add(Fj),K(this._canvas.getActiveLayer(),n),n};pi.prototype.createNoopConnection=function(n,e){return ro([n,e],{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"})};function qj(n){var e={};return function(t){var i=JSON.stringify(t),r=e[i];return r||(r=e[i]=n.apply(null,arguments)),r}}function Vj(n){return Pe(n)?n:{}}var sO={__init__:["connectionPreview"],connectionPreview:["type",pi]};var Hj=/\s/,zj=/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i,Wj=/^[a-z_][\w-.]*$/i,Uj=/\$\{([^}]*)\}/g;function aO(n,e){let t=n.$model.ids.assigned(e),i=t&&t!==n;return e?i?"Element must have unique ID.":Qj(e):"Element must have ID."}function Qj(n){if(n=Gj(n),Kj(n))return"Id must not contain spaces.";if(!Wj.test(n))return zj.test(n)?"Id must not contain prefix.":"Id must be a valid QName."}function Kj(n){return Hj.test(n)}function Gj(n){return n.replace(Uj,"$1")}var Xj=300;function bo(n,e,t,i,r){this._eventBus=n,this._modeling=e,this._canvas=t,this._definitionPropertiesView=i,this._translate=r,n.on("definitionIdView.create",function(o){this._container=o.html;var s=X(".dmn-definitions-name",this._container),a=X(".dmn-definitions-id",this._container);this._setup(s,"name"),this._setup(a,"id")},this)}bo.$inject=["eventBus","modeling","canvas","definitionPropertiesView","translate"];bo.prototype.update=function(n,e){var t=this._canvas.getRootElement(),i={};if(i[n]=e,n==="id"){var r=aO(Ke(t),e);if(r){this._addErrorMessage(r);return}this._clearErrorMessage()}this._modeling.updateProperties(t,i)};bo.prototype._setup=function(n,e){var t=this;n.setAttribute("contenteditable",!0),n.addEventListener("input",Mi(function(i){var r=i.target.value||i.target.textContent;t.update(e,r.trim())},Xj)),n.addEventListener("keydown",function(i){i.keyCode===13&&(n.blur(),window.getSelection().removeAllRanges())}),n.addEventListener("blur",function(){t._clearErrorMessage(),t._definitionPropertiesView.update()})};bo.prototype._addErrorMessage=function(n){let e='<span class="dmn-definitions-error-message">'+this._translate(n)+"</span>";var t=X(".dmn-definitions-id",this._container);this._clearErrorMessage(),ee(t).add("dmn-definitions-error"),t.parentElement.appendChild(te(e))};bo.prototype._clearErrorMessage=function(){var n=X(".dmn-definitions-id",this._container);if(ee(n).has("dmn-definitions-error")){ee(n).remove("dmn-definitions-error");let e=X(".dmn-definitions-error-message",this._container);n.parentNode.removeChild(e)}};var lO={__depends__:[Ca],__init__:["definitionPropertiesEdit","definitionPropertiesPaletteAdapter"],definitionPropertiesEdit:["type",bo],definitionPropertiesPaletteAdapter:["type",wa]};var Yj={horizontal:["x","width"],vertical:["y","height"]},cO=5;function mi(n,e){this._modeling=n,this._filters=[],this.registerFilter(function(t){var i=e.allowed("elements.distribute",{elements:t});return F(i)?i:i?t:[]})}mi.$inject=["modeling","rules"];mi.prototype.registerFilter=function(n){if(typeof n!="function")throw new Error("the filter has to be a function");this._filters.push(n)};mi.prototype.trigger=function(n,e){var t=this._modeling,i,r;if(!(n.length<3)&&(this._setOrientation(e),r=this._filterElements(n),i=this._createGroups(r),!(i.length<=2)))return t.distributeElements(i,this._axis,this._dimension),i};mi.prototype._filterElements=function(n){var e=this._filters,t=this._axis,i=this._dimension,r=[].concat(n);return e.length?(k(e,function(o){r=o(r,t,i)}),r):n};mi.prototype._createGroups=function(n){var e=[],t=this,i=this._axis,r=this._dimension;if(!i)throw new Error('must have a defined "axis" and "dimension"');var o=Fn(n,i);return k(o,function(s,a){var l=t._findRange(s,i,r),c,u=e[e.length-1];u&&t._hasIntersection(u.range,l)?e[e.length-1].elements.push(s):(c={range:l,elements:[s]},e.push(c))}),e};mi.prototype._setOrientation=function(n){var e=Yj[n];this._axis=e[0],this._dimension=e[1]};mi.prototype._hasIntersection=function(n,e){return Math.max(n.min,n.max)>=Math.min(e.min,e.max)&&Math.min(n.min,n.max)<=Math.max(e.min,e.max)};mi.prototype._findRange=function(n){var e=n[this._axis],t=n[this._dimension];return{min:e+cO,max:e+t-cO}};var uO={__init__:["distributeElements"],distributeElements:["type",mi]};function pm(n){n.registerFilter(function(e){return Ee(e,function(t){var i=Ge(t,["dmn:AuthorityRequirement","dmn:InformationRequirement","dmn:KnowledgeRequirement","dmn:Association","dmn:TextAnnotation"]);return!(t.labelTarget||i)})})}pm.$inject=["distributeElements"];var fO={__depends__:[uO],__init__:["drdDistributeElements"],drdDistributeElements:["type",pm]};var hO="is not a registered action",Zj="is already registered";function sn(n,e){this._eventBus=n,this._actions={};var t=this;n.on("diagram.init",function(){t._registerDefaultActions(e),n.fire("editorActions.init",{editorActions:t})})}sn.$inject=["eventBus","injector"];sn.prototype._registerDefaultActions=function(n){var e=n.get("commandStack",!1),t=n.get("modeling",!1),i=n.get("selection",!1),r=n.get("zoomScroll",!1),o=n.get("copyPaste",!1),s=n.get("canvas",!1),a=n.get("rules",!1),l=n.get("keyboardMove",!1),c=n.get("keyboardMoveSelection",!1);e&&(this.register("undo",function(){e.undo()}),this.register("redo",function(){e.redo()})),o&&i&&this.register("copy",function(){var u=i.get();if(u.length)return o.copy(u)}),o&&i&&this.register("duplicate",function(){var u=i.get();if(u.length)return o.duplicate(u)}),o&&this.register("paste",function(){o.paste()}),o&&i&&a&&this.register("cut",function(){var u=i.get();if(u.length){var f=a.allowed("elements.delete",{elements:u});if(f!==!1){var h=F(f)?f:u;return o.cut(h.slice())}}}),r&&this.register("stepZoom",function(u){r.stepZoom(u.value)}),s&&this.register("zoom",function(u){s.zoom(u.value)}),t&&i&&a&&this.register("removeSelection",function(){var u=i.get();if(u.length){var f=a.allowed("elements.delete",{elements:u}),h;f!==!1&&(F(f)?h=f:h=u,h.length&&t.removeElements(h.slice()))}}),l&&this.register("moveCanvas",function(u){l.moveCanvas(u)}),c&&this.register("moveSelection",function(u){c.moveSelection(u.direction,u.accelerated)})};sn.prototype.trigger=function(n,e){if(!this._actions[n])throw Ax(n,hO);var t=this._eventBus.fire("editorActions.allowed",{action:n,opts:e});if(t!==!1)return this._actions[n](e)};sn.prototype.register=function(n,e){var t=this;if(typeof n=="string")return this._registerAction(n,e);k(n,function(i,r){t._registerAction(r,i)})};sn.prototype._registerAction=function(n,e){if(this.isRegistered(n))throw Ax(n,Zj);this._actions[n]=e};sn.prototype.unregister=function(n){if(!this.isRegistered(n))throw Ax(n,hO);this._actions[n]=void 0};sn.prototype.getActions=function(){return Object.keys(this._actions)};sn.prototype.isRegistered=function(n){return!!this._actions[n]};function Ax(n,e){return new Error(n+" "+e)}var dO={__init__:["editorActions"],editorActions:["type",sn]};function Ia(n){n.invoke(sn,this)}fe(Ia,sn);Ia.$inject=["injector"];Ia.prototype._registerDefaultActions=function(n){sn.prototype._registerDefaultActions.call(this,n);let e=n.get("canvas",!1),t=n.get("elementRegistry",!1),i=n.get("selection",!1),r=n.get("lassoTool",!1),o=n.get("handTool",!1),s=n.get("directEditing",!1),a=n.get("distributeElements",!1),l=n.get("alignElements",!1),c=n.get("searchPad",!1);e&&t&&i&&this._registerAction("selectElements",function(){var u=e.getRootElement(),f=t.filter(function(h){return h!==u});return i.select(f),f}),i&&a&&this._registerAction("distributeElements",function(u){var f=i.get(),h=u.type;f.length>2&&a.trigger(f,h)}),i&&l&&this._registerAction("alignElements",function(u){var f=i.get(),h=u.type;f.length>1&&l.trigger(f,h)}),r&&this._registerAction("lassoTool",function(){r.toggle()}),o&&this._registerAction("handTool",function(){o.toggle()}),i&&s&&this._registerAction("directEditing",function(){var u=i.get();u.length&&s.activate(u[0])}),i&&c&&this._registerAction("find",function(){c.toggle()})};var pO={__depends__:[dO],editorActions:["type",Ia]};function La(n){return n.dmnDI&&n.dmnDI.diagrams&&n.dmnDI.diagrams[0]}function mm(n,e,t,i){function r(o){var s=o.dmnDI;s||(s=n.create("dmndi:DMNDI"),o.set("dmnDI",s));var a=n.create("dmndi:DMNDiagram");s.set("diagrams",[a]);var l=0;k(o.get("drgElement"),function(c){if(O(c,"dmn:Decision")){var u=e._getDefaultSize(c),f=n.createDiShape(c,{x:150+l*30,y:150+l*30,width:u.width,height:u.height});i.updateDiParent(f,a),l++}})}t.on("import.start",({definitions:o})=>{La(o)||r(o)})}mm.$inject=["drdFactory","elementFactory","eventBus","drdUpdater"];var mO={__init__:["diGenerator"],diGenerator:["type",mm]};var Jj=1e3;function ae(n){this._eventBus=n}ae.$inject=["eventBus"];function eF(n,e){return function(t){return n.call(e||null,t.context,t.command,t)}}ae.prototype.on=function(n,e,t,i,r,o){if((ge(e)||se(e))&&(o=r,r=i,i=t,t=e,e=null),ge(t)&&(o=r,r=i,i=t,t=Jj),Pe(r)&&(o=r,r=!1),!ge(i))throw new Error("handlerFn must be a function");F(n)||(n=[n]);var s=this._eventBus;k(n,function(a){var l=["commandStack",a,e].filter(function(c){return c}).join(".");s.on(l,t,r?eF(i,o):i,o)})};ae.prototype.canExecute=Sr("canExecute");ae.prototype.preExecute=Sr("preExecute");ae.prototype.preExecuted=Sr("preExecuted");ae.prototype.execute=Sr("execute");ae.prototype.executed=Sr("executed");ae.prototype.postExecute=Sr("postExecute");ae.prototype.postExecuted=Sr("postExecuted");ae.prototype.revert=Sr("revert");ae.prototype.reverted=Sr("reverted");function Sr(n){return function(t,i,r,o,s){(ge(t)||se(t))&&(s=o,o=r,r=i,i=t,t=null),this.on(t,n,i,r,o,s)}}function Or(n,e){ae.call(this,n),this._gridSnapping=e;var t=this;this.preExecute("shape.resize",function(i){var r=i.context,o=r.hints||{},s=o.autoResize;if(s){var a=r.shape,l=r.newBounds;Ie(s)?r.newBounds=t.snapComplex(l,s):r.newBounds=t.snapSimple(a,l)}})}Or.$inject=["eventBus","gridSnapping","modeling"];fe(Or,ae);Or.prototype.snapSimple=function(n,e){var t=this._gridSnapping;return e.width=t.snapValue(e.width,{min:e.width}),e.height=t.snapValue(e.height,{min:e.height}),e.x=n.x+n.width/2-e.width/2,e.y=n.y+n.height/2-e.height/2,e};Or.prototype.snapComplex=function(n,e){return/w|e/.test(e)&&(n=this.snapHorizontally(n,e)),/n|s/.test(e)&&(n=this.snapVertically(n,e)),n};Or.prototype.snapHorizontally=function(n,e){var t=this._gridSnapping,i=/w/.test(e),r=/e/.test(e),o={};return o.width=t.snapValue(n.width,{min:n.width}),r&&(i?(o.x=t.snapValue(n.x,{max:n.x}),o.width+=t.snapValue(n.x-o.x,{min:n.x-o.x})):n.x=n.x+n.width-o.width),T(n,o),n};Or.prototype.snapVertically=function(n,e){var t=this._gridSnapping,i=/n/.test(e),r=/s/.test(e),o={};return o.height=t.snapValue(n.height,{min:n.height}),i&&(r?(o.y=t.snapValue(n.y,{max:n.y}),o.height+=t.snapValue(n.y-o.y,{min:n.y-o.y})):n.y=n.y+n.height-o.height),T(n,o),n};var tF=2e3;function gm(n,e){n.on(["spaceTool.move","spaceTool.end"],tF,function(t){var i=t.context;if(i.initialized){var r=i.axis,o;r==="x"?(o=e.snapValue(t.dx),t.x=t.x+o-t.dx,t.dx=o):(o=e.snapValue(t.dy),t.y=t.y+o-t.dy,t.dy=o)}})}gm.$inject=["eventBus","gridSnapping"];var gO={__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",Or],gridSnappingSpaceToolBehavior:["type",gm]};var Tf=10;function ym(n,e,t){return t||(t="round"),Math[t](n/e)*e}var nF=1200,iF=800;function Fi(n,e,t){var i=!t||t.active!==!1;this._eventBus=e;var r=this;e.on("diagram.init",iF,function(){r.setActive(i)}),e.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],nF,function(o){var s=o.originalEvent;if(!(!r.active||s&&Mt(s))){var a=o.context,l=a.gridSnappingContext;l||(l=a.gridSnappingContext={}),["x","y"].forEach(function(c){var u={},f=oF(o,c,n);f&&(u.offset=f);var h=rF(o,c);h&&T(u,h),wr(o,c)||r.snapEvent(o,c,u)})}})}Fi.prototype.snapEvent=function(n,e,t){var i=this.snapValue(n[e],t);vn(n,e,i)};Fi.prototype.getGridSpacing=function(){return Tf};Fi.prototype.snapValue=function(n,e){var t=0;e&&e.offset&&(t=e.offset),n+=t,n=ym(n,Tf);var i,r;return e&&e.min&&(i=e.min,se(i)&&(i=ym(i+t,Tf,"ceil"),n=Math.max(n,i))),e&&e.max&&(r=e.max,se(r)&&(r=ym(r+t,Tf,"floor"),n=Math.min(n,r))),n-=t,n};Fi.prototype.isActive=function(){return this.active};Fi.prototype.setActive=function(n){this.active=n,this._eventBus.fire("gridSnapping.toggle",{active:n})};Fi.prototype.toggleActive=function(){this.setActive(!this.active)};Fi.$inject=["elementRegistry","eventBus","config.gridSnapping"];function rF(n,e){var t=n.context,i=t.createConstraints,r=t.resizeConstraints||{},o=t.gridSnappingContext,s=o.snapConstraints;if(s&&s[e])return s[e];s||(s=o.snapConstraints={}),s[e]||(s[e]={});var a=t.direction;i&&(vm(e)?(s.x.min=i.left,s.x.max=i.right):(s.y.min=i.top,s.y.max=i.bottom));var l=r.min,c=r.max;return l&&(vm(e)?vO(a)?s.x.max=l.left:s.x.min=l.right:yO(a)?s.y.max=l.top:s.y.min=l.bottom),c&&(vm(e)?vO(a)?s.x.min=c.left:s.x.max=c.right:yO(a)?s.y.min=c.top:s.y.max=c.bottom),s[e]}function oF(n,e,t){var i=n.context,r=n.shape,o=i.gridSnappingContext,s=o.snapLocation,a=o.snapOffset;return a&&se(a[e])||(a||(a=o.snapOffset={}),se(a[e])||(a[e]=0),!r)||(t.get(r.id)||(vm(e)?a[e]+=r[e]+r.width/2:a[e]+=r[e]+r.height/2),!s)||(e==="x"?/left/.test(s)?a[e]-=r.width/2:/right/.test(s)&&(a[e]+=r.width/2):/top/.test(s)?a[e]-=r.height/2:/bottom/.test(s)&&(a[e]+=r.height/2)),a[e]}function vm(n){return n==="x"}function yO(n){return n.indexOf("n")!==-1}function vO(n){return n.indexOf("w")!==-1}var xO={__depends__:[gO],__init__:["gridSnapping"],gridSnapping:["type",Fi]};var xm="keyboard.keydown",sF="keyboard.keyup",aF=1e3,bO="Keyboard binding is now implicit; explicit binding to an element got removed. For more information, see https://github.com/bpmn-io/diagram-js/issues/661";function Pt(n,e){var t=this;this._config=n=n||{},this._eventBus=e,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),e.on("diagram.destroy",function(){t._fire("destroy"),t.unbind()}),n.bindTo&&console.error("unsupported configuration <keyboard.bindTo>",new Error(bO));var i=n&&n.bind!==!1;e.on("canvas.init",function(r){t._target=r.svg,i&&t.bind(),t._fire("init")})}Pt.$inject=["config.keyboard","eventBus"];Pt.prototype._keydownHandler=function(n){this._keyHandler(n,xm)};Pt.prototype._keyupHandler=function(n){this._keyHandler(n,sF)};Pt.prototype._keyHandler=function(n,e){var t;if(!this._isEventIgnored(n)){var i={keyEvent:n};t=this._eventBus.fire(e||xm,i),t&&n.preventDefault()}};Pt.prototype._isEventIgnored=function(n){return!1};Pt.prototype.bind=function(n){n&&console.error("unsupported argument <node>",new Error(bO)),this.unbind(),n=this._node=this._target,q.bind(n,"keydown",this._keydownHandler),q.bind(n,"keyup",this._keyupHandler),this._fire("bind")};Pt.prototype.getBinding=function(){return this._node};Pt.prototype.unbind=function(){var n=this._node;n&&(this._fire("unbind"),q.unbind(n,"keydown",this._keydownHandler),q.unbind(n,"keyup",this._keyupHandler)),this._node=null};Pt.prototype._fire=function(n){this._eventBus.fire("keyboard."+n,{node:this._node})};Pt.prototype.addListener=function(n,e,t){ge(n)&&(t=e,e=n,n=aF),this._eventBus.on(t||xm,n,e)};Pt.prototype.removeListener=function(n,e){this._eventBus.off(e||xm,n)};Pt.prototype.hasModifier=lE;Pt.prototype.isCmd=Mt;Pt.prototype.isShift=Rp;Pt.prototype.isKey=Ve;var lF=500;function kr(n,e){var t=this;n.on("editorActions.init",lF,function(i){var r=i.editorActions;t.registerBindings(e,r)})}kr.$inject=["eventBus","keyboard"];kr.prototype.registerBindings=function(n,e){function t(i,r){e.isRegistered(i)&&n.addListener(r)}t("undo",function(i){var r=i.keyEvent;if(Tp(r))return e.trigger("undo"),!0}),t("redo",function(i){var r=i.keyEvent;if(Ap(r))return e.trigger("redo"),!0}),t("copy",function(i){var r=i.keyEvent;if(cE(r))return e.trigger("copy"),!0}),t("paste",function(i){var r=i.keyEvent;if(uE(r))return e.trigger("paste"),!0}),t("duplicate",function(i){var r=i.keyEvent;if(fE(r))return e.trigger("duplicate"),!0}),t("cut",function(i){var r=i.keyEvent;if(hE(r))return e.trigger("cut"),!0}),t("stepZoom",function(i){var r=i.keyEvent;if(Ve(["+","Add","="],r)&&Mt(r))return e.trigger("stepZoom",{value:1}),!0}),t("stepZoom",function(i){var r=i.keyEvent;if(Ve(["-","Subtract"],r)&&Mt(r))return e.trigger("stepZoom",{value:-1}),!0}),t("zoom",function(i){var r=i.keyEvent;if(Ve("0",r)&&Mt(r))return e.trigger("zoom",{value:1}),!0}),t("removeSelection",function(i){var r=i.keyEvent;if(Ve(["Backspace","Delete","Del"],r))return e.trigger("removeSelection"),!0})};var _o={__init__:["keyboard","keyboardBindings"],keyboard:["type",Pt],keyboardBindings:["type",kr]};function Ba(n){n.invoke(kr,this)}fe(Ba,kr);Ba.$inject=["injector"];Ba.prototype.registerBindings=function(n,e){kr.prototype.registerBindings.call(this,n,e);function t(i,r){e.isRegistered(i)&&n.addListener(r)}t("selectElements",function(i){var r=i.keyEvent;if(n.isKey(["a","A"],r)&&n.isCmd(r))return e.trigger("selectElements"),!0}),t("lassoTool",function(i){var r=i.keyEvent;if(!n.hasModifier(r)&&n.isKey(["l","L"],r))return e.trigger("lassoTool"),!0}),t("handTool",function(i){var r=i.keyEvent;if(!n.hasModifier(r)&&n.isKey(["h","H"],r))return e.trigger("handTool"),!0}),t("directEditing",function(i){var r=i.keyEvent;if(!n.hasModifier(r)&&n.isKey(["e","E"],r))return e.trigger("directEditing"),!0}),t("find",function(i){var r=i.keyEvent;if(n.isKey(["f","F"],r)&&n.isCmd(r))return e.trigger("find"),!0})};var _O={__depends__:[_o],__init__:["keyboardBindings"],keyboardBindings:["type",Ba]};var cF={moveSpeed:50,moveSpeedAccelerated:200};function bm(n,e,t){var i=this;this._config=T({},cF,n||{}),e.addListener(r);function r(o){var s=o.keyEvent,a=i._config;if(e.isCmd(s)&&e.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],s)){var l=e.isShift(s)?a.moveSpeedAccelerated:a.moveSpeed,c;switch(s.key){case"ArrowLeft":case"Left":c="left";break;case"ArrowUp":case"Up":c="up";break;case"ArrowRight":case"Right":c="right";break;case"ArrowDown":case"Down":c="down";break}return i.moveCanvas({speed:l,direction:c}),!0}}this.moveCanvas=function(o){var s=0,a=0,l=o.speed,c=l/Math.min(Math.sqrt(t.viewbox().scale),1);switch(o.direction){case"left":s=c;break;case"up":a=c;break;case"right":s=-c;break;case"down":a=-c;break}t.scroll({dx:s,dy:a})}}bm.$inject=["config.keyboardMove","keyboard","canvas"];var wO={__depends__:[_o],__init__:["keyboardMove"],keyboardMove:["type",bm]};var uF={moveSpeed:1,moveSpeedAccelerated:10},fF=1500,CO="left",EO="up",SO="right",OO="down",hF={ArrowLeft:CO,Left:CO,ArrowUp:EO,Up:EO,ArrowRight:SO,Right:SO,ArrowDown:OO,Down:OO},dF={left:function(n){return{x:-n,y:0}},up:function(n){return{x:0,y:-n}},right:function(n){return{x:n,y:0}},down:function(n){return{x:0,y:n}}};function _m(n,e,t,i,r){var o=this;this._config=T({},uF,n||{}),e.addListener(fF,function(s){var a=s.keyEvent,l=hF[a.key];if(l&&!e.isCmd(a)){var c=e.isShift(a);return o.moveSelection(l,c),!0}}),this.moveSelection=function(s,a){var l=r.get();if(l.length){var c=this._config[a?"moveSpeedAccelerated":"moveSpeed"],u=dF[s](c),f=i.allowed("elements.move",{shapes:l,hints:{keyboardMove:!0}});f&&t.moveElements(l,u)}}}_m.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];var kO={__depends__:[_o,ht],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",_m]};function ke(n,e){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=e,this._eventBus=n,this._uid=1,n.on(["diagram.destroy","diagram.clear"],function(){this.clear(!1)},this)}ke.$inject=["eventBus","injector"];ke.prototype.execute=function(n,e){if(!n)throw new Error("command required");this._currentExecution.trigger="execute";let t={command:n,context:e};this._pushAction(t),this._internalExecute(t),this._popAction()};ke.prototype.canExecute=function(n,e){let t={command:n,context:e},i=this._getHandler(n),r=this._fire(n,"canExecute",t);if(r===void 0){if(!i)return!1;i.canExecute&&(r=i.canExecute(e))}return r};ke.prototype.clear=function(n){this._stack.length=0,this._stackIdx=-1,n!==!1&&this._fire("changed",{trigger:"clear"})};ke.prototype.undo=function(){let n=this._getUndoAction(),e;if(n){for(this._currentExecution.trigger="undo",this._pushAction(n);n&&(this._internalUndo(n),e=this._getUndoAction(),!(!e||e.id!==n.id));)n=e;this._popAction()}};ke.prototype.redo=function(){let n=this._getRedoAction(),e;if(n){for(this._currentExecution.trigger="redo",this._pushAction(n);n&&(this._internalExecute(n,!0),e=this._getRedoAction(),!(!e||e.id!==n.id));)n=e;this._popAction()}};ke.prototype.register=function(n,e){this._setHandler(n,e)};ke.prototype.registerHandler=function(n,e){if(!n||!e)throw new Error("command and handlerCls must be defined");let t=this._injector.instantiate(e);this.register(n,t)};ke.prototype.canUndo=function(){return!!this._getUndoAction()};ke.prototype.canRedo=function(){return!!this._getRedoAction()};ke.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]};ke.prototype._getUndoAction=function(){return this._stack[this._stackIdx]};ke.prototype._internalUndo=function(n){let e=n.command,t=n.context,i=this._getHandler(e);this._atomicDo(()=>{this._fire(e,"revert",n),i.revert&&this._markDirty(i.revert(t)),this._revertedAction(n),this._fire(e,"reverted",n)})};ke.prototype._fire=function(n,e,t){arguments.length<3&&(t=e,e=null);let i=e?[n+"."+e,e]:[n],r;t=this._eventBus.createEvent(t);for(let o of i)if(r=this._eventBus.fire("commandStack."+o,t),t.cancelBubble)break;return r};ke.prototype._createId=function(){return this._uid++};ke.prototype._atomicDo=function(n){let e=this._currentExecution;e.atomic=!0;try{n()}finally{e.atomic=!1}};ke.prototype._internalExecute=function(n,e){let t=n.command,i=n.context,r=this._getHandler(t);if(!r)throw new Error("no command handler registered for <"+t+">");this._pushAction(n),e||(this._fire(t,"preExecute",n),r.preExecute&&r.preExecute(i),this._fire(t,"preExecuted",n)),this._atomicDo(()=>{this._fire(t,"execute",n),r.execute&&this._markDirty(r.execute(i)),this._executedAction(n,e),this._fire(t,"executed",n)}),e||(this._fire(t,"postExecute",n),r.postExecute&&r.postExecute(i),this._fire(t,"postExecuted",n)),this._popAction()};ke.prototype._pushAction=function(n){let e=this._currentExecution,t=e.actions,i=t[0];if(e.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+n.command+")");n.id||(n.id=i&&i.id||this._createId()),t.push(n)};ke.prototype._popAction=function(){let n=this._currentExecution,e=n.trigger,t=n.actions,i=n.dirty;t.pop(),t.length||(this._eventBus.fire("elements.changed",{elements:Bw("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:e}),n.trigger=null)};ke.prototype._markDirty=function(n){let e=this._currentExecution;n&&(n=F(n)?n:[n],e.dirty=e.dirty.concat(n))};ke.prototype._executedAction=function(n,e){let t=++this._stackIdx;e||this._stack.splice(t,this._stack.length,n)};ke.prototype._revertedAction=function(n){this._stackIdx--};ke.prototype._getHandler=function(n){return this._handlerMap[n]};ke.prototype._setHandler=function(n,e){if(!n||!e)throw new Error("command and handler required");if(this._handlerMap[n])throw new Error("overriding handler for command <"+n+">");this._handlerMap[n]=e};var xs={commandStack:["type",ke]};function wm(n,e,t,i){n.on("element.changed",function(r){var o=r.element;(o.parent||o===e.getRootElement())&&(r.gfx=t.getGraphics(o)),r.gfx&&n.fire(ip(o)+".changed",r)}),n.on("elements.changed",function(r){var o=r.elements;o.forEach(function(s){n.fire("element.changed",{element:s})}),i.updateContainments(o)}),n.on("shape.changed",function(r){i.update("shape",r.element,r.gfx)}),n.on("connection.changed",function(r){i.update("connection",r.element,r.gfx)})}wm.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var Cm={__init__:["changeSupport"],changeSupport:["type",wm]};var RO=Math.min,TO=Math.max;function Mx(n){n.preventDefault()}function Af(n){n.stopPropagation()}function pF(n){return n.nodeType===Node.TEXT_NODE}function mF(n){return[].slice.call(n)}function On(n){this.container=n.container,this.parent=te('<div class="djs-direct-editing-parent"><div class="djs-direct-editing-content" contenteditable="true"></div></div>'),this.content=X("[contenteditable]",this.parent),this.keyHandler=n.keyHandler||function(){},this.resizeHandler=n.resizeHandler||function(){},this.autoResize=at(this.autoResize,this),this.handlePaste=at(this.handlePaste,this)}On.prototype.create=function(n,e,t,i){var r=this,o=this.parent,s=this.content,a=this.container;i=this.options=i||{},e=this.style=e||{};var l=hn(e,["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);T(o.style,{width:n.width+"px",height:n.height+"px",maxWidth:n.maxWidth+"px",maxHeight:n.maxHeight+"px",minWidth:n.minWidth+"px",minHeight:n.minHeight+"px",left:n.x+"px",top:n.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},l);var c=hn(e,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return T(s.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},c),i.centerVertically&&T(s.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},c),s.innerText=t,q.bind(s,"keydown",this.keyHandler),q.bind(s,"mousedown",Af),q.bind(s,"paste",r.handlePaste),i.autoResize&&q.bind(s,"input",this.autoResize),i.resizable&&this.resizable(e),a.appendChild(o),this.setSelection(s.lastChild,s.lastChild&&s.lastChild.length),o};On.prototype.handlePaste=function(n){var e=this.options,t=this.style;n.preventDefault();var i;if(n.clipboardData?i=n.clipboardData.getData("text/plain"):i=window.clipboardData.getData("Text"),this.insertText(i),e.autoResize){var r=this.autoResize(t);r&&this.resizeHandler(r)}};On.prototype.insertText=function(n){n=gF(n);var e=document.execCommand("insertText",!1,n);e||this._insertTextIE(n)};On.prototype._insertTextIE=function(n){var e=this.getSelection(),t=e.startContainer,i=e.endContainer,r=e.startOffset,o=e.endOffset,s=e.commonAncestorContainer,a=mF(s.childNodes),l,c;if(pF(s)){var u=t.textContent;t.textContent=u.substring(0,r)+n+u.substring(o),l=t,c=r+n.length}else if(t===this.content&&i===this.content){var f=document.createTextNode(n);this.content.insertBefore(f,a[r]),l=f,c=f.textContent.length}else{var h=a.indexOf(t),d=a.indexOf(i);a.forEach(function(p,m){m===h?p.textContent=t.textContent.substring(0,r)+n+i.textContent.substring(o):m>h&&m<=d&&Qe(p)}),l=t,c=r+n.length}l&&c!==void 0&&setTimeout(function(){self.setSelection(l,c)})};On.prototype.autoResize=function(){var n=this.parent,e=this.content,t=parseInt(this.style.fontSize)||12;if(e.scrollHeight>n.offsetHeight||e.scrollHeight<n.offsetHeight-t){var i=n.getBoundingClientRect(),r=e.scrollHeight;n.style.height=r+"px",this.resizeHandler({width:i.width,height:i.height,dx:0,dy:r-i.height})}};On.prototype.resizable=function(){var n=this,e=this.parent,t=this.resizeHandle,i=parseInt(this.style.minWidth)||0,r=parseInt(this.style.minHeight)||0,o=parseInt(this.style.maxWidth)||1/0,s=parseInt(this.style.maxHeight)||1/0;if(!t){t=this.resizeHandle=te('<div class="djs-direct-editing-resize-handle"></div>');var a,l,c,u,f=function(p){Mx(p),Af(p),a=p.clientX,l=p.clientY;var m=e.getBoundingClientRect();c=m.width,u=m.height,q.bind(document,"mousemove",h),q.bind(document,"mouseup",d)},h=function(p){Mx(p),Af(p);var m=RO(TO(c+p.clientX-a,i),o),g=RO(TO(u+p.clientY-l,r),s);e.style.width=m+"px",e.style.height=g+"px",n.resizeHandler({width:c,height:u,dx:p.clientX-a,dy:p.clientY-l})},d=function(p){Mx(p),Af(p),q.unbind(document,"mousemove",h,!1),q.unbind(document,"mouseup",d,!1)};q.bind(t,"mousedown",f)}T(t.style,{position:"absolute",bottom:"0px",right:"0px",cursor:"nwse-resize",width:"0",height:"0",borderTop:(parseInt(this.style.fontSize)/4||3)+"px solid transparent",borderRight:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderBottom:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderLeft:(parseInt(this.style.fontSize)/4||3)+"px solid transparent"}),e.appendChild(t)};On.prototype.destroy=function(){var n=this.parent,e=this.content,t=this.resizeHandle;e.innerText="",n.removeAttribute("style"),e.removeAttribute("style"),q.unbind(e,"keydown",this.keyHandler),q.unbind(e,"mousedown",Af),q.unbind(e,"input",this.autoResize),q.unbind(e,"paste",this.handlePaste),t&&(t.removeAttribute("style"),Qe(t)),Qe(n)};On.prototype.getValue=function(){return this.content.innerText.trim()};On.prototype.getSelection=function(){var n=window.getSelection(),e=n.getRangeAt(0);return e};On.prototype.setSelection=function(n,e){var t=document.createRange();n===null?t.selectNodeContents(this.content):(t.setStart(n,e),t.setEnd(n,e));var i=window.getSelection();i.removeAllRanges(),i.addRange(t)};function gF(n){return n.replace(/\r\n|\r|\n/g,` [all...] |
| /plugin/bpmnio/vendor/bpmn-js/dist/ |
| H A D | bpmn-modeler.production.min.js | 10 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="`+c.width+'" height="'+c.height+'" viewBox="'+c.x+" "+c.y+" "+c.width+" "+c.height+'" version="1.1">'+s+a+"</svg>"}catch(r){n=r}if(this._emit("saveSVG.done",{error:n,svg:t}),n)throw n;return{svg:t}};$e.prototype._setDefinitions=function(e){this._definitions=e};$e.prototype.getModules=function(){return this._modules};$e.prototype.clear=function(){this.getDefinitions()&&tr.prototype.clear.call(this)};$e.prototype.destroy=function(){tr.prototype.destroy.call(this),Wt(this._container)};$e.prototype.on=function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)};$e.prototype.off=function(e,t){this.get("eventBus").off(e,t)};$e.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),typeof e=="string"&&(e=_e(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()};$e.prototype.getDefinitions=function(){return this._definitions};$e.prototype.detach=function(){let e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))};$e.prototype._init=function(e,t,n){let r=n.modules||this.getModules(n),i=n.additionalModules||[],o=[{bpmnjs:["value",this],moddle:["value",t]}],a=[].concat(o,r,i),s=C(Nt(n,["additionalModules"]),{canvas:C({},n.canvas,{container:e}),modules:a});tr.call(this,s),n&&n.container&&this.attachTo(n.container)};$e.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)};$e.prototype._createContainer=function(e){let t=ue('<div class="bjs-container"></div>');return vt(t,{width:mh(e.width),height:mh(e.height),position:e.position}),t};$e.prototype._createModdle=function(e){let t=C({},this._moddleExtensions,e.moddleExtensions);return new ph(t)};$e.prototype._modules=[];function Nc(e,t){return e.warnings=t,e}function YS(e){let n=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return n&&(e.message="unparsable content <"+n[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+n[2]),e}var XS={width:"100%",height:"100%",position:"relative"};function mh(e){return e+(ne(e)?"px":"")}function ZS(e,t){return t&&re(e.diagrams,function(n){return n.id===t})||null}function QS(e){let n='<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+Xl+"</a>",r=ue(n);vt(_e("svg",r),Zl),vt(r,Ql,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(r),se.bind(r,"click",function(i){dh(),i.preventDefault()})}function Ai(e){$e.call(this,e),this.on("import.parse.complete",function(t){t.error||this._collectIds(t.definitions,t.elementsById)},this),this.on("diagram.destroy",function(){this.get("moddle").ids.clear()},this)}B(Ai,$e);Ai.prototype._createModdle=function(e){var t=$e.prototype._createModdle.call(this,e);return t.ids=new En([32,36,1]),t};Ai.prototype._collectIds=function(e,t){var n=e.$model,r=n.ids,i;r.clear();for(i in t)r.claim(i,t[i])};N();N();function ie(e,t){return h(e,"bpmn:CallActivity")?!1:h(e,"bpmn:SubProcess")?(t=t||ce(e),t&&h(t,"bpmndi:BPMNPlane")?!0:t&&!!t.isExpanded):h(e,"bpmn:Participant")?!!j(e).processRef:!0}function Me(e){if(!(!h(e,"bpmn:Participant")&&!h(e,"bpmn:Lane"))){var t=ce(e).isHorizontal;return t===void 0?!0:t}}function hh(e){return e&&j(e).isInterrupting!==!1}function Qe(e){return e&&!!j(e).triggeredByEvent}function Er(e,t){var n=j(e).eventDefinitions;return Lt(n,function(r){return h(r,t)})}function vh(e){return Er(e,"bpmn:ErrorEventDefinition")}function gh(e){return Er(e,"bpmn:EscalationEventDefinition")}function yh(e){return Er(e,"bpmn:CompensateEventDefinition")}N();var ir={width:90,height:20},_h=15;function mn(e){return h(e,"bpmn:Event")||h(e,"bpmn:Gateway")||h(e,"bpmn:DataStoreReference")||h(e,"bpmn:DataObjectReference")||h(e,"bpmn:DataInput")||h(e,"bpmn:DataOutput")||h(e,"bpmn:SequenceFlow")||h(e,"bpmn:MessageFlow")||h(e,"bpmn:Group")}function Xr(e){return ee(e.label)}function JS(e){var t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)],i=e1(e),o=Math.atan((r.y-n.y)/(r.x-n.x)),a=i.x,s=i.y;return Math.abs(o)<Math.PI/2?s-=_h:a+=_h,{x:a,y:s}}function e1(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 La(e){return e.waypoints?JS(e.waypoints):h(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+ir.height/2}:{x:e.x+e.width/2,y:e.y+e.height+ir.height/2}}function bh(e,t){var n,r,i,o=e.label;return o&&o.bounds?(i=o.bounds,r={width:Math.max(ir.width,i.width),height:i.height},n={x:i.x+i.width/2,y:i.y+i.height/2}):(n=La(t),r=ir),C({x:n.x-r.width/2,y:n.y-r.height/2},r)}function xh(e){if(h(e,"bpmn:FlowElement")||h(e,"bpmn:Participant")||h(e,"bpmn:Lane")||h(e,"bpmn:SequenceFlow")||h(e,"bpmn:MessageFlow")||h(e,"bpmn:DataInput")||h(e,"bpmn:DataOutput"))return"name";if(h(e,"bpmn:TextAnnotation"))return"text";if(h(e,"bpmn:Group"))return"categoryValueRef"}function t1(e){var t=e.categoryValueRef;return t&&t.value||""}function gt(e){var t=e.businessObject,n=xh(t);if(n)return n==="categoryValueRef"?t1(t):t[n]||""}function Eh(e,t){var n=e.businessObject,r=xh(n);if(r)if(r==="categoryValueRef"){if(!n[r])return e;n[r].value=t}else n[r]=t;return e}function wh(e){return ee(e)&&mn(e.labelTarget)}N();var wr=7;function Jl(e){let t=[];return E(e.incoming,n=>{h(n,"bpmn:Association")&&h(n.source,"bpmn:TextAnnotation")&&t.push({annotation:n.source,association:n})}),E(e.outgoing,n=>{h(n,"bpmn:Association")&&h(n.target,"bpmn:TextAnnotation")&&t.push({annotation:n.target,association:n})}),t}function Ti(e){let t=new Map;return E(Ta(e,!0,-1),n=>{E(Jl(n),r=>{t.has(r.annotation)||t.set(r.annotation,{annotation:r.annotation,associations:[]}),t.get(r.annotation).associations.push(r.association)})}),[...t.values()]}N();var Oc="hsl(225, 10%, 15%)",n1="white";function jn(e,t){return Lt(e.eventDefinitions,function(n){return n.$type===t})}function Sh(e){return e.$type==="bpmn:IntermediateThrowEvent"||e.$type==="bpmn:EndEvent"}function Ch(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}function ge(e,t,n){var r=ce(e);return n||r.get("color:background-color")||r.get("bioc:fill")||t||n1}function Y(e,t,n){var r=ce(e);return n||r.get("color:border-color")||r.get("bioc:stroke")||t||Oc}function go(e,t,n,r){var i=ce(e),o=i.get("label");return r||o&&o.get("color:color")||t||Y(e,n)}function Bc(e){var t=e.x+e.width/2,n=e.y+e.height/2,r=e.width/2,i=[["M",t,n],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]];return br(i)}function ja(e,t){var n=e.x,r=e.y,i=e.width,o=e.height,a=[["M",n+t,r],["l",i-t*2,0],["a",t,t,0,0,1,t,t],["l",0,o-t*2],["a",t,t,0,0,1,-t,t],["l",t*2-i,0],["a",t,t,0,0,1,-t,-t],["l",0,t*2-o],["a",t,t,0,0,1,t,-t],["z"]];return br(a)}function Rh(e){var t=e.width,n=e.height,r=e.x,i=e.y,o=t/2,a=n/2,s=[["M",r+o,i],["l",o,a],["l",-o,a],["l",-o,-a],["z"]];return br(s)}function Ph(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=[["M",t,n],["l",r,0],["l",0,i],["l",-r,0],["z"]];return br(o)}function yo(e,t={}){return{width:hn(e,t),height:Yt(e,t)}}function hn(e,t={}){return dt(t,"width")?t.width:e.width}function Yt(e,t={}){return dt(t,"height")?t.height:e.height}var r1=new En,i1=10,Ic=3,o1=1.5,Lc=10,a1=4,_o=.95,s1=1,c1=.25;function Sr(e,t,n,r,i,o,a){Cn.call(this,t,a);var s=e&&e.defaultFillColor,c=e&&e.defaultStrokeColor,u=e&&e.defaultLabelColor;function p(P){return n.computeStyle(P,{strokeLinecap:"round",strokeLinejoin:"round",stroke:Oc,strokeWidth:2,fill:"white"})}function l(P){return n.computeStyle(P,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:Oc,strokeWidth:2})}function f(P,_){var{ref:y={x:0,y:0},scale:M=1,element:D,parentGfx:F=i._svg}=_,V=U("marker",{id:P,viewBox:"0 0 20 20",refX:y.x,refY:y.y,markerWidth:20*M,markerHeight:20*M,orient:"auto"});J(V,D);var ae=_e(":scope > defs",F);ae||(ae=U("defs"),J(F,ae)),J(ae,V)}function d(P,_,y,M){var D=r1.nextPrefixed("marker-");return m(P,D,_,y,M),"url(#"+D+")"}function m(P,_,y,M,D){if(y==="sequenceflow-end"){var F=U("path",{d:"M 1 5 L 11 10 L 1 15 Z",...p({fill:D,stroke:D,strokeWidth:1})});f(_,{element:F,ref:{x:11,y:10},scale:.5,parentGfx:P})}if(y==="messageflow-start"){var V=U("circle",{cx:6,cy:6,r:3.5,...p({fill:M,stroke:D,strokeWidth:1,strokeDasharray:[1e4,1]})});f(_,{element:V,ref:{x:6,y:6},parentGfx:P})}if(y==="messageflow-end"){var ae=U("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...p({fill:M,stroke:D,strokeWidth:1,strokeDasharray:[1e4,1]})});f(_,{element:ae,ref:{x:8.5,y:5},parentGfx:P})}if(y==="association-start"){var be=U("path",{d:"M 11 5 L 1 10 L 11 15",...l({fill:"none",stroke:D,strokeWidth:1.5,strokeDasharray:[1e4,1]})});f(_,{element:be,ref:{x:1,y:10},scale:.5,parentGfx:P})}if(y==="association-end"){var ft=U("path",{d:"M 1 5 L 11 10 L 1 15",...l({fill:"none",stroke:D,strokeWidth:1.5,strokeDasharray:[1e4,1]})});f(_,{element:ft,ref:{x:11,y:10},scale:.5,parentGfx:P})}if(y==="conditional-flow-marker"){var at=U("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...p({fill:M,stroke:D})});f(_,{element:at,ref:{x:-1,y:10},scale:.5,parentGfx:P})}if(y==="conditional-default-flow-marker"){var St=U("path",{d:"M 6 4 L 10 16",...p({stroke:D,fill:"none"})});f(_,{element:St,ref:{x:0,y:10},scale:.5,parentGfx:P})}}function g(P,_,y,M,D={}){Se(M)&&(D=M,M=0),M=M||0,D=p(D);var F=_/2,V=y/2,ae=U("circle",{cx:F,cy:V,r:Math.round((_+y)/4-M),...D});return J(P,ae),ae}function v(P,_,y,M,D,F){Se(D)&&(F=D,D=0),D=D||0,F=p(F);var V=U("rect",{x:D,y:D,width:_-D*2,height:y-D*2,rx:M,ry:M,...F});return J(P,V),V}function w(P,_,y,M){var D=_/2,F=y/2,V=[{x:D,y:0},{x:_,y:F},{x:D,y},{x:0,y:F}],ae=V.map(function(ft){return ft.x+","+ft.y}).join(" ");M=p(M);var be=U("polygon",{...M,points:ae});return J(P,be),be}function S(P,_,y,M){y=l(y);var D=Xn(_,y,M);return J(P,D),D}function x(P,_,y){return S(P,_,y,5)}function b(P,_,y){y=l(y);var M=U("path",{...y,d:_});return J(P,M),M}function R(P,_,y,M){return b(_,y,C({"data-marker":P},M))}function A(P){return Gt[P]}function O(P){return function(_,y,M){return A(P)(_,y,M)}}var T={"bpmn:MessageEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.235,my:.315}}),F=M?Y(_,c,y.stroke):ge(_,s,y.fill),V=M?ge(_,s,y.fill):Y(_,c,y.stroke),ae=b(P,D,{fill:F,stroke:V,strokeWidth:1});return ae},"bpmn:TimerEventDefinition":function(P,_,y={}){var M=y.width||_.width,D=y.height||_.height,F=y.width?1:2,V=g(P,M,D,.2*D,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:F}),ae=r.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:M,containerHeight:D,position:{mx:.5,my:.5}});b(P,ae,{stroke:Y(_,c,y.stroke),strokeWidth:F});for(var be=0;be<12;be++){var ft=r.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:M,containerHeight:D,position:{mx:.5,my:.5}}),at=M/2,St=D/2;b(P,ft,{strokeWidth:1,stroke:Y(_,c,y.stroke),transform:"rotate("+be*30+","+St+","+at+")"})}return V},"bpmn:EscalationEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.5,my:.2}}),F=M?Y(_,c,y.stroke):ge(_,s,y.fill);return b(P,D,{fill:F,stroke:Y(_,c,y.stroke),strokeWidth:1})},"bpmn:ConditionalEventDefinition":function(P,_,y={}){var M=r.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.5,my:.222}});return b(P,M,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1})},"bpmn:LinkEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.57,my:.263}}),F=M?Y(_,c,y.stroke):ge(_,s,y.fill);return b(P,D,{fill:F,stroke:Y(_,c,y.stroke),strokeWidth:1})},"bpmn:ErrorEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.2,my:.722}}),F=M?Y(_,c,y.stroke):ge(_,s,y.fill);return b(P,D,{fill:F,stroke:Y(_,c,y.stroke),strokeWidth:1})},"bpmn:CancelEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.638,my:-.055}}),F=M?Y(_,c,y.stroke):"none",V=b(P,D,{fill:F,stroke:Y(_,c,y.stroke),strokeWidth:1});return Rc(V,45),V},"bpmn:CompensateEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.22,my:.5}}),F=M?Y(_,c,y.stroke):ge(_,s,y.fill);return b(P,D,{fill:F,stroke:Y(_,c,y.stroke),strokeWidth:1})},"bpmn:SignalEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.5,my:.2}}),F=M?Y(_,c,y.stroke):ge(_,s,y.fill);return b(P,D,{strokeWidth:1,fill:F,stroke:Y(_,c,y.stroke)})},"bpmn:MultipleEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.211,my:.36}}),F=M?Y(_,c,y.stroke):ge(_,s,y.fill);return b(P,D,{fill:F,stroke:Y(_,c,y.stroke),strokeWidth:1})},"bpmn:ParallelMultipleEventDefinition":function(P,_,y={}){var M=r.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.458,my:.194}});return b(P,M,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1})},"bpmn:TerminateEventDefinition":function(P,_,y={}){var M=g(P,_.width,_.height,8,{fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke),strokeWidth:4});return M}};function I(P,_,y={},M){var D=j(P),F=Sh(D),V=M||P;return D.get("eventDefinitions")&&D.get("eventDefinitions").length>1?D.get("parallelMultiple")?T["bpmn:ParallelMultipleEventDefinition"](_,V,y,F):T["bpmn:MultipleEventDefinition"](_,V,y,F):jn(D,"bpmn:MessageEventDefinition")?T["bpmn:MessageEventDefinition"](_,V,y,F):jn(D,"bpmn:TimerEventDefinition")?T["bpmn:TimerEventDefinition"](_,V,y,F):jn(D,"bpmn:ConditionalEventDefinition")?T["bpmn:ConditionalEventDefinition"](_,V,y,F):jn(D,"bpmn:SignalEventDefinition")?T["bpmn:SignalEventDefinition"](_,V,y,F):jn(D,"bpmn:EscalationEventDefinition")?T["bpmn:EscalationEventDefinition"](_,V,y,F):jn(D,"bpmn:LinkEventDefinition")?T["bpmn:LinkEventDefinition"](_,V,y,F):jn(D,"bpmn:ErrorEventDefinition")?T["bpmn:ErrorEventDefinition"](_,V,y,F):jn(D,"bpmn:CancelEventDefinition")?T["bpmn:CancelEventDefinition"](_,V,y,F):jn(D,"bpmn:CompensateEventDefinition")?T["bpmn:CompensateEventDefinition"](_,V,y,F):jn(D,"bpmn:TerminateEventDefinition")?T["bpmn:TerminateEventDefinition"](_,V,y,F):null}var L={ParticipantMultiplicityMarker:function(P,_,y={}){var M=hn(_,y),D=Yt(_,y),F=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:M,containerHeight:D,position:{mx:(M/2-6)/M,my:(D-15)/D}});R("participant-multiplicity",P,F,{strokeWidth:2,fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke)})},SubProcessMarker:function(P,_,y={}){var M=v(P,14,14,0,{strokeWidth:1,fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke)});Fe(M,_.width/2-7.5,_.height-20);var D=r.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:_.width,containerHeight:_.height,position:{mx:(_.width/2-7.5)/_.width,my:(_.height-20)/_.height}});R("sub-process",P,D,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke)})},ParallelMarker:function(P,_,y){var M=hn(_,y),D=Yt(_,y),F=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:M,containerHeight:D,position:{mx:(M/2+y.parallel)/M,my:(D-20)/D}});R("parallel",P,F,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke)})},SequentialMarker:function(P,_,y){var M=r.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:(_.width/2+y.seq)/_.width,my:(_.height-19)/_.height}});R("sequential",P,M,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke)})},CompensationMarker:function(P,_,y){var M=r.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:(_.width/2+y.compensation)/_.width,my:(_.height-13)/_.height}});R("compensation",P,M,{strokeWidth:1,fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke)})},LoopMarker:function(P,_,y){var M=hn(_,y),D=Yt(_,y),F=r.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:M,containerHeight:D,position:{mx:(M/2+y.loop)/M,my:(D-7)/D}});R("loop",P,F,{strokeWidth:1.5,fill:"none",stroke:Y(_,c,y.stroke),strokeMiterlimit:.5})},AdhocMarker:function(P,_,y){var M=hn(_,y),D=Yt(_,y),F=r.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:M,containerHeight:D,position:{mx:(M/2+y.adhoc)/M,my:(D-15)/D}});R("adhoc",P,F,{strokeWidth:1,fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke)})}};function W(P,_,y,M){L[P](_,y,M)}function z(P,_,y=[],M={}){M={fill:M.fill,stroke:M.stroke,width:hn(_,M),height:Yt(_,M)};var D=j(_),F=y.includes("SubProcessMarker");F?M={...M,seq:-21,parallel:-22,compensation:-25,loop:-18,adhoc:10}:M={...M,seq:-5,parallel:-6,compensation:-7,loop:0,adhoc:-8},D.get("isForCompensation")&&y.push("CompensationMarker"),h(D,"bpmn:AdHocSubProcess")&&(y.push("AdhocMarker"),F||C(M,{compensation:M.compensation-18}));var V=D.get("loopCharacteristics"),ae=V&&V.get("isSequential");V&&(C(M,{compensation:M.compensation-18}),y.includes("AdhocMarker")&&C(M,{seq:-23,loop:-18,parallel:-24}),ae===void 0&&y.push("LoopMarker"),ae===!1&&y.push("ParallelMarker"),ae===!0&&y.push("SequentialMarker")),y.includes("CompensationMarker")&&y.length===1&&C(M,{compensation:-8}),E(y,function(be){W(be,P,_,M)})}function K(P,_,y={}){y=C({size:{width:100}},y);var M=o.createText(_||"",y);return pe(M).add("djs-label"),J(P,M),M}function ve(P,_,y,M={}){var D=j(_),F=yo({x:_.x,y:_.y,width:_.width,height:_.height},M);return K(P,D.name,{align:y,box:F,padding:7,style:{fill:go(_,u,c,M.stroke)}})}function Jt(P,_,y={}){var M={width:_.width,height:_.height,x:_.width/2+_.x,y:_.height/2+_.y};return K(P,gt(_),{box:M,style:C({},o.getExternalStyle(),{fill:go(_,u,c,y.stroke)})})}function ke(P,_,y,M={}){var D=Me(y),F=K(P,_,{box:{height:30,width:D?Yt(y,M):hn(y,M)},align:"center-middle",style:{fill:go(y,u,c,M.stroke)}});if(D){var V=-1*Yt(y,M);fo(F,0,-V,270)}}function ye(P,_,y={}){var{width:M,height:D}=yo(_,y);return v(P,M,D,Lc,{...y,fill:ge(_,s,y.fill),fillOpacity:_o,stroke:Y(_,c,y.stroke)})}function he(P,_,y={}){var M=j(_),D=ge(_,s,y.fill),F=Y(_,c,y.stroke);return(M.get("associationDirection")==="One"||M.get("associationDirection")==="Both")&&(y.markerEnd=d(P,"association-end",D,F)),M.get("associationDirection")==="Both"&&(y.markerStart=d(P,"association-start",D,F)),y=Ee(y,["markerStart","markerEnd"]),x(P,_.waypoints,{...y,stroke:F,strokeDasharray:"0, 5"})}function we(P,_,y={}){var M=ge(_,s,y.fill),D=Y(_,c,y.stroke),F=r.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.474,my:.296}}),V=b(P,F,{fill:M,fillOpacity:_o,stroke:D}),ae=j(_);if(Ch(ae)){var be=r.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.33,my:(_.height-18)/_.height}});b(P,be,{strokeWidth:2,fill:M,stroke:D})}return V}function Ie(P,_,y={}){return g(P,_.width,_.height,{fillOpacity:_o,...y,fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke)})}function Ze(P,_,y={}){return w(P,_.width,_.height,{fill:ge(_,s,y.fill),fillOpacity:_o,stroke:Y(_,c,y.stroke)})}function H(P,_,y={}){var M=v(P,hn(_,y),Yt(_,y),0,{fill:ge(_,s,y.fill),fillOpacity:y.fillOpacity||_o,stroke:Y(_,c,y.stroke),strokeWidth:1.5}),D=j(_);if(h(D,"bpmn:Lane")){var F=D.get("name");ke(P,F,_,y)}return M}function G(P,_,y={}){var M=ye(P,_,y),D=ie(_);if(Qe(_)&&($(M,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!D)){var F=j(_).flowElements||[],V=F.filter(ae=>h(ae,"bpmn:StartEvent"));V.length===1&&oe(V[0],P,y,_)}return ve(P,_,D?"center-top":"center-middle",y),D?z(P,_,void 0,y):z(P,_,["SubProcessMarker"],y),M}function oe(P,_,y,M){var D=22,F={fill:ge(M,s,y.fill),stroke:Y(M,c,y.stroke),width:D,height:D},V=j(P).isInterrupting,ae=V?0:3,be=V?1:1.2,ft=20,at=(D-ft)/2,St="translate("+at+","+at+")";g(_,ft,ft,{fill:F.fill,stroke:F.stroke,strokeWidth:be,strokeDasharray:ae,transform:St}),I(P,_,F,M)}function xe(P,_,y={}){var M=ye(P,_,y);return ve(P,_,"center-middle",y),z(P,_,void 0,y),M}var Gt=this.handlers={"bpmn:AdHocSubProcess":function(P,_,y={}){return ie(_)?y=Ee(y,["fill","stroke","width","height"]):y=Ee(y,["fill","stroke"]),G(P,_,y)},"bpmn:Association":function(P,_,y={}){return y=Ee(y,["fill","stroke"]),he(P,_,y)},"bpmn:BoundaryEvent":function(P,_,y={}){var{renderIcon:M=!0}=y;y=Ee(y,["fill","stroke"]);var D=j(_),F=D.get("cancelActivity");y={strokeWidth:1.5,fill:ge(_,s,y.fill),fillOpacity:s1,stroke:Y(_,c,y.stroke)},F||(y.strokeDasharray="6");var V=Ie(P,_,y);return g(P,_.width,_.height,Ic,{...y,fill:"none"}),M&&I(_,P,y),V},"bpmn:BusinessRuleTask":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=xe(P,_,y),D=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),F=b(P,D);$(F,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1});var V=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),ae=b(P,V);return $(ae,{fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke),strokeWidth:1}),M},"bpmn:CallActivity":function(P,_,y={}){return y=Ee(y,["fill","stroke"]),G(P,_,{strokeWidth:5,...y})},"bpmn:ComplexGateway":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=Ze(P,_,y),D=r.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:_.width,containerHeight:_.height,position:{mx:.46,my:.26}});return b(P,D,{fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke),strokeWidth:1}),M},"bpmn:DataInput":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=r.getRawPath("DATA_ARROW"),D=we(P,_,y);return b(P,M,{fill:"none",stroke:Y(_,c,y.stroke),strokeWidth:1}),D},"bpmn:DataInputAssociation":function(P,_,y={}){return y=Ee(y,["fill","stroke"]),he(P,_,{...y,markerEnd:d(P,"association-end",ge(_,s,y.fill),Y(_,c,y.stroke))})},"bpmn:DataObject":function(P,_,y={}){return y=Ee(y,["fill","stroke"]),we(P,_,y)},"bpmn:DataObjectReference":O("bpmn:DataObject"),"bpmn:DataOutput":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=r.getRawPath("DATA_ARROW"),D=we(P,_,y);return b(P,M,{strokeWidth:1,fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke)}),D},"bpmn:DataOutputAssociation":function(P,_,y={}){return y=Ee(y,["fill","stroke"]),he(P,_,{...y,markerEnd:d(P,"association-end",ge(_,s,y.fill),Y(_,c,y.stroke))})},"bpmn:DataStoreReference":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=r.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:0,my:.133}});return b(P,M,{fill:ge(_,s,y.fill),fillOpacity:_o,stroke:Y(_,c,y.stroke),strokeWidth:2})},"bpmn:EndEvent":function(P,_,y={}){var{renderIcon:M=!0}=y;y=Ee(y,["fill","stroke"]);var D=Ie(P,_,{...y,strokeWidth:4});return M&&I(_,P,y),D},"bpmn:EventBasedGateway":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=j(_),D=Ze(P,_,y);g(P,_.width,_.height,_.height*.2,{fill:ge(_,"none",y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1});var F=M.get("eventGatewayType"),V=!!M.get("instantiate");function ae(){var ft=r.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:_.width,containerHeight:_.height,position:{mx:.36,my:.44}});b(P,ft,{fill:"none",stroke:Y(_,c,y.stroke),strokeWidth:2})}if(F==="Parallel"){var be=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:_.width,containerHeight:_.height,position:{mx:.474,my:.296}});b(P,be,{fill:"none",stroke:Y(_,c,y.stroke),strokeWidth:1})}else F==="Exclusive"&&(V||g(P,_.width,_.height,_.height*.26,{fill:"none",stroke:Y(_,c,y.stroke),strokeWidth:1}),ae());return D},"bpmn:ExclusiveGateway":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=Ze(P,_,y),D=r.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:_.width,containerHeight:_.height,position:{mx:.32,my:.3}}),F=ce(_);return F.get("isMarkerVisible")&&b(P,D,{fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke),strokeWidth:1}),M},"bpmn:Gateway":function(P,_,y={}){return y=Ee(y,["fill","stroke"]),Ze(P,_,y)},"bpmn:Group":function(P,_,y={}){return y=Ee(y,["fill","stroke","width","height"]),v(P,_.width,_.height,Lc,{stroke:Y(_,c,y.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:hn(_,y),height:Yt(_,y)})},"bpmn:InclusiveGateway":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=Ze(P,_,y);return g(P,_.width,_.height,_.height*.24,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:2.5}),M},"bpmn:IntermediateEvent":function(P,_,y={}){var{renderIcon:M=!0}=y;y=Ee(y,["fill","stroke"]);var D=Ie(P,_,{...y,strokeWidth:1.5});return g(P,_.width,_.height,Ic,{fill:"none",stroke:Y(_,c,y.stroke),strokeWidth:1.5}),M&&I(_,P,y),D},"bpmn:IntermediateCatchEvent":O("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":O("bpmn:IntermediateEvent"),"bpmn:Lane":function(P,_,y={}){return y=Ee(y,["fill","stroke","width","height"]),H(P,_,{...y,fillOpacity:c1})},"bpmn:ManualTask":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=xe(P,_,y),D=r.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return b(P,D,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:.5}),M},"bpmn:MessageFlow":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=j(_),D=ce(_),F=ge(_,s,y.fill),V=Y(_,c,y.stroke),ae=x(P,_.waypoints,{markerEnd:d(P,"messageflow-end",F,V),markerStart:d(P,"messageflow-start",F,V),stroke:V,strokeDasharray:"10, 11",strokeWidth:1.5});if(M.get("messageRef")){var be=ae.getPointAtLength(ae.getTotalLength()/2),ft=r.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:be.x,y:be.y}}),at={strokeWidth:1};D.get("messageVisibleKind")==="initiating"?(at.fill=F,at.stroke=V):(at.fill=V,at.stroke=F);var St=b(P,ft,at),xn=M.get("messageRef"),Be=xn.get("name"),yr=K(P,Be,{align:"center-top",fitBox:!0,style:{fill:V}}),lc=St.getBBox(),pn=yr.getBBox(),me=be.x-pn.width/2,Te=be.y+lc.height/2+i1;fo(yr,me,Te,0)}return ae},"bpmn:ParallelGateway":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=Ze(P,_,y),D=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:_.width,containerHeight:_.height,position:{mx:.46,my:.2}});return b(P,D,{fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke),strokeWidth:1}),M},"bpmn:Participant":function(P,_,y={}){y=Ee(y,["fill","stroke","width","height"]);var M=H(P,_,y),D=ie(_),F=Me(_),V=j(_),ae=V.get("name");if(D){var be=F?[{x:30,y:0},{x:30,y:Yt(_,y)}]:[{x:0,y:30},{x:hn(_,y),y:30}];S(P,be,{stroke:Y(_,c,y.stroke),strokeWidth:o1}),ke(P,ae,_,y)}else{var ft=yo(_,y);F||(ft.height=hn(_,y),ft.width=Yt(_,y));var at=K(P,ae,{box:ft,align:"center-middle",style:{fill:go(_,u,c,y.stroke)}});if(!F){var St=-1*Yt(_,y);fo(at,0,-St,270)}}return V.get("participantMultiplicity")&&W("ParticipantMultiplicityMarker",P,_,y),M},"bpmn:ReceiveTask":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=j(_),D=xe(P,_,y),F;return M.get("instantiate")?(g(P,28,28,20*.22,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1}),F=r.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):F=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),b(P,F,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1}),D},"bpmn:ScriptTask":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=xe(P,_,y),D=r.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return b(P,D,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1}),M},"bpmn:SendTask":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=xe(P,_,y),D=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return b(P,D,{fill:Y(_,c,y.stroke),stroke:ge(_,s,y.fill),strokeWidth:1}),M},"bpmn:SequenceFlow":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=ge(_,s,y.fill),D=Y(_,c,y.stroke),F=x(P,_.waypoints,{markerEnd:d(P,"sequenceflow-end",M,D),stroke:D}),V=j(_),{source:ae}=_;if(ae){var be=j(ae);V.get("conditionExpression")&&h(be,"bpmn:Activity")&&$(F,{markerStart:d(P,"conditional-flow-marker",M,D)}),be.get("default")&&(h(be,"bpmn:Gateway")||h(be,"bpmn:Activity"))&&be.get("default")===V&&$(F,{markerStart:d(P,"conditional-default-flow-marker",M,D)})}return F},"bpmn:ServiceTask":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=xe(P,_,y);g(P,10,10,{fill:ge(_,s,y.fill),stroke:"none",transform:"translate(6, 6)"});var D=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});b(P,D,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1}),g(P,10,10,{fill:ge(_,s,y.fill),stroke:"none",transform:"translate(11, 10)"});var F=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return b(P,F,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1}),M},"bpmn:StartEvent":function(P,_,y={}){var{renderIcon:M=!0}=y;y=Ee(y,["fill","stroke"]);var D=j(_);D.get("isInterrupting")||(y={...y,strokeDasharray:"6"});var F=Ie(P,_,y);return M&&I(_,P,y),F},"bpmn:SubProcess":function(P,_,y={}){return ie(_)?y=Ee(y,["fill","stroke","width","height"]):y=Ee(y,["fill","stroke"]),G(P,_,y)},"bpmn:Task":function(P,_,y={}){return y=Ee(y,["fill","stroke"]),xe(P,_,y)},"bpmn:TextAnnotation":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var{width:M,height:D}=yo(_,y),F=v(P,M,D,0,0,{fill:"none",stroke:"none"}),V=r.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:M,containerHeight:D,position:{mx:0,my:0}});b(P,V,{stroke:Y(_,c,y.stroke)});var ae=j(_),be=ae.get("text")||"";return K(P,be,{align:"left-top",box:yo(_,y),padding:wr,style:{fill:go(_,u,c,y.stroke)}}),F},"bpmn:Transaction":function(P,_,y={}){ie(_)?y=Ee(y,["fill","stroke","width","height"]):y=Ee(y,["fill","stroke"]);var M=G(P,_,{strokeWidth:1.5,...y}),D=n.style(["no-fill","no-events"],{stroke:Y(_,c,y.stroke),strokeWidth:1.5}),F=ie(_);return F||(y={}),v(P,hn(_,y),Yt(_,y),Lc-Ic,Ic,D),M},"bpmn:UserTask":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=xe(P,_,y),D=15,F=12,V=r.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:D,y:F}});b(P,V,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:.5});var ae=r.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:D,y:F}});b(P,ae,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:.5});var be=r.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:D,y:F}});return b(P,be,{fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke),strokeWidth:.5}),M},label:function(P,_,y={}){return Jt(P,_,y)}};this._drawPath=b,this._renderer=A}B(Sr,Cn);Sr.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"];Sr.prototype.canRender=function(e){return h(e,"bpmn:BaseElement")};Sr.prototype.drawShape=function(e,t,n={}){var{type:r}=t,i=this._renderer(r);return i(e,t,n)};Sr.prototype.drawConnection=function(e,t,n={}){var{type:r}=t,i=this._renderer(r);return i(e,t,n)};Sr.prototype.getShapePath=function(e){return ee(e)?ja(e,a1):h(e,"bpmn:Event")?Bc(e):h(e,"bpmn:Activity")?ja(e,Lc):h(e,"bpmn:Gateway")?Rh(e):Ph(e)};function Ee(e,t=[]){return t.reduce((n,r)=>(e[r]&&(n[r]=e[r]),n),{})}N();N();var u1=0,p1={width:150,height:50};function l1(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function f1(e){return Se(e)?C({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}var ef=null;function d1(){return ef||(ef=document.createElement("canvas").getContext("2d")),ef}function m1(e){var t=[];return e.fontStyle&&t.push(e.fontStyle),e.fontVariant&&t.push(e.fontVariant),e.fontWeight&&t.push(e.fontWeight),e.fontStretch&&t.push(e.fontStretch),t.push(Th(e.fontSize)||"12px"),t.push(e.fontFamily||"sans-serif"),t.join(" ")}function Th(e){if(e!=null)return typeof e=="number"||/^-?\d+(\.\d+)?$/.test(e)?e+"px":e}function h1(e,t){var n=d1();if(!n)return{width:0,height:0};n.font=m1(t),"letterSpacing"in n&&(n.letterSpacing=Th(t.letterSpacing)||"0px");var r=e==="",i=r?"dummy":e.replace(/\s+$/,""),o=n.measureText(i);return{width:r?0:o.width,height:"fontBoundingBoxAscent"in o?o.fontBoundingBoxAscent+o.fontBoundingBoxDescent:o.actualBoundingBoxAscent+o.actualBoundingBoxDescent}}function v1(e,t,n){for(var r=e.shift(),i=r,o;;){if(o=h1(i,n),o.width=i?o.width:0,i===" "||i===""||o.width<Math.round(t)||i.length<2)return g1(e,i,r,o);i=_1(i,o.width,t)}}function g1(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 Ah="\xAD";function y1(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===Ah)&&i.pop();break}var a=i[i.length-1];return a&&a===Ah&&(i[i.length-1]="-"),i.join("")}function _1(e,t,n){var r=Math.max(e.length*(n/t),1),i=y1(e,r);return i||(i=e.slice(0,Math.max(Math.round(r-1),1))),i}function bo(e){this._config=C({},{size:p1,padding:u1,style:{},align:"center-top"},e||{})}bo.prototype.createText=function(e,t){return this.layoutText(e,t).element};bo.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions};bo.prototype.layoutText=function(e,t){for(var n=C({},this._config.size,t.box),r=C({},this._config.style,t.style),i=l1(t.align||this._config.align),o=f1(t.padding!==void 0?t.padding:this._config.padding),a=t.fitBox||!1,s=b1(r),c=e.split(/\u00AD?\r?\n/),u=[],p=n.width-o.left-o.right;c.length;)u.push(v1(c,p,r));i.vertical==="middle"&&(o.top=o.bottom=0);var l=Ge(u,function(v,w,S){return v+(s||w.height)},0)+o.top+o.bottom,f=Ge(u,function(v,w,S){return w.width>v?w.width:v},0),d=o.top;i.vertical==="middle"&&(d+=(n.height-l)/2),d-=(s||u[0].height)/4;var m=U("text");$(m,r),E(u,function(v){var w;switch(d+=s||v.height,i.horizontal){case"left":w=o.left;break;case"right":w=(a?f:p)-o.right-v.width;break;default:w=Math.max(((a?f:p)-v.width)/2+o.left,0)}var S=U("tspan");$(S,{x:w,y:d}),S.textContent=v.text,J(m,S)});var g={width:f,height:l};return{dimensions:g,element:m}};function b1(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}var x1=12,E1=1.2,w1=40;function jc(e){var t=C({fontFamily:"Arial, sans-serif",fontSize:x1,fontWeight:"normal",lineHeight:E1},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,r=C({},t,{fontSize:n},e&&e.externalStyle||{}),i=new bo({style:t});this.getExternalLabelBounds=function(a,s){var c={width:Math.max(a.width,ir.width),height:30},u=o(s,c,{style:r});return{x:Math.round(a.x+a.width/2-u.width/2),y:a.y,width:Math.ceil(u.width),height:Math.ceil(u.height)}},this.getTextAnnotationBounds=function(a,s){var c=o(s,a,{style:t,align:"left-top",padding:wr});return{x:a.x,y:a.y,width:a.width,height:Math.max(w1,Math.round(c.height))}},this.getDimensions=function(a,s){return i.getDimensions(a,s||{})};function o(a,s,c){return i.getDimensions(a,C({box:s},c))}this.createText=function(a,s){return i.createText(a,s||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return r}}jc.$inject=["config.textRenderer"];function tf(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(t){return this.pathMap[t].d},this.getScaledPath=function(t,n){var r=this.pathMap[t],i,o;n.abspos?(i=n.abspos.x,o=n.abspos.y):(i=n.containerWidth*n.position.mx,o=n.containerHeight*n.position.my);var a={};if(n.position){for(var s=n.containerHeight/r.height*n.yScaleFactor,c=n.containerWidth/r.width*n.xScaleFactor,u=0;u<r.heightElements.length;u++)a["y"+u]=r.heightElements[u]*s;for(var p=0;p<r.widthElements.length;p++)a["x"+p]=r.widthElements[p]*c}var l=P1(r.d,{mx:i,my:o,e:a});return l}}var S1=/\{([^{}]+)\}/g,C1=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;function R1(e,t,n){var r=n;return t.replace(C1,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 P1(e,t){return String(e).replace(S1,function(n,r){return R1(n,r,t)})}var Mh={__init__:["bpmnRenderer"],bpmnRenderer:["type",Sr],textRenderer:["type",jc],pathMap:["type",tf]};function nf(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(n,r){return t[r]||"{"+r+"}"})}var Zr={translate:["value",nf]};N();function Fc(e,t,n){return C({id:e.id,type:e.$type,businessObject:e,di:t},n)}function A1(e,t,n){var r=e.waypoint;return!r||r.length<2?[X(t),X(n)]:r.map(function(i){return{x:i.x,y:i.y}})}function Dh(e,t,n){return new Error(`element ${Rt(t)} referenced by ${Rt(e)}#${n} not yet drawn`)}function Fn(e,t,n,r,i){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=r,this._textRenderer=i}Fn.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"];Fn.prototype.add=function(e,t,n){var r,i,o;if(h(t,"bpmndi:BPMNPlane")){var a=h(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};r=this._elementFactory.createRoot(Fc(e,t,a)),this._canvas.addRootElement(r)}else if(h(t,"bpmndi:BPMNShape")){var s=!ie(e,t),c=M1(e);i=n&&(n.hidden||n.collapsed);var u=t.bounds;r=this._elementFactory.createShape(Fc(e,t,{collapsed:s,hidden:i,x:Math.round(u.x),y:Math.round(u.y),width:Math.round(u.width),height:Math.round(u.height),isFrame:c})),h(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,r),h(e,"bpmn:Lane")&&(o=0),h(e,"bpmn:DataStoreReference")&&(T1(n,X(u))||(n=this._canvas.findRoot(n))),this._canvas.addShape(r,n,o)}else if(h(t,"bpmndi:BPMNEdge")){var p=this._getSource(e),l=this._getTarget(e);i=n&&(n.hidden||n.collapsed),r=this._elementFactory.createConnection(Fc(e,t,{hidden:i,source:p,target:l,waypoints:A1(t,p,l)})),h(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(r,n,o)}else throw new Error(`unknown di ${Rt(t)} for element ${Rt(e)}`);return mn(e)&>(r)&&this.addLabel(e,t,r),this._eventBus.fire("bpmnElement.added",{element:r}),r};Fn.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${Rt(e)}#attachedToRef`);var r=this._elementRegistry.get(n.id),i=r&&r.attachers;if(!r)throw Dh(e,n,"attachedToRef");t.host=r,i||(r.attachers=i=[]),i.indexOf(t)===-1&&i.push(t)};Fn.prototype.addLabel=function(e,t,n){var r,i,o;return r=bh(t,n),i=gt(n),i&&(r=this._textRenderer.getExternalLabelBounds(r,i)),o=this._elementFactory.createLabel(Fc(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!gt(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)};Fn.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?Dh(e,r,t+"Ref"):new Error(`${Rt(e)}#${t} Ref not specified`)};Fn.prototype._getSource=function(e){return this._getConnectedElement(e,"source")};Fn.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")};Fn.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};function T1(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 M1(e){return h(e,"bpmn:Group")}var kh={__depends__:[Zr],bpmnImporter:["type",Fn]};var Nh={__depends__:[Mh,kh]};N();function or(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}or.prototype.next=function(){return this._prefix+ ++this._counter};var D1=new or("ov"),k1=500;function yt(e,t,n,r){this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=D1,this._overlayDefaults=C({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=N1(n.getContainer()),this._init()}yt.$inject=["config.overlays","eventBus","canvas","elementRegistry"];yt.prototype.get=function(e){if(st(e)&&(e={id:e}),st(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?Q(t.overlays,Ct({type:e.type})):t.overlays.slice():[]}else return e.type?Q(this._overlays,Ct({type:e.type})):e.id?this._overlays[e.id]:null};yt.prototype.add=function(e,t,n){if(Se(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var r=this._ids.next();return n=C({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r};yt.prototype.remove=function(e){var t=this.get(e)||[];q(t)||(t=[t]);var n=this;E(t,function(r){var i=n._getOverlayContainer(r.element,!0);if(r&&(Wt(r.html),Wt(r.htmlContainer),delete r.htmlContainer,delete r.element,delete n._overlays[r.id]),i){var o=i.overlays.indexOf(r);o!==-1&&i.overlays.splice(o,1)}})};yt.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"};yt.prototype.show=function(){Hc(this._overlayRoot)};yt.prototype.hide=function(){Hc(this._overlayRoot,!1)};yt.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Hr(this._overlayRoot)};yt.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,i=t.y;if(t.waypoints){var o=Ce(t);r=o.x,i=o.y}Oh(n,r,i),nt(e.html,"data-container-id",t.id)};yt.prototype._updateOverlay=function(e){var t=e.position,n=e.htmlContainer,r=e.element,i=t.left,o=t.top;if(t.right!==void 0){var a;r.waypoints?a=Ce(r).width:a=r.width,i=t.right*-1+a}if(t.bottom!==void 0){var s;r.waypoints?s=Ce(r).height:s=r.height,o=t.bottom*-1+s}Oh(n,i||0,o||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())};yt.prototype._createOverlayContainer=function(e){var t=ue('<div class="djs-overlays" />');vt(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n};yt.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Bh(this._overlayRoot,n)};yt.prototype._getOverlayContainer=function(e,t){var n=re(this._overlayContainers,function(r){return r.element===e});return!n&&!t?this._createOverlayContainer(e):n};yt.prototype._addOverlay=function(e){var t=e.id,n=e.element,r=e.html,i,o;r.get&&r.constructor.prototype.jquery&&(r=r.get(0)),st(r)&&(r=ue(r)),o=this._getOverlayContainer(n),i=ue('<div class="djs-overlay" data-overlay-id="'+t+'">'),vt(i,{position:"absolute"}),i.appendChild(r),e.type&&Ne(i).add("djs-overlay-"+e.type);var a=this._canvas.findRoot(n),s=this._canvas.getRootElement();Hc(i,a===s),e.htmlContainer=i,o.overlays.push(e),o.html.appendChild(i),this._overlays[t]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())};yt.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=this._canvas.findRoot(e.element),i=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,s=this._canvas.getRootElement(),c=!0;(r!==s||n&&(Ue(i)&&i>t.scale||Ue(o)&&o<t.scale))&&(c=!1),Hc(a,c),this._updateOverlayScale(e,t)};yt.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),Ue(r)&&t.scale<r&&(a=(1/t.scale||1)*r),Ue(i)&&t.scale>i&&(a=(1/t.scale||1)*i)),Ue(a)&&(s="scale("+a+","+a+")"),Bh(o,s)};yt.prototype._updateOverlaysVisibilty=function(e){var t=this;E(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})};yt.prototype._init=function(){var e=this._eventBus,t=this;function n(r){t._updateRoot(r),t._updateOverlaysVisibilty(r),t.show()}e.on("canvas.viewbox.changing",function(r){t.hide()}),e.on("canvas.viewbox.changed",function(r){n(r.viewbox)}),e.on(["shape.remove","connection.remove"],function(r){var i=r.element,o=t.get({element:i});E(o,function(c){t.remove(c.id)});var a=t._getOverlayContainer(i);if(a){Wt(a.html);var s=t._overlayContainers.indexOf(a);s!==-1&&t._overlayContainers.splice(s,1)}}),e.on("element.changed",k1,function(r){var i=r.element,o=t._getOverlayContainer(i,!0);o&&(E(o.overlays,function(a){t._updateOverlay(a)}),t._updateOverlayContainer(o))}),e.on("element.marker.update",function(r){var i=t._getOverlayContainer(r.element,!0);i&&Ne(i.html)[r.add?"add":"remove"](r.marker)}),e.on("root.set",function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};function N1(e){var t=ue('<div class="djs-overlay-container" />');return vt(t,{position:"absolute",width:0,height:0}),e.insertBefore(t,e.firstChild),t}function Oh(e,t,n){vt(e,{left:t+"px",top:n+"px"})}function Hc(e,t){e.style.display=t===!1?"none":""}function Bh(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}var Qr={__init__:["overlays"],overlays:["type",yt]};function $c(e,t,n,r){e.on("element.changed",function(i){var o=i.element;(o.parent||o===t.getRootElement())&&(i.gfx=n.getGraphics(o)),i.gfx&&e.fire(_c(o)+".changed",i)}),e.on("elements.changed",function(i){var o=i.elements;o.forEach(function(a){e.fire("element.changed",{element:a})}),r.updateContainments(o)}),e.on("shape.changed",function(i){r.update("shape",i.element,i.gfx)}),e.on("connection.changed",function(i){r.update("connection",i.element,i.gfx)})}$c.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var xo={__init__:["changeSupport"],changeSupport:["type",$c]};N();var O1=1e3;function k(e){this._eventBus=e}k.$inject=["eventBus"];function B1(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}k.prototype.on=function(e,t,n,r,i,o){if((Le(t)||ne(t))&&(o=i,i=r,r=n,n=t,t=null),Le(n)&&(o=i,i=r,r=n,n=O1),Se(i)&&(o=i,i=!1),!Le(r))throw new Error("handlerFn must be a function");q(e)||(e=[e]);var a=this._eventBus;E(e,function(s){var c=["commandStack",s,t].filter(function(u){return u}).join(".");a.on(c,n,i?B1(r,o):r,o)})};k.prototype.canExecute=Cr("canExecute");k.prototype.preExecute=Cr("preExecute");k.prototype.preExecuted=Cr("preExecuted");k.prototype.execute=Cr("execute");k.prototype.executed=Cr("executed");k.prototype.postExecute=Cr("postExecute");k.prototype.postExecuted=Cr("postExecuted");k.prototype.revert=Cr("revert");k.prototype.reverted=Cr("reverted");function Cr(e){return function(n,r,i,o,a){(Le(n)||ne(n))&&(a=o,o=i,i=r,r=n,n=null),this.on(n,e,r,i,o,a)}}function Fa(e,t){t.invoke(k,this),this.executed(function(n){var r=n.context;r.rootElement?e.setRootElement(r.rootElement):r.rootElement=e.getRootElement()}),this.revert(function(n){var r=n.context;r.rootElement&&e.setRootElement(r.rootElement)})}B(Fa,k);Fa.$inject=["canvas","injector"];var Ih={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",Fa]};N();function Rr(e){return CSS.escape(e)}var I1={"&":"&","<":"<",">":">",'"':""","'":"'"};function Hn(e){return e=""+e,e&&e.replace(/[&<>"']/g,function(t){return I1[t]})}var Lh="_plane";function rf(e){var t=e.id;return L1(t)}function vn(e){var t=e.id;return h(e,"bpmn:SubProcess")?jh(t):t}function Jr(e){return jh(e)}function Eo(e){var t=ce(e);return h(t,"bpmndi:BPMNPlane")}function jh(e){return e+Lh}function L1(e){return e.replace(new RegExp(Lh+"$"),"")}var j1="bjs-breadcrumbs-shown";function zc(e,t,n){var r=ue('<ul class="bjs-breadcrumbs"></ul>'),i=n.getContainer(),o=Ne(i);i.appendChild(r);var a=[];e.on("element.changed",function(c){var u=c.element,p=j(u),l=re(a,function(f){return f===p});l&&s()});function s(c){c&&(a=F1(c));var u=a.flatMap(function(l){var f=n.findRoot(vn(l))||n.findRoot(l.id);if(!f&&h(l,"bpmn:Process")){var d=t.find(function(v){var w=j(v);return w&&w.get("processRef")===l});f=d&&n.findRoot(d.id)}if(!f)return[];var m=Hn(l.name||l.id),g=ue('<li><span class="bjs-crumb"><a title="'+m+'">'+m+"</a></span></li>");return g.addEventListener("click",function(){n.setRootElement(f)}),g});r.innerHTML="";var p=u.length>1;o.toggle(j1,p),u.forEach(function(l){r.appendChild(l)})}e.on("root.set",function(c){s(c.element)})}zc.$inject=["eventBus","elementRegistry","canvas"];function F1(e){for(var t=j(e),n=[],r=t;r;r=r.$parent)(h(r,"bpmn:SubProcess")||h(r,"bpmn:Process"))&&n.push(r);return n.reverse()}function Gc(e,t){var n=null,r=new H1;e.on("root.set",function(i){var o=i.element,a=t.viewbox(),s=r.get(o);if(r.set(n,{x:a.x,y:a.y,zoom:a.scale}),n=o,!(!h(o,"bpmn:SubProcess")&&!s)){s=s||{x:0,y:0,zoom:1};var c=(a.x-s.x)*a.scale,u=(a.y-s.y)*a.scale;(c!==0||u!==0)&&t.scroll({dx:c,dy:u}),s.zoom!==a.scale&&t.zoom(s.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){r.clear(),n=null})}Gc.$inject=["eventBus","canvas"];function H1(){this._entries=[],this.set=function(e,t){var n=!1;for(var r in this._entries)if(this._entries[r][0]===e){this._entries[r][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}t!==-1&&this._entries.splice(t,1)}}var Fh={x:180,y:160};function Pr(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,function(r,i){n._handleImport(i.definitions)})}Pr.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach(function(r){!r.plane||!r.plane.bpmnElement||(t._processToDiagramMap[r.plane.bpmnElement.id]=r)});var n=e.diagrams.filter(r=>r.plane).flatMap(r=>t._createNewDiagrams(r.plane));n.forEach(function(r){t._movePlaneElementsToOrigin(r.plane)})}};Pr.prototype._createNewDiagrams=function(e){var t=this,n=[],r=[];e.get("planeElement").forEach(function(o){var a=o.bpmnElement;if(a){var s=a.$parent;h(a,"bpmn:SubProcess")&&!o.isExpanded&&n.push(a),z1(a,e)&&r.push({diElement:o,parent:s})}});var i=[];return n.forEach(function(o){if(!t._processToDiagramMap[o.id]){var a=t._createDiagram(o);t._processToDiagramMap[o.id]=a,i.push(a)}}),r.forEach(function(o){for(var a=o.diElement,s=o.parent;s&&n.indexOf(s)===-1;)s=s.$parent;if(s){var c=t._processToDiagramMap[s.id];t._moveToDiPlane(a,c.plane)}}),i};Pr.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=$1(e),r={x:n.x-Fh.x,y:n.y-Fh.y};t.forEach(function(i){i.waypoint?i.waypoint.forEach(function(o){o.x=o.x-r.x,o.y=o.y-r.y}):i.bounds&&(i.bounds.x=i.bounds.x-r.x,i.bounds.y=i.bounds.y-r.y)})};Pr.prototype._moveToDiPlane=function(e,t){var n=Hh(e),r=n.plane.get("planeElement");r.splice(r.indexOf(e),1),t.get("planeElement").push(e)};Pr.prototype._createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n};Pr.$inject=["eventBus","moddle"];function Hh(e){return h(e,"bpmndi:BPMNDiagram")?e:Hh(e.$parent)}function $1(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach(function(n){if(n.bounds){var r=Z(n.bounds);t.top=Math.min(r.top,t.top),t.left=Math.min(r.left,t.left)}}),Si(t)}function z1(e,t){var n=e.$parent;return!(!h(n,"bpmn:SubProcess")||n===t.bpmnElement||te(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))}var Vc=250,G1='<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>',V1="bjs-drilldown-empty";function ar(e,t,n,r,i){k.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=r,this._translate=i;var o=this;this.executed("shape.toggleCollapse",Vc,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.reverted("shape.toggleCollapse",Vc,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.executed(["shape.create","shape.move","shape.delete"],Vc,function(a){var s=a.oldParent,c=a.newParent||a.parent,u=a.shape;o._canDrillDown(u)&&o._addOverlay(u),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(u)},!0),this.reverted(["shape.create","shape.move","shape.delete"],Vc,function(a){var s=a.oldParent,c=a.newParent||a.parent,u=a.shape;o._canDrillDown(u)&&o._addOverlay(u),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(u)},!0),t.on("import.render.complete",function(){n.filter(function(a){return o._canDrillDown(a)}).map(function(a){o._addOverlay(a)})})}B(ar,k);ar.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}};ar.prototype._canDrillDown=function(e){var t=this._canvas;return h(e,"bpmn:SubProcess")&&t.findRoot(vn(e))};ar.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=j(e),r=t.get({element:n.id,type:"drilldown"})[0];if(r){var i=n&&n.get("flowElements")&&n.get("flowElements").length;Ne(r.html).toggle(V1,!i)}};ar.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,r=j(e),i=n.get({element:e,type:"drilldown"});i.length&&this._removeOverlay(e);var o=ue('<button type="button" class="bjs-drilldown">'+G1+"</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(vn(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:o}),this._updateOverlayVisibility(e)};ar.prototype._removeOverlay=function(e){var t=this._overlays;t.remove({element:e,type:"drilldown"})};ar.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];var $h={__depends__:[Qr,xo,Ih],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",zc],drilldownCentering:["type",Gc],drilldownOverlayBehavior:["type",ar],subprocessCompatibility:["type",Pr]};N();function zh(e){!e||typeof e.stopPropagation!="function"||e.stopPropagation()}function Ar(e){return e.originalEvent||e.srcEvent}function Wc(e){zh(e),zh(Ar(e))}function An(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function Uc(){return/mac/i.test(navigator.platform)}function Gh(e,t){return(Ar(e)||e).button===t}function gn(e){return Gh(e,0)}function Vh(e){return Gh(e,1)}function Tr(e){var t=Ar(e)||e;return gn(e)?Uc()?t.metaKey:t.ctrlKey:!1}function Mi(e){var t=Ar(e)||e;return gn(e)&&t.shiftKey}function W1(e){return!0}function qc(e){return gn(e)||Vh(e)}var Wh=500;function Kc(e,t,n){var r=this;function i(T,I,L){if(!s(T,I)){var W,z,K;L?z=t.getGraphics(L):(W=I.delegateTarget||I.target,W&&(z=W,L=t.get(z))),!(!z||!L)&&(K=e.fire(T,{element:L,gfx:z,originalEvent:I}),K===!1&&(I.stopPropagation(),I.preventDefault()))}}var o={};function a(T){return o[T]}function s(T,I){var L=u[T]||gn;return!L(I)}var c={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},u={"element.contextmenu":W1,"element.mousedown":qc,"element.mouseup":qc,"element.click":qc,"element.dblclick":qc};function p(T,I,L){var W=c[T];if(!W)throw new Error("unmapped DOM event name <"+T+">");return i(W,I,L)}var l="svg, .djs-element";function f(T,I,L,W){var z=o[L]=function(K){i(L,K)};W&&(u[L]=W),z.$delegate=bt.bind(T,l,I,z)}function d(T,I,L){var W=a(L);W&&bt.unbind(T,I,W.$delegate)}function m(T){E(c,function(I,L){f(T,L,I)})}function g(T){E(c,function(I,L){d(T,L,I)})}e.on("canvas.destroy",function(T){g(T.svg)}),e.on("canvas.init",function(T){m(T.svg)}),e.on(["shape.added","connection.added"],function(T){var I=T.element,L=T.gfx;e.fire("interactionEvents.createHit",{element:I,gfx:L})}),e.on(["shape.changed","connection.changed"],Wh,function(T){var I=T.element,L=T.gfx;e.fire("interactionEvents.updateHit",{element:I,gfx:L})}),e.on("interactionEvents.createHit",Wh,function(T){var I=T.element,L=T.gfx;r.createDefaultHit(I,L)}),e.on("interactionEvents.updateHit",function(T){var I=T.element,L=T.gfx;r.updateDefaultHit(I,L)});var v=R("djs-hit djs-hit-stroke"),w=R("djs-hit djs-hit-click-stroke"),S=R("djs-hit djs-hit-all"),x=R("djs-hit djs-hit-no-move"),b={all:S,"click-stroke":w,stroke:v,"no-move":x};function R(T,I){return I=C({stroke:"white",strokeWidth:15},I||{}),n.cls(T,["no-fill","no-border"],I)}function A(T,I){var L=b[I];if(!L)throw new Error("invalid hit type <"+I+">");return $(T,L),T}function O(T,I){J(T,I)}this.removeHits=function(T){var I=xi(".djs-hit",T);E(I,Pe)},this.createDefaultHit=function(T,I){var L=T.waypoints,W=T.isFrame,z;return L?this.createWaypointsHit(I,L):(z=W?"stroke":"all",this.createBoxHit(I,z,{width:T.width,height:T.height}))},this.createWaypointsHit=function(T,I){var L=Xn(I);return A(L,"stroke"),O(T,L),L},this.createBoxHit=function(T,I,L){L=C({x:0,y:0},L);var W=U("rect");return A(W,I),$(W,L),O(T,W),W},this.updateDefaultHit=function(T,I){var L=_e(".djs-hit",I);if(L)return T.waypoints?Pa(L,T.waypoints):$(L,{width:T.width,height:T.height}),L},this.fire=i,this.triggerMouseEvent=p,this.mouseHandler=a,this.registerEvent=f,this.unregisterEvent=d}Kc.$inject=["eventBus","elementRegistry","styles"];var ei={__init__:["interactionEvents"],interactionEvents:["type",Kc]};N();function ti(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],function(r){var i=r.element;n.deselect(i)}),e.on(["diagram.clear","root.set"],function(r){n.select(null)})}ti.$inject=["eventBus","canvas"];ti.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(n!==-1){var r=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:t})}};ti.prototype.get=function(){return this._selectedElements};ti.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1};ti.prototype.select=function(e,t){var n=this._selectedElements,r=n.slice();q(e)||(e=e?[e]:[]);var i=this._canvas,o=i.getRootElement();e=e.filter(function(a){var s=i.findRoot(a);return o===s}),t?E(e,function(a){n.indexOf(a)===-1&&n.push(a)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:n})};N();var Uh="hover",qh="selected";function Yc(e,t){this._canvas=e;function n(i,o){e.addMarker(i,o)}function r(i,o){e.removeMarker(i,o)}t.on("element.hover",function(i){n(i.element,Uh)}),t.on("element.out",function(i){r(i.element,Uh)}),t.on("selection.changed",function(i){function o(u){r(u,qh)}function a(u){n(u,qh)}var s=i.oldSelection,c=i.newSelection;E(s,function(u){c.indexOf(u)===-1&&o(u)}),E(c,function(u){s.indexOf(u)===-1&&a(u)})})}Yc.$inject=["canvas","eventBus"];N();function Xc(e,t,n,r){e.on("create.end",500,function(i){var o=i.context,a=o.canExecute,s=o.elements,c=o.hints||{},u=c.autoSelect;if(a){if(u===!1)return;q(u)?t.select(u):t.select(s.filter(U1))}}),e.on("connect.end",500,function(i){var o=i.context,a=o.connection;a&&t.select(a)}),e.on("shape.move.end",500,function(i){var o=i.previousSelection||[],a=r.get(i.context.shape.id),s=re(o,function(c){return a.id===c.id});s||t.select(a)}),e.on("element.click",function(i){if(gn(i)){var o=i.element;o===n.getRootElement()&&(o=null);var a=t.isSelected(o),s=t.get().length>1,c=Mi(i);if(a&&s)return c?t.deselect(o):t.select(o);a?t.deselect(o):t.select(o,c)}})}Xc.$inject=["eventBus","selection","canvas","elementRegistry"];function U1(e){return!e.hidden}var rt={__init__:["selectionVisuals","selectionBehavior"],__depends__:[ei],selection:["type",ti],selectionVisuals:["type",Yc],selectionBehavior:["type",Xc]};function nn(e){$e.call(this,e)}B(nn,$e);nn.prototype._modules=[Nh,$h,Qr,rt,Zr];nn.prototype._moddleExtensions={};N();N();var Kh=["c","C"],Yh=["v","V"],q1=["d","D"],K1=["x","X"],Xh=["y","Y"],of=["z","Z"];function Zh(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function xt(e){return e.altKey?!1:e.ctrlKey||e.metaKey}function Ke(e,t){return e=q(e)?e:[e],e.indexOf(t.key)!==-1||e.indexOf(t.code)!==-1}function Zc(e){return e.shiftKey}function Qh(e){return xt(e)&&Ke(Kh,e)}function Jh(e){return xt(e)&&Ke(Yh,e)}function ev(e){return xt(e)&&Ke(q1,e)}function tv(e){return xt(e)&&Ke(K1,e)}function nv(e){return xt(e)&&!Zc(e)&&Ke(of,e)}function rv(e){return xt(e)&&(Ke(Xh,e)||Ke(of,e)&&Zc(e))}var Qc="keyboard.keydown",Y1="keyboard.keyup",X1=1e3,iv="Keyboard binding is now implicit; explicit binding to an element got removed. For more information, see https://github.com/bpmn-io/diagram-js/issues/661";function Mt(e,t){var n=this;this._config=e=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",function(){n._fire("destroy"),n.unbind()}),e.bindTo&&console.error("unsupported configuration <keyboard.bindTo>",new Error(iv));var r=e&&e.bind!==!1;t.on("canvas.init",function(i){n._target=i.svg,r&&n.bind(),n._fire("init")})}Mt.$inject=["config.keyboard","eventBus"];Mt.prototype._keydownHandler=function(e){this._keyHandler(e,Qc)};Mt.prototype._keyupHandler=function(e){this._keyHandler(e,Y1)};Mt.prototype._keyHandler=function(e,t){var n;if(!this._isEventIgnored(e)){var r={keyEvent:e};n=this._eventBus.fire(t||Qc,r),n&&e.preventDefault()}};Mt.prototype._isEventIgnored=function(e){return!1};Mt.prototype.bind=function(e){e&&console.error("unsupported argument <node>",new Error(iv)),this.unbind(),e=this._node=this._target,se.bind(e,"keydown",this._keydownHandler),se.bind(e,"keyup",this._keyupHandler),this._fire("bind")};Mt.prototype.getBinding=function(){return this._node};Mt.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),se.unbind(e,"keydown",this._keydownHandler),se.unbind(e,"keyup",this._keyupHandler)),this._node=null};Mt.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})};Mt.prototype.addListener=function(e,t,n){Le(e)&&(n=t,t=e,e=X1),this._eventBus.on(n||Qc,e,t)};Mt.prototype.removeListener=function(e,t){this._eventBus.off(t||Qc,e)};Mt.prototype.hasModifier=Zh;Mt.prototype.isCmd=xt;Mt.prototype.isShift=Zc;Mt.prototype.isKey=Ke;var Z1=500;function Mr(e,t){var n=this;e.on("editorActions.init",Z1,function(r){var i=r.editorActions;n.registerBindings(t,i)})}Mr.$inject=["eventBus","keyboard"];Mr.prototype.registerBindings=function(e,t){function n(r,i){t.isRegistered(r)&&e.addListener(i)}n("undo",function(r){var i=r.keyEvent;if(nv(i))return t.trigger("undo"),!0}),n("redo",function(r){var i=r.keyEvent;if(rv(i))return t.trigger("redo"),!0}),n("copy",function(r){var i=r.keyEvent;if(Qh(i))return t.trigger("copy"),!0}),n("paste",function(r){var i=r.keyEvent;if(Jh(i))return t.trigger("paste"),!0}),n("duplicate",function(r){var i=r.keyEvent;if(ev(i))return t.trigger("duplicate"),!0}),n("cut",function(r){var i=r.keyEvent;if(tv(i))return t.trigger("cut"),!0}),n("stepZoom",function(r){var i=r.keyEvent;if(Ke(["+","Add","="],i)&&xt(i))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(r){var i=r.keyEvent;if(Ke(["-","Subtract"],i)&&xt(i))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(r){var i=r.keyEvent;if(Ke("0",i)&&xt(i))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(r){var i=r.keyEvent;if(Ke(["Backspace","Delete","Del"],i))return t.trigger("removeSelection"),!0})};var wo={__init__:["keyboard","keyboardBindings"],keyboard:["type",Mt],keyboardBindings:["type",Mr]};N();var Q1={moveSpeed:50,moveSpeedAccelerated:200};function Jc(e,t,n){var r=this;this._config=C({},Q1,e||{}),t.addListener(i);function i(o){var a=o.keyEvent,s=r._config;if(t.isCmd(a)&&t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],a)){var c=t.isShift(a)?s.moveSpeedAccelerated:s.moveSpeed,u;switch(a.key){case"ArrowLeft":case"Left":u="left";break;case"ArrowUp":case"Up":u="up";break;case"ArrowRight":case"Right":u="right";break;case"ArrowDown":case"Down":u="down";break}return r.moveCanvas({speed:c,direction:u}),!0}}this.moveCanvas=function(o){var a=0,s=0,c=o.speed,u=c/Math.min(Math.sqrt(n.viewbox().scale),1);switch(o.direction){case"left":a=u;break;case"up":s=u;break;case"right":a=-u;break;case"down":s=-u;break}n.scroll({dx:a,dy:s})}}Jc.$inject=["config.keyboardMove","keyboard","canvas"];var eu={__depends__:[wo],__init__:["keyboardMove"],keyboardMove:["type",Jc]};var J1=/^djs-cursor-.*$/;function Di(e){var t=Ne(document.body);t.removeMatching(J1),e&&t.add("djs-cursor-"+e)}function tu(){Di(null)}var eC=5e3;function nu(e,t){t=t||"element.click";function n(){return!1}return e.once(t,eC,n),function(){e.off(t,n)}}function So(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Dt(e,t){return{x:e.x-t.x,y:e.y-t.y}}var tC=15;function ru(e,t){var n;function r(s){return a(s.originalEvent)}e.on("canvas.focus.changed",function(s){s.focused?e.on("element.mousedown",500,r):e.off("element.mousedown",r)});function i(s){var c=n.start,u=n.button,p=An(s),l=Dt(p,c);if(!n.dragging&&nC(l)>tC&&(n.dragging=!0,u===0&&nu(e),Di("grab")),n.dragging){var f=n.last||n.start;l=Dt(p,f),t.scroll({dx:l.x,dy:l.y}),n.last=p}s.preventDefault()}function o(s){se.unbind(document,"mousemove",i),se.unbind(document,"mouseup",o),n=null,tu()}function a(s){if(!Bn(s.target,".djs-draggable")){var c=s.button;if(!(c>=2||s.ctrlKey||s.shiftKey||s.altKey))return n={button:c,start:An(s)},se.bind(document,"mousemove",i),se.bind(document,"mouseup",o),!0}}this.isActive=function(){return!!n}}ru.$inject=["eventBus","canvas"];function nC(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}var iu={__init__:["moveCanvas"],moveCanvas:["type",ru]};function Ha(e){return Math.log(e)/Math.log(10)}function af(e,t){var n=Ha(e.min),r=Ha(e.max),i=Math.abs(n)+Math.abs(r);return i/t}function ov(e,t){return Math.max(e.min,Math.min(e.max,t))}N();var rC=Math.sign||function(e){return e>=0?1:-1},sf={min:.2,max:4},av=10,iC=.1,oC=.75;function Tn(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=tt(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||oC;var r=this;t.on("canvas.mouseover",function(){r._init(e.enabled!==!1)}),t.on("canvas.mouseout",function(){r._init(!1)})}Tn.$inject=["config.zoomScroll","eventBus","canvas"];Tn.prototype.scroll=function(t){this._canvas.scroll(t)};Tn.prototype.reset=function(){this._canvas.zoom("fit-viewport")};Tn.prototype.zoom=function(t,n){var r=af(sf,av*2);this._totalDelta+=t,Math.abs(this._totalDelta)>iC&&(this._zoom(t,n,r),this._totalDelta=0)};Tn.prototype._handleWheel=function(t){if(this._enabled){var n=this._container;t.preventDefault();var r=t.ctrlKey||Uc()&&t.metaKey,i=t.shiftKey,o=-1*this._scale,a;if(r?o*=t.deltaMode===0?.02:.32:o*=t.deltaMode===0?1:16,r){var s=n.getBoundingClientRect(),c={x:t.clientX-s.left,y:t.clientY-s.top};a=Math.sqrt(Math.pow(t.deltaY,2)+Math.pow(t.deltaX,2))*rC(t.deltaY)*o,this.zoom(a,c)}else i?a={dx:o*t.deltaY,dy:0}:a={dx:o*t.deltaX,dy:o*t.deltaY},this.scroll(a)}};Tn.prototype.stepZoom=function(t,n){var r=af(sf,av);this._zoom(t,n,r)};Tn.prototype._zoom=function(e,t,n){var r=this._canvas,i=e>0?1:-1,o=Ha(r.zoom()),a=Math.round(o/n)*n;a+=n*i;var s=Math.pow(10,a);r.zoom(ov(sf,s),t)};Tn.prototype.toggle=function(t){var n=this._container,r=this._handleWheel,i=this._enabled;return typeof t=="undefined"&&(t=!i),i!==t&&se[t?"bind":"unbind"](n,"wheel",r,!1),this._enabled=t,t};Tn.prototype._init=function(e){this.toggle(e)};var ou={__init__:["zoomScroll"],zoomScroll:["type",Tn]};function sr(e){nn.call(this,e)}B(sr,nn);sr.prototype._navigationModules=[eu,iu,ou];sr.prototype._modules=[].concat(nn.prototype._modules,sr.prototype._navigationModules);N();function cf(e){return e&&e[e.length-1]}function sv(e){return e.y}function cv(e){return e.x}var aC={left:cv,center:cv,right:function(e){return e.x+e.width},top:sv,middle:sv,bottom:function(e){return e.y+e.height}};function ni(e,t){this._modeling=e,this._rules=t}ni.$inject=["modeling","rules"];ni.prototype._getOrientationDetails=function(e){var t=["top","bottom","middle"],n="x",r="width";return t.indexOf(e)!==-1&&(n="y",r="height"),{axis:n,dimension:r}};ni.prototype._isType=function(e,t){return t.indexOf(e)!==-1};ni.prototype._alignmentPosition=function(e,t){var n=this._getOrientationDetails(e),r=n.axis,i=n.dimension,o={},a={},s=!1,c,u,p;function l(f,d){return Math.round((f[r]+d[r]+d[i])/2)}if(this._isType(e,["left","top"]))o[e]=t[0][r];else if(this._isType(e,["right","bottom"]))p=cf(t),o[e]=p[r]+p[i];else if(this._isType(e,["center","middle"])){if(E(t,function(f){var d=f[r]+Math.round(f[i]/2);a[d]?a[d].elements.push(f):a[d]={elements:[f],center:d}}),c=At(a,function(f){return f.elements.length>1&&(s=!0),f.elements.length}),s)return o[e]=cf(c).center,o;u=t[0],t=At(t,function(f){return f[r]+f[i]}),p=cf(t),o[e]=l(u,p)}return o};ni.prototype.trigger=function(e,t){var n=this._modeling,r,i=Q(e,function(c){return!(c.waypoints||c.host||c.labelTarget)});if(r=this._rules.allowed("elements.align",{elements:i}),q(r)&&(i=r),!(i.length<2||!r)){var o=aC[t],a=At(i,o),s=this._alignmentPosition(t,a);n.alignElements(a,s)}};var uv={__init__:["alignElements"],alignElements:["type",ni]};var sC=new or;function ri(e){this._scheduled={},e.on("diagram.destroy",()=>{Object.keys(this._scheduled).forEach(t=>{this.cancel(t)})})}ri.$inject=["eventBus"];ri.prototype.schedule=function(e,t=sC.next()){this.cancel(t);let n=this._schedule(e,t);return this._scheduled[t]=n,n.promise};ri.prototype._schedule=function(e,t){let n=cC();return{executionId:setTimeout(()=>{try{this._scheduled[t]=null;try{n.resolve(e())}catch(i){n.reject(i)}}catch(i){console.error("Scheduler#_schedule execution failed",i)}}),promise:n.promise}};ri.prototype.cancel=function(e){let t=this._scheduled[e];t&&(this._cancel(t),this._scheduled[e]=null)};ri.prototype._cancel=function(e){clearTimeout(e.executionId)};function cC(){let e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}var pv={scheduler:["type",ri]};N();var uC="djs-element-hidden",au=".entry",pC=1e3,lv=8,lC=300;function it(e,t,n,r){this._canvas=e,this._elementRegistry=t,this._eventBus=n,this._scheduler=r,this._current=null,this._init()}it.$inject=["canvas","elementRegistry","eventBus","scheduler"];it.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",function(t){var n=t.newSelection,r=n.length?n.length===1?n[0]:n:null;r?e.open(r,!0):e.close()}),this._eventBus.on("elements.changed",function(t){var n=t.elements,r=e._current;if(r){var i=r.target,o=q(i)?i:[i],a=o.filter(function(c){return n.includes(c)});if(a.length){e.close();var s=o.filter(function(c){return e._elementRegistry.get(c.id)});s.length&&e._updateAndOpen(s.length>1?s:s[0])}}}),this._eventBus.on("canvas.viewbox.changed",function(){e._updatePosition()}),this._eventBus.on("element.marker.update",function(t){if(e.isOpen()){var n=t.element,r=e._current,i=q(r.target)?r.target:[r.target];i.includes(n)&&e._updateVisibility()}}),this._container=this._createContainer()};it.prototype._createContainer=function(){var e=ue('<div class="djs-context-pad-parent"></div>');return this._canvas.getContainer().appendChild(e),e};it.prototype.registerProvider=function(e,t){t||(t=e,e=pC),this._eventBus.on("contextPad.getProviders",e,function(n){n.providers.push(t)})};it.prototype.getEntries=function(e){var t=this._getProviders(),n=q(e)?"getMultiElementContextPadEntries":"getContextPadEntries",r={};return E(t,function(i){if(Le(i[n])){var o=i[n](e);Le(o)?r=o(r):E(o,function(a,s){r[s]=a})}}),r};it.prototype.trigger=function(e,t,n){var r=this,i,o,a=t.delegateTarget||t.target;if(!a)return t.preventDefault();if(i=nt(a,"data-action"),o=t.originalEvent||t,e==="mouseover"){this._timeout=setTimeout(function(){r._mouseout=r.triggerEntry(i,"hover",o,n)},lC);return}else if(e==="mouseout"){clearTimeout(this._timeout),this._mouseout&&(this._mouseout(),this._mouseout=null);return}return this.triggerEntry(i,e,o,n)};it.prototype.triggerEntry=function(e,t,n,r){if(this.isShown()){var i=this._current.target,o=this._current.entries,a=o[e];if(a){var s=a.action;if(this._eventBus.fire("contextPad.trigger",{entry:a,event:n})!==!1){if(Le(s)){if(t==="click")return s(n,i,r)}else if(s[t])return s[t](n,i,r);n.preventDefault()}}}};it.prototype.open=function(e,t){if(!(!t&&this.isOpen(e))){var n=this._eventBus.fire("contextPad.open.allowed",{target:e});n!==!1&&(this.close(),this._updateAndOpen(e))}};it.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers};it.prototype._updateAndOpen=function(e){var t=this.getEntries(e),n=this._createHtml(e),r;E(t,function(i,o){var a=i.group||"default",s=ue(i.html||'<div class="entry" draggable="true"></div>'),c;nt(s,"data-action",o),c=_e("[data-group="+Rr(a)+"]",n),c||(c=ue('<div class="group"></div>'),nt(c,"data-group",a),n.appendChild(c)),c.appendChild(s),i.className&&fC(s,i.className),i.title&&nt(s,"title",i.title),i.imageUrl&&(r=ue("<img>"),nt(r,"src",i.imageUrl),r.style.width="100%",r.style.height="100%",s.appendChild(r))}),Ne(n).add("open"),this._current={entries:t,html:n,target:e},this._updatePosition(),this._updateVisibility(),this._eventBus.fire("contextPad.open",{current:this._current})};it.prototype._createHtml=function(e){var t=this,n=ue('<div class="djs-context-pad"></div>');return bt.bind(n,au,"click",function(r){t.trigger("click",r)}),bt.bind(n,au,"dragstart",function(r){t.trigger("dragstart",r)}),bt.bind(n,au,"mouseover",function(r){t.trigger("mouseover",r)}),bt.bind(n,au,"mouseout",function(r){t.trigger("mouseout",r)}),se.bind(n,"mousedown",function(r){r.stopPropagation()}),this._container.appendChild(n),this._eventBus.fire("contextPad.create",{target:e,pad:n}),n};it.prototype.getPad=function(e){console.warn(new Error("ContextPad#getPad is deprecated and will be removed in future library versions, cf. https://github.com/bpmn-io/diagram-js/pull/888"));let t;return this.isOpen()&&mC(this._current.target,e)?t=this._current.html:t=this._createHtml(e),{html:t}};it.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)};it.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return q(e)!==q(n)?!1:q(e)?e.length===n.length&&ln(e,function(r){return n.includes(r)}):n===e};it.prototype.isShown=function(){return this.isOpen()&&Ne(this._current.html).has("open")};it.prototype.show=function(){this.isOpen()&&(Ne(this._current.html).add("open"),this._updatePosition(),this._eventBus.fire("contextPad.show",{current:this._current}))};it.prototype.hide=function(){this.isOpen()&&(Ne(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))};it.prototype._getPosition=function(e){if(!q(e)&&de(e)){var t=this._canvas.viewbox(),n=dC(e),r=n.x*t.scale-t.x*t.scale,i=n.y*t.scale-t.y*t.scale;return{left:r+lv*this._canvas.zoom(),top:i}}var o=this._canvas.getContainer(),a=o.getBoundingClientRect(),s=this._getTargetBounds(e);return{left:s.right-a.left+lv*this._canvas.zoom(),top:s.top-a.top}};it.prototype._updatePosition=function(){let e=()=>{if(this.isOpen()){var t=this._current.html,n=this._getPosition(this._current.target);"x"in n&&"y"in n?(t.style.left=n.x+"px",t.style.top=n.y+"px"):["top","right","bottom","left"].forEach(function(r){r in n&&(t.style[r]=n[r]+"px")})}};this._scheduler.schedule(e,"ContextPad#_updatePosition")};it.prototype._updateVisibility=function(){let e=()=>{if(this.isOpen()){var t=this,n=this._current.target,r=q(n)?n:[n],i=r.some(function(o){return t._canvas.hasMarker(o,uC)});i?t.hide():t.show()}};this._scheduler.schedule(e,"ContextPad#_updateVisibility")};it.prototype._getTargetBounds=function(e){var t=this,n=q(e)?e:[e],r=n.map(function(i){return t._canvas.getGraphics(i)});return r.reduce(function(i,o){let a=o.getBoundingClientRect();return i.top=Math.min(i.top,a.top),i.right=Math.max(i.right,a.right),i.bottom=Math.max(i.bottom,a.bottom),i.left=Math.min(i.left,a.left),i.x=i.left,i.y=i.top,i.width=i.right-i.left,i.height=i.bottom-i.top,i},{top:1/0,right:-1/0,bottom:-1/0,left:1/0})};function fC(e,t){var n=Ne(e);t=q(t)?t:t.split(/\s+/g),t.forEach(function(r){n.add(r)})}function dC(e){return e.waypoints[e.waypoints.length-1]}function mC(e,t){return e=q(e)?e:[e],t=q(t)?t:[t],e.length===t.length&&ln(e,function(n){return t.includes(n)})}var su={__depends__:[ei,pv,Qr],contextPad:["type",it]};var mu,Ye,vv,hC,ii,fv,gv,yv,uf,uu,$a,_v,df,pf,lf,vC,lu={},fu=[],gC=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,hu=Array.isArray;function Dr(e,t){for(var n in t)e[n]=t[n];return e}function mf(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function vu(e,t,n){var r,i,o,a={};for(o in t)o=="key"?r=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?mu.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return pu(e,a,r,i,null)}function pu(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i==null?++vv:i,__i:-1,__u:0};return i==null&&Ye.vnode!=null&&Ye.vnode(o),o}function gu(e){return e.children}function za(e,t){this.props=e,this.context=t}function Co(e,t){if(t==null)return e.__?Co(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Co(e):null}function yC(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],o=Dr({},t);o.__v=t.__v+1,Ye.vnode&&Ye.vnode(o),hf(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n==null?Co(t):n,!!(32&t.__u),i),o.__v=t.__v,o.__.__k[o.__i]=o,wv(r,o,i),t.__e=t.__=null,o.__e!=n&&bv(o)}}function bv(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),bv(e)}function dv(e){(!e.__d&&(e.__d=!0)&&ii.push(e)&&!du.__r++||fv!=Ye.debounceRendering)&&((fv=Ye.debounceRendering)||gv)(du)}function du(){try{for(var e,t=1;ii.length;)ii.length>t&&ii.sort(yv),e=ii.shift(),t=ii.length,yC(e)}finally{ii.length=du.__r=0}}function xv(e,t,n,r,i,o,a,s,c,u,p){var l,f,d,m,g,v,w,S=r&&r.__k||fu,x=t.length;for(c=_C(n,t,S,c,x),l=0;l<x;l++)(d=n.__k[l])!=null&&(f=d.__i!=-1&&S[d.__i]||lu,d.__i=l,v=hf(e,d,f,i,o,a,s,c,u,p),m=d.__e,d.ref&&f.ref!=d.ref&&(f.ref&&vf(f.ref,null,d),p.push(d.ref,d.__c||m,d)),g==null&&m!=null&&(g=m),(w=!!(4&d.__u))||f.__k===d.__k?(c=Ev(d,c,e,w),w&&f.__e&&(f.__e=null)):typeof d.type=="function"&&v!==void 0?c=v:m&&(c=m.nextSibling),d.__u&=-7);return n.__e=g,c}function _C(e,t,n,r,i){var o,a,s,c,u,p=n.length,l=p,f=0;for(e.__k=new Array(i),o=0;o<i;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=e.__k[o]=pu(null,a,null,null,null):hu(a)?a=e.__k[o]=pu(gu,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=e.__k[o]=pu(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[o]=a,c=o+f,a.__=e,a.__b=e.__b+1,s=null,(u=a.__i=bC(a,n,c,l))!=-1&&(l--,(s=n[u])&&(s.__u|=2)),s==null||s.__v==null?(u==-1&&(i>p?f--:i<p&&f++),typeof a.type!="function"&&(a.__u|=4)):u!=c&&(u==c-1?f--:u==c+1?f++:(u>c?f--:f++,a.__u|=4))):e.__k[o]=null;if(l)for(o=0;o<p;o++)(s=n[o])!=null&&(2&s.__u)==0&&(s.__e==r&&(r=Co(s)),Cv(s,s));return r}function Ev(e,t,n,r){var i,o;if(typeof e.type=="function"){for(i=e.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=e,t=Ev(i[o],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=Co(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function bC(e,t,n,r){var i,o,a,s=e.key,c=e.type,u=t[n],p=u!=null&&(2&u.__u)==0;if(u===null&&s==null||p&&s==u.key&&c==u.type)return n;if(r>(p?1:0)){for(i=n-1,o=n+1;i>=0||o<t.length;)if((u=t[a=i>=0?i--:o++])!=null&&(2&u.__u)==0&&s==u.key&&c==u.type)return a}return-1}function mv(e,t,n){t[0]=="-"?e.setProperty(t,n==null?"":n):e[t]=n==null?"":typeof n!="number"||gC.test(t)?n:n+"px"}function cu(e,t,n,r,i){var o,a;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||mv(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||mv(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(_v,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n[$a]=r[$a]:(n[$a]=df,e.addEventListener(t,o?lf:pf,o)):e.removeEventListener(t,o?lf:pf,o);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n==null?"":n;break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function hv(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[uu]==null)t[uu]=df++;else if(t[uu]<n[$a])return;return n(Ye.event?Ye.event(t):t)}}}function hf(e,t,n,r,i,o,a,s,c,u){var p,l,f,d,m,g,v,w,S,x,b,R,A,O,T,I=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),o=[s=t.__e=n.__e]),(p=Ye.__b)&&p(t);e:if(typeof I=="function")try{if(w=t.props,S=I.prototype&&I.prototype.render,x=(p=I.contextType)&&r[p.__c],b=p?x?x.props.value:p.__:r,n.__c?v=(l=t.__c=n.__c).__=l.__E:(S?t.__c=l=new I(w,b):(t.__c=l=new za(w,b),l.constructor=I,l.render=EC),x&&x.sub(l),l.state||(l.state={}),l.__n=r,f=l.__d=!0,l.__h=[],l._sb=[]),S&&l.__s==null&&(l.__s=l.state),S&&I.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=Dr({},l.__s)),Dr(l.__s,I.getDerivedStateFromProps(w,l.__s))),d=l.props,m=l.state,l.__v=t,f)S&&I.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),S&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(S&&I.getDerivedStateFromProps==null&&w!==d&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(w,b),t.__v==n.__v||!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(w,l.__s,b)===!1){t.__v!=n.__v&&(l.props=w,l.state=l.__s,l.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(L){L&&(L.__=t)}),fu.push.apply(l.__h,l._sb),l._sb=[],l.__h.length&&a.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(w,l.__s,b),S&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(d,m,g)})}if(l.context=b,l.props=w,l.__P=e,l.__e=!1,R=Ye.__r,A=0,S)l.state=l.__s,l.__d=!1,R&&R(t),p=l.render(l.props,l.state,l.context),fu.push.apply(l.__h,l._sb),l._sb=[];else do l.__d=!1,R&&R(t),p=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++A<25);l.state=l.__s,l.getChildContext!=null&&(r=Dr(Dr({},r),l.getChildContext())),S&&!f&&l.getSnapshotBeforeUpdate!=null&&(g=l.getSnapshotBeforeUpdate(d,m)),O=p!=null&&p.type===gu&&p.key==null?Sv(p.props.children):p,s=xv(e,hu(O)?O:[O],t,n,r,i,o,a,s,c,u),l.base=t.__e,t.__u&=-161,l.__h.length&&a.push(l),v&&(l.__E=l.__=null)}catch(L){if(t.__v=null,c||o!=null)if(L.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else{for(T=o.length;T--;)mf(o[T]);ff(t)}else t.__e=n.__e,t.__k=n.__k,L.then||ff(t);Ye.__e(L,t,n)}else o==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=xC(n.__e,t,n,r,i,o,a,c,u);return(p=Ye.diffed)&&p(t),128&t.__u?void 0:s}function ff(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ff))}function wv(e,t,n){for(var r=0;r<n.length;r++)vf(n[r],n[++r],n[++r]);Ye.__c&&Ye.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){Ye.__e(o,i.__v)}})}function Sv(e){return typeof e!="object"||e==null||e.__b>0?e:hu(e)?e.map(Sv):e.constructor!==void 0?null:Dr({},e)}function xC(e,t,n,r,i,o,a,s,c){var u,p,l,f,d,m,g,v=n.props||lu,w=t.props,S=t.type;if(S=="svg"?i="http://www.w3.org/2000/svg":S=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(u=0;u<o.length;u++)if((d=o[u])&&"setAttribute"in d==!!S&&(S?d.localName==S:d.nodeType==3)){e=d,o[u]=null;break}}if(e==null){if(S==null)return document.createTextNode(w);e=document.createElementNS(i,S,w.is&&w),s&&(Ye.__m&&Ye.__m(t,o),s=!1),o=null}if(S==null)v===w||s&&e.data==w||(e.data=w);else{if(o=S=="textarea"&&w.defaultValue!=null?null:o&&mu.call(e.childNodes),!s&&o!=null)for(v={},u=0;u<e.attributes.length;u++)v[(d=e.attributes[u]).name]=d.value;for(u in v)d=v[u],u=="dangerouslySetInnerHTML"?l=d:u=="children"||u in w||u=="value"&&"defaultValue"in w||u=="checked"&&"defaultChecked"in w||cu(e,u,null,d,i);for(u in w)d=w[u],u=="children"?f=d:u=="dangerouslySetInnerHTML"?p=d:u=="value"?m=d:u=="checked"?g=d:s&&typeof d!="function"||v[u]===d||cu(e,u,d,v[u],i);if(p)s||l&&(p.__html==l.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(l&&(e.innerHTML=""),xv(t.type=="template"?e.content:e,hu(f)?f:[f],t,n,r,S=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:n.__k&&Co(n,0),s,c),o!=null)for(u=o.length;u--;)mf(o[u]);s&&S!="textarea"||(u="value",S=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[u]||S=="progress"&&!m||S=="option"&&m!=v[u])&&cu(e,u,m,v[u],i),u="checked",g!=null&&g!=e[u]&&cu(e,u,g,v[u],i))}return e}function vf(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(i){Ye.__e(i,n)}}function Cv(e,t,n){var r,i;if(Ye.unmount&&Ye.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||vf(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){Ye.__e(o,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Cv(r[i],t,n||typeof e.type!="function");n||mf(e.__e),e.__c=e.__=e.__e=void 0}function EC(e,t,n){return this.constructor(e,n)}function yu(e,t,n){var r,i,o,a;t==document&&(t=document.documentElement),Ye.__&&Ye.__(e,t),i=(r=typeof n=="function")?null:n&&n.__k||t.__k,o=[],a=[],hf(t,e=(!r&&n||t).__k=vu(gu,null,[e]),i||lu,lu,t.namespaceURI,!r&&n?[n]:i?null:t.firstChild?mu.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r,a),wv(o,e,a)}mu=fu.slice,Ye={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(s){e=s}throw e}},vv=0,hC=function(e){return e!=null&&e.constructor===void 0},za.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Dr({},this.state),typeof e=="function"&&(e=e(Dr({},n),this.props)),e&&Dr(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),dv(this))},za.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),dv(this))},za.prototype.render=gu,ii=[],gv=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,yv=function(e,t){return e.__v.__b-t.__v.__b},du.__r=0,uf=Math.random().toString(8),uu="__d"+uf,$a="__a"+uf,_v=/(PointerCapture)$|Capture$/i,df=0,pf=hv(!1),lf=hv(!0),vC=0;var Pv=function(e,t,n,r){var i;t[0]=0;for(var o=1;o<t.length;o++){var a=t[o++],s=t[o]?(t[0]|=a?1:2,n[t[o++]]):t[++o];a===3?r[0]=s:a===4?r[1]=Object.assign(r[1]||{},s):a===5?(r[1]=r[1]||{})[t[++o]]=s:a===6?r[1][t[++o]]+=s+"":a?(i=e.apply(s,Pv(e,s,n,["",null])),r.push(i),s[0]?t[0]|=2:(t[o-2]=0,t[o]=i)):r.push(s)}return r},Rv=new Map;function Av(e){var t=Rv.get(this);return t||(t=new Map,Rv.set(this,t)),(t=Pv(this,t.get(e)||(t.set(e,t=(function(n){for(var r,i,o=1,a="",s="",c=[0],u=function(f){o===1&&(f||(a=a.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?c.push(0,f,a):o===3&&(f||a)?(c.push(3,f,a),o=2):o===2&&a==="..."&&f?c.push(4,f,0):o===2&&a&&!f?c.push(5,0,!0,a):o>=5&&((a||!f&&o===5)&&(c.push(o,0,a,i),o=6),f&&(c.push(o,f,0,i),o=6)),a=""},p=0;p<n.length;p++){p&&(o===1&&u(),u(p));for(var l=0;l<n[p].length;l++)r=n[p][l],o===1?r==="<"?(u(),c=[c],o=3):a+=r:o===4?a==="--"&&r===">"?(o=1,a=""):a=r+a[0]:s?r===s?s="":a+=r:r==='"'||r==="'"?s=r:r===">"?(u(),o=1):o&&(r==="="?(o=5,i=a,a=""):r==="/"&&(o<5||n[p][l+1]===">")?(u(),o===3&&(c=c[0]),o=c,(c=c[0]).push(2,0,o),o=0):r===" "||r===" "||r===` property 282 </svg>`},cd=zT;N();var GT=900;function to(e,t,n,r){this._distributeElements=t,this._translate=n,this._popupMenu=e,this._rules=r,e.registerProvider("align-elements",GT,this)}to.$inject=["popupMenu","distributeElements","translate","rules"];to.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&C(t,this._getEntries(e)),t};to.prototype._isAllowed=function(e){return this._rules.allowed("elements.distribute",{elements:e})};to.prototype._getEntries=function(e){var t=this._distributeElements,n=this._translate,r=this._popupMenu,i={"distribute-elements-horizontal":{group:"distribute",title:n("Distribute elements horizontally"),className:"bjs-align-elements-menu-entry",imageHtml:cd.horizontal,action:function(o,a){t.trigger(e,"horizontal"),r.close()}},"distribute-elements-vertical":{group:"distribute",title:n("Distribute elements vertically"),imageHtml:cd.vertical,action:function(o,a){t.trigger(e,"vertical"),r.close()}}};return i};var gb={__depends__:[Do,vb],__init__:["bpmnDistributeElements","distributeElementsMenuProvider"],bpmnDistributeElements:["type",ha],distributeElementsMenuProvider:["type",to]};N();var yb="is not a registered action",VT="is already registered";function Zt(e,t){this._eventBus=e,this._actions={};var n=this;e.on("diagram.init",function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})})}Zt.$inject=["eventBus","injector"];Zt.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),n=e.get("modeling",!1),r=e.get("selection",!1),i=e.get("zoomScroll",!1),o=e.get("copyPaste",!1),a=e.get("canvas",!1),s=e.get("rules",!1),c=e.get("keyboardMove",!1),u=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",function(){t.undo()}),this.register("redo",function(){t.redo()})),o&&r&&this.register("copy",function(){var p=r.get();if(p.length)return o.copy(p)}),o&&r&&this.register("duplicate",function(){var p=r.get();if(p.length)return o.duplicate(p)}),o&&this.register("paste",function(){o.paste()}),o&&r&&s&&this.register("cut",function(){var p=r.get();if(p.length){var l=s.allowed("elements.delete",{elements:p});if(l!==!1){var f=q(l)?l:p;return o.cut(f.slice())}}}),i&&this.register("stepZoom",function(p){i.stepZoom(p.value)}),a&&this.register("zoom",function(p){a.zoom(p.value)}),n&&r&&s&&this.register("removeSelection",function(){var p=r.get();if(p.length){var l=s.allowed("elements.delete",{elements:p}),f;l!==!1&&(q(l)?f=l:f=p,f.length&&n.removeElements(f.slice()))}}),c&&this.register("moveCanvas",function(p){c.moveCanvas(p)}),u&&this.register("moveSelection",function(p){u.moveSelection(p.direction,p.accelerated)})};Zt.prototype.trigger=function(e,t){if(!this._actions[e])throw ud(e,yb);var n=this._eventBus.fire("editorActions.allowed",{action:e,opts:t});if(n!==!1)return this._actions[e](t)};Zt.prototype.register=function(e,t){var n=this;if(typeof e=="string")return this._registerAction(e,t);E(e,function(r,i){n._registerAction(i,r)})};Zt.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw ud(e,VT);this._actions[e]=t};Zt.prototype.unregister=function(e){if(!this.isRegistered(e))throw ud(e,yb);this._actions[e]=void 0};Zt.prototype.getActions=function(){return Object.keys(this._actions)};Zt.prototype.isRegistered=function(e){return!!this._actions[e]};function ud(e,t){return new Error(e+" "+t)}var _b={__init__:["editorActions"],editorActions:["type",Zt]};N();function va(e){e.invoke(Zt,this)}B(va,Zt);va.$inject=["injector"];va.prototype._registerDefaultActions=function(e){Zt.prototype._registerDefaultActions.call(this,e);var t=e.get("canvas",!1),n=e.get("elementRegistry",!1),r=e.get("selection",!1),i=e.get("spaceTool",!1),o=e.get("lassoTool",!1),a=e.get("handTool",!1),s=e.get("globalConnect",!1),c=e.get("distributeElements",!1),u=e.get("alignElements",!1),p=e.get("directEditing",!1),l=e.get("searchPad",!1),f=e.get("modeling",!1),d=e.get("contextPad",!1);t&&n&&r&&this._registerAction("selectElements",function(){var m=t.getRootElement(),g=n.filter(function(v){return v!==m});return r.select(g),g}),i&&this._registerAction("spaceTool",function(){i.toggle()}),o&&this._registerAction("lassoTool",function(){o.toggle()}),a&&this._registerAction("handTool",function(){a.toggle()}),s&&this._registerAction("globalConnectTool",function(){s.toggle()}),r&&c&&this._registerAction("distributeElements",function(m){var g=r.get(),v=m.type;g.length&&c.trigger(g,v)}),r&&u&&this._registerAction("alignElements",function(m){var g=r.get(),v=[],w=m.type;g.length&&(v=Q(g,function(S){return!h(S,"bpmn:Lane")}),u.trigger(v,w))}),r&&f&&this._registerAction("setColor",function(m){var g=r.get();g.length&&f.setColor(g,m)}),r&&p&&this._registerAction("directEditing",function(){var m=r.get();m.length&&p.activate(m[0])}),l&&this._registerAction("find",function(){l.toggle()}),t&&f&&this._registerAction("moveToOrigin",function(){var m=t.getRootElement(),g,v;h(m,"bpmn:Collaboration")?v=n.filter(function(w){return h(w.parent,"bpmn:Collaboration")}):v=n.filter(function(w){return w!==m&&!h(w.parent,"bpmn:SubProcess")}),g=Ce(v),f.moveElements(v,{x:-g.x,y:-g.y},m)}),r&&d&&this._registerAction("replaceElement",function(m){d.triggerEntry("replace","click",m)})};var bb={__depends__:[_b],editorActions:["type",va]};function $p(e){e.on(["create.init","shape.move.init"],function(t){var n=t.context,r=t.shape;te(r,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}$p.$inject=["eventBus"];N();function Lr(e,t){k.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",function(r){var i=r.context,o=i.hints||{},a=o.autoResize;if(a){var s=i.shape,c=i.newBounds;st(a)?i.newBounds=n.snapComplex(c,a):i.newBounds=n.snapSimple(s,c)}})}Lr.$inject=["eventBus","gridSnapping","modeling"];B(Lr,k);Lr.prototype.snapSimple=function(e,t){var n=this._gridSnapping;return t.width=n.snapValue(t.width,{min:t.width}),t.height=n.snapValue(t.height,{min:t.height}),t.x=e.x+e.width/2-t.width/2,t.y=e.y+e.height/2-t.height/2,t};Lr.prototype.snapComplex=function(e,t){return/w|e/.test(t)&&(e=this.snapHorizontally(e,t)),/n|s/.test(t)&&(e=this.snapVertically(e,t)),e};Lr.prototype.snapHorizontally=function(e,t){var n=this._gridSnapping,r=/w/.test(t),i=/e/.test(t),o={};return o.width=n.snapValue(e.width,{min:e.width}),i&&(r?(o.x=n.snapValue(e.x,{max:e.x}),o.width+=n.snapValue(e.x-o.x,{min:e.x-o.x})):e.x=e.x+e.width-o.width),C(e,o),e};Lr.prototype.snapVertically=function(e,t){var n=this._gridSnapping,r=/n/.test(t),i=/s/.test(t),o={};return o.height=n.snapValue(e.height,{min:e.height}),r&&(i?(o.y=n.snapValue(e.y,{max:e.y}),o.height+=n.snapValue(e.y-o.y,{min:e.y-o.y})):e.y=e.y+e.height-o.height),C(e,o),e};var WT=2e3;function zp(e,t){e.on(["spaceTool.move","spaceTool.end"],WT,function(n){var r=n.context;if(r.initialized){var i=r.axis,o;i==="x"?(o=t.snapValue(n.dx),n.x=n.x+o-n.dx,n.dx=o):(o=t.snapValue(n.dy),n.y=n.y+o-n.dy,n.dy=o)}})}zp.$inject=["eventBus","gridSnapping"];var xb={__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",Lr],gridSnappingSpaceToolBehavior:["type",zp]};N();var ic=10;function Gp(e,t,n){return n||(n="round"),Math[n](e/t)*t}var UT=1200,qT=800;function mr(e,t,n){var r=!n||n.active!==!1;this._eventBus=t;var i=this;t.on("diagram.init",qT,function(){i.setActive(r)}),t.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],UT,function(o){var a=o.originalEvent;if(!(!i.active||a&&xt(a))){var s=o.context,c=s.gridSnappingContext;c||(c=s.gridSnappingContext={}),["x","y"].forEach(function(u){var p={},l=YT(o,u,e);l&&(p.offset=l);var f=KT(o,u);f&&C(p,f),zn(o,u)||i.snapEvent(o,u,p)})}})}mr.prototype.snapEvent=function(e,t,n){var r=this.snapValue(e[t],n);ze(e,t,r)};mr.prototype.getGridSpacing=function(){return ic};mr.prototype.snapValue=function(e,t){var n=0;t&&t.offset&&(n=t.offset),e+=n,e=Gp(e,ic);var r,i;return t&&t.min&&(r=t.min,ne(r)&&(r=Gp(r+n,ic,"ceil"),e=Math.max(e,r))),t&&t.max&&(i=t.max,ne(i)&&(i=Gp(i+n,ic,"floor"),e=Math.min(e,i))),e-=n,e};mr.prototype.isActive=function(){return this.active};mr.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})};mr.prototype.toggleActive=function(){this.setActive(!this.active)};mr.$inject=["elementRegistry","eventBus","config.gridSnapping"];function KT(e,t){var n=e.context,r=n.createConstraints,i=n.resizeConstraints||{},o=n.gridSnappingContext,a=o.snapConstraints;if(a&&a[t])return a[t];a||(a=o.snapConstraints={}),a[t]||(a[t]={});var s=n.direction;r&&(Vp(t)?(a.x.min=r.left,a.x.max=r.right):(a.y.min=r.top,a.y.max=r.bottom));var c=i.min,u=i.max;return c&&(Vp(t)?wb(s)?a.x.max=c.left:a.x.min=c.right:Eb(s)?a.y.max=c.top:a.y.min=c.bottom),u&&(Vp(t)?wb(s)?a.x.min=u.left:a.x.max=u.right:Eb(s)?a.y.min=u.top:a.y.max=u.bottom),a[t]}function YT(e,t,n){var r=e.context,i=e.shape,o=r.gridSnappingContext,a=o.snapLocation,s=o.snapOffset;return s&&ne(s[t])||(s||(s=o.snapOffset={}),ne(s[t])||(s[t]=0),!i)||(n.get(i.id)||(Vp(t)?s[t]+=i[t]+i.width/2:s[t]+=i[t]+i.height/2),!a)||(t==="x"?/left/.test(a)?s[t]-=i.width/2:/right/.test(a)&&(s[t]+=i.width/2):/top/.test(a)?s[t]-=i.height/2:/bottom/.test(a)&&(s[t]+=i.height/2)),s[t]}function Vp(e){return e==="x"}function Eb(e){return e.indexOf("n")!==-1}function wb(e){return e.indexOf("w")!==-1}var Sb={__depends__:[xb],__init__:["gridSnapping"],gridSnapping:["type",mr]};var XT=2e3;function Wp(e,t,n){e.on("autoPlace",XT,function(r){var i=r.source,o=X(i),a=r.shape,s=Au(i,a,n);return["x","y"].forEach(function(c){var u={};s[c]!==o[c]&&(s[c]>o[c]?u.min=s[c]:u.max=s[c],h(a,"bpmn:TextAnnotation")&&(ZT(c)?u.offset=-a.width/2:u.offset=-a.height/2),s[c]=t.snapValue(s[c],u))}),s})}Wp.$inject=["eventBus","gridSnapping","elementRegistry"];function ZT(e){return e==="x"}var QT=1750;function Up(e,t,n){t.on(["create.start","shape.move.start"],QT,function(r){var i=r.context,o=i.shape,a=e.getRootElement();if(!(!h(o,"bpmn:Participant")||!h(a,"bpmn:Process")||!a.children.length)){var s=i.createConstraints;s&&(o.width=n.snapValue(o.width,{min:o.width}),o.height=n.snapValue(o.height,{min:o.height}))}})}Up.$inject=["canvas","eventBus","gridSnapping"];N();var JT=3e3;function ga(e,t,n){k.call(this,e),this._gridSnapping=t;var r=this;this.postExecuted(["connection.create","connection.layout"],JT,function(i){var o=i.context,a=o.connection,s=o.hints||{},c=a.waypoints;s.connectionStart||s.connectionEnd||s.createElementsBehavior===!1||eM(c)&&n.updateWaypoints(a,r.snapMiddleSegments(c))})}ga.$inject=["eventBus","gridSnapping","modeling"];B(ga,k);ga.prototype.snapMiddleSegments=function(e){var t=this._gridSnapping,n;e=e.slice();for(var r=1;r<e.length-2;r++)n=rM(t,e[r],e[r+1]),e[r]=n[0],e[r+1]=n[1];return e};function eM(e){return e.length>3}function tM(e){return e==="h"}function nM(e){return e==="v"}function rM(e,t,n){var r=en(t,n),i={};return tM(r)&&(i.y=e.snapValue(t.y)),nM(r)&&(i.x=e.snapValue(t.x)),("x"in i||"y"in i)&&(t=C({},t,i),n=C({},n,i)),[t,n]}var Cb={__init__:["gridSnappingAutoPlaceBehavior","gridSnappingParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",Wp],gridSnappingParticipantBehavior:["type",Up],gridSnappingLayoutConnectionBehavior:["type",ga]};var Rb={__depends__:[Sb,Cb],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",$p]};var iM=30,Pb=30;function no(e,t){this._interactionEvents=t;var n=this;e.on(["interactionEvents.createHit","interactionEvents.updateHit"],function(r){var i=r.element,o=r.gfx;if(h(i,"bpmn:Lane"))return n._createParticipantHit(i,o);if(h(i,"bpmn:Participant"))return ie(i)?n._createParticipantHit(i,o):n._createDefaultHit(i,o);if(h(i,"bpmn:SubProcess"))return ie(i)?n._createSubProcessHit(i,o):n._createDefaultHit(i,o)})}no.$inject=["eventBus","interactionEvents"];no.prototype._createDefaultHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createDefaultHit(e,t),!0};no.prototype._createParticipantHit=function(e,t){this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height});var n=Me(e)?{width:iM,height:e.height}:{width:e.width,height:Pb};return this._interactionEvents.createBoxHit(t,"all",n),!0};no.prototype._createSubProcessHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:e.width,height:Pb}),!0};var Ab={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",no]};function ya(e){e.invoke(Mr,this)}B(ya,Mr);ya.$inject=["injector"];ya.prototype.registerBindings=function(e,t){Mr.prototype.registerBindings.call(this,e,t);function n(r,i){t.isRegistered(r)&&e.addListener(i)}n("selectElements",function(r){var i=r.keyEvent;if(e.isKey(["a","A"],i)&&e.isCmd(i))return t.trigger("selectElements"),!0}),n("find",function(r){var i=r.keyEvent;if(e.isKey(["f","F"],i)&&e.isCmd(i))return t.trigger("find"),!0}),n("spaceTool",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["s","S"],i))return t.trigger("spaceTool"),!0}),n("lassoTool",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["l","L"],i))return t.trigger("lassoTool"),!0}),n("handTool",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["h","H"],i))return t.trigger("handTool"),!0}),n("globalConnectTool",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["c","C"],i))return t.trigger("globalConnectTool"),!0}),n("directEditing",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["e","E"],i))return t.trigger("directEditing"),!0}),n("replaceElement",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["r","R"],i))return t.trigger("replaceElement",i),!0})};var Tb={__depends__:[wo],__init__:["keyboardBindings"],keyboardBindings:["type",ya]};N();var oM={moveSpeed:1,moveSpeedAccelerated:10},aM=1500,Mb="left",Db="up",kb="right",Nb="down",sM={ArrowLeft:Mb,Left:Mb,ArrowUp:Db,Up:Db,ArrowRight:kb,Right:kb,ArrowDown:Nb,Down:Nb},cM={left:function(e){return{x:-e,y:0}},up:function(e){return{x:0,y:-e}},right:function(e){return{x:e,y:0}},down:function(e){return{x:0,y:e}}};function qp(e,t,n,r,i){var o=this;this._config=C({},oM,e||{}),t.addListener(aM,function(a){var s=a.keyEvent,c=sM[s.key];if(c&&!t.isCmd(s)){var u=t.isShift(s);return o.moveSelection(c,u),!0}}),this.moveSelection=function(a,s){var c=i.get();if(c.length){var u=this._config[s?"moveSpeedAccelerated":"moveSpeed"],p=cM[a](u),l=r.allowed("elements.move",{shapes:c,hints:{keyboardMove:!0}});l&&n.moveElements(c,p)}}}qp.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];var Ob={__depends__:[wo,rt],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",qp]};N();var Bb=10;function ro(e,t,n,r){this._dragging=r,this._rules=t;var i=this;function o(c,u){var p=c.shape,l=c.direction,f=c.resizeConstraints,d;c.delta=u,d=Ng(p,l,u),c.newBounds=Bg(d,f),c.canExecute=i.canResize(c)}function a(c){var u=c.resizeConstraints,p=c.minBounds;u===void 0&&(p===void 0&&(p=i.computeMinResizeBox(c)),c.resizeConstraints={min:Z(p)})}function s(c){var u=c.shape,p=c.canExecute,l=c.newBounds;if(p){if(l=wc(l),!uM(u,l))return;n.resizeShape(u,l)}}e.on("resize.start",function(c){a(c.context)}),e.on("resize.move",function(c){var u={x:c.dx,y:c.dy};o(c.context,u)}),e.on("resize.end",function(c){s(c.context)})}ro.prototype.canResize=function(e){var t=this._rules,n=mt(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)};ro.prototype.activate=function(e,t,n){var r=this._dragging,i,o;if(typeof n=="string"&&(n={direction:n}),i=C({shape:t},n),o=i.direction,!o)throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");r.init(e,pd(t,o),"resize",{autoActivate:!0,cursor:pM(o),data:{shape:t,context:i}})};ro.prototype.computeMinResizeBox=function(e){var t=e.shape,n=e.direction,r,i;return r=e.minDimensions||{width:Bb,height:Bb},i=tp(t,e.childrenBoxPadding),Ig(n,t,r,i)};ro.$inject=["eventBus","rules","modeling","dragging"];function uM(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function pd(e,t){var n=X(e),r=Z(e),i={x:n.x,y:n.y};return t.indexOf("n")!==-1?i.y=r.top:t.indexOf("s")!==-1&&(i.y=r.bottom),t.indexOf("e")!==-1?i.x=r.right:t.indexOf("w")!==-1&&(i.x=r.left),i}function pM(e){var t="resize-";return e==="n"||e==="s"?t+"ns":e==="e"||e==="w"?t+"ew":e==="nw"||e==="se"?t+"nwse":t+"nesw"}var Ib="djs-resizing",Lb="resize-not-ok",lM=500;function Kp(e,t,n){function r(o){var a=o.shape,s=o.newBounds,c=o.frame;c||(c=o.frame=n.addFrame(a,t.getActiveLayer()),t.addMarker(a,Ib)),s.width>5&&$(c,{x:s.x,width:s.width}),s.height>5&&$(c,{y:s.y,height:s.height}),o.canExecute?pe(c).remove(Lb):pe(c).add(Lb)}function i(o){var a=o.shape,s=o.frame;s&&Pe(o.frame),t.removeMarker(a,Ib)}e.on("resize.move",lM,function(o){r(o.context)}),e.on("resize.cleanup",function(o){i(o.context)})}Kp.$inject=["eventBus","canvas","previewSupport"];N();var Yp=-6,Xp=8,Zp=20,oc="djs-resizer",fM=["n","w","s","e","nw","ne","se","sw"];function hr(e,t,n,r){this._resize=r,this._canvas=t;var i=this;e.on("selection.changed",function(o){var a=o.newSelection;i.removeResizers(),a.length===1&&E(a,tt(i.addResizer,i))}),e.on("shape.changed",function(o){var a=o.element;n.isSelected(a)&&(i.removeResizers(),i.addResizer(a))})}hr.prototype.makeDraggable=function(e,t,n){var r=this._resize;function i(o){gn(o)&&r.activate(o,e,n)}se.bind(t,"mousedown",i),se.bind(t,"touchstart",i)};hr.prototype._createResizer=function(e,t,n,r){var i=this._getResizersParent(),o=dM(r),a=U("g");pe(a).add(oc),pe(a).add(oc+"-"+e.id),pe(a).add(oc+"-"+r),J(i,a);var s=U("rect");$(s,{x:-Xp/2+o.x,y:-Xp/2+o.y,width:Xp,height:Xp}),pe(s).add(oc+"-visual"),J(a,s);var c=U("rect");return $(c,{x:-Zp/2+o.x,y:-Zp/2+o.y,width:Zp,height:Zp}),pe(c).add(oc+"-hit"),J(a,c),fo(a,t,n),a};hr.prototype.createResizer=function(e,t){var n=pd(e,t),r=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,r,t)};hr.prototype.addResizer=function(e){var t=this;de(e)||E(fM,function(n){t._resize.canResize({shape:e,direction:n})&&t.createResizer(e,n)})};hr.prototype.removeResizers=function(){var e=this._getResizersParent();_r(e)};hr.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")};hr.$inject=["eventBus","canvas","selection","resize"];function dM(e){var t={x:0,y:0};return e.indexOf("e")!==-1?t.x=-Yp:e.indexOf("w")!==-1&&(t.x=Yp),e.indexOf("s")!==-1?t.y=-Yp:e.indexOf("n")!==-1&&(t.y=Yp),t}var Qp={__depends__:[Et,kt,Dn],__init__:["resize","resizePreview","resizeHandles"],resize:["type",ro],resizePreview:["type",Kp],resizeHandles:["type",hr]};N();var mM=2e3;function io(e,t,n,r,i,o,a){this._bpmnFactory=t,this._canvas=n,this._modeling=i,this._textRenderer=a,r.registerProvider(this),e.on("element.dblclick",function(c){s(c.element,!0)}),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open","root.set","selection.changed"],function(){r.isActive()&&r.complete()}),e.on(["shape.remove","connection.remove"],mM,function(c){r.isActive(c.element)&&r.cancel()}),e.on(["commandStack.changed"],function(c){r.isActive()&&r.cancel()}),e.on("directEditing.activate",function(c){o.removeResizers()}),e.on("create.end",500,function(c){var u=c.context,p=u.shape,l=c.context.canExecute,f=c.isTouch;f||l&&(u.hints&&u.hints.createElementsBehavior===!1||s(p))}),e.on("autoPlace.end",500,function(c){s(c.shape)});function s(c,u){(u||te(c,["bpmn:Activity","bpmn:Event","bpmn:TextAnnotation","bpmn:Participant"]))&&r.activate(c)}}io.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"];io.prototype.activate=function(e){var t=gt(e);if(t!==void 0){var n={text:t},r=this.getEditingBBox(e);C(n,r);var i={},o=n.style||{};return C(o,{backgroundColor:null,border:null}),(te(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||jb(e))&&C(i,{centerVertically:!0}),mn(e)&&(C(i,{resizable:!0,autoResize:!0}),C(o,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),h(e,"bpmn:TextAnnotation")&&(C(i,{resizable:!0,autoResize:!0}),C(o,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),C(n,{options:i,style:o}),n}};io.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,r=t.getAbsoluteBBox(n),i={x:r.x+r.width/2,y:r.y+r.height/2},o={x:r.x,y:r.y},a=t.zoom(),s=this._textRenderer.getDefaultStyle(),c=this._textRenderer.getExternalStyle(),u=c.fontSize*a,p=c.lineHeight,l=s.fontSize*a,f=s.lineHeight,d={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};if(h(e,"bpmn:Lane")||gM(e)){var m=Me(e),g=m?{width:r.height,height:30*a,x:r.x-r.height/2+15*a,y:i.y-30*a/2}:{width:r.width,height:30*a};C(o,g),C(d,{fontSize:l+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px",transform:m?"rotate(-90deg)":null})}if(vM(e)){var v=Me(e),w=v?{width:r.width,height:r.height}:{width:r.height,height:r.width,x:i.x-r.height/2,y:i.y-r.width/2};C(o,w),C(d,{fontSize:l+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px",transform:v?null:"rotate(-90deg)"})}(te(e,["bpmn:Task","bpmn:CallActivity"])||jb(e))&&(C(o,{width:r.width,height:r.height}),C(d,{fontSize:l+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"})),hM(e)&&(C(o,{width:r.width,x:r.x}),C(d,{fontSize:l+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"}));var S=1,x=r.width+2*S;if(n.labelTarget&&(C(o,{width:x,height:r.height+2*S,x:r.x-S,y:r.y-S}),C(d,{fontSize:u+"px",lineHeight:p})),mn(n)&&!Xr(n)&&!ee(n)){var b=La(e),R=t.getAbsoluteBBox({x:b.x,y:b.y,width:0,height:0}),A=u,O=ir.width*a+2*S;C(o,{width:O,height:A+2*S,x:R.x-O/2,y:R.y-A/2-S}),C(d,{fontSize:u+"px",lineHeight:p})}return h(e,"bpmn:TextAnnotation")&&(C(o,{width:r.width+2*S,height:r.height+2*S,x:r.x-S,y:r.y-S,minWidth:30*a,minHeight:10*a}),C(d,{textAlign:"left",paddingTop:wr*a+"px",paddingBottom:wr*a+"px",paddingLeft:wr*a+"px",paddingRight:wr*a+"px",fontSize:l+"px",lineHeight:f})),{bounds:o,style:d}};io.prototype.update=function(e,t,n,r){var i,o;h(e,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(e),i={x:e.x,y:e.y,width:e.width/o.width*r.width,height:e.height/o.height*r.height}),yM(t)&&(t=null),this._modeling.updateLabel(e,t,i)};function jb(e){return h(e,"bpmn:SubProcess")&&!ie(e)}function hM(e){return h(e,"bpmn:SubProcess")&&ie(e)}function vM(e){return h(e,"bpmn:Participant")&&!ie(e)}function gM(e){return h(e,"bpmn:Participant")&&ie(e)}function yM(e){return!e||!e.trim()}var Fb="djs-element-hidden",Hb="djs-label-hidden";function Jp(e,t,n){var r=this,i=t.getDefaultLayer(),o,a,s;e.on("directEditing.activate",function(c){var u=c.active;if(o=u.element.label||u.element,h(o,"bpmn:TextAnnotation")){a=t.getAbsoluteBBox(o),s=U("g");var p=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:o.height,position:{mx:0,my:0}}),l=r.path=U("path");$(l,{d:p,strokeWidth:2,stroke:_M(o)}),J(s,l),J(i,s),Fe(s,o.x,o.y)}h(o,"bpmn:TextAnnotation")||o.labelTarget?t.addMarker(o,Fb):(h(o,"bpmn:Task")||h(o,"bpmn:CallActivity")||h(o,"bpmn:SubProcess")||h(o,"bpmn:Participant")||h(o,"bpmn:Lane"))&&t.addMarker(o,Hb)}),e.on("directEditing.resize",function(c){if(h(o,"bpmn:TextAnnotation")){var u=c.height,p=c.dy,l=Math.max(o.height/a.height*(u+p),0),f=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:l,position:{mx:0,my:0}});$(r.path,{d:f})}}),e.on(["directEditing.complete","directEditing.cancel"],function(c){var u=c.active;u&&(t.removeMarker(u.element.label||u.element,Fb),t.removeMarker(o,Hb)),o=void 0,a=void 0,s&&(Pe(s),s=void 0)})}Jp.$inject=["eventBus","canvas","pathMap"];function _M(e,t){var n=ce(e);return n.get("stroke")||t||"black"}var $b={__depends__:[xo,Qp,Hp],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",io],labelEditingPreview:["type",Jp]};N();var bM=500,xM=1e3;function jr(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),r=this;function i(o){var a=U("rect");return $(a,C({x:0,y:0,rx:4,width:100,height:100},n)),a}e.on(["shape.added","shape.changed"],bM,function(o){var a=o.element,s=o.gfx,c=_e(".djs-outline",s);c||(c=r.getOutline(a)||i(s),J(s,c)),r.updateShapeOutline(c,a)}),e.on(["connection.added","connection.changed"],function(o){var a=o.element,s=o.gfx,c=_e(".djs-outline",s);c||(c=i(s),J(s,c)),r.updateConnectionOutline(c,a)})}jr.prototype.updateShapeOutline=function(e,t){var n=!1,r=this._getProviders();r.length&&E(r,function(i){n=n||i.updateOutline(t,e)}),n||$(e,{x:-this.offset,y:-this.offset,width:t.width+this.offset*2,height:t.height+this.offset*2})};jr.prototype.updateConnectionOutline=function(e,t){var n=Ce(t);$(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+this.offset*2,height:n.height+this.offset*2})};jr.prototype.registerProvider=function(e,t){t||(t=e,e=xM),this._eventBus.on("outline.getProviders",e,function(n){n.providers.push(t)})};jr.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers};jr.prototype.getOutline=function(e){var t,n=this._getProviders();return E(n,function(r){Le(r.getOutline)&&(t=t||r.getOutline(e))}),t};jr.$inject=["eventBus","styles","elementRegistry"];N();var el=6;function ac(e,t,n){this._canvas=t;var r=this;e.on("element.changed",function(i){n.isSelected(i.element)&&r._updateMultiSelectionOutline(n.get())}),e.on("selection.changed",function(i){var o=i.newSelection;r._updateMultiSelectionOutline(o)})}ac.prototype._updateMultiSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");_r(t);var n=e.length>1,r=this._canvas.getContainer();if(pe(r)[n?"add":"remove"]("djs-multi-select"),!!n){var i=EM(Ce(e)),o=U("rect");$(o,C({rx:3},i)),pe(o).add("djs-selection-outline"),J(t,o)}};ac.$inject=["eventBus","canvas","selection"];function EM(e){return{x:e.x-el,y:e.y-el,width:e.width+el*2,height:e.height+el*2}}var _a={__depends__:[rt],__init__:["outline","multiSelectionOutline"],outline:["type",jr],multiSelectionOutline:["type",ac]};var zb=["bpmn:Event","bpmn:SequenceFlow","bpmn:Gateway"],Gb={class:"bjs-label-link",stroke:"var(--element-selected-outline-secondary-stroke-color)",strokeDasharray:"5, 5"},wM=15,tl=2;function nl(e,t,n,r,i){let o=t.getLayer("overlays");e.on(["selection.changed","shape.changed"],function(){s()}),e.on("selection.changed",function({newSelection:l}){var d;let f=l.filter(m=>te(m,zb));if(f.length===1){let m=f[0];ee(m)?a(m,m.labelTarget,l):(d=m.labels)!=null&&d.length&&a(m.labels[0],m,l)}if(f.length===2){let m=f.find(ee),g=f.find(v=>{var w;return(w=v.labels)==null?void 0:w.includes(m)});m&&g&&a(m,g,l)}}),e.on("shape.changed",function({element:l}){var f;!te(l,zb)||!p(l)||(ee(l)?a(l,l.labelTarget,i.get()):(f=l.labels)!=null&&f.length&&a(l.labels[0],l,i.get()))});function a(l,f,d=[]){let m=Xn([X(f),X(l)],Gb),g=m.getAttribute("d"),w=d.includes(l)?c(l):u(l),S=qr(w,g);if(!S)return;let b=d.includes(f)?c(f):u(f),R=qr(b,g)||X(f);Li(R,S)<wM||(Pa(m,[R,S]),J(o,m))}function s(){xi(`.${Gb.class}`,o).forEach(Pe)}function c(l){let f=r.getOutline(l),d=r.offset;if(!f)return u(l);if(f.x){let m={x:l.x+oo(f,"x")-tl,y:l.y+oo(f,"y")-tl,width:oo(f,"width")+tl*2,height:oo(f,"height")+tl*2};return ja(m,oo(f,"rx"))}if(f.cx){let m={x:l.x-d,y:l.y-d,width:oo(f,"r")*2,height:oo(f,"r")*2};return Bc(m)}}function u(l){return n.getShapePath(l)}function p(l){return i.get().includes(l)}}nl.$inject=["eventBus","canvas","graphicsFactory","outline","selection"];function oo(e,t){return parseFloat($(e,t)||0)}var Vb={__depends__:[rt,_a],__init__:["labelLink"],labelLink:["type",nl]};N();var SM=new or("tt");function CM(e){var t=ue('<div class="djs-tooltip-container" />');return vt(t,{position:"absolute",width:"0",height:"0"}),e.insertBefore(t,e.firstChild),t}function RM(e,t,n){vt(e,{left:t+"px",top:n+"px"})}function fd(e,t){e.style.display=t===!1?"none":""}var Wb="djs-tooltip",ld="."+Wb;function It(e,t){this._eventBus=e,this._canvas=t,this._ids=SM,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=CM(t.getContainer());var n=this;bt.bind(this._tooltipRoot,ld,"mousedown",function(r){r.stopPropagation()}),bt.bind(this._tooltipRoot,ld,"mouseover",function(r){n.trigger("mouseover",r)}),bt.bind(this._tooltipRoot,ld,"mouseout",function(r){n.trigger("mouseout",r)}),this._init()}It.$inject=["eventBus","canvas"];It.prototype.add=function(e){if(!e.position)throw new Error("must specifiy tooltip position");if(!e.html)throw new Error("must specifiy tooltip html");var t=this._ids.next();return e=C({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t};It.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,r=this.get(nt(n,"data-tooltip-id"));r&&(e==="mouseover"&&r.timeout&&this.clearTimeout(r),e==="mouseout"&&r.timeout&&(r.timeout=1e3,this.setTimeout(r)))};It.prototype.get=function(e){return typeof e!="string"&&(e=e.id),this._tooltips[e]};It.prototype.clearTimeout=function(e){if(e=this.get(e),!!e){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}};It.prototype.setTimeout=function(e){if(e=this.get(e),!!e){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout(function(){t.remove(e)},e.timeout)}};It.prototype.remove=function(e){var t=this.get(e);t&&(Wt(t.html),Wt(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])};It.prototype.show=function(){fd(this._tooltipRoot)};It.prototype.hide=function(){fd(this._tooltipRoot,!1)};It.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1,r="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._tooltipRoot.style.transform=r,this._tooltipRoot.style["-ms-transform"]=r};It.prototype._addTooltip=function(e){var t=e.id,n=e.html,r,i=this._tooltipRoot;n.get&&n.constructor.prototype.jquery&&(n=n.get(0)),st(n)&&(n=ue(n)),r=ue('<div data-tooltip-id="'+t+'" class="'+Wb+'">'),vt(r,{position:"absolute"}),r.appendChild(n),e.type&&Ne(r).add("djs-tooltip-"+e.type),e.className&&Ne(r).add(e.className),e.htmlContainer=r,i.appendChild(r),this._tooltips[t]=e,this._updateTooltip(e)};It.prototype._updateTooltip=function(e){var t=e.position,n=e.htmlContainer;RM(n,t.x,t.y)};It.prototype._updateTooltipVisibilty=function(e){E(this._tooltips,function(t){var n=t.show,r=t.htmlContainer,i=!0;n&&((n.minZoom>e.scale||n.maxZoom<e.scale)&&(i=!1),fd(r,i))})};It.prototype._init=function(){var e=this;function t(n){e._updateRoot(n),e._updateTooltipVisibilty(n),e.show()}this._eventBus.on("canvas.viewbox.changing",function(n){e.hide()}),this._eventBus.on("canvas.viewbox.changed",function(n){t(n.viewbox)})};var Ub={__init__:["tooltips"],tooltips:["type",It]};var PM="flow elements must be children of pools/participants",AM="Data object must be placed within a pool/participant.";function rl(e,t,n){function r(i,o,a){t.add({position:{x:i.x+5,y:i.y+5},type:"error",timeout:a||2e3,html:"<div>"+o+"</div>"})}e.on(["shape.move.rejected","create.rejected"],function(i){var o=i.context,a=o.shape,s=o.target;h(s,"bpmn:Collaboration")&&(h(a,"bpmn:FlowNode")?r(i,n(PM)):h(a,"bpmn:DataObjectReference")&&r(i,n(AM)))})}rl.$inject=["eventBus","tooltips","translate"];var qb={__depends__:[Ub],__init__:["modelingFeedback"],modelingFeedback:["type",rl]};N();var TM=500,MM=1250,DM=1500,il=Math.round;function kM(e){return{x:e.x+il(e.width/2),y:e.y+il(e.height/2)}}function ol(e,t,n,r,i){function o(s,c,u,p){return i.allowed("elements.move",{shapes:s,delta:c,position:u,target:p})}e.on("shape.move.start",DM,function(s){var c=s.context,u=s.shape,p=r.get().slice();p.indexOf(u)===-1&&(p=[u]),p=NM(p),C(c,{shapes:p,validatedShapes:p,shape:u})}),e.on("shape.move.start",MM,function(s){var c=s.context,u=c.validatedShapes,p;if(p=c.canExecute=o(u),!p)return!1}),e.on("shape.move.move",TM,function(s){var c=s.context,u=c.validatedShapes,p=s.hover,l={x:s.dx,y:s.dy},f={x:s.x,y:s.y},d;if(d=o(u,l,f,p),c.delta=l,c.canExecute=d,d===null){c.target=null;return}c.target=p}),e.on("shape.move.end",function(s){var c=s.context,u=c.delta,p=c.canExecute,l=p==="attach",f=c.shapes;if(p===!1)return!1;u.x=il(u.x),u.y=il(u.y),!(u.x===0&&u.y===0)&&n.moveElements(f,u,c.target,{primaryShape:c.shape,attach:l})}),e.on("element.mousedown",function(s){if(gn(s)){var c=Ar(s);if(!c)throw new Error("must supply DOM mousedown event");return a(c,s.element)}});function a(s,c,u,p){if(Se(u)&&(p=u,u=!1),!(c.waypoints||!c.parent)&&!pe(s.target).has("djs-hit-no-move")){var l=kM(c),f=t.init(s,l,"shape.move",{cursor:"grabbing",autoActivate:u,data:{shape:c,context:p||{}}});if(f!==!1)return!0}}this.start=a}ol.$inject=["eventBus","dragging","modeling","selection","rules"];function NM(e){var t=Vt(e,"id");return Q(e,function(n){for(;n=n.parent;)if(t[n.id])return!1;return!0})}N();var Kb=499,dd="djs-dragging",Yb="drop-ok",Xb="drop-not-ok",Zb="new-parent",Qb="attach-ok";function al(e,t,n,r){function i(c){var u=o(c),p=OM(u);return p}function o(c){var u=Zn(c,!0),p=u.flatMap(d=>(d.incoming||[]).concat(d.outgoing||[])),l=u.concat(p),f=[...new Set(l)];return f}function a(c,u){[Qb,Yb,Xb,Zb].forEach(function(p){p===u?t.addMarker(c,p):t.removeMarker(c,p)})}function s(c,u,p){r.addDragger(u,c.dragGroup),p&&t.addMarker(u,dd),c.allDraggedElements?c.allDraggedElements.push(u):c.allDraggedElements=[u]}e.on("shape.move.start",Kb,function(c){var u=c.context,p=u.shapes,l=u.allDraggedElements,f=i(p);if(!u.dragGroup){var d=U("g");$(d,n.cls("djs-drag-group",["no-events"]));var m=t.getActiveLayer();J(m,d),u.dragGroup=d}f.forEach(function(g){r.addDragger(g,u.dragGroup)}),l?l=_i([l,o(p)]):l=o(p),E(l,function(g){t.addMarker(g,dd)}),u.allDraggedElements=l,u.differentParents=BM(p)}),e.on("shape.move.move",Kb,function(c){var u=c.context,p=u.dragGroup,l=u.target,f=u.shape.parent,d=u.canExecute;l&&(d==="attach"?a(l,Qb):u.canExecute&&f&&l.id!==f.id?a(l,Zb):a(l,u.canExecute?Yb:Xb)),Fe(p,c.dx,c.dy)}),e.on(["shape.move.out","shape.move.cleanup"],function(c){var u=c.context,p=u.target;p&&a(p,null)}),e.on("shape.move.cleanup",function(c){var u=c.context,p=u.allDraggedElements,l=u.dragGroup;E(p,function(f){t.removeMarker(f,dd)}),l&&Pe(l)}),this.makeDraggable=s}al.$inject=["eventBus","canvas","styles","previewSupport"];function OM(e){var t=Q(e,function(n){return de(n)?re(e,Ct({id:n.source.id}))&&re(e,Ct({id:n.target.id})):!0});return t}function BM(e){return vl(Vt(e,function(t){return t.parent&&t.parent.id}))!==1}var Jb={__depends__:[ei,rt,_a,Et,kt,Dn],__init__:["move","movePreview"],move:["type",ol],movePreview:["type",al]};N();var tx=".djs-palette-toggle",nx=".entry",IM=tx+", "+nx,md="djs-palette-",LM="shown",hd="open",ex="two-column",jM=1e3;function ot(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",function(r){var i=r.tool;n.updateToolHighlight(i)}),e.on("i18n.changed",function(){n._update()}),e.on("diagram.init",function(){n._diagramInitialized=!0,n._rebuild()})}ot.$inject=["eventBus","canvas"];ot.prototype.registerProvider=function(e,t){t||(t=e,e=jM),this._eventBus.on("palette.getProviders",e,function(n){n.providers.push(t)}),this._rebuild()};ot.prototype.getEntries=function(){var e=this._getProviders();return e.reduce(HM,{})};ot.prototype._rebuild=function(){if(this._diagramInitialized){var e=this._getProviders();e.length&&(this._container||this._init(),this._update())}};ot.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),r=this._container=ue(ot.HTML_MARKUP);n.appendChild(r),Ne(n).add(md+LM),bt.bind(r,IM,"click",function(i){var o=i.delegateTarget;if(Ra(o,tx))return e.toggle();e.trigger("click",i)}),se.bind(r,"mousedown",function(i){i.stopPropagation()}),bt.bind(r,nx,"dragstart",function(i){e.trigger("dragstart",i)}),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:r})};ot.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers};ot.prototype._toggleState=function(e){e=e||{};var t=this._getParentContainer(),n=this._container,r=this._eventBus,i,o=Ne(n),a=Ne(t);"twoColumn"in e?i=e.twoColumn:i=this._needsCollapse(t.clientHeight,this._entries||{}),o.toggle(ex,i),a.toggle(md+ex,i),"open"in e&&(o.toggle(hd,e.open),a.toggle(md+hd,e.open)),r.fire("palette.changed",{twoColumn:i,open:this.isOpen()})};ot.prototype._update=function(){var e=_e(".djs-palette-entries",this._container),t=this._entries=this.getEntries();Hr(e),E(t,function(n,r){var i=n.group||"default",o=_e("[data-group="+Rr(i)+"]",e);o||(o=ue('<div class="group"></div>'),nt(o,"data-group",i),e.appendChild(o));var a=n.html||(n.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'),s=ue(a);if(o.appendChild(s),!n.separator&&(nt(s,"data-action",r),n.title&&nt(s,"title",n.title),n.className&&FM(s,n.className),n.imageUrl)){var c=ue("<img>");nt(c,"src",n.imageUrl),s.appendChild(c)}}),this.open()};ot.prototype.trigger=function(e,t,n){var r,i,o=t.delegateTarget||t.target;return o?(r=nt(o,"data-action"),i=t.originalEvent||t,this.triggerEntry(r,e,i,n)):t.preventDefault()};ot.prototype.triggerEntry=function(e,t,n,r){var i=this._entries,o,a;if(o=i[e],!!o&&(a=o.action,this._eventBus.fire("palette.trigger",{entry:o,event:n})!==!1)){if(Le(a)){if(t==="click")return a(n,r)}else if(a[t])return a[t](n,r);n.preventDefault()}};ot.prototype._layoutChanged=function(){this._toggleState({})};ot.prototype._needsCollapse=function(e,t){var n=50,r=Object.keys(t).length*46;return e<r+n};ot.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})};ot.prototype.open=function(){this._toggleState({open:!0})};ot.prototype.toggle=function(){this.isOpen()?this.close():this.open()};ot.prototype.isActiveTool=function(e){return e&&this._activeTool===e};ot.prototype.updateToolHighlight=function(e){var t,n;this._toolsContainer||(t=_e(".djs-palette-entries",this._container),this._toolsContainer=_e("[data-group=tools]",t)),n=this._toolsContainer,E(n.children,function(r){var i=r.getAttribute("data-action");if(i){var o=Ne(r);i=i.replace("-tool",""),o.contains("entry")&&i===e?o.add("highlighted-entry"):o.remove("highlighted-entry")}})};ot.prototype.isOpen=function(){return Ne(this._container).has(hd)};ot.prototype._getParentContainer=function(){return this._canvas.getContainer()};ot.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';function FM(e,t){var n=Ne(e),r=q(t)?t:t.split(/\s+/g);r.forEach(function(i){n.add(i)})}function HM(e,t){var n=t.getPaletteEntries();return Le(n)?n(e):(E(n,function(r,i){e[i]=r}),e)}var rx={__init__:["palette"],palette:["type",ot]};N();var ax="crosshair",ix="selected",$M="djs-dragging-active-lasso";function vr(e,t,n,r,i,o,a){this._selection=i,this._dragging=n,this._mouse=a;var s=this,c={create:function(l){var f=t.getActiveLayer(),d=l.frame=U("rect");$(d,{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),J(f,d),u(!0),this.update(l)},update:function(l){var f=l.frame,d=l.bbox;f&&d&&$(f,{x:d.x,y:d.y,width:d.width,height:d.height});var m=l.marked,g=l.lastMarked;if(m&&g){for(let v of g)m.has(v)||t.removeMarker(v,ix);for(let v of m)g.has(v)||t.addMarker(v,ix)}},remove:function(l){this.update(l),l.frame&&Pe(l.frame),u(!1)}};function u(l){pe(t.getContainer()).toggle($M,l)}function p(l){var f=r.getAll();return new Set(Sn(wi(f,l)))}o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",function(l){var f=l.originalEvent.target;!l.hover&&!(f instanceof SVGElement)||e.once("lasso.selection.ended",function(){s.activateLasso(l.originalEvent,!0)})}),e.on("lasso.end",0,function(l){var f=l.context;s._select(Array.from(f.marked))}),e.on("lasso.start",function(l){var f=l.context;f.bbox=ox(l),f.add=Mi(l),f.lastMarked=new Set(i.get()),f.add?f.marked=f.lastMarked:f.marked=new Set,f.initialMarked=f.marked,c.create(f)}),e.on("lasso.move",function(l){var f=l.context,d=f.bbox=ox(l),m=p(d),g=f.initialMarked.union(m);f.lastMarked=f.marked,f.marked=g,c.update(f)}),e.on("lasso.cleanup",function(l){var f=l.context;f.lastMarked=f.marked,f.marked=new Set(i.get()),c.remove(l.context)}),e.on("element.mousedown",1500,function(l){if(Mi(l))return s.activateLasso(l.originalEvent),!0})}vr.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"];vr.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:ax,data:{context:{}},keepSelection:!0})};vr.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:ax,data:{context:{}},keepSelection:!0})};vr.prototype._select=function(e){this._selection.select(e)};vr.prototype.select=function(e,t,n=[]){var r=Sn(wi(e,t));this._select([...n,...r])};vr.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)};vr.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};function ox(e){var t={x:e.x-e.dx,y:e.y-e.dy},n={x:e.x,y:e.y},r;return t.x<=n.x&&t.y<n.y||t.x<n.x&&t.y<=n.y?r={x:t.x,y:t.y,width:n.x-t.x,height:n.y-t.y}:t.x>=n.x&&t.y<n.y||t.x>n.x&&t.y<=n.y?r={x:n.x,y:t.y,width:t.x-n.x,height:n.y-t.y}:t.x<=n.x&&t.y>n.y||t.x<n.x&&t.y>=n.y?r={x:t.x,y:n.y,width:n.x-t.x,height:t.y-n.y}:t.x>=n.x&&t.y>n.y||t.x>n.x&&t.y>=n.y?r={x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:r={x:n.x,y:n.y,width:0,height:0},r}var sx={__depends__:[fi,pr],__init__:["lassoTool"],lassoTool:["type",vr]};var vd=1500,ux="grab";function vi(e,t,n,r,i,o){this._dragging=n,this._mouse=o;var a=this,s=r.get("keyboard",!1);i.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",vd,function(c){if(Tr(c))return a.activateMove(c.originalEvent,!0),!1}),s&&s.addListener(vd,function(c){if(!(!cx(c.keyEvent)||a.isActive())){var u=a._mouse.getLastMoveEvent();a.activateMove(u,!!u)}},"keyboard.keydown"),s&&s.addListener(vd,function(c){!cx(c.keyEvent)||!a.isActive()||a.toggle()},"keyboard.keyup"),e.on("hand.end",function(c){var u=c.originalEvent.target;if(!c.hover&&!(u instanceof SVGElement))return!1;e.once("hand.ended",function(){a.activateMove(c.originalEvent,{reactivate:!0})})}),e.on("hand.move.move",function(c){var u=t.viewbox().scale;t.scroll({dx:c.dx*u,dy:c.dy*u})}),e.on("hand.move.end",function(c){var u=c.context,p=u.reactivate;return!Tr(c)&&p&&e.once("hand.move.ended",function(l){a.activateHand(l.originalEvent,!0,!0)}),!1})}vi.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"];vi.prototype.activateMove=function(e,t,n){typeof t=="object"&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:ux,data:{context:n||{}}})};vi.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:ux,data:{context:{reactivate:n}}})};vi.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)};vi.prototype.isActive=function(){var e=this._dragging.context();return e?/^(hand|hand\.move)$/.test(e.prefix):!1};function cx(e){return Ke("Space",e)}var px={__depends__:[fi,pr],__init__:["handTool"],handTool:["type",vi]};var lx="connect-ok",fx="connect-not-ok";function gi(e,t,n,r,i,o,a){var s=this;this._dragging=t,this._rules=o,this._mouse=a,i.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),e.on("global-connect.hover",function(c){var u=c.context,p=c.hover,l=u.canStartConnect=s.canStartConnect(p);l!==null&&(u.startTarget=p,r.addMarker(p,l?lx:fx))}),e.on(["global-connect.out","global-connect.cleanup"],function(c){var u=c.context.startTarget,p=c.context.canStartConnect;u&&r.removeMarker(u,p?lx:fx)}),e.on(["global-connect.ended"],function(c){var u=c.context,p=u.startTarget,l={x:c.x,y:c.y},f=s.canStartConnect(p);if(f)return e.once("element.out",function(){e.once(["connect.ended","connect.canceled"],function(){e.fire("global-connect.drag.ended")}),n.start(null,p,l)}),!1})}gi.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"];gi.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})};gi.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)};gi.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)};gi.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};var dx={__depends__:[Lo,Et,kt,fi,pr],globalConnect:["type",gi]};N();function sc(e,t,n,r,i,o,a,s){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=r,this._lassoTool=i,this._handTool=o,this._globalConnect=a,this._translate=s,e.registerProvider(this)}sc.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"];sc.prototype.getPaletteEntries=function(){var e={},t=this._create,n=this._elementFactory,r=this._spaceTool,i=this._lassoTool,o=this._handTool,a=this._globalConnect,s=this._translate;function c(l,f,d,m,g){function v(w){var S=n.createShape(C({type:l},g));t.start(w,S)}return{group:f,className:d,title:m,action:{dragstart:v,click:v}}}function u(l){var f=n.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),d=n.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:f});t.start(l,[f,d],{hints:{autoSelect:[f]}})}function p(l){t.start(l,n.createParticipantShape())}return C(e,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:s("Activate hand tool"),action:{click:function(l){o.activateHand(l)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:s("Activate lasso tool"),action:{click:function(l){i.activateSelection(l)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:s("Activate create/remove space tool"),action:{click:function(l){r.activateSelection(l)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:s("Activate global connect tool"),action:{click:function(l){a.start(l)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":c("bpmn:StartEvent","event","bpmn-icon-start-event-none",s("Create start event")),"create.intermediate-event":c("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",s("Create intermediate/boundary event")),"create.end-event":c("bpmn:EndEvent","event","bpmn-icon-end-event-none",s("Create end event")),"create.exclusive-gateway":c("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",s("Create gateway")),"create.task":c("bpmn:Task","activity","bpmn-icon-task",s("Create task")),"create.data-object":c("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",s("Create data object reference")),"create.data-store":c("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",s("Create data store reference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:s("Create expanded sub-process"),action:{dragstart:u,click:u}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:s("Create pool/participant"),action:{dragstart:p,click:p}},"create.group":c("bpmn:Group","artifact","bpmn-icon-group",s("Create group"))}),e};var mx={__depends__:[rx,li,Np,sx,px,dx,Zr],__init__:["paletteProvider"],paletteProvider:["type",sc]};N();var zM=250;function cc(e,t,n,r,i){k.call(this,e);function o(s){var c=s.canExecute.replacements;E(c,function(u){var p=u.oldElementId,l={type:u.newElementType};if(!s.visualReplacements[p]){var f=t.get(p);C(l,{x:f.x,y:f.y});var d=n.createShape(l);r.addShape(d,f.parent);var m=_e('[data-element-id="'+Rr(f.id)+'"]',s.dragGroup);m&&$(m,{display:"none"});var g=i.addDragger(d,s.dragGroup);s.visualReplacements[p]=g,r.removeShape(d)}})}function a(s){var c=s.visualReplacements;E(c,function(u,p){var l=_e('[data-element-id="'+Rr(p)+'"]',s.dragGroup);l&&$(l,{display:"inline"}),u.remove(),c[p]&&delete c[p]})}e.on("shape.move.move",zM,function(s){var c=s.context,u=c.canExecute;c.visualReplacements||(c.visualReplacements={}),u&&u.replacements?o(c):a(c)})}cc.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"];B(cc,k);var hx={__depends__:[Dn],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",cc]};N();var GM=1250,gd=40,VM=20,WM=10,vx=20,yx=["x","y"],UM=Math.abs;function sl(e){e.on(["connect.hover","connect.move","connect.end"],GM,function(t){var n=t.context,r=n.canExecute,i=n.start,o=n.hover,a=n.source,s=n.target;t.originalEvent&&xt(t.originalEvent)||(n.initialConnectionStart||(n.initialConnectionStart=n.connectionStart),r&&o&&qM(t,o,ZM(o)),o&&XM(r,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(n.connectionStart=rn(i),te(o,["bpmn:Event","bpmn:Gateway"])&&gx(t,rn(o)),te(o,["bpmn:Task","bpmn:SubProcess"])&&KM(t,o),h(a,"bpmn:BoundaryEvent")&&s===a.host&&YM(t)):_x(r,"bpmn:MessageFlow")?(h(i,"bpmn:Event")&&(n.connectionStart=rn(i)),h(o,"bpmn:Event")&&gx(t,rn(o))):n.connectionStart=n.initialConnectionStart)})}sl.$inject=["eventBus"];function qM(e,t,n){yx.forEach(function(r){var i=bx(r,t);e[r]<t[r]+n?ze(e,r,t[r]+n):e[r]>t[r]+i-n&&ze(e,r,t[r]+i-n)})}function KM(e,t){var n=rn(t);yx.forEach(function(r){QM(e,t,r)&&ze(e,r,n[r])})}function YM(e){var t=e.context,n=t.source,r=t.target;if(!JM(t)){var i=rn(n),o=He(i,r,-10),a=[];/top|bottom/.test(o)&&a.push("x"),/left|right/.test(o)&&a.push("y"),a.forEach(function(s){var c=e[s],u;UM(c-i[s])<gd&&(c>i[s]?u=i[s]+gd:u=i[s]-gd,ze(e,s,u))})}}function gx(e,t){ze(e,"x",t.x),ze(e,"y",t.y)}function _x(e,t){return e&&e.type===t}function XM(e,t){return Lt(t,function(n){return _x(e,n)})}function bx(e,t){return e==="x"?t.width:t.height}function ZM(e){return h(e,"bpmn:Task")?WM:VM}function QM(e,t,n){return e[n]>t[n]+vx&&e[n]<t[n]+bx(n,t)-vx}function JM(e){var t=e.hover,n=e.source;return t&&n&&t===n}N();function Kn(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}Kn.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]};Kn.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,this._snapLocations.indexOf(e)===-1&&this._snapLocations.push(e)};Kn.prototype.addDefaultSnap=function(e,t){var n=this._defaultSnaps[e];n||(n=this._defaultSnaps[e]=[]),n.push(t)};Kn.prototype.getSnapLocations=function(){return this._snapLocations};Kn.prototype.setSnapLocations=function(e){this._snapLocations=e};Kn.prototype.pointsForTarget=function(e){var t=e.id||e,n=this._targets[t];return n||(n=this._targets[t]=new cl,n.initDefaults(this._defaultSnaps)),n};function cl(){this._snapValues={}}cl.prototype.add=function(e,t){var n=this._snapValues[e];n||(n=this._snapValues[e]={x:[],y:[]}),n.x.indexOf(t.x)===-1&&n.x.push(t.x),n.y.indexOf(t.y)===-1&&n.y.push(t.y)};cl.prototype.snap=function(e,t,n,r){var i=this._snapValues[t];return i&&bg(e[n],i[n],r)};cl.prototype.initDefaults=function(e){var t=this;E(e||{},function(n,r){E(n,function(i){t.add(r,i)})})};N();var eD=1250;function bn(e,t,n){var r=this;this._elementRegistry=e,t.on(["create.start","shape.move.start"],function(i){r.initSnap(i)}),t.on(["create.move","create.end","shape.move.move","shape.move.end"],eD,function(i){var o=i.context,a=o.shape,s=o.snapContext,c=o.target;if(!(i.originalEvent&&xt(i.originalEvent))&&!(zn(i)||!c)){var u=s.pointsForTarget(c);u.initialized||(u=r.addSnapTargetPoints(u,a,c),u.initialized=!0),n.snap(i,u)}}),t.on(["create.cleanup","shape.move.cleanup"],function(){n.hide()})}bn.$inject=["elementRegistry","eventBus","snapping"];bn.prototype.initSnap=function(e){var t=this._elementRegistry,n=e.context,r=n.shape,i=n.snapContext;i||(i=n.snapContext=new Kn);var o;t.get(r.id)?o=rn(r,e):o={x:e.x+rn(r).x,y:e.y+rn(r).y};var a={x:o.x-r.width/2,y:o.y-r.height/2},s={x:o.x+r.width/2,y:o.y+r.height/2};return i.setSnapOrigin("mid",{x:o.x-e.x,y:o.y-e.y}),ee(r)||(i.setSnapOrigin("top-left",{x:a.x-e.x,y:a.y-e.y}),i.setSnapOrigin("bottom-right",{x:s.x-e.x,y:s.y-e.y})),i};bn.prototype.addSnapTargetPoints=function(e,t,n){var r=this.getSnapTargets(t,n);return E(r,function(i){if(ee(i)){ee(t)&&e.add("mid",rn(i));return}if(de(i)){if(i.waypoints.length<3)return;var o=i.waypoints.slice(1,-1);E(o,function(a){e.add("mid",a)});return}e.add("mid",rn(i))}),!ne(t.x)||!ne(t.y)||this._elementRegistry.get(t.id)&&e.add("mid",rn(t)),e};bn.prototype.getSnapTargets=function(e,t){return zu(t).filter(function(n){return!tD(n)})};function tD(e){return!!e.hidden}N();var xx=1500;function yi(e,t){t.invoke(bn,this),e.on(["create.move","create.end"],xx,oD),e.on(["create.move","create.end","shape.move.move","shape.move.end"],xx,function(n){var r=n.context,i=r.canExecute,o=r.target,a=i&&(i==="attach"||i.attach);a&&!zn(n)&&nD(n,o)})}B(yi,bn);yi.$inject=["eventBus","injector"];yi.prototype.initSnap=function(e){var t=bn.prototype.initSnap.call(this,e),n=e.shape,r=!!this._elementRegistry.get(n.id);return E(n.outgoing,function(i){var o=i.waypoints[0];o=o.original||o,t.setSnapOrigin(i.id+"-docking",wx(o,r,e))}),E(n.incoming,function(i){var o=i.waypoints[i.waypoints.length-1];o=o.original||o,t.setSnapOrigin(i.id+"-docking",wx(o,r,e))}),h(n,"bpmn:Participant")&&t.setSnapLocations(["top-left","bottom-right","mid"]),t};yi.prototype.addSnapTargetPoints=function(e,t,n){bn.prototype.addSnapTargetPoints.call(this,e,t,n);var r=this.getSnapTargets(t,n);E(r,function(o){(iD(o)||rD([t,o],"bpmn:TextAnnotation"))&&(e.add("top-left",Hu(o)),e.add("bottom-right",$u(o)))});var i=this._elementRegistry;return E(t.incoming,function(o){if(i.get(t.id)){Ex(r,o.source)||e.add("mid",X(o.source));var a=o.waypoints[0];e.add(o.id+"-docking",a.original||a)}}),E(t.outgoing,function(o){if(i.get(t.id)){Ex(r,o.target)||e.add("mid",X(o.target));var a=o.waypoints[o.waypoints.length-1];e.add(o.id+"-docking",a.original||a)}}),h(n,"bpmn:SequenceFlow")&&(e=this.addSnapTargetPoints(e,t,n.parent)),e};yi.prototype.getSnapTargets=function(e,t){return bn.prototype.getSnapTargets.call(this,e,t).filter(function(n){return!h(n,"bpmn:Lane")})};function nD(e,t){var n=Z(t),r=hp(e,t),i=e.context,o=i.shape,a;o.parent?a={x:0,y:0}:a=X(o),/top/.test(r)?ze(e,"y",n.top-a.y):/bottom/.test(r)&&ze(e,"y",n.bottom-a.y),/left/.test(r)?ze(e,"x",n.left-a.x):/right/.test(r)&&ze(e,"x",n.right-a.x)}function rD(e,t){return e.every(function(n){return h(n,t)})}function iD(e){return h(e,"bpmn:SubProcess")&&ie(e)?!0:h(e,"bpmn:Participant")}function oD(e){var t=e.context,n=t.createConstraints;if(n){var r=n.top,i=n.right,o=n.bottom,a=n.left;(a&&a>=e.x||i&&i<=e.x)&&ze(e,"x",e.x),(r&&r>=e.y||o&&o<=e.y)&&ze(e,"y",e.y)}}function Ex(e,t){return e.indexOf(t)!==-1}function wx(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}N();var aD=1250;function ao(e,t){var n=this;e.on(["resize.start"],function(r){n.initSnap(r)}),e.on(["resize.move","resize.end"],aD,function(r){var i=r.context,o=i.shape,a=o.parent,s=i.direction,c=i.snapContext;if(!(r.originalEvent&&xt(r.originalEvent))&&!zn(r)){var u=c.pointsForTarget(a);u.initialized||(u=n.addSnapTargetPoints(u,o,a,s),u.initialized=!0),uD(s)&&ze(r,"x",r.x),pD(s)&&ze(r,"y",r.y),t.snap(r,u)}}),e.on(["resize.cleanup"],function(){t.hide()})}ao.prototype.initSnap=function(e){var t=e.context,n=t.shape,r=t.direction,i=t.snapContext;i||(i=t.snapContext=new Kn);var o=Sx(n,r);return i.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),i};ao.prototype.addSnapTargetPoints=function(e,t,n,r){var i=this.getSnapTargets(t,n);return E(i,function(o){e.add("corner",$u(o)),e.add("corner",Hu(o))}),e.add("corner",Sx(t,r)),e};ao.$inject=["eventBus","snapping"];ao.prototype.getSnapTargets=function(e,t){return zu(t).filter(function(n){return!sD(n,e)&&!de(n)&&!cD(n)&&!ee(n)})};function Sx(e,t){var n=X(e),r=Z(e),i={x:n.x,y:n.y};return t.indexOf("n")!==-1?i.y=r.top:t.indexOf("s")!==-1&&(i.y=r.bottom),t.indexOf("e")!==-1?i.x=r.right:t.indexOf("w")!==-1&&(i.x=r.left),i}function sD(e,t){return e.host===t}function cD(e){return!!e.hidden}function uD(e){return e==="n"||e==="s"}function pD(e){return e==="e"||e==="w"}N();var lD=7,fD=1e3;function gr(e){this._canvas=e,this._asyncHide=Ca(tt(this.hide,this),fD)}gr.$inject=["canvas"];gr.prototype.snap=function(e,t){var n=e.context,r=n.snapContext,i=r.getSnapLocations(),o={x:zn(e,"x"),y:zn(e,"y")};E(i,function(a){var s=r.getSnapOrigin(a),c={x:e.x+s.x,y:e.y+s.y};if(E(["x","y"],function(u){var p;o[u]||(p=t.snap(c,a,u,lD),p!==void 0&&(o[u]={value:p,originValue:p-s[u]}))}),o.x&&o.y)return!1}),this.showSnapLine("vertical",o.x&&o.x.value),this.showSnapLine("horizontal",o.y&&o.y.value),E(["x","y"],function(a){var s=o[a];Se(s)&&ze(e,a,s.originValue)})};gr.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=U("path");return $(n,{d:"M0,0 L0,0"}),pe(n).add("djs-snap-line"),J(t,n),{update:function(r){ne(r)?e==="horizontal"?$(n,{d:"M-100000,"+r+" L+100000,"+r,display:""}):$(n,{d:"M "+r+",-100000 L "+r+", +100000",display:""}):$(n,{display:"none"})}}};gr.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}};gr.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()};gr.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]};gr.prototype.hide=function(){E(this._snapLines,function(e){e.update()})};var Cx={__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",bn],resizeSnapping:["type",ao],snapping:["type",gr]};var Rx={__depends__:[Cx],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",sl],createMoveSnapping:["type",yi]};var Ax=300;function fe(e,t,n,r){this._open=!1,this._results={},this._eventMaps=[],this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._canvas=e,this._eventBus=t,this._selection=n,this._translate=r,this._container=this._getBoxHtml(),this._searchInput=_e(fe.INPUT_SELECTOR,this._container),this._resultsContainer=_e(fe.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy","drag.init","elements.changed"],this.close,this)}fe.$inject=["canvas","eventBus","selection","translate"];fe.prototype._bindEvents=function(){var e=this;function t(n,r,i,o){e._eventMaps.push({el:n,type:i,listener:bt.bind(n,r,i,o)})}t(document,"html","click",function(n){e.close(!1)}),t(this._container,fe.INPUT_SELECTOR,"click",function(n){n.stopPropagation(),n.delegateTarget.focus()}),t(this._container,fe.RESULT_SELECTOR,"mouseover",function(n){n.stopPropagation(),e._scrollToNode(n.delegateTarget),e._preselect(n.delegateTarget)}),t(this._container,fe.RESULT_SELECTOR,"click",function(n){n.stopPropagation(),e._select(n.delegateTarget)}),t(this._container,fe.INPUT_SELECTOR,"keydown",function(n){Ke("ArrowUp",n)&&n.preventDefault(),Ke("ArrowDown",n)&&n.preventDefault()}),t(this._container,fe.INPUT_SELECTOR,"keyup",function(n){if(Ke("Escape",n))return e.close();if(Ke("Enter",n)){var r=e._getCurrentResult();return r?e._select(r):e.close(!1)}if(Ke("ArrowUp",n))return e._scrollToDirection(!0);if(Ke("ArrowDown",n))return e._scrollToDirection();Ke(["ArrowLeft","ArrowRight"],n)||e._search(n.delegateTarget.value)})};fe.prototype._unbindEvents=function(){this._eventMaps.forEach(function(e){bt.unbind(e.el,e.type,e.listener)})};fe.prototype._search=function(e){var t=this;if(this._clearResults(),!!e.trim()){var n=this._searchProvider.find(e);if(n=n.filter(function(i){return!t._canvas.getRootElements().includes(i.element)}),!n.length){this._selection.select(null);return}n.forEach(function(i){var o=i.element.id,a=t._createResultNode(i,o);t._results[o]={element:i.element,node:a}});var r=_e(fe.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(r),this._preselect(r)}};fe.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}};fe.prototype._scrollToNode=function(e){if(!(!e||e===this._getCurrentResult())){var t=e.offsetTop,n=this._resultsContainer.scrollTop,r=t-this._resultsContainer.clientHeight+e.clientHeight;t<n?this._resultsContainer.scrollTop=t:n<r&&(this._resultsContainer.scrollTop=r)}};fe.prototype._clearResults=function(){Hr(this._resultsContainer),this._results={},this._eventBus.fire("searchPad.cleared")};fe.prototype._getCurrentResult=function(){return _e(fe.RESULT_SELECTED_SELECTOR,this._resultsContainer)};fe.prototype._createResultNode=function(e,t){var n=ue(fe.RESULT_HTML);return e.primaryTokens.length>0&&Px(n,e.primaryTokens,fe.RESULT_PRIMARY_HTML),Px(n,e.secondaryTokens,fe.RESULT_SECONDARY_HTML),nt(n,fe.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n};fe.prototype.registerProvider=function(e){this._searchProvider=e};fe.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._cachedRootElement=this._canvas.getRootElement(),this._cachedSelection=this._selection.get(),this._cachedViewbox=this._canvas.viewbox(),this._selection.select(null),this._bindEvents(),this._open=!0,Ne(this._canvas.getContainer()).add("djs-search-open"),Ne(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))};fe.prototype.close=function(e=!0){this.isOpen()&&(e&&(this._cachedRootElement&&this._canvas.setRootElement(this._cachedRootElement),this._cachedSelection&&this._selection.select(this._cachedSelection),this._cachedViewbox&&this._canvas.viewbox(this._cachedViewbox),this._eventBus.fire("searchPad.restored")),this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._unbindEvents(),this._open=!1,Ne(this._canvas.getContainer()).remove("djs-search-open"),Ne(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._eventBus.fire("searchPad.closed"),this._canvas.restoreFocus())};fe.prototype.toggle=function(){this.isOpen()?this.close():this.open()};fe.prototype.isOpen=function(){return this._open};fe.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&Ne(t).remove(fe.RESULT_SELECTED_CLASS);var n=nt(e,fe.RESULT_ID_ATTRIBUTE),r=this._results[n].element;Ne(e).add(fe.RESULT_SELECTED_CLASS),this._canvas.scrollToElement(r,{top:Ax}),this._selection.select(r),this._eventBus.fire("searchPad.preselected",r)}};fe.prototype._select=function(e){var t=nt(e,fe.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this._cachedSelection=null,this._cachedViewbox=null,this.close(!1),this._canvas.scrollToElement(n,{top:Ax}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)};fe.prototype._getBoxHtml=function(){let e=ue(fe.BOX_HTML),t=_e(fe.INPUT_SELECTOR,e);return t&&t.setAttribute("aria-label",this._translate("Search in diagram")),e};function Px(e,t,n){var r=dD(t),i=ue(n);i.innerHTML=r,e.appendChild(i)}function dD(e){var t="";return e.forEach(function(n){var r=Hn(n.value||n.matched||n.normal),i=n.match||n.matched;i?t+='<b class="'+fe.RESULT_HIGHLIGHT_CLASS+'">'+r+"</b>":t+=r}),t!==""?t:null}fe.CONTAINER_SELECTOR=".djs-search-container";fe.INPUT_SELECTOR=".djs-search-input input";fe.RESULTS_CONTAINER_SELECTOR=".djs-search-results";fe.RESULT_SELECTOR=".djs-search-result";fe.RESULT_SELECTED_CLASS="djs-search-result-selected";fe.RESULT_SELECTED_SELECTOR="."+fe.RESULT_SELECTED_CLASS;fe.RESULT_ID_ATTRIBUTE="data-result-id";fe.RESULT_HIGHLIGHT_CLASS="djs-search-highlight";fe.BOX_HTML=`<div class="djs-search-container djs-scrollable">
|