Home
last modified time | relevance | path

Searched refs:_getEntry (Results 1 – 4 of 4) sorted by relevance

/plugin/bpmnioeditor/vendor/bpmnio-js/
Dbpmn-modeler.production.min.js34_getEntry(t);if(n.action)return n.action.call(null,e,n)},$c.prototype._getProviders=function(e){va… function
Dbpmn-modeler.development.js32368 var entry = this._getEntry(entryId);
32470 PopupMenu.prototype._getEntry = function(entryId) {
/plugin/bpmnio/vendor/dmn-js/dist/
H A Ddmn-modeler.production.min.js248 `,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 Dbpmn-modeler.production.min.js234 `,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">