1/*! dmn-js - dmn-modeler v6.0.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.DmnJS=t()}(this,function(){"use strict";function f(e){return Array.prototype.concat.apply([],e)}var t=Object.prototype.toString,a=Object.prototype.hasOwnProperty;function u(e){return void 0===e}function c(e){return void 0!==e}function y(e){return"[object Array]"===t.call(e)}function _(e){return"[object Object]"===t.call(e)}function l(e){return"[object Number]"===t.call(e)}function p(e){return"[object Function]"===t.call(e)}function d(e){return"[object String]"===t.call(e)}function g(e,n){var t,o;return n=p(t=n)?t:function(e){return e===t},w(e,function(e,t){if(n(e,t))return o=e,!1}),o}function h(e,n){var o=[];return w(e,function(e,t){n(e,t)&&o.push(e)}),o}function w(e,t){if(!u(e)){var n,o,r=y(e)?S:k;for(var i in e){if(n=e,o=i,a.call(n,o))if(!1===t(e[i],r(i)))return}}}function x(e,n,o){return w(e,function(e,t){o=n(o,e,t)}),o}function r(e,o){return x(e,function(e,t,n){return e&&o(t,n)},!0)}function i(e,t){return!!g(e,t)}function v(e,n){var o=[];return w(e,function(e,t){o.push(n(e,t))}),o}function m(e){return e&&Object.keys(e)||[]}function b(e,o){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return o=s(o),w(e,function(e){var t=o(e)||"_",n=r[t];n||(n=r[t]=[]),n.push(e)}),r}function C(e,i){i=s(i);var a=[];return w(e,function(e,t){for(var n=i(e,t),o={d:n,v:e},r=0;r<a.length;r++){if(n<a[r].d)return void a.splice(r,0,o)}a.push(o)}),v(a,function(e){return e.v})}function E(e){return function(n){return r(e,function(e,t){return n[t]===e})}}function s(t){return p(t)?t:function(e){return e[t]}}function k(e){return e}function S(e){return Number(e)}var O=Array.prototype.slice;function j(t,n){var o;return function(){var e=O.call(arguments);o&&clearTimeout(o),o=setTimeout(function(){t.apply(void 0,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(e))},n)}}function P(e,t){return e.bind(t)}var T=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e};function R(e){for(var t=arguments.length,n=Array(1<t?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return T.apply(void 0,[e].concat(n))}function A(t,e){var n={},o=Object(t);return w(e,function(e){e in o&&(n[e]=t[e])}),n}var 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},M="__fn",B=Array.prototype.slice;function o(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function I(){}function N(){}function n(e,t){this.model=e,this.properties=t}o.prototype.on=function(e,t,n,o){if(e=y(e)?e:[e],p(t)&&(o=n,n=t,t=1e3),!l(t))throw new Error("priority must be a number");var r=n;o&&((r=P(n,o))[M]=n[M]||n);var i=this,a={priority:t,callback:r};e.forEach(function(e){i._addListener(e,a)})},o.prototype.once=function(e,t,n,o){var r=this;if(p(t)&&(o=n,n=t,t=1e3),!l(t))throw new Error("priority must be a number");function i(){return r.off(e,i),n.apply(o,arguments)}i[M]=n,this.on(e,t,i)},o.prototype.off=function(e,t){e=y(e)?e:[e];var n=this;e.forEach(function(e){n._removeListener(e,t)})},o.prototype.createEvent=function(e){var t=new I;return t.init(e),t},o.prototype.fire=function(e,t){var n,o,r,i;if(i=B.call(arguments),"object"===(void 0===e?"undefined":D(e))&&(e=(n=e).type),!e)throw new Error("no event type specified");if(o=this._listeners[e]){n=t instanceof I?t:this.createEvent(t);var a=(i[0]=n).type;e!==a&&(n.type=e);try{r=this._invokeListeners(n,i,o)}finally{e!==a&&(n.type=a)}return void 0===r&&n.defaultPrevented&&(r=!1),r}},o.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},o.prototype._destroy=function(){this._listeners={}},o.prototype._invokeListeners=function(e,t,n){var o,r,i;for(o=0;(r=n[o])&&!e.cancelBubble;o++)i=this._invokeListener(e,t,r);return i},o.prototype._invokeListener=function(e,t,n){var o,r,i;try{r=n.callback,i=t,void 0!==(o=r.apply(null,i))&&(e.returnValue=o,e.stopPropagation()),!1===o&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener"),console.error(e.stack),e}return o},o.prototype._addListener=function(e,t){var n,o,r=this._getListeners(e);for(o=0;n=r[o];o++)if(n.priority<t.priority)return void r.splice(o,0,t);r.push(t)},o.prototype._getListeners=function(e){var t=this._listeners[e];return t||(this._listeners[e]=t=[]),t},o.prototype._removeListener=function(e,t){var n,o,r,i=this._getListeners(e);if(t)for(r=i.length-1;n=i[r];r--)(o=n.callback)!==t&&o[M]!==t||i.splice(r,1);else i.length=0},I.prototype.stopPropagation=function(){this.cancelBubble=!0},I.prototype.preventDefault=function(){this.defaultPrevented=!0},I.prototype.init=function(e){R(this,e||{})},N.prototype.get=function(e){return this.$model.properties.get(this,e)},N.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},n.prototype.createType=function(e){var t=this.model,n=this.properties,o=Object.create(N.prototype);w(e.properties,function(e){e.isMany||void 0===e.default||(o[e.name]=e.default)}),n.defineModel(o,t),n.defineDescriptor(o,e);var r=e.ns.name;function i(e){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),w(e,P(function(e,t){this.set(t,e)},this))}return i.prototype=o,i.hasType=o.$instanceOf=this.model.hasType,n.defineModel(i,t),n.defineDescriptor(i,e),i};var V={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},L={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e,10)}};function $(e,t){var n=L[e];return n?n(t):t}function F(e){return!!V[e]}function U(e){return!!L[e]}function z(e,t){var n,o,r=e.split(/:/);if(1===r.length)n=e,o=t;else{if(2!==r.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=r[1],o=r[0]}return{name:e=(o?o+":":"")+n,prefix:o,localName:n}}function W(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function H(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,w(e,P(this.registerPackage,this))}function G(e,t,n){var o=t[n];if(o in e)throw new Error("package with "+n+" <"+o+"> already defined")}function q(e){this.model=e}function K(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function X(e){this.properties=new q(this),this.factory=new n(this,this.properties),this.registry=new H(e,this.properties),this.typeCache={}}W.prototype.build=function(){return A(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},W.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var o=this.properties;void 0!==t?o.splice(t,0,e):o.push(e)},W.prototype.replaceProperty=function(e,t,n){var o=e.ns,r=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)}var s=r.indexOf(e);if(-1===s)throw new Error("property <"+o.name+"> not found in property list");r.splice(s,1),this.addProperty(t,n?void 0:s,a),i[o.name]=i[o.localName]=t},W.prototype.redefineProperty=function(e,t,n){var o=e.ns.prefix,r=t.split("#"),i=z(r[0],o),a=z(r[1],i.prefix).name,s=this.propertiesByName[a];if(!s)throw new Error("refined property <"+a+"> not found");this.replaceProperty(s,e,n),delete e.redefines},W.prototype.addNamedProperty=function(e,t){var n=e.ns,o=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),o[n.name]=o[n.localName]=e},W.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},W.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},W.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},W.prototype.assertNotDefined=function(e,t){var n=e.name,o=this.propertiesByName[n];if(o)throw new Error("property <"+n+"> already defined; override of <"+o.definedBy.ns.name+"#"+o.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},W.prototype.hasProperty=function(e){return this.propertiesByName[e]},W.prototype.addTrait=function(o,r){var e=this.allTypesByName,t=this.allTypes,n=o.name;n in e||(w(o.properties,P(function(e){e=R({},e,{name:e.ns.localName,inherited:r}),Object.defineProperty(e,"definedBy",{value:o});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(o),e[n]=o)},H.prototype.getPackage=function(e){return this.packageMap[e]},H.prototype.getPackages=function(){return this.packages},H.prototype.registerPackage=function(t){t=R({},t);var e=this.packageMap;G(e,t,"prefix"),G(e,t,"uri"),w(t.types,P(function(e){this.registerType(e,t)},this)),e[t.uri]=e[t.prefix]=t,this.packages.push(t)},H.prototype.registerType=function(e,t){var o=z((e=R({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:R(e.meta||{})})).name,t.prefix),n=o.name,r={};w(e.properties,P(function(e){var t=z(e.name,o.prefix),n=t.name;F(e.type)||(e.type=z(e.type,t.prefix).name),R(e,{ns:t,name:n}),r[n]=e},this)),R(e,{ns:o,name:n,propertiesByName:r}),w(e.extends,P(function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(n)},this)),this.definePackage(e,t),this.typeMap[n]=e},H.prototype.mapTypes=function(o,r,e){var t=F(o.name)?{name:o.name}:this.typeMap[o.name],i=this;function n(e){return a(e,!0)}function a(e,t){var n=z(e,F(e)?"":o.prefix);i.mapTypes(n,r,t)}if(!t)throw new Error("unknown type <"+o.name+">");w(t.superClass,e?n:a),r(t,!e),w(t.traits,n)},H.prototype.getEffectiveDescriptor=function(e){var t=z(e),n=new W(t);this.mapTypes(t,function(e,t){n.addTrait(e,t)});var o=n.build();return this.definePackage(o,o.allTypes[o.allTypes.length-1].$pkg),o},H.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},q.prototype.set=function(e,t,n){var o=this.model.getPropertyDescriptor(e,t),r=o&&o.name;void 0===n?o?delete e[r]:delete e.$attrs[t]:o?r in e?e[r]=n:K(e,o,n):e.$attrs[t]=n},q.prototype.get=function(e,t){var n=this.model.getPropertyDescriptor(e,t);if(!n)return e.$attrs[t];var o=n.name;return!e[o]&&n.isMany&&K(e,n,[]),e[o]},q.prototype.define=function(e,t,n){Object.defineProperty(e,t,n)},q.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},q.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},X.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},X.prototype.getType=function(e){var t=this.typeCache,n=d(e)?e:e.ns.name,o=t[n];return o||(e=this.registry.getEffectiveDescriptor(n),o=t[n]=this.factory.createType(e)),o},X.prototype.createAny=function(e,t,n){var o=z(e),r={$type:e,$instanceOf:function(e){return e===this.$type}},i={name:e,isGeneric:!0,ns:{prefix:o.prefix,localName:o.localName,uri:t}};return this.properties.defineDescriptor(r,i),this.properties.defineModel(r,this),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),w(n,function(e,t){_(e)&&void 0!==e.value?r[e.name]=e.value:r[t]=e}),r},X.prototype.getPackage=function(e){return this.registry.getPackage(e)},X.prototype.getPackages=function(){return this.registry.getPackages()},X.prototype.getElementDescriptor=function(e){return e.$descriptor},X.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},X.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},X.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var Z="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(e,t){return e(t={exports:{}},t.exports),t.exports}var Y=e(function(e,t){var o,n=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();"undefined"!=typeof window&&window, 3/** 4 * Tiny stack for browser or server 5 * 6 * @author Jason Mulligan <jason.mulligan@avoidwork.com> 7 * @copyright 2018 8 * @license BSD-3-Clause 9 * @link http://avoidwork.github.io/tiny-stack 10 * @version 1.1.0 11 */ 12o=function(){function o(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")} 13/** 14 * Tiny stack for browser or server 15 * 16 * @author Jason Mulligan <jason.mulligan@avoidwork.com> 17 * @copyright 2018 18 * @license BSD-3-Clause 19 * @link http://avoidwork.github.io/tiny-stack 20 * @version 1.1.0 21 */(this,o);for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];this.data=[null].concat(t),this.top=this.data.length-1}return n(o,[{key:"clear",value:function(){return this.data.length=1,this.top=0,this}},{key:"empty",value:function(){return 0===this.top}},{key:"length",value:function(){return this.top}},{key:"peek",value:function(){return this.data[this.top]}},{key:"pop",value:function(){var e=void 0;return 0<this.top&&(e=this.data.pop(),this.top--),e}},{key:"push",value:function(e){return this.data[++this.top]=e,this}},{key:"search",value:function(e){var t=this.data.indexOf(e);return-1===t?-1:this.data.length-t}}]),o}(),e.exports=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return new(Function.prototype.bind.apply(o,[null].concat(t)))}}),J="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},Q=String.fromCharCode,ee=Object.prototype.hasOwnProperty,te=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,ne={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function oe(e,t,n,o){return o?ee.call(ne,o)?ne[o]:"&"+o+";":Q(t||parseInt(n,16))}function re(e){return 3<e.length&&-1!==e.indexOf("&")?e.replace(te,oe):e}Object.keys(ne).forEach(function(e){ne[e.toUpperCase()]=ne[e]});var ie="http://www.w3.org/2001/XMLSchema-instance",ae="xsi",se="xsi:type",ce="non-whitespace outside of root node";function ue(e){return new Error(e)}function le(e){return"missing namespace for prefix <"+e+">"}function pe(e){return{get:e,enumerable:!0}}function fe(e){var t,n={};for(t in e)n[t]=e[t];return n}function de(e){return e+"$uri"}function he(){return{line:0,column:0}}function ye(e){throw e}function ve(e){if(!this)return new ve(e);var m,C,E,k,n,S,O,j,P,T=e&&e.proxy,o=ye,R=he,A=!1,D=!1,t=null,M=!1;function B(e){e instanceof Error||(e=ue(e)),o(t=e,R)}function I(e){n&&(e instanceof Error||(e=ue(e)),n(e,R))}this.on=function(e,t){if("function"!=typeof t)throw ue("required args <name, cb>");switch(e){case"openTag":C=t;break;case"text":m=t;break;case"closeTag":E=t;break;case"error":o=t;break;case"warn":n=t;break;case"cdata":k=t;break;case"attention":j=t;break;case"question":O=t;break;case"comment":S=t;break;default:throw ue("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!==(void 0===e?"undefined":J(e)))throw ue("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return n[ie]=ae,D=!0,P=n,this},this.parse=function(e){if("string"!=typeof e)throw ue("required args <xml=string>");return t=null,function(a){var e,t,n,o,r,i,s,c,u,g,l=D?[]:null,b=D?function(e){var t,n,o={};for(t in e)o[n=e[t]]=n,o[de(n)]=t;return o}(P):null,p=[],_=0,f=!1,d=!1,h=0,y=0,w="",x=0;function v(){if(null!==g)return g;var e,t,n,o,r,i,a,s,c,u,l,p=D&&b.xmlns,f=D&&A?[]:null,d=x,h=w,y=h.length,v={},m={};e:for(;d<y;d++)if(c=!1,!(32===(u=h.charCodeAt(d))||u<14&&8<u)){for((u<65||122<u||90<u&&u<97)&&95!==u&&58!==u&&(I("illegal first char attribute name"),c=!0),l=d+1;l<y;l++)if(!(96<(u=h.charCodeAt(l))&&u<123||64<u&&u<91||47<u&&u<59||46===u||45===u||95===u)){if(32===u||u<14&&8<u){I("missing attribute value"),d=l;continue e}if(61===u)break;I("illegal attribute name char"),c=!0}if("xmlns:xmlns"===(s=h.substring(d,l))&&(I("illegal declaration of xmlns"),c=!0),34===(u=h.charCodeAt(l+1)))-1===(l=h.indexOf('"',d=l+2))&&-1!==(l=h.indexOf("'",d))&&(I("attribute value quote missmatch"),c=!0);else if(39===u)-1===(l=h.indexOf("'",d=l+2))&&-1!==(l=h.indexOf('"',d))&&(I("attribute value quote missmatch"),c=!0);else for(I("missing attribute value quotes"),c=!0,l+=1;l<y&&!(32===(u=h.charCodeAt(l+1))||u<14&&8<u);l++);for(-1===l&&(I("missing closing quotes"),l=y,c=!0),c||(i=h.substring(d,l)),d=l;l+1<y&&!(32===(u=h.charCodeAt(l+1))||u<14&&8<u);l++)d===l&&(I("illegal character after attribute end"),c=!0);if(d=l+1,!c)if(s in m)I("attribute <"+s+"> already defined");else if(m[s]=!0,D)if(A){if(null!==(r="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null)){if(e=re(i),t=de(r),!(a=P[e])){if("xmlns"===r||t in b&&b[t]!==e)for(;a="ns"+_++,void 0!==b[a];);else a=r;P[e]=a}b[r]!==a&&(o||(b=fe(b),o=!0),b[r]=a,"xmlns"===r&&(b[de(a)]=e,p=a),b[t]=e),v[s]=i;continue}f.push(s,i)}else-1!==(u=s.indexOf(":"))?(n=b[s.substring(0,u)])?((s=p===n?s.substr(u+1):n+s.substr(u))===se&&(i=-1!==(u=i.indexOf(":"))?(n=i.substring(0,u),(n=b[n]||n)+i.substring(u)):p+":"+i),v[s]=i):I(le(s.substring(0,u))):v[s]=i;else v[s]=i}if(A)for(d=0,y=f.length;d<y;d++){if(s=f[d++],i=f[d],-1!==(u=s.indexOf(":"))){if(!(n=b[s.substring(0,u)])){I(le(s.substring(0,u)));continue}(s=p===n?s.substr(u+1):n+s.substr(u))===se&&(i=-1!==(u=i.indexOf(":"))?(n=i.substring(0,u),(n=b[n]||n)+i.substring(u)):p+":"+i)}v[s]=i}return g=v}R=function(){for(var e,t=/(\r\n|\r|\n)/g,n=0,o=0,r=0,i=y;r<=h&&(e=t.exec(a))&&(i=e[0].length+e.index,!(h<i));)n+=1,r=i;return{data:-1==h?(o=i,a.substring(y)):0===y?(console.log(h-r),a.substring(y,h)):(o=h-r,-1==y?a.substring(h):a.substring(h,y+1)),line:n,column:o}},T&&(u=Object.create({},{name:pe(function(){return s}),originalName:pe(function(){return c}),attrs:pe(v),ns:pe(function(){return b})}));for(;-1!==y;){if(-1===(h=60===a.charCodeAt(y)?y:a.indexOf("<",y)))return p.length?B("unexpected end of file"):0===y?B("missing start tag"):y<a.length&&a.substring(y).trim()&&I(ce);if(y!==h)if(p.length){if(m&&(m(a.substring(y,h),re,R),M))return}else if(a.substring(y,h).trim()&&(I(ce),M))return;if(33!==(r=a.charCodeAt(h+1)))if(63!==r){if(-1==(y=a.indexOf(">",h+1)))return B("unclosed tag");if(g={},47===r){if(d=!(f=!1),!p.length)return B("missing open tag");if(t=s=p.pop(),o=h+2+t.length,a.substring(h+2,o)!==t)return B("closing tag mismatch");for(;o<y;o++)if(!(32===(r=a.charCodeAt(o))||8<r&&r<14))return B("close tag")}else{if(d=47===a.charCodeAt(y-1)?(t=s=a.substring(h+1,y-1),f=!0):(t=s=a.substring(h+1,y),!(f=!0)),!(96<r&&r<123||64<r&&r<91||95===r||58===r))return B("illegal first char nodeName");for(o=1,n=t.length;o<n;o++)if(!(96<(r=t.charCodeAt(o))&&r<123||64<r&&r<91||47<r&&r<59||45===r||95===r||46==r)){if(32===r||r<14&&8<r){s=t.substring(0,o),g=null;break}return B("invalid nodeName")}d||p.push(s)}if(D){if(e=b,f&&(d||l.push(e),null===g&&(A=-1!==t.indexOf("xmlns",o))&&(x=o,w=t,v(),A=!1)),-1!==(r=(c=s).indexOf(":"))){if(!(i=b[s.substring(0,r)]))return B("missing namespace on <"+c+">");s=s.substr(r+1)}else i=b.xmlns;i&&(s=i+":"+s)}if(f&&(x=o,w=t,C&&(T?C(u,re,d,R):C(s,v,re,d,R),M)))return;if(d){if(E&&(E(T?u:s,re,f,R),M))return;D&&(b=f?e:l.pop())}y+=1}else{if(-1===(y=a.indexOf("?>",h)))return B("unclosed question");if(O&&(O(a.substring(h,y+2),R),M))return;y+=2}else{if(91===(r=a.charCodeAt(h+2))&&"CDATA["===a.substr(h+3,6)){if(-1===(y=a.indexOf("]]>",h)))return B("unclosed cdata");if(k&&(k(a.substring(h+9,y),R),M))return;y+=3;continue}if(45===r&&45===a.charCodeAt(h+3)){if(-1===(y=a.indexOf("--\x3e",h)))return B("unclosed comment");if(S&&(S(a.substring(h+4,y),re,R),M))return;y+=3;continue}if(-1===(y=a.indexOf(">",h+1)))return B("unclosed tag");if(j&&(j(a.substring(h,y+1),re,R),M))return;y+=1}}}(e),R=he,M=!1,t},this.stop=function(){M=!0}}function me(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var ge={xsi:"http://www.w3.org/2001/XMLSchema-instance"},be="xsi:type";function _e(e){return e.xml&&e.xml.serialize}function we(e){return _e(e)===be}function xe(e,t){return me(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function Ce(e){return new Error(e)}function Ee(e){return e.$descriptor}function ke(e){R(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,o=Ee(e).idProperty;if(o&&(t=e.get(o.name))){if(n[t])throw Ce("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Se(){}function Oe(){}function je(){}function Pe(e,t){this.property=e,this.context=t}function Te(e,t){this.element=t,this.propertyDesc=e}function Re(){}function Ae(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function De(e,t,n){Ae.call(this,e,t,n)}function Me(e,t,n){this.model=e,this.context=n}function Be(e){e instanceof X&&(e={model:e}),R(this,{lax:!1},e)}Se.prototype.handleEnd=function(){},Se.prototype.handleText=function(){},Se.prototype.handleNode=function(){},(Oe.prototype=Object.create(Se.prototype)).handleNode=function(){return this},(je.prototype=Object.create(Se.prototype)).handleText=function(e){this.body=(this.body||"")+e},(Pe.prototype=Object.create(je.prototype)).handleNode=function(e){if(this.element)throw Ce("expected no sub nodes");return this.element=this.createReference(e),this},Pe.prototype.handleEnd=function(){this.element.id=this.body},Pe.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},(Te.prototype=Object.create(je.prototype)).handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=$(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},(Re.prototype=Object.create(je.prototype)).handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t},(Ae.prototype=Object.create(Re.prototype)).addReference=function(e){this.context.addReference(e)},Ae.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Ee(t).bodyProperty;n&&void 0!==e&&(e=$(n.type,e),t.set(n.name,e))},Ae.prototype.createElement=function(e){var o,t=e.attributes,n=this.type,r=Ee(n),i=this.context,a=new n({}),s=this.model;return w(t,function(e,t){var n=r.propertiesByName[t];n&&n.isReference?n.isMany?w(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=$(n.type,e):"xmlns"!==t&&(o=z(t,r.ns.prefix),s.getPackage(o.prefix)&&i.addWarning({message:"unknown attribute <"+t+">",element:a,property:t,value:e})),a.set(t,e))}),a},Ae.prototype.getPropertyForNode=function(e){var t,n,o,r,i,a,s,c,u,l,p=z(e.name),f=this.type,d=this.model,h=Ee(f),y=p.name,v=h.propertiesByName[y];if(v)return we(v)&&(t=e.attributes[be])?(o=d,u=z(t),l=o.getPackage(u.prefix),i=l,a=(r=u).name,s=r.localName,t=(c=i.xml&&i.xml.typePrefix)&&0===s.indexOf(c)?r.prefix+":"+s.slice(c.length):a,R({},v,{effectiveType:Ee(n=d.getType(t)).name})):v;var m=d.getPackage(p.prefix);if(m){if(t=xe(p,m),n=d.getType(t),v=g(h.properties,function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)}))return R({},v,{effectiveType:Ee(n).name})}else if(v=g(h.properties,function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type}))return v;throw Ce("unrecognized element <"+p.name+">")},Ae.prototype.toString=function(){return"ElementDescriptor["+Ee(this.type).name+"]"},Ae.prototype.valueHandler=function(e,t){return new Te(e,t)},Ae.prototype.referenceHandler=function(e){return new Pe(e,this.context)},Ae.prototype.handler=function(e){return"Element"===e?new Me(this.model,e,this.context):new Ae(this.model,e,this.context)},Ae.prototype.handleChild=function(e){var t,n,o,r;if(t=this.getPropertyForNode(e),o=this.element,U(n=t.effectiveType||t.type))return this.valueHandler(t,o);var i=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==i&&(t.isMany?o.get(t.name).push(i):o.set(t.name,i),t.isReference?(R(i,{element:o}),this.context.addReference(i)):i.$parent=o),r},(De.prototype=Object.create(Ae.prototype)).createElement=function(e){var t=e.name,n=z(t),o=this.model,r=this.type,i=o.getPackage(n.prefix),a=i&&xe(n,i)||t;if(!r.hasType(a))throw Ce("unexpected element <"+e.originalName+">");return Ae.prototype.createElement.call(this,e)},(Me.prototype=Object.create(Re.prototype)).createElement=function(e){var t=e.name,n=z(t).prefix,o=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,o,r)},Me.prototype.handleChild=function(e){var t=new Me(this.model,"Element",this.context).handleNode(e),n=this.element,o=t.element;return void 0!==o&&((n.$children=n.$children||[]).push(o),o.$parent=n),t},Me.prototype.handleText=function(e){this.body=this.body||""+e},Me.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Be.prototype.fromXML=function(n,e,o){var r=e.rootHandler;e instanceof Ae?(r=e,e={}):"string"==typeof e?(r=this.handler(e),e={}):"string"==typeof r&&(r=this.handler(r));var t=this.model,a=this.lax,u=new ke(R({},e,{rootHandler:r})),i=new ve({proxy:!0}),s=new Y;function c(e,t,n){var o=t(),r=o.line,i=o.column,a=o.data;"<"===a.charAt(0)&&-1!==a.indexOf(" ")&&(a=a.slice(0,a.indexOf(" "))+">");var s="unparsable content "+(a?a+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+i+"\n\tnested error: "+e.message;if(n)return u.addWarning({message:s,error:e}),console.warn("could not parse node"),console.warn(e),!0;throw console.error("could not parse document"),console.error(e),Ce(s)}r.context=u,s.push(r);var l=/^<\?xml /i,p=/ encoding="([^"]+)"/i,f=/^utf-8$/i;var d=t.getPackages().reduce(function(e,t){return e[t.uri]=t.prefix,e},{});i.ns(d).on("openTag",function(e,o,t,n){var r=e.attrs||{},i=Object.keys(r).reduce(function(e,t){var n=o(r[t]);return e[t]=n,e},{});!function(e,t){var n=s.peek();try{s.push(n.handleNode(e))}catch(e){c(e,t,a)&&s.push(new Oe)}}({name:e.name,originalName:e.originalName,attributes:i,ns:e.ns},n)}).on("question",function(e){if(l.test(e)){var t=p.exec(e),n=t&&t[1];n&&!f.test(n)&&u.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}}).on("closeTag",function(){s.pop().handleEnd()}).on("cdata",function(e){s.peek().handleText(e)}).on("text",function(e,t){var n;(n=(n=t(e)).trim())&&s.peek().handleText(n)}).on("error",c).on("warn",function(e,t){return c(e,t,!0)}),setTimeout(function(){var t;try{i.parse(n),function(){var e,t,n=u.elementsById,o=u.references;for(e=0;t=o[e];e++){var r=t.element,i=n[t.id],a=Ee(r).propertiesByName[t.property];if(i||u.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),a.isMany){var s=r.get(a.name),c=s.indexOf(t);-1===c&&(c=s.length),i?s[c]=i:s.splice(c,1)}else r.set(a.name,i)}}()}catch(e){t=e}var e=r.element;t||e||(t=Ce("failed to parse document as <"+r.type.$descriptor.name+">")),o(t,t?void 0:e,u)},0)},Be.prototype.handler=function(e){return new De(this.model,e)};var Ie=/<|>|'|"|&|\n\r|\n/g,Ne=/<|>|&/g;function Ve(t){var n={},o={},r={},i=[],a=[];this.byUri=function(e){return o[e]||t&&t.byUri(e)},this.add=function(e,t){o[e.uri]=e,t?i.push(e):a.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.logUsed=function(e){var t=e.uri;r[t]=this.byUri(t)},this.getUsed=function(e){return[].concat(i,a).filter(function(e){return r[e.uri]})}}function Le(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function $e(e){return d(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function Fe(e,t){return t.isGeneric?R({localName:t.ns.localName},e):R({localName:(n=t.ns.localName,o=t.$pkg,me(o)?(r=n).charAt(0).toLowerCase()+r.slice(1):n)},e);var n,o,r}var Ue={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},ze={"<":"lt",">":"gt","&":"amp"};function We(e,t,n){return(e=d(e)?e:""+e).replace(t,function(e){return"&"+n[e]+";"})}function He(e){this.tagName=e}function Ge(){}function qe(e){this.tagName=e}function Ke(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Xe(e,t){Ke.call(this,e,t)}function Ze(){this.value="",this.write=function(e){this.value+=e}}function Ye(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 Je(r){return r=R({format:!1,preamble:!0},r||{}),{toXML:function(e,t){var n=t||new Ze,o=new Ye(n,r.format);if(r.preamble&&o.append('<?xml version="1.0" encoding="UTF-8"?>\n'),(new Ke).build(e).serializeTo(o),!t)return n.value}}}function Qe(e,t){X.call(this,e,t)}He.prototype.build=function(e){return this.element=e,this},He.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},Ge.prototype.serializeValue=Ge.prototype.serializeTo=function(e){e.append(this.escape?We(this.value,Ne,ze):this.value)},Ge.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(Ne)&&(this.escape=!0),this},Le(qe,Ge),qe.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},Ke.prototype.build=function(e){var t,n,o,r=(this.element=e).$descriptor,i=this.propertyDescriptor,a=r.isGeneric;return t=a?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=i?this.nsPropertyTagName(i):this.nsTagName(r),this.tagName=this.addTagName(this.ns),a||(n=h((o=e).$descriptor.properties,function(e){var t=e.name;if(e.isVirtual)return!1;if(!o.hasOwnProperty(t))return!1;var n=o[t];return n!==e.default&&null!==n&&(!e.isMany||n.length)}),this.parseAttributes(h(n,function(e){return e.isAttr})),this.parseContainments(h(n,function(e){return!e.isAttr}))),this.parseGenericAttributes(e,t),this},Ke.prototype.nsTagName=function(e){return Fe(this.logNamespaceUsed(e.ns),e)},Ke.prototype.nsPropertyTagName=function(e){var t,n=this.logNamespaceUsed(e.ns);return t=n,R({localName:e.ns.localName},t)},Ke.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Ke.prototype.nsAttributeName=function(e){var t;if(t=d(e)?z(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:R({localName:t.localName},n)},Ke.prototype.parseGeneric=function(n){var o=this,r=this.body,i=[];return w(n,function(e,t){"$body"===t?r.push((new Ge).build({type:"String"},e)):"$children"===t?w(e,function(e){r.push(new Ke(o).build(e))}):0!==t.indexOf("$")&&o.parseNsAttribute(n,t,e)&&i.push({name:t,value:e})}),i},Ke.prototype.parseNsAttribute=function(e,t,n){var o,r=e.$model,i=z(t);if("xmlns"===i.prefix&&(o={prefix:i.localName,uri:n}),i.prefix||"xmlns"!==i.localName||(o={uri:n}),!o)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(o,!0,!0);else{var a=this.logNamespaceUsed(o,!0);this.getNamespaces().logUsed(a)}},Ke.prototype.parseNsAttributes=function(o,e){var r=this,t=o.$attrs,i=[];return w(t,function(e,t){var n=r.parseNsAttribute(o,t,e);n&&i.push(n)}),i},Ke.prototype.parseGenericAttributes=function(n,e){var o=this;w(e,function(t){if(t.name!==be)try{o.addAttribute(o.nsAttributeName(t.name),t.value)}catch(e){console.warn("missing namespace information for ",t.name,"=",t.value,"on",n,e)}})},Ke.prototype.parseContainments=function(e){var i=this,a=this.body,s=this.element;w(e,function(n){var e=s.get(n.name),t=n.isReference;if(n.isMany||(e=[e]),n.isBody)a.push((new Ge).build(n,e[0]));else if(U(n.type))w(e,function(e){a.push(new qe(i.addTagName(i.nsPropertyTagName(n))).build(n,e))});else if(t)w(e,function(e){a.push(new He(i.addTagName(i.nsPropertyTagName(n))).build(e))});else{var o=we(n),r="property"===_e(n);w(e,function(e){var t;t=o?new Xe(i,n):r?new Ke(i,n):new Ke(i),a.push(t.build(e))})}})},Ke.prototype.getNamespaces=function(e){var t,n=this.namespaces,o=this.parent;return n||(t=o&&o.getNamespaces(),e||!t?this.namespaces=n=new Ve(t):n=t),n},Ke.prototype.logNamespace=function(e,t,n){var o=this.getNamespaces(n),r=e.uri,i=e.prefix;return o.byUri(r)||o.add(e,t),o.mapPrefix(i,r),e},Ke.prototype.logNamespaceUsed=function(e,t){var n,o,r,i=this.element.$model,a=this.getNamespaces(t),s=e.prefix,c=e.uri;if(!s&&!c)return{localName:e.localName};if(r=ge[s]||i&&(i.getPackage(s)||{}).uri,!(c=c||r||a.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if(!(e=a.byUri(c))){for(n=s,o=1;a.uriByPrefix(n);)n=s+"_"+o++;e=this.logNamespace({prefix:n,uri:c},r===c)}return s&&a.mapPrefix(s,c),e},Ke.prototype.parseAttributes=function(e){var o=this,r=this.element;w(e,function(e){var t=r.get(e.name);if(e.isReference)if(e.isMany){var n=[];w(t,function(e){n.push(e.id)}),t=n.join(" ")}else t=t.id;o.addAttribute(o.nsAttributeName(e),t)})},Ke.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),$e(e)},Ke.prototype.addAttribute=function(e,t){var n=this.attrs;d(t)&&(t=We(t,Ie,Ue)),n.push({name:e,value:t})},Ke.prototype.serializeAttributes=function(t){var e,n=this.attrs,o=this.namespaces;o&&(n=(e=o,v(e.getUsed(),function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}})).concat(n)),w(n,function(e){t.append(" ").append($e(e.name)).append('="').append(e.value).append('"')})},Ke.prototype.serializeTo=function(t){var e=this.body[0],n=e&&e.constructor!==Ge;t.appendIndent().append("<"+this.tagName),this.serializeAttributes(t),t.append(e?">":" />"),e&&(n&&t.appendNewLine().indent(),w(this.body,function(e){e.serializeTo(t)}),n&&t.unindent().appendIndent(),t.append("</"+this.tagName+">")),t.appendNewLine()},Le(Xe,Ke),Xe.prototype.parseNsAttributes=function(e){var t=Ke.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var o=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(o.uri),i=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(be),(o.prefix?o.prefix+":":"")+i+n.ns.localName),t},Xe.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},(Qe.prototype=Object.create(X.prototype)).fromXML=function(e,t,n,o){d(t)||(o=n,n=t,t="dmn:Definitions"),p(n)&&(o=n,n={});var r=new Be(R({model:this,lax:!0},n)),i=r.handler(t);r.fromXML(e,i,o)};Qe.prototype.toXML=function(e,t,n){p(t)&&(n=t,t={});var o,r,i=new Je(t);try{o=i.toXML(e)}catch(e){r=e}return n(r,o)};var et={dmn:{name:"DMN",uri:"http://www.omg.org/spec/DMN/20151101/dmn.xsd",xml:{tagAlias:"lowerCase"},prefix:"dmn",types:[{name:"DMNElement",isAbstract:!0,properties:[{name:"description",type:"String"},{name:"id",type:"String",isAttr:!0,isId:!0},{name:"label",type:"String",isAttr:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"NamedElement",isAbstract:!0,superClass:["DMNElement"],properties:[{name:"name",type:"String",isAttr:!0}]},{name:"DMNElementReference",properties:[{name:"href",type:"String",isAttr:!0}]},{name:"ExtensionElements",properties:[{name:"values",type:"Element",isMany:!0}]},{name:"Definitions",superClass:["NamedElement"],properties:[{name:"namespace",type:"String",isAttr:!0},{name:"typeLanguage",type:"String",isAttr:!0,default:"http://www.omg.org/spec/FEEL/20140401"},{name:"expressionLanguage",type:"String",isAttr:!0,default:"http://www.omg.org/spec/FEEL/20140401"},{name:"exporter",type:"String",isAttr:!0},{name:"exporterVersion",type:"String",isAttr:!0},{name:"itemDefinition",type:"ItemDefinition",isMany:!0,xml:{serialize:"property"}},{name:"drgElements",type:"DRGElement",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"Import",properties:[{name:"namespace",type:"String",isAttr:!0},{name:"locationURI",type:"String",isAttr:!0},{name:"importType",type:"String",isAttr:!0}]},{name:"DRGElement",isAbstract:!0,superClass:["NamedElement"]},{name:"Decision",superClass:["DRGElement"],properties:[{name:"question",type:"String"},{name:"allowedAnswers",type:"String"},{name:"variable",type:"InformationItem",xml:{serialize:"property"}},{name:"informationRequirement",type:"InformationRequirement",isMany:!0,xml:{serialize:"property"}},{name:"knowledgeRequirement",type:"KnowledgeRequirement",isMany:!0,xml:{serialize:"property"}},{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0,xml:{serialize:"property"}},{name:"decisionTable",type:"DecisionTable",xml:{serialize:"property"}},{name:"literalExpression",type:"LiteralExpression",xml:{serialize:"property"}}]},{name:"BusinessKnowledgeModel",superClass:["DRGElement"],properties:[{name:"encapsulatedLogic",type:"FunctionDefinition"},{name:"variable",type:"InformationItem",xml:{serialize:"property"}},{name:"knowledgeRequirement",type:"KnowledgeRequirement",isMany:!0,xml:{serialize:"property"}},{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0,xml:{serialize:"property"}}]},{name:"InputData",superClass:["DRGElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}}]},{name:"KnowledgeSource",superClass:["DRGElement"],properties:[{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0,xml:{serialize:"property"}},{name:"type",type:"String",isAttr:!0},{name:"owner",type:"DMNElementReference",isAttr:!0},{name:"locationURI",type:"String",isAttr:!0}]},{name:"InformationRequirement",properties:[{name:"requiredDecision",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredInput",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"KnowledgeRequirement",properties:[{name:"requiredKnowledge",type:"DMNElementReference",isUnique:!0,xml:{serialize:"property"}}]},{name:"AuthorityRequirement",properties:[{name:"requiredDecision",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredInput",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredAuthority",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"Expression",isAbstract:!0,superClass:["DMNElement"],properties:[{name:"typeRef",type:"String",isAttr:!0}]},{name:"ItemDefinition",superClass:["NamedElement"],properties:[{name:"typeLanguage",type:"String",isAttr:!0},{name:"isCollection",type:"Boolean",isAttr:!0,default:!1},{name:"typeRef",type:"String"},{name:"allowedValues",type:"UnaryTests",isMany:!0,xml:{serialize:"property"}}]},{name:"LiteralExpression",superClass:["Expression"],properties:[{name:"expressionLanguage",type:"String",isAttr:!0},{name:"importedValues",type:"ImportedValues"},{name:"text",type:"String"}]},{name:"InformationItem",superClass:["NamedElement"],properties:[{name:"typeRef",type:"String",isAttr:!0}]},{name:"DecisionTable",superClass:["Expression"],properties:[{name:"input",type:"InputClause",isMany:!0,xml:{serialize:"property"}},{name:"output",type:"OutputClause",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,default:"Rule-as-Row"},{name:"outputLabel",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:"ImportedValues",superClass:["Import"],properties:[{name:"importedElement",type:"String",isMany:!0,xml:{serialize:"property"}},{name:"expressionLanguage",type:"String",isAttr:!0}]},{name:"Artifact",isAbstract:!0,superClass:["DMNElement"]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String",xml:{serialize:"property"}},{name:"textFormat",type:"String",isAttr:!0}]},{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,default:"None"}]},{name:"InputClause",superClass:["DMNElement"],properties:[{name:"inputExpression",type:"LiteralExpression",xml:{serialize:"property"}},{name:"inputValues",type:"UnaryTests",xml:{serialize:"property"}}]},{name:"OutputClause",superClass:["DMNElement"],properties:[{name:"outputValues",type:"UnaryTests",xml:{serialize:"property"}},{name:"defaultOutputEntry",type:"LiteralExpression",xml:{serialize:"property"}},{name:"name",type:"String",isAttr:!0},{name:"typeRef",type:"String",isAttr:!0}]},{name:"UnaryTests",superClass:["DMNElement"],properties:[{name:"text",type:"String"},{name:"expressionLanguage",type:"String",isAttr:!0}]},{name:"FunctionDefinition",superClass:["Expression"],properties:[{name:"formalParameter",type:"InformationItem",isMany:!0,xml:{serialize:"property"}},{name:"expression",type:"String",isReference:!0,xml:{serialize:"property"}}]}],emumerations:[{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{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"}]}]},camunda:{name:"Camunda",uri:"http://camunda.org/schema/1.0/dmn",prefix:"camunda",xml:{tagAlias:"lowerCase"},types:[{name:"InputVariable",extends:["dmn:InputClause"],properties:[{name:"inputVariable",isAttr:!0,type:"String"}]}]},dc:{name:"DC",uri:"http://www.omg.org/spec/DD/20100524/DC",types:[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],prefix:"dc",associations:[]},biodi:{name:"bpmn.io DI for DMN",uri:"http://bpmn.io/schema/dmn/biodi/1.0",prefix:"biodi",xml:{tagAlias:"lowerCase"},types:[{name:"Edge",superClass:["Element"],properties:[{name:"source",type:"String",isAttr:!0},{name:"waypoints",type:"Waypoint",isMany:!0,xml:{serialize:"property"}}]},{name:"Bounds",superClass:["dc:Bounds","Element"]},{name:"Waypoint",superClass:["dc:Point"]}]}};function tt(e,t){return new Qe(R({},et,e),t)}function nt(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)}var ot=[].indexOf,rt=function(e,t){if(ot)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1},it=/\s+/,at=Object.prototype.toString;function st(e){return new ct(e)}function ct(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function ut(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}ct.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~rt(t,e)||t.push(e),this.el.className=t.join(" "),this},ct.prototype.remove=function(e){if("[object RegExp]"==at.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=rt(t,e);return~n&&t.splice(n,1),this.el.className=t.join(" "),this},ct.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},ct.prototype.toggle=function(e,t){return this.list?void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e):void 0!==t?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this},ct.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(it);return""===e[0]&&e.shift(),e},ct.prototype.has=ct.prototype.contains=function(e){return this.list?this.list.contains(e):!!~rt(this.array(),e)};var lt=Element.prototype,pt=lt.matchesSelector||lt.webkitMatchesSelector||lt.mozMatchesSelector||lt.msMatchesSelector||lt.oMatchesSelector,ft=function(e,t){if(pt)return pt.call(e,t);for(var n=e.parentNode.querySelectorAll(t),o=0;o<n.length;++o)if(n[o]==e)return!0;return!1};var dt,ht=function(e,t,n){for(var o=n?e:e.parentNode;o&&o!==document;){if(ft(o,t))return o;o=o.parentNode}},yt=window.addEventListener?"addEventListener":"attachEvent",vt=window.removeEventListener?"removeEventListener":"detachEvent",mt="addEventListener"!==yt?"on":"",gt={bind:function(e,t,n,o){return e[yt](mt+t,n,o||!1),n},unbind:function(e,t,n,o){return e[vt](mt+t,n,o||!1),n}},bt=["focus","blur"],_t={bind:function(n,o,e,r,t){return-1!==bt.indexOf(e)&&(t=!0),gt.bind(n,e,function(e){var t=e.target||e.srcElement;e.delegateTarget=ht(t,o,!0,n),e.delegateTarget&&r.call(n,e)},t)},unbind:function(e,t,n,o){-1!==bt.indexOf(t)&&(o=!0),gt.unbind(e,t,n,o)}},wt=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 o=n[1];if("body"==o){var r=t.createElement("html");return r.innerHTML=e,r.removeChild(r.lastChild)}var i=Ct[o]||Ct._default,a=i[0],s=i[1],c=i[2];(r=t.createElement("div")).innerHTML=s+e+c;for(;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);var u=t.createDocumentFragment();for(;r.firstChild;)u.appendChild(r.removeChild(r.firstChild));return u},xt=!1;"undefined"!=typeof document&&((dt=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',xt=!dt.getElementsByTagName("link").length,dt=void 0);var Ct={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:xt?[1,"X<div>","</div>"]:[0,"",""]};Ct.td=Ct.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Ct.option=Ct.optgroup=[1,'<select multiple="multiple">',"</select>"],Ct.thead=Ct.tbody=Ct.colgroup=Ct.caption=Ct.tfoot=[1,"<table>","</table>"],Ct.polyline=Ct.ellipse=Ct.polygon=Ct.circle=Ct.text=Ct.line=Ct.path=Ct.rect=Ct.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Et="undefined"!=typeof Element?Element.prototype:{},kt=Et.matches||Et.matchesSelector||Et.webkitMatchesSelector||Et.mozMatchesSelector||Et.msMatchesSelector||Et.oMatchesSelector,St=function(e,t){if(!e||1!==e.nodeType)return!1;if(kt)return kt.call(e,t);for(var n=e.parentNode.querySelectorAll(t),o=0;o<n.length;o++)if(n[o]==e)return!0;return!1};function Ot(e,t){return(t=t||document).querySelector(e)}function jt(e,t){return(t=t||document).querySelectorAll(e)}function Pt(e){e.parentNode&&e.parentNode.removeChild(e)}var Tt="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},Rt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},At="function"==typeof Symbol&&"symbol"===Tt(Symbol.iterator)?function(e){return void 0===e?"undefined":Tt(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":Tt(e)},Dt=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();function Mt(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var Bt={width:"100%",height:"100%",position:"relative"},It=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),this._viewsChanged=function(){e._emit("views.changed",{views:e._views,activeView:e._activeView})},this._eventBus=new o,this._viewsChanged=j(this._viewsChanged,0),this._views=[],this._viewers={},this._init(t)}return Dt(n,[{key:"importXML",value:function(e,i,a){var s=this;"object"!==(void 0===i?"undefined":At(i))&&(a=i,i={open:!0}),"function"!=typeof a&&(a=Nt),e=this._emit("import.parse.start",{xml:e})||e,this._moddle.fromXML(e,"dmn:Definitions",function(e,t,n){t=s._emit("import.parse.complete",{error:e,definitions:t,context:n})||t;var o=n.warnings;if(s._setDefinitions(t),e&&(e=function(e){var t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid DMN 1.1 diagram file"+t[2]);return e}(e)),e||!i.open)return s._emit("import.done",{error:e,warmings:o}),a(e,o);var r=s._activeView||s._getInitialView(s._views);if(!r)return a(new Error("no displayable contents"));s.open(r,function(e,t){var n=[].concat(o,t||[]);s._emit("import.done",{error:e,warnings:n}),a(e,n)})})}},{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,n){var o=this;"function"==typeof e&&(n=e,e={});var t=this._definitions;if(!t)return n(new Error("no definitions loaded"));t=this._emit("saveXML.start",{definitions:t})||t,this._moddle.toXML(t,e,function(e,t){try{t=o._emit("saveXML.serialized",{error:e,xml:t})||t,o._emit("saveXML.done",{error:e,xml:t})}catch(e){console.error("error in saveXML life-cycle listener",e)}n(e,t)})}},{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.get&&e.constructor.prototype.jquery&&(e=e.get(0)),"string"==typeof e&&(e=Ot(e)),e.appendChild(this._container)}},{key:"detach",value:function(){Pt(this._container)}},{key:"destroy",value:function(){var t=this;Object.keys(this._viewers,function(e){Ft(t._viewers[e],"destroy")}),Pt(this._container)}},{key:"_init",value:function(e){this._options=e,this._moddle=this._createModdle(e),this._viewers={},this._views=[];var t=wt('<div class="dmn-js-parent"></div>'),n=R({},Bt,e);R(t.style,{width:Vt(n.width),height:Vt(n.height),position:n.position}),this._container=t,e.container&&this.attachTo(e.container)}},{key:"open",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:Nt;this._switchView(e,t)}},{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 r=this._getViewProviders(),t=[e].concat(Mt(e.drgElements||[]));this._views=t.reduce(function(e,t){var n=Lt(r,function(e){return"string"==typeof e.opens?e.opens===t.$type:e.opens(t)});if(!n)return e;var o={element:t,type:n.id};return[].concat(Mt(e),[o])},[]);var n,o=this._activeView;if(o){if(n=Lt(this._views,function(e){return $t(o,e)})||this._getInitialView(this._views),!$t(o,n))return this._switchView(null);this._activeView=n}this._viewsChanged()}},{key:"_getInitialView",value:function(e){return e[0]}},{key:"_switchView",value:function(n){var e,o=this,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:Nt,i=function(e,t){o._viewsChanged(),r(e,t)},t=this.getActiveView(),a=n&&this._getViewer(n),s=n&&n.element;if(t&&(e=this._getViewer(t))!==a&&(Ft(e,"clear"),e.detach()),this._activeView=n,a)return e!==a&&a.attachTo(this._container),this._emit("import.render.start",{view:n,element:s}),a.open(s,function(e,t){o._emit("import.render.complete",{view:n,error:e,warnings:t}),i(e,t)});i()}},{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=Lt(this._getViewProviders(),function(e){return e.id===t});if(!e)throw new Error("no provider for view type <"+t+">");var n=e.constructor,o=this._options[t]||{},r=this._options.common||{};return new n(Rt({},r,o,{additionalModules:[].concat(Mt(o.additionalModules||[]),[{_parent:["value",this],moddle:["value",this._moddle]}])}))}},{key:"_emit",value:function(){var e;(e=this._eventBus).fire.apply(e,arguments)}},{key:"_createModdle",value:function(e){return new tt(e.moddleExtensions||{})}},{key:"_getViewProviders",value:function(){return[]}}]),n}();function Nt(){}function Vt(e){return e+(l(e)?"px":"")}function Lt(e,t){return e.filter(t)[0]}function $t(e,t){return void 0===e?void 0===t:void 0!==t&&(e.element===t.element||e.element.id===t.element.id)}function Ft(e,t){"function"==typeof e[t]&&e[t]()}var Ut=e(function(e){var c=e.exports=function(e,t){if(t||(t=16),void 0===e&&(e=128),e<=0)return"0";for(var n=Math.log(Math.pow(2,e))/Math.log(t),o=2;n===1/0;o*=2)n=Math.log(Math.pow(2,e/o))/Math.log(t)*o;var r=n-Math.floor(n),i="";for(o=0;o<Math.floor(n);o++){i=Math.floor(Math.random()*t).toString(t)+i}if(r){var a=Math.pow(t,r);i=Math.floor(Math.random()*a).toString(t)+i}var s=parseInt(i,t);return s!==1/0&&s>=Math.pow(2,e)?c(e,t):i};c.rack=function(o,r,i){var n=function(e){var t=0;do{if(10<t++){if(!i)throw new Error("too many ID collisions, use more bits");o+=i}var n=c(o,r)}while(Object.hasOwnProperty.call(a,n));return a[n]=e,n},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=o||128,n.base=r||16,n}});function zt(e){if(!(this instanceof zt))return new zt(e);e=e||[128,36,1],this._seed=e.length?Ut.rack(e[0],e[1],e[2]):e}var Wt=zt;function Ht(e,t){var n=Kt(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function Gt(e){return Ht(e,"dmn:InputClause")}function qt(e){return Ht(e,"dmn:OutputClause")}function Kt(e){return e&&e.businessObject||e}function Xt(t,e){return i(e,function(e){return Ht(t,e)})}zt.prototype.next=function(e){return this._seed(e||!0)},zt.prototype.nextPrefixed=function(e,t){for(var n;n=e+this.next(!0),this.assigned(n););return this.claim(n,t),n},zt.prototype.claim=function(e,t){this._seed.set(e,t||!0)},zt.prototype.assigned=function(e){return this._seed.get(e)||!1},zt.prototype.unclaim=function(e){delete this._seed.hats[e]},zt.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var Zt="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},Yt=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}(),Jt=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0};var Qt=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Zt(t))&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Zt(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,It),Yt(n,[{key:"_init",value:function(e){var t=this;Jt(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"_init",this).call(this,e),this.on("import.parse.complete",function(e){e.error||t._collectIds(e.definitions,e.context)}),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 Xt(e,["dmn:Decision","dmn:Definitions"])})&&t._updateViews()})})}},{key:"_collectIds",value:function(e,t){var n,o=e.$model.ids;for(n in o.clear(),t.elementsById)o.claim(n,t.elementsById[n])}},{key:"_createModdle",value:function(e){var t=Jt(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"_createModdle",this).call(this,e);return t.ids=new Wt([32,36,1]),t}}]),n}(),en=e(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;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),tn="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},nn=/^class /;function on(e){return"[object Array]"===Object.prototype.toString.call(e)}function rn(){var e=Array.prototype.slice.call(arguments);1===e.length&&on(e[0])&&(e=e[0]);var t=e.pop();return t.$inject=e,t}var an=/constructor\s*[^(]*\(\s*([^)]*)\)/m,sn=/^function\s*[^(]*\(\s*([^)]*)\)/m,cn=/\/\*([^*]*)\*\//m;function un(e){if("function"!=typeof e)throw new Error('Cannot annotate "'+e+'". Expected a function!');var t,n=e.toString().match((t=e,nn.test(t.toString())?an:sn));return n&&n[1]&&n[1].split(",").map(function(e){return(n=e.match(cn))?n[1].trim():e.trim()})||[]}var ln="function"==typeof Symbol&&"symbol"===tn(Symbol.iterator)?function(e){return void 0===e?"undefined":tn(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":tn(e)};function pn(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function fn(e,i){i=i||{get:function(e,t){if(a.push(e),!1===t)return null;throw c('No provider for "'+e+'"!')}};var a=[],f=this._providers=Object.create(i._providers||null),s=this._instances=Object.create(null),d=s.injector=this,c=function(e){var t=a.join(" -> ");return a.length=0,new Error(t?e+" (Resolving: "+t+")":e)},n=function e(t,n){if(!f[t]&&-1!==t.indexOf(".")){for(var o=t.split("."),r=e(o.shift());o.length;)r=r[o.shift()];return r}if(dn(s,t))return s[t];if(dn(f,t)){if(-1!==a.indexOf(t))throw a.push(t),c("Cannot resolve circular dependency!");return a.push(t),s[t]=f[t][0](f[t][1]),a.pop(),s[t]}return i.get(t,n)},u=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if("function"!=typeof e){if(!on(e))throw new Error('Cannot invoke "'+e+'". Expected a function!');e=rn(e.slice())}return{fn:e,dependencies:(e.$inject||un(e)).map(function(e){return dn(t,e)?t[e]:n(e)})}},t=function(e){var t=u(e),n=t.dependencies,o=t.fn;return new(Function.prototype.bind.apply(o,[null].concat(pn(n))))},o=function(e,t,n){var o=u(e,n),r=o.dependencies,i=o.fn;return i.call.apply(i,[t].concat(pn(r)))},h=function(t){return rn(function(e){return t.get(e)})},l={factory:o,type:t,value:function(e){return e}};e.forEach(function(o){function r(e,t){return"value"!==e&&on(t)&&(t=rn(t.slice())),t}if(o 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)}})o.forEach(function(e){var t=e[0],n=e[1],o=e[2];f[t]=[l[n],r(n,o),n]});else if("object"===(void 0===o?"undefined":ln(o)))if(o.__exports__){var e=Object.keys(o).reduce(function(e,t){return"__"!==t.substring(0,2)&&(e[t]=o[t]),e},Object.create(null)),t=new fn((o.__modules__||[]).concat([e]),d),n=rn(function(e){return t.get(e)});o.__exports__.forEach(function(e){f[e]=[n,e,"private",t]})}else Object.keys(o).forEach(function(e){if("private"!==o[e][2]){var t=o[e][0],n=o[e][1];f[e]=[l[t],r(t,n),t]}else f[e]=o[e]})}),this.get=n,this.invoke=o,this.instantiate=t,this.createChild=function(e,t){if(t&&t.length){var n,o,r,i,a=Object.create(null),s=Object.create(null),c=[],u=[],l=[];for(var p in f)n=f[p],-1!==t.indexOf(p)&&("private"===n[2]?(o=c.indexOf(n[3]),a[p]=-1===o?(r=n[3].createChild([],t),i=h(r),c.push(n[3]),u.push(r),l.push(i),[i,p,"private",r]):[l[o],p,"private",u[o]]):a[p]=[n[2],n[1]],s[p]=!0),"factory"!==n[2]&&"type"!==n[2]||!n[1].$scope||t.forEach(function(e){-1!==n[1].$scope.indexOf(e)&&(a[p]=[n[2],n[1]],s[e]=!0)});t.forEach(function(e){if(!s[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')}),e.unshift(a)}return new fn(e,d)}}function dn(e,t){return Object.hasOwnProperty.call(e,t)}var hn=1e3;function yn(e,t){var i=this;t=t||hn,e.on(["render.shape","render.connection"],t,function(e,t){var n=e.type,o=t.element,r=t.gfx;if(i.canRender(o))return"render.shape"===n?i.drawShape(r,o):i.drawConnection(r,o)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(e,t){if(i.canRender(t))return"render.getShapePath"===e.type?i.getShapePath(t):i.getConnectionPath(t)})}function vn(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 mn(e,t){return vn(t,e),e}yn.prototype.canRender=function(){},yn.prototype.drawShape=function(){},yn.prototype.drawConnection=function(){},yn.prototype.getShapePath=function(){},yn.prototype.getConnectionPath=function(){};var gn=2,bn={"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":gn,"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":gn,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function _n(e,t,n){var o=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=bn[o];r?(r===gn&&"number"==typeof n&&(n=String(n)+"px"),e.style[o]=n):e.setAttributeNS(null,t,n)}function wn(e,t,n){if("string"==typeof t){if(void 0===n)return o=e,bn[r=t]?o.style[r]:o.getAttributeNS(null,r);_n(e,t,n)}else!function(e,t){var n,o,r=Object.keys(t);for(n=0;o=r[n];n++)_n(e,o,t[o])}(e,t);var o,r;return e}function xn(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 Cn=/\s+/,En=Object.prototype.toString;function kn(e){return void 0!==e}function Sn(e){return new On(e)}function On(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function jn(e){var t=e.parentNode;return t&&t.removeChild(e),e}function Pn(e){for(var t;t=e.firstChild;)jn(t);return e}On.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~xn(t,e)||t.push(e),kn(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" "),this},On.prototype.remove=function(e){if("[object RegExp]"===En.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=xn(t,e);return~n&&t.splice(n,1),this.el.className.baseVal=t.join(" "),this},On.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},On.prototype.toggle=function(e,t){return this.list?kn(t)?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e):kn(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this},On.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(Cn);return""===e[0]&&e.shift(),e},On.prototype.has=On.prototype.contains=function(e){return this.list?this.list.contains(e):!!~xn(this.array(),e)};var Tn={svg:"http://www.w3.org/2000/svg"},Rn='<svg xmlns="'+Tn.svg+'"';function An(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(Tn.svg)&&(e=Rn+e.substring(4)):(e=Rn+">"+e+"</svg>",t=!0);var n,o,r=(n=e,(o=new DOMParser).async=!1,o.parseFromString(n,"text/xml"));if(!t)return r;for(var i=document.createDocumentFragment(),a=r.firstChild;a.firstChild;)i.appendChild(a.firstChild);return i}function Dn(e,t){var n;return n="<"===e.charAt(0)?(n=An(e).firstChild,document.importNode(n,!0)):document.createElementNS(Tn.svg,e),t&&wn(n,t),n}var Mn=Dn("svg");function Bn(e,t,n,o,r,i){var a=Mn.createSVGMatrix();switch(arguments.length){case 0:return a;case 6:e={a:e,b:t,c:n,d:o,e:r,f:i}}return function(e,t){var n,o,r=Object.keys(t);for(n=0;o=r[n];n++)e[o]=t[o];return e}(a,e)}function In(e){return e?Mn.createSVGTransformFromMatrix(e):Mn.createSVGTransform()}var Nn=/([&<>]{1})/g,Vn=/([\n\r"]{1})/g,Ln={"&":"&","<":"<",">":">",'"':"'"};function $n(e,t){return e.replace(t,function(e,t){return Ln[t]||t})}function Fn(e,t){var n,o,r,i,a;switch(e.nodeType){case 3:t.push($n(e.textContent,Nn));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,o=(r=e.attributes).length;n<o;++n)i=r.item(n),t.push(" ",i.name,'="',$n(i.value,Vn),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,o=(a=e.childNodes).length;n<o;++n)Fn(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",$n(e.nodeValue,Nn),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function Un(e,t){var n=An(t);if(Pn(e),t){"#document-fragment"!==n.nodeName&&(n=n.documentElement);for(var o,r=(o=n.childNodes,Array.prototype.slice.call(o)),i=0;i<r.length;i++)vn(r[i],e)}}function zn(e,t){if(void 0===t)return function(e){for(var t=e.firstChild,n=[];t;)Fn(t,n),t=t.nextSibling;return n.join("")}(e);try{Un(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}function Wn(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function Hn(e,t){var n=e.transform.baseVal;if(1===arguments.length)return n.consolidate();t.length?function(e,t){var n,o;for(e.clear(),n=0;o=t[n];n++)e.appendItem(Wn(e,o));e.consolidate()}(n,t):n.initialize(Wn(n,t))}function Gn(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")}function qn(e){for(var t,n="",o=0;t=e[o];o++)n+=t.x+","+t.y+" ";return n}function Kn(e,t){var n=Dn("polyline");return wn(n,{points:qn(e)}),t&&wn(n,t),n}function Xn(e,t){yn.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})}en(Xn,yn),Xn.prototype.canRender=function(){return!0},Xn.prototype.drawShape=function(e,t){var n=Dn("rect");return wn(n,{x:0,y:0,width:t.width||0,height:t.height||0}),wn(n,this.SHAPE_STYLE),mn(e,n),n},Xn.prototype.drawConnection=function(e,t){var n=Kn(t.waypoints,this.CONNECTION_STYLE);return mn(e,n),n},Xn.prototype.getShapePath=function(e){var t=e.x,n=e.y,o=e.width;return Gn([["M",t,n],["l",o,0],["l",0,e.height],["l",-o,0],["z"]])},Xn.prototype.getConnectionPath=function(e){var t,n,o=e.waypoints,r=[];for(t=0;n=o[t];t++)n=n.original||n,r.push([0===t?"M":"L",n.x,n.y]);return Gn(r)},Xn.$inject=["eventBus","styles"];var Zn={__init__:["defaultRenderer"],defaultRenderer:["type",Xn],styles:["type",function(){var o={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},r=this;this.cls=function(e,t,n){return R(this.style(t,n),{class:e})},this.style=function(e,t){y(e)||t||(t=e,e=[]);var n=x(e,function(e,t){return R(e,o[t]||{})},{});return t?R(n,t):n},this.computeStyle=function(e,t,n){return y(t)||(n=t,t=[]),r.style(t||[],R({},n,e||{}))}}]};function Yn(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return-1!==n&&e.splice(n,1),n}function Jn(e,t,n){if(e&&t){"number"!=typeof n&&(n=-1);var o=e.indexOf(t);if(-1!==o){if(o===n)return;if(-1===n)return;e.splice(o,1)}-1!==n?e.splice(n,0,t):e.push(t)}}function Qn(e,t){return e&&t?e.indexOf(t):-1}function eo(e,t,n){var o=!n||-1===e.indexOf(t);return o&&e.push(t),o}function to(e,o,r){r=r||0,y(e)||(e=[e]),w(e,function(e,t){var n=o(e,t,r);y(n)&&n.length&&to(n,o,r+1)})}function no(e,t){return r=!t,i=-1,a=[],s=[],to(e,function(e,t,n){eo(a,e,r);var o=e.children;if((-1===i||n<i)&&o&&eo(s,o,r))return o}),a;var r,i,a,s}function oo(e,a){var s,c,u,l;return a=!!a,y(e)||(e=[e]),w(e,function(e){var t=e;e.waypoints&&!a&&(t=oo(e.waypoints,!0));var n=t.x,o=t.y,r=t.height||0,i=t.width||0;(n<s||void 0===s)&&(s=n),(o<c||void 0===c)&&(c=o),(u<n+i||void 0===u)&&(u=n+i),(l<o+r||void 0===l)&&(l=o+r)}),{x:s,y:c,height:l-c,width:u-s}}function ro(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function io(e,t){return R({},e||{},t||{})}var ao="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};function so(e,t){return Math.round(e*t)/t}function co(e){return l(e)?e+"px":e}function uo(e,t,n){var o=Dn("g");Sn(o).add(t);var r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(o,e.childNodes[r]||null),o}var lo={shape:["x","y","width","height"],connection:["waypoints"]};function po(e,t,n,o){this._eventBus=t,this._elementRegistry=o,this._graphicsFactory=n,this._init(e||{})}function fo(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}po.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],po.prototype._init=function(e){var t,n,o,r=this._eventBus,i=this._container=(n=(t=R({},{width:"100%",height:"100%"},t=e)).container||document.body,(o=document.createElement("div")).setAttribute("class","djs-container"),R(o.style,{position:"relative",overflow:"hidden",width:co(t.width),height:co(t.height)}),n.appendChild(o),o),a=this._svg=Dn("svg");wn(a,{width:"100%",height:"100%"}),mn(i,a);var s=this._viewport=uo(a,"viewport");!(this._layers={})!==e.deferUpdate&&(this._viewboxChanged=j(P(this._viewboxChanged,this),300)),r.on("diagram.init",function(){r.fire("canvas.init",{svg:a,viewport:s})},this),r.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed"],function(){delete this._cachedViewbox},this),r.on("diagram.destroy",500,this._destroy,this),r.on("diagram.clear",500,this._clear,this)},po.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._rootElement,delete this._viewport},po.prototype._clear=function(){var n=this;this._elementRegistry.getAll().forEach(function(e){var t=ro(e);"root"===t?n.setRootElement(null,!0):n._removeElement(e,t)}),delete this._cachedViewbox},po.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},po.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");var n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),void 0!==t&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},po.prototype._createLayer=function(e,n){n||(n=0);var t=x(this._layers,function(e,t){return n>=t.index&&e++,e},0);return{group:uo(this._viewport,"layer-"+e,t),index:n}},po.prototype.getContainer=function(){return this._container},po.prototype._updateMarker=function(e,t,n){var o;e.id||(e=this._elementRegistry.get(e)),(o=this._elementRegistry._elements[e.id])&&(w([o.gfx,o.secondaryGfx],function(e){e&&(n?Sn(e).add(t):Sn(e).remove(t))}),this._eventBus.fire("element.marker.update",{element:e,gfx:o.gfx,marker:t,add:!!n}))},po.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},po.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},po.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),Sn(this.getGraphics(e)).has(t)},po.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},po.prototype.getRootElement=function(){return this._rootElement||this.setRootElement({id:"__implicitroot",children:[]}),this._rootElement},po.prototype.setRootElement=function(e,t){e&&this._ensureValid("root",e);var n=this._rootElement,o=this._elementRegistry,r=this._eventBus;if(n){if(!t)throw new Error("rootElement already set, need to specify override");r.fire("root.remove",{element:n}),r.fire("root.removed",{element:n}),o.remove(n)}if(e){var i=this.getDefaultLayer();r.fire("root.add",{element:e}),o.add(e,i,this._svg),r.fire("root.added",{element:e,gfx:i})}return this._rootElement=e},po.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 with id "+t.id+" already exists");var n=lo[e];if(!r(n,function(e){return void 0!==t[e]}))throw new Error("must supply { "+n.join(", ")+" } with "+e)},po.prototype._setParent=function(e,t,n){Jn(t.children,e,n),e.parent=t},po.prototype._addElement=function(e,t,n,o){n=n||this.getRootElement();var r=this._eventBus,i=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,o);var a=i.create(e,t,o);return this._elementRegistry.add(t,a),i.update(e,t,a),r.fire(e+".added",{element:t,gfx:a}),t},po.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},po.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},po.prototype._removeElement=function(e,t){var n=this._elementRegistry,o=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e))return r.fire(t+".remove",{element:e}),o.remove(e),Yn(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},po.prototype.removeShape=function(e){return this._removeElement(e,"shape")},po.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},po.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},po.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},po.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},po.prototype.viewbox=function(t){if(void 0===t&&this._cachedViewbox)return this._cachedViewbox;var e,n,o,r,i,a,s=this._viewport,c=this.getSize();return t?(this._changeViewbox(function(){r=Math.min(c.width/t.width,c.height/t.height);var e=this._svg.createSVGMatrix().scale(r).translate(-t.x,-t.y);Hn(s,e)}),t):(e=this.getDefaultLayer().getBBox(),n=(o=Hn(s))?o.matrix:Bn(),r=so(n.a,1e3),i=so(-n.e||0,1e3),a=so(-n.f||0,1e3),t=this._cachedViewbox={x:i?i/r:0,y:a?a/r:0,width:c.width/r,height:c.height/r,scale:r,inner:{width:e.width,height:e.height,x:e.x,y:e.y},outer:c})},po.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=R({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),fo(t,n)}),{x:n.e,y:n.f}},po.prototype.zoom=function(e,t){return e?"fit-viewport"===e?this._fitViewport(t):(this._changeViewbox(function(){"object"!==(void 0===t?"undefined":ao(t))&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),o=this._setZoom(e,t)}),so(o.a,1e3)):this.viewbox(e).scale;var n,o},po.prototype._fitViewport=function(e){var t,n,o=this.viewbox(),r=o.outer,i=o.inner;return n=0<=i.x&&0<=i.y&&i.x+i.width<=r.width&&i.y+i.height<=r.height&&!e?{x:0,y:0,width:Math.max(i.width+i.x,r.width),height:Math.max(i.height+i.y,r.height)}:(t=Math.min(1,r.width/i.width,r.height/i.height),{x:i.x+(e?i.width/2-r.width/t/2:0),y:i.y+(e?i.height/2-r.height/t/2:0),width:r.width/t,height:r.height/t}),this.viewbox(n),this.viewbox(!1).scale},po.prototype._setZoom=function(e,t){var n,o,r,i,a=this._svg,s=this._viewport,c=a.createSVGMatrix(),u=a.createSVGPoint(),l=(o=s.getCTM()).a;return i=t?(n=R(u,t).matrixTransform(o.inverse()),r=c.translate(n.x,n.y).scale(1/l*e).translate(-n.x,-n.y),o.multiply(r)):c.scale(e),fo(this._viewport,i),i},po.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},po.prototype.getAbsoluteBBox=function(e){var t,n=this.viewbox();e.waypoints?t=this.getGraphics(e).getBBox():t=e;return{x:t.x*n.scale-n.x*n.scale,y:t.y*n.scale-n.y*n.scale,width:t.width*n.scale,height:t.height*n.scale}},po.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var ho="data-element-id";function yo(e){this._elements={},this._eventBus=e}yo.$inject=["eventBus"],yo.prototype.add=function(e,t,n){var o=e.id;this._validateId(o),wn(t,ho,o),n&&wn(n,ho,o),this._elements[o]={element:e,gfx:t,secondaryGfx:n}},yo.prototype.remove=function(e){var t=this._elements,n=e.id||e,o=n&&t[n];o&&(wn(o.gfx,ho,""),o.secondaryGfx&&wn(o.secondaryGfx,ho,""),delete t[n])},yo.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),o=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,o)},yo.prototype.get=function(e){var t;t="string"==typeof e?e:e&&wn(e,ho);var n=this._elements[t];return n&&n.element},yo.prototype.filter=function(n){var o=[];return this.forEach(function(e,t){n(e,t)&&o.push(e)}),o},yo.prototype.getAll=function(){return this.filter(function(e){return e})},yo.prototype.forEach=function(r){var i=this._elements;Object.keys(i).forEach(function(e){var t=i[e],n=t.element,o=t.gfx;return r(n,o)})},yo.prototype.getGraphics=function(e,t){var n=e.id||e,o=this._elements[n];return o&&(t?o.secondaryGfx:o.gfx)},yo.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,o,t,r){var i=t.inverse;return Object.defineProperty(e,"remove",{value:function(e){var t=this.indexOf(e);return-1!==t&&(this.splice(t,1),o.unset(e,i,r)),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&&o.set(e,i,r)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e},isExtended:function(e){return!0===e.__refs_collection}};function mo(t,n,o){var e=vo.extend(o[n.name]||[],t,n,o);Object.defineProperty(o,n.name,{enumerable:n.enumerable,value:e}),e.length&&e.forEach(function(e){t.set(e,n.inverse,o)})}function go(e,t){if(!(this instanceof go))return new go(e,t);(e.inverse=t).inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}go.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,o,r,i,a;t.collection?mo(this,t,e):(n=this,r=e,i=(o=t).inverse,a=r[o.name],Object.defineProperty(r,o.name,{configurable:o.configurable,enumerable:o.enumerable,get:function(){return a},set:function(e){if(e!==a){var t=a;a=null,t&&n.unset(t,i,r),a=e,n.set(a,i,r)}}}))},go.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return vo.isExtended(n)||mo(this,t,e),n},go.prototype.ensureBound=function(e,t){var n,o;n=e,o=t,Object.prototype.hasOwnProperty.call(n,o.name||o)||this.bind(e,t)},go.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},go.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var bo=go,_o=vo;bo.Collection=_o;var wo=new bo({name:"children",enumerable:!0,collection:!0},{name:"parent"}),xo=new bo({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Co=new bo({name:"attachers",collection:!0},{name:"host"}),Eo=new bo({name:"outgoing",collection:!0},{name:"source"}),ko=new bo({name:"incoming",collection:!0},{name:"target"});function So(){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"),Eo.bind(this,"outgoing"),ko.bind(this,"incoming")}function Oo(){So.call(this),wo.bind(this,"children"),Co.bind(this,"host"),Co.bind(this,"attachers")}function jo(){Oo.call(this)}function Po(){Oo.call(this),xo.bind(this,"labelTarget")}function To(){So.call(this),Eo.bind(this,"source"),ko.bind(this,"target")}en(Oo,So),en(jo,Oo),en(Po,Oo),en(To,So);var Ro={connection:To,shape:Oo,label:Po,root:jo};function Ao(){this._uid=12}function Do(e,t,n){var o=In();o.setTranslate(t,n),Hn(e,o)}function Mo(e,t){this._eventBus=e,this._elementRegistry=t}function Bo(e,t,n){t.insertBefore(e,n||t.firstChild)}Ao.prototype.createRoot=function(e){return this.create("root",e)},Ao.prototype.createLabel=function(e){return this.create("label",e)},Ao.prototype.createShape=function(e){return this.create("shape",e)},Ao.prototype.createConnection=function(e){return this.create("connection",e)},Ao.prototype.create=function(e,t){return(t=R({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=Ro[e];if(!n)throw new Error("unknown type: <"+e+">");return R(new n,t)}(e,t)},Mo.$inject=["eventBus","elementRegistry"],Mo.prototype._getChildren=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=n.parentNode.childNodes[1])||(Sn(t=Dn("g")).add("djs-children"),mn(n.parentNode,t)):t=n,t},Mo.prototype._clear=function(e){var t=Ot(".djs-visual",e);return ut(t),t},Mo.prototype._createContainer=function(e,t,n){var o=Dn("g");Sn(o).add("djs-group"),void 0!==n?Bo(o,t,t.childNodes[n]):mn(t,o);var r=Dn("g");Sn(r).add("djs-element"),Sn(r).add("djs-"+e),mn(o,r);var i=Dn("g");return Sn(i).add("djs-visual"),mn(r,i),r},Mo.prototype.create=function(e,t,n){var o=this._getChildren(t.parent);return this._createContainer(e,o,n)},Mo.prototype.updateContainments=function(e){var o=this,r=this._elementRegistry;w(x(e,function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e},{}),function(e){var t=e.children;if(t){var n=o._getChildren(e);w(t.slice().reverse(),function(e){Bo(r.getGraphics(e).parentNode,n)})}})},Mo.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},Mo.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},Mo.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},Mo.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},Mo.prototype.update=function(e,t,n){if(t.parent){var o=this._clear(n);if("shape"===e)this.drawShape(o,t),Do(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(o,t)}t.hidden?wn(n,"display","none"):wn(n,"display","block")}},Mo.prototype.remove=function(e){jn(this._elementRegistry.getGraphics(e).parentNode)};var Io={__depends__:[Zn],__init__:["canvas"],canvas:["type",po],elementRegistry:["type",yo],elementFactory:["type",Ao],eventBus:["type",o],graphicsFactory:["type",Mo]};function No(e){var o=[],r=[];function i(e){return 0<=o.indexOf(e)}e.forEach(function e(t){var n;i(t)||((t.__depends__||[]).forEach(e),i(t)||(n=t,o.push(n),(t.__init__||[]).forEach(function(e){r.push(e)})))});var t=new fn(o);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}function Vo(e,t){var n;this.injector=t=t||No([{config:["value",n=(n=e)||{}]},Io].concat(n.modules||[])),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}Vo.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Vo.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};var Lo,$o=(Lo=Object.freeze({default:Vo}))&&Lo.default||Lo;function Fo(n,e){var a=[];function s(e,t){if(e.gfx)throw new Error("already rendered "+e.id);return n.element(e,t)}function o(t){var n=[];!function(e,t){var n=e.extensionElements;if(!n)return;w(n.values,t)}(t,function(e){Ht(e,"biodi:Bounds")?s(t,e):Ht(e,"biodi:Edge")&&n.push(e)}),function(i,t){function n(e,t){var n,o=(n=t)&&n.href.slice(1),r=g(i,E({source:o}));r&&a.push(function(){s(e,r)})}if(Ht(t,"dmn:Association"))return n(t,t.sourceRef);w(["informationRequirement","knowledgeRequirement","authorityRequirement"],function(e){w(t[e],function(t){var e=null;Ht(t,"dmn:InformationRequirement")?e=["requiredDecision","requiredInput"]:Ht(t,"dmn:KnowledgeRequirement")?e=["requiredKnowledge"]:Ht(t,"dmn:AuthorityRequirement")&&(e=["requiredDecision","requiredInput","requiredAuthority"]),e&&w(e,function(e){t[e]&&n(t,t[e])})})})}(n,t)}return{handleDefinitions:function(t){n.root(t),w(["decision","drgElements","artifacts"],function(e){t[e]&&w(t[e],o)}),w(a,function(e){e()})}}}var Uo=0,zo={width:150,height:50};function Wo(e,t){var n;t.textContent=e;try{var o,r=""===e;return t.textContent=r?"dummy":e,o={width:(n=t.getBBox()).width+2*n.x,height:n.height},r&&(o.width=0),o}catch(e){return{width:0,height:0}}}function Ho(e,t,n){for(var o,r=e.shift(),i=r;;){if((o=Wo(i,n)).width=i?o.width:0," "===i||""===i||o.width<Math.round(t)||i.length<2)return Go(e,i,r,o);i=qo(i,o.width,t)}}function Go(e,t,n,o){if(t.length<n.length){var r=n.slice(t.length).trim();e.unshift(r)}return{width:o.width,height:o.height,text:t}}function qo(e,t,n){var o=Math.max(e.length*(n/t),1),r=function(e,t){var n,o=e.split(/(\s|-)/g),r=[],i=0;if(1<o.length)for(;n=o.shift();){if(!(n.length+i<t)){"-"===n&&r.pop();break}r.push(n),i+=n.length}return r.join("")}(e,o);return r||(r=e.slice(0,Math.max(Math.round(o-1),1))),r}function Ko(e){this._config=R({},{size:zo,padding:Uo,style:{},align:"center-top"},e||{})}function Xo(e,r,o){yn.call(this,e);var i=new Ko({style:{fontFamily:"Arial, sans-serif",fontSize:"12px"},size:{width:100}}),u={};function a(e){return"url(#"+u[e].id+")"}function t(c){function e(e,t){var n=R({strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},t.attrs),o=t.ref||{x:0,y:0},r=t.scale||1;"none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]);var i=Dn("marker");wn(t.element,n),mn(i,t.element),wn(i,{id:e,viewBox:"0 0 20 20",refX:o.x,refY:o.y,markerWidth:20*r,markerHeight:20*r,orient:"auto"});var a,s=Ot("defs",c);return s||(s=Dn("defs"),mn(c,s)),mn(s,i),a=i,void(u[e]=a)}var t=Dn("path");wn(t,{d:"M 11 5 L 1 10 L 11 15"}),e("association-start",{element:t,attrs:{fill:"none",stroke:"black",strokeWidth:1.5},ref:{x:1,y:10},scale:.5});var n=Dn("path");wn(n,{d:"M 1 5 L 11 10 L 1 15"}),e("association-end",{element:n,attrs:{fill:"none",stroke:"black",strokeWidth:1.5},ref:{x:12,y:10},scale:.5});var o=Dn("path");wn(o,{d:"M 1 5 L 11 10 L 1 15 Z"}),e("information-requirement-end",{element:o,ref:{x:11,y:10},scale:1});var r=Dn("path");wn(r,{d:"M 1 3 L 11 10 L 1 17"}),e("knowledge-requirement-end",{element:r,attrs:{fill:"none",stroke:"black",strokeWidth:2},ref:{x:11,y:10},scale:.8});var i=Dn("circle");wn(i,{cx:3,cy:3,r:3}),e("authority-requirement-end",{element:i,ref:{x:3,y:3},scale:.9})}function s(e,t,n){return y(t)||(n=t,t=[]),o.style(t||[],R(n,e||{}))}function c(e,t,n,o,r,i){_(r)&&(i=r,r=0),r=r||0,i=s(i,{stroke:"black",strokeWidth:2,fill:"white"});var a=Dn("rect");return wn(a,{x:r,y:r,width:t-2*r,height:n-2*r,rx:o,ry:o}),wn(a,i),mn(e,a),a}function l(e,t,n){var o=i.createText(t||"",n);return nt(o,"class","djs-label"),mn(e,o),o}function p(e,t,n){return l(e,Kt(t).name,{box:t,align:n,padding:5})}function f(e,t,n){n=s(n,["no-fill"],{strokeWidth:2,stroke:"black"});var o=Dn("path");return wn(o,{d:t}),wn(o,n),mn(e,o),o}var d={"dmn:Decision":function(e,t,n){var o=c(e,t.width,t.height,0,n);return p(e,t,"center-middle"),o},"dmn:KnowledgeSource":function(e,t,n){var o=f(e,r.getScaledPath("KNOWLEDGE_SOURCE",{xScaleFactor:1.021,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.075}}),{strokeWidth:2,fill:"white",stroke:"black"});return p(e,t,"center-middle"),o},"dmn:BusinessKnowledgeModel":function(e,t,n){var o=f(e,r.getScaledPath("BUSINESS_KNOWLEDGE_MODEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.3}}),{strokeWidth:2,fill:"white",stroke:"black"});return p(e,t,"center-middle"),o},"dmn:InputData":function(e,t,n){var o=c(e,t.width,t.height,22,n);return p(e,t,"center-middle"),o},"dmn:TextAnnotation":function(e,t,n){var o=c(e,t.width,t.height,0,0,{fill:"none",stroke:"none"});return f(e,r.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}})),l(e,Zo(t).text||"",{box:t,align:"left-middle",padding:5}),o},"dmn:Association":function(e,t,n){var o=Zo(t);return n=R({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"},n||{}),"One"!==o.associationDirection&&"Both"!==o.associationDirection||(n.markerEnd=a("association-end")),"Both"===o.associationDirection&&(n.markerStart=a("association-start")),h(e,t.waypoints,n)},"dmn:InformationRequirement":function(e,t,n){return n=R({strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:a("information-requirement-end")},n||{}),h(e,t.waypoints,n)},"dmn:KnowledgeRequirement":function(e,t,n){return n=R({strokeWidth:1,strokeDasharray:5,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:a("knowledge-requirement-end")},n||{}),h(e,t.waypoints,n)},"dmn:AuthorityRequirement":function(e,t,n){return n=R({strokeWidth:1.5,strokeDasharray:5,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:a("authority-requirement-end")},n||{}),h(e,t.waypoints,n)}};function h(e,t,n){var o=Kn(t,n=s(n,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"}));return mn(e,o),o}this.canRender=function(e){return Ht(e,"dmn:DMNElement")||Ht(e,"dmn:InformationRequirement")||Ht(e,"dmn:KnowledgeRequirement")||Ht(e,"dmn:AuthorityRequirement")},this.drawShape=function(e,t){var n=d[t.type];return n?n(e,t):yn.prototype.drawShape.apply(this,[e,t])},this.drawConnection=function(e,t){var n=t.type,o=d[n];return o?o(e,t):yn.prototype.drawConnection.apply(this,[e,t])},e.on("canvas.init",function(e){t(e.svg)})}function Zo(e){return e.businessObject}Ko.prototype.createText=function(e,t){return this.layoutText(e,t).element},Ko.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},Ko.prototype.layoutText=function(e,t){var n,o,r,i,a=R({},this._config.size,t.box),s=R({},this._config.style,t.style),c=(o=t.align||this._config.align,{horizontal:(r=o.split("-"))[0]||"center",vertical:r[1]||"top"}),u=_(n=void 0!==t.padding?t.padding:this._config.padding)?R({top:0,left:0,right:0,bottom:0},n):{top:n,left:n,right:n,bottom:n},l=t.fitBox||!1,p=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(s),f=e.split(/\r?\n/g),d=[],h=a.width-u.left-u.right,y=Dn("text");for(wn(y,{x:0,y:0}),wn(y,s),mn(((i=document.getElementById("helper-svg"))||(wn(i=Dn("svg"),{id:"helper-svg",width:0,height:0,style:"visibility: hidden; position: fixed"}),document.body.appendChild(i)),i),y);f.length;)d.push(Ho(f,h,y));"middle"===c.vertical&&(u.top=u.bottom=0);var v=x(d,function(e,t,n){return e+(p||t.height)},0)+u.top+u.bottom,m=x(d,function(e,t,n){return t.width>e?t.width:e},0),g=u.top;"middle"===c.vertical&&(g+=(a.height-v)/2),g-=(p||d[0].height)/4;var b=Dn("text");return wn(b,s),w(d,function(e){var t;switch(g+=p||e.height,c.horizontal){case"left":t=u.left;break;case"right":t=(l?m:h)-u.right-e.width;break;default:t=Math.max(((l?m:h)-e.width)/2+u.left,0)}var n=Dn("tspan");wn(n,{x:t,y:g}),n.textContent=e.text,mn(b,n)}),jn(y),{dimensions:{width:m,height:v},element:b}},en(Xo,yn),Xo.$inject=["eventBus","pathMap","styles"];var Yo=/\{([^}]+)\}/g,Jo=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var Qo={__init__:["drdRenderer"],drdRenderer:["type",Xo],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,o,r=this.pathMap[e];o=t.abspos?(n=t.abspos.x,t.abspos.y):(n=t.containerWidth*t.position.mx,t.containerHeight*t.position.my);var i,a,s={};if(t.position){for(var c=t.containerHeight/r.height*t.yScaleFactor,u=t.containerWidth/r.width*t.xScaleFactor,l=0;l<r.heightElements.length;l++)s["y"+l]=r.heightElements[l]*c;for(var p=0;p<r.widthElements.length;p++)s["x"+p]=r.widthElements[p]*u}return i=r.d,a={mx:n,my:o,e:s},String(i).replace(Yo,function(e,t){return n=e,i=o=a,t.replace(Jo,function(e,t,n,o,r){t=t||o,i&&(t in i&&(i=i[t]),"function"==typeof i&&r&&(i=i()))}),i=(null==i||i==o?n:i)+"";var n,o,i})}}]};function er(e,t){return R({id:e.id,type:e.$type,businessObject:e},t)}function tr(e,t,n,o){this._eventBus=e,this._canvas=t,this._elementRegistry=o,this._elementFactory=n}tr.$inject=["eventBus","canvas","elementFactory","elementRegistry"],tr.prototype.root=function(e){var t=this._elementFactory.createRoot(er(e));return this._canvas.setRootElement(t),t},tr.prototype.add=function(e,t){var n,o,r,i,a,s,c,u,l=this._elementFactory,p=this._canvas,f=this._eventBus;if(t.$instanceOf("biodi:Bounds"))a=er(e,{x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width),height:Math.round(t.height)}),n=l.createShape(a),p.addShape(n),f.fire("drdElement.added",{element:n,di:t});else{if(!t.$instanceOf("biodi:Edge"))throw new Error("unknown di for element "+e.id);o=function(e){var t=e.waypoints;if(t)return v(t,function(e){var t={x:e.x,y:e.y};return R({original:t},t)})}(t),s=t.source,c=e.$parent.id,Ht(e,"dmn:Association")&&(c=(u=e.targetRef)&&u.href.slice(1)),r=this._getShape(s),i=this._getShape(c),r&&i&&(a=er(e,{hidden:!1,source:r,target:i,waypoints:o}),n=l.createConnection(a),p.addConnection(n),f.fire("drdElement.added",{element:n,di:t}))}return n},tr.prototype._getShape=function(e){return this._elementRegistry.get(e)};var nr={__depends__:[Qo,{drdImporter:["type",tr]}]};var or={translate:["value",function(e,n){return n=n||{},e.replace(/{([^}]+)}/g,function(e,t){return n[t]||"{"+t+"}"})}]};function rr(e){e&&"function"==typeof e.stopPropagation&&e.stopPropagation()}function ir(e){return e.originalEvent||e.srcEvent}function ar(e,t){rr(e),rr(ir(e))}function sr(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function cr(e){return!(ir(e)||e).button}function ur(e){var t=ir(e)||e;return!!cr(e)&&(/mac/i.test(navigator.platform)?t.metaKey:t.ctrlKey)}function lr(e){return!0}function pr(a,s,e){var r=e.cls("djs-hit",["no-fill","no-border"],{stroke:"white",strokeWidth:15});function i(e,t,n){var o,r,i;(o=t,(p[e]||cr)(o))&&(n?i=s.getGraphics(n):(r=t.delegateTarget||t.target)&&(i=r,n=s.get(i)),i&&n&&!1===a.fire(e,{element:n,gfx:i,originalEvent:t})&&(t.stopPropagation(),t.preventDefault()))}var c={};function u(e){return c[e]}var l={mouseover:"element.hover",mouseout:"element.out",click:"element.click",dblclick:"element.dblclick",mousedown:"element.mousedown",mouseup:"element.mouseup",contextmenu:"element.contextmenu"},p={"element.contextmenu":lr};var f="svg, .djs-element";function o(e,t,n,o){var r=c[n]=function(e){i(n,e)};o&&(p[n]=o),r.$delegate=_t.bind(e,f,t,r)}function d(e,t,n){var o=u(n);o&&_t.unbind(e,t,o.$delegate)}a.on("canvas.destroy",function(e){var n;n=e.svg,w(l,function(e,t){d(n,t,e)})}),a.on("canvas.init",function(e){var n;n=e.svg,w(l,function(e,t){o(n,t,e)})}),a.on(["shape.added","connection.added"],function(e){var t,n=e.element,o=e.gfx;n.waypoints?t=Kn(n.waypoints):wn(t=Dn("rect"),{x:0,y:0,width:n.width,height:n.height}),wn(t,r),mn(o,t)}),a.on("shape.changed",500,function(e){var t=e.element;wn(Ot(".djs-hit",e.gfx),{width:t.width,height:t.height})}),a.on("connection.changed",function(e){var t,n,o=e.element,r=Ot(".djs-hit",e.gfx);t=r,n=o.waypoints,wn(t,{points:qn(n)})}),this.fire=i,this.triggerMouseEvent=function(e,t,n){var o=l[e];if(!o)throw new Error("unmapped DOM event name <"+e+">");return i(o,t,n)},this.mouseHandler=u,this.registerEvent=o,this.unregisterEvent=d}pr.$inject=["eventBus","elementRegistry","styles"];var fr={__init__:["interactionEvents"],interactionEvents:["type",pr]};function dr(e,t,n){this.offset=6;var o=t.cls("djs-outline",["no-fill"]),r=this;function i(e,t){var n=Dn("rect");return wn(n,R({x:10,y:10,width:100,height:100},o)),mn(e,n),n}e.on(["shape.added","shape.changed"],500,function(e){var t=e.element,n=e.gfx,o=Ot(".djs-outline",n);o||(o=i(n)),r.updateShapeOutline(o,t)}),e.on(["connection.added","connection.changed"],function(e){var t=e.element,n=e.gfx,o=Ot(".djs-outline",n);o||(o=i(n)),r.updateConnectionOutline(o,t)})}dr.prototype.updateShapeOutline=function(e,t){wn(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},dr.prototype.updateConnectionOutline=function(e,t){var n=oo(t);wn(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},dr.$inject=["eventBus","styles","elementRegistry"];var hr={__init__:["outline"],outline:["type",dr]};function yr(e){this._eventBus=e,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],function(e){var t=e.element;n.deselect(t)}),e.on(["diagram.clear"],function(e){n.select(null)})}yr.$inject=["eventBus"],yr.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(-1!==n){var o=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:o,newSelection:t})}},yr.prototype.get=function(){return this._selectedElements},yr.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},yr.prototype.select=function(e,t){var n=this._selectedElements,o=n.slice();y(e)||(e=e?[e]:[]),t?w(e,function(e){-1===n.indexOf(e)&&n.push(e)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:o,newSelection:n})};var vr="selected";function mr(e,n,t,o){function r(e,t){n.addMarker(e,t)}function i(e,t){n.removeMarker(e,t)}this._multiSelectionBox=null,e.on("element.hover",function(e){r(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;w(t,function(e){-1===n.indexOf(e)&&i(e,vr)}),w(n,function(e){-1===t.indexOf(e)&&r(e,vr)})})}function gr(e,i,a,o){e.on("create.end",500,function(e){e.context.canExecute&&i.select(e.context.shape)}),e.on("connect.end",500,function(e){e.context.canExecute&&e.context.target&&i.select(e.context.target)}),e.on("shape.move.end",500,function(e){var t=e.previousSelection||[],n=o.get(e.context.shape.id);g(t,function(e){return n.id===e.id})||i.select(n)}),e.on("element.click",function(e){var t=e.element;t===a.getRootElement()&&(t=null);var n=i.isSelected(t),o=1<i.get().length,r=ur(e);if(n&&o)return r?i.deselect(t):i.select(t);n?i.deselect(t):i.select(t,r)})}mr.$inject=["eventBus","canvas","selection","styles"],gr.$inject=["eventBus","selection","canvas","elementRegistry"];var br={__init__:["selectionVisuals","selectionBehavior"],__depends__:[fr,hr],selection:["type",yr],selectionVisuals:["type",mr],selectionBehavior:["type",gr]};function _r(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}_r.prototype.next=function(){return this._prefix+ ++this._counter};var wr=new _r("ov");function xr(e,t,n,o){var r,i;this._eventBus=t,this._canvas=n,this._elementRegistry=o,this._ids=wr,this._overlayDefaults=R({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),i=wt('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />'),r.insertBefore(i,r.firstChild),i),this._init()}function Cr(e,t,n){R(e.style,{left:t+"px",top:n+"px"})}function Er(e,t){e.style.display=!1===t?"none":""}function kr(t,n){t.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(e){t.style[e+"transform"]=n})}xr.$inject=["config.overlays","eventBus","canvas","elementRegistry"],xr.prototype.get=function(e){if(d(e)&&(e={id:e}),d(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?h(t.overlays,E({type:e.type})):t.overlays.slice():[]}return e.type?h(this._overlays,E({type:e.type})):e.id?this._overlays[e.id]:null},xr.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 o=this._ids.next();return n=R({},this._overlayDefaults,n,{id:o,type:t,element:e,html:n.html}),this._addOverlay(n),o},xr.prototype.remove=function(e){var t=this.get(e)||[];y(t)||(t=[t]);var o=this;w(t,function(e){var t=o._getOverlayContainer(e.element,!0);if(e&&(Pt(e.html),Pt(e.htmlContainer),delete e.htmlContainer,delete e.element,delete o._overlays[e.id]),t){var n=t.overlays.indexOf(e);-1!==n&&t.overlays.splice(n,1)}})},xr.prototype.show=function(){Er(this._overlayRoot)},xr.prototype.hide=function(){Er(this._overlayRoot,!1)},xr.prototype.clear=function(){this._overlays={},this._overlayContainers=[],ut(this._overlayRoot)},xr.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,o=t.x,r=t.y;if(t.waypoints){var i=oo(t);o=i.x,r=i.y}Cr(n,o,r),nt(e.html,"data-container-id",t.id)},xr.prototype._updateOverlay=function(e){var t,n,o=e.position,r=e.htmlContainer,i=e.element,a=o.left,s=o.top;void 0!==o.right&&(t=i.waypoints?oo(i).width:i.width,a=-1*o.right+t);void 0!==o.bottom&&(n=i.waypoints?oo(i).height:i.height,s=-1*o.bottom+n);Cr(r,a||0,s||0)},xr.prototype._createOverlayContainer=function(e){var t=wt('<div class="djs-overlays" style="position: absolute" />');this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},xr.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";kr(this._overlayRoot,n)},xr.prototype._getOverlayContainer=function(t,e){var n=g(this._overlayContainers,function(e){return e.element===t});return n||e?n:this._createOverlayContainer(t)},xr.prototype._addOverlay=function(e){var t,n,o=e.id,r=e.element,i=e.html;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),d(i)&&(i=wt(i)),n=this._getOverlayContainer(r),(t=wt('<div class="djs-overlay" data-overlay-id="'+o+'" style="position: absolute">')).appendChild(i),e.type&&st(t).add("djs-overlay-"+e.type),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[o]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},xr.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,o=n&&n.minZoom,r=n&&n.maxZoom,i=e.htmlContainer,a=!0;n&&((c(o)&&o>t.scale||c(r)&&r<t.scale)&&(a=!1),Er(i,a)),this._updateOverlayScale(e,t)},xr.prototype._updateOverlayScale=function(e,t){var n,o,r,i=e.scale,a=e.htmlContainer,s="";!0!==i&&(o=!1===i?n=1:(n=i.min,i.max),c(n)&&t.scale<n&&(r=(1/t.scale||1)*n),c(o)&&t.scale>o&&(r=(1/t.scale||1)*o)),c(r)&&(s="scale("+r+","+r+")"),kr(a,s)},xr.prototype._updateOverlaysVisibilty=function(t){var n=this;w(this._overlays,function(e){n._updateOverlayVisibilty(e,t)})},xr.prototype._init=function(){var e=this._eventBus,r=this;e.on("canvas.viewbox.changing",function(e){r.hide()}),e.on("canvas.viewbox.changed",function(e){var t;t=e.viewbox,r._updateRoot(t),r._updateOverlaysVisibilty(t),r.show()}),e.on(["shape.remove","connection.remove"],function(e){var t=e.element;w(r.get({element:t}),function(e){r.remove(e.id)});var n=r._getOverlayContainer(t);if(n){Pt(n.html);var o=r._overlayContainers.indexOf(n);-1!==o&&r._overlayContainers.splice(o,1)}}),e.on("element.changed",500,function(e){var t=e.element,n=r._getOverlayContainer(t,!0);n&&(w(n.overlays,function(e){r._updateOverlay(e)}),r._updateOverlayContainer(n))}),e.on("element.marker.update",function(e){var t=r._getOverlayContainer(e.element,!0);t&&st(t.html)[e.add?"add":"remove"](e.marker)}),e.on("diagram.clear",this.clear,this)};var Sr={__init__:["overlays"],overlays:["type",xr]};function Or(e,t){this._eventBus=e,this._canvas=t,e.on("diagram.init",function(){this._init()},this),e.on("import.done",function(e){this.update()},this)}function jr(e,n){function t(e,t){st(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)})}Or.$inject=["eventBus","canvas"],Or.prototype._init=function(){var e=this._canvas,t=this._eventBus,n=e.getContainer(),o=this._container=wt(Or.HTML_MARKUP);n.appendChild(o),this.nameElement=Ot(".dmn-definitions-name",this._container),this.idElement=Ot(".dmn-definitions-id",this._container),_t.bind(o,".dmn-definitions-name, .dmn-definitions-id","mousedown",function(e){e.stopPropagation()}),t.fire("definitionIdView.create",{html:o})},Or.prototype.update=function(e){var t=this._canvas.getRootElement().businessObject;this.nameElement.textContent=t.name,this.idElement.textContent=t.id},Or.HTML_MARKUP='<div class="dmn-definitions"><div class="dmn-definitions-name" title="Definition Name"></div><div class="dmn-definitions-id" title="Definition ID"></div></div>',jr.$inject=["eventBus","canvas"];var Pr={__init__:["definitionPropertiesView","definitionPropertiesPaletteAdapter"],definitionPropertiesView:["type",Or],definitionPropertiesPaletteAdapter:["type",jr]},Tr=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Rr=[{className:"dmn-icon-decision-table",matches:function(e){var t=e.businessObject;return Ht(t,"dmn:Decision")&&t.decisionTable}},{className:"dmn-icon-literal-expression",matches:function(e){var t=e.businessObject;return Ht(t,"dmn:Decision")&&t.literalExpression}}],Ar=function(){function r(e,t,n,o){var a=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this._injector=e,this._eventBus=t,this._overlays=n,this._config=o||{enabled:!0},t.on(["shape.added"],function(e){for(var t=e.element,n=0;n<Rr.length;n++){var o=Rr[n],r=o.matches,i=o.className;r&&r(t)&&a.addOverlay(t,i)}})}return Tr(r,[{key:"addOverlay",value:function(e,t){var n=wt('\n <div class="drill-down-overlay">\n <span class="'+t+'"></span>\n </div>\n '),o=this._overlays.add(e,{position:{top:2,left:2},html:n});!1!==this._config.enabled&&(st(n).add("interactive"),this.bindEventListener(e,n,o))}},{key:"bindEventListener",value:function(e,t,n){var o=this,r=this._overlays,i=this._eventBus,a=r._overlayRoot;_t.bind(a,'[data-overlay-id="'+n+'"]',"click",function(){!1!==i.fire("drillDown.click",{element:e})&&o.drillDown(e)})}},{key:"drillDown",value:function(e){var t=this._injector.get("_parent",!1);if(!t)return!1;var n=t.getView(e.businessObject);return!!n&&(t.open(n),!0)}}]),r}();Ar.$inject=["injector","eventBus","overlays","config.drillDown"];var Dr={__depends__:[Sr],__init__:["drillDown"],drillDown:["type",Ar]},Mr='<img width="52" height="52" src="'+("data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 960 960"><path fill="#fff" d="M960 60v839c0 33-27 61-60 61H60c-33 0-60-27-60-60V60C0 27 27 0 60 0h839c34 0 61 27 61 60z"/><path fill="#52b415" d="M217 548a205 205 0 0 0-144 58 202 202 0 0 0-4 286 202 202 0 0 0 285 3 200 200 0 0 0 48-219 203 203 0 0 0-185-128zM752 6a206 206 0 0 0-192 285 206 206 0 0 0 269 111 207 207 0 0 0 111-260A204 204 0 0 0 752 6zM62 0A62 62 0 0 0 0 62v398l60 46a259 259 0 0 1 89-36c5-28 10-57 14-85l99 2 12 85a246 246 0 0 1 88 38l70-52 69 71-52 68c17 30 29 58 35 90l86 14-2 100-86 12a240 240 0 0 1-38 89l43 58h413c37 0 60-27 60-61V407a220 220 0 0 1-44 40l21 85-93 39-45-76a258 258 0 0 1-98 1l-45 76-94-39 22-85a298 298 0 0 1-70-69l-86 22-38-94 76-45a258 258 0 0 1-1-98l-76-45 40-94 85 22a271 271 0 0 1 41-47z"/></svg>'))+'" />'; 22/** 23 * This file must not be changed or exchanged. 24 * 25 * @see http://bpmn.io/license for more information. 26 */function Br(e){return e.join(";")}var Ir,Nr='<div class="bjs-powered-by-lightbox" style="'+Br(["z-index: 1001","position: fixed","top: 0","left: 0","right: 0","bottom: 0"])+'"><div class="backdrop" style="'+Br(["width: 100%","height: 100%","background: rgba(0,0,0,0.2)"])+'"></div><div class="notice" style="'+Br(["position: absolute","left: 50%","top: 40%","margin: 0 -130px","width: 260px","padding: 10px","background: white","border: solid 1px #AAA","border-radius: 3px","font-family: Helvetica, Arial, sans-serif","font-size: 14px","line-height: 1.2em"])+'"><a href="http://bpmn.io" target="_blank" style="float: left; margin-right: 10px">'+Mr+'</a>Web-based tooling for BPMN, DMN and CMMN diagrams powered by <a href="http://bpmn.io" target="_blank">bpmn.io</a>.</div></div>';var Vr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e};function Lr(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function $r(e){ 27/** 28 * Adds the project logo to the diagram container as 29 * required by the bpmn.io license. 30 * 31 * @see http://bpmn.io/license 32 * 33 * @param {Element} container 34 */ 35var t,n;this._container=this._createContainer(),t=this._container,n=wt('<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">'+Mr+"</a>"),t.appendChild(n),gt.bind(n,"click",function(e){Ir||(Ir=wt(Nr),_t.bind(Ir,".backdrop","click",function(e){document.body.removeChild(Ir)})),document.body.appendChild(Ir),e.preventDefault()}),this._init(this._container,e)}function Fr(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Ur(e,t){return{x:e.x-t.x,y:e.y-t.y}}function zr(e){return Math.log(e)/Math.log(10)}function Wr(e,t){var n=zr(e.min),o=zr(e.max);return(Math.abs(n)+Math.abs(o))/t}en($r,$o),$r.prototype.saveSVG=function(e,t){t||(t=e,e={});var n=this.get("canvas"),o=n.getDefaultLayer(),r=Ot("defs",n._svg),i=zn(o),a=r&&r.outerHTML||"",s=o.getBBox();t(null,'<?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="'+s.width+'" height="'+s.height+'" viewBox="'+s.x+" "+s.y+" "+s.width+" "+s.height+'" version="1.1">'+a+i+"</svg>")},$r.prototype.getModules=function(){return this._modules},$r.prototype.destroy=function(){$o.prototype.destroy.call(this),Pt(this._container)},$r.prototype.on=function(e,t,n,o){return this.get("eventBus").on(e,t,n,o)},$r.prototype.off=function(e,t){this.get("eventBus").off(e,t)},$r.prototype._init=function(e,t){var n=t.additionalModules,o=t.canvas,r=function(e,t){var n={};for(var o in e)0<=t.indexOf(o)||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}(t,["additionalModules","canvas"]),i=t.modules||this.getModules(),a=[].concat([{drd:["value",this]}],Lr(i),Lr(n||[])),s=Vr({},r,{canvas:Vr({},o,{container:e}),modules:a});$o.call(this,s),t&&t.container&&this.attachTo(t.container)},$r.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},$r.prototype._createContainer=function(){return wt('<div class="dmn-drd-container"></div>')},$r.prototype.open=function(e,t){var n;try{return this._definitions&&this.clear(),this._definitions=e,function(e,t,n){var o,r,i=e.get("drdImporter"),a=e.get("eventBus"),s=[];a.fire("import.start",{definitions:t});try{r=t,new Fo({root:function(e){return i.root(e)},element:function(e,t){return i.add(e,t)},error:function(e,t){s.push({message:e,context:t})}}).handleDefinitions(r)}catch(e){o=e}a.fire("import.done",{error:o,warnings:s}),n(o,s)}(this,e,t)}catch(e){n=e}return t(n)},$r.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()},$r.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},$r.prototype._modules=[nr,or,br,Sr,Pr,Dr];var Hr=Math.sign||function(e){return 0<=e?1:-1},Gr={min:.2,max:4};function qr(t,e,n){t=t||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=P(this._handleWheel,this),this._totalDelta=0,this._scale=t.scale||.75;var o=this;e.on("canvas.init",function(e){o._init(!1!==t.enabled)})}qr.$inject=["config.zoomScroll","eventBus","canvas"],qr.prototype.scroll=function(e){this._canvas.scroll(e)},qr.prototype.reset=function(){this._canvas.zoom("fit-viewport")},qr.prototype.zoom=function(e,t){var n=Wr(Gr,20);this._totalDelta+=e,.1<Math.abs(this._totalDelta)&&(this._zoom(e,t,n),this._totalDelta=0)},qr.prototype._handleWheel=function(e){if(!ht(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,o=e.ctrlKey,r=e.shiftKey,i=-1*this._scale;if(i*=o?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,o){var a=t.getBoundingClientRect(),s={x:e.clientX-a.left,y:e.clientY-a.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*Hr(e.deltaY)*i,this.zoom(n,s)}else n=r?{dx:i*e.deltaY,dy:0}:{dx:i*e.deltaX,dy:i*e.deltaY},this.scroll(n)}},qr.prototype.stepZoom=function(e,t){var n=Wr(Gr,10);this._zoom(e,t,n)},qr.prototype._zoom=function(e,t,n){var o=this._canvas,r=0<e?1:-1,i=zr(o.zoom()),a=Math.round(i/n)*n;a+=n*r;var s,c,u=Math.pow(10,a);o.zoom((s=Gr,c=u,Math.max(s.min,Math.min(s.max,c))),t)},qr.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,o=this._enabled;return void 0===e&&(e=!o),o!==e&>[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e},qr.prototype._init=function(e){this.toggle(e)};var Kr={__init__:["zoomScroll"],zoomScroll:["type",qr]},Xr=/^djs-cursor-.*$/;function Zr(e){var t=st(document.body);t.removeMatching(Xr),e&&t.add("djs-cursor-"+e)}function Yr(){Zr(null)}var Jr=5e3;function Qr(e,t){function n(){return!1}return t=t||"element.click",e.once(t,Jr,n),function(){e.off(t,n)}}function ei(i,a){var s;function t(e){var t,n=s.start,o=sr(e),r=Ur(o,n);(!s.dragging&&(t=r,15<Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2)))&&(s.dragging=!0,Qr(i),Zr("grab")),s.dragging)&&(r=Ur(o,s.last||s.start),a.scroll({dx:r.x,dy:r.y}),s.last=o);e.preventDefault()}function n(e){gt.unbind(document,"mousemove",t),gt.unbind(document,"mouseup",n),s=null,Yr()}i.on("element.mousedown",500,function(e){return function(e){if(ht(e.target,".djs-draggable"))return;if(e.button||e.ctrlKey||e.shiftKey||e.altKey)return;return s={start:sr(e)},gt.bind(document,"mousemove",t),gt.bind(document,"mouseup",n),!0}(e.originalEvent)})}ei.$inject=["eventBus","canvas"];var ti={__init__:["moveCanvas"],moveCanvas:["type",ei]},ni=e(function(We){var He="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}; 36/*! Hammer.JS - v2.0.7 - 2016-04-22 37 * http://hammerjs.github.io/ 38 * 39 * Copyright (c) 2016 Jorik Tangelder; 40 * Licensed under the MIT license */ 41/*! Hammer.JS - v2.0.7 - 2016-04-22 42 * http://hammerjs.github.io/ 43 * 44 * Copyright (c) 2016 Jorik Tangelder; 45 * Licensed under the MIT license */ 46!function(i,s,e,y){var a,c=["","webkit","Moz","MS","ms","o"],t=s.createElement("div"),n="function",u=Math.round,v=Math.abs,m=Date.now;function l(e,t,n){return setTimeout(g(e,n),t)}function o(e,t,n){return!!Array.isArray(e)&&(p(e,n[t],n),!0)}function p(e,t,n){var o;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==y)for(o=0;o<e.length;)t.call(n,e[o],o,e),o++;else for(o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o,e)}function r(o,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",n=i.console&&(i.console.warn||i.console.log);return n&&n.call(i.console,r,t),o.apply(this,arguments)}}a="function"!=typeof Object.assign?function(e){if(e===y||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var o=arguments[n];if(o!==y&&null!==o)for(var r in o)o.hasOwnProperty(r)&&(t[r]=o[r])}return t}:Object.assign;var f=r(function(e,t,n){for(var o=Object.keys(t),r=0;r<o.length;)(!n||n&&e[o[r]]===y)&&(e[o[r]]=t[o[r]]),r++;return e},"extend","Use `assign`."),d=r(function(e,t){return f(e,t,!0)},"merge","Use `assign`.");function h(e,t,n){var o,r=t.prototype;(o=e.prototype=Object.create(r)).constructor=e,o._super=r,n&&a(o,n)}function g(e,t){return function(){return e.apply(t,arguments)}}function b(e,t){return(void 0===e?"undefined":He(e))==n?e.apply(t&&t[0]||y,t):e}function _(e,t){return e===y?t:e}function w(t,e,n){p(k(e),function(e){t.addEventListener(e,n,!1)})}function x(t,e,n){p(k(e),function(e){t.removeEventListener(e,n,!1)})}function C(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function E(e,t){return-1<e.indexOf(t)}function k(e){return e.trim().split(/\s+/g)}function S(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var o=0;o<e.length;){if(n&&e[o][n]==t||!n&&e[o]===t)return o;o++}return-1}function O(e){return Array.prototype.slice.call(e,0)}function j(e,n,t){for(var o=[],r=[],i=0;i<e.length;){var a=n?e[i][n]:e[i];S(r,a)<0&&o.push(e[i]),r[i]=a,i++}return t&&(o=n?o.sort(function(e,t){return e[n]>t[n]}):o.sort()),o}function P(e,t){for(var n,o,r=t[0].toUpperCase()+t.slice(1),i=0;i<c.length;){if((o=(n=c[i])?n+r:t)in e)return o;i++}return y}var T=1;function R(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||i}var A="ontouchstart"in i,D=P(i,"PointerEvent")!==y,M=A&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),B="touch",I=25,N=1,V=4,L=8,$=1,F=2,U=4,z=8,W=16,H=F|U,G=z|W,q=H|G,K=["x","y"],X=["clientX","clientY"];function Z(t,e){var n=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){b(t.options.enable,[t])&&n.handler(e)},this.init()}function Y(e,t,n){var o=n.pointers.length,r=n.changedPointers.length,i=t&N&&o-r==0,a=t&(V|L)&&o-r==0;n.isFirst=!!i,n.isFinal=!!a,i&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,o=t.pointers,r=o.length;n.firstInput||(n.firstInput=J(t));1<r&&!n.firstMultiple?n.firstMultiple=J(t):1===r&&(n.firstMultiple=!1);var i=n.firstInput,a=n.firstMultiple,s=a?a.center:i.center,c=t.center=Q(o);t.timeStamp=m(),t.deltaTime=t.timeStamp-i.timeStamp,t.angle=oe(s,c),t.distance=ne(s,c),function(e,t){var n=t.center,o=e.offsetDelta||{},r=e.prevDelta||{},i=e.prevInput||{};t.eventType!==N&&i.eventType!==V||(r=e.prevDelta={x:i.deltaX||0,y:i.deltaY||0},o=e.offsetDelta={x:n.x,y:n.y});t.deltaX=r.x+(n.x-o.x),t.deltaY=r.y+(n.y-o.y)}(n,t),t.offsetDirection=te(t.deltaX,t.deltaY);var u=ee(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=u.x,t.overallVelocityY=u.y,t.overallVelocity=v(u.x)>v(u.y)?u.x:u.y,t.scale=a?(f=a.pointers,d=o,ne(d[0],d[1],X)/ne(f[0],f[1],X)):1,t.rotation=a?(l=a.pointers,p=o,oe(p[1],p[0],X)+oe(l[1],l[0],X)):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,o,r,i,a=e.lastInterval||t,s=t.timeStamp-a.timeStamp;if(t.eventType!=L&&(I<s||a.velocity===y)){var c=t.deltaX-a.deltaX,u=t.deltaY-a.deltaY,l=ee(s,c,u);o=l.x,r=l.y,n=v(l.x)>v(l.y)?l.x:l.y,i=te(c,u),e.lastInterval=t}else n=a.velocity,o=a.velocityX,r=a.velocityY,i=a.direction;t.velocity=n,t.velocityX=o,t.velocityY=r,t.direction=i}(n,t);var l,p;var f,d;var h=e.element;C(t.srcEvent.target,h)&&(h=t.srcEvent.target);t.target=h}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function J(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:u(e.pointers[n].clientX),clientY:u(e.pointers[n].clientY)},n++;return{timeStamp:m(),pointers:t,center:Q(t),deltaX:e.deltaX,deltaY:e.deltaY}}function Q(e){var t=e.length;if(1===t)return{x:u(e[0].clientX),y:u(e[0].clientY)};for(var n=0,o=0,r=0;r<t;)n+=e[r].clientX,o+=e[r].clientY,r++;return{x:u(n/t),y:u(o/t)}}function ee(e,t,n){return{x:t/e||0,y:n/e||0}}function te(e,t){return e===t?$:v(e)>=v(t)?e<0?F:U:t<0?z:W}function ne(e,t,n){n||(n=K);var o=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(o*o+r*r)}function oe(e,t,n){n||(n=K);var o=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return 180*Math.atan2(r,o)/Math.PI}Z.prototype={handler:function(){},init: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)},destroy:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(R(this.element),this.evWin,this.domHandler)}};var re={mousedown:N,mousemove:2,mouseup:V},ie="mousedown",ae="mousemove mouseup";function se(){this.evEl=ie,this.evWin=ae,this.pressed=!1,Z.apply(this,arguments)}h(se,Z,{handler:function(e){var t=re[e.type];t&N&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=V),this.pressed&&(t&V&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}});var ce={pointerdown:N,pointermove:2,pointerup:V,pointercancel:L,pointerout:L},ue={2:B,3:"pen",4:"mouse",5:"kinect"},le="pointerdown",pe="pointermove pointerup pointercancel";function fe(){this.evEl=le,this.evWin=pe,Z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}i.MSPointerEvent&&!i.PointerEvent&&(le="MSPointerDown",pe="MSPointerMove MSPointerUp MSPointerCancel"),h(fe,Z,{handler:function(e){var t=this.store,n=!1,o=e.type.toLowerCase().replace("ms",""),r=ce[o],i=ue[e.pointerType]||e.pointerType,a=i==B,s=S(t,e.pointerId,"pointerId");r&N&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):r&(V|L)&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:i,srcEvent:e}),n&&t.splice(s,1))}});var de={touchstart:N,touchmove:2,touchend:V,touchcancel:L};function he(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Z.apply(this,arguments)}h(he,Z,{handler:function(e){var t=de[e.type];if(t===N&&(this.started=!0),this.started){var n=function(e,t){var n=O(e.touches),o=O(e.changedTouches);t&(V|L)&&(n=j(n.concat(o),"identifier",!0));return[n,o]}.call(this,e,t);t&(V|L)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:B,srcEvent:e})}}});var ye={touchstart:N,touchmove:2,touchend:V,touchcancel:L},ve="touchstart touchmove touchend touchcancel";function me(){this.evTarget=ve,this.targetIds={},Z.apply(this,arguments)}h(me,Z,{handler:function(e){var t=ye[e.type],n=function(e,t){var n=O(e.touches),o=this.targetIds;if(t&(2|N)&&1===n.length)return o[n[0].identifier]=!0,[n,n];var r,i,a=O(e.changedTouches),s=[],c=this.target;if(i=n.filter(function(e){return C(e.target,c)}),t===N)for(r=0;r<i.length;)o[i[r].identifier]=!0,r++;r=0;for(;r<a.length;)o[a[r].identifier]&&s.push(a[r]),t&(V|L)&&delete o[a[r].identifier],r++;return s.length?[j(i.concat(s),"identifier",!0),s]:void 0}.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:B,srcEvent:e})}});var ge=2500;function be(){Z.apply(this,arguments);var e=g(this.handler,this);this.touch=new me(this.manager,e),this.mouse=new se(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function _e(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var o=this.lastTouches;setTimeout(function(){var e=o.indexOf(n);-1<e&&o.splice(e,1)},ge)}}h(be,Z,{handler:function(e,t,n){var o=n.pointerType==B,r="mouse"==n.pointerType;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(o)(function(e,t){e&N?(this.primaryTouch=t.changedPointers[0].identifier,_e.call(this,t)):e&(V|L)&&_e.call(this,t)}).call(this,t,n);else if(r&&function(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,o=0;o<this.lastTouches.length;o++){var r=this.lastTouches[o],i=Math.abs(t-r.x),a=Math.abs(n-r.y);if(i<=25&&a<=25)return!0}return!1}.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var we=P(t.style,"touchAction"),xe=we!==y,Ce="manipulation",Ee="none",ke="pan-x",Se="pan-y",Oe=function(){if(!xe)return!1;var t={},n=i.CSS&&i.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(e){t[e]=!n||i.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()),xe&&this.manager.element.style&&Oe[e]&&(this.manager.element.style[we]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return p(this.manager.recognizers,function(e){b(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),function(e){if(E(e,Ee))return Ee;var t=E(e,ke),n=E(e,Se);if(t&&n)return Ee;if(t||n)return t?ke:Se;if(E(e,Ce))return Ce;return"auto"}(t.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var o=this.actions,r=E(o,Ee)&&!Oe.none,i=E(o,Se)&&!Oe[Se],a=E(o,ke)&&!Oe[ke];if(r){var s=1===e.pointers.length,c=e.distance<2,u=e.deltaTime<250;if(s&&c&&u)return}if(!a||!i)return r||i&&n&H||a&&n&G?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Pe=1;function Te(e){this.options=a({},this.defaults,e||{}),this.id=T++,this.manager=null,this.options.enable=_(this.options.enable,!0),this.state=Pe,this.simultaneous={},this.requireFail=[]}function Re(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Ae(e){return e==W?"down":e==z?"up":e==F?"left":e==U?"right":""}function De(e,t){var n=t.manager;return n?n.get(e):e}function Me(){Te.apply(this,arguments)}function Be(){Me.apply(this,arguments),this.pX=null,this.pY=null}function Ie(){Me.apply(this,arguments)}function Ne(){Te.apply(this,arguments),this._timer=null,this._input=null}function Ve(){Me.apply(this,arguments)}function Le(){Me.apply(this,arguments)}function $e(){Te.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Fe(e,t){return(t=t||{}).recognizers=_(t.recognizers,Fe.defaults.preset),new Ue(e,t)}Te.prototype={defaults:{},set:function(e){return a(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(o(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=De(e,this)).id]||(t[e.id]=e).recognizeWith(this),this},dropRecognizeWith:function(e){return o(e,"dropRecognizeWith",this)||(e=De(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(o(e,"requireFailure",this))return this;var t=this.requireFail;return-1===S(t,e=De(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(o(e,"dropRequireFailure",this))return this;e=De(e,this);var t=S(this.requireFail,e);return-1<t&&this.requireFail.splice(t,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 o(e){n.manager.emit(e,t)}e<8&&o(n.options.event+Re(e)),o(n.options.event),t.additionalEvent&&o(t.additionalEvent),8<=e&&o(n.options.event+Re(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(!(this.requireFail[e].state&(32|Pe)))return!1;e++}return!0},recognize:function(e){var t=a({},e);if(!b(this.options.enable,[this,t]))return this.reset(),void(this.state=32);56&this.state&&(this.state=Pe),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},h(Me,Te,{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,o=6&t,r=this.attrTest(e);return o&&(n&L||!r)?16|t:o||r?n&V?8|t:2&t?4|t:2:32}}),h(Be,Me,{defaults:{event:"pan",threshold:10,pointers:1,direction:q},getTouchAction:function(){var e=this.options.direction,t=[];return e&H&&t.push(Se),e&G&&t.push(ke),t},directionTest:function(e){var t=this.options,n=!0,o=e.distance,r=e.direction,i=e.deltaX,a=e.deltaY;return r&t.direction||(o=t.direction&H?(r=0===i?$:i<0?F:U,n=i!=this.pX,Math.abs(e.deltaX)):(r=0===a?$:a<0?z:W,n=a!=this.pY,Math.abs(e.deltaY))),e.direction=r,n&&o>t.threshold&&r&t.direction},attrTest:function(e){return Me.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=Ae(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),h(Ie,Me,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ee]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),h(Ne,Te,{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,o=e.distance<t.threshold,r=e.deltaTime>t.time;if(this._input=e,!o||!n||e.eventType&(V|L)&&!r)this.reset();else if(e.eventType&N)this.reset(),this._timer=l(function(){this.state=8,this.tryEmit()},t.time,this);else if(e.eventType&V)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&V?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=m(),this.manager.emit(this.options.event,this._input)))}}),h(Ve,Me,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ee]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),h(Le,Me,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:H|G,pointers:1},getTouchAction:function(){return Be.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(H|G)?t=e.overallVelocity:n&H?t=e.overallVelocityX:n&G&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&v(t)>this.options.velocity&&e.eventType&V},emit:function(e){var t=Ae(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),h($e,Te,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ce]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,o=e.distance<t.threshold,r=e.deltaTime<t.time;if(this.reset(),e.eventType&N&&0===this.count)return this.failTimeout();if(o&&r&&n){if(e.eventType!=V)return this.failTimeout();var i=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||ne(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&i?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=l(function(){this.state=8,this.tryEmit()},t.interval,this),2):8}return 32},failTimeout:function(){return this._timer=l(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))}}),Fe.VERSION="2.0.7",Fe.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[Ve,{enable:!1}],[Ie,{enable:!1},["rotate"]],[Le,{direction:H}],[Be,{direction:H},["swipe"]],[$e],[$e,{event:"doubletap",taps:2},["tap"]],[Ne]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Ue(e,t){var n;this.options=a({},Fe.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(D?fe:M?me:A?be:se))(n,Y),this.touchAction=new je(this,this.options.touchAction),ze(this,!0),p(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 ze(n,o){var r,i=n.element;i.style&&(p(n.options.cssProps,function(e,t){r=P(i.style,t),i.style[r]=o?(n.oldCssProps[r]=i.style[r],e):n.oldCssProps[r]||""}),o||(n.oldCssProps={}))}Ue.prototype={set:function(e){return a(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=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var o=this.recognizers,r=t.curRecognizer;(!r||r&&8&r.state)&&(r=t.curRecognizer=null);for(var i=0;i<o.length;)n=o[i],2===t.stopped||r&&n!=r&&!n.canRecognizeWith(r)?n.reset():n.recognize(e),!r&&14&n.state&&(r=t.curRecognizer=n),i++}},get:function(e){if(e instanceof Te)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(o(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){if(o(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=S(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==y&&t!==y){var n=this.handlers;return p(k(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this}},off:function(e,t){if(e!==y){var n=this.handlers;return p(k(e),function(e){t?n[e]&&n[e].splice(S(n[e],t),1):delete n[e]}),this}},emit:function(e,t){var n,o,r;this.options.domEvents&&(n=e,o=t,(r=s.createEvent("Event")).initEvent(n,!0,!0),(r.gesture=o).target.dispatchEvent(r));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&&ze(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},a(Fe,{INPUT_START:N,INPUT_MOVE:2,INPUT_END:V,INPUT_CANCEL:L,STATE_POSSIBLE:Pe,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:32,DIRECTION_NONE:$,DIRECTION_LEFT:F,DIRECTION_RIGHT:U,DIRECTION_UP:z,DIRECTION_DOWN:W,DIRECTION_HORIZONTAL:H,DIRECTION_VERTICAL:G,DIRECTION_ALL:q,Manager:Ue,Input:Z,TouchAction:je,TouchInput:me,MouseInput:se,PointerEventInput:fe,TouchMouseInput:be,SingleTouchInput:he,Recognizer:Te,AttrRecognizer:Me,Tap:$e,Pan:Be,Swipe:Le,Pinch:Ie,Rotate:Ve,Press:Ne,on:w,off:x,each:p,merge:d,extend:f,assign:a,inherit:h,bindFn:g,prefixed:P}),(void 0!==i?i:"undefined"!=typeof self?self:{}).Hammer=Fe,"function"==typeof y&&y.amd?y(function(){return Fe}):We.exports?We.exports=Fe:i.Hammer=Fe}(window,document)}),oi=["mousedown","mouseup","mouseover","mouseout","click","dblclick"];function ri(e,t){return t.get(e,!1)}function ii(e){e.preventDefault(),e.stopPropagation(),"function"==typeof e.stopImmediatePropagation&&e.stopImmediatePropagation()}function ai(t){function e(e){setTimeout(function(){w(oi,function(e){gt.unbind(t,e,ii,!0)})},500)}gt.bind(t,"touchstart",function(e){w(oi,function(e){gt.bind(t,e,ii,!0)})},!0),gt.bind(t,"touchend",e,!0),gt.bind(t,"touchcancel",e,!0);var r=new ni.Manager(t,{inputClass:ni.TouchInput,recognizers:[]}),n=new ni.Tap,o=new ni.Pan({threshold:10}),i=new ni.Press,a=new ni.Pinch,s=new ni.Tap({event:"doubletap",taps:2});return a.requireFailure(o),a.requireFailure(i),r.add([o,i,a,s,n]),r.reset=function(e){var n=this.recognizers,o=this.session;o.stopped||(r.stop(e),setTimeout(function(){var e,t;for(e=0;t=n[e];e++)t.reset(),t.state=8;o.curRecognizer=null},0))},r.on("hammer.input",function(e){e.srcEvent.defaultPrevented&&r.reset(!0)}),r}function si(e,i,t,a,n){var s,c=ri("dragging",e),o=ri("move",e),r=ri("contextPad",e),u=ri("palette",e);function l(t){return function(e){n.fire(t,e)}}function p(e){return ht(e,"svg, .djs-element",!0)}function f(e){function t(e){var t=p(e.target),n=t&&a.get(t);if(o&&i.getRootElement()!==n)return o.start(e,n,!0);!function(e){var o=0,r=0;function t(e){var t=e.deltaX-o,n=e.deltaY-r;i.scroll({dx:t,dy:n}),o=e.deltaX,r=e.deltaY}function n(e){s.off("panmove",t),s.off("panend",n),s.off("pancancel",n)}s.on("panmove",t),s.on("panend",n),s.on("pancancel",n)}()}(s=ai(e)).on("doubletap",l("element.dblclick")),s.on("tap",l("element.click")),s.on("panstart",t),s.on("press",t),s.on("pinchstart",function(e){var o=i.zoom(),r=e.center;function t(e){var t=1-(1-e.scale)/1.5,n=Math.max(.2,Math.min(4,t*o));i.zoom(n,r),ii(e)}function n(e){s.off("pinchmove",t),s.off("pinchend",n),s.off("pinchcancel",n),s.reset(!0)}s.on("pinchmove",t),s.on("pinchend",n),s.on("pinchcancel",n)})}c&&t.on("drag.move",function(e){var t=e.originalEvent;if(t&&!(t instanceof MouseEvent)){var n=sr(t),o=p(document.elementFromPoint(n.x,n.y)),r=o&&a.get(o);r!==e.hover&&(e.hover&&c.out(e),r&&(c.hover({element:r,gfx:o}),e.hover=r,e.hoverGfx=o))}}),r&&t.on("contextPad.create",function(e){var t=ai(e.pad.html);t.on("panstart",function(e){r.trigger("dragstart",e,!0)}),t.on("press",function(e){r.trigger("dragstart",e,!0)}),t.on("tap",function(e){r.trigger("click",e)})}),u&&t.on("palette.create",function(e){var t=ai(e.container);t.on("panstart",function(e){u.trigger("dragstart",e,!0)}),t.on("press",function(e){u.trigger("dragstart",e,!0)}),t.on("tap",function(e){u.trigger("click",e)})}),t.on("canvas.init",function(e){f(e.svg)})}function ci(e,t){var n=this;t.on("canvas.init",function(e){n.addBBoxMarker(e.svg)})}si.$inject=["injector","canvas","eventBus","elementRegistry","interactionEvents","touchFix"],ci.$inject=["canvas","eventBus"],ci.prototype.addBBoxMarker=function(e){var t={fill:"none",class:"outer-bound-marker"},n=Dn("rect");wn(n,{x:-1e4,y:1e4,width:10,height:10}),wn(n,t),mn(e,n);var o=Dn("rect");wn(o,{x:1e4,y:1e4,width:10,height:10}),wn(o,t),mn(e,o)};var ui={__depends__:[{__depends__:[fr],__init__:["touchInteractionEvents"],touchInteractionEvents:["type",si],touchFix:["type",ci]}]};function li(e){$r.call(this,e)}en(li,$r),li.prototype._modules=[].concat(li.prototype._modules,li.prototype._navigationModules=[Kr,ti,ui]);var pi=Math.round,fi="djs-drag-active";function di(e){e.preventDefault()}function hi(p,f,d){var h,y={threshold:5,trapClick:!0};function v(e){var t=f.viewbox(),n=f._container.getBoundingClientRect();return{x:t.x+(e.x-n.left)/t.scale,y:t.y+(e.y-n.top)/t.scale}}function m(e,t){t=t||h;var n=p.createEvent(R({},t.payload,t.data,{isTouch:t.isTouch}));return!1!==p.fire("drag."+e,n)&&p.fire(t.prefix+"."+e,n)}function g(e,t){var n,o=h.payload,r=h.displacement,i=h.globalStart,a=sr(e),s=Ur(a,i),c=h.localStart,u=v(a),l=Ur(u,c);if(!h.active&&(t||(n=s,Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2))>h.threshold))){if(R(o,{x:pi(c.x+r.x),y:pi(c.y+r.y),dx:0,dy:0},{originalEvent:e}),!1===m("start"))return k();h.active=!0,h.keepSelection||(o.previousSelection=d.get(),d.select(null)),h.cursor&&Zr(h.cursor),f.addMarker(f.getRootElement(),fi)}ar(e),h.active&&(R(o,{x:pi(u.x+r.x),y:pi(u.y+r.y),dx:pi(l.x),dy:pi(l.y)},{originalEvent:e}),m("move"))}function b(e){var t=!0;h.active&&(e&&ar(h.payload.originalEvent=e),t=m("end")),!1===t&&m("rejected"),m("ended",o(!0!==t))}function _(e){27===e.which&&(di(e),k())}function w(e){var t;h.active&&(t=Qr(p),setTimeout(t,400),di(e)),b(e)}function x(e){g(e)}function C(e){var t=h.payload;t.hoverGfx=e.gfx,t.hover=e.element,m("hover")}function E(e){m("out");var t=h.payload;t.hoverGfx=null,t.hover=null}function k(e){var t;if(h){var n=h.active;n&&m("cancel"),t=o(e),n&&m("canceled",t)}}function o(e){var t,n;m("cleanup"),Yr(),n=h.trapClick?w:b,gt.unbind(document,"mousemove",g),gt.unbind(document,"dragstart",di),gt.unbind(document,"selectstart",di),gt.unbind(document,"mousedown",n,!0),gt.unbind(document,"mouseup",n,!0),gt.unbind(document,"keyup",_),gt.unbind(document,"touchstart",x,!0),gt.unbind(document,"touchcancel",k,!0),gt.unbind(document,"touchmove",g,!0),gt.unbind(document,"touchend",b,!0),p.off("element.hover",C),p.off("element.out",E),f.removeMarker(f.getRootElement(),fi);var o=h.payload.previousSelection;return!1!==e&&o&&!d.get().length&&d.select(o),t=h,h=null,t}p.on("diagram.destroy",k),this.init=function(e,t,n,o){h&&k(!1),"string"==typeof t&&(o=n,n=t,t=null);var r,i,a,s,c,u,l=(o=R({},y,o||{})).data||{};s=o.trapClick?w:b,e?(r=ir(e)||e,i=sr(e),ar(e),"dragstart"===r.type&&di(r)):(r=null,i={x:0,y:0}),a=v(i),t||(t=a),u=r,c="undefined"!=typeof TouchEvent&&u instanceof TouchEvent,h=R({prefix:n,data:l,payload:{},globalStart:i,displacement:Ur(t,a),localStart:a,isTouch:c},o),o.manual||(c?(gt.bind(document,"touchstart",x,!0),gt.bind(document,"touchcancel",k,!0),gt.bind(document,"touchmove",g,!0),gt.bind(document,"touchend",b,!0)):(gt.bind(document,"mousemove",g),gt.bind(document,"dragstart",di),gt.bind(document,"selectstart",di),gt.bind(document,"mousedown",s,!0),gt.bind(document,"mouseup",s,!0)),gt.bind(document,"keyup",_),p.on("element.hover",C),p.on("element.out",E)),m("init"),o.autoActivate&&g(e,!0)},this.move=g,this.hover=C,this.out=E,this.end=b,this.cancel=k,this.context=function(){return h},this.setOptions=function(e){R(y,e)}}function yi(t,a,s){var n=this;t.on("drag.start",function(e){t.once("drag.move",function(){t.once("drag.move",function(e){n.ensureHover(e)})})}),this.ensureHover=function(e){if(!e.hover){var t,n,o,r,i=e.originalEvent;if(i instanceof MouseEvent)t=sr(i),n=document.elementFromPoint(t.x,t.y),(r=ht(n,"svg, .djs-element",!0))&&(o=s.get(r),a.hover({element:o,gfx:r}))}}}hi.$inject=["eventBus","canvas","selection"],yi.$inject=["eventBus","dragging","elementRegistry"];var vi={__init__:["hoverFix"],__depends__:[br],dragging:["type",hi],hoverFix:["type",yi]};function mi(e){this._commandStack=e.get("commandStack",!1)}mi.$inject=["injector"],mi.prototype.allowed=function(e,t){var n=!0,o=this._commandStack;return o&&(n=o.canExecute(e,t)),void 0===n||n};var gi={__init__:["rules"],rules:["type",mi]};function bi(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function _i(e,t,n,o){if(void 0===o&&(o=5),!e||!t||!n)return!1;var r=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),i=bi(e,t);return Math.abs(r/i)<=o}var wi=2;function xi(e,t){return Math.abs(e.x-t.x)<=wi?"h":Math.abs(e.y-t.y)<=wi&&"v"}function Ci(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}var Ei="djs-bendpoint",ki="djs-segment-dragger";function Si(e,t){var n=Dn("g");Sn(n).add(Ei),mn(e,n);var o=Dn("circle");wn(o,{cx:0,cy:0,r:4}),Sn(o).add("djs-visual"),mn(n,o);var r=Dn("circle");return wn(r,{cx:0,cy:0,r:10}),Sn(r).add("djs-hit"),mn(n,r),t&&Sn(n).add(t),n}function Oi(e,t,n){var o=Dn("g");mn(e,o);var r=Dn("rect");wn(r,{x:-7,y:-1.5,width:14,height:3}),Sn(r).add("djs-visual"),mn(o,r);var i,a,s,c=Dn("rect");return wn(c,{x:-10,y:-4.5,width:20,height:9}),Sn(c).add("djs-hit"),mn(o,c),i=o,a="h"===n?90:0,(s=In()).setRotate(a,0,0),Hn(i,s),o}function ji(e,t,n){var o=Dn("g"),r=Ci(t,n),i=xi(t,n);return mn(e,o),Oi(o,0,i),Sn(o).add(ki),Sn(o).add("h"===i?"vertical":"horizontal"),Do(o,r.x,r.y),o}var Pi=e(function(e,t){var n,o,r="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};n=Z,o=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var t,n=String(e),o=n.length,r=-1,i="",a=n.charCodeAt(0);++r<o;)0!=(t=n.charCodeAt(r))?i+=1<=t&&t<=31||127==t||0==r&&48<=t&&t<=57||1==r&&48<=t&&t<=57&&45==a?"\\"+t.toString(16)+" ":(0!=r||1!=o||45!=t)&&(128<=t||45==t||95==t||48<=t&&t<=57||65<=t&&t<=90||97<=t&&t<=122)?n.charAt(r):"\\"+n.charAt(r):i+="�";return i};return e.CSS||(e.CSS={}),e.CSS.escape=t},"object"==r(t)?e.exports=o(n):o(n)}),Ti="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},Ri="hasOwnProperty",Ai=/,?([a-z]),?/gi,Di=parseFloat,Mi=Math,Bi=Mi.PI,Ii=Mi.min,Ni=Mi.max,Vi=Mi.pow,Li=Mi.abs,$i=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/gi,Fi=/(-?\d*\.?\d*(?:e[-+]?\\d+)?)[\s]*,?[\s]*/gi; 47/** 48 * This file contains portions that got extraced from Snap.svg (licensed Apache-2.0). 49 * 50 * @see https://github.com/adobe-webplatform/Snap.svg/blob/master/src/path.js 51 */function Ui(e,t){return"finite"==(t=String.prototype.toLowerCase.call(t))?isFinite(e):!("array"!=t||!(e instanceof Array||Array.isArray&&Array.isArray(e)))||("null"==t&&null===e||t==(void 0===e?"undefined":Ti(e))&&null!==e||"object"==t&&e===Object(e)||Object.prototype.toString.call(e).slice(8,-1).toLowerCase()==t)}function zi(e){if("function"==typeof e||Object(e)!==e)return e;var t=new e.constructor;for(var n in e)e[Ri](n)&&(t[n]=zi(e[n]));return t}function Wi(t){var n=Wi.ps=Wi.ps||{};return n[t]?n[t].sleep=100:n[t]={sleep:100},setTimeout(function(){for(var e in n)n[Ri](e)&&e!=t&&(n[e].sleep--,!n[e].sleep&&delete n[e])}),n[t]}function Hi(e,t,n,o){return null==e&&(e=t=n=o=0),null==t&&(t=e.y,n=e.width,o=e.height,e=e.x),{x:e,y:t,width:n,w:n,height:o,h:o,x2:e+n,y2:t+o,cx:e+n/2,cy:t+o/2,r1:Mi.min(n,o)/2,r2:Mi.max(n,o)/2,r0:Mi.sqrt(n*n+o*o)/2,path:function(e,t,n,o,r){if(r)return[["M",+e+ +r,t],["l",n-2*r,0],["a",r,r,0,0,1,r,r],["l",0,o-2*r],["a",r,r,0,0,1,-r,r],["l",2*r-n,0],["a",r,r,0,0,1,-r,-r],["l",0,2*r-o],["a",r,r,0,0,1,r,-r],["z"]];var i=[["M",e,t],["l",n,0],["l",0,o],["l",-n,0],["z"]];return i.toString=Gi,i}(e,t,n,o),vb:[e,t,n,o].join(" ")}}function Gi(){return this.join(",").replace(Ai,"$1")}function qi(e){var t=zi(e);return t.toString=Gi,t}function Ki(e,t,n,o,r,i,a,s,c){var u=1-c,l=Vi(u,3),p=Vi(u,2),f=c*c,d=f*c,h=e+2*c*(n-e)+f*(r-2*n+e),y=t+2*c*(o-t)+f*(i-2*o+t),v=n+2*c*(r-n)+f*(a-2*r+n),m=o+2*c*(i-o)+f*(s-2*i+o);return{x:l*e+3*p*c*n+3*u*c*c*r+d*a,y:l*t+3*p*c*o+3*u*c*c*i+d*s,m:{x:h,y:y},n:{x:v,y:m},start:{x:u*e+c*n,y:u*t+c*o},end:{x:u*r+c*a,y:u*i+c*s},alpha:90-180*Mi.atan2(h-v,y-m)/Bi}}function Xi(e,t,n,o,r,i,a,s){Ui(e,"array")||(e=[e,t,n,o,r,i,a,s]);var c=function(e,t,n,o,r,i,a,s){for(var c,u,l,p,f,d,h,y,v=[],m=[[],[]],g=0;g<2;++g)if(l=0==g?(u=6*e-12*n+6*r,c=-3*e+9*n-9*r+3*a,3*n-3*e):(u=6*t-12*o+6*i,c=-3*t+9*o-9*i+3*s,3*o-3*t),Li(c)<1e-12){if(Li(u)<1e-12)continue;0<(p=-l/u)&&p<1&&v.push(p)}else h=u*u-4*l*c,y=Mi.sqrt(h),h<0||(0<(f=(-u+y)/(2*c))&&f<1&&v.push(f),0<(d=(-u-y)/(2*c))&&d<1&&v.push(d));var b,_=v.length,w=_;for(;_--;)p=v[_],b=1-p,m[0][_]=b*b*b*e+3*b*b*p*n+3*b*p*p*r+p*p*p*a,m[1][_]=b*b*b*t+3*b*b*p*o+3*b*p*p*i+p*p*p*s;return m[0][w]=e,m[1][w]=t,m[0][w+1]=a,m[1][w+1]=s,m[0].length=m[1].length=w+2,{min:{x:Ii.apply(0,m[0]),y:Ii.apply(0,m[1])},max:{x:Ni.apply(0,m[0]),y:Ni.apply(0,m[1])}}}.apply(null,e);return Hi(c.min.x,c.min.y,c.max.x-c.min.x,c.max.y-c.min.y)}function Zi(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Yi(e,t,n,o,r){return e*(e*(-3*t+9*n-9*o+3*r)+6*t-12*n+6*o)-3*t+3*n}function Ji(e,t,n,o,r,i,a,s,c){null==c&&(c=1);for(var u=(c=1<c?1:c<0?0:c)/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=u*l[d]+u,y=Yi(h,e,n,r,a),v=Yi(h,t,o,i,s),m=y*y+v*v;f+=p[d]*Mi.sqrt(m)}return u*f}function Qi(e,t,n,o,r,i,a,s){if(!(Ni(e,n)<Ii(r,a)||Ii(e,n)>Ni(r,a)||Ni(t,o)<Ii(i,s)||Ii(t,o)>Ni(i,s))){var c=(e-n)*(i-s)-(t-o)*(r-a);if(c){var u=((e*o-t*n)*(r-a)-(e-n)*(r*s-i*a))/c,l=((e*o-t*n)*(i-s)-(t-o)*(r*s-i*a))/c,p=+u.toFixed(2),f=+l.toFixed(2);if(!(p<+Ii(e,n).toFixed(2)||p>+Ni(e,n).toFixed(2)||p<+Ii(r,a).toFixed(2)||p>+Ni(r,a).toFixed(2)||f<+Ii(t,o).toFixed(2)||f>+Ni(t,o).toFixed(2)||f<+Ii(i,s).toFixed(2)||f>+Ni(i,s).toFixed(2)))return{x:u,y:l}}}}function ea(e,t,n){var o,r,i=Xi(e),a=Xi(t);if(r=a,o=Hi(o=i),!(Zi(r=Hi(r),o.x,o.y)||Zi(r,o.x2,o.y)||Zi(r,o.x,o.y2)||Zi(r,o.x2,o.y2)||Zi(o,r.x,r.y)||Zi(o,r.x2,r.y)||Zi(o,r.x,r.y2)||Zi(o,r.x2,r.y2)||(o.x<r.x2&&o.x>r.x||r.x<o.x2&&r.x>o.x)&&(o.y<r.y2&&o.y>r.y||r.y<o.y2&&r.y>o.y)))return n?0:[];for(var s=~~(Ji.apply(0,e)/5),c=~~(Ji.apply(0,t)/5),u=[],l=[],p={},f=n?0:[],d=0;d<s+1;d++){var h=Ki.apply(0,e.concat(d/s));u.push({x:h.x,y:h.y,t:d/s})}for(d=0;d<c+1;d++)h=Ki.apply(0,t.concat(d/c)),l.push({x:h.x,y:h.y,t:d/c});for(d=0;d<s;d++)for(var y=0;y<c;y++){var v=u[d],m=u[d+1],g=l[y],b=l[y+1],_=Li(m.x-v.x)<.01?"y":"x",w=Li(b.x-g.x)<.01?"y":"x",x=Qi(v.x,v.y,m.x,m.y,g.x,g.y,b.x,b.y);if(x){if(p[x.x.toFixed(0)]==x.y.toFixed(0))continue;p[x.x.toFixed(0)]=x.y.toFixed(0);var C=v.t+Li((x[_]-v[_])/(m[_]-v[_]))*(m.t-v.t),E=g.t+Li((x[w]-g[w])/(b[w]-g[w]))*(b.t-g.t);0<=C&&C<=1&&0<=E&&E<=1&&(n?f++:f.push({x:x.x,y:x.y,t1:C,t2:E}))}}return f}function ta(e,t,n,o,r){if(null==r&&null==o&&(o=n),e=+e,t=+t,n=+n,o=+o,null!=r)var i=Math.PI/180,a=e+n*Math.cos(-o*i),s=e+n*Math.cos(-r*i),c=[["M",a,t+n*Math.sin(-o*i)],["A",n,n,0,+(180<r-o),0,s,t+n*Math.sin(-r*i)]];else c=[["M",e,t],["m",0,-o],["a",n,o,0,1,1,0,2*o],["a",n,o,0,1,1,0,-2*o],["z"]];return c.toString=Gi,c}function na(e){var t=Wi(e);if(t.abs)return qi(t.abs);if(Ui(e,"array")&&Ui(e&&e[0],"array")||(e=function(e){if(!e)return null;var t=Wi(e);if(t.arr)return zi(t.arr);var i={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},a=[];return Ui(e,"array")&&Ui(e[0],"array")&&(a=zi(e)),a.length||String(e).replace($i,function(e,t,n){var o=[],r=t.toLowerCase();if(n.replace(Fi,function(e,t){t&&o.push(+t)}),"m"==r&&2<o.length&&(a.push([t].concat(o.splice(0,2))),r="l",t="m"==t?"l":"L"),"o"==r&&1==o.length&&a.push([t,o[0]]),"r"==r)a.push([t].concat(o));else for(;o.length>=i[r]&&(a.push([t].concat(o.splice(0,i[r]))),i[r]););}),a.toString=Wi.toString,t.arr=zi(a),a}(e)),!e||!e.length)return[["M",0,0]];var n,o=[],r=0,i=0,a=0,s=0,c=0;"M"==e[0][0]&&(a=r=+e[0][1],s=i=+e[0][2],c++,o[0]=["M",r,i]);for(var u,l,p=3==e.length&&"M"==e[0][0]&&"R"==e[1][0].toUpperCase()&&"Z"==e[2][0].toUpperCase(),f=c,d=e.length;f<d;f++){if(o.push(u=[]),(n=(l=e[f])[0])!=n.toUpperCase())switch(u[0]=n.toUpperCase(),u[0]){case"A":u[1]=l[1],u[2]=l[2],u[3]=l[3],u[4]=l[4],u[5]=l[5],u[6]=+l[6]+r,u[7]=+l[7]+i;break;case"V":u[1]=+l[1]+i;break;case"H":u[1]=+l[1]+r;break;case"R":for(var h=[r,i].concat(l.slice(1)),y=2,v=h.length;y<v;y++)h[y]=+h[y]+r,h[++y]=+h[y]+i;o.pop(),o=o.concat(aa(h,p));break;case"O":o.pop(),(h=ta(r,i,l[1],l[2])).push(h[0]),o=o.concat(h);break;case"U":o.pop(),o=o.concat(ta(r,i,l[1],l[2],l[3])),u=["U"].concat(o[o.length-1].slice(-2));break;case"M":a=+l[1]+r,s=+l[2]+i;default:for(y=1,v=l.length;y<v;y++)u[y]=+l[y]+(y%2?r:i)}else if("R"==n)h=[r,i].concat(l.slice(1)),o.pop(),o=o.concat(aa(h,p)),u=["R"].concat(l.slice(-2));else if("O"==n)o.pop(),(h=ta(r,i,l[1],l[2])).push(h[0]),o=o.concat(h);else if("U"==n)o.pop(),o=o.concat(ta(r,i,l[1],l[2],l[3])),u=["U"].concat(o[o.length-1].slice(-2));else for(var m=0,g=l.length;m<g;m++)u[m]=l[m];if("O"!=(n=n.toUpperCase()))switch(u[0]){case"Z":r=+a,i=+s;break;case"H":r=u[1];break;case"V":i=u[1];break;case"M":a=u[u.length-2],s=u[u.length-1];default:r=u[u.length-2],i=u[u.length-1]}}return o.toString=Gi,t.abs=qi(o),o}function oa(e,t,n,o){return[e,t,n,o,n,o]}function ra(e,t,n,o,r,i){return[1/3*e+2/3*n,1/3*t+2/3*o,1/3*r+2/3*n,1/3*i+2/3*o,r,i]}function ia(e,t,n,o,r,i,a,s,c,u){var l,p,f,d,h=120*Bi/180,y=Bi/180*(+r||0),v=[],m=(p=function(e,t,n){return{x:e*Mi.cos(n)-t*Mi.sin(n),y:e*Mi.sin(n)+t*Mi.cos(n)}},function e(){var t=Array.prototype.slice.call(arguments,0),n=t.join("␀"),o=e.cache=e.cache||{},r=e.count=e.count||[];return o[Ri](n)?function(e,t){for(var n=0,o=e.length;n<o;n++)if(e[n]===t)return e.push(e.splice(n,1)[0])}(r,n):(1e3<=r.length&&delete o[r.shift()],r.push(n),o[n]=p.apply(f,t)),d?d(o[n]):o[n]});if(u)S=u[0],O=u[1],E=u[2],k=u[3];else{e=(l=m(e,t,-y)).x,t=l.y;var g=(e-(s=(l=m(s,c,-y)).x))/2,b=(t-(c=l.y))/2,_=g*g/(n*n)+b*b/(o*o);1<_&&(n*=_=Mi.sqrt(_),o*=_);var w=n*n,x=o*o,C=(i==a?-1:1)*Mi.sqrt(Li((w*x-w*b*b-x*g*g)/(w*b*b+x*g*g))),E=C*n*b/o+(e+s)/2,k=C*-o*g/n+(t+c)/2,S=Mi.asin(((t-k)/o).toFixed(9)),O=Mi.asin(((c-k)/o).toFixed(9));(S=e<E?Bi-S:S)<0&&(S=2*Bi+S),(O=s<E?Bi-O:O)<0&&(O=2*Bi+O),a&&O<S&&(S-=2*Bi),!a&&S<O&&(O-=2*Bi)}var j=O-S;if(Li(j)>h){var P=O,T=s,R=c;O=S+h*(a&&S<O?1:-1),v=ia(s=E+n*Mi.cos(O),c=k+o*Mi.sin(O),n,o,r,0,a,T,R,[O,P,E,k])}j=O-S;var A=Mi.cos(S),D=Mi.sin(S),M=Mi.cos(O),B=Mi.sin(O),I=Mi.tan(j/4),N=4/3*n*I,V=4/3*o*I,L=[e,t],$=[e+N*D,t-V*A],F=[s+N*B,c-V*M],U=[s,c];if($[0]=2*L[0]-$[0],$[1]=2*L[1]-$[1],u)return[$,F,U].concat(v);for(var z=[],W=0,H=(v=[$,F,U].concat(v).join().split(",")).length;W<H;W++)z[W]=W%2?m(v[W-1],v[W],y).y:m(v[W],v[W+1],y).x;return z}function aa(e,t){for(var n=[],o=0,r=e.length;o<r-2*!t;o+=2){var i=[{x:+e[o-2],y:+e[o-1]},{x:+e[o],y:+e[o+1]},{x:+e[o+2],y:+e[o+3]},{x:+e[o+4],y:+e[o+5]}];t?o?r-4==o?i[3]={x:+e[0],y:+e[1]}:r-2==o&&(i[2]={x:+e[0],y:+e[1]},i[3]={x:+e[2],y:+e[3]}):i[0]={x:+e[r-2],y:+e[r-1]}:r-4==o?i[3]=i[2]:o||(i[0]={x:+e[o],y:+e[o+1]}),n.push(["C",(-i[0].x+6*i[1].x+i[2].x)/6,(-i[0].y+6*i[1].y+i[2].y)/6,(i[1].x+6*i[2].x-i[3].x)/6,(i[1].y+6*i[2].y-i[3].y)/6,i[2].x,i[2].y])}return n}function sa(e,t){var n=!t&&Wi(e);if(!t&&n.curve)return qi(n.curve);for(var i=na(e),a=t&&na(t),o={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},r={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s=function(e,t,n){var o,r;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(ia.apply(0,[t.x,t.y].concat(e.slice(1))));break;case"S":r="C"==n||"S"==n?(o=2*t.x-t.bx,2*t.y-t.by):(o=t.x,t.y),e=["C",o,r].concat(e.slice(1));break;case"T":t.qy="Q"==n||"T"==n?(t.qx=2*t.x-t.qx,2*t.y-t.qy):(t.qx=t.x,t.y),e=["C"].concat(ra(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(ra(t.x,t.y,e[1],e[2],e[3],e[4]));break;case"L":e=["C"].concat(oa(t.x,t.y,e[1],e[2]));break;case"H":e=["C"].concat(oa(t.x,t.y,e[1],t.y));break;case"V":e=["C"].concat(oa(t.x,t.y,t.x,e[1]));break;case"Z":e=["C"].concat(oa(t.x,t.y,t.X,t.Y))}return e},c=function(e,t){if(7<e[t].length){e[t].shift();for(var n=e[t];n.length;)l[t]="A",a&&(p[t]="A"),e.splice(t++,0,["C"].concat(n.splice(0,6)));e.splice(t,1),y=Ni(i.length,a&&a.length||0)}},u=function(e,t,n,o,r){e&&t&&"M"==e[r][0]&&"M"!=t[r][0]&&(t.splice(r,0,["M",o.x,o.y]),n.bx=0,n.by=0,n.x=e[r][1],n.y=e[r][2],y=Ni(i.length,a&&a.length||0))},l=[],p=[],f="",d="",h=0,y=Ni(i.length,a&&a.length||0);h<y;h++){i[h]&&(f=i[h][0]),"C"!=f&&(l[h]=f,h&&(d=l[h-1])),i[h]=s(i[h],o,d),"A"!=l[h]&&"C"==f&&(l[h]="C"),c(i,h),a&&(a[h]&&(f=a[h][0]),"C"!=f&&(p[h]=f,h&&(d=p[h-1])),a[h]=s(a[h],r,d),"A"!=p[h]&&"C"==f&&(p[h]="C"),c(a,h)),u(i,a,o,r,h),u(a,i,r,o,h);var v=i[h],m=a&&a[h],g=v.length,b=a&&m.length;o.x=v[g-2],o.y=v[g-1],o.bx=Di(v[g-4])||o.x,o.by=Di(v[g-3])||o.y,r.bx=a&&(Di(m[b-4])||r.x),r.by=a&&(Di(m[b-3])||r.y),r.x=a&&m[b-2],r.y=a&&m[b-1]}return a||(n.curve=qi(i)),a?[i,a]:i}var ca=function(e,t,n){e=sa(e),t=sa(t);for(var o,r,i,a,s,c,u,l,p,f,d=n?0:[],h=0,y=e.length;h<y;h++){var v=e[h];if("M"==v[0])o=s=v[1],r=c=v[2];else{r="C"==v[0]?(o=(p=[o,r].concat(v.slice(1)))[6],p[7]):(p=[o,r,o,r,s,c,s,c],o=s,c);for(var m=0,g=t.length;m<g;m++){var b=t[m];if("M"==b[0])i=u=b[1],a=l=b[2];else{a="C"==b[0]?(i=(f=[i,a].concat(b.slice(1)))[6],f[7]):(f=[i,a,i,a,u,l,u,l],i=u,l);var _=ea(p,f,n);if(n)d+=_;else{for(var w=0,x=_.length;w<x;w++)_[w].segment1=h,_[w].segment2=m,_[w].bez1=p,_[w].bez2=f;d=d.concat(_)}}}}}return d},ua=Math.round,la=Math.max;var pa=10;function fa(e,t){return function(e,t){var n,o;for(n=0;o=e[n];n++)if(bi(o,t)<=pa)return{point:e[n],bendpoint:!0,index:n};return null}(e,t)||(n=e,s=ca((i=pa,[["M",(r=t).x,r.y],["m",0,-i],["a",i,i,0,1,1,0,2*i],["a",i,i,0,1,1,0,-2*i],["z"]]),(o=[],n.forEach(function(e,t){o.push([0===t?"M":"L",e.x,e.y])}),o)),c=s[0],u=s[s.length-1],c?c!==u?c.segment2!==u.segment2?{point:n[a=la(c.segment2,u.segment2)-1],bendpoint:!0,index:a}:{point:{x:ua(c.x+u.x)/2,y:ua(c.y+u.y)/2},index:c.segment2}:{point:{x:ua(c.x),y:ua(c.y)},index:c.segment2}:null);var n,o,r,i,a,s,c,u}function da(e,r,o,y,v){function m(e,t){return fa(e,function(e,t){var n,o=sr(t),r=e._container.getBoundingClientRect();n={x:r.left,y:r.top};var i=e.viewbox();return{x:i.x+(o.x-n.x)/i.scale,y:i.y+(o.y-n.y)/i.scale}}(r,t))}function i(e,t){var n,o,r,i,a,s,c,u,l,p,f,d=t.waypoints,h=m(d,e);if(h)return o=d,r=10,p=(n=h).index,f=n.point,!(p<=0||n.bendpoint)&&(s=Ci(i=o[p-1],a=o[p]),c=xi(i,a),u=Math.abs(f.x-s.x),l=Math.abs(f.y-s.y),c&&u<=r&&l<=r)?v.start(e,t,h.index):y.start(e,t,h.index,!h.bendpoint),!0}function a(e,t,n){gt.bind(e,t,function(e){o.triggerMouseEvent(t,e,n),e.stopPropagation()})}function s(e,t){var n=r.getLayer("overlays"),o=Ot('.djs-bendpoints[data-element-id="'+Pi(e.id)+'"]',n);return!o&&t&&(wn(o=Dn("g"),{"data-element-id":e.id}),Sn(o).add("djs-bendpoints"),mn(n,o),a(o,"mousedown",e),a(o,"click",e),a(o,"dblclick",e)),o}function n(o,e){e.waypoints.forEach(function(e,t){var n=Si(o);mn(o,n),Do(n,e.x,e.y)}),Si(o,"floating")}function c(e,t){for(var n,o,r=t.waypoints,i=1;i<r.length;i++)xi(n=r[i-1],o=r[i])&&ji(e,n,o)}function u(e){var t=s(e);return t||(n(t=s(e,!0),e),c(t,e)),t}function t(e){var t=s(e);t&&(w(jt("."+ki,t),function(e){jn(e)}),w(jt("."+Ei,t),function(e){jn(e)}),c(t,e),n(t,e))}e.on("connection.changed",function(e){t(e.element)}),e.on("connection.remove",function(e){var t=s(e.element);t&&jn(t)}),e.on("element.marker.update",function(e){var t,n=e.element;n.waypoints&&(t=u(n),e.add?Sn(t).add(e.marker):Sn(t).remove(e.marker))}),e.on("element.mousemove",function(e){var t,n,o=e.element,r=o.waypoints;if(r){if(!(t=Ot(".floating",s(o,!0))))return;(n=m(r,e.originalEvent))&&Do(t,n.point.x,n.point.y)}}),e.on("element.mousedown",function(e){var t=e.originalEvent,n=e.element,o=n.waypoints;if(o)return i(t,n)}),e.on("selection.changed",function(e){var t=e.newSelection[0];t&&t.waypoints&&u(t)}),e.on("element.hover",function(e){var t=e.element;t.waypoints&&(u(t),o.registerEvent(e.gfx,"mousemove","element.mousemove"))}),e.on("element.out",function(e){o.unregisterEvent(e.gfx,"mousemove","element.mousemove")}),e.on("element.updateId",function(e){var t=e.element,n=e.newId;if(t.waypoints){var o=s(t);o&&wn(o,{"data-element-id":n})}}),this.addHandles=u,this.updateHandles=t,this.getBendpointsContainer=s}da.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];var ha="connect-ok",ya="connect-not-ok",va="connect-hover",ma="djs-updating",ga="connection.updateWaypoints",ba="connection.reconnectStart",_a="connection.reconnectEnd",wa=Math.round;function xa(e,t,s,c,n,o,u){var a=e.get("connectionDocking",!1);function l(e){n.update("connection",e.connection,e.connectionGfx)}this.start=function(e,t,n,o){var r,i=t.waypoints,a=s.getGraphics(t);r={connection:t,bendpointIndex:n,insert:o,type:o||0!==n?o||n!==i.length-1?ga:_a:ba},c.init(e,"bendpoint.move",{data:{connection:t,connectionGfx:a,context:r}})},t.on("bendpoint.move.start",function(e){var t=e.context,n=t.connection,o=n.waypoints,r=o.slice(),i=t.insert,a=t.bendpointIndex;t.originalWaypoints=o,i&&r.splice(a,0,null),n.waypoints=r,t.draggerGfx=Si(s.getLayer("overlays")),Sn(t.draggerGfx).add("djs-dragging"),s.addMarker(n,ma)}),t.on("bendpoint.move.hover",function(e){var t=e.context;if(t.hover=e.hover,e.hover){s.addMarker(e.hover,va);var n=t.allowed=o.allowed(t.type,t);n?(s.removeMarker(t.hover,ya),s.addMarker(t.hover,ha),t.target=t.hover):!1===n&&(s.removeMarker(t.hover,ha),s.addMarker(t.hover,ya),t.target=null)}}),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],function(e){var t=e.context.hover;t&&(s.removeMarker(t,va),s.removeMarker(t,e.context.target?ha:ya))}),t.on("bendpoint.move.move",function(e){var t,n,o=e.context,r=o.type,i=e.connection;i.waypoints[o.bendpointIndex]={x:e.x,y:e.y},a&&(o.hover&&(r===ba&&(t=o.hover),r===_a&&(n=o.hover)),i.waypoints=a.getCroppedWaypoints(i,t,n)),Do(o.draggerGfx,e.x,e.y),l(e)}),t.on(["bendpoint.move.end","bendpoint.move.cancel"],function(e){var t=e.context,n=t.hover,o=t.connection;jn(t.draggerGfx),t.newWaypoints=o.waypoints.slice(),o.waypoints=t.originalWaypoints,s.removeMarker(o,ma),n&&(s.removeMarker(n,ha),s.removeMarker(n,ya))}),t.on("bendpoint.move.end",function(e){var t,n=e.context,o=n.newWaypoints,r=n.bendpointIndex,i=o[r],a=n.allowed;if(i.x=wa(i.x),i.y=wa(i.y),a&&n.type===ba)u.reconnectStart(n.connection,n.target,i);else if(a&&n.type===_a)u.reconnectEnd(n.connection,n.target,i);else{if(!1===a||n.type!==ga)return l(e),!1;t={bendpointMove:{insert:e.context.insert,bendpointIndex:r}},u.updateWaypoints(n.connection,function(e){e=e.slice();for(var t,n,o,r=0;e[r];)t=e[r],n=e[r-1],0===bi(t,o=e[r+1])||_i(n,o,t)?e.splice(r,1):r++;return e}(o),t)}}),t.on("bendpoint.move.cancel",function(e){l(e)})}function Ca(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function Ea(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function ka(e){return Ca({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function Sa(e,t,n){_(n=n||0)||(n={x:n,y:n});var o=Ea(e),r=Ea(t),i=o.bottom+n.y<=r.top,a=o.left-n.x>=r.right,s=o.top-n.y>=r.bottom,c=i?"top":s?"bottom":null,u=o.right+n.x<=r.left?"left":a?"right":null;return u&&c?c+"-"+u:u||c||"intersect"}function Oa(e,t,n){var o=ca(e,t);return 1===o.length?Ca(o[0]):2===o.length&&bi(o[0],o[1])<1?Ca(o[0]):1<o.length?Ca((o=C(o,function(e){var t=Math.floor(100*e.t2)||1;return t=((t=100-t)<10?"0":"")+t,e.segment2+"#"+t}))[n?0:o.length-1]):null}xa.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","rules","modeling"];var ja="connect-hover",Pa="djs-updating";function Ta(e,t,n){return Ra(e,t,e[t]+n)}function Ra(e,t,n){return{x:"x"===t?n:e.x,y:"y"===t?n:e.y}}function Aa(e){return"x"===e?"y":"x"}function Da(e,t,n){var o,r;return e.original?e.original:(o=ka(t),Ra(e,r=Aa(n),o[r]))}function Ma(e,t,f,d,n,o,h){var r=e.get("connectionDocking",!1);function y(e,t){if(!r)return t;var n,o=e.waypoints;return e.waypoints=t,n=r.getCroppedWaypoints(e),e.waypoints=o,n}function v(e){n.update("connection",e.connection,e.connectionGfx)}function m(e,t,n){var o,r,i,a,s,c,u=e.newWaypoints,l=u[e.segmentStartIndex+t],p=u[e.segmentEndIndex+t],f=Aa(e.axis),d=(o=n,r=l,i=p,a=f,s=Math.max(r[a],i[a]),c=Math.min(r[a],i[a]),Ra(r,a,Math.min(Math.max(c+20,o[a]),s-20)));Do(e.draggerGfx,d.x,d.y)}this.start=function(e,t,n){var o,r,i,a=f.getGraphics(t),s=n-1,c=n,u=t.waypoints,l=u[s],p=u[c];(r=xi(l,p))&&(i="v"===r?"y":"x",0===s&&(l=Da(l,t.source,i)),c===u.length-1&&(p=Da(p,t.target,i)),o={connection:t,segmentStartIndex:s,segmentEndIndex:c,segmentStart:l,segmentEnd:p,axis:i},d.init(e,{x:(l.x+p.x)/2,y:(l.y+p.y)/2},"connectionSegment.move",{cursor:"x"===i?"resize-ew":"resize-ns",data:{connection:t,connectionGfx:a,context:o}}))},t.on("connectionSegment.move.start",function(e){var t=e.context,n=e.connection,o=f.getLayer("overlays");t.originalWaypoints=n.waypoints.slice(),t.draggerGfx=ji(o,t.segmentStart,t.segmentEnd),Sn(t.draggerGfx).add("djs-dragging"),f.addMarker(n,Pa)}),t.on("connectionSegment.move.move",function(e){var t,n,o=e.context,r=o.connection,i=o.segmentStartIndex,a=o.segmentEndIndex,s=o.segmentStart,c=o.segmentEnd,u=o.axis,l=o.originalWaypoints.slice(),p=Ta(s,u,e["d"+u]),f=Ta(c,u,e["d"+u]),d=l.length,h=0;l[i]=p,l[a]=f,i<2&&(t=Sa(r.source,p),1===i?"intersect"===t&&(l.shift(),l[0]=p,h--):"intersect"!==t&&(l.unshift(s),h++)),d-3<a&&(n=Sa(r.target,f),a===d-2?"intersect"===n&&(l.pop(),l[l.length-1]=f):"intersect"!==n&&l.push(c)),o.newWaypoints=r.waypoints=y(r,l),m(o,h,e),o.newSegmentStartIndex=i+h,v(e)}),t.on("connectionSegment.move.hover",function(e){e.context.hover=e.hover,f.addMarker(e.hover,ja)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(e){var t=e.context.hover;t&&f.removeMarker(t,ja)}),t.on("connectionSegment.move.cleanup",function(e){var t=e.context,n=t.connection;t.draggerGfx&&jn(t.draggerGfx),f.removeMarker(n,Pa)}),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(e){var t=e.context;t.connection.waypoints=t.originalWaypoints,v(e)}),t.on("connectionSegment.move.end",function(e){var t=e.context,n=t.connection,o=t.newWaypoints,r=t.newSegmentStartIndex;o=o.map(function(e){return{original:e.original,x:Math.round(e.x),y:Math.round(e.y)}});var i,a,s,c=(a=r,s=0,{waypoints:(i=o).filter(function(e,t){return!_i(i[t-1],i[t+1],e)||(s=t<=a?s-1:s,!1)}),segmentOffset:s}),u=y(n,c.waypoints),l=c.segmentOffset,p={segmentMove:{segmentStartIndex:t.segmentStartIndex,newSegmentStartIndex:r+l}};h.updateWaypoints(n,u,p)})}Ma.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","rules","modeling"];var Ba=Math.abs,Ia=Math.round;function Na(e){function u(e,t){if(y(e)){for(var n=e.length;n--;)if(Ba(e[n]-t)<=10)return e[n]}else{var o=t%(e=+e);if(o<10)return t-o;if(e-10<o)return t-o+e}return t}function l(e){if(e.width)return{x:Ia(e.width/2+e.x),y:Ia(e.height/2+e.y)}}e.on("connectionSegment.move.move",1500,function(e){var t,n,o=function(e){var t=e.snapPoints,n=e.connection,o=n.waypoints,r=e.segmentStart,i=e.segmentStartIndex,a=e.segmentEnd,s=e.segmentEndIndex,c=e.axis;if(t)return t;var u=[o[i-1],r,a,o[s+1]];return i<2&&u.unshift(l(n.source)),s>o.length-3&&u.unshift(l(n.target)),e.snapPoints=t={horizontal:[],vertical:[]},w(u,function(e){e&&(e=e.original||e,"y"===c&&t.horizontal.push(e.y),"x"===c&&t.vertical.push(e.x))}),t}(e.context),r=e.x,i=e.y;if(o){var a=r-(t=u(o.vertical,r)),s=i-(n=u(o.horizontal,i));R(e,{dx:e.dx-a,dy:e.dy-s,x:t,y:n})}}),e.on("bendpoint.move.move",1500,function(e){var t=e.context,n=function(e){var t=e.snapPoints,n=e.connection.waypoints,o=e.bendpointIndex;if(t)return t;var r=[n[o-1],n[o+1]];return e.snapPoints=t={horizontal:[],vertical:[]},w(r,function(e){e&&(e=e.original||e,t.horizontal.push(e.y),t.vertical.push(e.x))}),t}(t),o=t.target,r=o&&l(o),i=e.x,a=e.y;if(n){var s=i-u(r?n.vertical.concat([r.x]):n.vertical,i),c=a-u(r?n.horizontal.concat([r.y]):n.horizontal,a);R(e,{dx:e.dx-s,dy:e.dy-c,x:e.x-s,y:e.y-c})}})}Na.$inject=["eventBus"];var Va={__depends__:[vi,gi],__init__:["bendpoints","bendpointSnapping"],bendpoints:["type",da],bendpointMove:["type",xa],connectionSegmentMove:["type",Ma],bendpointSnapping:["type",Na]};function La(e,t,n){this._providers=[],this._eventBus=t,this._overlays=n;var o=c(e&&e.scale)?e.scale:{min:1,max:1.5};this._overlaysConfig={position:{right:-9,top:-6},scale:o},this._current=null,this._init()}La.$inject=["config.contextPad","eventBus","overlays"],La.prototype._init=function(){var e=this._eventBus,o=this;e.on("selection.changed",function(e){var t=e.newSelection;1===t.length?o.open(t[0]):o.close()}),e.on("elements.delete",function(e){w(e.elements,function(e){o.isOpen(e)&&o.close()})}),e.on("element.changed",function(e){var t=e.element,n=o._current;n&&n.element===t&&o.open(t,!0)})},La.prototype.registerProvider=function(e){this._providers.push(e)},La.prototype.getEntries=function(t){var n={};return w(this._providers,function(e){w(e.getContextPadEntries(t),function(e,t){n[t]=e})}),n},La.prototype.trigger=function(e,t,n){var o,r,i=this._current.element,a=this._current.entries,s=t.delegateTarget||t.target;if(!s)return t.preventDefault();if(o=a[nt(s,"data-action")].action,r=t.originalEvent||t,p(o)){if("click"===e)return o(r,i,n)}else if(o[e])return o[e](r,i,n);t.preventDefault()},La.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},La.prototype._updateAndOpen=function(e){var t=this.getEntries(e),n=this.getPad(e),c=n.html;w(t,function(e,t){var n,o,r,i,a=e.group||"default",s=wt(e.html||'<div class="entry" draggable="true"></div>');nt(s,"data-action",t),(n=Ot("[data-group="+a+"]",c))||(n=wt('<div class="group" data-group="'+a+'"></div>'),c.appendChild(n)),n.appendChild(s),e.className&&(o=s,r=e.className,i=st(o),(y(r)?r:r.split(/\s+/g)).forEach(function(e){i.add(e)})),e.title&&nt(s,"title",e.title),e.imageUrl&&s.appendChild(wt('<img src="'+e.imageUrl+'">'))}),st(c).add("open"),this._current={element:e,pad:n,entries:t},this._eventBus.fire("contextPad.open",{current:this._current})},La.prototype.getPad=function(e){if(this.isOpen())return this._current.pad;var t=this,n=this._overlays,o=wt('<div class="djs-context-pad"></div>'),r=R({html:o},this._overlaysConfig);_t.bind(o,".entry","click",function(e){t.trigger("click",e)}),_t.bind(o,".entry","dragstart",function(e){t.trigger("dragstart",e)}),gt.bind(o,"mousedown",function(e){e.stopPropagation()}),this._overlayId=n.add(e,"context-pad",r);var i=n.get(this._overlayId);return this._eventBus.fire("contextPad.create",{element:e,pad:i}),i},La.prototype.close=function(){this.isOpen()&&(this._overlays.remove(this._overlayId),this._overlayId=null,this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},La.prototype.isOpen=function(e){return!(!this._current||e&&this._current.element!==e)};var $a={__depends__:[fr,Sr],contextPad:["type",La]},Fa="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},Ua="connect-ok",za="connect-not-ok";function Wa(e,r,u,n,i,y){function l(e,t){return n.allowed("connection.create",{source:e,target:t})}e.on("connect.move",function(e){var t,n,o,r,i,a,s,c,u,l=e.context,p=l.source,f=l.target,d=l.visual,h=l.sourcePosition;t={x:e.x,y:e.y},o=h,r=t,i=p,a=f,s=y.getShapePath(i),c=a&&y.getShapePath(a),u=y.getConnectionPath({waypoints:[o,r]}),wn(d,{points:[(n=[o=Oa(s,u,!0)||o,r=a&&Oa(c,u,!1)||r])[0].x,n[0].y,n[1].x,n[1].y]})}),e.on("connect.hover",function(e){var t,n=e.context,o=n.source,r=e.hover;null!==(t=n.canExecute=l(o,r))&&(n.target=r,i.addMarker(r,t?Ua:za))}),e.on(["connect.out","connect.cleanup"],function(e){var t=e.context;t.target&&i.removeMarker(t.target,t.canExecute?Ua:za),t.target=null,t.canExecute=!1}),e.on("connect.cleanup",function(e){var t=e.context;t.visual&&jn(t.visual)}),e.on("connect.start",function(e){var t,n=e.context;wn(t=Dn("polyline"),{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"}),mn(i.getDefaultLayer(),t),n.visual=t}),e.on("connect.end",function(e){var t=e.context,n=t.source,o=t.sourcePosition,r=t.target,i={x:e.x,y:e.y},a=t.canExecute||l(n,r);if(!a)return!1;var s=null,c={connectionStart:o,connectionEnd:i};"object"===(void 0===a?"undefined":Fa(a))&&(s=a),u.connect(n,r,s,c)}),this.start=function(e,t,n,o){"object"!==(void 0===n?"undefined":Fa(n))&&(o=n,n=ka(t)),r.init(e,"connect",{autoActivate:o,data:{shape:t,context:{source:t,sourcePosition:n}}})}}Wa.$inject=["eventBus","dragging","modeling","rules","canvas","graphicsFactory"];var Ha={__depends__:[br,gi,vi],connect:["type",Wa]},Ga="drop-ok",qa="drop-not-ok",Ka="attach-ok",Xa="new-parent";function Za(e,o,c,u,i,a,s){function l(t,n){[Ka,Ga,qa,Xa].forEach(function(e){e===n?i.addMarker(t,e):i.removeMarker(t,e)})}e.on("create.move",function(e){var t,n=e.context,o=e.hover,r=n.shape,i=n.source,a={x:e.x,y:e.y};t=n.canExecute=o&&function(e,t,n,o){if(!t)return!1;var r,i,a,s={source:n,shape:e,target:t,position:o};return(i=c.allowed("shape.attach",s))||(r=c.allowed("shape.create",s)),(r||i)&&(a=n&&c.allowed("connection.create",{source:n,target:e,hints:{targetParent:t,targetAttach:i}})),!(!r&&!i)&&{attach:i,connect:a}}(r,o,i,a),o&&null!==t&&(n.target=o,t&&t.attach?l(o,Ka):l(o,t?Xa:qa))}),e.on("create.move",750,function(e){var t=e.context,n=t.shape,o=t.visual;o||(o=t.visual=function(e){var t,n,o;wn(t=Dn("g"),a.cls("djs-drag-group",["no-events"])),mn(i.getDefaultLayer(),t),Sn(n=Dn("g")).add("djs-dragger"),mn(t,n),Do(n,e.width/-2,e.height/-2);var r=Dn("g");return Sn(r).add("djs-visual"),mn(n,r),o=r,s.drawShape(o,e),t}(n)),Do(o,e.x,e.y)}),e.on(["create.end","create.out","create.cleanup"],function(e){var t=e.context.target;t&&l(t,null)}),e.on("create.end",function(e){var t=e.context,n=t.source,o=t.shape,r=t.target,i=t.canExecute,a=i&&i.attach,s=i&&i.connect,c={x:e.x,y:e.y};if(!i)return!1;o=s?u.appendShape(n,o,c,r,{attach:a,connection:!0===s?{}:s}):u.createShape(o,c,r,{attach:a}),t.shape=o}),e.on("create.cleanup",function(e){var t=e.context;t.visual&&jn(t.visual)}),this.start=function(e,t,n){o.init(e,"create",{cursor:"grabbing",autoActivate:!0,data:{shape:t,context:{shape:t,source:n}}})}}Za.$inject=["eventBus","dragging","rules","modeling","canvas","styles","graphicsFactory"];var Ya={__depends__:[vi,br,gi],create:["type",Za]},Ja="data-id";function Qa(e,t,n){var o=c(e&&e.scale)?e.scale:{min:1,max:1.5};this._config={scale:o},this._eventBus=t,this._canvas=n,this._providers={},this._current={}}Qa.$inject=["config.popupMenu","eventBus","canvas"],Qa.prototype.registerProvider=function(e,t){this._providers[e]=t},Qa.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._providers[t],o=n.getEntries(e),r=n.getHeaderEntries&&n.getHeaderEntries(e),i=0<o.length,a=r&&0<r.length;return!i&&!a},Qa.prototype.open=function(e,t,n){var o=this._providers[t];if(!e)throw new Error("Element is missing");if(!o)throw new Error("Provider is not registered: "+t);if(!n)throw new Error("the position argument is missing");this.isOpen()&&this.close(),this._emit("open");var r=this._current={provider:o,className:t,element:e,position:n};o.getHeaderEntries&&(r.headerEntries=o.getHeaderEntries(e)),r.entries=o.getEntries(e),r.container=this._createContainer();var i=r.headerEntries||[],a=r.entries||[];i.length&&r.container.appendChild(this._createEntries(r.headerEntries,"djs-popup-header")),a.length&&r.container.appendChild(this._createEntries(r.entries,"djs-popup-body"));var s=this._canvas.getContainer();this._attachContainer(r.container,s,n.cursor)},Qa.prototype.close=function(){this.isOpen()&&(this._emit("close"),this._unbindHandlers(),Pt(this._current.container),this._current.container=null)},Qa.prototype.isOpen=function(){return!!this._current.container},Qa.prototype.trigger=function(e){e.preventDefault();var t=nt(e.delegateTarget||e.target,Ja),n=this._getEntry(t);if(n.action)return n.action.call(null,e,n)},Qa.prototype._getEntry=function(e){var t=E({id:e}),n=g(this._current.entries,t)||g(this._current.headerEntries,t);if(!n)throw new Error("entry not found");return n},Qa.prototype._emit=function(e){this._eventBus.fire("popupMenu."+e)},Qa.prototype._createContainer=function(){var e=wt('<div class="djs-popup">'),t=this._current.position,n=this._current.className;return R(e.style,{position:"absolute",left:t.x+"px",top:t.y+"px",visibility:"hidden"}),st(e).add(n),e},Qa.prototype._attachContainer=function(e,t,n){var o=this;_t.bind(e,".entry","click",function(e){o.trigger(e)}),this._updateScale(e),t.appendChild(e),n&&this._assureIsInbounds(e,n),this._bindHandlers()},Qa.prototype._updateScale=function(e){var t,n,o,r,i=this._canvas.zoom(),a=this._config.scale,s=i;!0!==a&&(n=!1===a?t=1:(t=a.min,a.max),c(t)&&i<t&&(s=t),c(n)&&n<i&&(s=n)),r="scale("+s+")",(o=e).style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(e){o.style[e+"transform"]=r})},Qa.prototype._assureIsInbounds=function(e,t){var n,o,r=this._canvas._container.getBoundingClientRect(),i=e.offsetLeft,a=e.offsetTop,s=e.scrollWidth,c=e.scrollHeight,u={},l=t.x-r.left,p=t.y-r.top;i+s>r.width&&(u.x=!0),a+c>r.height&&(u.y=!0),u.x&&u.y?(n=l-s+"px",o=p-c+"px"):u.x?(n=l-s+"px",o=p+"px"):u.y&&p<c?(n=l+"px",o="10px"):u.y&&(n=l+"px",o=p-c+"px"),R(e.style,{left:n,top:o},{visibility:"visible","z-index":1e3})},Qa.prototype._createEntries=function(e,t){var n=wt("<div>"),o=this;return st(n).add(t),w(e,function(e){var t=o._createEntry(e,n);n.appendChild(t)}),n},Qa.prototype._createEntry=function(e){if(!e.id)throw new Error("every entry must have the id property set");var t=wt("<div>"),n=st(t);if(n.add("entry"),e.className&&e.className.split(" ").forEach(function(e){n.add(e)}),nt(t,Ja,e.id),e.label){var o=wt("<span>");o.textContent=e.label,t.appendChild(o)}return e.imageUrl&&t.appendChild(wt('<img src="'+e.imageUrl+'" />')),!0===e.active&&n.add("active"),!0===e.disabled&&n.add("disabled"),e.title&&(t.title=e.title),t},Qa.prototype._bindHandlers=function(){var e=this._eventBus,t=this;function n(){t.close()}e.once("contextPad.close",n),e.once("canvas.viewbox.changing",n),e.once("commandStack.changed",n)},Qa.prototype._unbindHandlers=function(){var e=this._eventBus,t=this;function n(){t.close()}e.off("contextPad.close",n),e.off("canvas.viewbox.changed",n),e.off("commandStack.changed",n)};var es={__init__:["popupMenu"],popupMenu:["type",Qa]},ts=Math.round;function ns(e){this._modeling=e}ns.$inject=["modeling"],ns.prototype.replaceElement=function(e,t,n){var o=this._modeling,r=null;return e.waypoints||(t.x=ts(e.x+(t.width||e.width)/2),t.y=ts(e.y+(t.height||e.height)/2),r=o.replaceShape(e,t,n)),r};var os={__init__:["replace"],replace:["type",ns]};function rs(p,f,e,t){this.replaceElement=function(e,t,n){n=n||{};var o=t.type,r=e.businessObject,i=p.create(o),a={type:o,businessObject:i};if(a.width=e.width,a.height=e.height,i.name=r.name,t.table){var s=p.create("dmn:DecisionTable");(i.decisionTable=s).$parent=i;var c=p.create("dmn:OutputClause");c.typeRef="string",(c.$parent=s).output=[c];var u=p.create("dmn:InputClause");u.$parent=s;var l=p.create("dmn:LiteralExpression",{typeRef:"string"});(u.inputExpression=l).$parent=u,s.input=[u]}return t.expression&&(i.literalExpression=p.create("dmn:LiteralExpression"),i.variable=p.create("dmn:InformationItem")),f.replaceElement(e,a,n)}}rs.$inject=["drdFactory","replace","selection","modeling"];var is={__depends__:[os,br],drdReplace:["type",rs]},as=[{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 ss(e,t,n,o,r,i){this._popupMenu=e,this._modeling=t,this._moddle=n,this._drdReplace=o,this._rules=r,this._translate=i,this.register()}ss.$inject=["popupMenu","modeling","moddle","drdReplace","rules","translate"],ss.prototype.register=function(){this._popupMenu.registerProvider("dmn-replace",this)},ss.prototype.getEntries=function(e){var r=e.businessObject;if(!this._rules.allowed("shape.replace",{element:e}))return[];if(Ht(r,"dmn:Decision")){var t=h(as,function(e){var t="replace-with-empty-decision"===e.actionName&&(r.decisionTable||r.literalExpression),n="replace-with-decision-table"===e.actionName&&!r.decisionTable,o="replace-with-literal-expression"===e.actionName&&!r.literalExpression;return t||n||o});return this._createEntries(e,t)}return[]},ss.prototype._createEntries=function(n,e){var o=[],r=this;return w(e,function(e){var t=r._createMenuEntry(e,n);o.push(t)}),o},ss.prototype._createMenuEntry=function(e,t,n){var o=this._drdReplace.replaceElement;return n=n||function(){return o(t,e.target)},{label:(0,this._translate)(e.label),className:e.className,id:e.actionName,action:n}},ss.prototype.getHeaderEntries=function(e){return[]};var cs={__depends__:[or,es,is],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",ss]};function us(e,o,t,n,r,i,a,s,c,u){o.registerProvider(this),this._contextPad=o,this._modeling=t,this._elementFactory=n,this._connect=r,this._create=i,this._rules=a,this._popupMenu=s,this._canvas=c,this._translate=u,e.on("create.end",250,function(e){var t=e.context.shape;if(ur(e)){var n=o.getEntries(t);n.replace&&n.replace.action.click(e,t)}})}us.$inject=["eventBus","contextPad","modeling","elementFactory","connect","create","rules","popupMenu","canvas","translate"],us.prototype.getContextPadEntries=function(t){var n=this._modeling,i=this._elementFactory,o=this._connect,a=this._create,u=this._popupMenu,l=this._canvas,p=this._contextPad,e=this._rules,s=this._translate,r={};if("label"===t.type)return r;var c=t.businessObject;function f(e,t,n){o.start(e,t,n)}function d(o,e,t,r){function n(e,t){var n=i.createShape(R({type:o},r));a.start(e,n,t)}return"string"!=typeof t&&(r=t,t=s("Append {type}",{type:o.replace(/^dmn:/,"")})),{group:"model",className:e,title:t,action:{dragstart:n,click:n}}}Xt(c,["dmn:InputData","dmn:BusinessKnowledgeModel","dmn:KnowledgeSource","dmn:Decision"])&&R(r,{"append.decision":d("dmn:Decision","dmn-icon-decision")}),Xt(c,["dmn:InputData","dmn:Decision","dmn:KnowledgeSource"])&&R(r,{"append.knowledge-source":d("dmn:KnowledgeSource","dmn-icon-knowledge-source")}),Xt(c,["dmn:BusinessKnowledgeModel","dmn:KnowledgeSource"])&&R(r,{"append.business-knowledge-model":d("dmn:BusinessKnowledgeModel","dmn-icon-business-knowledge")}),Xt(c,["dmn:Decision"])&&R(r,{"append.input-data":d("dmn:InputData","dmn-icon-input-data")}),Ht(c,"dmn:DRGElement")&&R(r,{"append.text-annotation":d("dmn:TextAnnotation","dmn-icon-text-annotation"),connect:{group:"connect",className:"dmn-icon-connection-multi",title:s("Connect using Information/Knowledge/Authority Requirement or Association"),action:{click:f,dragstart:f}}}),u.isEmpty(t,"dmn-replace")||R(r,{replace:{group:"edit",className:"dmn-icon-screw-wrench",title:s("Change type"),action:{click:function(e,t){var n,o,r,i,a,s,c=R((n=t,o=l.getContainer(),r=p.getPad(n).html,i=o.getBoundingClientRect(),a=r.getBoundingClientRect(),s=a.top-i.top,{x:a.left-i.left,y:s+a.height+5}),{cursor:{x:e.x,y:e.y}});u.open(t,"dmn-replace",c)}}}});var h=e.allowed("elements.delete",{elements:[t]});return y(h)&&(h=h[0]===t),h&&R(r,{delete:{group:"edit",className:"dmn-icon-trash",title:s("Remove"),action:{click:function(e){n.removeElements([t])}}}}),r};var ls={__depends__:[or,$a,br,Ha,Ya,cs],__init__:["contextPadProvider"],contextPadProvider:["type",us]};function ps(e,t,n){this._eventBus=e,this._modeling=t,this._canvas=n,e.on("definitionIdView.create",function(e){var t=e.html,n=Ot(".dmn-definitions-name",t),o=Ot(".dmn-definitions-id",t);this._setup(n,"name"),this._setup(o,"id")},this)}ps.$inject=["eventBus","modeling","canvas"],ps.prototype.update=function(e,t){var n={};n[e]=t,this._modeling.updateProperties(this._canvas.getRootElement(),n)},ps.prototype._setup=function(t,n){var o=this;t.setAttribute("contenteditable",!0),t.addEventListener("input",j(function(e){var t=e.target.value||e.target.textContent;o.update(n,t.trim())},300)),t.addEventListener("keydown",function(e){13===e.keyCode&&(t.blur(),window.getSelection().removeAllRanges())})};var fs={__init__:["definitionPropertiesEdit","definitionPropertiesPaletteAdapter"],definitionPropertiesEdit:["type",ps],definitionPropertiesPaletteAdapter:["type",jr]},ds="is not a registered action";function hs(e,t){this._actions={};var n=this;e.on("diagram.init",function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})})}function ys(e,t){return new Error(e+" "+t)}hs.$inject=["eventBus","injector"],hs.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),o=e.get("modeling",!1),r=e.get("selection",!1),n=e.get("zoomScroll",!1),i=e.get("copyPaste",!1),a=e.get("canvas",!1),s=e.get("rules",!1),c=e.get("mouseTracking",!1),u=e.get("keyboardMove",!1),l=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",function(){t.undo()}),this.register("redo",function(){t.redo()})),i&&r&&this.register("copy",function(){var e=r.get();i.copy(e)}),c&&i&&this.register("paste",function(){var e=c.getHoverContext();i.paste(e)}),n&&this.register("stepZoom",function(e){n.stepZoom(e.value)}),a&&this.register("zoom",function(e){a.zoom(e.value)}),o&&r&&s&&this.register("removeSelection",function(){var e=r.get();if(e.length){var t,n=s.allowed("elements.delete",{elements:e});!1!==n&&(t=y(n)?n:e).length&&o.removeElements(t.slice())}}),u&&this.register("moveCanvas",function(e){u.moveCanvas(e)}),l&&this.register("moveSelection",function(e){l.moveSelection(e.direction,e.accelerated)})},hs.prototype.trigger=function(e,t){if(!this._actions[e])throw ys(e,ds);return this._actions[e](t)},hs.prototype.register=function(e,t){var n=this;if("string"==typeof e)return this._registerAction(e,t);w(e,function(e,t){n._registerAction(t,e)})},hs.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw ys(e,"is already registered");this._actions[e]=t},hs.prototype.unregister=function(e){if(!this.isRegistered(e))throw ys(e,ds);this._actions[e]=void 0},hs.prototype.getActions=function(){return Object.keys(this._actions)},hs.prototype.isRegistered=function(e){return!!this._actions[e]};var vs={__init__:["editorActions"],editorActions:["type",hs]};function ms(e){e.invoke(hs,this)}en(ms,hs),ms.$inject=["injector"],ms.prototype._registerDefaultActions=function(e){hs.prototype._registerDefaultActions.call(this,e);var n=e.get("canvas",!1),o=e.get("elementRegistry",!1),r=e.get("selection",!1),t=e.get("lassoTool",!1),i=e.get("directEditing",!1);n&&o&&r&&this._registerAction("selectElements",function(){var t=n.getRootElement(),e=o.filter(function(e){return e!==t});return r.select(e),e}),t&&this._registerAction("lassoTool",function(){t.toggle()}),r&&i&&this._registerAction("directEditing",function(){var e=r.get();e.length&&i.activate(e[0])})};var gs={__depends__:[vs],editorActions:["type",ms]};function bs(e){return i(e.drgElements,_s)}function _s(e){var t=e.extensionElements,n=t&&t.values;return n&&g(n,function(e){return Ht(e,"biodi:Bounds")})}function ws(e,i,a){e.on("import.start",function(e){var r,t=e.definitions;bs(t)||(r=0,w(t.drgElements,function(e){var t,n,o;Ht(e,"dmn:Decision")&&((n=e.extensionElements)||((n=e.extensionElements=i.createDi()).$parent=e),o=a._getDefaultSize(e),t=i.createDiBounds({x:150+30*r,y:150+30*r,width:o.width,height:o.height}),n.get("values").push(t),t.$parent=n,r++)}))})}ws.$inject=["eventBus","drdFactory","elementFactory"];var xs={__init__:["diGenerator"],diGenerator:["type",ws]};function Cs(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function Es(e,t){return-1<(e=y(e)?e:[e]).indexOf(t.key)}function ks(e){return e.shiftKey}var Ss="keyboard.keydown";function Os(e,t){var n=this;this._config=e||{},this._eventBus=t,this._keyHandler=this._keyHandler.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()})}Os.$inject=["config.keyboard","eventBus"],Os.prototype._keyHandler=function(e){var t=e.target;if(!(n=t)||!St(n,"input, textarea")&&"true"!==n.contentEditable){var n,o={keyEvent:e};this._eventBus.fire(Ss,o)&&e.preventDefault()}},Os.prototype.bind=function(e){this.unbind(),this._node=e,gt.bind(e,"keydown",this._keyHandler,!0),this._fire("bind")},Os.prototype.getBinding=function(){return this._node},Os.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),gt.unbind(e,"keydown",this._keyHandler,!0)),this._node=null},Os.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},Os.prototype.addListener=function(e,t){p(e)&&(t=e,e=1e3),this._eventBus.on(Ss,e,t)},Os.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},Os.prototype.isCmd=Cs,Os.prototype.isShift=ks,Os.prototype.isKey=Es;var js=500;function Ps(e,n){var o=this;e.on("editorActions.init",js,function(e){var t=e.editorActions;o.registerBindings(n,t)})}Ps.$inject=["eventBus","keyboard"],Ps.prototype.registerBindings=function(n,o){function e(e,t){o.isRegistered(e)&&n.addListener(t)}e("undo",function(e){var t=e.keyEvent;if(Cs(t)&&!ks(t)&&Es(["z","Z"],t))return o.trigger("undo"),!0}),e("redo",function(e){var t=e.keyEvent;if(Cs(t)&&(Es(["y","Y"],t)||Es(["z","Z"],t)&&ks(t)))return o.trigger("redo"),!0}),e("copy",function(e){var t=e.keyEvent;if(Cs(t)&&Es(["c","C"],t))return o.trigger("copy"),!0}),e("paste",function(e){var t=e.keyEvent;if(Cs(t)&&Es(["v","V"],t))return o.trigger("paste"),!0}),e("stepZoom",function(e){var t=e.keyEvent;if(Es(["+","Add"],t)&&Cs(t))return o.trigger("stepZoom",{value:1}),!0}),e("stepZoom",function(e){var t=e.keyEvent;if(Es(["-","Subtract"],t)&&Cs(t))return o.trigger("stepZoom",{value:-1}),!0}),e("zoom",function(e){var t=e.keyEvent;if(Es("0",t)&&Cs(t))return o.trigger("zoom",{value:1}),!0}),e("removeSelection",function(e){if(Es(["Delete","Del"],e.keyEvent))return o.trigger("removeSelection"),!0})};var Ts={__init__:["keyboard","keyboardBindings"],keyboard:["type",Os],keyboardBindings:["type",Ps]};function Rs(e){e.invoke(Ps,this)}en(Rs,Ps),Rs.$inject=["injector"],Rs.prototype.registerBindings=function(n,o){function e(e,t){o.isRegistered(e)&&n.addListener(t)}Ps.prototype.registerBindings.call(this,n,o),e("selectElements",function(e){var t=e.keyEvent;if(n.isKey(["a","A"],t)&&n.isCmd(t))return o.trigger("selectElements"),!0}),e("lassoTool",function(e){var t=e.keyEvent;if(!n.hasModifier(t))return n.isKey(["l","L"],t)?(o.trigger("lassoTool"),!0):void 0}),e("directEditing",function(e){var t=e.keyEvent;if(!n.hasModifier(t))return n.isKey(["e","E"],t)?(o.trigger("directEditing"),!0):void 0})};var As={__depends__:[Ts],__init__:["keyboardBindings"],keyboardBindings:["type",Rs]},Ds={moveSpeed:50,moveSpeedAccelerated:200};function Ms(e,i,r){var a=this;this._config=R({},Ds,e||{}),i.addListener(function(e){var t=e.keyEvent,n=a._config;if(!i.isCmd(t))return;if(i.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],t)){var o,r=i.isShift(t)?n.moveSpeedAccelerated:n.moveSpeed;switch(t.key){case"ArrowLeft":case"Left":o="left";break;case"ArrowUp":case"Up":o="up";break;case"ArrowRight":case"Right":o="right";break;case"ArrowDown":case"Down":o="down"}return a.moveCanvas({speed:r,direction:o}),!0}}),this.moveCanvas=function(e){var t=0,n=0,o=e.speed/Math.min(Math.sqrt(r.viewbox().scale),1);switch(e.direction){case"left":t=o;break;case"up":n=o;break;case"right":t=-o;break;case"down":n=-o}r.scroll({dx:t,dy:n})}}Ms.$inject=["config.keyboardMove","keyboard","canvas"];var Bs={__depends__:[Ts],__init__:["keyboardMove"],keyboardMove:["type",Ms]},Is={moveSpeed:1,moveSpeedAccelerated:10},Ns={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 Ls(e,r,i,a){var s=this;this._config=R({},Is,e||{}),r.addListener(1500,function(e){var t=e.keyEvent,n=Ns[t.key];if(n&&!r.isCmd(t)){var o=r.isShift(t);return s.moveSelection(n,o),!0}}),this.moveSelection=function(e,t){var n=a.get();if(n.length){var o=this._config[t?"moveSpeedAccelerated":"moveSpeed"],r=Vs[e](o);i.moveElements(n,r)}}}Ls.$inject=["config.keyboardMoveSelection","keyboard","modeling","selection"];var $s={__depends__:[Ts,br],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",Ls]};function Fs(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[]},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],function(){this.clear(!1)},this)}Fs.$inject=["eventBus","injector"],Fs.prototype.execute=function(e,t){if(!e)throw new Error("command required");var n={command:e,context:t};this._pushAction(n),this._internalExecute(n),this._popAction(n)},Fs.prototype.canExecute=function(e,t){var n={command:e,context:t},o=this._getHandler(e),r=this._fire(e,"canExecute",n);if(void 0===r){if(!o)return!1;o.canExecute&&(r=o.canExecute(t))}return r},Fs.prototype.clear=function(e){this._stack.length=0,!(this._stackIdx=-1)!==e&&this._fire("changed")},Fs.prototype.undo=function(){var e,t=this._getUndoAction();if(t){for(this._pushAction(t);t&&(this._internalUndo(t),(e=this._getUndoAction())&&e.id===t.id);)t=e;this._popAction()}},Fs.prototype.redo=function(){var e,t=this._getRedoAction();if(t){for(this._pushAction(t);t&&(this._internalExecute(t,!0),(e=this._getRedoAction())&&e.id===t.id);)t=e;this._popAction()}},Fs.prototype.register=function(e,t){this._setHandler(e,t)},Fs.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");var n=this._injector.instantiate(t);this.register(e,n)},Fs.prototype.canUndo=function(){return!!this._getUndoAction()},Fs.prototype.canRedo=function(){return!!this._getRedoAction()},Fs.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},Fs.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},Fs.prototype._internalUndo=function(e){var t=this,n=e.command,o=e.context,r=this._getHandler(n);this._atomicDo(function(){t._fire(n,"revert",e),r.revert&&t._markDirty(r.revert(o)),t._revertedAction(e),t._fire(n,"reverted",e)})},Fs.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);var o,r,i,a=t?[e+"."+t,t]:[e];for(n=this._eventBus.createEvent(n),o=0;(r=a[o])&&(i=this._eventBus.fire("commandStack."+r,n),!n.cancelBubble);o++);return i},Fs.prototype._createId=function(){return this._uid++},Fs.prototype._atomicDo=function(e){var t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},Fs.prototype._internalExecute=function(e,t){var n=this,o=e.command,r=e.context,i=this._getHandler(o);if(!i)throw new Error("no command handler registered for <"+o+">");this._pushAction(e),t||(this._fire(o,"preExecute",e),i.preExecute&&i.preExecute(r),this._fire(o,"preExecuted",e)),this._atomicDo(function(){n._fire(o,"execute",e),i.execute&&n._markDirty(i.execute(r)),n._executedAction(e,t),n._fire(o,"executed",e)}),t||(this._fire(o,"postExecute",e),i.postExecute&&i.postExecute(r),this._fire(o,"postExecuted",e)),this._popAction(e)},Fs.prototype._pushAction=function(e){var t=this._currentExecution,n=t.actions,o=n[0];if(t.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+e.command+")");e.id||(e.id=o&&o.id||this._createId()),n.push(e)},Fs.prototype._popAction=function(){var e=this._currentExecution,t=e.actions,n=e.dirty;t.pop(),t.length||(this._eventBus.fire("elements.changed",{elements:function(t){t=s(t);for(var n={},e=arguments.length,o=Array(1<e?e-1:0),r=1;r<e;r++)o[r-1]=arguments[r];return w(o,function(e){return b(e,t,n)}),v(n,function(e,t){return e[0]})}("id",n)}),n.length=0,this._fire("changed"))},Fs.prototype._markDirty=function(e){var t=this._currentExecution;e&&(e=y(e)?e:[e],t.dirty=t.dirty.concat(e))},Fs.prototype._executedAction=function(e,t){var n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},Fs.prototype._revertedAction=function(e){this._stackIdx--},Fs.prototype._getHandler=function(e){return this._handlerMap[e]},Fs.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};var Us={commandStack:["type",Fs]};function zs(n,o,r,i){n.on("element.changed",function(e){var t=e.element;(t.parent||t===o.getRootElement())&&(e.gfx=r.getGraphics(t)),e.gfx&&n.fire(ro(t)+".changed",e)}),n.on("elements.changed",function(e){var t=e.elements;t.forEach(function(e){n.fire("element.changed",{element:e})}),i.updateContainments(t)}),n.on("shape.changed",function(e){i.update("shape",e.element,e.gfx)}),n.on("connection.changed",function(e){i.update("connection",e.element,e.gfx)})}zs.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var Ws={__init__:["changeSupport"],changeSupport:["type",zs]},Hs=Math.min,Gs=Math.max;function qs(e){e.preventDefault()}function Ks(e){e.stopPropagation()}function Xs(e){this.container=e.container,this.parent=wt('<div class="djs-direct-editing-parent"><div class="djs-direct-editing-content" contenteditable="true"></div></div>'),this.content=Ot("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=P(this.autoResize,this),this.handlePaste=P(this.handlePaste,this)}function Zs(e,t){this._eventBus=e,this._providers=[],this._textbox=new Xs({container:t.getContainer(),keyHandler:P(this._handleKey,this),resizeHandler:P(this._handleResize,this)})}Xs.prototype.create=function(e,t,n,o){var r=this.parent,i=this.content,a=this.container;o=this.options=o||{};var s=A(t=this.style=t||{},["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);R(r.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"},s);var c=A(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return R(i.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},c),o.centerVertically&&R(i.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},c),i.innerText=n,gt.bind(i,"keydown",this.keyHandler),gt.bind(i,"mousedown",Ks),gt.bind(i,"paste",this.handlePaste),o.autoResize&>.bind(i,"input",this.autoResize),o.resizable&&this.resizable(t),a.appendChild(r),this.setSelection(i.lastChild,i.lastChild&&i.lastChild.length),r},Xs.prototype.handlePaste=function(e){var n,t,o=this,r=this.options,i=this.style;if(e.preventDefault(),n=e.clipboardData?e.clipboardData.getData("text/plain"):window.clipboardData.getData("Text"),!document.execCommand("insertHTML",!1,n)){var a,s,c=this.getSelection(),u=c.startContainer,l=c.endContainer,p=c.startOffset,f=c.endOffset,d=c.commonAncestorContainer,h=(t=d.childNodes,[].slice.call(t));if(d.nodeType===Node.TEXT_NODE){var y=u.textContent;u.textContent=y.substring(0,p)+n+y.substring(f),a=u,s=p+n.length}else if(u===this.content&&l===this.content){var v=document.createTextNode(n);this.content.insertBefore(v,h[p]),s=(a=v).textContent.length}else{var m=h.indexOf(u),g=h.indexOf(l);h.forEach(function(e,t){t===m?e.textContent=u.textContent.substring(0,p)+n+l.textContent.substring(f):m<t&&t<=g&&Pt(e)}),a=u,s=p+n.length}a&&void 0!==s&&setTimeout(function(){o.setSelection(a,s)})}if(r.autoResize){var b=this.autoResize(i);b&&this.resizeHandler(b)}},Xs.prototype.autoResize=function(){var e=this.parent,t=this.content,n=parseInt(this.style.fontSize)||12;if(t.scrollHeight>e.offsetHeight||t.scrollHeight<e.offsetHeight-n){var o=e.getBoundingClientRect(),r=t.scrollHeight;e.style.height=r+"px",this.resizeHandler({width:o.width,height:o.height,dx:0,dy:r-o.height})}},Xs.prototype.resizable=function(){var o=this,r=this.parent,e=this.resizeHandle,i=parseInt(this.style.minWidth)||0,a=parseInt(this.style.minHeight)||0,s=parseInt(this.style.maxWidth)||1/0,c=parseInt(this.style.maxHeight)||1/0;if(!e){var u,l,p,f;e=this.resizeHandle=wt('<div class="djs-direct-editing-resize-handle"></div>');var n=function(e){qs(e),Ks(e);var t=Hs(Gs(p+e.clientX-u,i),s),n=Hs(Gs(f+e.clientY-l,a),c);r.style.width=t+"px",r.style.height=n+"px",o.resizeHandler({width:p,height:f,dx:e.clientX-u,dy:e.clientY-l})},d=function e(t){qs(t),Ks(t),gt.unbind(document,"mousemove",n,!1),gt.unbind(document,"mouseup",e,!1)};gt.bind(e,"mousedown",function(e){qs(e),Ks(e),u=e.clientX,l=e.clientY;var t=r.getBoundingClientRect();p=t.width,f=t.height,gt.bind(document,"mousemove",n),gt.bind(document,"mouseup",d)})}R(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"}),r.appendChild(e)},Xs.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),gt.unbind(t,"keydown",this.keyHandler),gt.unbind(t,"mousedown",Ks),gt.unbind(t,"input",this.autoResize),gt.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),Pt(n)),Pt(e)},Xs.prototype.getValue=function(){return this.content.innerText},Xs.prototype.getSelection=function(){return window.getSelection().getRangeAt(0)},Xs.prototype.setSelection=function(e,t){var n=document.createRange();null===e?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t));var o=window.getSelection();o.removeAllRanges(),o.addRange(n)},Zs.$inject=["eventBus","canvas"],Zs.prototype.registerProvider=function(e){this._providers.push(e)},Zs.prototype.isActive=function(){return!!this._active},Zs.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},Zs.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})},Zs.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0},Zs.prototype.complete=function(){var e=this._active;if(e){var t=this.getValue(),n=this.$textbox.getBoundingClientRect();(t!==e.context.text||this.resizable)&&e.provider.update(e.element,t,e.context.text,{x:n.top,y:n.left,width:n.width,height:n.height}),this._fire("complete"),this.close()}},Zs.prototype.getValue=function(){return this._textbox.getValue()},Zs.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())},Zs.prototype._handleResize=function(e){this._fire("resize",e)},Zs.prototype.activate=function(t){var n;this.isActive()&&this.cancel();var e=g(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};var Ys={__depends__:[fr],__init__:["directEditing"],directEditing:["type",Zs]};function Js(e){return Ht(e,"dmn:Decision")||Ht(e,"dmn:BusinessKnowledgeModel")||Ht(e,"dmn:InputData")||Ht(e,"dmn:KnowledgeSource")?"name":Ht(e,"dmn:TextAnnotation")?"text":void 0}function Qs(e){var t=e.businessObject,n=Js(t);if(n)return t[n]||""}function ec(){function t(e,t){var n,o,r,i,a,s=e.label||e,c=e.labelTarget||e;return o=t,r=c!==(n=s),i=n.businessObject,(a=Js(i))&&(i[a]=o),r&&(n.hidden=!o),[s,c]}this.execute=function(e){return e.oldLabel=Qs(e.element),t(e.element,e.newLabel)},this.revert=function(e){return t(e.element,e.oldLabel)}}function tc(e,t,n,o){this._canvas=t,this._commandStack=o,n.registerProvider(this),o.registerHandler("element.updateLabel",ec),e.on("element.dblclick",function(e){n.activate(e.element)}),e.on(["element.mousedown","drag.init","canvas.viewbox.changed"],function(e){n.complete()}),e.on(["commandStack.changed"],function(){n.cancel()}),e.on("create.end",500,function(e){var t=e.shape;(Ht(t,"dmn:Decision")||Ht(t,"dmn:InputData")||Ht(t,"dmn:BusinessKnowledgeModel")||Ht(t,"dmn:KnowledgeSource"))&&n.activate(t)})}tc.$inject=["eventBus","canvas","directEditing","commandStack"],tc.prototype.activate=function(e){var t=Qs(e);if(void 0!==t){var n=this.getEditingBBox(e);return n.text=t,n}},tc.prototype.getEditingBBox=function(e){var t,n=this._canvas,o=e.label||e,r=n.getAbsoluteBBox(o),i={x:r.x,y:r.y},a={};return t=n.zoom(),i.height=1<t?(i.width=r.width,r.height):(i.width=r.width/t,r.height/t),t<1&&(i.x=r.x-(i.width/2-r.width/2),i.y=r.y-(i.height/2-r.height/2)),Ht(e,"dmn:TextAnnotation")&&(i.minWidth=100,i.height=e.height,a.textAlign="left"),{bounds:i,style:a}},tc.prototype.update=function(e,t){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t})};var nc={__depends__:[Us,Ws,Ys],__init__:["labelEditingProvider"],labelEditingProvider:["type",tc]};function oc(e){this._eventBus=e}oc.$inject=["eventBus"],oc.prototype.on=function(e,r,i,a,s,c){if((p(r)||l(r))&&(c=s,s=a,a=i,i=r,r=null),p(i)&&(c=s,s=a,a=i,i=1e3),_(s)&&(c=s,s=!1),!p(a))throw new Error("handlerFn must be a function");y(e)||(e=[e]);var u=this._eventBus;w(e,function(e){var t,n,o=["commandStack",e,r].filter(function(e){return e}).join(".");u.on(o,i,s?(t=a,n=c,function(e){return t.call(n||null,e.context,e.command,e)}):a,c)})};function rc(e,l,t){oc.call(this,e),this.preExecute("connection.create",function(e){var t,n,o,r,i,a=e.connection,s=a.businessObject,c=e.source,u=e.target;"dmn:Association"===a.type?(t=l.create("dmn:DMNElementReference",{href:"#"+c.id}),n=l.create("dmn:DMNElementReference",{href:"#"+u.id}),s.sourceRef=t,s.targetRef=n,s.extensionElements=l.createDi(),i=l.createDiEdge(c,[ka(c),ka(u)]),s.extensionElements.values.push(i)):(Ht(c,"dmn:Decision")&&Ht(u,"dmn:InputData")&&(e.target=c,e.source=c=u),o=function(e){switch(e.type){case"dmn:InputData":return"Input";case"dmn:Decision":return"Decision";case"dmn:KnowledgeSource":return"Authority";case"dmn:BusinessKnowledgeModel":return"Knowledge"}}(c),r=l.create("dmn:DMNElementReference",{href:"#"+c.id}),s["required"+o]=r,i=l.createDiEdge(c,[ka(c),ka(e.target)]),e.di=i)},!0)}function ic(e,a,s){oc.call(this,e),this.postExecuted("connection.reconnectStart",function(t){var e=t.context.connection.target.businessObject.extensionElements.values,n=h(e,function(e){return"biodi:Edge"===e.$type&&e.source===t.context.oldSource.id})[0];n&&e.splice(e.indexOf(n),1)}),this.postExecuted(["connection.reconnectStart","connection.reconnectEnd"],function(e){var t,n,o,r,i=e.context.connection;o=(t=i).source,r=t.target,t.parent&&((n=s.canConnect(o,r)||{type:"dmn:Association"}).waypoints=t.waypoints.slice(),a.removeConnection(t),a.connect(o,r,n))})}function ac(e,i){oc.call(this,e),this._modeling=i,this.postExecuted(["shape.replace"],1500,function(e){var t=e.context,o=t.oldShape,n=t.newShape,r=n.id;i.unclaimId(o.businessObject.id,o.businessObject),i.updateProperties(n,{id:o.id}),w(n.outgoing,function(e){var t,n=e.businessObject;(t=h((n.$instanceOf("dmn:Association")?(n.sourceRef.href="#"+o.id,n.extensionElements):(n.requiredDecision.href="#"+o.id,n.$parent.extensionElements)).values,function(e){return"biodi:Edge"===e.$type&&e.source===r})[0])&&(t.source=o.id)})})}w(["canExecute","preExecute","preExecuted","execute","executed","postExecute","postExecuted","revert","reverted"],function(i){oc.prototype[i]=function(e,t,n,o,r){(p(e)||l(e))&&(r=o,o=n,n=t,t=e,e=null),this.on(e,i,t,n,o,r)}}),rc.$inject=["eventBus","drdFactory","drdRules"],en(rc,oc),en(ic,oc),ic.$inject=["eventBus","modeling","drdRules"],en(ac,oc),ac.$inject=["eventBus","modeling"];var sc={__init__:["createConnectionBehavior","replaceConnectionBehavior","replaceElementBehavior"],createConnectionBehavior:["type",rc],replaceConnectionBehavior:["type",ic],replaceElementBehavior:["type",ac]};function cc(e){oc.call(this,e),this.init()}function uc(e){cc.call(this,e)}function lc(e,t){if(Ht(e,"dmn:Definitions")||Ht(t,"dmn:Definitions"))return!1;if(Ht(e,"dmn:Decision")||Ht(e,"dmn:InputData")){if(Ht(t,"dmn:Decision")||Ht(e,"dmn:Decision")&&Ht(t,"dmn:InputData"))return{type:"dmn:InformationRequirement"};if(Ht(t,"dmn:KnowledgeSource"))return{type:"dmn:AuthorityRequirement"}}return Ht(e,"dmn:BusinessKnowledgeModel")&&Xt(t,["dmn:Decision","dmn:BusinessKnowledgeModel"])?{type:"dmn:KnowledgeRequirement"}:Ht(e,"dmn:KnowledgeSource")&&Xt(t,["dmn:Decision","dmn:BusinessKnowledgeModel","dmn:KnowledgeSource"])?{type:"dmn:AuthorityRequirement"}:!!Ht(t,"dmn:TextAnnotation")&&{type:"dmn:Association"}}function pc(e,t){return Ht(t,"dmn:Definitions")}function fc(e,t){return!t||!!Ht(t,"dmn:Definitions")}cc.$inject=["eventBus"],en(cc,oc),cc.prototype.addRule=function(e,t,o){var n=this;"string"==typeof e&&(e=[e]),e.forEach(function(e){n.canExecute(e,t,function(e,t,n){return o(e)},!0)})},cc.prototype.init=function(){},en(uc,cc),uc.$inject=["eventBus"],uc.prototype.init=function(){this.addRule("elements.move",function(e){var t=e.target,n=e.shapes;e.position;return fc(n,t)}),this.addRule("connection.create",function(e){return lc(e.source,e.target)}),this.addRule("connection.reconnectStart",function(e){var t=e.connection;return lc(e.hover||e.source,t.target)}),this.addRule("connection.reconnectEnd",function(e){var t=e.connection;return lc(t.source,e.hover||e.target)}),this.addRule("connection.updateWaypoints",function(e){return null}),this.addRule("shape.create",function(e){return pc(e.shape,e.target)})},uc.prototype.canConnect=lc,uc.prototype.canCreate=pc,uc.prototype.canMove=fc;var dc={__depends__:[gi],__init__:["drdRules"],drdRules:["type",uc]};function hc(e){this._model=e}function yc(e,t,o,n,r){oc.call(this,e),this._drdFactory=t,this._drdRules=n,this._definitionPropertiesView=r;var a=this;function s(e){var t=e.context,n=t.shape||t.connection,o=t.oldParent;t.connection&&!Ht(n,"dmn:Association")&&(o=n.target),a.updateParent(n,o)}function c(e){var t=e.context,n=t.shape||t.connection,o=t.parent||t.newParent;t.connection&&!Ht(n,"dmn:Association")&&(o=n.target),a.updateParent(n,o)}function i(e){var t=e.context.shape;(Ht(t,"dmn:DRGElement")||Ht(t,"dmn:TextAnnotation"))&&a.updateBounds(t)}function u(e){a.updateConnectionWaypoints(e.context)}this.executed(["connection.layout","connection.create","connection.reconnectEnd","connection.reconnectStart"],function(e){var t,n=e.context;n.cropped||((t=n.connection).waypoints=o.getCroppedWaypoints(t),n.cropped=!0)}),this.reverted(["connection.layout"],function(e){delete e.context.cropped}),this.executed(["shape.create","shape.delete","connection.create","connection.move","connection.delete"],s),this.reverted(["shape.create","shape.delete","connection.create","connection.move","connection.delete"],c),this.executed(["shape.create","shape.move"],i),this.reverted(["shape.create","shape.move"],i),this.executed(["connection.layout","connection.updateWaypoints","connection.move"],u),this.reverted(["connection.layout","connection.updateWaypoints","connection.move"],u),this.executed(["connection.create"],function(e){var t,n,o=e.context,r=o.connection,i=o.target.businessObject;Ht(r,"dmn:Association")?s(e):(a.updateSemanticParent(r.businessObject,i),t=o.di,n=i.extensionElements.values,w(t.waypoints,function(e,t){e.x=r.waypoints[t].x,e.y=r.waypoints[t].y}),n.push(t))}),this.reverted(["connection.create"],function(e){var t,n,o,r=e.context,i=r.connection;c(e),Ht(i,"dmn:Association")||(t=r.di,-1!==(o=(n=r.target.businessObject.extensionElements.values).indexOf(t))&&n.splice(o,1))}),this.executed(["connection.delete"],function(e){var n,t=e.context,o=Kt(t.connection),r=t.source,i=Kt(t.target);Ht(o,"dmn:Association")||(w(i.extensionElements.values,function(e,t){if(Ht(e,"biodi:Edge")&&r.id===e.source)return n=t,!1}),void 0!==n&&(t.oldDI=i.extensionElements.values[n],i.extensionElements.values.splice(n,1)))}),this.reverted(["connection.delete"],function(e){var t=e.context,n=t.connection,o=Kt(t.target),r=t.oldDI;r&&!Ht(n,"dmn:Association")&&o.extensionElements.values.push(r)}),this.executed(["element.updateProperties"],function(e){r.update()}),this.reverted(["element.updateProperties"],function(e){r.update()}),this.reverted(["connection.reconnectEnd"],function(e){a.updateSemanticParent(e.context.connection.businessObject,e.context.oldTarget.businessObject)})}function vc(e){Ao.call(this),this._drdFactory=e}function mc(e){this._modeling=e}hc.$inject=["moddle"],hc.prototype._needsId=function(e){return e.$instanceOf("dmn:DRGElement")||e.$instanceOf("dmn:Artifact")||e.$instanceOf("dmn:DMNElement")},hc.prototype._ensureId=function(e){var t=(e.$type||"").replace(/^[^:]*:/g,"")+"_";!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e))},hc.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n},hc.prototype.createDi=function(){return this.create("dmn:ExtensionElements",{values:[]})},hc.prototype.createDiBounds=function(e){return this.create("biodi:Bounds",e)},hc.prototype.createDiEdge=function(e,t){var n=this,o=[];return w(t||[],function(e){o.push(n.createDiWaypoint(e))}),this.create("biodi:Edge",{waypoints:o,source:e.id})},hc.prototype.createDiWaypoint=function(e){return this.create("biodi:Waypoint",e)},en(yc,oc),yc.$inject=["eventBus","drdFactory","connectionDocking","drdRules","definitionPropertiesView"],yc.prototype.updateParent=function(e,t){var n=e.parent;Ht(e,"dmn:DRGElement")||Ht(e,"dmn:Artifact")||(n=t);var o=e.businessObject,r=n&&n.businessObject;this.updateSemanticParent(o,r),this.updateExtensionElements(o)},yc.prototype.updateBounds=function(e){var t,n,o=this._drdFactory,r=Kt(e).extensionElements;r&&((n=(t=r.values)[0])?t[0]=R(n,{x:e.x,y:e.y,width:e.width,height:e.height}):t.push(o.createDiBounds({x:e.x,y:e.y,width:e.width,height:e.height})))},yc.prototype.updateExtensionElements=function(e){var t=e.extensionElements;t&&!t.$parent&&(t.$parent=e)},yc.prototype.updateSemanticParent=function(e,t){var n,o;e.$parent!==t&&(e.$instanceOf("dmn:DRGElement")?n="drgElements":e.$instanceOf("dmn:Artifact")?n="artifacts":e.$instanceOf("dmn:InformationRequirement")?n="informationRequirement":e.$instanceOf("dmn:AuthorityRequirement")?n="authorityRequirement":e.$instanceOf("dmn:KnowledgeRequirement")&&(n="knowledgeRequirement"),e.$parent&&Yn(o=e.$parent.get(n),e),t?(o=t.get(n))&&(o.push(e),e.$parent=t):e.$parent=null)},yc.prototype.updateConnectionWaypoints=function(e){var t,r=this._drdFactory,n=e.connection,i=n.source,o=n.target;(t=Ht(n,"dmn:Association")?n.businessObject.extensionElements:o.businessObject.extensionElements).values=v(t.values,function(o){return Ht(o,"biodi:Edge")&&o.source===i.id&&(o.waypoints=[],w(n.waypoints,function(e,t){var n=r.createDiWaypoint(A(e,["x","y"]));(n.$parent=o).waypoints.push(n)})),o})},en(vc,Ao),vc.$inject=["drdFactory"],vc.prototype.baseCreate=Ao.prototype.create,vc.prototype.create=function(e,t){return this.createDrdElement(e,t)},vc.prototype.createDrdElement=function(e,t){var n,o=this._drdFactory,r=(t=t||{}).businessObject;if(!r){if(!t.type)throw new Error("no shape type specified");r=o.create(t.type)}return"root"===e||"connection"===e||r.extensionElements||(r.extensionElements=o.createDi()),n=this._getDefaultSize(r),t=R({businessObject:r,id:r.id},n,t),this.baseCreate(e,t)},vc.prototype._getDefaultSize=function(e){return Ht(e,"dmn:Decision")?{width:180,height:80}:Ht(e,"dmn:InputData")?{width:125,height:45}:Ht(e,"dmn:KnowledgeSource")?{width:100,height:63}:Ht(e,"dmn:BusinessKnowledgeModel")?{width:135,height:46}:{width:100,height:80}},mc.$inject=["modeling"],mc.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var n=e.target||t.parent,o=e.shape;o=e.shape=this._modeling.createShape(o,e.position,n,{attach:e.attach}),e.shape=o},mc.prototype.postExecute=function(e){var t,n,o=e.connectionParent||e.shape.parent;t=e.source,n=e.shape,i(t.outgoing,function(e){return e.target===n})||this._modeling.connect(e.source,e.shape,e.connection,o)};var gc=Math.round;function bc(e){this._canvas=e}function _c(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 wc(e,t){this._canvas=e,this._modeling=t}function xc(e,t,n){var o=Fr(t),r=Fr(n),i=Ur(e,o),a=i.x*(n.width/t.width),s=i.y*(n.height/t.height);return Ca({x:r.x+a,y:r.y+s})}function Cc(e,t,n){var o=jc(e)[0];return xc(o.original||o,n,t)}function Ec(e,t,n){var o=jc(e),r=o[o.length-1];return xc(r.original||r,n,t)}function kc(e,t,n){return Cc(e,t,Oc(t,n))}function Sc(e,t,n){return Ec(e,t,Oc(t,n))}function Oc(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function jc(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function Pc(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}function Tc(e){this._modeling=e}function Rc(e){this._modeling=e,this._helper=new Tc(e)}function Ac(e){this._modeling=e}function Dc(e,t){this._modeling=e,this._rules=t}function Mc(e){this._modeling=e}function Bc(e){this._modeling=e}function Ic(e){bc.call(this,e)}bc.$inject=["canvas"],bc.prototype.execute=function(e){var t=e.shape,n=e.position,o=e.parent,r=e.parentIndex;if(!o)throw new Error("parent required");if(!n)throw new Error("position required");return void 0!==n.width?R(t,n):R(t,{x:n.x-gc(t.width/2),y:n.y-gc(t.height/2)}),this._canvas.addShape(t,o,r),t},bc.prototype.revert=function(e){this._canvas.removeShape(e.shape)},wc.$inject=["canvas","modeling"],wc.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;_c(n.incoming,function(e){t.removeConnection(e,{nested:!0})}),_c(n.outgoing,function(e){t.removeConnection(e,{nested:!0})}),_c(n.children,function(e){e.waypoints?t.removeConnection(e,{nested:!0}):t.removeShape(e,{nested:!0})})},wc.prototype.execute=function(e){var t=this._canvas,n=e.shape,o=n.parent;return e.oldParent=o,e.oldParentIndex=Qn(o.children,n),t.removeShape(n),n},wc.prototype.revert=function(e){var t=this._canvas,n=e.shape,o=e.oldParent,r=e.oldParentIndex;return Jn(o.children,n,r),t.addShape(n,o),n},Pc.prototype.add=function(e,t){return this.addAll([e],t)},Pc.prototype.addAll=function(e,t){return R(this,function(e,t,n){u(t)&&(t=!0),_(t)&&(n=t,t=!0);var o=io((n=n||{}).allShapes),r=io(n.allConnections),i=io(n.enclosedElements),a=io(n.enclosedConnections),s=io(n.topLevel,t&&b(e,function(e){return e.id}));function c(e){s[e.source.id]&&s[e.target.id]&&(s[e.id]=[e]),o[e.source.id]&&o[e.target.id]&&(a[e.id]=i[e.id]=e),r[e.id]=e}return to(e,function(e){if(!(i[e.id]=e).waypoints)return w((o[e.id]=e).incoming,c),w(e.outgoing,c),e.children;a[e.id]=r[e.id]=e}),{allShapes:o,allConnections:r,topLevel:s,enclosedConnections:a,enclosedElements:i}}(e,!!t,this)),this},Tc.prototype.moveRecursive=function(e,t,n){return e?this.moveClosure(this.getClosure(e),t,n):[]},Tc.prototype.moveClosure=function(e,o,r,t,n){var i=this._modeling,a=e.allShapes,s=e.allConnections,c=e.enclosedConnections,u=e.topLevel,l=!1;n&&n.parent===r&&(l=!0),w(a,function(e){i.moveShape(e,o,u[e.id]&&!l&&r,{recurse:!1,layout:!1})}),w(s,function(e){var t=!!a[e.source.id],n=!!a[e.target.id];c[e.id]&&t&&n?i.moveConnection(e,o,u[e.id]&&!l&&r):i.layoutConnection(e,{connectionStart:t&&kc(e,e.source,o),connectionEnd:n&&Sc(e,e.target,o)})})},Tc.prototype.getClosure=function(e){return(new Pc).addAll(e,!0)},Rc.$inject=["modeling"],Rc.prototype.execute=function(e){var t=e.shape,n=e.delta,o=e.newParent||t.parent,r=e.newParentIndex,i=t.parent;return e.oldBounds=A(t,["x","y","width","height"]),e.oldParent=i,e.oldParentIndex=Yn(i.children,t),Jn(o.children,t,r),R(t,{parent:o,x:t.x+n.x,y:t.y+n.y}),t},Rc.prototype.postExecute=function(e){var t=e.shape,n=e.delta,o=e.hints,r=this._modeling;!1!==o.layout&&(w(t.incoming,function(e){r.layoutConnection(e,{connectionEnd:Sc(e,t,n)})}),w(t.outgoing,function(e){r.layoutConnection(e,{connectionStart:kc(e,t,n)})})),!1!==o.recurse&&this.moveChildren(e)},Rc.prototype.revert=function(e){var t=e.shape,n=e.oldParent,o=e.oldParentIndex,r=e.delta;return Jn(n.children,t,o),R(t,{parent:n,x:t.x-r.x,y:t.y-r.y}),t},Rc.prototype.moveChildren=function(e){var t=e.delta,n=e.shape;this._helper.moveRecursive(n.children,t,null)},Rc.prototype.getNewParent=function(e){return e.newParent||e.shape.parent},Ac.$inject=["modeling"],Ac.prototype.execute=function(e){var t=e.shape,n=e.newBounds,o=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(o&&(n.width<o.width||n.height<o.height))throw new Error("width and height cannot be less than minimum height and width");if(!o&&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},R(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},Ac.prototype.postExecute=function(e){var t=e.shape,n=e.oldBounds,o=this._modeling;w(t.incoming,function(e){o.layoutConnection(e,{connectionEnd:Ec(e,t,n)})}),w(t.outgoing,function(e){o.layoutConnection(e,{connectionStart:Cc(e,t,n)})})},Ac.prototype.revert=function(e){var t=e.shape,n=e.oldBounds;return R(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},Dc.$inject=["modeling","rules"],Dc.prototype.preExecute=function(e){var o,r=this,t=this._modeling,i=this._rules,n=e.oldShape,a=e.newData,s=e.hints;function c(e,t,n,o){return i.allowed(e,{source:t,target:n,connection:o})}var u,l={x:a.x,y:a.y};o=e.newShape=e.newShape||r.createShape(a,l,n.parent,s),n.host&&t.updateAttachment(o,n.host),!1!==s.moveChildren&&(u=n.children.slice(),t.moveElements(u,{x:0,y:0},o));var p=n.incoming.slice(),f=n.outgoing.slice();w(p,function(e){var t=e.waypoints,n=t[t.length-1];c("connection.reconnectEnd",e.source,o,e)&&r.reconnectEnd(e,o,n)}),w(f,function(e){var t=e.waypoints[0],n=e.target;c("connection.reconnectStart",o,n,e)&&r.reconnectStart(e,o,t)})},Dc.prototype.postExecute=function(e){var t=this._modeling,n=e.oldShape,o=e.newShape;w(o.incoming,function(e){t.layoutConnection(e,{endChanged:!0})}),w(o.outgoing,function(e){t.layoutConnection(e,{startChanged:!0})}),t.removeShape(n)},Dc.prototype.execute=function(e){},Dc.prototype.revert=function(e){},Dc.prototype.createShape=function(e,t,n,o){return this._modeling.createShape(e,t,n,o)},Dc.prototype.reconnectStart=function(e,t,n){this._modeling.reconnectStart(e,t,n)},Dc.prototype.reconnectEnd=function(e,t,n){this._modeling.reconnectEnd(e,t,n)},Mc.$inject=["modeling"],Mc.prototype.execute=function(e){var t,n,o,r=e.shape,i=r.children;return e.oldChildrenVisibility=(t={},i.forEach(function(e){t[e.id]=e.hidden}),t),r.collapsed=!r.collapsed,n=i,o=r.collapsed,n.forEach(function(e){e.hidden=o}),[r].concat(i)},Mc.prototype.revert=function(e){var t,n=e.shape,o=e.oldChildrenVisibility,r=n.children;return t=o,r.forEach(function(e){e.hidden=t[e.id]}),n.collapsed=!n.collapsed,[n].concat(r)},Bc.$inject=["modeling"],Bc.prototype.preExecute=function(e){var n=this._modeling,t=e.resizingShapes,o=e.delta,r=e.direction;w(t,function(e){var t=function(e,t,n){var o=n.x,r=n.y;switch(t){case"n":return{x:e.x,y:e.y+r,width:e.width,height:e.height-r};case"s":return{x:e.x,y:e.y,width:e.width,height:e.height+r};case"w":return{x:e.x+o,y:e.y,width:e.width-o,height:e.height};case"e":return{x:e.x,y:e.y,width:e.width+o,height:e.height};default:throw new Error("unrecognized direction: "+t)}}(e,r,o);n.resizeShape(e,t)})},Bc.prototype.postExecute=function(e){var t=this._modeling,n=e.movingShapes,o=e.delta;t.moveElements(n,o,void 0,{autoResize:!1,attach:!1})},Bc.prototype.execute=function(e){},Bc.prototype.revert=function(e){},en(Ic,bc),Ic.$inject=["canvas"];var Nc=bc.prototype.execute;Ic.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,Nc.call(this,e)};var Vc=bc.prototype.revert;function Lc(e,t){this._canvas=e,this._layouter=t}function $c(e,t){this._canvas=e,this._modeling=t}function Fc(){}function Uc(e,t){this._layouter=e,this._canvas=t}function zc(){}function Wc(){}function Hc(e){this._helper=new Tc(e)}function Gc(e,t){this._modeling=e,this._elementRegistry=t}function qc(e){this._modeling=e}Ic.prototype.revert=function(e){return e.shape.labelTarget=null,Vc.call(this,e)},Lc.$inject=["canvas","layouter"],Lc.prototype.execute=function(e){var t=e.connection,n=e.source,o=e.target,r=e.parent,i=e.parentIndex,a=e.hints;if(!n||!o)throw new Error("source and target required");if(!r)throw new Error("parent required");return t.source=n,t.target=o,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,a)),this._canvas.addConnection(t,r,i),t},Lc.prototype.revert=function(e){var t=e.connection;this._canvas.removeConnection(t),t.source=null,t.target=null},$c.$inject=["canvas","modeling"],$c.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=Qn(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},$c.prototype.revert=function(e){var t=e.connection,n=e.parent,o=e.parentIndex;return t.source=e.source,t.target=e.target,Jn(n.children,t,o),this._canvas.addConnection(t,n),t},Fc.prototype.execute=function(e){var t=e.connection,n=e.delta,o=e.newParent||t.parent,r=e.newParentIndex,i=t.parent;return e.oldParent=i,e.oldParentIndex=Yn(i.children,t),Jn(o.children,t,r),t.parent=o,w(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},Fc.prototype.revert=function(e){var t=e.connection,n=t.parent,o=e.oldParent,r=e.oldParentIndex,i=e.delta;return Yn(n.children,t),Jn(o.children,t,r),t.parent=o,w(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},Uc.$inject=["layouter","canvas"],Uc.prototype.execute=function(e){var t=e.connection;return R(e,{oldWaypoints:t.waypoints}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t},Uc.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t},zc.prototype.execute=function(e){var t=e.connection,n=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=n,t},zc.prototype.revert=function(e){var t=e.connection,n=e.oldWaypoints;return t.waypoints=n,t},Wc.$inject=[],Wc.prototype.execute=function(e){var t,n=e.newSource,o=e.newTarget,r=e.connection,i=e.dockingOrPoints,a=r.waypoints;if(!n&&!o)throw new Error("newSource or newTarget are required");if(n&&o)throw new Error("must specify either newSource or newTarget");return e.oldWaypoints=a,y(i)?t=i:(t=a.slice()).splice(n?0:-1,1,i),n&&(e.oldSource=r.source,r.source=n),o&&(e.oldTarget=r.target,r.target=o),r.waypoints=t,r},Wc.prototype.revert=function(e){var t=e.newSource,n=e.newTarget,o=e.connection;return t&&(o.source=e.oldSource),n&&(o.target=e.oldTarget),o.waypoints=e.oldWaypoints,o},Hc.$inject=["modeling"],Hc.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)},Hc.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)},Gc.$inject=["modeling","elementRegistry"],Gc.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry;w(e.elements,function(e){n.get(e.id)&&(e.waypoints?t.removeConnection(e):t.removeShape(e))})},qc.$inject=["modeling"];var Kc={x:"y",y:"x"};function Xc(e,t){this._modeling=e,this._canvas=t}function Zc(e){this._modeling=e}function Yc(e,t){return Yn(e&&e.attachers,t)}function Jc(e,t,n){if(e){var o=e.attachers;o||(e.attachers=o=[]),Jn(o,t,n)}}function Qc(t,e){w(e,function(e){t[e]&&delete t[e]})}function eu(e,t,n,o,r,i){this._eventBus=e,this._canvas=t,this._selection=n,this._elementFactory=o,this._modeling=r,this._rules=i}qc.prototype.preExecute=function(e){var i=this._modeling,a=e.groups,s=e.axis,c=e.dimension;function u(e,t){e.range.min=Math.min(t[s],e.range.min),e.range.max=Math.max(t[s]+t[c],e.range.max)}function l(e){return e[s]+e[c]/2}function p(e){return e.length-1}function f(e){return e.max-e.min}var d,t,h=a[0],y=p(a),v=a[y],m=0;w(a,function(o,e){var t,n,r;o.elements.length<2?e&&e!==a.length-1&&(u(o,o.elements[0]),m+=f(o.range)):(n=(t=C(o.elements,s))[0],e===y&&(n=t[p(t)]),r=l(n),o.range=null,w(t,function(e){var t,n;(n={y:0})[s]=r-l(t=e),n[s]&&(n[Kc[s]]=0,i.moveElements([t],n,t.parent)),null!==o.range?u(o,e):o.range={min:e[s],max:e[s]+e[c]}}),e&&e!==a.length-1&&(m+=f(o.range)))}),t=Math.abs(v.range.min-h.range.max),(d=Math.round((t-m)/(a.length-1)))<a.length-1||w(a,function(n,e){var o,r={};n!==h&&n!==v&&(o=a[e-1],n.range.max=0,w(n.elements,function(e,t){r[Kc[s]]=0,r[s]=o.range.max-e[s]+d,n.range.min!==e[s]&&(r[s]+=e[s]-n.range.min),r[s]&&i.moveElements([e],r,e.parent),n.range.max=Math.max(e[s]+e[c],t?n.range.max:0)}))})},qc.prototype.postExecute=function(e){},Xc.$inject=["modeling","canvas"],Xc.prototype.preExecute=function(e){var n=this._modeling,t=e.elements,o=e.alignment;w(t,function(e){var t={x:0,y:0};o.left?t.x=o.left-e.x:o.right?t.x=o.right-e.width-e.x:o.center?t.x=o.center-Math.round(e.width/2)-e.x:o.top?t.y=o.top-e.y:o.bottom?t.y=o.bottom-e.height-e.y:o.middle&&(t.y=o.middle-Math.round(e.height/2)-e.y),n.moveElements([e],t,e.parent)})},Xc.prototype.postExecute=function(e){},Zc.$inject=["modeling"],Zc.prototype.execute=function(e){var t=e.shape,n=e.newHost,o=t.host;return e.oldHost=o,e.attacherIdx=Yc(o,t),Jc(n,t),t.host=n,t},Zc.prototype.revert=function(e){var t=e.shape,n=e.newHost,o=e.oldHost,r=e.attacherIdx;return t.host=o,Yc(n,t),Jc(o,t,r),t},eu.$inject=["eventBus","canvas","selection","elementFactory","modeling","rules"],eu.prototype.preExecute=function(e){var s=this._eventBus,c=this,u=e.tree,l=e.topParent,p=e.position;u.createdElements={},u.labels=[],w(u,function(e,t){var a=parseInt(t,10);isNaN(a)||(a||(e=v(e,function(e){return e.parent=l,e})),w(e=C(e,"priority"),function(e){var t,n=e.id,o=e.parent,r={},i=R({},e);if(a&&(i.parent=c._getCreatedElement(o,u)),o)if(s.fire("element.paste",{createdElements:u.createdElements,descriptor:i}),o=i.parent,i.waypoints)(i=c._createConnection(i,o,p,u))&&(u.createdElements[n]={element:i,descriptor:e});else{if(i.parent!==l&&(r.root=!1),i.host&&(r.attach=!0,o=c._getCreatedElement(i.host,u)),i.labelTarget)return u.labels.push(i);t={x:Math.round(p.x+i.delta.x+i.width/2),y:Math.round(p.y+i.delta.y+i.height/2)},Qc(i,["id","parent","delta","host","priority"]),(i=c._createShape(i,o,t,r))&&(u.createdElements[n]={element:i,descriptor:e})}}))})},eu.prototype.postExecute=function(e){var i=this._modeling,t=this._selection,a=this,s=e.tree,n=s.labels,o=[];w(n,function(t){var e,n,o,r=a._getCreatedElement(t.labelTarget,s);r&&(e=r.labels)&&e.length&&(n={x:r.x,y:r.y},r.waypoints&&(n=r.waypoints[0]),w(e,function(e){o={x:Math.round(n.x-e.x+t.delta.x),y:Math.round(n.y-e.y+t.delta.y)},i.moveShape(e,o,r.parent)}))}),w(s[0],function(e){var t=e.id,n=s.createdElements[t];n&&o.push(n.element)}),t.select(o)},eu.prototype._createConnection=function(n,e,o,t){var r,i,a=this._modeling,s=this._rules;return n.waypoints=v(n.waypoints,function(e,t){return{x:Math.round(o.x+n.delta[t].x),y:Math.round(o.y+n.delta[t].y)}}),r=this._getCreatedElement(n.source,t),i=this._getCreatedElement(n.target,t),r&&i&&s.allowed("element.paste",{source:r,target:i})?(Qc(n,["id","parent","delta","source","target","width","height","priority"]),a.createConnection(r,i,n,e)):null},eu.prototype._createShape=function(e,t,n,o,r){var i=this._modeling,a=this._elementFactory;if(!this._rules.allowed("element.paste",{element:e,position:n,parent:t}))return null;var s=a.createShape(e);return i.createShape(s,n,t,o,r),s},eu.prototype._getCreatedElement=function(e,t){return t.createdElements[e]&&t.createdElements[e].element};var tu="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};function nu(e,t,n){this._eventBus=e,this._elementFactory=t,this._commandStack=n;var o=this;e.on("diagram.init",function(){o.registerHandlers(n)})}nu.$inject=["eventBus","elementFactory","commandStack"],nu.prototype.getHandlers=function(){return{"shape.append":mc,"shape.create":bc,"shape.delete":wc,"shape.move":Rc,"shape.resize":Ac,"shape.replace":Dc,"shape.toggleCollapse":Mc,spaceTool:Bc,"label.create":Ic,"connection.create":Lc,"connection.delete":$c,"connection.move":Fc,"connection.layout":Uc,"connection.updateWaypoints":zc,"connection.reconnectStart":Wc,"connection.reconnectEnd":Wc,"elements.move":Hc,"elements.delete":Gc,"elements.distribute":qc,"elements.align":Xc,"element.updateAttachment":Zc,"elements.paste":eu}},nu.prototype.registerHandlers=function(n){w(this.getHandlers(),function(e,t){n.registerHandler(t,e)})},nu.prototype.moveShape=function(e,t,n,o,r){"object"===(void 0===o?"undefined":tu(o))&&(r=o,o=null);var i={shape:e,delta:t,newParent:n,newParentIndex:o,hints:r||{}};this._commandStack.execute("shape.move",i)},nu.prototype.updateAttachment=function(e,t){var n={shape:e,newHost:t};this._commandStack.execute("element.updateAttachment",n)},nu.prototype.moveElements=function(e,t,n,o){var r,i=(o=o||{}).attach,a=n;!0===i?a=(r=n).parent:!1===i&&(r=null);var s={shapes:e,delta:t,newParent:a,newHost:r,hints:o};this._commandStack.execute("elements.move",s)},nu.prototype.moveConnection=function(e,t,n,o,r){"object"===(void 0===o?"undefined":tu(o))&&(r=o,o=void 0);var i={connection:e,delta:t,newParent:n,newParentIndex:o,hints:r||{}};this._commandStack.execute("connection.move",i)},nu.prototype.layoutConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.layout",n)},nu.prototype.createConnection=function(e,t,n,o,r,i){"object"===(void 0===n?"undefined":tu(n))&&(i=r,r=o,o=n,n=void 0);var a={source:e,target:t,parent:r,parentIndex:n,connection:o=this._create("connection",o),hints:i};return this._commandStack.execute("connection.create",a),a.connection},nu.prototype.createShape=function(e,t,n,o,r){"number"!=typeof o&&(r=o,o=void 0);var i,a,s=(r=r||{}).attach;e=this._create("shape",e),s?(i=n.parent,a=n):i=n;var c={position:t,shape:e,parent:i,parentIndex:o,host:a,hints:r};return this._commandStack.execute("shape.create",c),c.shape},nu.prototype.createLabel=function(e,t,n,o){n=this._create("label",n);var r={labelTarget:e,position:t,parent:o||e.parent,shape:n};return this._commandStack.execute("label.create",r),r.shape},nu.prototype.appendShape=function(e,t,n,o,r){r=r||{};var i={source:e,position:n,target:o,shape:t=this._create("shape",t),connection:r.connection,connectionParent:r.connectionParent,attach:r.attach};return this._commandStack.execute("shape.append",i),i.shape},nu.prototype.removeElements=function(e){var t={elements:e};this._commandStack.execute("elements.delete",t)},nu.prototype.distributeElements=function(e,t,n){var o={groups:e,axis:t,dimension:n};this._commandStack.execute("elements.distribute",o)},nu.prototype.removeShape=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.delete",n)},nu.prototype.removeConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.delete",n)},nu.prototype.replaceShape=function(e,t,n){var o={oldShape:e,newData:t,hints:n||{}};return this._commandStack.execute("shape.replace",o),o.newShape},nu.prototype.pasteElements=function(e,t,n){var o={tree:e,topParent:t,position:n};this._commandStack.execute("elements.paste",o)},nu.prototype.alignElements=function(e,t){var n={elements:e,alignment:t};this._commandStack.execute("elements.align",n)},nu.prototype.resizeShape=function(e,t,n){var o={shape:e,newBounds:t,minBounds:n};this._commandStack.execute("shape.resize",o)},nu.prototype.createSpace=function(e,t,n,o){var r={movingShapes:e,resizingShapes:t,delta:n,direction:o};this._commandStack.execute("spaceTool",r)},nu.prototype.updateWaypoints=function(e,t,n){var o={connection:e,newWaypoints:t,hints:n||{}};this._commandStack.execute("connection.updateWaypoints",o)},nu.prototype.reconnectStart=function(e,t,n){var o={connection:e,newSource:t,dockingOrPoints:n};this._commandStack.execute("connection.reconnectStart",o)},nu.prototype.reconnectEnd=function(e,t,n){var o={connection:e,newTarget:t,dockingOrPoints:n};this._commandStack.execute("connection.reconnectEnd",o)},nu.prototype.connect=function(e,t,n,o){return this.createConnection(e,t,n||{},e.parent,o)},nu.prototype._create=function(e,t){return t instanceof So?t:this._elementFactory.create(e,t)},nu.prototype.toggleCollapse=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.toggleCollapse",n)};var ou="id";function ru(e,t){this._elementRegistry=e,this._moddle=t}function iu(e,t){return ou in e&&e.id!==t.id}function au(n,e){w(e,function(e,t){n.set(t,e)})}function su(e){this._moddle=e}function cu(e,t,n,o,r){this._canvas=e,this._drdRules=r,nu.call(this,t,n,o)}function uu(){}function lu(){}function pu(e,t){return e?e.original||e:ka(t)}function fu(e){return R({original:e.point.original||e.point},e.actual)}function du(e,t){this._elementRegistry=e,this._graphicsFactory=t}ru.$inject=["elementRegistry","moddle"],ru.prototype.execute=function(e){var t=e.element,n=[t];if(!t)throw new Error("element required");var o,r=this._elementRegistry,i=this._moddle.ids,a=t.businessObject,s=e.properties,c=e.oldProperties||(o=a,x(m(s),function(e,t){return e[t]=o.get(t),e},{}));return iu(s,a)&&(i.unclaim(a.id),r.updateId(t,s.id),i.claim(s.id,a)),"name"in s&&t.label&&n.push(t.label),au(a,s),e.oldProperties=c,e.changed=n},ru.prototype.revert=function(e){var t=e.element,n=e.properties,o=e.oldProperties,r=t.businessObject,i=this._elementRegistry,a=this._moddle.ids;return au(r,o),iu(n,r)&&(a.unclaim(n.id),i.updateId(t,o.id),a.claim(o.id,r)),e.changed},su.$inject=["moddle"],su.prototype.execute=function(e){var t=this._moddle.ids,n=e.id,o=e.element;e.claiming?t.claim(n,o):t.unclaim(n)},su.prototype.revert=function(e){var t=this._moddle.ids,n=e.id,o=e.element;e.claiming?t.unclaim(n):t.claim(n,o)},en(cu,nu),cu.$inject=["canvas","eventBus","elementFactory","commandStack","drdRules"],cu.prototype.getHandlers=function(){var e=nu.prototype.getHandlers.call(this);return e["element.updateProperties"]=ru,e["id.updateClaim"]=su,e},cu.prototype.updateProperties=function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})},cu.prototype.claimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t,claiming:!0})},cu.prototype.unclaimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t})},cu.prototype.connect=function(e,t,n,o){var r=this._drdRules,i=this._canvas.getRootElement();return n||(n=r.canConnect(e,t)||{type:"dmn:Association"}),this.createConnection(e,t,n,i,o)},uu.prototype.layoutConnection=function(e,t){return[(t=t||{}).connectionStart||ka(e.source),t.connectionEnd||ka(e.target)]},en(lu,uu),lu.prototype.layoutConnection=function(e,t){t=t||{};var n,o=e.source,r=e.target,i=e.waypoints,a=t.connectionStart,s=t.connectionEnd;return n=(i=i||[]).slice(1,i.length-1),a||(a=pu(i&&i[0],o)),s||(s=pu(i&&i[i.length-1],r)),[a].concat(n,[s])},du.$inject=["elementRegistry","graphicsFactory"],du.prototype.getCroppedWaypoints=function(e,t,n){t=t||e.source,n=n||e.target;var o=this.getDockingPoint(e,t,!0),r=this.getDockingPoint(e,n),i=e.waypoints.slice(o.idx+1,r.idx);return i.unshift(fu(o)),i.push(fu(r)),i},du.prototype.getDockingPoint=function(e,t,n){var o,r,i=e.waypoints;return{point:r=i[o=n?0:i.length-1],actual:this._getIntersection(t,e,n)||r,idx:o}},du.prototype._getIntersection=function(e,t,n){return Oa(this._getShapePath(e),this._getConnectionPath(t),n)},du.prototype._getConnectionPath=function(e){return this._graphicsFactory.getConnectionPath(e)},du.prototype._getShapePath=function(e){return this._graphicsFactory.getShapePath(e)},du.prototype._getGfx=function(e){return this._elementRegistry.getGraphics(e)};var hu={__init__:["modeling","drdUpdater"],__depends__:[sc,dc,Pr,Us,br,Ws],drdFactory:["type",hc],drdUpdater:["type",yc],elementFactory:["type",vc],modeling:["type",cu],layouter:["type",lu],connectionDocking:["type",du]};function yu(e,t,n){this._elementRegistry=e,this._canvas=t,this._styles=n}yu.$inject=["elementRegistry","canvas","styles"],yu.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},yu.prototype.addDragger=function(e,t){var n=this.getGfx(e),o=n.cloneNode(!0),r=n.getBoundingClientRect();return e.waypoints&&function t(e){e.children&&w(e.children,function(e){t(e)});e.style.markerStart="";e.style.markerEnd=""}(o),wn(o,this._styles.cls("djs-dragger",[],{x:r.top,y:r.left})),mn(t,o),o},yu.prototype.addFrame=function(e,t){var n=Dn("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return mn(t,n),n};var vu={__init__:["previewSupport"],previewSupport:["type",yu]},mu=Math.round;function gu(e,i,a,s,r){function c(e,t,n,o){return r.allowed("elements.move",{shapes:e,delta:t,position:n,target:o})}function n(e,t,n){if(!t.waypoints&&t.parent){var o,r={x:(o=t).x+mu(o.width/2),y:o.y+mu(o.height/2)};return i.init(e,r,"shape.move",{cursor:"grabbing",autoActivate:n,data:{shape:t,context:{}}}),!0}}e.on("shape.move.start",1500,function(e){var t,n,o=e.context,r=e.shape,i=s.get().slice();-1===i.indexOf(r)&&(i=[r]),n=b(t=i,"id"),R(o,{shapes:i=h(t,function(e){for(;e=e.parent;)if(n[e.id])return!1;return!0}),validatedShapes:i,shape:r})}),e.on("shape.move.start",1250,function(e){var t=e.context,n=t.validatedShapes;if(!(t.canExecute=c(n)))return!1}),e.on("shape.move.move",500,function(e){var t,n=e.context,o=n.validatedShapes,r=e.hover,i={x:e.dx,y:e.dy};t=c(o,i,{x:e.x,y:e.y},r),n.delta=i,null!==(n.canExecute=t)?n.target=r:n.target=null}),e.on("shape.move.end",function(e){var t=e.context,n=t.delta,o=t.canExecute,r="attach"===o,i=t.shapes;if(!o)return!1;n.x=mu(n.x),n.y=mu(n.y),a.moveElements(i,n,t.target,{primaryShape:t.shape,attach:r})}),e.on("element.mousedown",function(e){var t=ir(e);if(!t)throw new Error("must supply DOM mousedown event");return n(t,e.element)}),this.start=n}gu.$inject=["eventBus","dragging","modeling","selection","rules"];var bu="djs-dragging",_u="drop-ok",wu="drop-not-ok",xu="new-parent",Cu="attach-ok";function Eu(e,t,a,s,c){function u(e){var t,n=l(e);return h(t=n,function(e){return!e.waypoints||g(t,E({id:e.source.id}))&&g(t,E({id:e.target.id}))})}function l(e){var t=no(e,!0),n=v(t,function(e){return(e.incoming||[]).concat(e.outgoing||[])});return f(t.concat(n))}function p(t,n){[Cu,_u,wu,xu].forEach(function(e){e===n?a.addMarker(t,e):a.removeMarker(t,e)})}e.on("shape.move.start",499,function(e){var t=e.context,n=t.shapes,o=t.allDraggedElements,r=u(n);if(!t.dragGroup){var i=Dn("g");wn(i,s.cls("djs-drag-group",["no-events"])),mn(a.getDefaultLayer(),i),t.dragGroup=i}r.forEach(function(e){c.addDragger(e,t.dragGroup)}),w(o=o?f([o,l(n)]):l(n),function(e){a.addMarker(e,bu)}),t.allDraggedElements=o,t.differentParents=1!==m(b(n,function(e){return e.parent&&e.parent.id})).length}),e.on("shape.move.move",499,function(e){var t=e.context,n=t.dragGroup,o=t.target,r=t.shape.parent,i=t.canExecute;o&&("attach"===i?p(o,Cu):t.canExecute&&o&&o.id!==r.id?p(o,xu):p(o,t.canExecute?_u:wu)),Do(n,e.dx,e.dy)}),e.on(["shape.move.out","shape.move.cleanup"],function(e){var t=e.context.target;t&&p(t,null)}),e.on("shape.move.cleanup",function(e){var t=e.context,n=t.allDraggedElements,o=t.dragGroup;w(n,function(e){a.removeMarker(e,bu)}),o&&Pn(o)}),this.makeDraggable=function(e,t,n){c.addDragger(t,e.dragGroup),n&&a.addMarker(t,bu),e.allDraggedElements?e.allDraggedElements.push(t):e.allDraggedElements=[t]}}Eu.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];var ku={__depends__:[fr,br,hr,gi,vi,vu],__init__:["move","movePreview"],move:["type",gu],movePreview:["type",Eu]},Su=".djs-palette-toggle";function Ou(e,t){this._eventBus=e,this._canvas=t,this._providers=[];var n=this;e.on("tool-manager.update",function(e){var t=e.tool;n.updateToolHighlight(t)}),e.on("i18n.changed",function(){n._update()}),e.on("diagram.init",function(){n._diagramInitialized=!0,n._providers.length&&(n._init(),n._update())})}Ou.$inject=["eventBus","canvas"],Ou.prototype.registerProvider=function(e){this._providers.push(e),this._diagramInitialized&&(this._container||this._init(),this._update())},Ou.prototype.getEntries=function(){var n={};return w(this._providers,function(e){w(e.getPaletteEntries(),function(e,t){n[t]=e})}),n},Ou.prototype._init=function(){var e=this._canvas,t=this._eventBus,n=e.getContainer(),o=this._container=wt(Ou.HTML_MARKUP),r=this;n.appendChild(o),_t.bind(o,".djs-palette-toggle, .entry","click",function(e){var t=e.delegateTarget;if(St(t,Su))return r.toggle();r.trigger("click",e)}),gt.bind(o,"mousedown",function(e){e.stopPropagation()}),_t.bind(o,".entry","dragstart",function(e){r.trigger("dragstart",e)}),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:o})},Ou.prototype._toggleState=function(e){e=e||{};var t,n=this._getParentContainer(),o=this._container,r=this._eventBus,i=st(o);t="twoColumn"in e?e.twoColumn:this._needsCollapse(n.clientHeight,this._entries||{}),i.toggle("two-column",t),"open"in e&&i.toggle("open",e.open),r.fire("palette.changed",{twoColumn:t,open:this.isOpen()})},Ou.prototype._update=function(){var u=Ot(".djs-palette-entries",this._container),e=this._entries=this.getEntries();ut(u),w(e,function(e,t){var n=e.group||"default",o=Ot("[data-group="+n+"]",u);o||(o=wt('<div class="group" data-group="'+n+'"></div>'),u.appendChild(o));var r,i,a,s=e.html||(e.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'),c=wt(s);o.appendChild(c),e.separator||(nt(c,"data-action",t),e.title&&nt(c,"title",e.title),e.className&&(r=c,i=e.className,a=st(r),(y(i)?i:i.split(/\s+/g)).forEach(function(e){a.add(e)})),e.imageUrl&&c.appendChild(wt('<img src="'+e.imageUrl+'">')))}),this.open()},Ou.prototype.trigger=function(e,t,n){var o,r,i,a=this._entries,s=t.delegateTarget||t.target;if(!s)return t.preventDefault();(o=a[nt(s,"data-action")])&&(r=o.action,i=t.originalEvent||t,p(r)?"click"===e&&r(i,n):r[e]&&r[e](i,n),t.preventDefault())},Ou.prototype._layoutChanged=function(){this._toggleState({})},Ou.prototype._needsCollapse=function(e,t){return e<46*Object.keys(t).length+50},Ou.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},Ou.prototype.open=function(){this._toggleState({open:!0})},Ou.prototype.toggle=function(e){this.isOpen()?this.close():this.open()},Ou.prototype.isActiveTool=function(e){return e&&this._activeTool===e},Ou.prototype.updateToolHighlight=function(o){var e;this._toolsContainer||(e=Ot(".djs-palette-entries",this._container),this._toolsContainer=Ot("[data-group=tools]",e)),w(this._toolsContainer.children,function(e){var t=e.getAttribute("data-action");if(t){var n=st(e);t=t.replace("-tool",""),n.contains("entry")&&t===o?n.add("highlighted-entry"):n.remove("highlighted-entry")}})},Ou.prototype.isOpen=function(){return st(this._container).has("open")},Ou.prototype._getParentContainer=function(){return this._canvas.getContainer()},Ou.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';var ju={__init__:["palette"],palette:["type",Ou]};function Pu(e,t){this._eventBus=e,this._dragging=t,this._tools=[],this._active=null}Pu.$inject=["eventBus","dragging"],Pu.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)},Pu.prototype.isActive=function(e){return e&&this._active===e},Pu.prototype.length=function(e){return this._tools.length},Pu.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))},Pu.prototype.bindEvents=function(t,e){var n=this._eventBus,o=this._dragging,r=[];n.on(e.tool+".init",function(e){if(!e.context.reactivate&&this.isActive(t))return this.setActive(null),void o.cancel();this.setActive(t)},this),w(e,function(e){r.push(e+".ended"),r.push(e+".canceled")}),n.on(r,250,function(e){var t=e.originalEvent;this._active&&(t&&ht(t.target,'.group[data-group="tools"]')||this.setActive(null))},this)};var Tu={__depends__:[vi],__init__:["toolManager"],toolManager:["type",Pu]},Ru="crosshair";function Au(n,o,e,r,t,i){this._selection=t,this._dragging=e;var a=this,s=function(e){var t,n=o.getDefaultLayer();wn(t=e.frame=Dn("rect"),{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),mn(n,t)},c=function(e){var t=e.frame,n=e.bbox;wn(t,{x:n.x,y:n.y,width:n.width,height:n.height})},u=function(e){e.frame&&jn(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(){a.activateLasso(e.originalEvent,!0)})}),n.on("lasso.end",function(e){var t=Du(e),n=r.filter(function(e){return e});a.select(n,t)}),n.on("lasso.start",function(e){var t=e.context;t.bbox=Du(e),s(t)}),n.on("lasso.move",function(e){var t=e.context;t.bbox=Du(e),c(t)}),n.on("lasso.cleanup",function(e){var t=e.context;u(t)}),n.on("element.mousedown",1500,function(e){if(n=ir(t=e)||t,cr(t)&&n.shiftKey)return a.activateLasso(e.originalEvent),!0;var t,n})}function Du(e){var t={x:e.x-e.dx,y:e.y-e.dy},n={x:e.x,y:e.y};return t.x<=n.x&&t.y<n.y||t.x<n.x&&t.y<=n.y?{x:t.x,y:t.y,width:n.x-t.x,height:n.y-t.y}:n.x<=t.x&&t.y<n.y||n.x<t.x&&t.y<=n.y?{x:n.x,y:t.y,width:t.x-n.x,height:n.y-t.y}:t.x<=n.x&&n.y<t.y||t.x<n.x&&n.y<=t.y?{x:t.x,y:n.y,width:n.x-t.x,height:t.y-n.y}:n.x<=t.x&&n.y<t.y||n.x<t.x&&n.y<=t.y?{x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:{x:n.x,y:n.y,width:0,height:0}}Au.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager"],Au.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:Ru,data:{context:{}}})},Au.prototype.activateSelection=function(e){this._dragging.init(e,"lasso.selection",{trapClick:!1,cursor:Ru,data:{context:{}}})},Au.prototype.select=function(e,t){var n,o,r=(n=t,o={},w(e,function(e){var t=e;t.waypoints&&(t=oo(t)),!l(n.y)&&t.x>n.x&&(o[e.id]=e),!l(n.x)&&t.y>n.y&&(o[e.id]=e),t.x>n.x&&t.y>n.y&&(l(n.width)&&l(n.height)&&t.width+t.x<n.width+n.x&&t.height+t.y<n.height+n.y?o[e.id]=e:l(n.width)&&l(n.height)||(o[e.id]=e))}),o);this._selection.select(v(r,function(e){return e}))},Au.prototype.toggle=function(){this.isActive()?this._dragging.cancel():this.activateSelection()},Au.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};var Mu={__depends__:[Tu],__init__:["lassoTool"],lassoTool:["type",Au]};function Bu(e,t,n,o,r){this._palette=e,this._create=t,this._elementFactory=n,this._lassoTool=o,this._translate=r,e.registerProvider(this)}Bu.$inject=["palette","create","elementFactory","lassoTool","translate"],Bu.prototype.getPaletteEntries=function(e){var t={},a=this._create,s=this._elementFactory,n=this._lassoTool;function o(n,e,t,o,r){function i(e){var t=s.createShape(R({type:n},r));a.start(e,t)}return{group:e,className:t,title:o,action:{dragstart:i,click:i}}}return R(t,{"lasso-tool":{group:"tools",className:"dmn-icon-lasso-tool",title:(0,this._translate)("Activate the lasso tool"),action:{click:function(e){n.activateSelection(e)}}},"tool-separator":{group:"tools",separator:!0},"create.decision":o("dmn:Decision","drd","dmn-icon-decision"),"create.input-data":o("dmn:InputData","drd","dmn-icon-input-data"),"create.knowledge-source":o("dmn:KnowledgeSource","drd","dmn-icon-knowledge-source"),"create.business-knowledge-model":o("dmn:BusinessKnowledgeModel","drd","dmn-icon-business-knowledge")}),t};var Iu={__depends__:[or,ju,Ya,Mu],__init__:["paletteProvider"],paletteProvider:["type",Bu]};function Nu(e){li.call(this,e)}en(Nu,li),Nu.prototype._modules=[].concat(Nu.prototype._modules,Nu.prototype._modelingModules=[Va,ls,fs,gs,xs,As,Bs,$s,nc,hu,ku,Iu]);var Vu="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};function Lu(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Vu(t))&&"function"!=typeof t?e:t}function $u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Vu(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function Fu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Uu=function e(t){Fu(this,e),R(this,t),Ku(this,"businessObject",{writable:!0})},zu=function(e){function n(e){Fu(this,n);var t=Lu(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return Ku(t,"rows",{enumerable:!0,value:t.rows||[]}),Ku(t,"cols",{enumerable:!0,value:t.cols||[]}),t}return $u(n,Uu),n}(),Wu=function(e){function n(e){Fu(this,n);var t=Lu(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return Ku(t,"root",{writable:!0}),Ku(t,"cells",{enumerable:!0,value:t.cells||[]}),t}return $u(n,Uu),n}(),Hu=function(e){function n(e){Fu(this,n);var t=Lu(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return Ku(t,"root",{writable:!0}),Ku(t,"cells",{enumerable:!0,value:t.cells||[]}),t}return $u(n,Uu),n}(),Gu=function(e){function n(e){Fu(this,n);var t=Lu(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return Ku(t,"row",{writable:!0}),Ku(t,"col",{writable:!0}),t}return $u(n,Uu),n}(),qu={root:zu,row:Wu,col:Hu,cell:Gu};function Ku(e,t,n){Object.defineProperty(e,t,n)}var Xu=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Zu=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}return Xu(e,[{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=qu[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)}}]),e}(),Yu=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var 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._eventBus=e,this._elements={},e.on("table.clear",this.clear.bind(this))}return Yu(t,[{key:"add",value:function(e,t){var n=e.id;this._elements[n]=e}},{key:"remove",value:function(e){var t=e.id||e;delete this._elements[t]}},{key:"get",value:function(e){return this._elements[e]}},{key:"getAll",value:function(){return Qu(this._elements)}},{key:"forEach",value:function(t){Qu(this._elements).forEach(function(e){return t(e)})}},{key:"filter",value:function(t){return Qu(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")}}]),t}();function Qu(t){return Object.keys(t).map(function(e){return t[e]})}Ju.$inject=["eventBus"];var el=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var tl=function(){function e(t){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._listeners={},t.on("elements.changed",function(e){var t=e.elements;o.elementsChanged(t)}),t.on("root.remove",function(e){var n=e.root.id;o._listeners[n]&&t.once("root.add",function(e){var t=e.root.id;o.updateId(n,t)})}),t.on("element.updateId",function(e){var t=e.element,n=e.newId;o.updateId(t.id,n)})}return el(e,[{key:"elementsChanged",value:function(e){for(var t={},n=e.length,o=0;o<n;o++){var r=e[o].id;if(t[r])return;t[r]=!0;var i=this._listeners[r]&&this._listeners[r].length;if(i)for(var a=0;a<i;a++)this._listeners[r][a]&&this._listeners[r][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){if(this._listeners[e])if(t){var n=this._listeners[e].indexOf(t);-1!==n&&this._listeners[e].splice(n,1)}else this._listeners[e].length=0}},{key:"updateId",value:function(e,t){this._listeners[e]&&(this._listeners[t]=this._listeners[e],delete this._listeners[e])}}]),e}();tl.$inject=["eventBus"];var nl=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var ol=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._listeners={}}return nl(e,[{key:"getComponent",value:function(e,t){var n=this._listeners[e];if(n){for(var o=void 0,r=0;r<n.length&&!(o=n[r].callback(t));r++);return o}}},{key:"getComponents",value:function(e,t){var n=this._listeners[e],o=[];if(!n)return o;for(var r=0;r<n.length;r++){var i=n[r].callback(t);i&&o.push(i)}return o.length,o}},{key:"onGetComponent",value:function(e,t,n){if(p(t)&&(n=t,t=1e3),!l(t))throw new Error("priority must be a number");var o=this._getListeners(e),r=void 0,i=void 0,a={priority:t,callback:n};for(i=0;r=o[i];i++)if(r.priority<t)return void o.splice(i,0,a);o.push(a)}},{key:"offGetComponent",value:function(e,t){var n=this._getListeners(e),o=void 0,r=void 0;if(t)for(r=n.length-1;o=n[r];r--)o.callback===t&&n.splice(r,1);else n.length=0}},{key:"_getListeners",value:function(e){var t=this._listeners[e];return t||(this._listeners[e]=t=[]),t}}]),e}(),rl="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},il="$NO_OP",al="a runtime error occured! Use Inferno in development environment to find the error.",sl=!("undefined"==typeof window||!window.document),cl=Array.isArray;function ul(e){var t=void 0===e?"undefined":rl(e);return"string"===t||"number"===t}function ll(e){return vl(e)||yl(e)}function pl(e){return yl(e)||!1===e||!0===e||vl(e)}function fl(e){return"function"==typeof e}function dl(e){return"string"==typeof e}function hl(e){return"number"==typeof e}function yl(e){return null===e}function vl(e){return void 0===e}function ml(e,t){var n={};if(e)for(var o in e)n[o]=e[o];if(t)for(var r in t)n[r]=t[r];return n}var gl="$";function bl(e,t,n,o,r,i,a,s){return{childFlags:e,children:t,className:n,dom:null,flags:o,key:void 0===r?null:r,parentVNode:null,props:void 0===i?null:i,ref:void 0===a?null:a,type:s}}function _l(e,t,n,o,r,i,a,s){var c=void 0===r?1:r,u=bl(c,o,n,e,a,i,s,t);return 0===c&&Ol(u,u.children),u}function wl(e,t,n,o,r){0<(2&e)&&(e=t.prototype&&fl(t.prototype.render)?4:8);var i=t.defaultProps;if(!ll(i))for(var a in n||(n={}),i)vl(n[a])&&(n[a]=i[a]);if(0<(8&e)){var s=t.defaultHooks;if(!ll(s))if(r)for(var c in s)vl(r[c])&&(r[c]=s[c]);else r=s}var u=bl(1,null,null,e,o,n,r,t),l=jl.createVNode;return fl(l)&&l(u),u}function xl(e,t){return bl(1,ll(e)?"":e,null,16,t,null,null,null)}function Cl(e){var t=e.props;if(t){var n=e.flags;481&n&&(void 0!==t.children&&ll(e.children)&&Ol(e,t.children),void 0!==t.className&&(e.className=t.className||null,t.className=void 0)),void 0!==t.key&&(e.key=t.key,t.key=void 0),void 0!==t.ref&&(e.ref=8&n?ml(e.ref,t.ref):t.ref,t.ref=void 0)}return e}function El(e){var t,n=e.flags;if(14&n){var o,r=e.props;if(!yl(r))for(var i in o={},r)o[i]=r[i];t=wl(n,e.type,o,e.key,e.ref)}else if(481&n){var a=e.children;t=_l(n,e.type,e.className,a,e.childFlags,e.props,e.key,e.ref)}else 16&n?t=xl(e.children,e.key):1024&n&&(t=e);return t}function kl(){return xl("",null)}function Sl(e,t,n,o){for(var r=e.length;n<r;n++){var i=e[n];if(!pl(i)){var a=o+gl+n;if(cl(i))Sl(i,t,0,a);else{if(ul(i))i=xl(i,a);else{var s=i.key,c=dl(s)&&s[0]===gl;yl(i.dom)&&!c||(i=El(i)),yl(s)||c?i.key=a:i.key=o+s}t.push(i)}}}}function Ol(e,t){var n,o=1;if(pl(t))n=t;else if(dl(t))o=2,n=xl(t);else if(hl(t))o=2,n=xl(t+"");else if(cl(t)){var r=t.length;if(0===r)n=null,o=1;else{(Object.isFrozen(t)||!0===t.$)&&(t=t.slice()),o=8;for(var i=0;i<r;i++){var a=t[i];if(pl(a)||cl(a)){Sl(t,n=n||t.slice(0,i),i,"");break}if(ul(a))(n=n||t.slice(0,i)).push(xl(a,gl+i));else{var s=a.key,c=yl(a.dom),u=yl(s),l=!u&&s[0]===gl;!c||u||l?(n=n||t.slice(0,i),c&&!l||(a=El(a)),(u||l)&&(a.key=gl+i),n.push(a)):n&&n.push(a)}}(n=n||t).$=!0}}else yl((n=t).dom)||(n=El(t)),o=2;return e.children=n,e.childFlags=o,e}var jl={afterMount:null,afterRender:null,afterUpdate:null,beforeRender:null,beforeUnmount:null,createVNode:null,roots:[]},Pl="http://www.w3.org/1999/xlink",Tl="http://www.w3.org/XML/1998/namespace",Rl="http://www.w3.org/2000/svg",Al={"xlink:actuate":Pl,"xlink:arcrole":Pl,"xlink:href":Pl,"xlink:role":Pl,"xlink:show":Pl,"xlink:title":Pl,"xlink:type":Pl,"xml:base":Tl,"xml:lang":Tl,"xml:space":Tl},Dl={},Ml=[];function Bl(e,t){e.appendChild(t)}function Il(e,t,n){ll(n)?Bl(e,t):e.insertBefore(t,n)}function Nl(e,t,n){e.replaceChild(t,n)}function Vl(e){for(var t;void 0!==(t=e.shift());)t()}var Ll={},$l={};function Fl(e,t,n){var r,o,i=Ll[e],a=n.$EV;t?(i||($l[e]=(r=e,o=function(e){var t=e.type,n="click"===t||"dblclick"===t;if(n&&0!==e.button)return e.preventDefault(),e.stopPropagation(),!1;e.stopPropagation=zl;var o={dom:document};Object.defineProperty(e,"currentTarget",{configurable:!0,get:function(){return o.dom}}),function(e,t,n,o,r){var i=t;for(;!yl(i);){if(n&&i.disabled)return;var a=i.$EV;if(a){var s=a[o];if(s&&(r.dom=i,s.event?s.event(s.data,e):s(e),e.cancelBubble))return}i=i.parentNode}}(e,e.target,n,r,o)},document.addEventListener(Ul(r),o),o),Ll[e]=0),a||(a=n.$EV={}),a[e]||Ll[e]++,a[e]=t):a&&a[e]&&(Ll[e]--,1===i&&(document.removeEventListener(Ul(e),$l[e]),$l[e]=null),a[e]=t)}function Ul(e){return e.substr(2).toLowerCase()}function zl(){this.cancelBubble=!0,this.immediatePropagationStopped||this.stopImmediatePropagation()}function Wl(e,t){var n=document.createElement("i");return n.innerHTML=t,n.innerHTML===e.innerHTML}function Hl(e,t,n){if(e[t]){var o=e[t];o.event?o.event(o.data,n):o(n)}else{var r=t.toLowerCase();e[r]&&e[r](n)}}function Gl(s,c){var e=function(e){e.stopPropagation();var t=this.$V;if(t){var n=t.props||Dl,o=t.dom;if(dl(s))Hl(n,s,e);else for(var r=0;r<s.length;r++)Hl(n,s[r],e);if(fl(c)){var i=this.$V,a=i.props||Dl;c(a,o,!1,i)}}};return Object.defineProperty(e,"wrapped",{configurable:!1,enumerable:!1,value:!0,writable:!1}),e}function ql(e){return"checkbox"===e||"radio"===e}var Kl=Gl("onInput",Yl),Xl=Gl(["onClick","onChange"],Yl);function Zl(e){e.stopPropagation()}function Yl(e,t){var n=e.type,o=e.value,r=e.checked,i=e.multiple,a=e.defaultValue,s=!ll(o);n&&n!==t.type&&t.setAttribute("type",n),ll(i)||i===t.multiple||(t.multiple=i),ll(a)||s||(t.defaultValue=a+""),ql(n)?(s&&(t.value=o),ll(r)||(t.checked=r)):s&&t.value!==o?(t.defaultValue=o,t.value=o):ll(r)||(t.checked=r)}function Jl(e,t){if("optgroup"===e.type){var n=e.children,o=e.childFlags;if(12&o)for(var r=0,i=n.length;r<i;r++)Ql(n[r],t);else 2===o&&Ql(n,t)}else Ql(e,t)}function Ql(e,t){var n=e.props||Dl,o=e.dom;o.value=n.value,cl(t)&&-1!==t.indexOf(n.value)||n.value===t?o.selected=!0:ll(t)&&ll(n.selected)||(o.selected=n.selected||!1)}Zl.wrapped=!0;var ep=Gl("onChange",tp);function tp(e,t,n,o){var r=Boolean(e.multiple);ll(e.multiple)||r===t.multiple||(t.multiple=r);var i=o.childFlags;if(0==(1&i)){var a=o.children,s=e.value;if(n&&ll(s)&&(s=e.defaultValue),12&i)for(var c=0,u=a.length;c<u;c++)Jl(a[c],s);else 2===i&&Jl(a,s)}}var np=Gl("onInput",rp),op=Gl("onChange");function rp(e,t,n){var o=e.value,r=t.value;if(ll(o)){if(n){var i=e.defaultValue;ll(i)||i===r||(t.defaultValue=i,t.value=i)}}else r!==o&&(t.defaultValue=o,t.value=o)}function ip(e,t,n,o,r,i){64&e?Yl(o,n):256&e?tp(o,n,r,t):128&e&&rp(o,n,r),i&&(n.$V=t)}function ap(e,t,n){var o,r,i;64&e?(i=t,ql(n.type)?(i.onchange=Xl,i.onclick=Zl):i.oninput=Kl):256&e?t.onchange=ep:128&e&&(r=n,(o=t).oninput=np,r.onChange&&(o.onchange=op))}function sp(e){return e.type&&ql(e.type)?!ll(e.checked):!ll(e.value)}function cp(e,t){var n,o;up(e),yl(t)||(n=t,o=e.dom,n.removeChild(o),e.dom=null)}function up(e){var t,n=e.flags;if(481&n){var o=e.ref,r=e.props;fl(o)&&o(null);var i=e.children,a=e.childFlags;if(12&a?lp(i):2===a&&up(i),!yl(r))for(var s in r)switch(s){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":Fl(s,null,e.dom)}}else if(14&n){var c=e.children,u=e.ref;4&n?(fl(jl.beforeUnmount)&&jl.beforeUnmount(e),fl(c.componentWillUnmount)&&c.componentWillUnmount(),fl(u)&&u(null),c.$UN=!0,up(c.$LI)):(!ll(u)&&fl(u.onComponentWillUnmount)&&u.onComponentWillUnmount(e.dom,e.props||Dl),up(c))}else if(1024&n){var l=e.children;yl(l)||"object"!==(void 0===(t=l)?"undefined":rl(t))||cp(l,e.type)}}function lp(e){for(var t=0,n=e.length;t<n;t++)up(e[t])}function pp(e,t){lp(t),e.textContent=""}function fp(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 dp(e,t,n,o,r,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":Fl(e,n,o);break;case"children":case"childrenType":case"className":case"defaultValue":case"key":case"multiple":case"ref":return;case"allowfullscreen":case"autoFocus":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":o[e="autoFocus"===e?e.toLowerCase():e]=!!n;break;case"defaultChecked":case"value":case"volume":if(i&&"value"===e)return;var s=ll(n)?"":n;o[e]!==s&&(o[e]=s);break;case"dangerouslySetInnerHTML":var c=t&&t.__html||"",u=n&&n.__html||"";c!==u&&(ll(u)||Wl(o,u)||(yl(a)||(12&a.childFlags?lp(a.children):2===a.childFlags&&up(a.children),a.children=null,a.childFlags=1),o.innerHTML=u));break;default:"o"===e[0]&&"n"===e[1]?function(e,t,n,o){var r,i,a=e.toLowerCase();if(fl(n)||ll(n)){var s=o[a];s&&s.wrapped||(o[a]=n)}else{var c=n.event;c&&fl(c)&&(o[a]=(r=c,i=n,function(e){r(i.data,e)}))}}(e,0,n,o):ll(n)?o.removeAttribute(e):"style"===e?function(e,t,n){var o,r,i=n.style;if(dl(t))i.cssText=t;else if(ll(e)||dl(e))for(o in t)r=t[o],i[o]=hl(r)?fp(o,r):r;else{for(o in t)(r=t[o])!==e[o]&&(i[o]=hl(r)?fp(o,r):r);for(o in e)ll(t[o])&&(i[o]="")}}(t,n,o):r&&Al[e]?o.setAttributeNS(Al[e],e,n):o.setAttribute(e,n)}}function hp(e,t,n,o,r){var i=!1,a=0<(448&t);for(var s in a&&(i=sp(n))&&ap(t,o,n),n)dp(s,null,n[s],o,r,i,null);a&&ip(t,e,o,n,!0,i)}function yp(e,t,n,o){var r=new t(n,o);if((e.children=r).$V=e,r.$BS=!1,r.context=o,r.props===Dl&&(r.props=n),r.$UN=!1,fl(r.componentWillMount)){if(r.$BR=!0,r.componentWillMount(),r.$PSS){var i=r.state,a=r.$PS;if(yl(i))r.state=a;else for(var s in a)i[s]=a[s];r.$PSS=!1,r.$PS=null}r.$BR=!1}fl(jl.beforeRender)&&jl.beforeRender(r);var c,u=vp(r.render(n,r.state,o),e);return fl(r.getChildContext)&&(c=r.getChildContext()),ll(c)?r.$CX=o:r.$CX=ml(o,c),fl(jl.afterRender)&&jl.afterRender(r),r.$LI=u,r}function vp(e,t){return pl(e)?e=kl():ul(e)?e=xl(e,null):(e.dom&&(e=El(e)),14&e.flags&&(e.parentVNode=t)),e}function mp(e,t,n,o,r){var i=e.flags;return 481&i?bp(e,t,n,o,r):14&i?function(e,t,n,o,r,i){var a,s=e.type,c=e.props||Dl,u=e.ref;if(i){var l=yp(e,s,c,o);e.dom=a=mp(l.$LI,null,n,l.$CX,r),wp(e,u,l,n),l.$UPD=!1}else{var p=vp(s(c,o),e);e.children=p,e.dom=a=mp(p,null,n,o,r),xp(c,u,a,n)}yl(t)||Bl(t,a);return a}(e,t,n,o,r,0<(4&i)):512&i||16&i?gp(e,t):1024&i?(mp(e.children,e.type,n,o,!1),e.dom=gp(kl(),t)):void 0}function gp(e,t){var n=e.dom=document.createTextNode(e.children);return yl(t)||Bl(t,n),n}function bp(e,t,n,o,r){var i=e.flags,a=e.children,s=e.props,c=e.className,u=e.ref,l=e.childFlags;r=r||0<(32&i);var p,f=(p=e.type,!0===r?document.createElementNS(Rl,p):document.createElement(p));if(e.dom=f,ll(c)||""===c||(r?f.setAttribute("class",c):f.className=c),yl(t)||Bl(t,f),0==(1&l)){var d=!0===r&&"foreignObject"!==e.type;2===l?mp(a,f,n,o,d):12&l&&_p(a,f,n,o,d)}return yl(s)||hp(e,i,s,f,r),fl(u)&&Cp(f,u,n),f}function _p(e,t,n,o,r){for(var i=0,a=e.length;i<a;i++){var s=e[i];yl(s.dom)||(e[i]=s=El(s)),mp(s,t,n,o,r)}}function wp(e,t,n,o){fl(t)&&t(n);var r,i,a,s,c,u=fl(n.componentDidMount),l=jl.afterMount,p=fl(l);(u||p)&&o.push((r=n,i=p,a=l,s=e,c=u,function(){r.$UPD=!0,i&&a(s),c&&r.componentDidMount(),r.$UPD=!1}))}function xp(e,t,n,o){var r,i,a;ll(t)||(fl(t.onComponentWillMount)&&t.onComponentWillMount(e),fl(t.onComponentDidMount)&&o.push((r=t,i=n,a=e,function(){return r.onComponentDidMount(i,a)})))}function Cp(e,t,n){n.push(function(){return t(e)})}function Ep(e,t,n,o,r){var i,a,s=e.children,c=e.props,u=e.className,l=e.flags,p=e.ref;if(r=r||0<(32&l),1!==t.nodeType||t.tagName.toLowerCase()!==e.type){var f=bp(e,null,n,o,r);e.dom=f,Nl(t.parentNode,f,t)}else{var d=(e.dom=t).firstChild,h=e.childFlags;if(0==(1&h)){for(var y=null;d;)y=d.nextSibling,8===d.nodeType&&("!"===d.data?t.replaceChild(document.createTextNode(""),d):t.removeChild(d)),d=y;if(d=t.firstChild,2===h)yl(d)?mp(s,t,n,o,r):(y=d.nextSibling,kp(s,d,n,o,r),d=y);else if(12&h)for(var v=0,m=s.length;v<m;v++){var g=s[v];yl(d)?mp(g,t,n,o,r):(y=d.nextSibling,kp(g,d,n,o,r),d=y)}for(;d;)y=d.nextSibling,t.removeChild(d),d=y}else yl(t.firstChild)||(i=t,a=c,Boolean(a&&a.dangerouslySetInnerHTML&&a.dangerouslySetInnerHTML.__html&&Wl(i,a.dangerouslySetInnerHTML.__html)))||(t.textContent="",448&l&&(t.defaultValue=""));yl(c)||hp(e,l,c,t,r),ll(u)?""!==t.className&&t.removeAttribute("class"):r?t.setAttribute("class",u):t.className=u,fl(p)&&Cp(t,p,n)}}function kp(e,t,n,o,r){var i=e.flags;14&i?function(e,t,n,o,r,i){var a=e.type,s=e.ref,c=e.props||Dl;if(i){var u=yp(e,a,c,o),l=u.$LI;kp(l,t,n,u.$CX,r),e.dom=l.dom,wp(e,s,u,n),u.$UPD=!1}else{var p=vp(a(c,o),e);kp(p,t,n,o,r),e.children=p,e.dom=p.dom,xp(c,s,t,n)}}(e,t,n,o,r,0<(4&i)):481&i?Ep(e,t,n,o,r):16&i?function(e,t){if(3!==t.nodeType){var n=gp(e,null);e.dom=n,Nl(t.parentNode,n,t)}else{var o=e.children;t.nodeValue!==o&&(t.nodeValue=o),e.dom=t}}(e,t):512&i?e.dom=t:function(e){throw e||(e=al),new Error("Inferno Error: "+e)}()}function Sp(e,t,n,o,r,i){up(e),Nl(n,mp(t,null,o,r,i),e.dom)}function Op(e,t,n,o,r,i){if(e!==t){var a=0|t.flags;e.flags!==a||2048&a?Sp(e,t,n,o,r,i):481&a?function(e,t,n,o,r,i){var a=t.type;if(e.type!==a)Sp(e,t,n,o,r,i);else{var s,c=e.dom,u=t.flags,l=e.props,p=t.props,f=!1,d=!1;if(t.dom=c,i=i||0<(32&u),l!==p){var h=l||Dl;if((s=p||Dl)!==Dl)for(var y in(f=0<(448&u))&&(d=sp(s)),s){var v=h[y],m=s[y];v!==m&&dp(y,v,m,c,i,d,e)}if(h!==Dl)for(var g in h)s.hasOwnProperty(g)||ll(h[g])||dp(g,h[g],null,c,i,d,e)}var b=e.children,_=t.children,w=t.ref,x=e.className,C=t.className;b!==_&&jp(e.childFlags,t.childFlags,b,_,c,o,r,i&&"foreignObject"!==a),f&&ip(u,t,c,s,!1,d),x!==C&&(ll(C)?c.removeAttribute("class"):i?c.setAttribute("class",C):c.className=C),fl(w)&&e.ref!==w&&Cp(c,w,o)}}(e,t,n,o,r,i):14&a?function(e,t,n,o,r,i,a){var s=t.type,c=e.key,u=t.key;if(e.type!==s||c!==u)Sp(e,t,n,o,r,i);else{var l=t.props||Dl;if(a){var p=e.children;p.$UPD=!0,Pp(p,p.state,t,l,n,o,r,i,!1,!1),p.$V=t,p.$UPD=!1}else{var f=!0,d=e.props,h=t.ref,y=!ll(h),v=e.children;if(t.dom=e.dom,t.children=v,y&&fl(h.onComponentShouldUpdate)&&(f=h.onComponentShouldUpdate(d,l)),!1!==f){y&&fl(h.onComponentWillUpdate)&&h.onComponentWillUpdate(d,l);var m=s(l,r);m!==il&&(m=vp(m,t),Op(v,m,n,o,r,i),t.children=m,t.dom=m.dom,y&&fl(h.onComponentDidUpdate)&&h.onComponentDidUpdate(d,l))}else 14&v.flags&&(v.parentVNode=t)}}}(e,t,n,o,r,i,0<(4&a)):16&a?function(e,t,n){var o,r=t.children;yl(n.firstChild)?(n.textContent=r,o=n.firstChild):(o=e.dom,r!==e.children&&(o.nodeValue=r));t.dom=o}(e,t,n):512&a?t.dom=e.dom:function(e,t,n,o){var r=e.type,i=t.type,a=t.children;if(jp(e.childFlags,t.childFlags,e.children,a,r,n,o,!1),t.dom=e.dom,r!==i&&!pl(a)){var s=a.dom;r.removeChild(s),i.appendChild(s)}}(e,t,o,r)}}function jp(e,t,n,o,r,i,a,s){switch(e){case 2:switch(t){case 2:Op(n,o,r,i,a,s);break;case 1:cp(n,r);break;default:cp(n,r),_p(o,r,i,a,s)}break;case 1:switch(t){case 2:mp(o,r,i,a,s);break;case 1:break;default:_p(o,r,i,a,s)}break;default:if(12&t){var c=n.length,u=o.length;0===c?0<u&&_p(o,r,i,a,s):0===u?pp(r,n):8===t&&8===e?function(e,t,n,o,r,i,a,s){var c,u,l,p,f=a-1,d=s-1,h=0,y=0,v=e[h],m=t[y];e:{for(;v.key===m.key;){if(m.dom&&(t[y]=m=El(m)),Op(v,m,n,o,r,i),y++,f<++h||d<y)break e;v=e[h],m=t[y]}for(v=e[f],m=t[d];v.key===m.key;){if(m.dom&&(t[d]=m=El(m)),Op(v,m,n,o,r,i),d--,--f<h||d<y)break e;v=e[f],m=t[d]}}if(f<h){if(y<=d)for(l=(p=d+1)<s?t[p].dom:null;y<=d;)(m=t[y]).dom&&(t[y]=m=El(m)),y++,Il(n,mp(m,null,o,r,i),l)}else if(d<y)for(;h<=f;)cp(e[h++],n);else{var g=f-h+1,b=d-y+1,_=[];for(c=0;c<b;c++)_.push(0);var w=g===a,x=!1,C=0,E=0;if(s<4||(g|b)<32)for(c=h;c<=f;c++)if(v=e[c],E<b){for(u=y;u<=d;u++)if(m=t[u],v.key===m.key){if(_[u-y]=c+1,w)for(w=!1;h<c;)cp(e[h++],n);u<C?x=!0:C=u,m.dom&&(t[u]=m=El(m)),Op(v,m,n,o,r,i),E++;break}!w&&d<u&&cp(v,n)}else w||cp(v,n);else{var k={};for(c=y;c<=d;c++)k[t[c].key]=c;for(c=h;c<=f;c++)if(v=e[c],E<b)if(void 0!==(u=k[v.key])){if(w)for(w=!1;h<c;)cp(e[h++],n);m=t[u],_[u-y]=c+1,u<C?x=!0:C=u,m.dom&&(t[u]=m=El(m)),Op(v,m,n,o,r,i),E++}else w||cp(v,n);else w||cp(v,n)}if(w)pp(n,e),_p(t,n,o,r,i);else if(x){var S=function(e){var t,n,o,r,i,a=e.slice(),s=[0],c=e.length;for(t=0;t<c;t++){var u=e[t];if(0!==u){if(n=s[s.length-1],e[n]<u){a[t]=n,s.push(t);continue}for(o=0,r=s.length-1;o<r;)e[s[i=(o+r)/2|0]]<u?o=i+1:r=i;u<e[s[o]]&&(0<o&&(a[t]=s[o-1]),s[o]=t)}}o=s.length,r=s[o-1];for(;0<o--;)s[o]=r,r=a[r];return s}(_);for(u=S.length-1,c=b-1;0<=c;c--)0===_[c]?((m=t[C=c+y]).dom&&(t[C]=m=El(m)),p=C+1,Il(n,mp(m,null,o,r,i),p<s?t[p].dom:null)):u<0||c!==S[u]?(m=t[C=c+y],p=C+1,Il(n,m.dom,p<s?t[p].dom:null)):u--}else if(E!==b)for(c=b-1;0<=c;c--)0===_[c]&&((m=t[C=c+y]).dom&&(t[C]=m=El(m)),p=C+1,Il(n,mp(m,null,o,r,i),p<s?t[p].dom:null))}}(n,o,r,i,a,s,c,u):function(e,t,n,o,r,i,a,s){for(var c,u=s<a?s:a,l=0;l<u;l++)(c=t[l]).dom&&(c=t[l]=El(c)),Op(e[l],c,n,o,r,i);if(a<s)for(l=u;l<s;l++)(c=t[l]).dom&&(c=t[l]=El(c)),mp(c,n,o,r,i);else if(s<a)for(l=u;l<a;l++)cp(e[l],n)}(n,o,r,i,a,s,c,u)}else 1===t?pp(r,n):(pp(r,n),mp(o,r,i,a,s))}}function Pp(e,t,n,o,r,i,a,s,c,u){var l,p=e.state,f=e.props;if(!(n.children=e).$UN){if(f!==o||o===Dl){if(!u&&fl(e.componentWillReceiveProps)){if(e.$BR=!0,e.componentWillReceiveProps(o,a),e.$UN)return;e.$BR=!1}e.$PSS&&(t=ml(t,e.$PS),e.$PSS=!1,e.$PS=null)}var d=fl(e.shouldComponentUpdate);if(c||!d||d&&e.shouldComponentUpdate(o,t,a)){fl(e.componentWillUpdate)&&(e.$BS=!0,e.componentWillUpdate(o,t,a),e.$BS=!1),e.props=o,e.state=t,e.context=a,fl(jl.beforeRender)&&jl.beforeRender(e),l=e.render(o,t,a),fl(jl.afterRender)&&jl.afterRender(e);var h,y=l!==il;if(fl(e.getChildContext)&&(h=e.getChildContext()),h=ll(h)?a:ml(a,h),e.$CX=h,y)Op(e.$LI,e.$LI=vp(l,n),r,i,h,s),fl(e.componentDidUpdate)&&e.componentDidUpdate(f,p),fl(jl.afterUpdate)&&jl.afterUpdate(n)}else e.props=o,e.state=t,e.context=a;n.dom=e.$LI.dom}}var Tp=jl.roots;sl&&document.body;function Rp(e,t,n){if(e!==il){var o,r,i=Tp.length;for(r=0;r<i;r++)if(Tp[r]===t){o=t.$V;break}return vl(o)?pl(e)||(e.dom&&(e=El(e)),yl(t.firstChild)?(mp(e,t,Ml,Dl,!1),t.$V=e,Tp.push(t)):function(e,t,n){var o=t.firstChild;if(!yl(o))for(pl(e)||kp(e,o,Ml,Dl,!1),o=t.firstChild;o=o.nextSibling;)t.removeChild(o);0<Ml.length&&Vl(Ml),t.$V||jl.roots.push(t),t.$V=e,fl(n)&&n()}(e,t),o=e):ll(e)?(cp(o,t),Tp.splice(r,1)):(e.dom&&(e=El(e)),Op(o,e,t,Ml,Dl,!1),o=t.$V=e),0<Ml.length&&Vl(Ml),fl(n)&&n(),o&&14&o.flags?o.children:void 0}}var Ap="undefined"==typeof Promise?null:Promise.resolve(),Dp="undefined"==typeof requestAnimationFrame?setTimeout:requestAnimationFrame.bind(window);function Mp(e,t,n){fl(t)&&(t=t(e.state,e.props,e.context));var o,r,i,a=e.$PS;if(ll(a))e.$PS=t;else for(var s in t)a[s]=t[s];if(e.$PSS||e.$BR)e.$PSS=!0,e.$BR&&fl(n)&&Ml.push(n.bind(e));else if(e.$UPD){var c=e.$QU;yl(c)&&(c=e.$QU=[],r=e,i=c,o=function(){r.$QU=null,r.$UPD=!0,Bp(r,!1,function(){for(var e=0,t=i.length;e<t;e++)i[e].call(r)}),r.$UPD=!1},Ap?Ap.then(o):Dp(o)),fl(n)&&c.push(n)}else e.$PSS=!0,e.$UPD=!0,Bp(e,!1,n),e.$UPD=!1}function Bp(e,t,n){if(!e.$UN){if(t||!e.$BR){e.$PSS=!1;var o=e.$PS,r=ml(e.state,o),i=e.props,a=e.context;e.$PS=null;var s=e.$V,c=e.$LI;if(Pp(e,r,s,i,c.dom&&c.dom.parentNode,Ml,a,0<(32&s.flags),t,!0),e.$UN)return;if(0==(1024&e.$LI.flags))for(var u=e.$LI.dom;!yl(s=s.parentVNode);)0<(14&s.flags)&&(s.dom=u);0<Ml.length&&Vl(Ml)}else e.state=e.$PS,e.$PS=null;fl(n)&&n.call(e)}}var Ip=function(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||Dl,this.context=t||Dl};Ip.prototype.forceUpdate=function(e){this.$UN||Bp(this,!0,e)},Ip.prototype.setState=function(e,t){this.$UN||this.$BS||Mp(this,e,t)},Ip.prototype.render=function(e,t,n){},Ip.defaultProps=null;var Np="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},Vp=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Lp=function(e){function o(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Np(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e)),n=t._injector=e.injector;return t._sheet=n.get("sheet"),t._changeSupport=n.get("changeSupport"),t._components=n.get("components"),t.onElementsChanged=t.onElementsChanged.bind(t),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Np(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,Ip),Vp(o,[{key:"onElementsChanged",value:function(){this.forceUpdate()}},{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,o=this._components.getComponents("table.before"),r=this._components.getComponents("table.after"),i=this._components.getComponent("table.head"),a=this._components.getComponent("table.body"),s=this._components.getComponent("table.foot");return _l(1,"div","tjs-container",[o&&o.map(function(e,t){return wl(2,e,null,t)}),_l(1,"table","tjs-table",[i&&wl(2,i,{rows:t,cols:n}),a&&wl(2,a,{rows:t,cols:n}),s&&wl(2,s,{rows:t,cols:n})],0),r&&r.map(function(e,t){return wl(2,e,null,t)})],0)}}]),o}(),$p=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Fp=function(){function a(e,t,n,o,r){!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,o.on("root.added",function(){Rp(wl(2,Lp,{injector:r}),i)}),o.on("root.remove",function(){Rp(null,i)})}return $p(a,[{key:"getContainer",value:function(){return this._container}}]),a}();Fp.$inject=["changeSupport","components","config.renderer","eventBus","injector"];var Up={__init__:["changeSupport","components","renderer"],changeSupport:["type",tl],components:["type",ol],renderer:["type",Fp]},zp=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Wp=function(){function o(e,t){var n=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._root=null,t.on("table.clear",function(){n.setRoot(null)})}return zp(o,[{key:"setRoot",value:function(e){if(this._root){var 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,o){var r=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 void 0===o&&(o=i.rows.length),Hp(o,i.rows,n),n.root=i,this._elementRegistry.add(n),n.cells.forEach(function(e,t){r._elementRegistry.add(e),e.row=n,e.col=i.cols[t],Hp(o,i.cols[t].cells,e)}),this._eventBus.fire("row.add",{row:n}),n}},{key:"removeRow",value:function(e){var n=this,o=this.getRoot();"string"==typeof e&&(e=this._elementRegistry.get(e));var r=o.rows.indexOf(e);-1!==r&&(Gp(r,o.rows),e.root=void 0,this._elementRegistry.remove(e),e.cells.forEach(function(e,t){n._elementRegistry.remove(e),e.col=void 0,Gp(r,o.cols[t].cells)}),this._eventBus.fire("row.remove",{row:e}))}},{key:"addCol",value:function(n,o){var r=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 void 0===o&&(o=i.cols.length),Hp(o,i.cols,n),n.root=i,n.cells.forEach(function(e,t){r._elementRegistry.add(e),e.col=n,e.row=i.rows[t],Hp(o,i.rows[t].cells,e)}),this._eventBus.fire("col.add",{col:n}),n}},{key:"removeCol",value:function(e){var n=this,o=this.getRoot();"string"==typeof e&&(e=this._elementRegistry.get(e));var r=o.cols.indexOf(e);-1!==r&&(Gp(r,o.cols),e.root=void 0,this._elementRegistry.remove(e),e.cells.forEach(function(e,t){n._elementRegistry.remove(e),e.row=void 0,Gp(r,o.rows[t].cells)}),this._eventBus.fire("col.remove",{col:e}))}},{key:"resized",value:function(){this._eventBus.fire("sheet.resized")}}]),o}();function Hp(e,t,n){return t.splice(e,0,n)}function Gp(e,t){return t.splice(e,1)}Wp.$inject=["elementRegistry","eventBus"];var qp={__depends__:[Up],__init__:["elementFactory","sheet"],elementFactory:["type",Zu],elementRegistry:["type",Ju],eventBus:["type",o],sheet:["type",Wp]},Kp=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Xp=function(){function i(){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,i);var t=e.injector;if(!t){var n=this._init(e),o=n.modules,r=n.config;t=function(e){var o=[],r=[];function i(e){return 0<=o.indexOf(e)}e.forEach(function e(t){var n;i(t)||((t.__depends__||[]).forEach(e),i(t)||(n=t,o.push(n),(t.__init__||[]).forEach(function(e){r.push(e)})))});var t=new fn(o);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",r]},qp].concat(o||[]))}this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("table.init"),this.get("eventBus").fire("diagram.init")}return Kp(i,[{key:"_init",value:function(e){return{modules:e.modules,config:function(e,t){var n={};for(var o in e)0<=t.indexOf(o)||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}(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")}}]),i}();function Zp(e){if(!e)return"<null>";var t=e.id?' id="'+e.id+'"':"";return"<"+e.$type+t+" />"}function Yp(s,e){function c(e,t,n){if(e.gfx)throw new Error("already rendered "+Zp(e));return s.element(e,t,n)}function u(e,t,n){w(e,function(e){c(e,t,n)})}function l(e,t,n){w(e,function(e){c(e,t,n)})}return{handleDecision:function(e){e.id||(e.id="decision");var t=e.decisionTable;if(!t)throw new Error("no table for "+Zp(e));if(!t.output)throw new Error("missing output for "+Zp(t));var n,o,r,i,a=(i=t,s.table(i));t.input&&u(t.input,a,t),u(t.output,a,t),n=t.rule,o=a,r=t,w(n,function(e){c(e,o,r),l(e.inputEntry,e),l(e.outputEntry,e)})}}}function Jp(){return _l(1,"th","annotation header",xl("Annotation"),2,{rowspan:"3"})}var Qp="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},ef="function"==typeof Symbol&&"symbol"===Qp(Symbol.iterator)?function(e){return void 0===e?"undefined":Qp(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":Qp(e)},tf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e};function nf(e,t){var n,o,r,i=e.elements,a=e.index;return a[t]?e:{elements:[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(i),[t]),index:tf({},a,(n={},o=t,r=!0,o in n?Object.defineProperty(n,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[o]=r,n))}}function of(){for(var e,n={elements:[],index:{}},t=arguments.length,o=Array(t),r=0;r<t;r++)o[r]=arguments[r];return o.forEach(function(t){var e=void 0===t?"undefined":ef(t);"string"===e&&0<t.length?n=nf(n,t):"object"===e&&null!==t&&Object.keys(t).forEach(function(e){t[e]&&(n=nf(n,e))})}),e=" ",n.elements.join(e)}function rf(e){return af(e.constructor,e)}function af(e,a){var s=e.$inject;if(s){var t=a.context.injector,n=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(s),[function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var o in t){var r=s[o],i=t[o];a[r]=i}}]);t.invoke(n)}}function sf(o,r){Object.keys(r).forEach(function(e){if("$inject"!==e&&"__init"!==e){var t=r[e];"constructor"===e&&t.call(o,o.props,o.context);var n=o[e];if(void 0!==n){if("function"!=typeof n)throw new Error("failed to mixin <"+e+">: cannot combine with non-fn component value");o[e]=function(r){for(var e=arguments.length,i=Array(1<e?e-1:0),t=1;t<e;t++)i[t-1]=arguments[t];return function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=void 0;return i.forEach(function(e){if(void 0!==(o=e.call.apply(e,[r].concat(t))))return!1}),o}.bind(r)}(o,n,t)}else o[e]=t.bind(o)}}),"$inject"in r&&af(r,o),"__init"in r&&r.__init.call(o,o.props,o.context)}var cf={getSelectionClasses:function(){var e=this.state;return of({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&&t&&this.eventBus[e?"on":"off"]("selection."+t+".changed",this.selectionChanged)},$inject:["eventBus"]},uf="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},lf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},pf=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var ff=function(e){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=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":uf(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return sf(n,cf),rf(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":uf(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,Ip),pf(o,[{key:"getRenderProps",value:function(){for(var e=this.props,t=e.className,n=e.elementId,o=e.coords,r=function(e,t){var n={};for(var o in e)0<=t.indexOf(o)||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}(e,["className","elementId","coords"]),i=arguments.length,a=Array(i),s=0;s<i;s++)a[s]=arguments[s];var c={className:of.apply(void 0,a.concat([this.getSelectionClasses(),t]))};return n&&(c["data-element-id"]=n),o&&(c["data-coords"]=o),lf({},c,r)}}]),o}(),df="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},hf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},yf=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var vf=function(e){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=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":df(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n.state={},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":df(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,ff),yf(o,[{key:"render",value:function(){var e=this.props.children,t=this.getRenderProps("cell");return Cl(_l(1,"td",null,e,0,hf({},t)))}}]),o}(),mf="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},gf=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();!function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":mf(t))&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":mf(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)})(t,Ip),gf(t,[{key:"getChildContext",value:function(){return{injector:this.props.injector}}},{key:"render",value:function(){return this.props.children}}])}();var bf="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},_f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},wf=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();!function(e){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=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":bf(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n.state={},n}(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":bf(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)})(o,ff),wf(o,[{key:"render",value:function(){var e=this.props.children,t=this.getRenderProps("cell","header-cell");return Cl(_l(1,"th",null,e,0,_f({},t)))}}])}();function xf(e){var t=e.row.businessObject,n=t.id,o=t.description;return wl(2,vf,{className:"annotation",elementId:n+"__annotation",children:o||"-"})}function Cf(e){e.onGetComponent("cell",function(e){var t=e.cellType;return"after-label-cells"===t?Jp:"after-rule-cells"===t?xf:void 0})}Cf.$inject=["components"];var Ef={__init__:["annotationsProvider"],annotationsProvider:["type",Cf]},kf=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();function Sf(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function Of(e,t){return R({id:e.id,type:e.$type,businessObject:e},t)}var jf=function(){function o(e,t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this._elementFactory=e,this._eventBus=t,this._sheet=n}return kf(o,[{key:"add",value:function(e){var t=this,n=void 0;if(Ht(e,"dmn:DecisionTable"))n=this._elementFactory.createRoot(Of(e)),this._sheet.setRoot(n);else if(Ht(e,"dmn:InputClause"))n=this._elementFactory.createCol(Of(e)),this._sheet.addCol(n);else if(Ht(e,"dmn:OutputClause"))n=this._elementFactory.createCol(Of(e)),this._sheet.addCol(n);else if(Ht(e,"dmn:DecisionRule")){e.inputEntry||(e.inputEntry=[]),e.outputEntry||(e.outputEntry=[]);var o=[].concat(Sf(e.inputEntry),Sf(e.outputEntry)).map(function(e){return t._elementFactory.createCell(Of(e))});n=this._elementFactory.createRow(R(Of(e),{cells:o})),this._sheet.addRow(n)}return this._eventBus.fire("dmnElement.added",{element:n}),n}}]),o}();jf.$inject=["elementFactory","eventBus","sheet"];var Pf={__depends__:[{tableImporter:["type",jf]},Up]},Tf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e};function Rf(e,t){var n={};for(var o in e)0<=t.indexOf(o)||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}var Af={slotFill:function(e,t){var n=e.type,o=e.context,r=Rf(e,["type","context"]),i=this.components.getComponent(n,o)||t;return i?Cl(wl(2,i,Tf({},o,r))):null},slotFills:function(e){var t=e.type,n=e.context,o=Rf(e,["type","context"]);return this.components.getComponents(t,n).map(function(e){return Cl(wl(2,e,Tf({},n,o)))})},$inject:["components"]},Df="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},Mf=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();function Bf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function If(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Df(t))&&"function"!=typeof t?e:t}function Nf(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Df(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var Vf=function(e){function o(e,t){Bf(this,o);var n=If(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n.onElementsChanged=function(){n.forceUpdate()},sf(n,Af),n._sheet=t.injector.get("sheet"),n._changeSupport=t.changeSupport,n}return Nf(o,Ip),Mf(o,[{key:"componentWillMount",value:function(){var e=this._sheet.getRoot();this._changeSupport.onElementsChanged(e.id,this.onElementsChanged)}},{key:"componentWillUnmout",value:function(){var e=this._sheet.getRoot();this._changeSupport.offElementsChanged(e.id,this.onElementsChanged)}},{key:"render",value:function(e){var o=this,t=this._sheet.getRoot();if(!Ht(t,"dmn:DMNElement"))return null;var n=Kt(t),r=n.input,i=n.output;return _l(1,"thead",null,[_l(1,"tr",null,[this.slotFills({type:"cell",context:{cellType:"before-label-cells"}}),this.slotFill({type:"cell",context:{cellType:"input-label"}},$f),this.slotFill({type:"cell",context:{cellType:"output-label"}},Uf),this.slotFills({type:"cell",context:{cellType:"after-label-cells"}})],0),_l(1,"tr",null,[r&&r.map(function(e){return o.slotFill({type:"cell",context:{cellType:"input-header",input:e},key:e.id},Lf)}),i.map(function(e){return o.slotFill({type:"cell",context:{cellType:"output-header",output:e},key:e.id},Ff)})],0),_l(1,"tr",null,[r&&r.map(function(e,t){var n=e.inputExpression;return o.slotFill({type:"cell",context:{cellType:"input-header-type-ref",element:n},className:"input-cell",key:e.id},zf)}),i.map(function(e){return o.slotFill({type:"cell",context:{cellType:"output-header-type-ref",element:e},className:"output-cell",key:e.id},zf)})],0)],4)}}]),o}();function Lf(e){var t=e.input,n=e.className,o=t.label,r=t.inputExpression;return _l(1,"th",(n||"")+" input-cell",o?_l(1,"span","input-label",o,0,{title:"Input Label"}):_l(1,"span","input-expression",r.text||"-",0,{title:"Input Expression"}),0,{"data-col-id":t.id},t.id)}var $f=function(e){function o(e,t){Bf(this,o);var n=If(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n._sheet=t.injector.get("sheet"),n}return Nf(o,Ip),Mf(o,[{key:"render",value:function(){var e=this._sheet.getRoot().businessObject,t=e.input;if(!t||!t.length)return null;var n=e.input.length;return _l(1,"th","input-cell inputs-label header",xl("Input"),2,{colspan:n})}}]),o}();function Ff(e){var t=e.output,n=e.className,o=t.label,r=t.name;return _l(1,"th",(n||"")+" output-cell",o?_l(1,"span","output-label",o,0,{title:"Output Label"}):_l(1,"span","output-name",r||"-",0,{title:"Output Name"}),0,null,t.id)}var Uf=function(e){function o(e,t){Bf(this,o);var n=If(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n._sheet=t.injector.get("sheet"),n}return Nf(o,Ip),Mf(o,[{key:"render",value:function(){var e=this._sheet.getRoot().businessObject.output.length;return _l(1,"th","output-cell outputs-label header",xl("Output"),2,{colspan:e})}}]),o}();function zf(e){return _l(1,"th",e.className+" type-ref",e.element.typeRef,0,{title:"Data Type"})}function Wf(e){e.onGetComponent("table.head",function(){return Vf})}Wf.$inject=["components"];var Hf={__init__:["decisionTableHeadProvider"],decisionTableHeadProvider:["type",Wf]},Gf="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},qf=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Kf=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Gf(t))&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Gf(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,Ip),qf(t,[{key:"componentWillMount",value:function(){var e=this.context.injector;this._sheet=e.get("sheet")}},{key:"render",value:function(){var e=this._sheet.getRoot();if(!Ht(e,"dmn:DMNElement"))return null;var t=e.businessObject.$parent,n=t.id;return _l(1,"header","decision-table-properties",[_l(1,"h3","decision-table-name",t.name,0,{title:"Decision Name"}),_l(1,"h5","decision-table-id",n,0,{title:"Decision Id"})],4)}}]),t}();var Xf=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",function(){return Kf})};Xf.$inject=["components"];var Zf={__init__:["decisionTableProperties"],decisionTableProperties:["type",Xf]},Yf="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},Jf=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Qf=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Yf(t))&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Yf(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,Ip),Jf(t,[{key:"render",value:function(){var e=this.props,t=e.row,n=e.rowIndex,o=this.context.components.getComponents("cell-inner",{cellType:"rule-index",row:t,rowIndex:n});return _l(1,"td","rule-index",[o&&o.map(function(e){return wl(2,e,{row:t,rowIndex:n})}),n+1],0,{"data-row-id":t.id})}}]),t}();var ed=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 Qf})};ed.$inject=["components"];var td={__init__:["decisionRuleIndices"],decisionRuleIndices:["type",ed]},nd="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},od=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var rd=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":nd(t))&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":nd(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,Ip),od(t,[{key:"render",value:function(e){var t=e.rows,o=e.cols,r=this.context.components;return _l(1,"tbody",null,t.map(function(e,t){var n=r.getComponent("row",{rowType:"rule"});return n&&wl(2,n,{row:e,rowIndex:t,cols:o},e.id)}),0)}}]),t}(),id="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},ad=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var sd=function(e){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=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":id(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return sf(n,Af),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":id(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,Ip),ad(o,[{key:"render",value:function(){var n=this,e=this.props,o=e.row,r=e.rowIndex,i=e.cols,t=o.cells;return _l(1,"tr",null,[this.slotFills({type:"cell",context:{cellType:"before-rule-cells",row:o,rowIndex:r}}),t.map(function(e,t){return n.slotFill({type:"cell",context:{cellType:"rule",cell:e,rowIndex:r,colIndex:t},key:e.id,row:o,col:i[t]})}),this.slotFills({type:"cell",context:{cellType:"after-rule-cells",row:o,rowIndex:r}})],0)}}]),o}(),cd="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},ud=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var ld=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":cd(t))&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":cd(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,Ip),ud(t,[{key:"render",value:function(){var e=this.props,t=e.cell,n=e.row,o=e.col;return Ht(t,"dmn:UnaryTests")?wl(2,vf,{className:"input-cell",elementId:t.id,"data-row-id":n.id,"data-col-id":o.id,children:t.businessObject.text}):wl(2,vf,{className:"output-cell",elementId:t.id,"data-row-id":n.id,"data-col-id":o.id,children:t.businessObject.text})}}]),t}();var pd=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 rd}),t.onGetComponent("row",function(e){if("rule"===e.rowType)return sd}),t.onGetComponent("cell",function(e){if("rule"===e.cellType)return ld})};pd.$inject=["components"];var fd={__init__:["decisionRules"],decisionRules:["type",pd]},dd="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},hd=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var yd=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":dd(t))&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":dd(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,Ip),hd(t,[{key:"componentWillMount",value:function(){var e=this.context.injector;this._sheet=e.get("sheet")}},{key:"render",value:function(){var e=this._sheet.getRoot().businessObject,t=e.hitPolicy;return _l(1,"th","hit-policy header",[t.charAt(0),function(e){switch(e){case"SUM":return"+";case"MIN":return"<";case"MAX":return">";case"COUNT":return"#";default:return""}}(e.aggregation)],0,{rowspan:"3",title:"Hit Policy = "+t})}}]),t}();function vd(e){e.onGetComponent("cell",function(e){if("before-label-cells"===e.cellType)return yd})}vd.$inject=["components"];var md={__init__:["hitPolicyProvider"],hitPolicyProvider:["type",vd]},gd="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},bd=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var _d=function(e){function r(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":gd(t))&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));n.onClick=function(){n._eventBus.fire("showDrd")};var o=t.injector;return n._eventBus=o.get("eventBus"),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":gd(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,Ip),bd(r,[{key:"render",value:function(){var t=this;return _l(1,"div","view-drd",_l(1,"button","view-drd-button",xl("View DRD"),2,{onClick:this.onClick}),2,null,null,function(e){return t.node=e})}}]),r}(),wd=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var xd=function(){function i(e,t,o,r){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),this._injector=o,this._sheet=r,e.onGetComponent("table.before",function(){if(n.canViewDrd())return _d}),t.on("showDrd",function(){var e=o.get("_parent",!1),t=Cd(r.getRoot());if(t){var n=e.getView(t);e.open(n)}})}return wd(i,[{key:"canViewDrd",value:function(){var e=this._injector.get("_parent",!1);if(!e)return!1;var t=Cd(this._sheet.getRoot());return!!e.getView(t)}}]),i}();function Cd(e){var t=e.businessObject;if(t)return t.$parent.$parent}xd.$inject=["components","eventBus","injector","sheet"];var Ed={__init__:["viewDrd"],viewDrd:["type",xd]},kd="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},Sd=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Od=function(e){function r(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":kd(t))&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));n.onClick=function(){n._eventBus.fire("poweredBy.show")};var o=t.injector;return n._eventBus=o.get("eventBus"),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":kd(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,Ip),Sd(r,[{key:"render",value:function(){var t=this;return _l(1,"div","powered-by-logo",_l(1,"img","logo",null,1,{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC"}),2,{onClick:this.onClick,title:"Powered by bpmn.io"},null,function(e){return t.node=e})}}]),r}(),jd="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},Pd=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Td=function(e){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":jd(t))&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.state={show:!1},t.onClick=t.onClick.bind(t),t.onShow=t.onShow.bind(t),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":jd(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,Ip),Pd(n,[{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&&_l(1,"div","powered-by-overlay",_l(1,"div","powered-by-overlay-content",[_l(1,"div",null,_l(1,"img","logo",null,1,{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC"}),2),_l(1,"div",null,[xl("Web-based tooling for BPMN, DMN and CMMN diagrams powered by "),_l(1,"a",null,xl("bpmn.io"),2,{href:"http://bpmn.io",target:"_blank"}),xl(".")],4)],4,{onClick:function(e){return e.stopPropagation()}}),2,{onClick:this.onClick})}}]),n}();var Rd=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 Od}),t.onGetComponent("table.before",function(){return Td})};Rd.$inject=["components","eventBus"];var Ad={__init__:["poweredBy"],poweredBy:["type",Rd]},Dd="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},Md=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();function Bd(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var Id=function(e){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(),n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Dd(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,R(e,{renderer:{container:t}})));return n._container=t,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Dd(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,Xp),Md(o,[{key:"open",value:function(e,t){var n;try{return this._decision&&this.clear(),this._decision=e,function(e,t,n){var o,r=e.get("tableImporter"),i=e.get("eventBus"),a=e.get("sheet"),s=e.get("modeling",!1),c=void 0,u=[];i.fire("import.render.start",{decision:t});try{o=t,new Yp({create:function(e,t,n,o){return r.create(e,t,n,o)},table:function(e){return r.add(e)},element:function(e,t,n){return r.add(e,t,n)},error:function(e,t){u.push({message:e,context:t})}},{canAddMissingEntries:s}).handleDecision(o)}catch(e){c=e}i.fire("import.render.complete",{error:c,warnings:u}),i.fire("elements.changed",{elements:[a.getRoot()]}),n(c,u)}(this,e,t)}catch(e){n=e}return t(n)}},{key:"_init",value:function(e){var t=e.modules,n=e.additionalModules,o=function(e,t){var n={};for(var o in e)0<=t.indexOf(o)||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}(e,["modules","additionalModules"]),r=t||this.getModules(),i=n||[],a=[{decisionTable:["value",this]}];return{modules:[Ad].concat(Bd(r),Bd(i),a),config:o}}},{key:"on",value:function(e,t,n,o){return this.get("eventBus").on(e,t,n,o)}},{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",{}),Pt(e))}},{key:"destroy",value:function(){(function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0})(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"destroy",this).call(this),this.detach()}},{key:"getModules",value:function(){return o._getModules()}}],[{key:"_getModules",value:function(){return[Ef,Pf,Hf,Zf,td,fd,md,Ed]}},{key:"_createContainer",value:function(){return wt('<div class="dmn-decision-table-container"></div>')}}]),o}(),Nd="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},Vd=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Ld=function(e){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=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Nd(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n.handleClick=function(e){e.stopPropagation(),n.addRule()},rf(n),n.addRule=n.addRule.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Nd(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,Ip),Vd(o,[{key:"componentWillMount",value:function(){this._eventBus=this.context.injector.get("eventBus")}},{key:"addRule",value:function(){this._eventBus.fire("addRule")}},{key:"render",value:function(){var e=this.props.cols,t=[_l(1,"td","add-rule-add",_l(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(_l(1,"td","input-cell",xl("-"),2));for(var o=0;o<e.length+1;o++){var r="add-rule",i=e[o]&&e[o].businessObject;i&&(i.$instanceOf("dmn:InputClause")&&(r+=" input-cell"),i.$instanceOf("dmn:OutputClause")&&(r+=" output-cell")),t.push(_l(1,"td",r,xl("-"),2))}return _l(1,"tfoot","actionable add-rule",_l(1,"tr",null,t,0),2,{onClick:this.handleClick})}}]),o}();Ld.$inject=["sheet"];var $d=function e(t,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 Ld}),o.on("addRule",function(){n.trigger("addRule")})};$d.$inject=["components","editorActions","eventBus"];var Fd=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Ud=function(){function r(e,t,n){var o=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._renderer=n,this._selection=void 0,t.on("diagram.clear",function(){o._selection=void 0})}return Fd(r,[{key:"select",value:function(e){d(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}}]),r}();Ud.$inject=["elementRegistry","eventBus","renderer"];var zd=function e(o,t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._elementRegistry=o,this._renderer=n,this._selection=r,t.on(["cell.click","cell.contextmenu"],function(e){var t=e.id,n=o.get(t);n&&r.select(n)}),t.on("row.remove",function(e){var t=e.row,n=r.get();n&&t===n.row&&r.deselect()}),t.on("col.remove",function(e){var t=e.col,n=r.get();n&&t===n.col&&r.deselect()})};zd.$inject=["elementRegistry","eventBus","renderer","selection"];var Wd={__init__:["selection","selectionBehavior"],selection:["type",Ud],selectionBehavior:["type",zd]},Hd=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Gd=["click","dblclick","contextmenu","mousedown","mouseup","mouseenter","mouseleave","mouseout","mouseover","mousemove","focusin","focusout","drag","dragstart","dragend","dragover","dragenter","dragleave","drop"],qd=function(){function n(e,t){var a=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),this._handleEvent=function(e){var t=e.target,n=e.type,o=ht(t,"[data-element-id]",!0);if(o){var r=o.getAttribute("data-element-id");if(r){var i=a._eventBus.createEvent({id:r,event:e,node:o,target:o});a._eventBus.fire("cell."+n,i),i.defaultPrevented&&e.preventDefault(),i.cancelBubble&&e.stopPropagation()}}},this._eventBus=t,this._container=e.container,t.on("table.init",function(){a._addEventListeners(Gd)}),t.on("table.destroy",function(){a._removeEventListeners(Gd)})}return Hd(n,[{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)})}}]),n}();qd.$inject=["config.renderer","eventBus"];var Kd={__init__:["interactionEvents"],interactionEvents:["type",qd]},Xd="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},Zd=function(e,t){return e^t};var Yd=/\b(Array|Date|Object|Math|JSON)\b/g,Jd=function(e,t){var n,o,r,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(Yd,"").match(/[a-zA-Z_]\w*/g)||[]);return t&&"string"==typeof t&&(n=t,t=function(e){return n+e}),t?(o=i,r=t,e.replace(/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\/|[a-zA-Z_]\w*/g,function(e){return"("==e[e.length-1]?r(e):~o.indexOf(e)?r(e):e})):i};var Qd=eh;function eh(e,t){if(!(this instanceof eh))return new eh(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 th(a,s){var c="nextSibling"==a;return function(e,t,n){e=this.compile(e),t=t&&0<t?t:1;for(var o=this.node,r=this.closingTag,i=this._revisit;o;){if(Zd(c,r)&&o[s])o=o[s],r=!c;else if(1==o.nodeType&&!o[s]&&Zd(c,r)){if(r=c,!i)continue}else if(o[a])o=o[a],r=!c;else if(o=o.parentNode,r=c,!i)continue;if(!o||this.higher(o,this.root))break;if(e(o)&&this.selects(o,n)&&this.rejects(o,n)){if(--t)continue;return n||(this.node=o),this.closingTag=r,o}}return null}}eh.prototype.reset=function(e){return this.node=e||this.start,this},eh.prototype.revisit=function(e){return this._revisit=null==e||e,this},eh.prototype.opening=function(){return 1==this.node.nodeType&&(this.closingTag=!1),this},eh.prototype.atOpening=function(){return!this.closingTag},eh.prototype.closing=function(){return 1==this.node.nodeType&&(this.closingTag=!0),this},eh.prototype.atClosing=function(){return this.closingTag},eh.prototype.next=th("nextSibling","firstChild"),eh.prototype.previous=eh.prototype.prev=th("previousSibling","lastChild"),eh.prototype.select=function(e){return e=this.compile(e),this._selects.push(e),this},eh.prototype.selects=function(e,t){var n=this._selects,o=n.length;if(!o)return!0;for(var r=0;r<o;r++)if(n[r].call(this,e,t))return!0;return!1},eh.prototype.reject=function(e){return e=this.compile(e),this._rejects.push(e),this},eh.prototype.rejects=function(e,t){var n=this._rejects,o=n.length;if(!o)return!0;for(var r=0;r<o;r++)if(n[r].call(this,e,t))return!1;return!0},eh.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},eh.prototype.compile=function(t){switch(void 0===t?"undefined":Xd(t)){case"number":return function(e){return t==e.nodeType};case"string":return new Function("node","return "+Jd(t,"node."));case"function":return t;default:return function(){return!0}}},eh.prototype.peak=eh.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},eh.prototype.use=function(e){return e(this),this};var nh=window.getSelection();function oh(e){nh.removeAllRanges(),nh.addRange(e)}function rh(e,t){oh(function(e,t){var n,o=t.start,r=t.end,i=document.createRange(),a=Qd(e.firstChild,e),s=a.node,c=!1,u=0;for(;s;){if(u===o&&(c?i.setStartAfter(s):i.setStartBefore(s)),u===r)return c?i.setEndAfter(s):i.setEndBefore(s),i;if(c||(sh(s)||s.previousSibling&&(ch(s)||uh(s)))&&u++,ah(s)){if(n=s.textContent.length,u<=o&&o<u+n&&i.setStart(s,o-u),r<u+n)return i.setEnd(s,r-u),i;u+=n}s=a.next(),c=a.closingTag}u<=o&&(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 ih(e){if(!function(e){if(!nh.rangeCount)return null;var t=nh.focusNode;return ah(t)&&(t=t.parentNode),e==t||e.contains(t)}(e))return null;var t,n,o=nh.getRangeAt(0),r=o.startContainer,i=o.endContainer,a=o.startOffset,s=o.endOffset,c=Qd(e.firstChild,e),u=c.node,l=!1,p=0;function f(e,t){return 1===arguments.length&&(t=e),e.parentNode===i&&t==i.childNodes[s]}function d(e,t){return 1===arguments.length&&(t=e),e.parentNode===r&&t==r.childNodes[a]}for(;u&&(d(u)&&(n=p),!f(u));){if(l||(sh(u)||t&&t.nextSibling==u&&(ch(u)||uh(u)))&&p++,ah(u)){if(r===u&&(n=p+a),i===u){p+=s;break}p+=u.textContent.length}if((ah(u)||l)&&(d(u,u.nextSibling)&&(n=p),f(u,u.nextSibling)))break;t=u,u=c.next(),l=c.closingTag}return{start:void 0===n?p:n,end:p}}function ah(e){return 3===e.nodeType}function sh(e){return 1===e.nodeType&&"BR"===e.nodeName}function ch(e){return 1===e.nodeType&&"DIV"===e.nodeName}function uh(e){return 1===e.nodeType&&"P"===e.nodeName}var lh=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],o=!0,r=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(o=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);o=!0);}catch(e){r=!0,i=e}finally{try{!o&&s.return&&s.return()}finally{if(r)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},ph="[contenteditable]",fh="[data-element-id]";function dh(e){return e.getAttribute("data-element-id")}function hh(e,t){return Ot('[data-element-id="'+Pi(e)+'"]',t)}function yh(e){return ht(e,fh,!0)}function vh(e){var t=ph;return St(e,t)?e:Ot(t,e)}var mh={above:!0,below:!0,right:!0,left:!0};function gh(e,n,t,o,r){var c=e.container,u=null;function i(e,t){n.fire("selection."+e+".changed",t),n.fire("cellSelection.changed",{elementId:e,selection:t})}function l(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];u!==e&&i(u,{selected:!1,focussed:!1}),(u=e)&&i(e,{selected:!0,focussed:t}),e?o.select(e):o.deselect()}n.on("cell.click",500,function(e){var t=e.target;if(!ht(t,".no-deselect",!0)){var n=yh(t);l(n&&dh(n),!e.defaultPrevented),e.stopPropagation()}}),n.on("cell.focusin",500,function(e){var t=dh(e.target),n=!e.defaultPrevented;return e.stopPropagation(),l(t,n)}),n.on("cell.focusout",500,function(e){i(dh(e.target),{focussed:!1})}),n.on("cellSelection.changed",function(e){var t=e.elementId,n=e.selection,o=hh(t,c);n.focussed&&o&&function(e){var t=vh(e);if(t&&document.body.contains(t)&&document.activeElement!==t){t.focus();var n=ih(t);n&&0!==n.end||rh(t,{start:5e3,end:5e3})}}(o)}),n.on("selection.changed",function(e){var t=e.selection,n=e.oldSelection,o=t&&t.id,r=n&&n.id;o&&o!==u?l(t.id):r&&r===u&&l()}),this.isCellSelected=function(){return!!u},this.getCellSelection=function(){return u},this.selectCell=function(e){if(u){if(!(e in mh))throw new Error("direction must be any of { above, below, left, right }");var t=function(e){var t=e.getAttribute("data-coords");if(!t)return null;var n=t.split(":"),o=lh(n,2);return{row:o[0],col:o[1]}}(hh(u,c));if(!t)return!1;var n,o,r,i=function(e,t){var n=e.row,o=e.col;if("above"===t||"below"===t){var r=parseInt(n,10);if(isNaN(r))return e;var i="above"===t?r-1:r+1;return{col:o,row:i}}if("left"!==t&&"right"!==t)throw new Error("invalid direction <"+t+">");var a=parseInt(o,10);if(isNaN(a))return e;return{row:n,col:"left"===t?a-1:a+1}}(t,e),a=(o=c,r=(n=i).row+":"+n.col,Ot('[data-coords="'+Pi(r)+'"]',o));if(!a)return!1;var s=dh(a);return s&&l(s,{focussed:!0,selected:!0}),!0}},n.on("contextMenu.close",function(){if(u)return l(u)})}gh.$inject=["config.renderer","eventBus","sheet","selection","elementRegistry"];var bh={__depends__:[Kd,Wd],__init__:["cellSelection"],cellSelection:["type",gh]};function _h(){}_h.prototype.get=function(){return this._data},_h.prototype.set=function(e){this._data=e},_h.prototype.clear=function(){var e=this._data;return delete this._data,e},_h.prototype.isEmpty=function(){return!this._data};var wh={clipboard:["type",_h]},xh="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},Ch=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Eh=function(e){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=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":xh(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e));return n._sheet=t,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":xh(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,cc),Ch(o,[{key:"init",value:function(){var r=this;this.addRule("col.move",2e3,function(e){var t=e.col,n=e.index,o=r._sheet.getRoot().businessObject.input;return Gt(t)?n<o.length:n>=o.length}),this.addRule("col.remove",2e3,function(e){var t=e.col,n=r._sheet.getRoot().cols;return!qt(t)||1<n.filter(function(e){return qt(e)}).length}),this.addRule("paste",2e3,function(e){var t=e.data,n=e.target;if(!t||!n)return!1;var o=t.root;return n instanceof Wu?r.canPasteRows(o):n instanceof Hu&&r.canPasteCols(o,n)})}},{key:"canPasteRows",value:function(e){var n=this._sheet.getRoot().cols;return r(e,function(e){return"row"===e.type&&(e.cells.length===n.length&&r(e.cells,function(e,t){return Gt(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 r(e,function(e){return"col"===e.type&&(e.cells.length===n.length&&(Gt(t)?"dmn:InputClause"===e.businessObject.$type:"dmn:OutputClause"===e.businessObject.$type))})}}]),o}();Eh.$inject=["eventBus","sheet"];var kh={__depends__:[{__depends__:[gi]}],__init__:["decisionTableModelingRules"],decisionTableModelingRules:["type",Eh]},Sh=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Oh=function(){function o(e,t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this._clipboard=e,this._modeling=t,this._sheet=n}return Sh(o,[{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 Wu?t._modeling.removeRow(e):e instanceof Hu&&t._modeling.removeCol(e)})}},{key:"revert",value:function(e){var t=e.oldData;return this._clipboard.set(t),this._sheet.getRoot()}}]),o}();Oh.$inject=["clipboard","modeling","sheet"];var jh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e};function Ph(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Th(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var Rh=[function(e,t,n,o){var r=n,i=jh({},t,{type:function(e){if(e instanceof Wu)return"row";if(e instanceof Hu)return"col";if(e instanceof Gu)return"cell";throw new Error("cannot deduce element type: #"+e.id)}(e)});if(e instanceof Wu||e instanceof Hu){var a=o(e.cells,r);i.cells=a.root,r=a.descriptorCache}return{root:i,descriptorCache:r}},function(e,t,n){var o=e.businessObject;if(!o)return{root:t,descriptorCache:n};var r=function o(r,i){var e,t;var n=r.id;if(n&&(e=i.boCache||{},t=e[n]))return{root:t,descriptorCache:i};var a={$type:r.$type};n&&(a.id=n,e=jh({},e,Ph({},n,a)),i=jh({},i,{boCache:e}));r.$descriptor.properties.forEach(function(e){var t=r[e.name];if(t){if(y(t)&&(t=t.map(function(e){var t=o(e,i);return i=t.descriptorCache,t.root})),t.$type){var n=o(t,i);i=n.descriptorCache,t=n.root}a[e.name]=t}});return{root:a,descriptorCache:i}}(o,n);return{root:jh({},t,{businessObject:r.root}),descriptorCache:r.descriptorCache}}],Ah=[function(e,t,n){var o=e.root.businessObject;if(!o)return{root:t,reviveCache:n};var r=function o(e,r){var i=e.root;var t=i.id;var a=void 0,n=void 0;if(t&&(a=r.boCache||{},n=a[t]))return{root:n,reviveCache:r};var s={};m(i).forEach(function(e){var t=void 0,n=void 0;i[e].$type?(n=o({root:i[e]},r),t=n.root,r=n.reviveCache,a=r.boCache||{}):t=y(i[e])?i[e].map(function(e){return n=o({root:e},r),r=n.reviveCache,a=r.boCache||{},n.root}):i[e],s[e]=t});var c=s.$type;delete s.$type;r._keepIds&&!r._model.ids.assigned(s.id)||delete s.id;var u=r._dmnFactory.create(c,s);w(s,function(e){e.$type&&(e.$parent=u),y(e)&&e.forEach(function(e){return e.$parent=u})});t&&(a=jh({},a,Ph({},t,u)),r=jh({},r,{boCache:a}));return{root:u,reviveCache:r}}({root:o,descriptorCache:e.descriptorCache},n);return{root:jh({},t,{businessObject:r.root}),reviveCache:r.reviveCache}},function(e,t,n,o){var r=e.root,i=e.descriptorCache,a=jh({},t);t.businessObject&&t.businessObject.id&&(a.id=t.businessObject.id);if("row"===r.type||"col"===r.type){var s=o({root:r.cells,descriptorCache:i},n);a.cells=s.root,n=s.reviveCache}var c=new(function(e){switch(e.type){case"row":return Wu;case"cell":return Gu;case"col":return Hu;default:throw new Error("unknown element type: #"+e.type)}}(r))(a);c instanceof Wu?c.cells.forEach(function(e){e.row=c}):c instanceof Hu&&c.cells.forEach(function(e){e.col=c});return{root:c,reviveCache:n}}];function Dh(e,t,n){return n=n||Rh,t=t||{},y(e)?(s=n,x(e,function(e,t){var n=e.descriptorCache,o=e.root,r=Mh(t,n,s),i=r.root,a=r.descriptorCache;return{root:[].concat(Th(o),[i]),descriptorCache:jh({},n,a)}},{root:[],descriptorCache:t})):Mh(e,t,n);var s}function Mh(e,t,n){var o=e.id,r={id:o},i=t.elements||{},a=i[o];if(a)return{root:a,descriptorCache:t};var s=function(n,e,o,t){function r(e,t){return Dh(e,t,o)}return x(o,function(e,t){return t(n,e.root,e.descriptorCache,r)},{root:e,descriptorCache:t})}(e,r,n,jh({},t,{elements:i}));return{root:s.root,descriptorCache:jh({},s.descriptorCache,{elements:jh({},s.descriptorCache.elements,Ph({},o,s.root))})}}function Bh(e,t,n){return n=n||Ah,t=t||{},y(e.root)?(r=t,s=n,i=(o=e).root,c=o.descriptorCache,x(i,function(e,t){var n=e.reviveCache,o=e.root,r=Ih({root:t,descriptorCache:c},n,s),i=r.root,a=r.reviveCache;return{root:[].concat(Th(o),[i]),reviveCache:a}},{root:[],reviveCache:r})):Ih(e,t,n);var o,r,s,i,c}function Ih(e,t,n){var o=e.root.id,r=t.elements||{},i=r[o];if(i)return{root:i,reviveCache:t};var a=function(n,e,o,t){function r(e,t){return Bh(e,t,o)}return x(o,function(e,t){return t(n,e.root,e.reviveCache,r)},{root:e,reviveCache:t})}(e,{id:o},n,jh({},t,{elements:r}));return{root:a.root,reviveCache:jh({},a.reviveCache,{elements:jh({},a.reviveCache.elements,Ph({},o,a.root))})}}var Nh=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Vh=function(){function c(e,t,n,o,r,i,a,s){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),this._clipboard=e,this._dmnFactory=t,this._elementFactory=n,this._elementRegistry=o,this._eventBus=r,this._model=i,this._modeling=a,this._sheet=s}return Nh(c,[{key:"postExecute",value:function(e){var t=this,n=e.element,o=e.after,r=this._clipboard.get();if(!r)throw new Error("missing clipboard data");var i=this._sheet.getRoot(),a=Bh(r.elements,{_dmnFactory:this._dmnFactory,_keepIds:r.keepIds,_model:this._model}).root;if(n instanceof Wu){var s=i.rows.indexOf(n);if(-1===s)return;a.forEach(function(e){o&&s++,t._modeling.addRow(e,s)})}else if(n instanceof Hu){var c=i.cols.indexOf(n);if(-1===c)return;a.forEach(function(e){o&&c++,t._modeling.addCol(e,c)})}return e.oldElements=this._clipboard.get(),this._sheet.getRoot()}},{key:"revert",value:function(e){}}]),c}();Vh.$inject=["clipboard","dmnFactory","elementFactory","elementRegistry","eventBus","moddle","modeling","sheet"];var Lh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},$h=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Fh=function(){function a(e,t,n,o,r,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=o,this._sheet=r,this._rules=i,t.registerHandler("cut",Oh),t.registerHandler("paste",Vh)}return $h(a,[{key:"copy",value:function(e){y(e)||(e=[e]);var t={elements:Dh(e)};this._eventBus.fire("copyCutPaste.copy",{data:t}),this._clipboard.set(t)}},{key:"cut",value:function(e){y(e)||(e=[e]);var t={elements:Dh(e),keepIds:!0},n={elements:e,data:t};this._eventBus.fire("copyCutPaste.cut",{data:t}),this._commandStack.execute("cut",n)}},{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",Lh({element:e},t)),!0)}},{key:"pasteAt",value:function(e){}}]),a}();Fh.$inject=["clipboard","commandStack","eventBus","modeling","sheet","rules"];var Uh={__depends__:[wh,kh],__init__:["copyCutPaste"],copyCutPaste:["type",Fh]};var zh=function e(n,t,o,r,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var s={addRule:function(){return o.addRow({type:"dmn:DecisionRule"})},addRuleAbove:function(e){var t=e&&e.rule;if(t||r.hasSelection()){t=t||r.get().row;var n=a.getRoot().rows.indexOf(t);if(-1!==n)return o.addRow({type:"dmn:DecisionRule"},n)}},addRuleBelow:function(e){var t=e&&e.rule;if(t||r.hasSelection()){t=t||r.get().row;var n=a.getRoot().rows.indexOf(t);if(-1!==n)return o.addRow({type:"dmn:DecisionRule"},n+1)}},removeRule:function(e){var t=e&&e.rule;(t||r.hasSelection())&&(t=t||r.get().row,o.removeRow(t))},addInput:function(){var e=a.getRoot().businessObject.input;return o.addCol({type:"dmn:InputClause"},e?e.length:0)},addInputLeft:function(e){var t=e&&e.input;if(t||r.hasSelection()){t=t||r.get().col;var n=a.getRoot().cols.indexOf(t);if(-1!==n)return o.addCol({type:"dmn:InputClause"},n)}},addInputRight:function(e){var t=e&&e.input;if(t||r.hasSelection()){t=t||r.get().col;var n=a.getRoot().cols.indexOf(t);if(-1!==n)return o.addCol({type:"dmn:InputClause"},n+1)}},removeInput:function(e){var t=e&&e.input;(t||r.hasSelection())&&(t=t||r.get().col,o.removeCol(t))},addOutput:function(){var e=a.getRoot().businessObject,t=e.input,n=e.output;return o.addCol({type:"dmn:OutputClause"},t.length+n.length)},addOutputLeft:function(e){var t=e&&e.output;if(t||r.hasSelection()){t=t||r.get().col;var n=a.getRoot().cols.indexOf(t);if(-1!==n)return o.addCol({type:"dmn:OutputClause"},n)}},addOutputRight:function(e){var t=e&&e.output;if(t||r.hasSelection()){t=t||r.get().col;var n=a.getRoot().cols.indexOf(t);if(-1!==n)return o.addCol({type:"dmn:OutputClause"},n+1)}},removeOutput:function(e){var t=e&&e.output;(t||r.hasSelection())&&(t=t||r.get().col,o.removeCol(t))},addClause:function(){if(r.hasSelection()){var e=r.get().col;return Ht(e,"dmn:InputClause")?s.addInput({input:e}):Ht(e,"dmn:OutputClause")?s.addOutput({output:e}):void 0}},addClauseLeft:function(){if(r.hasSelection()){var e=r.get().col;return Ht(e,"dmn:InputClause")?s.addInputLeft({input:e}):Ht(e,"dmn:OutputClause")?s.addOutputLeft({output:e}):void 0}},addClauseRight:function(){if(r.hasSelection()){var e=r.get().col;return Ht(e,"dmn:InputClause")?s.addInputRight({input:e}):Ht(e,"dmn:OutputClause")?s.addOutputRight({output:e}):void 0}},removeClause:function(){if(r.hasSelection()){var e=r.get().col;return Ht(e,"dmn:InputClause")?s.removeInput({input:e}):Ht(e,"dmn:OutputClause")?s.removeOutput({output:e}):void 0}},selectCellAbove:function(){return i.selectCell("above")},selectCellBelow:function(){return i.selectCell("below")},copy:function(e){var t=e.element;n.copy(t)},cut:function(e){var t=e.element;n.cut(t)},pasteBefore:function(e){var t=e.element;return n.pasteBefore(t)},pasteAfter:function(e){var t=e.element;return n.pasteAfter(t)}};t.register(s)};zh.$inject=["copyCutPaste","editorActions","modeling","selection","cellSelection","sheet"];var Wh=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Hh="is not a registered action",Gh=function(){function r(e,t,o,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this._actions={undo:function(){e.undo()},redo:function(){e.redo()},select:function(e){var t=e.cell;n.select(t)},deselect:function(){n.deselect()},addRow:function(e){var t=e.attrs,n=e.index;o.addRow(t,n)},removeRow:function(e){var t=e.row;o.removeRow(t)},moveRow:function(e){var t=e.row,n=e.index;o.moveRow(t,n)},addCol:function(e){var t=e.attrs,n=e.index;o.addCol(t,n)},removeCol:function(e){var t=e.col;o.removeCol(t)},moveCol:function(e){var t=e.col,n=e.index;o.moveCol(t,n)}}}return Wh(r,[{key:"trigger",value:function(e,t){if(!this._actions[e])throw qh(e,Hh);return this._actions[e](t)}},{key:"register",value:function(e,t){var n=this;if("string"==typeof e)return this._registerAction(e,t);w(e,function(e,t){n._registerAction(t,e)})}},{key:"_registerAction",value:function(e,t){if(this.isRegistered(e))throw qh(e,"is already registered");this._actions[e]=t}},{key:"unregister",value:function(e){if(!this.isRegistered(e))throw qh(e,Hh);this._actions[e]=void 0}},{key:"isRegistered",value:function(e){return!!this._actions[e]}}]),r}();function qh(e,t){return new Error(e+" "+t)}Gh.$inject=["commandStack","eventBus","modeling","selection"];var Kh={__depends__:[Wd],__init__:["editorActions"],editorActions:["type",Gh]},Xh={__depends__:[bh,Uh,Kh,Wd],__init__:["decisionTableEditorActions"],decisionTableEditorActions:["type",zh]},Zh={__depends__:[Xh],__init__:["addRule"],addRule:["type",$d]},Yh=/["'&<>]/,Jh=function(e){var t,n=""+e,o=Yh.exec(n);if(!o)return n;var r="",i=0,a=0;for(i=o.index;i<n.length;i++){switch(n.charCodeAt(i)){case 34:t=""";break;case 38:t="&";break;case 39:t="'";break;case 60:t="<";break;case 62:t=">";break;default:continue}a!==i&&(r+=n.substring(a,i)),a=i+1,r+=t}return a!==i?r+n.substring(a,i):r};var Qh=function(e,t,n){var o=e.start,r=o,i=n.length-t.length,a=(n.length,t.length,t.substring(o));return n.lastIndexOf(a)===n.length-a.length&&(t=t.substring(0,t.length-a.length),n=n.substring(0,n.length-a.length)),(i=function(e,t){var n,o,r,i,a,s=0,c=0;for(i=t.length>e.length?(o=t,e):(o=e,t);s<o.length;)r=o.charAt(s),a=i.charAt(c),r!==a?n||(n={l_start:s,s_start:c}):(n&&!n.complete&&(n.l_end=s,n.s_end=c,n.complete=!0),c++),s++;if(n&&!n.complete&&(n.complete=!0,n.s_end=i.length,n.l_end=o.length),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))&&(r="remove"===i.type?i.newStart:i.newEnd),ey(r)};function ey(e,t){return{start:e,end:void 0===t?e:t}}var ty=ey;Qh.range=ty;var ny="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},oy=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var ry=function(e){function r(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var n,o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":ny(t))&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));return o.onFocus=function(){var e=o.props.onFocus;o.setState({focussed:!0}),"function"==typeof e&&e()},o.onBlur=function(){var e=o.props.onBlur;o.setState({focussed:!1}),"function"==typeof e&&e()},o.onKeydown=function(e){if(13===e.which){if(e.preventDefault(),o.props.ctrlForNewline&&(!(t=e).metaKey&&!t.ctrlKey))return;e.stopPropagation(),function(){var e=nh.getRangeAt(0);if(!e)return;var t=e.cloneRange(),n=document.createElement("br");t.deleteContents(),t.insertNode(n),t.setStartAfter(n),t.setEndAfter(n),oh(t)}(),o.onInput(e)}var t},o.onInput=function(e){var t=o.props.onInput;"function"==typeof t&&t(iy(o.node))},o.onPaste=ay,o.onKeypress=ay,o.state={},(0<(n=window.navigator.userAgent).indexOf("MSIE ")||0<n.indexOf("Trident/"))&&(o.onPaste=o.onKeypress=function(t){var n=o.node.innerHTML;setTimeout(function(){var e=o.node.innerHTML;n!==e&&o.onInput(t)},0)}),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":ny(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,Ip),oy(r,[{key:"componentWillUpdate",value:function(e,t){var n=this.node,o=t.focussed&&ih(n);this.selected=o&&{range:o,text:iy(n)}}},{key:"componentDidUpdate",value:function(){var e=this.selected;if(e){var t=e.range,n=e.text,o=this.node,r=iy(o);rh(o,r!==n?Qh(t,n,r):t)}}},{key:"render",value:function(e){var t=this,n=e.value,o=e.className;return n=Jh(n).replace(/\r?\n/g,"<br/>")+"<br/>",_l(1,"div",[o||"","content-editable"].join(" "),null,1,{contentEditable:"true",spellcheck:"false",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})}}]),r}();function iy(e){return e.innerText.replace(/\n$/,"")}function ay(){}var sy="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},cy=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var uy=function(e){function r(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":sy(t))&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));o.onFocus=function(){o.setState({focussed:!0});var e=o.props.onFocus;"function"==typeof e&&e()},o.onBlur=function(e){o.setState({focussed:!1}),o.state.invalid&&o.setState({changing:!1,invalid:!1});var t=o.props.onBlur;"function"==typeof t&&t()},o.state={changing:!1,focussed:!1};var n=t.injector.get("debounceInput");return o.inputChanged=n(function(e){var t=o.props.onChange;"function"==typeof t&&t(e);var n=o.state.changing;o.setState({changing:n!==e&&n})}),o.onInput=function(e){var t=(o.props.validate||function(){})(e);o.setState({changing:e,invalid:t}),t||o.inputChanged(e)},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":sy(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,Ip),cy(r,[{key:"getClassName",value:function(){var e=this.props.className,t=this.state;return e+=" editable",t.focussed&&(e+=" focussed"),t.invalid&&(e+=" invalid"),e}},{key:"getDisplayValue",value:function(){var e=this.props.value,t=this.state,n=t.focussed,o=t.changing;return"string"==typeof o&&(e=o),e||(e=n?"":"-"),e}},{key:"getEditor",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return wl(2,ry,{className:e.className,ctrlForNewline:e.ctrlForNewline,onFocus:this.onFocus,onBlur:this.onBlur,onInput:this.onInput,value:this.getDisplayValue()})}}]),r}(),ly="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},py=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();function fy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dy(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":ly(t))&&"function"!=typeof t?e:t}function hy(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":ly(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var yy=function(e){function o(e,t){fy(this,o);var n=dy(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n.onElementsChanged=function(){n.forceUpdate()},n.setAnnotationValue=function(e){var t=n.props.row;n.modeling.editAnnotation(t.businessObject,e)},rf(n),n}return hy(o,Ip),py(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,o=t.businessObject,r=o.description,i=o.id;return wl(2,vf,{className:"annotation",onChange:this.setAnnotationValue,coords:n+":annotation",value:r,elementId:i+"__annotation","data-row-id":t.id,children:wl(2,vy,{ctrlForNewline:!0,className:"annotation-editor",onChange:this.setAnnotationValue,value:r})})}}]),o}();yy.$inject=["changeSupport","modeling"];var vy=function(e){function t(){return fy(this,t),dy(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return hy(t,uy),py(t,[{key:"render",value:function(){return _l(1,"div",this.getClassName(),this.getEditor(),0)}}]),t}();function my(e){e.onGetComponent("cell",function(e){var t=e.cellType;return"after-label-cells"===t?Jp:"after-rule-cells"===t?yy:void 0})}my.$inject=["components"];function gy(t){return function(e){return!1===t?e:j(e,l(t)?t:300)}}gy.$inject=["config.debounceInput"];var by={debounceInput:["factory",gy]},_y={__depends__:[by],__init__:["annotationsProvider"],annotationsProvider:["type",my]},wy="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},xy=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();function Cy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ey(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":wy(t))&&"function"!=typeof t?e:t}function ky(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":wy(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var Sy=function(e){function o(e,t){Cy(this,o);var n=Ey(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return Oy.call(n),n.state={isOpen:!1,position:{x:0,y:0}},rf(n),n}return ky(o,Ip),xy(o,[{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,o=e.position;if(!t)return null;var r=this.components.getComponents("context-menu",n);return r.length?wl(2,jy,{className:"context-menu no-deselect",context:n,position:o,offset:n.offset||{x:0,y:0},autoFocus:!1!==n.autoFocus,autoClose:!1!==n.autoClose,components:r,onClose:this.triggerClose}):null}}]),o}(),Oy=function(){var o=this;this.open=function(e){var t=e.position,n=e.context;o.close(),o.setState({isOpen:!0,position:t||{x:0,y:0},context:n||{}})},this.close=function(){o.state.isOpen&&o.setState({context:void 0,isOpen:!1,position:{x:0,y:0}})},this.triggerClose=function(){o.eventBus.fire("contextMenu.close")}};Sy.$inject=["eventBus","components"];var jy=function(e){function n(e,t){Cy(this,n);var o=Ey(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e,t));return o.onGlobalClick=function(e){o.checkClose(e.target)},o.onGlobalKey=function(e){var t=e.which;13!==t&&27!==t||(e.stopPropagation(),e.preventDefault(),o.close())},o.onFocusChanged=function(e){o.checkClose(e.target)},o.setNode=function(e){o.node=e;var t,n=o.props.autoFocus;e&&(n&&(t=Ot(Ty,e))&&(t.focus(),t.selectionStart&&"text"===t.type?t.selectionStart=1e5:"contentEditable"in t&&rh(t,{start:1e5,end:1e5})),o.updatePosition())},rf(o),o}return ky(n,Ip),xy(n,[{key:"close",value:function(){var e=this.props.onClose;p(e)&&e()}},{key:"checkClose",value:function(e){if(this.props.autoClose){var t=this.node;t&&t!==e&&(t.contains(e)||this.close())}}},{key:"componentDidMount",value:function(){document.addEventListener("focusin",this.onFocusChanged),document.addEventListener("keydown",this.onGlobalKey),document.addEventListener("click",this.onGlobalClick)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("focusin",this.onFocusChanged),document.removeEventListener("keydown",this.onGlobalKey),document.removeEventListener("click",this.onGlobalClick)}},{key:"updatePosition",value:function(){var e=this.props,t=e.position,n=e.offset,o=this.node.getBoundingClientRect();t.width||(t.width=0),t.height||(t.height=0);var r=this.renderer.getContainer(),i=r.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=r.scrollLeft,s=r.scrollTop,c={};if(t.x+t.width/2>i.width/2){var u=t.x-i.left-o.width+n.x+a;u=Py(u,0+a,i.width-o.width+a),c.left=u+"px"}else{var l=window.scrollX-i.left+t.x+t.width-n.x+a;l=Py(l,0+a,i.width-o.width+a),c.left=l+"px"}var p=void 0;p=t.y+t.height/2>i.height/2?Py(p=t.y-i.top-o.height+n.y+s,0+s,i.height-o.height+s):Py(p=window.scrollY-i.top+t.y-n.y+s,0+s,i.height-o.height+s),c.top=p+"px",c.overflowY="auto",c.maxHeight=i.height-p+s+"px",R(this.node.style,c)}},{key:"render",value:function(){var e=this.props,n=e.context,t=e.components;return _l(1,"div",e.className,t.map(function(e,t){return wl(2,e,{context:n},t)}),0,{onContextMenu:function(e){return e.preventDefault()}},null,this.setNode)}}]),n}();function Py(e,t,n){return Math.max(t,Math.min(n,e))}jy.$inject=["renderer"];var Ty="\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";var Ry=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Ay=function(){function o(e,t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this._eventBus=t,e.onGetComponent("table.before",function(){return Sy})}return Ry(o,[{key:"open",value:function(e,t){this._eventBus.fire("contextMenu.open",{position:e,context:t})}},{key:"close",value:function(){this._eventBus.fire("contextMenu.close")}}]),o}();Ay.$inject=["components","eventBus","renderer"];var Dy={__init__:["contextMenu"],contextMenu:["type",Ay]};function My(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function By(e){return e.shiftKey}var Iy=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Ny=function(){function c(e,t,n,o,r,i,a){var s=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),this._clearClipboard=function(){s._clipboard.clear()},this._registerBindings=function(){[function(e,t){if(My(t)&&67===e){var n=s._getSelectedCell();if(!n)return;return By(t)?s._editorActions.trigger("copy",{element:n.col}):s._editorActions.trigger("copy",{element:n.row}),!0}},function(e,t){if(My(t)&&88===e){var n=s._getSelectedCell();if(!n)return;return By(t)?s._editorActions.trigger("cut",{element:n.col}):s._editorActions.trigger("cut",{element:n.row}),!0}},function(e,t){var n=void 0;if(My(t)&&86===e){var o=s._getSelectedCell();if(!o)return;By(t)?(n=s._editorActions.trigger("pasteAfter",{element:o.col}))&&s._cellSelection.selectCell("right"):(n=s._editorActions.trigger("pasteAfter",{element:o.row}))&&s._cellSelection.selectCell("below")}return void 0!==n}].forEach(function(e){s._keyboard.addListener(e)})},this._clipboard=n,this._cellSelection=o,this._elementRegistry=r,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(){gt.bind(document,"copy",s._clearClipboard,!0),gt.bind(document,"cut",s._clearClipboard,!0)}),t.on("keyboard.unbind",function(){gt.unbind(document,"copy",s._clearClipboard,!0),gt.unbind(document,"cut",s._clearClipboard,!0)}))}return Iy(c,[{key:"_getSelectedCell",value:function(){var e=this._cellSelection.getCellSelection();if(e){var t=this._elementRegistry.get(e);if(t){var n=hh(e,this._renderer.getContainer()),o=vh(n);if(document.activeElement===o){var r=ih(n);if(!r||r.start===r.end)return t}}}}}]),c}();Ny.$inject=["injector","eventBus","clipboard","cellSelection","elementRegistry","editorActions","renderer"];var Vy={__depends__:[wh,bh],__init__:["copyCutPasteKeyBindings"],copyCutPasteKeyBindings:["type",Ny]},Ly="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},$y=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Fy=function(e){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=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Ly(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n.onClick=function(e){n.editorActions.trigger("addInput")},rf(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Ly(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,Ip),$y(o,[{key:"render",value:function(){return _l(1,"th","input-cell create-inputs header actionable",[xl("Input "),_l(1,"span","add-input dmn-icon-plus action-icon",null,1,{title:"Add Input"})],4,{onClick:this.onClick,rowspan:"3",title:"Add Input"})}}]),o}();Fy.$inject=["editorActions"];var Uy="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},zy=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Wy=function(e){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=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Uy(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n.onClick=function(e){n.editorActions.trigger("addInput")},rf(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Uy(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,Ip),zy(o,[{key:"render",value:function(){return _l(1,"td","input-cell create-inputs",xl("-"),2,{onClick:this.onClick,title:"Add Input"})}}]),o}();Wy.$inject=["editorActions"];var Hy=function e(t,o){!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,n=o.getRoot().businessObject;if(!n.input||!n.input.length)return"before-label-cells"===t?Fy:"before-rule-cells"===t?Wy:void 0})};Hy.$inject=["components","sheet"];var Gy={__depends__:[Xh],__init__:["createInputsProvider"],createInputsProvider:["type",Hy]},qy=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Ky=function(){function l(i,o,e,t,n,r,a,s,c){var u=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),this._contextMenu=o,this._clipboard=e,this._editorActions=t,this._elementRegistry=r,this._eventBus=n,this._modeling=a,this._sheet=s,this._rules=c,this._getEntries=this._getEntries.bind(this),i.onGetComponent("context-menu",function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(e.contextMenuType&&"context-menu"===e.contextMenuType){var t=u._getEntries(e),n=u._elementRegistry.get(e.id),o=n instanceof Gu&&i.getComponents("context-menu-cell-additional",e);if(o&&o.length){var r=_l(1,"div","context-menu-group context-menu-group-cell",[_l(1,"h4","context-menu-group-title",xl("Cell"),2),o],0);return function(){return _l(1,"div","context-menu-flex",(t||[]).concat([r]),0)}}return function(){return _l(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",id:n})})}return qy(l,[{key:"_getEntries",value:function(e){var t=this,n=function(e){t._editorActions.trigger("addRuleAbove",{rule:e}),t._contextMenu.close()},o=function(e){t._editorActions.trigger("addRuleBelow",{rule:e}),t._contextMenu.close()},r=function(e){t._editorActions.trigger("removeRule",{rule:e}),t._contextMenu.close()},i=function(e){t._editorActions.trigger("addInputLeft",{input:e}),t._contextMenu.close()},a=function(e){t._editorActions.trigger("addInputRight",{input:e}),t._contextMenu.close()},s=function(e){t._editorActions.trigger("removeInput",{input:e}),t._contextMenu.close()},c=function(e){t._editorActions.trigger("addOutputLeft",{output:e}),t._contextMenu.close()},u=function(e){t._editorActions.trigger("addOutputRight",{output:e}),t._contextMenu.close()},l=function(e){t._editorActions.trigger("removeOutput",{output:e}),t._contextMenu.close()},p=function(e){t._editorActions.trigger("copy",{element:e}),t._contextMenu.close()},f=function(e){t._editorActions.trigger("cut",{element:e}),t._contextMenu.close()},d=function(e){t._editorActions.trigger("pasteBefore",{element:e}),t._contextMenu.close()},h=function(e){t._editorActions.trigger("pasteAfter",{element:e}),t._contextMenu.close()},y=e&&e.id;if(!y)return null;var v=this._elementRegistry.get(y);if(!v)return null;var m=this._clipboard.get()||{},g=[];if(Ht(v.row,"dmn:DecisionRule")){var b=this._rules.allowed("paste",{data:m.elements,target:v.row});g.push(_l(1,"div","context-menu-group context-menu-group-rule",[_l(1,"h4","context-menu-group-title",xl("Rule"),2),_l(1,"div","context-menu-group-entry context-menu-entry-add-rule-above",[_l(1,"span","context-menu-group-entry-icon dmn-icon-up"),xl("Add Above")],4,{onClick:function(){return n(v.row)}}),_l(1,"div","context-menu-group-entry context-menu-entry-add-rule-below",[_l(1,"span","context-menu-group-entry-icon dmn-icon-down"),xl("Add Below")],4,{onClick:function(){return o(v.row)}}),_l(1,"div","context-menu-group-entry context-menu-entry-remove-rule",[_l(1,"span","context-menu-group-entry-icon dmn-icon-clear"),xl("Remove")],4,{onClick:function(){return r(v.row)}}),_l(1,"div","context-menu-group-entry context-menu-entry-copy-rule",[_l(1,"span","context-menu-group-entry-icon dmn-icon-copy"),xl("Copy")],4,{onClick:function(){return p(v.row)}}),_l(1,"div","context-menu-group-entry context-menu-entry-cut-rule",[_l(1,"span","context-menu-group-entry-icon dmn-icon-cut"),xl("Cut")],4,{onClick:function(){return f(v.row)}}),_l(1,"div","context-menu-group-entry "+(b?"":"disabled")+" context-menu-entry-paste-rule-above",[_l(1,"span","context-menu-group-entry-icon dmn-icon-paste"),xl("Paste Above")],4,{onClick:function(){return d(v.row)}}),_l(1,"div","context-menu-group-entry "+(b?"":"disabled")+" context-menu-entry-paste-rule-below",[_l(1,"span","context-menu-group-entry-icon dmn-icon-paste"),xl("Paste Below")],4,{onClick:function(){return h(v.row)}})],4))}if(Ht(v,"dmn:InputClause")||Ht(v.col,"dmn:InputClause")){var _=Ht(v,"dmn:InputClause")?v:v.col,w=this._rules.allowed("col.remove",{col:v.col||v}),x=this._rules.allowed("paste",{data:m.elements,target:v.col||v});g.push(_l(1,"div","context-menu-group context-menu-group-input",[_l(1,"h4","context-menu-group-title",xl("Input"),2),_l(1,"div","context-menu-group-entry context-menu-entry-add-input-left",[_l(1,"span","context-menu-group-entry-icon dmn-icon-left"),xl("Add Left")],4,{onClick:function(){return i(_)}}),_l(1,"div","context-menu-group-entry context-menu-entry-add-input-right",[_l(1,"span","context-menu-group-entry-icon dmn-icon-right"),xl("Add Right")],4,{onClick:function(){return a(_)}}),_l(1,"div","context-menu-group-entry "+(w?"":"disabled")+" context-menu-entry-remove-input",[_l(1,"span","context-menu-group-entry-icon dmn-icon-clear"),xl("Remove")],4,{onClick:function(){return s(_)}}),_l(1,"div","context-menu-group-entry context-menu-entry-copy-input",[_l(1,"span","context-menu-group-entry-icon dmn-icon-copy"),xl("Copy")],4,{onClick:function(){return p(_)}}),_l(1,"div","context-menu-group-entry "+(w?"":"disabled")+" context-menu-entry-cut-input",[_l(1,"span","context-menu-group-entry-icon dmn-icon-cut"),xl("Cut")],4,{onClick:function(){return f(_)}}),_l(1,"div","context-menu-group-entry "+(x?"":"disabled")+" context-menu-entry-paste-input-left",[_l(1,"span","context-menu-group-entry-icon dmn-icon-paste"),xl("Paste Left")],4,{onClick:function(){return d(_)}}),_l(1,"div","context-menu-group-entry "+(x?"":"disabled")+" context-menu-entry-paste-input-right",[_l(1,"span","context-menu-group-entry-icon dmn-icon-paste"),xl("Paste Right")],4,{onClick:function(){return h(_)}})],4))}else if(Ht(v,"dmn:OutputClause")||Ht(v.col,"dmn:OutputClause")){var C=Ht(v,"dmn:OutputClause")?v:v.col,E=this._rules.allowed("col.remove",{col:v.col||v}),k=this._rules.allowed("paste",{data:m.elements,target:v.col||v});g.push(_l(1,"div","context-menu-group context-menu-group-output",[_l(1,"h4","context-menu-group-title",xl("Output"),2),_l(1,"div","context-menu-group-entry context-menu-entry-add-output-left",[_l(1,"span","context-menu-group-entry-icon dmn-icon-left"),xl("Add Left")],4,{onClick:function(){return c(C)}}),_l(1,"div","context-menu-group-entry context-menu-entry-add-output-right",[_l(1,"span","context-menu-group-entry-icon dmn-icon-right"),xl("Add Right")],4,{onClick:function(){return u(C)}}),_l(1,"div","context-menu-group-entry "+(E?"":"disabled")+" context-menu-entry-remove-output",[_l(1,"span","context-menu-group-entry-icon dmn-icon-clear"),xl("Remove")],4,{onClick:function(){return l(C)}}),_l(1,"div","context-menu-group-entry context-menu-entry-copy-output",[_l(1,"span","context-menu-group-entry-icon dmn-icon-copy"),xl("Copy")],4,{onClick:function(){return p(C)}}),_l(1,"div","context-menu-group-entry "+(E?"":"disabled")+" context-menu-entry-cut-output",[_l(1,"span","context-menu-group-entry-icon dmn-icon-cut"),xl("Cut")],4,{onClick:function(){return f(C)}}),_l(1,"div","context-menu-group-entry "+(k?"":"disabled")+" context-menu-entry-paste-output-left",[_l(1,"span","context-menu-group-entry-icon dmn-icon-paste"),xl("Paste Left")],4,{onClick:function(){return d(C)}}),_l(1,"div","context-menu-group-entry "+(k?"":"disabled")+" context-menu-entry-paste-output-right",[_l(1,"span","context-menu-group-entry-icon dmn-icon-paste"),xl("Paste Right")],4,{onClick:function(){return h(C)}})],4))}return g}}]),l}();Ky.$inject=["components","contextMenu","clipboard","editorActions","eventBus","elementRegistry","modeling","sheet","rules"];var Xy=["row.add","row.remove","col.add","col.remove"],Zy=function e(n,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.on("commandStack.executed",function(e){var t=e.command;-1!==Xy.indexOf(t)&&n.close()}),t.on("commandStack.reverted",function(){n.close()})};Zy.$inject=["contextMenu","eventBus"];var Yy={__depends__:[Xh,Dy,kh],__init__:["decisionTableContextMenu","contextMenuCloseBehavior"],decisionTableContextMenu:["type",Ky],contextMenuCloseBehavior:["type",Zy]},Jy="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},Qy=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var ev=function(e){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=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Jy(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n.onClick=function(e){var t=n.props.output;n._eventBus.fire("output.edit",{event:e,output:t})},n.onContextmenu=function(e){var t=n.props.output.id;n._eventBus.fire("cell.contextmenu",{event:e,id:t})},n.onElementsChanged=function(){n.forceUpdate()},sf(n,Af),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Jy(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,Ip),Qy(o,[{key:"componentWillMount",value:function(){var e=this.context.injector;this._changeSupport=this.context.changeSupport,this._eventBus=e.get("eventBus"),this._elementRegistry=e.get("elementRegistry");var t=this.props.output;this._changeSupport.onElementsChanged(t.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.output,t=e.get("label"),n=e.get("name");return _l(1,"th","output-cell output-editor",[this.slotFills({type:"cell-inner",context:{cellType:"output-cell",col:this._elementRegistry.get(e.id)},col:e}),t?_l(1,"span","output-label",t,0,{title:"Output Label"}):_l(1,"span","output-name",n||"-",0,{title:"Output Expression"})],0,{"data-col-id":e.id,onClick:this.onClick,onContextmenu:this.onContextmenu})}}]),o}(),tv="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},nv=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var ov=function(e){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=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":tv(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n.onInput=function(e){var t=n.props.onInput;"function"==typeof t&&t(e.target.value)},n.onKeyDown=function(e){var t=n.props.onKeyDown;"function"==typeof t&&t(e)},n.onKeyUp=function(e){var t=n.props.onKeyUp;"function"==typeof t&&t(e)},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":tv(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,Ip),nv(o,[{key:"render",value:function(){var e=this.props,t=e.className,n=e.placeholder,o=e.type,r=e.value;return _l(64,"input",[t||"","dms-input"].join(" "),null,1,{placeholder:n||"",onInput:this.onInput,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,spellcheck:"false",type:o||"text",value:r})}}]),o}(),rv="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},iv=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var av=function(e){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=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":rv(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n.setName=function(e){e=e||void 0,n.handleChange({name:e})},n.setLabel=function(e){e=e||void 0,n.handleChange({label:e})},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":rv(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,Ip),iv(o,[{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,n=e.label;return _l(1,"div","dms-container ref-output-editor",[_l(1,"p","dms-fill-row",[_l(1,"label","dms-label",xl("Output Name"),2),wl(2,ov,{className:"ref-output-name",value:t||"",onInput:this.setName})],4),_l(1,"p","dms-fill-row",[_l(1,"label","dms-label",xl("Output Label"),2),wl(2,ov,{className:"ref-output-label",value:n||"",onInput:this.setLabel})],4)],4)}}]),o}(),sv="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},cv=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},uv=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var lv=function(e){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=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":sv(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n.persistChanges=function(){var e=n.props.context.output,t=n.state.unsaved;t&&(n.modeling.updateProperties(e,t),n.setState({unsaved:!1}))},n.handleChange=function(e){n.setState({unsaved:cv({},n.state.unsaved,e)},n.persistChanges)},n.state={},rf(n),n.persistChanges=n.debounceInput(n.persistChanges),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":sv(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,Ip),uv(o,[{key:"getValue",value:function(e){var t=this.props.context.output,n=this.state.unsaved;return n&&n[e]||t.get(e)}},{key:"render",value:function(){return _l(1,"div","context-menu-container output-edit",wl(2,av,{name:this.getValue("name"),label:this.getValue("label"),onChange:this.handleChange}),2)}}]),o}();lv.$inject=["debounceInput","modeling"];var pv=function e(t,l,n,p){!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 ev}),t.onGetComponent("context-menu",function(){if("output-edit"===(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).contextMenuType)return lv}),n.on("output.edit",function(e){var t=e.event,n=e.output,o=t.target,r=ht(o,"th",!0).getBoundingClientRect(),i=r.left,a=r.top,s=r.width,c=r.height,u=p.getContainer();l.open({x:i+u.parentNode.scrollLeft,y:a+u.parentNode.scrollTop,width:s,height:c},{contextMenuType:"output-edit",output:n,offset:{x:4,y:4}})})};pv.$inject=["components","contextMenu","eventBus","renderer"];var fv="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},dv=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var hv=function(e){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=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":fv(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n.onClick=function(e){var t=n.props.input;n._eventBus.fire("input.edit",{event:e,input:t})},n.onContextmenu=function(e){var t=n.props.input.id;n._eventBus.fire("cell.contextmenu",{event:e,id:t})},n.onElementsChanged=function(){n.forceUpdate()},sf(n,Af),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":fv(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,Ip),dv(o,[{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(),n=this.props.input;this._changeSupport.onElementsChanged(t.id,this.onElementsChanged),this._changeSupport.onElementsChanged(n.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.input,t=e.inputExpression,n=e.get("label"),o=e.get("inputVariable"),r=t.get("expressionLanguage")||"FEEL",i=!n&&"FEEL"!=r;return _l(1,"th","input-cell input-editor",[this.slotFills({type:"cell-inner",context:{cellType:"input-cell",col:this._elementRegistry.get(e.id)},col:e}),n?_l(1,"span","input-label",n,0,{title:"Input Label"}):_l(1,"span","input-expression",t.text||"-",0,{title:"Input Expression"}),o&&_l(1,"span","dms-badge dmn-variable-name input-variable",o,0,{title:"Input Variable"}),i&&_l(1,"span","dms-badge dmn-expression-language input-expression-language",[_l(1,"span","dms-badge-icon dmn-icon-file-code"),_l(1,"span","dms-badge-label",r,0)],4,{title:"Input Expression Language = "+r})],0,{"data-col-id":e.id,onClick:this.onClick,onContextmenu:this.onContextmenu})}}]),o}(),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},vv=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var mv=function(e){function r(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":yv(t))&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));gv.call(n),rf(n);var o=e.value;return n.state={value:o,optionsVisible:!1},n._portalEl=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":yv(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,Ip),vv(r,[{key:"componentDidMount",value:function(){document.addEventListener("click",this.onGlobalClick),document.addEventListener("focusin",this.onFocusChanged),this.keyboard.addListener(this.onKeyboard)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("focusin",this.onFocusChanged),document.removeEventListener("click",this.onGlobalClick),this.keyboard.removeListener(this.onKeyboard),this.removePortalEl()}},{key:"componentWillReceiveProps",value:function(e){var t=e.value;this.setState({value:t})}},{key:"componentWillUpdate",value:function(e,t){t.optionsVisible?this._portalEl||this.addPortalEl():this._portalEl&&this.removePortalEl()}},{key:"componentDidUpdate",value:function(){if(this.state.optionsVisible&&this.inputNode){var e=this.inputNode.getBoundingClientRect(),t=e.top,n=e.left,o=e.width,r=e.height;R(this._portalEl.style,{top:t+r+"px",left:n+"px",width:o+"px"})}}},{key:"addPortalEl",value:function(){this._portalEl=wt('<div class="dms-select-options"></div>'),this.renderer.getContainer().appendChild(this._portalEl)}},{key:"removePortalEl",value:function(){this._portalEl&&(Pt(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=this.props.options,n=this.state.value;if(t){var o=t.filter(function(e){return e.value===n})[0],r=o?t.indexOf(o):-1,i=-1===r?1===e?0:t.length-1:(r+e)%t.length,a=t[i<0?t.length+i:i];this.onChange(a.value)}}},{key:"setOptionsVisible",value:function(e){this.setState({optionsVisible:e})}},{key:"renderOptions",value:function(e,n){var o=this;return _l(1,"div","options",e.map(function(t){return _l(1,"div",["option",n===t?"active":""].join(" "),t.label,0,{"data-value":t.value,onClick:function(e){return o.onOptionClick(t.value,e)}})}),0)}},{key:"render",value:function(){var e,t,n=this,o=this.props,r=o.className,i=o.options,a=o.noInput,s=this.state,c=s.optionsVisible,u=s.value,l=!!i&&i.filter(function(e){return e.value===u})[0],p=l?l.label:u;return _l(1,"div",[r||"","dms-input-select"].join(" "),[a?_l(1,"div","dms-input",p,0,{tabindex:"0",onKeyDown:this.onKeyDown},null,function(e){return n.inputNode=e}):_l(64,"input","dms-input",null,1,{onInput:this.onInput,onKeyDown:this.onKeyDown,spellcheck:"false",type:"text",value:u},null,function(e){return n.inputNode=e}),_l(1,"span",["dms-input-select-icon",c?"dmn-icon-up":"dmn-icon-down"].join(" ")),c&&(e=this.renderOptions(i,l),t=this._portalEl,_l(1024,t,null,e,0,null,pl(e)?null:e.key,null))],0,{onClick:this.onInputClick},null,function(e){return n.parentNode=e})}}]),r}(),gv=function(){var o=this;this.onChange=function(e){o.setState({value:e});var t=o.props.onChange;"function"==typeof t&&t(e)},this.onInputClick=function(e){e.preventDefault(),e.stopPropagation(),o.setOptionsVisible(!o.state.optionsVisible),o.focusInput()},this.onInput=function(e){var t=e.target.value;o.onChange(t)},this.onOptionClick=function(e,t){t.preventDefault(),t.stopPropagation(),o.setOptionsVisible(!1),o.onChange(e),o.focusInput()},this.onFocusChanged=function(e){o.checkClose(e.target)},this.onGlobalClick=function(e){o.checkClose(e.target)},this.onKeyDown=function(e){var t=o.state.optionsVisible,n=e.which;40!==n&&38!==n||(e.stopPropagation(),e.preventDefault(),t?o.select(40===n?1:-1):o.setOptionsVisible(!0)),t&&(13!==n&&27!==n||(e.stopPropagation(),e.preventDefault(),o.setOptionsVisible(!1)))},this.onKeyboard=function(e){if(o.state.optionsVisible)return 27===e?(o.setOptionsVisible(!1),!0):void 0}};mv.$inject=["keyboard","renderer"];var bv="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},_v=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var wv=function(e){function n(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":bv(t))&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e,t));return o.setExpressionLanguage=function(e){o.handleChange({expressionLanguage:e})},o.makeScript=function(e){e.preventDefault(),e.stopPropagation(),o.setExpressionLanguage("FEEL")},o.handleValue=function(e){var t=o.props.expressionLanguage,n={text:e};xv(e)&&!t&&(n.expressionLanguage="FEEL"),xv(e)||"FEEL"!==t||(n.expressionLanguage=void 0),o.handleChange(n)},o.handleLanguageChange=function(e){o.setExpressionLanguage(e)},o.handleLabelChange=function(e){var t=e||void 0;o.handleChange({label:t})},o.handleInputVariableChange=function(e){var t=e||void 0;o.handleChange({inputVariable:t})},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":bv(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,Ip),_v(n,[{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.expressionLanguage,n=e.inputVariable,o=e.label,r=e.text,i=t||xv(r),a=[!xv(r)&&"","FEEL","JUEL","JavaScript","Groovy","Python"].filter(d).map(function(e){return{label:e,value:e}});return _l(1,"div","dms-container ref-input-editor",[_l(1,"h4","dms-heading",xl("Input Expression"),2),wl(2,ry,{placeholder:"enter expression",ctrlForNewline:!0,className:["ref-text","dms-input",i?"dms-script-input script-editor":"","dms-fit-row"].join(" "),onInput:this.handleValue,value:r||""}),!i&&_l(1,"p","dms-hint",[xl("Enter simple "),_l(1,"code",null,xl("FEEL"),2),xl(" expression or "),_l(1,"a","ref-make-script",xl("change to script"),2,{href:"#",onClick:this.makeScript}),xl(".")],4),i&&_l(1,"p","dms-hint",xl("Enter script."),2),i&&_l(1,"p",null,[_l(1,"label","dms-label",xl("Expression Language"),2),wl(2,mv,{className:"ref-language",value:t||"",onChange:this.handleLanguageChange,options:a})],4),_l(1,"hr","dms-hrule"),_l(1,"p","dms-fill-row",[_l(1,"label","dms-label",xl("Input Label"),2),wl(2,ov,{className:"ref-input-label",value:o||"",onInput:this.handleLabelChange})],4),_l(1,"p","dms-fill-row",[_l(1,"label","dms-label",xl("Input Variable"),2),wl(2,ov,{className:"ref-input-variable",value:n||"",onInput:this.handleInputVariableChange,placeholder:"cellInput"})],4)],0)}}]),n}();function xv(e){return e&&1<e.split(/\n/).length}var Cv="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},Ev=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},kv=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Sv=function(e){function n(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var s=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Cv(t))&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e,t));return s.persistChanges=function(){var e=s.props.context.input,t=s.state.unsaved;if(t){var n,o=t.inputVariable,r=t.label,i=function(e,t){var n={};for(var o in e)0<=t.indexOf(o)||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}(t,["inputVariable","label"]),a={};"inputVariable"in t&&(a.inputVariable=o),"label"in t&&(a.label=r),n=i,Object.keys(n).length&&(a.inputExpression=i),s.modeling.updateProperties(e,a),s.setState({unsaved:!1})}},s.handleChange=function(e){s.setState({unsaved:Ev({},s.state.unsaved,e)},s.persistChanges)},s.state={},rf(s),s.persistChanges=s.debounceInput(s.persistChanges),s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Cv(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,Ip),kv(n,[{key:"getValue",value:function(e){var t=this.props.context.input,n=this.state.unsaved,o=t;return"expressionLanguage"!==e&&"text"!==e||(o=o.inputExpression),n&&n[e]||o.get(e)}},{key:"render",value:function(){return _l(1,"div","context-menu-container input-edit",wl(2,wv,{expressionLanguage:this.getValue("expressionLanguage"),inputVariable:this.getValue("inputVariable"),label:this.getValue("label"),text:this.getValue("text"),onChange:this.handleChange}),2)}}]),n}();Sv.$inject=["debounceInput","modeling"];var Ov=function e(t,l,n,p){!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 hv}),t.onGetComponent("context-menu",function(){if("input-edit"===(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).contextMenuType)return Sv}),n.on("input.edit",function(e){var t=e.event,n=e.input,o=t.target,r=ht(o,"th",!0).getBoundingClientRect(),i=r.left,a=r.top,s=r.width,c=r.height,u=p.getContainer();l.open({x:i+u.parentNode.scrollLeft,y:a+u.parentNode.scrollTop,width:s,height:c},{contextMenuType:"input-edit",input:n,offset:{x:4,y:4}})})};Ov.$inject=["components","contextMenu","eventBus","renderer"];var jv="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},Pv=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Tv=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":jv(t))&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o.onClick=function(e){var t=o.getTypeRefTarget();o._eventBus.fire("typeRef.edit",{event:e,element:t})},o.onContextmenu=function(e){var t=o.props.element,n=t;Ht(t,"dmn:LiteralExpression")&&(n=t.$parent),o._eventBus.fire("cell.contextmenu",{event:e,node:e.node,id:n.id})},o.onElementsChanged=function(){o.forceUpdate()},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":jv(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,Ip),Pv(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");var t=this.getTypeRefTarget();this._changeSupport.onElementsChanged(t.id,this.onElementsChanged)}},{key:"componentWillUnmount",value:function(){var e=this.getTypeRefTarget();this._changeSupport.offElementsChanged(e.id,this.onElementsChanged)}},{key:"getTypeRefTarget",value:function(){var e=this.props.element;return Ht(e,"dmn:InputClause")?e.inputExpression:e}},{key:"render",value:function(){var e=this.props,t=e.element,n=(e.className||"")+" type-ref",o=Ht(t,"dmn:LiteralExpression")?t.$parent.id:t.id;return _l(1,"th",n,t.typeRef,0,{title:"Data Type","data-col-id":o,onClick:this.onClick,onContextmenu:this.onContextmenu})}}]),t}(),Rv="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},Av=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Dv=["string","boolean","integer","long","double","date"],Mv=function(e){function n(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Rv(t))&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return r.onTypeChange=function(e){var t=r.props.context.element,n=Ht(t,"dmn:LiteralExpression")?t.$parent:t,o=void 0;Gt(n)?o={inputExpression:{typeRef:e}}:qt(n)&&(o={typeRef:e}),r._modeling.updateProperties(n,o)},r._modeling=t.injector.get("modeling"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Rv(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,Ip),Av(n,[{key:"render",value:function(){var e=this.props.context.element,t=(Ht(e,"dmn:InputClause")?e.inputExpression:e).typeRef,n=Dv.map(function(e){return{label:e,value:e}});return _l(1,"div","type-ref-edit context-menu-container",[_l(1,"label","dms-label",xl("Type:"),2),wl(2,mv,{className:"type-ref-edit-select",onChange:this.onTypeChange,options:n,value:t})],4)}}]),n}();var Bv=function e(t,l,n,p){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("cell",function(e){var t=e.cellType;if("input-header-type-ref"===t||"output-header-type-ref"===t)return Tv}),t.onGetComponent("context-menu",function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(e.contextMenuType&&"type-ref-edit"===e.contextMenuType)return Mv}),n.on("typeRef.edit",function(e){var t=e.event,n=e.element,o=t.target,r=ht(o,"th",!0).getBoundingClientRect(),i=r.left,a=r.top,s=r.width,c=r.height,u=p.getContainer();l.open({x:i+u.parentNode.scrollLeft,y:a+u.parentNode.scrollTop,width:s,height:c},{contextMenuType:"type-ref-edit",element:n,offset:{x:4,y:4}})})};Bv.$inject=["components","contextMenu","eventBus","renderer"];var Iv={__depends__:[Dy],__init__:["typeRefEditingProvider"],typeRefEditingProvider:["type",Bv]},Nv="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};var Vv=function(e){function n(e,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Nv(t))&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.postExecuted("updateProperties",function(e){var t=e.context,n=t.element,o=t.properties,r=Gt(n)?o.inputExpression:o;if(r&&r.typeRef&&"string"!==r.typeRef){var i=Ht(n,"dmn:LiteralExpression")?n.$parent:n;a.editAllowedValues(i,null)}}),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Nv(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,oc),n}();Vv.$inject=["eventBus","modeling"];var Lv="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},$v=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Fv=function(e){function o(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Lv(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));i.getRemoveClickHandler=function(t){return function(e){e.stopPropagation(),i.removeItem(t)}},i.getToggleClickHandler=function(t){return function(e){e.stopPropagation(),i.toggleItem(t)}},i.removeItem=function(t){var e=i.props.onChange,n=i.state.items.filter(function(e){return e!==t});i.setState({items:n}),e&&e(n)},i.toggleItem=function(t){var e=i.props,n=e.onChange,o=e.type,r=i.state.items.map(function(e){return e===t?e.isChecked=!e.isChecked:"radio"===o&&(e.isChecked=!1),e});i.setState({items:r}),n&&n(r)};var n=e.items;return i.state={items:n},i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Lv(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,Ip),$v(o,[{key:"componentWillReceiveProps",value:function(e){var t=e.items;this.setState({items:t})}},{key:"render",value:function(){var o=this,e=this.props,t=e.className,n=e.items,r=e.type,i=["dms-list-component"];t&&i.push(t);var a=function(e){var t=[];for(var n in e)t.push([n,e[n]]);return t}(b(n,"group"));return _l(1,"div",i.join(" "),a.map(function(e){var t=e[0],n=e[1];return _l(1,"div","group",[_l(1,"h4","dms-heading",t,0),_l(1,"ul","items no-wrap",n.map(function(e){return _l(1,"li","item",[r&&_l(64,"input","item-toggle",null,1,{type:r,checked:e.isChecked,onClick:o.getToggleClickHandler(e)}),xl(" "),e.value,e.isRemovable&&_l(1,"span","remove dmn-icon-clear",null,1,{title:"Remove item",onClick:o.getRemoveClickHandler(e)})],0)}),0)],4)}),0)}}]),o}();var Uv="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},zv=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Wv=function(e){function a(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Uv(t))&&"function"!=typeof t?e:t}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,e,t)),o=e.validate,r=e.value,i=o?o(r||""):void 0;return n.state={validationWarning:i,value:r},n.onInput=n.onInput.bind(n),n.onKeyDown=n.onKeyDown.bind(n),n.onKeyUp=n.onKeyUp.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Uv(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(a,Ip),zv(a,[{key:"componentWillReceiveProps",value:function(e){var t=e.validate,n=e.value,o=t?t(n||""):void 0;this.setState({validationWarning:o,value:n})}},{key:"onInput",value:function(e){var t=this.props,n=t.onInput,o=t.validate,r=o?o(e):void 0;this.setState({validationWarning:r,value:e}),"function"==typeof n&&n&&n({isValid:!r,value:e})}},{key:"onKeyDown",value:function(e){var t=e.target.value,n=this.props,o=n.onKeyDown,r=n.validate,i=r?r(t):void 0;"function"==typeof o&&o({isValid:!i,value:t,event:e})}},{key:"onKeyUp",value:function(e){var t=e.target.value,n=this.props,o=n.onKeyUp,r=n.validate,i=r?r(t):void 0;"function"==typeof o&&o({isValid:!i,value:t,event:e})}},{key:"render",value:function(){var e=this.props,t=e.placeholder,n=e.type,o=e.className,r=this.state,i=r.validationWarning,a=r.value,s=["dms-validated-input",o].join(" "),c=[];return i&&c.push("invalid"),_l(1,"div",s,[wl(2,ov,{className:c,onInput:this.onInput,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,placeholder:t||"",type:n,value:a||""}),i&&_l(1,"p","dms-hint dms-validation-warning",i,0)],0)}}]),a}();function Hv(e){if(!e||""===e.trim())return{values:[]};var t=e.split(","),n={values:[]},o="";return t.forEach(function(e){/^"[^"]*"$/.test((o+=e).trim())?(n.values.push(o.trim()),o=""):o+=","}),o?void 0:n}var Gv="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},qv=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Kv=function(e){function i(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Gv(t))&&"function"!=typeof t?e:t}(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,e,t));Xv.call(n),n._modeling=t.injector.get("modeling"),n._changeSupport=t.changeSupport;var o=n.getAllowedValuesTarget(),r=Hv(o.inputValues&&o.inputValues.text||o.outputValues&&o.outputValues.text||"");return n.state=r?{values:r.values.map(function(e){return{value:e,isCheckable:!1,isRemovable:!0,group:"Predefined Values"}}),inputValue:""}:{values:null,inputValue:""},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Gv(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,Ip),qv(i,[{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.props.context.element;return Ht(e,"dmn:LiteralExpression")?e.$parent:e}},{key:"render",value:function(){var e=this.props.context.element,t=this.state,n=t.inputValue,o=t.values;return"string"===e.typeRef?_l(1,"div","context-menu-container allowed-values-edit",[_l(1,"hr","dms-hrule"),!Zv(o)&&0<o.length&&wl(2,Fv,{items:o,onChange:this.onListChange}),!Zv(o)&&!o.length&&_l(1,"div",null,[_l(1,"h4","dms-heading",xl("Predefined Values"),2),_l(1,"span","placeholder",xl("No values"),2)],4),!Zv(o)&&_l(1,"p","dms-hint",_l(1,"a","del-values",xl("Clear predefined values."),2,{href:"#",onClick:this.handleRemovePredifinedValuesClick}),2),_l(1,"h4","dms-heading",xl("Add Predefined Values"),2),wl(2,Wv,{onInput:this.onInput,onKeyDown:this.onKeyDown,placeholder:'"value", "value", ...',type:"text",validate:function(e){if(!Hv(e))return"Strings must be in double quotes."},value:n})],0):null}}]),i}(),Xv=function(){var s=this;this.onElementsChanged=function(){s.forceUpdate()},this.setPredefinedValues=function(e){var t=s.getAllowedValuesTarget();s.setState({values:e}),s._modeling.editAllowedValues(t,e&&e.map(function(e){return e.value}))},this.onListChange=function(e){s.setPredefinedValues(e)},this.onInput=function(e){e.isValid;var t=e.value;s.setState({inputValue:t})},this.onKeyDown=function(e){var t=e.isValid,n=e.event;if(13===n.keyCode&&(n.stopPropagation(),n.preventDefault(),t)){var o=s.state,r=o.inputValue,i=o.values,a=Hv(r);s.onListChange((i||[]).concat(a.values.map(function(e){return{value:e,isCheckable:!1,isRemovable:!0,group:"Predefined Values"}}))),s.setState({inputValue:""})}},this.handleRemovePredifinedValuesClick=function(e){e.stopPropagation(),s.removePredefinedValues()},this.removePredefinedValues=function(){s.setPredefinedValues(null)}};function Zv(e){return null===e}var Yv=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]:{};if(e.contextMenuType&&"type-ref-edit"===e.contextMenuType)return Kv})};Yv.$inject=["components"];var Jv={__init__:["allowedValuesUpdateBehavior","allowedValuesEditingProvider"],allowedValuesUpdateBehavior:["type",Vv],allowedValuesEditingProvider:["type",Yv]},Qv="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},em=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var tm=function(e){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=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Qv(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n.onElementsChanged=function(){n.forceUpdate()},n.handleClick=function(e){e.stopPropagation(),n.add()},n.add=function(){n._eventBus.fire("addInput")},n._sheet=t.injector.get("sheet"),n._eventBus=t.injector.get("eventBus"),n._changeSupport=t.changeSupport,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Qv(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,Ip),em(o,[{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(){var e=this.getRoot().businessObject.input;if(!e||!e.length)return null;var t=e.length;return _l(1,"th","input-cell inputs-label actionable add-input header",[xl("Input "),_l(1,"span","add-input dmn-icon-plus action-icon",null,1,{title:"Add Input"})],4,{onClick:this.handleClick,colspan:t})}}]),o}(),nm="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},om=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var rm=function(e){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=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":nm(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n.onElementsChanged=function(){n.forceUpdate()},n.handleClick=function(e){e.stopPropagation(),n.add()},n.add=function(){n._eventBus.fire("addOutput")},n._sheet=t.injector.get("sheet"),n._eventBus=t.injector.get("eventBus"),n._changeSupport=t.changeSupport,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":nm(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,Ip),om(o,[{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(){var e=this.getRoot().businessObject.output.length;return _l(1,"th","output-cell outputs-label add-output actionable header",[xl("Output "),_l(1,"span","add-output dmn-icon-plus action-icon",null,1,{title:"Add Output"})],4,{onClick:this.handleClick,colspan:e})}}]),o}();function im(e,t,n){e.onGetComponent("cell",function(e){var t=e.cellType;return"input-label"===t?tm:"output-label"===t?rm:void 0}),n.on("addInput",function(){t.trigger("addInput")}),n.on("addOutput",function(){t.trigger("addOutput")})}im.$inject=["components","editorActions","eventBus"];var am={__depends__:[{__depends__:[Xh],__init__:["addInputOutputProvider"],addInputOutputProvider:["type",im]},Jv,Dy,by,Iv],__init__:["inputEditingProvider","outputEditingProvider"],inputEditingProvider:["type",Ov],outputEditingProvider:["type",pv]},sm=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var cm=function(){function r(e,t,n,o){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this.handleDragOver=function(e){um(e);var t=e.target,n=ht(t,".dmn-decision-table-container td,\n .dmn-decision-table-container th",!0),o=!!n,r=i._dragContext.hoverEl;r&&r!==n&&(i._emit("dragAndDrop.dragLeave",e),i._dragContext.targetEl=null,i._dragContext.hoverEl=null),n&&(n!==r&&(i._dragContext.hoverEl=n,!1!==(o=i._emit("dragAndDrop.dragEnter",e))&&(i._dragContext.targetEl=n)),o=i._emit("dragAndDrop.dragOver",e)),e.dataTransfer.dropEffect=!1!==o?"move":"none"},this.handleDrop=function(e){um(e);var t=i._emit("dragAndDrop.drop",e);if(t){var n=i._dragContext.draggedElement;if(n instanceof Wu){var o=i._sheet.getRoot().rows.indexOf(t);i._modeling.moveRow(n,o)}else if(n instanceof Hu){var r=i._sheet.getRoot().cols.indexOf(t);i._modeling.moveCol(n,r)}}i.handleDragEnd(e)},this.handleDragEnd=function(e){um(e),i._unbindListeners(),i._emit("dragAndDrop.dragEnd",e),i._dragContext=null},this._eventBus=e,this._renderer=t,this._modeling=n,this._sheet=o,this._dragContext=null,e.on("table.destroy",function(){i._unbindListeners()})}return sm(r,[{key:"_bindListeners",value:function(){gt.bind(document,"dragover",this.handleDragOver),gt.bind(document,"drop",this.handleDrop),gt.bind(document,"dragend",this.handleDragEnd)}},{key:"_unbindListeners",value:function(){gt.unbind(document,"dragover",this.handleDragOver),gt.unbind(document,"drop",this.handleDrop),gt.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){um(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)}}]),r}();function um(e,t){e.stopPropagation(),!0!==t&&e.preventDefault()}cm.$inject=["eventBus","renderer","modeling","sheet"];var lm={__init__:["dragAndDrop"],dragAndDrop:["type",cm]},pm=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var fm="top",dm="right",hm="bottom",ym="left",vm=function(){function s(e,t,n,o,r,i,a){var d=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),this._cleanup=function(){var e=d._renderer.getContainer();bm(e),w(jt(".dragged",e),function(e){xm(e)&&st(e).remove("dragged")}),d._dragImage&&(Pt(d._dragImage),d._dragImage=null)},this._elementRegistry=t,this._dragAndDrop=o,this._renderer=r,this._rules=i,this._sheet=a,e.onGetComponent("cell-inner",function(e){var t=e.cellType,n=e.col,o=e.row;if("rule-index"===t)return function(){return _l(1,"span","dmn-icon-drag vertical",xl(" "),2,{draggable:"true",onDragStart:function(e){return d.startDrag(o,e)},title:"Move rule"})};if("input-cell"===t||"output-cell"===t){var r="Move "+(Gt(n)?"Input":"Output");return function(){return _l(1,"span","dmn-icon-drag horizontal",null,1,{draggable:"true",onDragStart:function(e){return d.startDrag(n,e)},title:r})}}}),n.on("dragAndDrop.dragEnter",function(e){var t,n,o,r,i=e.dragContext,a=i.draggedElement,s=i.hoverEl;if(a instanceof Wu)return!0;if(a instanceof Hu){var c=(t=s,n=d._elementRegistry,o=d._sheet,(r=n.get(t.dataset.colId))?o.getRoot().cols.indexOf(r):-1);return-1!==c&&d._rules.allowed("col.move",{col:a,index:c})}return!1}),n.on("dragAndDrop.dragLeave",function(e){e.dragContext.targetEl&&bm(d._renderer.getContainer())}),n.on("dragAndDrop.dragOver",function(e){var t=e.dragContext,n=e.originalEvent,o=t.draggedElement,r=t.lastPosition,i=t.targetEl,a=d._renderer.getContainer();if(!i)return!1;var s=void 0;return o instanceof Wu&&(s=wm(n,i)),o instanceof Hu&&(s=_m(n,i)),r===s||(bm(a),o instanceof Wu&&mm(i,a,s===fm?"top":"bottom"),o instanceof Hu&&gm(i,a,s===ym?"left":"right"),t.lastPosition=s),!0}),n.on("dragAndDrop.drop",function(e){var t=e.dragContext,n=e.originalEvent,o=t.draggedElement,r=t.targetEl;if(!r)return!1;if(o instanceof Wu){var i=wm(n,r),a=r.dataset.rowId,s=d._elementRegistry.get(a);if(!s||s===o)return;var c=function(e,t,n,o){o.indexOf(e)>o.indexOf(t)&&(r=t,a=(i=o).indexOf(r),t=i[Math.min(i.length-1,a+1)]);var r,i,a;return n===fm?(s=t,u=(c=o).indexOf(s),c[Math.max(0,u-1)]):t;var s,c,u}(o,s,i,d._sheet.getRoot().rows);if(c===o)return;return c}if(o instanceof Hu){var u=_m(n,r),l=r.dataset.colId,p=d._elementRegistry.get(l);if(!p||p===o)return;var f=function(e,t,n,o){o.indexOf(e)>o.indexOf(t)&&(t=function(e,t){var n=t.indexOf(e);if(Gt(e)){var o=t.filter(function(e){return Gt(e)}),r=o[o.length-1],i=t.indexOf(r);return t[Math.min(i,n+1)]}return t[Math.min(t.length-1,n+1)]}(t,o));return n===ym?function(e,t){var n=t.indexOf(e);if(qt(e)){var o=t.filter(function(e){return qt(e)})[0],r=t.indexOf(o);return t[Math.max(r,n-1)]}return t[Math.max(0,n-1)]}(t,o):t}(o,p,u,d._sheet.getRoot().cols);if(f===o)return;return f}}),n.on("dragAndDrop.dragEnd",this._cleanup)}return pm(s,[{key:"startDrag",value:function(e,t){var n,o,r=this._renderer.getContainer();this._dragImage=wt('<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 Wu?(o=r,w(jt("[data-row-id="+e.id+"]",o),function(e){xm(e)&&st(e).add("dragged")})):e instanceof Hu&&(n=r,w(jt("[data-col-id="+e.id+"]",n),function(e){xm(e)&&st(e).add("dragged")})),this._dragAndDrop.startDrag(e,t)}}]),s}();function mm(e,t,n){var o=e.dataset.rowId;o&&w(jt("[data-row-id="+o+"]",t),function(e){xm(e)&&(st(e).add("dragover"),st(e).add(n))})}function gm(e,t,n){var o=e.dataset.colId;o&&w(jt("[data-col-id="+o+"]",t),function(e){xm(e)&&(st(e).add("dragover"),st(e).add(n))})}function bm(e){w(jt(".dragover",e),function(e){xm(e)&&(st(e).remove("dragover"),st(e).remove("top"),st(e).remove("right"),st(e).remove("bottom"),st(e).remove("left"))})}function _m(e,t){var n=t.getBoundingClientRect();return e.clientX<n.left+n.width/2?ym:dm}function wm(e,t){var n=t.getBoundingClientRect();return e.clientY<n.top+n.height/2?fm:hm}function xm(e){return e&&(1===e.nodeType||11==e.nodeType)}vm.$inject=["components","elementRegistry","eventBus","dragAndDrop","renderer","rules","sheet"];var Cm={__depends__:[lm,kh],__init__:["dmnDragAndDrop"],dmnDragAndDrop:["type",vm]},Em="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},km=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();function Sm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Om(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Em(t))&&"function"!=typeof t?e:t}function jm(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Em(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var Pm=function(e){function r(e,t){Sm(this,r);var n=Om(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));n.onElementsChanged=function(){n.forceUpdate()},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;var o=n.props.context.id;return n._element=n._elementRegistry.get(o),n}return jm(r,Ip),km(r,[{key:"componentWillMount",value:function(){this._element&&this._changeSupport.onElementsChanged(this._element.id,this.onElementsChanged)}},{key:"componentDidMount",value:function(){this.props.context.autoFocus&&this.node&&Ot(".content-editable",this.node).focus()}},{key:"componentWillUnmount",value:function(){if(this._element){this._changeSupport.offElementsChanged(this._element.id,this.onElementsChanged);var e=this._element.businessObject.description;d(e)&&!e.length&&this.changeDescription(null)}}},{key:"render",value:function(){var t=this;if(this._element){var e=this._element.businessObject.description;if(d(e))return _l(1,"div","context-menu-container description-editor",wl(2,Tm,{className:"dms-input",onChange:this.changeDescription,value:e}),2,null,null,function(e){return t.node=e})}}}]),r}(),Tm=function(e){function t(){return Sm(this,t),Om(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return jm(t,uy),km(t,[{key:"render",value:function(){return _l(1,"div",this.getClassName(),this.getEditor(),0)}}]),t}();var Rm=function e(t,i,a,n,o,s){var c=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.addDescription=function(e){c._modeling.updateProperties(e,{description:""});var t=c._renderer.getContainer(),n=Am(t,hh(e.id,t).getBoundingClientRect());c._contextMenu.open(n,{contextMenuType:"cell-description",id:e.id,autoFocus:!0,offset:{x:4,y:4}})},this.removeDescription=function(e){c._modeling.updateProperties(e,{description:null}),c._contextMenu.close()},this._contextMenu=i,this._modeling=o,this._renderer=s,n.on("cell.click",750,function(e){if(!e.defaultPrevented){var t=e.target,n=e.id,o=a.get(n);if(o){Dm(o)||e.preventDefault();var r=Am(s.getContainer(),t.getBoundingClientRect());i.open(r,{contextMenuType:"cell-description",autoFocus:!1,id:n,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&&d(Dm(a.get(e.id))))return Pm}),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)return;var n=a.get(t);if(!n)return;var o=n.businessObject.description,r=d(o),i=r?function(){return c.removeDescription(n)}:function(){return c.addDescription(n)};return _l(1,"div","context-menu-group-entry "+(r?"remove-description":"add-description"),[_l(1,"span","context-menu-group-entry-icon "+(r?"dmn-icon-clear":"dmn-icon-plus")),d(o)?"Remove":"Add",xl(" Description")],0,{onClick:i})}})};function Am(e,t){var n=t.top,o=t.left,r=t.width,i=t.height;return{x:o+e.parentNode.scrollLeft-26,y:n+e.parentNode.scrollTop,width:r+52,height:i}}function Dm(e){return e&&e.businessObject&&e.businessObject.description}Rm.$inject=["components","contextMenu","elementRegistry","eventBus","modeling","renderer"];var Mm={__depends__:[Dy,Kd],__init__:["description"],description:["type",Rm]},Bm=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Im=[{label:"FEEL",value:"feel"},{label:"JUEL",value:"juel"},{label:"JavaScript",value:"javascript"},{label:"Groovy",value:"groovy"},{label:"Python",value:"python"},{label:"JRuby",value:"jruby"}],Nm=function(){function n(e,r,t){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),this._modeling=t,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.id;if(!t)return;var n=r.get(t);if(!n)return;var o=n.businessObject.expressionLanguage||(Gt(n.col)?"feel":"juel");return _l(1,"div","context-menu-group-entry context-menu-entry-set-expression-language",[_l(1,"div",null,[_l(1,"span","context-menu-group-entry-icon dmn-icon-file-code"),xl("Expression Language")],4),wl(2,mv,{className:"expression-language",onChange:function(e){return i.onChange(n,e)},options:Im,value:o})],4)}})}return Bm(n,[{key:"onChange",value:function(e,t){this._modeling.editExpressionLanguage(e.businessObject,t)}}]),n}();Nm.$inject=["components","elementRegistry","modeling"];var Vm={__init__:["expressionLanguage"],expressionLanguage:["type",Nm]},Lm=/\s/,$m=/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i,Fm=/^[a-z_][\w-.]*$/i,Um=/\$\{([^}]*)\}/g;function zm(e,t){var n=e.$model.ids.assigned(t);return!t||n&&n!==e?"Element must have an unique id.":function(e){if(n=e,t=e=n.replace(Um,"$1"),Lm.test(t))return"Id must not contain spaces.";var t;var n;if(!Fm.test(e))return $m.test(e)?"Id must not contain prefix.":"Id must be a valid QName."}(t)}var 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},Hm=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();function Gm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qm(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Wm(t))&&"function"!=typeof t?e:t}function Km(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Wm(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var Xm=function(e){function o(e,t){Gm(this,o);var n=qm(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n.onElementsChanged=function(){n.forceUpdate()},n.setDecisionTableName=function(e){n.modeling.editDecisionTableName(e)},n.setDecisionTableId=function(e){n.getBusinessObject().id!==e&&n.modeling.editDecisionTableId(e)},n.validateId=function(e){return zm(n.getBusinessObject(),e)},rf(n),n}return Km(o,Ip),Hm(o,[{key:"componentWillMount",value:function(){var e=this.context.injector;this.sheet=e.get("sheet"),this.modeling=e.get("modeling"),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,n=e.unbind;"string"==typeof n&&this.changeSupport.offElementsChanged(n,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(),t=e.id,n=e.name;return _l(1,"header","decision-table-properties",[wl(2,Zm,{className:"decision-table-name",value:n,ctrlForNewline:!0,onChange:this.setDecisionTableName,elementId:"__decisionProperties_name",coords:"0:__decisionProperties"}),wl(2,Ym,{className:"decision-table-id",value:t,ctrlForNewline:!0,validate:this.validateId,onChange:this.setDecisionTableId,elementId:"__decisionProperties_id",coords:"1:__decisionProperties"})],4)}}]),o}();Xm.$inject=["sheet","modeling","changeSupport"];var Zm=function(e){function o(e,t){Gm(this,o);var n=qm(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return sf(n,cf),n}return Km(o,uy),Hm(o,[{key:"render",value:function(){return _l(1,"h3",of(this.getSelectionClasses(),this.getClassName()),this.getEditor(),0,{"data-element-id":this.props.elementId,"data-coords":this.props.coords,title:"Decision Name"})}}]),o}(),Ym=function(e){function o(e,t){Gm(this,o);var n=qm(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return sf(n,cf),n}return Km(o,uy),Hm(o,[{key:"render",value:function(){return _l(1,"h5",of(this.getSelectionClasses(),this.getClassName()),this.getEditor(),0,{title:"Decision Id","data-element-id":this.props.elementId,"data-coords":this.props.coords})}}]),o}();var Jm=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",function(){return Xm})};Jm.$inject=["components"];var Qm={__depends__:[by],__init__:["decisionTableProperties"],decisionTableProperties:["type",Jm]},eg="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},tg=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var ng=function(e){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=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":eg(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n.onClick=function(e){n.eventBus.fire("hitPolicy.edit",{event:e})},n.onElementsChanged=function(){n.forceUpdate()},rf(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":eg(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,Ip),tg(o,[{key:"getRoot",value:function(){return this.sheet.getRoot()}},{key:"componentWillMount",value:function(){this.changeSupport.onElementsChanged(this.getRoot().id,this.onElementsChanged)}},{key:"componentWillUnmount",value:function(){this.changeSupport.offElementsChanged(this.getRoot().id,this.onElementsChanged)}},{key:"render",value:function(){var e=this.getRoot().businessObject,t=e.hitPolicy;return _l(1,"th","hit-policy header",[t.charAt(0),function(e){switch(e){case"SUM":return"+";case"MIN":return"<";case"MAX":return">";case"COUNT":return"#";default:return""}}(e.aggregation)],0,{"data-hit-policy":"true",title:"Hit Policy = "+t,onClick:this.onClick,rowspan:"3"})}}]),o}();ng.$inject=["changeSupport","sheet","eventBus"];var og="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},rg=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var ig=["UNIQUE","FIRST","PRIORITY","ANY","COLLECT","RULE ORDER","OUTPUT ORDER"],ag=["SUM","MIN","MAX","COUNT"],sg=function(e){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=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":og(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n.onHitPolicyChange=n.onHitPolicyChange.bind(n),n.onAggregationChange=n.onAggregationChange.bind(n),n.onElementsChanged=n.onElementsChanged.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":og(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,Ip),rg(o,[{key:"onHitPolicyChange",value:function(e){this._modeling.editHitPolicy(e,void 0)}},{key:"onAggregationChange",value:function(e){var t=""===e?void 0:e;this._modeling.editHitPolicy("COLLECT",t)}},{key:"onElementsChanged",value:function(){this.forceUpdate()}},{key:"componentWillMount",value:function(){var e=this.context.injector,t=this._changeSupport=this.context.changeSupport;this._sheet=e.get("sheet"),this._modeling=e.get("modeling");var n=this._sheet.getRoot(),o=n.businessObject,r=o.hitPolicy,i=o.aggregation;t.onElementsChanged(n.id,this.onElementsChanged),this.state={hitPolicy:r,aggregation:i}}},{key:"componentWillUnmount",value:function(){var e=this._sheet.getRoot();this._changeSupport.onElementsChanged(e.id,this.onElementsChanged)}},{key:"render",value:function(){var e=this._sheet.getRoot().businessObject,t=e.hitPolicy,n=e.aggregation,o=ig.map(function(e){return{label:e,value:e}}),r=ag.map(function(e){return{label:"NONE"===e?"-":e,value:e}});return _l(1,"div","context-menu-container hit-policy-edit",[_l(1,"p","hit-policy-edit-policy",[_l(1,"label","dms-label",xl("Hit Policy:"),2),wl(2,mv,{className:"hit-policy-edit-policy-select",onChange:this.onHitPolicyChange,options:o,value:t})],4),"COLLECT"===t&&_l(1,"p","hit-policy-edit-operator",[_l(1,"label","dms-label",xl("Aggregation:"),2),wl(2,mv,{className:"hit-policy-edit-operator-select",onChange:this.onAggregationChange,options:r,value:n})],4)],0)}}]),o}();function cg(e,c,t,u){e.onGetComponent("cell",function(e){if("before-label-cells"===e.cellType)return ng}),e.onGetComponent("context-menu",function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(e.contextMenuType&&"hit-policy-edit"===e.contextMenuType)return sg}),t.on("hitPolicy.edit",function(e){var t=e.event,n=ht(t.target,"th",!0).getBoundingClientRect(),o=n.left,r=n.top,i=n.width,a=n.height,s=u.getContainer();c.open({x:o+s.parentNode.scrollLeft,y:r+s.parentNode.scrollTop,width:i,height:a},{contextMenuType:"hit-policy-edit",offset:{x:4,y:4}})})}cg.$inject=["components","contextMenu","eventBus","renderer"];var ug={__depends__:[Dy],__init__:["hitPolicyProvider"],hitPolicyProvider:["type",cg]},lg=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var pg=function(){function o(e,t,n){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this._init=function(){i._registerDefaultBindings(),i._fire("init")},this._destroy=function(){i._fire("destroy"),i.unbind(),i._listeners=null},this._keyHandler=function(e){var t,n,o=i._listeners,r=e.keyCode||e.charCode||-1;for(t=0;n=o[t];t++)if(n(r,e))return e.preventDefault(),void e.stopPropagation()},this.unbind=function(){var e=i._node;e&&(i._fire("unbind"),gt.unbind(e,"keydown",i._keyHandler,!0)),i._node=null},this._config=e||{},this._editorActions=n,this._eventBus=t,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)}return lg(o,[{key:"bind",value:function(e){this.unbind(),this._node=e,gt.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,o=this._editorActions;e.push(function(e,t){if(My(t)&&!By(t)&&90===e)return o.trigger("undo"),!0}),e.push(function(e,t){if(My(t)&&(89===e||90===e&&By(t)))return o.trigger("redo"),!0}),e.push(function(e,t){if(13===e&&!My(t)&&yh(t.target)){var n=By(t)?"selectCellAbove":"selectCellBelow";return o.trigger(n),!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})}}]),o}();pg.$inject=["config.keyboard","eventBus","editorActions"];var fg={__depends__:[Xh],__init__:["keyboard"],keyboard:["type",pg]},dg="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},hg=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var yg=function(e){function n(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":dg(t))&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return o.executed(["row.add","row.remove","col.add","col.remove"],vg(function(e){var t=e.context,n=t.row||t.col;o.updateRoot(n,t.oldRoot)})),o.reverted(["row.add","row.remove","col.add","col.remove"],vg(function(e){var t=e.context,n=t.row||t.col;o.updateRoot(n,t.newRoot)})),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":dg(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,oc),hg(n,[{key:"updateRoot",value:function(n,o){var r=this,i=n.root,e=n.businessObject;if(Ht(n,"dmn:DecisionRule")){if(o){var t=o.businessObject.get("rule"),a=t.indexOf(e);t.splice(a,1),e.$parent=null}if(i){var s=i.businessObject,c=i.rows.indexOf(n);s.get("rule").splice(c,0,e),e.$parent=s,n.cells.forEach(function(e,t){r.wireCell(e,n,t)})}}if(Ht(n,"dmn:InputClause")||Ht(n,"dmn:OutputClause")){var u=void 0,l=void 0;if(o){var p=o.businessObject,f=p.get("input"),d=p.get("output");if(Ht(n,"dmn:InputClause")&&(l=(u=f).indexOf(e)),Ht(n,"dmn:OutputClause")&&(l=(u=d).indexOf(e)),-1===l)throw new Error("inconsistent model: clause not in table");u.splice(l,1),e.$parent=null,n.cells.forEach(function(e,t){r.unwireCell(e,o.rows[t])})}if(i){var h=i.businessObject,y=h.get("input"),v=h.get("output"),m=i.cols.indexOf(n),g=void 0,b=void 0;Ht(n,"dmn:InputClause")&&(b=y,g=m),Ht(n,"dmn:OutputClause")&&(b=v,g=m-y.length),b.splice(g,0,e),e.$parent=h,n.cells.forEach(function(e,t){r.wireCell(e,i.rows[t],m)})}}}},{key:"unwireCell",value:function(e,t){var n,o=e.businessObject,r=t.businessObject,i=r.get("inputEntry"),a=r.get("outputEntry"),s=void 0;if(Ht(e,"dmn:UnaryTests")&&(s=i),Ht(e,"dmn:LiteralExpression")&&(s=a),-1===(n=s.indexOf(o)))throw new Error("cell not in row");s.splice(n,1),o.$parent=null}},{key:"wireCell",value:function(e,t,n){var o=e.businessObject,r=t.businessObject,i=r.get("inputEntry"),a=r.get("outputEntry"),s=void 0,c=void 0;o.$parent!==r&&(Ht(e,"dmn:UnaryTests")&&(s=i,c=n),Ht(e,"dmn:LiteralExpression")&&(s=a,c=n-i.length),s.splice(c,0,o),o.$parent=r)}}]),n}();function vg(n){return function(e){var t=e.context;Ht(t.row||t.col,"dmn:DMNElement")&&n(e)}}yg.$inject=["eventBus","sheet"];var mg=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var gg=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}return mg(t,[{key:"create",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=this._model.create(e,t||{});return Ht(n,"dmn:InputClause")&&(t.inputExpression?n.inputExpression=t.inputExpression:(n.inputExpression=this.create("dmn:LiteralExpression",{typeRef:"string"}),n.inputExpression.$parent=n)),Ht(n,"dmn:OutputClause")&&(n.typeRef=t.typeRef||"string"),(Ht(n,"dmn:UnaryTests")||Ht(n,"dmn:LiteralExpression"))&&(n.text=t.text||""),this._ensureId(n),n}},{key:"_needsId",value:function(e){return Ht(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))}}]),t}();gg.$inject=["moddle"];var bg="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},_g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},wg=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var xg=function(e){function s(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":bg(t))&&"function"!=typeof t?e:t}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));return t._dmnFactory=e,t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":bg(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(s,Zu),wg(s,[{key:"create",value:function(e,t){var n=this._dmnFactory,o=t.businessObject,r=t.type,i=function(e,t){var n={};for(var o in e)0<=t.indexOf(o)||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}(t,["businessObject","type"]);if(!o){if(!r){if("root"===e)r="dmn:DecisionTable";else if("cell"===e){var a=i.col;Ht(a,"dmn:OutputClause")&&(r="dmn:LiteralExpression"),Ht(a,"dmn:InputClause")&&(r="dmn:UnaryTests")}if(!r)throw new Error("cannot guess <type>")}o=n.create(r)}return function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0}(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"create",this).call(this,e,_g({businessObject:o,id:o.id},i))}}]),s}();xg.$inject=["dmnFactory"];var Cg="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},Eg=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var kg=function(e){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Cg(t))&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.executed("updateProperties",t.updateIds.bind(t)),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Cg(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,oc),Eg(n,[{key:"updateIds",value:function(e){var t,n=e.context,o=n.element,s=n.oldProperties,c=n.properties;Ht(o,"dmn:DRGElement")&&(t=c,"id"in s&&"id"in t)&&o.$parent.drgElements.forEach(function(e){var n,r,i,t,o,a;n=e,r=s.id,i=c.id,w({authorityRequirement:function(){n.authorityRequirement.forEach(function(e){var t=e.requiredAuthority,n=e.requiredDecision,o=e.requiredInput;t&&t.href==="#"+r&&(t.href="#"+i),n&&n.href==="#"+r&&(n.href="#"+i),o&&o.href==="#"+r&&(o.href="#"+i)})},informationRequirement:function(){n.informationRequirement.forEach(function(e){var t=e.requiredDecision,n=e.requiredInput;t&&t.href==="#"+r&&(t.href="#"+i),n&&n.href==="#"+r&&(n.href="#"+i)})},knowledgeRequirement:function(){n.knowledgeRequirement.forEach(function(e){var t=e.requiredKnowledge;t&&t.href==="#"+r&&(t.href="#"+i)})}},function(e,t){n[t]&&e()}),t=e,o=s.id,a=c.id,t.extensionElements&&t.extensionElements.values.forEach(function(e){Ht(e,"biodi:Edge")&&e.source===o&&(e.source=a)})})}}]),n}();kg.$inject=["eventBus"];var Sg=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Og=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}return Sg(n,[{key:"execute",value:function(e){var t=this._sheet,o=this._elementFactory,n=t.getRoot(),r=e.row,i=e.index;return void 0===i&&(i=e.index=n.rows.length),e.newRoot=n,r.cells.length||n.cols.forEach(function(e,t){var n=o.create("cell",{row:r,col:e});r.cells[t]=n}),t.addRow(r,i),t.getRoot()}},{key:"revert",value:function(e){var t=e.row,n=this._sheet;return n.removeRow(t),n.getRoot()}}]),n}();Og.$inject=["sheet","elementFactory"];var jg=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Pg=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}return jg(t,[{key:"execute",value:function(e){var t=this._sheet,n=t.getRoot(),o=e.row,r=e.oldIndex=n.rows.indexOf(o);if(e.oldRoot=o.root,-1===r)throw new Error("row#"+o.id+" not in sheet");return t.removeRow(o),t.getRoot()}},{key:"revert",value:function(e){var t=e.row,n=e.oldIndex,o=this._sheet;return o.addRow(t,n),o.getRoot()}}]),t}();Pg.$inject=["sheet"];var Tg=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Rg=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}return Tg(t,[{key:"preExecute",value:function(e){var t=e.row;this._modeling.removeRow(t)}},{key:"postExecute",value:function(e){var t=e.row,n=e.index;this._modeling.addRow(t,n)}}]),t}();Rg.$inject=["modeling"];var Ag=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Dg=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}return Ag(n,[{key:"execute",value:function(e){var t=this._sheet,o=this._elementFactory,n=t.getRoot(),r=e.col,i=e.index;return void 0===i&&(i=e.index=n.cols.length),e.newRoot=n,r.cells.length||n.rows.forEach(function(e,t){var n=o.create("cell",{row:e,col:r});r.cells[t]=n}),t.addCol(r,i),t.getRoot()}},{key:"revert",value:function(e){var t=e.col,n=this._sheet;return n.removeCol(t),n.getRoot()}}]),n}();Dg.$inject=["sheet","elementFactory"];var Mg=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Bg=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}return Mg(n,[{key:"execute",value:function(e){var t=this._sheet,n=e.col,o=e.oldRoot=n.root;if(-1===(e.oldIndex=o.cols.indexOf(n)))throw new Error("col#"+n.id+" not in sheet");return t.removeCol(n),t.getRoot()}},{key:"revert",value:function(e){var t=e.col,n=e.oldIndex,o=this._sheet;return o.addCol(t,n),o.getRoot()}}]),n}();Bg.$inject=["sheet","elementFactory"];var Ig=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Ng=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}return Ig(t,[{key:"preExecute",value:function(e){var t=e.col;this._modeling.removeCol(t)}},{key:"postExecute",value:function(e){var t=e.col,n=e.index;this._modeling.addCol(t,n)}}]),t}();Ng.$inject=["modeling"];var Vg=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Lg=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return Vg(e,[{key:"execute",value:function(e){return e.cell}},{key:"revert",value:function(e){return e.cell}}]),e}(),$g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Fg=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Ug=function(){function n(e,t,o){var r=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=o,e.on("table.init",function(){var e,n;e=r.getHandlers(),n=o,w(e,function(e,t){n.registerHandler(t,e)})})}return Fg(n,[{key:"getHandlers",value:function(){return n._getHandlers()}},{key:"_create",value:function(e,t){return t instanceof Uu?t:this._elementFactory.create(e,t)}},{key:"addRow",value:function(e,t){var n=this._create("row",e),o={row:n,index:t};return this._commandStack.execute("row.add",o),n}},{key:"removeRow",value:function(e){this._commandStack.execute("row.remove",{row:e})}},{key:"moveRow",value:function(e,t){var n={row:e,index:t};this._commandStack.execute("row.move",n)}},{key:"addCol",value:function(e,t){var n=this._create("col",e),o={col:n,index:t};return this._commandStack.execute("col.add",o),n}},{key:"removeCol",value:function(e){this._commandStack.execute("col.remove",{col:e})}},{key:"moveCol",value:function(e,t){var n={col:e,index:t};this._commandStack.execute("col.move",n)}},{key:"editCell",value:function(e,t){var n=$g({cell:e},t);this._commandStack.execute("cell.edit",n)}}],[{key:"_getHandlers",value:function(){return{"row.add":Og,"row.remove":Pg,"row.move":Rg,"col.add":Dg,"col.remove":Bg,"col.move":Ng,"cell.edit":Lg}}}]),n}();Ug.$inject=["eventBus","elementFactory","commandStack"];var zg=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Wg=function(){function o(e,t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this._dmnFactory=e,this._moddle=t,this._modeling=n}return zg(o,[{key:"execute",value:function(e){var t=e.element,n=e.allowedValues;return Ht(t,"dmn:InputClause")?(t.inputValues?e.oldAllowedValues=t.inputValues.text:Hg(n)||(t.inputValues=this._dmnFactory.create("dmn:UnaryTests",{text:""})),Hg(n)?t.inputValues&&delete t.inputValues:t.inputValues.text=n.join(",")):(t.outputValues&&t?e.oldAllowedValues=t.outputValues.text:Hg(n)||(t.outputValues=this._dmnFactory.create("dmn:UnaryTests",{text:""})),Hg(n)?t.outputValues&&delete t.outputValues:t.outputValues.text=n.join(",")),t}},{key:"revert",value:function(e){var t=e.element,n=e.oldAllowedValues;return Ht(t,"dmn:InputClause")?n?(t.inputValues||(t.inputValues=this._dmnFactory.create("dmn:UnaryTests",{text:""})),t.inputValues.text=n):delete t.inputValues:n?(t.outputValues||(t.outputValues=this._dmnFactory.create("dmn:UnaryTests",{text:""})),t.outputValues.text=n):delete t.outputValues,t}}]),o}();function Hg(e){return null===e}Wg.$inject=["dmnFactory","moddle","modeling"];var Gg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},qg=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();function Kg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xg(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var Zg=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}return qg(n,[{key:"execute",value:function(e){var t=e.element,n=e.properties,o=Kt(t),r=this.updateProperties(o,n),i=r.changed,a=r.oldProperties;return e.oldProperties=a,[].concat(Xg(i),[t])}},{key:"revert",value:function(e){var t=e.element,n=e.oldProperties,o=Kt(t),r=this.updateProperties(o,n).changed;return[].concat(Xg(r),[t])}},{key:"updateProperties",value:function(c,e){var u=this,l=this._moddle.ids;return x(e,function(e,t,n){var o,r=c.get(n);if(Yg(t)){if(!Yg(r))throw new Error("non-existing property <"+n+">: cannot update values");var i=u.updateProperties(r,t),a=i.changed,s=i.oldProperties;return{changed:[].concat(Xg(e.changed),Xg(a),[r]),oldProperties:Gg({},e.oldProperties,Kg({},n,s))}}return"id"===n&&(o=t,c.id!==o)&&(l.unclaim(c.id),u._elementRegistry.updateId(c,t),l.claim(t,c)),c.set(n,t),{changed:e.changed,oldProperties:Gg({},e.oldProperties,Kg({},n,r))}},{changed:[],oldProperties:{}})}}]),n}();function Yg(e){return c(e)&&_(e)}Zg.$inject=["elementRegistry","moddle"];var Jg=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Qg=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}return Jg(t,[{key:"execute",value:function(e){var t=this._moddle.ids,n=e.id,o=e.element;e.claiming?t.claim(n,o):t.unclaim(n)}},{key:"revert",value:function(e){var t=this._moddle.ids,n=e.id,o=e.element;e.claiming?t.unclaim(n):t.claim(n,o)}}]),t}();Qg.$inject=["moddle"];var eb="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},tb=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var nb=function(e){function i(e,t,n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":eb(t))&&"function"!=typeof t?e:t}(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,e,t,n));return r._eventBus=e,r._elementFactory=t,r._commandStack=n,r._sheet=o,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":eb(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,Ug),tb(i,[{key:"getHandlers",value:function(){return i._getHandlers()}},{key:"editDecisionTableName",value:function(e){var t={element:this._sheet.getRoot().businessObject.$parent,properties:{name:e}};this._commandStack.execute("updateProperties",t)}},{key:"editDecisionTableId",value:function(e){var t={element:this._sheet.getRoot().businessObject.$parent,properties:{id:e}};this._commandStack.execute("updateProperties",t)}},{key:"editHitPolicy",value:function(e,t){var n={element:this._sheet.getRoot().businessObject,properties:{hitPolicy:e,aggregation:t}};this._commandStack.execute("updateProperties",n)}},{key:"updateProperties",value:function(e,t){var n={element:e,properties:t};this._commandStack.execute("updateProperties",n)}},{key:"editInputExpression",value:function(e,t){var n={element:e,properties:t};this._commandStack.execute("updateProperties",n)}},{key:"editOutputName",value:function(e,t){var n={element:e,properties:{name:t}};this._commandStack.execute("updateProperties",n)}},{key:"editInputExpressionTypeRef",value:function(e,t){var n={element:e,properties:{typeRef:t}};this._commandStack.execute("updateProperties",n)}},{key:"editOutputTypeRef",value:function(e,t){var n={element:e,properties:{typeRef:t}};this._commandStack.execute("updateProperties",n)}},{key:"editCell",value:function(e,t){var n={element:e,properties:{text:t}};this._commandStack.execute("updateProperties",n)}},{key:"editAnnotation",value:function(e,t){var n={element:e,properties:{description:t}};this._commandStack.execute("updateProperties",n)}},{key:"editAllowedValues",value:function(e,t){var n={element:e,allowedValues:t};this._commandStack.execute("editAllowedValues",n)}},{key:"editExpressionLanguage",value:function(e,t){var n={element:e,properties:{expressionLanguage:t}};this._commandStack.execute("updateProperties",n)}},{key:"claimId",value:function(e,t){var n={id:e,element:t,claiming:!0};this._commandStack.execute("id.updateClaim",n)}},{key:"unclaimId",value:function(e,t){var n={id:e,element:t};this._commandStack.execute("id.updateClaim",n)}}],[{key:"_getHandlers",value:function(){return R({},function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0}(i.__proto__||Object.getPrototypeOf(i),"_getHandlers",this).call(this),{editAllowedValues:Wg,updateProperties:Zg,"id.updateClaim":Qg})}}]),i}();nb.$inject=["eventBus","elementFactory","commandStack","sheet"];var ob="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},rb=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var ib=function(e){function r(e,t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":ob(t))&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return o._ids=t.ids,o._modeling=n,o.preExecute(["row.add","col.add"],function(e){var t=e.context,n=t.row||t.col;o.claimId(n.businessObject),n.cells&&n.cells.forEach(function(e){return o.claimId(e.businessObject)})}),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":ob(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,oc),rb(r,[{key:"claimId",value:function(n){var o=this;n.id&&!this._ids.assigned(n.id)&&this._modeling.claimId(n.id,n),n.$descriptor.properties.forEach(function(e){var t=n[e.name];t&&(y(t)&&t.forEach(function(e){return o.claimId(e)}),t.$type&&o.claimId(t))})}}]),r}();ib.$inject=["eventBus","moddle","modeling"];var ab="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},sb=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var cb=function(e){function n(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":ab(t))&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return o._modeling=t,o.preExecute(["row.remove","col.remove"],function(e){var t=e.context,n=t.row||t.col;o.unclaimId(n.businessObject),n.cells&&n.cells.forEach(function(e){return o.unclaimId(e.businessObject)})}),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":ab(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,oc),sb(n,[{key:"unclaimId",value:function(n){var o=this;n.id&&this._modeling.unclaimId(n.id,n),n.$descriptor.properties.forEach(function(e){var t=n[e.name];t&&(y(t)&&t.forEach(function(e){return o.unclaimId(e)}),t.$type&&o.unclaimId(t))})}}]),n}();cb.$inject=["eventBus","modeling"];var ub={__init__:["dmnUpdater","idChangeBehavior","modeling"],__depends__:[{__init__:["idClaimBehavior","idUnclaimBehavior"],idClaimBehavior:["type",ib],idUnclaimBehavior:["type",cb]},Us],dmnUpdater:["type",yg],dmnFactory:["type",gg],elementFactory:["type",xg],idChangeBehavior:["type",kg],modeling:["type",nb]},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},pb=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();function fb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function db(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":lb(t))&&"function"!=typeof t?e:t}function hb(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":lb(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var yb={feel:"FEEL",juel:"JUEL",python:"Python",javascript:"JavaScript",groovy:"Groovy",jruby:"JRuby"},vb=function(e){function o(e,t){fb(this,o);var n=db(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n.state={isFocussed:!1},n.changeCellValue=n.changeCellValue.bind(n),n.onFocus=n.onFocus.bind(n),n.onBlur=n.onBlur.bind(n),n.onElementsChanged=n.onElementsChanged.bind(n),n}return hb(o,Ip),pb(o,[{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,o=e.row,r=e.col,i=e.colIndex,a=this.state.isFocussed,s=Ht(t,"dmn:UnaryTests")?"input-cell":"output-cell",c=t.businessObject;return wl(2,vf,{className:s,elementId:t.id,coords:n+":"+i,"data-row-id":o.id,"data-col-id":r.id,children:wl(2,mb,{className:"cell-editor",ctrlForNewline:!0,onFocus:this.onFocus,onBlur:this.onBlur,isFocussed:a,onChange:this.changeCellValue,value:c.text,businessObject:c})})}}]),o}(),mb=function(e){function t(){return fb(this,t),db(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return hb(t,uy),pb(t,[{key:"isDefaultExpressionLanguage",value:function(e){var t=e.expressionLanguage,n=Ht(e,"dmn:UnaryTests"),o=this.context.injector.get("config"),r=o.defaultInputExpressionLanguage,i=o.defaultOutputExpressionLanguage;return n?!t&&!r||t===(r||"feel"):!t&&!i||t===(i||"juel")}},{key:"getDescription",value:function(e){return e.description}},{key:"getExpressionLanguageLabel",value:function(e){var t=e.expressionLanguage;return Ht(e,"dmn:UnaryTests")?t?yb[e.expressionLanguage.toLowerCase()]:"FEEL":t?yb[e.expressionLanguage.toLowerCase()]:"JUEL"}},{key:"isScript",value:function(e){return Ht(e,"dmn:UnaryTests")&&("FEEL"!==(e.expressionLanguage||"FEEL")||-1!==e.text.indexOf("\n"))}},{key:"render",value:function(){var e=this.props,t=e.businessObject,n=e.isFocussed,o=this.getDescription(t),r=this.isDefaultExpressionLanguage(t),i=this.getExpressionLanguageLabel(t)||t.expressionLanguage,a=this.isScript(t);return _l(1,"div",this.getClassName(),[d(o)&&!n&&_l(1,"div","description-indicator"),this.getEditor({className:a?"script-editor":null}),!r&&!n&&_l(1,"span","dms-badge dmn-expression-language",[_l(1,"span","dms-badge-icon dmn-icon-file-code"),_l(1,"span","dms-badge-label",i,0)],4,{title:"Expression Language = "+i})],0)}}]),t}();var gb=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 vb})};gb.$inject=["components"];var bb={__depends__:[by,fd],__init__:["decisionRulesEditor"],decisionRulesEditor:["type",gb]},_b="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},wb=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var xb=function(e){function a(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_b(t))&&"function"!=typeof t?e:t}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,e,t));o.state={top:0,left:0,isVisible:!1,isDisabled:!0};var n=t.injector,r=o._eventBus=n.get("eventBus"),i=n.get("simpleMode");return o._renderer=n.get("renderer"),o._selection=t.injector.get("selection"),o.updatePosition=o.updatePosition.bind(o),r.on("selection.changed",function(e){var t,n=e.selection;n&&i.canSimpleEdit(n)?(o.setState({isVisible:!0,selection:n},o.updatePosition),t=!function(e,t){{if(Gt(e.col))return!t||"feel"===t;if(qt(e.col))return!t||"juel"===t}}(n,n.businessObject.expressionLanguage),o.setState({isVisible:!0,selection:n,isDisabled:t},o.updatePosition)):o.setState({isVisible:!1})}),o.onClick=o.onClick.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_b(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(a,Ip),wb(a,[{key:"updatePosition",value:function(){var e=this.state.selection;if(e&&this.node){var t=this._container=this._renderer.getContainer(),n=hh(e.id,t).getBoundingClientRect(),o=this.node.getBoundingClientRect(),r=t.getBoundingClientRect(),i=t.scrollLeft,a=t.scrollTop,s={};n.left+n.width/2>r.width/2?s.left=window.scrollX-r.left+n.left-o.width+4+i+"px":s.left=window.scrollX-r.left+n.left+n.width-4+i+"px",n.top+n.height/2>r.height/2?s.top=window.scrollY-r.top+n.top-o.height+4+a+"px":s.top=window.scrollY-r.top+n.top-4+a+"px",R(this.node.style,s)}}},{key:"onClick",value:function(){if(!this.state.isDisabled){var e=this._selection.get();e&&(this._eventBus.fire("simpleMode.open",{element:e,node:hh(e.id,this._container)}),this.setState({isVisible:!1}))}}},{key:"render",value:function(){var t=this,e=this.state,n=e.isDisabled,o=e.isVisible,r=e.top,i=e.left,a=["simple-mode-button","no-deselect"];return n&&a.push("disabled"),o?_l(1,"div",a.join(" "),_l(1,"span","dmn-icon-edit"),2,{onClick:this.onClick,style:{top:r,left:i},title:n?"Editing not supported for set expression language":"Edit"},null,function(e){return t.node=e}):null}}]),a}();var Cb=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Eb=function(){function t(e,c,i,a,u){!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 xb}),a.on("simpleMode.open",function(e){var t=e.element,n=e.node.getBoundingClientRect(),o=n.left,r=n.top,i=n.width,a=n.height,s=u.getContainer();c.open({x:o+s.parentNode.scrollLeft,y:r+s.parentNode.scrollTop,width:i,height:a},{contextMenuType:"simple-mode-edit",element:t,offset:{x:4,y:4}})}),a.on("cell.click",function(e){var t=e.event,n=e.node,o=e.id;if(function(e){if(e.altKey)return!1;return e.ctrlKey||e.metaKey}(t)){var r=i.get(o);r&&a.fire("simpleMode.open",{node:n,element:r}),e.preventDefault()}})}return Cb(t,[{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)}}]),t}();Eb.$inject=["components","contextMenu","elementRegistry","eventBus","renderer"];var kb={__depends__:[Dy,bh],__init__:["simpleMode"],simpleMode:["type",Eb]};var Sb="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},Ob=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var jb="none",Pb=function(e){function a(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Sb(t))&&"function"!=typeof t?e:t}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,e,t));n._modeling=t.injector.get("modeling");var o,r=n.props.context.element,i=(o=r.businessObject.text)&&""!==o?"true"===o.trim()?"true":"false"===o.trim()?"false":void 0:"none";return n.state={value:i||jb},n.editCell=n.editCell.bind(n),n.onChange=n.onChange.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Sb(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(a,Ip),Ob(a,[{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===jb?"":e),this.setState({value:e})}},{key:"render",value:function(){var e=this.state.value,t=[{label:"-",value:jb},{label:"Yes",value:"true"},{label:"No",value:"false"}];return _l(1,"div","simple-boolean-edit context-menu-container",[_l(1,"h3","dms-heading",xl("Edit Boolean"),2),_l(1,"h4","dms-heading",xl("Set Value"),2),wl(2,mv,{noInput:!0,className:"dms-block",onChange:this.onChange,options:t,value:e})],4)}}]),a}();var Tb=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(Gt(e.col)||qt(e.col))&&"boolean"===Rb(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){if(!e.element)return;if("boolean"===Rb(e.element))return Pb}})};function Rb(e){return Gt(e.col)?e.col&&e.col.businessObject.inputExpression.typeRef:e.col&&e.col.businessObject.typeRef}Tb.$inject=["components","simpleMode"];var Ab={__depends__:[fg,kb],__init__:["simpleBooleanEdit"],simpleBooleanEdit:["type",Tb]},Db=/^\d{4}(?:-\d\d){2}T(?:\d\d:){2}\d\d$/,Mb=/^\[date and time\("(\d{4}(?:-\d\d){2}T(?:\d\d:){2}\d\d)"\)..date and time\("(\d{4}(?:-\d\d){2}T(?:\d\d:){2}\d\d)"/,Bb=/^(<|>)\s*date and time\("(\d{4}(?:-\d\d){2}T(?:\d\d:){2}\d\d)"\)/,Ib=/^date and time\("(\d{4}(?:-\d\d){2}T(?:\d\d:){2}\d\d)"\)$/;function Nb(e){if(!Db.test(e.trim()))return"Date must match pattern yyyy-MM-ddTHH:mm:ss."}function Vb(e,t){return"exact"===e?'date and time("'+t[0]+'")':"before"===e?'< date and time("'+t[0]+'")':"after"===e?'> date and time("'+t[0]+'")':"between"===e?'[date and time("'+t[0]+'")..date and time("'+t[1]+'")]':void 0}function Lb(){var e=new Date;return e.setUTCHours(0,0,0,0),e.toISOString().slice(0,-5)}function $b(e){if(!e||""===e.trim())return{type:"exact",date:""};var t=e.match(Mb);return t?{type:"between",dates:[t[1],t[2]]}:(t=e.match(Bb))?{type:"<"===t[1]?"before":"after",date:t[2]}:(t=e.match(Ib))?{type:"exact",date:t[1]}:void 0}var Fb="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},Ub=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var zb="between",Wb=function(e){function a(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Fb(t))&&"function"!=typeof t?e:t}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,e,t));n._modeling=t.injector.get("modeling");var o=$b(n.props.context.element.businessObject.text);if(o){var r=void 0;r=o.date?[o.date,""]:o.dates?o.dates:["",""],n.state={type:o.type,dates:r}}else n.state={type:"exact",dates:["",""]};var i=t.injector.get("debounceInput");return n.debouncedEditCell=i(n.editCell.bind(n)),n.editCell=n.editCell.bind(n),n.onTypeChange=n.onTypeChange.bind(n),n.onSetStartDateTodayClick=n.onSetStartDateTodayClick.bind(n),n.onSetEndDateTodayClick=n.onSetEndDateTodayClick.bind(n),n.onStartDateInput=n.onStartDateInput.bind(n),n.onEndDateInput=n.onEndDateInput.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Fb(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(a,Ip),Ub(a,[{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}),$b(Vb(e,n))&&this.editCell(t.businessObject,Vb(e,n))}},{key:"onSetStartDateTodayClick",value:function(){var e=this.props.context.element,t=this.state,n=t.dates,o=t.type,r=Lb();this.setState({dates:[r,n[1]]}),$b(Vb(o,[r,n[1]]))&&this.editCell(e.businessObject,Vb(o,[r,n[1]]))}},{key:"onSetEndDateTodayClick",value:function(){var e=this.props.context.element,t=this.state,n=t.dates,o=t.type,r=Lb();this.setState({dates:[n[0],r]}),$b(Vb(o,[n[0],r]))&&this.editCell(e.businessObject,Vb(o,[n[0],r]))}},{key:"onStartDateInput",value:function(e){var t=e.isValid,n=e.value;if(t){var o=this.props.context.element,r=this.state,i=r.dates,a=r.type;this.setState({dates:[n,i[1]]}),this.debouncedEditCell(o.businessObject,Vb(a,[n,i[1]]))}}},{key:"onEndDateInput",value:function(e){var t=e.isValid,n=e.value;if(t){var o=this.props.context.element,r=this.state,i=r.dates,a=r.type;this.setState({dates:[i[0],n]}),this.debouncedEditCell(o.businessObject,Vb(a,[i[0],n]))}}},{key:"render",value:function(){var e=this.state,t=e.dates,n=e.type,o=[{label:"Exactly",value:"exact"},{label:"Before",value:"before"},{label:"After",value:"after"},{label:"Between",value:zb}];return _l(1,"div","context-menu-container simple-date-edit",[_l(1,"h3","dms-heading",xl("Edit Date"),2),_l(1,"div","dms-fill-row",wl(2,mv,{noInput:!0,onChange:this.onTypeChange,options:o,value:n}),2),_l(1,"h4","dms-heading",n===zb?"Edit Start Date":"Set Date",0),_l(1,"div",null,[wl(2,Wv,{className:"start-date-input dms-block",onInput:this.onStartDateInput,placeholder:"e.g. "+Lb(),validate:Nb,value:t[0]}),_l(1,"p","dms-hint",[_l(1,"a","use-today",xl("Use today"),2,{href:"#",onClick:this.onSetStartDateTodayClick}),xl(".")],4)],4),n===zb&&_l(1,"h4","dms-heading",xl("Edit End Date"),2),n===zb&&_l(1,"div",null,[wl(2,Wv,{className:"end-date-input dms-block",onInput:this.onEndDateInput,placeholder:"e.g. "+Lb(),validate:Nb,value:t[1]}),_l(1,"p","dms-hint",[_l(1,"a","use-today",xl("Use today"),2,{href:"#",onClick:this.onSetEndDateTodayClick}),xl(".")],4)],4)],0)}}]),a}(),Hb="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},Gb=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var qb=function(e){function i(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Hb(t))&&"function"!=typeof t?e:t}(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,e,t));n._modeling=t.injector.get("modeling");var o=$b(n.props.context.element.businessObject.text);n.state={date:o?o.date:""};var r=t.injector.get("debounceInput");return n.debouncedEditCell=r(n.editCell.bind(n)),n.editCell=n.editCell.bind(n),n.onClick=n.onClick.bind(n),n.onInput=n.onInput.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Hb(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,Ip),Gb(i,[{key:"editCell",value:function(e,t){this._modeling.editCell(e,t)}},{key:"onClick",value:function(){var e=this.props.context.element,t=Lb();this.setState({date:t}),this.editCell(e.businessObject,'date and time("'+t+'")')}},{key:"onInput",value:function(e){var t=e.isValid,n=e.value;if(t){var o=this.props.context.element;this.setState({date:n}),this.debouncedEditCell(o.businessObject,'date and time("'+n+'")')}}},{key:"render",value:function(){var e=this.state.date;return _l(1,"div","context-menu-container simple-date-edit",[_l(1,"h3","dms-heading",xl("Edit Date"),2),_l(1,"h4","dms-heading",xl("Set Date"),2),_l(1,"div",null,[wl(2,Wv,{onInput:this.onInput,placeholder:"e.g. "+Lb(),validate:Nb,value:e,className:"dms-block"}),_l(1,"p","dms-hint",[xl("Set date "),_l(1,"a","use-today",xl("to today"),2,{href:"#",onClick:this.onClick}),xl(".")],4)],4)],4)}}]),i}();var Kb=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=Xb(e);return(Gt(e.col)||qt(e.col))&&Zb(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){if(!e.element)return;if(Zb(Xb(e.element))){if(Gt(e.element.col))return Wb;if(qt(e.element.col))return qb}}})};function Xb(e){return Gt(e.col)?e.col&&e.col.businessObject.inputExpression.typeRef:e.col&&e.col.businessObject.typeRef}function Zb(e){return"date"===e}Kb.$inject=["components","simpleMode"];var Yb={__depends__:[fg,kb],__init__:["simpleDateEdit"],simpleDateEdit:["type",Kb]},Jb=/^(-?(?:[0-9]|\.[0-9])+)$|^((?:<|>|=){0,2})\s*(-?(?:[0-9]|\.[0-9])+)$/,Qb=/^(\[|\]){1}(-?(?:[0-9]|\.[0-9])+){1,}\.\.(-?(?:[0-9]|\.[0-9])+){1,}(\[|\]){1}$/,e_={equals:"=",less:"<",lessEquals:"<=",greater:">",greaterEquals:">="};function t_(e){if(!e||""===e.trim())return{type:"comparison"};var t,n,o,r=e.match(Jb),i=e.match(Qb);if(r){if((o=r)[0]&&o[1]&&!o[2]&&!o[3])return{type:"comparison",value:parseFloat(r[1]),operator:"equals"};if((n=r)[0]&&!n[1]&&n[2]&&n[3])return{type:"comparison",value:parseFloat(r[3]),operator:(t=r[2],m(e_).filter(function(e){return t===e_[e]})[0])}}else if(i)return{type:"range",values:[i[2],i[3]].map(function(e){return parseFloat(e)}),start:"]"===i[1]?"exclude":"include",end:"["===i[4]?"exclude":"include"}}function n_(e,t){return"equals"===e?""+t:e_[e]+" "+t}function o_(e,t,n,o){return""+("exclude"===n?"]":"[")+e+".."+t+("exclude"===o?"[":"]")}var r_="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},i_=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var a_="comparison",s_="range",c_=function(e){function i(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":r_(t))&&"function"!=typeof t?e:t}(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,e,t));n._modeling=t.injector.get("modeling");var o=t_(n.props.context.element.businessObject.text);n.state=o?{type:o.type,comparisonOperator:o.operator||"equals",comparisonValue:o.value||0,rangeStartValue:o.values?o.values[0]:0,rangeEndValue:o.values?o.values[1]:0,rangeStartType:o.start||"include",rangeEndType:o.end||"include"}:{type:a_,comparisonOperator:"equals",comparisonValue:0,rangeStartValue:0,rangeEndValue:0,rangeStartType:"include",rangeEndType:"include"};var r=t.injector.get("debounceInput");return n.debouncedEditCell=r(n.editCell.bind(n)),n.editCell=n.editCell.bind(n),n.onComparisonOperatorChange=n.onComparisonOperatorChange.bind(n),n.onComparisonValueChange=n.onComparisonValueChange.bind(n),n.onTypeChange=n.onTypeChange.bind(n),n.onRangeStartTypeChange=n.onRangeStartTypeChange.bind(n),n.onRangeStartValueChange=n.onRangeStartValueChange.bind(n),n.onRangeEndTypeChange=n.onRangeEndTypeChange.bind(n),n.onRangeEndValueChange=n.onRangeEndValueChange.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":r_(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,Ip),i_(i,[{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,o=n.comparisonOperator,r=n.comparisonValue,i=n.rangeStartValue,a=n.rangeEndValue,s=n.rangeStartType,c=n.rangeEndType;e===a_?this.editCell(t.businessObject,n_(o,r)):this.editCell(t.businessObject,o_(i,a,s,c)),this.setState({type:e})}},{key:"onComparisonOperatorChange",value:function(e){var t=this.props.context.element,n=this.state,o=n.type,r=n.comparisonValue;o===a_&&(this.editCell(t.businessObject,n_(e,r)),this.setState({comparisonOperator:e}))}},{key:"onComparisonValueChange",value:function(e){var t=this.props.context.element,n=this.state,o=n.type,r=n.comparisonOperator;o===a_&&(this.debouncedEditCell(t.businessObject,n_(r,e)),this.setState({comparisonValue:e}))}},{key:"onRangeStartTypeChange",value:function(e){var t=this.props.context.element,n=this.state,o=n.type,r=n.rangeStartValue,i=n.rangeEndValue,a=n.rangeEndType;o===s_&&(this.editCell(t.businessObject,o_(r,i,e,a)),this.setState({rangeStartType:e}))}},{key:"onRangeStartValueChange",value:function(e){var t=this.props.context.element,n=this.state,o=n.type,r=n.rangeEndValue,i=n.rangeStartType,a=n.rangeEndType;o===s_&&(this.editCell(t.businessObject,o_(e,r,i,a)),this.setState({rangeStartValue:e}))}},{key:"onRangeEndTypeChange",value:function(e){var t=this.props.context.element,n=this.state,o=n.type,r=n.rangeStartValue,i=n.rangeEndValue,a=n.rangeStartType;o===s_&&(this.editCell(t.businessObject,o_(r,i,a,e)),this.setState({rangeEndType:e}))}},{key:"onRangeEndValueChange",value:function(e){var t=this.props.context.element,n=this.state,o=n.type,r=n.rangeStartValue,i=n.rangeStartType,a=n.rangeEndType;o===s_&&(this.editCell(t.businessObject,o_(r,e,i,a)),this.setState({rangeEndValue:e}))}},{key:"renderComparison",value:function(e,t){return _l(1,"div","comparison",[_l(1,"h4","dms-heading",xl("Value"),2),_l(1,"div","dms-fill-row",[wl(2,mv,{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}),xl(" "),wl(2,ov,{className:"comparison-number-input",onInput:this.onComparisonValueChange,type:"number",value:t})],4)],4)}},{key:"renderRange",value:function(e,t,n,o){var r=[{label:"Include",value:"include"},{label:"Exclude",value:"exclude"}];return _l(1,"div","range",[_l(1,"h4","dms-heading",xl("Start Value"),2),_l(1,"div","dms-fill-row",[wl(2,mv,{noInput:!0,onChange:this.onRangeStartTypeChange,options:r,value:n}),xl(" "),wl(2,ov,{className:"range-start-number-input",onInput:this.onRangeStartValueChange,type:"number",value:e})],4),_l(1,"h4","dms-heading",xl("End Value"),2),_l(1,"div","dms-fill-row",[wl(2,mv,{noInput:!0,onChange:this.onRangeEndTypeChange,options:r,value:o}),xl(" "),wl(2,ov,{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,o=e.comparisonValue,r=e.rangeStartValue,i=e.rangeEndValue,a=e.rangeStartType,s=e.rangeEndType,c=[{label:"Comparison",value:a_},{label:"Range",value:s_}];return _l(1,"div","context-menu-container simple-number-edit",[_l(1,"h3","dms-heading",xl("Edit Number"),2),_l(1,"div","dms-fill-row",wl(2,mv,{noInput:!0,onChange:this.onTypeChange,options:c,value:t}),2),t===a_&&this.renderComparison(n,o),t===s_&&this.renderRange(r,i,a,s)],0)}}]),i}(),u_="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},l_=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var p_=function(e){function i(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":u_(t))&&"function"!=typeof t?e:t}(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,e,t));n._modeling=t.injector.get("modeling");var o=t_(n.props.context.element.businessObject.text);n.state=o?{value:o.value}:{value:""};var r=t.injector.get("debounceInput");return n.debouncedEditCell=r(n.editCell.bind(n)),n.editCell=n.editCell.bind(n),n.onInput=n.onInput.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":u_(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,Ip),l_(i,[{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 _l(1,"div","context-menu-container simple-number-edit",[_l(1,"h3","dms-heading",xl("Edit Number"),2),_l(1,"h4","dms-heading",xl("Set Value"),2),wl(2,ov,{onInput:this.onInput,type:"number",value:e})],4)}}]),i}();var f_=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=d_(e);return(Gt(e.col)||qt(e.col))&&("integer"===t||"long"===t||"double"===t)}),t.onGetComponent("context-menu",function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(t.contextMenuType&&"simple-mode-edit"===t.contextMenuType){if(!t.element)return;var n=d_(t.element);if("integer"===(e=n)||"long"===e||"double"===e){if(Gt(t.element.col))return c_;if(qt(t.element.col))return p_}}})};function d_(e){return Gt(e.col)?e.col&&e.col.businessObject.inputExpression.typeRef:e.col&&e.col.businessObject.typeRef}f_.$inject=["components","simpleMode"];var h_={__depends__:[fg,kb],__init__:["simpleNumberEdit"],simpleNumberEdit:["type",f_]};function y_(e){if(!e||v_(e.trim()))return{type:"disjunction",values:[]};var t=e.split(","),n={type:"disjunction",values:[]},o="";if(t.forEach(function(e){/^"[^"]*"$/.test((o+=e).trim())?(n.values.push(o.trim()),o=""):o+=","}),!o)return n;n.type="negation",n.values=[],o="";var r=e.match(/^\s*not\((.*)\)\s*$/);return r&&((t=r[1].split(",")).forEach(function(e){/^"[^"]*"$/.test((o+=e).trim())?(n.values.push(o.trim()),o=""):o+=","}),!o)?n:void 0}function v_(e){return""===e}var m_="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},g_=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var b_="disjunction",__="negation",w_=function(e){function f(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":m_(t))&&"function"!=typeof t?e:t}(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,e,t));n._modeling=t.injector.get("modeling");var o=y_(e.context.element.businessObject.text);o||(o={values:[],type:b_});var r,i,a=(r=e.context.element.col.businessObject,!(i=Gt(r)?r.inputValues:r.outputValues)||v_(i.text)?[]:i.text.split(",").map(function(e){return e.trim()})),s=o.values.filter(function(e){return!C_(a,e)}),c=Gt(e.context.element.col),u=a.map(function(e){return{value:e,isChecked:C_(o.values,e),isRemovable:!1,group:"Predefined Values"}});c&&(u=u.concat(s.map(function(e){return{value:e,isChecked:!0,isRemovable:!0,group:"Custom Values"}})));var l="";c||!o.values.length||C_(a,o.values[0])||(l=o.values[0]),n.state={items:u,unaryTestsType:o.type,inputValue:l,isOutputValueInputChecked:""!==l};var p=t.injector.get("debounceInput");return n.debouncedEditCell=p(n.editCell.bind(n)),n.editCell=n.editCell.bind(n),n.addUnaryTestsListItem=n.addUnaryTestsListItem.bind(n),n.onInput=n.onInput.bind(n),n.onKeyDown=n.onKeyDown.bind(n),n.onOutputValueInputClick=n.onOutputValueInputClick.bind(n),n.onUnaryTestsListChanged=n.onUnaryTestsListChanged.bind(n),n.onUnaryTestsTypeChange=n.onUnaryTestsTypeChange.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":m_(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(f,Ip),g_(f,[{key:"editCell",value:function(e,t){this._modeling.editCell(e,t)}},{key:"onUnaryTestsTypeChange",value:function(e){var t=x_(this.state.items),n=this.props.context.element;e===b_?(this.editCell(n.businessObject,t.join(",")),this.setState({unaryTestsType:b_})):(this.editCell(n.businessObject,"not("+t.join(",")+")"),this.setState({unaryTestsType:__}))}},{key:"onUnaryTestsListChanged",value:function(e){var t=x_(e),n=this.props.context.element;this.state.unaryTestsType===b_?this.editCell(n.businessObject,t.join(",")):this.editCell(n.businessObject,"not("+t.join(",")+")"),this.setState({items:e,isOutputValueInputChecked:!1})}},{key:"onOutputValueInputClick",value:function(){var e=this.props.context.element,t=this.state,n=t.inputValue,o=t.items,r=y_(n);!r||1<r.values.length||(this.editCell(e.businessObject,""+r.values.join("")),this.setState({items:o.map(function(e){return e.isChecked=!1,e}),isOutputValueInputChecked:!0}))}},{key:"onInput",value:function(e){var t=e.isValid,n=e.value,o=this.state.isOutputValueInputChecked;this.setState({inputValue:n});var r=this.props.context.element;!Gt(r)&&t&&o&&this.debouncedEditCell(r.businessObject,n)}},{key:"onKeyDown",value:function(e){var t=e.isValid,n=e.event;if(13===n.keyCode){var o=Gt(this.props.context.element.col);!o&&t||(n.stopPropagation(),n.preventDefault()),t&&(o?this.addUnaryTestsListItem():this.onOutputValueInputClick())}}},{key:"addUnaryTestsListItem",value:function(){var e=this.state,t=e.inputValue,n=e.items,o=e.unaryTestsType,r=y_(t);if(r){var i=this.props.context.element,a=x_(n),s=[].concat(a,r.values);o===b_?this.editCell(i.businessObject,s.join(",")):this.editCell(i.businessObject,"not("+s.join(",")+")");var c=n.concat(r.values.map(function(e){return{value:e,isChecked:!0,isRemovable:!0,group:"Custom Values"}}));this.setState({items:c,inputValue:""})}}},{key:"render",value:function(){var t=this,e=this.props.context.element,n=this.state,o=n.inputValue,r=n.isOutputValueInputChecked,i=n.items,a=n.unaryTestsType,s=[{label:"Match one",value:b_},{label:"Match none",value:__}],c=Gt(e.col),u=a===__,l=!c&&0<i.length;return _l(1,"div","simple-string-edit context-menu-container",[_l(1,"h3","dms-heading",xl("Edit String"),2),c&&_l(1,"p",null,wl(2,mv,{noInput:!0,onChange:this.onUnaryTestsTypeChange,options:s,value:u?__:b_},null,function(e){return t.selectNode=e}),2),wl(2,Fv,{onChange:this.onUnaryTestsListChanged,items:i,type:c?"checkbox":"radio"}),_l(1,"h4","dms-heading",xl(c?"Add Values":"Set Value"),2),_l(1,"div","dms-fill-row",[l&&_l(64,"input","cursor-pointer",null,1,{checked:r,onClick:this.onOutputValueInputClick,type:"radio",style:{marginRight:"8px"}}),wl(2,Wv,{className:"dms-block",onKeyDown:this.onKeyDown,onInput:this.onInput,placeholder:c?'"value", "value", ...':'"value"',type:"text",validate:function(e){if(!y_(e))return"Strings must be in double quotes."},value:o})],0)],0)}}]),f}();function x_(e){return e.filter(function(e){return e.isChecked}).map(function(e){return e.value})}function C_(e,t){return-1!==e.indexOf(t)}var E_=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(Gt(e.col)||qt(e.col))&&"string"===k_(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){if(!e.element)return;if("string"===k_(e.element))return w_}})};function k_(e){return Gt(e.col)?e.col&&e.col.businessObject.inputExpression.typeRef:e.col&&e.col.businessObject.typeRef}E_.$inject=["components","simpleMode"];var S_={__depends__:[fg,kb],__init__:["simpleStringEdit"],simpleStringEdit:["type",E_]},O_="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},j_=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();function P_(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var T_=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":O_(t))&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":O_(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,Id),j_(t,[{key:"getModules",value:function(){return[].concat(P_(Id._getModules()),P_(t._getModules()))}}],[{key:"_getModules",value:function(){return[Zh,_y,bh,Dy,Uh,Vy,Gy,Yy,Xh,am,Cm,Mm,Vm,fg,am,Qm,Kh,ug,Kd,ub,bb,Wd,kb,Ab,Yb,h_,S_]}}]),t}(),R_=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var A_=function(){function t(e){var o=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){var t=e.elements;o.elementsChanged(t)}),e.on("element.updateId",function(e){var t=e.element,n=e.newId;o.updateId(t.id,n)})}return R_(t,[{key:"elementsChanged",value:function(e){for(var t={},n=e.length,o=0;o<n;o++){var r=e[o].id;if(t[r])return;t[r]=!0;var i=this._listeners[r]&&this._listeners[r].length;if(i)for(var a=0;a<i;a++)this._listeners[r][a]&&this._listeners[r][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){if(this._listeners[e])if(t){var n=this._listeners[e].indexOf(t);-1!==n&&this._listeners[e].splice(n,1)}else this._listeners[e].length=0}},{key:"updateId",value:function(e,t){this._listeners[e]&&(this._listeners[t]=this._listeners[e],delete this._listeners[e])}}]),t}();A_.$inject=["eventBus"];var D_=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var M_=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._listeners={}}return D_(e,[{key:"getComponent",value:function(e,t){var n=this._listeners[e];if(n){for(var o=void 0,r=0;r<n.length&&!(o=n[r].callback(t));r++);return o}}},{key:"getComponents",value:function(e,t){var n=this._listeners[e];if(n){for(var o=[],r=0;r<n.length;r++){var i=n[r].callback(t);i&&o.push(i)}if(o.length)return o}}},{key:"onGetComponent",value:function(e,t,n){if(p(t)&&(n=t,t=1e3),!l(t))throw new Error("priority must be a number");var o=this._getListeners(e),r=void 0,i=void 0,a={priority:t,callback:n};for(i=0;r=o[i];i++)if(r.priority<t)return void o.splice(i,0,a);o.push(a)}},{key:"offGetComponent",value:function(e,t){var n=this._getListeners(e),o=void 0,r=void 0;if(t)for(r=n.length-1;o=n[r];r--)o.callback===t&&n.splice(r,1);else n.length=0}},{key:"_getListeners",value:function(e){var t=this._listeners[e];return t||(this._listeners[e]=t=[]),t}}]),e}(),B_="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},I_=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var N_=function(e){function o(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":B_(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e)),n=t._injector=e.injector;return t._changeSupport=n.get("changeSupport"),t._components=n.get("components"),t._renderer=n.get("renderer"),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":B_(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,Ip),I_(o,[{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 _l(1,"div","viewer-container",e&&e.map(function(e,t){return wl(2,e,null,t)}),0)}}]),o}(),V_=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var L_=function(){function a(e,t,n,o,r){!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,o.on("renderer.mount",function(){Rp(wl(2,N_,{injector:r}),i)}),o.on("renderer.unmount",function(){Rp(null,i)})}return V_(a,[{key:"getContainer",value:function(){return this._container}}]),a}();L_.$inject=["changeSupport","components","config.renderer","eventBus","injector"];var $_={__init__:["changeSupport","components","renderer"],changeSupport:["type",A_],components:["type",M_],eventBus:["type",o],renderer:["type",L_]},F_=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var U_=function(){function i(){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,i);var t=e.injector;if(!t){var n=this._init(e),o=n.modules,r=n.config;t=function(e){var o=[],r=[];function i(e){return 0<=o.indexOf(e)}e.forEach(function e(t){var n;i(t)||((t.__depends__||[]).forEach(e),i(t)||(n=t,o.push(n),(t.__init__||[]).forEach(function(e){r.push(e)})))});var t=new fn(o);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",r]},$_].concat(o||[]))}this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("viewer.init")}return F_(i,[{key:"_init",value:function(e){return{modules:e.modules,config:function(e,t){var n={};for(var o in e)0<=t.indexOf(o)||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}(e,["modules"])}}},{key:"destroy",value:function(){this.get("eventBus").fire("viewer.destroy")}},{key:"clear",value:function(){this.get("eventBus").fire("viewer.clear")}}]),i}();var z_=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var W_=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}return z_(n,[{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}}]),n}();W_.$inject=["viewer","eventBus"];var H_={__init__:["elementRegistry"],elementRegistry:["type",W_]},G_="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},q_=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var K_=function(e){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=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":G_(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n._viewer=t.injector.get("viewer"),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":G_(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,Ip),q_(o,[{key:"render",value:function(){var e=this._viewer.getDecision(),t=e.name,n=e.id;return _l(1,"div","decision-properties",[_l(1,"h3","decision-name",t,0),_l(1,"h5","decision-id",n,0)],4)}}]),o}();var X_=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",2e3,function(){return K_})};X_.$inject=["components"];var Z_={__init__:["decisionProperties"],decisionProperties:["type",X_]},Y_="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},J_=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Q_=function(e){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=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Y_(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n._viewer=t.injector.get("viewer"),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Y_(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,Ip),J_(o,[{key:"render",value:function(){var e=this._viewer.getDecision(),t=e.literalExpression,n=e.variable;return _l(1,"div","literal-expression-properties",_l(1,"table",null,[_l(1,"tr",null,[_l(1,"td",null,xl("Variable Name:"),2),_l(1,"td",null,_l(1,"span",null,n.name||"-",0),2)],4),_l(1,"tr",null,[_l(1,"td",null,xl("Variable Type:"),2),_l(1,"td",null,_l(1,"span",null,n.typeRef||"-",0),2)],4),_l(1,"tr",null,[_l(1,"td",null,xl("Expression Language:"),2),_l(1,"td",null,_l(1,"span",null,t.expressionLanguage||"-",0),2)],4)],4),2)}}]),o}();var ew=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 Q_})};ew.$inject=["components"];var tw={__init__:["literalExpressionProperties"],literalExpressionProperties:["type",ew]},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},ow=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var rw=function(e){function r(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":nw(t))&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));n.onClick=function(){n._eventBus.fire("poweredBy.show")};var o=t.injector;return n._eventBus=o.get("eventBus"),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":nw(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,Ip),ow(r,[{key:"render",value:function(){var t=this;return _l(1,"div","powered-by-logo",_l(1,"img","logo",null,1,{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC"}),2,{onClick:this.onClick,title:"Powered by bpmn.io"},null,function(e){return t.node=e})}}]),r}(),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},aw=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var sw=function(e){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":iw(t))&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.state={show:!1},t.onClick=t.onClick.bind(t),t.onShow=t.onShow.bind(t),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":iw(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,Ip),aw(n,[{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&&_l(1,"div","powered-by-overlay",_l(1,"div","powered-by-overlay-content",[_l(1,"div",null,_l(1,"img","logo",null,1,{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC"}),2),_l(1,"div",null,[xl("Web-based tooling for BPMN, DMN and CMMN diagrams powered by "),_l(1,"a",null,xl("bpmn.io"),2,{href:"http://bpmn.io",target:"_blank"}),xl(".")],4)],4,{onClick:function(e){return e.stopPropagation()}}),2,{onClick:this.onClick})}}]),n}();var cw=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 rw}),t.onGetComponent("viewer",function(){return sw})};cw.$inject=["components","eventBus"];var uw={__init__:["poweredBy"],poweredBy:["type",cw]},lw="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},pw=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var fw=function(e){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=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":lw(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n._viewer=t.injector.get("viewer"),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":lw(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,Ip),pw(o,[{key:"render",value:function(){return _l(1,"div","textarea",_l(1,"div","content",this._viewer.getDecision().literalExpression.text,0),2)}}]),o}();var dw=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 fw})};dw.$inject=["components"];var hw={__init__:["textarea"],textarea:["type",dw]},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},vw=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var mw=function(e){function r(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":yw(t))&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));n.onClick=function(){n._eventBus.fire("showDrd")};var o=t.injector;return n._eventBus=o.get("eventBus"),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":yw(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,Ip),vw(r,[{key:"render",value:function(){var t=this;return _l(1,"div","view-drd",_l(1,"button","view-drd-button",xl("View DRD"),2,{onClick:this.onClick}),2,null,null,function(e){return t.node=e})}}]),r}(),gw=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var bw=function(){function i(e,t,n,o){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),this._injector=o,this._viewer=t,e.onGetComponent("viewer",1500,function(){if(r.canViewDrd())return mw}),n.on("showDrd",function(){var e=o.get("_parent",!1),t=r.getDefinitions(),n=e.getView(t);e.open(n)})}return gw(i,[{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}}]),i}();bw.$inject=["components","viewer","eventBus","injector"];var _w={__init__:["viewDrd"],viewDrd:["type",bw]},ww="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},xw=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();function Cw(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var Ew=function(e){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(),n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":ww(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,R(e,{renderer:{container:t}})));return n._container=t,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":ww(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,U_),xw(o,[{key:"open",value:function(e,t){var n;try{this._decision&&(this.clear(),this.get("eventBus").fire("renderer.unmount")),this._decision=e,this.get("eventBus").fire("import",e),this.get("eventBus").fire("renderer.mount")}catch(e){n=e}return t(n)}},{key:"_init",value:function(e){var t=e.modules,n=e.additionalModules,o=function(e,t){var n={};for(var o in e)0<=t.indexOf(o)||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}(e,["modules","additionalModules"]),r=t||this.getModules(),i=n||[],a=[{viewer:["value",this]}];return{modules:[].concat(Cw(r),Cw(i),a),config:o}}},{key:"on",value:function(e,t,n,o){return this.get("eventBus").on(e,t,n,o)}},{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",{}),Pt(e))}},{key:"destroy",value:function(){(function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0})(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"destroy",this).call(this),this.detach()}},{key:"getModules",value:function(){return o._getModules()}}],[{key:"_getModules",value:function(){return[H_,Z_,tw,uw,hw,_w]}},{key:"_createContainer",value:function(){return wt('<div class="dmn-literal-expression-container"></div>')}}]),o}(),kw="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},Sw=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();function Ow(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jw(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":kw(t))&&"function"!=typeof t?e:t}function Pw(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":kw(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var Tw=function(e){function o(e,t){Ow(this,o);var n=jw(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return n.onElementsChanged=function(){n.forceUpdate()},n.setDecisionName=function(e){n._modeling.editDecisionName(e)},n.setDecisionId=function(e){n.getDecision().id!==e&&n._modeling.editDecisionId(e)},n.validateId=function(e){return zm(n.getDecision(),e)},n._viewer=t.injector.get("viewer"),n._modeling=t.injector.get("modeling"),n.setupChangeListeners({bind:n.getDecision().id}),n}return Pw(o,Ip),Sw(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,o=this.context.changeSupport;"string"==typeof n&&o.offElementsChanged(n,this.onElementsChanged),"string"==typeof t&&o.onElementsChanged(t,this.onElementsChanged)}},{key:"render",value:function(){var e=this.getDecision(),t=e.name,n=e.id;return _l(1,"header","decision-properties",[wl(2,Rw,{className:"decision-name editor",value:t,onChange:this.setDecisionName}),wl(2,Aw,{className:"decision-id editor",value:n,validate:this.validateId,onChange:this.setDecisionId})],4)}}]),o}(),Rw=function(e){function t(){return Ow(this,t),jw(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return Pw(t,uy),Sw(t,[{key:"render",value:function(){return _l(1,"h3",this.getClassName(),this.getEditor(),0)}}]),t}(),Aw=function(e){function t(){return Ow(this,t),jw(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return Pw(t,uy),Sw(t,[{key:"render",value:function(){return _l(1,"h5",this.getClassName(),this.getEditor(),0)}}]),t}();var Dw=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",2e3,function(){return Tw})};Dw.$inject=["components"];var Mw={__depends__:[by],__init__:["decisionProperties"],decisionProperties:["type",Dw]},Bw=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Iw="is not a registered action",Nw=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()}}}return Bw(n,[{key:"trigger",value:function(e,t){if(!this._actions[e])throw Vw(e,Iw);return this._actions[e](t)}},{key:"register",value:function(e,t){var n=this;if("string"==typeof e)return this._registerAction(e,t);w(e,function(e,t){n._registerAction(t,e)})}},{key:"_registerAction",value:function(e,t){if(this.isRegistered(e))throw Vw(e,"is already registered");this._actions[e]=t}},{key:"unregister",value:function(e){if(!this.isRegistered(e))throw Vw(e,Iw);this._actions[e]=void 0}},{key:"isRegistered",value:function(e){return!!this._actions[e]}}]),n}();function Vw(e,t){return new Error(e+" "+t)}Nw.$inject=["commandStack","eventBus"];var Lw={__init__:["editorActions"],editorActions:["type",Nw]};function $w(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function Fw(e){return e.shiftKey}var Uw=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var zw=function(){function o(e,t,n){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this._init=function(){i._registerDefaultBindings(),i._fire("init")},this._destroy=function(){i._fire("destroy"),i.unbind(),i._listeners=null},this._keyHandler=function(e){var t,n,o=i._listeners,r=e.keyCode||e.charCode||-1;for(t=0;n=o[t];t++)if(n(r,e))return e.preventDefault(),void e.stopPropagation()},this.unbind=function(){var e=i._node;e&&(i._fire("unbind"),gt.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)}return Uw(o,[{key:"bind",value:function(e){this.unbind(),this._node=e,gt.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($w(t)&&!Fw(t)&&90===e)return n.trigger("undo"),!0}),e.push(function(e,t){if($w(t)&&(89===e||90===e&&Fw(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})}}]),o}();zw.$inject=["config.keyboard","eventBus","editorActions"];var Ww={__depends__:[Lw],__init__:["keyboard"],keyboard:["type",zw]},Hw="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},Gw=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var qw=[{label:"FEEL",value:"feel"},{label:"JUEL",value:"juel"},{label:"JavaScript",value:"javascript"},{label:"Groovy",value:"groovy"},{label:"Python",value:"python"},{label:"JRuby",value:"jruby"}],Kw=[{label:"string",value:"string"},{label:"boolean",value:"boolean"},{label:"integer",value:"integer"},{label:"long",value:"long"},{label:"double",value:"double"},{label:"date",value:"date"}],Xw=function(e){function i(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Hw(t))&&"function"!=typeof t?e:t}(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,e,t));n._viewer=t.injector.get("viewer"),n._modeling=t.injector.get("modeling");var o,r=n._viewer.getDecision();return n.state={name:r.variable.name,typeRef:r.variable.typeRef,expressionLanguage:(o=r.literalExpression,o&&o.expressionLanguage?o.expressionLanguage.toLowerCase():void 0)},n.setVariableName=n.setVariableName.bind(n),n.setVariableType=n.setVariableType.bind(n),n.setExpressionLanguage=n.setExpressionLanguage.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":Hw(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,Ip),Gw(i,[{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:"setExpressionLanguage",value:function(e){""===e?(this._modeling.editExpressionLanguage(void 0),this.setState({expressionLanguage:void 0})):(this._modeling.editExpressionLanguage(e),this.setState({expressionLanguage:e}))}},{key:"render",value:function(){var e=this.state,t=e.expressionLanguage,n=e.name,o=e.typeRef;return _l(1,"div","literal-expression-properties",_l(1,"table",null,[_l(1,"tr",null,[_l(1,"td",null,xl("Variable Name:"),2),_l(1,"td",null,wl(2,ov,{className:"variable-name-input",onInput:this.setVariableName,placeholder:"name",value:n||""}),2)],4),_l(1,"tr",null,[_l(1,"td",null,xl("Variable Type:"),2),_l(1,"td",null,_l(1,"div","dms-fill-row",wl(2,mv,{onChange:this.setVariableType,options:Kw,value:o,className:"variable-type-select dms-block"}),2),2)],4),_l(1,"tr",null,[_l(1,"td",null,xl("Expression Language:"),2),_l(1,"td",null,_l(1,"div","dms-fill-row",wl(2,mv,{onChange:this.setExpressionLanguage,options:qw,value:t,className:"expression-language-select dms-block"}),2),2)],4)],4),2)}}]),i}();var Zw=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 Xw})};Zw.$inject=["components"];var Yw={__depends__:[by,Ww],__init__:["literalExpressionProperties"],literalExpressionProperties:["type",Zw]},Jw=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var Qw=function(){function r(t,e,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this._commandStack=t,this._viewer=e,(this._eventBus=n).on("viewer.init",function(){var e,n;e=o.getHandlers(),n=t,w(e,function(e,t){n.registerHandler(t,e)})})}return Jw(r,[{key:"getHandlers",value:function(){return r._getHandlers()}},{key:"getDecision",value:function(){return this._viewer.getDecision()}},{key:"editDecisionName",value:function(e){var t={element:this.getDecision(),properties:{name:e}};this._commandStack.execute("updateProperties",t)}},{key:"editDecisionId",value:function(e){var t={element:this.getDecision(),properties:{id:e}};this._commandStack.execute("updateProperties",t)}},{key:"editLiteralExpressionText",value:function(e){var t={element:this.getDecision().literalExpression,properties:{text:e}};this._commandStack.execute("updateProperties",t)}},{key:"editExpressionLanguage",value:function(e){var t={element:this.getDecision().literalExpression,properties:{expressionLanguage:e}};this._commandStack.execute("updateProperties",t)}},{key:"editVariableName",value:function(e){var t={element:this.getDecision().variable,properties:{name:e}};this._commandStack.execute("updateProperties",t)}},{key:"editVariableType",value:function(e){var t={element:this.getDecision().variable,properties:{typeRef:e}};this._commandStack.execute("updateProperties",t)}}],[{key:"_getHandlers",value:function(){return{updateProperties:Zg}}}]),r}();Qw.$inject=["commandStack","viewer","eventBus"];var ex={__init__:["idChangeBehavior","modeling"],commandStack:["type",Fs],idChangeBehavior:["type",kg],modeling:["type",Qw]},tx="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},nx=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();function ox(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rx(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":tx(t))&&"function"!=typeof t?e:t}function ix(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":tx(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var ax=function(e){function r(e,t){ox(this,r);var n=rx(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));n._modeling=t.injector.get("modeling"),n._viewer=t.injector.get("viewer"),n.editLiteralExpressionText=n.editLiteralExpressionText.bind(n),n.onElementsChanged=n.onElementsChanged.bind(n);var o=n.getLiteralExpression().id;return t.changeSupport.onElementsChanged(o,n.onElementsChanged),n}return ix(r,Ip),nx(r,[{key:"getLiteralExpression",value:function(){return this._viewer.getDecision().literalExpression}},{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 wl(2,sx,{className:"textarea editor",value:e,onChange:this.editLiteralExpressionText})}}]),r}(),sx=function(e){function t(){return ox(this,t),rx(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return ix(t,uy),nx(t,[{key:"render",value:function(){return _l(1,"div",this.getClassName(),this.getEditor(),0)}}]),t}();var cx=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 ax})};cx.$inject=["components"];var ux={__depends__:[by],__init__:["textarea"],textarea:["type",cx]},lx="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},px=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();function fx(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var dx=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":lx(t))&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":lx(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,Ew),px(t,[{key:"getModules",value:function(){return[].concat(fx(Ew._getModules()),fx(t._getModules()))}}],[{key:"_getModules",value:function(){return[Mw,Ww,Yw,ex,ux]}}]),t}(),hx=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();return function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,Qt),hx(t,[{key:"_getViewProviders",value:function(){return[{id:"drd",constructor:Nu,opens:"dmn:Definitions"},{id:"decisionTable",constructor:T_,opens:function(e){return Ht(e,"dmn:Decision")&&e.decisionTable}},{id:"literalExpression",constructor:dx,opens:function(e){return Ht(e,"dmn:Decision")&&e.literalExpression}}]}},{key:"_getInitialView",value:function(e){for(var t,n=0;n<e.length;n++){var o=e[n],r=o.element;if(Ht(r,"dmn:Decision"))return o;if(Ht(r,"dmn:Definitions")&&(t=o,bs(r)))return o}return t||e[0]}}]),t}()}); 52