| H A D | bpmn-modeler.production.min.js | 234 `,this._current.container)};Ve.prototype.open=function(e,t,n,r){if(!e)throw new Error("target is missing");if(!t)throw new Error("providers for <"+t+"> not found");if(!n)throw new Error("position is missing");var i=this._eventBus.fire("popupMenu.open.allowed",{target:e,providerId:t});if(i===!1)return;this.isOpen()&&this.close();let{entries:o,headerEntries:a,emptyPlaceholder:s}=this._getContext(e,t);this._current={position:n,providerId:t,target:e,entries:o,headerEntries:a,emptyPlaceholder:s,container:this._createContainer({provider:t}),options:r},this._emit("open"),this._bindAutoClose(),this._render()};Ve.prototype.refresh=function(){if(!this.isOpen())return;let{target:e,providerId:t}=this._current,{entries:n,headerEntries:r,emptyPlaceholder:i}=this._getContext(e,t);this._current={...this._current,entries:n,headerEntries:r,emptyPlaceholder:i},this._emit("refresh"),this._render()};Ve.prototype._getContext=function(e,t){let n=this._getProviders(t);if(!n||!n.length)throw new Error("provider for <"+t+"> not found");let r=this._getEntries(e,n),i=this._getHeaderEntries(e,n),o=this._getEmptyPlaceholder(n);return{entries:r,headerEntries:i,emptyPlaceholder:o,empty:!(Object.keys(r).length||Object.keys(i).length)}};Ve.prototype.close=function(){this.isOpen()&&(this._emit("close"),this.reset(),this._canvas.restoreFocus(),this._current=null)};Ve.prototype.reset=function(){let e=this._current.container;yu(null,e),Wt(e)};Ve.prototype._emit=function(e,t){this._eventBus.fire(`popupMenu.${e}`,t)};Ve.prototype._onOpened=function(){this._emit("opened")};Ve.prototype._onClosed=function(){this._emit("closed")};Ve.prototype._createContainer=function(e){var t=this._canvas,n=t.getContainer();let r=ue(`<div class="djs-popup-parent djs-scrollable" data-popup=${e.provider}></div>`);return n.appendChild(r),r};Ve.prototype._bindAutoClose=function(){this._eventBus.once(zv,this.close,this)};Ve.prototype._unbindAutoClose=function(){this._eventBus.off(zv,this.close,this)};Ve.prototype._updateScale=function(){var e=this._canvas.zoom(),t=this._config.scale,n,r,i=e;return t!==!0&&(t===!1?(n=1,r=1):(n=t.min,r=t.max),Ue(n)&&e<n&&(i=n),Ue(r)&&e>r&&(i=r)),i};Ve.prototype._ensureVisible=function(e,t){var n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect(),i={},o=t.x,a=t.y;return t.x+r.width>n.width&&(i.x=!0),t.y+r.height>n.height&&(i.y=!0),i.x&&i.y?(o=t.x-r.width,a=t.y-r.height):i.x?(o=t.x-r.width,a=t.y):i.y&&t.y<r.height?(o=t.x,a=10):i.y&&(o=t.x,a=t.y-r.height),t.y<n.top&&(a=t.y+r.height),{x:o,y:a}};Ve.prototype.isEmpty=function(e,t){if(!e)throw new Error("target is missing");if(!t)throw new Error("provider ID is missing");let n=this._getProviders(t);return!n||!n.length?!0:this._getContext(e,t).empty};Ve.prototype.registerProvider=function(e,t,n){n||(n=t,t=OC),this._eventBus.on("popupMenu.getProviders."+e,t,function(r){r.providers.push(n)})};Ve.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"popupMenu.getProviders."+e,providers:[]});return this._eventBus.fire(t),t.providers};Ve.prototype._getEntries=function(e,t){var n={};return E(t,function(r){if(!r.getPopupMenuEntries){E(r.getEntries(e),function(o){var a=o.id;if(!a)throw new Error("entry ID is missing");n[a]=Nt(o,["id"])});return}var i=r.getPopupMenuEntries(e);Le(i)?n=i(n):E(i,function(o,a){n[a]=o})}),n};Ve.prototype._getHeaderEntries=function(e,t){var n={};return E(t,function(r){if(!r.getPopupMenuHeaderEntries){if(!r.getHeaderEntries)return;E(r.getHeaderEntries(e),function(o){var a=o.id;if(!a)throw new Error("entry ID is missing");n[a]=Nt(o,["id"])});return}var i=r.getPopupMenuHeaderEntries(e);Le(i)?n=i(n):E(i,function(o,a){n[a]=o})}),n};Ve.prototype._getEmptyPlaceholder=function(e){let t=e.find(n=>Le(n.getEmptyPlaceholder));return t&&t.getEmptyPlaceholder()};Ve.prototype.isOpen=function(){return!!this._current};Ve.prototype.trigger=function(e,t,n="click"){if(e.preventDefault(),!t){let i=Bn(e.delegateTarget||e.target,".entry",!0),o=nt(i,NC);t={id:o,...this._getEntry(o)}}let r=t.action;if(this._emit("trigger",{entry:t,event:e})!==!1){if(Le(r)){if(n==="click")return r(e,t)}else if(r[n])return r[n](e,t)}};Ve.prototype._getEntry=function(e){var t=this._current.entries[e]||this._current.headerEntries[e];if(!t)throw new Error("entry not found");return t};function Gv(e){return Object.entries(e).map(([t,n])=>{let r={id:t,...n};return r.entries&&(r.entries=Gv(r.entries)),r})}N();function Cf(e,t,n){let{keys:r}=n;if(t=t.trim().toLowerCase(),!t)throw new Error("<pattern> must not be empty");let i=t.trim().toLowerCase().split(/\s+/);return e.flatMap(o=>{let a=BC(o,i,r);return a?{item:o,tokens:a}:[]}).sort(IC(r))}function BC(e,t,n){let{matchedWords:r,tokens:i}=n.reduce((o,a)=>{let s=e[a],{tokens:c,matchedWords:u}=q(s)?s.reduce((p,l)=>{let{tokens:f,matchedWords:d}=qv(l,t);return{tokens:[...p.tokens,f],matchedWords:{...p.matchedWords,...d}}},{matchedWords:{},tokens:[]}):qv(s,t);return{tokens:{...o.tokens,[a]:c},matchedWords:{...o.matchedWords,...u}}},{matchedWords:{},tokens:{}});return Object.keys(r).length!==t.length?null:i}function IC(e){return(t,n)=>{let r=0,i=1;for(let o of e){let a=LC(t.tokens[o],n.tokens[o]);if(a!==0){r+=a*i,i*=Vv;continue}let s=jC(t.item[o],n.item[o]);if(s!==0){r+=s*i,i*=Vv;continue}}return r}}function LC(e,t){return Wv(t)-Wv(e)}var Vv=.5,Mo={FULL:131.9,START_FULL_WORD:8,START_WORD_PART:7.87,WORD_START:2.19,WORD_PART:1,NO_MATCH:-.07};function Wv(e){let t=e.reduce((s,c)=>s+Kv(c),0),n=e.flat(),r=n.reduce((s,c)=>s+c.value.length,0),i=n.reduce((s,c)=>s+(c.match?c.value.length:0),0),o=r?i/r:0;return t*(1+o)}function Kv(e){if(q(e))return Math.max(...e.map(Kv));let t=Math.log(e.value.length);return e.match?(e.start?e.end?Mo.FULL:e.wordEnd?Mo.START_FULL_WORD:Mo.START_WORD_PART:e.wordStart?Mo.WORD_START:Mo.WORD_PART)*t:Mo.NO_MATCH*t}function Uv(e=""){return q(e)?e.join(", "):e}function jC(e,t){return Uv(e).localeCompare(Uv(t))}function qv(e,t){var u;if(!e)return{tokens:[],matchedWords:{}};let n=[],r={},i=t.map(FC),o=[`(?<all>${i.join("\\s+")})`,...i].join("|"),a=new RegExp(o,"ig"),s,c=0;for(;s=a.exec(e);){let[p]=s,l=s.index,f=s.index+p.length,d=l===0,m=f===e.length,g=!!((u=s.groups)!=null&&u.all),v=d||/\s/.test(e.charAt(l-1)),w=m||/\s/.test(e.charAt(f));s.index>c&&n.push({value:e.slice(c,s.index),index:c}),n.push({value:p,index:s.index,match:!0,wordStart:v,wordEnd:w,start:d,end:m,all:g});let S=g?t:[p];for(let x of S)r[x.toLowerCase()]=!0;c=s.index+p.length}return c<e.length&&n.push({value:e.slice(c),index:c}),{tokens:n,matchedWords:r}}function FC(e){return e.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&")}var xu={search:["value",Cf]};var Do={__depends__:[xu],__init__:["popupMenu"],popupMenu:["type",Ve]};N();var HC={align:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000"> 274 </svg>`};function un(e,t,n,r,i,o,a,s){this._bpmnFactory=e,this._popupMenu=t,this._modeling=n,this._moddle=r,this._bpmnReplace=i,this._rules=o,this._translate=a,this._moddleCopy=s,this._register()}un.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate","moddleCopy"];un.prototype._register=function(){this._popupMenu.registerProvider("bpmn-replace",this)};un.prototype.getPopupMenuEntries=function(e){var s;var t=e.businessObject,n=this._rules,r=[],i,o=[];if(q(e)||!n.allowed("shape.replace",{element:e}))return{};var a=X_(e);return h(t,"bpmn:DataObjectReference")?this._createEntries(e,ob):h(t,"bpmn:DataStoreReference")&&!h(e.parent,"bpmn:Collaboration")?this._createEntries(e,ab):(h(t,"bpmn:Event")&&!h(t,"bpmn:BoundaryEvent")&&(i=(s=t.get("eventDefinitions")[0])==null?void 0:s.$type,r=lb[i]||[],!Qe(t.$parent)&&h(t.$parent,"bpmn:SubProcess")&&(r=Q(r,function(c){return c.target.type!=="bpmn:StartEvent"}))),h(t,"bpmn:StartEvent")&&!h(t.$parent,"bpmn:SubProcess")?(o=Q(Z_.concat(r),a),this._createEntries(e,o)):h(t,"bpmn:Participant")?(o=Q(pb,function(c){return ie(e)!==c.target.isExpanded}),this._createEntries(e,o)):h(t,"bpmn:StartEvent")&&Qe(t.$parent)?(o=Q(cb.concat(r),function(c){var u=c.target,p=u.isInterrupting!==!1,l=t.isInterrupting===p;return a(c)||!a(c)&&!l}),this._createEntries(e,o)):h(t,"bpmn:StartEvent")&&!Qe(t.$parent)&&h(t.$parent,"bpmn:SubProcess")?(o=Q(Q_.concat(r),a),this._createEntries(e,o)):h(t,"bpmn:EndEvent")?(o=Q(eb.concat(r),function(c){var u=c.target;return u.eventDefinitionType=="bpmn:CancelEventDefinition"&&!h(t.$parent,"bpmn:Transaction")?!1:a(c)}),this._createEntries(e,o)):h(t,"bpmn:BoundaryEvent")?(o=Q(sb,function(c){var u=c.target;if(u.eventDefinitionType=="bpmn:CancelEventDefinition"&&!h(t.attachedToRef,"bpmn:Transaction"))return!1;var p=u.cancelActivity!==!1,l=t.cancelActivity==p;return a(c)||!a(c)&&!l}),this._createEntries(e,o)):h(t,"bpmn:IntermediateCatchEvent")||h(t,"bpmn:IntermediateThrowEvent")?(o=Q(J_.concat(r),a),this._createEntries(e,o)):h(t,"bpmn:Gateway")?(o=Q(tb,a),this._createEntries(e,o)):h(t,"bpmn:Transaction")?(o=Q(od,a),this._createEntries(e,o)):Qe(t)&&ie(e)?(o=Q(ib,a),this._createEntries(e,o)):h(t,"bpmn:AdHocSubProcess")&&ie(e)?(o=Q(rb,a),this._createEntries(e,o)):h(t,"bpmn:SubProcess")&&ie(e)?(o=Q(nb,a),this._createEntries(e,o)):h(t,"bpmn:SubProcess")&&!ie(e)?(o=Q(ad,function(c){var u=c.target.type===e.type,p=c.target.isExpanded===!0;return u===p}),this._createEntries(e,o)):h(t,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(e,ub):h(t,"bpmn:FlowNode")?(o=Q(ad,a),this._createEntries(e,o)):{})};un.prototype.getPopupMenuHeaderEntries=function(e){var t={};return h(e,"bpmn:Activity")&&!Qe(e)&&(t={...t,...this._getLoopCharacteristicsHeaderEntries(e)}),h(e,"bpmn:DataObjectReference")&&(t={...t,...this._getCollectionHeaderEntries(e)}),h(e,"bpmn:Participant")&&(t={...t,...this._getParticipantMultiplicityHeaderEntries(e)}),cp(e)&&(t={...t,...this._getNonInterruptingHeaderEntries(e)}),t};un.prototype._createEntries=function(e,t){var n={},r=this;return E(t,function(i){n[i.actionName]=r._createEntry(i,e)}),n};un.prototype._createSequenceFlowEntries=function(e,t){var n=j(e),r={},i=this._modeling,o=this._moddle,a=this;return E(t,function(s){switch(s.actionName){case"replace-with-default-flow":n.sourceRef.default!==n&&(h(n.sourceRef,"bpmn:ExclusiveGateway")||h(n.sourceRef,"bpmn:InclusiveGateway")||h(n.sourceRef,"bpmn:ComplexGateway")||h(n.sourceRef,"bpmn:Activity"))&&(r={...r,[s.actionName]:a._createEntry(s,e,function(){i.updateProperties(e.source,{default:n})})});break;case"replace-with-conditional-flow":!n.conditionExpression&&h(n.sourceRef,"bpmn:Activity")&&(r={...r,[s.actionName]:a._createEntry(s,e,function(){var c=o.create("bpmn:FormalExpression",{body:""});i.updateProperties(e,{conditionExpression:c})})});break;default:h(n.sourceRef,"bpmn:Activity")&&n.conditionExpression&&(r={...r,[s.actionName]:a._createEntry(s,e,function(){i.updateProperties(e,{conditionExpression:void 0})})}),(h(n.sourceRef,"bpmn:ExclusiveGateway")||h(n.sourceRef,"bpmn:InclusiveGateway")||h(n.sourceRef,"bpmn:ComplexGateway")||h(n.sourceRef,"bpmn:Activity"))&&n.sourceRef.default===n&&(r={...r,[s.actionName]:a._createEntry(s,e,function(){i.updateProperties(e.source,{default:void 0})})})}}),r};un.prototype._createEntry=function(e,t,n){var r=this._translate,i=this._bpmnReplace.replaceElement,o=function(){return i(t,e.target)},a=e.label;return a&&typeof a=="function"&&(a=a(t)),n=n||o,{label:r(a),className:e.className,action:n}};un.prototype._getLoopCharacteristicsHeaderEntries=function(e){var t=this,n=this._translate;function r(u,p){if(p.active){t._modeling.updateProperties(e,{loopCharacteristics:void 0});return}var l=e.businessObject.get("loopCharacteristics");l&&h(l,p.options.loopCharacteristics)?t._modeling.updateModdleProperties(e,l,{isSequential:p.options.isSequential}):(l=t._moddle.create(p.options.loopCharacteristics,{isSequential:p.options.isSequential}),t._modeling.updateProperties(e,{loopCharacteristics:l}))}var i=j(e),o=i.loopCharacteristics,a,s,c;return o&&(a=o.isSequential,s=o.isSequential===void 0,c=o.isSequential!==void 0&&!o.isSequential),{"toggle-parallel-mi":{className:"bpmn-icon-parallel-mi-marker",title:n("Parallel multi-instance"),active:c,action:r,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!1}},"toggle-sequential-mi":{className:"bpmn-icon-sequential-mi-marker",title:n("Sequential multi-instance"),active:a,action:r,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!0}},"toggle-loop":{className:"bpmn-icon-loop-marker",title:n("Loop"),active:s,action:r,options:{loopCharacteristics:"bpmn:StandardLoopCharacteristics"}}}};un.prototype._getCollectionHeaderEntries=function(e){var t=this,n=this._translate,r=e.businessObject.dataObjectRef;if(!r)return{};function i(a,s){t._modeling.updateModdleProperties(e,r,{isCollection:!s.active})}var o=r.isCollection;return{"toggle-is-collection":{className:"bpmn-icon-parallel-mi-marker",title:n("Collection"),active:o,action:i}}};un.prototype._getParticipantMultiplicityHeaderEntries=function(e){var t=this,n=this._bpmnFactory,r=this._translate;function i(a,s){var c=s.active,u;c||(u=n.create("bpmn:ParticipantMultiplicity")),t._modeling.updateProperties(e,{participantMultiplicity:u})}var o=e.businessObject.participantMultiplicity;return{"toggle-participant-multiplicity":{className:"bpmn-icon-parallel-mi-marker",title:r("Participant multiplicity"),active:!!o,action:i}}};un.prototype._getNonInterruptingHeaderEntries=function(e){let t=this._translate,n=j(e),r=this,i=up(e),o=h(e,"bpmn:BoundaryEvent")?sd["intermediate-event-non-interrupting"]:sd["start-event-non-interrupting"],a=!n[i];return{"toggle-non-interrupting":{imageHtml:o,title:t("Toggle non-interrupting"),active:a,action:function(){r._modeling.updateProperties(e,{[i]:!!a})}}}};var fb={__depends__:[Do,Ap,No],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",un]};N();function eo(e,t,n,r,i,o,a,s,c,u,p,l,f){e=e||{},r.registerProvider(this),this._contextPad=r,this._modeling=i,this._elementFactory=o,this._connect=a,this._create=s,this._popupMenu=c,this._canvas=u,this._rules=p,this._translate=l,this._eventBus=n,this._appendPreview=f,e.autoPlace!==!1&&(this._autoPlace=t.get("autoPlace",!1)),n.on("create.end",250,function(d){var m=d.context,g=m.shape;if(!(!Tr(d)||!r.isOpen(g))){var v=r.getEntries(g);v.replace&&v.replace.action.click(d,g)}}),n.on("contextPad.close",function(){f.cleanUp()})}eo.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate","appendPreview"];eo.prototype.getMultiElementContextPadEntries=function(e){var t=this._modeling,n={};return this._isDeleteAllowed(e)&&C(n,{delete:{group:"edit",className:"bpmn-icon-trash",title:this._translate("Delete"),action:{click:function(r,i){t.removeElements(i.slice())}}}}),n};eo.prototype._isDeleteAllowed=function(e){var t=this._rules.allowed("elements.delete",{elements:e});return q(t)?ln(e,n=>t.includes(n)):t};eo.prototype.getContextPadEntries=function(e){var t=this._contextPad,n=this._modeling,r=this._elementFactory,i=this._connect,o=this._create,a=this._popupMenu,s=this._autoPlace,c=this._translate,u=this._appendPreview,p={};if(e.type==="label")return this._isDeleteAllowed([e])&&C(p,m()),p;var l=e.businessObject;function f(x,b){i.start(x,b)}function d(x,b){n.removeElements([b])}function m(){return{delete:{group:"edit",className:"bpmn-icon-trash",title:c("Delete"),action:{click:d}}}}function g(x){var b=5,R=t.getPad(x).html,A=R.getBoundingClientRect(),O={x:A.left,y:A.bottom+b};return O}function v(x,b,R,A){function O(L,W){var z=r.createShape(C({type:x},A));o.start(L,z,{source:W})}var T=s?function(L,W){var z=r.createShape(C({type:x},A));s.append(W,z)}:O,I=s?function(L,W){return u.create(W,x,A),()=>{u.cleanUp()}}:null;return{group:"model",className:b,title:R,action:{dragstart:O,click:T,hover:I}}}function w(x){return function(b,R){n.splitLane(R,x),t.open(R,!0)}}if(te(l,["bpmn:Lane","bpmn:Participant"])&&ie(e)){var S=yn(e);C(p,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:c("Add lane above"),action:{click:function(x,b){n.addLane(b,"top")}}}}),S.length<2&&((Me(e)?e.height>=120:e.width>=120)&&C(p,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:c("Divide into two lanes"),action:{click:w(2)}}}),(Me(e)?e.height>=180:e.width>=180)&&C(p,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:c("Divide into three lanes"),action:{click:w(3)}}})),C(p,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:c("Add lane below"),action:{click:function(x,b){n.addLane(b,"bottom")}}}})}return h(l,"bpmn:FlowNode")&&(h(l,"bpmn:EventBasedGateway")?C(p,{"append.receive-task":v("bpmn:ReceiveTask","bpmn-icon-receive-task",c("Append receive task")),"append.message-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",c("Append message intermediate catch event"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",c("Append timer intermediate catch event"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",c("Append conditional intermediate catch event"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",c("Append signal intermediate catch event"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):db(l,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?C(p,{"append.compensation-activity":v("bpmn:Task","bpmn-icon-task",c("Append compensation activity"),{isForCompensation:!0})}):!h(l,"bpmn:EndEvent")&&!l.isForCompensation&&!db(l,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")&&!Qe(l)&&C(p,{"append.end-event":v("bpmn:EndEvent","bpmn-icon-end-event-none",c("Append end event")),"append.gateway":v("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",c("Append gateway")),"append.append-task":v("bpmn:Task","bpmn-icon-task",c("Append task")),"append.intermediate-event":v("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",c("Append intermediate/boundary event"))})),a.isEmpty(e,"bpmn-replace")||C(p,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:c("Change element"),action:{click:function(x,b){var R=C(g(b),{cursor:{x:x.x,y:x.y}});a.open(b,"bpmn-replace",R,{title:c("Change element"),width:300,search:!0})}}}}),h(l,"bpmn:SequenceFlow")&&C(p,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),h(l,"bpmn:MessageFlow")&&C(p,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),te(l,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&C(p,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation")),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect to other element"),action:{click:f,dragstart:f}}}),h(l,"bpmn:TextAnnotation")&&C(p,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect using association"),action:{click:f,dragstart:f}}}),te(l,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&C(p,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect using data input association"),action:{click:f,dragstart:f}}}),h(l,"bpmn:Group")&&C(p,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),this._isDeleteAllowed([e])&&C(p,m()),p};function db(e,t,n){var r=e.$instanceOf(t),i=!1,o=e.eventDefinitions||[];return E(o,function(a){a.$type===n&&(i=!0)}),r&&i}var mb={__depends__:[q_,Hp,su,rt,Lo,li,fb],__init__:["contextPadProvider"],contextPadProvider:["type",eo]};N();var $T={horizontal:["x","width"],vertical:["y","height"]},hb=5;function qn(e,t){this._modeling=e,this._filters=[],this.registerFilter(function(n){var r=t.allowed("elements.distribute",{elements:n});return q(r)?r:r?n:[]})}qn.$inject=["modeling","rules"];qn.prototype.registerFilter=function(e){if(typeof e!="function")throw new Error("the filter has to be a function");this._filters.push(e)};qn.prototype.trigger=function(e,t){var n=this._modeling,r,i;if(!(e.length<3)&&(this._setOrientation(t),i=this._filterElements(e),r=this._createGroups(i),!(r.length<=2)))return n.distributeElements(r,this._axis,this._dimension),r};qn.prototype._filterElements=function(e){var t=this._filters,n=this._axis,r=this._dimension,i=[].concat(e);return t.length?(E(t,function(o){i=o(i,n,r)}),i):e};qn.prototype._createGroups=function(e){var t=[],n=this,r=this._axis,i=this._dimension;if(!r)throw new Error('must have a defined "axis" and "dimension"');var o=At(e,r);return E(o,function(a,s){var c=n._findRange(a,r,i),u,p=t[t.length-1];p&&n._hasIntersection(p.range,c)?t[t.length-1].elements.push(a):(u={range:c,elements:[a]},t.push(u))}),t};qn.prototype._setOrientation=function(e){var t=$T[e];this._axis=t[0],this._dimension=t[1]};qn.prototype._hasIntersection=function(e,t){return Math.max(e.min,e.max)>=Math.min(t.min,t.max)&&Math.min(e.min,e.max)<=Math.max(t.min,t.max)};qn.prototype._findRange=function(e){var t=e[this._axis],n=e[this._dimension];return{min:t+hb,max:t+n-hb}};var vb={__init__:["distributeElements"],distributeElements:["type",qn]};N();function ha(e){Ot.call(this,e)}ha.$inject=["eventBus"];B(ha,Ot);ha.prototype.init=function(){this.addRule("elements.distribute",function(e){var t=e.elements;return t=Q(t,function(n){var r=te(n,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(n.labelTarget||r)}),t=zr(t),t.length<3?!1:t})};var zT={horizontal:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800"> 223 </svg>`};function Qt(e,t,n,r,i,o,a,s){this._bpmnFactory=e,this._popupMenu=t,this._modeling=n,this._moddle=r,this._bpmnReplace=i,this._rules=o,this._translate=a,this._moddleCopy= global() method in Qt
|