xref: /plugin/bpmnio/vendor/dmn-js/dist/dmn-modeler.production.min.js (revision 5fb5a3df33f870f519bbeb09ad9a2a663d016c66)
1/*! dmn-js - dmn-modeler v12.2.0 | Copyright (c) 2014-present, camunda Services GmbH | bpmn.io/license */
2!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).DmnJS=t()}(this,function(){"use strict";function Ve(e){return(Ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function u(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=c(n);return a(this,r?(e=c(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function s(){return(s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=c(e)););return e}(e,t);if(r){t=Object.getOwnPropertyDescriptor(r,t);return t.get?t.get.call(arguments.length<3?e:n):t.value}}).apply(this,arguments)}function p(e){return Array.prototype.concat.apply([],e)}var t=Object.prototype.toString,n=Object.prototype.hasOwnProperty;function l(e){return void 0===e}function f(e){return void 0!==e}function d(e){return null==e}function y(e){return"[object Array]"===t.call(e)}function _(e){return"[object Object]"===t.call(e)}function h(e){return"[object Number]"===t.call(e)}function m(e){e=t.call(e);return"[object Function]"===e||"[object AsyncFunction]"===e||"[object GeneratorFunction]"===e||"[object AsyncGeneratorFunction]"===e||"[object Proxy]"===e}function v(e){return"[object String]"===t.call(e)}function g(e,t){return n.call(e,t)}function b(e,n){var t,r;return n=m(t=n)?t:function(e){return e===t},x(e,function(e,t){if(n(e,t))return r=e,!1}),r}function w(e,n){var r=[];return x(e,function(e,t){n(e,t)&&r.push(e)}),r}function x(e,t){var n;if(!l(e)){var r,o=y(e)?B:M;for(r in e)if(g(e,r)&&!1===t(n=e[r],o(r)))return n}}function O(e,n,r){return x(e,function(e,t){r=n(r,e,t)}),r}function j(e,r){return!!O(e,function(e,t,n){return e&&r(t,n)},!0)}function E(e,t){return!!b(e,t)}function C(e,n){var r=[];return x(e,function(e,t){r.push(n(e,t))}),r}function S(e){return e&&Object.keys(e)||[]}function P(e){return S(e).length}function k(e){return C(e,function(e){return e})}function R(e,n,t){var r=2<arguments.length&&void 0!==t?t:{};return n=D(n),x(e,function(e){var t=n(e)||"_";(r[t]||(r[t]=[])).push(e)}),r}function T(e,i){i=D(i);var a=[];return x(e,function(e,t){for(var n=i(e,t),r={d:n,v:e},o=0;o<a.length;o++)if(n<a[o].d)return void a.splice(o,0,r);a.push(r)}),C(a,function(e){return e.v})}function r(e){return function(n){return j(e,function(e,t){return n[t]===e})}}function D(t){return m(t)?t:function(e){return e[t]}}function M(e){return e}function B(e){return Number(e)}function I(n,r){var o,i,a,c;function t(e){var t=Date.now(),t=e?0:c+r-t;if(0<t)return u(t);n.apply(a,i),s()}function u(e){o=setTimeout(t,e)}function s(){o&&clearTimeout(o),o=c=i=a=void 0}function e(){c=Date.now();for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];i=t,a=this,o||u(r)}return e.flush=function(){o&&t(!0),s()},e.cancel=s,e}function A(e,t){return e.bind(t)}function N(){return(N=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function L(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return N.apply(void 0,[e].concat(n))}function $(t,e){var n={},r=Object(t);return x(e,function(e){e in r&&(n[e]=t[e])}),n}function V(e,n){var r={};return x(Object(e),function(e,t){-1===n.indexOf(t)&&(r[t]=e)}),r}var z="__fn",F=Array.prototype.slice;function U(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function H(){}function W(){}function q(e,t){this.model=e,this.properties=t}U.prototype.on=function(e,t,n,r){if(e=y(e)?e:[e],m(t)&&(r=n,n=t,t=1e3),!h(t))throw new Error("priority must be a number");var o=n;r&&((o=A(n,r))[z]=n[z]||n);var i=this;e.forEach(function(e){i._addListener(e,{priority:t,callback:o,next:null})})},U.prototype.once=function(t,e,n,r){var o=this;if(m(e)&&(r=n,n=e,e=1e3),!h(e))throw new Error("priority must be a number");function i(){i.__isTomb=!0;var e=n.apply(r,arguments);return o.off(t,i),e}i[z]=n,this.on(t,e,i)},U.prototype.off=function(e,t){e=y(e)?e:[e];var n=this;e.forEach(function(e){n._removeListener(e,t)})},U.prototype.createEvent=function(e){var t=new H;return t.init(e),t},U.prototype.fire=function(e,t){var n,r,o=F.call(arguments);if(!(e="object"===Ve(e)?(t=e).type:e))throw new Error("no event type specified");if(n=this._listeners[e]){var i=t instanceof H?t:this.createEvent(t),t=(o[0]=i).type;e!==t&&(i.type=e);try{r=this._invokeListeners(i,o,n)}finally{e!==t&&(i.type=t)}return r=void 0===r&&i.defaultPrevented?!1:r}},U.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},U.prototype._destroy=function(){this._listeners={}},U.prototype._invokeListeners=function(e,t,n){for(var r;n&&!e.cancelBubble;)r=this._invokeListener(e,t,n),n=n.next;return r},U.prototype._invokeListener=function(e,t,n){var r;if(n.callback.__isTomb)return r;try{void 0!==(r=n.callback.apply(null,t))&&(e.returnValue=r,e.stopPropagation()),!1===r&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener",e),e}return r},U.prototype._addListener=function(e,t){var n,r=this._getListeners(e);if(r){for(;r;){if(r.priority<t.priority)return t.next=r,void(n?n.next=t:this._setListeners(e,t));r=(n=r).next}n.next=t}else this._setListeners(e,t)},U.prototype._getListeners=function(e){return this._listeners[e]},U.prototype._setListeners=function(e,t){this._listeners[e]=t},U.prototype._removeListener=function(e,t){var n,r,o,i=this._getListeners(e);if(t)for(;i;)n=i.next,(o=i.callback)!==t&&o[z]!==t||(r?r.next=n:this._setListeners(e,n)),r=i,i=n;else this._setListeners(e,null)},H.prototype.stopPropagation=function(){this.cancelBubble=!0},H.prototype.preventDefault=function(){this.defaultPrevented=!0},H.prototype.init=function(e){L(this,e||{})},W.prototype.get=function(e){return this.$model.properties.get(this,e)},W.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},q.prototype.createType=function(e){var t=this.model,n=this.properties,r=Object.create(W.prototype);x(e.properties,function(e){e.isMany||void 0===e.default||(r[e.name]=e.default)}),n.defineModel(r,t),n.defineDescriptor(r,e);var o=e.ns.name;function i(e){n.define(this,"$type",{value:o,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),x(e,A(function(e,t){this.set(t,e)},this))}return i.prototype=r,i.hasType=r.$instanceOf=this.model.hasType,n.defineModel(i,t),n.defineDescriptor(i,e),i};var G={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},K={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function X(e,t){e=K[e];return e?e(t):t}function Y(e){return G[e]}function Z(e){return K[e]}function Q(e,t){var n,r,o=e.split(/:/);if(1===o.length)n=e,r=t;else{if(2!==o.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=o[1],r=o[0]}return{name:e=(r?r+":":"")+n,prefix:r,localName:n}}function J(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function ee(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,x(e,A(this.registerPackage,this))}function te(e,t,n){t=t[n];if(t in e)throw new Error("package with "+n+" <"+t+"> already defined")}function ne(e){this.model=e}function re(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function oe(e){this.properties=new ne(this),this.factory=new q(this,this.properties),this.registry=new ee(e,this.properties),this.typeCache={}}J.prototype.build=function(){return $(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},J.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);n=this.properties;void 0!==t?n.splice(t,0,e):n.push(e)},J.prototype.replaceProperty=function(e,t,n){var r=e.ns,o=this.properties,i=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}e=o.indexOf(e);if(-1===e)throw new Error("property <"+r.name+"> not found in property list");o.splice(e,1),this.addProperty(t,n?void 0:e,a),i[r.name]=i[r.localName]=t},J.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,t=t.split("#"),r=Q(t[0],r),t=Q(t[1],r.prefix).name,r=this.propertiesByName[t];if(!r)throw new Error("refined property <"+t+"> not found");this.replaceProperty(r,e,n),delete e.redefines},J.prototype.addNamedProperty=function(e,t){var n=e.ns,r=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),r[n.name]=r[n.localName]=e},J.prototype.removeNamedProperty=function(e){var t=e.ns,e=this.propertiesByName;delete e[t.name],delete e[t.localName]},J.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},J.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e},J.prototype.assertNotDefined=function(e,t){var n=e.name,r=this.propertiesByName[n];if(r)throw new Error("property <"+n+"> already defined; override of <"+r.definedBy.ns.name+"#"+r.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},J.prototype.hasProperty=function(e){return this.propertiesByName[e]},J.prototype.addTrait=function(r,o){var e=this.allTypesByName,t=this.allTypes,n=r.name;n in e||(x(r.properties,A(function(e){e=L({},e,{name:e.ns.localName,inherited:o}),Object.defineProperty(e,"definedBy",{value:r});var t=e.replaces,n=e.redefines;t||n?this.redefineProperty(e,t||n,t):(e.isBody&&this.setBodyProperty(e),e.isId&&this.setIdProperty(e),this.addProperty(e))},this)),t.push(r),e[n]=r)},ee.prototype.getPackage=function(e){return this.packageMap[e]},ee.prototype.getPackages=function(){return this.packages},ee.prototype.registerPackage=function(t){t=L({},t);var e=this.packageMap;te(e,t,"prefix"),te(e,t,"uri"),x(t.types,A(function(e){this.registerType(e,t)},this)),e[t.uri]=e[t.prefix]=t,this.packages.push(t)},ee.prototype.registerType=function(e,t){var r=Q((e=L({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:L(e.meta||{})})).name,t.prefix),n=r.name,o={};x(e.properties,A(function(e){var t=Q(e.name,r.prefix),n=t.name;Y(e.type)||(e.type=Q(e.type,t.prefix).name),L(e,{ns:t,name:n}),o[n]=e},this)),L(e,{ns:r,name:n,propertiesByName:o}),x(e.extends,A(function(e){e=this.typeMap[e];e.traits=e.traits||[],e.traits.push(n)},this)),this.definePackage(e,t),this.typeMap[n]=e},ee.prototype.mapTypes=function(n,r,e){var t=Y(n.name)?{name:n.name}:this.typeMap[n.name],o=this;function i(e){return a(e,!0)}function a(e,t){e=Q(e,G[e]?"":n.prefix);o.mapTypes(e,r,t)}if(!t)throw new Error("unknown type <"+n.name+">");x(t.superClass,e?i:a),r(t,!e),x(t.traits,i)},ee.prototype.getEffectiveDescriptor=function(e){var e=Q(e),n=new J(e);this.mapTypes(e,function(e,t){n.addTrait(e,t)});e=n.build();return this.definePackage(e,e.allTypes[e.allTypes.length-1].$pkg),e},ee.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},ne.prototype.set=function(e,t,n){var r=this.model.getPropertyDescriptor(e,t),o=r&&r.name;void 0===n?r?delete e[o]:delete e.$attrs[t]:r?o in e?e[o]=n:re(e,r,n):e.$attrs[t]=n},ne.prototype.get=function(e,t){var n=this.model.getPropertyDescriptor(e,t);if(!n)return e.$attrs[t];t=n.name;return!e[t]&&n.isMany&&re(e,n,[]),e[t]},ne.prototype.define=function(e,t,n){var r;n.writable||(r=n.value,delete(n=L({},n,{get:function(){return r}})).value),Object.defineProperty(e,t,n)},ne.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},ne.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},oe.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},oe.prototype.getType=function(e){var t=this.typeCache,n=v(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r},oe.prototype.createAny=function(e,t,n){var r=Q(e),o={$type:e,$instanceOf:function(e){return e===this.$type}},t={name:e,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:t}};return this.properties.defineDescriptor(o,t),this.properties.defineModel(o,this),this.properties.define(o,"$parent",{enumerable:!1,writable:!0}),this.properties.define(o,"$instanceOf",{enumerable:!1,writable:!0}),x(n,function(e,t){_(e)&&void 0!==e.value?o[e.name]=e.value:o[t]=e}),o},oe.prototype.getPackage=function(e){return this.registry.getPackage(e)},oe.prototype.getPackages=function(){return this.registry.getPackages()},oe.prototype.getElementDescriptor=function(e){return e.$descriptor},oe.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},oe.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},oe.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var ie=String.fromCharCode,ae=Object.prototype.hasOwnProperty,ce=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,ue={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function se(e,t,n,r){return r?ae.call(ue,r)?ue[r]:"&"+r+";":ie(t||parseInt(n,16))}function le(e){return 3<e.length&&-1!==e.indexOf("&")?e.replace(ce,se):e}Object.keys(ue).forEach(function(e){ue[e.toUpperCase()]=ue[e]});var pe="xsi:type",fe="non-whitespace outside of root node";function de(e){return new Error(e)}function he(e){return"missing namespace for prefix <"+e+">"}function ye(e){return{get:e,enumerable:!0}}function me(e){return e+"$uri"}function ve(){return{line:0,column:0}}function ge(e){throw e}function be(e){if(!this)return new be(e);var O,j,E,C,n,S,P,k,R,T=e&&e.proxy,r=ge,D=ve,M=!1,B=!1,t=null,I=!1;function A(e){e instanceof Error||(e=de(e)),r(t=e,D)}function N(e){n&&(e instanceof Error||(e=de(e)),n(e,D))}this.on=function(e,t){if("function"!=typeof t)throw de("required args <name, cb>");switch(e){case"openTag":j=t;break;case"text":O=t;break;case"closeTag":E=t;break;case"error":r=t;break;case"warn":n=t;break;case"cdata":C=t;break;case"attention":k=t;break;case"question":P=t;break;case"comment":S=t;break;default:throw de("unsupported event: "+e)}return this},this.ns=function(e){if("object"!==Ve(e=void 0===e?{}:e))throw de("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return n["http://www.w3.org/2001/XMLSchema-instance"]="xsi",B=!0,R=n,this},this.parse=function(e){if("string"!=typeof e)throw de("required args <xml=string>");return t=null,function(a){var e,t,n,r,o,i,c,u,s,l,g,p=B?[]:null,b=B?function(e){var t,n,r={};for(t in e)r[n=e[t]]=n,r[me(n)]=t;return r}(R):null,f=[],_=0,d=!1,h=!1,y=0,m=0,w="",x=0;function v(){if(null!==g)return g;var e,t,n,r,o,i,a,c,u,s,l,p=B&&b.xmlns,f=B&&M?[]:null,d=x,h=w,y=h.length,m={},v={};e:for(;d<y;d++)if(u=!1,!(32===(s=h.charCodeAt(d))||s<14&&8<s)){for((s<65||122<s||90<s&&s<97)&&95!==s&&58!==s&&(N("illegal first char attribute name"),u=!0),l=d+1;l<y;l++)if(!(96<(s=h.charCodeAt(l))&&s<123||64<s&&s<91||47<s&&s<59||46===s||45===s||95===s)){if(32===s||s<14&&8<s){N("missing attribute value"),d=l;continue e}if(61===s)break;N("illegal attribute name char"),u=!0}if("xmlns:xmlns"===(c=h.substring(d,l))&&(N("illegal declaration of xmlns"),u=!0),34===(s=h.charCodeAt(l+1)))-1===(l=h.indexOf('"',d=l+2))&&-1!==(l=h.indexOf("'",d))&&(N("attribute value quote missmatch"),u=!0);else if(39===s)-1===(l=h.indexOf("'",d=l+2))&&-1!==(l=h.indexOf('"',d))&&(N("attribute value quote missmatch"),u=!0);else for(N("missing attribute value quotes"),u=!0,l+=1;l<y&&!(32===(s=h.charCodeAt(l+1))||s<14&&8<s);l++);for(-1===l&&(N("missing closing quotes"),l=y,u=!0),u||(i=h.substring(d,l)),d=l;l+1<y&&!(32===(s=h.charCodeAt(l+1))||s<14&&8<s);l++)d===l&&(N("illegal character after attribute end"),u=!0);if(d=l+1,!u)if(c in v)N("attribute <"+c+"> already defined");else if(v[c]=!0,B)if(M)if(null===(o="xmlns"===c?"xmlns":120===c.charCodeAt(0)&&"xmlns:"===c.substr(0,6)?c.substr(6):null))f.push(c,i);else{if(e=le(i),t=me(o),!(a=R[e])){if("xmlns"===o||t in b&&b[t]!==e)for(;a="ns"+_++,void 0!==b[a];);else a=o;R[e]=a}b[o]!==a&&(r||(b=function(e){var t,n={};for(t in e)n[t]=e[t];return n}(b),r=!0),b[o]=a,"xmlns"===o&&(b[me(a)]=e,p=a),b[t]=e),m[c]=i}else-1!==(s=c.indexOf(":"))?(n=b[c.substring(0,s)])?((c=p===n?c.substr(s+1):n+c.substr(s))===pe&&(i=-1!==(s=i.indexOf(":"))?(n=i.substring(0,s),(n=b[n]||n)+i.substring(s)):p+":"+i),m[c]=i):N(he(c.substring(0,s))):m[c]=i;else m[c]=i}if(M)for(d=0,y=f.length;d<y;d++){if(c=f[d++],i=f[d],-1!==(s=c.indexOf(":"))){if(!(n=b[c.substring(0,s)])){N(he(c.substring(0,s)));continue}(c=p===n?c.substr(s+1):n+c.substr(s))===pe&&(i=-1!==(s=i.indexOf(":"))?(n=i.substring(0,s),(n=b[n]||n)+i.substring(s)):p+":"+i)}m[c]=i}return g=m}D=function(){for(var e,t=/(\r\n|\r|\n)/g,n=0,r=0,o=0,i=m;o<=y&&(e=t.exec(a))&&(i=e[0].length+e.index,!(y<i));)n+=1,o=i;return{data:-1==y?(r=i,a.substring(m)):0===m?a.substring(m,y):(r=y-o,-1==m?a.substring(y):a.substring(y,m+1)),line:n,column:r}},T&&(l=Object.create({},{name:ye(function(){return u}),originalName:ye(function(){return s}),attrs:ye(v),ns:ye(function(){return b})}));for(;-1!==m;){if(-1===(y=60===a.charCodeAt(m)?m:a.indexOf("<",m)))return f.length?A("unexpected end of file"):0===m?A("missing start tag"):m<a.length&&a.substring(m).trim()&&N(fe);if(m!==y)if(f.length){if(O&&(O(a.substring(m,y),le,D),I))return}else if(a.substring(m,y).trim()&&(N(fe),I))return;if(33===(o=a.charCodeAt(y+1))){if(91===(r=a.charCodeAt(y+2))&&"CDATA["===a.substr(y+3,6)){if(-1===(m=a.indexOf("]]>",y)))return A("unclosed cdata");if(C&&(C(a.substring(y+9,m),D),I))return;m+=3;continue}if(45===r&&45===a.charCodeAt(y+3)){if(-1===(m=a.indexOf("--\x3e",y)))return A("unclosed comment");if(S&&(S(a.substring(y+4,m),le,D),I))return;m+=3;continue}}if(63!==o){for(t=y+1;;t++){if(i=a.charCodeAt(t),isNaN(i))return m=-1,A("unclosed tag");if(34===i)r=a.indexOf('"',t+1),t=-1!==r?r:t;else if(39===i)r=a.indexOf("'",t+1),t=-1!==r?r:t;else if(62===i){m=t;break}}if(33!==o){if(g={},47===o){if(h=!(d=!1),!f.length)return A("missing open tag");if(t=u=f.pop(),r=y+2+t.length,a.substring(y+2,r)!==t)return A("closing tag mismatch");for(;r<m;r++)if(!(32===(o=a.charCodeAt(r))||8<o&&o<14))return A("close tag")}else{if(h=47===a.charCodeAt(m-1)?(t=u=a.substring(y+1,m-1),d=!0):(t=u=a.substring(y+1,m),!(d=!0)),!(96<o&&o<123||64<o&&o<91||95===o||58===o))return A("illegal first char nodeName");for(r=1,n=t.length;r<n;r++)if(!(96<(o=t.charCodeAt(r))&&o<123||64<o&&o<91||47<o&&o<59||45===o||95===o||46==o)){if(32===o||o<14&&8<o){u=t.substring(0,r),g=null;break}return A("invalid nodeName")}h||f.push(u)}if(B){if(e=b,d&&(h||p.push(e),null===g&&(M=-1!==t.indexOf("xmlns",r))&&(x=r,w=t,v(),M=!1)),-1!==(o=(s=u).indexOf(":"))){if(!(c=b[u.substring(0,o)]))return A("missing namespace on <"+s+">");u=u.substr(o+1)}else c=b.xmlns;c&&(u=c+":"+u)}if(d&&(x=r,w=t,j&&(T?j(l,le,h,D):j(u,v,le,h,D),I)))return;if(h){if(E&&(E(T?l:u,le,d,D),I))return;B&&(b=d?e:p.pop())}m+=1}else{if(k&&(k(a.substring(y,m+1),le,D),I))return;m+=1}}else{if(-1===(m=a.indexOf("?>",y)))return A("unclosed question");if(P&&(P(a.substring(y,m+2),D),I))return;m+=2}}}(e),D=ve,I=!1,t},this.stop=function(){I=!0}}function _e(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var we={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},xe="xsi:type";function Oe(e){return e.xml&&e.xml.serialize}function je(e){return Oe(e)===xe}function Ee(e,t){return _e(t)?e.prefix+":"+((t=e.localName).charAt(0).toUpperCase()+t.slice(1)):e.name}function Ce(e){return new Error(e)}function Se(e){return e.$descriptor}function Pe(e){L(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw Ce("expected element");var t,n=this.elementsById,r=Se(e).idProperty;if(r&&(t=e.get(r.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw Ce("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function e(){}function ke(){}function Re(){}function Te(e,t){this.property=e,this.context=t}function De(e,t){this.element=t,this.propertyDesc=e}function Me(){}function Be(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function Ie(e,t,n){Be.call(this,e,t,n)}function Ae(e,t,n){this.model=e,this.context=n}function Ne(e){L(this,{lax:!1},e=e instanceof oe?{model:e}:e)}e.prototype.handleEnd=function(){},e.prototype.handleText=function(){},e.prototype.handleNode=function(){},(ke.prototype=Object.create(e.prototype)).handleNode=function(){return this},(Re.prototype=Object.create(e.prototype)).handleText=function(e){this.body=(this.body||"")+e},(Te.prototype=Object.create(Re.prototype)).handleNode=function(e){if(this.element)throw Ce("expected no sub nodes");return this.element=this.createReference(e),this},Te.prototype.handleEnd=function(){this.element.id=this.body},Te.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},(De.prototype=Object.create(Re.prototype)).handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc,e=X(n.type,e);n.isMany?t.get(n.name).push(e):t.set(n.name,e)},(Me.prototype=Object.create(Re.prototype)).handleNode=function(e){var t,n=this;return(t=this.element)?n=this.handleChild(e):(t=this.element=this.createElement(e),this.context.addElement(t)),n},(Be.prototype=Object.create(Me.prototype)).addReference=function(e){this.context.addReference(e)},Be.prototype.handleText=function(e){if(!Se(this.element).bodyProperty)throw Ce("unexpected body text <"+e+">");Re.prototype.handleText.call(this,e)},Be.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Se(t).bodyProperty;n&&void 0!==e&&(e=X(n.type,e),t.set(n.name,e))},Be.prototype.createElement=function(e){var r,t=e.attributes,e=this.type,o=Se(e),i=this.context,a=new e({}),c=this.model;return x(t,function(e,t){var n=o.propertiesByName[t];n&&n.isReference?n.isMany?x(e.split(" "),function(e){i.addReference({element:a,property:n.ns.name,id:e})}):i.addReference({element:a,property:n.ns.name,id:e}):(n?e=X(n.type,e):"xmlns"!==t&&(r=Q(t,o.ns.prefix),c.getPackage(r.prefix)&&i.addWarning({message:"unknown attribute <"+t+">",element:a,property:t,value:e})),a.set(t,e))}),a},Be.prototype.getPropertyForNode=function(e){var t,n,r=Q(e.name),o=this.type,i=this.model,a=Se(o),c=r.name,u=a.propertiesByName[c];if(u&&!u.isAttr)return je(u)&&(t=e.attributes[xe])?(o=i,e=Q(c=t),s=o.getPackage(e.prefix),c=s,s=(o=e).name,e=o.localName,t=(c=c.xml&&c.xml.typePrefix)&&0===e.indexOf(c)?o.prefix+":"+e.slice(c.length):s,L({},u,{effectiveType:Se(n=i.getType(t)).name})):u;var s=i.getPackage(r.prefix);if(s){if(t=Ee(r,s),n=i.getType(t),u=b(a.properties,function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)}))return L({},u,{effectiveType:Se(n).name})}else if(u=b(a.properties,function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type}))return u;throw Ce("unrecognized element <"+r.name+">")},Be.prototype.toString=function(){return"ElementDescriptor["+Se(this.type).name+"]"},Be.prototype.valueHandler=function(e,t){return new De(e,t)},Be.prototype.referenceHandler=function(e){return new Te(e,this.context)},Be.prototype.handler=function(e){return new("Element"===e?Ae:Be)(this.model,e,this.context)},Be.prototype.handleChild=function(e){var t=this.getPropertyForNode(e),n=this.element,r=t.effectiveType||t.type;if(K[r])return this.valueHandler(t,n);e=(r=(t.isReference?this.referenceHandler(t):this.handler(r)).handleNode(e)).element;return void 0!==e&&(t.isMany?n.get(t.name).push(e):n.set(t.name,e),t.isReference?(L(e,{element:n}),this.context.addReference(e)):e.$parent=n),r},(Ie.prototype=Object.create(Be.prototype)).createElement=function(e){var t=e.name,n=Q(t),r=this.model,o=this.type,r=r.getPackage(n.prefix),t=r&&Ee(n,r)||t;if(!o.hasType(t))throw Ce("unexpected element <"+e.originalName+">");return Be.prototype.createElement.call(this,e)},(Ae.prototype=Object.create(Me.prototype)).createElement=function(e){var t=e.name,n=Q(t).prefix,n=e.ns[n+"$uri"],e=e.attributes;return this.model.createAny(t,n,e)},Ae.prototype.handleChild=function(e){var t=new Ae(this.model,0,this.context).handleNode(e),n=this.element,e=t.element;return void 0!==e&&((n.$children=n.$children||[]).push(e),e.$parent=n),t},Ae.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Ne.prototype.fromXML=function(c,e,t){var u=e.rootHandler;e instanceof Be?(u=e,e={}):"string"==typeof e?(u=this.handler(e),e={}):"string"==typeof u&&(u=this.handler(u));var n=this.model,a=this.lax,s=new Pe(L({},e,{rootHandler:u})),l=new be({proxy:!0}),p=(e=[],Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e);function f(e,t,n){var r=t(),o=r.line,t=r.column,r=r.data,t="unparsable content "+((r="<"===r.charAt(0)&&-1!==r.indexOf(" ")?r.slice(0,r.indexOf(" "))+">":r)?r+" ":"")+"detected\n\tline: "+o+"\n\tcolumn: "+t+"\n\tnested error: "+e.message;if(n)return s.addWarning({message:t,error:e}),!0;throw Ce(t)}function r(e,t){return f(e,t,!0)}u.context=s,p.push(u);var o=/^<\?xml /i,i=/ encoding="([^"]+)"/i,d=/^utf-8$/i;function h(e,t){try{p.peek().handleText(e)}catch(e){r(e,t)}}n=n.getPackages().reduce(function(e,t){return e[t.uri]=t.prefix,e},{"http://www.w3.org/XML/1998/namespace":"xml"});return l.ns(n).on("openTag",function(e,r,t,n){var o=e.attrs||{},i=Object.keys(o).reduce(function(e,t){var n=r(o[t]);return e[t]=n,e},{});!function(e,t){var n=p.peek();try{p.push(n.handleNode(e))}catch(e){f(e,t,a)&&p.push(new ke)}}({name:e.name,originalName:e.originalName,attributes:i,ns:e.ns},n)}).on("question",function(e){!o.test(e)||(e=(e=i.exec(e))&&e[1])&&!d.test(e)&&s.addWarning({message:"unsupported document encoding <"+e+">, falling back to UTF-8"})}).on("closeTag",function(){p.pop().handleEnd()}).on("cdata",h).on("text",function(e,t,n){e=t(e),n=n,e.trim()&&h(e,n)}).on("error",f).on("warn",r),new Promise(function(e,t){var n;try{l.parse(c),function(){for(var e=s.elementsById,t=s.references,n=0;o=t[n];n++){var r,o,i=o.element,a=e[o.id],c=Se(i).propertiesByName[o.property];a||s.addWarning({message:"unresolved reference <"+o.id+">",element:o.element,property:o.property,value:o.id}),c.isMany?(-1===(o=(r=i.get(c.name)).indexOf(o))&&(o=r.length),a?r[o]=a:r.splice(o,1)):i.set(c.name,a)}}()}catch(e){n=e}var r=u.element;n||r||(n=Ce("failed to parse document as <"+u.type.$descriptor.name+">"));var o=s.warnings,i=s.references,a=s.elementsById;return n?(n.warnings=o,t(n)):e({rootElement:r,elementsById:a,references:i,warnings:o})})},Ne.prototype.handler=function(e){return new Ie(this.model,e)};var Le=/<|>|'|"|&|\n\r|\n/g,$e=/<|>|&/g;function ze(r){var n={},o={},i={},a=[],c=[];this.byUri=function(e){return o[e]||r&&r.byUri(e)},this.add=function(e,t){o[e.uri]=e,(t?a:c).push(e),this.mapPrefix(e.prefix,e.uri)},this.uriByPrefix=function(e){return n[e||"xmlns"]},this.mapPrefix=function(e,t){n[e||"xmlns"]=t},this.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},this.logUsed=function(e){var t=e.uri,n=this.getNSKey(e);i[n]=this.byUri(t),r&&r.logUsed(e)},this.getUsed=function(e){var t=this;return[].concat(a,c).filter(function(e){return e=t.getNSKey(e),i[e]})}}function Fe(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function Ue(e){return v(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function He(e,t){return t.isGeneric?L({localName:t.ns.localName},e):L({localName:(n=t.ns.localName,_e(t=t.$pkg)?(t=n).charAt(0).toLowerCase()+t.slice(1):n)},e);var n}var We={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},qe={"<":"lt",">":"gt","&":"amp"};function Ge(e,t,n){return(e=v(e)?e:""+e).replace(t,function(e){return"&"+n[e]+";"})}function Ke(e){this.tagName=e}function Xe(){}function Ye(e){this.tagName=e}function Ze(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Qe(e,t){Ze.call(this,e,t)}function Je(){this.value="",this.write=function(e){this.value+=e}}function et(t,e){var n=[""];this.append=function(e){return t.write(e),this},this.appendNewLine=function(){return e&&t.write("\n"),this},this.appendIndent=function(){return e&&t.write(n.join("  ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function tt(o){return o=L({format:!1,preamble:!0},o||{}),{toXML:function(e,t){var n=t||new Je,r=new et(n,o.format);if(o.preamble&&r.append('<?xml version="1.0" encoding="UTF-8"?>\n'),(new Ze).build(e).serializeTo(r),!t)return n.value}}}function nt(e,t){oe.call(this,e,t)}Ke.prototype.build=function(e){return this.element=e,this},Ke.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},Xe.prototype.serializeValue=Xe.prototype.serializeTo=function(e){e.append(this.escape?Ge(this.value,$e,qe):this.value)},Xe.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search($e)&&(this.escape=!0),this},Fe(Ye,Xe),Ye.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},Ze.prototype.build=function(e){var n,t=(this.element=e).$descriptor,r=this.propertyDescriptor,o=t.isGeneric,i=o?this.parseGeneric(e):this.parseNsAttributes(e);return this.ns=r?this.nsPropertyTagName(r):this.nsTagName(t),this.tagName=this.addTagName(this.ns),o||(o=w((n=e).$descriptor.properties,function(e){var t=e.name;if(!e.isVirtual&&g(n,t)){t=n[t];return t!==e.default?null!==t&&(!e.isMany||t.length):void 0}}),this.parseAttributes(w(o,function(e){return e.isAttr})),this.parseContainments(w(o,function(e){return!e.isAttr}))),this.parseGenericAttributes(e,i),this},Ze.prototype.nsTagName=function(e){return He(this.logNamespaceUsed(e.ns),e)},Ze.prototype.nsPropertyTagName=function(e){var t=this.logNamespaceUsed(e.ns);return L({localName:e.ns.localName},t)},Ze.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Ze.prototype.nsAttributeName=function(e){var t=v(e)?Q(e):e.ns;if(e.inherited)return{localName:t.localName};e=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(e),this.isLocalNs(e)?{localName:t.localName}:L({localName:t.localName},e)},Ze.prototype.parseGeneric=function(n){var r=this,o=this.body,i=[];return x(n,function(e,t){"$body"===t?o.push((new Xe).build({type:"String"},e)):"$children"===t?x(e,function(e){o.push(new Ze(r).build(e))}):0!==t.indexOf("$")&&r.parseNsAttribute(n,t,e)&&i.push({name:t,value:e})}),i},Ze.prototype.parseNsAttribute=function(e,t,n){var r,o=e.$model,e=Q(t);if("xmlns"===e.prefix&&(r={prefix:e.localName,uri:n}),!(r=!e.prefix&&"xmlns"===e.localName?{uri:n}:r))return{name:t,value:n};o&&o.getPackage(n)?this.logNamespace(r,!0,!0):(r=this.logNamespaceUsed(r,!0),this.getNamespaces().logUsed(r))},Ze.prototype.parseNsAttributes=function(n,e){var r=this,t=n.$attrs,o=[];return x(t,function(e,t){e=r.parseNsAttribute(n,t,e);e&&o.push(e)}),o},Ze.prototype.parseGenericAttributes=function(n,e){var r=this;x(e,function(t){if(t.name!==xe)try{r.addAttribute(r.nsAttributeName(t.name),t.value)}catch(e){console.warn("missing namespace information for ",t.name,"=",t.value,"on",n,e)}})},Ze.prototype.parseContainments=function(e){var i=this,a=this.body,c=this.element;x(e,function(n){var r,o,e=c.get(n.name),t=n.isReference;n.isMany||(e=[e]),n.isBody?a.push((new Xe).build(n,e[0])):Z(n.type)?x(e,function(e){a.push(new Ye(i.addTagName(i.nsPropertyTagName(n))).build(n,e))}):t?x(e,function(e){a.push(new Ke(i.addTagName(i.nsPropertyTagName(n))).build(e))}):(r=je(n),o="property"===Oe(n),x(e,function(e){var t=r?new Qe(i,n):o?new Ze(i,n):new Ze(i);a.push(t.build(e))}))})},Ze.prototype.getNamespaces=function(e){var t=this.namespaces,n=this.parent;return t||(n=n&&n.getNamespaces(),e||!n?this.namespaces=t=new ze(n):t=n),t},Ze.prototype.logNamespace=function(e,t,n){var r=this.getNamespaces(n),o=e.uri,i=e.prefix;return r.byUri(o)&&!n||r.add(e,t),r.mapPrefix(i,o),e},Ze.prototype.logNamespaceUsed=function(e,t){var n,r,o=this.element.$model,i=this.getNamespaces(t),a=e.prefix,t=e.uri;if(!a&&!t)return{localName:e.localName};if(o=we[a]||o&&(o.getPackage(a)||{}).uri,!(t=t||o||i.uriByPrefix(a)))throw new Error("no namespace uri given for prefix <"+a+">");if(!(e=i.byUri(t))){for(n=a,r=1;i.uriByPrefix(n);)n=a+"_"+r++;e=this.logNamespace({prefix:n,uri:t},o===t)}return a&&i.mapPrefix(a,t),e},Ze.prototype.parseAttributes=function(e){var r=this,o=this.element;x(e,function(e){var t,n=o.get(e.name);e.isReference&&(n=e.isMany?(t=[],x(n,function(e){t.push(e.id)}),t.join(" ")):n.id),r.addAttribute(r.nsAttributeName(e),n)})},Ze.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),Ue(e)},Ze.prototype.addAttribute=function(e,t){var n=this.attrs;v(t)&&(t=Ge(t,Le,We)),n.push({name:e,value:t})},Ze.prototype.serializeAttributes=function(t){var e=this.attrs,n=this.namespaces;x(e=n?n.getUsed().filter(function(e){return"xml"!==e.prefix}).map(function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}}).concat(e):e,function(e){t.append(" ").append(Ue(e.name)).append('="').append(e.value).append('"')})},Ze.prototype.serializeTo=function(t){var e=this.body[0],n=e&&e.constructor!==Xe;t.appendIndent().append("<"+this.tagName),this.serializeAttributes(t),t.append(e?">":" />"),e&&(n&&t.appendNewLine().indent(),x(this.body,function(e){e.serializeTo(t)}),n&&t.unindent().appendIndent(),t.append("</"+this.tagName+">")),t.appendNewLine()},Fe(Qe,Ze),Qe.prototype.parseNsAttributes=function(e){var t=Ze.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var r=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);e=e.$model.getPackage(r.uri),e=e.xml&&e.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(xe),(r.prefix?r.prefix+":":"")+e+n.ns.localName),t},Qe.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},(nt.prototype=Object.create(oe.prototype)).fromXML=function(e,t,n){v(t)||(n=t,t="dmn:Definitions");n=new Ne(L({model:this,lax:!0},n)),t=n.handler(t);return n.fromXML(e,t)},nt.prototype.toXML=function(n,e){var r=new tt(e);return new Promise(function(e,t){try{return e({xml:r.toXML(n)})}catch(e){return t(e)}})};var rt={dc:{name:"DC",prefix:"dc",uri:"http://www.omg.org/spec/DMN/20180521/DC/",types:[{name:"Dimension",properties:[{name:"width",isAttr:!0,type:"Real"},{name:"height",isAttr:!0,type:"Real"}]},{name:"Bounds",properties:[{name:"height",isAttr:!0,type:"Real"},{name:"width",isAttr:!0,type:"Real"},{name:"x",isAttr:!0,type:"Real"},{name:"y",isAttr:!0,type:"Real"}]},{name:"Point",properties:[{name:"x",isAttr:!0,type:"Real"},{name:"y",isAttr:!0,type:"Real"}]},{name:"Color",properties:[{name:"red",type:"UML_Standard_Profile.mdzip:eee_1045467100323_917313_65"},{name:"green",type:"UML_Standard_Profile.mdzip:eee_1045467100323_917313_65"},{name:"blue",type:"UML_Standard_Profile.mdzip:eee_1045467100323_917313_65"}]}],associations:[],enumerations:[{name:"AlignmentKind",literalValues:[{name:"start"},{name:"center"},{name:"end"}]}]},di:{name:"DI",prefix:"di",uri:"http://www.omg.org/spec/DMN/20180521/DI/",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"extension",type:"Extension"},{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"style",isReference:!0,type:"Style",xml:{serialize:"property"}},{name:"sharedStyle",isReference:!0,isVirtual:!0,type:"Style"}]},{name:"Diagram",superClass:["DiagramElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"}]},{name:"Shape",isAbstract:!0,properties:[{name:"bounds",type:"dc:Bounds"}],superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,properties:[{name:"waypoint",type:"dc:Point",isMany:!0,xml:{serialize:"property"}}],superClass:["DiagramElement"]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],associations:[],enumerations:[],xml:{tagAlias:"lowerCase"}},dmn:{name:"DMN",prefix:"dmn",uri:"https://www.omg.org/spec/DMN/20191111/MODEL/",types:[{name:"AuthorityRequirement",superClass:["DMNElement"],properties:[{name:"requiredAuthority",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredDecision",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredInput",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"ItemDefinition",superClass:["NamedElement"],properties:[{name:"typeRef",type:"String"},{name:"allowedValues",type:"UnaryTests",xml:{serialize:"property"}},{name:"typeLanguage",type:"String",isAttr:!0},{name:"itemComponent",type:"ItemDefinition",isMany:!0,xml:{serialize:"property"}},{name:"functionItem",type:"FunctionItem"},{name:"isCollection",isAttr:!0,type:"Boolean"}]},{name:"Definitions",superClass:["NamedElement"],properties:[{name:"import",type:"Import",isMany:!0},{name:"itemDefinition",type:"ItemDefinition",isMany:!0},{name:"drgElement",type:"DRGElement",isMany:!0},{name:"artifact",type:"Artifact",isMany:!0},{name:"elementCollection",type:"ElementCollection",isMany:!0},{name:"businessContextElement",type:"BusinessContextElement",isMany:!0},{name:"namespace",type:"String",isAttr:!0},{name:"expressionLanguage",type:"String",isAttr:!0},{name:"typeLanguage",type:"String",isAttr:!0},{name:"exporter",isAttr:!0,type:"String"},{name:"exporterVersion",isAttr:!0,type:"String"},{name:"dmnDI",type:"dmndi:DMNDI"}]},{name:"KnowledgeSource",superClass:["DRGElement"],properties:[{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0},{name:"type",type:"String"},{name:"owner",type:"DMNElementReference",xml:{serialize:"property"}},{name:"locationURI",type:"String",isAttr:!0}]},{name:"DecisionRule",superClass:["DMNElement"],properties:[{name:"inputEntry",type:"UnaryTests",isMany:!0,xml:{serialize:"property"}},{name:"outputEntry",type:"LiteralExpression",isMany:!0,xml:{serialize:"property"}},{name:"annotationEntry",type:"RuleAnnotation",isMany:!0,xml:{serialize:"property"}}]},{name:"Expression",isAbstract:!0,superClass:["DMNElement"],properties:[{name:"typeRef",isAttr:!0,type:"String"}]},{name:"InformationItem",superClass:["NamedElement"],properties:[{name:"typeRef",isAttr:!0,type:"String"}]},{name:"Decision",superClass:["DRGElement"],properties:[{name:"question",type:"String",xml:{serialize:"property"}},{name:"allowedAnswers",type:"String",xml:{serialize:"property"}},{name:"variable",type:"InformationItem",xml:{serialize:"property"}},{name:"informationRequirement",type:"InformationRequirement",isMany:!0},{name:"knowledgeRequirement",type:"KnowledgeRequirement",isMany:!0},{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0},{name:"supportedObjective",isMany:!0,type:"DMNElementReference",xml:{serialize:"property"}},{name:"impactedPerformanceIndicator",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"decisionMaker",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"decisionOwner",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"usingProcess",isMany:!0,type:"DMNElementReference",xml:{serialize:"property"}},{name:"usingTask",isMany:!0,type:"DMNElementReference",xml:{serialize:"property"}},{name:"decisionLogic",type:"Expression"}]},{name:"Invocation",superClass:["Expression"],properties:[{name:"calledFunction",type:"Expression"},{name:"binding",type:"Binding",isMany:!0}]},{name:"OrganisationalUnit",superClass:["BusinessContextElement"],properties:[{name:"decisionMade",type:"Decision",isReference:!0,isMany:!0},{name:"decisionOwned",type:"Decision",isReference:!0,isMany:!0}]},{name:"Import",superClass:["NamedElement"],properties:[{name:"importType",type:"String",isAttr:!0},{name:"locationURI",type:"String",isAttr:!0},{name:"namespace",type:"String",isAttr:!0}]},{name:"InformationRequirement",superClass:["DMNElement"],properties:[{name:"requiredDecision",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredInput",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"ElementCollection",superClass:["NamedElement"],properties:[{name:"drgElement",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}}]},{name:"DRGElement",isAbstract:!0,superClass:["NamedElement"],properties:[]},{name:"InputData",superClass:["DRGElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}}]},{name:"DMNElement",isAbstract:!0,properties:[{name:"description",type:"String"},{name:"extensionElements",type:"ExtensionElements"},{name:"id",type:"String",isAttr:!0,isId:!0},{name:"extensionAttribute",type:"ExtensionAttribute",isMany:!0},{name:"label",isAttr:!0,type:"String"}]},{name:"InputClause",superClass:["DMNElement"],properties:[{name:"inputExpression",type:"LiteralExpression",xml:{serialize:"property"}},{name:"inputValues",type:"UnaryTests",xml:{serialize:"property"}}]},{name:"DecisionTable",superClass:["Expression"],properties:[{name:"input",type:"InputClause",isMany:!0,xml:{serialize:"property"}},{name:"output",type:"OutputClause",isMany:!0,xml:{serialize:"property"}},{name:"annotation",type:"RuleAnnotationClause",isMany:!0,xml:{serialize:"property"}},{name:"rule",type:"DecisionRule",isMany:!0,xml:{serialize:"property"}},{name:"hitPolicy",type:"HitPolicy",isAttr:!0,default:"UNIQUE"},{name:"aggregation",type:"BuiltinAggregator",isAttr:!0},{name:"preferredOrientation",type:"DecisionTableOrientation",isAttr:!0},{name:"outputLabel",isAttr:!0,type:"String"}]},{name:"LiteralExpression",superClass:["Expression"],properties:[{name:"expressionLanguage",type:"String",isAttr:!0},{name:"text",type:"String"},{name:"importedValues",type:"ImportedValues"}]},{name:"Binding",properties:[{name:"parameter",type:"InformationItem",xml:{serialize:"property"}},{name:"bindingFormula",type:"Expression"}]},{name:"KnowledgeRequirement",superClass:["DMNElement"],properties:[{name:"requiredKnowledge",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"BusinessKnowledgeModel",superClass:["Invocable"],properties:[{name:"encapsulatedLogic",type:"FunctionDefinition",xml:{serialize:"property"}},{name:"knowledgeRequirement",type:"KnowledgeRequirement",isMany:!0},{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0}]},{name:"BusinessContextElement",isAbstract:!0,superClass:["NamedElement"],properties:[{name:"URI",type:"String",isAttr:!0}]},{name:"PerformanceIndicator",superClass:["BusinessContextElement"],properties:[{name:"impactingDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}}]},{name:"FunctionDefinition",superClass:["Expression"],properties:[{name:"formalParameter",type:"InformationItem",isMany:!0,xml:{serialize:"property"}},{name:"body",type:"Expression"},{name:"kind",type:"FunctionKind",isAttr:!0}]},{name:"Context",superClass:["Expression"],properties:[{name:"contextEntry",type:"ContextEntry",isMany:!0}]},{name:"ContextEntry",superClass:["DMNElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}},{name:"value",type:"Expression"}]},{name:"List",superClass:["Expression"],properties:[{name:"elements",isMany:!0,type:"Expression"}]},{name:"Relation",superClass:["Expression"],properties:[{name:"column",type:"InformationItem",isMany:!0,xml:{serialize:"property"}},{name:"row",type:"List",isMany:!0,xml:{serialize:"property"}}]},{name:"OutputClause",superClass:["DMNElement"],properties:[{name:"outputValues",type:"UnaryTests",xml:{serialize:"property"}},{name:"defaultOutputEntry",type:"LiteralExpression",xml:{serialize:"property"}},{name:"name",isAttr:!0,type:"String"},{name:"typeRef",isAttr:!0,type:"String"}]},{name:"UnaryTests",superClass:["Expression"],properties:[{name:"text",type:"String"},{name:"expressionLanguage",type:"String",isAttr:!0}]},{name:"NamedElement",isAbstract:!0,superClass:["DMNElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ImportedValues",superClass:["Import"],properties:[{name:"importedElement",type:"String"},{name:"expressionLanguage",type:"String",isAttr:!0}]},{name:"DecisionService",superClass:["Invocable"],properties:[{name:"outputDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"encapsulatedDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"inputDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"inputData",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}}]},{name:"ExtensionElements",properties:[{name:"values",type:"Element",isMany:!0}]},{name:"ExtensionAttribute",properties:[{name:"value",type:"Element"},{name:"valueRef",type:"Element",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Element",isAbstract:!0,properties:[{name:"extensionAttribute",type:"ExtensionAttribute",isAttr:!0,isReference:!0},{name:"elements",type:"ExtensionElements",isAttr:!0,isReference:!0}]},{name:"Artifact",isAbstract:!0,superClass:["DMNElement"],properties:[]},{name:"Association",superClass:["Artifact"],properties:[{name:"sourceRef",type:"DMNElementReference",xml:{serialize:"property"}},{name:"targetRef",type:"DMNElementReference",xml:{serialize:"property"}},{name:"associationDirection",type:"AssociationDirection",isAttr:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",isAttr:!0,type:"String",default:"text/plain"}]},{name:"RuleAnnotationClause",properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"RuleAnnotation",properties:[{name:"text",type:"String"}]},{name:"Invocable",isAbstract:!0,superClass:["DRGElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}}]},{name:"Group",superClass:["Artifact"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"FunctionItem",superClass:["DMNElement"],properties:[{name:"parameters",isMany:!0,type:"InformationItem",xml:{serialize:"property"}},{name:"outputTypeRef",isAttr:!0,type:"String"}]},{name:"DMNElementReference",properties:[{isAttr:!0,name:"href",type:"String"}]}],enumerations:[{name:"HitPolicy",literalValues:[{name:"UNIQUE"},{name:"FIRST"},{name:"PRIORITY"},{name:"ANY"},{name:"COLLECT"},{name:"RULE ORDER"},{name:"OUTPUT ORDER"}]},{name:"BuiltinAggregator",literalValues:[{name:"SUM"},{name:"COUNT"},{name:"MIN"},{name:"MAX"}]},{name:"DecisionTableOrientation",literalValues:[{name:"Rule-as-Row"},{name:"Rule-as-Column"},{name:"CrossTable"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"FunctionKind",literalValues:[{name:"FEEL"},{name:"Java"},{name:"PMML"}]}],associations:[],xml:{tagAlias:"lowerCase"}},dmndi:{name:"DMNDI",prefix:"dmndi",uri:"https://www.omg.org/spec/DMN/20191111/DMNDI/",types:[{name:"DMNDI",properties:[{name:"diagrams",type:"DMNDiagram",isMany:!0},{name:"styles",type:"DMNStyle",isMany:!0}]},{name:"DMNStyle",superClass:["di:Style"],properties:[{name:"fillColor",type:"dc:Color",isAttr:!0},{name:"strokeColor",type:"dc:Color",isAttr:!0},{name:"fontColor",type:"dc:Color",isAttr:!0},{name:"fontSize",isAttr:!0,type:"Real"},{name:"fontFamily",isAttr:!0,type:"String"},{name:"fontItalic",isAttr:!0,type:"Boolean"},{name:"fontBold",isAttr:!0,type:"Boolean"},{name:"fontUnderline",isAttr:!0,type:"Boolean"},{name:"fontStrikeThrough",isAttr:!0,type:"Boolean"},{name:"labelHorizontalAlignment",type:"dc:AlignmentKind",isAttr:!0},{name:"labelVerticalAlignment",type:"dc:AlignmentKind",isAttr:!0}]},{name:"DMNDiagram",superClass:["di:Diagram"],properties:[{name:"dmnElementRef",type:"dmn:DMNElement",isAttr:!0,isReference:!0},{name:"size",type:"Size"},{name:"localStyle",type:"DMNStyle",isVirtual:!0},{name:"sharedStyle",type:"DMNStyle",isVirtual:!0,isReference:!0,redefines:"di:DiagramElement#sharedStyle"},{name:"diagramElements",type:"DMNDiagramElement",isMany:!0}]},{name:"DMNDiagramElement",isAbstract:!0,superClass:["di:DiagramElement"],properties:[{name:"dmnElementRef",type:"dmn:DMNElement",isAttr:!0,isReference:!0},{name:"sharedStyle",type:"DMNStyle",isVirtual:!0,isReference:!0,redefines:"di:DiagramElement#sharedStyle"},{name:"localStyle",type:"DMNStyle",isVirtual:!0},{name:"label",type:"DMNLabel"}]},{name:"DMNLabel",superClass:["di:Shape"],properties:[{name:"text",type:"Text"}]},{name:"DMNShape",superClass:["di:Shape","DMNDiagramElement"],properties:[{name:"isListedInputData",isAttr:!0,type:"Boolean"},{name:"decisionServiceDividerLine",type:"DMNDecisionServiceDividerLine"},{name:"isCollapsed",isAttr:!0,type:"Boolean"}]},{name:"DMNEdge",superClass:["di:Edge","DMNDiagramElement"],properties:[{name:"sourceElement",type:"DMNDiagramElement",isAttr:!0,isReference:!0},{name:"targetElement",type:"DMNDiagramElement",isAttr:!0,isReference:!0}]},{name:"DMNDecisionServiceDividerLine",superClass:["di:Edge"]},{name:"Text",properties:[{name:"text",isBody:!0,type:"String"}]},{name:"Size",superClass:["dc:Dimension"]}],associations:[],enumerations:[]},biodi:{name:"bpmn.io DI for DMN",uri:"http://bpmn.io/schema/dmn/biodi/2.0",prefix:"biodi",xml:{tagAlias:"lowerCase"},types:[{name:"DecisionTable",isAbstract:!0,extends:["dmn:DecisionTable"],properties:[{name:"annotationsWidth",isAttr:!0,type:"Integer"}]},{name:"OutputClause",isAbstract:!0,extends:["dmn:OutputClause"],properties:[{name:"width",isAttr:!0,type:"Integer"}]},{name:"InputClause",isAbstract:!0,extends:["dmn:InputClause"],properties:[{name:"width",isAttr:!0,type:"Integer"}]}]}};function ot(e,t){return new nt(L({},rt,e),t)}var it=Object.prototype.toString,at=Object.prototype.hasOwnProperty;function ct(e,t){var n;if(void 0!==e){var r,o,i="[object Array]"===it.call(e)?st:ut;for(r in e)if(o=r,at.call(e,o)&&!1===t(n=e[r],i(r)))return n}}function ut(e){return e}function st(e){return Number(e)}function lt(e){for(var n=e.style,t=arguments.length,r=Array(1<t?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];return ct(r,function(e){e&&ct(e,function(e,t){n[t]=e})}),e}function pt(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)}function ft(e,t){if(dt)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}var dt=[].indexOf,ht=/\s+/,yt=Object.prototype.toString;function mt(e){return new vt(e)}function vt(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function gt(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}vt.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~ft(t,e)||t.push(e),this.el.className=t.join(" "),this},vt.prototype.remove=function(e){if("[object RegExp]"==yt.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),e=ft(t,e);return~e&&t.splice(e,1),this.el.className=t.join(" "),this},vt.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},vt.prototype.toggle=function(e,t){return this.list?void 0!==t&&t===this.list.toggle(e,t)||this.list.toggle(e):void 0!==t?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this},vt.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(ht);return""===e[0]&&e.shift(),e},vt.prototype.has=vt.prototype.contains=function(e){return this.list?this.list.contains(e):!!~ft(this.array(),e)};var bt="undefined"!=typeof Element?Element.prototype:{},_t=bt.matches||bt.matchesSelector||bt.webkitMatchesSelector||bt.mozMatchesSelector||bt.msMatchesSelector||bt.oMatchesSelector,wt=function(e,t){if(!e||1!==e.nodeType)return!1;if(_t)return _t.call(e,t);for(var n=e.parentNode.querySelectorAll(t),r=0;r<n.length;r++)if(n[r]==e)return!0;return!1};function xt(e,t,n){for(var r=n?e:e.parentNode;r&&r.nodeType!==document.DOCUMENT_NODE&&r.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(wt(r,t))return r;r=r.parentNode}return wt(r,t)?r:null}var Ot=window.addEventListener?"addEventListener":"attachEvent",jt=window.removeEventListener?"removeEventListener":"detachEvent",Et="addEventListener"!=Ot?"on":"",Ct={bind:function(e,t,n,r){return e[Ot](Et+t,n,r||!1),n},unbind:function(e,t,n,r){return e[jt](Et+t,n,r||!1),n}},St=["focus","blur"];var Pt={bind:function(n,r,e,o,t){return-1!==St.indexOf(e)&&(t=!0),Ct.bind(n,e,function(e){var t=e.target||e.srcElement;e.delegateTarget=xt(t,r,!0),e.delegateTarget&&o.call(n,e)},t)},unbind:function(e,t,n,r){return-1!==St.indexOf(t)&&(r=!0),Ct.unbind(e,t,n,r)}},kt=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");t=t||document;var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var r=n[1];if("body"==r)return(o=t.createElement("html")).innerHTML=e,o.removeChild(o.lastChild);var o,n=Tt[r]||Tt._default,i=n[0],r=n[1],n=n[2];(o=t.createElement("div")).innerHTML=r+e+n;for(;i--;)o=o.lastChild;if(o.firstChild==o.lastChild)return o.removeChild(o.firstChild);var a=t.createDocumentFragment();for(;o.firstChild;)a.appendChild(o.removeChild(o.firstChild));return a},Rt=!1;"undefined"!=typeof document&&((ju=document.createElement("div")).innerHTML='  <link/><table></table><a href="/a">a</a><input type="checkbox"/>',Rt=!ju.getElementsByTagName("link").length,ju=void 0);var Tt={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:Rt?[1,"X<div>","</div>"]:[0,"",""]};function Dt(e,t){return(t=t||document).querySelector(e)}function Mt(e,t){return(t=t||document).querySelectorAll(e)}function Bt(e){e.parentNode&&e.parentNode.removeChild(e)}function It(t){return function(){if(!window.Promise)throw new Error("Promises is not supported in this environment. Please polyfill Promise.");var e=arguments.length;if(!(1<=e&&m(arguments[e-1])))return t.apply(this,arguments);var n=arguments[e-1];console.warn(new Error("Passing callbacks to "+t.name.replace("bound ","")+" is deprecated and will be removed in a future major release. Please switch to promises: https://bpmn.io/l/moving-to-promises.html"));e=Array.prototype.slice.call(arguments,0,-1);t.apply(this,e).then(function(e){var t=Object.keys(e)[0];return n(null,e[t])},function(e){return n(e,e.warnings)})}}function At(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function Nt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?At(Object(n),!0).forEach(function(e){Ft(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):At(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Lt(e){return function(e){if(Array.isArray(e))return Vt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||$t(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $t(e,t){if(e){if("string"==typeof e)return Vt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vt(e,t):void 0}}function Vt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ft(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Tt.td=Tt.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Tt.option=Tt.optgroup=[1,'<select multiple="multiple">',"</select>"],Tt.thead=Tt.tbody=Tt.colgroup=Tt.caption=Tt.tfoot=[1,"<table>","</table>"],Tt.polyline=Tt.ellipse=Tt.polygon=Tt.circle=Tt.text=Tt.line=Tt.path=Tt.rect=Tt.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Ut={width:"100%",height:"100%",position:"relative"},Ht=function(){function n(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),Ft(this,"_viewsChanged",function(){e._emit("views.changed",{views:e._views,activeView:e._activeView})}),this._eventBus=new U,this._viewsChanged=I(this._viewsChanged,0),this._views=[],this._viewers={},this.open=It(this.open.bind(this)),this.importXML=It(this.importXML.bind(this)),this.saveXML=It(this.saveXML.bind(this)),this._init(t)}var e,t,r;return e=n,(t=[{key:"importXML",value:function(r,u){var s=this;return u=u||{open:!0},new Promise(function(i,a){var c=s._activeView;s._clear().then(function(){var o;r=s._emit("import.parse.start",{xml:r})||r,s._moddle.fromXML(r,"dmn:Definitions").then(function(e){var t=e.rootElement,n=e.references,r=e.elementsById;if(o=e.warnings,t=s._emit("import.parse.complete",l({error:null,definitions:t,elementsById:r,references:n,warnings:o}))||t,s._setDefinitions(t),!u.open)return s._emit("import.done",{error:null,warnings:o}),void i({warnings:o});n=s._getInitialView(s._views,c);if(!n){t=new Error("no displayable contents");return s._emit("import.done",{error:t,warnings:o}),t.warnings=o,a(t)}s.open(n).then(function(e){return{warnings:e.warnings}}).catch(function(e){return{error:e,warnings:e.warnings}}).then(function(e){var t=[].concat(o,e.warnings);s._emit("import.done",{error:e.error,warnings:t}),e.error?(e.error.warnings=t,a(e.error)):i({warnings:t})})}).catch(function(e){var t,n;return o=e.warnings,e=function(e,t){if("failed to parse document as <dmn:Definitions>"!==e.message)return null;t=-1!==t.indexOf('"http://www.omg.org/spec/DMN/20151101/dmn.xsd"')?"1.1":-1!==t.indexOf('"http://www.omg.org/spec/DMN/20180521/MODEL/"')&&"1.2";return t?(e=new Error("unsupported DMN "+t+" file detected; only DMN 1.3 files can be opened"),console.error("Cannot open what looks like a DMN "+t+" diagram. Please refer to https://bpmn.io/l/dmn-compatibility.html to learn how to make the toolkit compatible with older DMN files",e),e):null}(e,r)||(t=e,(n=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(t.message))?(t.message="unparsable content <"+n[1]+"> detected; this may indicate an invalid DMN 1.3 diagram file"+n[2],t):null)||e,s._emit("import.parse.complete",l({error:e,warnings:o})),s._emit("import.done",{error:e,warnings:o}),e.warnings=o,a(e)})}).catch(function(e){return s._emit("import.done",{error:e,warnings:[]}),e.warnings=[],a(e)})});function l(e){var t=s._eventBus.createEvent(e);return Object.defineProperty(t,"context",{enumerable:!0,get:function(){return console.warn(new Error("import.parse.complete <context> is deprecated and will be removed in future library versions")),{warnings:e.warnings,references:e.references,elementsById:e.elementsById}}}),t}}},{key:"getDefinitions",value:function(){return this._definitions}},{key:"getActiveView",value:function(){return this._activeView}},{key:"getActiveViewer",value:function(){var e=this.getActiveView();return e&&this._getViewer(e)}},{key:"getView",value:function(t){return this._views.filter(function(e){return e.element===t})[0]}},{key:"getViews",value:function(){return this._views}},{key:"saveXML",value:function(e){var r=this;e=e||{};var o=this._definitions;return new Promise(function(t,n){o?(o=r._emit("saveXML.start",{definitions:o})||o,r._moddle.toXML(o,e).then(function(e){var e=e.xml;return{xml:e=r._emit("saveXML.serialized",{xml:e})||e}}).catch(function(e){return{error:e}}).then(function(e){r._emit("saveXML.done",e),e.error?n(e.error):t({xml:e.xml})})):n(new Error("no definitions loaded"))})}},{key:"on",value:function(){var e;(e=this._eventBus).on.apply(e,arguments)}},{key:"off",value:function(){var e;(e=this._eventBus).off.apply(e,arguments)}},{key:"once",value:function(){var e;(e=this._eventBus).once.apply(e,arguments)}},{key:"attachTo",value:function(e){(e="string"==typeof(e=e.get&&e.constructor.prototype.jquery?e.get(0):e)?Dt(e):e).appendChild(this._container),this._emit("attach",{})}},{key:"detach",value:function(){this._emit("detach",{}),Bt(this._container)}},{key:"destroy",value:function(){var t=this;Object.keys(this._viewers).forEach(function(e){Kt(t._viewers[e],"destroy")}),Bt(this._container)}},{key:"_init",value:function(e){this._options=e,this._moddle=this._createModdle(e),this._viewers={},this._views=[];var t=kt('<div class="dmn-js-parent"></div>'),n=L({},Ut,e);L(t.style,{width:Wt(n.width),height:Wt(n.height),position:n.position}),this._container=t,e.container&&this.attachTo(e.container)}},{key:"_clear",value:function(){return this._switchView(null)}},{key:"open",value:function(e){return this._switchView(e)}},{key:"_setDefinitions",value:function(e){this._definitions=e,this._updateViews()}},{key:"_updateViews",value:function(){var e=this._definitions;if(!e)return this._views=[],void this._switchView(null);var t,n=this._getViewProviders(),r=[e].concat(Lt(e.drgElement||[])),o=this._views,i=[],a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=$t(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,t=function(){};return{s:t,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw o}}}}(r);try{for(a.s();!(t=a.n()).done;){var c,u=t.value,s=b(n,function(e){return"string"==typeof e.opens?e.opens===u.$type:e.opens(u)});s&&(c={element:u,id:u.id,name:u.name,type:s.id},i.push(c))}}catch(e){a.e(e)}finally{a.f()}var l,p=this._activeView;!p||(l=b(i,function(e){return qt(p,e)})||this._getInitialView(i))?(e=!qt(p,l)||Gt(p,l),r=o.length!==i.length||!j(i,function(t){return b(o,function(e){return qt(e,t)&&!Gt(e,t)})}),this._activeView=l,this._views=i,(e||r)&&this._viewsChanged()):this._switchView(null)}},{key:"_getInitialView",value:function(e,t){var n;return(n=t?b(e,function(e){return qt(e,t)})||b(e,function(e){return e.type===t}):n)||e[0]}},{key:"_switchView",value:function(c){var u=this;return new Promise(function(n,r){function t(e,t){u._viewsChanged(),e?r(e):n(t)}var e,o=u.getActiveView(),i=c&&u._getViewer(c),a=c&&c.element;if(o&&(e=u._getViewer(o))!==i&&(Kt(e,"clear"),e.detach()),u._activeView=c,i)return e!==i&&i.attachTo(u._container),u._emit("import.render.start",{view:c,element:a}),void i.open(a).then(function(e){u._emit("import.render.complete",{view:c,error:null,warnings:e.warnings}),t(null,e)}).catch(function(e){u._emit("import.render.complete",{view:c,error:e,warnings:e.warnings}),t(e,null)});t()})}},{key:"_getViewer",value:function(e){var t=e.type,n=this._viewers[t];return n||(n=this._viewers[t]=this._createViewer(e.type),this._emit("viewer.created",{type:t,viewer:n})),n}},{key:"_createViewer",value:function(t){var e=b(this._getViewProviders(),function(e){return e.id===t});if(!e)throw new Error("no provider for view type <"+t+">");var n=e.constructor,e=this._options[t]||{};return new n(Nt(Nt(Nt({},this._options.common||{}),e),{},{additionalModules:[].concat(Lt(e.additionalModules||[]),[{_parent:["value",this],moddle:["value",this._moddle]}])}))}},{key:"_emit",value:function(){var e;return(e=this._eventBus).fire.apply(e,arguments)}},{key:"_createModdle",value:function(e){return new ot(e.moddleExtensions)}},{key:"_getViewProviders",value:function(){return[]}}])&&zt(e.prototype,t),r&&zt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),n}();function Wt(e){return e+(h(e)?"px":"")}function qt(e,t){return f(e)?!!f(t)&&(e.element===t.element||e.id===t.id):!f(t)}function Gt(e,t){return!e||!t||e.name!==t.name}function Kt(e,t){m(e[t])&&e[t]()}var Xt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Yt(e,t){return e(t={exports:{}},t.exports),t.exports}var Zt=Yt(function(e){var c=e.exports=function(e,t){if(t=t||16,(e=void 0===e?128:e)<=0)return"0";for(var n=Math.log(Math.pow(2,e))/Math.log(t),r=2;n===1/0;r*=2)n=Math.log(Math.pow(2,e/r))/Math.log(t)*r;for(var o=n-Math.floor(n),i="",r=0;r<Math.floor(n);r++)i=Math.floor(Math.random()*t).toString(t)+i;o&&(a=Math.pow(t,o),i=Math.floor(Math.random()*a).toString(t)+i);var a=parseInt(i,t);return a!==1/0&&a>=Math.pow(2,e)?c(e,t):i};c.rack=function(r,o,i){function n(e){var t=0;do{if(10<t++){if(!i)throw new Error("too many ID collisions, use more bits");r+=i}var n=c(r,o)}while(Object.hasOwnProperty.call(a,n));return a[n]=e,n}var a=n.hats={};return n.get=function(e){return n.hats[e]},n.set=function(e,t){return n.hats[e]=t,n},n.bits=r||128,n.base=o||16,n}});function Qt(e){if(!(this instanceof Qt))return new Qt(e);this._seed=(e=e||[128,36,1]).length?Zt.rack(e[0],e[1],e[2]):e}var Jt=Qt;function en(e,t){e=rn(e);return e&&"function"==typeof e.$instanceOf&&e.$instanceOf(t)}function tn(e){return en(e,"dmn:InputClause")}function nn(e){return en(e,"dmn:OutputClause")}function rn(e){return e&&e.businessObject||e}function on(t,e){return E(e,function(e){return en(t,e)})}function an(e){return(an="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function cn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function un(){return(un="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=pn(e)););return e}(e,t);if(r){t=Object.getOwnPropertyDescriptor(r,t);return t.get?t.get.call(arguments.length<3?e:n):t.value}}).apply(this,arguments)}function sn(e,t){return(sn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ln(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=pn(n);return function(e,t){{if(t&&("object"===an(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,r?(e=pn(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function pn(e){return(pn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Qt.prototype.next=function(e){return this._seed(e||!0)},Qt.prototype.nextPrefixed=function(e,t){for(var n;n=e+this.next(!0),this.assigned(n););return this.claim(n,t),n},Qt.prototype.claim=function(e,t){this._seed.set(e,t||!0)},Qt.prototype.assigned=function(e){return this._seed.get(e)||!1},Qt.prototype.unclaim=function(e){delete this._seed.hats[e]},Qt.prototype.clear=function(){for(var e in this._seed.hats)this.unclaim(e)};var fn=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sn(e,t)}(o,Ht);var e,t,n,r=ln(o);function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),r.apply(this,arguments)}return e=o,(t=[{key:"_init",value:function(e){var t=this;un(pn(o.prototype),"_init",this).call(this,e),this.on("import.parse.complete",function(e){e.error||t._collectIds(e.definitions,e.elementsById)}),this.on("destroy",function(){t._moddle.ids.clear()}),this.on("viewer.created",function(e){e.viewer.on("elements.changed",function(e){e.elements.some(function(e){return on(e,["dmn:Decision","dmn:Definitions"])})&&t._updateViews()})})}},{key:"_collectIds",value:function(e,t){var n,r=e.$model.ids;for(n in r.clear(),t)r.claim(n,t[n])}},{key:"_createModdle",value:function(e){e=un(pn(o.prototype),"_createModdle",this).call(this,e);return e.ids=new Jt([32,36,1]),e}}])&&cn(e.prototype,t),n&&cn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(),dn=Yt(function(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;function n(){}n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),hn=/^class /;function yn(e){return"[object Array]"===Object.prototype.toString.call(e)}function mn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function vn(){var e=Array.prototype.slice.call(arguments),t=(e=1===e.length&&yn(e[0])?e[0]:e).pop();return t.$inject=e,t}var gn=/constructor\s*[^(]*\(\s*([^)]*)\)/m,bn=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,_n=/\/\*([^*]*)\*\//m;function wn(e){if("function"!=typeof e)throw new Error('Cannot annotate "'+e+'". Expected a function!');e=e.toString().match(hn.test(e.toString())?gn:bn);if(!e)return[];e=e[1]||e[2];return e&&e.split(",").map(function(e){var t=e.match(_n);return(t&&t[1]||e).trim()})||[]}function xn(e,o){o=o||{get:function(e,t){if(i.push(e),!1===t)return null;throw c('No provider for "'+e+'"!')}};var i=[],f=this._providers=Object.create(o._providers||null),a=this._instances=Object.create(null),d=a.injector=this,c=function(e){var t=i.join(" -> ");return i.length=0,new Error(t?e+" (Resolving: "+t+")":e)};function u(e,t){if(!f[e]&&-1!==e.indexOf(".")){for(var n=e.split("."),r=u(n.shift());n.length;)r=r[n.shift()];return r}if(mn(a,e))return a[e];if(mn(f,e)){if(-1!==i.indexOf(e))throw i.push(e),c("Cannot resolve circular dependency!");return i.push(e),a[e]=f[e][0](f[e][1]),i.pop(),a[e]}return o.get(e,t)}function r(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!yn(e))throw new Error('Cannot invoke "'+e+'". Expected a function!');e=vn(e.slice())}return{fn:e,dependencies:(e.$inject||wn(e)).map(function(e){return mn(t,e)?t[e]:u(e)})}}function t(e){var t=r(e),e=t.fn,t=t.dependencies;return new(Function.prototype.bind.apply(e,[null].concat(t)))}function n(e,t,n){e=r(e,n),n=e.fn,e=e.dependencies;return n.apply(t,e)}function s(e,t){if(t&&t.length){var n,r,o,i,a,c=Object.create(null),u=Object.create(null),s=[],l=[],p=[];for(a in f)n=f[a],-1!==t.indexOf(a)&&("private"===n[2]?-1===(r=s.indexOf(n[3]))?(i=function(t){return vn(function(e){return t.get(e)})}(o=n[3].createChild([],t)),s.push(n[3]),l.push(o),p.push(i),c[a]=[i,a,"private",o]):c[a]=[p[r],a,"private",l[r]]:c[a]=[n[2],n[1]],u[a]=!0),"factory"!==n[2]&&"type"!==n[2]||!n[1].$scope||t.forEach(function(e){-1!==n[1].$scope.indexOf(e)&&(c[a]=[n[2],n[1]],u[e]=!0)});t.forEach(function(e){if(!u[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')}),e.unshift(c)}return new xn(e,d)}var l,p,h={factory:n,type:t,value:function(e){return e}};function y(e,t){var n=e.__init__||[];return function(){n.forEach(function(e){try{"string"==typeof e?t.get(e):t.invoke(e)}catch(e){if("undefined"!=typeof AggregateError)throw new AggregateError([e],"Failed to initialize!");throw new Error("Failed to initialize! "+e.message)}})}}function m(r){var e=r.__exports__;if(e){var t=r.__modules__,n=Object.keys(r).reduce(function(e,t){return"__exports__"!==t&&"__modules__"!==t&&"__init__"!==t&&"__depends__"!==t&&(e[t]=r[t]),e},Object.create(null)),o=s((t||[]).concat(n)),i=vn(function(e){return o.get(e)});e.forEach(function(e){f[e]=[i,e,"private",o]});e=(r.__init__||[]).slice();return e.unshift(function(){o.init()}),y(r=Object.assign({},r,{__init__:e}),o)}return Object.keys(r).forEach(function(e){var t,n;"__init__"!==e&&"__depends__"!==e&&("private"!==r[e][2]?(t=r[e][0],n=r[e][1],f[e]=[h[t],function(e,t){"value"!==e&&yn(t)&&(t=vn(t.slice()));return t}(t,n),t]):f[e]=r[e])}),y(r,d)}function v(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(v,e)).indexOf(t)?e:e.concat(t)}this.get=u,this.invoke=n,this.instantiate=t,this.createChild=s,this.init=(l=e.reduce(v,[]).map(m),p=!1,function(){p||(p=!0,l.forEach(function(e){return e()}))})}function On(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function jn(e,t){var o=this;e.on(["render.shape","render.connection"],t=t||1e3,function(e,t){var n=e.type,r=t.element,e=t.gfx,t=t.attrs;if(o.canRender(r))return"render.shape"===n?o.drawShape(e,r,t):o.drawConnection(e,r,t)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(e,t){if(o.canRender(t))return"render.getShapePath"===e.type?o.getShapePath(t):o.getConnectionPath(t)})}function En(e,t){return t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}function Cn(e,t){return En(t,e),e}jn.prototype.canRender=function(){},jn.prototype.drawShape=function(){},jn.prototype.drawConnection=function(){},jn.prototype.getShapePath=function(){},jn.prototype.getConnectionPath=function(){};var Sn=2,Pn={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":Sn,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":Sn,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function kn(e,t,n){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),o=Pn[r];o?(o===Sn&&"number"==typeof n&&(n=String(n)+"px"),e.style[r]=n):e.setAttributeNS(null,t,n)}function Rn(e,t,n){if("string"==typeof t){if(void 0===n)return r=e,Pn[o=t]?r.style[o]:r.getAttributeNS(null,o);kn(e,t,n)}else!function(e,t){for(var n,r=Object.keys(t),o=0;n=r[o];o++)kn(e,n,t[n])}(e,t);var r,o;return e}function Tn(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}var Dn=/\s+/,Mn=Object.prototype.toString;function Bn(e){return void 0!==e}function In(e){return new An(e)}function An(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Nn(e){var t=e.parentNode;return t&&t.removeChild(e),e}function Ln(e){for(var t;t=e.firstChild;)Nn(t);return e}function $n(e){return e.cloneNode(!0)}An.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~Tn(t,e)||t.push(e),Bn(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" "),this},An.prototype.remove=function(e){if("[object RegExp]"===Mn.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),e=Tn(t,e);return~e&&t.splice(e,1),this.el.className.baseVal=t.join(" "),this},An.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},An.prototype.toggle=function(e,t){return this.list?Bn(t)&&t===this.list.toggle(e,t)||this.list.toggle(e):Bn(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this},An.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(Dn);return""===e[0]&&e.shift(),e},An.prototype.has=An.prototype.contains=function(e){return this.list?this.list.contains(e):!!~Tn(this.array(),e)};var Vn={svg:"http://www.w3.org/2000/svg"},zn='<svg xmlns="'+Vn.svg+'"';function Fn(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(Vn.svg)&&(e=zn+e.substring(4)):(e=zn+">"+e+"</svg>",t=!0);var n=(n=e,(e=new DOMParser).async=!1,e.parseFromString(n,"text/xml"));if(!t)return n;for(var r=document.createDocumentFragment(),o=n.firstChild;o.firstChild;)r.appendChild(o.firstChild);return r}function Un(e,t){var n="<"===e.charAt(0)?(n=Fn(e).firstChild,document.importNode(n,!0)):document.createElementNS(Vn.svg,e);return t&&Rn(n,t),n}var Hn=Un("svg");function Wn(e,t){for(var n,r=Object.keys(t),o=0;n=r[o];o++)e[n]=t[n];return e}function qn(e){return e?Hn.createSVGTransformFromMatrix(e):Hn.createSVGTransform()}var Gn=/([&<>]{1})/g,Kn=/([\n\r"]{1})/g,Xn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function Yn(e,t){return e.replace(t,function(e,t){return Xn[t]||t})}function Zn(e,t){var n=Fn(t);if(Ln(e),t){"#document-fragment"!==n.nodeName&&(n=n.documentElement);for(var r=(n=n.childNodes,Array.prototype.slice.call(n)),o=0;o<r.length;o++)En(r[o],e)}}function Qn(e){for(var t=e.firstChild,n=[];t;)!function e(t,n){var r,o,i,a,c;switch(t.nodeType){case 3:n.push(Yn(t.textContent,Gn));break;case 1:if(n.push("<",t.tagName),t.hasAttributes())for(r=0,o=(i=t.attributes).length;r<o;++r)a=i.item(r),n.push(" ",a.name,'="',Yn(a.value,Kn),'"');if(t.hasChildNodes()){for(n.push(">"),r=0,o=(c=t.childNodes).length;r<o;++r)e(c.item(r),n);n.push("</",t.tagName,">")}else n.push("/>");break;case 8:n.push("\x3c!--",Yn(t.nodeValue,Gn),"--\x3e");break;case 4:n.push("<![CDATA[",t.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+t.nodeType)}return n}(t,n),t=t.nextSibling;return n.join("")}function Jn(e,t){var n,r,o;for(e.clear(),n=0;o=t[n];n++)e.appendItem((r=e,(o=o)instanceof SVGMatrix?r.createSVGTransformFromMatrix(o):o))}function er(e,t){e=e.transform.baseVal;return t&&Jn(e,t=!Array.isArray(t)?[t]:t),e.consolidate()}function tr(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")}function nr(e){for(var t,n="",r=0;t=e[r];r++)n+=t.x+","+t.y+" ";return n}function rr(e,t){var n=Un("polyline");return Rn(n,{points:nr(e)}),t&&Rn(n,t),n}function or(e){return w(e,function(t){return!b(e,function(e){return e!==t&&function e(t,n){if(!n)return;if(t===n)return n;if(!t.parent)return;return e(t.parent,n)}(t,e)})})}function ir(e,t,n){n=!n||-1===e.indexOf(t);return n&&e.push(t),n}function ar(e,n,r){r=r||0,x(e=!y(e)?[e]:e,function(e,t){t=n(e,t,r);y(t)&&t.length&&ar(t,n,r+1)})}function cr(e,t){return r=!t,o=-1,i=[],a=[],ar(e,function(e,t,n){ir(i,e,r);e=e.children;if((-1===o||n<o)&&e&&ir(a,e,r))return e}),i;var r,o,i,a}function ur(e,t,n){_(t=l(t)?!0:t)&&(n=t,t=!0);var r=fr((n=n||{}).allShapes),o=fr(n.allConnections),i=fr(n.enclosedElements),a=fr(n.enclosedConnections),c=fr(n.topLevel,t&&R(e,function(e){return e.id}));function u(e){c[e.source.id]&&c[e.target.id]&&(c[e.id]=[e]),r[e.source.id]&&r[e.target.id]&&(a[e.id]=i[e.id]=e),o[e.id]=e}return ar(e,function(e){if(!(i[e.id]=e).waypoints)return x((r[e.id]=e).incoming,u),x(e.outgoing,u),e.children;a[e.id]=o[e.id]=e}),{allShapes:r,allConnections:o,topLevel:c,enclosedConnections:a,enclosedElements:i}}function sr(e,o){var i,a,c,u;return o=!!o,x(e=!y(e)?[e]:e,function(e){var t=e,n=(t=e.waypoints&&!o?sr(e.waypoints,!0):t).x,r=t.y,e=t.height||0,t=t.width||0;(n<i||void 0===i)&&(i=n),(r<a||void 0===a)&&(a=r),(c<n+t||void 0===c)&&(c=n+t),(u<r+e||void 0===u)&&(u=r+e)}),{x:i,y:a,height:u-a,width:c-i}}function lr(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function pr(e){return!(!e||!e.isFrame)}function fr(e,t){return L({},e||{},t||{})}function dr(e,t){jn.call(this,e,1),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}On(dr,jn),dr.prototype.canRender=function(){return!0},dr.prototype.drawShape=function(e,t,n){var r=Un("rect");return Rn(r,{x:0,y:0,width:t.width||0,height:t.height||0}),pr(t)?Rn(r,L({},this.FRAME_STYLE,n||{})):Rn(r,L({},this.SHAPE_STYLE,n||{})),Cn(e,r),r},dr.prototype.drawConnection=function(e,t,n){n=rr(t.waypoints,L({},this.CONNECTION_STYLE,n||{}));return Cn(e,n),n},dr.prototype.getShapePath=function(e){var t=e.x,n=e.y,r=e.width;return tr([["M",t,n],["l",r,0],["l",0,e.height],["l",-r,0],["z"]])},dr.prototype.getConnectionPath=function(e){for(var t,n=e.waypoints,r=[],o=0;t=n[o];o++)t=t.original||t,r.push([0===o?"M":"L",t.x,t.y]);return tr(r)},dr.$inject=["eventBus","styles"];var hr={__init__:["defaultRenderer"],defaultRenderer:["type",dr],styles:["type",function(){var n={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},r=this;this.cls=function(e,t,n){return L(this.style(t,n),{class:e})},this.style=function(e,t){y(e)||t||(t=e,e=[]);e=O(e,function(e,t){return L(e,n[t]||{})},{});return t?L(e,t):e},this.computeStyle=function(e,t,n){return y(t)||(n=t,t=[]),r.style(t||[],L({},n,e||{}))}}]};function yr(e,t){if(!e||!t)return-1;t=e.indexOf(t);return-1!==t&&e.splice(t,1),t}function mr(e,t,n){if(e&&t){"number"!=typeof n&&(n=-1);var r=e.indexOf(t);if(-1!==r){if(r===n)return;if(-1===n)return;e.splice(r,1)}-1!==n?e.splice(n,0,t):e.push(t)}}function vr(e,t){return e&&t?e.indexOf(t):-1}function gr(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function br(e,t,n,r){if(void 0===r&&(r=5),e&&t&&n){n=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),t=gr(e,t);return Math.abs(n/t)<=r}}var _r=2;function wr(e,t){t=y(e)?e:[e,t];return function(e,t){t=y(e)?e:[e,t];var n=t.slice().shift();return j(t,function(e){return Math.abs(n.y-e.y)<=_r})}(t)?"h":!!function(e,t){t=y(e)?e:[e,t];var n=t.slice().shift();return j(t,function(e){return Math.abs(n.x-e.x)<=_r})}(t)&&"v"}function xr(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}
3/**
4   * This file contains source code adapted from Snap.svg (licensed Apache-2.0).
5   *
6   * @see https://github.com/adobe-webplatform/Snap.svg/blob/master/src/path.js
7   */var Or=/,?([a-z]),?/gi,jr=parseFloat,Er=Math,Cr=Er.PI,Sr=Er.min,Pr=Er.max,kr=Er.pow,Rr=Er.abs,Tr=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/gi,Dr=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/gi,Mr=Array.isArray||function(e){return e instanceof Array};function Br(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ir(e){if("function"==typeof e||Object(e)!==e)return e;var t,n=new e.constructor;for(t in e)Br(e,t)&&(n[t]=Ir(e[t]));return n}function Ar(o){function i(){var e=Array.prototype.slice.call(arguments,0),t=e.join("␀"),n=i.cache=i.cache||{},r=i.count=i.count||[];return Br(n,t)?function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return e.push(e.splice(n,1)[0])}(r,t):(1e3<=r.length&&delete n[r.shift()],r.push(t),n[t]=o.apply(0,e)),n[t]}return i}function Nr(t){var n=Nr.ps=Nr.ps||{};return n[t]?n[t].sleep=100:n[t]={sleep:100},setTimeout(function(){for(var e in n)Br(n,e)&&e!=t&&(n[e].sleep--,n[e].sleep||delete n[e])}),n[t]}function Lr(e,t,n,r){return 1===arguments.length&&(t=e.y,n=e.width,r=e.height,e=e.x),{x:e,y:t,width:n,height:r,x2:e+n,y2:t+r}}function $r(){return this.join(",").replace(Or,"$1")}function Vr(e){e=Ir(e);return e.toString=$r,e}function zr(e,t,n,r,o,i,a,c,u){var s=1-u,l=kr(s,3),p=kr(s,2),f=u*u*u,c=l*t+3*p*u*r+3*s*u*u*i+f*c;return{x:qr(l*e+3*p*u*n+3*s*u*u*o+f*a),y:qr(c)}}function Fr(e){e=function(e,t,n,r,o,i,a,c){for(var u,s,l,p,f,d=[],h=[[],[]],y=0;y<2;++y)f=0==y?(s=6*e-12*n+6*o,u=-3*e+9*n-9*o+3*a,3*n-3*e):(s=6*t-12*r+6*i,u=-3*t+9*r-9*i+3*c,3*r-3*t),Rr(u)<1e-12?Rr(s)<1e-12||0<(l=-f/s)&&l<1&&d.push(l):(p=s*s-4*f*u,f=Er.sqrt(p),p<0||(0<(p=(-s+f)/(2*u))&&p<1&&d.push(p),0<(f=(-s-f)/(2*u))&&f<1&&d.push(f)));var m,v=d.length,g=v;for(;v--;)l=d[v],m=1-l,h[0][v]=m*m*m*e+3*m*m*l*n+3*m*l*l*o+l*l*l*a,h[1][v]=m*m*m*t+3*m*m*l*r+3*m*l*l*i+l*l*l*c;return h[0][g]=e,h[1][g]=t,h[0][g+1]=a,h[1][g+1]=c,h[0].length=h[1].length=g+2,{x0:Sr.apply(0,h[0]),y0:Sr.apply(0,h[1]),x1:Pr.apply(0,h[0]),y1:Pr.apply(0,h[1])}}.apply(null,e);return Lr(e.x0,e.y0,e.x1-e.x0,e.y1-e.y0)}function Ur(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Hr(e,t,n,r,o){return e*(e*(-3*t+9*n-9*r+3*o)+6*t-12*n+6*r)-3*t+3*n}function Wr(e,t,n,r,o,i,a,c,u){for(var s=(u=1<(u=null==u?1:u)?1:u<0?0:u)/2,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],p=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],f=0,d=0;d<12;d++){var h=s*l[d]+s,y=Hr(h,e,n,o,a),h=Hr(h,t,r,i,c);f+=p[d]*Er.sqrt(y*y+h*h)}return s*f}function qr(e){return Math.round(1e11*e)/1e11}function Gr(e,t,n){var r=Fr(e),o=Fr(t);if(o=o,r=Lr(r=r),!(Ur(o=Lr(o),r.x,r.y)||Ur(o,r.x2,r.y)||Ur(o,r.x,r.y2)||Ur(o,r.x2,r.y2)||Ur(r,o.x,o.y)||Ur(r,o.x2,o.y)||Ur(r,o.x,o.y2)||Ur(r,o.x2,o.y2)||(r.x<o.x2&&r.x>o.x||o.x<r.x2&&o.x>r.x)&&(r.y<o.y2&&r.y>o.y||o.y<r.y2&&o.y>r.y)))return n?0:[];for(var o=Wr.apply(0,e),r=Wr.apply(0,t),i=!Xr(e)&&~~(o/5)||1,a=!Xr(t)&&~~(r/5)||1,c=[],u=[],s={},l=n?0:[],p=0;p<i+1;p++){var f=zr.apply(0,e.concat(p/i));c.push({x:f.x,y:f.y,t:p/i})}for(p=0;p<a+1;p++)f=zr.apply(0,t.concat(p/a)),u.push({x:f.x,y:f.y,t:p/a});for(p=0;p<i;p++)for(var d=0;d<a;d++){var h,y=c[p],m=c[p+1],v=u[d],g=u[d+1],b=Rr(m.x-y.x)<.01?"y":"x",_=Rr(g.x-v.x)<.01?"y":"x",w=function(e,t,n,r,o,i,a,c){if(!(Pr(e,n)<Sr(o,a)||Sr(e,n)>Pr(o,a)||Pr(t,r)<Sr(i,c)||Sr(t,r)>Pr(i,c))){var u=(e*r-t*n)*(o-a)-(e-n)*(o*c-i*a),s=(e*r-t*n)*(i-c)-(t-r)*(o*c-i*a),l=(e-n)*(i-c)-(t-r)*(o-a);if(l){var p=qr(u/l),u=qr(s/l),s=+p.toFixed(2),l=+u.toFixed(2);if(!(s<+Sr(e,n).toFixed(2)||s>+Pr(e,n).toFixed(2)||s<+Sr(o,a).toFixed(2)||s>+Pr(o,a).toFixed(2)||l<+Sr(t,r).toFixed(2)||l>+Pr(t,r).toFixed(2)||l<+Sr(i,c).toFixed(2)||l>+Pr(i,c).toFixed(2)))return{x:p,y:u}}}}(y.x,y.y,m.x,m.y,v.x,v.y,g.x,g.y);w&&(s[h=w.x.toFixed(9)+"#"+w.y.toFixed(9)]||(s[h]=!0,y=y.t+Rr((w[b]-y[b])/(m[b]-y[b]))*(m.t-y.t),v=v.t+Rr((w[_]-v[_])/(g[_]-v[_]))*(g.t-v.t),0<=y&&y<=1&&0<=v&&v<=1&&(n?l++:l.push({x:w.x,y:w.y,t1:y,t2:v}))))}return l}function Kr(e){var t=Nr(e);if(t.abs)return Vr(t.abs);if(!(e=!Mr(e)||!Mr(e&&e[0])?function(e){if(!e)return null;var t=Nr(e);if(t.arr)return Ir(t.arr);var i={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},a=[];return(a=Mr(e)&&Mr(e[0])?Ir(e):a).length||String(e).replace(Tr,function(e,t,n){var r=[],o=t.toLowerCase();for(n.replace(Dr,function(e,t){t&&r.push(+t)}),"m"==o&&2<r.length&&(a.push([t].concat(r.splice(0,2))),o="l",t="m"==t?"l":"L");r.length>=i[o]&&(a.push([t].concat(r.splice(0,i[o]))),i[o]););}),a.toString=Nr.toString,t.arr=Ir(a),a}(e):e)||!e.length)return[["M",0,0]];var n,r=[],o=0,i=0,a=0,c=0,u=0;"M"==e[0][0]&&(a=o=+e[0][1],c=i=+e[0][2],u++,r[0]=["M",o,i]);for(var s,l,p=u,f=e.length;p<f;p++){if(r.push(s=[]),(n=(l=e[p])[0])!=n.toUpperCase())switch(s[0]=n.toUpperCase(),s[0]){case"A":s[1]=l[1],s[2]=l[2],s[3]=l[3],s[4]=l[4],s[5]=l[5],s[6]=+l[6]+o,s[7]=+l[7]+i;break;case"V":s[1]=+l[1]+i;break;case"H":s[1]=+l[1]+o;break;case"M":a=+l[1]+o,c=+l[2]+i;default:for(var d=1,h=l.length;d<h;d++)s[d]=+l[d]+(d%2?o:i)}else for(var y=0,m=l.length;y<m;y++)s[y]=l[y];switch(n=n.toUpperCase(),s[0]){case"Z":o=+a,i=+c;break;case"H":o=s[1];break;case"V":i=s[1];break;case"M":a=s[s.length-2],c=s[s.length-1];default:o=s[s.length-2],i=s[s.length-1]}}return r.toString=$r,t.abs=Vr(r),r}function Xr(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function Yr(e,t,n,r){return[e,t,n,r,n,r]}function Zr(e,t,n,r,o,i){return[1/3*e+2/3*n,1/3*t+2/3*r,1/3*o+2/3*n,1/3*i+2/3*r,o,i]}function Qr(e,t,n,r,o,i,a,c,u,s){var l,p,f,d=120*Cr/180,h=Cr/180*(+o||0),y=[],m=Ar(function(e,t,n){return{x:e*Er.cos(n)-t*Er.sin(n),y:e*Er.sin(n)+t*Er.cos(n)}});s?(_=s[0],w=s[1],g=s[2],b=s[3]):(e=(p=m(e,t,-h)).x,t=p.y,1<(v=(f=(e-(c=(p=m(c,u,-h)).x))/2)*f/(n*n)+(l=(t-(u=p.y))/2)*l/(r*r))&&(n*=v=Er.sqrt(v),r*=v),g=(p=(i==a?-1:1)*Er.sqrt(Rr(((p=n*n)*(v=r*r)-p*l*l-v*f*f)/(p*l*l+v*f*f))))*n*l/r+(e+c)/2,_=Er.asin(((t-(b=p*-r*f/n+(t+u)/2))/r).toFixed(9)),w=Er.asin(((u-b)/r).toFixed(9)),(_=e<g?Cr-_:_)<0&&(_=2*Cr+_),(w=c<g?Cr-w:w)<0&&(w=2*Cr+w),a&&w<_&&(_-=2*Cr),!a&&_<w&&(w-=2*Cr)),Rr(v=w-_)>d&&(l=w,p=c,f=u,y=Qr(c=g+n*Er.cos(w=_+d*(a&&_<w?1:-1)),u=b+r*Er.sin(w),n,r,o,0,a,p,f,[w,l,g,b]));var v=w-_,g=Er.cos(_),b=Er.sin(_),_=Er.cos(w),w=Er.sin(w),v=Er.tan(v/4),n=4/3*n*v,r=4/3*r*v,v=[e,t],g=[e+n*b,t-r*g],_=[c+n*w,u-r*_],u=[c,u];if(g[0]=2*v[0]-g[0],g[1]=2*v[1]-g[1],s)return[g,_,u].concat(y);for(var x=[],O=0,j=(y=[g,_,u].concat(y).join().split(",")).length;O<j;O++)x[O]=O%2?m(y[O-1],y[O],h).y:m(y[O],y[O+1],h).x;return x}function Jr(e){var t=Nr(e);if(t.curve)return Vr(t.curve);for(var r=Kr(e),n={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o=[],i="",a="",c=0,u=r.length;c<u;c++){"C"!=(i=r[c]?r[c][0]:i)&&(o[c]=i,c&&(a=o[c-1])),r[c]=function(e,t,n){var r,o;if(!e)return["C",t.x,t.y,t.x,t.y,t.x,t.y];switch(e[0]in{T:1,Q:1}||(t.qx=t.qy=null),e[0]){case"M":t.X=e[1],t.Y=e[2];break;case"A":e=["C"].concat(Qr.apply(0,[t.x,t.y].concat(e.slice(1))));break;case"S":o="C"==n||"S"==n?(r=2*t.x-t.bx,2*t.y-t.by):(r=t.x,t.y),e=["C",r,o].concat(e.slice(1));break;case"T":"Q"==n||"T"==n?(t.qx=2*t.x-t.qx,t.qy=2*t.y-t.qy):(t.qx=t.x,t.qy=t.y),e=["C"].concat(Zr(t.x,t.y,t.qx,t.qy,e[1],e[2]));break;case"Q":t.qx=e[1],t.qy=e[2],e=["C"].concat(Zr(t.x,t.y,e[1],e[2],e[3],e[4]));break;case"L":e=["C"].concat(Yr(t.x,t.y,e[1],e[2]));break;case"H":e=["C"].concat(Yr(t.x,t.y,e[1],t.y));break;case"V":e=["C"].concat(Yr(t.x,t.y,t.x,e[1]));break;case"Z":e=["C"].concat(Yr(t.x,t.y,t.X,t.Y))}return e}(r[c],n,a),"A"!=o[c]&&"C"==i&&(o[c]="C"),function(e,t){if(7<e[t].length){e[t].shift();for(var n=e[t];n.length;)o[t]="A",e.splice(t++,0,["C"].concat(n.splice(0,6)));e.splice(t,1),u=r.length}}(r,c);var s=r[c],l=s.length;n.x=s[l-2],n.y=s[l-1],n.bx=jr(s[l-4])||n.x,n.by=jr(s[l-3])||n.y}return t.curve=Vr(r),r}var eo=function(e,t,n){e=Jr(e),t=Jr(t);for(var r,o,i,a,c,u,s,l,p=n?0:[],f=0,d=e.length;f<d;f++){var h=e[f];if("M"==h[0])r=i=h[1],y=a=h[2];else for(var y="C"==h[0]?(r=(s=[r,y].concat(h.slice(1)))[6],s[7]):(s=[r,y,r,y,i,a,i,a],r=i,a),m=0,v=t.length;m<v;m++){var g=t[m];if("M"==g[0])o=c=g[1],b=u=g[2];else{var b="C"==g[0]?(o=(l=[o,b].concat(g.slice(1)))[6],l[7]):(l=[o,b,o,b,c,u,c,u],o=c,u),_=Gr(s,l,n);if(n)p+=_;else{for(var w=0,x=_.length;w<x;w++)_[w].segment1=f,_[w].segment2=m,_[w].bez1=s,_[w].bez2=l;p=p.concat(_)}}}}return p};function to(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function no(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function ro(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function oo(e){for(var a=e.waypoints,t=a.reduce(function(e,t,n){var r,o,i=a[n-1];return i&&(r=(o=e[e.length-1])&&o.endLength||0,n=i,o=t,o=Math.sqrt(Math.pow(n.x-o.x,2)+Math.pow(n.y-o.y,2)),e.push({start:i,end:t,startLength:r,endLength:r+o,length:o})),e},[]),n=t.reduce(function(e,t){return e+t.length},0)/2,r=0,o=t[r];o.endLength<n;)o=t[++r];e=(n-o.startLength)/o.length;return{x:o.start.x+(o.end.x-o.start.x)*e,y:o.start.y+(o.end.y-o.start.y)*e}}function io(e){return e.waypoints?oo(e):to({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function ao(e,t,n){_(n=n||0)||(n={x:n,y:n});var r=no(e),o=no(t),i=r.bottom+n.y<=o.top,e=r.left-n.x>=o.right,t=r.top-n.y>=o.bottom,t=i?"top":t?"bottom":null,e=r.right+n.x<=o.left?"left":e?"right":null;return e&&t?t+"-"+e:e||t||"intersect"}function co(e,t,n){t=eo(e,t);return 1===t.length||2===t.length&&gr(t[0],t[1])<1?to(t[0]):1<t.length?to((t=T(t,function(e){var t=Math.floor(100*e.t2)||1;return e.segment2+"#"+(t=((t=100-t)<10?"0":"")+t)}))[n?0:t.length-1]):null}function uo(e,t){return Math.round(e*t)/t}function so(e){return h(e)?e+"px":e}function lo(e,t,n){var r=Un("g");In(r).add(t);n=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(r,e.childNodes[n]||null),r}var po={shape:["x","y","width","height"],connection:["waypoints"]};function fo(e,t,n,r){this._eventBus=t,this._elementRegistry=r,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._init(e||{})}function ho(e,t){t="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",t)}fo.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],fo.prototype._init=function(e){var t,n,r=this._eventBus,o=this._container=(n=(t=L({},{width:"100%",height:"100%"},t=e)).container||document.body,(o=document.createElement("div")).setAttribute("class","djs-container"),lt(o,{position:"relative",overflow:"hidden",width:so(t.width),height:so(t.height)}),n.appendChild(o),o),i=this._svg=Un("svg");Rn(i,{width:"100%",height:"100%"}),Cn(o,i);var a=this._viewport=lo(i,"viewport");!1!==e.deferUpdate&&(this._viewboxChanged=I(A(this._viewboxChanged,this),300)),r.on("diagram.init",function(){r.fire("canvas.init",{svg:i,viewport:a})},this),r.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],function(){delete this._cachedViewbox},this),r.on("diagram.destroy",500,this._destroy,this),r.on("diagram.clear",500,this._clear,this)},fo.prototype._destroy=function(e){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});var t=this._container.parentNode;t&&t.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},fo.prototype._clear=function(){var n=this;this._elementRegistry.getAll().forEach(function(e){var t=lr(e);"root"===t?n.removeRootElement(e):n._removeElement(e,t)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox},fo.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},fo.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");var n=(n=this._layers[e])||(this._layers[e]=this._createLayer(e,t));if(void 0!==t&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},fo.prototype._getChildIndex=function(n){return O(this._layers,function(e,t){return t.visible&&n>=t.index&&e++,e},0)},fo.prototype._createLayer=function(e,t){var n=this._getChildIndex(t=void 0===t?1:t);return{group:lo(this._viewport,"layer-"+e,n),index:t,visible:!0}},fo.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");var t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");var n=this._viewport,r=t.group,e=t.index;if(t.visible)return r;e=this._getChildIndex(e);return n.insertBefore(r,n.childNodes[e]||null),t.visible=!0,r},fo.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");var t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");e=t.group;return t.visible&&(Nn(e),t.visible=!1),e},fo.prototype._removeLayer=function(e){var t=this._layers[e];t&&(delete this._layers[e],Nn(t.group))},fo.prototype.getActiveLayer=function(){var e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},fo.prototype.findRoot=function(e){if(e="string"==typeof e?this._elementRegistry.get(e):e)return(this._findPlaneForRoot(function(e){for(;e.parent;)e=e.parent;return e}(e))||{}).rootElement},fo.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})},fo.prototype._findPlaneForRoot=function(t){return b(this._planes,function(e){return e.rootElement===t})},fo.prototype.getContainer=function(){return this._container},fo.prototype._updateMarker=function(e,t,n){var r;e.id||(e=this._elementRegistry.get(e)),(r=this._elementRegistry._elements[e.id])&&(x([r.gfx,r.secondaryGfx],function(e){e&&(n?In(e).add(t):In(e).remove(t))}),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))},fo.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},fo.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},fo.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),In(this.getGraphics(e)).has(t)},fo.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},fo.prototype.getRootElement=function(){var e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},fo.prototype.addRootElement=function(e){var t=this._rootsIdx++,n=(e=e||{id:"__implicitroot_"+t,children:[],isImplicit:!0}).layer="root-"+t;this._ensureValid("root",e);t=this.getLayer(n,0);return this.hideLayer(n),this._addRoot(e,t),this._planes.push({rootElement:e,layer:t}),e},fo.prototype.removeRootElement=function(t){if("string"==typeof t&&(t=this._elementRegistry.get(t)),this._findPlaneForRoot(t))return this._removeRoot(t),this._removeLayer(t.layer),this._planes=this._planes.filter(function(e){return e.rootElement!==t}),this._rootElement===t&&(this._rootElement=null),t},fo.prototype.setRootElement=function(e,t){if(f(t))throw new Error("override not supported");if(e!==this._rootElement){if(!e)throw new Error("rootElement required");return this._findPlaneForRoot(e)||(e=this.addRootElement(e)),this._setRoot(e),e}},fo.prototype._removeRoot=function(e){var t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)},fo.prototype._addRoot=function(e,t){var n=this._elementRegistry,r=this._eventBus;r.fire("root.add",{element:e}),n.add(e,t),r.fire("root.added",{element:e,gfx:t})},fo.prototype._setRoot=function(e,t){var n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t=t||this._findPlaneForRoot(e).layer,this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})},fo.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");var n=po[e];if(!j(n,function(e){return void 0!==t[e]}))throw new Error("must supply { "+n.join(", ")+" } with "+e)},fo.prototype._setParent=function(e,t,n){mr(t.children,e,n),e.parent=t},fo.prototype._addElement=function(e,t,n,r){n=n||this.getRootElement();var o=this._eventBus,i=this._graphicsFactory;this._ensureValid(e,t),o.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,r);r=i.create(e,t,r);return this._elementRegistry.add(t,r),i.update(e,t,r),o.fire(e+".added",{element:t,gfx:r}),t},fo.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},fo.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},fo.prototype._removeElement=function(e,t){var n=this._elementRegistry,r=this._graphicsFactory,o=this._eventBus;if(e=n.get(e.id||e))return o.fire(t+".remove",{element:e}),r.remove(e),yr(e.parent&&e.parent.children,e),e.parent=null,o.fire(t+".removed",{element:e}),n.remove(e),e},fo.prototype.removeShape=function(e){return this._removeElement(e,"shape")},fo.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},fo.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},fo.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},fo.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},fo.prototype.viewbox=function(t){if(void 0===t&&this._cachedViewbox)return this._cachedViewbox;var e,n,r,o,i=this._viewport,a=this.getSize();return t?(this._changeViewbox(function(){n=Math.min(a.width/t.width,a.height/t.height);var e=this._svg.createSVGMatrix().scale(n).translate(-t.x,-t.y);er(i,e)}),t):(e=(o=this._rootElement?this.getActiveLayer():null)&&o.getBBox()||{},o=(r=er(i))?r.matrix:function(e,t,n,r,o,i){var a=Hn.createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return Wn(a,e);case 6:return Wn(a,{a:e,b:t,c:n,d:r,e:o,f:i})}}(),n=uo(o.a,1e3),r=uo(-o.e||0,1e3),o=uo(-o.f||0,1e3),t=this._cachedViewbox={x:r?r/n:0,y:o?o/n:0,width:a.width/n,height:a.height/n,scale:n,inner:{width:e.width||0,height:e.height||0,x:e.x||0,y:e.y||0},outer:a})},fo.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=L({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),ho(t,n)}),{x:n.e,y:n.f}},fo.prototype.scrollToElement=function(e,t){var n=100;"string"==typeof e&&(e=this._elementRegistry.get(e));var r=this.findRoot(e);r!==this.getRootElement()&&this.setRootElement(r),"number"==typeof(t=t||{})&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};var o=sr(e),i=no(o),a=this.viewbox(),r=this.zoom();a.y+=t.top/r,a.x+=t.left/r,a.width-=(t.right+t.left)/r,a.height-=(t.bottom+t.top)/r;var c,n=no(a);a=o.width<a.width&&o.height<a.height?(e=Math.max(0,i.right-n.right),c=Math.min(0,i.left-n.left),t=Math.max(0,i.bottom-n.bottom),n=Math.min(0,i.top-n.top),c=e||c,t||n):(c=o.x-a.x,o.y-a.y),this.scroll({dx:-c*r,dy:-a*r})},fo.prototype.zoom=function(e,t){return e?"fit-viewport"===e?this._fitViewport(t):(this._changeViewbox(function(){"object"!==Ve(t)&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),r=this._setZoom(e,t)}),uo(r.a,1e3)):this.viewbox(e).scale;var n,r},fo.prototype._fitViewport=function(e){var t=this.viewbox(),n=t.outer,t=t.inner,r=0<=t.x&&0<=t.y&&t.x+t.width<=n.width&&t.y+t.height<=n.height&&!e?{x:0,y:0,width:Math.max(t.width+t.x,n.width),height:Math.max(t.height+t.y,n.height)}:(r=Math.min(1,n.width/t.width,n.height/t.height),{x:t.x+(e?t.width/2-n.width/r/2:0),y:t.y+(e?t.height/2-n.height/r/2:0),width:n.width/r,height:n.height/r});return this.viewbox(r),this.viewbox(!1).scale},fo.prototype._setZoom=function(e,t){var n=this._svg,r=this._viewport,o=n.createSVGMatrix(),i=n.createSVGPoint(),n=r.getCTM(),r=n.a,e=t?(t=L(i,t).matrixTransform(n.inverse()),t=o.translate(t.x,t.y).scale(1/r*e).translate(-t.x,-t.y),n.multiply(t)):o.scale(e);return ho(this._viewport,e),e},fo.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},fo.prototype.getAbsoluteBBox=function(e){var t=this.viewbox();return{x:(e=e.waypoints?this.getGraphics(e).getBBox():e).x*t.scale-t.x*t.scale,y:e.y*t.scale-t.y*t.scale,width:e.width*t.scale,height:e.height*t.scale}},fo.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var yo="data-element-id";function mo(e){this._elements={},this._eventBus=e}mo.$inject=["eventBus"],mo.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),Rn(t,yo,r),n&&Rn(n,yo,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}},mo.prototype.remove=function(e){var t=this._elements,n=e.id||e,e=n&&t[n];e&&(Rn(e.gfx,yo,""),e.secondaryGfx&&Rn(e.secondaryGfx,yo,""),delete t[n])},mo.prototype.updateId=function(e,t){this._validateId(t),"string"==typeof e&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),r=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,r)},mo.prototype.updateGraphics=function(e,t,n){var r=e.id||e,e=this._elements[r];return n?e.secondaryGfx=t:e.gfx=t,t&&Rn(t,yo,r),t},mo.prototype.get=function(e){e="string"==typeof e?e:e&&Rn(e,yo),e=this._elements[e];return e&&e.element},mo.prototype.filter=function(n){var r=[];return this.forEach(function(e,t){n(e,t)&&r.push(e)}),r},mo.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),r=0;r<n.length;r++){var o=t[n[r]],i=o.element;if(e(i,o.gfx))return i}},mo.prototype.getAll=function(){return this.filter(function(e){return e})},mo.prototype.forEach=function(n){var r=this._elements;Object.keys(r).forEach(function(e){var t=r[e],e=t.element,t=t.gfx;return n(e,t)})},mo.prototype.getGraphics=function(e,t){e=e.id||e,e=this._elements[e];return e&&(t?e.secondaryGfx:e.gfx)},mo.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};var vo={extend:function(e,r,t,o){var i=t.inverse;return Object.defineProperty(e,"remove",{value:function(e){var t=this.indexOf(e);return-1!==t&&(this.splice(t,1),r.unset(e,i,o)),e}}),Object.defineProperty(e,"contains",{value:function(e){return-1!==this.indexOf(e)}}),Object.defineProperty(e,"add",{value:function(e,t){var n=this.indexOf(e);if(void 0===t){if(-1!==n)return;t=this.length}-1!==n&&this.splice(n,1),this.splice(t,0,e),-1===n&&r.set(e,i,o)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e},isExtended:function(e){return!0===e.__refs_collection}};function go(t,n,r){var e=vo.extend(r[n.name]||[],t,n,r);Object.defineProperty(r,n.name,{enumerable:n.enumerable,value:e}),e.length&&e.forEach(function(e){t.set(e,n.inverse,r)})}function bo(e,t){if(!(this instanceof bo))return new bo(e,t);(e.inverse=t).inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}bo.prototype.bind=function(e,t){if("string"==typeof t){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}var n,r,o,i;t.collection?go(this,t,e):(n=this,r=e,o=(t=t).inverse,i=r[t.name],Object.defineProperty(r,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return i},set:function(e){var t;e!==i&&(t=i,i=null,t&&n.unset(t,o,r),i=e,n.set(i,o,r))}}))},bo.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return vo.isExtended(n)||go(this,t,e),n},bo.prototype.ensureBound=function(e,t){var n;n=t,Object.prototype.hasOwnProperty.call(e,n.name||n)||this.bind(e,t)},bo.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},bo.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var _o=bo;_o.Collection=vo;var wo=new _o({name:"children",enumerable:!0,collection:!0},{name:"parent"}),xo=new _o({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Oo=new _o({name:"attachers",collection:!0},{name:"host"}),jo=new _o({name:"outgoing",collection:!0},{name:"source"}),Eo=new _o({name:"incoming",collection:!0},{name:"target"});function Co(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),wo.bind(this,"parent"),xo.bind(this,"labels"),jo.bind(this,"outgoing"),Eo.bind(this,"incoming")}function So(){Co.call(this),wo.bind(this,"children"),Oo.bind(this,"host"),Oo.bind(this,"attachers")}function Po(){So.call(this)}function ko(){So.call(this),xo.bind(this,"labelTarget")}function Ro(){Co.call(this),jo.bind(this,"source"),Eo.bind(this,"target")}On(So,Co),On(Po,So),On(ko,So),On(Ro,Co);var To={connection:Ro,shape:So,label:ko,root:Po};function Do(){this._uid=12}function Mo(e){return e.childNodes[0]}function Bo(e,t,n){var r=qn();r.setTranslate(t,n),er(e,r)}function Io(e,t){this._eventBus=e,this._elementRegistry=t}function Ao(e,t,n){n=n||t.firstChild;e!==n&&t.insertBefore(e,n)}Do.prototype.createRoot=function(e){return this.create("root",e)},Do.prototype.createLabel=function(e){return this.create("label",e)},Do.prototype.createShape=function(e){return this.create("shape",e)},Do.prototype.createConnection=function(e){return this.create("connection",e)},Do.prototype.create=function(e,t){return(t=L({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=To[e];if(!n)throw new Error("unknown type: <"+e+">");return L(new n,t)}(e,t)},Io.$inject=["eventBus","elementRegistry"],Io.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=n.parentNode.childNodes[1])||(In(t=Un("g")).add("djs-children"),Cn(n.parentNode,t)):t=n,t},Io.prototype._clear=function(e){e=Mo(e);return gt(e),e},Io.prototype._createContainer=function(e,t,n,r){var o=Un("g");In(o).add("djs-group"),void 0!==n?Ao(o,t,t.childNodes[n]):Cn(t,o);t=Un("g");In(t).add("djs-element"),In(t).add("djs-"+e),r&&In(t).add("djs-frame"),Cn(o,t);o=Un("g");return In(o).add("djs-visual"),Cn(t,o),t},Io.prototype.create=function(e,t,n){var r=this._getChildrenContainer(t.parent);return this._createContainer(e,r,n,pr(t))},Io.prototype.updateContainments=function(e){var r=this,o=this._elementRegistry;x(O(e,function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e},{}),function(e){var t,n=e.children;n&&(t=r._getChildrenContainer(e),x(n.slice().reverse(),function(e){Ao(o.getGraphics(e).parentNode,t)}))})},Io.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},Io.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},Io.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},Io.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},Io.prototype.update=function(e,t,n){if(t.parent){var r=this._clear(n);if("shape"===e)this.drawShape(r,t),Bo(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(r,t)}t.hidden?Rn(n,"display","none"):Rn(n,"display","block")}},Io.prototype.remove=function(e){Nn(this._elementRegistry.getGraphics(e).parentNode)};var No={__depends__:[hr],__init__:["canvas"],canvas:["type",fo],elementRegistry:["type",mo],elementFactory:["type",Do],eventBus:["type",U],graphicsFactory:["type",Io]};function Lo(e){var e=[{config:["value",e=e||{}]},No].concat(e.modules||[]);return(e=new xn(e=e)).init(),e}function $o(e,t){this.injector=t=t||Lo(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}$o.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},$o.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};var Vo=new _o({name:"dmnElementRef",enumerable:!0},{name:"di",configurable:!0});function zo(r,e){var o=[];function i(t){try{return t.di&&function(e){if(e.gfx)throw new Error("already rendered "+e.id);return r.element(e)}(t)}catch(e){n(e.message,{element:t,error:e})}}function a(e){var t;(e=(t=e).dmnElementRef)?e.di?n("multiple DI elements defined for element",{element:e}):(Vo.bind(e,"di"),e.di=t):n("no DMN element referenced in element",{element:t})}function c(e){o.push(e)}function n(e,t){r.error(e,t)}return{handleDefinitions:function(e,t){var n=e.dmnDI;if(!n)throw new Error("no dmndi:DMNDI");if(n=n.diagrams||[],t&&-1===n.indexOf(t))throw new Error("diagram not part of dmndi:DMNDI");if(!(t=!t&&n&&n.length?n[0]:t))throw new Error("no diagram to display");x((e.di=t).diagramElements,a),r.root(e),x(e.get("drgElement"),function(e){var t;i(e),t=e,x(["informationRequirement","knowledgeRequirement","authorityRequirement"],function(e){x(t[e],function(e){c(function(){i(e)})})})}),x(e.get("artifact"),function(e){var t;en(e,"dmn:Association")?(t=e,c(function(){i(t)})):i(e)}),x(o,function(e){e()})}}}function Fo(e,t,n){var r,o=e.get("drdImporter"),e=e.get("eventBus"),i=[];e.fire("import.start",{definitions:t});try{new zo({root:function(e){return o.root(e)},element:function(e,t){return o.add(e,t)},error:function(e,t){i.push({message:e,context:t})}}).handleDefinitions(t)}catch(e){r=e}e.fire("import.done",{error:r,warnings:i}),n(r,i)}var Uo=new Jt,Ho="hsl(225, 10%, 15%)";function Wo(e,t,r,n,o,a){jn.call(this,t);var i=Uo.next(),c=n.computeStyle,u={},s=e&&e.defaultFillColor||"white",l=e&&e.defaultStrokeColor||Ho,p=e&&e.defaultLabelColor;function f(e,t,n){t=e+"-"+Go(t)+"-"+Go(n)+"-"+i;return u[t]||function(e,t,n){{var r,o;"association-start"===t?(Rn(r=Un("path"),{d:"M 11 5 L 1 10 L 11 15"}),d(e,{element:r,attrs:{fill:"none",stroke:n,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})):"association-end"===t?(Rn(r=Un("path"),{d:"M 1 5 L 11 10 L 1 15"}),d(e,{element:r,attrs:{fill:"none",stroke:n,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})):"information-requirement-end"===t?(Rn(o=Un("path"),{d:"M 1 5 L 11 10 L 1 15 Z"}),d(e,{element:o,attrs:{fill:n,stroke:"none"},ref:{x:11,y:10},scale:1})):"knowledge-requirement-end"===t?(Rn(o=Un("path"),{d:"M 1 3 L 11 10 L 1 17"}),d(e,{element:o,attrs:{fill:"none",stroke:n,strokeWidth:2},ref:{x:11,y:10},scale:.8})):"authority-requirement-end"===t&&(Rn(t=Un("circle"),{cx:3,cy:3,r:3}),d(e,{element:t,attrs:{fill:n,stroke:"none"},ref:{x:3,y:3},scale:.9}))}}(t,e,n),"url(#"+t+")"}function d(e,t){var n=L({strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},t.attrs),r=t.ref||{x:0,y:0},o=t.scale||1;"none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]);var i=Un("marker");Rn(t.element,n),Cn(i,t.element),Rn(i,{id:e,viewBox:"0 0 20 20",refX:r.x,refY:r.y,markerWidth:20*o,markerHeight:20*o,orient:"auto"});o=Dt("defs",a._svg);o||(o=Un("defs"),Cn(a._svg,o)),Cn(o,i),u[e]=i}function h(e,t,n,r,o,i){_(o)&&(i=o,o=0),o=o||0,i=c(i,{stroke:Ho,strokeWidth:2,fill:"white"});var a=Un("rect");return Rn(a,{x:o,y:o,width:t-2*o,height:n-2*o,rx:r,ry:r}),Rn(a,i),Cn(e,a),a}function y(e,t,n){n=o.createText(t||"",n);return pt(n,"class","djs-label"),Cn(e,n),n}function m(e,t,n,r){return y(e,rn(t).name,r=L({box:t,align:n,padding:5,style:{fill:Ko(0,p,l)}},r))}function v(e,t,n){n=c(n,["no-fill"],{strokeWidth:2,stroke:Ho});var r=Un("path");return Rn(r,{d:t}),Rn(r,n),Cn(e,r),r}var g={"dmn:Decision":function(e,t){var n=h(e,t.width,t.height,0,{stroke:l,fill:s});return m(e,t,"center-middle"),n},"dmn:KnowledgeSource":function(e,t){var n=v(e,r.getScaledPath("KNOWLEDGE_SOURCE",{xScaleFactor:1.021,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.075}}),{strokeWidth:2,fill:s,stroke:l});return m(e,t,"center-middle"),n},"dmn:BusinessKnowledgeModel":function(e,t){var n=v(e,r.getScaledPath("BUSINESS_KNOWLEDGE_MODEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.3}}),{strokeWidth:2,fill:s,stroke:l});return m(e,t,"center-middle"),n},"dmn:InputData":function(e,t){var n=h(e,t.width,t.height,22,{stroke:l,fill:s});return m(e,t,"center-middle"),n},"dmn:TextAnnotation":function(e,t){var n=h(e,t.width,t.height,0,0,{fill:"none",stroke:"none"});return v(e,r.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}}),{stroke:l}),y(e,qo(t).text||"",{style:{fill:Ko(0,p,l)},box:t,align:"left-top",padding:5}),n},"dmn:Association":function(e,t){var n=qo(t),r=s,o=l,i={stroke:o,strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"};return"One"!==n.associationDirection&&"Both"!==n.associationDirection||(i.markerEnd=f("association-end",r,o)),"Both"===n.associationDirection&&(i.markerStart=f("association-start",r,o)),b(e,t.waypoints,i)},"dmn:InformationRequirement":function(e,t){var n={stroke:l,strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:f("information-requirement-end",s,l)};return b(e,t.waypoints,n)},"dmn:KnowledgeRequirement":function(e,t){var n={stroke:l,strokeWidth:1,strokeDasharray:5,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:f("knowledge-requirement-end",s,l)};return b(e,t.waypoints,n)},"dmn:AuthorityRequirement":function(e,t){var n={stroke:l,strokeWidth:1.5,strokeDasharray:5,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:f("authority-requirement-end",s,l)};return b(e,t.waypoints,n)}};function b(e,t,n){n=rr(t,n=c(n,["no-fill"],{stroke:Ho,strokeWidth:2,fill:"none"}));return Cn(e,n),n}this.canRender=function(e){return en(e,"dmn:DMNElement")||en(e,"dmn:InformationRequirement")||en(e,"dmn:KnowledgeRequirement")||en(e,"dmn:AuthorityRequirement")},this.drawShape=function(e,t){var n=g[t.type];return n?n(e,t):jn.prototype.drawShape.apply(this,[e,t])},this.drawConnection=function(e,t){var n=t.type;return(n=g[n])?n(e,t):jn.prototype.drawConnection.apply(this,[e,t])}}function qo(e){return e.businessObject}function Go(e){return e.replace(/[^0-9a-zA-z]+/g,"_")}function Ko(e,t,n){return t||n}dn(Wo,jn),Wo.$inject=["config.drdRenderer","eventBus","pathMap","styles","textRenderer","canvas"];var Xo={width:150,height:50};function Yo(e,t,n){for(var r,o=e.shift(),i=o;;){if((r=function(e,t){var n;t.textContent=e;try{var r,o=""===e;return t.textContent=o?"dummy":e,r={width:(n=t.getBBox()).width+2*n.x,height:n.height},o&&(r.width=0),r}catch(e){return{width:0,height:0}}}(i,n)).width=i?r.width:0," "===i||""===i||r.width<Math.round(t)||i.length<2)return function(e,t,n,r){t.length<n.length&&(n=n.slice(t.length).trim(),e.unshift(n));return{width:r.width,height:r.height,text:t}}(e,i,o,r);i=function(e,t,n){n=Math.max(e.length*(n/t),1),t=function(e,t){var n,r=e.split(/(\s|-|\u00AD)/g),o=[],i=0;if(1<r.length)for(;n=r.shift();){if(!(n.length+i<t)){"-"!==n&&n!==Zo||o.pop();break}o.push(n),i+=n.length}e=o[o.length-1];e&&e===Zo&&(o[o.length-1]="-");return o.join("")}(e,n);t=t||e.slice(0,Math.max(Math.round(n-1),1));return t}(i,r.width,t)}}var Zo="­";function Qo(e){this._config=L({},{size:Xo,padding:0,style:{},align:"center-top"},e||{})}Qo.prototype.createText=function(e,t){return this.layoutText(e,t).element},Qo.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},Qo.prototype.layoutText=function(e,t){var n,r=L({},this._config.size,t.box),o=L({},this._config.style,t.style),i={horizontal:(n=(n=t.align||this._config.align).split("-"))[0]||"center",vertical:n[1]||"top"},a=_(n=(void 0!==t.padding?t:this._config).padding)?L({top:0,left:0,right:0,bottom:0},n):{top:n,left:n,right:n,bottom:n},c=t.fitBox||!1,u=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(o),s=e.split(/\u00AD?\r?\n/),l=[],p=r.width-a.left-a.right,f=Un("text");for(Rn(f,{x:0,y:0}),Rn(f,o),Cn(((e=document.getElementById("helper-svg"))||(Rn(e=Un("svg"),{id:"helper-svg",width:0,height:0,visibility:"hidden",position:"fixed"}),document.body.appendChild(e)),e),f);s.length;)l.push(Yo(s,p,f));"middle"===i.vertical&&(a.top=a.bottom=0);var e=O(l,function(e,t,n){return e+(u||t.height)},0)+a.top+a.bottom,d=O(l,function(e,t,n){return t.width>e?t.width:e},0),h=a.top;"middle"===i.vertical&&(h+=(r.height-e)/2),h-=(u||l[0].height)/4;var y=Un("text");return Rn(y,o),x(l,function(e){var t;switch(h+=u||e.height,i.horizontal){case"left":t=a.left;break;case"right":t=(c?d:p)-a.right-e.width;break;default:t=Math.max(((c?d:p)-e.width)/2+a.left,0)}var n=Un("tspan");Rn(n,{x:t,y:h}),n.textContent=e.text,Cn(y,n)}),Nn(f),{dimensions:{width:d,height:e},element:y}};function Jo(e){var n=L({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),t=parseInt(n.fontSize,10)-1,r=L({},n,{fontSize:t},e&&e.externalStyle||{}),o=new Qo({style:n});this.getExternalLabelBounds=function(e,t){t=o.getDimensions(t,{box:{width:90,height:30,x:e.width/2+e.x,y:e.height/2+e.y},style:r});return{x:Math.round(e.x+e.width/2-t.width/2),y:Math.round(e.y),width:Math.ceil(t.width),height:Math.ceil(t.height)}},this.getTextAnnotationBounds=function(e,t){t=o.getDimensions(t,{box:e,style:n,align:"left-top",padding:5});return{x:e.x,y:e.y,width:e.width,height:Math.max(30,Math.round(t.height))}},this.createText=function(e,t){return o.createText(e,t||{})},this.getDefaultStyle=function(){return n},this.getExternalStyle=function(){return r}}Jo.$inject=["config.textRenderer"];var ei=/\{([^{}]+)\}/g,ti=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var ni={__init__:["drdRenderer"],drdRenderer:["type",Wo],textRenderer:["type",Jo],pathMap:["type",function(){this.pathMap={KNOWLEDGE_SOURCE:{d:"m {mx},{my} l 0,{e.y0} c {e.x0},{e.y1} {e.x1},-{e.y2} {e.x2},-{e.y3} c {e.x3},-{e.y4} {e.x4},{e.y5} {e.x5},{e.y6} l 0,-{e.y7}z",width:100,height:65,widthElements:[29.8,48.4,67.2,12.2,19.8,30.8],heightElements:[55.3,19.7,4.2,6.7,2.3,1.6,6.2,54.6]},BUSINESS_KNOWLEDGE_MODEL:{d:"m {mx},{my} l {e.x0},-{e.y0} l {e.x1},0 l 0,{e.y1} l -{e.x2},{e.y2} l -{e.x3},0z",width:125,height:45,widthElements:[13.8,109.2,13.8,109.1],heightElements:[13.2,29.8,13.2]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",width:10,height:30,widthElements:[10],heightElements:[30]}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,r,o=this.pathMap[e],e=t.abspos?(n=t.abspos.x,t.abspos.y):(n=t.containerWidth*t.position.mx,t.containerHeight*t.position.my),i={};if(t.position){for(var a=t.containerHeight/o.height*t.yScaleFactor,c=t.containerWidth/o.width*t.xScaleFactor,u=0;u<o.heightElements.length;u++)i["y"+u]=o.heightElements[u]*a;for(var s=0;s<o.widthElements.length;s++)i["x"+s]=o.widthElements[s]*c}return t=o.d,r={mx:n,my:e,e:i},String(t).replace(ei,function(e,t){return n=e,i=e=r,t.replace(ti,function(e,t,n,r,o){t=t||r,i&&"function"==typeof(i=t in i?i[t]:i)&&o&&(i=i())}),i=(null==i||i==e?n:i)+"";var n,i})}}]};function ri(e,t,n,r){this._eventBus=e,this._canvas=t,this._elementRegistry=r,this._elementFactory=n}function oi(e,t){return L({id:e.id,type:e.$type,businessObject:e},t)}function ii(e){return e.split("#").pop()}ri.$inject=["eventBus","canvas","elementFactory","elementRegistry"],ri.prototype.root=function(e){e=this._elementFactory.createRoot(oi(e));return this._canvas.setRootElement(e),e},ri.prototype.add=function(e){var t,n,r,o,i,a=this._elementFactory,c=this._canvas,u=this._eventBus,s=e.di;if(s.$instanceOf("dmndi:DMNShape"))i=s.bounds,o=oi(e,{x:Math.round(i.x),y:Math.round(i.y),width:Math.round(i.width),height:Math.round(i.height)}),t=a.createShape(o),c.addShape(t),u.fire("drdElement.added",{element:t,di:s});else{if(!s.$instanceOf("dmndi:DMNEdge"))throw new Error("unknown di for element "+e.id);n=function(e){e=e.waypoint;if(e)return C(e,function(e){e={x:e.x,y:e.y};return L({original:e},e)})}(s),r=this._getSource(e),i=this._getTarget(e),r&&i&&(o=oi(e,{hidden:!1,source:r,target:i,waypoints:n}),t=a.createConnection(o),c.addConnection(t),u.fire("drdElement.added",{element:t,di:s}))}return t},ri.prototype._getSource=function(e){var t,n;if(en(e,"dmn:Association")?n=e.sourceRef:en(e,"dmn:InformationRequirement")?n=e.requiredDecision||e.requiredInput:en(e,"dmn:KnowledgeRequirement")?n=e.requiredKnowledge:en(e,"dmn:AuthorityRequirement")&&(n=e.requiredDecision||e.requiredInput||e.requiredAuthority),t=n?n.href:t)return this._getShape(ii(t))},ri.prototype._getTarget=function(e){return en(e,"dmn:Association")?e.targetRef&&this._getShape(ii(e.targetRef.href)):this._getShape(e.$parent.id)},ri.prototype._getShape=function(e){return this._elementRegistry.get(e)};var ai={__depends__:[ni,{drdImporter:["type",ri]}]};var ci={translate:["value",function(e,n){return n=n||{},e.replace(/{([^}]+)}/g,function(e,t){return n[t]||"{"+t+"}"})}]};function ui(e){e&&"function"==typeof e.stopPropagation&&e.stopPropagation()}function si(e){return e.originalEvent||e.srcEvent}function li(e){ui(e),ui(si(e))}function pi(e){return(e=(e=e.pointers&&e.pointers.length?e.pointers[0]:e).touches&&e.touches.length?e.touches[0]:e)?{x:e.clientX,y:e.clientY}:null}function fi(e,t){return(si(e)||e).button===t}function di(e){return fi(e,0)}function hi(e){var t=si(e)||e;return!!di(e)&&(/mac/i.test(navigator.platform)?t.metaKey:t.ctrlKey)}function yi(e){var t=si(e)||e;return di(e)&&t.shiftKey}function mi(e){return!0}function vi(e){return di(e)||fi(e,1)}function gi(i,a,n){var r=this;function c(e,t,n){var r,o;(l[e]||di)(t)&&(n?o=a.getGraphics(n):(r=t.delegateTarget||t.target)&&(n=a.get(o=r)),o&&n&&!1===i.fire(e,{element:n,gfx:o,originalEvent:t})&&(t.stopPropagation(),t.preventDefault()))}var u={};function o(e){return u[e]}var s={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":mi,"element.mousedown":vi,"element.mouseup":vi,"element.click":vi,"element.dblclick":vi};var p="svg, .djs-element";function f(e,t,n,r){var o=u[n]=function(e){c(n,e)};r&&(l[n]=r),o.$delegate=Pt.bind(e,p,t,o)}function d(e,t,n){n=o(n);n&&Pt.unbind(e,t,n.$delegate)}i.on("canvas.destroy",function(e){var n;n=e.svg,x(s,function(e,t){d(n,t,e)})}),i.on("canvas.init",function(e){var n;n=e.svg,x(s,function(e,t){f(n,t,e)})}),i.on(["shape.added","connection.added"],function(e){var t=e.element,e=e.gfx;i.fire("interactionEvents.createHit",{element:t,gfx:e})}),i.on(["shape.changed","connection.changed"],500,function(e){var t=e.element,e=e.gfx;i.fire("interactionEvents.updateHit",{element:t,gfx:e})}),i.on("interactionEvents.createHit",500,function(e){var t=e.element,e=e.gfx;r.createDefaultHit(t,e)}),i.on("interactionEvents.updateHit",function(e){var t=e.element,e=e.gfx;r.updateDefaultHit(t,e)});var e=y("djs-hit djs-hit-stroke"),t=y("djs-hit djs-hit-click-stroke"),h={all:y("djs-hit djs-hit-all"),"click-stroke":t,stroke:e,"no-move":y("djs-hit djs-hit-no-move")};function y(e,t){return t=L({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function m(e,t){var n=h[t];if(!n)throw new Error("invalid hit type <"+t+">");return Rn(e,n),e}function v(e,t){Cn(e,t)}this.removeHits=function(e){x(Mt(".djs-hit",e),Nn)},this.createDefaultHit=function(e,t){var n=e.waypoints,r=e.isFrame;return n?this.createWaypointsHit(t,n):this.createBoxHit(t,r?"stroke":"all",{width:e.width,height:e.height})},this.createWaypointsHit=function(e,t){t=rr(t);return m(t,"stroke"),v(e,t),t},this.createBoxHit=function(e,t,n){n=L({x:0,y:0},n);var r=Un("rect");return m(r,t),Rn(r,n),v(e,r),r},this.updateDefaultHit=function(e,t){var n,r=Dt(".djs-hit",t);if(r)return e.waypoints?(n=r,t=e.waypoints,Rn(n,{points:nr(t)})):Rn(r,{width:e.width,height:e.height}),r},this.fire=c,this.triggerMouseEvent=function(e,t,n){var r=s[e];if(!r)throw new Error("unmapped DOM event name <"+e+">");return c(r,t,n)},this.mouseHandler=o,this.registerEvent=f,this.unregisterEvent=d}gi.$inject=["eventBus","elementRegistry","styles"];var bi={__init__:["interactionEvents"],interactionEvents:["type",gi]};function _i(e,t,n){this.offset=6;var r=t.cls("djs-outline",["no-fill"]),o=this;function i(e){var t=Un("rect");return Rn(t,L({x:10,y:10,rx:3,width:100,height:100},r)),Cn(e,t),t}e.on(["shape.added","shape.changed"],500,function(e){var t=e.element,n=e.gfx,e=(e=Dt(".djs-outline",n))||i(n);o.updateShapeOutline(e,t)}),e.on(["connection.added","connection.changed"],function(e){var t=e.element,n=e.gfx,e=(e=Dt(".djs-outline",n))||i(n);o.updateConnectionOutline(e,t)})}_i.prototype.updateShapeOutline=function(e,t){Rn(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},_i.prototype.updateConnectionOutline=function(e,t){t=sr(t);Rn(e,{x:t.x-this.offset,y:t.y-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},_i.$inject=["eventBus","styles","elementRegistry"];var wi={__init__:["outline"],outline:["type",_i]};function xi(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],function(e){e=e.element;n.deselect(e)}),e.on(["diagram.clear","root.set"],function(e){n.select(null)})}xi.$inject=["eventBus","canvas"],xi.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);-1!==n&&(e=t.slice(),t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:e,newSelection:t}))},xi.prototype.get=function(){return this._selectedElements},xi.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},xi.prototype.select=function(e,t){var n=this._selectedElements,r=n.slice();y(e)||(e=e?[e]:[]);var o=this._canvas,i=o.getRootElement();e=e.filter(function(e){e=o.findRoot(e);return i===e}),t?x(e,function(e){-1!==n.indexOf(e)||n.push(e)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:n})};var Oi="selected";function ji(n,e,t){this._canvas=n;var r=this;function o(e,t){n.addMarker(e,t)}function i(e,t){n.removeMarker(e,t)}this._multiSelectionBox=null,e.on("element.hover",function(e){o(e.element,"hover")}),e.on("element.out",function(e){i(e.element,"hover")}),e.on("selection.changed",function(e){var t=e.oldSelection,n=e.newSelection;x(t,function(e){-1===n.indexOf(e)&&i(e,Oi)}),x(n,function(e){-1===t.indexOf(e)&&o(e,Oi)}),r._updateSelectionOutline(n)}),e.on("element.changed",function(e){t.isSelected(e.element)&&r._updateSelectionOutline(t.get())})}function Ei(e,o,i,r){e.on("create.end",500,function(e){var t=e.context,n=t.canExecute,e=t.elements,t=(t.hints||{}).autoSelect;n&&!1!==t&&(y(t)?o.select(t):o.select(e.filter(Ci)))}),e.on("connect.end",500,function(e){e=e.context.connection;e&&o.select(e)}),e.on("shape.move.end",500,function(e){var t=e.previousSelection||[],n=r.get(e.context.shape.id);b(t,function(e){return n.id===e.id})||o.select(n)}),e.on("element.click",function(e){if(di(e)){var t=e.element;t===i.getRootElement()&&(t=null);var n=o.isSelected(t),r=1<o.get().length,e=hi(e)||yi(e);if(n&&r)return e?o.deselect(t):o.select(t);n?o.deselect(t):o.select(t,e)}})}function Ci(e){return!e.hidden}ji.$inject=["canvas","eventBus","selection"],ji.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");Ln(t);var n=1<e.length;In(this._canvas.getContainer())[n?"add":"remove"]("djs-multi-select"),n&&(e={x:(n=sr(e)).x-6,y:n.y-6,width:n.width+12,height:n.height+12},Rn(n=Un("rect"),L({rx:3},e)),In(n).add("djs-selection-outline"),Cn(t,n))},Ei.$inject=["eventBus","selection","canvas","elementRegistry"];var Si={__init__:["selectionVisuals","selectionBehavior"],__depends__:[bi,wi],selection:["type",xi],selectionVisuals:["type",ji],selectionBehavior:["type",Ei]};function Pi(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}Pi.prototype.next=function(){return this._prefix+ ++this._counter};var ki=new Pi("ov");function Ri(e,t,n,r){this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=ki,this._overlayDefaults=L({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(e=n.getContainer(),lt(n=kt('<div class="djs-overlay-container" />'),{position:"absolute",width:0,height:0}),e.insertBefore(n,e.firstChild),n),this._init()}function Ti(e,t,n){lt(e,{left:t+"px",top:n+"px"})}function Di(e,t){e.style.display=!1===t?"none":""}function Mi(t,n){t.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(e){t.style[e+"transform"]=n})}Ri.$inject=["config.overlays","eventBus","canvas","elementRegistry"],Ri.prototype.get=function(e){if(v(e)&&(e={id:e}),v(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?w(t.overlays,r({type:e.type})):t.overlays.slice():[]}return e.type?w(this._overlays,r({type:e.type})):e.id?this._overlays[e.id]:null},Ri.prototype.add=function(e,t,n){if(_(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=L({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r},Ri.prototype.remove=function(e){e=this.get(e)||[];y(e)||(e=[e]);var n=this;x(e,function(e){var t=n._getOverlayContainer(e.element,!0);e&&(Bt(e.html),Bt(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),!t||-1!==(e=t.overlays.indexOf(e))&&t.overlays.splice(e,1)})},Ri.prototype.show=function(){Di(this._overlayRoot)},Ri.prototype.hide=function(){Di(this._overlayRoot,!1)},Ri.prototype.clear=function(){this._overlays={},this._overlayContainers=[],gt(this._overlayRoot)},Ri.prototype._updateOverlayContainer=function(e){var t,n=e.element,r=e.html,o=n.x,i=n.y;n.waypoints&&(o=(t=sr(n)).x,i=t.y),Ti(r,o,i),pt(e.html,"data-container-id",n.id)},Ri.prototype._updateOverlay=function(e){var t,n=e.position,r=e.htmlContainer,o=e.element,i=n.left,a=n.top;void 0!==n.right&&(t=(o.waypoints?sr(o):o).width,i=-1*n.right+t),void 0!==n.bottom&&(o=(o.waypoints?sr(o):o).height,a=-1*n.bottom+o),Ti(r,i||0,a||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Ri.prototype._createOverlayContainer=function(e){var t=kt('<div class="djs-overlays" />');lt(t,{position:"absolute"}),this._overlayRoot.appendChild(t);e={html:t,element:e,overlays:[]};return this._updateOverlayContainer(e),this._overlayContainers.push(e),e},Ri.prototype._updateRoot=function(e){var t=e.scale||1,t="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Mi(this._overlayRoot,t)},Ri.prototype._getOverlayContainer=function(t,e){var n=b(this._overlayContainers,function(e){return e.element===t});return n||e?n:this._createOverlayContainer(t)},Ri.prototype._addOverlay=function(e){var t,n,r=e.id,o=e.element,i=e.html;v(i=i.get&&i.constructor.prototype.jquery?i.get(0):i)&&(i=kt(i)),n=this._getOverlayContainer(o),lt(t=kt('<div class="djs-overlay" data-overlay-id="'+r+'">'),{position:"absolute"}),t.appendChild(i),e.type&&mt(t).add("djs-overlay-"+e.type),Di(t,this._canvas.findRoot(o)===this._canvas.getRootElement()),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[r]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Ri.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=this._canvas.findRoot(e.element),o=n&&n.minZoom,i=n&&n.maxZoom,a=!0;Di(e.htmlContainer,a=r!==this._canvas.getRootElement()||n&&(f(o)&&o>t.scale||f(i)&&i<t.scale)?!1:a),this._updateOverlayScale(e,t)},Ri.prototype._updateOverlayScale=function(e,t){var n,r,o=e.scale,i=e.htmlContainer,e="";!0!==o&&(o=!1===o?n=1:(n=o.min,o.max),f(n)&&t.scale<n&&(r=(1/t.scale||1)*n),f(o)&&t.scale>o&&(r=(1/t.scale||1)*o)),Mi(i,e=f(r)?"scale("+r+","+r+")":e)},Ri.prototype._updateOverlaysVisibilty=function(t){var n=this;x(this._overlays,function(e){n._updateOverlayVisibilty(e,t)})},Ri.prototype._init=function(){var e=this._eventBus,n=this;e.on("canvas.viewbox.changing",function(e){n.hide()}),e.on("canvas.viewbox.changed",function(e){e=e.viewbox,n._updateRoot(e),n._updateOverlaysVisibilty(e),n.show()}),e.on(["shape.remove","connection.remove"],function(e){e=e.element;x(n.get({element:e}),function(e){n.remove(e.id)});var e=n._getOverlayContainer(e);e&&(Bt(e.html),-1!==(e=n._overlayContainers.indexOf(e))&&n._overlayContainers.splice(e,1))}),e.on("element.changed",500,function(e){e=e.element,e=n._getOverlayContainer(e,!0);e&&(x(e.overlays,function(e){n._updateOverlay(e)}),n._updateOverlayContainer(e))}),e.on("element.marker.update",function(e){var t=n._getOverlayContainer(e.element,!0);t&&mt(t.html)[e.add?"add":"remove"](e.marker)}),e.on("root.set",function(){n._updateOverlaysVisibilty(n._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};var Bi={__init__:["overlays"],overlays:["type",Ri]};function Ii(e,t){this._eventBus=e,this._canvas=t,e.on("diagram.init",function(){this._init()},this),e.on("import.done",function(e){e.error||this.update()},this)}function Ai(e,n){function t(e,t){mt(n.getContainer()).toggle(e,t)}e.on("palette.create",function(){t("with-palette",!0)}),e.on("palette.changed",function(e){t("with-palette-two-column",e.twoColumn)})}Ii.$inject=["eventBus","canvas"],Ii.prototype._init=function(){var e=this._canvas,t=this._eventBus,n=e.getContainer(),e=this._container=kt(Ii.HTML_MARKUP);n.appendChild(e),this.nameElement=Dt(".dmn-definitions-name",this._container),this.idElement=Dt(".dmn-definitions-id",this._container),Pt.bind(e,".dmn-definitions-name, .dmn-definitions-id","mousedown",function(e){e.stopPropagation()}),t.fire("definitionIdView.create",{html:e})},Ii.prototype.update=function(){var e=this._canvas.getRootElement().businessObject;this.nameElement.textContent=e.name,this.idElement.textContent=e.id},Ii.HTML_MARKUP='<div class="dmn-definitions"><div class="dmn-definitions-name" title="Definition Name" spellcheck="false"></div><div class="dmn-definitions-id" title="Definition ID" spellcheck="false"></div></div>',Ai.$inject=["eventBus","canvas"];var Ni={__init__:["definitionPropertiesView","definitionPropertiesPaletteAdapter"],definitionPropertiesView:["type",Ii],definitionPropertiesPaletteAdapter:["type",Ai]};function Li(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var $i=[{className:"dmn-icon-decision-table",matches:function(e){e=e.businessObject;return en(e,"dmn:Decision")&&en(e.decisionLogic,"dmn:DecisionTable")}},{className:"dmn-icon-literal-expression",matches:function(e){e=e.businessObject;return en(e,"dmn:Decision")&&en(e.decisionLogic,"dmn:LiteralExpression")}}],Vi=function(){function o(e,t,n,r){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this._injector=e,this._eventBus=t,this._overlays=n,this._config=r||{enabled:!0},t.on(["shape.added"],function(e){for(var t=e.element,n=0;n<$i.length;n++){var r=$i[n],o=r.matches,r=r.className;o&&o(t)&&i.addOverlay(t,r)}})}var e,t,n;return e=o,(t=[{key:"addOverlay",value:function(e,t){var n=kt('\n      <div class="drill-down-overlay">\n        <span class="'.concat(t,'"></span>\n      </div>\n    ')),t=this._overlays.add(e,{position:{top:2,left:2},html:n});!1!==this._config.enabled&&(mt(n).add("interactive"),this.bindEventListener(e,n,t))}},{key:"bindEventListener",value:function(e,t,n){var r=this,o=this._overlays,i=this._eventBus,o=o._overlayRoot;Pt.bind(o,'[data-overlay-id="'+n+'"]',"click",function(){!1!==i.fire("drillDown.click",{element:e})&&r.drillDown(e)})}},{key:"drillDown",value:function(e){var t=this._injector.get("_parent",!1);if(!t)return!1;e=t.getView(e.businessObject);return!!e&&(t.open(e),!0)}}])&&Li(e.prototype,t),n&&Li(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();Vi.$inject=["injector","eventBus","overlays","config.drillDown"];var zi={__depends__:[Bi],__init__:["drillDown"],drillDown:["type",Vi]},Fi='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21" style="vertical-align:middle"><path fill="#000000" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="#000000" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>';
8/**
9   * This file must not be changed or exchanged.
10   *
11   * @see http://bpmn.io/license for more information.
12   */function Ui(e){return e.join(";")}var Hi,Wi='<div class="bjs-powered-by-lightbox" style="'+Ui(["z-index: 1001","position: fixed","top: 0","left: 0","right: 0","bottom: 0"])+'"><div class="backdrop" style="'+Ui(["width: 100%","height: 100%","background: rgba(40,40,40,0.2)"])+'"></div><div class="notice" style="'+Ui(["position: absolute","left: 50%","top: 40%","transform: translate(-50%)","width: 260px","padding: 10px","background: white","box-shadow: 0 1px 4px rgba(0,0,0,0.3)","font-family: Helvetica, Arial, sans-serif","font-size: 14px","display: flex","line-height: 1.3"])+'"><a href="https://bpmn.io" target="_blank" rel="noopener" style="margin: 15px 20px 15px 10px; align-self: center;">'+Fi+'</a><span>Web-based tooling for BPMN, DMN and CMMN diagrams powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>';var qi=["additionalModules","canvas"];function Gi(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function Ki(r){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?Gi(Object(o),!0).forEach(function(e){var t,n;t=r,e=o[n=e],n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Gi(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))})}return r}function Xi(e){return function(e){if(Array.isArray(e))return Yi(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Yi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yi(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Zi(e,t){if(null==e)return{};var n,r=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols)for(var o=Object.getOwnPropertySymbols(e),i=0;i<o.length;i++)n=o[i],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r}function Qi(e){
13/**
14   * Adds the project logo to the diagram container as
15   * required by the bpmn.io license.
16   *
17   * @see http://bpmn.io/license
18   *
19   * @param {Element} container
20   */
21var t,n;this._container=this._createContainer(),t=this._container,n=kt('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" style="position: absolute; bottom: 15px; right: 15px; z-index: 100;">'+Fi+"</a>"),t.appendChild(n),Ct.bind(n,"click",function(e){Hi||(Hi=kt(Wi),Pt.bind(Hi,".backdrop","click",function(e){document.body.removeChild(Hi)})),document.body.appendChild(Hi),e.preventDefault()}),this._init(this._container,e)}function Ji(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function ea(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ta(e){return Math.log(e)/Math.log(10)}function na(e,t){var n=ta(e.min),e=ta(e.max);return(Math.abs(n)+Math.abs(e))/t}dn(Qi,$o),Qi.prototype.saveSVG=It(function(e){var o=this;return new Promise(function(e){var t=o.get("canvas"),n=t.getDefaultLayer(),r=Dt("defs",t._svg),t=function(e,t){if(void 0===t)return Qn(e);try{Zn(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}(n),r=r&&r.outerHTML||"",n=n.getBBox();e({svg:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with dmn-js / http://bpmn.io --\x3e\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+n.width+'" height="'+n.height+'" viewBox="'+n.x+" "+n.y+" "+n.width+" "+n.height+'" version="1.1">'+r+t+"</svg>"})})}),Qi.prototype.getModules=function(){return this._modules},Qi.prototype.destroy=function(){$o.prototype.destroy.call(this),Bt(this._container)},Qi.prototype.on=function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)},Qi.prototype.off=function(e,t){this.get("eventBus").off(e,t)},Qi.prototype._init=function(e,t){var n=t.additionalModules,r=t.canvas,o=Zi(t,qi),i=t.modules||this.getModules(),n=[].concat([{drd:["value",this]}],Xi(i),Xi(n||[])),n=Ki(Ki({},o),{},{canvas:Ki(Ki({},r),{},{container:e}),modules:n});$o.call(this,n),t&&t.container&&this.attachTo(t.container)},Qi.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},Qi.prototype._createContainer=function(){return kt('<div class="dmn-drd-container"></div>')},Qi.prototype.open=function(e){var o=this;return new Promise(function(n,r){var t;try{return o._definitions&&o.clear(),o._definitions=e,Fo(o,e,function(e,t){e?(e.warnings=t||[],r(e)):n({warnings:t||[]})})}catch(e){t=e}t?(t.warnings=t.warnings||[],r(t)):n({warnings:[]})})},Qi.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach();var t=this._container;e.appendChild(t),this._emit("attach",{}),this.get("canvas").resized()},Qi.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},Qi.prototype._modules=[ai,ci,Si,Bi,Ni,zi];var ra=Math.sign||function(e){return 0<=e?1:-1},oa={min:.2,max:4};function ia(t,e,n){t=t||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=A(this._handleWheel,this),this._totalDelta=0,this._scale=t.scale||.75;var r=this;e.on("canvas.init",function(e){r._init(!1!==t.enabled)})}ia.$inject=["config.zoomScroll","eventBus","canvas"],ia.prototype.scroll=function(e){this._canvas.scroll(e)},ia.prototype.reset=function(){this._canvas.zoom("fit-viewport")},ia.prototype.zoom=function(e,t){var n=na(oa,20);this._totalDelta+=e,.1<Math.abs(this._totalDelta)&&(this._zoom(e,t,n),this._totalDelta=0)},ia.prototype._handleWheel=function(e){var t,n,r,o,i;xt(e.target,".djs-scrollable",!0)||(o=this._container,e.preventDefault(),t=e.ctrlKey,n=e.shiftKey,r=-1*this._scale,r*=t?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,t?(i=o.getBoundingClientRect(),o={x:e.clientX-i.left,y:e.clientY-i.top},i=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*ra(e.deltaY)*r,this.zoom(i,o)):(i=n?{dx:r*e.deltaY,dy:0}:{dx:r*e.deltaX,dy:r*e.deltaY},this.scroll(i)))},ia.prototype.stepZoom=function(e,t){var n=na(oa,10);this._zoom(e,t,n)},ia.prototype._zoom=function(e,t,n){var r=this._canvas,o=0<e?1:-1,e=ta(r.zoom()),e=Math.round(e/n)*n;e+=n*o;e=Math.pow(10,e);r.zoom(Math.max(oa.min,Math.min(oa.max,e)),t)},ia.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,r=this._enabled;return r!==(e=void 0===e?!r:e)&&Ct[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e},ia.prototype._init=function(e){this.toggle(e)};var aa={__init__:["zoomScroll"],zoomScroll:["type",ia]},ca=/^djs-cursor-.*$/;function ua(e){var t=mt(document.body);t.removeMatching(ca),e&&t.add("djs-cursor-"+e)}function sa(){ua(null)}var la=5e3;function pa(e,t){function n(){return!1}return t=t||"element.click",e.once(t,la,n),function(){e.off(t,n)}}function fa(i,a){var c;function n(e){var t=c.start,n=c.button,r=pi(e),o=ea(r,t);!c.dragging&&(t=o,15<Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2)))&&(c.dragging=!0,0===n&&pa(i),ua("grab")),c.dragging&&(o=ea(r,c.last||c.start),a.scroll({dx:o.x,dy:o.y}),c.last=r),e.preventDefault()}function r(e){Ct.unbind(document,"mousemove",n),Ct.unbind(document,"mouseup",r),c=null,sa()}i.on("element.mousedown",500,function(e){return function(e){if(!xt(e.target,".djs-draggable")){var t=e.button;if(!(2<=t||e.ctrlKey||e.shiftKey||e.altKey))return c={button:t,start:pi(e)},Ct.bind(document,"mousemove",n),Ct.bind(document,"mouseup",r),!0}}(e.originalEvent)}),this.isActive=function(){return!!c}}fa.$inject=["eventBus","canvas"];var da={__init__:["moveCanvas"],moveCanvas:["type",fa]},ha=Yt(function($e){
22/*! Hammer.JS - v2.0.7 - 2016-04-22
23     * http://hammerjs.github.io/
24     *
25     * Copyright (c) 2016 Jorik Tangelder;
26     * Licensed under the MIT license */
27!function(o,c,s){var i=["","webkit","Moz","MS","ms","o"],e=c.createElement("div"),n="function",a=Math.round,l=Math.abs,u=Date.now;function p(e,t,n){return setTimeout(v(e,n),t)}function r(e,t,n){return Array.isArray(e)&&(f(e,n[t],n),1)}function f(e,t,n){if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(var r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function t(n,e,t){var r="DEPRECATED METHOD: "+e+"\n"+t+" AT \n";return function(){var e=new Error("get-stack-trace"),t=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",e=o.console&&(o.console.warn||o.console.log);return e&&e.call(o.console,r,t),n.apply(this,arguments)}}var d="function"!=typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==s&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}:Object.assign,h=t(function(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;)n&&e[r[o]]!==s||(e[r[o]]=t[r[o]]),o++;return e},"extend","Use `assign`."),y=t(function(e,t){return h(e,t,!0)},"merge","Use `assign`.");function m(e,t,n){var r=t.prototype,t=e.prototype=Object.create(r);t.constructor=e,t._super=r,n&&d(t,n)}function v(e,t){return function(){return e.apply(t,arguments)}}function g(e,t){return Ve(e)==n?e.apply(t&&t[0]||s,t):e}function b(e,t){return e===s?t:e}function _(t,e,n){f(j(e),function(e){t.addEventListener(e,n,!1)})}function w(t,e,n){f(j(e),function(e){t.removeEventListener(e,n,!1)})}function x(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function O(e,t){return-1<e.indexOf(t)}function j(e){return e.trim().split(/\s+/g)}function E(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function C(e){return Array.prototype.slice.call(e,0)}function S(e,n,t){for(var r=[],o=[],i=0;i<e.length;){var a=n?e[i][n]:e[i];E(o,a)<0&&r.push(e[i]),o[i]=a,i++}return r=t?n?r.sort(function(e,t){return e[n]>t[n]}):r.sort():r}function P(e,t){for(var n,r=t[0].toUpperCase()+t.slice(1),o=0;o<i.length;){if((n=(n=i[o])?n+r:t)in e)return n;o++}return s}var k=1;function R(e){e=e.ownerDocument||e;return e.defaultView||e.parentWindow||o}var T="ontouchstart"in o,D=P(o,"PointerEvent")!==s,M=T&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),B="touch",I=25,A=1,N=4,L=8,$=1,V=2,z=4,F=8,U=16,H=V|z,W=F|U,q=H|W,G=["x","y"],K=["clientX","clientY"];function X(t,e){var n=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){g(t.options.enable,[t])&&n.handler(e)},this.init()}function Y(e,t,n){var r=n.pointers.length,o=n.changedPointers.length,i=t&A&&r-o==0,o=t&(N|L)&&r-o==0;n.isFirst=!!i,n.isFinal=!!o,i&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,o=r.length;n.firstInput||(n.firstInput=Z(t));1<o&&!n.firstMultiple?n.firstMultiple=Z(t):1===o&&(n.firstMultiple=!1);var i=n.firstInput,a=n.firstMultiple,c=(a||i).center,o=t.center=Q(r);t.timeStamp=u(),t.deltaTime=t.timeStamp-i.timeStamp,t.angle=ne(c,o),t.distance=te(c,o),function(e,t){var n=t.center,r=e.offsetDelta||{},o=e.prevDelta||{},i=e.prevInput||{};t.eventType!==A&&i.eventType!==N||(o=e.prevDelta={x:i.deltaX||0,y:i.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y});t.deltaX=o.x+(n.x-r.x),t.deltaY=o.y+(n.y-r.y)}(n,t),t.offsetDirection=ee(t.deltaX,t.deltaY);o=J(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=o.x,t.overallVelocityY=o.y,t.overallVelocity=l(o.x)>l(o.y)?o.x:o.y,t.scale=a?function(e,t){return te(t[0],t[1],K)/te(e[0],e[1],K)}(a.pointers,r):1,t.rotation=a?function(e,t){return ne(t[1],t[0],K)+ne(e[1],e[0],K)}(a.pointers,r):0,t.maxPointers=!n.prevInput||t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers,function(e,t){var n,r,o=e.lastInterval||t,i=t.timeStamp-o.timeStamp;{var a,c,u;t.eventType!=L&&(I<i||o.velocity===s)?(a=t.deltaX-o.deltaX,c=t.deltaY-o.deltaY,u=J(i,a,c),n=u.x,r=u.y,u=l(u.x)>l(u.y)?u.x:u.y,c=ee(a,c),e.lastInterval=t):(u=o.velocity,n=o.velocityX,r=o.velocityY,c=o.direction)}t.velocity=u,t.velocityX=n,t.velocityY=r,t.direction=c}(n,t);e=e.element;x(t.srcEvent.target,e)&&(e=t.srcEvent.target);t.target=e}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function Z(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:a(e.pointers[n].clientX),clientY:a(e.pointers[n].clientY)},n++;return{timeStamp:u(),pointers:t,center:Q(t),deltaX:e.deltaX,deltaY:e.deltaY}}function Q(e){var t=e.length;if(1===t)return{x:a(e[0].clientX),y:a(e[0].clientY)};for(var n=0,r=0,o=0;o<t;)n+=e[o].clientX,r+=e[o].clientY,o++;return{x:a(n/t),y:a(r/t)}}function J(e,t,n){return{x:t/e||0,y:n/e||0}}function ee(e,t){return e===t?$:l(e)>=l(t)?e<0?V:z:t<0?F:U}function te(e,t,n){var r=t[(n=n||G)[0]]-e[n[0]],n=t[n[1]]-e[n[1]];return Math.sqrt(r*r+n*n)}function ne(e,t,n){var r=t[(n=n||G)[0]]-e[n[0]],n=t[n[1]]-e[n[1]];return 180*Math.atan2(n,r)/Math.PI}X.prototype={handler:function(){},init:function(){this.evEl&&_(this.element,this.evEl,this.domHandler),this.evTarget&&_(this.target,this.evTarget,this.domHandler),this.evWin&&_(R(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(R(this.element),this.evWin,this.domHandler)}};var re={mousedown:A,mousemove:2,mouseup:N};function oe(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,X.apply(this,arguments)}m(oe,X,{handler:function(e){var t=re[e.type];t&A&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=N),this.pressed&&(t&N&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}});var ie={pointerdown:A,pointermove:2,pointerup:N,pointercancel:L,pointerout:L},ae={2:B,3:"pen",4:"mouse",5:"kinect"},ce="pointerdown",ue="pointermove pointerup pointercancel";function se(){this.evEl=ce,this.evWin=ue,X.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}o.MSPointerEvent&&!o.PointerEvent&&(ce="MSPointerDown",ue="MSPointerMove MSPointerUp MSPointerCancel"),m(se,X,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),o=ie[r],i=ae[e.pointerType]||e.pointerType,a=i==B,r=E(t,e.pointerId,"pointerId");o&A&&(0===e.button||a)?r<0&&(t.push(e),r=t.length-1):o&(N|L)&&(n=!0),r<0||(t[r]=e,this.callback(this.manager,o,{pointers:t,changedPointers:[e],pointerType:i,srcEvent:e}),n&&t.splice(r,1))}});var le={touchstart:A,touchmove:2,touchend:N,touchcancel:L};function pe(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,X.apply(this,arguments)}m(pe,X,{handler:function(e){var t,n=le[e.type];n===A&&(this.started=!0),this.started&&(t=function(e,t){var n=C(e.touches),e=C(e.changedTouches);t&(N|L)&&(n=S(n.concat(e),"identifier",!0));return[n,e]}.call(this,e,n),n&(N|L)&&t[0].length-t[1].length==0&&(this.started=!1),this.callback(this.manager,n,{pointers:t[0],changedPointers:t[1],pointerType:B,srcEvent:e}))}});var fe={touchstart:A,touchmove:2,touchend:N,touchcancel:L};function de(){this.evTarget="touchstart touchmove touchend touchcancel",this.targetIds={},X.apply(this,arguments)}m(de,X,{handler:function(e){var t=fe[e.type],n=function(e,t){var n=C(e.touches),r=this.targetIds;if(t&(2|A)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var o,i,a=C(e.changedTouches),c=[],u=this.target;if(i=n.filter(function(e){return x(e.target,u)}),t===A)for(o=0;o<i.length;)r[i[o].identifier]=!0,o++;o=0;for(;o<a.length;)r[a[o].identifier]&&c.push(a[o]),t&(N|L)&&delete r[a[o].identifier],o++;if(c.length)return[S(i.concat(c),"identifier",!0),c]}.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:B,srcEvent:e})}});var he=2500;function ye(){X.apply(this,arguments);var e=v(this.handler,this);this.touch=new de(this.manager,e),this.mouse=new oe(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function me(e){var t,n,e=e.changedPointers[0];e.identifier===this.primaryTouch&&(t={x:e.clientX,y:e.clientY},this.lastTouches.push(t),n=this.lastTouches,setTimeout(function(){var e=n.indexOf(t);-1<e&&n.splice(e,1)},he))}m(ye,X,{handler:function(e,t,n){var r=n.pointerType==B,o="mouse"==n.pointerType;if(!(o&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)!function(e,t){e&A?(this.primaryTouch=t.changedPointers[0].identifier,me.call(this,t)):e&(N|L)&&me.call(this,t)}.call(this,t,n);else if(o&&function(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var o=this.lastTouches[r],i=Math.abs(t-o.x),o=Math.abs(n-o.y);if(i<=25&&o<=25)return!0}return!1}.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ve=P(e.style,"touchAction"),ge=ve!==s,be="manipulation",_e="none",we="pan-x",xe="pan-y",Oe=function(){if(!ge)return!1;var t={},n=o.CSS&&o.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(e){t[e]=!n||o.CSS.supports("touch-action",e)}),t}();function je(e,t){this.manager=e,this.set(t)}je.prototype={set:function(e){"compute"==e&&(e=this.compute()),ge&&this.manager.element.style&&Oe[e]&&(this.manager.element.style[ve]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return f(this.manager.recognizers,function(e){g(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),function(e){if(O(e,_e))return _e;var t=O(e,we),n=O(e,xe);if(t&&n)return _e;if(t||n)return t?we:xe;if(O(e,be))return be;return"auto"}(t.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,o=O(r,_e)&&!Oe.none,i=O(r,xe)&&!Oe[xe],a=O(r,we)&&!Oe[we];if(o){var c=1===e.pointers.length,r=e.distance<2,e=e.deltaTime<250;if(c&&r&&e)return}if(!a||!i)return o||i&&n&H||a&&n&W?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};function Ee(e){this.options=d({},this.defaults,e||{}),this.id=k++,this.manager=null,this.options.enable=b(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Ce(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Se(e){return e==U?"down":e==F?"up":e==V?"left":e==z?"right":""}function Pe(e,t){t=t.manager;return t?t.get(e):e}function ke(){Ee.apply(this,arguments)}function Re(){ke.apply(this,arguments),this.pX=null,this.pY=null}function Te(){ke.apply(this,arguments)}function De(){Ee.apply(this,arguments),this._timer=null,this._input=null}function Me(){ke.apply(this,arguments)}function Be(){ke.apply(this,arguments)}function Ie(){Ee.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Ae(e,t){return(t=t||{}).recognizers=b(t.recognizers,Ae.defaults.preset),new Ne(e,t)}Ee.prototype={defaults:{},set:function(e){return d(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(r(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Pe(e,this)).id]||(t[e.id]=e).recognizeWith(this),this},dropRecognizeWith:function(e){return r(e,"dropRecognizeWith",this)||(e=Pe(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(r(e,"requireFailure",this))return this;var t=this.requireFail;return-1===E(t,e=Pe(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(r(e,"dropRequireFailure",this))return this;e=Pe(e,this);e=E(this.requireFail,e);return-1<e&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return 0<this.requireFail.length},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(t){var n=this,e=this.state;function r(e){n.manager.emit(e,t)}e<8&&r(n.options.event+Ce(e)),r(n.options.event),t.additionalEvent&&r(t.additionalEvent),8<=e&&r(n.options.event+Ce(e))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=32},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){e=d({},e);if(!g(this.options.enable,[this,e]))return this.reset(),void(this.state=32);56&this.state&&(this.state=1),this.state=this.process(e),30&this.state&&this.tryEmit(e)},process:function(e){},getTouchAction:function(){},reset:function(){}},m(ke,Ee,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,e=this.attrTest(e);return r&&(n&L||!e)?16|t:r||e?n&N?8|t:2&t?4|t:2:32}}),m(Re,ke,{defaults:{event:"pan",threshold:10,pointers:1,direction:q},getTouchAction:function(){var e=this.options.direction,t=[];return e&H&&t.push(xe),e&W&&t.push(we),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,o=e.direction,i=e.deltaX,a=e.deltaY;return o&t.direction||(r=t.direction&H?(o=0===i?$:i<0?V:z,n=i!=this.pX,Math.abs(e.deltaX)):(o=0===a?$:a<0?F:U,n=a!=this.pY,Math.abs(e.deltaY))),e.direction=o,n&&r>t.threshold&&o&t.direction},attrTest:function(e){return ke.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Se(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),m(Te,ke,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[_e]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){var t;1!==e.scale&&(t=e.scale<1?"in":"out",e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),m(De,Ee,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,o=e.deltaTime>t.time;if(this._input=e,!r||!n||e.eventType&(N|L)&&!o)this.reset();else if(e.eventType&A)this.reset(),this._timer=p(function(){this.state=8,this.tryEmit()},t.time,this);else if(e.eventType&N)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&N?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}}),m(Me,ke,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[_e]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),m(Be,ke,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:H|W,pointers:1},getTouchAction:function(){return Re.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(H|W)?t=e.overallVelocity:n&H?t=e.overallVelocityX:n&W&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&l(t)>this.options.velocity&&e.eventType&N},emit:function(e){var t=Se(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),m(Ie,Ee,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[be]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,o=e.deltaTime<t.time;if(this.reset(),e.eventType&A&&0===this.count)return this.failTimeout();if(r&&o&&n){if(e.eventType!=N)return this.failTimeout();o=!this.pTime||e.timeStamp-this.pTime<t.interval,n=!this.pCenter||te(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,n&&o?this.count+=1:this.count=1,this._input=e,0==this.count%t.taps)return this.hasRequireFailures()?(this._timer=p(function(){this.state=8,this.tryEmit()},t.interval,this),2):8}return 32},failTimeout:function(){return this._timer=p(function(){this.state=32},this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Ae.VERSION="2.0.7",Ae.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[Me,{enable:!1}],[Te,{enable:!1},["rotate"]],[Be,{direction:H}],[Re,{direction:H},["swipe"]],[Ie],[Ie,{event:"doubletap",taps:2},["tap"]],[De]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Ne(e,t){this.options=d({},Ae.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((e=this).options.inputClass||(D?se:M?de:T?ye:oe))(e,Y),this.touchAction=new je(this,this.options.touchAction),Le(this,!0),f(this.options.recognizers,function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}function Le(n,r){var o,i=n.element;i.style&&(f(n.options.cssProps,function(e,t){o=P(i.style,t),r?(n.oldCssProps[o]=i.style[o],i.style[o]=e):i.style[o]=n.oldCssProps[o]||""}),r||(n.oldCssProps={}))}Ne.prototype={set:function(e){return d(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t,n=this.session;if(!n.stopped){this.touchAction.preventDefaults(e);var r=this.recognizers,o=n.curRecognizer;(!o||8&o.state)&&(o=n.curRecognizer=null);for(var i=0;i<r.length;)t=r[i],2===n.stopped||o&&t!=o&&!t.canRecognizeWith(o)?t.reset():t.recognize(e),!o&&14&t.state&&(o=n.curRecognizer=t),i++}},get:function(e){if(e instanceof Ee)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(r(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),(e.manager=this).touchAction.update(),e},remove:function(e){return r(e,"remove",this)||!(e=this.get(e))||-1!==(e=E(t=this.recognizers,e))&&(t.splice(e,1),this.touchAction.update()),this;var t},on:function(e,t){if(e!==s&&t!==s){var n=this.handlers;return f(j(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this}},off:function(e,t){if(e!==s){var n=this.handlers;return f(j(e),function(e){t?n[e]&&n[e].splice(E(n[e],t),1):delete n[e]}),this}},emit:function(e,t){var n,r,o;this.options.domEvents&&(n=e,r=t,(o=c.createEvent("Event")).initEvent(n,!0,!0),(o.gesture=r).target.dispatchEvent(o));var i=this.handlers[e]&&this.handlers[e].slice();if(i&&i.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var a=0;a<i.length;)i[a](t),a++}},destroy:function(){this.element&&Le(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},d(Ae,{INPUT_START:A,INPUT_MOVE:2,INPUT_END:N,INPUT_CANCEL:L,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:32,DIRECTION_NONE:$,DIRECTION_LEFT:V,DIRECTION_RIGHT:z,DIRECTION_UP:F,DIRECTION_DOWN:U,DIRECTION_HORIZONTAL:H,DIRECTION_VERTICAL:W,DIRECTION_ALL:q,Manager:Ne,Input:X,TouchAction:je,TouchInput:de,MouseInput:oe,PointerEventInput:se,TouchMouseInput:ye,SingleTouchInput:pe,Recognizer:Ee,AttrRecognizer:ke,Tap:Ie,Pan:Re,Swipe:Be,Pinch:Te,Rotate:Me,Press:De,on:_,off:w,each:f,merge:y,extend:h,assign:d,inherit:m,bindFn:v,prefixed:P}),(void 0!==o?o:"undefined"!=typeof self?self:{}).Hammer=Ae,"function"==typeof s&&s.amd?s(function(){return Ae}):$e.exports?$e.exports=Ae:o.Hammer=Ae}(window,document)}),ya=["mousedown","mouseup","mouseover","mouseout","click","dblclick"];function ma(e,t){return t.get(e,!1)}function va(e){e.preventDefault(),"function"==typeof e.stopPropagation?e.stopPropagation():e.srcEvent&&"function"==typeof e.srcEvent.stopPropagation&&e.srcEvent.stopPropagation(),"function"==typeof e.stopImmediatePropagation&&e.stopImmediatePropagation()}function ga(t){function e(e){setTimeout(function(){x(ya,function(e){Ct.unbind(t,e,va,!0)})},500)}Ct.bind(t,"touchstart",function(e){x(ya,function(e){Ct.bind(t,e,va,!0)})},!0),Ct.bind(t,"touchend",e,!0),Ct.bind(t,"touchcancel",e,!0);var o=new ha.Manager(t,{inputClass:ha.TouchInput,recognizers:[],domEvents:!0}),n=new ha.Tap,r=new ha.Pan({threshold:10}),i=new ha.Press,a=new ha.Pinch,c=new ha.Tap({event:"doubletap",taps:2});return a.requireFailure(r),a.requireFailure(i),o.add([r,i,a,c,n]),o.reset=function(e){var n=this.recognizers,r=this.session;r.stopped||(o.stop(e),setTimeout(function(){for(var e,t=0;e=n[t];t++)e.reset(),e.state=8;r.curRecognizer=null},0))},o.on("hammer.input",function(e){e.srcEvent.defaultPrevented&&o.reset(!0)}),o}function ba(e,a,t,c,o){var u,r=ma("dragging",e),s=ma("move",e),n=ma("contextPad",e),i=ma("palette",e);function l(n,r){return function(e){var t=p(e.target),t=t&&c.get(t);return r&&(e.srcEvent.button=r),o.fire(n,e,t)}}function p(e){return xt(e,"svg, .djs-element",!0)}function f(e){function t(e){var r,o,t=p(e.target),t=t&&c.get(t);if(s&&a.getRootElement()!==t)return s.start(e,t,!0);function n(e){var t=e.deltaX-r,n=e.deltaY-o;a.scroll({dx:t,dy:n}),r=e.deltaX,o=e.deltaY}function i(e){u.off("panmove",n),u.off("panend",i),u.off("pancancel",i)}o=r=0,u.on("panmove",n),u.on("panend",i),u.on("pancancel",i)}(u=ga(e)).on("tap",l("element.click")),u.on("doubletap",l("element.dblclick",1)),u.on("panstart",t),u.on("press",t),u.on("pinchstart",function(e){var n=a.zoom(),r=e.center;function t(e){var t=1-(1-e.scale)/1.5,t=Math.max(.2,Math.min(4,t*n));a.zoom(t,r),va(e)}function o(e){u.off("pinchmove",t),u.off("pinchend",o),u.off("pinchcancel",o),u.reset(!0)}u.on("pinchmove",t),u.on("pinchend",o),u.on("pinchcancel",o)})}r&&t.on("drag.move",function(e){var t,n=e.originalEvent;!n||n instanceof MouseEvent||(t=pi(n),(t=(n=p(document.elementFromPoint(t.x,t.y)))&&c.get(n))!==e.hover&&(e.hover&&r.out(e),t&&(r.hover({element:t,gfx:n}),e.hover=t,e.hoverGfx=n)))}),n&&t.on("contextPad.create",function(e){e=ga(e.pad.html);e.on("panstart",function(e){n.trigger("dragstart",e,!0)}),e.on("press",function(e){n.trigger("dragstart",e,!0)}),e.on("tap",function(e){n.trigger("click",e)})}),i&&t.on("palette.create",function(e){e=ga(e.container);e.on("panstart",function(e){i.trigger("dragstart",e,!0)}),e.on("press",function(e){i.trigger("dragstart",e,!0)}),e.on("tap",function(e){i.trigger("click",e)})}),t.on("canvas.init",function(e){f(e.svg)})}function _a(e,t){var n=this;t.on("canvas.init",function(e){n.addBBoxMarker(e.svg)})}ba.$inject=["injector","canvas","eventBus","elementRegistry","interactionEvents","touchFix"],_a.$inject=["canvas","eventBus"],_a.prototype.addBBoxMarker=function(e){var t={fill:"none",class:"outer-bound-marker"},n=Un("rect");Rn(n,{x:-1e4,y:1e4,width:10,height:10}),Rn(n,t),Cn(e,n);n=Un("rect");Rn(n,{x:1e4,y:1e4,width:10,height:10}),Rn(n,t),Cn(e,n)};var wa={__depends__:[{__depends__:[bi],__init__:["touchInteractionEvents"],touchInteractionEvents:["type",ba],touchFix:["type",_a]}]};function xa(e){Qi.call(this,e)}function Oa(e){return e&&e[e.length-1]}function ja(e){return e.y}function Ea(e){return e.x}dn(xa,Qi),xa.prototype._modules=[].concat(xa.prototype._modules,xa.prototype._navigationModules=[aa,da,wa]);var Ca={left:Ea,center:Ea,right:function(e){return e.x+e.width},top:ja,middle:ja,bottom:function(e){return e.y+e.height}};function Sa(e,t){this._modeling=e,this._rules=t}Sa.$inject=["modeling","rules"],Sa.prototype._getOrientationDetails=function(e){var t="x",n="width";return-1!==["top","bottom","middle"].indexOf(e)&&(t="y",n="height"),{axis:t,dimension:n}},Sa.prototype._isType=function(e,t){return-1!==t.indexOf(e)},Sa.prototype._alignmentPosition=function(e,t){var n,r=this._getOrientationDetails(e),o=r.axis,i=r.dimension,a={},c={},u=!1;if(this._isType(e,["left","top"]))a[e]=t[0][o];else if(this._isType(e,["right","bottom"]))n=Oa(t),a[e]=n[o]+n[i];else if(this._isType(e,["center","middle"])){if(x(t,function(e){var t=e[o]+Math.round(e[i]/2);c[t]?c[t].elements.push(e):c[t]={elements:[e],center:t}}),r=T(c,function(e){return 1<e.elements.length&&(u=!0),e.elements.length}),u)return a[e]=Oa(r).center,a;r=t[0],n=Oa(t=T(t,function(e){return e[o]+e[i]})),a[e]=(n=n,Math.round((r[o]+n[o]+n[i])/2))}return a},Sa.prototype.trigger=function(e,t){var n=this._modeling,r=w(e,function(e){return!(e.waypoints||e.host||e.labelTarget)}),e=this._rules.allowed("elements.align",{elements:r});(r=y(e)?e:r).length<2||!e||(r=T(r,Ca[t]),t=this._alignmentPosition(t,r),n.alignElements(r,t))};var Pa={__init__:["alignElements"],alignElements:["type",Sa]},ka=10,Ra=50;function Ta(e,t,n,r){for(var o;o=function(e,t,n){var r={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height};return b(function(e){var t=Ma(e);e.host&&(t=t.concat(Ma(e.host)));e.attachers&&(t=t.concat(e.attachers.reduce(function(e,t){return e.concat(Ma(t))},[])));return t}(e),function(e){return e!==n&&"intersect"===ao(e,r,ka)})}(e,n,t);)n=r(t,n,o);return n}function Da(r,e){var t=(e=e||{}).defaultDistance||Ra,n=e.direction||"e",o=e.filter,i=e.getWeight||function(e){return e.source===r?1:-1},a=e.maxDistance||250,c=e.reference||"start";function u(e,t){return"n"===n?"start"===c?no(e).top-no(t).bottom:"center"===c?no(e).top-io(t).y:no(e).top-no(t).top:"w"===n?"start"===c?no(e).left-no(t).right:"center"===c?no(e).left-io(t).x:no(e).left-no(t).left:"s"===n?"start"===c?no(t).top-no(e).bottom:"center"===c?io(t).y-no(e).bottom:no(t).bottom-no(e).bottom:"start"===c?no(t).left-no(e).right:"center"===c?io(t).x-no(e).right:no(t).right-no(e).right}o=o||Ba,e=r.incoming.filter(o).map(function(e){var t=i(e),n=t<0?u(e.source,r):u(r,e.source);return{id:e.source.id,distance:n,weight:t}}),o=r.outgoing.filter(o).map(function(e){var t=i(e),n=0<t?u(r,e.target):u(e.target,r);return{id:e.target.id,distance:n,weight:t}});return O(e.concat(o).reduce(function(e,t){return e[t.id+"__weight_"+t.weight]=t,e},{}),function(e,t){var n=t.distance,t=t.weight;return n<0||a<n||(e[String(n)]||(e[String(n)]=0),e[String(n)]+=+t,(!e.distance||e[e.distance]<e[String(n)])&&(e.distance=n)),e},{}).distance||t}function Ma(e){return e.outgoing.map(function(e){return e.target}).concat(e.incoming.map(function(e){return e.source}))}function Ba(){return!0}function Ia(o,i,t){o.on("autoPlace",100,function(e){var t=e.shape;return function(e,t,n){n=n||{};var r=n.defaultDistance||Ra,n=io(e);return{x:no(e).right+r+t.width/2,y:n.y}}(e.source,t)}),o.on("autoPlace.end",function(e){t.scrollToElement(e.shape)}),this.append=function(e,t,n){o.fire("autoPlace.start",{source:e,shape:t});var r=o.fire("autoPlace",{source:e,shape:t}),n=i.appendShape(e,t,r,e.parent,n);return o.fire("autoPlace.end",{source:e,shape:n}),n}}function Aa(e,t){e.on("autoPlace.end",500,function(e){t.select(e.shape)})}Ia.$inject=["eventBus","modeling","canvas"],Aa.$inject=["eventBus","selection"];var Na={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",Ia],autoPlaceSelectionBehavior:["type",Aa]},La={width:135,height:46},$a={width:180,height:80},Va={width:125,height:45},za={width:100,height:63};function Fa(e){Do.call(this),this._drdFactory=e}dn(Fa,Do),Fa.$inject=["drdFactory"],Fa.prototype.baseCreate=Do.prototype.create,Fa.prototype.create=function(e,t){return this.createDrdElement(e,t)},Fa.prototype.createDrdElement=function(e,t){var n=this._drdFactory,r=(t=t||{}).businessObject;if(!r){if(!t.type)throw new Error("no shape type specified");r=n.create(t.type)}return r.di||("connection"===e?r.di=n.createDiEdge(r,[]):"shape"===e&&(r.di=n.createDiShape(r,{}))),n=this._getDefaultSize(r),t=L({businessObject:r,id:r.id},n,t),this.baseCreate(e,t)},Fa.prototype._getDefaultSize=function(e){return en(e,"dmn:BusinessKnowledgeModel")?La:en(e,"dmn:Decision")?$a:en(e,"dmn:InputData")?Va:en(e,"dmn:KnowledgeSource")?za:{width:100,height:80}};var Ua="left",Ha="right",Wa=60,qa=$a.width;function Ga(e,t){return en(t,"dmn:TextAnnotation")?(o={x:(o=no(e)).right+t.width/2,y:o.top-50-t.height/2},Ta(e,t,o,function(u){return function(o,i,a){var c={x:i.x,y:i.y};return["x","y"].forEach(function(e){var t,n,r=u[e];r&&(t="x"===e?"width":"height",n=r.margin,r=r.minDistance,c[e]=n<0?Math.min(a[e]+n-o[t]/2,i[e]-r+n):Math.max(a[e]+a[t]+n+o[t]/2,i[e]+r+n))}),c}}({y:{margin:-30,minDistance:20}}))):en(t,"dmn:DRGElement")?(r=t,o=no(n=e),t=io(n),e=Da(n,{defaultDistance:180,direction:"s",getWeight:function(e){return e.target===n?1:-1},filter:Ka,reference:"center"}),e={x:t.x,y:o.bottom+e},Ta(n,r,e,function(e){var r,o,i=io(e);return function(e,t,n){n=r?(t.x<i.x?r=n:o=n,Xa(i,io(r))<Xa(i,io(o))?Ua:Ha):0<io(o=r=n).x-i.x?Ua:Ha;return n===Ua?{x:Math.min(io(r).x-qa-Wa,no(r).left-Wa-e.width/2),y:t.y}:{x:Math.max(io(o).x+qa+Wa,no(o).right+Wa+e.width/2),y:t.y}}}(n))):void 0;var n,r,o}function Ka(e){return!en(e,"dmn:Association")}function Xa(e,t){return Math.abs(t.x-e.x)}function Ya(e){e.on("autoPlace",function(e){var t=e.shape;return Ga(e.source,t)})}Ya.$inject=["eventBus"];var Za={__depends__:[Na],__init__:["dmnAutoPlace"],dmnAutoPlace:["type",Ya]};function Qa(o,t,e){var n,r,i=this,a=e.get("dragging",!1);a&&t.on("drag.start",function(e){t.once("drag.move",1500,function(e){var t,n,r;(t=e).hover||(n=t.originalEvent,e=(r=i._findTargetGfx(n))&&o.get(r),r&&e&&(t.stopPropagation(),a.hover({element:e,gfx:r}),a.move(n)))})}),t.on("element.hover",function(e){n=e.gfx,r=e.element}),t.on("element.hover",1500,function(e){r&&t.fire("element.out",{element:r,gfx:n})}),t.on("element.out",function(){r=n=null}),this._findTargetGfx=function(e){if(e instanceof MouseEvent)return e=pi(e),xt(document.elementFromPoint(e.x,e.y),"svg, .djs-element",!0)}}Qa.$inject=["elementRegistry","eventBus","injector"];var Ja={__init__:["hoverFix"],hoverFix:["type",Qa]},ec=Math.round,tc="djs-drag-active";function nc(e){e.preventDefault()}function rc(l,u,s,r){var p,f={threshold:5,trapClick:!0};function d(e){var t=u.viewbox(),n=u._container.getBoundingClientRect();return{x:t.x+(e.x-n.left)/t.scale,y:t.y+(e.y-n.top)/t.scale}}function h(e,t){t=t||p;var n=l.createEvent(L({},t.payload,t.data,{isTouch:t.isTouch}));return!1!==l.fire("drag."+e,n)&&l.fire(t.prefix+"."+e,n)}function y(e,t){var n=p.payload,r=p.displacement,o=p.globalStart,i=pi(e),a=ea(i,o),c=p.localStart,o=d(i),i=ea(o,c);if(!p.active&&(t||(a=a,Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2))>p.threshold))){if(L(n,{x:ec(c.x+r.x),y:ec(c.y+r.y),dx:0,dy:0},{originalEvent:e}),!1===h("start"))return x();p.active=!0,p.keepSelection||(n.previousSelection=s.get(),s.select(null)),p.cursor&&ua(p.cursor),u.addMarker(u.getRootElement(),tc)}li(e),p.active&&(L(n,{x:ec(o.x+r.x),y:ec(o.y+r.y),dx:ec(i.x),dy:ec(i.y)},{originalEvent:e}),h("move"))}function m(e){var t=!0;p.active&&(e&&li(p.payload.originalEvent=e),t=h("end")),!1===t&&h("rejected"),h("ended",n(!0!==t))}function v(e){27===e.which&&(nc(e),x())}function g(e){var t;p.active&&(t=pa(l),setTimeout(t,400),nc(e)),m(e)}function b(e){y(e)}function _(e){var t=p.payload;t.hoverGfx=e.gfx,t.hover=e.element,h("hover")}function w(e){h("out");var t=p.payload;t.hoverGfx=null,t.hover=null}function x(e){var t;p&&((t=p.active)&&h("cancel"),e=n(e),t&&h("canceled",e))}function n(e){h("cleanup"),sa(),n=p.trapClick?g:m,Ct.unbind(document,"mousemove",y),Ct.unbind(document,"dragstart",nc),Ct.unbind(document,"selectstart",nc),Ct.unbind(document,"mousedown",n,!0),Ct.unbind(document,"mouseup",n,!0),Ct.unbind(document,"keyup",v),Ct.unbind(document,"touchstart",b,!0),Ct.unbind(document,"touchcancel",x,!0),Ct.unbind(document,"touchmove",y,!0),Ct.unbind(document,"touchend",m,!0),l.off("element.hover",_),l.off("element.out",w),u.removeMarker(u.getRootElement(),tc);var t,n=p.payload.previousSelection;return!1!==e&&n&&!s.get().length&&(t=(t=n).filter(function(e){return r.get(e.id)})).length&&s.select(t),t=p,p=null,t}l.on("diagram.destroy",x),this.init=function(e,t,n,r){p&&x(!1),"string"==typeof t&&(r=n,n=t,t=null);var o,i,a,c,u=(r=L({},f,r||{})).data||{},s=r.trapClick?g:m;e?(o=si(e)||e,i=pi(e),li(e),"dragstart"===o.type&&nc(o)):(o=null,i={x:0,y:0}),a=d(i),t=t||a,c=o,c="undefined"!=typeof TouchEvent&&c instanceof TouchEvent,p=L({prefix:n,data:u,payload:{},globalStart:i,displacement:ea(t,a),localStart:a,isTouch:c},r),r.manual||(c?(Ct.bind(document,"touchstart",b,!0),Ct.bind(document,"touchcancel",x,!0),Ct.bind(document,"touchmove",y,!0),Ct.bind(document,"touchend",m,!0)):(Ct.bind(document,"mousemove",y),Ct.bind(document,"dragstart",nc),Ct.bind(document,"selectstart",nc),Ct.bind(document,"mousedown",s,!0),Ct.bind(document,"mouseup",s,!0)),Ct.bind(document,"keyup",v),l.on("element.hover",_),l.on("element.out",w)),h("init"),r.autoActivate&&y(e,!0)},this.move=y,this.hover=_,this.out=w,this.end=m,this.cancel=x,this.context=function(){return p},this.setOptions=function(e){L(f,e)}}rc.$inject=["eventBus","canvas","selection","elementRegistry"];var oc={__depends__:[Ja,Si],dragging:["type",rc]};function ic(e,t,n){this._canvas=n,this._opts=L({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},e);var r=this;t.on("drag.move",function(e){e=r._toBorderPoint(e);r.startScroll(e)}),t.on(["drag.cleanup"],function(){r.stopScroll()})}ic.$inject=["config.autoScroll","eventBus","canvas"],ic.prototype.startScroll=function(e){var t=this._canvas,n=this._opts,r=this,o=t.getContainer().getBoundingClientRect(),i=[e.x,e.y,o.width-e.x,o.height-e.y];this.stopScroll();for(var a=0,c=0,u=0;u<4;u++)!function(e,t,n){if(t<e&&e<n)return!0;return!1}(i[u],n.scrollThresholdOut[u],n.scrollThresholdIn[u])||(0===u?a=n.scrollStep:1==u?c=n.scrollStep:2==u?a=-n.scrollStep:3==u&&(c=-n.scrollStep));0===a&&0===c||(t.scroll({dx:a,dy:c}),this._scrolling=setTimeout(function(){r.startScroll(e)},n.scrollRepeatTimeout))},ic.prototype.stopScroll=function(){clearTimeout(this._scrolling)},ic.prototype.setOptions=function(e){this._opts=L({},this._opts,e)},ic.prototype._toBorderPoint=function(e){var t=this._canvas._container.getBoundingClientRect(),e=pi(e.originalEvent);return{x:e.x-t.left,y:e.y-t.top}};var ac={__depends__:[oc],__init__:["autoScroll"],autoScroll:["type",ic]};function cc(e){this._commandStack=e.get("commandStack",!1)}cc.$inject=["injector"],cc.prototype.allowed=function(e,t){var n=!0,r=this._commandStack;return void 0===(n=r?r.canExecute(e,t):n)||n};var uc={__init__:["rules"],rules:["type",cc]},sc=Math.round,lc=Math.max;function pc(e,t){return function(e,t){for(var n,r=0;n=e[r];r++)if(gr(n,t)<=10)return{point:e[r],bendpoint:!0,index:r};return null}(e,t)||(n=e,e=(t=eo((e=10,[["M",(t=t).x,t.y],["m",0,-e],["a",e,e,0,1,1,0,2*e],["a",e,e,0,1,1,0,-2*e],["z"]]),(r=[],n.forEach(function(e,t){r.push([0===t?"M":"L",e.x,e.y])}),r)))[0],t=t[t.length-1],e?e!==t?e.segment2!==t.segment2?{point:n[n=lc(e.segment2,t.segment2)-1],bendpoint:!0,index:n}:{point:{x:sc(e.x+t.x)/2,y:sc(e.y+t.y)/2},index:e.segment2}:{point:{x:sc(e.x),y:sc(e.y)},index:e.segment2}:null);var n,r}function fc(e,t){var n=t[0],r=t[1],o={x:r.x-n.x,y:r.y-n.y},r=(t=[n.x,n.y],r=[o.x,o.y],e=[e.x,e.y],-((e=[{n:t[0]-e[0],lambda:r[0]},{n:t[1]-e[1],lambda:r[1]}])[0].n*r[0]+e[1].n*r[1])/(e[0].lambda*r[0]+e[1].lambda*r[1]));return{x:n.x+r*o.x,y:n.y+r*o.y}}function dc(e,t){var t=fc(e,t),e={x:t.x-e.x,y:t.y-e.y};return e=e,Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}var hc="djs-bendpoint",yc="djs-segment-dragger";function mc(e,t,n){return pc(t,(t=e,n=pi(e=n),e={x:(e=t._container.getBoundingClientRect()).left,y:e.top},{x:(t=t.viewbox()).x+(n.x-e.x)/t.scale,y:t.y+(n.y-e.y)/t.scale}))}function vc(e,t){var n=Un("g");In(n).add(hc),Cn(e,n);e=Un("circle");Rn(e,{cx:0,cy:0,r:4}),In(e).add("djs-visual"),Cn(n,e);e=Un("circle");return Rn(e,{cx:0,cy:0,r:10}),In(e).add("djs-hit"),Cn(n,e),t&&In(n).add(t),n}function gc(e,t,n,r){var o=Un("g");Cn(e,o);var e=(i=t,e=n.x-t.x,i=n.y-t.y,_c("h"===r?e:i)),i=Un("rect");Rn(i,{x:-9,y:-3,width:18,height:6}),In(i).add("djs-visual"),Cn(o,i);var i=Un("rect");return Rn(i,{x:-e/2,y:-8.5,width:e,height:17}),In(i).add("djs-hit"),Cn(o,i),e=o,i="v"===r?90:0,(r=qn()).setRotate(i,0,0),er(e,r),o}function bc(e,t,n){var r=Un("g"),o=xr(t,n),i=wr(t,n);return Cn(e,r),gc(r,t,n,i),In(r).add(yc),In(r).add("h"===i?"horizontal":"vertical"),Bo(r,o.x,o.y),r}function _c(e){return Math.abs(Math.round(2*e/3))}function wc(e,t){return fc(e,function(e,t){for(var n,r=t.waypoints,o=1/0,i=0;i<r.length-1;i++){var a=r[i],c=r[i+1],c=dc(e,[a,c]);c<o&&(o=c,n=i)}return[r[n],r[n+1]]}(e,t))}var xc=Yt(function(e,t){e.exports=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function e(t){if(arguments.length==0)throw new TypeError("`CSS.escape` requires an argument.");var n=String(t);var r=n.length;var o=-1;var i;var a="";var c=n.charCodeAt(0);while(++o<r){i=n.charCodeAt(o);if(i==0){a+="�";continue}if(i>=1&&i<=31||i==127||o==0&&i>=48&&i<=57||o==1&&i>=48&&i<=57&&c==45){a+="\\"+i.toString(16)+" ";continue}if(o==0&&r==1&&i==45){a+="\\"+n.charAt(o);continue}if(i>=128||i==45||i==95||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122){a+=n.charAt(o);continue}a+="\\"+n.charAt(o)}return a};if(!e.CSS)e.CSS={};return e.CSS.escape=t}(typeof Xt!="undefined"?Xt:Xt)});function Oc(e,u,r,s,l){function n(e,t){var n,r,o,i,a=t.waypoints,c=mc(u,a,e);if(c)return o=c,n=(n=t).waypoints,i=!(o.index<=0||o.bendpoint)&&(o=wr((n={start:n[o.index-1],end:n[o.index]}).start,n.end))?_c("h"===o?n.end.x-n.start.x:n.end.y-n.start.y)/2:null,r=a,o=i,a=(n=c).index,i=n.point,!(a<=0||n.bendpoint)&&(a=xr(n=r[a-1],r=r[a]),n=wr(n,r),r=Math.abs(i.x-a.x),a=Math.abs(i.y-a.y),n&&r<=o&&a<=o)?l.start(e,t,c.index):s.start(e,t,c.index,!c.bendpoint),!0}function a(e,t,n){Ct.bind(e,t,function(e){r.triggerMouseEvent(t,e,n),e.stopPropagation()})}function i(e,t){var n=u.getLayer("overlays"),r=Dt('.djs-bendpoints[data-element-id="'+xc(e.id)+'"]',n);return!r&&t&&(Rn(r=Un("g"),{"data-element-id":e.id}),In(r).add("djs-bendpoints"),Cn(n,r),a(r,"mousedown",e),a(r,"click",e),a(r,"dblclick",e)),r}function c(e,t){return Dt('.djs-segment-dragger[data-segment-idx="'+e+'"]',t)}function o(r,e){e.waypoints.forEach(function(e,t){var n=vc(r);Cn(r,n),Bo(n,e.x,e.y)}),vc(r,"floating")}function p(e,t){for(var n,r,o=t.waypoints,i=1;i<o.length;i++)wr(n=o[i-1],r=o[i])&&(Rn(r=bc(e,n,r),{"data-segment-idx":i}),a(r,"mousemove",t))}function f(e){var t=i(e);return t||(o(t=i(e,!0),e),p(t,e)),t}function t(e){var t=i(e);t&&(x(Mt("."+yc,t),function(e){Nn(e)}),x(Mt("."+hc,t),function(e){Nn(e)}),p(t,e),o(t,e))}function d(e,t,n){var r=c(t.index,e),o=n[t.index-1],e=n[t.index],n=t.point,t=xr(o,e),e=wr(o,e);r&&(r=Dt(".djs-visual",r),t={x:n.x-t.x,y:n.y-t.y},Bo(r,(t="v"===e?{x:t.y,y:t.x}:t).x,t.y))}e.on("connection.changed",function(e){t(e.element)}),e.on("connection.remove",function(e){e=i(e.element);e&&Nn(e)}),e.on("element.marker.update",function(e){var t=e.element;t.waypoints&&(t=f(t),e.add?In(t).add(e.marker):In(t).remove(e.marker))}),e.on("element.mousemove",function(e){var t,n,r=e.element,o=r.waypoints;o&&(t=i(r,!0),(n=mc(u,o,e.originalEvent))&&(r=n,e=Dt(".floating",e=t),r=r.point,e&&Bo(e,r.x,r.y),n.bendpoint||d(t,n,o)))}),e.on("element.mousedown",function(e){if(di(e)){var t=e.originalEvent,e=e.element;if(e.waypoints)return n(t,e)}}),e.on("selection.changed",function(e){e=e.newSelection[0];e&&e.waypoints&&f(e)}),e.on("element.hover",function(e){var t=e.element;t.waypoints&&(f(t),r.registerEvent(e.gfx,"mousemove","element.mousemove"))}),e.on("element.out",function(e){r.unregisterEvent(e.gfx,"mousemove","element.mousemove")}),e.on("element.updateId",function(e){var t=e.element,e=e.newId;!t.waypoints||(t=i(t))&&Rn(t,{"data-element-id":e})}),this.addHandles=f,this.updateHandles=t,this.getBendpointsContainer=i,this.getSegmentDragger=c}Oc.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];var jc=Math.round,Ec="reconnectStart",Cc="reconnectEnd",Sc="updateWaypoints";function Pc(e,t,l,p,f,d){this._injector=e,this.start=function(e,t,n,r){var o=l.getGraphics(t),i=t.source,a=t.target,c=t.waypoints,u=r||0!==n?r||n!==c.length-1?Sc:Cc:Ec,s=u===Sc?"connection.updateWaypoints":"connection.reconnect",c=f.allowed(s,{connection:t,source:i,target:a});!1!==(c=!1===c?f.allowed(s,{connection:t,source:a,target:i}):c)&&p.init(e,"bendpoint.move",{data:{connection:t,connectionGfx:o,context:{allowed:c,bendpointIndex:n,connection:t,source:i,target:a,insert:r,type:u}}})},t.on("bendpoint.move.hover",function(e){var t=e.context,n=t.connection,r=n.source,o=n.target,i=e.hover,a=t.type;if(t.hover=i){var c=a===Sc?"connection.updateWaypoints":"connection.reconnect";if(e=t.allowed=f.allowed(c,{connection:n,source:a===Ec?i:r,target:a===Cc?i:o}))return t.source=a===Ec?i:r,void(t.target=a===Cc?i:o);(e=!1===e?t.allowed=f.allowed(c,{connection:n,source:a===Cc?i:o,target:a===Ec?i:r}):e)&&(t.source=a===Cc?i:o,t.target=a===Ec?i:r)}}),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],function(e){var t=e.context,e=t.type;t.hover=null,t.source=null,t.target=null,e!==Sc&&(t.allowed=!1)}),t.on("bendpoint.move.end",function(e){var t=e.context,n=t.allowed,r=t.bendpointIndex,o=t.connection,i=t.insert,a=o.waypoints.slice(),c=t.source,u=t.target,s=t.type,l=t.hints||{},e={x:jc(e.x),y:jc(e.y)};if(!n)return!1;s===Sc?(i?a.splice(r,0,e):a[r]=e,l.bendpointMove={insert:i,bendpointIndex:r},a=this.cropWaypoints(o,a),d.updateWaypoints(o,function(e){e=e.slice();for(var t,n,r,o=0;e[o];)t=e[o],n=e[o-1],0===gr(t,r=e[o+1])||br(n,r,t)?e.splice(o,1):o++;return e}(a),l)):(s===Ec?(l.docking="source",kc(t)&&(l.docking="target",l.newWaypoints=a.reverse())):s===Cc&&(l.docking="target",kc(t)&&(l.docking="source",l.newWaypoints=a.reverse())),d.reconnect(o,c,u,e,l))},this)}function kc(e){var t=e.hover,n=e.source,r=e.target,e=e.type;return e===Ec?t&&r&&t===r&&n!==r:e===Cc&&(t&&n&&t===n&&n!==r)}Pc.$inject=["injector","eventBus","canvas","dragging","rules","modeling"],Pc.prototype.cropWaypoints=function(e,t){var n=this._injector.get("connectionDocking",!1);if(!n)return t;var r=e.waypoints;return e.waypoints=t,e.waypoints=n.getCroppedWaypoints(e),t=e.waypoints,e.waypoints=r,t};var Rc="updateWaypoints",Tc="connect-ok",Dc="connect-not-ok",Mc="connect-hover",Bc="djs-updating",Ic="djs-element-hidden";function Ac(h,e,t,c){var y=(this._injector=e).get("connectionPreview",!1);t.on("bendpoint.move.start",function(e){var t=e.context,n=t.bendpointIndex,r=t.connection,o=t.insert,i=r.waypoints,a=i.slice();t.waypoints=i,o&&a.splice(n,0,{x:e.x,y:e.y}),r.waypoints=a,In(t.draggerGfx=vc(c.getLayer("overlays"))).add("djs-dragging"),c.addMarker(r,Ic),c.addMarker(r,Bc)}),t.on("bendpoint.move.hover",function(e){var t=e.context,n=t.allowed,e=t.hover,t=t.type;e&&(c.addMarker(e,Mc),t!==Rc&&(n?(c.removeMarker(e,Dc),c.addMarker(e,Tc)):!1===n&&(c.removeMarker(e,Tc),c.addMarker(e,Dc))))}),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],1100,function(e){var t=e.context,e=t.hover,t=t.target;e&&(c.removeMarker(e,Mc),c.removeMarker(e,t?Tc:Dc))}),t.on("bendpoint.move.move",function(e){var t=e.context,n=t.allowed,r=t.bendpointIndex,o=t.draggerGfx,i=t.hover,a=t.type,c=t.connection,u=c.source,s=c.target,l=c.waypoints.slice(),p={x:e.x,y:e.y},f=t.hints||{},d={};y&&(f.connectionStart&&(d.connectionStart=f.connectionStart),f.connectionEnd&&(d.connectionEnd=f.connectionEnd),"reconnectStart"===a?kc(t)?(d.connectionEnd=d.connectionEnd||p,d.source=s,d.target=i||u,l=l.reverse()):(d.connectionStart=d.connectionStart||p,d.source=i||u,d.target=s):"reconnectEnd"===a?kc(t)?(d.connectionStart=d.connectionStart||p,d.source=i||s,d.target=u,l=l.reverse()):(d.connectionEnd=d.connectionEnd||p,d.source=u,d.target=i||s):(d.noCropping=!0,d.noLayout=!0,l[r]=p),a===Rc&&(l=h.cropWaypoints(c,l)),d.waypoints=l,y.drawPreview(t,n,d)),Bo(o,e.x,e.y)},this),t.on(["bendpoint.move.end","bendpoint.move.cancel"],1100,function(e){var t=e.context,n=t.connection,r=t.draggerGfx,o=t.hover,i=t.target,e=t.waypoints;n.waypoints=e,Nn(r),c.removeMarker(n,Bc),c.removeMarker(n,Ic),o&&(c.removeMarker(o,Tc),c.removeMarker(o,i?Tc:Dc)),y&&y.cleanUp(t)})}Ac.$inject=["bendpointMove","injector","eventBus","canvas"];var Nc="connect-hover",Lc="djs-updating";function $c(e,t,n){return Vc(e,t,e[t]+n)}function Vc(e,t,n){return{x:"x"===t?n:e.x,y:"y"===t?n:e.y}}function zc(e){return"x"===e?"y":"x"}function Fc(e,t,n){return e.original||(t=io(t),Vc(e,n=zc(n),t[n]))}function Uc(e,t,l,p,n,u){var r=e.get("connectionDocking",!1);function d(e,t){if(!r)return t;var n=e.waypoints;return e.waypoints=t,t=r.getCroppedWaypoints(e),e.waypoints=n,t}function h(e){n.update("connection",e.connection,e.connectionGfx)}function y(e,t,n){var r=e.newWaypoints,o=r[e.segmentStartIndex+t],i=r[e.segmentEndIndex+t],r=zc(e.axis),r=(t=n,n=o,o=i,i=r,r=Math.max(n[i],o[i]),o=Math.min(n[i],o[i]),Vc(n,i,Math.min(Math.max(o+20,t[i]),r-20)));Bo(e.draggerGfx,r.x,r.y)}this.start=function(e,t,n){var r=l.getGraphics(t),o=n-1,i=n,a=t.waypoints,c=a[o],u=a[i],s=mc(l,a,e),n=wr(c,u);n&&(n="v"===n?"x":"y",0==o&&(c=Fc(c,t.source,n)),i===a.length-1&&(u=Fc(u,t.target,n)),s=s?s.point:{x:(c.x+u.x)/2,y:(c.y+u.y)/2},p.init(e,s,"connectionSegment.move",{cursor:"x"==n?"resize-ew":"resize-ns",data:{connection:t,connectionGfx:r,context:{connection:t,segmentStartIndex:o,segmentEndIndex:i,segmentStart:c,segmentEnd:u,axis:n,dragPosition:s}}}))},t.on("connectionSegment.move.start",function(e){var t=e.context,n=e.connection,e=l.getLayer("overlays");t.originalWaypoints=n.waypoints.slice(),t.draggerGfx=bc(e,t.segmentStart,t.segmentEnd),In(t.draggerGfx).add("djs-dragging"),l.addMarker(n,Lc)}),t.on("connectionSegment.move.move",function(e){var t=e.context,n=t.connection,r=t.segmentStartIndex,o=t.segmentEndIndex,i=t.segmentStart,a=t.segmentEnd,c=t.axis,u=t.originalWaypoints.slice(),s=$c(i,c,e["d"+c]),l=$c(a,c,e["d"+c]),p=u.length,f=0;u[r]=s,u[o]=l,r<2&&(c=ao(n.source,s),1===r?"intersect"===c&&(u.shift(),u[0]=s,f--):"intersect"!==c&&(u.unshift(i),f++)),p-3<o&&(i=ao(n.target,l),o===p-2?"intersect"===i&&(u.pop(),u[u.length-1]=l):"intersect"!==i&&u.push(a)),t.newWaypoints=n.waypoints=d(n,u),y(t,f,e),t.newSegmentStartIndex=r+f,h(e)}),t.on("connectionSegment.move.hover",function(e){e.context.hover=e.hover,l.addMarker(e.hover,Nc)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(e){e=e.context.hover;e&&l.removeMarker(e,Nc)}),t.on("connectionSegment.move.cleanup",function(e){var t=e.context,e=t.connection;t.draggerGfx&&Nn(t.draggerGfx),l.removeMarker(e,Lc)}),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(e){var t=e.context;t.connection.waypoints=t.originalWaypoints,h(e)}),t.on("connectionSegment.move.end",function(e){var n,r,o,t=e.context,i=t.connection,a=t.newWaypoints,c=t.newSegmentStartIndex,a=a.map(function(e){return{original:e.original,x:Math.round(e.x),y:Math.round(e.y)}}),e=(r=c,o=0,{waypoints:(n=a).filter(function(e,t){return!br(n[t-1],n[t+1],e)||(o=t<=r?o-1:o,!1)}),segmentOffset:o}),a=d(i,e.waypoints),e={segmentMove:{segmentStartIndex:t.segmentStartIndex,newSegmentStartIndex:c+e.segmentOffset}};u.updateWaypoints(i,a,e)})}Uc.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var Hc=Math.abs,Wc=Math.round;function qc(e,t){return!e||isNaN(e.x)||isNaN(e.y)?t:{x:Wc(e.x+e.width/2),y:Wc(e.y+e.height/2)}}function Gc(e,t){e=e.snapped;return!!e&&("string"==typeof t?e[t]:e.x&&e.y)}function Kc(e,t,n){if("string"!=typeof t)throw new Error("axis must be in [x, y]");if("number"!=typeof n&&!1!==n)throw new Error("value must be Number or false");var r=e[t],o=e.snapped=e.snapped||{};return!1===n?o[t]=!1:(o[t]=!0,e[t]+=n=n-r,e["d"+t]+=n),r}function Xc(e){return e.children||[]}var Yc=Math.abs,Zc=Math.round;function Qc(e){function p(e,t){if(y(e)){for(var n=e.length;n--;)if(Yc(e[n]-t)<=10)return e[n]}else{var r=t%(e=+e);if(r<10)return t-r;if(e-10<r)return t-r+e}return t}function f(e,t){return e.waypoints?wc(t,e):e.width?{x:Zc(e.width/2+e.x),y:Zc(e.height/2+e.y)}:void 0}e.on("connectionSegment.move.move",1500,function(e){var t,n,r,o,i,a,c,u=(i=(a=e).context,t=i.snapPoints,o=i.connection,l=o.waypoints,n=i.segmentStart,u=i.segmentStartIndex,c=i.segmentEnd,s=i.segmentEndIndex,r=i.axis,t||(c=[l[u-1],n,c,l[s+1]],u<2&&c.unshift(f(o.source,a)),s>l.length-3&&c.unshift(f(o.target,a)),i.snapPoints=t={horizontal:[],vertical:[]},x(c,function(e){e&&(e=e.original||e,"y"===r&&t.horizontal.push(e.y),"x"===r&&t.vertical.push(e.x))}),t)),s=e.x,l=e.y;u&&(a=s-(o=p(u.vertical,s)),c=l-(i=p(u.horizontal,l)),L(e,{dx:e.dx-a,dy:e.dy-c,x:o,y:i}),!a&&-1===u.vertical.indexOf(s)||Kc(e,"x",o),!c&&-1===u.horizontal.indexOf(l)||Kc(e,"y",i))}),e.on(["connect.hover","connect.move","connect.end"],1500,function(e){var t=e.context.hover,n=t&&f(t,e);(t=t)&&t.waypoints&&n&&n.x&&n.y&&(Kc(e,"x",n.x),Kc(e,"y",n.y))}),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(e){var t,n,r=e.context,o=(t=(u=r).snapPoints,c=u.connection.waypoints,n=u.bendpointIndex,t||(n=[c[n-1],c[n+1]],u.snapPoints=t={horizontal:[],vertical:[]},x(n,function(e){e&&(e=e.original||e,t.horizontal.push(e.y),t.vertical.push(e.x))}),t)),i=r.hover,a=i&&f(i,e),c=e.x,u=e.y;o&&(r=c-(n=p(a?o.vertical.concat([a.x]):o.vertical,c)),a=u-(i=p(a?o.horizontal.concat([a.y]):o.horizontal,u)),L(e,{dx:e.dx-r,dy:e.dy-a,x:e.x-r,y:e.y-a}),!r&&-1===o.vertical.indexOf(c)||Kc(e,"x",n),!a&&-1===o.horizontal.indexOf(u)||Kc(e,"y",i))})}Qc.$inject=["eventBus"];var Jc={__depends__:[oc,uc],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",Oc],bendpointMove:["type",Pc],bendpointMovePreview:["type",Ac],connectionSegmentMove:["type",Uc],bendpointSnapping:["type",Qc]};function eu(e,t,n,r){this._canvas=e,this._eventBus=n,this._overlays=r;t=f(t&&t.scale)?t.scale:{min:1,max:1.5};this._overlaysConfig={scale:t},this._current=null,this._init()}function tu(e,t){return-1!==e.indexOf(t)}eu.$inject=["canvas","config.contextPad","eventBus","overlays"],eu.prototype._init=function(){var n=this;this._eventBus.on("selection.changed",function(e){e=e.newSelection,e=e.length?1===e.length?e[0]:e:null;e?n.open(e,!0):n.close()}),this._eventBus.on("elements.changed",function(e){var t=e.elements,e=n._current;!e||E(y(e=e.target)?e:[e],function(e){return tu(t,e)})&&n.open(e,!0)})},eu.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("contextPad.getProviders",e,function(e){e.providers.push(t)})},eu.prototype.getEntries=function(t){var e=this._getProviders(),n=y(t)?"getMultiElementContextPadEntries":"getContextPadEntries",r={};return x(e,function(e){m(e[n])&&(m(e=e[n](t))?r=e(r):x(e,function(e,t){r[t]=e}))}),r},eu.prototype.trigger=function(e,t,n){var r=this._current.target,o=this._current.entries,i=t.delegateTarget||t.target;if(!i)return t.preventDefault();if(o=o[pt(i,"data-action")].action,i=t.originalEvent||t,m(o)){if("click"===e)return o(i,r,n)}else if(o[e])return o[e](i,r,n);t.preventDefault()},eu.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},eu.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},eu.prototype._updateAndOpen=function(e){var i,t=this.getEntries(e),n=this.getPad(e),a=n.html;x(t,function(e,t){var n,r=e.group||"default",o=kt(e.html||'<div class="entry" draggable="true"></div>');pt(o,"data-action",t),(t=Dt("[data-group="+xc(r)+"]",a))||(pt(t=kt('<div class="group"></div>'),"data-group",r),a.appendChild(t)),t.appendChild(o),e.className&&(t=e.className,n=mt(o),(t=y(t)?t:t.split(/\s+/g)).forEach(function(e){n.add(e)})),e.title&&pt(o,"title",e.title),e.imageUrl&&(pt(i=kt("<img>"),"src",e.imageUrl),i.style.width="100%",i.style.height="100%",o.appendChild(i))}),mt(a).add("open"),this._current={target:e,entries:t,pad:n},this._eventBus.fire("contextPad.open",{current:this._current})},eu.prototype.getPad=function(e){if(this.isOpen())return this._current.pad;var t=this,n=this._overlays,r=kt('<div class="djs-context-pad"></div>'),o=this._getPosition(e),o=L({html:r},this._overlaysConfig,o);Pt.bind(r,".entry","click",function(e){t.trigger("click",e)}),Pt.bind(r,".entry","dragstart",function(e){t.trigger("dragstart",e)}),Ct.bind(r,"mousedown",function(e){e.stopPropagation()});r=this._canvas.getRootElement();this._overlayId=n.add(r,"context-pad",o);n=n.get(this._overlayId);return this._eventBus.fire("contextPad.create",{target:e,pad:n}),n},eu.prototype.close=function(){this.isOpen()&&(this._overlays.remove(this._overlayId),this._overlayId=null,this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},eu.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return y(e)===y(n)&&(y(e)?e.length===n.length&&j(e,function(e){return tu(n,e)}):n===e)},eu.prototype._getPosition=function(e){e=sr(y(e)?e:[e]);return{position:{left:e.x+e.width+12,top:e.y-6}}};var nu={__depends__:[bi,Bi],contextPad:["type",eu]};function ru(e,o,c,n){function i(e,t){return n.allowed("connection.create",{source:e,target:t})}e.on("connect.hover",function(e){var t=e.context,n=t.start,r=e.hover;if(t.hover=r,!d(e=t.canExecute=i(n,r))){if(!1!==e)return t.source=n,void(t.target=r);d(e=t.canExecute=i(r,n))||!1!==e&&(t.source=r,t.target=n)}}),e.on(["connect.out","connect.cleanup"],function(e){e=e.context;e.hover=null,e.source=null,e.target=null,e.canExecute=!1}),e.on("connect.end",function(e){var t=e.context,n=t.canExecute,r=t.connectionStart,o={x:e.x,y:e.y},i=t.source,a=t.target;if(!n)return!1;e=null,o={connectionStart:ou(t)?o:r,connectionEnd:ou(t)?r:o};_(n)&&(e=n),t.connection=c.connect(i,a,e,o)}),this.start=function(e,t,n,r){_(n)||(r=n,n=io(t)),o.init(e,"connect",{autoActivate:r,data:{shape:t,context:{start:t,connectionStart:n}}})}}function ou(e){var t=e.hover,n=e.source,e=e.target;return t&&n&&t===n&&n!==e}ru.$inject=["eventBus","dragging","modeling","rules"];var iu="connect-ok",au="connect-not-ok";function cu(e,t,n){var l=e.get("connectionPreview",!1);l&&t.on("connect.move",function(e){var t=e.context,n=t.canExecute,r=t.hover,o=t.source,i=t.start,a=t.startPosition,c=t.target,u=t.connectionStart||a,s=t.connectionEnd||{x:e.x,y:e.y},a=u,e=s;ou(t)&&(a=s,e=u),l.drawPreview(t,n,{source:o||i,target:c||r,connectionStart:a,connectionEnd:e})}),t.on("connect.hover",900,function(e){var t=e.context,e=e.hover,t=t.canExecute;null!==t&&n.addMarker(e,t?iu:au)}),t.on(["connect.out","connect.cleanup"],1100,function(e){e=e.hover;e&&(n.removeMarker(e,iu),n.removeMarker(e,au))}),l&&t.on("connect.cleanup",function(e){l.cleanUp(e.context)})}cu.$inject=["injector","eventBus","canvas"];var uu={__depends__:[Si,uc,oc],__init__:["connectPreview"],connect:["type",ru],connectPreview:["type",cu]},su=["marker-start","marker-mid","marker-end"],lu=["circle","ellipse","line","path","polygon","polyline","rect"];function pu(e,t,n,r){this._elementRegistry=e,this._canvas=n,this._styles=r,this._clonedMarkers={};var o=this;t.on("drag.cleanup",function(){x(o._clonedMarkers,function(e){Nn(e)}),o._clonedMarkers={}})}pu.$inject=["elementRegistry","eventBus","canvas","styles"],pu.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},pu.prototype.addDragger=function(e,t,n){e=$n(n=n||this.getGfx(e)),n=n.getBoundingClientRect();return this._cloneMarkers(Mo(e)),Rn(e,this._styles.cls("djs-dragger",[],{x:n.top,y:n.left})),Cn(t,e),e},pu.prototype.addFrame=function(e,t){e=Un("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return Cn(t,e),e},pu.prototype._cloneMarkers=function(o){var i=this;if(o.childNodes)for(var e=0;e<o.childNodes.length;e++)i._cloneMarkers(o.childNodes[e]);-1!==lu.indexOf(o.nodeName)&&su.forEach(function(e){var t,n,r;Rn(o,e)&&(t=o,n=e,r=i._canvas.getContainer(),r=Dt("marker#"+Rn(t,n).match(/url\(['"]?#([^'"]*)['"]?\)/)[1],r||document),i._cloneMarker(o,r,e))})},pu.prototype._cloneMarker=function(e,t,n){var r=t.id,o=this._clonedMarkers[r];o||((o=$n(t)).id=r+"-clone",In(o).add("djs-dragger").add("djs-dragger-marker"),this._clonedMarkers[r]=o,(t=Dt("defs",this._canvas._svg))||(t=Un("defs"),Cn(this._canvas._svg,t)),Cn(t,o)),Rn(e,n,"url(#"+this._clonedMarkers[r].id+")")};var fu={__init__:["previewSupport"],previewSupport:["type",pu]},du="drop-not-ok",hu="attach-ok",yu="new-parent";function mu(r,i,e,l,s){function a(t,n){[hu,"drop-ok",du,yu].forEach(function(e){e===n?r.addMarker(t,e):r.removeMarker(t,e)})}function t(){var e=i.context();e&&"create"===e.prefix&&i.cancel()}e.on(["create.move","create.hover"],function(e){var t=e.context,n=t.elements,r=e.hover,o=t.source,i=t.hints||{};if(!r)return t.canExecute=!1,void(t.target=null);vu(e);e={x:e.x,y:e.y},i=t.canExecute=r&&function(n,e,t,r,o){if(!e)return!1;var i=b(n=w(n,function(e){var t=e.labelTarget;return!(e.parent||e.labelTarget&&-1!==n.indexOf(t))}),function(e){return!gu(e)}),a=!1,c=!1,u=!1;return(a=bu(n)?s.allowed("shape.attach",{position:t,shape:i,target:e}):a)||(u=bu(n)?s.allowed("shape.create",{position:t,shape:i,source:r,target:e}):s.allowed("elements.create",{elements:n,position:t,target:e})),o=o.connectionTarget,u||a?{attach:a,connect:c=i&&r?s.allowed("connection.create",{source:o===r?i:r,target:o===r?r:i,hints:{targetParent:e,targetAttach:a}}):c}:(null===u||null===a)&&null}(n,r,e,o,i);r&&null!==i&&(t.target=r,i&&i.attach?a(r,hu):a(r,i?yu:du))}),e.on(["create.end","create.out","create.cleanup"],function(e){e=e.hover;e&&a(e,null)}),e.on("create.end",function(e){var t=e.context,n=t.source,r=t.shape,o=t.elements,i=t.target,a=t.canExecute,c=a&&a.attach,u=a&&a.connect,s=t.hints||{};if(!1===a||!i)return!1;vu(e);a={x:e.x,y:e.y},r=u?l.appendShape(n,r,a,i,{attach:c,connection:!0===u?{}:u,connectionTarget:s.connectionTarget}):b(o=l.createElements(o,a,i,L({},s,{attach:c})),function(e){return!gu(e)});L(t,{elements:o,shape:r}),L(e,{elements:o,shape:r})}),e.on("create.init",function(){e.on("elements.changed",t),e.once(["create.cancel","create.end"],2e3,function(){e.off("elements.changed",t)})}),this.start=function(e,t,n){var r,o=b(t=!y(t)?[t]:t,function(e){return!gu(e)});o&&(n=L({elements:t,hints:{},shape:o},n||{}),x(t,function(e){h(e.x)||(e.x=0),h(e.y)||(e.y=0)}),r=sr(w(t,function(e){return!e.hidden})),x(t,function(e){gu(e)&&(e.waypoints=C(e.waypoints,function(e){return{x:e.x-r.x-r.width/2,y:e.y-r.y-r.height/2}})),L(e,{x:e.x-r.x-r.width/2,y:e.y-r.y-r.height/2})}),i.init(e,"create",{cursor:"grabbing",autoActivate:!0,data:{shape:o,elements:t,context:n}}))}}function vu(e){var t=e.context.createConstraints;t&&(t.left&&(e.x=Math.max(e.x,t.left)),t.right&&(e.x=Math.min(e.x,t.right)),t.top&&(e.y=Math.max(e.y,t.top)),t.bottom&&(e.y=Math.min(e.y,t.bottom)))}function gu(e){return e.waypoints}function bu(e){return e&&1===e.length&&!gu(e[0])}mu.$inject=["canvas","dragging","eventBus","modeling","rules"];function _u(i,e,a,c,u){e.on("create.move",750,function(e){var t=e.hover,n=e.context,r=n.elements,o=(o=n.dragGroup)||(n.dragGroup=function(e){var n=Un("g");Rn(n,u.cls("djs-drag-group",["no-events"]));var r=Un("g");return e.forEach(function(e){var t;e.hidden||(e.waypoints?(t=a._createContainer("connection",r),a.drawConnection(Mo(t),e)):(t=a._createContainer("shape",r),a.drawShape(Mo(t),e),Bo(t,e.x,e.y)),c.addDragger(e,n,t))}),n}(r));t?(o.parentNode||Cn(i.getActiveLayer(),o),Bo(o,e.x,e.y)):Nn(o)}),e.on("create.cleanup",function(e){e=e.context.dragGroup;e&&Nn(e)})}_u.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];var bt={__depends__:[oc,fu,uc,Si],__init__:["create","createPreview"],create:["type",mu],createPreview:["type",_u]},wu="data-id",xu=["contextPad.close","canvas.viewbox.changing","commandStack.changed"];function Ou(e,t,n){e=f(e&&e.scale)?e.scale:{min:1,max:1.5};this._config={scale:e},this._eventBus=t,this._canvas=n,this._providers={},this._current={}}Ou.$inject=["config.popupMenu","eventBus","canvas"],Ou.prototype.registerProvider=function(e,t,n){n||(n=t,t=1e3),this._eventBus.on("popupMenu.getProviders."+e,t,function(e){e.providers.push(n)})},Ou.prototype.isEmpty=function(e,t){if(!e)throw new Error("element parameter is missing");if(!t)throw new Error("providerId parameter is missing");var n=this._getProviders(t);if(!n)return!0;t=this._getEntries(e,n),n=this._getHeaderEntries(e,n),t=0<P(t),n=n&&0<P(n);return!t&&!n},Ou.prototype.open=function(e,t,n){var r=this._getProviders(t);if(!e)throw new Error("Element is missing");if(!r||!r.length)throw new Error("No registered providers for: "+t);if(!n)throw new Error("the position argument is missing");this.isOpen()&&this.close(),this._emit("open");var o=this._current={className:t,element:e,position:n},i=this._getEntries(e,r),r=this._getHeaderEntries(e,r);o.entries=L({},i,r),o.container=this._createContainer(t),P(r)&&o.container.appendChild(this._createEntries(r,"djs-popup-header")),P(i)&&o.container.appendChild(this._createEntries(i,"djs-popup-body"));i=this._canvas.getContainer();this._attachContainer(o.container,i,n.cursor),this._bindAutoClose()},Ou.prototype.close=function(){this.isOpen()&&(this._emit("close"),this._unbindAutoClose(),Bt(this._current.container),this._current.container=null)},Ou.prototype.isOpen=function(){return!!this._current.container},Ou.prototype.trigger=function(e){e.preventDefault();var t=pt(e.delegateTarget||e.target,wu),t=this._getEntry(t);if(t.action)return t.action.call(null,e,t)},Ou.prototype._getProviders=function(e){e=this._eventBus.createEvent({type:"popupMenu.getProviders."+e,providers:[]});return this._eventBus.fire(e),e.providers},Ou.prototype._getEntries=function(n,e){var r={};return x(e,function(e){var t;e.getPopupMenuEntries?m(t=e.getPopupMenuEntries(n))?r=t(r):x(t,function(e,t){r[t]=e}):x(e.getEntries(n),function(e){var t=e.id;if(!t)throw new Error("every entry must have the id property set");r[t]=V(e,["id"])})}),r},Ou.prototype._getHeaderEntries=function(t,e){var n={};return x(e,function(e){if(!e.getPopupMenuHeaderEntries)return e.getHeaderEntries?void x(e.getHeaderEntries(t),function(e){var t=e.id;if(!t)throw new Error("every entry must have the id property set");n[t]=V(e,["id"])}):void 0;e=e.getPopupMenuHeaderEntries(t);m(e)?n=e(n):x(e,function(e,t){n[t]=e})}),n},Ou.prototype._getEntry=function(e){e=this._current.entries[e];if(!e)throw new Error("entry not found");return e},Ou.prototype._emit=function(e){this._eventBus.fire("popupMenu."+e)},Ou.prototype._createContainer=function(e){var t=kt('<div class="djs-popup">'),n=this._current.position,r=this._current.className;return lt(t,{position:"absolute",left:n.x+"px",top:n.y+"px",visibility:"hidden"}),mt(t).add(r),pt(t,"data-popup",e),t},Ou.prototype._attachContainer=function(e,t,n){var r=this;Pt.bind(e,".entry","click",function(e){r.trigger(e)}),this._updateScale(e),t.appendChild(e),n&&this._assureIsInbounds(e,n),lt(e,{visibility:"visible"})},Ou.prototype._updateScale=function(e){var t,n,r,o=this._canvas.zoom(),i=this._config.scale,a=o;!0!==i&&(i=!1===i?t=1:(t=i.min,i.max),f(t)&&o<t&&(a=t),f(i)&&i<o&&(a=i)),r="scale("+a+")",(n=e).style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(e){n.style[e+"transform"]=r})},Ou.prototype._assureIsInbounds=function(e,t){var n,r,o=this._canvas._container.getBoundingClientRect(),i=e.offsetLeft,a=e.offsetTop,c=e.scrollWidth,u=e.scrollHeight,s={},l=t.x-o.left,t=t.y-o.top;i+c>o.width&&(s.x=!0),a+u>o.height&&(s.y=!0),s.x&&s.y?(n=l-c+"px",r=t-u+"px"):s.x?(n=l-c+"px",r=t+"px"):s.y&&t<u?(n=l+"px",r="10px"):s.y&&(n=l+"px",r=t-u+"px"),lt(e,{left:n,top:r},{zIndex:1e3})},Ou.prototype._createEntries=function(e,t){var r=kt("<div>"),o=this;return mt(r).add(t),x(e,function(e,t){var n=o._createEntry(e,t),t=e.group||"default",e=Dt("[data-group="+xc(t)+"]",r);e||(pt(e=kt('<div class="group"></div>'),"data-group",t),r.appendChild(e)),e.appendChild(n)}),r},Ou.prototype._createEntry=function(e,t){var n,r=kt("<div>"),o=mt(r);return o.add("entry"),e.className&&e.className.split(" ").forEach(function(e){o.add(e)}),pt(r,wu,t),e.label&&((n=kt("<span>")).textContent=e.label,r.appendChild(n)),e.imageUrl&&(pt(n=kt("<img>"),"src",e.imageUrl),r.appendChild(n)),!0===e.active&&o.add("active"),!0===e.disabled&&o.add("disabled"),e.title&&(r.title=e.title),r},Ou.prototype._bindAutoClose=function(){this._eventBus.once(xu,this.close,this)},Ou.prototype._unbindAutoClose=function(){this._eventBus.off(xu,this.close,this)};var ju={__init__:["popupMenu"],popupMenu:["type",Ou]},Eu=Math.round;function Cu(e){this._modeling=e}Cu.$inject=["modeling"],Cu.prototype.replaceElement=function(e,t,n){if(e.waypoints)return null;var r=this._modeling,o=t.width||e.width,i=t.height||e.height,a=t.x||e.x,c=t.y||e.y,a=Eu(a+o/2),c=Eu(c+i/2);return r.replaceShape(e,L({},t,{x:a,y:c,width:o,height:i}),n)};Rt={__init__:["replace"],replace:["type",Cu]};function Su(u,s,e,t){this.replaceElement=function(e,t,n){n=n||{};var r,o=t.type,i=e.businessObject,a=u.create(o),c={type:o,businessObject:a};return c.width=e.width,c.height=e.height,a.name=i.name,t.table&&(r=u.create("dmn:DecisionTable"),(a.decisionLogic=r).$parent=a,(o=u.create("dmn:OutputClause")).typeRef="string",(o.$parent=r).output=[o],(i=u.create("dmn:InputClause")).$parent=r,o=u.create("dmn:LiteralExpression",{typeRef:"string"}),(i.inputExpression=o).$parent=i,r.input=[i]),t.expression&&(a.decisionLogic=u.create("dmn:LiteralExpression"),a.variable=u.create("dmn:InformationItem")),s.replaceElement(e,c,n)}}Su.$inject=["drdFactory","replace","selection","modeling"];var hr={__depends__:[Rt,Si],drdReplace:["type",Su]},Pu=[{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}}];function ku(e,t,n,r,o,i){this._popupMenu=e,this._modeling=t,this._moddle=n,this._drdReplace=r,this._rules=o,this._translate=i,this.register()}ku.$inject=["popupMenu","modeling","moddle","drdReplace","rules","translate"],ku.prototype.register=function(){this._popupMenu.registerProvider("dmn-replace",this)},ku.prototype.getEntries=function(e){var r=e.businessObject;if(!this._rules.allowed("shape.replace",{element:e}))return[];if(en(r,"dmn:Decision")){var t=w(Pu,function(e){var t="replace-with-empty-decision"===e.actionName&&r.decisionLogic,n="replace-with-decision-table"===e.actionName&&!en(r.decisionLogic,"dmn:DecisionTable"),e="replace-with-literal-expression"===e.actionName&&!en(r.decisionLogic,"dmn:LiteralExpression");return t||n||e});return this._createEntries(e,t)}return[]},ku.prototype._createEntries=function(t,e){var n=[],r=this;return x(e,function(e){e=r._createMenuEntry(e,t);n.push(e)}),n},ku.prototype._createMenuEntry=function(e,t,n){var r=this._drdReplace.replaceElement;return n=n||function(){return r(t,e.target)},{label:(0,this._translate)(e.label),className:e.className,id:e.actionName,action:n}},ku.prototype.getHeaderEntries=function(e){return[]};_o={__depends__:[ci,ju,hr],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",ku]};function Ru(e,r,t,n,o,i,a,c,u,s,l,p){l=l||{},r.registerProvider(this),this._contextPad=r,this._modeling=t,this._elementFactory=n,this._connect=o,this._create=i,this._rules=a,this._popupMenu=c,this._canvas=u,this._translate=s,!1!==l.autoPlace&&(this._autoPlace=p.get("autoPlace",!1)),e.on("create.end",250,function(e){var t,n=e.context.shape;!hi(e)||(t=r.getEntries(n)).replace&&t.replace.action.click(e,n)})}Ru.$inject=["eventBus","contextPad","modeling","elementFactory","connect","create","rules","popupMenu","canvas","translate","config.contextPad","injector"],Ru.prototype.getContextPadEntries=function(t){var n=this._modeling,i=this._elementFactory,r=this._connect,a=this._create,c=this._popupMenu,u=this._canvas,s=this._contextPad,e=this._rules,l=this._translate,p=this._autoPlace,o={};if("label"===t.type)return o;var f=t.businessObject;function d(e,t,n){r.start(e,t,n)}function h(r,e,t,o){function n(e,t){var n=i.createShape(L({type:r},o));a.start(e,n,{source:t,hints:{connectionTarget:t}})}return"string"!=typeof t&&(o=t,t=l("Append {type}",{type:r.replace(/^dmn:/,"")})),{group:"model",className:e,title:t,action:{dragstart:n,click:p?function(e,t){var n=i.createShape(L({type:r},o));p.append(t,n,{connectionTarget:t})}:n}}}en(f,"dmn:Decision")&&L(o,{"append.decision":h("dmn:Decision","dmn-icon-decision")}),on(f,["dmn:BusinessKnowledgeModel","dmn:Decision","dmn:KnowledgeSource"])&&L(o,{"append.knowledge-source":h("dmn:KnowledgeSource","dmn-icon-knowledge-source")}),on(f,["dmn:BusinessKnowledgeModel","dmn:Decision"])&&L(o,{"append.business-knowledge-model":h("dmn:BusinessKnowledgeModel","dmn-icon-business-knowledge")}),on(f,["dmn:Decision","dmn:KnowledgeSource"])&&L(o,{"append.input-data":h("dmn:InputData","dmn-icon-input-data")}),en(f,"dmn:DRGElement")&&L(o,{"append.text-annotation":h("dmn:TextAnnotation","dmn-icon-text-annotation"),connect:{group:"connect",className:"dmn-icon-connection-multi",title:l("Connect using Information/Knowledge/Authority Requirement or Association"),action:{click:d,dragstart:d}}}),en(f,"dmn:TextAnnotation")&&L(o,{connect:{group:"connect",className:"dmn-icon-connection-multi",title:l("Connect using association"),action:{click:d,dragstart:d}}}),c.isEmpty(t,"dmn-replace")||L(o,{replace:{group:"edit",className:"dmn-icon-screw-wrench",title:l("Change type"),action:{click:function(e,t){var n,r,o,e=L((n=t,r=u.getContainer(),o=s.getPad(n).html,n=r.getBoundingClientRect(),o=(r=o.getBoundingClientRect()).top-n.top,{x:r.left-n.left,y:o+r.height+5}),{cursor:{x:e.x,y:e.y}});c.open(t,"dmn-replace",e)}}}});e=e.allowed("elements.delete",{elements:[t]});return(e=y(e)?e[0]===t:e)&&L(o,{delete:{group:"edit",className:"dmn-icon-trash",title:l("Remove"),action:{click:function(e){n.removeElements([t])}}}}),o};ni={__depends__:[ci,nu,Si,uu,bt,_o],__init__:["contextPadProvider"],contextPadProvider:["type",Ru]};function Tu(e,t,n,r){this._canvas=t,this._graphicsFactory=n,this._elementFactory=r,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}Tu.$inject=["injector","canvas","graphicsFactory","elementFactory"],Tu.prototype.drawPreview=function(e,t,n){var r,o,i,a=e.connectionPreviewGfx,c=e.getConnection,u=(n=n||{}).source,s=n.target,l=n.waypoints,p=n.connectionStart,f=n.connectionEnd,d=n.noLayout,h=n.noCropping,y=n.noNoop,m=this;Ln(a=a||(e.connectionPreviewGfx=this.createConnectionPreviewGfx())),c=c||(e.getConnection=(o=function(e,t,n){return m.getConnection(e,t,n)},i={},function(e){e=JSON.stringify(e);return i[e]||(i[e]=o.apply(null,arguments))})),(r=t?c(t,u,s):r)?(r.waypoints=l||[],this._layouter&&!d&&(r.waypoints=this._layouter.layoutConnection(r,{source:u,target:s,connectionStart:p,connectionEnd:f,waypoints:n.waypoints||r.waypoints})),r.waypoints&&r.waypoints.length||(r.waypoints=[u?io(u):p,s?io(s):f]),this._connectionDocking&&(u||s)&&!h&&(r.waypoints=this._connectionDocking.getCroppedWaypoints(r,u,s)),this._graphicsFactory.drawConnection(a,r)):y||this.drawNoopPreview(a,n)},Tu.prototype.drawNoopPreview=function(e,t){var n=t.source,r=t.target,o=t.connectionStart||io(n),t=t.connectionEnd||io(r),r=this.cropWaypoints(o,t,n,r);Cn(e,this.createNoopConnection(r[0],r[1]))},Tu.prototype.cropWaypoints=function(e,t,n,r){var o=this._graphicsFactory,i=n&&o.getShapePath(n),a=r&&o.getShapePath(r),o=o.getConnectionPath({waypoints:[e,t]});return[e=n&&co(i,o,!0)||e,t=r&&co(a,o,!1)||t]},Tu.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&Nn(e.connectionPreviewGfx)},Tu.prototype.getConnection=function(e){e=_(e=e)?e:{};return this._elementFactory.createConnection(e)},Tu.prototype.createConnectionPreviewGfx=function(){var e=Un("g");return Rn(e,{pointerEvents:"none"}),In(e).add("djs-connection-preview"),Cn(this._canvas.getActiveLayer(),e),e},Tu.prototype.createNoopConnection=function(e,t){var n=Un("polyline");return Rn(n,{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"}),Rn(n,{points:[e.x,e.y,t.x,t.y]}),n};var Vi={__init__:["connectionPreview"],connectionPreview:["type",Tu]},Du=/\s/,Mu=/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i,Bu=/^[a-z_][\w-.]*$/i,Iu=/\$\{([^}]*)\}/g;function Au(e,t){var n=e.$model.ids.assigned(t);return t?n&&n!==e?"Element must have unique ID.":function(e){if(function(e){return Du.test(e)}(e=function(e){return e.replace(Iu,"$1")}(e)))return"Id must not contain spaces.";if(!Bu.test(e))return Mu.test(e)?"Id must not contain prefix.":"Id must be a valid QName."}(t):"Element must have ID."}function Nu(e,t,n,r){this._eventBus=e,this._modeling=t,this._canvas=n,this._definitionPropertiesView=r,e.on("definitionIdView.create",function(e){this._container=e.html;var t=Dt(".dmn-definitions-name",this._container),e=Dt(".dmn-definitions-id",this._container);this._setup(t,"name"),this._setup(e,"id")},this)}Nu.$inject=["eventBus","modeling","canvas","definitionPropertiesView"],Nu.prototype.update=function(e,t){var n=this._canvas.getRootElement(),r={};if(r[e]=t,"id"===e){t=Au(rn(n),t);if(t)return void this._addErrorMessage(t);this._clearErrorMessage()}this._modeling.updateProperties(n,r)},Nu.prototype._setup=function(t,n){var r=this;t.setAttribute("contenteditable",!0),t.addEventListener("input",I(function(e){e=e.target.value||e.target.textContent;r.update(n,e.trim())},300)),t.addEventListener("keydown",function(e){13===e.keyCode&&(t.blur(),window.getSelection().removeAllRanges())}),t.addEventListener("blur",function(){r._clearErrorMessage(),r._definitionPropertiesView.update()})},Nu.prototype._addErrorMessage=function(e){var t='<span class="dmn-definitions-error-message">'+e+"</span>",e=Dt(".dmn-definitions-id",this._container);this._clearErrorMessage(),mt(e).add("dmn-definitions-error"),e.parentElement.appendChild(kt(t))},Nu.prototype._clearErrorMessage=function(){var e,t=Dt(".dmn-definitions-id",this._container);mt(t).has("dmn-definitions-error")&&(mt(t).remove("dmn-definitions-error"),e=Dt(".dmn-definitions-error-message",this._container),t.parentNode.removeChild(e))};var ai={__depends__:[Ni],__init__:["definitionPropertiesEdit","definitionPropertiesPaletteAdapter"],definitionPropertiesEdit:["type",Nu],definitionPropertiesPaletteAdapter:["type",Ai]},Lu={horizontal:["x","width"],vertical:["y","height"]};function $u(e,n){this._modeling=e,this._filters=[],this.registerFilter(function(e){var t=n.allowed("elements.distribute",{elements:e});return y(t)?t:t?e:[]})}$u.$inject=["modeling","rules"],$u.prototype.registerFilter=function(e){if("function"!=typeof e)throw new Error("the filter has to be a function");this._filters.push(e)},$u.prototype.trigger=function(e,t){var n,r=this._modeling;if(!(e.length<3||(this._setOrientation(t),n=this._filterElements(e),(n=this._createGroups(n)).length<=2)))return r.distributeElements(n,this._axis,this._dimension),n},$u.prototype._filterElements=function(e){var t=this._filters,n=this._axis,r=this._dimension,o=[].concat(e);return t.length?(x(t,function(e){o=e(o,n,r)}),o):e},$u.prototype._createGroups=function(e){var o=[],i=this,a=this._axis,c=this._dimension;if(!a)throw new Error('must have a defined "axis" and "dimension"');return x(T(e,a),function(e,t){var n=i._findRange(e,a,c),r=o[o.length-1];r&&i._hasIntersection(r.range,n)?o[o.length-1].elements.push(e):o.push({range:n,elements:[e]})}),o},$u.prototype._setOrientation=function(e){e=Lu[e];this._axis=e[0],this._dimension=e[1]},$u.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)},$u.prototype._findRange=function(e){var t=e[this._axis];return{min:t+5,max:t+e[this._dimension]-5}};zi={__init__:["distributeElements"],distributeElements:["type",$u]};function Vu(e){e.registerFilter(function(e){return w(e,function(e){var t=on(e,["dmn:AuthorityRequirement","dmn:InformationRequirement","dmn:KnowledgeRequirement","dmn:Association","dmn:TextAnnotation"]);return!e.labelTarget&&!t})})}Vu.$inject=["distributeElements"];var aa={__depends__:[zi],__init__:["drdDistributeElements"],drdDistributeElements:["type",Vu]},zu="is not a registered action";function Fu(e,t){this._actions={};var n=this;e.on("diagram.init",function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})})}function Uu(e,t){return new Error(e+" "+t)}Fu.$inject=["eventBus","injector"],Fu.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),r=e.get("modeling",!1),o=e.get("selection",!1),n=e.get("zoomScroll",!1),i=e.get("copyPaste",!1),a=e.get("canvas",!1),c=e.get("rules",!1),u=e.get("keyboardMove",!1),s=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",function(){t.undo()}),this.register("redo",function(){t.redo()})),i&&o&&this.register("copy",function(){var e=o.get();i.copy(e)}),i&&this.register("paste",function(){i.paste()}),n&&this.register("stepZoom",function(e){n.stepZoom(e.value)}),a&&this.register("zoom",function(e){a.zoom(e.value)}),r&&o&&c&&this.register("removeSelection",function(){var e,t,n=o.get();!n.length||!1!==(e=c.allowed("elements.delete",{elements:n}))&&(t=y(e)?e:n).length&&r.removeElements(t.slice())}),u&&this.register("moveCanvas",function(e){u.moveCanvas(e)}),s&&this.register("moveSelection",function(e){s.moveSelection(e.direction,e.accelerated)})},Fu.prototype.trigger=function(e,t){if(!this._actions[e])throw Uu(e,zu);return this._actions[e](t)},Fu.prototype.register=function(e,t){var n=this;if("string"==typeof e)return this._registerAction(e,t);x(e,function(e,t){n._registerAction(t,e)})},Fu.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw Uu(e,"is already registered");this._actions[e]=t},Fu.prototype.unregister=function(e){if(!this.isRegistered(e))throw Uu(e,zu);this._actions[e]=void 0},Fu.prototype.getActions=function(){return Object.keys(this._actions)},Fu.prototype.isRegistered=function(e){return!!this._actions[e]};da={__init__:["editorActions"],editorActions:["type",Fu]};function Hu(e){e.invoke(Fu,this)}dn(Hu,Fu),Hu.$inject=["injector"],Hu.prototype._registerDefaultActions=function(e){Fu.prototype._registerDefaultActions.call(this,e);var n=e.get("canvas",!1),r=e.get("elementRegistry",!1),o=e.get("selection",!1),t=e.get("lassoTool",!1),i=e.get("handTool",!1),a=e.get("directEditing",!1),c=e.get("distributeElements",!1),u=e.get("alignElements",!1);n&&r&&o&&this._registerAction("selectElements",function(){var t=n.getRootElement(),e=r.filter(function(e){return e!==t});return o.select(e),e}),o&&c&&this._registerAction("distributeElements",function(e){var t=o.get(),e=e.type;2<t.length&&c.trigger(t,e)}),o&&u&&this._registerAction("alignElements",function(e){var t=o.get(),e=e.type;1<t.length&&u.trigger(t,e)}),t&&this._registerAction("lassoTool",function(){t.toggle()}),i&&this._registerAction("handTool",function(){i.toggle()}),o&&a&&this._registerAction("directEditing",function(){var e=o.get();e.length&&a.activate(e[0])})};wa={__depends__:[da],editorActions:["type",Hu]};function Wu(e){return e.dmnDI&&e.dmnDI.diagrams&&e.dmnDI.diagrams[0]}function qu(o,i,e,a){e.on("import.start",function(e){e=e.definitions;Wu(e)||function(e){var t=e.dmnDI;t||(t=o.create("dmndi:DMNDI"),e.set("dmnDI",t));var n=o.create("dmndi:DMNDiagram");t.set("diagrams",[n]);var r=0;x(e.get("drgElement"),function(e){var t;en(e,"dmn:Decision")&&(t=i._getDefaultSize(e),t=o.createDiShape(e,{x:150+30*r,y:150+30*r,width:t.width,height:t.height}),a.updateDiParent(t,n),r++)})}(e)})}qu.$inject=["drdFactory","elementFactory","eventBus","drdUpdater"];Na={__init__:["diGenerator"],diGenerator:["type",qu]};function Gu(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function Ku(e,t){return-1!==(e=y(e)?e:[e]).indexOf(t.key)||-1!==e.indexOf(t.keyCode)}function Xu(e){return e.shiftKey}function Yu(e,t,n){return n=n||"round",Math[n](e/t)*t}function Zu(o,e,t){var n=!t||!1!==t.active;this._eventBus=e;var i=this;e.on("diagram.init",800,function(){i.setActive(n)}),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"],1200,function(r){var e=r.originalEvent;!i.active||e&&Gu(e)||((e=r.context).gridSnappingContext||(e.gridSnappingContext={}),["x","y"].forEach(function(e){var t={},n=function(e,t,n){var r=e.context,o=e.shape,i=r.gridSnappingContext,e=i.snapLocation,r=i.snapOffset;if(r&&h(r[t]))return r[t];r=r||(i.snapOffset={});h(r[t])||(r[t]=0);if(!o)return r[t];n.get(o.id)||(Qu(t)?r[t]+=o[t]+o.width/2:r[t]+=o[t]+o.height/2);if(!e)return r[t];"x"===t?/left/.test(e)?r[t]-=o.width/2:/right/.test(e)&&(r[t]+=o.width/2):/top/.test(e)?r[t]-=o.height/2:/bottom/.test(e)&&(r[t]+=o.height/2);return r[t]}(r,e,o);n&&(t.offset=n);n=function(e,t){var n=e.context,r=n.createConstraints,o=n.resizeConstraints||{},i=n.gridSnappingContext,e=i.snapConstraints;if(e&&e[t])return e[t];e=e||(i.snapConstraints={});e[t]||(e[t]={});n=n.direction;r&&(Qu(t)?(e.x.min=r.left,e.x.max=r.right):(e.y.min=r.top,e.y.max=r.bottom));r=o.min,o=o.max;r&&(Qu(t)?es(n)?e.x.max=r.left:e.x.min=r.right:Ju(n)?e.y.max=r.top:e.y.min=r.bottom);o&&(Qu(t)?es(n)?e.x.min=o.left:e.x.max=o.right:Ju(n)?e.y.min=o.top:e.y.max=o.bottom);return e[t]}(r,e);n&&L(t,n),Gc(r,e)||i.snapEvent(r,e,t)}))})}function Qu(e){return"x"===e}function Ju(e){return-1!==e.indexOf("n")}function es(e){return-1!==e.indexOf("w")}Zu.prototype.snapEvent=function(e,t,n){Kc(e,t,this.snapValue(e[t],n))},Zu.prototype.getGridSpacing=function(){return 10},Zu.prototype.snapValue=function(e,t){var n,r,o=0;return e=Yu(e+=o=t&&t.offset?t.offset:o,10),t&&t.min&&h(n=t.min)&&(n=Yu(n+o,10,"ceil"),e=Math.max(e,n)),t&&t.max&&h(r=t.max)&&(r=Yu(r+o,10,"floor"),e=Math.min(e,r)),e-=o},Zu.prototype.isActive=function(){return this.active},Zu.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})},Zu.prototype.toggleActive=function(){this.setActive(!this.active)},Zu.$inject=["elementRegistry","eventBus","config.gridSnapping"];function ts(e){this._eventBus=e}ts.$inject=["eventBus"],ts.prototype.on=function(e,r,o,i,a,c){if((m(r)||h(r))&&(c=a,a=i,i=o,o=r,r=null),m(o)&&(c=a,a=i,i=o,o=1e3),_(a)&&(c=a,a=!1),!m(i))throw new Error("handlerFn must be a function");y(e)||(e=[e]);var u=this._eventBus;x(e,function(e){var t,n,e=["commandStack",e,r].filter(function(e){return e}).join(".");u.on(e,o,a?(t=i,n=c,function(e){return t.call(n||null,e.context,e.command,e)}):i,c)})};function ns(e,t){ts.call(this,e),this._gridSnapping=t;var o=this;this.preExecute("shape.resize",function(e){var t,n=e.context,r=(n.hints||{}).autoResize;r&&(t=n.shape,e=n.newBounds,v(r)?n.newBounds=o.snapComplex(e,r):n.newBounds=o.snapSimple(t,e))})}x(["canExecute","preExecute","preExecuted","execute","executed","postExecute","postExecuted","revert","reverted"],function(i){ts.prototype[i]=function(e,t,n,r,o){(m(e)||h(e))&&(o=r,r=n,n=t,t=e,e=null),this.on(e,i,t,n,r,o)}}),ns.$inject=["eventBus","gridSnapping","modeling"],On(ns,ts),ns.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},ns.prototype.snapComplex=function(e,t){return/w|e/.test(t)&&(e=this.snapHorizontally(e,t)),e=/n|s/.test(t)?this.snapVertically(e,t):e},ns.prototype.snapHorizontally=function(e,t){var n=this._gridSnapping,r=/w/.test(t),o=/e/.test(t),t={};return t.width=n.snapValue(e.width,{min:e.width}),o&&(r?(t.x=n.snapValue(e.x,{max:e.x}),t.width+=n.snapValue(e.x-t.x,{min:e.x-t.x})):e.x=e.x+e.width-t.width),L(e,t),e},ns.prototype.snapVertically=function(e,t){var n=this._gridSnapping,r=/n/.test(t),o=/s/.test(t),t={};return t.height=n.snapValue(e.height,{min:e.height}),r&&(o?(t.y=n.snapValue(e.y,{max:e.y}),t.height+=n.snapValue(e.y-t.y,{min:e.y-t.y})):e.y=e.y+e.height-t.height),L(e,t),e};function rs(e,r){e.on(["spaceTool.move","spaceTool.end"],2e3,function(e){var t,n=e.context;n.initialized&&("x"===n.axis?(t=r.snapValue(e.dx),e.x=e.x+t-e.dx,e.dx=t):(t=r.snapValue(e.dy),e.y=e.y+t-e.dy,e.dy=t))})}rs.$inject=["eventBus","gridSnapping"];var Ja={__depends__:[{__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",ns],gridSnappingSpaceToolBehavior:["type",rs]}],__init__:["gridSnapping"],gridSnapping:["type",Zu]},os="keyboard.keydown",is="input-handle-modified-keys";function as(e,t){var n=this;this._config=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()}),t.on("diagram.init",function(){n._fire("init")}),t.on("attach",function(){e&&e.bindTo&&n.bind(e.bindTo)}),t.on("detach",function(){n.unbind()})}as.$inject=["config.keyboard","eventBus"],as.prototype._keydownHandler=function(e){this._keyHandler(e,os)},as.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},as.prototype._keyHandler=function(e,t){this._isEventIgnored(e)||this._eventBus.fire(t||os,{keyEvent:e})&&e.preventDefault()},as.prototype._isEventIgnored=function(e){return(t=e.target)&&(wt(t,"input, textarea")||"true"===t.contentEditable)&&this._isModifiedKeyIgnored(e);var t},as.prototype._isModifiedKeyIgnored=function(e){return!Gu(e)||-1===this._getAllowedModifiers(e.target).indexOf(e.key)},as.prototype._getAllowedModifiers=function(e){e=xt(e,"["+is+"]",!0);return!e||this._node&&!this._node.contains(e)?[]:e.getAttribute(is).split(",")},as.prototype.bind=function(e){this.unbind(),this._node=e,Ct.bind(e,"keydown",this._keydownHandler,!0),Ct.bind(e,"keyup",this._keyupHandler,!0),this._fire("bind")},as.prototype.getBinding=function(){return this._node},as.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),Ct.unbind(e,"keydown",this._keydownHandler,!0),Ct.unbind(e,"keyup",this._keyupHandler,!0)),this._node=null},as.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},as.prototype.addListener=function(e,t,n){m(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||os,e,t)},as.prototype.removeListener=function(e,t){this._eventBus.off(t||os,e)},as.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},as.prototype.isCmd=Gu,as.prototype.isShift=Xu,as.prototype.isKey=Ku;var cs=["c","C",67],us=["v","V",86],ss=["y","Y",89],ls=["z","Z",90];function ps(e,t){var n=this;e.on("editorActions.init",500,function(e){e=e.editorActions;n.registerBindings(t,e)})}ps.$inject=["eventBus","keyboard"],ps.prototype.registerBindings=function(n,r){function e(e,t){r.isRegistered(e)&&n.addListener(t)}e("undo",function(e){e=e.keyEvent;if(Gu(e)&&!Xu(e)&&Ku(ls,e))return r.trigger("undo"),!0}),e("redo",function(e){e=e.keyEvent;if(Gu(e)&&(Ku(ss,e)||Ku(ls,e)&&Xu(e)))return r.trigger("redo"),!0}),e("copy",function(e){e=e.keyEvent;if(Gu(e)&&Ku(cs,e))return r.trigger("copy"),!0}),e("paste",function(e){e=e.keyEvent;if(Gu(e)&&Ku(us,e))return r.trigger("paste"),!0}),e("stepZoom",function(e){e=e.keyEvent;if(Ku(["+","Add","="],e)&&Gu(e))return r.trigger("stepZoom",{value:1}),!0}),e("stepZoom",function(e){e=e.keyEvent;if(Ku(["-","Subtract"],e)&&Gu(e))return r.trigger("stepZoom",{value:-1}),!0}),e("zoom",function(e){e=e.keyEvent;if(Ku("0",e)&&Gu(e))return r.trigger("zoom",{value:1}),!0}),e("removeSelection",function(e){if(Ku(["Backspace","Delete","Del"],e.keyEvent))return r.trigger("removeSelection"),!0})};Bi={__init__:["keyboard","keyboardBindings"],keyboard:["type",as],keyboardBindings:["type",ps]};function fs(e){e.invoke(ps,this)}dn(fs,ps),fs.$inject=["injector"],fs.prototype.registerBindings=function(n,r){function e(e,t){r.isRegistered(e)&&n.addListener(t)}ps.prototype.registerBindings.call(this,n,r),e("selectElements",function(e){e=e.keyEvent;if(n.isKey(["a","A"],e)&&n.isCmd(e))return r.trigger("selectElements"),!0}),e("lassoTool",function(e){e=e.keyEvent;if(!n.hasModifier(e))return n.isKey(["l","L"],e)?(r.trigger("lassoTool"),!0):void 0}),e("handTool",function(e){e=e.keyEvent;if(!n.hasModifier(e))return n.isKey(["h","H"],e)?(r.trigger("handTool"),!0):void 0}),e("directEditing",function(e){e=e.keyEvent;if(!n.hasModifier(e))return n.isKey(["e","E"],e)?(r.trigger("directEditing"),!0):void 0})};var Rt={__depends__:[Bi],__init__:["keyboardBindings"],keyboardBindings:["type",fs]},ds={moveSpeed:50,moveSpeedAccelerated:200};function hs(e,r,o){var i=this;this._config=L({},ds,e||{}),r.addListener(function(e){var t=e.keyEvent,e=i._config;if(r.isCmd(t)&&r.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],t)){var n,e=r.isShift(t)?e.moveSpeedAccelerated:e.moveSpeed;switch(t.key){case"ArrowLeft":case"Left":n="left";break;case"ArrowUp":case"Up":n="up";break;case"ArrowRight":case"Right":n="right";break;case"ArrowDown":case"Down":n="down"}return i.moveCanvas({speed:e,direction:n}),!0}}),this.moveCanvas=function(e){var t=0,n=0,r=e.speed/Math.min(Math.sqrt(o.viewbox().scale),1);switch(e.direction){case"left":t=r;break;case"up":n=r;break;case"right":t=-r;break;case"down":n=-r}o.scroll({dx:t,dy:n})}}hs.$inject=["config.keyboardMove","keyboard","canvas"];var ju={__depends__:[Bi],__init__:["keyboardMove"],keyboardMove:["type",hs]},ys={moveSpeed:1,moveSpeedAccelerated:10},ms={ArrowLeft:"left",Left:"left",ArrowUp:"up",Up:"up",ArrowRight:"right",Right:"right",ArrowDown:"down",Down:"down"},vs={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 gs(e,n,r,o,i){var a=this;this._config=L({},ys,e||{}),n.addListener(1500,function(e){var t=e.keyEvent,e=ms[t.key];if(e&&!n.isCmd(t)){t=n.isShift(t);return a.moveSelection(e,t),!0}}),this.moveSelection=function(e,t){var n=i.get();n.length&&(t=this._config[t?"moveSpeedAccelerated":"moveSpeed"],t=vs[e](t),o.allowed("elements.move",{shapes:n})&&r.moveElements(n,t))}}gs.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];hr={__depends__:[Bi,Si],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",gs]};function bs(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],function(){this.clear(!1)},this)}bs.$inject=["eventBus","injector"],bs.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";t={command:e,context:t};this._pushAction(t),this._internalExecute(t),this._popAction(t)},bs.prototype.canExecute=function(e,t){var n={command:e,context:t},r=this._getHandler(e),n=this._fire(e,"canExecute",n);if(void 0===n){if(!r)return!1;r.canExecute&&(n=r.canExecute(t))}return n},bs.prototype.clear=function(e){this._stack.length=0,!(this._stackIdx=-1)!==e&&this._fire("changed",{trigger:"clear"})},bs.prototype.undo=function(){var e,t=this._getUndoAction();if(t){for(this._currentExecution.trigger="undo",this._pushAction(t);t&&(this._internalUndo(t),(e=this._getUndoAction())&&e.id===t.id);)t=e;this._popAction()}},bs.prototype.redo=function(){var e,t=this._getRedoAction();if(t){for(this._currentExecution.trigger="redo",this._pushAction(t);t&&(this._internalExecute(t,!0),(e=this._getRedoAction())&&e.id===t.id);)t=e;this._popAction()}},bs.prototype.register=function(e,t){this._setHandler(e,t)},bs.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");t=this._injector.instantiate(t);this.register(e,t)},bs.prototype.canUndo=function(){return!!this._getUndoAction()},bs.prototype.canRedo=function(){return!!this._getRedoAction()},bs.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},bs.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},bs.prototype._internalUndo=function(e){var t=this,n=e.command,r=e.context,o=this._getHandler(n);this._atomicDo(function(){t._fire(n,"revert",e),o.revert&&t._markDirty(o.revert(r)),t._revertedAction(e),t._fire(n,"reverted",e)})},bs.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);var r,o,i,a=t?[e+"."+t,t]:[e];for(n=this._eventBus.createEvent(n),r=0;(o=a[r])&&(i=this._eventBus.fire("commandStack."+o,n),!n.cancelBubble);r++);return i},bs.prototype._createId=function(){return this._uid++},bs.prototype._atomicDo=function(e){var t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},bs.prototype._internalExecute=function(e,t){var n=this,r=e.command,o=e.context,i=this._getHandler(r);if(!i)throw new Error("no command handler registered for <"+r+">");this._pushAction(e),t||(this._fire(r,"preExecute",e),i.preExecute&&i.preExecute(o),this._fire(r,"preExecuted",e)),this._atomicDo(function(){n._fire(r,"execute",e),i.execute&&n._markDirty(i.execute(o)),n._executedAction(e,t),n._fire(r,"executed",e)}),t||(this._fire(r,"postExecute",e),i.postExecute&&i.postExecute(o),this._fire(r,"postExecuted",e)),this._popAction(e)},bs.prototype._pushAction=function(e){var t=this._currentExecution,n=t.actions,r=n[0];if(t.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+e.command+")");e.id||(e.id=r&&r.id||this._createId()),n.push(e)},bs.prototype._popAction=function(){var e=this._currentExecution,t=e.trigger,n=e.actions,r=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:function(t){t=D(t);for(var n={},e=arguments.length,r=new Array(1<e?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];return x(r,function(e){return R(e,t,n)}),C(n,function(e,t){return e[0]})}("id",r.reverse())}),r.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},bs.prototype._markDirty=function(e){var t=this._currentExecution;e&&(e=y(e)?e:[e],t.dirty=t.dirty.concat(e))},bs.prototype._executedAction=function(e,t){var n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},bs.prototype._revertedAction=function(e){this._stackIdx--},bs.prototype._getHandler=function(e){return this._handlerMap[e]},bs.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};nu={commandStack:["type",bs]};function _s(n,r,o,t){n.on("element.changed",function(e){var t=e.element;!t.parent&&t!==r.getRootElement()||(e.gfx=o.getGraphics(t)),e.gfx&&n.fire(lr(t)+".changed",e)}),n.on("elements.changed",function(e){e=e.elements;e.forEach(function(e){n.fire("element.changed",{element:e})}),t.updateContainments(e)}),n.on("shape.changed",function(e){t.update("shape",e.element,e.gfx)}),n.on("connection.changed",function(e){t.update("connection",e.element,e.gfx)})}_s.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var uu={__init__:["changeSupport"],changeSupport:["type",_s]},ws=Math.min,xs=Math.max;function Os(e){e.preventDefault()}function js(e){e.stopPropagation()}function Es(e){this.container=e.container,this.parent=kt('<div class="djs-direct-editing-parent"><div class="djs-direct-editing-content" contenteditable="true"></div></div>'),this.content=Dt("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=A(this.autoResize,this),this.handlePaste=A(this.handlePaste,this)}function Cs(e,t){this._eventBus=e,this._providers=[],this._textbox=new Es({container:t.getContainer(),keyHandler:A(this._handleKey,this),resizeHandler:A(this._handleResize,this)})}Es.prototype.create=function(e,t,n,r){var o=this.parent,i=this.content,a=this.container;r=this.options=r||{};var c=$(t=this.style=t||{},["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);L(o.style,{width:e.width+"px",height:e.height+"px",maxWidth:e.maxWidth+"px",maxHeight:e.maxHeight+"px",minWidth:e.minWidth+"px",minHeight:e.minHeight+"px",left:e.x+"px",top:e.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},c);c=$(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return L(i.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},c),r.centerVertically&&L(i.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},c),i.innerText=n,Ct.bind(i,"keydown",this.keyHandler),Ct.bind(i,"mousedown",js),Ct.bind(i,"paste",this.handlePaste),r.autoResize&&Ct.bind(i,"input",this.autoResize),r.resizable&&this.resizable(t),a.appendChild(o),this.setSelection(i.lastChild,i.lastChild&&i.lastChild.length),o},Es.prototype.handlePaste=function(e){var t=this.options,n=this.style;e.preventDefault(),e=e.clipboardData?e.clipboardData.getData("text/plain"):window.clipboardData.getData("Text"),this.insertText(e),!t.autoResize||(n=this.autoResize(n))&&this.resizeHandler(n)},Es.prototype.insertText=function(e){e=e.replace(/\r\n|\r|\n/g,"\n"),document.execCommand("insertText",!1,e)||this._insertTextIE(e)},Es.prototype._insertTextIE=function(n){var e,t,r,o,i=this.getSelection(),a=i.startContainer,c=i.endContainer,u=i.startOffset,s=i.endOffset,l=i.commonAncestorContainer,i=(i=l.childNodes,[].slice.call(i)),p=l.nodeType===Node.TEXT_NODE?(t=a.textContent,a.textContent=t.substring(0,u)+n+t.substring(s),e=a,u+n.length):a===this.content&&c===this.content?(t=document.createTextNode(n),this.content.insertBefore(t,i[u]),(e=t).textContent.length):(r=i.indexOf(a),o=i.indexOf(c),i.forEach(function(e,t){t===r?e.textContent=a.textContent.substring(0,u)+n+c.textContent.substring(s):r<t&&t<=o&&Bt(e)}),e=a,u+n.length);e&&void 0!==p&&setTimeout(function(){self.setSelection(e,p)})},Es.prototype.autoResize=function(){var e=this.parent,t=this.content,n=parseInt(this.style.fontSize)||12;(t.scrollHeight>e.offsetHeight||t.scrollHeight<e.offsetHeight-n)&&(n=e.getBoundingClientRect(),t=t.scrollHeight,e.style.height=t+"px",this.resizeHandler({width:n.width,height:n.height,dx:0,dy:t-n.height}))},Es.prototype.resizable=function(){var r,o,i,a,n,t,c=this,u=this.parent,e=this.resizeHandle,s=parseInt(this.style.minWidth)||0,l=parseInt(this.style.minHeight)||0,p=parseInt(this.style.maxWidth)||1/0,f=parseInt(this.style.maxHeight)||1/0;e||(e=this.resizeHandle=kt('<div class="djs-direct-editing-resize-handle"></div>'),n=function(e){Os(e),js(e);var t=ws(xs(i+e.clientX-r,s),p),n=ws(xs(a+e.clientY-o,l),f);u.style.width=t+"px",u.style.height=n+"px",c.resizeHandler({width:i,height:a,dx:e.clientX-r,dy:e.clientY-o})},t=function e(t){Os(t),js(t),Ct.unbind(document,"mousemove",n,!1),Ct.unbind(document,"mouseup",e,!1)},Ct.bind(e,"mousedown",function(e){Os(e),js(e),r=e.clientX,o=e.clientY;e=u.getBoundingClientRect();i=e.width,a=e.height,Ct.bind(document,"mousemove",n),Ct.bind(document,"mouseup",t)})),L(e.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"}),u.appendChild(e)},Es.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),Ct.unbind(t,"keydown",this.keyHandler),Ct.unbind(t,"mousedown",js),Ct.unbind(t,"input",this.autoResize),Ct.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),Bt(n)),Bt(e)},Es.prototype.getValue=function(){return this.content.innerText.trim()},Es.prototype.getSelection=function(){return window.getSelection().getRangeAt(0)},Es.prototype.setSelection=function(e,t){var n=document.createRange();null===e?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t));t=window.getSelection();t.removeAllRanges(),t.addRange(n)},Cs.$inject=["eventBus","canvas"],Cs.prototype.registerProvider=function(e){this._providers.push(e)},Cs.prototype.isActive=function(e){return!(!this._active||e&&this._active.element!==e)},Cs.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},Cs.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})},Cs.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0},Cs.prototype.complete=function(){var e,t,n,r=this._active;r&&(e=r.context.bounds,t=this.$textbox.getBoundingClientRect(),(n=this.getValue())===r.context.text&&t.height===e.height&&t.width===e.width||(e=this._textbox.container.getBoundingClientRect(),r.provider.update(r.element,n,r.context.text,{x:t.left-e.left,y:t.top-e.top,width:t.width,height:t.height})),this._fire("complete"),this.close())},Cs.prototype.getValue=function(){return this._textbox.getValue()},Cs.prototype._handleKey=function(e){e.stopPropagation();var t=e.keyCode||e.charCode;return 27===t?(e.preventDefault(),this.cancel()):13!==t||e.shiftKey?void 0:(e.preventDefault(),this.complete())},Cs.prototype._handleResize=function(e){this._fire("resize",e)},Cs.prototype.activate=function(t){var n;this.isActive()&&this.cancel();var e=b(this._providers,function(e){return(n=e.activate(t))?e:null});return n&&(this.$textbox=this._textbox.create(n.bounds,n.style,n.text,n.options),this._active={element:t,context:n,provider:e},n.options&&n.options.resizable&&(this.resizable=!0),this._fire("activate")),!!n};_o={__depends__:[bi],__init__:["directEditing"],directEditing:["type",Cs]};function Ss(e){return en(e,"dmn:Decision")||en(e,"dmn:BusinessKnowledgeModel")||en(e,"dmn:InputData")||en(e,"dmn:KnowledgeSource")?"name":en(e,"dmn:TextAnnotation")?"text":void 0}function Ps(e){var t=e.businessObject,e=Ss(t);if(e)return t[e]||""}function ks(e,t,n,r,o){this._canvas=e,this._modeling=r,this._textRenderer=o,t.registerProvider(this),n.on("element.dblclick",function(e){t.activate(e.element)}),n.on(["autoPlace.start","canvas.viewbox.changing","drag.init","drillDown.click","element.mousedown","popupMenu.open","selection.changed"],function(){t.complete()}),n.on(["commandStack.changed"],function(){t.cancel()}),n.on("create.end",500,function(e){e=e.shape;(en(e,"dmn:Decision")||en(e,"dmn:InputData")||en(e,"dmn:BusinessKnowledgeModel")||en(e,"dmn:KnowledgeSource")||en(e,"dmn:TextAnnotation"))&&t.activate(e)}),n.on("autoPlace.end",500,function(e){t.activate(e.shape)})}ks.$inject=["canvas","directEditing","eventBus","modeling","textRenderer"],ks.prototype.activate=function(e){var t=Ps(e);if(f(t)){var n={text:t};L(n,this.getEditingBBox(e));t={};return en(e,"dmn:DRGElement")&&L(t,{centerVertically:!0}),en(e,"dmn:TextAnnotation")&&L(t,{resizable:!0}),L(n,{options:t}),n}},ks.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,r=t.getAbsoluteBBox(n),o={x:r.x,y:r.y},i=t.zoom(),a=this._textRenderer.getDefaultStyle(),n=a.fontSize*i,t=a.lineHeight,a={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};return en(e,"dmn:DRGElement")&&(L(o,{width:r.width,height:r.height}),L(a,{fontSize:n+"px",lineHeight:t,paddingTop:7*i+"px",paddingBottom:7*i+"px",paddingLeft:5*i+"px",paddingRight:5*i+"px"})),en(e,"dmn:TextAnnotation")&&(L(o,{width:r.width,height:r.height,minWidth:30*i,minHeight:10*i}),L(a,{textAlign:"left",paddingTop:5*i+"px",paddingBottom:7*i+"px",paddingLeft:7*i+"px",paddingRight:5*i+"px",fontSize:n+"px",lineHeight:t})),{bounds:o,style:a}},ks.prototype.update=function(e,t,n,r){var o;en(e,"dmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(e),o={x:e.x,y:e.y,width:e.width/o.width*r.width,height:e.height/o.height*r.height}),(r=t)&&r.trim()||(t=null),this._modeling.updateLabel(e,t,o)};zi={__depends__:[nu,uu,_o],__init__:["labelEditingProvider"],labelEditingProvider:["type",ks]};function Rs(o,e){e.invoke(ts,this),this.preExecute("connection.create",function(e){var t=e.connection,n=t.businessObject,r=e.source,e=e.target;en(t,"dmn:Association")?(((n.sourceRef=o.create("dmn:DMNElementReference",{href:"#"+r.id})).$parent=n).targetRef=o.create("dmn:DMNElementReference",{href:"#"+e.id})).$parent=n:(n["required"+(en(e=r,"dmn:BusinessKnowledgeModel")?"Knowledge":en(e,"dmn:Decision")?"Decision":en(e,"dmn:InputData")?"Input":en(e,"dmn:KnowledgeSource")?"Authority":void 0)]=o.create("dmn:DMNElementReference",{href:"#"+r.id})).$parent=n},!0)}Rs.$inject=["drdFactory","injector"],dn(Rs,ts);function Ts(e,u,s,o){function i(n,e,t){e=e||n.incoming.filter(function(e){return en(e,"dmn:InformationRequirement")});var r,o,i={};t?i[t]=e:(r=n,o={},e.forEach(function(e){var t=ao(e.source,r).split("-").shift();o[t]||(o[t]=[]),o[t].push(e)}),i=o),x(i,function(e,t){e=function(e,t){var n;n=t.includes("top")||t.includes("bottom")?"x":"y";return e.sort(function(e,t){return io(e.source)[n]-io(t.source)[n]})}(e,t);var i,a,c,r=(a=n,c=t,(i=e).map(function(e,t){var n=e.source,r=io(n),o=no(n),e=no(a),n=i.length;return c.includes("bottom")?{start:{x:r.x,y:o.top},end:{x:e.left+a.width/(n+1)*(t+1),y:e.bottom}}:c.includes("top")?{start:{x:r.x,y:o.bottom},end:{x:e.left+a.width/(n+1)*(t+1),y:e.top}}:c.includes("right")?{start:{x:o.left,y:r.y},end:{x:e.right,y:e.top+a.height/(n+1)*(t+1)}}:{start:{x:o.right,y:r.y},end:{x:e.left,y:e.top+a.height/(n+1)*(t+1)}}}));e.forEach(function(e,t){var n=r[t].start,t=r[t].end,t=u.layoutConnection(e,{connectionStart:n,connectionEnd:t});s.updateWaypoints(e,t)})})}e.invoke(ts,this),this.preExecute(["connection.create","connection.reconnect"],function(e){var t=e.connection,n=e.newSource||e.source,r=e.newTarget||e.target;en(t,"dmn:InformationRequirement")&&!o.allowed("connection.connect",{connection:t,source:n,target:r})||en(t,"dmn:InformationRequirement")&&(t=ao(n,r),e.hints||(e.hints={}),L(e.hints,function(e,t,n){var r=io(e),o=io(t);n.includes("bottom")?(r.y=e.y,o.y=t.y+t.height):n.includes("top")?(r.y=e.y+e.height,o.y=t.y):n.includes("right")?(r.x=e.x,o.x=t.x+t.width):(r.x=e.x+e.width,o.x=t.x);return{connectionStart:r,connectionEnd:o}}(n,r,t)))},!0),this.postExecuted(["connection.create","connection.delete","connection.reconnect"],function(e){var n,t=e.connection,r=t.source||e.source,e=t.target||e.target;en(t,"dmn:InformationRequirement")&&(n=ao(r,e),(r=e.incoming.filter(function(e){var t=ao(e.source,e.target);return en(e,"dmn:InformationRequirement")&&Ds(t,n)})).length&&i(e,r,n))},!0),this.preExecute("connection.reconnect",function(e){var n,r=e.connection,t=r.source,e=r.target;en(r,"dmn:InformationRequirement")&&(n=ao(t,e),(t=e.incoming.filter(function(e){var t=ao(e.source,e.target);return e!==r&&en(e,"dmn:InformationRequirement")&&Ds(t,n)})).length&&i(e,t,n))},!0),this.postExecuted("elements.move",500,function(e){var t=e.shapes,n=e.closure.enclosedConnections;t.forEach(function(e){var t;on(e,["dmn:Decision","dmn:InputData"])&&((t=e.incoming.filter(function(e){return en(e,"dmn:InformationRequirement")&&!n[e.id]})).length&&i(e,t),e.outgoing.forEach(function(e){en(e,"dmn:InformationRequirement")&&!n[e.id]&&i(e.target)}))})},!0)}function Ds(e,t){return e&&t&&e.split("-").shift()===t.split("-").shift()}function Ms(e,a,c){e.invoke(ts,this),this.preExecute("connection.reconnect",function(e){var t=e.connection,n=e.newSource||t.source,r=e.newTarget||t.target,o=t.waypoints.slice(),i=c.allowed("connection.reconnect",{connection:t,source:n,target:r});i&&i.type!==t.type&&(e.connection=a.connect(n,r,{type:i.type,waypoints:o}),a.removeConnection(t))},!0)}function Bs(e,n,r){ts.call(this,e),this._modeling=n,this.postExecuted(["shape.replace"],1500,function(e){var t=e.context,e=t.oldShape,t=t.newShape;n.unclaimId(e.businessObject.id,e.businessObject),n.updateProperties(t,{id:e.id}),r.select(t)})}function Is(e){return(Is="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function As(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ns(e,t){return(Ns=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ls(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=Vs(n);return function(e,t){{if(t&&("object"===Is(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return $s(e)}(this,r?(e=Vs(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function $s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Vs(e){return(Vs=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Ts.$inject=["injector","layouter","modeling","rules"],dn(Ts,ts),dn(Ms,ts),Ms.$inject=["injector","modeling","rules"],dn(Bs,ts),Bs.$inject=["eventBus","modeling","selection"];da=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ns(e,t)}(o,ts);var e,t,n,r=Ls(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,e)).executed("element.updateProperties",e.updateIds.bind($s(e))),e}return e=o,(t=[{key:"updateIds",value:function(e){var t=e.context,e=t.element,i=t.oldProperties,a=t.properties,e=rn(e);this.shouldSkipUpdate(e,i,a)||((e=function(e){var t=e;for(;!en(t,"dmn:Definitions");)t=t.$parent;return t}(e)).get("drgElement").forEach(function(e){var n,r,o;n=e,r=i.id,o=a.id,x({authorityRequirement:function(){n.authorityRequirement.forEach(function(e){var t=e.requiredAuthority,n=e.requiredDecision,e=e.requiredInput;t&&t.href==="#".concat(r)&&(t.href="#".concat(o)),n&&n.href==="#".concat(r)&&(n.href="#".concat(o)),e&&e.href==="#".concat(r)&&(e.href="#".concat(o))})},informationRequirement:function(){n.informationRequirement.forEach(function(e){var t=e.requiredDecision,e=e.requiredInput;t&&t.href==="#".concat(r)&&(t.href="#".concat(o)),e&&e.href==="#".concat(r)&&(e.href="#".concat(o))})},knowledgeRequirement:function(){n.knowledgeRequirement.forEach(function(e){e=e.requiredKnowledge;e&&e.href==="#".concat(r)&&(e.href="#".concat(o))})}},function(e,t){n[t]&&e()})}),e.get("artifact").forEach(function(e){var n,t,r;n=e,t=i.id,r=a.id,x({sourceRef:function(){var e;(e=n.sourceRef).href==="#".concat(t)&&(e.href="#".concat(r))},targetRef:function(){var e;(e=n.targetRef).href==="#".concat(t)&&(e.href="#".concat(r))}},function(e,t){n[t]&&e()})}))}},{key:"shouldSkipUpdate",value:function(e,t,n){return n=n,!("id"in t&&"id"in n)||!en(e,"dmn:DRGElement")&&!en(e,"dmn:TextAnnotation")}}])&&As(e.prototype,t),n&&As(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();da.$inject=["eventBus"];Bi={__init__:["createConnectionBehavior","idChangeBehavior","layoutConnectionBehavior","replaceConnectionBehavior","replaceElementBehavior"],createConnectionBehavior:["type",Rs],idChangeBehavior:["type",da],layoutConnectionBehavior:["type",Ts],replaceConnectionBehavior:["type",Ms],replaceElementBehavior:["type",Bs]};function zs(e){ts.call(this,e),this.init()}function Fs(e){e.invoke(zs,this)}function Us(e,t){if(!e||qs(e)||!t||qs(t))return null;if(e===t)return!1;if(en(e,"dmn:BusinessKnowledgeModel")&&on(t,["dmn:BusinessKnowledgeModel","dmn:Decision"]))return{type:"dmn:KnowledgeRequirement"};if(en(e,"dmn:Decision")){if(en(t,"dmn:Decision"))return{type:"dmn:InformationRequirement"};if(en(t,"dmn:KnowledgeSource"))return{type:"dmn:AuthorityRequirement"}}if(en(e,"dmn:Definitions")||en(t,"dmn:Definitions"))return!1;if(en(e,"dmn:InputData")){if(en(t,"dmn:Decision"))return{type:"dmn:InformationRequirement"};if(en(t,"dmn:KnowledgeSource"))return{type:"dmn:AuthorityRequirement"}}return en(e,"dmn:KnowledgeSource")&&on(t,["dmn:BusinessKnowledgeModel","dmn:Decision","dmn:KnowledgeSource"])?{type:"dmn:AuthorityRequirement"}:!!(en(e,"dmn:TextAnnotation")&&!en(t,"dmn:TextAnnotation")||!en(e,"dmn:TextAnnotation")&&en(t,"dmn:TextAnnotation"))&&{type:"dmn:Association"}}function Hs(e,t){return on(e,["dmn:BusinessKnowledgeModel","dmn:Decision","dmn:InputData","dmn:KnowledgeSource","dmn:TextAnnotation"])&&en(t,"dmn:Definitions")}function Ws(e,t){return y(e)||(e=[e]),!t||!(!j(e,function(e){return on(e,["dmn:BusinessKnowledgeModel","dmn:Decision","dmn:InputData","dmn:KnowledgeSource","dmn:TextAnnotation","dmn:InformationRequirement","dmn:AuthorityRequirement","dmn:KnowledgeRequirement","dmn:Association"])})||!en(t,"dmn:Definitions"))}function qs(e){return e.labelTarget}zs.$inject=["eventBus"],On(zs,ts),zs.prototype.addRule=function(e,t,r){var n=this;(e="string"==typeof e?[e]:e).forEach(function(e){n.canExecute(e,t,function(e,t,n){return r(e)},!0)})},zs.prototype.init=function(){},dn(Fs,zs),Fs.$inject=["injector"],Fs.prototype.init=function(){this.addRule("connection.create",function(e){return Us(e.source,e.target)}),this.addRule("connection.reconnect",function(e){e.connection;return Us(e.source,e.target)}),this.addRule("connection.updateWaypoints",function(e){e=e.connection;return{type:e.type,businessObject:e.businessObject}}),this.addRule("elements.move",function(e){var t=e.target,n=e.shapes;e.position;return Ws(n,t)}),this.addRule("shape.create",function(e){return Hs(e.shape,e.target)}),this.addRule("shape.resize",function(e){return en(e.shape,"dmn:TextAnnotation")})},Fs.prototype.canConnect=Us,Fs.prototype.canCreate=Hs,Fs.prototype.canMove=Ws;_o={__depends__:[uc],__init__:["drdRules"],drdRules:["type",Fs]};function Gs(e){this._model=e}function Ks(n,t,e,r,o){o.invoke(ts,this),this._definitionPropertiesView=t,this._drdFactory=e,this._drdRules=r;var i=this;function a(e){var t=e.connection,n=e.parent,e=e.shape;t&&!en(t,"dmn:Association")&&(n=t.target),i.updateParent(e||t,n)}function c(e){var t=e.connection,n=e.shape,e=e.parent||e.newParent;t&&!en(t,"dmn:Association")&&(e=t.target),i.updateParent(n||t,e)}function u(e){e=e.shape;(en(e,"dmn:DRGElement")||en(e,"dmn:TextAnnotation"))&&i.updateBounds(e)}function s(e){i.updateConnectionWaypoints(e)}this.executed(["connection.create","connection.layout"],function(e){var t=e.connection;e.cropped||(t.waypoints=n.getCroppedWaypoints(t),e.cropped=!0)},!0),this.reverted(["connection.layout"],function(e){delete e.cropped},!0),this.executed(["connection.create","connection.delete","connection.move","shape.create","shape.delete"],a,!0),this.reverted(["connection.create","connection.delete","connection.move","shape.create","shape.delete"],c,!0),this.executed(["shape.create","shape.move","shape.resize"],u,!0),this.reverted(["shape.create","shape.move","shape.resize"],u,!0),this.executed(["connection.create","connection.layout","connection.move","connection.updateWaypoints"],s,!0),this.reverted(["connection.create","connection.layout","connection.move","connection.updateWaypoints"],s,!0),this.executed("connection.create",function(e){var t=e.connection,n=t.businessObject,r=e.target.businessObject;en(t,"dmn:Association")?a(e):i.updateSemanticParent(n,r)},!0),this.reverted("connection.create",function(e){c(e)},!0),this.executed("connection.reconnect",function(e){var t=e.connection.businessObject,e=e.newTarget.businessObject;en(t,"dmn:Association")||i.updateSemanticParent(t,e)},!0),this.reverted("connection.reconnect",function(e){var t=e.connection.businessObject,e=e.oldTarget.businessObject;en(t,"dmn:Association")||i.updateSemanticParent(t,e)},!0),this.executed("element.updateProperties",function(e){t.update()},!0),this.reverted("element.updateProperties",function(e){t.update()},!0)}function Xs(e,t){this._modeling=e,this._canvas=t}function Ys(e){this._modeling=e}function Zs(e,t){this._canvas=e,this._layouter=t}Gs.$inject=["moddle"],Gs.prototype._needsId=function(e){return on(e,["dmn:Artifact","dmn:DMNElement","dmn:DRGElement","dmndi:DMNDiagram","dmndi:DMNDiagramElement"])},Gs.prototype._ensureId=function(e){var t=(e.$type||"").replace(/^[^:]*:/g,"")+"_";!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e))},Gs.prototype.create=function(e,t){t=this._model.create(e,t||{});return this._ensureId(t),t},Gs.prototype.createDiShape=function(e,t,n){return this.create("dmndi:DMNShape",L({dmnElementRef:e,bounds:this.createDiBounds(t)},n))},Gs.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)},Gs.prototype.createDiEdge=function(e,t,n){return this.create("dmndi:DMNEdge",{dmnElementRef:e,waypoint:this.createDiWaypoints(t)},n)},Gs.prototype.createDiWaypoints=function(e){var t=this;return e.map(function(e){return t.createDiWaypoint(e)})},Gs.prototype.createDiWaypoint=function(e){return this.create("dc:Point",$(e,["x","y"]))},Gs.prototype.createExtensionElements=function(){return this.create("dmn:ExtensionElements",{values:[]})},dn(Ks,ts),Ks.$inject=["connectionDocking","definitionPropertiesView","drdFactory","drdRules","injector"],Ks.prototype.updateBounds=function(e){L(e.businessObject.di.bounds,{x:e.x,y:e.y,width:e.width,height:e.height})},Ks.prototype.updateConnectionWaypoints=function(e){var t=this._drdFactory,e=e.connection,n=e.businessObject.di;n.waypoint=t.createDiWaypoints(e.waypoints).map(function(e){return e.$parent=n,e})},Ks.prototype.updateParent=function(e,t){var n=e.parent;en(e,"dmn:DRGElement")||en(e,"dmn:Artifact")||(n=t);e=e.businessObject,n=n&&n.businessObject;this.updateSemanticParent(e,n),this.updateDiParent(e.di,n&&n.di)},Ks.prototype.updateSemanticParent=function(e,t){var n,r;e.$parent!==t&&(en(e,"dmn:DRGElement")?r="drgElement":en(e,"dmn:Artifact")?r="artifact":en(e,"dmn:InformationRequirement")?r="informationRequirement":en(e,"dmn:AuthorityRequirement")?r="authorityRequirement":en(e,"dmn:KnowledgeRequirement")&&(r="knowledgeRequirement"),e.$parent&&yr(n=e.$parent.get(r),e),t?(n=t.get(r))&&(n.push(e),e.$parent=t):e.$parent=null)},Ks.prototype.updateDiParent=function(e,t){if(e.$parent!==t){if(!on(e,["dmndi:DMNEdge","dmndi:DMNShape"]))throw new Error("unsupported");for(var n=t||e;!en(n,"dmndi:DMNDiagram");)n=n.$parent;var r=n.get("diagramElements");t?(e.$parent=n,mr(r,e)):(e.$parent=null,yr(r,e))}},Xs.$inject=["modeling","canvas"],Xs.prototype.preExecute=function(e){var n=this._modeling,t=e.elements,r=e.alignment;x(t,function(e){var t={x:0,y:0};r.left?t.x=r.left-e.x:r.right?t.x=r.right-e.width-e.x:r.center?t.x=r.center-Math.round(e.width/2)-e.x:r.top?t.y=r.top-e.y:r.bottom?t.y=r.bottom-e.height-e.y:r.middle&&(t.y=r.middle-Math.round(e.height/2)-e.y),n.moveElements([e],t,e.parent)})},Xs.prototype.postExecute=function(e){},Ys.$inject=["modeling"],Ys.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var n=e.target||t.parent,r=e.shape,t=e.hints||{},r=e.shape=this._modeling.createShape(r,e.position,n,{attach:t.attach});e.shape=r},Ys.prototype.postExecute=function(e){var t,n,r=e.hints||{};t=e.source,n=e.shape,E(t.outgoing,function(e){return e.target===n})||(r.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))},Zs.$inject=["canvas","layouter"],Zs.prototype.execute=function(e){var t=e.connection,n=e.source,r=e.target,o=e.parent,i=e.parentIndex,e=e.hints;if(!n||!r)throw new Error("source and target required");if(!o)throw new Error("parent required");return t.source=n,t.target=r,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,e)),this._canvas.addConnection(t,o,i),t},Zs.prototype.revert=function(e){e=e.connection;return this._canvas.removeConnection(e),e.source=null,e.target=null,e};var Qs=Math.round;function Js(e){this._modeling=e}function el(e){return e.waypoints}Js.$inject=["modeling"],Js.prototype.preExecute=function(e){var t=e.elements,n=e.parent,r=e.parentIndex,o=e.position,i=e.hints,a=this._modeling;x(t,function(e){h(e.x)||(e.x=0),h(e.y)||(e.y=0)});var c=sr(w(t,function(e){return!e.hidden}));x(t,function(e){el(e)&&(e.waypoints=C(e.waypoints,function(e){return{x:Qs(e.x-c.x-c.width/2+o.x),y:Qs(e.y-c.y-c.height/2+o.y)}})),L(e,{x:Qs(e.x-c.x-c.width/2+o.x),y:Qs(e.y-c.y-c.height/2+o.y)})});var u=or(t),s={};x(t,function(e){var t;el(e)?s[e.id]=h(r)?a.createConnection(s[e.source.id],s[e.target.id],r,e,e.parent||n,i):a.createConnection(s[e.source.id],s[e.target.id],e,e.parent||n,i):(t=L({},i),-1===u.indexOf(e)&&(t.autoResize=!1),s[e.id]=h(r)?a.createShape(e,$(e,["x","y","width","height"]),e.parent||n,r,t):a.createShape(e,$(e,["x","y","width","height"]),e.parent||n,t))}),e.elements=k(s)};var tl=Math.round;function nl(e){this._canvas=e}function rl(e){nl.call(this,e)}nl.$inject=["canvas"],nl.prototype.execute=function(e){var t=e.shape,n=e.position,r=e.parent,e=e.parentIndex;if(!r)throw new Error("parent required");if(!n)throw new Error("position required");return void 0!==n.width?L(t,n):L(t,{x:n.x-tl(t.width/2),y:n.y-tl(t.height/2)}),this._canvas.addShape(t,r,e),t},nl.prototype.revert=function(e){e=e.shape;return this._canvas.removeShape(e),e},On(rl,nl),rl.$inject=["canvas"];var ol=nl.prototype.execute;rl.prototype.execute=function(e){var t,n=e.shape;return t=n,["width","height"].forEach(function(e){void 0===t[e]&&(t[e]=0)}),n.labelTarget=e.labelTarget,ol.call(this,e)};var il=nl.prototype.revert;function al(e,t){if("function"!=typeof t)throw new Error("removeFn iterator must be a function");if(e){for(var n;n=e[0];)t(n);return e}}function cl(e,t){this._canvas=e,this._modeling=t}function ul(e,t){this._modeling=e,this._elementRegistry=t}function sl(e,t){this._canvas=e,this._modeling=t}function ll(e){this._modeling=e}rl.prototype.revert=function(e){return e.shape.labelTarget=null,il.call(this,e)},cl.$inject=["canvas","modeling"],cl.prototype.preExecute=function(e){var t=this._modeling,e=e.connection;al(e.incoming,function(e){t.removeConnection(e,{nested:!0})}),al(e.outgoing,function(e){t.removeConnection(e,{nested:!0})})},cl.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=vr(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},cl.prototype.revert=function(e){var t=e.connection,n=e.parent,r=e.parentIndex;return t.source=e.source,t.target=e.target,mr(n.children,t,r),this._canvas.addConnection(t,n),t},ul.$inject=["modeling","elementRegistry"],ul.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry;x(e.elements,function(e){n.get(e.id)&&(e.waypoints?t.removeConnection(e):t.removeShape(e))})},sl.$inject=["canvas","modeling"],sl.prototype.preExecute=function(e){var t=this._modeling,e=e.shape;al(e.incoming,function(e){t.removeConnection(e,{nested:!0})}),al(e.outgoing,function(e){t.removeConnection(e,{nested:!0})}),al(e.children,function(e){e.waypoints?t.removeConnection(e,{nested:!0}):t.removeShape(e,{nested:!0})})},sl.prototype.execute=function(e){var t=this._canvas,n=e.shape,r=n.parent;return e.oldParent=r,e.oldParentIndex=vr(r.children,n),t.removeShape(n),n},sl.prototype.revert=function(e){var t=this._canvas,n=e.shape,r=e.oldParent,e=e.oldParentIndex;return mr(r.children,n,e),t.addShape(n,r),n},ll.$inject=["modeling"];var pl={x:"y",y:"x"};function fl(e,t){this._layouter=e,this._canvas=t}function dl(){}function hl(e,t,n){var r=Ji(t),o=Ji(n),e=ea(e,r),r=e.x*(n.width/t.width),t=e.y*(n.height/t.height);return to({x:o.x+r,y:o.y+t})}function yl(e,t,n){var r=_l(e),e=wl(r,t),r=r[0];return e.length?e[e.length-1]:hl(r.original||r,n,t)}function ml(e,t,n){var r=_l(e),e=wl(r,t),r=r[r.length-1];return e.length?e[0]:hl(r.original||r,n,t)}function vl(e,t,n){e=_l(e),n=bl(t,n),e=e[0];return hl(e.original||e,n,t)}function gl(e,t,n){e=_l(e),n=bl(t,n),e=e[e.length-1];return hl(e.original||e,n,t)}function bl(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function _l(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function wl(e,t){return w(C(e,xl),function(e){return"intersect"===ao(t,e,1)})}function xl(e){return e.original||e}function Ol(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}function jl(e){this._modeling=e}function El(e){this._helper=new jl(e)}function Cl(e){this._modeling=e,this._helper=new jl(e)}function Sl(e){this._modeling=e}function Pl(e){return e.original||e}function kl(e,t){this._modeling=e,this._rules=t}function Rl(e){this._modeling=e}function Tl(e,t){return-1!==e.indexOf(t)}function Dl(e){this._modeling=e}function Ml(e){return L({},e)}function Bl(e){switch(e){case"n":return"y";case"w":return"x";case"s":return"y";case"e":return"x"}}function Il(e,t,n){var r=Bl(n);return/e|s/.test(n)?e[r]>t:/n|w/.test(n)&&e[r]<t}function Al(e,t){return-1!==e.indexOf(t)}function Nl(e){this._modeling=e}function Ll(e){this._modeling=e}function $l(e,t){return yr(e&&e.attachers,t)}function Vl(e,t,n){var r;e&&((r=e.attachers)||(e.attachers=r=[]),mr(r,t,n))}function zl(){}function Fl(e,t,n){this._eventBus=e,this._elementFactory=t,this._commandStack=n;var r=this;e.on("diagram.init",function(){r.registerHandlers(n)})}function Ul(e){this._moddle=e}function Hl(){function t(e,t){var n,r,o,i=e.label||e,a=e.labelTarget||e;return r=t,o=a!==(n=i),e=n.businessObject,(t=Ss(e))&&(e[t]=r),o&&(n.hidden=!r),[i,a]}this.execute=function(e){return e.oldLabel=Ps(e.element),t(e.element,e.newLabel)},this.revert=function(e){return t(e.element,e.oldLabel)}}ll.prototype.preExecute=function(e){var i=this._modeling,a=e.groups,c=e.axis,u=e.dimension;function s(e,t){e.range.min=Math.min(t[c],e.range.min),e.range.max=Math.max(t[c]+t[u],e.range.max)}function l(e){return e[c]+e[u]/2}function p(e){return e.length-1}function f(e){return e.max-e.min}var d,t=a[0],h=p(a),y=a[h],m=0;x(a,function(r,e){var t,n,o;r.elements.length<2?e&&e!==a.length-1&&(s(r,r.elements[0]),m+=f(r.range)):(n=(t=T(r.elements,c))[0],e===h&&(n=t[p(t)]),o=l(n),r.range=null,x(t,function(e){var t,n;(n={y:0})[c]=o-l(t=e),n[c]&&(n[pl[c]]=0,i.moveElements([t],n,t.parent)),null!==r.range?s(r,e):r.range={min:e[c],max:e[c]+e[u]}}),e&&e!==a.length-1&&(m+=f(r.range)))}),e=Math.abs(y.range.min-t.range.max),(d=Math.round((e-m)/(a.length-1)))<a.length-1||x(a,function(n,e){var r,o={};n!==t&&n!==y&&(r=a[e-1],n.range.max=0,x(n.elements,function(e,t){o[pl[c]]=0,o[c]=r.range.max-e[c]+d,n.range.min!==e[c]&&(o[c]+=e[c]-n.range.min),o[c]&&i.moveElements([e],o,e.parent),n.range.max=Math.max(e[c]+e[u],t?n.range.max:0)}))})},ll.prototype.postExecute=function(e){},fl.$inject=["layouter","canvas"],fl.prototype.execute=function(e){var t=e.connection;return L(e,{oldWaypoints:t.waypoints}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t},fl.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t},dl.prototype.execute=function(e){var t=e.connection,n=e.delta,r=e.newParent||t.parent,o=e.newParentIndex,i=t.parent;return e.oldParent=i,e.oldParentIndex=yr(i.children,t),mr(r.children,t,o),t.parent=r,x(t.waypoints,function(e){e.x+=n.x,e.y+=n.y,e.original&&(e.original.x+=n.x,e.original.y+=n.y)}),t},dl.prototype.revert=function(e){var t=e.connection,n=t.parent,r=e.oldParent,o=e.oldParentIndex,i=e.delta;return yr(n.children,t),mr(r.children,t,o),t.parent=r,x(t.waypoints,function(e){e.x-=i.x,e.y-=i.y,e.original&&(e.original.x-=i.x,e.original.y-=i.y)}),t},Ol.prototype.add=function(e,t){return this.addAll([e],t)},Ol.prototype.addAll=function(e,t){return L(this,ur(e,!!t,this)),this},jl.prototype.moveRecursive=function(e,t,n){return e?this.moveClosure(this.getClosure(e),t,n):[]},jl.prototype.moveClosure=function(e,r,o,t,n){var i=this._modeling,a=e.allShapes,c=e.allConnections,u=e.enclosedConnections,s=e.topLevel,l=!1;n&&n.parent===o&&(l=!0),x(a,function(e){i.moveShape(e,r,s[e.id]&&!l&&o,{recurse:!1,layout:!1})}),x(c,function(e){var t=!!a[e.source.id],n=!!a[e.target.id];u[e.id]&&t&&n?i.moveConnection(e,r,s[e.id]&&!l&&o):i.layoutConnection(e,{connectionStart:t&&vl(e,e.source,r),connectionEnd:n&&gl(e,e.target,r)})})},jl.prototype.getClosure=function(e){return(new Ol).addAll(e,!0)},El.$inject=["modeling"],El.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)},El.prototype.postExecute=function(e){var t,n=e.hints;n&&n.primaryShape&&(t=n.primaryShape,n.oldParent=t.parent),this._helper.moveClosure(e.closure,e.delta,e.newParent,e.newHost,t)},Cl.$inject=["modeling"],Cl.prototype.execute=function(e){var t=e.shape,n=e.delta,r=e.newParent||t.parent,o=e.newParentIndex,i=t.parent;return e.oldBounds=$(t,["x","y","width","height"]),e.oldParent=i,e.oldParentIndex=yr(i.children,t),mr(r.children,t,o),L(t,{parent:r,x:t.x+n.x,y:t.y+n.y}),t},Cl.prototype.postExecute=function(e){var t=e.shape,n=e.delta,r=e.hints,o=this._modeling;!1!==r.layout&&(x(t.incoming,function(e){o.layoutConnection(e,{connectionEnd:gl(e,t,n)})}),x(t.outgoing,function(e){o.layoutConnection(e,{connectionStart:vl(e,t,n)})})),!1!==r.recurse&&this.moveChildren(e)},Cl.prototype.revert=function(e){var t=e.shape,n=e.oldParent,r=e.oldParentIndex,e=e.delta;return mr(n.children,t,r),L(t,{parent:n,x:t.x-e.x,y:t.y-e.y}),t},Cl.prototype.moveChildren=function(e){var t=e.delta,e=e.shape;this._helper.moveRecursive(e.children,t,null)},Cl.prototype.getNewParent=function(e){return e.newParent||e.shape.parent},Sl.$inject=["modeling"],Sl.prototype.execute=function(e){var t=e.newSource,n=e.newTarget,r=e.connection,o=e.dockingOrPoints;if(!t&&!n)throw new Error("newSource or newTarget required");return y(o)&&(e.oldWaypoints=r.waypoints,r.waypoints=o),t&&(e.oldSource=r.source,r.source=t),n&&(e.oldTarget=r.target,r.target=n),r},Sl.prototype.postExecute=function(e){var t=e.connection,n=e.newSource,r=e.newTarget,o=e.dockingOrPoints,i=e.hints||{},e={};i.connectionStart&&(e.connectionStart=i.connectionStart),i.connectionEnd&&(e.connectionEnd=i.connectionEnd),!1!==i.layoutConnection&&(!n||r&&"source"!==i.docking||(e.connectionStart=e.connectionStart||Pl(y(o)?o[0]:o)),!r||n&&"target"!==i.docking||(e.connectionEnd=e.connectionEnd||Pl(y(o)?o[o.length-1]:o)),i.newWaypoints&&(e.waypoints=i.newWaypoints),this._modeling.layoutConnection(t,e))},Sl.prototype.revert=function(e){var t=e.oldSource,n=e.oldTarget,r=e.oldWaypoints,e=e.connection;return t&&(e.source=t),n&&(e.target=n),r&&(e.waypoints=r),e},kl.$inject=["modeling","rules"],kl.prototype.preExecute=function(e){var n=this,t=this._modeling,r=this._rules,o=e.oldShape,i=e.newData,a=e.hints||{};function c(e,t,n){return r.allowed("connection.reconnect",{connection:n,source:e,target:t})}var u={x:i.x,y:i.y},s={x:o.x,y:o.y,width:o.width,height:o.height},l=e.newShape=e.newShape||n.createShape(i,u,o.parent,a);o.host&&t.updateAttachment(l,o.host),!1!==a.moveChildren&&(p=o.children.slice(),t.moveElements(p,{x:0,y:0},l,a));var p=o.incoming.slice(),o=o.outgoing.slice();x(p,function(e){c(e.source,l,e)&&n.reconnectEnd(e,l,ml(e,l,s),a)}),x(o,function(e){var t=e.target;c(l,t,e)&&n.reconnectStart(e,l,yl(e,l,s),a)})},kl.prototype.postExecute=function(e){e=e.oldShape;this._modeling.removeShape(e)},kl.prototype.execute=function(e){},kl.prototype.revert=function(e){},kl.prototype.createShape=function(e,t,n,r){return this._modeling.createShape(e,t,n,r)},kl.prototype.reconnectStart=function(e,t,n,r){this._modeling.reconnectStart(e,t,n,r)},kl.prototype.reconnectEnd=function(e,t,n,r){this._modeling.reconnectEnd(e,t,n,r)},Rl.$inject=["modeling"],Rl.prototype.execute=function(e){var t=e.shape,n=e.newBounds,r=e.minBounds;if(void 0===n.x||void 0===n.y||void 0===n.width||void 0===n.height)throw new Error("newBounds must have {x, y, width, height} properties");if(r&&(n.width<r.width||n.height<r.height))throw new Error("width and height cannot be less than minimum height and width");if(!r&&n.width<10||n.height<10)throw new Error("width and height cannot be less than 10px");return e.oldBounds={width:t.width,height:t.height,x:t.x,y:t.y},L(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},Rl.prototype.postExecute=function(e){var t=this._modeling,n=e.shape,r=e.oldBounds;!1!==(e.hints||{}).layout&&(x(n.incoming,function(e){t.layoutConnection(e,{connectionEnd:ml(e,n,r)})}),x(n.outgoing,function(e){t.layoutConnection(e,{connectionStart:yl(e,n,r)})}))},Rl.prototype.revert=function(e){var t=e.shape,e=e.oldBounds;return L(t,{width:e.width,height:e.height,x:e.x,y:e.y}),t},Dl.$inject=["modeling"],Dl.prototype.preExecute=function(e){var r,o,i,t=e.delta,n=e.direction,a=e.movingShapes,c=e.resizingShapes,e=e.start,u={};this.moveShapes(a,t),x(c,function(e){u[e.id]={x:e.x,y:e.y,height:e.height,width:e.width}}),this.resizeShapes(c,t,n),this.updateConnectionWaypoints((o=c,i=[],x((r=a).concat(o),function(e){var t=e.incoming,e=e.outgoing;x(t.concat(e),function(e){var t=e.source,n=e.target;(Tl(r,t)||Tl(r,n)||Tl(o,t)||Tl(o,n))&&(Tl(i,e)||i.push(e))})}),i),t,n,e,a,c,u)},Dl.prototype.execute=function(){},Dl.prototype.revert=function(){},Dl.prototype.moveShapes=function(e,t){var n=this;x(e,function(e){n._modeling.moveShape(e,t,null,{autoResize:!1,layout:!1,recurse:!1})})},Dl.prototype.resizeShapes=function(e,n,r){var o=this;x(e,function(e){var t=function(e,t,n){var r=e.x,o=e.y,i=e.width,a=e.height,c=n.x,u=n.y;switch(t){case"n":return{x:r,y:o+u,width:i,height:a-u};case"s":return{x:r,y:o,width:i,height:a+u};case"w":return{x:r+c,y:o,width:i-c,height:a};case"e":return{x:r,y:o,width:i+c,height:a};default:throw new Error("unknown direction: "+t)}}(e,r,n);o._modeling.resizeShape(e,t,null,{attachSupport:!1,autoResize:!1,layout:!1})})},Dl.prototype.updateConnectionWaypoints=function(e,a,c,u,s,l,p){var f=this,d=s.concat(l);x(e,function(e){var t=e.source,n=e.target,r=C(e.waypoints,function(e){return(e=Ml(e)).original&&(e.original=Ml(e.original)),e}),o=Bl(c),i={labelBehavior:!1};Al(d,t)&&Al(d,n)?(r=C(r,function(e){return Il(e,u,c)&&(e[o]=e[o]+a[o]),e.original&&Il(e.original,u,c)&&(e.original[o]=e.original[o]+a[o]),e}),f._modeling.updateWaypoints(e,r,{labelBehavior:!1})):(Al(d,t)||Al(d,n))&&(Al(s,t)?i.connectionStart=vl(e,t,a):Al(s,n)?i.connectionEnd=gl(e,n,a):Al(l,t)?i.connectionStart=yl(e,t,p[t.id]):Al(l,n)&&(i.connectionEnd=ml(e,n,p[n.id])),f._modeling.layoutConnection(e,i))})},Nl.$inject=["modeling"],Nl.prototype.execute=function(e){var t=e.shape,n=t.children;e.oldChildrenVisibility=function t(e){var n={};x(e,function(e){n[e.id]=e.hidden,e.children&&(n=L({},n,t(e.children)))});return n}(n),t.collapsed=!t.collapsed;n=function t(e,n){var r=[];x(e,function(e){e.hidden=n,r=r.concat(e),e.children&&(r=r.concat(t(e.children,e.collapsed||n)))});return r}(n,t.collapsed);return[t].concat(n)},Nl.prototype.revert=function(e){var t=e.shape,e=e.oldChildrenVisibility,e=function t(e,n){var r=[];x(e,function(e){e.hidden=n[e.id],r=r.concat(e),e.children&&(r=r.concat(t(e.children,n)))});return r}(t.children,e);return t.collapsed=!t.collapsed,[t].concat(e)},Ll.$inject=["modeling"],Ll.prototype.execute=function(e){var t=e.shape,n=e.newHost,r=t.host;return e.oldHost=r,e.attacherIdx=$l(r,t),Vl(n,t),t.host=n,t},Ll.prototype.revert=function(e){var t=e.shape,n=e.newHost,r=e.oldHost,e=e.attacherIdx;return t.host=r,$l(n,t),Vl(r,t,e),t},zl.prototype.execute=function(e){var t=e.connection,n=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=n,t},zl.prototype.revert=function(e){var t=e.connection,e=e.oldWaypoints;return t.waypoints=e,t},Fl.$inject=["eventBus","elementFactory","commandStack"],Fl.prototype.getHandlers=function(){return{"shape.append":Ys,"shape.create":nl,"shape.delete":sl,"shape.move":Cl,"shape.resize":Rl,"shape.replace":kl,"shape.toggleCollapse":Nl,spaceTool:Dl,"label.create":rl,"connection.create":Zs,"connection.delete":cl,"connection.move":dl,"connection.layout":fl,"connection.updateWaypoints":zl,"connection.reconnect":Sl,"elements.create":Js,"elements.move":El,"elements.delete":ul,"elements.distribute":ll,"elements.align":Xs,"element.updateAttachment":Ll}},Fl.prototype.registerHandlers=function(n){x(this.getHandlers(),function(e,t){n.registerHandler(t,e)})},Fl.prototype.moveShape=function(e,t,n,r,o){"object"===Ve(r)&&(o=r,r=null),this._commandStack.execute("shape.move",{shape:e,delta:t,newParent:n,newParentIndex:r,hints:o||{}})},Fl.prototype.updateAttachment=function(e,t){this._commandStack.execute("element.updateAttachment",{shape:e,newHost:t})},Fl.prototype.moveElements=function(e,t,n,r){var o,i=(r=r||{}).attach,a=n;!0===i?a=(o=n).parent:!1===i&&(o=null),this._commandStack.execute("elements.move",{shapes:e,delta:t,newParent:a,newHost:o,hints:r})},Fl.prototype.moveConnection=function(e,t,n,r,o){"object"===Ve(r)&&(o=r,r=void 0),this._commandStack.execute("connection.move",{connection:e,delta:t,newParent:n,newParentIndex:r,hints:o||{}})},Fl.prototype.layoutConnection=function(e,t){this._commandStack.execute("connection.layout",{connection:e,hints:t||{}})},Fl.prototype.createConnection=function(e,t,n,r,o,i){"object"===Ve(n)&&(i=o,o=r,r=n,n=void 0);i={source:e,target:t,parent:o,parentIndex:n,connection:r=this._create("connection",r),hints:i};return this._commandStack.execute("connection.create",i),i.connection},Fl.prototype.createShape=function(e,t,n,r,o){"number"!=typeof r&&(o=r,r=void 0);var i,a,c=(o=o||{}).attach;e=this._create("shape",e),c?(i=n.parent,a=n):i=n;o={position:t,shape:e,parent:i,parentIndex:r,host:a,hints:o};return this._commandStack.execute("shape.create",o),o.shape},Fl.prototype.createElements=function(e,t,n,r,o){"number"!=typeof r&&(o=r,r=void 0);o={position:t,elements:e=!y(e)?[e]:e,parent:n,parentIndex:r,hints:o=o||{}};return this._commandStack.execute("elements.create",o),o.elements},Fl.prototype.createLabel=function(e,t,n,r){n=this._create("label",n);n={labelTarget:e,position:t,parent:r||e.parent,shape:n};return this._commandStack.execute("label.create",n),n.shape},Fl.prototype.appendShape=function(e,t,n,r,o){o=o||{};o={source:e,position:n,target:r,shape:t=this._create("shape",t),connection:o.connection,connectionParent:o.connectionParent,hints:o};return this._commandStack.execute("shape.append",o),o.shape},Fl.prototype.removeElements=function(e){this._commandStack.execute("elements.delete",{elements:e})},Fl.prototype.distributeElements=function(e,t,n){this._commandStack.execute("elements.distribute",{groups:e,axis:t,dimension:n})},Fl.prototype.removeShape=function(e,t){this._commandStack.execute("shape.delete",{shape:e,hints:t||{}})},Fl.prototype.removeConnection=function(e,t){this._commandStack.execute("connection.delete",{connection:e,hints:t||{}})},Fl.prototype.replaceShape=function(e,t,n){n={oldShape:e,newData:t,hints:n||{}};return this._commandStack.execute("shape.replace",n),n.newShape},Fl.prototype.alignElements=function(e,t){this._commandStack.execute("elements.align",{elements:e,alignment:t})},Fl.prototype.resizeShape=function(e,t,n,r){this._commandStack.execute("shape.resize",{shape:e,newBounds:t,minBounds:n,hints:r})},Fl.prototype.createSpace=function(e,t,n,r,o){this._commandStack.execute("spaceTool",{delta:n,direction:r,movingShapes:e,resizingShapes:t,start:o})},Fl.prototype.updateWaypoints=function(e,t,n){this._commandStack.execute("connection.updateWaypoints",{connection:e,newWaypoints:t,hints:n||{}})},Fl.prototype.reconnect=function(e,t,n,r,o){this._commandStack.execute("connection.reconnect",{connection:e,newSource:t,newTarget:n,dockingOrPoints:r,hints:o||{}})},Fl.prototype.reconnectStart=function(e,t,n,r){this.reconnect(e,t,e.target,n,L(r=r||{},{docking:"source"}))},Fl.prototype.reconnectEnd=function(e,t,n,r){this.reconnect(e,e.source,t,n,L(r=r||{},{docking:"target"}))},Fl.prototype.connect=function(e,t,n,r){return this.createConnection(e,t,n||{},e.parent,r)},Fl.prototype._create=function(e,t){return t instanceof Co?t:this._elementFactory.create(e,t)},Fl.prototype.toggleCollapse=function(e,t){this._commandStack.execute("shape.toggleCollapse",{shape:e,hints:t||{}})},Ul.$inject=["moddle"],Ul.prototype.execute=function(e){var t=this._moddle.ids,n=e.id,r=e.element;e.claiming?t.claim(n,r):t.unclaim(n)},Ul.prototype.revert=function(e){var t=this._moddle.ids,n=e.id,r=e.element;e.claiming?t.unclaim(n):t.claim(n,r)};var Wl="id";function ql(e,t){this._elementRegistry=e,this._moddle=t}function Gl(e,t){return Wl in e&&e.id!==t.id}function Kl(n,e){x(e,function(e,t){n.set(t,e)})}function Xl(e,t,n){this._canvas=e,this._drdRules=t,n.invoke(Fl,this)}function Yl(){}ql.$inject=["elementRegistry","moddle"],ql.prototype.execute=function(e){var t=e.element,n=[t];if(!t)throw new Error("element required");var r,o=this._elementRegistry,i=this._moddle.ids,a=t.businessObject,c=e.properties,u=e.oldProperties||(r=a,O(S(c),function(e,t){return e[t]=r.get(t),e},{}));return Gl(c,a)&&(i.unclaim(a.id),o.updateId(t,c.id),i.claim(c.id,a)),"name"in c&&t.label&&n.push(t.label),Kl(a,c),e.oldProperties=u,e.changed=n},ql.prototype.revert=function(e){var t=e.element,n=e.properties,r=e.oldProperties,o=t.businessObject,i=this._elementRegistry,a=this._moddle.ids;return Kl(o,r),Gl(n,o)&&(a.unclaim(n.id),i.updateId(t,r.id),a.claim(r.id,o)),e.changed},dn(Xl,Fl),Xl.$inject=["canvas","drdRules","injector"],Xl.prototype.claimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t,claiming:!0})},Xl.prototype.connect=function(e,t,n,r){var o=this._drdRules,i=this._canvas.getRootElement();return n=n||(o.canConnect(e,t)||{type:"dmn:Association"}),this.createConnection(e,t,n,i,r)},Xl.prototype.getHandlers=function(){var e=Fl.prototype.getHandlers.call(this);return e["id.updateClaim"]=Ul,e["element.updateLabel"]=Hl,e["element.updateProperties"]=ql,e},Xl.prototype.unclaimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t})},Xl.prototype.updateProperties=function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})},Xl.prototype.updateLabel=function(e,t,n,r){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:n,hints:r||{}})},Yl.prototype.layoutConnection=function(e,t){return[(t=t||{}).connectionStart||io(t.source||e.source),t.connectionEnd||io(t.target||e.target)]};function Zl(e){this._connectionDocking=e}function Ql(e,t){return e?e.original||e:io(t)}function Jl(e){return L({original:e.point.original||e.point},e.actual)}function ep(e,t){this._elementRegistry=e,this._graphicsFactory=t}dn(Zl,Yl),Zl.$inject=["connectionDocking"],Zl.prototype.layoutConnection=function(e,t){var n=this._connectionDocking,r=(t=t||{}).source||e.source,o=t.target||e.target,i=t.waypoints||e.waypoints||[],a=t.connectionStart,c=t.connectionEnd,t=ao(r,o),a=a||Ql(i[0],r);if(c=c||Ql(i[i.length-1],o),en(e,"dmn:InformationRequirement")){i=[a,c],r=n.getCroppedWaypoints(L({},e,{waypoints:i}),r,o),o={x:(c=r.pop()).x,y:c.y};return t.includes("bottom")?o.y+=20:t.includes("top")?o.y-=20:t.includes("right")?o.x+=20:o.x-=20,i=r.concat([o,c])}return[a,c]},ep.$inject=["elementRegistry","graphicsFactory"],ep.prototype.getCroppedWaypoints=function(e,t,n){t=t||e.source,n=n||e.target;t=this.getDockingPoint(e,t,!0),n=this.getDockingPoint(e,n),e=e.waypoints.slice(t.idx+1,n.idx);return e.unshift(Jl(t)),e.push(Jl(n)),e},ep.prototype.getDockingPoint=function(e,t,n){var r=e.waypoints,o=n?0:r.length-1,r=r[o];return{point:r,actual:this._getIntersection(t,e,n)||r,idx:o}},ep.prototype._getIntersection=function(e,t,n){return co(this._getShapePath(e),this._getConnectionPath(t),n)},ep.prototype._getConnectionPath=function(e){return this._graphicsFactory.getConnectionPath(e)},ep.prototype._getShapePath=function(e){return this._graphicsFactory.getShapePath(e)},ep.prototype._getGfx=function(e){return this._elementRegistry.getGraphics(e)};var _o={__init__:["modeling","drdUpdater"],__depends__:[Bi,_o,Ni,nu,Si,uu],drdFactory:["type",Gs],drdUpdater:["type",Ks],elementFactory:["type",Fa],modeling:["type",Xl],layouter:["type",Zl],connectionDocking:["type",ep]},tp=Math.round;function np(e,i,a,c,o){function u(e,t,n,r){return o.allowed("elements.move",{shapes:e,delta:t,position:n,target:r})}function n(e,t,n,r){if(_(n)&&(r=n,n=!1),!t.waypoints&&t.parent&&!In(e.target).has("djs-hit-no-move")){var o={x:(o=t).x+tp(o.width/2),y:o.y+tp(o.height/2)};return i.init(e,o,"shape.move",{cursor:"grabbing",autoActivate:n,data:{shape:t,context:r||{}}}),!0}}e.on("shape.move.start",1500,function(e){var t,n=e.context,r=e.shape,o=c.get().slice();-1===o.indexOf(r)&&(o=[r]),t=R(e=o,"id"),L(n,{shapes:o=w(e,function(e){for(;e=e.parent;)if(t[e.id])return;return 1}),validatedShapes:o,shape:r})}),e.on("shape.move.start",1250,function(e){var t=e.context,e=t.validatedShapes;if(!(t.canExecute=u(e)))return!1}),e.on("shape.move.move",500,function(e){var t=e.context,n=t.validatedShapes,r=e.hover,o={x:e.dx,y:e.dy},e=u(n,o,{x:e.x,y:e.y},r);t.delta=o,null!==(t.canExecute=e)?t.target=r:t.target=null}),e.on("shape.move.end",function(e){var t=e.context,n=t.delta,r=t.canExecute,o="attach"===r,e=t.shapes;if(!1===r)return!1;n.x=tp(n.x),n.y=tp(n.y),0===n.x&&0===n.y||a.moveElements(e,n,t.target,{primaryShape:t.shape,attach:o})}),e.on("element.mousedown",function(e){if(di(e)){var t=si(e);if(!t)throw new Error("must supply DOM mousedown event");return n(t,e.element)}}),this.start=n}np.$inject=["eventBus","dragging","modeling","selection","rules"];var rp="djs-dragging",op="drop-ok",ip="drop-not-ok",ap="new-parent",cp="attach-ok";function up(e,i,a,c){function u(e){var t,e=s(e);return w(t=e,function(e){return!e.waypoints||b(t,r({id:e.source.id}))&&b(t,r({id:e.target.id}))})}function s(e){var t=cr(e,!0),e=C(t,function(e){return(e.incoming||[]).concat(e.outgoing||[])});return p(t.concat(e))}function l(t,n){[cp,op,ip,ap].forEach(function(e){e===n?i.addMarker(t,e):i.removeMarker(t,e)})}e.on("shape.move.start",499,function(e){var t=e.context,n=t.shapes,r=t.allDraggedElements,o=u(n);t.dragGroup||(Rn(e=Un("g"),a.cls("djs-drag-group",["no-events"])),Cn(i.getActiveLayer(),e),t.dragGroup=e),o.forEach(function(e){c.addDragger(e,t.dragGroup)}),x(r=r?p([r,s(n)]):s(n),function(e){i.addMarker(e,rp)}),t.allDraggedElements=r,t.differentParents=1!==P(R(n,function(e){return e.parent&&e.parent.id}))}),e.on("shape.move.move",499,function(e){var t=e.context,n=t.dragGroup,r=t.target,o=t.shape.parent,i=t.canExecute;r&&("attach"===i?l(r,cp):t.canExecute&&r&&r.id!==o.id?l(r,ap):l(r,t.canExecute?op:ip)),Bo(n,e.dx,e.dy)}),e.on(["shape.move.out","shape.move.cleanup"],function(e){e=e.context.target;e&&l(e,null)}),e.on("shape.move.cleanup",function(e){var t=e.context,e=t.allDraggedElements,t=t.dragGroup;x(e,function(e){i.removeMarker(e,rp)}),t&&Nn(t)}),this.makeDraggable=function(e,t,n){c.addDragger(t,e.dragGroup),n&&i.addMarker(t,rp),e.allDraggedElements?e.allDraggedElements.push(t):e.allDraggedElements=[t]}}up.$inject=["eventBus","canvas","styles","previewSupport"];var Ni={__depends__:[bi,Si,wi,uc,oc,fu],__init__:["move","movePreview"],move:["type",np],movePreview:["type",up]},sp=".djs-palette-toggle",lp="djs-palette-",pp="open",fp="two-column";function dp(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",function(e){e=e.tool;n.updateToolHighlight(e)}),e.on("i18n.changed",function(){n._update()}),e.on("diagram.init",function(){n._diagramInitialized=!0,n._rebuild()})}function hp(n,e){e=e.getPaletteEntries();return m(e)?e(n):(x(e,function(e,t){n[t]=e}),n)}dp.$inject=["eventBus","canvas"],dp.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("palette.getProviders",e,function(e){e.providers.push(t)}),this._rebuild()},dp.prototype.getEntries=function(){return this._getProviders().reduce(hp,{})},dp.prototype._rebuild=function(){this._diagramInitialized&&this._getProviders().length&&(this._container||this._init(),this._update())},dp.prototype._init=function(){var n=this,e=this._eventBus,t=this._getParentContainer(),r=this._container=kt(dp.HTML_MARKUP);t.appendChild(r),mt(t).add(lp+"shown"),Pt.bind(r,".djs-palette-toggle, .entry","click",function(e){var t=e.delegateTarget;if(wt(t,sp))return n.toggle();n.trigger("click",e)}),Ct.bind(r,"mousedown",function(e){e.stopPropagation()}),Pt.bind(r,".entry","dragstart",function(e){n.trigger("dragstart",e)}),e.on("canvas.resized",this._layoutChanged,this),e.fire("palette.create",{container:r})},dp.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},dp.prototype._toggleState=function(e){e=e||{};var t=this._getParentContainer(),n=this._container,r=this._eventBus,o=mt(n),n=mt(t),t="twoColumn"in e?e.twoColumn:this._needsCollapse(t.clientHeight,this._entries||{});o.toggle(fp,t),n.toggle(lp+fp,t),"open"in e&&(o.toggle(pp,e.open),n.toggle(lp+pp,e.open)),r.fire("palette.changed",{twoColumn:t,open:this.isOpen()})},dp.prototype._update=function(){var a=Dt(".djs-palette-entries",this._container),e=this._entries=this.getEntries();gt(a),x(e,function(e,t){var n=e.group||"default",r=Dt("[data-group="+xc(n)+"]",a);r||(pt(r=kt('<div class="group"></div>'),"data-group",n),a.appendChild(r));var o,i,n=e.html||(e.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'),n=kt(n);r.appendChild(n),e.separator||(pt(n,"data-action",t),e.title&&pt(n,"title",e.title),e.className&&(o=e.className,i=mt(n),(y(o)?o:o.split(/\s+/g)).forEach(function(e){i.add(e)})),e.imageUrl&&(pt(o=kt("<img>"),"src",e.imageUrl),n.appendChild(o)))}),this.open()},dp.prototype.trigger=function(e,t,n){var r=this._entries,o=t.delegateTarget||t.target;if(!o)return t.preventDefault();(r=r[pt(o,"data-action")])&&(o=r.action,r=t.originalEvent||t,m(o)?"click"===e&&o(r,n):o[e]&&o[e](r,n),t.preventDefault())},dp.prototype._layoutChanged=function(){this._toggleState({})},dp.prototype._needsCollapse=function(e,t){return e<50+46*Object.keys(t).length},dp.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},dp.prototype.open=function(){this._toggleState({open:!0})},dp.prototype.toggle=function(e){this.isOpen()?this.close():this.open()},dp.prototype.isActiveTool=function(e){return e&&this._activeTool===e},dp.prototype.updateToolHighlight=function(n){var e;this._toolsContainer||(e=Dt(".djs-palette-entries",this._container),this._toolsContainer=Dt("[data-group=tools]",e)),x(this._toolsContainer.children,function(e){var t=e.getAttribute("data-action");t&&(e=mt(e),t=t.replace("-tool",""),e.contains("entry")&&t===n?e.add("highlighted-entry"):e.remove("highlighted-entry"))})},dp.prototype.isOpen=function(){return mt(this._container).has(pp)},dp.prototype._getParentContainer=function(){return this._canvas.getContainer()},dp.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';uu={__init__:["palette"],palette:["type",dp]};function yp(e,t){this._eventBus=e,this._dragging=t,this._tools=[],this._active=null}yp.$inject=["eventBus","dragging"],yp.prototype.registerTool=function(e,t){var n=this._tools;if(!t)throw new Error('A tool has to be registered with it\'s "events"');n.push(e),this.bindEvents(e,t)},yp.prototype.isActive=function(e){return e&&this._active===e},yp.prototype.length=function(e){return this._tools.length},yp.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))},yp.prototype.bindEvents=function(t,e){var n=this._eventBus,r=this._dragging,o=[];n.on(e.tool+".init",function(e){return!e.context.reactivate&&this.isActive(t)?(this.setActive(null),void r.cancel()):void this.setActive(t)},this),x(e,function(e){o.push(e+".ended"),o.push(e+".canceled")}),n.on(o,250,function(e){this._active&&!function(e){e=e.originalEvent&&e.originalEvent.target;return e&&xt(e,'.group[data-group="tools"]')}(e)&&this.setActive(null)},this)};bi={__depends__:[oc],__init__:["toolManager"],toolManager:["type",yp]};function mp(e){var t=this;function n(e){t._lastMoveEvent=e}this._lastMoveEvent=null,e.on("canvas.init",function(e){(t._svg=e.svg).addEventListener("mousemove",n)}),e.on("canvas.destroy",function(){t._lastMouseEvent=null,t._svg.removeEventListener("mousemove",n)})}mp.$inject=["eventBus"],mp.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||function(e,t){var n=document.createEvent("MouseEvent"),r=e,o=t,e=e,t=t;n.initMouseEvent&&n.initMouseEvent("mousemove",!0,!0,window,0,r,o,e,t,!1,!1,!1,!1,0,null);return n}(0,0)};var Si={__init__:["mouse"],mouse:["type",mp]},vp="crosshair";function gp(n,r,e,o,t,i,a){this._selection=t,this._dragging=e,this._mouse=a;var c=this,u=function(e){var t=r.getActiveLayer(),e=e.frame=Un("rect");Rn(e,{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),Cn(t,e)},s=function(e){var t=e.frame,e=e.bbox;Rn(t,{x:e.x,y:e.y,width:e.width,height:e.height})},l=function(e){e.frame&&Nn(e.frame)};i.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),n.on("lasso.selection.end",function(e){var t=e.originalEvent.target;(e.hover||t instanceof SVGElement)&&n.once("lasso.selection.ended",function(){c.activateLasso(e.originalEvent,!0)})}),n.on("lasso.end",function(e){var t=bp(e),e=o.filter(function(e){return e});c.select(e,t)}),n.on("lasso.start",function(e){var t=e.context;t.bbox=bp(e),u(t)}),n.on("lasso.move",function(e){var t=e.context;t.bbox=bp(e),s(t)}),n.on("lasso.cleanup",function(e){e=e.context;l(e)}),n.on("element.mousedown",1500,function(e){if(yi(e))return c.activateLasso(e.originalEvent),!0})}function bp(e){var t={x:e.x-e.dx,y:e.y-e.dy},e={x:e.x,y:e.y},e=t.x<=e.x&&t.y<e.y||t.x<e.x&&t.y<=e.y?{x:t.x,y:t.y,width:e.x-t.x,height:e.y-t.y}:e.x<=t.x&&t.y<e.y||e.x<t.x&&t.y<=e.y?{x:e.x,y:t.y,width:t.x-e.x,height:e.y-t.y}:t.x<=e.x&&e.y<t.y||t.x<e.x&&e.y<=t.y?{x:t.x,y:e.y,width:e.x-t.x,height:t.y-e.y}:e.x<=t.x&&e.y<t.y||e.x<t.x&&e.y<=t.y?{x:e.x,y:e.y,width:t.x-e.x,height:t.y-e.y}:{x:e.x,y:e.y,width:0,height:0};return e}gp.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],gp.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:vp,data:{context:{}}})},gp.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:vp,data:{context:{}}})},gp.prototype.select=function(e,t){var n,r,e=(n=t,r={},x(e,function(e){var t=e;t.waypoints&&(t=sr(t)),!h(n.y)&&t.x>n.x&&(r[e.id]=e),!h(n.x)&&t.y>n.y&&(r[e.id]=e),t.x>n.x&&t.y>n.y&&(!(h(n.width)&&h(n.height)&&t.width+t.x<n.width+n.x&&t.height+t.y<n.height+n.y)&&h(n.width)&&h(n.height)||(r[e.id]=e))}),r);this._selection.select(k(e))},gp.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},gp.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};wi={__depends__:[bi,Si],__init__:["lassoTool"],lassoTool:["type",gp]};function _p(n,r,e,t,o,i){this._dragging=e,this._mouse=i;var a=this,t=t.get("keyboard",!1);o.registerTool("hand",{tool:"hand",dragging:"hand.move"}),n.on("element.mousedown",1500,function(e){if(hi(e))return a.activateMove(e.originalEvent,!0),!1}),t&&t.addListener(1500,function(e){wp(e.keyEvent)&&!a.isActive()&&(e=a._mouse.getLastMoveEvent(),a.activateMove(e,!!e))},"keyboard.keydown"),t&&t.addListener(1500,function(e){wp(e.keyEvent)&&a.isActive()&&a.toggle()},"keyboard.keyup"),n.on("hand.end",function(e){var t=e.originalEvent.target;if(!(e.hover||t instanceof SVGElement))return!1;n.once("hand.ended",function(){a.activateMove(e.originalEvent,{reactivate:!0})})}),n.on("hand.move.move",function(e){var t=r.viewbox().scale;r.scroll({dx:e.dx*t,dy:e.dy*t})}),n.on("hand.move.end",function(e){var t=e.context.reactivate;return!hi(e)&&t&&n.once("hand.move.ended",function(e){a.activateHand(e.originalEvent,!0,!0)}),!1})}function wp(e){return Ku(" ",e)}_p.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],_p.prototype.activateMove=function(e,t,n){"object"===Ve(t)&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:"grab",data:{context:n||{}}})},_p.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:"grab",data:{context:{reactivate:n}}})},_p.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)},_p.prototype.isActive=function(){var e=this._dragging.context();return!!e&&/^(hand|hand\.move)$/.test(e.prefix)};Si={__depends__:[bi,Si],__init__:["handTool"],handTool:["type",_p]};function xp(e,t,n,r,o,i){this._palette=e,this._create=t,this._elementFactory=n,this._handTool=r,this._lassoTool=o,this._translate=i,e.registerProvider(this)}xp.$inject=["palette","create","elementFactory","handTool","lassoTool","translate"],xp.prototype.getPaletteEntries=function(e){var t={},a=this._create,c=this._elementFactory,n=this._handTool,r=this._lassoTool,o=this._translate;function i(n,e,t,r,o){function i(e){var t=c.createShape(L({type:n},o));a.start(e,t)}return{group:e,className:t,title:r,action:{dragstart:i,click:i}}}return L(t,{"hand-tool":{group:"tools",className:"dmn-icon-hand-tool",title:o("Activate the hand tool"),action:{click:function(e){n.activateHand(e)}}},"lasso-tool":{group:"tools",className:"dmn-icon-lasso-tool",title:o("Activate the lasso tool"),action:{click:function(e){r.activateSelection(e)}}},"tool-separator":{group:"tools",separator:!0},"create.decision":i("dmn:Decision","drd","dmn-icon-decision",o("Create Decision")),"create.input-data":i("dmn:InputData","drd","dmn-icon-input-data",o("Create Input Data")),"create.knowledge-source":i("dmn:KnowledgeSource","drd","dmn-icon-knowledge-source",o("Create Knowledge Source")),"create.business-knowledge-model":i("dmn:BusinessKnowledgeModel","drd","dmn-icon-business-knowledge",o("Create Knowledge Model"))}),t};var Si={__depends__:[ci,uu,bt,wi,Si],__init__:["paletteProvider"],paletteProvider:["type",xp]},Op=Math.max,jp=Math.min,Ep=20;function Cp(e,t,n){var r=t[e],t=n.min&&n.min[e],n=n.max&&n.max[e];return h(t)&&(r=(/top|left/.test(e)?jp:Op)(r,t)),r=h(n)?(/top|left/.test(e)?Op:jp)(r,n):r}function Sp(e){return void 0!==e?e:Ep}function Pp(e){return!e.waypoints&&"label"!==e.type}function kp(e,t){var n,r,o,i,e=void 0===e.length?w(e.children,Pp):e;if(e.length)return e=sr(e),"object"===Ve(t=t)?(n=Sp(t.left),r=Sp(t.right),o=Sp(t.top),i=Sp(t.bottom)):n=r=o=i=Sp(t),{x:e.x-n,y:e.y-o,width:e.width+n+r,height:e.height+o+i}}function Rp(e,t,o,n){this._dragging=n,this._rules=t;var c=this;function r(e,t){var n,r,o=e.shape,i=e.direction,a=e.resizeConstraints;e.delta=t,n=o,r=i,i=(o=t).x,t=o.y,o={x:n.x,y:n.y,width:n.width,height:n.height},-1!==r.indexOf("n")?(o.y=n.y+t,o.height=n.height-t):-1!==r.indexOf("s")&&(o.height=n.height+t),-1!==r.indexOf("e")?o.width=n.width+i:-1!==r.indexOf("w")&&(o.x=n.x+i,o.width=n.width-i),e.newBounds=(o=o,(a=a)?ro({top:Cp("top",o=no(o),a),right:Cp("right",o,a),bottom:Cp("bottom",o,a),left:Cp("left",o,a)}):o),e.canExecute=c.canResize(e)}function i(e){var t=e.shape,n=e.canExecute,r=e.newBounds;n&&(e=r,r={x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)},n=r,(e=t).x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height||o.resizeShape(t,r))}e.on("resize.start",function(e){var t,n;t=e.context,n=t.resizeConstraints,e=t.minBounds,void 0===n&&(void 0===e&&(e=c.computeMinResizeBox(t)),t.resizeConstraints={min:no(e)})}),e.on("resize.move",function(e){var t={x:e.dx,y:e.dy};r(e.context,t)}),e.on("resize.end",function(e){i(e.context)})}function Tp(e,t){var n=io(e),e=no(e),n={x:n.x,y:n.y};return-1!==t.indexOf("n")?n.y=e.top:-1!==t.indexOf("s")&&(n.y=e.bottom),-1!==t.indexOf("e")?n.x=e.right:-1!==t.indexOf("w")&&(n.x=e.left),n}Rp.prototype.canResize=function(e){var t=this._rules,e=$(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",e)},Rp.prototype.activate=function(e,t,n){var r,o=this._dragging;if(!(n=(r=L({shape:t},n="string"==typeof n?{direction:n}:n)).direction))throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");o.init(e,Tp(t,n),"resize",{autoActivate:!0,cursor:(e="resize-","n"===(n=n)||"s"===n?e+"ns":"e"===n||"w"===n?e+"ew":"nw"===n||"se"===n?e+"nwse":e+"nesw"),data:{shape:t,context:r}})},Rp.prototype.computeMinResizeBox=function(e){var t=e.shape,n=e.direction,r=e.minDimensions||{width:10,height:10},e=kp(t,e.childrenBoxPadding);return n=n,r=r,e=e,t=no(t=t),t={top:/n/.test(n)?t.bottom-r.height:t.top,left:/w/.test(n)?t.right-r.width:t.left,bottom:/s/.test(n)?t.top+r.height:t.bottom,right:/e/.test(n)?t.left+r.width:t.right},e=e?no(e):t,ro({top:jp(t.top,e.top),left:jp(t.left,e.left),bottom:Op(t.bottom,e.bottom),right:Op(t.right,e.right)})},Rp.$inject=["eventBus","rules","modeling","dragging"];var Dp="djs-resizing",Mp="resize-not-ok";function Bp(e,o,i){e.on("resize.move",500,function(e){var t,n,r;t=e.context,n=t.shape,r=t.newBounds,(e=t.frame)||(e=t.frame=i.addFrame(n,o.getActiveLayer()),o.addMarker(n,Dp)),5<r.width&&Rn(e,{x:r.x,width:r.width}),5<r.height&&Rn(e,{y:r.y,height:r.height}),t.canExecute?In(e).remove(Mp):In(e).add(Mp)}),e.on("resize.cleanup",function(e){var t;t=e.context,e=t.shape,t.frame&&Nn(t.frame),o.removeMarker(e,Dp)})}Bp.$inject=["eventBus","canvas","previewSupport"];var Ip="djs-resizer",Ap=["n","w","s","e","nw","ne","se","sw"];function Np(e,t,n,r){this._resize=r,this._canvas=t;var o=this;e.on("selection.changed",function(e){e=e.newSelection;o.removeResizers(),1===e.length&&x(e,A(o.addResizer,o))}),e.on("shape.changed",function(e){e=e.element;n.isSelected(e)&&(o.removeResizers(),o.addResizer(e))})}Np.prototype.makeDraggable=function(t,e,n){var r=this._resize;function o(e){di(e)&&r.activate(e,t,n)}Ct.bind(e,"mousedown",o),Ct.bind(e,"touchstart",o)},Np.prototype._createResizer=function(e,t,n,r){var o=this._getResizersParent(),i=function(e){var t={x:0,y:0};-1!==e.indexOf("e")?t.x=6:-1!==e.indexOf("w")&&(t.x=-6);-1!==e.indexOf("s")?t.y=6:-1!==e.indexOf("n")&&(t.y=-6);return t}(r),a=Un("g");In(a).add(Ip),In(a).add(Ip+"-"+e.id),In(a).add(Ip+"-"+r),Cn(o,a);o=Un("rect");Rn(o,{x:-4+i.x,y:-4+i.y,width:8,height:8}),In(o).add(Ip+"-visual"),Cn(a,o);var c,u,o=Un("rect");return Rn(o,{x:-10+i.x,y:-10+i.y,width:20,height:20}),In(o).add(Ip+"-hit"),Cn(a,o),i=a,o=t,t=n,(n=qn()).setTranslate(o,t),(t=qn()).setRotate(c||0,0,0),(c=qn()).setScale(u||1,u||1),er(i,[n,t,c]),a},Np.prototype.createResizer=function(e,t){var n=Tp(e,t),n=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,n,t)},Np.prototype.addResizer=function(t){var n=this;!t.waypoints&&this._resize.canResize({shape:t})&&x(Ap,function(e){n.createResizer(t,e)})},Np.prototype.removeResizers=function(){Ln(this._getResizersParent())},Np.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},Np.$inject=["eventBus","canvas","selection","resize"];oc={__depends__:[uc,oc,fu],__init__:["resize","resizePreview","resizeHandles"],resize:["type",Rp],resizePreview:["type",Bp],resizeHandles:["type",Np]};function Lp(e){e.on(["bendpoint.move.move","bendpoint.move.end"],2e3,function(e){var t,n,r,o=e.context,i=o.allowed,a=o.hover,c=o.source,u=o.target,s=o.type;o.hints||(o.hints={}),delete o.hints.connectionStart,delete o.hints.connectionEnd,i&&"dmn:InformationRequirement"!==i.type||a&&on(a,["dmn:Decision","dmn:InputData"])&&c!==u&&(t="reconnectStart"===s||"reconnectEnd"===s,n=ao(c,u),t&&a===c?(r=n,s=$p((i=e).context.source,r),r=i.x-s.x,s=i.y-s.y,i.x-=r,i.y-=s,i.dx-=r,i.dy-=s,o.hints.connectionEnd=Vp(u,n)):t&&a===u&&(o.hints.connectionStart=$p(c,n),function(e,t){var n=Vp(e.context.target,t),r=0,o=0;t.includes("top")||t.includes("bottom")?o=e.y-n.y:r=e.x-n.x;e.x-=r,e.y-=o,e.dx-=r,e.dy-=o}(e,n)))})}function $p(e,t){var n=no(e),e=io(e);return t.includes("bottom")?e.y=n.top:t.includes("top")?e.y=n.bottom:t.includes("right")?e.x=n.left:e.x=n.right,e}function Vp(e,t){var n=no(e),e=io(e);return t.includes("bottom")?e.y=n.bottom:t.includes("top")?e.y=n.top:t.includes("right")?e.x=n.right:e.x=n.left,e}Lp.$inject=["eventBus"];function zp(e){e.on(["connect.hover","connect.move","connect.end"],250,function(e){var t=e.context,n=t.canExecute,r=t.hover,o=t.source,i=t.target;n&&"dmn:InformationRequirement"===n.type?(n=ao(o,i),t.connectionStart=io(o),t.connectionEnd=r===o?io(i):{x:e.x,y:e.y},n.includes("bottom")?(t.connectionStart.y=no(o).top,t.connectionEnd.y=no(i).bottom):n.includes("top")?(t.connectionStart.y=no(o).bottom,t.connectionEnd.y=no(i).top):n.includes("right")?(t.connectionStart.x=no(o).left,t.connectionEnd.x=no(i).right):(t.connectionStart.x=no(o).right,t.connectionEnd.x=no(i).left)):(delete t.connectionStart,delete t.connectionEnd)})}function Fp(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}function Up(e){this._snapValues={}}zp.$inject=["eventBus"],Fp.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]},Fp.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,-1===this._snapLocations.indexOf(e)&&this._snapLocations.push(e)},Fp.prototype.addDefaultSnap=function(e,t){(this._defaultSnaps[e]||(this._defaultSnaps[e]=[])).push(t)},Fp.prototype.getSnapLocations=function(){return this._snapLocations},Fp.prototype.setSnapLocations=function(e){this._snapLocations=e},Fp.prototype.pointsForTarget=function(e){var t=e.id||e,e=this._targets[t];return e||(e=this._targets[t]=new Up).initDefaults(this._defaultSnaps),e},Up.prototype.add=function(e,t){var n=this._snapValues[e];-1===(n=n||(this._snapValues[e]={x:[],y:[]})).x.indexOf(t.x)&&n.x.push(t.x),-1===n.y.indexOf(t.y)&&n.y.push(t.y)},Up.prototype.snap=function(e,t,n,r){t=this._snapValues[t];return t&&function(e,t,n){var r,o;for(n=void 0===n?10:n,r=0;r<t.length;r++)if(o=t[r],Hc(o-e)<=n)return o}(e[n],t[n],r)},Up.prototype.initDefaults=function(e){var n=this;x(e||{},function(e,t){x(e,function(e){n.add(t,e)})})};function Hp(e,t,o){var i=this;this._elementRegistry=e,t.on(["create.start","shape.move.start"],function(e){i.initSnap(e)}),t.on(["create.move","create.end","shape.move.move","shape.move.end"],1250,function(e){var t=e.context,n=t.shape,r=t.snapContext,t=t.target;e.originalEvent&&Gu(e.originalEvent)||!Gc(e)&&t&&((r=r.pointsForTarget(t)).initialized||((r=i.addSnapTargetPoints(r,n,t)).initialized=!0),o.snap(e,r))}),t.on(["create.cleanup","shape.move.cleanup"],function(){o.hide()})}function Wp(e){return e.labelTarget}Hp.$inject=["elementRegistry","eventBus","snapping"],Hp.prototype.initSnap=function(e){var t=this._elementRegistry,n=e.context,r=n.shape,o=(o=n.snapContext)||(n.snapContext=new Fp),i=t.get(r.id)?qc(r,e):{x:e.x+qc(r).x,y:e.y+qc(r).y},a=i.x-r.width/2,c=i.y-r.height/2,n=i.x+r.width/2,t=i.y+r.height/2;return o.setSnapOrigin("mid",{x:i.x-e.x,y:i.y-e.y}),Wp(r)||(o.setSnapOrigin("top-left",{x:a-e.x,y:c-e.y}),o.setSnapOrigin("bottom-right",{x:n-e.x,y:t-e.y})),o},Hp.prototype.addSnapTargetPoints=function(t,n,e){return x(this.getSnapTargets(n,e),function(e){if(Wp(e))Wp(n)&&t.add("mid",qc(e));else{if(e.waypoints)return e.waypoints.length<3?void 0:void x(e.waypoints.slice(1,-1),function(e){t.add("mid",e)});t.add("mid",qc(e))}}),h(n.x)&&h(n.y)&&this._elementRegistry.get(n.id)&&t.add("mid",qc(n)),t},Hp.prototype.getSnapTargets=function(e,t){return Xc(t).filter(function(e){return!e.hidden})};function qp(e,i){var a=this;e.on(["resize.start"],function(e){a.initSnap(e)}),e.on(["resize.move","resize.end"],1250,function(e){var t=e.context,n=t.shape,r=n.parent,o=t.direction,t=t.snapContext;e.originalEvent&&Gu(e.originalEvent)||Gc(e)||((t=t.pointsForTarget(r)).initialized||((t=a.addSnapTargetPoints(t,n,r,o)).initialized=!0),"n"!==(r=o)&&"s"!==r||Kc(e,"x",e.x),"e"!==(o=o)&&"w"!==o||Kc(e,"y",e.y),i.snap(e,t))}),e.on(["resize.cleanup"],function(){i.hide()})}function Gp(e,t){var n=io(e),e=no(e),n={x:n.x,y:n.y};return-1!==t.indexOf("n")?n.y=e.top:-1!==t.indexOf("s")&&(n.y=e.bottom),-1!==t.indexOf("e")?n.x=e.right:-1!==t.indexOf("w")&&(n.x=e.left),n}qp.prototype.initSnap=function(e){var t=e.context,n=t.shape,r=t.direction,o=(o=t.snapContext)||(t.snapContext=new Fp),r=Gp(n,r);return o.setSnapOrigin("corner",{x:r.x-e.x,y:r.y-e.y}),o},qp.prototype.addSnapTargetPoints=function(t,e,n,r){return x(this.getSnapTargets(e,n),function(e){t.add("corner",{x:e.x+e.width,y:e.y+e.height}),t.add("corner",{x:e.x,y:e.y})}),t.add("corner",Gp(e,r)),t},qp.$inject=["eventBus","snapping"],qp.prototype.getSnapTargets=function(t,e){return Xc(e).filter(function(e){return!(e.host===t||e.waypoints||e.hidden||e.labelTarget)})};function Kp(e){this._canvas=e,this._asyncHide=I(A(this.hide,this),1e3)}Kp.$inject=["canvas"],Kp.prototype.snap=function(i,a){var e=i.context.snapContext,t=e.getSnapLocations(),c={x:Gc(i,"x"),y:Gc(i,"y")};x(t,function(n){var r=e.getSnapOrigin(n),o={x:i.x+r.x,y:i.y+r.y};if(x(["x","y"],function(e){var t;c[e]||void 0!==(t=a.snap(o,n,e,7))&&(c[e]={value:t,originValue:t-r[e]})}),c.x&&c.y)return!1}),this.showSnapLine("vertical",c.x&&c.x.value),this.showSnapLine("horizontal",c.y&&c.y.value),x(["x","y"],function(e){var t=c[e];_(t)&&Kc(i,e,t.originValue)})},Kp.prototype._createLine=function(t){var e=this._canvas.getLayer("snap"),n=Un("path");return Rn(n,{d:"M0,0 L0,0"}),In(n).add("djs-snap-line"),Cn(e,n),{update:function(e){h(e)?Rn(n,"horizontal"===t?{d:"M-100000,"+e+" L+100000,"+e,display:""}:{d:"M "+e+",-100000 L "+e+", +100000",display:""}):Rn(n,{display:"none"})}}},Kp.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},Kp.prototype.showSnapLine=function(e,t){e=this.getSnapLine(e);e&&e.update(t),this._asyncHide()},Kp.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},Kp.prototype.hide=function(){x(this._snapLines,function(e){e.update()})};fu={__depends__:[{__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",Hp],resizeSnapping:["type",qp],snapping:["type",Kp]}],__init__:["bendpointSnapping","connectSnapping"],bendpointSnapping:["type",Lp],connectSnapping:["type",zp]};function Xp(e){xa.call(this,e)}dn(Xp,xa),Xp.prototype._modules=[].concat(Xp.prototype._modules,Xp.prototype._modelingModules=[Pa,Za,ac,Jc,ni,Vi,ai,aa,wa,Na,Ja,Rt,ju,hr,zi,_o,Ni,Si,oc,fu]);var Yp=/^class /;function Zp(e){return"[object Array]"===Object.prototype.toString.call(e)}function Qp(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Jp(){var e=Array.prototype.slice.call(arguments),t=(e=1===e.length&&Zp(e[0])?e[0]:e).pop();return t.$inject=e,t}var ef=/constructor\s*[^(]*\(\s*([^)]*)\)/m,tf=/^(?:async )?(?:function\s*)?[^(]*\(\s*([^)]*)\)/m,nf=/\/\*([^*]*)\*\//m;function rf(e){if("function"!=typeof e)throw new Error('Cannot annotate "'+e+'". Expected a function!');var t=e.toString().match(Yp.test(e.toString())?ef:tf);return t&&t[1]&&t[1].split(",").map(function(e){return((t=e.match(nf))?t[1]:e).trim()})||[]}function of(e,i){i=i||{get:function(e,t){if(a.push(e),!1===t)return null;throw u('No provider for "'+e+'"!')}};function t(e){var e=(t=o(e)).fn,t=t.dependencies;return new(Function.prototype.bind.apply(e,[null].concat(t)))}function n(e,t,n){return e=o(e,n),n=e.fn,e=e.dependencies,n.apply(t,e)}var a=[],f=this._providers=Object.create(i._providers||null),c=this._instances=Object.create(null),d=c.injector=this,u=function(e){var t=a.join(" -> ");return a.length=0,new Error(t?e+" (Resolving: "+t+")":e)},r=function e(t,n){if(!f[t]&&-1!==t.indexOf(".")){for(var r=t.split("."),o=e(r.shift());r.length;)o=o[r.shift()];return o}if(Qp(c,t))return c[t];if(Qp(f,t)){if(-1!==a.indexOf(t))throw a.push(t),u("Cannot resolve circular dependency!");return a.push(t),c[t]=f[t][0](f[t][1]),a.pop(),c[t]}return i.get(t,n)},o=function(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!Zp(e))throw new Error('Cannot invoke "'+e+'". Expected a function!');e=Jp(e.slice())}return{fn:e,dependencies:(e.$inject||rf(e)).map(function(e){return Qp(t,e)?t[e]:r(e)})}},h=function(t){return Jp(function(e){return t.get(e)})},s={factory:n,type:t,value:function(e){return e}};e.forEach(function(r){function o(e,t){return t="value"!==e&&Zp(t)?Jp(t.slice()):t}var e,t,n;r instanceof function(){var n=[];this.factory=function(e,t){return n.push([e,"factory",t]),this},this.value=function(e,t){return n.push([e,"value",t]),this},this.type=function(e,t){return n.push([e,"type",t]),this},this.forEach=function(e){n.forEach(e)}}?r.forEach(function(e){var t=e[0],n=e[1],e=e[2];f[t]=[s[n],o(n,e),n]}):"object"===Ve(r)&&(r.__exports__?(e=Object.keys(r).reduce(function(e,t){return"__"!==t.substring(0,2)&&(e[t]=r[t]),e},Object.create(null)),t=new of((r.__modules__||[]).concat([e]),d),n=Jp(function(e){return t.get(e)}),r.__exports__.forEach(function(e){f[e]=[n,e,"private",t]})):Object.keys(r).forEach(function(e){var t,n;"private"!==r[e][2]?(t=r[e][0],n=r[e][1],f[e]=[s[t],o(t,n),t]):f[e]=r[e]}))}),this.get=r,this.invoke=n,this.instantiate=t,this.createChild=function(e,t){if(t&&t.length){var n,r,o,i,a,c=Object.create(null),u=Object.create(null),s=[],l=[],p=[];for(a in f)n=f[a],-1!==t.indexOf(a)&&("private"===n[2]?-1===(r=s.indexOf(n[3]))?(o=n[3].createChild([],t),i=h(o),s.push(n[3]),l.push(o),p.push(i),c[a]=[i,a,"private",o]):c[a]=[p[r],a,"private",l[r]]:c[a]=[n[2],n[1]],u[a]=!0),"factory"!==n[2]&&"type"!==n[2]||!n[1].$scope||t.forEach(function(e){-1!==n[1].$scope.indexOf(e)&&(c[a]=[n[2],n[1]],u[e]=!0)});t.forEach(function(e){if(!u[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')}),e.unshift(c)}return new of(e,d)}}function af(e){return(af="function"==typeof Symbol&&"symbol"===Ve(Symbol.iterator)?function(e){return Ve(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":Ve(e)})(e)}function cf(e,t){return!t||"object"!==af(t)&&"function"!=typeof t?sf(e):t}function uf(e){return(uf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function sf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lf(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&pf(e,t)}function pf(e,t){return(pf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ff(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function df(e){ff(this,df),L(this,e),gf(this,"businessObject",{writable:!0})}var ju=function(){function t(e){return ff(this,t),gf(sf(e=cf(this,uf(t).call(this,e))),"rows",{enumerable:!0,value:e.rows||[]}),gf(sf(e),"cols",{enumerable:!0,value:e.cols||[]}),e}return lf(t,df),t}(),hf=function(){function t(e){return ff(this,t),gf(sf(e=cf(this,uf(t).call(this,e))),"root",{writable:!0}),gf(sf(e),"cells",{enumerable:!0,value:e.cells||[]}),e}return lf(t,df),t}(),yf=function(){function t(e){return ff(this,t),gf(sf(e=cf(this,uf(t).call(this,e))),"root",{writable:!0}),gf(sf(e),"cells",{enumerable:!0,value:e.cells||[]}),e}return lf(t,df),t}(),mf=function(){function t(e){return ff(this,t),gf(sf(e=cf(this,uf(t).call(this,e))),"row",{writable:!0}),gf(sf(e),"col",{writable:!0}),e}return lf(t,df),t}(),vf={root:ju,row:hf,col:yf,cell:mf};function gf(e,t,n){Object.defineProperty(e,t,n)}function bf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var _f=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._uid=12}var t,n,r;return t=e,(n=[{key:"create",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return t.id||(t.id=e+"_"+this._uid++),function(e,t){var n=vf[e];if(!n)throw new Error("unknown type "+e);return new n(t)}(e,t)}},{key:"createRoot",value:function(e){return this.create("root",e)}},{key:"createRow",value:function(e){return this.create("row",e)}},{key:"createCol",value:function(e){return this.create("col",e)}},{key:"createCell",value:function(e){return this.create("cell",e)}}])&&bf(t.prototype,n),r&&bf(t,r),e}();function wf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}hr=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this._eventBus=e,this._elements={},e.on("table.clear",this.clear.bind(this))}var e,n,r;return e=t,(n=[{key:"add",value:function(e,t){var n=e.id;this._elements[n]=e}},{key:"remove",value:function(e){e=e.id||e;delete this._elements[e]}},{key:"get",value:function(e){return this._elements[e]}},{key:"getAll",value:function(){return xf(this._elements)}},{key:"forEach",value:function(t){xf(this._elements).forEach(function(e){return t(e)})}},{key:"filter",value:function(t){return xf(this._elements).filter(function(e){return t(e)})}},{key:"clear",value:function(){this._elements={}}},{key:"updateId",value:function(e,t){this._validateId(t),"string"==typeof e&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t}),this.remove(e),e.id=t,this.add(e)}},{key:"_validateId",value:function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")}}])&&wf(e.prototype,n),r&&wf(e,r),t}();function xf(t){return Object.keys(t).map(function(e){return t[e]})}function Of(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}hr.$inject=["eventBus"];zi=function(){function e(n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._listeners={},n.on("elements.changed",function(e){e=e.elements;r.elementsChanged(e)}),n.on("root.remove",function(e){var t=e.root.id;r._listeners[t]&&n.once("root.add",function(e){e=e.root.id;r.updateId(t,e)})}),n.on("element.updateId",function(e){var t=e.element,e=e.newId;r.updateId(t.id,e)})}var t,n,r;return t=e,(n=[{key:"elementsChanged",value:function(e){for(var t={},n=e.length,r=0;r<n;r++){var o=e[r].id;if(t[o])return;t[o]=!0;var i=this._listeners[o]&&this._listeners[o].length;if(i)for(var a=0;a<i;a++)this._listeners[o][a]&&this._listeners[o][a]()}}},{key:"onElementsChanged",value:function(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e][this._listeners[e].length]=t}},{key:"offElementsChanged",value:function(e,t){this._listeners[e]&&(t?-1!==(t=this._listeners[e].indexOf(t))&&this._listeners[e].splice(t,1):this._listeners[e].length=0)}},{key:"updateId",value:function(e,t){this._listeners[e]&&(this._listeners[t]=this._listeners[e],delete this._listeners[e])}}])&&Of(t.prototype,n),r&&Of(t,r),e}();function jf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}zi.$inject=["eventBus"];var _o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._listeners={}}var t,n,r;return t=e,(n=[{key:"getComponent",value:function(e,t){var n=this._listeners[e];if(n){for(var r,o=0;o<n.length&&!(r=n[o].callback(t));o++);return r}}},{key:"getComponents",value:function(e,t){var n=this._listeners[e],r=[];if(!n)return r;for(var o=0;o<n.length;o++){var i=n[o].callback(t);i&&r.push(i)}return r.length,r}},{key:"onGetComponent",value:function(e,t,n){if(m(t)&&(n=t,t=1e3),!h(t))throw new Error("priority must be a number");for(var r,o=this._getListeners(e),i={priority:t,callback:n},a=0;r=o[a];a++)if(r.priority<t)return void o.splice(a,0,i);o.push(i)}},{key:"offGetComponent",value:function(e,t){var n,r,o=this._getListeners(e);if(t)for(r=o.length-1;n=o[r];r--)n.callback===t&&o.splice(r,1);else o.length=0}},{key:"_getListeners",value:function(e){var t=this._listeners[e];return t||(this._listeners[e]=t=[]),t}}])&&jf(t.prototype,n),r&&jf(t,r),e}(),Ef="$NO_OP",Cf="a runtime error occured! Use Inferno in development environment to find the error.",Ni=!("undefined"==typeof window||!window.document),Sf=Array.isArray;function Pf(e){e=Ve(e);return"string"===e||"number"===e}function kf(e){return If(e)||Bf(e)}function Rf(e){return Bf(e)||!1===e||!0===e||If(e)}function Tf(e){return"function"==typeof e}function Df(e){return"string"==typeof e}function Mf(e){return"number"==typeof e}function Bf(e){return null===e}function If(e){return void 0===e}function Af(e){throw e=e||Cf,new Error("Inferno Error: "+e)}function Nf(e){console.error(e)}function Lf(e,t){var n={};if(e)for(var r in e)n[r]=e[r];if(t)for(var o in t)n[o]=t[o];return n}function $f(e){var t;return">> "+(Sf(e)?"Array("+(3<e.length?e.slice(0,3).toString()+",...":e.toString())+")":Pf(e)?"Text("+e+")":Rf(e)?"InvalidVNode("+e+")":481&(t=e.flags)?"<"+e.type+(e.className?' class="'+e.className+'"':"")+">":16&t?"Text("+e.children+")":1024&t?"Portal*":"<"+((e=e.type).name||e.displayName||e.constructor.name||(e.toString().match(/^function\s*([^\s(]+)/)||[])[1])+" />")+"\n"}function Vf(e){var t;1&e.childFlags||(64&e.flags&&Af("input elements can't have children."),128&e.flags&&Af("textarea elements can't have children."),481&e.flags&&(t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],"media"===(e=e.type.toLowerCase())&&Af("media elements can't have children."),-1!==(e=t.indexOf(e))&&Af(t[e]+" elements can't have children.")))}function zf(e){var t;!1===e.isValidated&&e.children&&481&e.flags&&((t=function e(t,n){for(var r={},o=0,i=t.length;o<i;o++){var a=t[o];if(Sf(a))return"Encountered ARRAY in mount, array must be flattened, or normalize used. Location: \n"+$f(a);if(Rf(a)){if(n)return"Encountered invalid node when preparing to keyed algorithm. Location: \n"+$f(a);if(0!==Object.keys(r).length)return"Encountered invalid node with mixed keys. Location: \n"+$f(a)}else{"object"===Ve(a)&&(a.isValidated=!0);var c=a.key;if(!kf(c)&&!Pf(c))return"Encountered child vNode where key property is not string or number. Location: \n"+$f(a);var u=a.children,s=a.childFlags;if(!Rf(u)){var l=void 0;if(12&s?l=e(u,8&a.childFlags):2===s&&(l=e([u],8&a.childFlags)),l)return l+=$f(a)}if(n&&kf(c))return"Encountered child without key during keyed algorithm. If this error points to Array make sure children is flat list. Location: \n"+$f(a);if(n||!kf(c)){if(r[c])return"Encountered two children with same key: {"+c+"}. Location: \n"+$f(a);r[c]=!0}else if(0!==Object.keys(r).length)return"Encountered children with key missing. Location: \n"+$f(a)}}}(Array.isArray(e.children)?e.children:[e.children],0<(8&e.childFlags)))&&Af(t+$f(e))),e.isValidated=!0}var Ff="$";function Uf(e,t,n,r,o,i,a,c){return{childFlags:e,children:t,className:n,dom:null,flags:r,isValidated:!1,key:void 0===o?null:o,parentVNode:null,props:void 0===i?null:i,ref:void 0===a?null:a,type:c}}function Hf(e,t,n,r,o,i,a,c){14&e&&Af("Creating Component vNodes using createVNode is not allowed. Use Inferno.createComponentVNode method.");o=void 0===o?1:o,c=Uf(o,r,n,e,a,i,c,t),t=Zf.createVNode;return"function"==typeof t&&t(c),0===o&&Yf(c,c.children),Vf(c),c}function Wf(e,t,n,r,o){1&e&&Af("Creating element vNodes using createComponentVNode is not allowed. Use Inferno.createVNode method."),0<(2&e)&&(e=t.prototype&&Tf(t.prototype.render)?4:8);var i=t.defaultProps;if(!kf(i))for(var a in n=n||{},i)If(n[a])&&(n[a]=i[a]);if(0<(8&e)){var c=t.defaultHooks;if(!kf(c))if(o)for(var u in c)If(o[u])&&(o[u]=c[u]);else o=c}r=Uf(1,null,null,e,r,n,o,t),t=Zf.createVNode;return Tf(t)&&t(r),r}function qf(e,t){return Uf(1,kf(e)?"":e,null,16,t,null,null,null)}function Gf(e){var t,n=e.props;return n&&(481&(t=e.flags)&&(void 0!==n.children&&kf(e.children)&&Yf(e,n.children),void 0!==n.className&&(e.className=n.className||null,n.className=void 0)),void 0!==n.key&&(e.key=n.key,n.key=void 0),void 0!==n.ref&&(e.ref=8&t?Lf(e.ref,n.ref):n.ref,n.ref=void 0)),e}function Kf(e){var t,n=e.flags;if(14&n){var r,o=e.props;if(!Bf(o))for(var i in r={},o)r[i]=o[i];t=Wf(n,e.type,r,e.key,e.ref)}else 481&n?t=Hf(n,e.type,e.className,e.children,e.childFlags,e.props,e.key,e.ref):16&n?t=qf(e.children,e.key):1024&n&&(t=e);return t}function Xf(){return qf("",null)}function Yf(e,t){var n,r=1;if(Rf(t))n=t;else if(Df(t))r=2,n=qf(t);else if(Mf(t))r=2,n=qf(t+"");else if(Sf(t)){var o=t.length;if(0===o)n=null,r=1;else{!Object.isFrozen(t)&&!0!==t.$||(t=t.slice());for(var r=8,i=0;i<o;i++){var a,c,u,s=t[i];if(Rf(s)||Sf(s)){n=n||t.slice(0,i),function e(t,n,r,o){for(var i=t.length;r<i;r++){var a,c,u,s=t[r];Rf(s)||(a=o+Ff+r,Sf(s)?e(s,n,0,a):(Pf(s)?s=qf(s,a):(u=Df(c=s.key)&&c[0]===Ff,Bf(s.dom)&&!u||(s=Kf(s)),Bf(c)||u?s.key=a:s.key=o+c),n.push(s)))}}(t,n,i,"");break}Pf(s)?(n=n||t.slice(0,i)).push(qf(s,Ff+i)):(u=s.key,a=Bf(s.dom),u=!(c=Bf(u))&&Df(u)&&u[0]===Ff,!a||c||u?(n=n||t.slice(0,i),a&&!u||(s=Kf(s)),(c||u)&&(s.key=Ff+i),n.push(s)):n&&n.push(s))}(n=n||t).$=!0}}else Bf((n=t).dom)||(n=Kf(t)),r=2;return e.children=n,e.childFlags=r,Vf(e),e}var Zf={afterRender:null,beforeRender:null,createVNode:null,renderComplete:null},Si="http://www.w3.org/1999/xlink",oc="http://www.w3.org/XML/1998/namespace",Qf="http://www.w3.org/2000/svg",Jf={"xlink:actuate":Si,"xlink:arcrole":Si,"xlink:href":Si,"xlink:role":Si,"xlink:show":Si,"xlink:title":Si,"xlink:type":Si,"xml:base":oc,"xml:lang":oc,"xml:space":oc},ed={},td=[];function nd(e,t){e.appendChild(t)}function rd(e,t,n){kf(n)?nd(e,t):e.insertBefore(t,n)}function od(e,t,n){e.replaceChild(t,n)}function id(e){for(var t;void 0!==(t=e.shift());)t()}Object.freeze(ed);var ad={},cd={};function ud(e,t,n){var r,o=ad[e],i=n.$EV;function a(e){var t=e.type;if((t="click"===t||"dblclick"===t)&&0!==e.button)return e.stopPropagation(),!1;e.stopPropagation=ld;var n={dom:document};Object.defineProperty(e,"currentTarget",{configurable:!0,get:function(){return n.dom}}),function(e,t,n,r,o){var i=t;for(;!Bf(i);){if(n&&i.disabled)return;var a=i.$EV;if(a){a=a[r];if(a&&(o.dom=i,a.event?a.event(a.data,e):a(e),e.cancelBubble))return}i=i.parentNode}}(e,e.target,t,r,n)}t?(o||(cd[e]=(r=e,document.addEventListener(sd(r),a),a),ad[e]=0),(i=i||(n.$EV={}))[e]||ad[e]++,i[e]=t):i&&i[e]&&(ad[e]--,1===o&&(document.removeEventListener(sd(e),cd[e]),cd[e]=null),i[e]=t)}function sd(e){return e.substr(2).toLowerCase()}function ld(){this.cancelBubble=!0,this.immediatePropagationStopped||this.stopImmediatePropagation()}function pd(e,t){var n=document.createElement("i");return n.innerHTML=t,n.innerHTML===e.innerHTML}function fd(e,t,n){var r;e[t]?(r=e[t]).event?r.event(r.data,n):r(n):e[t=t.toLowerCase()]&&e[t](n)}function dd(a,c){function e(e){e.stopPropagation();var t=this.$V;if(t){var n,r=t.props||ed,o=t.dom;if(Df(a))fd(r,a,e);else for(var i=0;i<a.length;i++)fd(r,a[i],e);Tf(c)&&(t=(n=this.$V).props||ed,c(t,o,!1,n))}}return Object.defineProperty(e,"wrapped",{configurable:!1,enumerable:!1,value:!0,writable:!1}),e}function hd(e){return"checkbox"===e||"radio"===e}var yd=dd("onInput",gd),md=dd(["onClick","onChange"],gd);function vd(e){e.stopPropagation()}function gd(e,t){var n=e.type,r=e.value,o=e.checked,i=e.multiple,a=e.defaultValue,e=!kf(r);n&&n!==t.type&&t.setAttribute("type",n),kf(i)||i===t.multiple||(t.multiple=i),kf(a)||e||(t.defaultValue=a+""),hd(n)?(e&&(t.value=r),kf(o)||(t.checked=o)):e&&t.value!==r?(t.defaultValue=r,t.value=r):kf(o)||(t.checked=o)}function bd(e,t){if("optgroup"===e.type){var n=e.children,r=e.childFlags;if(12&r)for(var o=0,i=n.length;o<i;o++)_d(n[o],t);else 2===r&&_d(n,t)}else _d(e,t)}function _d(e,t){var n=e.props||ed,e=e.dom;e.value=n.value,Sf(t)&&-1!==t.indexOf(n.value)||n.value===t?e.selected=!0:kf(t)&&kf(n.selected)||(e.selected=n.selected||!1)}vd.wrapped=!0;var wd=dd("onChange",xd);function xd(e,t,n,r){var o=Boolean(e.multiple);kf(e.multiple)||o===t.multiple||(t.multiple=o);o=r.childFlags;if(0==(1&o)){var i=r.children,a=e.value;if(n&&kf(a)&&(a=e.defaultValue),12&o)for(var c=0,u=i.length;c<u;c++)bd(i[c],a);else 2===o&&bd(i,a)}}var Od=dd("onInput",Ed),jd=dd("onChange");function Ed(e,t,n){var r=e.value,o=t.value;kf(r)?n&&(kf(e=e.defaultValue)||e===o||(t.defaultValue=e,t.value=e)):o!==r&&(t.defaultValue=r,t.value=r)}function Cd(e,t,n,r,o,i){64&e?gd(r,n):256&e?xd(r,n,o,t):128&e&&Ed(r,n,o),i&&(n.$V=t)}function Sd(e,t,n){var r;64&e?(r=t,hd(n.type)?(r.onchange=md,r.onclick=vd):r.oninput=yd):256&e?t.onchange=wd:128&e&&(n=n,(t=t).oninput=Od,n.onChange&&(t.onchange=jd))}function Pd(e){return e.type&&hd(e.type)?!kf(e.checked):!kf(e.value)}function kd(e,t){var n;Rd(e),t&&e.dom&&(n=e.dom,t.removeChild(n),e.dom=null)}function Rd(e){var t=e.flags;if(481&t){var n=e.ref,r=e.props;Tf(n)&&n(null);var o=e.children,n=e.childFlags;if(12&n?Td(o):2===n&&Rd(o),!Bf(r))for(var i in r)switch(i){case"onClick":case"onDblClick":case"onFocusIn":case"onFocusOut":case"onKeyDown":case"onKeyPress":case"onKeyUp":case"onMouseDown":case"onMouseMove":case"onMouseUp":case"onSubmit":case"onTouchEnd":case"onTouchMove":case"onTouchStart":ud(i,null,e.dom)}}else{o=e.children;o&&(14&t?(r=e.ref,4&t?(Tf(o.componentWillUnmount)&&o.componentWillUnmount(),Tf(r)&&r(null),o.$UN=!0,o.$LI&&Rd(o.$LI)):(!kf(r)&&Tf(r.onComponentWillUnmount)&&r.onComponentWillUnmount(e.dom,e.props||ed),Rd(o))):1024&t&&kd(o,e.type))}}function Td(e){for(var t=0,n=e.length;t<n;t++)Rd(e[t])}function Dd(e,t){Td(t),e.textContent=""}function Md(e,t){switch(e){case"animationIterationCount":case"borderImageOutset":case"borderImageSlice":case"borderImageWidth":case"boxFlex":case"boxFlexGroup":case"boxOrdinalGroup":case"columnCount":case"fillOpacity":case"flex":case"flexGrow":case"flexNegative":case"flexOrder":case"flexPositive":case"flexShrink":case"floodOpacity":case"fontWeight":case"gridColumn":case"gridRow":case"lineClamp":case"lineHeight":case"opacity":case"order":case"orphans":case"stopOpacity":case"strokeDasharray":case"strokeDashoffset":case"strokeMiterlimit":case"strokeOpacity":case"strokeWidth":case"tabSize":case"widows":case"zIndex":case"zoom":return t;default:return t+"px"}}function Bd(e,t,n,r,o,i,a){switch(e){case"onClick":case"onDblClick":case"onFocusIn":case"onFocusOut":case"onKeyDown":case"onKeyPress":case"onKeyUp":case"onMouseDown":case"onMouseMove":case"onMouseUp":case"onSubmit":case"onTouchEnd":case"onTouchMove":case"onTouchStart":ud(e,n,r);break;case"children":case"childrenType":case"className":case"defaultValue":case"key":case"multiple":case"ref":break;case"autoFocus":r.autofocus=!!n;break;case"allowfullscreen":case"autoplay":case"capture":case"checked":case"controls":case"default":case"disabled":case"hidden":case"indeterminate":case"loop":case"muted":case"novalidate":case"open":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"selected":r[e]=!!n;break;case"defaultChecked":case"value":case"volume":if(i&&"value"===e)return;var c=kf(n)?"":n;r[e]!==c&&(r[e]=c);break;case"dangerouslySetInnerHTML":var u=t&&t.__html||"",s=n&&n.__html||"";u!==s&&(kf(s)||pd(r,s)||(Bf(a)||(12&a.childFlags?Td(a.children):2===a.childFlags&&Rd(a.children),a.children=null,a.childFlags=1),r.innerHTML=s));break;default:"o"===e[0]&&"n"===e[1]?(l=n,c=r,s=(u=e).toLowerCase(),Tf(l)||kf(l)?(p=c[s])&&p.wrapped||(c[s]=l):(p=l.event)&&Tf(p)?c[s]=(f=p,d=l,function(e){f(d.data,e)}):Af('an event on a VNode "'+u+'". was not a function or a valid linkEvent.')):kf(n)?r.removeAttribute(e):"style"===e?function(e,t,n){var r,o,i=n.style;if(Df(t))i.cssText=t;else if(kf(e)||Df(e))for(r in t)o=t[r],i[r]=Mf(o)?Md(r,o):o;else{for(r in t)(o=t[r])!==e[r]&&(i[r]=Mf(o)?Md(r,o):o);for(r in e)kf(t[r])&&(i[r]="")}}(t,n,r):o&&Jf[e]?r.setAttributeNS(Jf[e],e,n):r.setAttribute(e,n)}var l,p,f,d}function Id(e,t,n,r,o){var i,a=!1,c=0<(448&t);for(i in c&&(a=Pd(n))&&Sd(t,r,n),n)Bd(i,null,n[i],r,o,a,null);c&&Cd(t,e,r,n,!0,a)}function Ad(e,t,n,r){t=new t(n,r);if((e.children=t).$V=e,t.$BS=!1,t.context=r,t.props===ed&&(t.props=n),t.$UN=!1,Tf(t.componentWillMount)){if(t.$BR=!0,t.componentWillMount(),t.$PSS){var o=t.state,i=t.$PS;if(Bf(o))t.state=i;else for(var a in i)o[a]=i[a];t.$PSS=!1,t.$PS=null}t.$BR=!1}Tf(Zf.beforeRender)&&Zf.beforeRender(t);var c,e=Nd(t.render(n,t.state,r),e);return kf(c=Tf(t.getChildContext)?t.getChildContext():c)?t.$CX=r:t.$CX=Lf(r,c),Tf(Zf.afterRender)&&Zf.afterRender(t),t.$LI=e,t}function Nd(e,t){return Sf(e)&&Af("a valid Inferno VNode (or null) must be returned from a component render. You may have returned an array or an invalid object."),Rf(e)?e=Xf():Pf(e)?e=qf(e,null):14&(e=e.dom?Kf(e):e).flags&&(e.parentVNode=t),e}function Ld(e,t,n,r){var o=e.flags;return 481&o?Vd(e,t,n,r):14&o?function(e,t,n,r,o){var i,a=e.type,c=e.props||ed,u=e.ref;o?(o=Ad(e,a,c,n),e.dom=i=Ld(o.$LI,null,o.$CX,r),Fd(e,u,o),o.$UPD=!1):(a=Nd(a(c,n),e),e.children=a,e.dom=i=Ld(a,null,n,r),Ud(c,u,i));Bf(t)||nd(t,i);return i}(e,t,n,r,0<(4&o)):512&o||16&o?$d(e,t):1024&o?(Ld(e.children,e.type,n,!1),e.dom=$d(Xf(),t)):void("object"===Ve(e)?Af("mount() received an object that's not a valid VNode, you should stringify it first, fix createVNode flags or call normalizeChildren. Object: \""+JSON.stringify(e)+'".'):Af('mount() expects a valid VNode, instead it received an object with the type "'+Ve(e)+'".'))}function $d(e,t){e=e.dom=document.createTextNode(e.children);return Bf(t)||nd(t,e),e}function Vd(e,t,n,r){var o=e.flags,i=e.children,a=e.props,c=e.className,u=e.ref,s=e.childFlags;r=r||0<(32&o);var l=(l=e.type,r?document.createElementNS(Qf,l):document.createElement(l));return e.dom=l,kf(c)||""===c||(r?l.setAttribute("class",c):l.className=c),zf(e),Bf(t)||nd(t,l),0==(1&s)&&(t=!0===r&&"foreignObject"!==e.type,2===s?Ld(i,l,n,t):12&s&&zd(i,l,n,t)),Bf(a)||Id(e,o,a,l,r),Df(u)&&Af('string "refs" are not supported in Inferno 1.0. Use callback "refs" instead.'),Tf(u)&&Hd(l,u),l}function zd(e,t,n,r){for(var o=0,i=e.length;o<i;o++){var a=e[o];Bf(a.dom)||(e[o]=a=Kf(a)),Ld(a,t,n,r)}}function Fd(e,t,n){var r;Tf(t)?t(n):Pf(t)?Af('string "refs" are not supported in Inferno 1.0. Use callback "refs" instead.'):!kf(t)&&"object"===Ve(t)&&4&e.flags&&Af("functional component lifecycle events are not supported on ES2015 class components."),Tf(n.componentDidMount)&&td.push((r=n,function(){r.$UPD=!0,r.componentDidMount(),r.$UPD=!1}))}function Ud(e,t,n){var r,o,i;kf(t)||(Tf(t.onComponentWillMount)&&t.onComponentWillMount(e),Tf(t.onComponentDidMount)&&td.push((r=t,o=n,i=e,function(){return r.onComponentDidMount(o,i)})))}function Hd(e,t){td.push(function(){return t(e)})}function Wd(e,t,n,r){var o=e.children,i=e.props,a=e.className,c=e.flags,u=e.ref;if(r=r||0<(32&c),1!==t.nodeType||t.tagName.toLowerCase()!==e.type){Nf("Inferno hydration: Server-side markup doesn't match client-side markup or Initial render target is not empty");var s=Vd(e,null,n,r);e.dom=s,od(t.parentNode,s,t)}else{var l=(e.dom=t).firstChild,p=e.childFlags;if(0==(1&p)){for(var f=null;l;)f=l.nextSibling,8===l.nodeType&&("!"===l.data?t.replaceChild(document.createTextNode(""),l):t.removeChild(l)),l=f;if(l=t.firstChild,2===p)Bf(l)?Ld(o,t,n,r):(f=l.nextSibling,qd(o,l,n,r),l=f);else if(12&p)for(var d=0,h=o.length;d<h;d++){var y=o[d];Bf(l)?Ld(y,t,n,r):(f=l.nextSibling,qd(y,l,n,r),l=f)}for(;l;)f=l.nextSibling,t.removeChild(l),l=f}else Bf(t.firstChild)||(s=t,p=i,Boolean(p&&p.dangerouslySetInnerHTML&&p.dangerouslySetInnerHTML.__html&&pd(s,p.dangerouslySetInnerHTML.__html)))||(t.textContent="",448&c&&(t.defaultValue=""));Bf(i)||Id(e,c,i,t,r),kf(a)?""!==t.className&&t.removeAttribute("class"):r?t.setAttribute("class",a):t.className=a,Tf(u)?Hd(t,u):Df(u)&&Af('string "refs" are not supported in Inferno 1.0. Use callback "refs" instead.')}}function qd(e,t,n,r){var o,i,a,c,u,s,l,p,f,d,h=e.flags;14&h?(a=t,c=n,u=r,s=0<(4&h),p=(i=e).type,f=i.ref,d=i.props||ed,s?(qd(s=(l=Ad(i,p,d,c)).$LI,a,l.$CX,u),i.dom=s.dom,Fd(i,f,l),l.$UPD=!1):(qd(p=Nd(p(d,c),i),a,c,u),i.children=p,i.dom=p.dom,Ud(d,f,a))):481&h?Wd(e,t,n,r):16&h?(n=e,3!==(r=t).nodeType?(o=$d(n,null),n.dom=o,od(r.parentNode,o,r)):(o=n.children,r.nodeValue!==o&&(r.nodeValue=o),n.dom=r)):512&h?e.dom=t:(Af('hydrate() expects a valid VNode, instead it received an object with the type "'+Ve(e)+'".'),Af())}function Gd(e,t,n,r,o){Rd(e),od(n,Ld(t,null,r,o),e.dom)}function Kd(e,t,n,r,o){var i=0|t.flags;e.flags!==i||2048&i?Gd(e,t,n,r,o):481&i?function(e,t,n,r,o,i){var a,c=t.type;if(e.type!==c)Gd(e,t,n,r,o);else{var u=e.dom,s=e.props,l=t.props,p=!1,f=!1;if(t.dom=u,o=o||0<(32&i),s!==l){var d=s||ed;if((a=l||ed)!==ed)for(var h in(p=0<(448&i))&&(f=Pd(a)),a){var y=d[h],m=a[h];y!==m&&Bd(h,y,m,u,o,f,e)}if(d!==ed)for(var v in d)a.hasOwnProperty(v)||kf(d[v])||Bd(v,d[v],null,u,o,f,e)}var g=e.children,b=t.children,n=t.ref,s=e.className,l=t.className;zf(t),4096&i?function(e,t){e.textContent!==t.children&&(e.textContent=t.children)}(u,b):Xd(e.childFlags,t.childFlags,g,b,u,r,o&&"foreignObject"!==c),p&&Cd(i,t,u,a,!1,f),s!==l&&(kf(l)?u.removeAttribute("class"):o?u.setAttribute("class",l):u.className=l),Tf(n)&&e.ref!==n?Hd(u,n):Df(n)&&Af('string "refs" are not supported in Inferno 1.0. Use callback "refs" instead.')}}(e,t,n,r,o,i):14&i?function(e,t,n,r,o,i){var a=t.type,c=e.key,u=t.key;{var s,l,p;e.type!==a||c!==u?Gd(e,t,n,r,o):(s=t.props||ed,i?((p=e.children).$UPD=!0,p.$V=t,Yd(p,p.state,t,s,n,r,o,!1,!1),p.$UPD=!1):(l=!0,c=e.props,u=t.ref,i=!kf(u),p=e.children,t.dom=e.dom,t.children=p,!1!==(l=i&&Tf(u.onComponentShouldUpdate)?u.onComponentShouldUpdate(c,s):l)?(i&&Tf(u.onComponentWillUpdate)&&u.onComponentWillUpdate(c,s),(a=a(s,r))!==Ef&&(a=Nd(a,t),Kd(p,a,n,r,o),t.children=a,t.dom=a.dom,i&&Tf(u.onComponentDidUpdate)&&u.onComponentDidUpdate(c,s))):14&p.flags&&(p.parentVNode=t)))}}(e,t,n,r,o,0<(4&i)):16&i?function(e,t){var n=t.children,r=e.dom;n!==e.children&&(r.nodeValue=n);t.dom=r}(e,t):512&i?t.dom=e.dom:(n=t,i=(o=e).type,t=n.type,e=n.children,Xd(o.childFlags,n.childFlags,o.children,e,i,r,!1),n.dom=o.dom,i===t||Rf(e)||(e=e.dom,i.removeChild(e),t.appendChild(e)))}function Xd(e,t,n,r,o,i,a){switch(e){case 2:switch(t){case 2:Kd(n,r,o,i,a);break;case 1:kd(n,o);break;default:kd(n,o),zd(r,o,i,a)}break;case 1:switch(t){case 2:Ld(r,o,i,a);break;case 1:break;default:zd(r,o,i,a)}break;default:var c,u;12&t?(c=n.length,u=r.length,0===c?0<u&&zd(r,o,i,a):0===u?Dd(o,n):(8===t&&8===e?function(e,t,n,r,o,i,a){var c,u,s=i-1,l=a-1,p=0,f=e[p],d=t[p];e:{for(;f.key===d.key;){if(d.dom&&(t[p]=d=Kf(d)),Kd(f,d,n,r,o),e[p]=d,s<++p||l<p)break e;f=e[p],d=t[p]}for(f=e[s],d=t[l];f.key===d.key;){if(d.dom&&(t[l]=d=Kf(d)),Kd(f,d,n,r,o),e[s]=d,l--,--s<p||l<p)break e;f=e[s],d=t[l]}}if(s<p){if(p<=l)for(var h=(u=l+1)<a?t[u].dom:null;p<=l;)(d=t[p]).dom&&(t[p]=d=Kf(d)),p++,rd(n,Ld(d,null,r,o),h)}else if(l<p)for(;p<=s;)kd(e[p++],n);else{var y=p,m=p,v=s-p+1,g=l-p+1,b=[];for(c=0;c<g;c++)b.push(0);var _=v===i,w=!1,x=0,O=0;if(a<4||(v|g)<32)for(c=y;c<=s;c++)if(f=e[c],O<g){for(p=m;p<=l;p++)if(d=t[p],f.key===d.key){if(b[p-m]=c+1,_)for(_=!1;y<c;)kd(e[y++],n);p<x?w=!0:x=p,d.dom&&(t[p]=d=Kf(d)),Kd(f,d,n,r,o),O++;break}!_&&l<p&&kd(f,n)}else _||kd(f,n);else{var j={};for(c=m;c<=l;c++)j[t[c].key]=c;for(c=y;c<=s;c++)if(f=e[c],O<g)if(void 0!==(p=j[f.key])){if(_)for(_=!1;y<c;)kd(e[y++],n);d=t[p],b[p-m]=c+1,p<x?w=!0:x=p,d.dom&&(t[p]=d=Kf(d)),Kd(f,d,n,r,o),O++}else _||kd(f,n);else _||kd(f,n)}if(_)Dd(n,e),zd(t,n,r,o);else if(w){var E=function(e){var t,n,r,o,i,a=e.slice(),c=[0],u=e.length;for(t=0;t<u;t++){var s=e[t];if(0!==s)if(n=c[c.length-1],e[n]<s)a[t]=n,c.push(t);else{for(r=0,o=c.length-1;r<o;)e[c[i=(r+o)/2|0]]<s?r=1+i:o=i;s<e[c[r]]&&(0<r&&(a[t]=c[r-1]),c[r]=t)}}r=c.length,o=c[r-1];for(;0<r--;)c[r]=o,o=a[o];return c}(b);for(p=E.length-1,c=g-1;0<=c;c--)0===b[c]?((d=t[x=c+m]).dom&&(t[x]=d=Kf(d)),u=x+1,rd(n,Ld(d,null,r,o),u<a?t[u].dom:null)):p<0||c!==E[p]?(d=t[x=c+m],u=x+1,rd(n,d.dom,u<a?t[u].dom:null)):p--}else if(O!==g)for(c=g-1;0<=c;c--)0===b[c]&&((d=t[x=c+m]).dom&&(t[x]=d=Kf(d)),u=x+1,rd(n,Ld(d,null,r,o),u<a?t[u].dom:null))}}:function(e,t,n,r,o,i,a){for(var c,u,s=a<i?a:i,l=0;l<s;l++)c=t[l],u=e[l],c.dom&&(c=t[l]=Kf(c)),Kd(u,c,n,r,o),e[l]=c;if(i<a)for(l=s;l<a;l++)Ld(c=(c=t[l]).dom?t[l]=Kf(c):c,n,r,o);else if(a<i)for(l=s;l<i;l++)kd(e[l],n)})(n,r,o,i,a,c,u)):1===t?Dd(o,n):2===t&&(Dd(o,n),Ld(r,o,i,a))}}function Yd(e,t,n,r,o,i,a,c,u){var s=e.state,l=e.props;if((n.children=e).$UN)Nf("Inferno Error: Can only update a mounted or mounting component. This usually means you called setState() or forceUpdate() on an unmounted component. This is a no-op.");else{if(l!==r||r===ed){if(!u&&Tf(e.componentWillReceiveProps)){if(e.$BR=!0,e.componentWillReceiveProps(r,i),e.$UN)return;e.$BR=!1}e.$PSS&&(t=Lf(t,e.$PS),e.$PSS=!1,e.$PS=null)}var p,u=Boolean(e.shouldComponentUpdate);c||!u||u&&e.shouldComponentUpdate(r,t,i)?(Tf(e.componentWillUpdate)&&(e.$BS=!0,e.componentWillUpdate(r,t,i),e.$BS=!1),e.props=r,e.state=t,e.context=i,Tf(Zf.beforeRender)&&Zf.beforeRender(e),c=e.render(r,t,i),Tf(Zf.afterRender)&&Zf.afterRender(e),u=c!==Ef,p=kf(p=Tf(e.getChildContext)?e.getChildContext():p)?i:Lf(i,p),e.$CX=p,u&&(Kd(e.$LI,c=Nd(c,n),o,p,a),e.$LI=c,Tf(e.componentDidUpdate)&&e.componentDidUpdate(l,s))):(e.props=r,e.state=t,e.context=i),n.dom=e.$LI.dom}}Ni&&null===document.body&&Nf('Inferno warning: you cannot initialize inferno without "document.body". Wait on "DOMContentLoaded" event, add script to bottom of body, or use async/defer attributes on script tag.');var Zd=Ni?document.body:null;function Qd(e,t,n){if(Zd===t&&Af('you cannot render() to the "document.body". Use an empty element as a container instead.'),e!==Ef){var r=t.$V;return kf(r)?Rf(e)||(e.dom&&(e=Kf(e)),Bf(t.firstChild)?(Ld(e,t,ed,!1),t.$V=e):function(e,t,n){var r=t.firstChild;if(!Bf(r))for(Rf(e)||qd(e,r,ed,!1),r=t.firstChild;r=r.nextSibling;)t.removeChild(r);0<td.length&&id(td),t.$V=e,Tf(n)&&n()}(e,t),r=e):kf(e)?(kd(r,t),t.$V=null):(Kd(r,e=e.dom?Kf(e):e,t,ed,!1),r=t.$V=e),0<td.length&&id(td),Tf(n)&&n(),Tf(Zf.renderComplete)&&Zf.renderComplete(r),r&&14&r.flags&&r.children}}var Jd="undefined"==typeof Promise?null:Promise.resolve(),eh="undefined"==typeof requestAnimationFrame?setTimeout:requestAnimationFrame.bind(window);function th(e,t,n,r){Tf(t)&&(t=t(e.state,e.props,e.context));var o,i,a,c,u=e.$PS;if(kf(u))e.$PS=t;else for(var s in t)u[s]=t[s];e.$PSS||e.$BR?(e.$PSS=!0,e.$BR&&Tf(n)&&td.push(n.bind(e))):e.$UPD?(Bf(o=e.$QU)&&(o=e.$QU=[],a=e,c=o,i=function(){a.$QU=null,a.$UPD=!0,nh(a,!1,function(){for(var e=0,t=c.length;e<t;e++)c[e].call(a)}),a.$UPD=!1},Jd?Jd.then(i):eh(i)),Tf(n)&&o.push(n)):(e.$PSS=!0,e.$UPD=!0,nh(e,r,n),e.$UPD=!1)}function nh(e,t,n){if(!e.$UN){if(t||!e.$BR){e.$PSS=!1;var r=e.$PS,o=Lf(e.state,r),i=e.props,a=e.context;e.$PS=null;var c=e.$V,r=e.$LI;if(Yd(e,o,c,i,r.dom&&r.dom.parentNode,a,0<(32&c.flags),t,!0),e.$UN)return;if(0==(1024&e.$LI.flags))for(var u=e.$LI.dom;!Bf(c=c.parentVNode);)0<(14&c.flags)&&(c.dom=u);0<td.length&&id(td)}else e.state=e.$PS,e.$PS=null;Tf(n)&&n.call(e)}}function rh(e,t){this.state=null,this.$BR=!1,this.$BS=!0,this.$PSS=!1,this.$PS=null,this.$LI=null,this.$V=null,this.$UN=!1,this.$CX=null,this.$UPD=!0,this.$QU=null,this.props=e||ed,this.context=t||ed}rh.prototype.forceUpdate=function(e){this.$UN||th(this,{},e,!0)},rh.prototype.setState=function(e,t){this.$UN||(this.$BS?Af("cannot update state via setState() in componentWillUpdate() or constructor."):th(this,e,t,!1))},rh.prototype.render=function(e,t,n){};function oh(){}function ih(e){return(ih="function"==typeof Symbol&&"symbol"===Ve(Symbol.iterator)?function(e){return Ve(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":Ve(e)})(e)}function ah(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ch(e){return(ch=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function uh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sh(e,t){return(sh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}console.info("Inferno is in development mode."),-1===(oh.name||oh.toString()).indexOf("testFn")&&Nf("It looks like you're using a minified copy of the development build of Inferno. When deploying Inferno apps to production, make sure to use the production build which skips development warnings and is faster. See http://infernojs.org for more details.");var lh=function(){function r(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),t=this;var n,e=(n=!(n=ch(r).call(this,e))||"object"!==ih(n)&&"function"!=typeof n?uh(t):n)._injector=e.injector;n._sheet=e.get("sheet"),n._changeSupport=e.get("changeSupport"),n._components=e.get("components"),n._eventBus=e.get("eventBus");e=e.get("throttle");return n.onElementsChanged=n.onElementsChanged.bind(uh(n)),n.onScroll=e(n.onScroll.bind(uh(n))),n}var e,t,n;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&sh(e,t)}(r,rh),e=r,(t=[{key:"onElementsChanged",value:function(){this.forceUpdate()}},{key:"onScroll",value:function(){this._eventBus.fire("sheet.scroll")}},{key:"getChildContext",value:function(){return{changeSupport:this._changeSupport,components:this._components,injector:this._injector}}},{key:"componentWillMount",value:function(){var e=this._sheet.getRoot().id;this._changeSupport.onElementsChanged(e,this.onElementsChanged)}},{key:"componentWillUnmount",value:function(){var e=this._sheet.getRoot().id;this._changeSupport.offElementsChanged(e,this.onElementsChanged)}},{key:"render",value:function(){var e=this._sheet.getRoot(),t=e.rows,n=e.cols,r=this._components.getComponents("table.before"),o=this._components.getComponents("table.after"),i=this._components.getComponent("table.head"),a=this._components.getComponent("table.body"),e=this._components.getComponent("table.foot");return Hf(1,"div","tjs-container",[r&&r.map(function(e,t){return Wf(2,e,null,t)}),Hf(1,"div","tjs-table-container",Hf(1,"table","tjs-table",[i&&Wf(2,i,{rows:t,cols:n}),a&&Wf(2,a,{rows:t,cols:n}),e&&Wf(2,e,{rows:t,cols:n})],0),2,{onScroll:this.onScroll}),o&&o.map(function(e,t){return Wf(2,e,null,t)})],0)}}])&&ah(e.prototype,t),n&&ah(e,n),r}();function ph(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}fu=function(){function a(e,t,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);var i=n.container;this._container=i,r.on("root.added",function(){Qd(Wf(2,lh,{injector:o}),i)}),r.on("root.remove",function(){Qd(null,i)})}var e,t,n;return e=a,(t=[{key:"getContainer",value:function(){return this._container}}])&&ph(e.prototype,t),n&&ph(e,n),a}();fu.$inject=["changeSupport","components","config.renderer","eventBus","injector"];ju={__init__:["changeSupport","components","renderer"],changeSupport:["type",zi],components:["type",_o],renderer:["type",fu]};function fh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Si=function(){function r(e,t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this._elementRegistry=e,this._eventBus=t,this._root=null,t.on("table.clear",function(){n.setRoot(null)})}var e,t,n;return e=r,(t=[{key:"setRoot",value:function(e){var t;this._root&&(t=this._root,this._eventBus.fire("root.remove",{root:t}),this._root=null,this._eventBus.fire("root.removed",{root:t})),e&&this._eventBus.fire("root.add",{root:e}),(this._root=e)&&this._eventBus.fire("root.added",{root:e})}},{key:"getRoot",value:function(){return this._root||this.setRoot({id:"__implicitroot",rows:[],cols:[]}),this._root}},{key:"addRow",value:function(n,r){var o=this,i=this.getRoot();if(i.cols.length!=n.cells.length)throw new Error("number of cells is not equal to number of cols");return dh(r=void 0===r?i.rows.length:r,i.rows,n),n.root=i,this._elementRegistry.add(n),n.cells.forEach(function(e,t){o._elementRegistry.add(e),e.row=n,e.col=i.cols[t],dh(r,i.cols[t].cells,e)}),this._eventBus.fire("row.add",{row:n}),n}},{key:"removeRow",value:function(e){var n=this,r=this.getRoot();"string"==typeof e&&(e=this._elementRegistry.get(e));var o=r.rows.indexOf(e);-1!==o&&(hh(o,r.rows),e.root=void 0,this._elementRegistry.remove(e),e.cells.forEach(function(e,t){n._elementRegistry.remove(e),e.col=void 0,hh(o,r.cols[t].cells)}),this._eventBus.fire("row.remove",{row:e}))}},{key:"addCol",value:function(n,r){var o=this,i=this.getRoot();if(this._elementRegistry.add(n),i.rows.length!=n.cells.length)throw new Error("number of cells is not equal to number of rows");return dh(r=void 0===r?i.cols.length:r,i.cols,n),n.root=i,n.cells.forEach(function(e,t){o._elementRegistry.add(e),e.col=n,e.row=i.rows[t],dh(r,i.rows[t].cells,e)}),this._eventBus.fire("col.add",{col:n}),n}},{key:"removeCol",value:function(e){var n=this,r=this.getRoot();"string"==typeof e&&(e=this._elementRegistry.get(e));var o=r.cols.indexOf(e);-1!==o&&(hh(o,r.cols),e.root=void 0,this._elementRegistry.remove(e),e.cells.forEach(function(e,t){n._elementRegistry.remove(e),e.row=void 0,hh(o,r.rows[t].cells)}),this._eventBus.fire("col.remove",{col:e}))}},{key:"resized",value:function(){this._eventBus.fire("sheet.resized")}}])&&fh(e.prototype,t),n&&fh(e,n),r}();function dh(e,t,n){return t.splice(e,0,n)}function hh(e,t){return t.splice(e,1)}function yh(){var e=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],o="number"==typeof e?e:e?300:0;return o?function(e){return t=e,n=o,r=!1,function(){r||(t.apply(void 0,arguments),r=!0,setTimeout(function(){r=!1},n))};var t,n,r}:function(e){return e}}Si.$inject=["elementRegistry","eventBus"],yh.$inject=["config.throttle"];var mh={__depends__:[ju],__init__:["elementFactory","sheet"],elementFactory:["type",_f],elementRegistry:["type",hr],eventBus:["type",U],sheet:["type",Si],throttle:["factory",yh]};function vh(e,t){if(null==e)return{};var n,r=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols)for(var o=Object.getOwnPropertySymbols(e),i=0;i<o.length;i++)n=o[i],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r}function gh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var bh=function(){function r(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var t,n=e.injector;n||(e=(t=this._init(e)).modules,t=t.config,n=function(e){var n=[],r=[];function o(e){return 0<=n.indexOf(e)}e.forEach(function e(t){o(t)||((t.__depends__||[]).forEach(e),o(t)||(n.push(t),(t.__init__||[]).forEach(function(e){r.push(e)})))});var t=new of(n);return r.forEach(function(e){try{t["string"==typeof e?"get":"invoke"](e)}catch(e){throw console.error("Failed to instantiate component"),console.error(e.stack),e}}),t}([{config:["value",t]},mh].concat(e||[]))),this.get=n.get,this.invoke=n.invoke,this.get("eventBus").fire("table.init"),this.get("eventBus").fire("diagram.init")}var e,t,n;return e=r,(t=[{key:"_init",value:function(e){return{modules:e.modules,config:vh(e,["modules"])}}},{key:"destroy",value:function(){var e=this.get("eventBus");e.fire("table.destroy"),e.fire("diagram.destroy")}},{key:"clear",value:function(){var e=this.get("eventBus");e.fire("table.clear"),e.fire("diagram.clear")}}])&&gh(e.prototype,t),n&&gh(e,n),r}();function _h(e){if(!e)return"<null>";var t=e.id?' id="'.concat(e.id,'"'):"";return"<".concat(e.$type).concat(t," />")}function wh(i,e){function a(e,t,n){if(e.gfx)throw new Error("already rendered ".concat(_h(e)));return i.element(e,t,n)}function c(e,t,n){x(e,function(e){a(e,t,n)})}function u(e,t,n){x(e,function(e){a(e,t,n)})}return{handleDecision:function(e){e.id||(e.id="decision");var t=e.decisionLogic;if(!t)throw new Error("no table for ".concat(_h(e)));if(!t.output)throw new Error("missing output for ".concat(_h(t)));var n,r,o=i.table(t);t.input&&c(t.input,o,t),c(t.output,o,t),e=t.rule,n=o,r=t,x(e,function(e){a(e,n,r),u(e.inputEntry,e),u(e.outputEntry,e)})}}}function xh(e,t,n){var r,o=e.get("tableImporter"),i=e.get("eventBus"),a=e.get("sheet"),c=(e.get("modeling",!1),[]);i.fire("import.render.start",{decision:t});try{new wh({create:function(e,t,n,r){return o.create(e,t,n,r)},table:function(e){return o.add(e)},element:function(e,t,n){return o.add(e,t,n)},error:function(e,t){c.push({message:e,context:t})}}).handleDecision(t)}catch(e){r=e}i.fire("import.render.complete",{error:r,warnings:c}),i.fire("elements.changed",{elements:[a.getRoot()]}),n(r,c)}function Oh(e){return(Oh="function"==typeof Symbol&&"symbol"===Ve(Symbol.iterator)?function(e){return Ve(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":Ve(e)})(e)}function jh(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),n=e?n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}):n}function Eh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ch(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function Sh(e,t){var n=e.elements,r=e.index;return r[t]?e:{elements:[].concat(Ch(n),[t]),index:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?jh(n,!0).forEach(function(e){Eh(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jh(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},r,Eh({},t,!0))}}function Ph(){for(var e,n={elements:[],index:{}},t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return r.forEach(function(t){var e=Oh(t);"string"===e&&0<t.length?n=Sh(n,t):"object"===e&&null!==t&&Object.keys(t).forEach(function(e){t[e]&&(n=Sh(n,e))})}),e=" ",n.elements.join(e)}function kh(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function Rh(e){return Th(e.constructor,e),0}function Th(e,a){var t,c=e.$inject;c&&(t=a.context.injector,e=[].concat(kh(c),[function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(e in n){var o=c[e],i=n[e];a[o]=i}}]),t.invoke(e))}function Dh(r,o){Object.keys(o).forEach(function(e){if("$inject"!==e&&"__init"!==e){var t=o[e];"constructor"===e&&t.call(r,r.props,r.context);var n=r[e];if(void 0!==n){if("function"!=typeof n)throw new Error("failed to mixin <".concat(e,">: cannot combine with non-fn component value"));r[e]=function(o){for(var e=arguments.length,i=new Array(1<e?e-1:0),t=1;t<e;t++)i[t-1]=arguments[t];return function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return i.forEach(function(e){if(void 0!==(t=e.call.apply(e,[o].concat(n))))return!1}),t}.bind(o)}(r,n,t)}else r[e]=t.bind(r)}}),"$inject"in o&&Th(o,r),"__init"in o&&o.__init.call(r,r.props,r.context)}var Mh={getSelectionClasses:function(){var e=this.state;return Ph({selected:e.selected,"selected-secondary":e.selectedSecondary,focussed:e.focussed})},selectionChanged:function(e){this.setState(e)},componentWillUpdate:function(e){e.elementId!==this.props.elementId&&this.updateSelectionSubscription(!1)},componentDidUpdate:function(e){e.elementId!==this.props.elementId&&this.updateSelectionSubscription(!0)},componentDidMount:function(){this.updateSelectionSubscription(!0)},componentWillUnmount:function(){this.updateSelectionSubscription(!1)},updateSelectionSubscription:function(e){var t=this.props.elementId;t&&this.eventBus[e?"on":"off"]("selection.".concat(t,".changed"),this.selectionChanged)}};function Bh(e){return(Bh="function"==typeof Symbol&&"symbol"===Ve(Symbol.iterator)?function(e){return Ve(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":Ve(e)})(e)}function Ih(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),n=e?n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}):n}function Ah(r){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?Ih(o,!0).forEach(function(e){var t,n;t=r,e=o[n=e],n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Ih(o).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))})}return r}function Nh(e,t){if(null==e)return{};var n,r=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols)for(var o=Object.getOwnPropertySymbols(e),i=0;i<o.length;i++)n=o[i],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r}function Lh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $h(e){return($h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Vh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zh(e,t){return(zh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Mh.$inject=["eventBus"];var Fh=function(){function r(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),n=this,t=!(t=$h(r).call(this,e,t))||"object"!==Bh(t)&&"function"!=typeof t?Vh(n):t,Dh(Vh(t),Mh),Rh(Vh(t)),t}var e,t,n;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&zh(e,t)}(r,rh),e=r,(t=[{key:"getRenderProps",value:function(){for(var e=this.props,t=e.className,n=e.elementId,r=e.coords,e=Nh(e,["className","elementId","coords"]),o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];t={className:Ph.apply(void 0,i.concat([this.getSelectionClasses(),t]))};return n&&(t["data-element-id"]=n),r&&(t["data-coords"]=r),Ah({},t,{},e)}}])&&Lh(e.prototype,t),n&&Lh(e,n),r}();function Uh(e){return(Uh="function"==typeof Symbol&&"symbol"===Ve(Symbol.iterator)?function(e){return Ve(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":Ve(e)})(e)}function Hh(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),n=e?n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}):n}function Wh(r){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?Hh(o,!0).forEach(function(e){var t,n;t=r,e=o[n=e],n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Hh(o).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))})}return r}function qh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Gh(e,t){return!t||"object"!==Uh(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function Kh(e){return(Kh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Xh(e,t){return(Xh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Yh=function(){function n(e,t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(t=Gh(this,Kh(n).call(this,e,t))).state={},t}var e,t,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Xh(e,t)}(n,Fh),e=n,(t=[{key:"render",value:function(){return Gf(Hf(1,"td",null,this.props.children,0,Wh({},this.getRenderProps("cell"))))}}])&&qh(e.prototype,t),r&&qh(e,r),n}(),Zh=["type","context"],Qh=["type","context"];function Jh(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function ey(r){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?Jh(Object(o),!0).forEach(function(e){var t,n;t=r,e=o[n=e],n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Jh(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))})}return r}function ty(e,t){if(null==e)return{};var n,r=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols)for(var o=Object.getOwnPropertySymbols(e),i=0;i<o.length;i++)n=o[i],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r}var ny={slotFill:function(e,t){var n=e.type,r=e.context,e=ty(e,Zh),t=this.components.getComponent(n,r)||t;return t?Gf(Wf(2,t,ey(ey({},r),e))):null},slotFills:function(e){var t=e.type,n=e.context,r=ty(e,Qh);return this.components.getComponents(t,n).map(function(e){return Gf(Wf(2,e,ey(ey({},n),r)))})}};function ry(e){return(ry="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function oy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function iy(e,t){return(iy=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ay(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=uy(n);return function(e,t){{if(t&&("object"===ry(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return cy(e)}(this,r?(e=uy(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function cy(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uy(e){return(uy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}ny.$inject=["components"];var sy=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&iy(e,t)}(i,rh);var e,t,n,o=ay(i);function i(e,t){var n,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),n=o.call(this,e,t),r=cy(n),e=function(){n.forceUpdate()},(t="onElementsChanged")in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,Dh(cy(n),ny),Rh(cy(n)),n}return e=i,(t=[{key:"componentDidMount",value:function(){this.changeSupport.onElementsChanged(this.getRoot(),this.onElementsChanged)}},{key:"componentWillUnmount",value:function(){this.changeSupport.offElementsChanged(this.getRoot(),this.onElementsChanged)}},{key:"getRoot",value:function(){return this.sheet.getRoot()}},{key:"render",value:function(){var e=(this.getRoot().businessObject.get("annotationsWidth")||400)+"px";return Hf(1,"th","annotation header",[this.slotFills({type:"cell-inner",context:{cellType:"annotations",col:this.sheet.getRoot(),minWidth:400}}),this.translate("Annotations")],0,{style:{width:e}})}}])&&oy(e.prototype,t),n&&oy(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function ly(e){var t=e.row.businessObject,e=t.id,t=t.description;return Wf(2,Yh,{className:"annotation",elementId:e,children:t||"-"})}function py(e){e.onGetComponent("cell",function(e){e=e.cellType;return"after-label-cells"===e?sy:"after-rule-cells"===e?ly:void 0})}sy.$inject=["changeSupport","sheet","translate"],py.$inject=["components"];var fy={__init__:["annotationsProvider"],annotationsProvider:["type",py]};function dy(e){return function(e){if(Array.isArray(e))return hy(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return hy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hy(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function yy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function my(e,t){return L({id:e.id,type:e.$type,businessObject:e},t)}oc=function(){function r(e,t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this._elementFactory=e,this._eventBus=t,this._sheet=n}var e,t,n;return e=r,(t=[{key:"add",value:function(e){var t,n,r=this;return en(e,"dmn:DecisionTable")?(n=this._elementFactory.createRoot(my(e)),this._sheet.setRoot(n)):en(e,"dmn:InputClause")||en(e,"dmn:OutputClause")?(n=this._elementFactory.createCol(my(e)),this._sheet.addCol(n)):en(e,"dmn:DecisionRule")&&(e.inputEntry||(e.inputEntry=[]),e.outputEntry||(e.outputEntry=[]),t=[].concat(dy(e.inputEntry),dy(e.outputEntry)).map(function(e){return r._elementFactory.createCell(my(e))}),n=this._elementFactory.createRow(L(my(e),{cells:t})),this._sheet.addRow(n)),this._eventBus.fire("dmnElement.added",{element:n}),n}}])&&yy(e.prototype,t),n&&yy(e,n),Object.defineProperty(e,"prototype",{writable:!1}),r}();oc.$inject=["elementFactory","eventBus","sheet"];var vy={__depends__:[{__depends__:[ci],tableImporter:["type",oc]},ju]};function gy(e){return(gy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function by(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _y(e,t){return(_y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function wy(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=Oy(n);return function(e,t){{if(t&&("object"===gy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return xy(e)}(this,r?(e=Oy(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function xy(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Oy(e){return(Oy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var jy=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_y(e,t)}(a,rh);var e,t,n,i=wy(a);function a(e,t){var n,r,o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),n=i.call(this,e,t),r=xy(n),o=function(){n.forceUpdate()},(e="onElementsChanged")in r?Object.defineProperty(r,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[e]=o,Dh(xy(n),ny),n._sheet=t.injector.get("sheet"),n._changeSupport=t.changeSupport,n}return e=a,(t=[{key:"componentWillMount",value:function(){var e=this._sheet.getRoot();this._changeSupport.onElementsChanged(e.id,this.onElementsChanged)}},{key:"componentWillUnmount",value:function(){var e=this._sheet.getRoot();this._changeSupport.offElementsChanged(e.id,this.onElementsChanged)}},{key:"render",value:function(){var r=this,e=this._sheet.getRoot();if(!en(e,"dmn:DMNElement"))return null;var e=rn(e),o=e.input,n=e.output;return Hf(1,"thead",null,Hf(1,"tr",null,[Hf(1,"th","index-column"),this.slotFills({type:"cell",context:{cellType:"before-label-cells"}}),o&&o.map(function(e,t){var n=e.width||"192px";return r.slotFill({type:"cell",context:{cellType:"input-header",input:e,index:t,inputsLength:o.length,width:n},key:e.id},Ey)}),n.map(function(e,t){return r.slotFill({type:"cell",context:{cellType:"output-header",output:e,index:t,outputsLength:n.length},key:e.id},Cy)}),this.slotFills({type:"cell",context:{cellType:"after-label-cells"}})],0),2)}}])&&by(e.prototype,t),n&&by(e,n),Object.defineProperty(e,"prototype",{writable:!1}),a}();function Ey(e,t){var n=e.input,r=e.className,o=e.index,i=n.label,a=n.inputExpression,e=n.inputValues,t=t.injector.get("translate");return Hf(1,"th",(r||"")+" input-cell",[Hf(1,"div","clause",t(0===o?"When":"And"),0),i?Hf(1,"div","input-label",i,0,{title:t("Input Label")}):Hf(1,"div","input-expression",a.text,0,{title:t("Input Expression")}),Hf(1,"div","input-variable",e&&e.text||a.typeRef,0,{title:e&&e.text?t("Input Values"):t("Input Type")})],0,{"data-col-id":n.id},n.id)}function Cy(e,t){var n=e.output,r=e.className,o=e.index,i=n.label,a=n.name,c=n.outputValues,e=n.typeRef,t=t.injector.get("translate");return Hf(1,"th",(r||"")+" output-cell",[Hf(1,"div","clause",t(0===o?"Then":"And"),0),i?Hf(1,"div","output-label",i,0,{title:t("Output Label")}):Hf(1,"div","output-name",a,0,{title:t("Output Name")}),Hf(1,"div","output-variable",c&&c.text||e,0,{title:c&&c.text?t("Output Values"):t("Output Type")})],0,null,n.id)}function Sy(e){e.onGetComponent("table.head",function(){return jy})}Sy.$inject=["components"];var Py={__init__:["decisionTableHeadProvider"],decisionTableHeadProvider:["type",Sy]};function ky(e){return(ky="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ry(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ty(e,t){return(Ty=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Dy(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=By(n);return function(e,t){{if(t&&("object"===ky(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return My(e)}(this,r?(e=By(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function My(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function By(e){return(By=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Iy=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ty(e,t)}(o,rh);var e,t,n,r=Dy(o);function o(e,t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),Rh(My(t=r.call(this,e,t))),t}return e=o,(t=[{key:"render",value:function(){var e=this.sheet.getRoot();if(!en(e,"dmn:DMNElement"))return null;var t=e.businessObject.$parent.name,e=this.components.getComponent("hit-policy")||Ay;return Hf(1,"div","decision-table-properties",[Hf(1,"div","decision-table-name",t,0,{title:"Decision Name: "+t}),Hf(1,"div","decision-table-header-separator"),Wf(2,e)],4)}}])&&Ry(e.prototype,t),n&&Ry(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function Ay(){return null}function Ny(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ly(e,t,n){return t&&Ny(e.prototype,t),n&&Ny(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}Iy.$inject=["sheet","components"];Ni=Ly(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("table.before",500,function(){return Iy})});Ni.$inject=["components"];var $y={__init__:["decisionTableProperties"],decisionTableProperties:["type",Ni]};function Vy(e){return(Vy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Fy(e,t){return(Fy=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Uy(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=Hy(n);return function(e,t){{if(t&&("object"===Vy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,r?(e=Hy(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function Hy(e){return(Hy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Wy=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fy(e,t)}(o,rh);var e,t,n,r=Uy(o);function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),r.apply(this,arguments)}return e=o,(t=[{key:"render",value:function(){var e=this.props,t=e.row,n=e.rowIndex,e=this.context.components.getComponents("cell-inner",{cellType:"rule-index",row:t,rowIndex:n});return Hf(1,"td","rule-index",[e&&e.map(function(e){return Wf(2,e,{row:t,rowIndex:n})}),n+1],0,{"data-element-id":t.id,"data-row-id":t.id})}}])&&zy(e.prototype,t),n&&zy(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function qy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Gy(e,t,n){return t&&qy(e.prototype,t),n&&qy(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}zi=Gy(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("cell",function(e){if("before-rule-cells"===e.cellType)return Wy})});zi.$inject=["components"];var Ky={__init__:["decisionRuleIndices"],decisionRuleIndices:["type",zi]};function Xy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Yy=[{label:"FEEL",value:"feel"}],_o=function(){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=(this._injector=e).get("config.expressionLanguages")||{};this._config={options:Yy,defaults:{editor:"feel"}},t.options&&(this._config.options=t.options);e=this._getLegacyDefaults();L(this._config.defaults,e,t.defaults)}var e,t,r;return e=n,(t=[{key:"getDefault",value:function(e){var t=this._config.defaults,t=t[e]||t.editor;return this._getLanguageByValue(t)||this.getAll()[0]}},{key:"getLabel",value:function(e){var t=this._getLanguageByValue(e);return t?t.label:e}},{key:"getAll",value:function(){return this._config.options}},{key:"_getLegacyDefaults",value:function(){var e={},t=this._injector,n=t.get("config.defaultInputExpressionLanguage"),t=t.get("config.defaultOutputExpressionLanguage");return n&&(e.inputCell=n),t&&(e.outputCell=t),e}},{key:"_getLanguageByValue",value:function(t){return b(this.getAll(),function(e){return t===e.value})}}])&&Xy(e.prototype,t),r&&Xy(e,r),Object.defineProperty(e,"prototype",{writable:!1}),n}();_o.$inject=["injector"];var Zy={__init__:["expressionLanguages"],expressionLanguages:["type",_o]};function Qy(e){return(Qy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Jy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function em(e,t){return(em=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function tm(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=nm(n);return function(e,t){{if(t&&("object"===Qy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,r?(e=nm(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function nm(e){return(nm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var rm=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&em(e,t)}(o,rh);var e,t,n,r=tm(o);function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),r.apply(this,arguments)}return e=o,(t=[{key:"render",value:function(e){var t=e.rows,r=e.cols,o=this.context.components;return Hf(1,"tbody",null,t.map(function(e,t){var n=o.getComponent("row",{rowType:"rule"});return n&&Wf(2,n,{row:e,rowIndex:t,cols:r},e.id)}),0)}}])&&Jy(e.prototype,t),n&&Jy(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function om(e){return(om="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function im(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function am(e,t){return(am=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function cm(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=sm(n);return function(e,t){{if(t&&("object"===om(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return um(e)}(this,r?(e=sm(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function um(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sm(e){return(sm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var lm=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&am(e,t)}(o,rh);var e,t,n,r=cm(o);function o(e,t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),Dh(um(t=r.call(this,e,t)),ny),t}return e=o,(t=[{key:"render",value:function(){var n=this,e=this.props,r=e.row,o=e.rowIndex,i=e.cols,e=r.cells;return Hf(1,"tr",null,[this.slotFills({type:"cell",context:{cellType:"before-rule-cells",row:r,rowIndex:o}}),e.map(function(e,t){return n.slotFill({type:"cell",context:{cellType:"rule",cell:e,rowIndex:o,colIndex:t},key:e.id,row:r,col:i[t]})}),this.slotFills({type:"cell",context:{cellType:"after-rule-cells",row:r,rowIndex:o}})],0)}}])&&im(e.prototype,t),n&&im(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function pm(e){return(pm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function fm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function dm(e,t){return(dm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function hm(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=ym(n);return function(e,t){{if(t&&("object"===pm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,r?(e=ym(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function ym(e){return(ym=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var mm=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dm(e,t)}(o,rh);var e,t,n,r=hm(o);function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),r.apply(this,arguments)}return e=o,(t=[{key:"render",value:function(){var e=this.props,t=e.cell,n=e.row,e=e.col;return en(t,"dmn:UnaryTests")?Wf(2,Yh,{className:"input-cell",elementId:t.id,"data-row-id":n.id,"data-col-id":e.id,children:t.businessObject.text}):Wf(2,Yh,{className:"output-cell",elementId:t.id,"data-row-id":n.id,"data-col-id":e.id,children:t.businessObject.text})}}])&&fm(e.prototype,t),n&&fm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function vm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function gm(e,t,n){return t&&vm(e.prototype,t),n&&vm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}fu=gm(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("table.body",function(){return rm}),t.onGetComponent("row",function(e){if("rule"===e.rowType)return lm}),t.onGetComponent("cell",function(e){if("rule"===e.cellType)return mm})});fu.$inject=["components"];var bm={__depends__:[Zy],__init__:["decisionRules"],decisionRules:["type",fu]},_m=[{label:"Unique",value:{hitPolicy:"UNIQUE",aggregation:void 0},explanation:"No overlap is possible and all rules are disjoint. Only a single rule can be matched"},{label:"First",value:{hitPolicy:"FIRST",aggregation:void 0},explanation:"Rules may overlap. The first matching rule will be chosen"},{label:"Priority",value:{hitPolicy:"PRIORITY",aggregation:void 0},explanation:"Rules may overlap. The one with the highest priority will be chosen"},{label:"Any",value:{hitPolicy:"ANY",aggregation:void 0},explanation:"Rules may overlap. Their output have to match"},{label:"Collect",value:{hitPolicy:"COLLECT",aggregation:void 0},explanation:"Collects the values of all matching rules"},{label:"Collect (Sum)",value:{hitPolicy:"COLLECT",aggregation:"SUM"},explanation:"Collects the values of all matching rules and sums up to a single value"},{label:"Collect (Min)",value:{hitPolicy:"COLLECT",aggregation:"MIN"},explanation:"Collects the values of all matching rules and uses the lowest value"},{label:"Collect (Max)",value:{hitPolicy:"COLLECT",aggregation:"MAX"},explanation:"Collects the values of all matching rules and uses the highest value"},{label:"Collect (Count)",value:{hitPolicy:"COLLECT",aggregation:"COUNT"},explanation:"Collects the values of all matching rules and counts the number of them"},{label:"Rule order",value:{hitPolicy:"RULE ORDER",aggregation:void 0},explanation:"Collects the values of all matching rules in rule order"},{label:"Output order",value:{hitPolicy:"OUTPUT ORDER",aggregation:void 0},explanation:"Collects the values of all matching rules in decreasing output priority order"}];function wm(e){return(wm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Om(e,t){return(Om=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function jm(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=Cm(n);return function(e,t){{if(t&&("object"===wm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return Em(e)}(this,r?(e=Cm(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function Em(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cm(e){return(Cm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Sm=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Om(e,t)}(o,rh);var e,t,n,r=jm(o);function o(e,t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),Rh(Em(t=r.call(this,e,t))),t}return e=o,(t=[{key:"getRoot",value:function(){return this.sheet.getRoot()}},{key:"render",value:function(){var e=this.getRoot().businessObject,n=e.aggregation,r=e.hitPolicy,e=b(_m,function(e){return t=e.value,e={aggregation:n,hitPolicy:r},t.hitPolicy===e.hitPolicy&&t.aggregation===e.aggregation;var t});return Hf(1,"div","hit-policy header",[Hf(1,"label","dms-label",qf("Hit Policy:"),2),Hf(1,"span","hit-policy-value",e.label,0)],4,{title:e.explanation})}}])&&xm(e.prototype,t),n&&xm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function Pm(e){e.onGetComponent("hit-policy",function(){return Sm})}Sm.$inject=["sheet"],Pm.$inject=["components"];var km={__init__:["hitPolicyProvider"],hitPolicyProvider:["type",Pm]};function Rm(e){return(Rm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Dm(e,t){return(Dm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Mm(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=Im(n);return function(e,t){{if(t&&("object"===Rm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return Bm(e)}(this,r?(e=Im(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function Bm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Im(e){return(Im=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Am=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dm(e,t)}(a,rh);var e,t,n,i=Mm(a);function a(e,t){var n,r,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),n=i.call(this,e,t),r=Bm(n),o=function(){n._eventBus.fire("showDrd")},(e="onClick")in r?Object.defineProperty(r,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[e]=o;t=t.injector;return n._eventBus=t.get("eventBus"),n}return e=a,(t=[{key:"render",value:function(){var t=this;return Hf(1,"div","view-drd",Hf(1,"button","view-drd-button",qf("View DRD"),2,{onClick:this.onClick}),2,null,null,function(e){return t.node=e})}}])&&Tm(e.prototype,t),n&&Tm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),a}();function Nm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}hr=function(){function i(e,t,n,r){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),this._injector=n,this._sheet=r,e.onGetComponent("table.before",function(){if(o.canViewDrd())return Am}),t.on("showDrd",function(){var e=n.get("_parent",!1),t=Lm(r.getRoot());t&&(t=e.getView(t),e.open(t))})}var e,t,n;return e=i,(t=[{key:"canViewDrd",value:function(){var e=this._injector.get("_parent",!1);if(!e)return!1;var t=Lm(this._sheet.getRoot());return!!e.getView(t)}}])&&Nm(e.prototype,t),n&&Nm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function Lm(e){e=e.businessObject;if(e)return e.$parent.$parent}hr.$inject=["components","eventBus","injector","sheet"];var $m={__init__:["viewDrd"],viewDrd:["type",hr]};function Vm(){return Hf(32,"svg",null,[Hf(1,"path",null,null,1,{fill:"#000000",d:"M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"}),Hf(1,"path",null,null,1,{fill:"#000000",d:"M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"})],4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14.02 5.57",width:"53",height:"21",style:"vertical-align:middle"})}function zm(e){return(zm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Fm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Um(e,t){return(Um=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Hm(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=qm(n);return function(e,t){{if(t&&("object"===zm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return Wm(e)}(this,r?(e=qm(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function Wm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qm(e){return(qm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Gm=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Um(e,t)}(a,rh);var e,t,n,i=Hm(a);function a(e,t){var n,r,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),n=i.call(this,e,t),r=Wm(n),o=function(){n._eventBus.fire("poweredBy.show")},(e="onClick")in r?Object.defineProperty(r,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[e]=o;t=t.injector;return n._eventBus=t.get("eventBus"),n}return e=a,(t=[{key:"render",value:function(){var t=this;return Hf(1,"div","powered-by",Hf(1,"div","powered-by__logo",Wf(2,Vm),2,{title:"Powered by bpmn.io",onClick:this.onClick},null,function(e){return t.node=e}),2)}}])&&Fm(e.prototype,t),n&&Fm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),a}();function Km(e){return(Km="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ym(e,t){return(Ym=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zm(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=Jm(n);return function(e,t){{if(t&&("object"===Km(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return Qm(e)}(this,r?(e=Jm(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function Qm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Jm(e){return(Jm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ev=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ym(e,t)}(o,rh);var e,t,n,r=Zm(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,e)).state={show:!1},e.onClick=e.onClick.bind(Qm(e)),e.onShow=e.onShow.bind(Qm(e)),e}return e=o,(t=[{key:"onClick",value:function(){this.setState({show:!1})}},{key:"onShow",value:function(){this.setState({show:!0})}},{key:"componentWillMount",value:function(){(this._eventBus=this.context.injector.get("eventBus")).on("poweredBy.show",this.onShow)}},{key:"componentWillUnmount",value:function(){this._eventBus.off("poweredBy.show",this.onShow)}},{key:"render",value:function(){return this.state.show&&Hf(1,"div","powered-by-overlay",Hf(1,"div","powered-by-overlay-content",[Hf(1,"a","logo",Wf(2,Vm),2,{href:"https://bpmn.io",target:"_blank",rel:"noopener"}),Hf(1,"span",null,[qf("Web-based tooling for BPMN, DMN and CMMN diagrams powered by "),Hf(1,"a",null,qf("bpmn.io"),2,{href:"http://bpmn.io",target:"_blank"}),qf(".")],4)],4,{onClick:function(e){return e.stopPropagation()}}),2,{onClick:this.onClick})}}])&&Xm(e.prototype,t),n&&Xm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function tv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function nv(e,t,n){return t&&tv(e.prototype,t),n&&tv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}Si=nv(function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("table.before",function(){return Gm}),t.onGetComponent("table.before",function(){return ev})});Si.$inject=["components","eventBus"];var rv={__init__:["poweredBy"],poweredBy:["type",Si]};function ov(e){return(ov="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var iv=["modules","additionalModules"];function av(e){return function(e){if(Array.isArray(e))return cv(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return cv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cv(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uv(e,t){if(null==e)return{};var n,r=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols)for(var o=Object.getOwnPropertySymbols(e),i=0;i<o.length;i++)n=o[i],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r}function sv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function lv(){return(lv="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=dv(e)););return e}(e,t);if(r){t=Object.getOwnPropertyDescriptor(r,t);return t.get?t.get.call(arguments.length<3?e:n):t.value}}).apply(this,arguments)}function pv(e,t){return(pv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function fv(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=dv(n);return function(e,t){{if(t&&("object"===ov(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,r?(e=dv(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function dv(e){return(dv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var hv=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pv(e,t)}(o,bh);var e,t,n,r=fv(o);function o(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var t=o._createContainer();return(e=r.call(this,L(e,{renderer:{container:t}})))._container=t,e}return e=o,n=[{key:"_getModules",value:function(){return[fy,vy,ci,Py,$y,Ky,bm,km,$m]}},{key:"_createContainer",value:function(){return kt('<div class="dmn-decision-table-container"></div>')}}],(t=[{key:"open",value:function(e){var o=this;return new Promise(function(n,r){var t;try{return o._decision&&o.clear(),o._decision=e,xh(o,e,function(e,t){e?(e.warnings=t||[],r(e)):n({warnings:t||[]})})}catch(e){t=e}t?(t.warnings=t.warnings||[],r(t)):n({warnings:[]})})}},{key:"_init",value:function(e){var t=e.modules,n=e.additionalModules,r=uv(e,iv),e=t||this.getModules(),t=n||[],n=[{decisionTable:["value",this]}];return{modules:[rv].concat(av(e),av(t),n),config:r}}},{key:"on",value:function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)}},{key:"off",value:function(e,t){this.get("eventBus").off(e,t)}},{key:"_emit",value:function(e,t){return this.get("eventBus").fire(e,t)}},{key:"attachTo",value:function(e){if(!e)throw new Error("parentNode required");this.detach();var t=this._container;e.appendChild(t),this._emit("attach",{})}},{key:"detach",value:function(){var e=this._container;e.parentNode&&(this._emit("detach",{}),Bt(e))}},{key:"destroy",value:function(){lv(dv(o.prototype),"destroy",this).call(this),this.detach()}},{key:"getModules",value:function(){return o._getModules()}}])&&sv(e.prototype,t),n&&sv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function yv(e){return(yv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function vv(e,t){return(vv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function gv(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=_v(n);return function(e,t){{if(t&&("object"===yv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return bv(e)}(this,r?(e=_v(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function bv(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _v(e){return(_v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var wv=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vv(e,t)}(i,rh);var e,t,n,o=gv(i);function i(e,t){var n,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),n=o.call(this,e,t),r=bv(n),e=function(e){e.stopPropagation(),n.addRule(e.target.dataset.colIndex)},(t="handleClick")in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,Rh(bv(n)),n.addRule=n.addRule.bind(bv(n)),n}return e=i,(t=[{key:"componentWillMount",value:function(){this._eventBus=this.context.injector.get("eventBus")}},{key:"addRule",value:function(e){this._eventBus.fire("addRule",{colIndex:e})}},{key:"render",value:function(){var e=this.props.cols,t=[Hf(1,"td","add-rule-add",Hf(1,"span","dmn-icon-plus action-icon",null,1,{title:"Add Rule"}),2)],n=this.sheet.getRoot().businessObject;n.input&&n.input.length||t.push(Hf(1,"td","input-cell",qf("-"),2));for(var r=0;r<e.length+1;r++){var o="add-rule",i=e[r]&&e[r].businessObject,a="";i?(i.$instanceOf("dmn:InputClause")&&(o+=" input-cell",a="-"),i.$instanceOf("dmn:OutputClause")&&(o+=" output-cell")):o+=" annotation",t.push(Hf(1,"td",o,a,0,{"data-col-index":r}))}return Hf(1,"tfoot","actionable add-rule",Hf(1,"tr",null,t,0),2,{onClick:this.handleClick})}}])&&mv(e.prototype,t),n&&mv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function xv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ov(e,t,n){return t&&xv(e.prototype,t),n&&xv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}wv.$inject=["sheet"];oc=Ov(function e(t,r,n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("table.foot",function(){return wv}),n.on("addRule",function(e,t){var n=r.trigger("addRule"),t=t.colIndex;n.cells[t]?o.select(n.cells[t]):o.select(n.cells[0])})});function jv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}oc.$inject=["components","editorActions","eventBus","selection"];ju=function(){function o(e,t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this._elementRegistry=e,this._eventBus=t,this._renderer=n,this._selection=void 0,t.on("diagram.clear",function(){r._selection=void 0})}var e,t,n;return e=o,(t=[{key:"select",value:function(e){v(e)&&(e=this._elementRegistry.get(e));var t=this._selection;t!==e&&(this._selection=e,this._eventBus.fire("selection.changed",{oldSelection:t,selection:e}))}},{key:"deselect",value:function(){var e=this._selection;this._selection=void 0,this._eventBus.fire("selection.changed",{oldSelection:e,selection:this._selection})}},{key:"get",value:function(){return this._selection}},{key:"hasSelection",value:function(){return!!this._selection}}])&&jv(e.prototype,t),n&&jv(e,n),o}();ju.$inject=["elementRegistry","eventBus","renderer"];function Ev(t,e,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,Ev),this._elementRegistry=t,this._renderer=n,this._selection=r,e.on(["cell.click","cell.contextmenu"],function(e){e=e.id,e=t.get(e);e&&r.select(e)}),e.on("row.remove",function(e){var t=e.row,e=r.get();e&&t===e.row&&r.deselect()}),e.on("col.remove",function(e){var t=e.col,e=r.get();e&&t===e.col&&r.deselect()})}Ev.$inject=["elementRegistry","eventBus","renderer","selection"];var Cv={__init__:["selection","selectionBehavior"],selection:["type",ju],selectionBehavior:["type",Ev]};function Sv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Pv=["click","dblclick","contextmenu","mousedown","mouseup","mouseenter","mouseleave","mouseout","mouseover","mousemove","focusin","focusout","drag","dragstart","dragend","dragover","dragenter","dragleave","drop"],Ni=function(){function a(e,t){var n,r,o,i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),o=function(e){var t=e.target,n=e.type,r=xt(t,"[data-element-id]",!0);!r||(t=r.getAttribute("data-element-id"))&&(r=i._eventBus.createEvent({id:t,event:e,node:r,target:r}),i._eventBus.fire("cell.".concat(n),r),r.defaultPrevented&&e.preventDefault(),r.cancelBubble&&e.stopPropagation())},(r="_handleEvent")in(n=this)?Object.defineProperty(n,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[r]=o,this._eventBus=t,this._container=e.container,t.on("table.init",function(){i._addEventListeners(Pv)}),t.on("table.destroy",function(){i._removeEventListeners(Pv)})}var e,t,n;return e=a,(t=[{key:"_addEventListeners",value:function(e){var t=this,n=this._container;e.forEach(function(e){n.addEventListener(e,t._handleEvent)})}},{key:"_removeEventListeners",value:function(e){var t=this,n=this._container;e.forEach(function(e){n.removeEventListener(e,t._handleEvent)})}}])&&Sv(e.prototype,t),n&&Sv(e,n),a}();Ni.$inject=["config.renderer","eventBus"];var kv={__init__:["interactionEvents"],interactionEvents:["type",Ni]},Rv=function(e,t){return e^t};function Tv(e,t){var n,r,o,i=function(e){for(var t=[],n=0;n<e.length;n++)~t.indexOf(e[n])||t.push(e[n]);return t}(e.replace(/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\//g,"").replace(Dv,"").match(/[a-zA-Z_]\w*/g)||[]);return t&&"string"==typeof t&&(n=t,t=function(e){return n+e}),t?(r=i,o=t,e.replace(/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\/|[a-zA-Z_]\w*/g,function(e){return"("==e[e.length-1]||~r.indexOf(e)?o(e):e})):i}var Dv=/\b(Array|Date|Object|Math|JSON)\b/g;var Mv=Bv;function Bv(e,t){if(!(this instanceof Bv))return new Bv(e,t);if(this.node=this.start=this.peeked=e,this.root=t,this.closingTag=!1,this._revisit=!0,this._selects=[],this._rejects=[],e&&this.higher(e))throw new Error("root must be a parent or ancestor to node")}function Iv(a,c){var u="nextSibling"==a;return function(e,t,n){e=this.compile(e),t=t&&0<t?t:1;for(var r=this.node,o=this.closingTag,i=this._revisit;r;){if(Rv(u,o)&&r[c])r=r[c],o=!u;else if(1==r.nodeType&&!r[c]&&Rv(u,o)){if(o=u,!i)continue}else if(r[a])r=r[a],o=!u;else if(r=r.parentNode,o=u,!i)continue;if(!r||this.higher(r,this.root))break;if(e(r)&&this.selects(r,n)&&this.rejects(r,n)&&!--t)return n||(this.node=r),this.closingTag=o,r}return null}}Bv.prototype.reset=function(e){return this.node=e||this.start,this},Bv.prototype.revisit=function(e){return this._revisit=null==e||e,this},Bv.prototype.opening=function(){return 1==this.node.nodeType&&(this.closingTag=!1),this},Bv.prototype.atOpening=function(){return!this.closingTag},Bv.prototype.closing=function(){return 1==this.node.nodeType&&(this.closingTag=!0),this},Bv.prototype.atClosing=function(){return this.closingTag},Bv.prototype.next=Iv("nextSibling","firstChild"),Bv.prototype.previous=Bv.prototype.prev=Iv("previousSibling","lastChild"),Bv.prototype.select=function(e){return e=this.compile(e),this._selects.push(e),this},Bv.prototype.selects=function(e,t){var n=this._selects,r=n.length;if(!r)return!0;for(var o=0;o<r;o++)if(n[o].call(this,e,t))return!0;return!1},Bv.prototype.reject=function(e){return e=this.compile(e),this._rejects.push(e),this},Bv.prototype.rejects=function(e,t){var n=this._rejects,r=n.length;if(!r)return!0;for(var o=0;o<r;o++)if(n[o].call(this,e,t))return!1;return!0},Bv.prototype.higher=function(e){var t=this.root;if(!t)return!1;for(e=e.parentNode;e&&e!=t;)e=e.parentNode;return e!=t},Bv.prototype.compile=function(t){switch(Ve(t)){case"number":return function(e){return t==e.nodeType};case"string":return new Function("node","return "+Tv(t,"node."));case"function":return t;default:return function(){return!0}}},Bv.prototype.peak=Bv.prototype.peek=function(e,t){return 1==arguments.length&&(t=e,e=!0),(t=null==t?1:t)?0<t?this.next(e,t,!0):this.prev(e,Math.abs(t),!0):this.node},Bv.prototype.use=function(e){return e(this),this};var Av=window.getSelection();function Nv(e){Av.removeAllRanges(),Av.addRange(e)}function Lv(e,t){Nv(function(e,t){var n,r=t.start,o=t.end,i=document.createRange(),a=Mv(e.firstChild,e),c=a.node,u=!1,s=0;for(;c;){if(s===r&&(u?i.setStartAfter(c):i.setStartBefore(c)),s===o)return u?i.setEndAfter(c):i.setEndBefore(c),i;if(u||(zv(c)||c.previousSibling&&(Fv(c)||Uv(c)))&&s++,Vv(c)){if(n=c.textContent.length,s<=r&&r<s+n&&i.setStart(c,r-s),o<s+n)return i.setEnd(c,o-s),i;s+=n}c=a.next(),u=a.closingTag}s<=r&&(e.lastChild?i.setStartAfter(e.lastChild):i.setStart(e,0));e.lastChild?i.setEndAfter(e.lastChild):i.setEnd(e,0);return i}(e,t))}function $v(e){if(!function(e){if(Av.rangeCount){var t=Av.focusNode;return e==(t=Vv(t)?t.parentNode:t)||e.contains(t)}}(e))return null;var t,n,r=Av.getRangeAt(0),o=r.startContainer,i=r.endContainer,a=r.startOffset,c=r.endOffset,u=Mv(e.firstChild,e),s=u.node,l=!1,p=0;function f(e,t){return 1===arguments.length&&(t=e),e.parentNode===i&&t==i.childNodes[c]}function d(e,t){return 1===arguments.length&&(t=e),e.parentNode===o&&t==o.childNodes[a]}for(;s&&(d(s)&&(n=p),!f(s));){if(l||(zv(s)||t&&t.nextSibling==s&&(Fv(s)||Uv(s)))&&p++,Vv(s)){if(o===s&&(n=p+a),i===s){p+=c;break}p+=s.textContent.length}if((Vv(s)||l)&&(d(s,s.nextSibling)&&(n=p),f(s,s.nextSibling)))break;t=s,s=u.next(),l=u.closingTag}return{start:void 0===n?p:n,end:p}}function Vv(e){return 3===e.nodeType}function zv(e){return 1===e.nodeType&&"BR"===e.nodeName}function Fv(e){return 1===e.nodeType&&"DIV"===e.nodeName}function Uv(e){return 1===e.nodeType&&"P"===e.nodeName}function Hv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Wv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wv(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var qv="[contenteditable]",Gv="[data-element-id]";function Kv(e){return e.getAttribute("data-element-id")}function Xv(e,t){return Dt('[data-element-id="'.concat(xc(e),'"]'),t)}function Yv(e){return xt(e,Gv,!0)}function Zv(e){var t=qv;return wt(e,t)?e:Dt(t,e)}var Qv={above:!0,below:!0,right:!0,left:!0};function Jv(e,n,t,r,o){var i=e.container,a=null;function c(e,t){n.fire("selection."+e+".changed",t),n.fire("cellSelection.changed",{elementId:e,selection:t})}function u(e,t){t=!(1<arguments.length&&void 0!==t)||t;a!==e&&c(a,{selected:!1,focussed:!1}),(a=e)&&c(e,{selected:!0,focussed:t}),e?r.select(e):r.deselect()}n.on("cell.click",500,function(e){var t=e.target;xt(t,".no-deselect",!0)||u((t=Yv(t))&&Kv(t),!e.defaultPrevented)}),n.on("cell.focusin",500,function(e){var t=Kv(e.target),n=!e.defaultPrevented;return e.stopPropagation(),u(t,n)}),n.on("cell.focusout",500,function(e){c(Kv(e.target),{focussed:!1})}),n.on("cellSelection.changed",function(e){var t,n,r=e.elementId,e=e.selection,r=Xv(r,i);e.focussed&&r&&(n=Zv(t=r))&&document.body.contains(n)&&document.activeElement!==n&&(n.focus(),(t=$v(n))&&0!==t.end||Lv(n,{start:5e3,end:5e3}))}),n.on("selection.changed",function(e){var t=e.selection,n=e.oldSelection,e=t&&t.id,n=n&&n.id;e&&e!==a?u(t.id):n&&n===a&&u()}),this.isCellSelected=function(){return!!a},this.getCellSelection=function(){return a},this.selectCell=function(e){if(a){if(!(e in Qv))throw new Error("direction must be any of { above, below, left, right }");var t=Xv(a,i),t=(t=(t=t).getAttribute("data-coords"))?{row:(t=Hv(t.split(":"),2))[0],col:t[1]}:null;if(!t)return!1;var t=function(e,t){var n=e.row,r=e.col;if("above"===t||"below"===t){var o=parseInt(n,10);return isNaN(o)?e:{col:r,row:"above"===t?o-1:o+1}}if("left"!==t&&"right"!==t)throw new Error("invalid direction <"+t+">");r=parseInt(r,10);if(isNaN(r))return e;return{row:n,col:"left"===t?r-1:r+1}}(t,e),e=(e=i,t="".concat((t=t).row,":").concat(t.col),Dt('[data-coords="'.concat(xc(t),'"]'),e));if(!e)return!1;e=Kv(e);return e&&u(e,{focussed:!0,selected:!0}),!0}},n.on("contextMenu.close",function(){if(a)return u(a)})}Jv.$inject=["config.renderer","eventBus","sheet","selection","elementRegistry"];var eg={__depends__:[kv,Cv],__init__:["cellSelection"],cellSelection:["type",Jv]};function tg(){}tg.prototype.get=function(){return this._data},tg.prototype.set=function(e){this._data=e},tg.prototype.clear=function(){var e=this._data;return delete this._data,e},tg.prototype.isEmpty=function(){return!this._data};zi={clipboard:["type",tg]};function ng(e){return(ng="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function rg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function og(e,t){return(og=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ig(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=ag(n);return function(e,t){{if(t&&("object"===ng(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,r?(e=ag(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function ag(e){return(ag=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}_o=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&og(e,t)}(o,zs);var e,t,n,r=ig(o);function o(e,t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,e))._sheet=t,e}return e=o,(t=[{key:"init",value:function(){var r=this;this.addRule("col.move",2e3,function(e){var t=e.col,n=e.index,e=r._sheet.getRoot().businessObject.input;return tn(t)?n<e.length:n>=e.length}),this.addRule("col.remove",2e3,function(e){var t=e.col,e=r._sheet.getRoot().cols;return!nn(t)||1<e.filter(nn).length}),this.addRule("paste",2e3,function(e){var t=e.data,e=e.target;if(!t||!e)return!1;t=t.root;return e instanceof hf?r.canPasteRows(t):e instanceof yf&&r.canPasteCols(t,e)})}},{key:"canPasteRows",value:function(e){var n=this._sheet.getRoot().cols;return j(e,function(e){return"row"===e.type&&(e.cells.length===n.length&&j(e.cells,function(e,t){return tn(n[t])?"dmn:UnaryTests"===e.businessObject.$type:"dmn:LiteralExpression"===e.businessObject.$type}))})}},{key:"canPasteCols",value:function(e,t){var n=this._sheet.getRoot().rows;return j(e,function(e){return"col"===e.type&&(e.cells.length===n.length&&(tn(t)?"dmn:InputClause"===e.businessObject.$type:"dmn:OutputClause"===e.businessObject.$type))})}}])&&rg(e.prototype,t),n&&rg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();_o.$inject=["eventBus","sheet"];fu={__depends__:[{__depends__:[uc]}],__init__:["decisionTableModelingRules"],decisionTableModelingRules:["type",_o]};function cg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var ug=function(){function r(e,t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this._clipboard=e,this._modeling=t,this._sheet=n}var e,t,n;return e=r,(t=[{key:"execute",value:function(e){var t=e.data;return e.oldData=this._clipboard.get(),this._clipboard.set(t),this._sheet.getRoot()}},{key:"postExecute",value:function(e){var t=this;e.elements.forEach(function(e){e instanceof hf?t._modeling.removeRow(e):e instanceof yf&&t._modeling.removeCol(e)})}},{key:"revert",value:function(e){e=e.oldData;return this._clipboard.set(e),this._sheet.getRoot()}}])&&cg(e.prototype,t),n&&cg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),r}();function sg(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function lg(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?sg(Object(n),!0).forEach(function(e){pg(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):sg(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function pg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fg(e){return function(e){if(Array.isArray(e))return dg(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return dg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dg(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}ug.$inject=["clipboard","modeling","sheet"];var hg=[function(e,t,n,r){t=lg(lg({},t),{},{type:function(e){if(e instanceof hf)return"row";if(e instanceof yf)return"col";if(e instanceof mf)return"cell";throw new Error("cannot deduce element type: #"+e.id)}(e)});(e instanceof hf||e instanceof yf)&&(e=r(e.cells,n),t.cells=e.root,n=e.descriptorCache);return{root:t,descriptorCache:n}},function(e,t,n){e=e.businessObject;if(!e)return{root:t,descriptorCache:n};n=function r(o,i){var e,t;var n=o.id;if(n&&(e=i.boCache||{},t=e[n]))return{root:t,descriptorCache:i};var a={$type:o.$type};n&&(a.id=n,e=lg(lg({},e),{},pg({},n,a)),i=lg(lg({},i),{},{boCache:e}));o.$descriptor.properties.forEach(function(e){var t,n=o[e.name];n&&((n=y(n)?n.map(function(e){e=r(e,i);return i=e.descriptorCache,e.root}):n).$type&&(t=r(n,i),i=t.descriptorCache,n=t.root),a[e.name]=n)});return{root:a,descriptorCache:i}}(e,n);return{root:lg(lg({},t),{},{businessObject:n.root}),descriptorCache:n.descriptorCache}}],yg=[function(e,t,n){var r=e.root.businessObject;if(!r)return{root:t,reviveCache:n};n=function r(e,o){var i=e.root;e=i.id;var a;if(e&&(a=o.boCache||{},t=a[e]))return{root:t,reviveCache:o};var c={};S(i).forEach(function(e){var t,n;i[e].$type?(n=r({root:i[e]},o),t=n.root,o=n.reviveCache,a=o.boCache||{}):t=y(i[e])?i[e].map(function(e){return n=r({root:e},o),o=n.reviveCache,a=o.boCache||{},n.root}):i[e],c[e]=t});var t=c.$type;delete c.$type;o._keepIds&&!o._model.ids.assigned(c.id)||delete c.id;var n=o._dmnFactory.create(t,c);x(c,function(e){e.$type&&(e.$parent=n),y(e)&&e.forEach(function(e){return e.$parent=n})});e&&(a=lg(lg({},a),{},pg({},e,n)),o=lg(lg({},o),{},{boCache:a}));return{root:n,reviveCache:o}}({root:r,descriptorCache:e.descriptorCache},n);return{root:lg(lg({},t),{},{businessObject:n.root}),reviveCache:n.reviveCache}},function(e,t,n,r){var o=e.root,i=e.descriptorCache,e=lg({},t);t.businessObject&&t.businessObject.id&&(e.id=t.businessObject.id);"row"!==o.type&&"col"!==o.type||(i=r({root:o.cells,descriptorCache:i},n),e.cells=i.root,n=i.reviveCache);var a=new(function(e){switch(e.type){case"row":return hf;case"cell":return mf;case"col":return yf;default:throw new Error("unknown element type: #"+e.type)}}(o))(e);a instanceof hf?a.cells.forEach(function(e){e.row=a}):a instanceof yf&&a.cells.forEach(function(e){e.col=a});return{root:a,reviveCache:n}}];function mg(e,t,n){return n=n||hg,t=t||{},y(e)?(o=n,O(e,function(e,t){var n=e.descriptorCache,r=e.root,e=vg(t,n,o),t=e.root,e=e.descriptorCache;return{root:[].concat(fg(r),[t]),descriptorCache:lg(lg({},n),e)}},{root:[],descriptorCache:t})):vg(e,t,n);var o}function vg(e,t,n){var r=e.id,o=t.elements||{},i=o[r];if(i)return{root:i,descriptorCache:t};var a,c,o=(a=e,e={id:r},c=n,o=lg(lg({},t),{},{elements:o}),O(c,function(e,t){return t(a,e.root,e.descriptorCache,u)},{root:e,descriptorCache:o}));function u(e,t){return mg(e,t,c)}return{root:o.root,descriptorCache:lg(lg({},o.descriptorCache),{},{elements:lg(lg({},o.descriptorCache.elements),{},pg({},r,o.root))})}}function gg(e,t,n){return n=n||yg,t=t||{},y(e.root)?(r=t,o=n,i=e.root,a=e.descriptorCache,O(i,function(e,t){var n=e.reviveCache,e=e.root,t=bg({root:t,descriptorCache:a},n,o),n=t.root,t=t.reviveCache;return{root:[].concat(fg(e),[n]),reviveCache:t}},{root:[],reviveCache:r})):bg(e,t,n);var r,o,i,a}function bg(e,t,n){var r=e.root.id,o=t.elements||{},i=o[r];if(i)return{root:i,reviveCache:t};var a,c,o=(a=e,e={id:r},c=n,o=lg(lg({},t),{},{elements:o}),O(c,function(e,t){return t(a,e.root,e.reviveCache,u)},{root:e,reviveCache:o}));function u(e,t){return gg(e,t,c)}return{root:o.root,reviveCache:lg(lg({},o.reviveCache),{},{elements:lg(lg({},o.reviveCache.elements),{},pg({},r,o.root))})}}function _g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var wg=function(){function u(e,t,n,r,o,i,a,c){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),this._clipboard=e,this._dmnFactory=t,this._elementFactory=n,this._elementRegistry=r,this._eventBus=o,this._model=i,this._modeling=a,this._sheet=c}var e,t,n;return e=u,(t=[{key:"postExecute",value:function(e){var t=this,n=e.element,r=e.after,o=this._clipboard.get();if(!o)throw new Error("missing clipboard data");var i=this._sheet.getRoot(),o=gg(o.elements,{_dmnFactory:this._dmnFactory,_keepIds:o.keepIds,_model:this._model}).root;if(n instanceof hf){var a=i.rows.indexOf(n);if(-1===a)return;o.forEach(function(e){r&&a++,t._modeling.addRow(e,a)})}else if(n instanceof yf){var c=i.cols.indexOf(n);if(-1===c)return;o.forEach(function(e){r&&c++,t._modeling.addCol(e,c)})}return e.oldElements=this._clipboard.get(),this._sheet.getRoot()}},{key:"revert",value:function(e){}}])&&_g(e.prototype,t),n&&_g(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}();function xg(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function Og(r){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?xg(Object(o),!0).forEach(function(e){var t,n;t=r,e=o[n=e],n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):xg(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))})}return r}function jg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}wg.$inject=["clipboard","dmnFactory","elementFactory","elementRegistry","eventBus","moddle","modeling","sheet"];hr=function(){function a(e,t,n,r,o,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),this._clipboard=e,this._commandStack=t,this._eventBus=n,this._modeling=r,this._sheet=o,this._rules=i,t.registerHandler("cut",ug),t.registerHandler("paste",wg)}var e,t,n;return e=a,(t=[{key:"copy",value:function(e){e={elements:mg(e=!y(e)?[e]:e)};this._eventBus.fire("copyCutPaste.copy",{data:e}),this._clipboard.set(e)}},{key:"cut",value:function(e){var t={elements:mg(e=!y(e)?[e]:e),keepIds:!0},e={elements:e,data:t};this._eventBus.fire("copyCutPaste.cut",{data:t}),this._commandStack.execute("cut",e)}},{key:"pasteBefore",value:function(e){return this._paste(e,{before:!0})}},{key:"pasteAfter",value:function(e){return this._paste(e,{after:!0})}},{key:"_paste",value:function(e,t){var n=this._clipboard.get();if(n)return!!this._rules.allowed("paste",{data:n.elements,target:e})&&(this._commandStack.execute("paste",Og({element:e},t)),this._clipboard.clear(),!0)}},{key:"pasteAt",value:function(e){}}])&&jg(e.prototype,t),n&&jg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),a}();hr.$inject=["clipboard","commandStack","eventBus","modeling","sheet","rules"];var Eg={__depends__:[zi,fu],__init__:["copyCutPaste"],copyCutPaste:["type",hr]};function Cg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Sg(e,t,n){return t&&Cg(e.prototype,t),n&&Cg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}Si=Sg(function e(t,n,r,o,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var c={addRule:function(){return r.addRow({type:"dmn:DecisionRule"})},addRuleAbove:function(e){if((e=e&&e.rule)||o.hasSelection()){e=e||o.get().row,e=a.getRoot().rows.indexOf(e);if(-1!==e)return r.addRow({type:"dmn:DecisionRule"},e)}},addRuleBelow:function(e){if((e=e&&e.rule)||o.hasSelection()){e=e||o.get().row,e=a.getRoot().rows.indexOf(e);if(-1!==e)return r.addRow({type:"dmn:DecisionRule"},e+1)}},removeRule:function(e){e=e&&e.rule;(e||o.hasSelection())&&(e=e||o.get().row,r.removeRow(e))},addInput:function(){var e=a.getRoot().businessObject.input;return r.addCol({type:"dmn:InputClause"},e?e.length:0)},addInputLeft:function(e){if((e=e&&e.input)||o.hasSelection()){e=e||o.get().col,e=a.getRoot().cols.indexOf(e);if(-1!==e)return r.addCol({type:"dmn:InputClause"},e)}},addInputRight:function(e){if((e=e&&e.input)||o.hasSelection()){e=e||o.get().col,e=a.getRoot().cols.indexOf(e);if(-1!==e)return r.addCol({type:"dmn:InputClause"},e+1)}},removeInput:function(e){e=e&&e.input;(e||o.hasSelection())&&(e=e||o.get().col,r.removeCol(e))},addOutput:function(){var e=a.getRoot().businessObject,t=e.get("input"),e=e.get("output");return r.addCol({type:"dmn:OutputClause"},t.length+e.length)},addOutputLeft:function(e){if((e=e&&e.output)||o.hasSelection()){e=e||o.get().col,e=a.getRoot().cols.indexOf(e);if(-1!==e)return r.addCol({type:"dmn:OutputClause"},e)}},addOutputRight:function(e){if((e=e&&e.output)||o.hasSelection()){e=e||o.get().col,e=a.getRoot().cols.indexOf(e);if(-1!==e)return r.addCol({type:"dmn:OutputClause"},e+1)}},removeOutput:function(e){e=e&&e.output;(e||o.hasSelection())&&(e=e||o.get().col,r.removeCol(e))},addClause:function(){if(o.hasSelection()){var e=o.get().col;return en(e,"dmn:InputClause")?c.addInput({input:e}):en(e,"dmn:OutputClause")?c.addOutput({output:e}):void 0}},addClauseLeft:function(){if(o.hasSelection()){var e=o.get().col;return en(e,"dmn:InputClause")?c.addInputLeft({input:e}):en(e,"dmn:OutputClause")?c.addOutputLeft({output:e}):void 0}},addClauseRight:function(){if(o.hasSelection()){var e=o.get().col;return en(e,"dmn:InputClause")?c.addInputRight({input:e}):en(e,"dmn:OutputClause")?c.addOutputRight({output:e}):void 0}},removeClause:function(){if(o.hasSelection()){var e=o.get().col;return en(e,"dmn:InputClause")?c.removeInput({input:e}):en(e,"dmn:OutputClause")?c.removeOutput({output:e}):void 0}},selectCellAbove:function(){return i.selectCell("above")},selectCellBelow:function(){return i.selectCell("below")},copy:function(e){e=e.element;t.copy(e)},cut:function(e){e=e.element;t.cut(e)},pasteBefore:function(e){e=e.element;return t.pasteBefore(e)},pasteAfter:function(e){e=e.element;return t.pasteAfter(e)}};n.register(c)});function Pg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Si.$inject=["copyCutPaste","editorActions","modeling","selection","cellSelection","sheet"];var kg="is not a registered action",ju=function(){function o(e,t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this._actions={undo:function(){e.undo()},redo:function(){e.redo()},select:function(e){e=e.cell;r.select(e)},deselect:function(){r.deselect()},addRow:function(e){var t=e.attrs,e=e.index;n.addRow(t,e)},removeRow:function(e){e=e.row;n.removeRow(e)},moveRow:function(e){var t=e.row,e=e.index;n.moveRow(t,e)},addCol:function(e){var t=e.attrs,e=e.index;n.addCol(t,e)},removeCol:function(e){e=e.col;n.removeCol(e)},moveCol:function(e){var t=e.col,e=e.index;n.moveCol(t,e)}}}var e,t,n;return e=o,(t=[{key:"trigger",value:function(e,t){if(!this._actions[e])throw Rg(e,kg);return this._actions[e](t)}},{key:"register",value:function(e,t){var n=this;if("string"==typeof e)return this._registerAction(e,t);x(e,function(e,t){n._registerAction(t,e)})}},{key:"_registerAction",value:function(e,t){if(this.isRegistered(e))throw Rg(e,"is already registered");this._actions[e]=t}},{key:"unregister",value:function(e){if(!this.isRegistered(e))throw Rg(e,kg);this._actions[e]=void 0}},{key:"isRegistered",value:function(e){return!!this._actions[e]}}])&&Pg(e.prototype,t),n&&Pg(e,n),o}();function Rg(e,t){return new Error(e+" "+t)}ju.$inject=["commandStack","eventBus","modeling","selection"];var Tg={__depends__:[Cv],__init__:["editorActions"],editorActions:["type",ju]},Dg={__depends__:[eg,Eg,Tg,Cv],__init__:["decisionTableEditorActions"],decisionTableEditorActions:["type",Si]},Mg={__depends__:[Dg],__init__:["addRule"],addRule:["type",oc]},Bg=/["'&<>]/,Ig=function(e){var t,n=""+e,e=Bg.exec(n);if(!e)return n;var r="",o=0,i=0;for(o=e.index;o<n.length;o++){switch(n.charCodeAt(o)){case 34:t="&quot;";break;case 38:t="&amp;";break;case 39:t="&#39;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}i!==o&&(r+=n.substring(i,o)),i=o+1,r+=t}return i!==o?r+n.substring(i,o):r};var Ag=function(e,t,n){var r=o=e.start,e=n.length-t.length,o=(n.length,t.length,t.substring(o));return n.lastIndexOf(o)===n.length-o.length&&(t=t.substring(0,t.length-o.length),n=n.substring(0,n.length-o.length)),Ng(r=(e=function(e,t){var n,r,o,i,a,c=0,u=0;i=t.length>e.length?(r=t,e):(r=e,t);for(;c<r.length;)o=r.charAt(c),a=i.charAt(u),o!==a?n=n||{l_start:c,s_start:u}:(n&&!n.complete&&(n.l_end=c,n.s_end=u,n.complete=!0),u++),c++;n&&!n.complete&&(n.complete=!0,n.s_end=i.length,n.l_end=r.length);if(n)return t.length>e.length?{newStart:n.l_start,newEnd:n.l_end,type:"add"}:{newStart:n.s_start,newEnd:n.s_end,type:t.length<e.length?"remove":"replace"}}(t,n))?"remove"===e.type?e.newStart:e.newEnd:r)};function Ng(e,t){return{start:e,end:void 0===t?e:t}}function Lg(e){return(Lg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Vg(e,t){return(Vg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function zg(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=Ug(n);return function(e,t){{if(t&&("object"===Lg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return Fg(e)}(this,r?(e=Ug(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function Fg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ug(e){return(Ug=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Hg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Ag.range=Ng;var Wg=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vg(e,t)}(i,rh);var e,t,n,o=zg(i);function i(e,t){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),Hg(Fg(r=o.call(this,e,t)),"onFocus",function(e){var t=r.props.onFocus;r.setState({focussed:!0}),"function"==typeof t&&t(e)}),Hg(Fg(r),"onBlur",function(e){var t=r.props.onBlur;r.setState({focussed:!1}),"function"==typeof t&&t(e)}),Hg(Fg(r),"onKeydown",function(e){var t,n;13===e.which&&(e.preventDefault(),r.props.ctrlForNewline&&!(n=e).metaKey&&!n.ctrlKey||r.props.singleLine||(e.stopPropagation(),(t=Av.getRangeAt(0))&&(n=t.cloneRange(),t=document.createElement("br"),n.deleteContents(),n.insertNode(t),n.setStartAfter(t),n.setEndAfter(t),Nv(n)),r.onInput(e)))}),Hg(Fg(r),"onInput",function(e){var t=r.props.onInput;"function"==typeof t&&t(qg(r.node))}),Hg(Fg(r),"onKeyPress",function(e){r.onInputIEPolyfill&&r.onInputIEPolyfill(e)}),Hg(Fg(r),"onPaste",function(e){var t;r.onInputIEPolyfill&&r.onInputIEPolyfill(e),r.props.singleLine&&(t=(e.clipboardData||window.clipboardData).getData("text"),document.execCommand("insertText",!1,t.replace(/\n/g," ")),e.preventDefault())}),r.state={},(0<(t=window.navigator.userAgent).indexOf("MSIE ")||0<t.indexOf("Trident/"))&&(r.onInputIEPolyfill=function(t){var n=r.node.innerHTML;setTimeout(function(){var e=r.node.innerHTML;n!==e&&r.onInput(t)},0)}),r}return e=i,(t=[{key:"componentWillUpdate",value:function(e,t){var n=this.node,t=t.focussed&&$v(n);this.selected=t&&{range:t,text:qg(n)}}},{key:"componentDidUpdate",value:function(){var e,t,n=this.selected;n&&(e=n.range,t=n.text,Lv(n=this.node,(n=qg(n))!==t?Ag(e,t,n):e))}},{key:"getClassName",value:function(){var e=this.props,t=e.className,n=e.placeholder;return[t||"","content-editable",!e.value&&n?"content-editable--with-placeholder":""].join(" ")}},{key:"render",value:function(e){var t=this,n=e.value,e=e.placeholder,n=Ig(n).replace(/\r?\n/g,"<br/>")+"<br/>";return Hf(1,"div",this.getClassName(),null,1,{contentEditable:"true",spellcheck:"false","data-placeholder":e||"",onInput:this.onInput,onKeypress:this.onKeypress,onPaste:this.onPaste,onFocus:this.onFocus,onBlur:this.onBlur,onKeydown:this.onKeydown,dangerouslySetInnerHTML:{__html:n}},null,function(e){return t.node=e})}}])&&$g(e.prototype,t),n&&$g(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function qg(e){return e.innerText.replace(/\n$/,"")}function Gg(e){return(Gg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Kg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Xg(e,t){return(Xg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Yg(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=Qg(n);return function(e,t){{if(t&&("object"===Gg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return Zg(e)}(this,r?(e=Qg(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function Zg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qg(e){return(Qg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Jg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var eb=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xg(e,t)}(o,rh);var e,t,n,r=Yg(o);function o(e,t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),Jg(Zg(n=r.call(this,e,t)),"onFocus",function(e){n.setState({focussed:!0});var t=n.props.onFocus;"function"==typeof t&&t(e)}),Jg(Zg(n),"onBlur",function(e){n.setState({focussed:!1}),n.state.invalid&&n.setState({changing:!1,invalid:!1});var t=n.props.onBlur;"function"==typeof t&&t(e)}),n.state={changing:!1,focussed:!1};t=t.injector.get("debounceInput");return n.inputChanged=t(function(e){var t=n.props.onChange;"function"==typeof t&&t(e);t=n.state.changing;n.setState({changing:t!==e&&t})}),n.onInput=function(e){var t=(n.props.validate||function(){})(e);n.setState({changing:e,invalid:t}),t||n.inputChanged(e)},n}return e=o,(t=[{key:"getClassName",value:function(){var e=this.props,t=e.className,n=e.value,r=this.state,e=r.changing;return t+=" editable",r.focussed&&(t+=" focussed"),r.invalid&&(t+=" invalid"),n||e||(t+=" empty"),t}},{key:"getDisplayValue",value:function(){var e=this.props,t=e.value,n=e.placeholder,r=this.state,e=r.focussed,r=r.changing;return t=(t="string"==typeof r?r:t)||(!e&&n||"")}},{key:"getEditor",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return Wf(2,Wg,{className:e.className,ctrlForNewline:e.ctrlForNewline,onFocus:this.onFocus,onBlur:this.onBlur,onInput:this.onInput,value:this.getDisplayValue()})}}])&&Kg(e.prototype,t),n&&Kg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function tb(e){return(tb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ob(e,t,n){return t&&rb(e.prototype,t),n&&rb(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ib(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ab(e,t)}function ab(e,t){return(ab=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function cb(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=sb(n);return function(e,t){{if(t&&("object"===tb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return ub(e)}(this,r?(e=sb(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function ub(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sb(e){return(sb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function lb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pb=function(){ib(o,rh);var r=cb(o);function o(e,t){var n;return nb(this,o),lb(ub(n=r.call(this,e,t)),"onElementsChanged",function(){n.forceUpdate()}),lb(ub(n),"setAnnotationValue",function(e){var t=n.props.row;n.modeling.editAnnotation(t.businessObject,e)}),Rh(ub(n)),n}return ob(o,[{key:"componentWillMount",value:function(){var e=this.props.row;this.changeSupport.onElementsChanged(e.id,this.onElementsChanged)}},{key:"componentWillUnmount",value:function(){var e=this.props.row;this.changeSupport.offElementsChanged(e.id,this.onElementsChanged)}},{key:"render",value:function(){var e=this.props,t=e.row,n=e.rowIndex,r=t.businessObject,e=r.description,r=r.id;return Wf(2,Yh,{className:"annotation",onChange:this.setAnnotationValue,coords:"".concat(n,":annotation"),value:e,elementId:r,"data-row-id":t.id,children:Wf(2,fb,{ctrlForNewline:!0,className:"annotation-editor",onChange:this.setAnnotationValue,value:e})})}}]),o}();pb.$inject=["changeSupport","modeling"];var fb=function(){ib(t,eb);var e=cb(t);function t(){return nb(this,t),e.apply(this,arguments)}return ob(t,[{key:"render",value:function(){return Hf(1,"div",this.getClassName(),this.getEditor(),0)}}]),t}();function db(e){e.onGetComponent("cell",function(e){e=e.cellType;return"after-label-cells"===e?sy:"after-rule-cells"===e?pb:void 0})}db.$inject=["components"];function hb(t){return function(e){return!1===t?e:I(e,h(t)?t:300)}}hb.$inject=["config.debounceInput"];var Ni={debounceInput:["factory",hb]},yb={__depends__:[Ni],__init__:["annotationsProvider"],annotationsProvider:["type",db]};function mb(e){return(mb="function"==typeof Symbol&&"symbol"===Ve(Symbol.iterator)?function(e){return Ve(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":Ve(e)})(e)}function vb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function bb(e,t,n){return t&&gb(e.prototype,t),n&&gb(e,n),e}function _b(e,t){return!t||"object"!==mb(t)&&"function"!=typeof t?xb(e):t}function wb(e){return(wb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function xb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ob(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&jb(e,t)}function jb(e,t){return(jb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Eb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Cb={position:"absolute"},Sb=function(){function r(e,t){var n;return vb(this,r),Eb(xb(n=_b(this,wb(r).call(this,e,t))),"open",function(e){var t=e.position,e=e.context;n.close(),n.setState({isOpen:!0,position:t||{x:0,y:0},context:e||{}})}),Eb(xb(n),"close",function(){n.state.isOpen&&n.setState({context:void 0,isOpen:!1,position:{x:0,y:0}})}),Eb(xb(n),"triggerClose",function(){n.eventBus.fire("contextMenu.close")}),n.state={isOpen:!1,position:{x:0,y:0}},Rh(xb(n)),n}return Ob(r,rh),bb(r,[{key:"componentDidMount",value:function(){this.eventBus.on("contextMenu.open",this.open),this.eventBus.on("contextMenu.close",this.close)}},{key:"componentWillUnmount",value:function(){this.eventBus.off("contextMenu.open",this.open),this.eventBus.off("contextMenu.close",this.close)}},{key:"render",value:function(){var e=this.state,t=e.isOpen,n=e.context,e=e.position;if(!t)return null;t=this.components.getComponents("context-menu",n);return t.length?Wf(2,Pb,{className:"context-menu no-deselect",context:n,position:e,offset:n.offset||{x:0,y:0},autoFocus:!1!==n.autoFocus,autoClose:!1!==n.autoClose,components:t,onClose:this.triggerClose}):null}}]),r}();Sb.$inject=["eventBus","components"];var Pb=function(){function r(e,t){var n;return vb(this,r),Eb(xb(n=_b(this,wb(r).call(this,e,t))),"onGlobalMouseDown",function(e){n.checkClose(e.target)}),Eb(xb(n),"onGlobalKey",function(e){var t=e.which;13!==t&&27!==t||(e.stopPropagation(),e.preventDefault(),n.close())}),Eb(xb(n),"onFocusChanged",function(e){n.checkClose(e.target)}),Eb(xb(n),"setNode",function(e){n.node=e;var t=n.props.autoFocus;e&&(n.updatePosition(),t&&function(e){e=Dt(Rb,e);e&&(e.focus(),e.selectionStart&&"text"===e.type?e.selectionStart=1e5:"contentEditable"in e&&Lv(e,{start:1e5,end:1e5}))}(e))}),Rh(xb(n)),n}return Ob(r,rh),bb(r,[{key:"close",value:function(){var e=this.props.onClose;m(e)&&e()}},{key:"checkClose",value:function(e){var t;!this.props.autoClose||(t=this.node)&&t!==e&&(t.contains(e)||this.close())}},{key:"componentDidMount",value:function(){document.addEventListener("focusin",this.onFocusChanged),document.addEventListener("keydown",this.onGlobalKey),document.addEventListener("mousedown",this.onGlobalMouseDown)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("focusin",this.onFocusChanged),document.removeEventListener("keydown",this.onGlobalKey),document.removeEventListener("mousedown",this.onGlobalMouseDown)}},{key:"updatePosition",value:function(){var e=this.props,t=e.position,n=e.offset,r=this.node,o=r.getBoundingClientRect();t.width||(t.width=0),t.height||(t.height=0);var i=this.renderer.getContainer().getBoundingClientRect();i.width>i.height?(this.node.classList.add("horizontal"),this.node.classList.remove("vertical")):(this.node.classList.add("vertical"),this.node.classList.remove("horizontal"));var a,c,u,s=function(e){var t=xt(e,".tjs-container");if(!t)return{scrollTop:0,scrollLeft:0};e=t.scrollLeft;return{scrollTop:t.scrollTop,scrollLeft:e}}(r),l=s.scrollLeft,e=s.scrollTop,s={};"left"===((a=t.align?t.align.split("-"):a)&&a[1]||(t.x+t.width/2>i.width/2?"left":"right"))?(c=t.x-i.left-o.width+n.x+l,r.classList.remove("right"),r.classList.add("left")):(c=-i.left+t.x+t.width-n.x+l,r.classList.remove("left"),r.classList.add("right")),c=a?c:kb(c,0+l,i.width-o.width+l),s.left=c+"px","top"===(a&&a[0]||(t.y+t.height/2>i.height/2?"top":"bottom"))?(u=t.y-i.top-o.height+n.y+e,r.classList.remove("bottom"),r.classList.add("top")):(u=-i.top+t.y-n.y+e,r.classList.remove("top"),r.classList.add("bottom")),u=a?u:kb(u,0+e,i.height-o.height+e),s.top=u+"px",s.overflowY="auto",s.maxHeight=i.height-u+e+"px",L(this.node.style,Cb,s)}},{key:"render",value:function(){var e=this.props,n=e.context,t=e.components;return Hf(1,"div",e.className,t.map(function(e,t){return Wf(2,e,{context:n},t)}),0,{onContextMenu:function(e){return e.preventDefault()}},null,this.setNode)}}]),r}();function kb(e,t,n){return Math.max(t,Math.min(n,e))}Pb.$inject=["renderer"];var Rb="\n  input[type=text],\n  input[type=number],\n  input[type=button],\n  input[type=submit],\n  [contenteditable],\n  [tabindex],\n  a[href],\n  textarea,\n  button\n";function Tb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}uc=function(){function r(e,t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this._eventBus=t,e.onGetComponent("table.before",function(){return Sb})}var e,t,n;return e=r,(t=[{key:"open",value:function(e,t){this._eventBus.fire("contextMenu.open",{position:e,context:t})}},{key:"close",value:function(){this._eventBus.fire("contextMenu.close")}}])&&Tb(e.prototype,t),n&&Tb(e,n),r}();uc.$inject=["components","eventBus","renderer"];var Db={__init__:["contextMenu"],contextMenu:["type",uc]};function Mb(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function Bb(e){return e.shiftKey}function Ib(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ab(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}_o=function(){function u(e,t,n,r,o,i,a){var c=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),Ab(this,"_clearClipboard",function(){c._clipboard.clear()}),Ab(this,"_registerBindings",function(){[function(e,t){if(Mb(t)&&67===e){e=c._getSelectedCell();if(e)return Bb(t)?c._editorActions.trigger("copy",{element:e.col}):c._editorActions.trigger("copy",{element:e.row}),!0}},function(e,t){if(Mb(t)&&88===e){e=c._getSelectedCell();if(e)return Bb(t)?c._editorActions.trigger("cut",{element:e.col}):c._editorActions.trigger("cut",{element:e.row}),!0}},function(e,t){var n;if(Mb(t)&&86===e){e=c._getSelectedCell();if(!e)return;Bb(t)?(n=c._editorActions.trigger("pasteAfter",{element:e.col}))&&c._cellSelection.selectCell("right"):(n=c._editorActions.trigger("pasteAfter",{element:e.row}))&&c._cellSelection.selectCell("below")}return void 0!==n}].forEach(function(e){c._keyboard.addListener(e)})}),this._clipboard=n,this._cellSelection=r,this._elementRegistry=o,this._editorActions=i,this._keyboard=e.get("keyboard",!1),this._renderer=a,this._keyboard&&(t.on("keyboard.init",this._registerBindings),t.on("keyboard.bind",function(){Ct.bind(document,"copy",c._clearClipboard,!0),Ct.bind(document,"cut",c._clearClipboard,!0)}),t.on("keyboard.unbind",function(){Ct.unbind(document,"copy",c._clearClipboard,!0),Ct.unbind(document,"cut",c._clearClipboard,!0)}))}var e,t,n;return e=u,(t=[{key:"_getSelectedCell",value:function(){var e=this._cellSelection.getCellSelection();if(e){var t=this._elementRegistry.get(e);if(t){var n=Xv(e,this._renderer.getContainer()),e=Zv(n);if(document.activeElement===e){n=$v(n);if(!n||n.start===n.end)return t}}}}}])&&Ib(e.prototype,t),n&&Ib(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}();_o.$inject=["injector","eventBus","clipboard","cellSelection","elementRegistry","editorActions","renderer"];var Nb={__depends__:[zi,eg],__init__:["copyCutPasteKeyBindings"],copyCutPasteKeyBindings:["type",_o]};function Lb(e){return(Lb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Vb(e,t){return(Vb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function zb(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=Ub(n);return function(e,t){{if(t&&("object"===Lb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return Fb(e)}(this,r?(e=Ub(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function Fb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ub(e){return(Ub=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Hb=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vb(e,t)}(i,rh);var e,t,n,o=zb(i);function i(e,t){var n,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),n=o.call(this,e,t),r=Fb(n),e=function(e){n.editorActions.trigger("addInput")},(t="onClick")in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,Rh(Fb(n)),n}return e=i,(t=[{key:"render",value:function(){return Hf(1,"th","input-cell create-inputs header actionable",[this.translate("Input"),qf(" "),Hf(1,"span","add-input dmn-icon-plus action-icon",null,1,{title:this.translate("Add Input")})],0,{onClick:this.onClick,title:this.translate("Add Input")})}}])&&$b(e.prototype,t),n&&$b(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function Wb(e){return(Wb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Gb(e,t){return(Gb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Kb(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=Yb(n);return function(e,t){{if(t&&("object"===Wb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return Xb(e)}(this,r?(e=Yb(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function Xb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yb(e){return(Yb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Hb.$inject=["editorActions","translate"];var Zb=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gb(e,t)}(i,rh);var e,t,n,o=Kb(i);function i(e,t){var n,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),n=o.call(this,e,t),r=Xb(n),e=function(e){n.editorActions.trigger("addInput")},(t="onClick")in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,Rh(Xb(n)),n}return e=i,(t=[{key:"render",value:function(){return Hf(1,"td","input-cell create-inputs",qf("-"),2,{onClick:this.onClick,title:this.translate("Add Input")})}}])&&qb(e.prototype,t),n&&qb(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function Qb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Jb(e,t,n){return t&&Qb(e.prototype,t),n&&Qb(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}Zb.$inject=["editorActions","translate"];hr=Jb(function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("cell",500,function(e){var t=e.cellType,e=n.getRoot().businessObject;if(!e.input||!e.input.length)return"before-label-cells"===t?Hb:"before-rule-cells"===t?Zb:void 0})});hr.$inject=["components","sheet"];var e_={__depends__:[Dg],__init__:["createInputsProvider"],createInputsProvider:["type",hr]};function t_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var n_=["string","boolean","number","date","time","dateTime","dayTimeDuration","yearMonthDuration","Any"],ju=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this._dataTypes=e||n_}var e,n,r;return e=t,(n=[{key:"getAll",value:function(){return this._dataTypes}}])&&t_(e.prototype,n),r&&t_(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();ju.$inject=["config.dataTypes"];var r_={__init__:["dataTypes"],dataTypes:["type",ju]};function o_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Si=function(){function f(r,o,e,t,n,i,a,c,u,s,l){var p=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),this._contextMenu=o,this._clipboard=e,this._editorActions=t,this._elementRegistry=i,this._eventBus=n,this._modeling=a,this._selection=c,this._sheet=u,this._rules=s,this._translate=l,this._getEntries=this._getEntries.bind(this),r.onGetComponent("context-menu",function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(e.contextMenuType&&"context-menu"===e.contextMenuType){var t=p._getEntries(e),e=p._elementRegistry.get(e.id)instanceof mf&&r.getComponents("context-menu-cell-additional",e);if(e&&e.length){var n=Hf(1,"div","context-menu-group context-menu-group-cell",e,0);return function(){return Hf(1,"div","context-menu-flex",(t||[]).concat(n),0)}}return function(){return Hf(1,"div","context-menu-flex",t||[],0)}}}),n.on("cell.contextmenu",function(e){var t=e.event,n=e.id;e.node;t.preventDefault(),o.open({x:t.pageX,y:t.pageY},{contextMenuType:"context-menu",event:t,id:n})})}var e,t,n;return e=f,(t=[{key:"_getEntries",value:function(n){var r=this,e=function(e){var t=e.cells.map(function(e){return e.id}).indexOf(n.id),e=r._editorActions.trigger("addRuleAbove",{rule:e});e.cells[t]?r._selection.select(e.cells[t]):r._selection.select(e.cells[0]),r._contextMenu.close()},t=function(e){var t=e.cells.map(function(e){return e.id}).indexOf(n.id),e=r._editorActions.trigger("addRuleBelow",{rule:e});e.cells[t]?r._selection.select(e.cells[t]):r._selection.select(e.cells[0]),r._contextMenu.close()},o=function(e){r._editorActions.trigger("removeRule",{rule:e}),r._contextMenu.close()},i=function(e){r._editorActions.trigger("addInputLeft",{input:e}),r._contextMenu.close()},a=function(e){r._editorActions.trigger("addInputRight",{input:e}),r._contextMenu.close()},c=function(e){r._editorActions.trigger("removeInput",{input:e}),r._contextMenu.close()},u=function(e){r._editorActions.trigger("addOutputLeft",{output:e}),r._contextMenu.close()},s=function(e){r._editorActions.trigger("addOutputRight",{output:e}),r._contextMenu.close()},l=function(e){r._editorActions.trigger("removeOutput",{output:e}),r._contextMenu.close()},p=function(e){r._editorActions.trigger("copy",{element:e}),r._contextMenu.close()},f=function(e){r._editorActions.trigger("cut",{element:e}),r._contextMenu.close()},d=function(e){r._editorActions.trigger("pasteBefore",{element:e}),r._contextMenu.close()},h=function(e){r._editorActions.trigger("pasteAfter",{element:e}),r._contextMenu.close()},y=n&&n.id;if(!y)return null;var m=this._elementRegistry.get(y);if(!m)return null;var v,g,b,_,w=this._clipboard.get()||{},y=[],x=m.row||m;return en(x,"dmn:DecisionRule")?(g=this._rules.allowed("paste",{data:w.elements,target:x}),y.push(Hf(1,"div","context-menu-group",[Hf(1,"div","context-menu-group-entry context-menu-entry-copy-rule",this._translate("Copy Rule"),0,{onClick:function(){return p(x)}}),Hf(1,"div","context-menu-group-entry context-menu-entry-cut-rule",this._translate("Cut Rule"),0,{onClick:function(){return f(x)}}),Hf(1,"div","context-menu-group-entry ".concat(g?"":"disabled"," context-menu-entry-paste-rule-above"),this._translate("Paste Rule Above"),0,{onClick:function(){return d(x)}}),Hf(1,"div","context-menu-group-entry ".concat(g?"":"disabled"," context-menu-entry-paste-rule-below"),this._translate("Paste Rule Below"),0,{onClick:function(){return h(x)}})],4),Hf(1,"div","context-menu-group",[Hf(1,"div","context-menu-group-entry context-menu-entry-add-rule-above",this._translate("Add Rule Above"),0,{onClick:function(){return e(x)}}),Hf(1,"div","context-menu-group-entry context-menu-entry-add-rule-below",this._translate("Add Rule Below"),0,{onClick:function(){return t(x)}}),Hf(1,"div","context-menu-group-entry context-menu-entry-remove-rule",this._translate("Remove Rule"),0,{onClick:function(){return o(x)}})],4))):en(m,"dmn:InputClause")?(v=en(m,"dmn:InputClause")?m:m.col,_=this._rules.allowed("col.remove",{col:m.col||m}),g=this._rules.allowed("paste",{data:w.elements,target:m.col||m}),y.push(Hf(1,"div","context-menu-group",[Hf(1,"div","context-menu-group-entry context-menu-entry-copy-input",this._translate("Copy Input Column"),0,{onClick:function(){return p(v)}}),Hf(1,"div","context-menu-group-entry ".concat(_?"":"disabled"," context-menu-entry-cut-input"),this._translate("Cut Input Column"),0,{onClick:function(){return f(v)}}),Hf(1,"div","context-menu-group-entry ".concat(g?"":"disabled"," context-menu-entry-paste-input-left"),this._translate("Paste Input Column Left"),0,{onClick:function(){return d(v)}}),Hf(1,"div","context-menu-group-entry ".concat(g?"":"disabled"," context-menu-entry-paste-input-right"),this._translate("Paste Input Column Right"),0,{onClick:function(){return h(v)}})],4),Hf(1,"div","context-menu-group",[Hf(1,"div","context-menu-group-entry context-menu-entry-add-input-left",this._translate("Add Input Column Left"),0,{onClick:function(){return i(v)}}),Hf(1,"div","context-menu-group-entry context-menu-entry-add-input-right",this._translate("Add Input Column Right"),0,{onClick:function(){return a(v)}}),Hf(1,"div","context-menu-group-entry ".concat(_?"":"disabled"," context-menu-entry-remove-input"),this._translate("Remove Input Column"),0,{onClick:function(){return c(v)}})],4))):(en(m,"dmn:OutputClause")||en(m.col,"dmn:OutputClause"))&&(b=en(m,"dmn:OutputClause")?m:m.col,_=this._rules.allowed("col.remove",{col:m.col||m}),m=this._rules.allowed("paste",{data:w.elements,target:m.col||m}),y.push(Hf(1,"div","context-menu-group",[Hf(1,"div","context-menu-group-entry context-menu-entry-copy-output",this._translate("Copy Output Column"),0,{onClick:function(){return p(b)}}),Hf(1,"div","context-menu-group-entry ".concat(_?"":"disabled"," context-menu-entry-cut-output"),this._translate("Cut Output Column"),0,{onClick:function(){return f(b)}}),Hf(1,"div","context-menu-group-entry ".concat(m?"":"disabled"," context-menu-entry-paste-output-left"),this._translate("Paste Output Column Left"),0,{onClick:function(){return d(b)}}),Hf(1,"div","context-menu-group-entry ".concat(m?"":"disabled"," context-menu-entry-paste-output-right"),this._translate("Paste Output Column Right"),0,{onClick:function(){return h(b)}})],4),Hf(1,"div","context-menu-group",[Hf(1,"div","context-menu-group-entry context-menu-entry-add-output-left",this._translate("Add Output Column Left"),0,{onClick:function(){return u(b)}}),Hf(1,"div","context-menu-group-entry context-menu-entry-add-output-right",this._translate("Add Output Column Right"),0,{onClick:function(){return s(b)}}),Hf(1,"div","context-menu-group-entry ".concat(_?"":"disabled"," context-menu-entry-remove-output"),this._translate("Remove Output Column"),0,{onClick:function(){return l(b)}})],4))),y}}])&&o_(e.prototype,t),n&&o_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),f}();function i_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a_(e,t,n){return t&&i_(e.prototype,t),n&&i_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}Si.$inject=["components","contextMenu","clipboard","editorActions","eventBus","elementRegistry","modeling","selection","sheet","rules","translate"];var c_=["row.add","row.remove","col.add","col.remove"],oc=a_(function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n.on("commandStack.executed",function(e){e=e.command;-1!==c_.indexOf(e)&&t.close()}),n.on("commandStack.reverted",function(){t.close()})});oc.$inject=["contextMenu","eventBus"];var u_={__depends__:[Dg,Db,fu],__init__:["decisionTableContextMenu","contextMenuCloseBehavior"],decisionTableContextMenu:["type",Si],contextMenuCloseBehavior:["type",oc]};function s_(e){return(s_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p_(e,t){return(p_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f_(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=h_(n);return function(e,t){{if(t&&("object"===s_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return d_(e)}(this,r?(e=h_(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function d_(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h_(e){return(h_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y_(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m_=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p_(e,t)}(o,rh);var e,t,n,r=f_(o);function o(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),y_(d_(n=r.call(this,e,t)),"onClick",function(e){var t=n.props.output;n._eventBus.fire("output.edit",{event:e,output:t})}),y_(d_(n),"onContextmenu",function(e){var t=n.props.output.id;n._eventBus.fire("cell.contextmenu",{event:e,id:t})}),y_(d_(n),"onElementsChanged",function(){n.forceUpdate()}),Dh(d_(n),ny),n._translate=t.injector.get("translate"),n}return e=o,(t=[{key:"componentWillMount",value:function(){var e=this.context.injector;this._changeSupport=this.context.changeSupport,this._eventBus=e.get("eventBus"),this._elementRegistry=e.get("elementRegistry");e=this.props.output;this._changeSupport.onElementsChanged(e.id,this.onElementsChanged)}},{key:"componentWillUnmount",value:function(){var e=this.props.output;this._changeSupport.offElementsChanged(e.id,this.onElementsChanged)}},{key:"render",value:function(){var e=this.props,t=e.output,n=e.index,r=e.outputsLength,o=t.label,i=t.name,a=t.outputValues,c=t.typeRef,e=t.width?t.width+"px":"192px";return Hf(1,"th","output-cell output-editor",[this.slotFills({type:"cell-inner",context:{cellType:"output-cell",col:this._elementRegistry.get(t.id),index:n,outputsLength:r},col:t}),Hf(1,"div","clause",0===n?this._translate("Then"):this._translate("And"),0),o?Hf(1,"div","output-label",o,0,{title:this._translate("Output Label")}):Hf(1,"div","output-name",i,0,{title:this._translate("Output Name")}),Hf(1,"div","output-variable",a&&a.text||c,0,{title:a&&a.text?this._translate("Output Values"):this._translate("Output Type")})],0,{"data-col-id":t.id,onDblClick:this.onClick,onContextmenu:this.onContextmenu,style:{width:e}})}}])&&l_(e.prototype,t),n&&l_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function v_(e){return(v_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function b_(e,t){return(b_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function __(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=x_(n);return function(e,t){{if(t&&("object"===v_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return w_(e)}(this,r?(e=x_(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function w_(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x_(e){return(x_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function O_(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var j_=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b_(e,t)}(o,rh);var e,t,n,r=__(o);function o(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),O_(w_(n=r.call(this,e,t)),"onInput",function(e){var t=n.props.onInput;"function"==typeof t&&t(e.target.value)}),O_(w_(n),"onKeyDown",function(e){var t=n.props.onKeyDown;"function"==typeof t&&t(e)}),O_(w_(n),"onKeyUp",function(e){var t=n.props.onKeyUp;"function"==typeof t&&t(e)}),n}return e=o,(t=[{key:"render",value:function(){var e=this.props,t=e.className,n=e.placeholder,r=e.type,e=e.value;return Hf(64,"input",[t||"","dms-input"].join(" "),null,1,{placeholder:n||"",onInput:this.onInput,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,spellcheck:"false",type:r||"text",value:e})}}])&&g_(e.prototype,t),n&&g_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function E_(e){return(E_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function C_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function S_(e,t){return(S_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function P_(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=k_(n);return function(e,t){{if(t&&("object"===E_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,r?(e=k_(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function k_(e){return(k_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var R_=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&S_(e,t)}(o,rh);var e,t,n,r=P_(o);function o(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(n=r.call(this,e,t)).translate=t.injector?t.injector.get("translate"):T_,n.setName=function(e){n.handleChange({name:e=e||void 0})},n.setLabel=function(e){n.handleChange({label:e=e||void 0})},n}return e=o,(t=[{key:"handleChange",value:function(e){var t=this.props.onChange;"function"==typeof t&&t(e)}},{key:"render",value:function(){var e=this.props,t=e.name,e=e.label;return Hf(1,"div","context-menu-container ref-output-editor output-edit",[Hf(1,"div","dms-form-control",Wf(2,Wg,{className:"dms-output-label",value:e||"",placeholder:this.translate("Output"),singleLine:!0,onInput:this.setLabel}),2),Hf(1,"div","dms-form-control",[Hf(1,"label","dms-label",this.translate("Output Name"),0),Wf(2,j_,{className:"ref-output-name",value:t||"",onInput:this.setName})],4)],4)}}])&&C_(e.prototype,t),n&&C_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function T_(e){return e}function D_(e){return(D_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function M_(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function B_(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?M_(Object(n),!0).forEach(function(e){V_(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):M_(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function I_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function A_(e,t){return(A_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function N_(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=$_(n);return function(e,t){{if(t&&("object"===D_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return L_(e)}(this,r?(e=$_(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function L_(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $_(e){return($_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function V_(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var z_=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&A_(e,t)}(o,rh);var e,t,n,r=N_(o);function o(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),V_(L_(n=r.call(this,e,t)),"persistChanges",function(){var e=n.props.context.output,t=n.state.unsaved;t&&(n.modeling.updateProperties(e,t),n.setState({unsaved:!1}))}),V_(L_(n),"handleChange",function(e){n.setState({unsaved:B_(B_({},n.state.unsaved),e)},n.persistChanges)}),n.state={},Rh(L_(n)),n.persistChanges=n.debounceInput(n.persistChanges),n}return e=o,(t=[{key:"getValue",value:function(e){var t=this.props.context.output,n=this.state.unsaved;return n&&e in n?n[e]:t.get(e)}},{key:"render",value:function(){return Wf(2,R_,{name:this.getValue("name"),label:this.getValue("label"),onChange:this.handleChange})}}])&&I_(e.prototype,t),n&&I_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function F_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function U_(e,t,n){return t&&F_(e.prototype,t),n&&F_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}z_.$inject=["debounceInput","modeling"];uc=U_(function e(t,o,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("cell",function(e){if("output-header"===e.cellType)return m_}),t.onGetComponent("context-menu",function(){if("output-edit"===(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).contextMenuType)return z_}),n.on("output.edit",function(e){var t=e.event,n=e.output,r=xt(t.target,"th",!0),e=r.getBoundingClientRect(),t=e.left,e=e.top,r=function(e){if(!wt(e,".output-cell + .output-cell"))return{x:-1,y:0}}(r);o.open({x:t,y:e,align:"bottom-right"},{contextMenuType:"output-edit",output:n,offset:r})})});function H_(e){return(H_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function W_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function q_(e,t){return(q_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function G_(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=X_(n);return function(e,t){{if(t&&("object"===H_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return K_(e)}(this,r?(e=X_(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function K_(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function X_(e){return(X_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Y_(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}uc.$inject=["components","contextMenu","eventBus","renderer"];var Z_=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&q_(e,t)}(o,rh);var e,t,n,r=G_(o);function o(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),Y_(K_(n=r.call(this,e,t)),"onClick",function(e){var t=n.props.input;n._eventBus.fire("input.edit",{event:e,input:t})}),Y_(K_(n),"onContextmenu",function(e){var t=n.props.input.id;n._eventBus.fire("cell.contextmenu",{event:e,id:t})}),Y_(K_(n),"onElementsChanged",function(){n.forceUpdate()}),Dh(K_(n),ny),n._translate=t.injector.get("translate"),n}return e=o,(t=[{key:"componentWillMount",value:function(){var e=this.context.injector;this._changeSupport=this.context.changeSupport,this._sheet=e.get("sheet"),this._eventBus=e.get("eventBus"),this._elementRegistry=e.get("elementRegistry");var t=this._sheet.getRoot(),e=this.props.input;this._changeSupport.onElementsChanged(t.id,this.onElementsChanged),this._changeSupport.onElementsChanged(e.id,this.onElementsChanged)}},{key:"componentWillUnmount",value:function(){var e=this._sheet.getRoot(),t=this.props.input;this._changeSupport.offElementsChanged(e.id,this.onElementsChanged),this._changeSupport.offElementsChanged(t.id,this.onElementsChanged)}},{key:"render",value:function(){var e=this.props,t=e.input,n=e.index,r=e.inputsLength,o=t.inputExpression,i=t.inputValues,a=t.get("label"),e=t.width?t.width+"px":"192px";return Hf(1,"th","input-cell input-editor",[this.slotFills({type:"cell-inner",context:{cellType:"input-cell",col:this._elementRegistry.get(t.id),index:n,inputsLength:r},col:t}),Hf(1,"div","clause",0===n?this._translate("When"):this._translate("And"),0),a?Hf(1,"div","input-label",a,0,{title:this._translate("Input Label")}):Hf(1,"div","input-expression",o.text,0,{title:this._translate("Input Expression")}),Hf(1,"div","input-variable",i&&i.text||o.typeRef,0,{title:i&&i.text?this._translate("Input Values"):this._translate("Input Type")})],0,{"data-col-id":t.id,onDblClick:this.onClick,onContextmenu:this.onContextmenu,style:{width:e}})}}])&&W_(e.prototype,t),n&&W_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function Q_(e){return(Q_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function J_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ew(e,t){return(ew=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function tw(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=nw(n);return function(e,t){{if(t&&("object"===Q_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,r?(e=nw(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function nw(e){return(nw=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var rw=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ew(e,t)}(o,rh);var e,t,n,r=tw(o);function o(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(n=r.call(this,e,t)).translate=t.injector?t.injector.get("translate"):ow,n.handleValue=function(e){n.handleChange({text:e})},n.handleLabelChange=function(e){n.handleChange({label:e||void 0})},n}return e=o,(t=[{key:"handleChange",value:function(e){var t=this.props.onChange;"function"==typeof t&&t(e)}},{key:"render",value:function(){var e=this.props,t=e.label,e=e.text;return Hf(1,"div","context-menu-container ref-input-editor input-edit",[Hf(1,"div","dms-form-control",Wf(2,Wg,{className:"dms-input-label",value:t||"",placeholder:this.translate("Input"),singleLine:!0,onInput:this.handleLabelChange}),2),Hf(1,"div","dms-form-control",[Hf(1,"label","dms-label",this.translate("Expression"),0),Wf(2,Wg,{placeholder:"enter expression",className:["ref-text","dms-input"].join(" "),onInput:this.handleValue,value:e||""})],4)],4)}}])&&J_(e.prototype,t),n&&J_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function ow(e){return e}function iw(e){return(iw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var aw=["label"];function cw(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function uw(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?cw(Object(n),!0).forEach(function(e){yw(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):cw(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function sw(e,t){if(null==e)return{};var n,r=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols)for(var o=Object.getOwnPropertySymbols(e),i=0;i<o.length;i++)n=o[i],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r}function lw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function pw(e,t){return(pw=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function fw(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=hw(n);return function(e,t){{if(t&&("object"===iw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return dw(e)}(this,r?(e=hw(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function dw(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hw(e){return(hw=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function yw(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var mw=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pw(e,t)}(o,rh);var e,t,n,r=fw(o);function o(e,t){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),yw(dw(i=r.call(this,e,t)),"persistChanges",function(){var e,t,n,r=i.props.context.input,o=i.state.unsaved;o&&(e=o.label,t=sw(o,aw),n={},"label"in o&&(n.label=e),Object.keys(t).length&&(n.inputExpression=t),i.modeling.updateProperties(r,n),i.setState({unsaved:!1}))}),yw(dw(i),"handleChange",function(e){i.setState({unsaved:uw(uw({},i.state.unsaved),e)},i.persistChanges)}),i.state={},Rh(dw(i)),i.persistChanges=i.debounceInput(i.persistChanges),i}return e=o,(t=[{key:"getValue",value:function(e){var t=this.props.context.input,n=this.state.unsaved,r=t;return"text"===e&&(r=t.inputExpression),n&&e in n?n[e]:r.get(e)}},{key:"render",value:function(){return Wf(2,rw,{label:this.getValue("label"),text:this.getValue("text"),onChange:this.handleChange})}}])&&lw(e.prototype,t),n&&lw(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function vw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function gw(e,t,n){return t&&vw(e.prototype,t),n&&vw(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}mw.$inject=["debounceInput","modeling","injector"];zi=gw(function e(t,r,n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("cell",function(e){if("input-header"===e.cellType)return Z_}),t.onGetComponent("context-menu",function(){if("input-edit"===(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).contextMenuType)return mw}),n.on("input.edit",function(e){var t=e.event,n=e.input,e=xt(t.target,"th",!0).getBoundingClientRect(),t=e.left,e=e.top;r.open({x:t,y:e,align:"bottom-right"},{contextMenuType:"input-edit",input:n})})});function bw(e){return(bw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ww(e,t){return(ww=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function xw(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=jw(n);return function(e,t){{if(t&&("object"===bw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return Ow(e)}(this,r?(e=jw(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function Ow(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jw(e){return(jw=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ew(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}zi.$inject=["components","contextMenu","eventBus","renderer"];var Cw=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ww(e,t)}(i,rh);var e,t,n,o=xw(i);function i(e,t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),Ew(Ow(r=o.call(this,e,t)),"onChange",function(e){r.setState({value:e});var t=r.props.onChange;"function"==typeof t&&t(e)}),Ew(Ow(r),"onInputClick",function(e){e.preventDefault(),e.stopPropagation(),r.setOptionsVisible(!r.state.optionsVisible),r.focusInput()}),Ew(Ow(r),"onInput",function(e){e=e.target.value;r.onChange(e)}),Ew(Ow(r),"onOptionClick",function(e,t){t.preventDefault(),t.stopPropagation(),r.setOptionsVisible(!1),r.onChange(e),r.focusInput()}),Ew(Ow(r),"onFocusChanged",function(e){r.checkClose(e.target)}),Ew(Ow(r),"onGlobalClick",function(e){r.checkClose(e.target)}),Ew(Ow(r),"onKeyDown",function(e){var t=r.state.optionsVisible,n=e.which;40!==n&&38!==n||(e.stopPropagation(),e.preventDefault(),t?r.select(40===n?1:-1):r.setOptionsVisible(!0)),t&&(13!==n&&27!==n||(e.stopPropagation(),e.preventDefault(),r.setOptionsVisible(!1)))}),Ew(Ow(r),"onKeyboard",function(e){if(r.state.optionsVisible)return 27===e?(r.setOptionsVisible(!1),!0):void 0}),Rh(Ow(r));e=e.value;return r.state={value:e,optionsVisible:!1},r._portalEl=null,r}return e=i,(t=[{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.onGlobalClick),document.addEventListener("focusin",this.onFocusChanged),this.keyboard.addListener(this.onKeyboard)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("focusin",this.onFocusChanged),document.removeEventListener("mousedown",this.onGlobalClick),this.keyboard.removeListener(this.onKeyboard),this.removePortalEl()}},{key:"componentWillReceiveProps",value:function(e){e=e.value;this.setState({value:e})}},{key:"componentWillUpdate",value:function(e,t){t.optionsVisible?this._portalEl||this.addPortalEl():this._portalEl&&this.removePortalEl()}},{key:"componentDidUpdate",value:function(){var e;this.state.optionsVisible&&this.inputNode&&(e=this.getOptionsBounds(),L(this._portalEl.style,e))}},{key:"getOptionsBounds",value:function(){var e=this.renderer.getContainer(),t=e.getBoundingClientRect(),n=t.top,r=t.left,o=t.bottom,i=this.inputNode.getBoundingClientRect(),a=i.top,c=i.left,u=i.width,t=i.height,i=i.bottom,n=a+t-n+e.scrollTop,e=c-r+e.scrollLeft,n={top:"".concat(n,"px"),left:"".concat(e,"px"),width:"".concat(u,"px"),"max-height":"calc(100% - ".concat(n,"px)")};return o-i<t&&(n.bottom="".concat(a=o-a,"px"),n["max-height"]="calc(100% - ".concat(a,")"),delete n.top),n}},{key:"addPortalEl",value:function(){this._portalEl=kt('<div class="dms-select-options"></div>'),this.renderer.getContainer().appendChild(this._portalEl),this._portalEl.addEventListener("mousedown",Sw)}},{key:"removePortalEl",value:function(){this._portalEl&&(this._portalEl.removeEventListener("mousedown",Sw),Bt(this._portalEl),this._portalEl=null)}},{key:"focusInput",value:function(){var e=this.inputNode;e.focus(),"selectionStart"in e&&(e.selectionStart=1e5)}},{key:"checkClose",value:function(e){!this._portalEl||this._portalEl.contains(e)||this.parentNode.contains(e)||this.setOptionsVisible(!1)}},{key:"select",value:function(e){var t,n=this.props.options,r=this.state.value;n&&(t=(t=n.filter(function(e){return e.value===r})[0])?n.indexOf(t):-1,e=n[(e=-1===t?1===e?0:n.length-1:(t+e)%n.length)<0?n.length+e:e],this.onChange(e.value))}},{key:"setOptionsVisible",value:function(e){this.setState({optionsVisible:e})}},{key:"renderOptions",value:function(e,n){var r=this;return Hf(1,"div","options",e.map(function(t){return Hf(1,"div",["option",n===t?"active":""].join(" "),t.label,0,{"data-value":t.value,onClick:function(e){return r.onOptionClick(t.value,e)}})}),0)}},{key:"render",value:function(){var t=this,e=this.props,n=e.className,r=e.options,o=e.noInput,i=e.title,a=this.state,c=a.optionsVisible,u=a.value,e=!!r&&r.filter(function(e){return e.value===u})[0],a=e?e.label:u;return Hf(1,"div",[n||"","dms-input-select"].join(" "),[o?Hf(1,"div","dms-input",a,0,{tabindex:"0",onKeyDown:this.onKeyDown},null,function(e){return t.inputNode=e}):Hf(64,"input","dms-input",null,1,{onInput:this.onInput,onKeyDown:this.onKeyDown,spellcheck:"false",type:"text",value:u},null,function(e){return t.inputNode=e}),Hf(1,"span",["dms-input-select-icon",c?"dmn-icon-up":"dmn-icon-down"].join(" ")),c&&(e=this.renderOptions(r,e),Hf(1024,this._portalEl,null,e,0,null,Rf(e)?null:e.key,null))],0,{title:i,onClick:this.onInputClick},null,function(e){return t.parentNode=e})}}])&&_w(e.prototype,t),n&&_w(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function Sw(e){e.stopPropagation()}function Pw(e){return(Pw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function kw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Rw(e,t){return(Rw=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Tw(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=Mw(n);return function(e,t){{if(t&&("object"===Pw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return Dw(e)}(this,r?(e=Mw(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function Dw(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Mw(e){return(Mw=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Cw.$inject=["keyboard","renderer"];var Bw=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rw(e,t)}(a,rh);var e,t,n,i=Tw(a);function a(e,t){var r,n,o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),r=i.call(this,e),n=Dw(r),o=function(e){var t,n=r.getElement(),n=en(n,"dmn:LiteralExpression")?n.$parent:n;tn(n)?t={inputExpression:{typeRef:e}}:nn(n)&&(t={typeRef:e}),r._modeling.updateProperties(n,t)},(e="onTypeChange")in n?Object.defineProperty(n,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[e]=o,r._translate=t.injector.get("translate"),r._modeling=t.injector.get("modeling"),r._dataTypes=t.injector.get("dataTypes"),r}return e=a,(t=[{key:"getElement",value:function(){return this.props.context.input||this.props.context.output}},{key:"render",value:function(){var e=this.getElement(),t=(en(e,"dmn:InputClause")?e.inputExpression:e).typeRef,e=this._dataTypes.getAll().map(function(e){return{label:e,value:e}});return Hf(1,"div","type-ref-edit context-menu-container",Hf(1,"div","dms-form-control",[Hf(1,"label","dms-label",[this._translate("Type"),qf(":")],0),Wf(2,Cw,{className:"type-ref-edit-select",onChange:this.onTypeChange,options:e,value:t})],4),2)}}])&&kw(e.prototype,t),n&&kw(e,n),Object.defineProperty(e,"prototype",{writable:!1}),a}();function Iw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Aw(e,t,n){return t&&Iw(e.prototype,t),n&&Iw(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}_o=Aw(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("context-menu",750,function(){var e=(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).contextMenuType;if("input-edit"===e||"output-edit"===e)return Bw})});_o.$inject=["components"];hr={__depends__:[Db,r_],__init__:["typeRefEditingProvider"],typeRefEditingProvider:["type",_o]};function Nw(e){return(Nw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Lw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $w(e,t){return($w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Vw(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=zw(n);return function(e,t){{if(t&&("object"===Nw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,r?(e=zw(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function zw(e){return(zw=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Si=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$w(e,t)}(o,ts);var e,t,n,r=Vw(o);function o(e,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,e)).postExecuted("element.updateProperties",function(e){var t=e.context,e=t.element,t=t.properties,t=tn(e)?t.inputExpression:t;t&&t.typeRef&&"string"!==t.typeRef&&(e=en(e,"dmn:LiteralExpression")?e.$parent:e,n.editAllowedValues(e,null))}),e}return e=o,t&&Lw(e.prototype,t),n&&Lw(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}();function Fw(e){return(Fw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Uw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Hw(e,t){return(Hw=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ww(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=Gw(n);return function(e,t){{if(t&&("object"===Fw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return qw(e)}(this,r?(e=Gw(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function qw(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gw(e){return(Gw=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Kw(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Si.$inject=["eventBus","modeling"];var Xw=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hw(e,t)}(i,rh);var e,t,n,r=Ww(i);function i(e,t){var o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),Kw(qw(o=r.call(this,e,t)),"getRemoveClickHandler",function(t){return function(e){e.stopPropagation(),o.removeItem(t)}}),Kw(qw(o),"getToggleClickHandler",function(t){return function(e){e.stopPropagation(),o.toggleItem(t)}}),Kw(qw(o),"removeItem",function(t){var e=o.props.onChange,n=o.state.items.filter(function(e){return e!==t});o.setState({items:n}),e&&e(n)}),Kw(qw(o),"toggleItem",function(t){var e=o.props,n=e.onChange,r=e.type,e=o.state.items.map(function(e){return e===t?e.isChecked=!e.isChecked:"radio"===r&&(e.isChecked=!1),e});o.setState({items:e}),n&&n(e)});e=e.items;return o.state={items:e},o}return e=i,(t=[{key:"componentWillReceiveProps",value:function(e){e=e.items;this.setState({items:e})}},{key:"render",value:function(){var n=this,e=this.props,t=e.className,r=e.items,o=e.type,i=e.labelComponent,e=["dms-list-component"];t&&e.push(t);r=function(e){var t,n=[];for(t in e)n.push([t,e[t]]);return n}(R(r,"group"));return Hf(1,"div",e.join(" "),r.map(function(e){var t=e[0],e=e[1];return Hf(1,"div","group",[i&&i(t)||Hf(1,"h4","dms-heading",t,0),Hf(1,"ul","items no-wrap",e.map(function(e){return Hf(1,"li","item",[o&&Hf(64,"input","item-toggle",null,1,{type:o,checked:e.isChecked,onClick:n.getToggleClickHandler(e)}),qf(" "),e.value,e.isRemovable&&Hf(1,"span","remove dmn-icon-clear",null,1,{title:"Remove item",onClick:n.getRemoveClickHandler(e)})],0)}),0)],0)}),0)}}])&&Uw(e.prototype,t),n&&Uw(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function Yw(e){return(Yw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Zw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Qw(e,t){return(Qw=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Jw(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=t0(n);return function(e,t){{if(t&&("object"===Yw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return e0(e)}(this,r?(e=t0(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function e0(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t0(e){return(t0=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var n0=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qw(e,t)}(o,rh);var e,t,n,r=Jw(o);function o(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var n=r.call(this,e,t),t=e.validate,e=e.value,t=t?t(e||""):void 0;return n.state={validationWarning:t,value:e},n.onInput=n.onInput.bind(e0(n)),n.onKeyDown=n.onKeyDown.bind(e0(n)),n.onKeyUp=n.onKeyUp.bind(e0(n)),n}return e=o,(t=[{key:"componentWillReceiveProps",value:function(e){var t=e.validate,e=e.value,t=t?t(e||""):void 0;this.setState({validationWarning:t,value:e})}},{key:"onInput",value:function(e){var t=this.props,n=t.onInput,t=t.validate,t=t?t(e):void 0;this.setState({validationWarning:t,value:e}),"function"==typeof n&&n&&n({isValid:!t,value:e})}},{key:"onKeyDown",value:function(e){var t=e.target.value,n=this.props,r=n.onKeyDown,n=n.validate,n=n?n(t):void 0;"function"==typeof r&&r({isValid:!n,value:t,event:e})}},{key:"onKeyUp",value:function(e){var t=e.target.value,n=this.props,r=n.onKeyUp,n=n.validate,n=n?n(t):void 0;"function"==typeof r&&r({isValid:!n,value:t,event:e})}},{key:"render",value:function(){var e=this.props,t=e.placeholder,n=e.type,r=e.className,o=this.state,i=o.validationWarning,e=o.value,o=["dms-validated-input",r].join(" "),r=[];return i&&r.push("invalid"),Hf(1,"div",o,[Wf(2,j_,{className:r,onInput:this.onInput,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,placeholder:t||"",type:n,value:e||""}),i&&Hf(1,"p","dms-hint dms-validation-warning",i,0)],0)}}])&&Zw(e.prototype,t),n&&Zw(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function r0(e){if(!e||""===e.trim())return{values:[]};var e=e.split(","),t={values:[]},n="";return e.forEach(function(e){n+=e,/^"[^"]*"$/.test(n.trim())?(t.values.push(n.trim()),n=""):n+=","}),n?void 0:t}function o0(e){return(o0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i0(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a0(e,t){return(a0=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c0(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=s0(n);return function(e,t){{if(t&&("object"===o0(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return u0(e)}(this,r?(e=s0(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function u0(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s0(e){return(s0=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l0(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var p0=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a0(e,t)}(o,rh);var e,t,n,r=c0(o);function o(e,t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),l0(u0(n=r.call(this,e,t)),"onElementsChanged",function(){n.forceUpdate()}),l0(u0(n),"setPredefinedValues",function(e){var t=n.getAllowedValuesTarget();n.setState({values:e}),n._modeling.editAllowedValues(t,e&&e.map(function(e){return e.value}))}),l0(u0(n),"onListChange",function(e){n.setPredefinedValues(e)}),l0(u0(n),"onInput",function(e){e.isValid;e=e.value;n.setState({inputValue:e})}),l0(u0(n),"onKeyDown",function(e){var t=e.isValid,e=e.event;13===e.keyCode&&(e.stopPropagation(),e.preventDefault(),t&&(t=(e=n.state).inputValue,e=e.values,t=r0(t),n.onListChange((e||[]).concat(t.values.map(function(e){return{value:e,isCheckable:!1,isRemovable:!0,group:"Predefined Values"}}))),n.setState({inputValue:""})))}),l0(u0(n),"handleRemovePredifinedValuesClick",function(e){e.stopPropagation(),n.removePredefinedValues()}),l0(u0(n),"removePredefinedValues",function(){n.setPredefinedValues(null)}),n._translate=t.injector.get("translate"),n._modeling=t.injector.get("modeling"),n._changeSupport=t.changeSupport;t=n.getAllowedValuesTarget(),t=r0(t.inputValues&&t.inputValues.text||t.outputValues&&t.outputValues.text||"");return n.state=t?{values:t.values.map(function(e){return{value:e,isCheckable:!1,isRemovable:!0,group:"Predefined Values"}}),inputValue:""}:{values:null,inputValue:""},n}return e=o,(t=[{key:"componentWillMount",value:function(){var e=this.getAllowedValuesTarget();this._changeSupport.onElementsChanged(e.id,this.onElementsChanged)}},{key:"componentWillUnmount",value:function(){var e=this.getAllowedValuesTarget();this._changeSupport.offElementsChanged(e.id,this.onElementsChanged)}},{key:"getAllowedValuesTarget",value:function(){var e=this.getElement();return en(e,"dmn:LiteralExpression")?e.$parent:e}},{key:"getElement",value:function(){return this.props.context.output||this.props.context.input.inputExpression}},{key:"render",value:function(){var t=this,e=this.getElement(),n=this.state,r=n.inputValue,n=n.values;return"string"===e.typeRef?Hf(1,"div","context-menu-container allowed-values-edit",Hf(1,"div","dms-form-control",[!d0(n)&&0<n.length&&Wf(2,Xw,{labelComponent:f0,items:n,onChange:this.onListChange}),!d0(n)&&!n.length&&Hf(1,"div",null,[Hf(1,"label","dms-label",this._translate("Predefined Values"),0),Hf(1,"span","placeholder",this._translate("No values"),0)],4),!d0(n)&&Hf(1,"p","dms-hint",Hf(1,"button","del-values",this._translate("Clear predefined values."),0,{type:"button",onClick:this.handleRemovePredifinedValuesClick}),2),Hf(1,"label","dms-label",this._translate("Add Predefined Values"),0),Wf(2,n0,{onInput:this.onInput,onKeyDown:this.onKeyDown,placeholder:'"value", "value", ...',type:"text",validate:function(e){if(!r0(e))return t._translate("Strings must be in double quotes.")},value:r})],0),2):null}}])&&i0(e.prototype,t),n&&i0(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function f0(e){return Hf(1,"label","dms-label",e,0)}function d0(e){return null===e}function h0(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y0(e,t,n){return t&&h0(e.prototype,t),n&&h0(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}oc=y0(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("context-menu",500,function(){var e=(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).contextMenuType;if("input-edit"===e||"output-edit"===e)return p0})});oc.$inject=["components"];_o={__init__:["allowedValuesUpdateBehavior","allowedValuesEditingProvider"],allowedValuesUpdateBehavior:["type",Si],allowedValuesEditingProvider:["type",oc]};function m0(e){return(m0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v0(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function g0(e,t){return(g0=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b0(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=w0(n);return function(e,t){{if(t&&("object"===m0(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return _0(e)}(this,r?(e=w0(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function _0(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w0(e){return(w0=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function x0(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var O0=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g0(e,t)}(o,rh);var e,t,n,r=b0(o);function o(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),x0(_0(n=r.call(this,e,t)),"onElementsChanged",function(){n.forceUpdate()}),x0(_0(n),"handleClick",function(e){e.stopPropagation(),n.add()}),x0(_0(n),"add",function(){n._eventBus.fire("addInput")}),n._sheet=t.injector.get("sheet"),n._eventBus=t.injector.get("eventBus"),n._changeSupport=t.changeSupport,n._translate=t.injector.get("translate"),n}return e=o,(t=[{key:"componentWillMount",value:function(){var e=this.getRoot();this._changeSupport.onElementsChanged(e.id,this.onElementsChanged)}},{key:"componentWillUnmount",value:function(){var e=this.getRoot();this._changeSupport.offElementsChanged(e.id,this.onElementsChanged)}},{key:"getRoot",value:function(){return this._sheet.getRoot()}},{key:"render",value:function(){return Hf(1,"div","add-input actionable",Hf(1,"span","dmn-icon-plus action-icon"),2,{onClick:this.handleClick,title:this._translate("Add Input")})}}])&&v0(e.prototype,t),n&&v0(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function j0(e){return(j0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function E0(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function C0(e,t){return(C0=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S0(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=k0(n);return function(e,t){{if(t&&("object"===j0(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return P0(e)}(this,r?(e=k0(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function P0(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function k0(e){return(k0=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function R0(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var T0=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C0(e,t)}(o,rh);var e,t,n,r=S0(o);function o(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),R0(P0(n=r.call(this,e,t)),"onElementsChanged",function(){n.forceUpdate()}),R0(P0(n),"handleClick",function(e){e.stopPropagation(),n.add()}),R0(P0(n),"add",function(){n._eventBus.fire("addOutput")}),n._sheet=t.injector.get("sheet"),n._eventBus=t.injector.get("eventBus"),n._changeSupport=t.changeSupport,n._translate=t.injector.get("translate"),n}return e=o,(t=[{key:"componentWillMount",value:function(){var e=this.getRoot();this._changeSupport.onElementsChanged(e.id,this.onElementsChanged)}},{key:"componentWillUnmount",value:function(){var e=this.getRoot();this._changeSupport.offElementsChanged(e.id,this.onElementsChanged)}},{key:"getRoot",value:function(){return this._sheet.getRoot()}},{key:"render",value:function(){return Hf(1,"div","add-output actionable",Hf(1,"span","dmn-icon-plus action-icon"),2,{onClick:this.handleClick,title:this._translate("Add Output")})}}])&&E0(e.prototype,t),n&&E0(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function D0(e,t,n){e.onGetComponent("cell-inner",function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.cellType,n=e.index,r=e.inputsLength,e=e.outputsLength;return"input-cell"===t&&n===r-1?O0:"output-cell"===t&&n===e-1?T0:void 0}),n.on("addInput",function(){t.trigger("addInput")}),n.on("addOutput",function(){t.trigger("addOutput")})}D0.$inject=["components","editorActions","eventBus"];Si={__depends__:[Dg],__init__:["addInputOutputProvider"],addInputOutputProvider:["type",D0]};function M0(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function B0(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}oc=function(){function o(e,t,n,r){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),B0(this,"_init",function(){i._registerDefaultBindings(),i._fire("init")}),B0(this,"_destroy",function(){i._fire("destroy"),i.unbind(),i._listeners=null}),B0(this,"_keyHandler",function(e){for(var t,n=i._listeners,r=e.keyCode||e.charCode||-1,o=0;t=n[o];o++)if(t(r,e))return e.preventDefault(),void e.stopPropagation()}),B0(this,"unbind",function(){var e=i._node;e&&(i._fire("unbind"),Ct.unbind(e,"keydown",i._keyHandler,!0)),i._node=null}),this._config=e||{},this._editorActions=n,this._eventBus=t,this._cellSelection=r,this._listeners=[],t.on("table.destroy",this._destroy),t.on("table.init",this._init),t.on("attach",function(){i._config.bindTo&&i.bind(e.bindTo)}),t.on("detach",this.unbind)}var e,t,n;return e=o,(t=[{key:"bind",value:function(e){this.unbind(),this._node=e,Ct.bind(e,"keydown",this._keyHandler,!0),this._fire("bind")}},{key:"getBinding",value:function(){return this._node}},{key:"_fire",value:function(e){this._eventBus.fire("keyboard."+e,{node:this._node,listeners:this._listeners})}},{key:"_registerDefaultBindings",value:function(){var e=this._listeners,n=this._editorActions,r=this._cellSelection;e.push(function(e,t){if(Mb(t)&&!Bb(t)&&90===e)return n.trigger("undo"),!0}),e.push(function(e,t){if(Mb(t)&&(89===e||90===e&&Bb(t)))return n.trigger("redo"),!0}),e.push(function(e,t){if(13===e&&!Mb(t)&&Bb(t)&&Yv(t.target))return n.trigger("selectCellAbove"),!0}),e.push(function(e,t){if(13===e&&!Mb(t)&&!Bb(t)&&Yv(t.target)){e=n.trigger("selectCellBelow"),t=r.getCellSelection();if(e||!t||"__decisionProperties_name"===t)return!0;t=n.trigger("addRule");return n.trigger("selectCellBelow"),t}})}},{key:"addListener",value:function(e){this._listeners.unshift(e)}},{key:"removeListener",value:function(t){this._listeners=this._listeners.filter(function(e){return e!==t})}}])&&M0(e.prototype,t),n&&M0(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();oc.$inject=["config.keyboard","eventBus","editorActions","cellSelection"];var I0={__depends__:[Dg],__init__:["keyboard"],keyboard:["type",oc]},A0={__depends__:[Si,_o,Db,Ni,Zy,I0,hr],__init__:["inputEditingProvider","outputEditingProvider"],inputEditingProvider:["type",zi],outputEditingProvider:["type",uc]};function N0(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function L0(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Si=function(){function i(e,t,n,r){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),L0(this,"handleDragOver",function(e){$0(e);var t=xt(e.target,".dmn-decision-table-container td,\n   .dmn-decision-table-container th",!0),n=!!t,r=o._dragContext.hoverEl;r&&r!==t&&(o._emit("dragAndDrop.dragLeave",e),o._dragContext.targetEl=null,o._dragContext.hoverEl=null),t&&(t!==r&&(o._dragContext.hoverEl=t,!1!==(n=o._emit("dragAndDrop.dragEnter",e))&&(o._dragContext.targetEl=t)),n=o._emit("dragAndDrop.dragOver",e)),e.dataTransfer.dropEffect=!1!==n?"move":"none"}),L0(this,"handleDrop",function(e){$0(e);var t,n,r=o._emit("dragAndDrop.drop",e);r&&((t=o._dragContext.draggedElement)instanceof hf?(n=o._sheet.getRoot().rows.indexOf(r),o._modeling.moveRow(t,n)):t instanceof yf&&(r=o._sheet.getRoot().cols.indexOf(r),o._modeling.moveCol(t,r))),o.handleDragEnd(e)}),L0(this,"handleDragEnd",function(e){$0(e),o._unbindListeners(),o._emit("dragAndDrop.dragEnd",e),o._dragContext=null}),this._eventBus=e,this._renderer=t,this._modeling=n,this._sheet=r,this._dragContext=null,e.on("table.destroy",function(){o._unbindListeners()})}var e,t,n;return e=i,(t=[{key:"_bindListeners",value:function(){Ct.bind(document,"dragover",this.handleDragOver),Ct.bind(document,"drop",this.handleDrop),Ct.bind(document,"dragend",this.handleDragEnd)}},{key:"_unbindListeners",value:function(){Ct.unbind(document,"dragover",this.handleDragOver),Ct.unbind(document,"drop",this.handleDrop),Ct.unbind(document,"dragend",this.handleDragEnd)}},{key:"_emit",value:function(e,t){return this._eventBus.fire(e,{dragContext:this._dragContext,originalEvent:t})}},{key:"startDrag",value:function(e,t){$0(t,!0),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData&&t.dataTransfer.setData("text","__DUMMY"),this._dragContext={draggedElement:e},this._bindListeners(),this._emit("dragAndDrop.dragStart",t)}}])&&N0(e.prototype,t),n&&N0(e,n),i}();function $0(e,t){e.stopPropagation(),!0!==t&&e.preventDefault()}Si.$inject=["eventBus","renderer","modeling","sheet"];_o={__init__:["dragAndDrop"],dragAndDrop:["type",Si]};function V0(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var z0="top",F0="right",U0="bottom",H0="left",hr=function(){function p(e,t,n,r,o,i,a){var c,u,s,l=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),s=function(){var e=l._renderer.getContainer();G0(e),x(Mt(".dragged",e),function(e){Y0(e)&&mt(e).remove("dragged")}),l._dragImage&&(Bt(l._dragImage),l._dragImage=null)},(u="_cleanup")in(c=this)?Object.defineProperty(c,u,{value:s,enumerable:!0,configurable:!0,writable:!0}):c[u]=s,this._elementRegistry=t,this._dragAndDrop=r,this._renderer=o,this._rules=i,this._sheet=a,e.onGetComponent("cell-inner",function(e){var t=e.cellType,n=e.col,r=e.row;if("rule-index"===t)return function(){return Hf(1,"span","dmn-icon-drag vertical",qf(" "),2,{draggable:"true",onDragStart:function(e){return l.startDrag(r,e)},title:"Move rule"})};if("input-cell"===t||"output-cell"===t){var o="Move ".concat(tn(n)?"Input":"Output");return function(){return Hf(1,"span","dmn-icon-drag horizontal",null,1,{draggable:"true",onDragStart:function(e){return l.startDrag(n,e)},title:o})}}}),n.on("dragAndDrop.dragEnter",function(e){var t=e.dragContext,e=t.draggedElement,t=t.hoverEl;if(e instanceof hf)return!0;if(e instanceof yf){t=function(e,t,n){e=t.get(e.dataset.colId);return e?n.getRoot().cols.indexOf(e):-1}(t,l._elementRegistry,l._sheet);return-1===t?!1:l._rules.allowed("col.move",{col:e,index:t})}return!1}),n.on("dragAndDrop.dragLeave",function(e){e.dragContext.targetEl&&G0(l._renderer.getContainer())}),n.on("dragAndDrop.dragOver",function(e){var t,n=e.dragContext,r=e.originalEvent,o=n.draggedElement,i=n.lastPosition,a=n.targetEl,e=l._renderer.getContainer();return!!a&&(o instanceof hf&&(t=X0(r,a)),i===(t=o instanceof yf?K0(r,a):t)||(G0(e),o instanceof hf&&W0(a,e,t===z0?"top":"bottom"),o instanceof yf&&q0(a,e,t===H0?"left":"right"),n.lastPosition=t),!0)}),n.on("dragAndDrop.drop",function(e){var t=e.dragContext,n=e.originalEvent,r=t.draggedElement,o=t.targetEl;if(!o)return!1;if(r instanceof hf){e=X0(n,o),t=o.dataset.rowId,t=l._elementRegistry.get(t);if(!t||t===r)return;e=function(e,t,n,r){r.indexOf(e)>r.indexOf(t)&&(t=function(e,t){e=t.indexOf(e);return t[Math.min(t.length-1,e+1)]}(t,r));return n===z0?function(e,t){e=t.indexOf(e);return t[Math.max(0,e-1)]}(t,r):t}(r,t,e,l._sheet.getRoot().rows);return e===r?void 0:e}if(r instanceof yf){n=K0(n,o),o=o.dataset.colId,o=l._elementRegistry.get(o);if(o&&o!==r){n=function(e,t,n,r){r.indexOf(e)>r.indexOf(t)&&(t=function(e,t){var n=t.indexOf(e);if(tn(e)){e=t.filter(tn),e=e[e.length-1],e=t.indexOf(e);return t[Math.min(e,n+1)]}return t[Math.min(t.length-1,n+1)]}(t,r));return n===H0?function(e,t){var n=t.indexOf(e);if(nn(e)){e=t.filter(nn)[0],e=t.indexOf(e);return t[Math.max(e,n-1)]}return t[Math.max(0,n-1)]}(t,r):t}(r,o,n,l._sheet.getRoot().cols);if(n!==r)return n}}}),n.on("dragAndDrop.dragEnd",this._cleanup)}var e,t,n;return e=p,(t=[{key:"startDrag",value:function(e,t){var n,r=this._renderer.getContainer();this._dragImage=kt('<span style="\n          visibility: hidden;\n          position: fixed;\n          top: -10000px\n      "></span>'),document.body.appendChild(this._dragImage),t.dataTransfer.setDragImage&&t.dataTransfer.setDragImage(this._dragImage,0,0),e instanceof hf?(n=r,x(Mt("[data-row-id=".concat(e.id,"]"),n),function(e){Y0(e)&&mt(e).add("dragged")})):e instanceof yf&&(r=r,x(Mt("[data-col-id=".concat(e.id,"]"),r),function(e){Y0(e)&&mt(e).add("dragged")})),this._dragAndDrop.startDrag(e,t)}}])&&V0(e.prototype,t),n&&V0(e,n),Object.defineProperty(e,"prototype",{writable:!1}),p}();function W0(e,t,n){e=e.dataset.rowId;e&&x(Mt("[data-row-id=".concat(e,"]"),t),function(e){Y0(e)&&(mt(e).add("dragover"),mt(e).add(n))})}function q0(e,t,n){e=e.dataset.colId;e&&x(Mt("[data-col-id=".concat(e,"]"),t),function(e){Y0(e)&&(mt(e).add("dragover"),mt(e).add(n))})}function G0(e){x(Mt(".dragover",e),function(e){Y0(e)&&(mt(e).remove("dragover"),mt(e).remove("top"),mt(e).remove("right"),mt(e).remove("bottom"),mt(e).remove("left"))})}function K0(e,t){t=t.getBoundingClientRect();return e.clientX<t.left+t.width/2?H0:F0}function X0(e,t){t=t.getBoundingClientRect();return e.clientY<t.top+t.height/2?z0:U0}function Y0(e){return e&&(1===e.nodeType||11==e.nodeType)}hr.$inject=["components","elementRegistry","eventBus","dragAndDrop","renderer","rules","sheet"];var Z0={__depends__:[_o,fu],__init__:["dmnDragAndDrop"],dmnDragAndDrop:["type",hr]};function Q0(e){return(Q0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function J0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ex(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function tx(e,t,n){return t&&ex(e.prototype,t),n&&ex(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function nx(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rx(e,t)}function rx(e,t){return(rx=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ox(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=ax(n);return function(e,t){{if(t&&("object"===Q0(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return ix(e)}(this,r?(e=ax(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function ix(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ax(e){return(ax=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function cx(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ux=function(){nx(o,rh);var r=ox(o);function o(e,t){var n;J0(this,o),cx(ix(n=r.call(this,e,t)),"onElementsChanged",function(){n.forceUpdate()}),cx(ix(n),"changeDescription",function(e){n._modeling.updateProperties(n._element,{description:e})}),n._elementRegistry=t.injector.get("elementRegistry"),n._modeling=t.injector.get("modeling"),n._changeSupport=n.context.changeSupport;t=n.props.context.id;return n._element=n._elementRegistry.get(t),n}return tx(o,[{key:"componentWillMount",value:function(){this._element&&this._changeSupport.onElementsChanged(this._element.id,this.onElementsChanged)}},{key:"componentDidMount",value:function(){this.props.context.autoFocus&&this.node&&Dt(".content-editable",this.node).focus()}},{key:"componentWillUnmount",value:function(){var e;this._element&&(this._changeSupport.offElementsChanged(this._element.id,this.onElementsChanged),v(e=this._element.businessObject.description)&&!e.length&&this.changeDescription(null))}},{key:"render",value:function(){var t=this;if(this._element){var e=this._element.businessObject.description;if(v(e))return Hf(1,"div","context-menu-container description-editor",Wf(2,sx,{className:"dms-input",onChange:this.changeDescription,value:e}),2,null,null,function(e){return t.node=e})}}}]),o}(),sx=function(){nx(t,eb);var e=ox(t);function t(){return J0(this,t),e.apply(this,arguments)}return tx(t,[{key:"render",value:function(){return Hf(1,"div",this.getClassName(),this.getEditor(),0)}}]),t}();function lx(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function px(e,t,n){return t&&lx(e.prototype,t),n&&lx(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fx(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}zi=px(function e(t,o,i,n,r,a,c){var u=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),fx(this,"addDescription",function(e){u._modeling.updateProperties(e,{description:""});var t=u._renderer.getContainer(),t=dx(t,Xv(e.id,t).getBoundingClientRect());u._contextMenu.open(t,{contextMenuType:"cell-description",id:e.id,autoFocus:!0,offset:{x:4,y:4}})}),fx(this,"removeDescription",function(e){u._modeling.updateProperties(e,{description:null}),u._contextMenu.close()}),this._contextMenu=o,this._modeling=r,this._renderer=a,this._translate=c,n.on("cell.click",750,function(e){var t,n,r;e.defaultPrevented||(r=e.target,t=e.id,on(n=i.get(t),["dmn:UnaryTests","dmn:LiteralExpression"])&&(hx(n)||e.preventDefault(),r=dx(a.getContainer(),r.getBoundingClientRect()),o.open(r,{contextMenuType:"cell-description",autoFocus:!1,id:t,offset:{x:4,y:4}})))}),t.onGetComponent("context-menu",function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(e.contextMenuType&&"cell-description"===e.contextMenuType&&v(hx(i.get(e.id))))return ux}),t.onGetComponent("context-menu-cell-additional",500,function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(e.contextMenuType&&"context-menu"===e.contextMenuType){var t=e.id;if(t){var n=i.get(t);if(n){var r=n.businessObject.description,e=v(r),t=e?function(){return u.removeDescription(n)}:function(){return u.addDescription(n)};return Hf(1,"div","context-menu-group-entry ".concat(e?"remove-description":"add-description"),v(r)?u._translate("Remove Cell Description"):u._translate("Add Cell Description"),0,{onClick:t})}}}})});function dx(e,t){var n=t.top,r=t.left,o=t.width,t=t.height;return{x:r+e.parentNode.scrollLeft-26,y:n+e.parentNode.scrollTop,width:o+52,height:t}}function hx(e){return e&&e.businessObject&&e.businessObject.description}zi.$inject=["components","contextMenu","elementRegistry","eventBus","modeling","renderer","translate"];var yx={__depends__:[Db,kv],__init__:["description"],description:["type",zi]};function mx(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}uc=function(){function c(e,o,t,i,n,r){var a=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),this._modeling=t,this._translate=n,this._expressionLanguages=i,e.onGetComponent("context-menu-cell-additional",function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(e.contextMenuType&&"context-menu"===e.contextMenuType){var t=e.event,n=e.id;if(n){e=o.get(n);if(e&&a._shouldDisplayContextMenuEntry(e))return Hf(1,"div","context-menu-group-entry",a._translate("Change Cell Expression Language"),0,{onClick:function(e){r.open({x:(t||e).pageX,y:(t||e).pageY},{contextMenuType:"expression-language",id:n})}})}}}),e.onGetComponent("context-menu",function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(e.contextMenuType&&"expression-language"===e.contextMenuType){e=e.id;if(e){var t=o.get(e);if(t){var n=a._getElementExpressionLanguage(t),r=i.getAll();return function(){return Hf(1,"div","context-menu-flex",Hf(1,"div","context-menu-group",Hf(1,"div","context-menu-group-entry context-menu-entry-set-expression-language",[Hf(1,"div",null,a._translate("Expression Language"),0),Wf(2,Cw,{className:"expression-language",onChange:function(e){return a.onChange(t,e)},options:r,value:n})],4),2),2)}}}}}),e.onGetComponent("context-menu",function(){var r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if("input-edit"===r.contextMenuType)return function(){var t=r.input.inputExpression;if(a._shouldDisplayContextMenuEntry(t)){var e=a._getElementExpressionLanguage(t),n=i.getAll();return Hf(1,"div","context-menu-container ref-language",Hf(1,"div","dms-form-control",[Hf(1,"label","dms-label",a._translate("Expression Language"),0),Wf(2,Cw,{className:"ref-language",value:e||"",onChange:function(e){return a.onChange(t,e)},options:n})],4),2)}}})}var e,t,n;return e=c,(t=[{key:"onChange",value:function(e,t){this._modeling.editExpressionLanguage(e,t)}},{key:"_shouldDisplayContextMenuEntry",value:function(e){return 1<this._expressionLanguages.getAll().length||this._getElementExpressionLanguage(e)!==this._getDefaultElementExpressionLanguage(e)}},{key:"_getElementExpressionLanguage",value:function(e){return rn(e).expressionLanguage||this._getDefaultElementExpressionLanguage(e)}},{key:"_getDefaultElementExpressionLanguage",value:function(e){return this._expressionLanguages.getDefault(tn(e.col)?"inputCell":"outputCell").value}}])&&mx(e.prototype,t),n&&mx(e,n),Object.defineProperty(e,"prototype",{writable:!1}),c}();uc.$inject=["components","elementRegistry","modeling","expressionLanguages","translate","contextMenu"];var vx={__depends__:[Zy],__init__:["expressionLanguage"],expressionLanguage:["type",uc]};function gx(e){return(gx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bx(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _x(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function wx(e,t,n){return t&&_x(e.prototype,t),n&&_x(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function xx(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ox(e,t)}function Ox(e,t){return(Ox=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function jx(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=Cx(n);return function(e,t){{if(t&&("object"===gx(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return Ex(e)}(this,r?(e=Cx(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function Ex(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cx(e){return(Cx=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Sx(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Px=function(){xx(o,rh);var r=jx(o);function o(e,t){var n;return bx(this,o),Sx(Ex(n=r.call(this,e,t)),"onElementsChanged",function(){n.forceUpdate()}),Sx(Ex(n),"setDecisionTableName",function(e){n.modeling.editDecisionTableName(e)}),Rh(Ex(n)),n}return wx(o,[{key:"componentWillMount",value:function(){this.setupChangeListeners({bind:this.getBusinessObject().id})}},{key:"componentWillUnmount",value:function(){this.setupChangeListeners({unbind:this.getBusinessObject().id})}},{key:"setupChangeListeners",value:function(e){var t=e.bind,e=e.unbind;"string"==typeof e&&this.changeSupport.offElementsChanged(e,this.onElementsChanged),"string"==typeof t&&this.changeSupport.onElementsChanged(t,this.onElementsChanged)}},{key:"getBusinessObject",value:function(){return this.sheet.getRoot().businessObject.$parent}},{key:"render",value:function(){var e=this.getBusinessObject().name,t=this.components.getComponent("hit-policy")||Rx;return Hf(1,"div","decision-table-properties",[Wf(2,kx,{className:"decision-table-name",value:e,ctrlForNewline:!0,onBlur:Tx,onChange:this.setDecisionTableName,elementId:"__decisionProperties_name",coords:"0:__decisionProperties"}),Hf(1,"div","decision-table-header-separator"),Wf(2,t)],4)}}]),o}();Px.$inject=["sheet","modeling","changeSupport","components"];var kx=function(){xx(r,eb);var n=jx(r);function r(e,t){return bx(this,r),Dh(Ex(t=n.call(this,e,t)),Mh),t}return wx(r,[{key:"render",value:function(){var e=this.props.value;return Hf(1,"div",Ph(this.getSelectionClasses(),this.getClassName()),this.getEditor(),0,{"data-element-id":this.props.elementId,"data-coords":this.props.coords,title:"Decision Name: "+e})}}]),r}();function Rx(){return null}function Tx(e){e.target.scroll(0,0)}function Dx(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Mx(e,t,n){return t&&Dx(e.prototype,t),n&&Dx(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}Si=Mx(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("table.before",500,function(){return Px})});Si.$inject=["components"];var Bx={__depends__:[Ni],__init__:["decisionTableProperties"],decisionTableProperties:["type",Si]};function Ix(e){return(Ix="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ax(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Nx(e,t){return(Nx=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Lx(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=Vx(n);return function(e,t){{if(t&&("object"===Ix(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return $x(e)}(this,r?(e=Vx(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function $x(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Vx(e){return(Vx=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function zx(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Fx=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nx(e,t)}(o,rh);var e,t,n,r=Lx(o);function o(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),zx($x(n=r.call(this,e,t)),"onChange",function(e){var t=e.aggregation,e=e.hitPolicy;n.modeling.editHitPolicy(e,t)}),zx($x(n),"onElementsChanged",function(){n.forceUpdate()}),Rh($x(n)),n}return e=o,(t=[{key:"componentDidMount",value:function(){this.changeSupport.onElementsChanged(this.getRoot().id,this.onElementsChanged)}},{key:"componentWillUnmount",value:function(){this.changeSupport.offElementsChanged(this.getRoot().id,this.onElementsChanged)}},{key:"getRoot",value:function(){return this.sheet.getRoot()}},{key:"render",value:function(){var e=this.getRoot().businessObject,n=e.aggregation,r=e.hitPolicy,e=b(_m,function(e){return t=e.value,e={aggregation:n,hitPolicy:r},t.hitPolicy===e.hitPolicy&&t.aggregation===e.aggregation;var t});return Hf(1,"div","hit-policy",[Hf(1,"label","dms-label",qf("Hit Policy:"),2),Wf(2,Cw,{className:"hit-policy-edit-policy-select",onChange:this.onChange,options:_m,value:e.value,"data-hit-policy":"true",noInput:!0})],4,{title:e.explanation})}}])&&Ax(e.prototype,t),n&&Ax(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function Ux(e){e.onGetComponent("hit-policy",function(){return Fx})}Fx.$inject=["changeSupport","sheet","modeling"],Ux.$inject=["components"];var Hx={__depends__:[Db],__init__:["hitPolicyProvider"],hitPolicyProvider:["type",Ux]};function Wx(e){return(Wx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qx(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Gx(e,t){return(Gx=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Kx(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=Xx(n);return function(e,t){{if(t&&("object"===Wx(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,r?(e=Xx(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function Xx(e){return(Xx=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}_o=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gx(e,t)}(o,ts);var e,t,n,r=Kx(o);function o(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(n=r.call(this,e)).executed(["row.add","row.remove","col.add","col.remove"],Yx(function(e){var t=e.context,e=t.row||t.col;n.updateRoot(e,t.oldRoot)})),n.reverted(["row.add","row.remove","col.add","col.remove"],Yx(function(e){var t=e.context,e=t.row||t.col;n.updateRoot(e,t.newRoot)})),n}return e=o,(t=[{key:"updateRoot",value:function(n,r){var e,t,o,i,a,c,u,s=this,l=n.root,p=n.businessObject;if(en(n,"dmn:DecisionRule")&&(r&&(t=(e=r.businessObject.get("rule")).indexOf(p),e.splice(t,1),p.$parent=null),l&&(d=l.businessObject,t=l.rows.indexOf(n),d.get("rule").splice(t,0,p),p.$parent=d,n.cells.forEach(function(e,t){s.wireCell(e,n,t)}))),en(n,"dmn:InputClause")||en(n,"dmn:OutputClause")){if(r){var f=r.businessObject,d=f.get("input"),f=f.get("output");if(en(n,"dmn:InputClause")&&(i=(o=d).indexOf(p)),-1===(i=en(n,"dmn:OutputClause")?(o=f).indexOf(p):i))throw new Error("inconsistent model: clause not in table");o.splice(i,1),p.$parent=null,n.cells.forEach(function(e,t){s.unwireCell(e,r.rows[t])})}l&&(o=(f=l.businessObject).get("input"),i=f.get("output"),a=l.cols.indexOf(n),en(n,"dmn:InputClause")&&(u=o,c=a),en(n,"dmn:OutputClause")&&(u=i,c=a-o.length),u.splice(c,0,p),p.$parent=f,n.cells.forEach(function(e,t){s.wireCell(e,l.rows[t],a)}))}}},{key:"unwireCell",value:function(e,t){var n,r=e.businessObject,o=t.businessObject,t=o.get("inputEntry"),o=o.get("outputEntry");if(en(e,"dmn:UnaryTests")&&(n=t),-1===(o=(n=en(e,"dmn:LiteralExpression")?o:n).indexOf(r)))throw new Error("cell not in row");n.splice(o,1),r.$parent=null}},{key:"wireCell",value:function(e,t,n){var r,o,i=e.businessObject,a=t.businessObject,c=a.get("inputEntry"),t=a.get("outputEntry");i.$parent!==a&&(en(e,"dmn:UnaryTests")&&(r=c,o=n),en(e,"dmn:LiteralExpression")&&(r=t,o=n-c.length),r.splice(o,0,i),i.$parent=a)}}])&&qx(e.prototype,t),n&&qx(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function Yx(n){return function(e){var t=e.context;en(t.row||t.col,"dmn:DMNElement")&&n(e)}}function Zx(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}_o.$inject=["eventBus","sheet"];fu=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this._model=e}var e,n,r;return e=t,(n=[{key:"create",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=this._model.create(e,t||{});return en(e,"dmn:InputClause")&&(t.inputExpression?e.inputExpression=t.inputExpression:(e.inputExpression=this.create("dmn:LiteralExpression",{typeRef:"string"}),e.inputExpression.$parent=e)),en(e,"dmn:OutputClause")&&(e.typeRef=t.typeRef||"string"),(en(e,"dmn:UnaryTests")||en(e,"dmn:LiteralExpression"))&&(e.text=t.text||""),this._ensureId(e),e}},{key:"_needsId",value:function(e){return en(e,"dmn:DMNElement")}},{key:"_ensureId",value:function(e){var t=(e.$type||"").replace(/^[^:]*:/g,"")+"_";!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e))}}])&&Zx(e.prototype,n),r&&Zx(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Qx(e){return(Qx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}fu.$inject=["moddle"];var Jx=["businessObject","type"];function e1(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function t1(r){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?e1(Object(o),!0).forEach(function(e){var t,n;t=r,e=o[n=e],n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):e1(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))})}return r}function n1(e,t){if(null==e)return{};var n,r=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols)for(var o=Object.getOwnPropertySymbols(e),i=0;i<o.length;i++)n=o[i],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r}function r1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o1(){return(o1="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=c1(e)););return e}(e,t);if(r){t=Object.getOwnPropertyDescriptor(r,t);return t.get?t.get.call(arguments.length<3?e:n):t.value}}).apply(this,arguments)}function i1(e,t){return(i1=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a1(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=c1(n);return function(e,t){{if(t&&("object"===Qx(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,r?(e=c1(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function c1(e){return(c1=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}hr=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&i1(e,t)}(a,_f);var e,t,n,r=a1(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=r.call(this))._dmnFactory=e,t}return e=a,(t=[{key:"create",value:function(e,t){var n=this._dmnFactory,r=t.businessObject,o=t.type,i=n1(t,Jx);if(!r){if(!o)if("root"===e?o="dmn:DecisionTable":"cell"===e&&(en(t=i.col,"dmn:OutputClause")&&(o="dmn:LiteralExpression"),en(t,"dmn:InputClause")&&(o="dmn:UnaryTests")),!o)throw new Error("cannot guess <type>");r=n.create(o)}return o1(c1(a.prototype),"create",this).call(this,e,t1({businessObject:r,id:r.id},i))}}])&&r1(e.prototype,t),n&&r1(e,n),Object.defineProperty(e,"prototype",{writable:!1}),a}();function u1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}hr.$inject=["dmnFactory"];var s1=function(){function n(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),this._sheet=e,this._elementFactory=t}var e,t,r;return e=n,(t=[{key:"execute",value:function(e){var t=this._sheet,n=this._elementFactory,r=t.getRoot(),o=e.row,i=e.index;return void 0===i&&(i=e.index=r.rows.length),e.newRoot=r,o.cells.length||r.cols.forEach(function(e,t){e=n.create("cell",{row:o,col:e});o.cells[t]=e}),t.addRow(o,i),t.getRoot()}},{key:"revert",value:function(e){var t=e.row,e=this._sheet;return e.removeRow(t),e.getRoot()}}])&&u1(e.prototype,t),r&&u1(e,r),n}();function l1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}s1.$inject=["sheet","elementFactory"];var p1=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this._sheet=e}var e,n,r;return e=t,(n=[{key:"execute",value:function(e){var t=this._sheet,n=t.getRoot(),r=e.row,n=e.oldIndex=n.rows.indexOf(r);if(e.oldRoot=r.root,-1===n)throw new Error("row#".concat(r.id," not in sheet"));return t.removeRow(r),t.getRoot()}},{key:"revert",value:function(e){var t=e.row,n=e.oldIndex,e=this._sheet;return e.addRow(t,n),e.getRoot()}}])&&l1(e.prototype,n),r&&l1(e,r),t}();function f1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}p1.$inject=["sheet"];var d1=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this._modeling=e}var e,n,r;return e=t,(n=[{key:"preExecute",value:function(e){e=e.row;this._modeling.removeRow(e)}},{key:"postExecute",value:function(e){var t=e.row,e=e.index;this._modeling.addRow(t,e)}}])&&f1(e.prototype,n),r&&f1(e,r),t}();function h1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}d1.$inject=["modeling"];var y1=function(){function n(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),this._sheet=e,this._elementFactory=t}var e,t,r;return e=n,(t=[{key:"execute",value:function(e){var t=this._sheet,n=this._elementFactory,r=t.getRoot(),o=e.col,i=e.index;return void 0===i&&(i=e.index=r.cols.length),e.newRoot=r,o.cells.length||r.rows.forEach(function(e,t){e=n.create("cell",{row:e,col:o});o.cells[t]=e}),t.addCol(o,i),t.getRoot()}},{key:"revert",value:function(e){var t=e.col,e=this._sheet;return e.removeCol(t),e.getRoot()}}])&&h1(e.prototype,t),r&&h1(e,r),n}();function m1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}y1.$inject=["sheet","elementFactory"];var v1=function(){function n(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),this._sheet=e,this._elementFactory=t}var e,t,r;return e=n,(t=[{key:"execute",value:function(e){var t=this._sheet,n=e.col,r=e.oldRoot=n.root;if(-1===(e.oldIndex=r.cols.indexOf(n)))throw new Error("col#".concat(n.id," not in sheet"));return t.removeCol(n),t.getRoot()}},{key:"revert",value:function(e){var t=e.col,n=e.oldIndex,e=this._sheet;return e.addCol(t,n),e.getRoot()}}])&&m1(e.prototype,t),r&&m1(e,r),n}();function g1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}v1.$inject=["sheet","elementFactory"];var b1=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this._modeling=e}var e,n,r;return e=t,(n=[{key:"preExecute",value:function(e){e=e.col;this._modeling.removeCol(e)}},{key:"postExecute",value:function(e){var t=e.col,e=e.index;this._modeling.addCol(t,e)}}])&&g1(e.prototype,n),r&&g1(e,r),t}();function _1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}b1.$inject=["modeling"];var w1=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,(n=[{key:"execute",value:function(e){return e.cell}},{key:"revert",value:function(e){return e.cell}}])&&_1(t.prototype,n),r&&_1(t,r),e}();function x1(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),n=e?n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}):n}function O1(r){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?x1(o,!0).forEach(function(e){var t,n;t=r,e=o[n=e],n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):x1(o).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))})}return r}function j1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var E1=function(){function n(e,t,r){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),this._eventBus=e,this._elementFactory=t,this._commandStack=r,e.on("table.init",function(){var e,n;e=o.getHandlers(),n=r,x(e,function(e,t){n.registerHandler(t,e)})})}var e,t,r;return e=n,r=[{key:"_getHandlers",value:function(){return{"row.add":s1,"row.remove":p1,"row.move":d1,"col.add":y1,"col.remove":v1,"col.move":b1,"cell.edit":w1}}}],(t=[{key:"getHandlers",value:function(){return n._getHandlers()}},{key:"_create",value:function(e,t){return t instanceof df?t:this._elementFactory.create(e,t)}},{key:"addRow",value:function(e,t){e=this._create("row",e);return this._commandStack.execute("row.add",{row:e,index:t}),e}},{key:"removeRow",value:function(e){this._commandStack.execute("row.remove",{row:e})}},{key:"moveRow",value:function(e,t){this._commandStack.execute("row.move",{row:e,index:t})}},{key:"addCol",value:function(e,t){e=this._create("col",e);return this._commandStack.execute("col.add",{col:e,index:t}),e}},{key:"removeCol",value:function(e){this._commandStack.execute("col.remove",{col:e})}},{key:"moveCol",value:function(e,t){this._commandStack.execute("col.move",{col:e,index:t})}},{key:"editCell",value:function(e,t){t=O1({cell:e},t);this._commandStack.execute("cell.edit",t)}}])&&j1(e.prototype,t),r&&j1(e,r),n}();function C1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}E1.$inject=["eventBus","elementFactory","commandStack"];var S1=function(){function r(e,t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this._dmnFactory=e,this._moddle=t,this._modeling=n}var e,t,n;return e=r,(t=[{key:"execute",value:function(e){var t=e.element,n=e.allowedValues;return en(t,"dmn:InputClause")?(t.inputValues?e.oldAllowedValues=t.inputValues.text:P1(n)||(t.inputValues=this._dmnFactory.create("dmn:UnaryTests",{text:""})),P1(n)?t.inputValues&&delete t.inputValues:t.inputValues.text=n.join(",")):(t.outputValues&&t?e.oldAllowedValues=t.outputValues.text:P1(n)||(t.outputValues=this._dmnFactory.create("dmn:UnaryTests",{text:""})),P1(n)?t.outputValues&&delete t.outputValues:t.outputValues.text=n.join(",")),t}},{key:"revert",value:function(e){var t=e.element,e=e.oldAllowedValues;return en(t,"dmn:InputClause")?e?(t.inputValues||(t.inputValues=this._dmnFactory.create("dmn:UnaryTests",{text:""})),t.inputValues.text=e):delete t.inputValues:e?(t.outputValues||(t.outputValues=this._dmnFactory.create("dmn:UnaryTests",{text:""})),t.outputValues.text=e):delete t.outputValues,t}}])&&C1(e.prototype,t),n&&C1(e,n),Object.defineProperty(e,"prototype",{writable:!1}),r}();function P1(e){return null===e}function k1(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function R1(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?k1(Object(n),!0).forEach(function(e){T1(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):k1(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function T1(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D1(e){return function(e){if(Array.isArray(e))return M1(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return M1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M1(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M1(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function B1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}S1.$inject=["dmnFactory","moddle","modeling"];var I1=function(){function n(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),this._elementRegistry=e,this._moddle=t}var e,t,r;return e=n,(t=[{key:"execute",value:function(e){var t=e.element,n=e.properties,r=rn(t),r=this.updateProperties(r,n),n=r.changed,r=r.oldProperties;return e.oldProperties=r,[].concat(D1(n),[t])}},{key:"revert",value:function(e){var t=e.element,n=e.oldProperties,e=rn(t),n=this.updateProperties(e,n).changed;return[].concat(D1(n),[t])}},{key:"updateProperties",value:function(a,e){var c=this,u=this._moddle.ids;return O(e,function(e,t,n){var r=a.get(n);if(A1(t)){if(!A1(r))throw new Error("non-existing property <".concat(n,">: cannot update values"));var o=c.updateProperties(r,t),i=o.changed,o=o.oldProperties;return{changed:[].concat(D1(e.changed),D1(i),[r]),oldProperties:R1(R1({},e.oldProperties),{},T1({},n,o))}}return"id"===n&&a.id!==t&&(u.unclaim(a.id),c._elementRegistry.updateId(a,t),u.claim(t,a)),a.set(n,t),{changed:e.changed,oldProperties:R1(R1({},e.oldProperties),{},T1({},n,r))}},{changed:[],oldProperties:{}})}}])&&B1(e.prototype,t),r&&B1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),n}();function A1(e){return f(e)&&_(e)}function N1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}I1.$inject=["elementRegistry","moddle"];var L1=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this._moddle=e}var e,n,r;return e=t,(n=[{key:"execute",value:function(e){var t=this._moddle.ids,n=e.id,r=e.element;e.claiming?t.claim(n,r):t.unclaim(n)}},{key:"revert",value:function(e){var t=this._moddle.ids,n=e.id,r=e.element;e.claiming?t.unclaim(n):t.claim(n,r)}}])&&N1(e.prototype,n),r&&N1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function $1(e){return($1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function V1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function z1(){return(z1="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=H1(e)););return e}(e,t);if(r){t=Object.getOwnPropertyDescriptor(r,t);return t.get?t.get.call(arguments.length<3?e:n):t.value}}).apply(this,arguments)}function F1(e,t){return(F1=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function U1(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=H1(n);return function(e,t){{if(t&&("object"===$1(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,r?(e=H1(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function H1(e){return(H1=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}L1.$inject=["moddle"];zi=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&F1(e,t)}(a,E1);var e,t,n,i=U1(a);function a(e,t,n,r){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(o=i.call(this,e,t,n))._eventBus=e,o._elementFactory=t,o._commandStack=n,o._sheet=r,o}return e=a,n=[{key:"_getHandlers",value:function(){return L({},z1(H1(a),"_getHandlers",this).call(this),{editAllowedValues:S1,"element.updateProperties":I1,"id.updateClaim":L1})}}],(t=[{key:"getHandlers",value:function(){return a._getHandlers()}},{key:"editDecisionTableName",value:function(e){var t=this._sheet.getRoot().businessObject.$parent;this._commandStack.execute("element.updateProperties",{element:t,properties:{name:e}})}},{key:"editDecisionTableId",value:function(e){var t=this._sheet.getRoot().businessObject.$parent;this._commandStack.execute("element.updateProperties",{element:t,properties:{id:e}})}},{key:"editHitPolicy",value:function(e,t){var n=this._sheet.getRoot().businessObject;this._commandStack.execute("element.updateProperties",{element:n,properties:{hitPolicy:e,aggregation:t}})}},{key:"updateProperties",value:function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})}},{key:"editInputExpression",value:function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})}},{key:"editOutputName",value:function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:{name:t}})}},{key:"editInputExpressionTypeRef",value:function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:{typeRef:t}})}},{key:"editOutputTypeRef",value:function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:{typeRef:t}})}},{key:"editCell",value:function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:{text:t}})}},{key:"editAnnotation",value:function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:{description:t}})}},{key:"editAllowedValues",value:function(e,t){this._commandStack.execute("editAllowedValues",{element:e,allowedValues:t})}},{key:"editExpressionLanguage",value:function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:{expressionLanguage:t}})}},{key:"claimId",value:function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t,claiming:!0})}},{key:"unclaimId",value:function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t})}}])&&V1(e.prototype,t),n&&V1(e,n),Object.defineProperty(e,"prototype",{writable:!1}),a}();function W1(e){return(W1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function q1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function G1(e,t){return(G1=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function K1(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=X1(n);return function(e,t){{if(t&&("object"===W1(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,r?(e=X1(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function X1(e){return(X1=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}zi.$inject=["eventBus","elementFactory","commandStack","sheet"];uc=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&G1(e,t)}(i,ts);var e,t,n,o=K1(i);function i(e,t,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(r=o.call(this,e))._ids=t.ids,r._modeling=n,r.preExecute(["row.add","col.add"],function(e){e=e.context,e=e.row||e.col;r.claimId(e.businessObject),e.cells&&e.cells.forEach(function(e){return r.claimId(e.businessObject)})}),r}return e=i,(t=[{key:"claimId",value:function(t){var n=this;t.id&&!this._ids.assigned(t.id)&&this._modeling.claimId(t.id,t),t.$descriptor.properties.forEach(function(e){e=t[e.name];e&&(y(e)&&e.forEach(function(e){return n.claimId(e)}),e.$type&&n.claimId(e))})}}])&&q1(e.prototype,t),n&&q1(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function Y1(e){return(Y1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Z1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Q1(e,t){return(Q1=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function J1(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=eO(n);return function(e,t){{if(t&&("object"===Y1(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,r?(e=eO(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function eO(e){return(eO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}uc.$inject=["eventBus","moddle","modeling"];Si=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Q1(e,t)}(o,ts);var e,t,n,r=J1(o);function o(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(n=r.call(this,e))._modeling=t,n.preExecute(["row.remove","col.remove"],function(e){e=e.context,e=e.row||e.col;n.unclaimId(e.businessObject),e.cells&&e.cells.forEach(function(e){return n.unclaimId(e.businessObject)})}),n}return e=o,(t=[{key:"unclaimId",value:function(t){var n=this;t.id&&this._modeling.unclaimId(t.id,t),t.$descriptor.properties.forEach(function(e){e=t[e.name];e&&(y(e)&&e.forEach(function(e){return n.unclaimId(e)}),e.$type&&n.unclaimId(e))})}}])&&Z1(e.prototype,t),n&&Z1(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();Si.$inject=["eventBus","modeling"];var tO={__init__:["dmnUpdater","idChangeBehavior","modeling"],__depends__:[{__init__:["idClaimBehavior","idUnclaimBehavior"],idClaimBehavior:["type",uc],idUnclaimBehavior:["type",Si]},nu],dmnUpdater:["type",_o],dmnFactory:["type",fu],elementFactory:["type",hr],idChangeBehavior:["type",da],modeling:["type",zi]};function nO(e){return(nO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function rO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function iO(e,t,n){return t&&oO(e.prototype,t),n&&oO(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function aO(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cO(e,t)}function cO(e,t){return(cO=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function uO(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=lO(n);return function(e,t){{if(t&&("object"===nO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return sO(e)}(this,r?(e=lO(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function sO(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lO(e){return(lO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var pO=function(){aO(r,rh);var n=uO(r);function r(e,t){return rO(this,r),(t=n.call(this,e,t)).state={isFocussed:!1},t.changeCellValue=t.changeCellValue.bind(sO(t)),t.onFocus=t.onFocus.bind(sO(t)),t.onBlur=t.onBlur.bind(sO(t)),t.onElementsChanged=t.onElementsChanged.bind(sO(t)),t}return iO(r,[{key:"onElementsChanged",value:function(){this.forceUpdate()}},{key:"componentWillMount",value:function(){var e=this.context.injector,t=this.props.cell,n=this._changeSupport=this.context.changeSupport;this._modeling=e.get("modeling"),n.onElementsChanged(t.id,this.onElementsChanged)}},{key:"componentWillUnmount",value:function(){var e=this.props.cell;this._changeSupport.offElementsChanged(e.id,this.onElementsChanged)}},{key:"changeCellValue",value:function(e){var t=this.props.cell;this._modeling.editCell(t.businessObject,e)}},{key:"onFocus",value:function(){this.setState({isFocussed:!0})}},{key:"onBlur",value:function(){this.setState({isFocussed:!1})}},{key:"render",value:function(){var e=this.props,t=e.cell,n=e.rowIndex,r=e.row,o=e.col,i=e.colIndex,a=this.state.isFocussed,c=en(t,"dmn:UnaryTests"),e=t.businessObject;return Wf(2,Yh,{className:c?"input-cell":"output-cell",elementId:t.id,coords:"".concat(n,":").concat(i),"data-row-id":r.id,"data-col-id":o.id,children:Wf(2,fO,{className:"cell-editor",placeholder:c?"-":"",ctrlForNewline:!0,onFocus:this.onFocus,onBlur:this.onBlur,isFocussed:a,onChange:this.changeCellValue,value:e.text,businessObject:e})})}}]),r}(),fO=function(){aO(r,eb);var n=uO(r);function r(e,t){return rO(this,r),(e=n.call(this,e,t))._expressionLanguages=t.injector.get("expressionLanguages"),e._translate=t.injector.get("translate"),e}return iO(r,[{key:"isDefaultExpressionLanguage",value:function(e){var t=e.expressionLanguage,e=this.getDefaultExpressionLanguage(e).value;return!t||t===e}},{key:"getDescription",value:function(e){return e.description}},{key:"getExpressionLanguageLabel",value:function(e){var t=e.expressionLanguage,e=this.getDefaultExpressionLanguage(e);return this._expressionLanguages.getLabel(t)||e.label}},{key:"isScript",value:function(e){var t=this.getDefaultExpressionLanguage(e);return!!en(e,"dmn:UnaryTests")&&(-1!==e.text.indexOf("\n")||e.expressionLanguage&&e.expressionLanguage!==t)}},{key:"getDefaultExpressionLanguage",value:function(e){e=en(e,"dmn:UnaryTests")?"inputCell":"outputCell";return this._expressionLanguages.getDefault(e)}},{key:"render",value:function(){var e=this.props,t=e.businessObject,n=e.isFocussed,r=this.getDescription(t),o=this.isDefaultExpressionLanguage(t),e=this.getExpressionLanguageLabel(t),t=this.isScript(t);return Hf(1,"div",this.getClassName(),[v(r)&&!n&&Hf(1,"div","description-indicator"),this.getEditor({className:t?"script-editor":null}),!o&&!n&&Hf(1,"span","dms-badge dmn-expression-language",[Hf(1,"span","dms-badge-icon dmn-icon-file-code"),Hf(1,"span","dms-badge-label",e,0)],4,{title:this._translate("Expression Language = {expressionLanguageLabel}",{expressionLanguageLabel:e})})],0)}}]),r}();function dO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function hO(e,t,n){return t&&dO(e.prototype,t),n&&dO(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}fu=hO(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("cell",1500,function(e){if("rule"===e.cellType)return pO})});fu.$inject=["components"];var yO={__depends__:[Ni,bm],__init__:["decisionRulesEditor"],decisionRulesEditor:["type",fu]};function mO(e){return(mO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vO(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function gO(r){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?vO(Object(o),!0).forEach(function(e){var t,n;t=r,e=o[n=e],n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):vO(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))})}return r}function bO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _O(e,t){return(_O=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function wO(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=OO(n);return function(e,t){{if(t&&("object"===mO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return xO(e)}(this,r?(e=OO(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function xO(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function OO(e){return(OO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var jO=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_O(e,t)}(o,rh);var e,t,n,r=wO(o);function o(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,e,t)).state={top:0,left:0,isVisible:!1,isDisabled:!1,selection:null},Rh(xO(e));t=xO(e).debounceInput;return e.onClick=e.onClick.bind(xO(e)),e.handleSelectionChanged=e.handleSelectionChanged.bind(xO(e)),e.hideAndShowDebounced=e.hideAndShowDebounced.bind(xO(e)),e.showDebounced=t(e.showDebounced.bind(xO(e))),e.updatePosition=e.updatePosition.bind(xO(e)),e}return e=o,(t=[{key:"componentDidMount",value:function(){var e=this.eventBus;e.on("cellSelection.changed",this.handleSelectionChanged),e.on("commandStack.changed",this.updatePosition),e.on("sheet.scroll",this.hideAndShowDebounced)}},{key:"componentWillUnmount",value:function(){var e=this.eventBus;e.off("cellSelection.changed",this.handleSelectionChanged),e.off("commandStack.changed",this.updatePosition),e.off("sheet.scroll",this.hideAndShowDebounced)}},{key:"hideAndShowDebounced",value:function(){this.state.isVisible&&(this.hide(),this.showDebounced())}},{key:"showDebounced",value:function(){this.show()}},{key:"hide",value:function(){this.setState(gO(gO({},0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}),{},{isVisible:!1}))}},{key:"show",value:function(){this.setState(gO(gO({},0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}),{},{isVisible:!0})),this.updatePosition()}},{key:"handleSelectionChanged",value:function(e){var t=e.elementId,n=this.elementRegistry,r=this.expressionLanguages,e=this.simpleMode,n=n.get(t);n&&e.canSimpleEdit(n)?(t=n.businessObject.expressionLanguage,e=n,r=r,r=!(!(t=t)||t===function(e,t){{if(tn(e.col))return t.getDefault("inputCell").value;if(nn(e.col))return t.getDefault("outputCell").value}}(e,r)),this.show({isDisabled:r,selection:n})):this.hide({isDisabled:!1,selection:null})}},{key:"updatePosition",value:function(){var e,t,n,r,o,i=this.state.selection,a=this.node;i&&a&&(e=(r=this.renderer.getContainer()).getBoundingClientRect(),t=Xv(i.id,r).getBoundingClientRect(),n=this.node.getBoundingClientRect(),i=(o=function(e){var t=xt(e,".tjs-table-container");if(!t)return{scrollTop:0,scrollLeft:0};e=t.scrollLeft;return{scrollTop:t.scrollTop,scrollLeft:e}}(a)).scrollLeft,r=o.scrollTop,o={},t.left+t.width/2>e.width/2?(o.left=-e.left+t.left-n.width+4+i+"px",a.classList.remove("right"),a.classList.add("left")):(o.left=-e.left+t.left+t.width-4+i+"px",a.classList.remove("left"),a.classList.add("right")),t.top+t.height/2>e.height/2?(o.top=-e.top+t.top-n.height+4+r+"px",a.classList.remove("top"),a.classList.add("bottom")):(o.top=-e.top+t.top-4+r+"px",a.classList.remove("bottom"),a.classList.add("top")),L(this.node.style,o))}},{key:"onClick",value:function(){var e,t=this.eventBus;this.state.isDisabled||(e=this.selection.get())&&(t.fire("simpleMode.open",{element:e,node:Xv(e.id,this._container)}),this.hide())}},{key:"render",value:function(){var t=this,e=this.state,n=e.isDisabled,r=e.isVisible,o=e.top,i=e.left,e=["simple-mode-button","no-deselect"];return n&&e.push("disabled"),r?Hf(1,"div",e.join(" "),Hf(1,"span","dmn-icon-edit"),2,{onClick:this.onClick,style:{top:o,left:i},title:n?"Editing not supported for set expression language":"Edit"},null,function(e){return t.node=e}):null}}])&&bO(e.prototype,t),n&&bO(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function EO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}jO.$inject=["debounceInput","elementRegistry","eventBus","expressionLanguages","renderer","selection","simpleMode"];hr=function(){function t(e,a,o,i,c){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this._providers=[],e.onGetComponent("table.before",function(){return jO}),i.on("simpleMode.open",function(e){var t=e.element,n=e.node.getBoundingClientRect(),r=n.left,o=n.top,i=n.width,e=n.height,n=c.getContainer();a.open({x:r+n.parentNode.scrollLeft,y:o+n.parentNode.scrollTop,width:i,height:e},{contextMenuType:"simple-mode-edit",element:t,offset:{x:4,y:4}})}),i.on("cell.click",function(e){var t=e.event,n=e.node,r=e.id;!function(e){if(e.altKey)return!1;return e.ctrlKey||e.metaKey}(t)||((r=o.get(r))&&i.fire("simpleMode.open",{node:n,element:r}),e.preventDefault())})}var e,n,r;return e=t,(n=[{key:"registerProvider",value:function(e){this._providers.push(e)}},{key:"canSimpleEdit",value:function(n){return this._providers.reduce(function(e,t){return e||t(n)},!1)}}])&&EO(e.prototype,n),r&&EO(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();hr.$inject=["components","contextMenu","elementRegistry","eventBus","renderer"];var CO={__depends__:[Db,eg,Zy],__init__:["simpleMode"],simpleMode:["type",hr]};function SO(e){return(SO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function PO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function kO(e,t){return(kO=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function RO(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=DO(n);return function(e,t){{if(t&&("object"===SO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return TO(e)}(this,r?(e=DO(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function TO(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function DO(e){return(DO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var MO="none",BO=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kO(e,t)}(o,rh);var e,t,n,r=RO(o);function o(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,e,t))._modeling=t.injector.get("modeling");var t=e.props.context.element,t=(t=t.businessObject.text)&&""!==t?"true"===t.trim()?"true":"false"===t.trim()?"false":void 0:"none";return e.state={value:t||MO},e.editCell=e.editCell.bind(TO(e)),e.onChange=e.onChange.bind(TO(e)),e}return e=o,(t=[{key:"editCell",value:function(e,t){this._modeling.editCell(e,t)}},{key:"onChange",value:function(e){var t=this.props.context.element;this.editCell(t.businessObject,e===MO?"":e),this.setState({value:e})}},{key:"render",value:function(){var e=this.state.value,t=[{label:"-",value:MO},{label:"Yes",value:"true"},{label:"No",value:"false"}];return Hf(1,"div","simple-boolean-edit context-menu-container",[Hf(1,"h3","dms-heading",qf("Edit Boolean"),2),Hf(1,"h4","dms-heading",qf("Set Value"),2),Wf(2,Cw,{noInput:!0,className:"dms-block",onChange:this.onChange,options:t,value:e})],4)}}])&&PO(e.prototype,t),n&&PO(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function IO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function AO(e,t,n){return t&&IO(e.prototype,t),n&&IO(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}zi=AO(function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n.registerProvider(function(e){return(tn(e.col)||nn(e.col))&&"boolean"===NO(e)}),t.onGetComponent("context-menu",function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(e.contextMenuType&&"simple-mode-edit"===e.contextMenuType&&e.element)return"boolean"===NO(e.element)?BO:void 0})});function NO(e){return tn(e.col)?e.col&&e.col.businessObject.inputExpression.typeRef:e.col&&e.col.businessObject.typeRef}zi.$inject=["components","simpleMode"];var LO={__depends__:[I0,CO],__init__:["simpleBooleanEdit"],simpleBooleanEdit:["type",zi]},$O=/^\d{4}(?:-\d\d){2}$/,VO=/^\[date\("([^"]*)"\)..date\("([^"]*)"\)\]$/,zO=/^(<|>)\s*date\("([^"]*)"\)$/,FO=/^date\("([^"]*)"\)$/;function UO(e){if(!$O.test(e.trim()))return"Date must match pattern yyyy-MM-dd."}function HO(e,t){return"exact"===e?'date("'.concat(t[0],'")'):"before"===e?'< date("'.concat(t[0],'")'):"after"===e?'> date("'.concat(t[0],'")'):"between"===e?'[date("'.concat(t[0],'")..date("').concat(t[1],'")]'):void 0}function WO(){var e=new Date;return e.setUTCHours(0,0,0,0),e.toISOString().slice(0,10)}function qO(e){if(!e||""===e.trim())return{type:"exact",date:""};var t=e.match(VO);return t?{type:"between",dates:[t[1],t[2]]}:(t=e.match(zO))?{type:"<"===t[1]?"before":"after",date:t[2]}:(t=e.match(FO))?{type:"exact",date:t[1]}:void 0}function GO(e){return(GO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function KO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function XO(e,t){return(XO=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function YO(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=QO(n);return function(e,t){{if(t&&("object"===GO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return ZO(e)}(this,r?(e=QO(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function ZO(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function QO(e){return(QO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var JO="between",ej=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&XO(e,t)}(i,rh);var e,t,n,o=YO(i);function i(e,t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(n=o.call(this,e,t))._modeling=t.injector.get("modeling");var r=qO(n.props.context.element.businessObject.text);r?(e=r.date?[r.date,""]:r.dates||["",""],n.state={type:r.type,dates:e}):n.state={type:"exact",dates:["",""]};t=t.injector.get("debounceInput");return n.debouncedEditCell=t(n.editCell.bind(ZO(n))),n.editCell=n.editCell.bind(ZO(n)),n.onTypeChange=n.onTypeChange.bind(ZO(n)),n.onSetStartDateTodayClick=n.onSetStartDateTodayClick.bind(ZO(n)),n.onSetEndDateTodayClick=n.onSetEndDateTodayClick.bind(ZO(n)),n.onStartDateInput=n.onStartDateInput.bind(ZO(n)),n.onEndDateInput=n.onEndDateInput.bind(ZO(n)),n}return e=i,(t=[{key:"editCell",value:function(e,t){this._modeling.editCell(e,t)}},{key:"onTypeChange",value:function(e){var t=this.props.context.element,n=this.state.dates;this.setState({type:e}),qO(HO(e,n))&&this.editCell(t.businessObject,HO(e,n))}},{key:"onSetStartDateTodayClick",value:function(){var e=this.props.context.element,t=this.state,n=t.dates,r=t.type,t=WO();this.setState({dates:[t,n[1]]}),qO(HO(r,[t,n[1]]))&&this.editCell(e.businessObject,HO(r,[t,n[1]]))}},{key:"onSetEndDateTodayClick",value:function(){var e=this.props.context.element,t=this.state,n=t.dates,r=t.type,t=WO();this.setState({dates:[n[0],t]}),qO(HO(r,[n[0],t]))&&this.editCell(e.businessObject,HO(r,[n[0],t]))}},{key:"onStartDateInput",value:function(e){var t=e.value,n=this.props.context.element,r=this.state,e=r.dates,r=r.type;this.setState({dates:[t,e[1]]}),this.debouncedEditCell(n.businessObject,HO(r,[t,e[1]]))}},{key:"onEndDateInput",value:function(e){var t=e.value,n=this.props.context.element,r=this.state,e=r.dates,r=r.type;this.setState({dates:[e[0],t]}),this.debouncedEditCell(n.businessObject,HO(r,[e[0],t]))}},{key:"render",value:function(){var e=this.state,t=e.dates,n=e.type,e=[{label:"Exactly",value:"exact"},{label:"Before",value:"before"},{label:"After",value:"after"},{label:"Between",value:JO}];return Hf(1,"div","context-menu-container simple-date-edit",[Hf(1,"h3","dms-heading",qf("Edit date"),2),Hf(1,"div","dms-fill-row",Wf(2,Cw,{noInput:!0,onChange:this.onTypeChange,options:e,value:n}),2),Hf(1,"h4","dms-heading",n===JO?"Edit start date":"Set date",0),Hf(1,"div",null,[Wf(2,n0,{className:"start-date-input dms-block",onInput:this.onStartDateInput,placeholder:"e.g. ".concat(WO()),validate:UO,value:t[0]}),Hf(1,"p","dms-hint",[Hf(1,"button","use-today",qf("Use today"),2,{type:"button",onClick:this.onSetStartDateTodayClick}),qf(".")],4)],4),n===JO&&Hf(1,"h4","dms-heading",qf("Edit end date"),2),n===JO&&Hf(1,"div",null,[Wf(2,n0,{className:"end-date-input dms-block",onInput:this.onEndDateInput,placeholder:"e.g. ".concat(WO()),validate:UO,value:t[1]}),Hf(1,"p","dms-hint",[Hf(1,"button","use-today",qf("Use today"),2,{type:"button",onClick:this.onSetEndDateTodayClick}),qf(".")],4)],4)],0)}}])&&KO(e.prototype,t),n&&KO(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function tj(e){return(tj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function rj(e,t){return(rj=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function oj(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=aj(n);return function(e,t){{if(t&&("object"===tj(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return ij(e)}(this,r?(e=aj(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function ij(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aj(e){return(aj=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var cj=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rj(e,t)}(o,rh);var e,t,n,r=oj(o);function o(e,t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(n=r.call(this,e,t))._modeling=t.injector.get("modeling");e=qO(n.props.context.element.businessObject.text);n.state={date:e?e.date:""};t=t.injector.get("debounceInput");return n.debouncedEditCell=t(n.editCell.bind(ij(n))),n.editCell=n.editCell.bind(ij(n)),n.onClick=n.onClick.bind(ij(n)),n.onInput=n.onInput.bind(ij(n)),n}return e=o,(t=[{key:"editCell",value:function(e,t){this._modeling.editCell(e,t)}},{key:"onClick",value:function(){var e=this.props.context.element,t=WO();this.setState({date:t}),this.editCell(e.businessObject,'date("'.concat(t,'")'))}},{key:"onInput",value:function(e){var t=e.value,e=this.props.context.element;this.setState({date:t}),this.debouncedEditCell(e.businessObject,'date("'.concat(t,'")'))}},{key:"render",value:function(){var e=this.state.date;return Hf(1,"div","context-menu-container simple-date-edit",[Hf(1,"h3","dms-heading",qf("Edit date"),2),Hf(1,"h4","dms-heading",qf("Set date"),2),Hf(1,"div",null,[Wf(2,n0,{onInput:this.onInput,placeholder:"e.g. ".concat(WO()),validate:UO,value:e,className:"dms-block"}),Hf(1,"p","dms-hint",[qf("Set date "),Hf(1,"button","use-today",qf("to today"),2,{type:"button",onClick:this.onClick}),qf(".")],4)],4)],4)}}])&&nj(e.prototype,t),n&&nj(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function uj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function sj(e,t,n){return t&&uj(e.prototype,t),n&&uj(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}fu=sj(function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n.registerProvider(function(e){var t=lj(e);return(tn(e.col)||nn(e.col))&&pj(t)}),t.onGetComponent("context-menu",function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(e.contextMenuType&&"simple-mode-edit"===e.contextMenuType&&e.element)return pj(lj(e.element))?tn(e.element.col)?ej:nn(e.element.col)?cj:void 0:void 0})});function lj(e){return tn(e.col)?e.col&&e.col.businessObject.inputExpression.typeRef:e.col&&e.col.businessObject.typeRef}function pj(e){return"date"===e}fu.$inject=["components","simpleMode"];var fj={__depends__:[I0,CO],__init__:["simpleDateEdit"],simpleDateEdit:["type",fu]},dj=/^\d{4}(?:-\d\d){2}T(?:\d\d:){2}\d\d(?:Z|(?:[@+-][^")]+))?$/,hj=/^\[date and time\("([^"]*)"\)..date and time\("([^"]*)"\)\]$/,yj=/^(<|>)\s*date and time\("([^"]*)"\)$/,mj=/^date and time\("([^"]*)"\)$/;function vj(e){if(!dj.test(e.trim()))return"Date and time must match pattern yyyy-MM-ddTHH:mm:ss[time zone]."}function gj(e,t){return"exact"===e?'date and time("'.concat(t[0],'")'):"before"===e?'< date and time("'.concat(t[0],'")'):"after"===e?'> date and time("'.concat(t[0],'")'):"between"===e?'[date and time("'.concat(t[0],'")..date and time("').concat(t[1],'")]'):void 0}function bj(){var e=new Date;return e.setUTCHours(0,0,0,0),e.toISOString().replace(".000Z","Z")}function _j(e){if(!e||""===e.trim())return{type:"exact",date:""};var t=e.match(hj);return t?{type:"between",dates:[t[1],t[2]]}:(t=e.match(yj))?{type:"<"===t[1]?"before":"after",date:t[2]}:(t=e.match(mj))?{type:"exact",date:t[1]}:void 0}function wj(e){return(wj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Oj(e,t){return(Oj=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function jj(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=Cj(n);return function(e,t){{if(t&&("object"===wj(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return Ej(e)}(this,r?(e=Cj(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function Ej(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cj(e){return(Cj=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Sj="between",Pj=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Oj(e,t)}(i,rh);var e,t,n,o=jj(i);function i(e,t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(n=o.call(this,e,t))._modeling=t.injector.get("modeling");var r=_j(n.props.context.element.businessObject.text);r?(e=r.date?[r.date,""]:r.dates||["",""],n.state={type:r.type,dates:e}):n.state={type:"exact",dates:["",""]};t=t.injector.get("debounceInput");return n.debouncedEditCell=t(n.editCell.bind(Ej(n))),n.editCell=n.editCell.bind(Ej(n)),n.onTypeChange=n.onTypeChange.bind(Ej(n)),n.onSetStartDateTodayClick=n.onSetStartDateTodayClick.bind(Ej(n)),n.onSetEndDateTodayClick=n.onSetEndDateTodayClick.bind(Ej(n)),n.onStartDateInput=n.onStartDateInput.bind(Ej(n)),n.onEndDateInput=n.onEndDateInput.bind(Ej(n)),n}return e=i,(t=[{key:"editCell",value:function(e,t){this._modeling.editCell(e,t)}},{key:"onTypeChange",value:function(e){var t=this.props.context.element,n=this.state.dates;this.setState({type:e}),_j(gj(e,n))&&this.editCell(t.businessObject,gj(e,n))}},{key:"onSetStartDateTodayClick",value:function(){var e=this.props.context.element,t=this.state,n=t.dates,r=t.type,t=bj();this.setState({dates:[t,n[1]]}),_j(gj(r,[t,n[1]]))&&this.editCell(e.businessObject,gj(r,[t,n[1]]))}},{key:"onSetEndDateTodayClick",value:function(){var e=this.props.context.element,t=this.state,n=t.dates,r=t.type,t=bj();this.setState({dates:[n[0],t]}),_j(gj(r,[n[0],t]))&&this.editCell(e.businessObject,gj(r,[n[0],t]))}},{key:"onStartDateInput",value:function(e){var t=e.value,n=this.props.context.element,r=this.state,e=r.dates,r=r.type;this.setState({dates:[t,e[1]]}),this.debouncedEditCell(n.businessObject,gj(r,[t,e[1]]))}},{key:"onEndDateInput",value:function(e){var t=e.value,n=this.props.context.element,r=this.state,e=r.dates,r=r.type;this.setState({dates:[e[0],t]}),this.debouncedEditCell(n.businessObject,gj(r,[e[0],t]))}},{key:"render",value:function(){var e=this.state,t=e.dates,n=e.type,e=[{label:"Exactly",value:"exact"},{label:"Before",value:"before"},{label:"After",value:"after"},{label:"Between",value:Sj}];return Hf(1,"div","context-menu-container simple-date-edit",[Hf(1,"h3","dms-heading",qf("Edit date and time"),2),Hf(1,"div","dms-fill-row",Wf(2,Cw,{noInput:!0,onChange:this.onTypeChange,options:e,value:n}),2),Hf(1,"h4","dms-heading",n===Sj?"Edit start date":"Set date",0),Hf(1,"div",null,[Wf(2,n0,{className:"start-date-input dms-block",onInput:this.onStartDateInput,placeholder:"e.g. ".concat(bj()),validate:vj,value:t[0]}),Hf(1,"p","dms-hint",[Hf(1,"button","use-today",qf("Use today"),2,{type:"button",onClick:this.onSetStartDateTodayClick}),qf(".")],4)],4),n===Sj&&Hf(1,"h4","dms-heading",qf("Edit end date"),2),n===Sj&&Hf(1,"div",null,[Wf(2,n0,{className:"end-date-input dms-block",onInput:this.onEndDateInput,placeholder:"e.g. ".concat(bj()),validate:vj,value:t[1]}),Hf(1,"p","dms-hint",[Hf(1,"button","use-today",qf("Use today"),2,{type:"button",onClick:this.onSetEndDateTodayClick}),qf(".")],4)],4)],0)}}])&&xj(e.prototype,t),n&&xj(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function kj(e){return(kj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Rj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Tj(e,t){return(Tj=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Dj(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=Bj(n);return function(e,t){{if(t&&("object"===kj(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return Mj(e)}(this,r?(e=Bj(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function Mj(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bj(e){return(Bj=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ij=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Tj(e,t)}(o,rh);var e,t,n,r=Dj(o);function o(e,t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(n=r.call(this,e,t))._modeling=t.injector.get("modeling");e=_j(n.props.context.element.businessObject.text);n.state={date:e?e.date:""};t=t.injector.get("debounceInput");return n.debouncedEditCell=t(n.editCell.bind(Mj(n))),n.editCell=n.editCell.bind(Mj(n)),n.onClick=n.onClick.bind(Mj(n)),n.onInput=n.onInput.bind(Mj(n)),n}return e=o,(t=[{key:"editCell",value:function(e,t){this._modeling.editCell(e,t)}},{key:"onClick",value:function(){var e=this.props.context.element,t=bj();this.setState({date:t}),this.editCell(e.businessObject,'date and time("'.concat(t,'")'))}},{key:"onInput",value:function(e){var t=e.value,e=this.props.context.element;this.setState({date:t}),this.debouncedEditCell(e.businessObject,'date and time("'.concat(t,'")'))}},{key:"render",value:function(){var e=this.state.date;return Hf(1,"div","context-menu-container simple-date-edit",[Hf(1,"h3","dms-heading",qf("Edit date and time"),2),Hf(1,"h4","dms-heading",qf("Set date and time"),2),Hf(1,"div",null,[Wf(2,n0,{onInput:this.onInput,placeholder:"e.g. ".concat(bj()),validate:vj,value:e,className:"dms-block"}),Hf(1,"p","dms-hint",[qf("Use "),Hf(1,"button","use-today",qf("today"),2,{type:"button",onClick:this.onClick}),qf(".")],4)],4)],4)}}])&&Rj(e.prototype,t),n&&Rj(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function Aj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Nj(e,t,n){return t&&Aj(e.prototype,t),n&&Aj(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}hr=Nj(function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n.registerProvider(function(e){var t=Lj(e);return(tn(e.col)||nn(e.col))&&$j(t)}),t.onGetComponent("context-menu",function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(e.contextMenuType&&"simple-mode-edit"===e.contextMenuType&&e.element)return $j(Lj(e.element))?tn(e.element.col)?Pj:nn(e.element.col)?Ij:void 0:void 0})});function Lj(e){return tn(e.col)?e.col&&e.col.businessObject.inputExpression.typeRef:e.col&&e.col.businessObject.typeRef}function $j(e){return"dateTime"===e}hr.$inject=["components","simpleMode"];var Vj={__depends__:[I0,CO],__init__:["simpleDateTimeEdit"],simpleDateTimeEdit:["type",hr]};function zj(e){return(zj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Fj(){Fj=function(e,t){return new r(e,void 0,t)};var o=RegExp.prototype,i=new WeakMap;function r(e,t,n){t=new RegExp(e,t);return i.set(t,n||i.get(e)),Uj(t,r.prototype)}function a(n,e){var r=i.get(e);return Object.keys(r).reduce(function(e,t){return e[t]=n[r[t]],e},Object.create(null))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Uj(e,t)}(r,RegExp),r.prototype.exec=function(e){e=o.exec.call(this,e);return e&&(e.groups=a(e,this)),e},r.prototype[Symbol.replace]=function(e,t){if("string"==typeof t){var n=i.get(this);return o[Symbol.replace].call(this,e,t.replace(/\$<([^>]+)>/g,function(e,t){return"$"+n[t]}))}if("function"!=typeof t)return o[Symbol.replace].call(this,e,t);var r=this;return o[Symbol.replace].call(this,e,function(){var e=arguments;return"object"!=zj(e[e.length-1])&&(e=[].slice.call(e)).push(a(e,r)),t.apply(this,e)})},Fj.apply(this,arguments)}function Uj(e,t){return(Uj=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Hj={equals:"=",less:"<",lessEquals:"<=",greater:">",greaterEquals:">="};function Wj(e){if(!e||""===e.trim())return{type:"comparison",values:[]};var t=function(e){var t=Kj(e);if(t)return{type:"comparison",operator:"equals",values:[t]};t=Xj(Fj(/^(=|(:?<|>)=?)[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*duration\("((?:(?!")[\s\S])*)"\)$/,{operator:1,value:3}),e),e=t.operator,t=t.value;if(e&&t)return{type:"comparison",values:[t],operator:function(t){return S(Hj).filter(function(e){return t===Hj[e]})[0]}(e)}}(e);if(t)return t;e=function(e){var t=Xj(Fj(/^([\[\]])duration\("((?:(?!")[\s\S])*)"\)\.\.duration\("((?:(?!")[\s\S])*)"\)([\[\]])$/,{start:1,firstValue:2,secondValue:3,end:4}),e),n=t.start,r=t.end,e=t.firstValue,t=t.secondValue;if(n&&r)return{type:"range",values:[e,t],start:"]"===n?"exclude":"include",end:"["===r?"exclude":"include"}}(e);return e||void 0}function qj(e,t){return("equals"===e?'duration("':"".concat(Hj[e],' duration("')).concat(t,'")')}function Gj(e,t,n,r){r="exclude"===r?"[":"]";return"".concat("exclude"===n?"]":"[",'duration("').concat(e,'")')+'..duration("'.concat(t,'")').concat(r)}function Kj(e){e=/^duration\("([^"]*)"\)$/.exec(e);return e&&e[1]}function Xj(e,t){return(e.exec(t)||{groups:{}}).groups}function Yj(e){return(Yj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Zj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Qj(e,t){return(Qj=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Jj(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=tE(n);return function(e,t){{if(t&&("object"===Yj(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return eE(e)}(this,r?(e=tE(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function eE(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tE(e){return(tE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var nE={yearMonthDuration:"Must match PnYnM.",dayTimeDuration:"Must match PnDTnH."},rE=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qj(e,t)}(o,rh);var e,t,n,r=Jj(o);function o(e,t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=r.call(this,e,t))._type=e.type,t.onInput=t.onInput.bind(eE(t)),t.validate=t.validate.bind(eE(t)),t.state={value:e.value},t}return e=o,(t=[{key:"onInput",value:function(e){e=e.value;this.setState({value:e}),this.props.onInput(e)}},{key:"validate",value:function(e){if(t=this._type,e=e,!("yearMonthDuration"===t?/^P(\d+Y\d+M|\d+Y|\d+M)$/.test(e):"dayTimeDuration"===t&&/^P(\d+DT\d+H|\d+D|T\d+H)$/.test(e)))return nE[this._type];var t}},{key:"_getPlaceholder",value:function(){return"yearMonthDuration"===this._type?"e.g. P1Y2M":"dayTimeDuration"===this._type?"e.g. P1DT2H":void 0}},{key:"render",value:function(){return Wf(2,n0,{type:"text",onInput:this.onInput,placeholder:this._getPlaceholder(),validate:this.validate,value:this.state.value,className:this.props.className})}}])&&Zj(e.prototype,t),n&&Zj(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function oE(e){return(oE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function iE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function aE(e,t){return(aE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function cE(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=sE(n);return function(e,t){{if(t&&("object"===oE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return uE(e)}(this,r?(e=sE(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function uE(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sE(e){return(sE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var lE="comparison",pE="range",fE=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&aE(e,t)}(o,rh);var e,t,n,r=cE(o);function o(e,t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(n=r.call(this,e,t))._modeling=t.injector.get("modeling");e=n.props.context.element;n._type=e.col.businessObject.inputExpression.typeRef;e=Wj(e.businessObject.text,n._type);n.state=e?{type:e.type,comparisonOperator:e.operator||"equals",startValue:e.values[0]||"",endValue:e.values[1]||"",rangeStartType:e.start||"include",rangeEndType:e.end||"include"}:{type:lE,comparisonOperator:"equals",startValue:"",endValue:"",rangeStartType:"include",rangeEndType:"include"};t=t.injector.get("debounceInput");return n.debouncedEditCell=t(n.editCell.bind(uE(n))),n.editCell=n.editCell.bind(uE(n)),n.onComparisonOperatorChange=n.onComparisonOperatorChange.bind(uE(n)),n.onComparisonValueChange=n.onComparisonValueChange.bind(uE(n)),n.onTypeChange=n.onTypeChange.bind(uE(n)),n.onRangeStartTypeChange=n.onRangeStartTypeChange.bind(uE(n)),n.onRangeStartValueChange=n.onRangeStartValueChange.bind(uE(n)),n.onRangeEndTypeChange=n.onRangeEndTypeChange.bind(uE(n)),n.onRangeEndValueChange=n.onRangeEndValueChange.bind(uE(n)),n}return e=o,(t=[{key:"editCell",value:function(e,t){this._modeling.editCell(e,t)}},{key:"onTypeChange",value:function(e){var t=this.props.context.element,n=this.state,r=n.comparisonOperator,o=n.startValue,i=n.endValue,a=n.rangeStartType,n=n.rangeEndType;e===lE?this.editCell(t.businessObject,qj(r,o)):this.editCell(t.businessObject,Gj(o,i,a,n)),this.setState({type:e})}},{key:"onComparisonOperatorChange",value:function(e){var t=this.props.context.element,n=this.state,r=n.type,n=n.startValue;r===lE&&(this.editCell(t.businessObject,qj(e,n)),this.setState({comparisonOperator:e}))}},{key:"onComparisonValueChange",value:function(e){var t=this.props.context.element,n=this.state,r=n.type,n=n.comparisonOperator;r===lE&&(this.debouncedEditCell(t.businessObject,qj(n,e)),this.setState({startValue:e}))}},{key:"onRangeStartTypeChange",value:function(e){var t=this.props.context.element,n=this.state,r=n.type,o=n.startValue,i=n.endValue,n=n.rangeEndType;r===pE&&(this.editCell(t.businessObject,Gj(o,i,e,n)),this.setState({rangeStartType:e}))}},{key:"onRangeStartValueChange",value:function(e){var t=this.props.context.element,n=this.state,r=n.type,o=n.endValue,i=n.rangeStartType,n=n.rangeEndType;r===pE&&(this.editCell(t.businessObject,Gj(e,o,i,n)),this.setState({startValue:e}))}},{key:"onRangeEndTypeChange",value:function(e){var t=this.props.context.element,n=this.state,r=n.type,o=n.startValue,i=n.endValue,n=n.rangeStartType;r===pE&&(this.editCell(t.businessObject,Gj(o,i,n,e)),this.setState({rangeEndType:e}))}},{key:"onRangeEndValueChange",value:function(e){var t=this.props.context.element,n=this.state,r=n.type,o=n.startValue,i=n.rangeStartType,n=n.rangeEndType;r===pE&&(this.editCell(t.businessObject,Gj(o,e,i,n)),this.setState({endValue:e}))}},{key:"renderComparison",value:function(e,t){return Hf(1,"div","comparison",[Hf(1,"h4","dms-heading",qf("Value"),2),Hf(1,"div","dms-fill-row dms-input-duration-edit-row",[Wf(2,Cw,{noInput:!0,onChange:this.onComparisonOperatorChange,options:[{label:"Equals",value:"equals"},{label:"Less",value:"less"},{label:"Less or equals",value:"lessEquals"},{label:"Greater",value:"greater"},{label:"Greater or equals",value:"greaterEquals"}],value:e}),qf(" "),Wf(2,rE,{type:this._type,className:"comparison-duration-input",onInput:this.onComparisonValueChange,value:t})],4)],4)}},{key:"renderRange",value:function(e,t,n,r){var o=[{label:"Include",value:"include"},{label:"Exclude",value:"exclude"}];return Hf(1,"div","range",[Hf(1,"h4","dms-heading",qf("Start value"),2),Hf(1,"div","dms-fill-row dms-input-duration-edit-row",[Wf(2,Cw,{noInput:!0,onChange:this.onRangeStartTypeChange,options:o,value:n}),qf(" "),Wf(2,rE,{type:this._type,className:"range-start-duration-input",onInput:this.onRangeStartValueChange,value:e})],4),Hf(1,"h4","dms-heading",qf("End value"),2),Hf(1,"div","dms-fill-row dms-input-duration-edit-row",[Wf(2,Cw,{noInput:!0,onChange:this.onRangeEndTypeChange,options:o,value:r}),qf(" "),Wf(2,rE,{type:this._type,className:"range-end-duration-input",onInput:this.onRangeEndValueChange,value:t})],4)],4)}},{key:"render",value:function(){var e=this.state,t=e.type,n=e.comparisonOperator,r=e.startValue,o=e.endValue,i=e.rangeStartType,a=e.rangeEndType,e=[{label:"Comparison",value:lE},{label:"Range",value:pE}];return Hf(1,"div","context-menu-container simple-duration-edit",[Hf(1,"h3","dms-heading",qf("Edit duration"),2),Hf(1,"div","dms-fill-row",Wf(2,Cw,{noInput:!0,onChange:this.onTypeChange,options:e,value:t}),2),t===lE&&this.renderComparison(n,r),t===pE&&this.renderRange(r,o,i,a)],0)}}])&&iE(e.prototype,t),n&&iE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function dE(e){return(dE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function hE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function yE(e,t){return(yE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function mE(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=gE(n);return function(e,t){{if(t&&("object"===dE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return vE(e)}(this,r?(e=gE(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function vE(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gE(e){return(gE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var bE=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yE(e,t)}(o,rh);var e,t,n,r=mE(o);function o(e,t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(n=r.call(this,e,t))._modeling=t.injector.get("modeling");e=n.props.context.element;n._type=e.col.businessObject.typeRef;t=t.injector.get("debounceInput");return n.debouncedEditCell=t(n.editCell.bind(vE(n))),n.editCell=n.editCell.bind(vE(n)),n.onInput=n.onInput.bind(vE(n)),n}return e=o,(t=[{key:"editCell",value:function(e,t){this._modeling.editCell(e,t)}},{key:"onInput",value:function(e){var t=this.props.context.element;this.debouncedEditCell(t.businessObject,'duration("'.concat(e,'")'))}},{key:"render",value:function(){var e=Kj(this.props.context.element.businessObject.text,this._type);return Hf(1,"div","context-menu-container simple-duration-edit",[Hf(1,"h3","dms-heading",qf("Edit duration"),2),Hf(1,"h4","dms-heading",qf("Set duration"),2),Wf(2,rE,{onInput:this.onInput,value:e,type:this._type,className:"dms-block"})],4)}}])&&hE(e.prototype,t),n&&hE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function _E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function wE(e,t,n){return t&&_E(e.prototype,t),n&&_E(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}zi=wE(function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n.registerProvider(function(e){var t=xE(e);return(tn(e.col)||nn(e.col))&&jE(t)}),t.onGetComponent("context-menu",function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(e.contextMenuType&&"simple-mode-edit"===e.contextMenuType&&e.element)return jE(xE(e.element))?tn(e.element.col)?fE:nn(e.element.col)?bE:void 0:void 0})});function xE(e){return tn(e.col)?e.col&&e.col.businessObject.inputExpression.typeRef:e.col&&e.col.businessObject.typeRef}zi.$inject=["components","simpleMode"];var OE=["yearMonthDuration","dayTimeDuration"];function jE(e){return OE.includes(e)}var EE={__depends__:[I0,CO],__init__:["simpleDurationEdit"],simpleDurationEdit:["type",zi]},CE=/^(-?(?:[0-9]|\.[0-9])+)$|^((?:<|>|=){0,2})\s*(-?(?:[0-9]|\.[0-9])+)$/,SE=/^(\[|\]){1}(-?(?:[0-9]|\.[0-9])+){1,}\.\.(-?(?:[0-9]|\.[0-9])+){1,}(\[|\]){1}$/,PE={equals:"=",less:"<",lessEquals:"<=",greater:">",greaterEquals:">="};function kE(e){if(!e||""===e.trim())return{type:"comparison"};var t,n=e.match(CE),r=e.match(SE);return n?(e=n)[0]&&e[1]&&!e[2]&&!e[3]?{type:"comparison",value:parseFloat(n[1]),operator:"equals"}:(e=n)[0]&&!e[1]&&e[2]&&e[3]?{type:"comparison",value:parseFloat(n[3]),operator:(t=n[2],S(PE).filter(function(e){return t===PE[e]})[0])}:void 0:r?{type:"range",values:[r[2],r[3]].map(function(e){return parseFloat(e)}),start:"]"===r[1]?"exclude":"include",end:"["===r[4]?"exclude":"include"}:void 0}function RE(e,t){return("equals"===e?"":"".concat(PE[e]," ")).concat(t)}function TE(e,t,n,r){r="exclude"===r?"[":"]";return"".concat("exclude"===n?"]":"[").concat(e,"..").concat(t).concat(r)}function DE(e){return(DE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ME(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function BE(e,t){return(BE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function IE(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=NE(n);return function(e,t){{if(t&&("object"===DE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return AE(e)}(this,r?(e=NE(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function AE(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function NE(e){return(NE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var LE="comparison",$E="range",VE=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&BE(e,t)}(o,rh);var e,t,n,r=IE(o);function o(e,t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(n=r.call(this,e,t))._modeling=t.injector.get("modeling");e=kE(n.props.context.element.businessObject.text);n.state=e?{type:e.type,comparisonOperator:e.operator||"equals",comparisonValue:e.value||0,rangeStartValue:e.values?e.values[0]:0,rangeEndValue:e.values?e.values[1]:0,rangeStartType:e.start||"include",rangeEndType:e.end||"include"}:{type:LE,comparisonOperator:"equals",comparisonValue:0,rangeStartValue:0,rangeEndValue:0,rangeStartType:"include",rangeEndType:"include"};t=t.injector.get("debounceInput");return n.debouncedEditCell=t(n.editCell.bind(AE(n))),n.editCell=n.editCell.bind(AE(n)),n.onComparisonOperatorChange=n.onComparisonOperatorChange.bind(AE(n)),n.onComparisonValueChange=n.onComparisonValueChange.bind(AE(n)),n.onTypeChange=n.onTypeChange.bind(AE(n)),n.onRangeStartTypeChange=n.onRangeStartTypeChange.bind(AE(n)),n.onRangeStartValueChange=n.onRangeStartValueChange.bind(AE(n)),n.onRangeEndTypeChange=n.onRangeEndTypeChange.bind(AE(n)),n.onRangeEndValueChange=n.onRangeEndValueChange.bind(AE(n)),n}return e=o,(t=[{key:"editCell",value:function(e,t){this._modeling.editCell(e,t)}},{key:"onTypeChange",value:function(e){var t=this.props.context.element,n=this.state,r=n.comparisonOperator,o=n.comparisonValue,i=n.rangeStartValue,a=n.rangeEndValue,c=n.rangeStartType,n=n.rangeEndType;e===LE?this.editCell(t.businessObject,RE(r,o)):this.editCell(t.businessObject,TE(i,a,c,n)),this.setState({type:e})}},{key:"onComparisonOperatorChange",value:function(e){var t=this.props.context.element,n=this.state,r=n.type,n=n.comparisonValue;r===LE&&(this.editCell(t.businessObject,RE(e,n)),this.setState({comparisonOperator:e}))}},{key:"onComparisonValueChange",value:function(e){var t=this.props.context.element,n=this.state,r=n.type,n=n.comparisonOperator;r===LE&&(this.debouncedEditCell(t.businessObject,RE(n,e)),this.setState({comparisonValue:e}))}},{key:"onRangeStartTypeChange",value:function(e){var t=this.props.context.element,n=this.state,r=n.type,o=n.rangeStartValue,i=n.rangeEndValue,n=n.rangeEndType;r===$E&&(this.editCell(t.businessObject,TE(o,i,e,n)),this.setState({rangeStartType:e}))}},{key:"onRangeStartValueChange",value:function(e){var t=this.props.context.element,n=this.state,r=n.type,o=n.rangeEndValue,i=n.rangeStartType,n=n.rangeEndType;r===$E&&(this.editCell(t.businessObject,TE(e,o,i,n)),this.setState({rangeStartValue:e}))}},{key:"onRangeEndTypeChange",value:function(e){var t=this.props.context.element,n=this.state,r=n.type,o=n.rangeStartValue,i=n.rangeEndValue,n=n.rangeStartType;r===$E&&(this.editCell(t.businessObject,TE(o,i,n,e)),this.setState({rangeEndType:e}))}},{key:"onRangeEndValueChange",value:function(e){var t=this.props.context.element,n=this.state,r=n.type,o=n.rangeStartValue,i=n.rangeStartType,n=n.rangeEndType;r===$E&&(this.editCell(t.businessObject,TE(o,e,i,n)),this.setState({rangeEndValue:e}))}},{key:"renderComparison",value:function(e,t){return Hf(1,"div","comparison",[Hf(1,"h4","dms-heading",qf("Value"),2),Hf(1,"div","dms-fill-row",[Wf(2,Cw,{noInput:!0,onChange:this.onComparisonOperatorChange,options:[{label:"Equals",value:"equals"},{label:"Less",value:"less"},{label:"Less or equals",value:"lessEquals"},{label:"Greater",value:"greater"},{label:"Greater or equals",value:"greaterEquals"}],value:e}),qf(" "),Wf(2,j_,{className:"comparison-number-input",onInput:this.onComparisonValueChange,type:"number",value:t})],4)],4)}},{key:"renderRange",value:function(e,t,n,r){var o=[{label:"Include",value:"include"},{label:"Exclude",value:"exclude"}];return Hf(1,"div","range",[Hf(1,"h4","dms-heading",qf("Start Value"),2),Hf(1,"div","dms-fill-row",[Wf(2,Cw,{noInput:!0,onChange:this.onRangeStartTypeChange,options:o,value:n}),qf(" "),Wf(2,j_,{className:"range-start-number-input",onInput:this.onRangeStartValueChange,type:"number",value:e})],4),Hf(1,"h4","dms-heading",qf("End Value"),2),Hf(1,"div","dms-fill-row",[Wf(2,Cw,{noInput:!0,onChange:this.onRangeEndTypeChange,options:o,value:r}),qf(" "),Wf(2,j_,{className:"range-end-number-input",onInput:this.onRangeEndValueChange,type:"number",value:t})],4)],4)}},{key:"render",value:function(){var e=this.state,t=e.type,n=e.comparisonOperator,r=e.comparisonValue,o=e.rangeStartValue,i=e.rangeEndValue,a=e.rangeStartType,c=e.rangeEndType,e=[{label:"Comparison",value:LE},{label:"Range",value:$E}];return Hf(1,"div","context-menu-container simple-number-edit",[Hf(1,"h3","dms-heading",qf("Edit Number"),2),Hf(1,"div","dms-fill-row",Wf(2,Cw,{noInput:!0,onChange:this.onTypeChange,options:e,value:t}),2),t===LE&&this.renderComparison(n,r),t===$E&&this.renderRange(o,i,a,c)],0)}}])&&ME(e.prototype,t),n&&ME(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function zE(e){return(zE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function FE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function UE(e,t){return(UE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function HE(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=qE(n);return function(e,t){{if(t&&("object"===zE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return WE(e)}(this,r?(e=qE(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function WE(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qE(e){return(qE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var GE=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&UE(e,t)}(o,rh);var e,t,n,r=HE(o);function o(e,t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(n=r.call(this,e,t))._modeling=t.injector.get("modeling");e=kE(n.props.context.element.businessObject.text);n.state=e?{value:e.value}:{value:""};t=t.injector.get("debounceInput");return n.debouncedEditCell=t(n.editCell.bind(WE(n))),n.editCell=n.editCell.bind(WE(n)),n.onInput=n.onInput.bind(WE(n)),n}return e=o,(t=[{key:"editCell",value:function(e,t){this._modeling.editCell(e,t)}},{key:"onInput",value:function(e){var t=this.props.context.element;this.debouncedEditCell(t.businessObject,e),this.setState({value:e})}},{key:"render",value:function(){var e=this.state.value;return Hf(1,"div","context-menu-container simple-number-edit",[Hf(1,"h3","dms-heading",qf("Edit Number"),2),Hf(1,"h4","dms-heading",qf("Set Value"),2),Wf(2,j_,{onInput:this.onInput,type:"number",value:e})],4)}}])&&FE(e.prototype,t),n&&FE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function KE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function XE(e,t,n){return t&&KE(e.prototype,t),n&&KE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}fu=XE(function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n.registerProvider(function(e){var t=YE(e);return(tn(e.col)||nn(e.col))&&QE(t)}),t.onGetComponent("context-menu",function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(e.contextMenuType&&"simple-mode-edit"===e.contextMenuType&&e.element)return QE(YE(e.element))?tn(e.element.col)?VE:nn(e.element.col)?GE:void 0:void 0})});function YE(e){return tn(e.col)?e.col&&e.col.businessObject.inputExpression.typeRef:e.col&&e.col.businessObject.typeRef}fu.$inject=["components","simpleMode"];var ZE=["number","integer","long","double"];function QE(e){return ZE.includes(e)}var JE={__depends__:[I0,CO],__init__:["simpleNumberEdit"],simpleNumberEdit:["type",fu]};function eC(e){if(!e||tC(e.trim()))return{type:"disjunction",values:[]};var t=e.split(","),n={type:"disjunction",values:[]},r="";if(t.forEach(function(e){r+=e,/^"[^"]*"$/.test(r.trim())?(n.values.push(r.trim()),r=""):r+=","}),!r)return n;n.type="negation",n.values=[];r="",e=e.match(/^\s*not\((.*)\)\s*$/);return e&&((t=e[1].split(",")).forEach(function(e){r+=e,/^"[^"]*"$/.test(r.trim())?(n.values.push(r.trim()),r=""):r+=","}),!r)?n:void 0}function tC(e){return""===e}function nC(e){return(nC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function rC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function oC(e,t){return(oC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function iC(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=cC(n);return function(e,t){{if(t&&("object"===nC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return aC(e)}(this,r?(e=cC(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function aC(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cC(e){return(cC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var uC="disjunction",sC="negation",lC=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&oC(e,t)}(u,rh);var e,t,n,c=iC(u);function u(e,t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(n=c.call(this,e,t))._translate=t.injector.get("translate"),n._modeling=t.injector.get("modeling");var r=(r=eC(e.context.element.businessObject.text))||{values:[],type:uC},o=!(a=tn(a=e.context.element.col.businessObject)?a.inputValues:a.outputValues)||tC(a.text)?[]:a.text.split(",").map(function(e){return e.trim()}),i=r.values.filter(function(e){return!fC(o,e)}),a=tn(e.context.element.col),e=o.map(function(e){return{value:e,isChecked:fC(r.values,e),isRemovable:!1,group:"Predefined Values"}});a&&(e=e.concat(i.map(function(e){return{value:e,isChecked:!0,isRemovable:!0,group:"Custom Values"}})));i="";a||!r.values.length||fC(o,r.values[0])||(i=r.values[0]),n.state={items:e,unaryTestsType:r.type,inputValue:i,isOutputValueInputChecked:""!==i};t=t.injector.get("debounceInput");return n.debouncedEditCell=t(n.editCell.bind(aC(n))),n.editCell=n.editCell.bind(aC(n)),n.addUnaryTestsListItem=n.addUnaryTestsListItem.bind(aC(n)),n.onInput=n.onInput.bind(aC(n)),n.onKeyDown=n.onKeyDown.bind(aC(n)),n.onOutputValueInputClick=n.onOutputValueInputClick.bind(aC(n)),n.onUnaryTestsListChanged=n.onUnaryTestsListChanged.bind(aC(n)),n.onUnaryTestsTypeChange=n.onUnaryTestsTypeChange.bind(aC(n)),n}return e=u,(t=[{key:"editCell",value:function(e,t){this._modeling.editCell(e,t)}},{key:"onUnaryTestsTypeChange",value:function(e){var t=pC(this.state.items),n=this.props.context.element;e===uC?(this.editCell(n.businessObject,t.join(",")),this.setState({unaryTestsType:uC})):(this.editCell(n.businessObject,"not(".concat(t.join(","),")")),this.setState({unaryTestsType:sC}))}},{key:"onUnaryTestsListChanged",value:function(e){var t=pC(e),n=this.props.context.element;this.state.unaryTestsType===uC?this.editCell(n.businessObject,t.join(",")):this.editCell(n.businessObject,"not(".concat(t.join(","),")")),this.setState({items:e,isOutputValueInputChecked:!1})}},{key:"onOutputValueInputClick",value:function(){var e=this.props.context.element,t=this.state,n=t.inputValue,t=t.items,n=eC(n);!n||1<n.values.length||(this.editCell(e.businessObject,"".concat(n.values.join(""))),this.setState({items:t.map(function(e){return e.isChecked=!1,e}),isOutputValueInputChecked:!0}))}},{key:"onInput",value:function(e){var t=e.isValid,n=e.value,r=this.state.isOutputValueInputChecked;this.setState({inputValue:n});e=this.props.context.element;!tn(e)&&t&&r&&this.debouncedEditCell(e.businessObject,n)}},{key:"onKeyDown",value:function(e){var t=e.isValid,n=e.event;13===n.keyCode&&(!(e=tn(this.props.context.element.col))&&t||(n.stopPropagation(),n.preventDefault()),t&&(e?this.addUnaryTestsListItem():this.onOutputValueInputClick()))}},{key:"addUnaryTestsListItem",value:function(){var e=this.state,t=e.inputValue,n=e.items,r=e.unaryTestsType,o=eC(t);o&&(e=this.props.context.element,t=pC(n),t=[].concat(t,o.values),r===uC?this.editCell(e.businessObject,t.join(",")):this.editCell(e.businessObject,"not(".concat(t.join(","),")")),o=n.concat(o.values.map(function(e){return{value:e,isChecked:!0,isRemovable:!0,group:"Custom Values"}})),this.setState({items:o,inputValue:""}))}},{key:"render",value:function(){var t=this,e=this.props.context.element,n=this.state,r=n.inputValue,o=n.isOutputValueInputChecked,i=n.items,a=n.unaryTestsType,c=[{label:"Match one",value:uC},{label:"Match none",value:sC}],n=tn(e.col),e=a===sC,a=!n&&0<i.length;return Hf(1,"div","simple-string-edit context-menu-container",[Hf(1,"h3","dms-heading",this._translate("Edit String"),0),n&&Hf(1,"p",null,Wf(2,Cw,{noInput:!0,onChange:this.onUnaryTestsTypeChange,options:c,value:e?sC:uC},null,function(e){return t.selectNode=e}),2),Wf(2,Xw,{onChange:this.onUnaryTestsListChanged,items:i,type:n?"checkbox":"radio"}),Hf(1,"h4","dms-heading",n?this._translate("Add Values"):this._translate("Set Value"),0),Hf(1,"div","dms-fill-row",[a&&Hf(64,"input","cursor-pointer",null,1,{checked:o,onClick:this.onOutputValueInputClick,type:"radio",style:{marginRight:"8px"}}),Wf(2,n0,{className:"dms-block",onKeyDown:this.onKeyDown,onInput:this.onInput,placeholder:n?'"value", "value", ...':'"value"',type:"text",validate:function(e){if(!eC(e))return t._translate("Strings must be in double quotes.")},value:r})],0)],0)}}])&&rC(e.prototype,t),n&&rC(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}();function pC(e){return e.filter(function(e){return e.isChecked}).map(function(e){return e.value})}function fC(e,t){return-1!==e.indexOf(t)}function dC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function hC(e,t,n){return t&&dC(e.prototype,t),n&&dC(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}hr=hC(function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n.registerProvider(function(e){return(tn(e.col)||nn(e.col))&&"string"===yC(e)}),t.onGetComponent("context-menu",function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(e.contextMenuType&&"simple-mode-edit"===e.contextMenuType&&e.element)return"string"===yC(e.element)?lC:void 0})});function yC(e){return tn(e.col)?e.col&&e.col.businessObject.inputExpression.typeRef:e.col&&e.col.businessObject.typeRef}hr.$inject=["components","simpleMode"];var mC={__depends__:[I0,CO],__init__:["simpleStringEdit"],simpleStringEdit:["type",hr]},vC=/^(?:\d\d:){2}\d\d(?:Z|(?:[@+-][^")]+))?$/,gC=/^\[time\("([^"]*)"\)..time\("([^"]*)"\)\]$/,bC=/^(<|>)\s*time\("([^"]*)"\)$/,_C=/^time\("([^"]*)"\)$/;function wC(e){if(!vC.test(e.trim()))return"Time must match pattern hh:mm:ss[time zone]."}function xC(e,t){return"exact"===e?'time("'.concat(t[0],'")'):"before"===e?'< time("'.concat(t[0],'")'):"after"===e?'> time("'.concat(t[0],'")'):"between"===e?'[time("'.concat(t[0],'")..time("').concat(t[1],'")]'):void 0}function OC(){return(new Date).toISOString().slice(11,-5)+"Z"}function jC(e){if(!e||""===e.trim())return{type:"exact",time:""};var t=e.match(gC);return t?{type:"between",times:[t[1],t[2]]}:(t=e.match(bC))?{type:"<"===t[1]?"before":"after",time:t[2]}:(t=e.match(_C))?{type:"exact",time:t[1]}:void 0}function EC(e){return(EC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function CC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function SC(e,t){return(SC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function PC(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=RC(n);return function(e,t){{if(t&&("object"===EC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return kC(e)}(this,r?(e=RC(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function kC(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function RC(e){return(RC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var TC="between",DC=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&SC(e,t)}(i,rh);var e,t,n,o=PC(i);function i(e,t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(n=o.call(this,e,t))._modeling=t.injector.get("modeling");var r=jC(n.props.context.element.businessObject.text);r?(e=r.time?[r.time,""]:r.times||["",""],n.state={type:r.type,times:e}):n.state={type:"exact",times:["",""]};t=t.injector.get("debounceInput");return n.debouncedEditCell=t(n.editCell.bind(kC(n))),n.editCell=n.editCell.bind(kC(n)),n.onTypeChange=n.onTypeChange.bind(kC(n)),n.onSetStartTimeNowClick=n.onSetStartTimeNowClick.bind(kC(n)),n.onSetEndTimeNowClick=n.onSetEndTimeNowClick.bind(kC(n)),n.onStartTimeInput=n.onStartTimeInput.bind(kC(n)),n.onEndTimeInput=n.onEndTimeInput.bind(kC(n)),n}return e=i,(t=[{key:"editCell",value:function(e,t){this._modeling.editCell(e,t)}},{key:"onTypeChange",value:function(e){var t=this.props.context.element,n=this.state.times;this.setState({type:e}),jC(xC(e,n))&&this.editCell(t.businessObject,xC(e,n))}},{key:"onSetStartTimeNowClick",value:function(){var e=this.props.context.element,t=this.state,n=t.times,r=t.type,t=OC();this.setState({times:[t,n[1]]}),jC(xC(r,[t,n[1]]))&&this.editCell(e.businessObject,xC(r,[t,n[1]]))}},{key:"onSetEndTimeNowClick",value:function(){var e=this.props.context.element,t=this.state,n=t.times,r=t.type,t=OC();this.setState({times:[n[0],t]}),jC(xC(r,[n[0],t]))&&this.editCell(e.businessObject,xC(r,[n[0],t]))}},{key:"onStartTimeInput",value:function(e){var t=e.value,n=this.props.context.element,r=this.state,e=r.times,r=r.type;this.setState({times:[t,e[1]]}),this.debouncedEditCell(n.businessObject,xC(r,[t,e[1]]))}},{key:"onEndTimeInput",value:function(e){var t=e.value,n=this.props.context.element,r=this.state,e=r.times,r=r.type;this.setState({times:[e[0],t]}),this.debouncedEditCell(n.businessObject,xC(r,[e[0],t]))}},{key:"render",value:function(){var e=this.state,t=e.times,n=e.type,e=[{label:"Exactly",value:"exact"},{label:"Before",value:"before"},{label:"After",value:"after"},{label:"Between",value:TC}];return Hf(1,"div","context-menu-container simple-time-edit",[Hf(1,"h3","dms-heading",qf("Edit time"),2),Hf(1,"div","dms-fill-row",Wf(2,Cw,{noInput:!0,onChange:this.onTypeChange,options:e,value:n}),2),Hf(1,"h4","dms-heading",n===TC?"Edit start time":"Set time",0),Hf(1,"div",null,[Wf(2,n0,{className:"start-time-input dms-block",onInput:this.onStartTimeInput,placeholder:"e.g. ".concat(OC()),validate:wC,value:t[0]}),Hf(1,"p","dms-hint",[Hf(1,"button","use-now",qf("Use now"),2,{type:"button",onClick:this.onSetStartTimeNowClick}),qf(".")],4)],4),n===TC&&Hf(1,"h4","dms-heading",qf("Edit end time"),2),n===TC&&Hf(1,"div",null,[Wf(2,n0,{className:"end-time-input dms-block",onInput:this.onEndTimeInput,placeholder:"e.g. ".concat(OC()),validate:wC,value:t[1]}),Hf(1,"p","dms-hint",[Hf(1,"button","use-now",qf("Use now"),2,{type:"button",onClick:this.onSetEndTimeNowClick}),qf(".")],4)],4)],0)}}])&&CC(e.prototype,t),n&&CC(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function MC(e){return(MC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function BC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function IC(e,t){return(IC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function AC(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=LC(n);return function(e,t){{if(t&&("object"===MC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return NC(e)}(this,r?(e=LC(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function NC(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function LC(e){return(LC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var $C=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&IC(e,t)}(o,rh);var e,t,n,r=AC(o);function o(e,t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(n=r.call(this,e,t))._modeling=t.injector.get("modeling");e=jC(n.props.context.element.businessObject.text);n.state={date:e?e.date:""};t=t.injector.get("debounceInput");return n.debouncedEditCell=t(n.editCell.bind(NC(n))),n.editCell=n.editCell.bind(NC(n)),n.onClick=n.onClick.bind(NC(n)),n.onInput=n.onInput.bind(NC(n)),n}return e=o,(t=[{key:"editCell",value:function(e,t){this._modeling.editCell(e,t)}},{key:"onClick",value:function(){var e=this.props.context.element,t=OC();this.setState({date:t}),this.editCell(e.businessObject,'time("'.concat(t,'")'))}},{key:"onInput",value:function(e){var t=e.value,e=this.props.context.element;this.setState({date:t}),this.debouncedEditCell(e.businessObject,'time("'.concat(t,'")'))}},{key:"render",value:function(){var e=this.state.date;return Hf(1,"div","context-menu-container simple-time-edit",[Hf(1,"h3","dms-heading",qf("Edit Date"),2),Hf(1,"h4","dms-heading",qf("Set Date"),2),Hf(1,"div",null,[Wf(2,n0,{onInput:this.onInput,placeholder:"e.g. ".concat(OC()),validate:wC,value:e,className:"dms-block"}),Hf(1,"p","dms-hint",[qf("Set date "),Hf(1,"button","use-now",qf("to now"),2,{type:"button",onClick:this.onClick}),qf(".")],4)],4)],4)}}])&&BC(e.prototype,t),n&&BC(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function VC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function zC(e,t,n){return t&&VC(e.prototype,t),n&&VC(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}zi=zC(function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n.registerProvider(function(e){var t=FC(e);return(tn(e.col)||nn(e.col))&&UC(t)}),t.onGetComponent("context-menu",function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(e.contextMenuType&&"simple-mode-edit"===e.contextMenuType&&e.element)return UC(FC(e.element))?tn(e.element.col)?DC:nn(e.element.col)?$C:void 0:void 0})});function FC(e){return tn(e.col)?e.col&&e.col.businessObject.inputExpression.typeRef:e.col&&e.col.businessObject.typeRef}function UC(e){return"time"===e}zi.$inject=["components","simpleMode"];var HC={__depends__:[I0,CO],__init__:["simpleTimeEdit"],simpleTimeEdit:["type",zi]};function WC(e){return(WC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function GC(e,t){return(GC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function KC(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=YC(n);return function(e,t){{if(t&&("object"===WC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return XC(e)}(this,r?(e=YC(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function XC(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function YC(e){return(YC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ZC(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var QC=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&GC(e,t)}(i,rh);var e,t,n,o=KC(i);function i(e,t){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),ZC(XC(r=o.call(this,e,t)),"onElementsChanged",function(){r.forceUpdate()}),ZC(XC(r),"handleMouseDown",function(e){!function(e){var n=e.node,t=e.event,r=e.minWidth,e=e.onEnd,o=void 0===e?JC:e;t.preventDefault();var i,a=n.getBoundingClientRect().width,c=t.clientX;function u(e){e.preventDefault();var t=s(e.clientX);i&&cancelAnimationFrame(i),i=requestAnimationFrame(function(){n.style.width=t+"px"})}function s(e){return Math.max(a+(e-c),r)}document.addEventListener("mousemove",u),document.addEventListener("mouseup",function e(t){t.preventDefault(),document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",e);t=s(t.clientX);o(t)})}({node:xt(e.target,"th",!1),event:e,minWidth:r.props.minWidth||150,onEnd:r.saveWidth})}),ZC(XC(r),"saveWidth",function(e){var t=r.props.col,n={};en(t,"dmn:DecisionTable")?n.annotationsWidth=e:n.width=e,r.modeling.updateProperties(t,n)}),Rh(XC(r)),r}return e=i,(t=[{key:"componentDidMount",value:function(){var e=this.getRoot();this.changeSupport.onElementsChanged(e,this.onElementsChanged)}},{key:"componentWillUnmount",value:function(){var e=this.getRoot();this.changeSupport.offElementsChanged(e,this.onElementsChanged)}},{key:"getRoot",value:function(){return this.sheet.getRoot()}},{key:"isLastInputOrOutput",value:function(){var e=this.props.col,t=rn(this.getRoot());if(en(e,"dmn:InputClause")){var n=t.get("input");return n.indexOf(e)===n.length-1}if(en(e,"dmn:OutputClause")){t=t.get("output");return t.indexOf(e)===t.length-1}}},{key:"render",value:function(){var e=this.isLastInputOrOutput()?{right:"-7px",width:"27px"}:null;return Hf(1,"div","resize-column-handle",null,1,{onMouseDown:this.handleMouseDown,title:this.translate("Resize"),style:e})}}])&&qC(e.prototype,t),n&&qC(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function JC(){}function eS(e){e.onGetComponent("cell-inner",function(){var e=(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).cellType;if("input-cell"===e||"output-cell"===e||"annotations"===e)return QC})}QC.$inject=["sheet","changeSupport","translate","modeling"],eS.$inject=["components"];var tS={__init__:["columnResizeProvider"],columnResizeProvider:["type",eS]};function nS(e){return(nS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function rS(e){return function(e){if(Array.isArray(e))return oS(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return oS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?oS(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function iS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function aS(e,t){return(aS=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function cS(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=uS(n);return function(e,t){{if(t&&("object"===nS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,r?(e=uS(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function uS(e){return(uS=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var sS=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&aS(e,t)}(o,hv);var e,t,n,r=cS(o);function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),r.apply(this,arguments)}return e=o,n=[{key:"_getModules",value:function(){return[Mg,yb,eg,Db,Eg,Nb,e_,r_,u_,Dg,A0,tS,Z0,yx,vx,Zy,I0,Bx,Tg,Hx,kv,tO,yO,Cv,CO,LO,fj,Vj,EE,JE,mC,HC]}}],(t=[{key:"getModules",value:function(){return[].concat(rS(hv._getModules()),rS(o._getModules()))}}])&&iS(e.prototype,t),n&&iS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function lS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}fu=function(){function t(e){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this._listeners={},e.on("elements.changed",function(e){e=e.elements;n.elementsChanged(e)}),e.on("element.updateId",function(e){var t=e.element,e=e.newId;n.updateId(t.id,e)})}var e,n,r;return e=t,(n=[{key:"elementsChanged",value:function(e){for(var t={},n=e.length,r=0;r<n;r++){var o=e[r].id;if(t[o])return;t[o]=!0;var i=this._listeners[o]&&this._listeners[o].length;if(i)for(var a=0;a<i;a++)this._listeners[o][a]&&this._listeners[o][a]()}}},{key:"onElementsChanged",value:function(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e][this._listeners[e].length]=t}},{key:"offElementsChanged",value:function(e,t){this._listeners[e]&&(t?-1!==(t=this._listeners[e].indexOf(t))&&this._listeners[e].splice(t,1):this._listeners[e].length=0)}},{key:"updateId",value:function(e,t){this._listeners[e]&&(this._listeners[t]=this._listeners[e],delete this._listeners[e])}}])&&lS(e.prototype,n),r&&lS(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function pS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}fu.$inject=["eventBus"];hr=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._listeners={}}var t,n,r;return t=e,(n=[{key:"getComponent",value:function(e,t){var n=this._listeners[e];if(n){for(var r,o=0;o<n.length&&!(r=n[o].callback(t));o++);return r}}},{key:"getComponents",value:function(e,t){var n=this._listeners[e];if(n){for(var r=[],o=0;o<n.length;o++){var i=n[o].callback(t);i&&r.push(i)}if(r.length)return r}}},{key:"onGetComponent",value:function(e,t,n){if(m(t)&&(n=t,t=1e3),!h(t))throw new Error("priority must be a number");for(var r,o=this._getListeners(e),i={priority:t,callback:n},a=0;r=o[a];a++)if(r.priority<t)return void o.splice(a,0,i);o.push(i)}},{key:"offGetComponent",value:function(e,t){var n,r,o=this._getListeners(e);if(t)for(r=o.length-1;n=o[r];r--)n.callback===t&&o.splice(r,1);else o.length=0}},{key:"_getListeners",value:function(e){var t=this._listeners[e];return t||(this._listeners[e]=t=[]),t}}])&&pS(t.prototype,n),r&&pS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function fS(e){return(fS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function dS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function hS(e,t){return(hS=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function yS(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=mS(n);return function(e,t){{if(t&&("object"===fS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,r?(e=mS(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function mS(e){return(mS=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var vS=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hS(e,t)}(o,rh);var e,t,n,r=yS(o);function o(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var t,e=(t=r.call(this,e))._injector=e.injector;return t._changeSupport=e.get("changeSupport"),t._components=e.get("components"),t._renderer=e.get("renderer"),t}return e=o,(t=[{key:"getChildContext",value:function(){return{changeSupport:this._changeSupport,components:this._components,renderer:this._renderer,injector:this._injector}}},{key:"render",value:function(){var e=this._components.getComponents("viewer");return Hf(1,"div","viewer-container",e&&e.map(function(e,t){return Wf(2,e,null,t)}),0)}}])&&dS(e.prototype,t),n&&dS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function gS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}zi=function(){function a(e,t,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);var i=n.container;this._container=i,r.on("renderer.mount",function(){Qd(Wf(2,vS,{injector:o}),i)}),r.on("renderer.unmount",function(){Qd(null,i)})}var e,t,n;return e=a,(t=[{key:"getContainer",value:function(){return this._container}}])&&gS(e.prototype,t),n&&gS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),a}();zi.$inject=["changeSupport","components","config.renderer","eventBus","injector"];var bS={__init__:["changeSupport","components","renderer"],changeSupport:["type",fu],components:["type",hr],eventBus:["type",U],renderer:["type",zi]},_S=["modules"];function wS(e,t){if(null==e)return{};var n,r=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols)for(var o=Object.getOwnPropertySymbols(e),i=0;i<o.length;i++)n=o[i],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r}function xS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var OS=function(){function r(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var t,n=e.injector;n||(e=(t=this._init(e)).modules,t=t.config,n=function(e){var n=[],r=[];function o(e){return 0<=n.indexOf(e)}e.forEach(function e(t){o(t)||((t.__depends__||[]).forEach(e),o(t)||(n.push(t),(t.__init__||[]).forEach(function(e){r.push(e)})))});var t=new of(n);return r.forEach(function(e){try{t["string"==typeof e?"get":"invoke"](e)}catch(e){throw console.error("Failed to instantiate component"),console.error(e.stack),e}}),t}([{config:["value",t]},bS].concat(e||[]))),this.get=n.get,this.invoke=n.invoke,this.get("eventBus").fire("viewer.init")}var e,t,n;return e=r,(t=[{key:"_init",value:function(e){return{modules:e.modules,config:wS(e,_S)}}},{key:"destroy",value:function(){this.get("eventBus").fire("viewer.destroy")}},{key:"clear",value:function(){this.get("eventBus").fire("viewer.clear")}}])&&xS(e.prototype,t),n&&xS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),r}();function jS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}hr=function(){function n(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),this._eventBus=t,this._viewer=e}var e,t,r;return e=n,(t=[{key:"getDecision",value:function(){return this._viewer.getDecision()}},{key:"updateId",value:function(e,t){if(e!==this.getDecision())throw new Error("element !== decision");this._eventBus.fire("element.updateId",{element:e,newId:t}),e.id=t}}])&&jS(e.prototype,t),r&&jS(e,r),Object.defineProperty(e,"prototype",{writable:!1}),n}();hr.$inject=["viewer","eventBus"];var ES={__init__:["elementRegistry"],elementRegistry:["type",hr]};function CS(e){return(CS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function SS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function PS(e,t){return(PS=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function kS(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=RS(n);return function(e,t){{if(t&&("object"===CS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,r?(e=RS(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function RS(e){return(RS=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var TS=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&PS(e,t)}(o,rh);var e,t,n,r=kS(o);function o(e,t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,e,t))._viewer=t.injector.get("viewer"),e}return e=o,(t=[{key:"render",value:function(){return Hf(1,"div","decision-properties",Hf(1,"h3","decision-name",this._viewer.getDecision().name,0),2)}}])&&SS(e.prototype,t),n&&SS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function DS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function MS(e,t,n){return t&&DS(e.prototype,t),n&&DS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}zi=MS(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("viewer",1500,function(){return TS})});zi.$inject=["components"];var BS={__init__:["decisionProperties"],decisionProperties:["type",zi]};function IS(e){return(IS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function AS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function NS(e,t){return(NS=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function LS(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=$S(n);return function(e,t){{if(t&&("object"===IS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,r?(e=$S(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function $S(e){return($S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var VS=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&NS(e,t)}(o,rh);var e,t,n,r=LS(o);function o(e,t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,e,t))._viewer=t.injector.get("viewer"),e}return e=o,(t=[{key:"render",value:function(){var e=this._viewer.getDecision(),t=e.decisionLogic,e=e.variable;return Hf(1,"div","literal-expression-properties",Hf(1,"table",null,[Hf(1,"tr",null,[Hf(1,"td",null,qf("Variable Name:"),2),Hf(1,"td",null,Hf(1,"span",null,e.name||"-",0),2)],4),Hf(1,"tr",null,[Hf(1,"td",null,qf("Variable Type:"),2),Hf(1,"td",null,Hf(1,"span",null,e.typeRef||"-",0),2)],4),Hf(1,"tr",null,[Hf(1,"td",null,qf("Expression Language:"),2),Hf(1,"td",null,Hf(1,"span",null,t.expressionLanguage||"-",0),2)],4)],4),2)}}])&&AS(e.prototype,t),n&&AS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function zS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function FS(e,t,n){return t&&zS(e.prototype,t),n&&zS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}hr=FS(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("viewer",500,function(){return VS})});hr.$inject=["components"];var US={__depends__:[],__init__:["literalExpressionProperties"],literalExpressionProperties:["type",hr]};function HS(e){return(HS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function WS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qS(e,t){return(qS=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function GS(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=XS(n);return function(e,t){{if(t&&("object"===HS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return KS(e)}(this,r?(e=XS(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function KS(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function XS(e){return(XS=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var YS=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qS(e,t)}(a,rh);var e,t,n,i=GS(a);function a(e,t){var n,r,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),n=i.call(this,e,t),r=KS(n),o=function(){n._eventBus.fire("poweredBy.show")},(e="onClick")in r?Object.defineProperty(r,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[e]=o;t=t.injector;return n._eventBus=t.get("eventBus"),n}return e=a,(t=[{key:"render",value:function(){var t=this;return Hf(1,"div","powered-by",Hf(1,"div","powered-by__logo",Wf(2,Vm),2),2,{onClick:this.onClick,title:"Powered by bpmn.io"},null,function(e){return t.node=e})}}])&&WS(e.prototype,t),n&&WS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),a}();function ZS(e){return(ZS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function QS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function JS(e,t){return(JS=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eP(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=nP(n);return function(e,t){{if(t&&("object"===ZS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return tP(e)}(this,r?(e=nP(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function tP(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nP(e){return(nP=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var rP=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&JS(e,t)}(o,rh);var e,t,n,r=eP(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,e)).state={show:!1},e.onClick=e.onClick.bind(tP(e)),e.onShow=e.onShow.bind(tP(e)),e}return e=o,(t=[{key:"onClick",value:function(){this.setState({show:!1})}},{key:"onShow",value:function(){this.setState({show:!0})}},{key:"componentWillMount",value:function(){(this._eventBus=this.context.injector.get("eventBus")).on("poweredBy.show",this.onShow)}},{key:"componentWillUnmount",value:function(){this._eventBus.off("poweredBy.show",this.onShow)}},{key:"render",value:function(){return this.state.show&&Hf(1,"div","powered-by-overlay",Hf(1,"div","powered-by-overlay-content",[Hf(1,"a","logo",Wf(2,Vm),2,{href:"https://bpmn.io",target:"_blank",rel:"noopener"}),Hf(1,"span",null,[qf("Web-based tooling for BPMN, DMN and CMMN diagrams powered by "),Hf(1,"a",null,qf("bpmn.io"),2,{href:"http://bpmn.io",target:"_blank"}),qf(".")],4)],4,{onClick:function(e){return e.stopPropagation()}}),2,{onClick:this.onClick})}}])&&QS(e.prototype,t),n&&QS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function oP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function iP(e,t,n){return t&&oP(e.prototype,t),n&&oP(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}zi=iP(function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("viewer",2e3,function(){return YS}),t.onGetComponent("viewer",function(){return rP})});zi.$inject=["components","eventBus"];var aP={__init__:["poweredBy"],poweredBy:["type",zi]};function cP(e){return(cP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function uP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function sP(e,t){return(sP=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function lP(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=pP(n);return function(e,t){{if(t&&("object"===cP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,r?(e=pP(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function pP(e){return(pP=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var fP=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sP(e,t)}(o,rh);var e,t,n,r=lP(o);function o(e,t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,e,t))._viewer=t.injector.get("viewer"),e}return e=o,(t=[{key:"render",value:function(){return Hf(1,"div","textarea",Hf(1,"div","content",this._viewer.getDecision().decisionLogic.text,0),2)}}])&&uP(e.prototype,t),n&&uP(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function dP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function hP(e,t,n){return t&&dP(e.prototype,t),n&&dP(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}hr=hP(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("viewer",function(){return fP})});hr.$inject=["components"];var yP={__init__:["textarea"],textarea:["type",hr]};function mP(e){return(mP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function gP(e,t){return(gP=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function bP(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=wP(n);return function(e,t){{if(t&&("object"===mP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return _P(e)}(this,r?(e=wP(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function _P(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wP(e){return(wP=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var xP=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gP(e,t)}(a,rh);var e,t,n,i=bP(a);function a(e,t){var n,r,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),n=i.call(this,e,t),r=_P(n),o=function(){n._eventBus.fire("showDrd")},(e="onClick")in r?Object.defineProperty(r,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[e]=o;t=t.injector;return n._eventBus=t.get("eventBus"),n}return e=a,(t=[{key:"render",value:function(){var t=this;return Hf(1,"div","view-drd",Hf(1,"button","view-drd-button",qf("View DRD"),2,{onClick:this.onClick}),2,null,null,function(e){return t.node=e})}}])&&vP(e.prototype,t),n&&vP(e,n),Object.defineProperty(e,"prototype",{writable:!1}),a}();function OP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}zi=function(){function i(e,t,n,r){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),this._injector=r,this._viewer=t,e.onGetComponent("viewer",2e3,function(){if(o.canViewDrd())return xP}),n.on("showDrd",function(){var e=r.get("_parent",!1),t=o.getDefinitions(),t=e.getView(t);e.open(t)})}var e,t,n;return e=i,(t=[{key:"canViewDrd",value:function(){var e=this._injector.get("_parent",!1);if(e){var t=this.getDefinitions();return!!e.getView(t)}}},{key:"getDefinitions",value:function(){return this._viewer.getDecision().$parent}}])&&OP(e.prototype,t),n&&OP(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();zi.$inject=["components","viewer","eventBus","injector"];var jP={__init__:["viewDrd"],viewDrd:["type",zi]};function EP(e){return(EP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var CP=["modules","additionalModules"];function SP(e){return function(e){if(Array.isArray(e))return PP(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return PP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?PP(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function PP(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function kP(e,t){if(null==e)return{};var n,r=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols)for(var o=Object.getOwnPropertySymbols(e),i=0;i<o.length;i++)n=o[i],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r}function RP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function TP(){return(TP="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=BP(e)););return e}(e,t);if(r){t=Object.getOwnPropertyDescriptor(r,t);return t.get?t.get.call(arguments.length<3?e:n):t.value}}).apply(this,arguments)}function DP(e,t){return(DP=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function MP(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=BP(n);return function(e,t){{if(t&&("object"===EP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,r?(e=BP(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function BP(e){return(BP=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var IP=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&DP(e,t)}(o,OS);var e,t,n,r=MP(o);function o(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var t=o._createContainer();return(e=r.call(this,L(e,{renderer:{container:t}})))._container=t,e}return e=o,n=[{key:"_getModules",value:function(){return[ES,BS,US,aP,yP,jP]}},{key:"_createContainer",value:function(){return kt('<div class="dmn-literal-expression-container"></div>')}}],(t=[{key:"open",value:function(r){var o=this;return new Promise(function(e,t){var n;try{o._decision&&(o.clear(),o.get("eventBus").fire("renderer.unmount")),o._decision=r,o.get("eventBus").fire("import",r),o.get("eventBus").fire("renderer.mount")}catch(e){n=e}n?(n.warnings=n.warnings||[],t(n)):e({warnings:[]})})}},{key:"_init",value:function(e){var t=e.modules,n=e.additionalModules,r=kP(e,CP),e=t||this.getModules(),t=n||[],n=[{viewer:["value",this]}];return{modules:[].concat(SP(e),SP(t),n),config:r}}},{key:"on",value:function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)}},{key:"off",value:function(e,t){this.get("eventBus").off(e,t)}},{key:"_emit",value:function(e,t){return this.get("eventBus").fire(e,t)}},{key:"getDecision",value:function(){return this._decision}},{key:"attachTo",value:function(e){if(!e)throw new Error("parentNode required");this.detach(),e.appendChild(this._container),this._emit("attach",{})}},{key:"detach",value:function(){var e=this._container;e.parentNode&&(this._emit("detach",{}),Bt(e))}},{key:"destroy",value:function(){TP(BP(o.prototype),"destroy",this).call(this),this.detach()}},{key:"getModules",value:function(){return o._getModules()}}])&&RP(e.prototype,t),n&&RP(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function AP(e){return(AP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function NP(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $P(e,t,n){return t&&LP(e.prototype,t),n&&LP(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function VP(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zP(e,t)}function zP(e,t){return(zP=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function FP(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=HP(n);return function(e,t){{if(t&&("object"===AP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return UP(e)}(this,r?(e=HP(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function UP(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function HP(e){return(HP=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function WP(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var qP=function(){VP(o,rh);var r=FP(o);function o(e,t){var n;return NP(this,o),WP(UP(n=r.call(this,e,t)),"onElementsChanged",function(){n.forceUpdate()}),WP(UP(n),"setDecisionName",function(e){n._modeling.editDecisionName(e)}),n._viewer=t.injector.get("viewer"),n._modeling=t.injector.get("modeling"),n.setupChangeListeners({bind:n.getDecision().id}),n}return $P(o,[{key:"componentWillUnmount",value:function(){this.setupChangeListeners({unbind:this.getDecision().id})}},{key:"getDecision",value:function(){return this._viewer.getDecision()}},{key:"setupChangeListeners",value:function(e){var t=e.bind,n=e.unbind,e=this.context.changeSupport;"string"==typeof n&&e.offElementsChanged(n,this.onElementsChanged),"string"==typeof t&&e.onElementsChanged(t,this.onElementsChanged)}},{key:"render",value:function(){var e=this.getDecision().name;return Hf(1,"header","decision-properties",Wf(2,GP,{className:"decision-name editor",value:e,onBlur:KP,onChange:this.setDecisionName}),2)}}]),o}(),GP=function(){VP(t,eb);var e=FP(t);function t(){return NP(this,t),e.apply(this,arguments)}return $P(t,[{key:"render",value:function(){return Hf(1,"h3",this.getClassName(),this.getEditor(),0)}}]),t}();function KP(e){e.target.scroll(0,0)}function XP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function YP(e,t,n){return t&&XP(e.prototype,t),n&&XP(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}hr=YP(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("viewer",1500,function(){return qP})});hr.$inject=["components"];var ZP={__depends__:[Ni],__init__:["decisionProperties"],decisionProperties:["type",hr]};function QP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var JP="is not a registered action",zi=function(){function n(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),this._actions={undo:function(){e.undo()},redo:function(){e.redo()}}}var e,t,r;return e=n,(t=[{key:"trigger",value:function(e,t){if(!this._actions[e])throw ek(e,JP);return this._actions[e](t)}},{key:"register",value:function(e,t){var n=this;if("string"==typeof e)return this._registerAction(e,t);x(e,function(e,t){n._registerAction(t,e)})}},{key:"_registerAction",value:function(e,t){if(this.isRegistered(e))throw ek(e,"is already registered");this._actions[e]=t}},{key:"unregister",value:function(e){if(!this.isRegistered(e))throw ek(e,JP);this._actions[e]=void 0}},{key:"isRegistered",value:function(e){return!!this._actions[e]}}])&&QP(e.prototype,t),r&&QP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),n}();function ek(e,t){return new Error(e+" "+t)}zi.$inject=["commandStack","eventBus"];hr={__init__:["editorActions"],editorActions:["type",zi]};function tk(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function nk(e){return e.shiftKey}function rk(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ok(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}zi=function(){function r(e,t,n){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),ok(this,"_init",function(){i._registerDefaultBindings(),i._fire("init")}),ok(this,"_destroy",function(){i._fire("destroy"),i.unbind(),i._listeners=null}),ok(this,"_keyHandler",function(e){for(var t,n=i._listeners,r=e.keyCode||e.charCode||-1,o=0;t=n[o];o++)if(t(r,e))return e.preventDefault(),void e.stopPropagation()}),ok(this,"unbind",function(){var e=i._node;e&&(i._fire("unbind"),Ct.unbind(e,"keydown",i._keyHandler,!0)),i._node=null}),this._config=e||{},this._eventBus=t,this._editorActions=n,this._listeners=[],t.on("viewer.destroy",this._destroy),t.on("viewer.init",this._init),t.on("attach",function(){i._config.bindTo&&i.bind(e.bindTo)}),t.on("detach",this.unbind)}var e,t,n;return e=r,(t=[{key:"bind",value:function(e){this.unbind(),this._node=e,Ct.bind(e,"keydown",this._keyHandler,!0),this._fire("bind")}},{key:"getBinding",value:function(){return this._node}},{key:"_fire",value:function(e){this._eventBus.fire("keyboard."+e,{node:this._node,listeners:this._listeners})}},{key:"_registerDefaultBindings",value:function(){var e=this._listeners,n=this._editorActions;e.push(function(e,t){if(tk(t)&&!nk(t)&&90===e)return n.trigger("undo"),!0}),e.push(function(e,t){if(tk(t)&&(89===e||90===e&&nk(t)))return n.trigger("redo"),!0})}},{key:"addListener",value:function(e){this._listeners.unshift(e)}},{key:"removeListener",value:function(t){this._listeners=this._listeners.filter(function(e){return e!==t})}}])&&rk(e.prototype,t),n&&rk(e,n),Object.defineProperty(e,"prototype",{writable:!1}),r}();zi.$inject=["config.keyboard","eventBus","editorActions"];var ik={__depends__:[hr],__init__:["keyboard"],keyboard:["type",zi]};function ak(e){return(ak="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uk(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function sk(e,t,n){return t&&uk(e.prototype,t),n&&uk(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function lk(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pk(e,t)}function pk(e,t){return(pk=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function fk(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=hk(n);return function(e,t){{if(t&&("object"===ak(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return dk(e)}(this,r?(e=hk(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function dk(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hk(e){return(hk=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var yk=function(){lk(r,rh);var n=fk(r);function r(e,t){ck(this,r),(e=n.call(this,e,t))._viewer=t.injector.get("viewer"),e._modeling=t.injector.get("modeling"),e._dataTypes=t.injector.get("dataTypes");t=e._viewer.getDecision();return e.state={name:t.variable.name,typeRef:t.variable.typeRef},e.setVariableName=e.setVariableName.bind(dk(e)),e.setVariableType=e.setVariableType.bind(dk(e)),e}return sk(r,[{key:"setVariableName",value:function(e){this._modeling.editVariableName(e),this.setState({name:e})}},{key:"setVariableType",value:function(e){""===e?(this._modeling.editVariableType(void 0),this.setState({typeRef:void 0})):(this._modeling.editVariableType(e),this.setState({typeRef:e}))}},{key:"render",value:function(){var e=this.state,t=e.name,n=e.typeRef,e=this._dataTypes.getAll().map(function(e){return{label:e,value:e}});return Hf(1,"div","literal-expression-properties",Hf(1,"table",null,[Hf(1,"tr",null,[Hf(1,"td",null,qf("Variable Name:"),2),Hf(1,"td",null,Wf(2,j_,{className:"variable-name-input",onInput:this.setVariableName,placeholder:"name",value:t||""}),2)],4),Hf(1,"tr",null,[Hf(1,"td",null,qf("Variable Type:"),2),Hf(1,"td",null,Hf(1,"div","dms-fill-row",Wf(2,Cw,{onChange:this.setVariableType,options:e,value:n,className:"variable-type-select dms-block"}),2),2)],4),Wf(2,mk)],4),2)}}]),r}(),mk=function(){lk(r,rh);var n=fk(r);function r(e,t){return ck(this,r),(e=n.call(this,e,t))._viewer=t.injector.get("viewer"),e._modeling=t.injector.get("modeling"),e._expressionLanguages=t.injector.get("expressionLanguages"),e.setExpressionLanguage=e.setExpressionLanguage.bind(dk(e)),e}return sk(r,[{key:"setExpressionLanguage",value:function(e){""===e?this._modeling.editExpressionLanguage(void 0):this._modeling.editExpressionLanguage(e)}},{key:"_getExpressionLanguage",value:function(){var e=this._viewer.getDecision().decisionLogic;return e&&e.expressionLanguage?e.expressionLanguage.toLowerCase():this._getDefaultExpressionLanguage()}},{key:"_getDefaultExpressionLanguage",value:function(){return this._expressionLanguages.getDefault().value}},{key:"_shouldRender",value:function(){return 1<this._expressionLanguages.getAll().length||this._getExpressionLanguage()!==this._getDefaultExpressionLanguage()}},{key:"render",value:function(){if(!this._shouldRender())return null;var e=this._getExpressionLanguage(),t=this._expressionLanguages.getAll();return Hf(1,"tr",null,[Hf(1,"td",null,qf("Expression Language:"),2),Hf(1,"td",null,Hf(1,"div","dms-fill-row",Wf(2,Cw,{onChange:this.setExpressionLanguage,options:t,value:e,className:"expression-language-select dms-block"}),2),2)],4)}}]),r}();function vk(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function gk(e,t,n){return t&&vk(e.prototype,t),n&&vk(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}zi=gk(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("viewer",500,function(){return yk})});zi.$inject=["components"];var bk={__depends__:[Ni,ik,Zy,ju],__init__:["literalExpressionProperties"],literalExpressionProperties:["type",zi]};function _k(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}zi=function(){function o(t,e,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this._commandStack=t,this._viewer=e,(this._eventBus=n).on("viewer.init",function(){var e,n;e=r.getHandlers(),n=t,x(e,function(e,t){n.registerHandler(t,e)})})}var e,t,n;return e=o,n=[{key:"_getHandlers",value:function(){return{"element.updateProperties":I1}}}],(t=[{key:"getHandlers",value:function(){return o._getHandlers()}},{key:"getDecision",value:function(){return this._viewer.getDecision()}},{key:"editDecisionName",value:function(e){var t=this.getDecision();this._commandStack.execute("element.updateProperties",{element:t,properties:{name:e}})}},{key:"editDecisionId",value:function(e){var t=this.getDecision();this._commandStack.execute("element.updateProperties",{element:t,properties:{id:e}})}},{key:"editLiteralExpressionText",value:function(e){var t=this.getDecision().decisionLogic;this._commandStack.execute("element.updateProperties",{element:t,properties:{text:e}})}},{key:"editExpressionLanguage",value:function(e){var t=this.getDecision().decisionLogic;this._commandStack.execute("element.updateProperties",{element:t,properties:{expressionLanguage:e}})}},{key:"editVariableName",value:function(e){var t=this.getDecision().variable;this._commandStack.execute("element.updateProperties",{element:t,properties:{name:e}})}},{key:"editVariableType",value:function(e){var t=this.getDecision().variable;this._commandStack.execute("element.updateProperties",{element:t,properties:{typeRef:e}})}}])&&_k(e.prototype,t),n&&_k(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();zi.$inject=["commandStack","viewer","eventBus"];var wk={__init__:["idChangeBehavior","modeling"],commandStack:["type",bs],idChangeBehavior:["type",da],modeling:["type",zi]};function xk(e){return(xk="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ok(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jk(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ek(e,t,n){return t&&jk(e.prototype,t),n&&jk(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ck(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sk(e,t)}function Sk(e,t){return(Sk=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pk(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=Rk(n);return function(e,t){{if(t&&("object"===xk(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return kk(e)}(this,r?(e=Rk(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function kk(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rk(e){return(Rk=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Tk=function(){Ck(o,rh);var r=Pk(o);function o(e,t){var n;Ok(this,o),(n=r.call(this,e,t))._modeling=t.injector.get("modeling"),n._viewer=t.injector.get("viewer"),n.editLiteralExpressionText=n.editLiteralExpressionText.bind(kk(n)),n.onElementsChanged=n.onElementsChanged.bind(kk(n));e=n.getLiteralExpression().id;return t.changeSupport.onElementsChanged(e,n.onElementsChanged),n}return Ek(o,[{key:"getLiteralExpression",value:function(){return this._viewer.getDecision().decisionLogic}},{key:"onElementsChanged",value:function(){this.forceUpdate()}},{key:"editLiteralExpressionText",value:function(e){this._modeling.editLiteralExpressionText(e)}},{key:"render",value:function(){var e=this.getLiteralExpression().text;return Wf(2,Dk,{className:"textarea editor",value:e,onChange:this.editLiteralExpressionText})}}]),o}(),Dk=function(){Ck(t,eb);var e=Pk(t);function t(){return Ok(this,t),e.apply(this,arguments)}return Ek(t,[{key:"render",value:function(){return Hf(1,"div",this.getClassName(),this.getEditor(),0)}}]),t}();function Mk(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Bk(e,t,n){return t&&Mk(e.prototype,t),n&&Mk(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}zi=Bk(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("viewer",function(){return Tk})});zi.$inject=["components"];var Ik={__depends__:[Ni],__init__:["textarea"],textarea:["type",zi]};function Ak(e){return(Ak="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Nk(e){return function(e){if(Array.isArray(e))return Lk(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Lk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lk(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lk(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $k(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Vk(e,t){return(Vk=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function zk(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=Fk(n);return function(e,t){{if(t&&("object"===Ak(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined")}return function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,r?(e=Fk(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function Fk(e){return(Fk=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Uk=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vk(e,t)}(o,IP);var e,t,n,r=zk(o);function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),r.apply(this,arguments)}return e=o,n=[{key:"_getModules",value:function(){return[ZP,ik,bk,wk,Zy,r_,Ik]}}],(t=[{key:"getModules",value:function(){return[].concat(Nk(IP._getModules()),Nk(o._getModules()))}}])&&$k(e.prototype,t),n&&$k(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();return function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&i(e,t)}(a,fn);var e,t,n,r=u(a);function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),r.apply(this,arguments)}return e=a,(t=[{key:"_getViewProviders",value:function(){return[{id:"drd",constructor:Xp,opens:"dmn:Definitions"},{id:"decisionTable",constructor:sS,opens:function(e){return en(e,"dmn:Decision")&&en(e.decisionLogic,"dmn:DecisionTable")}},{id:"literalExpression",constructor:Uk,opens:function(e){return en(e,"dmn:Decision")&&en(e.decisionLogic,"dmn:LiteralExpression")}}]}},{key:"_getInitialView",value:function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=(i=s(c(a.prototype),"_getInitialView",this)).call.apply(i,[this,e].concat(n));if(o){var i=o.element;return o=en(i,"dmn:Definitions")&&!Wu(i)?b(e,function(e){return!en(e.element,"dmn:Definitions")})||o:o}}}])&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),a}()});
28