1/*! dmn-js - dmn-viewer v14.1.2 | 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="undefined"!=typeof globalThis?globalThis:e||self).DmnJS=t()}(this,(function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e){return n="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(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g(r.key),r)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function c(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return p(e)}function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f(this,n)}}function h(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=l(e)););return e}function m(){return m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=h(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},m.apply(this,arguments)}function v(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var b=Object.prototype.toString,w=Object.prototype.hasOwnProperty;function _(e){return void 0!==e}function x(e){return"[object Array]"===b.call(e)}function k(e){return"[object Object]"===b.call(e)}function E(e){return"[object Number]"===b.call(e)}function C(e){var t=b.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t||"[object Proxy]"===t}function O(e){return"[object String]"===b.call(e)}function S(e,t){return w.call(e,t)}function j(e,t){var n;return t=function(e){return C(e)?e:function(t){return t===e}}(t),M(e,(function(e,r){if(t(e,r))return n=e,!1})),n}function N(e,t){var n=[];return M(e,(function(e,r){t(e,r)&&n.push(e)})),n}function M(e,t){var n;if(void 0!==e){var r=x(e)?B:A;for(var i in e)if(S(e,i)&&!1===t(n=e[i],r(i)))return n}}function D(e,t,n){return M(e,(function(e,r){n=t(n,e,r)})),n}function P(e,t){return!!D(e,(function(e,n,r){return e&&t(n,r)}),!0)}function R(e){return function(t){return P(e,(function(e,n){return t[n]===e}))}}function A(e){return e}function B(e){return Number(e)}function I(e,t){var n,r,i,o;function a(n){var a=Date.now(),u=n?0:o+t-a;if(u>0)return s(u);e.apply(i,r),l()}function s(e){n=setTimeout(a,e)}function l(){n&&clearTimeout(n),n=o=r=i=void 0}function u(){o=Date.now();for(var e=arguments.length,a=new Array(e),l=0;l<e;l++)a[l]=arguments[l];r=a,i=this,n||s(t)}return u.flush=function(){n&&a(!0),l()},u.cancel=l,u}function T(e,t){var n=!1;return function(){n||(e.apply(void 0,arguments),n=!0,setTimeout((function(){n=!1}),t))}}function L(e,t){return e.bind(t)}function $(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Object.assign.apply(Object,[e].concat(n))}var V="__fn",z=Array.prototype.slice;function U(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function F(){}U.prototype.on=function(e,t,n,r){if(e=x(e)?e:[e],C(t)&&(r=n,n=t,t=1e3),!E(t))throw new Error("priority must be a number");var i=n;r&&((i=L(n,r))[V]=n[V]||n);var o=this;e.forEach((function(e){o._addListener(e,{priority:t,callback:i,next:null})}))},U.prototype.once=function(e,t,n,r){var i=this;if(C(t)&&(r=n,n=t,t=1e3),!E(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var t=n.apply(r,arguments);return i.off(e,o),t}o[V]=n,this.on(e,t,o)},U.prototype.off=function(e,t){e=x(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},U.prototype.createEvent=function(e){var t=new F;return t.init(e),t},U.prototype.fire=function(e,t){var r,i,o,a;if(a=z.call(arguments),"object"===n(e)&&(e=(t=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){r=t instanceof F?t:this.createEvent(t),a[0]=r;var s=r.type;e!==s&&(r.type=e);try{o=this._invokeListeners(r,a,i)}finally{e!==s&&(r.type=s)}return void 0===o&&r.defaultPrevented&&(o=!1),o}},U.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},U.prototype._destroy=function(){this._listeners={}},U.prototype._invokeListeners=function(e,t,n){for(var r;n&&!e.cancelBubble;)r=this._invokeListener(e,t,n),n=n.next;return r},U.prototype._invokeListener=function(e,t,n){var r;if(n.callback.__isTomb)return r;try{r=function(e,t){return e.apply(null,t)}(n.callback,t),void 0!==r&&(e.returnValue=r,e.stopPropagation()),!1===r&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener",e),e}return r},U.prototype._addListener=function(e,t){var n,r=this._getListeners(e);if(r){for(;r;){if(r.priority<t.priority)return t.next=r,void(n?n.next=t:this._setListeners(e,t));n=r,r=r.next}n.next=t}else this._setListeners(e,t)},U.prototype._getListeners=function(e){return this._listeners[e]},U.prototype._setListeners=function(e,t){this._listeners[e]=t},U.prototype._removeListener=function(e,t){var n,r,i,o=this._getListeners(e);if(t)for(;o;)n=o.next,(i=o.callback)!==t&&i[V]!==t||(r?r.next=n:this._setListeners(e,n)),r=o,o=n;else this._setListeners(e,null)},F.prototype.stopPropagation=function(){this.cancelBubble=!0},F.prototype.preventDefault=function(){this.defaultPrevented=!0},F.prototype.init=function(e){$(this,e||{})};var G=Object.prototype.toString;function q(){return q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},q.apply(this,arguments)}function W(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return q.apply(void 0,[e].concat(n))}var H=Object.prototype.toString,K=Object.prototype.hasOwnProperty;function X(e){return"[object String]"===H.call(e)}function Y(e,t){return K.call(e,t)}function Q(e,t){var n;if(void 0!==e){var r=function(e){return"[object Array]"===H.call(e)}(e)?J:Z;for(var i in e)if(Y(e,i)&&!1===t(n=e[i],r(i)))return n}}function Z(e){return e}function J(e){return Number(e)}function ee(e,t){return e.bind(t)}function te(){return te=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},te.apply(this,arguments)}function ne(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return te.apply(void 0,[e].concat(n))}function re(){}function ie(e,t){this.model=e,this.properties=t}re.prototype.get=function(e){return this.$model.properties.get(this,e)},re.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},ie.prototype.createType=function(e){var t=this.model,n=this.properties,r=Object.create(re.prototype);Q(e.properties,(function(e){e.isMany||void 0===e.default||(r[e.name]=e.default)})),n.defineModel(r,t),n.defineDescriptor(r,e);var i=e.ns.name;function o(e){n.define(this,"$type",{value:i,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),Q(e,ee((function(e,t){this.set(t,e)}),this))}return o.prototype=r,o.hasType=r.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var oe={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},ae={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function se(e,t){var n=ae[e];return n?n(t):t}function le(e){return!!oe[e]}function ue(e){return!!ae[e]}function ce(e,t){var n,r,i=e.split(/:/);if(1===i.length)n=e,r=t;else{if(2!==i.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=i[1],r=i[0]}return{name:e=(r?r+":":"")+n,prefix:r,localName:n}}function pe(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function fe(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,Q(e,ee(this.registerPackage,this))}function de(e,t,n){var r=t[n];if(r in e)throw new Error("package with "+n+" <"+r+"> already defined")}function he(e){this.model=e}function me(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function ve(e){this.properties=new he(this),this.factory=new ie(this,this.properties),this.registry=new fe(e,this.properties),this.typeCache={}}pe.prototype.build=function(){return e=this,t=["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"],n={},r=Object(e),Q(t,(function(t){t in r&&(n[t]=e[t])})),n;var e,t,n,r},pe.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var r=this.properties;void 0!==t?r.splice(t,0,e):r.push(e)},pe.prototype.replaceProperty=function(e,t,n){var r=e.ns,i=this.properties,o=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=i.indexOf(e);if(-1===s)throw new Error("property <"+r.name+"> not found in property list");i.splice(s,1),this.addProperty(t,n?void 0:s,a),o[r.name]=o[r.localName]=t},pe.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,i=t.split("#"),o=ce(i[0],r),a=ce(i[1],o.prefix).name,s=this.propertiesByName[a];if(!s)throw new Error("refined property <"+a+"> not found");this.replaceProperty(s,e,n),delete e.redefines},pe.prototype.addNamedProperty=function(e,t){var n=e.ns,r=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),r[n.name]=r[n.localName]=e},pe.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},pe.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},pe.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},pe.prototype.assertNotDefined=function(e,t){var n=e.name,r=this.propertiesByName[n];if(r)throw new Error("property <"+n+"> already defined; override of <"+r.definedBy.ns.name+"#"+r.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},pe.prototype.hasProperty=function(e){return this.propertiesByName[e]},pe.prototype.addTrait=function(e,t){var n=this.allTypesByName,r=this.allTypes,i=e.name;i in n||(Q(e.properties,ee((function(n){n=ne({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var r=n.replaces,i=n.redefines;r||i?this.redefineProperty(n,r||i,r):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))}),this)),r.push(e),n[i]=e)},fe.prototype.getPackage=function(e){return this.packageMap[e]},fe.prototype.getPackages=function(){return this.packages},fe.prototype.registerPackage=function(e){e=ne({},e);var t=this.packageMap;de(t,e,"prefix"),de(t,e,"uri"),Q(e.types,ee((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},fe.prototype.registerType=function(e,t){var n=ce((e=ne({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:ne(e.meta||{})})).name,t.prefix),r=n.name,i={};Q(e.properties,ee((function(e){var t=ce(e.name,n.prefix),r=t.name;le(e.type)||(e.type=ce(e.type,t.prefix).name),ne(e,{ns:t,name:r}),i[r]=e}),this)),ne(e,{ns:n,name:r,propertiesByName:i}),Q(e.extends,ee((function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(r)}),this)),this.definePackage(e,t),this.typeMap[r]=e},fe.prototype.mapTypes=function(e,t,n){var r=le(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(e){return a(e,!0)}function a(n,r){var o=ce(n,le(n)?"":e.prefix);i.mapTypes(o,t,r)}if(!r)throw new Error("unknown type <"+e.name+">");Q(r.superClass,n?o:a),t(r,!n),Q(r.traits,o)},fe.prototype.getEffectiveDescriptor=function(e){var t=ce(e),n=new pe(t);this.mapTypes(t,(function(e,t){n.addTrait(e,t)}));var r=n.build();return this.definePackage(r,r.allTypes[r.allTypes.length-1].$pkg),r},fe.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},he.prototype.set=function(e,t,n){if(!X(t)||!t.length)throw new TypeError("property name must be a non-empty string");var r=this.model.getPropertyDescriptor(e,t),i=r&&r.name;void 0===n?r?delete e[i]:delete e.$attrs[t]:r?i in e?e[i]=n:me(e,r,n):e.$attrs[t]=n},he.prototype.get=function(e,t){var n=this.model.getPropertyDescriptor(e,t);if(!n)return e.$attrs[t];var r=n.name;return!e[r]&&n.isMany&&me(e,n,[]),e[r]},he.prototype.define=function(e,t,n){if(!n.writable){var r=n.value;delete(n=ne({},n,{get:function(){return r}})).value}Object.defineProperty(e,t,n)},he.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},he.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},ve.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},ve.prototype.getType=function(e){var t=this.typeCache,n=X(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r},ve.prototype.createAny=function(e,t,n){var r=ce(e),i={$type:e,$instanceOf:function(e){return e===this.$type}},o={name:e,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:t}};return this.properties.defineDescriptor(i,o),this.properties.defineModel(i,this),this.properties.define(i,"$parent",{enumerable:!1,writable:!0}),this.properties.define(i,"$instanceOf",{enumerable:!1,writable:!0}),Q(n,(function(e,t){var n;n=e,"[object Object]"===H.call(n)&&void 0!==e.value?i[e.name]=e.value:i[t]=e})),i},ve.prototype.getPackage=function(e){return this.registry.getPackage(e)},ve.prototype.getPackages=function(){return this.registry.getPackages()},ve.prototype.getElementDescriptor=function(e){return e.$descriptor},ve.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},ve.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},ve.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var ye=Object.prototype.toString,ge=Object.prototype.hasOwnProperty;function be(e){return"[object Array]"===ye.call(e)}function we(e){return"[object String]"===ye.call(e)}function _e(e,t){return ge.call(e,t)}function xe(e,t){var n;return t=Ce(t),Ee(e,(function(e,r){if(t(e,r))return n=e,!1})),n}function ke(e,t){var n=[];return Ee(e,(function(e,r){t(e,r)&&n.push(e)})),n}function Ee(e,t){var n;if(void 0!==e){var r=be(e)?Se:Oe;for(var i in e)if(_e(e,i)&&!1===t(n=e[i],r(i)))return n}}function Ce(e){return t=e,"[object Function]"===(n=ye.call(t))||"[object AsyncFunction]"===n||"[object GeneratorFunction]"===n||"[object AsyncGeneratorFunction]"===n||"[object Proxy]"===n?e:function(t){return t===e};var t,n}function Oe(e){return e}function Se(e){return Number(e)}function je(){return je=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},je.apply(this,arguments)}function Ne(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return je.apply(void 0,[e].concat(n))}var Me=String.fromCharCode,De=Object.prototype.hasOwnProperty,Pe=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,Re={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function Ae(e,t,n,r){return r?De.call(Re,r)?Re[r]:"&"+r+";":Me(t||parseInt(n,16))}function Be(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(Pe,Ae):e}Object.keys(Re).forEach((function(e){Re[e.toUpperCase()]=Re[e]}));var Ie="xsi:type",Te="non-whitespace outside of root node";function Le(e){return new Error(e)}function $e(e){return"missing namespace for prefix <"+e+">"}function Ve(e){return{get:e,enumerable:!0}}function ze(e){var t,n={};for(t in e)n[t]=e[t];return n}function Ue(e){return e+"$uri"}function Fe(){return{line:0,column:0}}function Ge(e){throw e}function qe(e){if(!this)return new qe(e);var t,r,i,o,a,s,l,u,c,p=e&&e.proxy,f=Ge,d=Fe,h=!1,m=!1,v=null,y=!1;function g(e){e instanceof Error||(e=Le(e)),v=e,f(e,d)}function b(e){a&&(e instanceof Error||(e=Le(e)),a(e,d))}this.on=function(e,n){if("function"!=typeof n)throw Le("required args <name, cb>");switch(e){case"openTag":r=n;break;case"text":t=n;break;case"closeTag":i=n;break;case"error":f=n;break;case"warn":a=n;break;case"cdata":o=n;break;case"attention":u=n;break;case"question":l=n;break;case"comment":s=n;break;default:throw Le("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!==n(e))throw Le("required args <nsMap={}>");var t,r={};for(t in e)r[t]=e[t];return r["http://www.w3.org/2001/XMLSchema-instance"]="xsi",m=!0,c=r,this},this.parse=function(e){if("string"!=typeof e)throw Le("required args <xml=string>");return v=null,function(e){var n,a,f,v,w,_,x,k,E,C,O,S=m?[]:null,j=m?function(e){var t,n,r={};for(t in e)r[n=e[t]]=n,r[Ue(n)]=t;return r}(c):null,N=[],M=0,D=!1,P=!1,R=0,A=0,B="",I=0;function T(){if(null!==O)return O;var e,t,n,r,i,o,a,s,l,u,p,f=m&&j.xmlns,d=m&&h?[]:null,v=I,y=B,g=y.length,w={},_={};e:for(;v<g;v++)if(l=!1,!(32===(u=y.charCodeAt(v))||u<14&&u>8)){for((u<65||u>122||u>90&&u<97)&&95!==u&&58!==u&&(b("illegal first char attribute name"),l=!0),p=v+1;p<g;p++)if(!((u=y.charCodeAt(p))>96&&u<123||u>64&&u<91||u>47&&u<59||46===u||45===u||95===u)){if(32===u||u<14&&u>8){b("missing attribute value"),v=p;continue e}if(61===u)break;b("illegal attribute name char"),l=!0}if("xmlns:xmlns"===(s=y.substring(v,p))&&(b("illegal declaration of xmlns"),l=!0),34===(u=y.charCodeAt(p+1)))-1===(p=y.indexOf('"',v=p+2))&&-1!==(p=y.indexOf("'",v))&&(b("attribute value quote missmatch"),l=!0);else if(39===u)-1===(p=y.indexOf("'",v=p+2))&&-1!==(p=y.indexOf('"',v))&&(b("attribute value quote missmatch"),l=!0);else for(b("missing attribute value quotes"),l=!0,p+=1;p<g&&!(32===(u=y.charCodeAt(p+1))||u<14&&u>8);p++);for(-1===p&&(b("missing closing quotes"),p=g,l=!0),l||(o=y.substring(v,p)),v=p;p+1<g&&!(32===(u=y.charCodeAt(p+1))||u<14&&u>8);p++)v===p&&(b("illegal character after attribute end"),l=!0);if(v=p+1,!l)if(s in _)b("attribute <"+s+"> already defined");else if(_[s]=!0,m)if(h){if(null!==(i="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null)){if(e=Be(o),t=Ue(i),!(a=c[e])){if("xmlns"===i||t in j&&j[t]!==e)do{a="ns"+M++}while(void 0!==j[a]);else a=i;c[e]=a}j[i]!==a&&(r||(j=ze(j),r=!0),j[i]=a,"xmlns"===i&&(j[Ue(a)]=e,f=a),j[t]=e),w[s]=o;continue}d.push(s,o)}else-1!==(u=s.indexOf(":"))?(n=j[s.substring(0,u)])?((s=f===n?s.substr(u+1):n+s.substr(u))===Ie&&(-1!==(u=o.indexOf(":"))?(n=o.substring(0,u),o=(n=j[n]||n)+o.substring(u)):o=f+":"+o),w[s]=o):b($e(s.substring(0,u))):w[s]=o;else w[s]=o}if(h)for(v=0,g=d.length;v<g;v++){if(s=d[v++],o=d[v],-1!==(u=s.indexOf(":"))){if(!(n=j[s.substring(0,u)])){b($e(s.substring(0,u)));continue}(s=f===n?s.substr(u+1):n+s.substr(u))===Ie&&(-1!==(u=o.indexOf(":"))?(n=o.substring(0,u),o=(n=j[n]||n)+o.substring(u)):o=f+":"+o)}w[s]=o}return O=w}function L(){for(var t,n,r=/(\r\n|\r|\n)/g,i=0,o=0,a=0,s=A;R>=a&&(t=r.exec(e))&&!((s=t[0].length+t.index)>R);)i+=1,a=s;return-1==R?(o=s,n=e.substring(A)):0===A?n=e.substring(A,R):(o=R-a,n=-1==A?e.substring(R):e.substring(R,A+1)),{data:n,line:i,column:o}}d=L,p&&(C=Object.create({},{name:Ve((function(){return k})),originalName:Ve((function(){return E})),attrs:Ve(T),ns:Ve((function(){return j}))}));for(;-1!==A;){if(-1===(R=60===e.charCodeAt(A)?A:e.indexOf("<",A)))return N.length?g("unexpected end of file"):0===A?g("missing start tag"):void(A<e.length&&e.substring(A).trim()&&b(Te));if(A!==R)if(N.length){if(t&&(t(e.substring(A,R),Be,d),y))return}else if(e.substring(A,R).trim()&&(b(Te),y))return;if(33===(w=e.charCodeAt(R+1))){if(91===(v=e.charCodeAt(R+2))&&"CDATA["===e.substr(R+3,6)){if(-1===(A=e.indexOf("]]>",R)))return g("unclosed cdata");if(o&&(o(e.substring(R+9,A),d),y))return;A+=3;continue}if(45===v&&45===e.charCodeAt(R+3)){if(-1===(A=e.indexOf("--\x3e",R)))return g("unclosed comment");if(s&&(s(e.substring(R+4,A),Be,d),y))return;A+=3;continue}}if(63!==w){for(a=R+1;;a++){if(_=e.charCodeAt(a),isNaN(_))return A=-1,g("unclosed tag");if(34===_)a=-1!==(v=e.indexOf('"',a+1))?v:a;else if(39===_)a=-1!==(v=e.indexOf("'",a+1))?v:a;else if(62===_){A=a;break}}if(33!==w){if(O={},47===w){if(D=!1,P=!0,!N.length)return g("missing open tag");if(a=k=N.pop(),v=R+2+a.length,e.substring(R+2,v)!==a)return g("closing tag mismatch");for(;v<A;v++)if(!(32===(w=e.charCodeAt(v))||w>8&&w<14))return g("close tag")}else{if(47===e.charCodeAt(A-1)?(a=k=e.substring(R+1,A-1),D=!0,P=!0):(a=k=e.substring(R+1,A),D=!0,P=!1),!(w>96&&w<123||w>64&&w<91||95===w||58===w))return g("illegal first char nodeName");for(v=1,f=a.length;v<f;v++)if(!((w=a.charCodeAt(v))>96&&w<123||w>64&&w<91||w>47&&w<59||45===w||95===w||46==w)){if(32===w||w<14&&w>8){k=a.substring(0,v),O=null;break}return g("invalid nodeName")}P||N.push(k)}if(m){if(n=j,D&&(P||S.push(n),null===O&&(h=-1!==a.indexOf("xmlns",v))&&(I=v,B=a,T(),h=!1)),E=k,-1!==(w=k.indexOf(":"))){if(!(x=j[k.substring(0,w)]))return g("missing namespace on <"+E+">");k=k.substr(w+1)}else x=j.xmlns;x&&(k=x+":"+k)}if(D&&(I=v,B=a,r&&(p?r(C,Be,P,d):r(k,T,Be,P,d),y)))return;if(P){if(i&&(i(p?C:k,Be,D,d),y))return;m&&(j=D?n:S.pop())}A+=1}else{if(u&&(u(e.substring(R,A+1),Be,d),y))return;A+=1}}else{if(-1===(A=e.indexOf("?>",R)))return g("unclosed question");if(l&&(l(e.substring(R,A+2),d),y))return;A+=2}}}(e),d=Fe,y=!1,v},this.stop=function(){y=!0}}function We(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var He={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},Ke="xsi:type";function Xe(e){return e.xml&&e.xml.serialize}function Ye(e){return Xe(e)===Ke}function Qe(e,t){return We(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function Ze(e){return new Error(e)}function Je(e){return e.$descriptor}function et(e){Ne(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw Ze("expected element");var t,n=this.elementsById,r=Je(e).idProperty;if(r&&(t=e.get(r.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw Ze("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function tt(){}function nt(){}function rt(){}function it(e,t){this.property=e,this.context=t}function ot(e,t){this.element=t,this.propertyDesc=e}function at(){}function st(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function lt(e,t,n){st.call(this,e,t,n)}function ut(e,t,n){this.model=e,this.context=n}function ct(e){e instanceof ve&&(e={model:e}),Ne(this,{lax:!1},e)}tt.prototype.handleEnd=function(){},tt.prototype.handleText=function(){},tt.prototype.handleNode=function(){},nt.prototype=Object.create(tt.prototype),nt.prototype.handleNode=function(){return this},rt.prototype=Object.create(tt.prototype),rt.prototype.handleText=function(e){this.body=(this.body||"")+e},it.prototype=Object.create(rt.prototype),it.prototype.handleNode=function(e){if(this.element)throw Ze("expected no sub nodes");return this.element=this.createReference(e),this},it.prototype.handleEnd=function(){this.element.id=this.body},it.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},ot.prototype=Object.create(rt.prototype),ot.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=se(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},at.prototype=Object.create(rt.prototype),at.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},st.prototype=Object.create(at.prototype),st.prototype.addReference=function(e){this.context.addReference(e)},st.prototype.handleText=function(e){if(!Je(this.element).bodyProperty)throw Ze("unexpected body text <"+e+">");rt.prototype.handleText.call(this,e)},st.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Je(t).bodyProperty;n&&void 0!==e&&(e=se(n.type,e),t.set(n.name,e))},st.prototype.createElement=function(e){var t,n=e.attributes,r=this.type,i=Je(r),o=this.context,a=new r({}),s=this.model;return Ee(n,(function(e,n){var r=i.propertiesByName[n];r&&r.isReference?r.isMany?Ee(e.split(" "),(function(e){o.addReference({element:a,property:r.ns.name,id:e})})):o.addReference({element:a,property:r.ns.name,id:e}):(r?e=se(r.type,e):"xmlns"!==n&&(t=ce(n,i.ns.prefix),s.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:a,property:n,value:e})),a.set(n,e))})),a},st.prototype.getPropertyForNode=function(e){var t,n,r=ce(e.name),i=this.type,o=this.model,a=Je(i),s=r.name,l=a.propertiesByName[s];if(l&&!l.isAttr)return Ye(l)&&(t=e.attributes[Ke])?(t=function(e,t){var n=ce(e);return function(e,t){var n=e.name,r=e.localName,i=t.xml&&t.xml.typePrefix;return i&&0===r.indexOf(i)?e.prefix+":"+r.slice(i.length):n}(n,t.getPackage(n.prefix))}(t,o),Ne({},l,{effectiveType:Je(n=o.getType(t)).name})):l;var u=o.getPackage(r.prefix);if(u){if(t=Qe(r,u),n=o.getType(t),l=xe(a.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})))return Ne({},l,{effectiveType:Je(n).name})}else if(l=xe(a.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})))return l;throw Ze("unrecognized element <"+r.name+">")},st.prototype.toString=function(){return"ElementDescriptor["+Je(this.type).name+"]"},st.prototype.valueHandler=function(e,t){return new ot(e,t)},st.prototype.referenceHandler=function(e){return new it(e,this.context)},st.prototype.handler=function(e){return"Element"===e?new ut(this.model,e,this.context):new st(this.model,e,this.context)},st.prototype.handleChild=function(e){var t,n,r,i;if(t=this.getPropertyForNode(e),r=this.element,ue(n=t.effectiveType||t.type))return this.valueHandler(t,r);var o=(i=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==o&&(t.isMany?r.get(t.name).push(o):r.set(t.name,o),t.isReference?(Ne(o,{element:r}),this.context.addReference(o)):o.$parent=r),i},lt.prototype=Object.create(st.prototype),lt.prototype.createElement=function(e){var t=e.name,n=ce(t),r=this.model,i=this.type,o=r.getPackage(n.prefix),a=o&&Qe(n,o)||t;if(!i.hasType(a))throw Ze("unexpected element <"+e.originalName+">");return st.prototype.createElement.call(this,e)},ut.prototype=Object.create(at.prototype),ut.prototype.createElement=function(e){var t=e.name,n=ce(t).prefix,r=e.ns[n+"$uri"],i=e.attributes;return this.model.createAny(t,r,i)},ut.prototype.handleChild=function(e){var t=new ut(this.model,"Element",this.context).handleNode(e),n=this.element,r=t.element;return void 0!==r&&((n.$children=n.$children||[]).push(r),r.$parent=n),t},ut.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},ct.prototype.fromXML=function(e,t,n){var r=t.rootHandler;t instanceof st?(r=t,t={}):"string"==typeof t?(r=this.handler(t),t={}):"string"==typeof r&&(r=this.handler(r));var i=this.model,o=this.lax,a=new et(Ne({},t,{rootHandler:r})),s=new qe({proxy:!0}),l=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function u(e,t,n){var r=t(),i=r.line,o=r.column,s=r.data;"<"===s.charAt(0)&&-1!==s.indexOf(" ")&&(s=s.slice(0,s.indexOf(" "))+">");var l="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+i+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return a.addWarning({message:l,error:e}),!0;throw Ze(l)}function c(e,t){return u(e,t,!0)}r.context=a,l.push(r);var p=/^<\?xml /i,f=/ encoding="([^"]+)"/i,d=/^utf-8$/i;function h(e,t){try{l.peek().handleText(e)}catch(e){c(e,t)}}var m=i.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),{"http://www.w3.org/XML/1998/namespace":"xml"});return s.ns(m).on("openTag",(function(e,t,n,r){var i=e.attrs||{},a=Object.keys(i).reduce((function(e,n){var r=t(i[n]);return e[n]=r,e}),{});!function(e,t){var n=l.peek();try{l.push(n.handleNode(e))}catch(e){u(e,t,o)&&l.push(new nt)}}({name:e.name,originalName:e.originalName,attributes:a,ns:e.ns},r)})).on("question",(function(e){if(p.test(e)){var t=f.exec(e),n=t&&t[1];n&&!d.test(n)&&a.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){l.pop().handleEnd()})).on("cdata",h).on("text",(function(e,t,n){!function(e,t){e.trim()&&h(e,t)}(t(e),n)})).on("error",u).on("warn",c),new Promise((function(t,n){var i;try{s.parse(e),function(){var e,t,n=a.elementsById,r=a.references;for(e=0;t=r[e];e++){var i=t.element,o=n[t.id],s=Je(i).propertiesByName[t.property];if(o||a.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),s.isMany){var l=i.get(s.name),u=l.indexOf(t);-1===u&&(u=l.length),o?l[u]=o:l.splice(u,1)}else i.set(s.name,o)}}()}catch(e){i=e}var o=r.element;i||o||(i=Ze("failed to parse document as <"+r.type.$descriptor.name+">"));var l=a.warnings,u=a.references,c=a.elementsById;return i?(i.warnings=l,n(i)):t({rootElement:o,elementsById:c,references:u,warnings:l})}))},ct.prototype.handler=function(e){return new lt(this.model,e)};var pt=/<|>|'|"|&|\n\r|\n/g,ft=/<|>|&/g;function dt(e){var t={},n={},r={},i=[],o=[];this.byUri=function(t){return n[t]||e&&e.byUri(t)},this.add=function(e,t){n[e.uri]=e,t?i.push(e):o.push(e),this.mapPrefix(e.prefix,e.uri)},this.uriByPrefix=function(e){return t[e||"xmlns"]},this.mapPrefix=function(e,n){t[e||"xmlns"]=n},this.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},this.logUsed=function(t){var n=t.uri,i=this.getNSKey(t);r[i]=this.byUri(n),e&&e.logUsed(t)},this.getUsed=function(e){var t=this;return[].concat(i,o).filter((function(e){var n=t.getNSKey(e);return r[n]}))}}function ht(e,t){return We(t)?(n=e).charAt(0).toLowerCase()+n.slice(1):e;var n}function mt(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function vt(e){return we(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var yt={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},gt={"<":"lt",">":"gt","&":"amp"};function bt(e,t,n){return(e=we(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function wt(e){this.tagName=e}function _t(){}function xt(e){this.tagName=e}function kt(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Et(e,t){kt.call(this,e,t)}function Ct(){this.value="",this.write=function(e){this.value+=e}}function Ot(e,t){var n=[""];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write("\n"),this},this.appendIndent=function(){return t&&e.write(n.join("  ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function St(e){return e=Ne({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var r=n||new Ct,i=new Ot(r,e.format);if(e.preamble&&i.append('<?xml version="1.0" encoding="UTF-8"?>\n'),(new kt).build(t).serializeTo(i),!n)return r.value}}}function jt(e,t){ve.call(this,e,t)}wt.prototype.build=function(e){return this.element=e,this},wt.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},_t.prototype.serializeValue=_t.prototype.serializeTo=function(e){e.append(this.escape?bt(this.value,ft,gt):this.value)},_t.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(ft)&&(this.escape=!0),this},mt(xt,_t),xt.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},kt.prototype.build=function(e){this.element=e;var t,n,r=e.$descriptor,i=this.propertyDescriptor,o=r.isGeneric;return t=o?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=i?this.nsPropertyTagName(i):this.nsTagName(r),this.tagName=this.addTagName(this.ns),o||(n=function(e){return ke(e.$descriptor.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!_e(e,n))return!1;var r=e[n];return r!==t.default&&null!==r&&(!t.isMany||r.length)}))}(e),this.parseAttributes(ke(n,(function(e){return e.isAttr}))),this.parseContainments(function(e){return ke(e,(function(e){return!e.isAttr}))}(n))),this.parseGenericAttributes(e,t),this},kt.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?Ne({localName:t.ns.localName},e):Ne({localName:ht(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},kt.prototype.nsPropertyTagName=function(e){return function(e,t){return Ne({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},kt.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},kt.prototype.nsAttributeName=function(e){var t;if(t=we(e)?ce(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}:Ne({localName:t.localName},n)},kt.prototype.parseGeneric=function(e){var t=this,n=this.body,r=[];return Ee(e,(function(i,o){"$body"===o?n.push((new _t).build({type:"String"},i)):"$children"===o?Ee(i,(function(e){n.push(new kt(t).build(e))})):0!==o.indexOf("$")&&t.parseNsAttribute(e,o,i)&&r.push({name:o,value:i})})),r},kt.prototype.parseNsAttribute=function(e,t,n){var r,i=e.$model,o=ce(t);if("xmlns"===o.prefix&&(r={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(r={uri:n}),!r)return{name:t,value:n};if(i&&i.getPackage(n))this.logNamespace(r,!0,!0);else{var a=this.logNamespaceUsed(r,!0);this.getNamespaces().logUsed(a)}},kt.prototype.parseNsAttributes=function(e,t){var n=this,r=e.$attrs,i=[];return Ee(r,(function(t,r){var o=n.parseNsAttribute(e,r,t);o&&i.push(o)})),i},kt.prototype.parseGenericAttributes=function(e,t){var n=this;Ee(t,(function(t){if(t.name!==Ke)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}}))},kt.prototype.parseContainments=function(e){var t=this,n=this.body,r=this.element;Ee(e,(function(e){var i=r.get(e.name),o=e.isReference;if(e.isMany||(i=[i]),e.isBody)n.push((new _t).build(e,i[0]));else if(ue(e.type))Ee(i,(function(r){n.push(new xt(t.addTagName(t.nsPropertyTagName(e))).build(e,r))}));else if(o)Ee(i,(function(r){n.push(new wt(t.addTagName(t.nsPropertyTagName(e))).build(r))}));else{var a=Ye(e),s=function(e){return"property"===Xe(e)}(e);Ee(i,(function(r){var i;i=a?new Et(t,e):s?new kt(t,e):new kt(t),n.push(i.build(r))}))}}))},kt.prototype.getNamespaces=function(e){var t,n=this.namespaces,r=this.parent;return n||(t=r&&r.getNamespaces(),e||!t?this.namespaces=n=new dt(t):n=t),n},kt.prototype.logNamespace=function(e,t,n){var r=this.getNamespaces(n),i=e.uri,o=e.prefix;return r.byUri(i)&&!n||r.add(e,t),r.mapPrefix(o,i),e},kt.prototype.logNamespaceUsed=function(e,t){var n,r,i,o=this.element.$model,a=this.getNamespaces(t),s=e.prefix,l=e.uri;if(!s&&!l)return{localName:e.localName};if(i=He[s]||o&&(o.getPackage(s)||{}).uri,!(l=l||i||a.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if(!(e=a.byUri(l))){for(n=s,r=1;a.uriByPrefix(n);)n=s+"_"+r++;e=this.logNamespace({prefix:n,uri:l},i===l)}return s&&a.mapPrefix(s,l),e},kt.prototype.parseAttributes=function(e){var t=this,n=this.element;Ee(e,(function(e){var r=n.get(e.name);if(e.isReference)if(e.isMany){var i=[];Ee(r,(function(e){i.push(e.id)})),r=i.join(" ")}else r=r.id;t.addAttribute(t.nsAttributeName(e),r)}))},kt.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),vt(e)},kt.prototype.addAttribute=function(e,t){var n=this.attrs;we(t)&&(t=bt(t,pt,yt));var r=function(e,t){t=Ce(t);var n=be(e)?-1:void 0;return Ee(e,(function(e,r){if(t(e,r))return n=r,!1})),n}(n,(function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix})),i={name:e,value:t};-1!==r?n.splice(r,1,i):n.push(i)},kt.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(e){return e.getUsed().filter((function(e){return"xml"!==e.prefix})).map((function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}}))}(n).concat(t)),Ee(t,(function(t){e.append(" ").append(vt(t.name)).append('="').append(t.value).append('"')}))},kt.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==_t;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),Ee(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},mt(Et,kt),Et.prototype.parseNsAttributes=function(e){var t=kt.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var r=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var i=e.$model.getPackage(r.uri),o=i.xml&&i.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(Ke),(r.prefix?r.prefix+":":"")+o+n.ns.localName),t},Et.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},jt.prototype=Object.create(ve.prototype),jt.prototype.fromXML=function(e,t,n){var r;r=t,"[object String]"!==G.call(r)&&(n=t,t="dmn:Definitions");var i=new ct(W({model:this,lax:!0},n)),o=i.handler(t);return i.fromXML(e,o)},jt.prototype.toXML=function(e,t){var n=new St(t);return new Promise((function(t,r){try{return t({xml:n.toXML(e)})}catch(e){return r(e)}}))};var Nt={dc:{name:"DC",prefix:"dc",uri:"http://www.omg.org/spec/DMN/20180521/DC/",types:[{name:"Dimension",properties:[{name:"width",isAttr:!0,type:"Real"},{name:"height",isAttr:!0,type:"Real"}]},{name:"Bounds",properties:[{name:"height",isAttr:!0,type:"Real"},{name:"width",isAttr:!0,type:"Real"},{name:"x",isAttr:!0,type:"Real"},{name:"y",isAttr:!0,type:"Real"}]},{name:"Point",properties:[{name:"x",isAttr:!0,type:"Real"},{name:"y",isAttr:!0,type:"Real"}]},{name:"Color",properties:[{name:"red",type:"UML_Standard_Profile.mdzip:eee_1045467100323_917313_65"},{name:"green",type:"UML_Standard_Profile.mdzip:eee_1045467100323_917313_65"},{name:"blue",type:"UML_Standard_Profile.mdzip:eee_1045467100323_917313_65"}]}],associations:[],enumerations:[{name:"AlignmentKind",literalValues:[{name:"start"},{name:"center"},{name:"end"}]}]},di:{name:"DI",prefix:"di",uri:"http://www.omg.org/spec/DMN/20180521/DI/",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"extension",type:"Extension"},{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"style",isReference:!0,type:"Style",xml:{serialize:"property"}},{name:"sharedStyle",isReference:!0,isVirtual:!0,type:"Style"}]},{name:"Diagram",superClass:["DiagramElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"}]},{name:"Shape",isAbstract:!0,properties:[{name:"bounds",type:"dc:Bounds"}],superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,properties:[{name:"waypoint",type:"dc:Point",isMany:!0,xml:{serialize:"property"}}],superClass:["DiagramElement"]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],associations:[],enumerations:[],xml:{tagAlias:"lowerCase"}},dmn:{name:"DMN",prefix:"dmn",uri:"https://www.omg.org/spec/DMN/20191111/MODEL/",types:[{name:"AuthorityRequirement",superClass:["DMNElement"],properties:[{name:"requiredAuthority",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredDecision",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredInput",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"ItemDefinition",superClass:["NamedElement"],properties:[{name:"typeRef",type:"String"},{name:"allowedValues",type:"UnaryTests",xml:{serialize:"property"}},{name:"typeLanguage",type:"String",isAttr:!0},{name:"itemComponent",type:"ItemDefinition",isMany:!0,xml:{serialize:"property"}},{name:"functionItem",type:"FunctionItem"},{name:"isCollection",isAttr:!0,type:"Boolean"}]},{name:"Definitions",superClass:["NamedElement"],properties:[{name:"import",type:"Import",isMany:!0},{name:"itemDefinition",type:"ItemDefinition",isMany:!0},{name:"drgElement",type:"DRGElement",isMany:!0},{name:"artifact",type:"Artifact",isMany:!0},{name:"elementCollection",type:"ElementCollection",isMany:!0},{name:"businessContextElement",type:"BusinessContextElement",isMany:!0},{name:"namespace",type:"String",isAttr:!0},{name:"expressionLanguage",type:"String",isAttr:!0},{name:"typeLanguage",type:"String",isAttr:!0},{name:"exporter",isAttr:!0,type:"String"},{name:"exporterVersion",isAttr:!0,type:"String"},{name:"dmnDI",type:"dmndi:DMNDI"}]},{name:"KnowledgeSource",superClass:["DRGElement"],properties:[{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0},{name:"type",type:"String"},{name:"owner",type:"DMNElementReference",xml:{serialize:"property"}},{name:"locationURI",type:"String",isAttr:!0}]},{name:"DecisionRule",superClass:["DMNElement"],properties:[{name:"inputEntry",type:"UnaryTests",isMany:!0,xml:{serialize:"property"}},{name:"outputEntry",type:"LiteralExpression",isMany:!0,xml:{serialize:"property"}},{name:"annotationEntry",type:"RuleAnnotation",isMany:!0,xml:{serialize:"property"}}]},{name:"Expression",isAbstract:!0,superClass:["DMNElement"],properties:[{name:"typeRef",isAttr:!0,type:"String"}]},{name:"InformationItem",superClass:["NamedElement"],properties:[{name:"typeRef",isAttr:!0,type:"String"}]},{name:"Decision",superClass:["DRGElement"],properties:[{name:"question",type:"String",xml:{serialize:"property"}},{name:"allowedAnswers",type:"String",xml:{serialize:"property"}},{name:"variable",type:"InformationItem",xml:{serialize:"property"}},{name:"informationRequirement",type:"InformationRequirement",isMany:!0},{name:"knowledgeRequirement",type:"KnowledgeRequirement",isMany:!0},{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0},{name:"supportedObjective",isMany:!0,type:"DMNElementReference",xml:{serialize:"property"}},{name:"impactedPerformanceIndicator",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"decisionMaker",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"decisionOwner",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"usingProcess",isMany:!0,type:"DMNElementReference",xml:{serialize:"property"}},{name:"usingTask",isMany:!0,type:"DMNElementReference",xml:{serialize:"property"}},{name:"decisionLogic",type:"Expression"}]},{name:"Invocation",superClass:["Expression"],properties:[{name:"calledFunction",type:"Expression"},{name:"binding",type:"Binding",isMany:!0}]},{name:"OrganisationalUnit",superClass:["BusinessContextElement"],properties:[{name:"decisionMade",type:"Decision",isReference:!0,isMany:!0},{name:"decisionOwned",type:"Decision",isReference:!0,isMany:!0}]},{name:"Import",superClass:["NamedElement"],properties:[{name:"importType",type:"String",isAttr:!0},{name:"locationURI",type:"String",isAttr:!0},{name:"namespace",type:"String",isAttr:!0}]},{name:"InformationRequirement",superClass:["DMNElement"],properties:[{name:"requiredDecision",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredInput",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"ElementCollection",superClass:["NamedElement"],properties:[{name:"drgElement",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}}]},{name:"DRGElement",isAbstract:!0,superClass:["NamedElement"],properties:[]},{name:"InputData",superClass:["DRGElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}}]},{name:"DMNElement",isAbstract:!0,properties:[{name:"description",type:"String"},{name:"extensionElements",type:"ExtensionElements"},{name:"id",type:"String",isAttr:!0,isId:!0},{name:"extensionAttribute",type:"ExtensionAttribute",isMany:!0},{name:"label",isAttr:!0,type:"String"}]},{name:"InputClause",superClass:["DMNElement"],properties:[{name:"inputExpression",type:"LiteralExpression",xml:{serialize:"property"}},{name:"inputValues",type:"UnaryTests",xml:{serialize:"property"}}]},{name:"DecisionTable",superClass:["Expression"],properties:[{name:"input",type:"InputClause",isMany:!0,xml:{serialize:"property"}},{name:"output",type:"OutputClause",isMany:!0,xml:{serialize:"property"}},{name:"annotation",type:"RuleAnnotationClause",isMany:!0,xml:{serialize:"property"}},{name:"rule",type:"DecisionRule",isMany:!0,xml:{serialize:"property"}},{name:"hitPolicy",type:"HitPolicy",isAttr:!0,default:"UNIQUE"},{name:"aggregation",type:"BuiltinAggregator",isAttr:!0},{name:"preferredOrientation",type:"DecisionTableOrientation",isAttr:!0},{name:"outputLabel",isAttr:!0,type:"String"}]},{name:"LiteralExpression",superClass:["Expression"],properties:[{name:"expressionLanguage",type:"String",isAttr:!0},{name:"text",type:"String"},{name:"importedValues",type:"ImportedValues"}]},{name:"Binding",properties:[{name:"parameter",type:"InformationItem",xml:{serialize:"property"}},{name:"bindingFormula",type:"Expression"}]},{name:"KnowledgeRequirement",superClass:["DMNElement"],properties:[{name:"requiredKnowledge",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"BusinessKnowledgeModel",superClass:["Invocable"],properties:[{name:"encapsulatedLogic",type:"FunctionDefinition",xml:{serialize:"property"}},{name:"knowledgeRequirement",type:"KnowledgeRequirement",isMany:!0},{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0}]},{name:"BusinessContextElement",isAbstract:!0,superClass:["NamedElement"],properties:[{name:"URI",type:"String",isAttr:!0}]},{name:"PerformanceIndicator",superClass:["BusinessContextElement"],properties:[{name:"impactingDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}}]},{name:"FunctionDefinition",superClass:["Expression"],properties:[{name:"formalParameter",type:"InformationItem",isMany:!0,xml:{serialize:"property"}},{name:"body",type:"Expression"},{name:"kind",type:"FunctionKind",isAttr:!0}]},{name:"Context",superClass:["Expression"],properties:[{name:"contextEntry",type:"ContextEntry",isMany:!0}]},{name:"ContextEntry",superClass:["DMNElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}},{name:"value",type:"Expression"}]},{name:"List",superClass:["Expression"],properties:[{name:"elements",isMany:!0,type:"Expression"}]},{name:"Relation",superClass:["Expression"],properties:[{name:"column",type:"InformationItem",isMany:!0,xml:{serialize:"property"}},{name:"row",type:"List",isMany:!0,xml:{serialize:"property"}}]},{name:"OutputClause",superClass:["DMNElement"],properties:[{name:"outputValues",type:"UnaryTests",xml:{serialize:"property"}},{name:"defaultOutputEntry",type:"LiteralExpression",xml:{serialize:"property"}},{name:"name",isAttr:!0,type:"String"},{name:"typeRef",isAttr:!0,type:"String"}]},{name:"UnaryTests",superClass:["Expression"],properties:[{name:"text",type:"String"},{name:"expressionLanguage",type:"String",isAttr:!0}]},{name:"NamedElement",isAbstract:!0,superClass:["DMNElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ImportedValues",superClass:["Import"],properties:[{name:"importedElement",type:"String"},{name:"expressionLanguage",type:"String",isAttr:!0}]},{name:"DecisionService",superClass:["Invocable"],properties:[{name:"outputDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"encapsulatedDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"inputDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"inputData",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}}]},{name:"ExtensionElements",properties:[{name:"values",type:"Element",isMany:!0}]},{name:"ExtensionAttribute",properties:[{name:"value",type:"Element"},{name:"valueRef",type:"Element",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Element",isAbstract:!0,properties:[{name:"extensionAttribute",type:"ExtensionAttribute",isAttr:!0,isReference:!0},{name:"elements",type:"ExtensionElements",isAttr:!0,isReference:!0}]},{name:"Artifact",isAbstract:!0,superClass:["DMNElement"],properties:[]},{name:"Association",superClass:["Artifact"],properties:[{name:"sourceRef",type:"DMNElementReference",xml:{serialize:"property"}},{name:"targetRef",type:"DMNElementReference",xml:{serialize:"property"}},{name:"associationDirection",type:"AssociationDirection",isAttr:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",isAttr:!0,type:"String",default:"text/plain"}]},{name:"RuleAnnotationClause",properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"RuleAnnotation",properties:[{name:"text",type:"String"}]},{name:"Invocable",isAbstract:!0,superClass:["DRGElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}}]},{name:"Group",superClass:["Artifact"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"FunctionItem",superClass:["DMNElement"],properties:[{name:"parameters",isMany:!0,type:"InformationItem",xml:{serialize:"property"}},{name:"outputTypeRef",isAttr:!0,type:"String"}]},{name:"DMNElementReference",properties:[{isAttr:!0,name:"href",type:"String"}]}],enumerations:[{name:"HitPolicy",literalValues:[{name:"UNIQUE"},{name:"FIRST"},{name:"PRIORITY"},{name:"ANY"},{name:"COLLECT"},{name:"RULE ORDER"},{name:"OUTPUT ORDER"}]},{name:"BuiltinAggregator",literalValues:[{name:"SUM"},{name:"COUNT"},{name:"MIN"},{name:"MAX"}]},{name:"DecisionTableOrientation",literalValues:[{name:"Rule-as-Row"},{name:"Rule-as-Column"},{name:"CrossTable"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"FunctionKind",literalValues:[{name:"FEEL"},{name:"Java"},{name:"PMML"}]}],associations:[],xml:{tagAlias:"lowerCase"}},dmndi:{name:"DMNDI",prefix:"dmndi",uri:"https://www.omg.org/spec/DMN/20191111/DMNDI/",types:[{name:"DMNDI",properties:[{name:"diagrams",type:"DMNDiagram",isMany:!0},{name:"styles",type:"DMNStyle",isMany:!0}]},{name:"DMNStyle",superClass:["di:Style"],properties:[{name:"fillColor",type:"dc:Color",isAttr:!0},{name:"strokeColor",type:"dc:Color",isAttr:!0},{name:"fontColor",type:"dc:Color",isAttr:!0},{name:"fontSize",isAttr:!0,type:"Real"},{name:"fontFamily",isAttr:!0,type:"String"},{name:"fontItalic",isAttr:!0,type:"Boolean"},{name:"fontBold",isAttr:!0,type:"Boolean"},{name:"fontUnderline",isAttr:!0,type:"Boolean"},{name:"fontStrikeThrough",isAttr:!0,type:"Boolean"},{name:"labelHorizontalAlignment",type:"dc:AlignmentKind",isAttr:!0},{name:"labelVerticalAlignment",type:"dc:AlignmentKind",isAttr:!0}]},{name:"DMNDiagram",superClass:["di:Diagram"],properties:[{name:"dmnElementRef",type:"dmn:DMNElement",isAttr:!0,isReference:!0},{name:"size",type:"Size"},{name:"localStyle",type:"DMNStyle",isVirtual:!0},{name:"sharedStyle",type:"DMNStyle",isVirtual:!0,isReference:!0,redefines:"di:DiagramElement#sharedStyle"},{name:"diagramElements",type:"DMNDiagramElement",isMany:!0}]},{name:"DMNDiagramElement",isAbstract:!0,superClass:["di:DiagramElement"],properties:[{name:"dmnElementRef",type:"dmn:DMNElement",isAttr:!0,isReference:!0},{name:"sharedStyle",type:"DMNStyle",isVirtual:!0,isReference:!0,redefines:"di:DiagramElement#sharedStyle"},{name:"localStyle",type:"DMNStyle",isVirtual:!0},{name:"label",type:"DMNLabel"}]},{name:"DMNLabel",superClass:["di:Shape"],properties:[{name:"text",type:"Text"}]},{name:"DMNShape",superClass:["di:Shape","DMNDiagramElement"],properties:[{name:"isListedInputData",isAttr:!0,type:"Boolean"},{name:"decisionServiceDividerLine",type:"DMNDecisionServiceDividerLine"},{name:"isCollapsed",isAttr:!0,type:"Boolean"}]},{name:"DMNEdge",superClass:["di:Edge","DMNDiagramElement"],properties:[{name:"sourceElement",type:"DMNDiagramElement",isAttr:!0,isReference:!0},{name:"targetElement",type:"DMNDiagramElement",isAttr:!0,isReference:!0}]},{name:"DMNDecisionServiceDividerLine",superClass:["di:Edge"]},{name:"Text",properties:[{name:"text",isBody:!0,type:"String"}]},{name:"Size",superClass:["dc:Dimension"]}],associations:[],enumerations:[]},biodi:{name:"bpmn.io DI for DMN",uri:"http://bpmn.io/schema/dmn/biodi/2.0",prefix:"biodi",xml:{tagAlias:"lowerCase"},types:[{name:"DecisionTable",isAbstract:!0,extends:["dmn:DecisionTable"],properties:[{name:"annotationsWidth",isAttr:!0,type:"Integer"}]},{name:"OutputClause",isAbstract:!0,extends:["dmn:OutputClause"],properties:[{name:"width",isAttr:!0,type:"Integer"}]},{name:"InputClause",isAbstract:!0,extends:["dmn:InputClause"],properties:[{name:"width",isAttr:!0,type:"Integer"}]}]}};function Mt(e,t){return new jt(W({},Nt,e),t)}function Dt(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}var Pt=Object.prototype.toString,Rt=Object.prototype.hasOwnProperty;function At(e,t){return Rt.call(e,t)}function Bt(e,t){var n;if(void 0!==e){var r=function(e){return"[object Array]"===Pt.call(e)}(e)?Tt:It;for(var i in e)if(At(e,i)&&!1===t(n=e[i],r(i)))return n}}function It(e){return e}function Tt(e){return Number(e)}function Lt(e){for(var t=e.style,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Bt(r,(function(e){e&&Bt(e,(function(e,n){t[n]=e}))})),e}function $t(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)}var Vt=Object.prototype.toString;function zt(e){return new Ut(e)}function Ut(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Ft(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}function Gt(e,t){return e&&"function"==typeof e.matches&&e.matches(t)}Ut.prototype.add=function(e){return this.list.add(e),this},Ut.prototype.remove=function(e){return"[object RegExp]"==Vt.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Ut.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},Ut.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Ut.prototype.array=function(){return Array.from(this.list)},Ut.prototype.has=Ut.prototype.contains=function(e){return this.list.contains(e)};var qt,Wt,Ht,Kt={};function Xt(){qt=window.addEventListener?"addEventListener":"attachEvent",Wt=window.removeEventListener?"removeEventListener":"detachEvent",Ht="addEventListener"!==qt?"on":""}var Yt=Dt({__proto__:null,bind:Kt.bind=function(e,t,n,r){return qt||Xt(),e[qt](Ht+t,n,r||!1),n},unbind:Kt.unbind=function(e,t,n,r){return Wt||Xt(),e[Wt](Ht+t,n,r||!1),n},default:Kt},[Kt]),Qt=["focus","blur"];var Zt,Jt={bind:function(e,t,n,r,i){return-1!==Qt.indexOf(n)&&(i=!0),Yt.bind(e,n,(function(n){var i=n.target||n.srcElement;n.delegateTarget=function(e,t,n){for(var r=n?e:e.parentNode;r&&r.nodeType!==document.DOCUMENT_NODE&&r.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(Gt(r,t))return r;r=r.parentNode}return Gt(r,t)?r:null}(i,t,!0),n.delegateTarget&&r.call(e,n)}),i)},unbind:function(e,t,n,r){return-1!==Qt.indexOf(t)&&(r=!0),Yt.unbind(e,t,n,r)}},en=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var r=n[1];if("body"==r){return(i=t.createElement("html")).innerHTML=e,i.removeChild(i.lastChild)}var i,o=Object.prototype.hasOwnProperty.call(nn,r)?nn[r]:nn._default,a=o[0],s=o[1],l=o[2];(i=t.createElement("div")).innerHTML=s+e+l;for(;a--;)i=i.lastChild;if(i.firstChild==i.lastChild)return i.removeChild(i.firstChild);var u=t.createDocumentFragment();for(;i.firstChild;)u.appendChild(i.removeChild(i.firstChild));return u},tn=!1;"undefined"!=typeof document&&((Zt=document.createElement("div")).innerHTML='  <link/><table></table><a href="/a">a</a><input type="checkbox"/>',tn=!Zt.getElementsByTagName("link").length,Zt=void 0);var nn={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:tn?[1,"X<div>","</div>"]:[0,"",""]};nn.td=nn.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],nn.option=nn.optgroup=[1,'<select multiple="multiple">',"</select>"],nn.thead=nn.tbody=nn.colgroup=nn.caption=nn.tfoot=[1,"<table>","</table>"],nn.polyline=nn.ellipse=nn.polygon=nn.circle=nn.text=nn.line=nn.path=nn.rect=nn.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var rn=en;function on(e,t){return(t=t||document).querySelector(e)}function an(e){e.parentNode&&e.parentNode.removeChild(e)}function sn(e){return function(){if(!window.Promise)throw new Error("Promises is not supported in this environment. Please polyfill Promise.");var t=arguments.length;if(!(t>=1&&C(arguments[t-1])))return e.apply(this,arguments);var n=arguments[t-1];console.warn(new Error("Passing callbacks to "+ln(e.name)+" is deprecated and will be removed in a future major release. Please switch to promises: https://bpmn.io/l/moving-to-promises.html"));var r=Array.prototype.slice.call(arguments,0,-1);e.apply(this,r).then((function(e){var t=Object.keys(e)[0];return n(null,e[t])}),(function(e){return n(e,e.warnings)}))}}function ln(e){return e.replace("bound ","")}function un(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?un(Object(n),!0).forEach((function(t){pn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):un(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function pn(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var fn={width:"100%",height:"100%",position:"relative"},dn=function(){function e(){var t=this;r(this,e);var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};pn(this,"_viewsChanged",(function(){t._emit("views.changed",{views:t._views,activeView:t._activeView})})),this._eventBus=new U,this._viewsChanged=I(this._viewsChanged,0),this._views=[],this._viewers={},this.open=sn(this.open.bind(this)),this.importXML=sn(this.importXML.bind(this)),this.saveXML=sn(this.saveXML.bind(this)),this._init(n)}return o(e,[{key:"importXML",value:function(e,t){var n=this;return t=t||{open:!0},new Promise((function(i,o){var a=n._activeView;n._clear().then((function(){var s;e=n._emit("import.parse.start",{xml:e})||e,n._moddle.fromXML(e,"dmn:Definitions").then((function(e){var l=e.rootElement,u=e.references,c=e.elementsById;if(s=e.warnings,l=n._emit("import.parse.complete",r({error:null,definitions:l,elementsById:c,references:u,warnings:s}))||l,n._setDefinitions(l),!t.open)return n._emit("import.done",{error:null,warnings:s}),void i({warnings:s});var p=n._getInitialView(n._views,a);if(!p){var f=new Error("no displayable contents");return n._emit("import.done",{error:f,warnings:s}),f.warnings=s,o(f)}n.open(p).then((function(e){return{warnings:e.warnings}})).catch((function(e){return{error:e,warnings:e.warnings}})).then((function(e){var t=[].concat(s,e.warnings);n._emit("import.done",{error:e.error,warnings:t}),e.error?(e.error.warnings=t,o(e.error)):i({warnings:t})}))})).catch((function(t){return s=t.warnings,t=function(e,t){if("failed to parse document as <dmn:Definitions>"!==e.message)return null;var n=-1!==t.indexOf('"http://www.omg.org/spec/DMN/20151101/dmn.xsd"')?"1.1":-1!==t.indexOf('"http://www.omg.org/spec/DMN/20180521/MODEL/"')&&"1.2";if(!n)return null;return e=new Error("unsupported DMN "+n+" file detected; only DMN 1.3 files can be opened"),console.error("Cannot open what looks like a DMN "+n+" diagram. Please refer to https://bpmn.io/l/dmn-compatibility.html to learn how to make the toolkit compatible with older DMN files",e),e}(t,e)||function(e){var t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);if(!t)return null;return e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid DMN 1.3 diagram file"+t[2],e}(t)||t,n._emit("import.parse.complete",r({error:t,warnings:s})),n._emit("import.done",{error:t,warnings:s}),t.warnings=s,o(t)}))})).catch((function(e){return n._emit("import.done",{error:e,warnings:[]}),e.warnings=[],o(e)}))}));function r(e){var t=n._eventBus.createEvent(e);return Object.defineProperty(t,"context",{enumerable:!0,get:function(){return console.warn(new Error("import.parse.complete <context> is deprecated and will be removed in future library versions")),{warnings:e.warnings,references:e.references,elementsById:e.elementsById}}}),t}}},{key:"getDefinitions",value:function(){return this._definitions}},{key:"getActiveView",value:function(){return this._activeView}},{key:"getActiveViewer",value:function(){var e=this.getActiveView();return e&&this._getViewer(e)}},{key:"getView",value:function(e){return this._views.filter((function(t){return t.element===e}))[0]}},{key:"getViews",value:function(){return this._views}},{key:"saveXML",value:function(e){var t=this;e=e||{};var n=this._definitions;return new Promise((function(r,i){n?(n=t._emit("saveXML.start",{definitions:n})||n,t._moddle.toXML(n,e).then((function(e){var n=e.xml;return{xml:n=t._emit("saveXML.serialized",{xml:n})||n}})).catch((function(e){return{error:e}})).then((function(e){t._emit("saveXML.done",e),e.error?i(e.error):r({xml:e.xml})}))):i(new Error("no definitions loaded"))}))}},{key:"on",value:function(){var e;(e=this._eventBus).on.apply(e,arguments)}},{key:"off",value:function(){var e;(e=this._eventBus).off.apply(e,arguments)}},{key:"once",value:function(){var e;(e=this._eventBus).once.apply(e,arguments)}},{key:"attachTo",value:function(e){e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),"string"==typeof e&&(e=on(e)),e.appendChild(this._container),this._emit("attach",{})}},{key:"detach",value:function(){this._emit("detach",{}),an(this._container)}},{key:"destroy",value:function(){var e=this;Object.keys(this._viewers).forEach((function(t){yn(e._viewers[t],"destroy")})),an(this._container)}},{key:"_init",value:function(e){this._options=e,this._moddle=this._createModdle(e),this._viewers={},this._views=[];var t=rn('<div class="dmn-js-parent"></div>'),n=$({},fn,e);$(t.style,{width:hn(n.width),height:hn(n.height),position:n.position}),this._container=t,e.container&&this.attachTo(e.container)}},{key:"_clear",value:function(){return this._switchView(null)}},{key:"open",value:function(e){return this._switchView(e)}},{key:"_setDefinitions",value:function(e){this._definitions=e,this._updateViews()}},{key:"_updateViews",value:function(){var e=this._definitions;if(!e)return this._views=[],void this._switchView(null);for(var t=this._getViewProviders(),n=[e].concat(v(e.drgElement||[])),r=this._views,i=[],o=0,a=n;o<a.length;o++){var s=a[o],l=j(t,(function(e){return"string"==typeof e.opens?e.opens===s.$type:e.opens(s)}));if(l){var u={element:s,id:s.id,name:s.name,type:l.id};i.push(u)}}var c,p=this._activeView;if(!p||(c=j(i,(function(e){return mn(p,e)}))||this._getInitialView(i),c)){var f=!mn(p,c)||vn(p,c),d=r.length!==i.length||!P(i,(function(e){return j(r,(function(t){return mn(t,e)&&!vn(t,e)}))}));this._activeView=c,this._views=i,(f||d)&&this._viewsChanged()}else this._switchView(null)}},{key:"_getInitialView",value:function(e,t){var n;return t&&(n=j(e,(function(e){return mn(e,t)}))||j(e,(function(e){return e.type===t}))),n||e[0]}},{key:"_switchView",value:function(e){var t=this;return new Promise((function(n,r){var i,o=function(e,i){t._viewsChanged(),e?r(e):n(i)},a=t.getActiveView(),s=e&&t._getViewer(e),l=e&&e.element;if(a&&(i=t._getViewer(a))!==s&&(yn(i,"clear"),i.detach()),t._activeView=e,s)return i!==s&&s.attachTo(t._container),t._emit("import.render.start",{view:e,element:l}),void s.open(l).then((function(n){t._emit("import.render.complete",{view:e,error:null,warnings:n.warnings}),o(null,n)})).catch((function(n){t._emit("import.render.complete",{view:e,error:n,warnings:n.warnings}),o(n,null)}));o()}))}},{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(e){var t=j(this._getViewProviders(),(function(t){return t.id===e}));if(!t)throw new Error("no provider for view type <"+e+">");var n=t.constructor,r=this._options[e]||{};return new n(cn(cn(cn({},this._options.common||{}),r),{},{additionalModules:[].concat(v(r.additionalModules||[]),[{_parent:["value",this],moddle:["value",this._moddle]}])}))}},{key:"_emit",value:function(){var e;return(e=this._eventBus).fire.apply(e,arguments)}},{key:"_createModdle",value:function(e){return new Mt(e.moddleExtensions)}},{key:"_getViewProviders",value:function(){return[]}}]),e}();function hn(e){return e+(E(e)?"px":"")}function mn(e,t){return _(e)?!!_(t)&&(e.element===t.element||e.id===t.id):!_(t)}function vn(e,t){return!e||!t||e.name!==t.name}function yn(e,t){C(e[t])&&e[t]()}var gn=/^class[ {]/;function bn(e){return Array.isArray(e)}function wn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _n(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];1===t.length&&bn(t[0])&&(t=t[0]);var r=(t=v(t)).pop();return r.$inject=t,r}var xn=/constructor\s*[^(]*\(\s*([^)]*)\)/m,kn=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,En=/\/\*([^*]*)\*\//m;function Cn(e){if("function"!=typeof e)throw new Error('Cannot annotate "'.concat(e,'". Expected a function!'));var t=e.toString().match(function(e){return gn.test(e.toString())}(e)?xn:kn);if(!t)return[];var n=t[1]||t[2];return n&&n.split(",").map((function(e){var t=e.match(En);return(t&&t[1]||e).trim()}))||[]}function On(e,t){t=t||{get:function(e,t){if(n.push(e),!1===t)return null;throw a('No provider for "'.concat(e,'"!'))}};var n=[],r=this._providers=Object.create(t._providers||null),i=this._instances=Object.create(null),o=i.injector=this,a=function(e){var t=n.join(" -> ");return n.length=0,new Error(t?"".concat(e," (Resolving: ").concat(t,")"):e)};function s(e,o){if(!r[e]&&-1!==e.indexOf(".")){for(var l=e.split("."),u=s(l.shift());l.length;)u=u[l.shift()];return u}if(wn(i,e))return i[e];if(wn(r,e)){if(-1!==n.indexOf(e))throw n.push(e),a("Cannot resolve circular dependency!");return n.push(e),i[e]=r[e][0](r[e][1]),n.pop(),i[e]}return t.get(e,o)}function l(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!bn(e))throw a('Cannot invoke "'.concat(e,'". Expected a function!'));e=_n(e.slice())}return{fn:e,dependencies:(e.$inject||Cn(e)).map((function(e){return wn(t,e)?t[e]:s(e)}))}}function u(e){var t=l(e),n=t.fn,r=t.dependencies;return new(Function.prototype.bind.apply(n,[null].concat(r)))}function c(e,t,n){var r=l(e,n),i=r.fn,o=r.dependencies;return i.apply(t,o)}function p(e,t){if(t&&t.length){var n,i,a,s,l=Object.create(null),u=Object.create(null),c=[],p=[],f=[],d=function(e){var o;n=r[e],-1!==t.indexOf(e)&&("private"===n[2]?-1===(i=c.indexOf(n[3]))?(a=n[3].createChild([],t),o=a,s=_n((function(e){return o.get(e)})),c.push(n[3]),p.push(a),f.push(s),l[e]=[s,e,"private",a]):l[e]=[f[i],e,"private",p[i]]:l[e]=[n[2],n[1]],u[e]=!0),"factory"!==n[2]&&"type"!==n[2]||!n[1].$scope||t.forEach((function(t){-1!==n[1].$scope.indexOf(t)&&(l[e]=[n[2],n[1]],u[t]=!0)}))};for(var h in r)d(h);t.forEach((function(e){if(!u[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')})),e.unshift(l)}return new On(e,o)}var f,d,h={factory:c,type:u,value:function(e){return e}};function m(e,t){var n=e.__init__||[];return function(){n.forEach((function(e){"string"==typeof e?t.get(e):t.invoke(e)}))}}function v(e){var t=e.__exports__;if(t){var n=e.__modules__,i=Object.keys(e).reduce((function(t,n){return"__exports__"!==n&&"__modules__"!==n&&"__init__"!==n&&"__depends__"!==n&&(t[n]=e[n]),t}),Object.create(null)),a=p((n||[]).concat(i)),s=_n((function(e){return a.get(e)}));t.forEach((function(e){r[e]=[s,e,"private",a]}));var l=(e.__init__||[]).slice();return l.unshift((function(){a.init()})),m(e=Object.assign({},e,{__init__:l}),a)}return Object.keys(e).forEach((function(t){if("__init__"!==t&&"__depends__"!==t)if("private"!==e[t][2]){var n=e[t][0],i=e[t][1];r[t]=[h[n],Sn(n,i),n]}else r[t]=e[t]})),m(e,o)}function y(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(y,e)).indexOf(t)?e:e.concat(t)}this.get=s,this.invoke=c,this.instantiate=u,this.createChild=p,this.init=(f=e.reduce(y,[]).map(v),d=!1,function(){d||(d=!0,f.forEach((function(e){return e()})))})}function Sn(e,t){return"value"!==e&&bn(t)&&(t=_n(t.slice())),t}function jn(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function Nn(e,t){var n=this;t=t||1e3,e.on(["render.shape","render.connection"],t,(function(e,t){var r=e.type,i=t.element,o=t.gfx,a=t.attrs;if(n.canRender(i))return"render.shape"===r?n.drawShape(o,i,a):n.drawConnection(o,i,a)})),e.on(["render.getShapePath","render.getConnectionPath"],t,(function(e,t){if(n.canRender(t))return"render.getShapePath"===e.type?n.getShapePath(t):n.getConnectionPath(t)}))}function Mn(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 Dn(e,t){return Mn(t,e),e}Nn.prototype.canRender=function(e){},Nn.prototype.drawShape=function(e,t){},Nn.prototype.drawConnection=function(e,t){},Nn.prototype.getShapePath=function(e){},Nn.prototype.getConnectionPath=function(e){};var Pn={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":2,"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":2,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function Rn(e,t,n){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=Pn[r];i?(2===i&&"number"==typeof n&&(n=String(n)+"px"),e.style[r]=n):e.setAttributeNS(null,t,n)}function An(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return Pn[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);Rn(e,t,n)}else!function(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)Rn(e,r,t[r])}(e,t);return e}var Bn=Object.prototype.toString;function In(e){return new Tn(e)}function Tn(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Ln(e){var t=e.parentNode;return t&&t.removeChild(e),e}function $n(e){for(var t;t=e.firstChild;)Ln(t);return e}Tn.prototype.add=function(e){return this.list.add(e),this},Tn.prototype.remove=function(e){return"[object RegExp]"==Bn.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Tn.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},Tn.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Tn.prototype.array=function(){return Array.from(this.list)},Tn.prototype.has=Tn.prototype.contains=function(e){return this.list.contains(e)};var Vn="http://www.w3.org/2000/svg",zn='<svg xmlns="'+Vn+'"';function Un(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(Vn)&&(e=zn+e.substring(4)):(e=zn+">"+e+"</svg>",t=!0);var n=function(e){var t;return(t=new DOMParser).async=!1,t.parseFromString(e,"text/xml")}(e);if(!t)return n;for(var r=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)r.appendChild(i.firstChild);return r}function Fn(e,t){var n;return"<"===e.charAt(0)?(n=Un(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Vn,e),t&&An(n,t),n}var Gn=null;function qn(){return null===Gn&&(Gn=Fn("svg")),Gn}function Wn(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)e[r]=t[r];return e}var Hn=/([&<>]{1})/g,Kn=/([\n\r"]{1})/g,Xn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function Yn(e,t){return e.replace(t,(function(e,t){return Xn[t]||t}))}function Qn(e,t){var n,r,i,o,a;switch(e.nodeType){case 3:t.push(Yn(e.textContent,Hn));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,r=(i=e.attributes).length;n<r;++n)o=i.item(n),t.push(" ",o.name,'="',Yn(o.value,Kn),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,r=(a=e.childNodes).length;n<r;++n)Qn(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",Yn(e.nodeValue,Hn),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function Zn(e,t){var n=Un(t);if($n(e),t){(function(e){return"#document-fragment"===e.nodeName})(n)||(n=n.documentElement);for(var r,i=(r=n.childNodes,Array.prototype.slice.call(r)),o=0;o<i.length;o++)Mn(i[o],e)}}function Jn(e,t){if(void 0!==t){try{Zn(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}return function(e){for(var t=e.firstChild,n=[];t;)Qn(t,n),t=t.nextSibling;return n.join("")}(e)}function er(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function tr(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),function(e,t){var n,r;for(e.clear(),n=0;r=t[n];n++)e.appendItem(er(e,r))}(n,t)),n.consolidate()}function nr(e){return e.flat().join(",").replace(/,?([A-z]),?/g,"$1")}function rr(e){return["M",e.x,e.y]}function ir(e){return["L",e.x,e.y]}function or(e,t){for(var n,r,i,o=e.length,a=[rr(e[0])],s=1;s<o;s++){var l=e[s-1],u=e[s],c=e[s+1];if(c&&t){var p=Math.min(t,sr(u.x-l.x,u.y-l.y),sr(c.x-u.x,c.y-u.y));if(p){var f=ar(u,l,p),d=ar(u,l,.5*p),h=ar(u,c,p),m=ar(u,c,.5*p);a.push(ir(f)),a.push((r=m,i=h,["C",(n=d).x,n.y,r.x,r.y,i.x,i.y]))}else a.push(ir(u))}else a.push(ir(u))}return a}function ar(e,t,n){var r=t.x-e.x,i=t.y-e.y,o=n/sr(r,i);return{x:e.x+r*o,y:e.y+i*o}}function sr(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function lr(e,t,n){E(t)&&(n=t,t=null),t||(t={});var r=Fn("path",t);return E(n)&&(r.dataset.cornerRadius=String(n)),ur(r,e)}function ur(e,t){return An(e,{d:nr(or(t,parseInt(e.dataset.cornerRadius,10)||0))}),e}function cr(e,t){var n,r,i,o;return t=!!t,x(e)||(e=[e]),M(e,(function(e){var a=e;e.waypoints&&!t&&(a=cr(e.waypoints,!0));var s=a.x,l=a.y,u=a.height||0,c=a.width||0;(s<n||void 0===n)&&(n=s),(l<r||void 0===r)&&(r=l),(s+c>i||void 0===i)&&(i=s+c),(l+u>o||void 0===o)&&(o=l+u)})),{x:n,y:r,height:o-r,width:i-n}}function pr(e){return!(!e||!e.isFrame)}function fr(e,t){Nn.call(this,e,1),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}jn(fr,Nn),fr.prototype.canRender=function(){return!0},fr.prototype.drawShape=function(e,t,n){var r=Fn("rect");return An(r,{x:0,y:0,width:t.width||0,height:t.height||0}),pr(t)?An(r,$({},this.FRAME_STYLE,n||{})):An(r,$({},this.SHAPE_STYLE,n||{})),Dn(e,r),r},fr.prototype.drawConnection=function(e,t,n){var r=lr(t.waypoints,$({},this.CONNECTION_STYLE,n||{}));return Dn(e,r),r},fr.prototype.getShapePath=function(e){var t=e.x,n=e.y,r=e.width;return nr([["M",t,n],["l",r,0],["l",0,e.height],["l",-r,0],["z"]])},fr.prototype.getConnectionPath=function(e){var t,n,r=e.waypoints,i=[];for(t=0;n=r[t];t++)n=n.original||n,i.push([0===t?"M":"L",n.x,n.y]);return nr(i)},fr.$inject=["eventBus","styles"];var dr={__init__:["defaultRenderer"],defaultRenderer:["type",fr],styles:["type",function(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(e,t,n){return $(this.style(t,n),{class:e})},this.style=function(t,n){x(t)||n||(n=t,t=[]);var r=D(t,(function(t,n){return $(t,e[n]||{})}),{});return n?$(r,n):r},this.computeStyle=function(e,n,r){return x(n)||(r=n,n=[]),t.style(n||[],$({},r,e||{}))}}]};function hr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function mr(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function vr(e,t){return Math.round(e*t)/t}function yr(e){return E(e)?e+"px":e}function gr(e,t,n){var r=Fn("g");In(r).add(t);var i=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(r,e.childNodes[i]||null),r}var br={shape:["x","y","width","height"],connection:["waypoints"]};function wr(e,t,n,r){this._eventBus=t,this._elementRegistry=r,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._init(e||{})}function _r(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}wr.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],wr.prototype._init=function(e){var t=this,n=this._eventBus,r=this._container=function(e){var t=(e=$({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),Lt(n,{position:"relative",overflow:"hidden",width:yr(e.width),height:yr(e.height)}),t.appendChild(n),n}(e),i=this._svg=Fn("svg");An(i,{width:"100%",height:"100%"}),Dn(r,i);var o=this._viewport=gr(i,"viewport");!1!==e.deferUpdate&&(this._viewboxChanged=I(L(this._viewboxChanged,this),300)),n.on("diagram.init",(function(){n.fire("canvas.init",{svg:i,viewport:o})})),n.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],(function(){delete t._cachedViewbox})),n.on("diagram.destroy",500,this._destroy,this),n.on("diagram.clear",500,this._clear,this)},wr.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});var e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},wr.prototype._clear=function(){var e=this;this._elementRegistry.getAll().forEach((function(t){var n=function(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}(t);"root"===n?e.removeRootElement(t):e._removeElement(t,n)})),this._planes=[],this._rootElement=null,delete this._cachedViewbox},wr.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},wr.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},wr.prototype._getChildIndex=function(e){return D(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},wr.prototype._createLayer=function(e,t){void 0===t&&(t=1);var n=this._getChildIndex(t);return{group:gr(this._viewport,"layer-"+e,n),index:t,visible:!0}},wr.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");var t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");var n=this._viewport,r=t.group,i=t.index;if(t.visible)return r;var o=this._getChildIndex(i);return n.insertBefore(r,n.childNodes[o]||null),t.visible=!0,r},wr.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");var t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");var n=t.group;return t.visible?(Ln(n),t.visible=!1,n):n},wr.prototype._removeLayer=function(e){var t=this._layers[e];t&&(delete this._layers[e],Ln(t.group))},wr.prototype.getActiveLayer=function(){var e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},wr.prototype.findRoot=function(e){if("string"==typeof e&&(e=this._elementRegistry.get(e)),e){var t=this._findPlaneForRoot(function(e){for(;e.parent;)e=e.parent;return e}(e))||{};return t.rootElement}},wr.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},wr.prototype._findPlaneForRoot=function(e){return j(this._planes,(function(t){return t.rootElement===e}))},wr.prototype.getContainer=function(){return this._container},wr.prototype._updateMarker=function(e,t,n){var r;e.id||(e=this._elementRegistry.get(e)),(r=this._elementRegistry._elements[e.id])&&(M([r.gfx,r.secondaryGfx],(function(e){e&&(n?In(e).add(t):In(e).remove(t))})),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))},wr.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},wr.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},wr.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),In(this.getGraphics(e)).has(t)},wr.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},wr.prototype.getRootElement=function(){var e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},wr.prototype.addRootElement=function(e){var t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});var n=e.layer="root-"+t;this._ensureValid("root",e);var r=this.getLayer(n,0);return this.hideLayer(n),this._addRoot(e,r),this._planes.push({rootElement:e,layer:r}),e},wr.prototype.removeRootElement=function(e){if("string"==typeof e&&(e=this._elementRegistry.get(e)),this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter((function(t){return t.rootElement!==e})),this._rootElement===e&&(this._rootElement=null),e},wr.prototype.setRootElement=function(e,t){if(_(t))throw new Error("override not supported");if(e!==this._rootElement){if(!e)throw new Error("rootElement required");return this._findPlaneForRoot(e)||(e=this.addRootElement(e)),this._setRoot(e),e}},wr.prototype._removeRoot=function(e){var t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)},wr.prototype._addRoot=function(e,t){var n=this._elementRegistry,r=this._eventBus;r.fire("root.add",{element:e}),n.add(e,t),r.fire("root.added",{element:e,gfx:t})},wr.prototype._setRoot=function(e,t){var n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})},wr.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");var n=br[e],r=P(n,(function(e){return void 0!==t[e]}));if(!r)throw new Error("must supply { "+n.join(", ")+" } with "+e)},wr.prototype._setParent=function(e,t,n){!function(e,t,n){if(e&&t){"number"!=typeof n&&(n=-1);var r=e.indexOf(t);if(-1!==r){if(r===n)return;if(-1===n)return;e.splice(r,1)}-1!==n?e.splice(n,0,t):e.push(t)}}(t.children,e,n),e.parent=t},wr.prototype._addElement=function(e,t,n,r){n=n||this.getRootElement();var i=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),i.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,r);var a=o.create(e,t,r);return this._elementRegistry.add(t,a),o.update(e,t,a),i.fire(e+".added",{element:t,gfx:a}),t},wr.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},wr.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},wr.prototype._removeElement=function(e,t){var n=this._elementRegistry,r=this._graphicsFactory,i=this._eventBus;if(e=n.get(e.id||e))return i.fire(t+".remove",{element:e}),r.remove(e),function(e,t){if(!e||!t)return-1;var n=e.indexOf(t);-1!==n&&e.splice(n,1)}(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+".removed",{element:e}),n.remove(e),e},wr.prototype.removeShape=function(e){return this._removeElement(e,"shape")},wr.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},wr.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},wr.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},wr.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},wr.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;var t,n,r,i,o,a,s,l=this._viewport,u=this.getSize();return e?(this._changeViewbox((function(){o=Math.min(u.width/e.width,u.height/e.height);var t=this._svg.createSVGMatrix().scale(o).translate(-e.x,-e.y);tr(l,t)})),e):(t=(r=this._rootElement?this.getActiveLayer():null)&&r.getBBox()||{},n=(i=tr(l))?i.matrix:function(e,t,n,r,i,o){var a=qn().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return Wn(a,e);case 6:return Wn(a,{a:e,b:t,c:n,d:r,e:i,f:o})}}(),o=vr(n.a,1e3),a=vr(-n.e||0,1e3),s=vr(-n.f||0,1e3),e=this._cachedViewbox={x:a?a/o:0,y:s?s/o:0,width:u.width/o,height:u.height/o,scale:o,inner:{width:t.width||0,height:t.height||0,x:t.x||0,y:t.y||0},outer:u})},wr.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox((function(){e=$({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),_r(t,n)})),{x:n.e,y:n.f}},wr.prototype.scrollToElement=function(e,t){var n=100;"string"==typeof e&&(e=this._elementRegistry.get(e));var r=this.findRoot(e);r!==this.getRootElement()&&this.setRootElement(r),t||(t={}),"number"==typeof t&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};var i,o,a=cr(e),s=mr(a),l=this.viewbox(),u=this.zoom();l.y+=t.top/u,l.x+=t.left/u,l.width-=(t.right+t.left)/u,l.height-=(t.bottom+t.top)/u;var c=mr(l);if(a.width<l.width&&a.height<l.height){var p=Math.max(0,s.right-c.right),f=Math.min(0,s.left-c.left),d=Math.max(0,s.bottom-c.bottom),h=Math.min(0,s.top-c.top);i=p||f,o=d||h}else i=a.x-l.x,o=a.y-l.y;this.scroll({dx:-i*u,dy:-o*u})},wr.prototype.zoom=function(e,t){return e?"fit-viewport"===e?this._fitViewport(t):(this._changeViewbox((function(){"object"!==n(t)&&(r=this.viewbox().outer,t={x:r.width/2,y:r.height/2}),i=this._setZoom(e,t)})),vr(i.a,1e3)):this.viewbox(e).scale;var r,i},wr.prototype._fitViewport=function(e){var t,n,r=this.viewbox(),i=r.outer,o=r.inner;return o.x>=0&&o.y>=0&&o.x+o.width<=i.width&&o.y+o.height<=i.height&&!e?n={x:0,y:0,width:Math.max(o.width+o.x,i.width),height:Math.max(o.height+o.y,i.height)}:(t=Math.min(1,i.width/o.width,i.height/o.height),n={x:o.x+(e?o.width/2-i.width/t/2:0),y:o.y+(e?o.height/2-i.height/t/2:0),width:i.width/t,height:i.height/t}),this.viewbox(n),this.viewbox(!1).scale},wr.prototype._setZoom=function(e,t){var n,r,i,o,a=this._svg,s=this._viewport,l=a.createSVGMatrix(),u=a.createSVGPoint(),c=(r=s.getCTM()).a;return t?(n=$(u,t).matrixTransform(r.inverse()),i=l.translate(n.x,n.y).scale(1/c*e).translate(-n.x,-n.y),o=r.multiply(i)):o=l.scale(e),_r(this._viewport,o),o},wr.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},wr.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}},wr.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var xr="data-element-id";function kr(e){this._elements={},this._eventBus=e}kr.$inject=["eventBus"],kr.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),An(t,xr,r),n&&An(n,xr,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}},kr.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&(An(r.gfx,xr,""),r.secondaryGfx&&An(r.secondaryGfx,xr,""),delete t[n])},kr.prototype.updateId=function(e,t){this._validateId(t),"string"==typeof e&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),r=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,r)},kr.prototype.updateGraphics=function(e,t,n){var r=e.id||e,i=this._elements[r];return n?i.secondaryGfx=t:i.gfx=t,t&&An(t,xr,r),t},kr.prototype.get=function(e){var t;t="string"==typeof e?e:e&&An(e,xr);var n=this._elements[t];return n&&n.element},kr.prototype.filter=function(e){var t=[];return this.forEach((function(n,r){e(n,r)&&t.push(n)})),t},kr.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),r=0;r<n.length;r++){var i=t[n[r]],o=i.element;if(e(o,i.gfx))return o}},kr.prototype.getAll=function(){return this.filter((function(e){return e}))},kr.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach((function(n){var r=t[n],i=r.element,o=r.gfx;return e(i,o)}))},kr.prototype.getGraphics=function(e,t){var n=e.id||e,r=this._elements[n];return r&&(t?r.secondaryGfx:r.gfx)},kr.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 Er={},Cr={get exports(){return Er},set exports(e){Er=e}},Or={};Or.extend=function(e,t,n,r){var i=n.inverse;return Object.defineProperty(e,"remove",{value:function(e){var n=this.indexOf(e);return-1!==n&&(this.splice(n,1),t.unset(e,i,r)),e}}),Object.defineProperty(e,"contains",{value:function(e){return-1!==this.indexOf(e)}}),Object.defineProperty(e,"add",{value:function(e,n){var o=this.indexOf(e);if(void 0===n){if(-1!==o)return;n=this.length}-1!==o&&this.splice(o,1),this.splice(n,0,e),-1===o&&t.set(e,i,r)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e},Or.isExtended=function(e){return!0===e.__refs_collection};var Sr=Or;function jr(e,t,n){var r=Sr.extend(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:r}),r.length&&r.forEach((function(r){e.set(r,t.inverse,n)}))}function Nr(e,t){if(!(this instanceof Nr))return new Nr(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}Nr.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]}t.collection?jr(this,t,e):function(e,t,n){var r=t.inverse,i=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return i},set:function(t){if(t!==i){var o=i;i=null,o&&e.unset(o,r,n),i=t,e.set(i,r,n)}}})}(this,t,e)},Nr.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Sr.isExtended(n)||jr(this,t,e),n},Nr.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},Nr.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},Nr.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Mr=Nr;!function(e){e.exports=Mr,e.exports.Collection=Or}(Cr);var Dr=hr(Er),Pr=new Dr({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Rr=new Dr({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Ar=new Dr({name:"attachers",collection:!0},{name:"host"}),Br=new Dr({name:"outgoing",collection:!0},{name:"source"}),Ir=new Dr({name:"incoming",collection:!0},{name:"target"});function Tr(){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)}}),Pr.bind(this,"parent"),Rr.bind(this,"labels"),Br.bind(this,"outgoing"),Ir.bind(this,"incoming")}function Lr(){Tr.call(this),Pr.bind(this,"children"),Ar.bind(this,"host"),Ar.bind(this,"attachers")}function $r(){Lr.call(this)}function Vr(){Lr.call(this),Rr.bind(this,"labelTarget")}function zr(){Tr.call(this),Br.bind(this,"source"),Ir.bind(this,"target")}jn(Lr,Tr),jn($r,Lr),jn(Vr,Lr),jn(zr,Tr);var Ur={connection:zr,shape:Lr,label:Vr,root:$r};function Fr(){this._uid=12}function Gr(e,t,n){var r,i=r?qn().createSVGTransformFromMatrix(r):qn().createSVGTransform();i.setTranslate(t,n),tr(e,i)}function qr(e,t){this._eventBus=e,this._elementRegistry=t}function Wr(e,t,n){var r=n||t.firstChild;e!==r&&t.insertBefore(e,r)}Fr.prototype.createRoot=function(e){return this.create("root",e)},Fr.prototype.createLabel=function(e){return this.create("label",e)},Fr.prototype.createShape=function(e){return this.create("shape",e)},Fr.prototype.createConnection=function(e){return this.create("connection",e)},Fr.prototype.create=function(e,t){return(t=$({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=Ur[e];if(!n)throw new Error("unknown type: <"+e+">");return $(new n,t)}(e,t)},qr.$inject=["eventBus","elementRegistry"],qr.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(e){return e.parentNode.childNodes[1]}(n),t||(In(t=Fn("g")).add("djs-children"),Dn(n.parentNode,t))):t=n,t},qr.prototype._clear=function(e){var t=function(e){return e.childNodes[0]}(e);return Ft(t),t},qr.prototype._createContainer=function(e,t,n,r){var i=Fn("g");In(i).add("djs-group"),void 0!==n?Wr(i,t,t.childNodes[n]):Dn(t,i);var o=Fn("g");In(o).add("djs-element"),In(o).add("djs-"+e),r&&In(o).add("djs-frame"),Dn(i,o);var a=Fn("g");return In(a).add("djs-visual"),Dn(o,a),o},qr.prototype.create=function(e,t,n){var r=this._getChildrenContainer(t.parent);return this._createContainer(e,r,n,pr(t))},qr.prototype.updateContainments=function(e){var t,n=this,r=this._elementRegistry;t=D(e,(function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e}),{}),M(t,(function(e){var t=e.children;if(t){var i=n._getChildrenContainer(e);M(t.slice().reverse(),(function(e){Wr(r.getGraphics(e).parentNode,i)}))}}))},qr.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},qr.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},qr.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},qr.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},qr.prototype.update=function(e,t,n){if(t.parent){var r=this._clear(n);if("shape"===e)this.drawShape(r,t),Gr(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(r,t)}t.hidden?An(n,"display","none"):An(n,"display","block")}},qr.prototype.remove=function(e){Ln(this._elementRegistry.getGraphics(e).parentNode)};var Hr={__depends__:[dr],__init__:["canvas"],canvas:["type",wr],elementRegistry:["type",kr],elementFactory:["type",Fr],eventBus:["type",U],graphicsFactory:["type",qr]};function Kr(e){return function(e){var t=new On(e);return t.init(),t}([{config:["value",e=e||{}]},Hr].concat(e.modules||[]))}function Xr(e,t){this.injector=t=t||Kr(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}function Yr(e,t){var n=Qr(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function Qr(e){return e&&e.businessObject||e}Xr.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Xr.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};var Zr=new Dr({name:"dmnElementRef",enumerable:!0},{name:"di",configurable:!0});function Jr(e,t){var n=[];function r(t){try{var n=t.di&&function(t){if(t.gfx)throw new Error("already rendered "+t.id);return e.element(t)}(t);return n}catch(e){a(e.message,{element:t,error:e})}}function i(e){var t,n;(n=(t=e).dmnElementRef)?n.di?a("multiple DI elements defined for element",{element:n}):(Zr.bind(n,"di"),n.di=t):a("no DMN element referenced in element",{element:t})}function o(e){n.push(e)}function a(t,n){e.error(t,n)}return{handleDefinitions:function(t,a){var s=t.dmnDI;if(!s)throw new Error("no dmndi:DMNDI");var l,u=s.diagrams||[];if(a&&-1===u.indexOf(a))throw new Error("diagram not part of dmndi:DMNDI");if(!a&&u&&u.length&&(a=u[0]),!a)throw new Error("no diagram to display");t.di=a,function(e){M(e.diagramElements,i)}(a),l=t,e.root(l),M(t.get("drgElement"),(function(e){r(e),function(e){M(["informationRequirement","knowledgeRequirement","authorityRequirement"],(function(t){M(e[t],(function(e){o((function(){r(e)}))}))}))}(e)})),function(e){M(e,(function(e){Yr(e,"dmn:Association")?function(e){o((function(){r(e)}))}(e):r(e)}))}(t.get("artifact")),M(n,(function(e){e()}))}}}var ei=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var t=e.exports=function(e,n){if(n||(n=16),void 0===e&&(e=128),e<=0)return"0";for(var r=Math.log(Math.pow(2,e))/Math.log(n),i=2;r===1/0;i*=2)r=Math.log(Math.pow(2,e/i))/Math.log(n)*i;var o=r-Math.floor(r),a="";for(i=0;i<Math.floor(r);i++){a=Math.floor(Math.random()*n).toString(n)+a}if(o){var s=Math.pow(n,o);a=Math.floor(Math.random()*s).toString(n)+a}var l=parseInt(a,n);return l!==1/0&&l>=Math.pow(2,e)?t(e,n):a};t.rack=function(e,n,r){var i=function(i){var a=0;do{if(a++>10){if(!r)throw new Error("too many ID collisions, use more bits");e+=r}var s=t(e,n)}while(Object.hasOwnProperty.call(o,s));return o[s]=i,s},o=i.hats={};return i.get=function(e){return i.hats[e]},i.set=function(e,t){return i.hats[e]=t,i},i.bits=e||128,i.base=n||16,i}}));function ti(e){if(!(this instanceof ti))return new ti(e);e=e||[128,36,1],this._seed=e.length?ei.rack(e[0],e[1],e[2]):e}ti.prototype.next=function(e){return this._seed(e||!0)},ti.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},ti.prototype.claim=function(e,t){this._seed.set(e,t||!0)},ti.prototype.assigned=function(e){return this._seed.get(e)||!1},ti.prototype.unclaim=function(e){delete this._seed.hats[e]},ti.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var ni=new ti,ri="hsl(225, 10%, 15%)";function ii(e,t,n,r,i,o){Nn.call(this,t);var a=ni.next(),s=r.computeStyle,l={},u=e&&e.defaultFillColor||"white",c=e&&e.defaultStrokeColor||ri,p=e&&e.defaultLabelColor;function f(e,t,n){var r=e+"-"+ai(t)+"-"+ai(n)+"-"+a;return l[r]||function(e,t,n,r){if("association-start"===t){var i=Fn("path");An(i,{d:"M 11 5 L 1 10 L 11 15"}),d(e,{element:i,attrs:{fill:"none",stroke:r,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}else if("association-end"===t){var o=Fn("path");An(o,{d:"M 1 5 L 11 10 L 1 15"}),d(e,{element:o,attrs:{fill:"none",stroke:r,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}else if("information-requirement-end"===t){var a=Fn("path");An(a,{d:"M 1 5 L 11 10 L 1 15 Z"}),d(e,{element:a,attrs:{fill:r,stroke:"none"},ref:{x:11,y:10},scale:1})}else if("knowledge-requirement-end"===t){var s=Fn("path");An(s,{d:"M 1 3 L 11 10 L 1 17"}),d(e,{element:s,attrs:{fill:"none",stroke:r,strokeWidth:2},ref:{x:11,y:10},scale:.8})}else if("authority-requirement-end"===t){var l=Fn("circle");An(l,{cx:3,cy:3,r:3}),d(e,{element:l,attrs:{fill:r,stroke:"none"},ref:{x:3,y:3},scale:.9})}}(r,e,0,n),"url(#"+r+")"}function d(e,t){var n=$({strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},t.attrs),r=t.ref||{x:0,y:0},i=t.scale||1;"none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]);var a=Fn("marker");An(t.element,n),Dn(a,t.element),An(a,{id:e,viewBox:"0 0 20 20",refX:r.x,refY:r.y,markerWidth:20*i,markerHeight:20*i,orient:"auto"});var s=on("defs",o._svg);s||(s=Fn("defs"),Dn(o._svg,s)),Dn(s,a),l[e]=a}function h(e,t,n,r,i,o){k(i)&&(o=i,i=0),i=i||0,o=s(o,{stroke:ri,strokeWidth:2,fill:"white"});var a=Fn("rect");return An(a,{x:i,y:i,width:t-2*i,height:n-2*i,rx:r,ry:r}),An(a,o),Dn(e,a),a}function m(e,t,n){var r=i.createText(t||"",n);return $t(r,"class","djs-label"),Dn(e,r),r}function v(e,t,n,r){var i=function(e){return Qr(e).name}(t);return m(e,i,r=$({box:t,align:n,padding:5,style:{fill:ui(t,p,c)}},r))}function y(e,t,n){n=s(n,["no-fill"],{strokeWidth:2,stroke:ri});var r=Fn("path");return An(r,{d:t}),An(r,n),Dn(e,r),r}var g={"dmn:Decision":function(e,t){var n=h(e,t.width,t.height,0,{stroke:si(t,c),fill:li(t,u)});return v(e,t,"center-middle"),n},"dmn:KnowledgeSource":function(e,t){var r=y(e,n.getScaledPath("KNOWLEDGE_SOURCE",{xScaleFactor:1.021,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.075}}),{strokeWidth:2,fill:li(t,u),stroke:si(t,c)});return v(e,t,"center-middle"),r},"dmn:BusinessKnowledgeModel":function(e,t){var r=y(e,n.getScaledPath("BUSINESS_KNOWLEDGE_MODEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.3}}),{strokeWidth:2,fill:li(t,u),stroke:si(t,c)});return v(e,t,"center-middle"),r},"dmn:InputData":function(e,t){var n=h(e,t.width,t.height,22,{stroke:si(t,c),fill:li(t,u)});return v(e,t,"center-middle"),n},"dmn:TextAnnotation":function(e,t){var r=h(e,t.width,t.height,0,0,{fill:"none",stroke:"none"});return y(e,n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}}),{stroke:si(t,c)}),m(e,oi(t).text||"",{style:{fill:ui(t,p,c)},box:t,align:"left-top",padding:5}),r},"dmn:Association":function(e,t){var n=oi(t),r=li(t,u),i=si(t,c),o={stroke:i,strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"};return"One"!==n.associationDirection&&"Both"!==n.associationDirection||(o.markerEnd=f("association-end",r,i)),"Both"===n.associationDirection&&(o.markerStart=f("association-start",r,i)),b(e,t.waypoints,o)},"dmn:InformationRequirement":function(e,t){var n=li(t,u),r=si(t,c),i={stroke:r,strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:f("information-requirement-end",n,r)};return b(e,t.waypoints,i)},"dmn:KnowledgeRequirement":function(e,t){var n=li(t,u),r=si(t,c),i={stroke:r,strokeWidth:1,strokeDasharray:5,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:f("knowledge-requirement-end",n,r)};return b(e,t.waypoints,i)},"dmn:AuthorityRequirement":function(e,t){var n=li(t,u),r=si(t,c),i={stroke:r,strokeWidth:1.5,strokeDasharray:5,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:f("authority-requirement-end",n,r)};return b(e,t.waypoints,i)}};function b(e,t,n){var r=lr(t,n=s(n,["no-fill"],{stroke:ri,strokeWidth:2,fill:"none"}));return Dn(e,r),r}this.canRender=function(e){return Yr(e,"dmn:DMNElement")||Yr(e,"dmn:InformationRequirement")||Yr(e,"dmn:KnowledgeRequirement")||Yr(e,"dmn:AuthorityRequirement")},this.drawShape=function(e,t){var n=g[t.type];return n?n(e,t):Nn.prototype.drawShape.apply(this,[e,t])},this.drawConnection=function(e,t){var n=t.type,r=g[n];return r?r(e,t):Nn.prototype.drawConnection.apply(this,[e,t])}}function oi(e){return e.businessObject}function ai(e){return e.replace(/[^0-9a-zA-z]+/g,"_")}function si(e,t){return t}function li(e,t){return t}function ui(e,t,n){return t||si(0,n)}jn(ii,Nn),ii.$inject=["config.drdRenderer","eventBus","pathMap","styles","textRenderer","canvas"];var ci={width:150,height:50};function pi(e,t){var n;t.textContent=e;try{var r,i=""===e;return t.textContent=i?"dummy":e,r={width:(n=t.getBBox()).width+2*n.x,height:n.height},i&&(r.width=0),r}catch(e){return{width:0,height:0}}}function fi(e,t,n){for(var r,i=e.shift(),o=i;;){if((r=pi(o,n)).width=o?r.width:0," "===o||""===o||r.width<Math.round(t)||o.length<2)return di(e,o,i,r);o=hi(o,r.width,t)}}function di(e,t,n,r){if(t.length<n.length){var i=n.slice(t.length).trim();e.unshift(i)}return{width:r.width,height:r.height,text:t}}function hi(e,t,n){var r=Math.max(e.length*(n/t),1),i=function(e,t){var n,r=e.split(/(\s|-|\u00AD)/g),i=[],o=0;if(r.length>1)for(;n=r.shift();){if(!(n.length+o<t)){"-"!==n&&"­"!==n||i.pop();break}i.push(n),o+=n.length}var a=i[i.length-1];return a&&"­"===a&&(i[i.length-1]="-"),i.join("")}(e,r);return i||(i=e.slice(0,Math.max(Math.round(r-1),1))),i}function mi(e){this._config=$({},{size:ci,padding:0,style:{},align:"center-top"},e||{})}mi.prototype.createText=function(e,t){return this.layoutText(e,t).element},mi.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},mi.prototype.layoutText=function(e,t){var n=$({},this._config.size,t.box),r=$({},this._config.style,t.style),i=function(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}(t.align||this._config.align),o=function(e){return k(e)?$({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}(void 0!==t.padding?t.padding:this._config.padding),a=t.fitBox||!1,s=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(r),l=e.split(/\u00AD?\r?\n/),u=[],c=n.width-o.left-o.right,p=Fn("text");for(An(p,{x:0,y:0}),An(p,r),Dn(function(){var e=document.getElementById("helper-svg");return e||(An(e=Fn("svg"),{id:"helper-svg"}),Lt(e,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(e)),e}(),p);l.length;)u.push(fi(l,c,p));"middle"===i.vertical&&(o.top=o.bottom=0);var f=D(u,(function(e,t,n){return e+(s||t.height)}),0)+o.top+o.bottom,d=D(u,(function(e,t,n){return t.width>e?t.width:e}),0),h=o.top;"middle"===i.vertical&&(h+=(n.height-f)/2),h-=(s||u[0].height)/4;var m=Fn("text");return An(m,r),M(u,(function(e){var t;switch(h+=s||e.height,i.horizontal){case"left":t=o.left;break;case"right":t=(a?d:c)-o.right-e.width;break;default:t=Math.max(((a?d:c)-e.width)/2+o.left,0)}var n=Fn("tspan");An(n,{x:t,y:h}),n.textContent=e.text,Dn(m,n)})),Ln(p),{dimensions:{width:d,height:f},element:m}};function vi(e){var t=$({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,r=$({},t,{fontSize:n},e&&e.externalStyle||{}),i=new mi({style:t});this.getExternalLabelBounds=function(e,t){var n=i.getDimensions(t,{box:{width:90,height:30,x:e.width/2+e.x,y:e.height/2+e.y},style:r});return{x:Math.round(e.x+e.width/2-n.width/2),y:Math.round(e.y),width:Math.ceil(n.width),height:Math.ceil(n.height)}},this.getTextAnnotationBounds=function(e,n){var r=i.getDimensions(n,{box:e,style:t,align:"left-top",padding:5});return{x:e.x,y:e.y,width:e.width,height:Math.max(30,Math.round(r.height))}},this.createText=function(e,t){return i.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return r}}vi.$inject=["config.textRenderer"];var yi=/\{([^{}]+)\}/g,gi=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var bi={__init__:["drdRenderer"],drdRenderer:["type",ii],textRenderer:["type",vi],pathMap:["type",function(){this.pathMap={KNOWLEDGE_SOURCE:{d:"m {mx},{my} l 0,{e.y0} c {e.x0},{e.y1} {e.x1},-{e.y2} {e.x2},-{e.y3} c {e.x3},-{e.y4} {e.x4},{e.y5} {e.x5},{e.y6} l 0,-{e.y7}z",width:100,height:65,widthElements:[29.8,48.4,67.2,12.2,19.8,30.8],heightElements:[55.3,19.7,4.2,6.7,2.3,1.6,6.2,54.6]},BUSINESS_KNOWLEDGE_MODEL:{d:"m {mx},{my} l {e.x0},-{e.y0} l {e.x1},0 l 0,{e.y1} l -{e.x2},{e.y2} l -{e.x3},0z",width:125,height:45,widthElements:[13.8,109.2,13.8,109.1],heightElements:[13.2,29.8,13.2]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",width:10,height:30,widthElements:[10],heightElements:[30]}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,r,i=this.pathMap[e];t.abspos?(n=t.abspos.x,r=t.abspos.y):(n=t.containerWidth*t.position.mx,r=t.containerHeight*t.position.my);var o={};if(t.position){for(var a=t.containerHeight/i.height*t.yScaleFactor,s=t.containerWidth/i.width*t.xScaleFactor,l=0;l<i.heightElements.length;l++)o["y"+l]=i.heightElements[l]*a;for(var u=0;u<i.widthElements.length;u++)o["x"+u]=i.widthElements[u]*s}var c,p,f=(c=i.d,p={mx:n,my:r,e:o},String(c).replace(yi,(function(e,t){return function(e,t,n){var r=n;return t.replace(gi,(function(e,t,n,i,o){t=t||i,r&&(t in r&&(r=r[t]),"function"==typeof r&&o&&(r=r()))})),r=(null==r||r==n?e:r)+""}(e,t,p)})));return f}}]};function wi(e,t,n,r){this._eventBus=e,this._canvas=t,this._elementRegistry=r,this._elementFactory=n}function _i(e,t){return $({id:e.id,type:e.$type,businessObject:e},t)}function xi(e){return e.split("#").pop()}wi.$inject=["eventBus","canvas","elementFactory","elementRegistry"],wi.prototype.root=function(e){var t=this._elementFactory.createRoot(_i(e));return this._canvas.setRootElement(t),t},wi.prototype.add=function(e){var t,n,r,i,o,a,s=this._elementFactory,l=this._canvas,u=this._eventBus,c=e.di;if(c.$instanceOf("dmndi:DMNShape"))a=c.bounds,o=_i(e,{x:Math.round(a.x),y:Math.round(a.y),width:Math.round(a.width),height:Math.round(a.height)}),t=s.createShape(o),l.addShape(t),u.fire("drdElement.added",{element:t,di:c});else{if(!c.$instanceOf("dmndi:DMNEdge"))throw new Error("unknown di for element "+e.id);n=function(e){var t=e.waypoint;if(t)return function(e,t){var n=[];return M(e,(function(e,r){n.push(t(e,r))})),n}(t,(function(e){var t={x:e.x,y:e.y};return $({original:t},t)}))}(c),r=this._getSource(e),i=this._getTarget(e),r&&i&&(o=_i(e,{hidden:!1,source:r,target:i,waypoints:n}),t=s.createConnection(o),l.addConnection(t),u.fire("drdElement.added",{element:t,di:c}))}return t},wi.prototype._getSource=function(e){var t,n;if(Yr(e,"dmn:Association")?n=e.sourceRef:Yr(e,"dmn:InformationRequirement")?n=e.requiredDecision||e.requiredInput:Yr(e,"dmn:KnowledgeRequirement")?n=e.requiredKnowledge:Yr(e,"dmn:AuthorityRequirement")&&(n=e.requiredDecision||e.requiredInput||e.requiredAuthority),n&&(t=n.href),t)return this._getShape(xi(t))},wi.prototype._getTarget=function(e){return Yr(e,"dmn:Association")?e.targetRef&&this._getShape(xi(e.targetRef.href)):this._getShape(e.$parent.id)},wi.prototype._getShape=function(e){return this._elementRegistry.get(e)};var ki={__depends__:[bi,{drdImporter:["type",wi]}]};var Ei={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,(function(e,n){return t[n]||"{"+n+"}"}))}]};function Ci(e){return e.originalEvent||e.srcEvent}function Oi(e,t){return(Ci(e)||e).button===t}function Si(e){return Oi(e,0)}function ji(e){var t=Ci(e)||e;return!!Si(e)&&(/mac/i.test(navigator.platform)?t.metaKey:t.ctrlKey)}function Ni(e){return!0}function Mi(e){return Si(e)||function(e){return Oi(e,1)}(e)}function Di(e,t,n){var r=this;function i(n,r,i){var o,a;(function(e,t){var n=l[e]||Si;return!n(t)})(n,r)||(i?a=t.getGraphics(i):(o=r.delegateTarget||r.target)&&(a=o,i=t.get(a)),a&&i&&!1===e.fire(n,{element:i,gfx:a,originalEvent:r})&&(r.stopPropagation(),r.preventDefault()))}var o={};function a(e){return o[e]}var s={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":Ni,"element.mousedown":Mi,"element.mouseup":Mi,"element.click":Mi,"element.dblclick":Mi};function u(e,t,n,r){var a=o[n]=function(e){i(n,e)};r&&(l[n]=r),a.$delegate=Jt.bind(e,"svg, .djs-element",t,a)}function c(e,t,n){var r=a(n);r&&Jt.unbind(e,t,r.$delegate)}e.on("canvas.destroy",(function(e){var t;t=e.svg,M(s,(function(e,n){c(t,n,e)}))})),e.on("canvas.init",(function(e){var t;t=e.svg,M(s,(function(e,n){u(t,n,e)}))})),e.on(["shape.added","connection.added"],(function(t){var n=t.element,r=t.gfx;e.fire("interactionEvents.createHit",{element:n,gfx:r})})),e.on(["shape.changed","connection.changed"],500,(function(t){var n=t.element,r=t.gfx;e.fire("interactionEvents.updateHit",{element:n,gfx:r})})),e.on("interactionEvents.createHit",500,(function(e){var t=e.element,n=e.gfx;r.createDefaultHit(t,n)})),e.on("interactionEvents.updateHit",(function(e){var t=e.element,n=e.gfx;r.updateDefaultHit(t,n)}));var p=h("djs-hit djs-hit-stroke"),f=h("djs-hit djs-hit-click-stroke"),d={all:h("djs-hit djs-hit-all"),"click-stroke":f,stroke:p,"no-move":h("djs-hit djs-hit-no-move")};function h(e,t){return t=$({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function m(e,t){var n=d[t];if(!n)throw new Error("invalid hit type <"+t+">");return An(e,n),e}function v(e,t){Dn(e,t)}this.removeHits=function(e){var t;M((t=".djs-hit",(e||document).querySelectorAll(t)),Ln)},this.createDefaultHit=function(e,t){var n,r=e.waypoints,i=e.isFrame;return r?this.createWaypointsHit(t,r):(n=i?"stroke":"all",this.createBoxHit(t,n,{width:e.width,height:e.height}))},this.createWaypointsHit=function(e,t){var n=lr(t);return m(n,"stroke"),v(e,n),n},this.createBoxHit=function(e,t,n){n=$({x:0,y:0},n);var r=Fn("rect");return m(r,t),An(r,n),v(e,r),r},this.updateDefaultHit=function(e,t){var n=on(".djs-hit",t);if(n)return e.waypoints?ur(n,e.waypoints):An(n,{width:e.width,height:e.height}),n},this.fire=i,this.triggerMouseEvent=function(e,t,n){var r=s[e];if(!r)throw new Error("unmapped DOM event name <"+e+">");return i(r,t,n)},this.mouseHandler=a,this.registerEvent=u,this.unregisterEvent=c}Di.$inject=["eventBus","elementRegistry","styles"];var Pi={__init__:["interactionEvents"],interactionEvents:["type",Di]};function Ri(e,t){this.offset=6;var n=t.cls("djs-outline",["no-fill"]),r=this;function i(e,t){var r=Fn("rect");return An(r,$({x:10,y:10,rx:4,width:100,height:100},n)),Dn(e,r),r}e.on(["shape.added","shape.changed"],500,(function(e){var t=e.element,n=e.gfx,o=on(".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=on(".djs-outline",n);o||(o=i(n)),r.updateConnectionOutline(o,t)}))}Ri.prototype.updateShapeOutline=function(e,t){An(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Ri.prototype.updateConnectionOutline=function(e,t){var n=cr(t);An(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Ri.$inject=["eventBus","styles","elementRegistry"];var Ai={__init__:["outline"],outline:["type",Ri]};function Bi(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],(function(e){var t=e.element;n.deselect(t)})),e.on(["diagram.clear","root.set"],(function(e){n.select(null)}))}Bi.$inject=["eventBus","canvas"],Bi.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(-1!==n){var r=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:t})}},Bi.prototype.get=function(){return this._selectedElements},Bi.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},Bi.prototype.select=function(e,t){var n=this._selectedElements,r=n.slice();x(e)||(e=e?[e]:[]);var i=this._canvas,o=i.getRootElement();e=e.filter((function(e){var t=i.findRoot(e);return o===t})),t?M(e,(function(e){-1===n.indexOf(e)&&n.push(e)})):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:n})};var Ii="hover",Ti="selected";function Li(e,t,n){this._canvas=e;var r=this;function i(t,n){e.addMarker(t,n)}function o(t,n){e.removeMarker(t,n)}this._multiSelectionBox=null,t.on("element.hover",(function(e){i(e.element,Ii)})),t.on("element.out",(function(e){o(e.element,Ii)})),t.on("selection.changed",(function(e){var t=e.oldSelection,n=e.newSelection;M(t,(function(e){-1===n.indexOf(e)&&o(e,Ti)})),M(n,(function(e){-1===t.indexOf(e)&&i(e,Ti)})),r._updateSelectionOutline(n)})),t.on("element.changed",(function(e){n.isSelected(e.element)&&r._updateSelectionOutline(n.get())}))}function $i(e,t,n,r){e.on("create.end",500,(function(e){var n=e.context,r=n.canExecute,i=n.elements,o=(n.hints||{}).autoSelect;if(r){if(!1===o)return;x(o)?t.select(o):t.select(i.filter(Vi))}})),e.on("connect.end",500,(function(e){var n=e.context.connection;n&&t.select(n)})),e.on("shape.move.end",500,(function(e){var n=e.previousSelection||[],i=r.get(e.context.shape.id);j(n,(function(e){return i.id===e.id}))||t.select(i)})),e.on("element.click",(function(e){if(Si(e)){var r=e.element;r===n.getRootElement()&&(r=null);var i=t.isSelected(r),o=t.get().length>1,a=ji(e)||function(e){var t=Ci(e)||e;return Si(e)&&t.shiftKey}(e);if(i&&o)return a?t.deselect(r):t.select(r);i?t.deselect(r):t.select(r,a)}}))}function Vi(e){return!e.hidden}Li.$inject=["canvas","eventBus","selection"],Li.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");$n(t);var n=e.length>1;if(In(this._canvas.getContainer())[n?"add":"remove"]("djs-multi-select"),n){var r=function(e){return{x:e.x-6,y:e.y-6,width:e.width+12,height:e.height+12}}(cr(e)),i=Fn("rect");An(i,$({rx:3},r)),In(i).add("djs-selection-outline"),Dn(t,i)}},$i.$inject=["eventBus","selection","canvas","elementRegistry"];var zi={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Pi,Ai],selection:["type",Bi],selectionVisuals:["type",Li],selectionBehavior:["type",$i]};function Ui(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}Ui.prototype.next=function(){return this._prefix+ ++this._counter};var Fi=new Ui("ov");function Gi(e,t,n,r){var i,o;this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=Fi,this._overlayDefaults=$({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(i=n.getContainer(),Lt(o=rn('<div class="djs-overlay-container" />'),{position:"absolute",width:0,height:0}),i.insertBefore(o,i.firstChild),o),this._init()}function qi(e,t,n){Lt(e,{left:t+"px",top:n+"px"})}function Wi(e,t){e.style.display=!1===t?"none":""}function Hi(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}Gi.$inject=["config.overlays","eventBus","canvas","elementRegistry"],Gi.prototype.get=function(e){if(O(e)&&(e={id:e}),O(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?N(t.overlays,R({type:e.type})):t.overlays.slice():[]}return e.type?N(this._overlays,R({type:e.type})):e.id?this._overlays[e.id]:null},Gi.prototype.add=function(e,t,n){if(k(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var r=this._ids.next();return n=$({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r},Gi.prototype.remove=function(e){var t=this.get(e)||[];x(t)||(t=[t]);var n=this;M(t,(function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(an(e.html),an(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var r=t.overlays.indexOf(e);-1!==r&&t.overlays.splice(r,1)}}))},Gi.prototype.isShown=function(){return"none"!==this._overlayRoot.style.display},Gi.prototype.show=function(){Wi(this._overlayRoot)},Gi.prototype.hide=function(){Wi(this._overlayRoot,!1)},Gi.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Ft(this._overlayRoot)},Gi.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,i=t.y;if(t.waypoints){var o=cr(t);r=o.x,i=o.y}qi(n,r,i),$t(e.html,"data-container-id",t.id)},Gi.prototype._updateOverlay=function(e){var t,n,r=e.position,i=e.htmlContainer,o=e.element,a=r.left,s=r.top;void 0!==r.right&&(t=o.waypoints?cr(o).width:o.width,a=-1*r.right+t);void 0!==r.bottom&&(n=o.waypoints?cr(o).height:o.height,s=-1*r.bottom+n);qi(i,a||0,s||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Gi.prototype._createOverlayContainer=function(e){var t=rn('<div class="djs-overlays" />');Lt(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},Gi.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Hi(this._overlayRoot,n)},Gi.prototype._getOverlayContainer=function(e,t){var n=j(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},Gi.prototype._addOverlay=function(e){var t,n,r=e.id,i=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),O(o)&&(o=rn(o)),n=this._getOverlayContainer(i),Lt(t=rn('<div class="djs-overlay" data-overlay-id="'+r+'">'),{position:"absolute"}),t.appendChild(o),e.type&&zt(t).add("djs-overlay-"+e.type),Wi(t,this._canvas.findRoot(i)===this._canvas.getRootElement()),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[r]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Gi.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=this._canvas.findRoot(e.element),i=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,s=!0;(r!==this._canvas.getRootElement()||n&&(_(i)&&i>t.scale||_(o)&&o<t.scale))&&(s=!1),Wi(a,s),this._updateOverlayScale(e,t)},Gi.prototype._updateOverlayScale=function(e,t){var n,r,i,o=e.scale,a=e.htmlContainer,s="";!0!==o&&(!1===o?(n=1,r=1):(n=o.min,r=o.max),_(n)&&t.scale<n&&(i=(1/t.scale||1)*n),_(r)&&t.scale>r&&(i=(1/t.scale||1)*r)),_(i)&&(s="scale("+i+","+i+")"),Hi(a,s)},Gi.prototype._updateOverlaysVisibilty=function(e){var t=this;M(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},Gi.prototype._init=function(){var e=this._eventBus,t=this;e.on("canvas.viewbox.changing",(function(e){t.hide()})),e.on("canvas.viewbox.changed",(function(e){var n;n=e.viewbox,t._updateRoot(n),t._updateOverlaysVisibilty(n),t.show()})),e.on(["shape.remove","connection.remove"],(function(e){var n=e.element;M(t.get({element:n}),(function(e){t.remove(e.id)}));var r=t._getOverlayContainer(n);if(r){an(r.html);var i=t._overlayContainers.indexOf(r);-1!==i&&t._overlayContainers.splice(i,1)}})),e.on("element.changed",500,(function(e){var n=e.element,r=t._getOverlayContainer(n,!0);r&&(M(r.overlays,(function(e){t._updateOverlay(e)})),t._updateOverlayContainer(r))})),e.on("element.marker.update",(function(e){var n=t._getOverlayContainer(e.element,!0);n&&zt(n.html)[e.add?"add":"remove"](e.marker)})),e.on("root.set",(function(){t._updateOverlaysVisibilty(t._canvas.viewbox())})),e.on("diagram.clear",this.clear,this)};var Ki={__init__:["overlays"],overlays:["type",Gi]};function Xi(e,t,n){this._eventBus=e,this._canvas=t,this._translate=n,e.on("diagram.init",(function(){this._init()}),this),e.on("import.done",(function(e){e.error||this.update()}),this),this.HTML_MARKUP='<div class="dmn-definitions"><div class="dmn-definitions-name" title="'+this._translate("Definition Name")+'" spellcheck="false"></div><div class="dmn-definitions-id" title="'+this._translate("Definition ID")+'" spellcheck="false"></div></div>'}function Yi(e,t){function n(e,n){zt(t.getContainer()).toggle(e,n)}e.on("palette.create",(function(){n("with-palette",!0)})),e.on("palette.changed",(function(e){n("with-palette-two-column",e.twoColumn)}))}Xi.$inject=["eventBus","canvas","translate"],Xi.prototype._init=function(){var e=this._canvas,t=this._eventBus,n=e.getContainer(),r=this._container=rn(this.HTML_MARKUP);n.appendChild(r),this.nameElement=on(".dmn-definitions-name",this._container),this.idElement=on(".dmn-definitions-id",this._container),Jt.bind(r,".dmn-definitions-name, .dmn-definitions-id","mousedown",(function(e){e.stopPropagation()})),t.fire("definitionIdView.create",{html:r})},Xi.prototype.update=function(){var e=this._canvas.getRootElement().businessObject;this.nameElement.textContent=e.name,this.idElement.textContent=e.id},Yi.$inject=["eventBus","canvas"];var Qi={__depends__:[Ei],__init__:["definitionPropertiesView","definitionPropertiesPaletteAdapter"],definitionPropertiesView:["type",Xi],definitionPropertiesPaletteAdapter:["type",Yi]},Zi=[{className:"dmn-icon-decision-table",matches:function(e){var t=e.businessObject;return Yr(t,"dmn:Decision")&&Yr(t.decisionLogic,"dmn:DecisionTable")}},{className:"dmn-icon-literal-expression",matches:function(e){var t=e.businessObject;return Yr(t,"dmn:Decision")&&Yr(t.decisionLogic,"dmn:LiteralExpression")}}],Ji=function(){function e(t,n,i,o){var a=this;r(this,e),this._injector=t,this._eventBus=n,this._overlays=i,this._config=o||{enabled:!0},n.on(["shape.added"],(function(e){for(var t=e.element,n=0;n<Zi.length;n++){var r=Zi[n],i=r.matches,o=r.className;i&&i(t)&&a.addOverlay(t,o)}}))}return o(e,[{key:"addOverlay",value:function(e,t){var n=rn('\n      <div class="drill-down-overlay">\n        <span class="'.concat(t,'"></span>\n      </div>\n    ')),r=this._overlays.add(e,{position:{top:2,left:2},html:n});!1!==this._config.enabled&&(zt(n).add("interactive"),this.bindEventListener(e,n,r))}},{key:"bindEventListener",value:function(e,t,n){var r=this,i=this._overlays,o=this._eventBus,a=i._overlayRoot;Jt.bind(a,'[data-overlay-id="'+n+'"]',"click",(function(){!1!==o.fire("drillDown.click",{element:e})&&r.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)}}]),e}();Ji.$inject=["injector","eventBus","overlays","config.drillDown"];var eo={__depends__:[Ki],__init__:["drillDown"],drillDown:["type",Ji]},to='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21" style="vertical-align:middle"><path fill="#000000" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="#000000" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>';
3/**
4   * This file must not be changed or exchanged.
5   *
6   * @see http://bpmn.io/license for more information.
7   */function no(e){return e.join(";")}var ro,io='<div class="bjs-powered-by-lightbox" style="'+no(["z-index: 1001","position: fixed","top: 0","left: 0","right: 0","bottom: 0"])+'"><div class="backdrop" style="'+no(["width: 100%","height: 100%","background: rgba(40,40,40,0.2)"])+'"></div><div class="notice" style="'+no(["position: absolute","left: 50%","top: 40%","transform: translate(-50%)","width: 260px","padding: 10px","background: white","box-shadow: 0 1px 4px rgba(0,0,0,0.3)","font-family: Helvetica, Arial, sans-serif","font-size: 14px","display: flex","line-height: 1.3"])+'"><a href="https://bpmn.io" target="_blank" rel="noopener" style="margin: 15px 20px 15px 10px; align-self: center;">'+to+'</a><span>Web-based tooling for BPMN, DMN and CMMN diagrams powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>';var oo=["additionalModules","canvas"];function ao(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function so(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ao(Object(n),!0).forEach((function(t){lo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ao(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function lo(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uo(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function co(e){
8/**
9   * Adds the project logo to the diagram container as
10   * required by the bpmn.io license.
11   *
12   * @see http://bpmn.io/license
13   *
14   * @param {Element} container
15   */
16var t,n;this._container=this._createContainer(),t=this._container,n=rn('<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;">'+to+"</a>"),t.appendChild(n),Yt.bind(n,"click",(function(e){ro||(ro=rn(io),Jt.bind(ro,".backdrop","click",(function(e){document.body.removeChild(ro)}))),document.body.appendChild(ro),e.preventDefault()})),this._init(this._container,e)}jn(co,Xr),co.prototype.saveSVG=sn((function(e){var t=this;return new Promise((function(e){var n=t.get("canvas"),r=n.getActiveLayer(),i=on("defs",n._svg),o=Jn(r),a=i&&i.outerHTML||"",s=r.getBBox();e({svg:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with dmn-js / http://bpmn.io --\x3e\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+s.width+'" height="'+s.height+'" viewBox="'+s.x+" "+s.y+" "+s.width+" "+s.height+'" version="1.1">'+a+o+"</svg>"})}))})),co.prototype.getModules=function(){return this._modules},co.prototype.destroy=function(){Xr.prototype.destroy.call(this),an(this._container)},co.prototype.on=function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)},co.prototype.off=function(e,t){this.get("eventBus").off(e,t)},co.prototype._init=function(e,t){var n=t.additionalModules,r=t.canvas,i=uo(t,oo),o=t.modules||this.getModules(),a=[].concat([{drd:["value",this]}],v(o),v(n||[])),s=so(so({},i),{},{canvas:so(so({},r),{},{container:e}),modules:a});Xr.call(this,s),t&&t.container&&this.attachTo(t.container)},co.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},co.prototype._createContainer=function(){return rn('<div class="dmn-drd-container"></div>')},co.prototype.open=function(e){var t=this;return new Promise((function(n,r){var i;try{return t._definitions&&t.clear(),t._definitions=e,function(e,t,n){var r,i=e.get("drdImporter"),o=e.get("eventBus"),a=[];o.fire("import.start",{definitions:t});try{!function(e){new Jr({root:function(e){return i.root(e)},element:function(e,t){return i.add(e,t)},error:function(e,t){a.push({message:e,context:t})}}).handleDefinitions(e)}(t)}catch(e){r=e}o.fire("import.done",{error:r,warnings:a}),n(r,a)}(t,e,(function(e,t){e?(e.warnings=t||[],r(e)):n({warnings:t||[]})}))}catch(e){i=e}i?(i.warnings=i.warnings||[],r(i)):n({warnings:[]})}))},co.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()},co.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},co.prototype._modules=[ki,Ei,zi,Ki,Qi,eo];var po=o((function e(t){r(this,e),$(this,t),mo(this,"businessObject",{writable:!0})})),fo={root:function(e){s(n,e);var t=d(n);function n(e){var i;return r(this,n),mo(p(i=t.call(this,e)),"rows",{enumerable:!0,value:i.rows||[]}),mo(p(i),"cols",{enumerable:!0,value:i.cols||[]}),i}return o(n)}(po),row:function(e){s(n,e);var t=d(n);function n(e){var i;return r(this,n),mo(p(i=t.call(this,e)),"root",{writable:!0}),mo(p(i),"cells",{enumerable:!0,value:i.cells||[]}),i}return o(n)}(po),col:function(e){s(n,e);var t=d(n);function n(e){var i;return r(this,n),mo(p(i=t.call(this,e)),"root",{writable:!0}),mo(p(i),"cells",{enumerable:!0,value:i.cells||[]}),i}return o(n)}(po),cell:function(e){s(n,e);var t=d(n);function n(e){var i;return r(this,n),mo(p(i=t.call(this,e)),"row",{writable:!0}),mo(p(i),"col",{writable:!0}),i}return o(n)}(po)};function ho(e,t){var n=fo[e];if(!n)throw new Error("unknown type "+e);return new n(t)}function mo(e,t,n){Object.defineProperty(e,t,n)}var vo=function(){function e(){r(this,e),this._uid=12}return o(e,[{key:"create",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.id||(t.id=e+"_"+this._uid++),ho(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}(),yo=function(){function e(t){r(this,e),this._eventBus=t,this._elements={},t.on("table.clear",this.clear.bind(this))}return o(e,[{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 go(this._elements)}},{key:"forEach",value:function(e){go(this._elements).forEach((function(t){return e(t)}))}},{key:"filter",value:function(e){return go(this._elements).filter((function(t){return e(t)}))}},{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")}}]),e}();function go(e){return Object.keys(e).map((function(t){return e[t]}))}yo.$inject=["eventBus"];var bo=function(){function e(t){var n=this;r(this,e),this._listeners={},t.on("elements.changed",(function(e){var t=e.elements;n.elementsChanged(t)})),t.on("root.remove",(function(e){var r=e.root.id;n._listeners[r]&&t.once("root.add",(function(e){var t=e.root.id;n.updateId(r,t)}))})),t.on("element.updateId",(function(e){var t=e.element,r=e.newId;n.updateId(t.id,r)}))}return o(e,[{key:"elementsChanged",value:function(e){for(var t={},n=e.length,r=0;r<n;r++){var i=e[r].id;if(t[i])return;t[i]=!0;var o=this._listeners[i]&&this._listeners[i].length;if(o)for(var a=0;a<o;a++)this._listeners[i][a]&&this._listeners[i][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}();bo.$inject=["eventBus"];var wo=function(){function e(){r(this,e),this._listeners={}}return o(e,[{key:"getComponent",value:function(e,t){var n=this._listeners[e];if(n){for(var r,i=0;i<n.length&&!(r=n[i].callback(t));i++);return r}}},{key:"getComponents",value:function(e,t){var n=this._listeners[e],r=[];if(!n)return r;for(var i=0;i<n.length;i++){var o=n[i].callback(t);o&&r.push(o)}return r.length,r}},{key:"onGetComponent",value:function(e,t,n){if(C(t)&&(n=t,t=1e3),!E(t))throw new Error("priority must be a number");var r,i,o=this._getListeners(e),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,r,i=this._getListeners(e);if(t)for(r=i.length-1;n=i[r];r--)n.callback===t&&i.splice(r,1);else i.length=0}},{key:"_getListeners",value:function(e){var t=this._listeners[e];return t||(this._listeners[e]=t=[]),t}}]),e}(),_o="$NO_OP",xo=!("undefined"==typeof window||!window.document),ko=Array.isArray;function Eo(e){var t=n(e);return"string"===t||"number"===t}function Co(e){return Do(e)||Mo(e)}function Oo(e){return Mo(e)||!1===e||function(e){return!0===e}(e)||Do(e)}function So(e){return"function"==typeof e}function jo(e){return"string"==typeof e}function No(e){return"number"==typeof e}function Mo(e){return null===e}function Do(e){return void 0===e}function Po(e){throw e||(e="a runtime error occured! Use Inferno in development environment to find the error."),new Error("Inferno Error: "+e)}function Ro(e){console.error(e)}function Ao(e,t){var n={};if(e)for(var r in e)n[r]=e[r];if(t)for(var i in t)n[i]=t[i];return n}function Bo(e){var t;if(ko(e))t="Array("+(e.length>3?e.slice(0,3).toString()+",...":e.toString())+")";else if(Eo(e))t="Text("+e+")";else if(Oo(e))t="InvalidVNode("+e+")";else{var n=e.flags;if(481&n)t="<"+e.type+(e.className?' class="'+e.className+'"':"")+">";else if(16&n)t="Text("+e.children+")";else if(1024&n)t="Portal*";else{var r=e.type;t="<"+(r.name||r.displayName||r.constructor.name||(r.toString().match(/^function\s*([^\s(]+)/)||[])[1])+" />"}}return">> "+t+"\n"}function Io(e,t){for(var r={},i=0,o=e.length;i<o;i++){var a=e[i];if(ko(a))return"Encountered ARRAY in mount, array must be flattened, or normalize used. Location: \n"+Bo(a);if(Oo(a)){if(t)return"Encountered invalid node when preparing to keyed algorithm. Location: \n"+Bo(a);if(0!==Object.keys(r).length)return"Encountered invalid node with mixed keys. Location: \n"+Bo(a)}else{"object"===n(a)&&(a.isValidated=!0);var s=a.key;if(!Co(s)&&!Eo(s))return"Encountered child vNode where key property is not string or number. Location: \n"+Bo(a);var l=a.children,u=a.childFlags;if(!Oo(l)){var c=void 0;if(12&u?c=Io(l,8&a.childFlags):2===u&&(c=Io([l],8&a.childFlags)),c)return c+=Bo(a)}if(t&&Co(s))return"Encountered child without key during keyed algorithm. If this error points to Array make sure children is flat list. Location: \n"+Bo(a);if(t||!Co(s)){if(r[s])return"Encountered two children with same key: {"+s+"}. Location: \n"+Bo(a);r[s]=!0}else if(0!==Object.keys(r).length)return"Encountered children with key missing. Location: \n"+Bo(a)}}}function To(e){if(!(1&e.childFlags)&&(64&e.flags&&Po("input elements can't have children."),128&e.flags&&Po("textarea elements can't have children."),481&e.flags)){var t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],n=e.type.toLowerCase();"media"===n&&Po("media elements can't have children.");var r=t.indexOf(n);-1!==r&&Po(t[r]+" elements can't have children.")}}function Lo(e){if(!1===e.isValidated&&e.children&&481&e.flags){var t=Io(Array.isArray(e.children)?e.children:[e.children],(8&e.childFlags)>0);t&&Po(t+Bo(e))}e.isValidated=!0}var $o="$";function Vo(e,t,n,r,i,o,a,s){return{childFlags:e,children:t,className:n,dom:null,flags:r,isValidated:!1,key:void 0===i?null:i,parentVNode:null,props:void 0===o?null:o,ref:void 0===a?null:a,type:s}}function zo(e,t,n,r,i,o,a,s){14&e&&Po("Creating Component vNodes using createVNode is not allowed. Use Inferno.createComponentVNode method.");var l=void 0===i?1:i,u=Vo(l,r,n,e,a,o,s,t);return 0===l&&Ko(u,u.children),To(u),u}function Uo(e,t,n,r,i){1&e&&Po("Creating element vNodes using createComponentVNode is not allowed. Use Inferno.createVNode method."),(2&e)>0&&(e=t.prototype&&So(t.prototype.render)?4:8);var o=t.defaultProps;if(!Co(o))for(var a in n||(n={}),o)Do(n[a])&&(n[a]=o[a]);if((8&e)>0){var s=t.defaultHooks;if(!Co(s))if(i)for(var l in s)Do(i[l])&&(i[l]=s[l]);else i=s}var u=Vo(1,null,null,e,r,n,i,t),c=Xo.createVNode;return So(c)&&c(u),u}function Fo(e,t){return Vo(1,Co(e)?"":e,null,16,t,null,null,null)}function Go(e){var t=e.props;if(t){var n=e.flags;481&n&&(void 0!==t.children&&Co(e.children)&&Ko(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?Ao(e.ref,t.ref):t.ref,t.ref=void 0)}return e}function qo(e){var t,n=e.flags;if(14&n){var r,i=e.props;if(!Mo(i))for(var o in r={},i)r[o]=i[o];t=Uo(n,e.type,r,e.key,e.ref)}else 481&n?t=zo(n,e.type,e.className,e.children,e.childFlags,e.props,e.key,e.ref):16&n?t=Fo(e.children,e.key):1024&n&&(t=e);return t}function Wo(){return Fo("",null)}function Ho(e,t,n,r){for(var i=e.length;n<i;n++){var o=e[n];if(!Oo(o)){var a=r+$o+n;if(ko(o))Ho(o,t,0,a);else{if(Eo(o))o=Fo(o,a);else{var s=o.key,l=jo(s)&&s[0]===$o;Mo(o.dom)&&!l||(o=qo(o)),Mo(s)||l?o.key=a:o.key=r+s}t.push(o)}}}}function Ko(e,t){var n,r=1;if(Oo(t))n=t;else if(jo(t))r=2,n=Fo(t);else if(No(t))r=2,n=Fo(t+"");else if(ko(t)){var i=t.length;if(0===i)n=null,r=1;else{(Object.isFrozen(t)||!0===t.$)&&(t=t.slice()),r=8;for(var o=0;o<i;o++){var a=t[o];if(Oo(a)||ko(a)){n=n||t.slice(0,o),Ho(t,n,o,"");break}if(Eo(a))(n=n||t.slice(0,o)).push(Fo(a,$o+o));else{var s=a.key,l=Mo(a.dom),u=Mo(s),c=!u&&jo(s)&&s[0]===$o;!l||u||c?(n=n||t.slice(0,o),l&&!c||(a=qo(a)),(u||c)&&(a.key=$o+o),n.push(a)):n&&n.push(a)}}(n=n||t).$=!0}}else n=t,Mo(t.dom)||(n=qo(t)),r=2;return e.children=n,e.childFlags=r,To(e),e}var Xo={afterRender:null,beforeRender:null,createVNode:null,renderComplete:null},Yo="http://www.w3.org/1999/xlink",Qo="http://www.w3.org/XML/1998/namespace",Zo={"xlink:actuate":Yo,"xlink:arcrole":Yo,"xlink:href":Yo,"xlink:role":Yo,"xlink:show":Yo,"xlink:title":Yo,"xlink:type":Yo,"xml:base":Qo,"xml:lang":Qo,"xml:space":Qo},Jo={},ea=[];function ta(e,t){e.appendChild(t)}function na(e,t,n){Co(n)?ta(e,t):e.insertBefore(t,n)}function ra(e,t,n){e.replaceChild(t,n)}function ia(e){for(var t;void 0!==(t=e.shift());)t()}Object.freeze(Jo);var oa={},aa={};function sa(e,t,n){var r=oa[e],i=n.$EV;t?(r||(aa[e]=function(e){var t=function(t){var n=t.type,r="click"===n||"dblclick"===n;if(r&&0!==t.button)return t.stopPropagation(),!1;t.stopPropagation=ua;var i={dom:document};Object.defineProperty(t,"currentTarget",{configurable:!0,get:function(){return i.dom}}),function(e,t,n,r,i){var o=t;for(;!Mo(o);){if(n&&o.disabled)return;var a=o.$EV;if(a){var s=a[r];if(s&&(i.dom=o,s.event?s.event(s.data,e):s(e),e.cancelBubble))return}o=o.parentNode}}(t,t.target,r,e,i)};return document.addEventListener(la(e),t),t}(e),oa[e]=0),i||(i=n.$EV={}),i[e]||oa[e]++,i[e]=t):i&&i[e]&&(oa[e]--,1===r&&(document.removeEventListener(la(e),aa[e]),aa[e]=null),i[e]=t)}function la(e){return e.substr(2).toLowerCase()}function ua(){this.cancelBubble=!0,this.immediatePropagationStopped||this.stopImmediatePropagation()}function ca(e,t){var n=document.createElement("i");return n.innerHTML=t,n.innerHTML===e.innerHTML}function pa(e,t,n){if(e[t]){var r=e[t];r.event?r.event(r.data,n):r(n)}else{var i=t.toLowerCase();e[i]&&e[i](n)}}function fa(e,t){var n=function(n){n.stopPropagation();var r=this.$V;if(r){var i=r.props||Jo,o=r.dom;if(jo(e))pa(i,e,n);else for(var a=0;a<e.length;a++)pa(i,e[a],n);if(So(t)){var s=this.$V,l=s.props||Jo;t(l,o,!1,s)}}};return Object.defineProperty(n,"wrapped",{configurable:!1,enumerable:!1,value:!0,writable:!1}),n}function da(e){return"checkbox"===e||"radio"===e}var ha=fa("onInput",ya),ma=fa(["onClick","onChange"],ya);function va(e){e.stopPropagation()}function ya(e,t){var n=e.type,r=e.value,i=e.checked,o=e.multiple,a=e.defaultValue,s=!Co(r);n&&n!==t.type&&t.setAttribute("type",n),Co(o)||o===t.multiple||(t.multiple=o),Co(a)||s||(t.defaultValue=a+""),da(n)?(s&&(t.value=r),Co(i)||(t.checked=i)):s&&t.value!==r?(t.defaultValue=r,t.value=r):Co(i)||(t.checked=i)}function ga(e,t){if("optgroup"===e.type){var n=e.children,r=e.childFlags;if(12&r)for(var i=0,o=n.length;i<o;i++)ba(n[i],t);else 2===r&&ba(n,t)}else ba(e,t)}function ba(e,t){var n=e.props||Jo,r=e.dom;r.value=n.value,ko(t)&&-1!==t.indexOf(n.value)||n.value===t?r.selected=!0:Co(t)&&Co(n.selected)||(r.selected=n.selected||!1)}va.wrapped=!0;var wa=fa("onChange",_a);function _a(e,t,n,r){var i=Boolean(e.multiple);Co(e.multiple)||i===t.multiple||(t.multiple=i);var o=r.childFlags;if(0==(1&o)){var a=r.children,s=e.value;if(n&&Co(s)&&(s=e.defaultValue),12&o)for(var l=0,u=a.length;l<u;l++)ga(a[l],s);else 2===o&&ga(a,s)}}var xa=fa("onInput",Ea),ka=fa("onChange");function Ea(e,t,n){var r=e.value,i=t.value;if(Co(r)){if(n){var o=e.defaultValue;Co(o)||o===i||(t.defaultValue=o,t.value=o)}}else i!==r&&(t.defaultValue=r,t.value=r)}function Ca(e,t,n,r,i,o){64&e?ya(r,n):256&e?_a(r,n,i,t):128&e&&Ea(r,n,i),o&&(n.$V=t)}function Oa(e,t,n){64&e?function(e,t){da(t.type)?(e.onchange=ma,e.onclick=va):e.oninput=ha}(t,n):256&e?function(e){e.onchange=wa}(t):128&e&&function(e,t){e.oninput=xa,t.onChange&&(e.onchange=ka)}(t,n)}function Sa(e){return e.type&&da(e.type)?!Co(e.checked):!Co(e.value)}function ja(e,t){Na(e),t&&e.dom&&(!function(e,t){e.removeChild(t)}(t,e.dom),e.dom=null)}function Na(e){var t=e.flags;if(481&t){var n=e.ref,r=e.props;So(n)&&n(null);var i=e.children,o=e.childFlags;if(12&o?Ma(i):2===o&&Na(i),!Mo(r))for(var a in r)switch(a){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":sa(a,null,e.dom)}}else{var s=e.children;if(s)if(14&t){var l=e.ref;4&t?(So(s.componentWillUnmount)&&s.componentWillUnmount(),So(l)&&l(null),s.$UN=!0,s.$LI&&Na(s.$LI)):(!Co(l)&&So(l.onComponentWillUnmount)&&l.onComponentWillUnmount(e.dom,e.props||Jo),Na(s))}else 1024&t&&ja(s,e.type)}}function Ma(e){for(var t=0,n=e.length;t<n;t++)Na(e[t])}function Da(e,t){Ma(t),e.textContent=""}function Pa(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 Ra(e,t,n,r,i,o,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":sa(e,n,r);break;case"children":case"childrenType":case"className":case"defaultValue":case"key":case"multiple":case"ref":break;case"autoFocus":r.autofocus=!!n;break;case"allowfullscreen":case"autoplay":case"capture":case"checked":case"controls":case"default":case"disabled":case"hidden":case"indeterminate":case"loop":case"muted":case"novalidate":case"open":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"selected":r[e]=!!n;break;case"defaultChecked":case"value":case"volume":if(o&&"value"===e)return;var s=Co(n)?"":n;r[e]!==s&&(r[e]=s);break;case"dangerouslySetInnerHTML":var l=t&&t.__html||"",u=n&&n.__html||"";l!==u&&(Co(u)||ca(r,u)||(Mo(a)||(12&a.childFlags?Ma(a.children):2===a.childFlags&&Na(a.children),a.children=null,a.childFlags=1),r.innerHTML=u));break;default:"o"===e[0]&&"n"===e[1]?function(e,t,n){var r=e.toLowerCase();if(So(t)||Co(t)){var i=n[r];i&&i.wrapped||(n[r]=t)}else{var o=t.event;o&&So(o)?n[r]=function(e,t){return function(n){e(t.data,n)}}(o,t):Po('an event on a VNode "'+e+'". was not a function or a valid linkEvent.')}}(e,n,r):Co(n)?r.removeAttribute(e):"style"===e?function(e,t,n){var r,i,o=n.style;if(jo(t))o.cssText=t;else if(Co(e)||jo(e))for(r in t)i=t[r],o[r]=No(i)?Pa(r,i):i;else{for(r in t)(i=t[r])!==e[r]&&(o[r]=No(i)?Pa(r,i):i);for(r in e)Co(t[r])&&(o[r]="")}}(t,n,r):i&&Zo[e]?r.setAttributeNS(Zo[e],e,n):r.setAttribute(e,n)}}function Aa(e,t,n,r,i){var o=!1,a=(448&t)>0;for(var s in a&&(o=Sa(n))&&Oa(t,r,n),n)Ra(s,null,n[s],r,i,o,null);a&&Ca(t,e,r,n,!0,o)}function Ba(e,t,n,r){var i=new t(n,r);if(e.children=i,i.$V=e,i.$BS=!1,i.context=r,i.props===Jo&&(i.props=n),i.$UN=!1,So(i.componentWillMount)){if(i.$BR=!0,i.componentWillMount(),i.$PSS){var o=i.state,a=i.$PS;if(Mo(o))i.state=a;else for(var s in a)o[s]=a[s];i.$PSS=!1,i.$PS=null}i.$BR=!1}So(Xo.beforeRender)&&Xo.beforeRender(i);var l,u=Ia(i.render(n,i.state,r),e);return So(i.getChildContext)&&(l=i.getChildContext()),Co(l)?i.$CX=r:i.$CX=Ao(r,l),So(Xo.afterRender)&&Xo.afterRender(i),i.$LI=u,i}function Ia(e,t){return ko(e)&&Po("a valid Inferno VNode (or null) must be returned from a component render. You may have returned an array or an invalid object."),Oo(e)?e=Wo():Eo(e)?e=Fo(e,null):(e.dom&&(e=qo(e)),14&e.flags&&(e.parentVNode=t)),e}function Ta(e,t,r,i){var o=e.flags;return 481&o?$a(e,t,r,i):14&o?function(e,t,n,r,i){var o,a=e.type,s=e.props||Jo,l=e.ref;if(i){var u=Ba(e,a,s,n);e.dom=o=Ta(u.$LI,null,u.$CX,r),za(e,l,u),u.$UPD=!1}else{var c=Ia(a(s,n),e);e.children=c,e.dom=o=Ta(c,null,n,r),Ua(s,l,o)}Mo(t)||ta(t,o);return o}(e,t,r,i,(4&o)>0):512&o||16&o?La(e,t):1024&o?(Ta(e.children,e.type,r,!1),e.dom=La(Wo(),t)):void("object"===n(e)?Po("mount() received an object that's not a valid VNode, you should stringify it first, fix createVNode flags or call normalizeChildren. Object: \""+JSON.stringify(e)+'".'):Po('mount() expects a valid VNode, instead it received an object with the type "'+n(e)+'".'))}function La(e,t){var n=e.dom=document.createTextNode(e.children);return Mo(t)||ta(t,n),n}function $a(e,t,n,r){var i=e.flags,o=e.children,a=e.props,s=e.className,l=e.ref,u=e.childFlags;r=r||(32&i)>0;var c=function(e,t){return t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}(e.type,r);if(e.dom=c,Co(s)||""===s||(r?c.setAttribute("class",s):c.className=s),Lo(e),Mo(t)||ta(t,c),0==(1&u)){var p=!0===r&&"foreignObject"!==e.type;2===u?Ta(o,c,n,p):12&u&&Va(o,c,n,p)}return Mo(a)||Aa(e,i,a,c,r),jo(l)&&Po('string "refs" are not supported in Inferno 1.0. Use callback "refs" instead.'),So(l)&&Fa(c,l),c}function Va(e,t,n,r){for(var i=0,o=e.length;i<o;i++){var a=e[i];Mo(a.dom)||(e[i]=a=qo(a)),Ta(a,t,n,r)}}function za(e,t,r){So(t)?t(r):Eo(t)?Po('string "refs" are not supported in Inferno 1.0. Use callback "refs" instead.'):!Co(t)&&"object"===n(t)&&4&e.flags&&Po("functional component lifecycle events are not supported on ES2015 class components."),So(r.componentDidMount)&&ea.push(function(e){return function(){e.$UPD=!0,e.componentDidMount(),e.$UPD=!1}}(r))}function Ua(e,t,n){Co(t)||(So(t.onComponentWillMount)&&t.onComponentWillMount(e),So(t.onComponentDidMount)&&ea.push(function(e,t,n){return function(){return e.onComponentDidMount(t,n)}}(t,n,e)))}function Fa(e,t){ea.push((function(){return t(e)}))}function Ga(e,t,n,r){var i=e.children,o=e.props,a=e.className,s=e.flags,l=e.ref;if(r=r||(32&s)>0,1!==t.nodeType||t.tagName.toLowerCase()!==e.type){Ro("Inferno hydration: Server-side markup doesn't match client-side markup or Initial render target is not empty");var u=$a(e,null,n,r);e.dom=u,ra(t.parentNode,u,t)}else{e.dom=t;var c=t.firstChild,p=e.childFlags;if(0==(1&p)){for(var f=null;c;)f=c.nextSibling,8===c.nodeType&&("!"===c.data?t.replaceChild(document.createTextNode(""),c):t.removeChild(c)),c=f;if(c=t.firstChild,2===p)Mo(c)?Ta(i,t,n,r):(f=c.nextSibling,qa(i,c,n,r),c=f);else if(12&p)for(var d=0,h=i.length;d<h;d++){var m=i[d];Mo(c)?Ta(m,t,n,r):(f=c.nextSibling,qa(m,c,n,r),c=f)}for(;c;)f=c.nextSibling,t.removeChild(c),c=f}else Mo(t.firstChild)||function(e,t){return Boolean(t&&t.dangerouslySetInnerHTML&&t.dangerouslySetInnerHTML.__html&&ca(e,t.dangerouslySetInnerHTML.__html))}(t,o)||(t.textContent="",448&s&&(t.defaultValue=""));Mo(o)||Aa(e,s,o,t,r),Co(a)?""!==t.className&&t.removeAttribute("class"):r?t.setAttribute("class",a):t.className=a,So(l)?Fa(t,l):jo(l)&&Po('string "refs" are not supported in Inferno 1.0. Use callback "refs" instead.')}}function qa(e,t,r,i){var o=e.flags;14&o?function(e,t,n,r,i){var o=e.type,a=e.ref,s=e.props||Jo;if(i){var l=Ba(e,o,s,n),u=l.$LI;qa(u,t,l.$CX,r),e.dom=u.dom,za(e,a,l),l.$UPD=!1}else{var c=Ia(o(s,n),e);qa(c,t,n,r),e.children=c,e.dom=c.dom,Ua(s,a,t)}}(e,t,r,i,(4&o)>0):481&o?Ga(e,t,r,i):16&o?function(e,t){if(3!==t.nodeType){var n=La(e,null);e.dom=n,ra(t.parentNode,n,t)}else{var r=e.children;t.nodeValue!==r&&(t.nodeValue=r),e.dom=t}}(e,t):512&o?e.dom=t:(Po('hydrate() expects a valid VNode, instead it received an object with the type "'+n(e)+'".'),Po())}function Wa(e,t,n,r,i){Na(e),ra(n,Ta(t,null,r,i),e.dom)}function Ha(e,t,n,r,i){var o=0|t.flags;e.flags!==o||2048&o?Wa(e,t,n,r,i):481&o?function(e,t,n,r,i,o){var a=t.type;if(e.type!==a)Wa(e,t,n,r,i);else{var s,l=e.dom,u=e.props,c=t.props,p=!1,f=!1;if(t.dom=l,i=i||(32&o)>0,u!==c){var d=u||Jo;if((s=c||Jo)!==Jo)for(var h in(p=(448&o)>0)&&(f=Sa(s)),s){var m=d[h],v=s[h];m!==v&&Ra(h,m,v,l,i,f,e)}if(d!==Jo)for(var y in d)s.hasOwnProperty(y)||Co(d[y])||Ra(y,d[y],null,l,i,f,e)}var g=e.children,b=t.children,w=t.ref,_=e.className,x=t.className;Lo(t),4096&o?function(e,t){e.textContent!==t.children&&(e.textContent=t.children)}(l,b):Ka(e.childFlags,t.childFlags,g,b,l,r,i&&"foreignObject"!==a),p&&Ca(o,t,l,s,!1,f),_!==x&&(Co(x)?l.removeAttribute("class"):i?l.setAttribute("class",x):l.className=x),So(w)&&e.ref!==w?Fa(l,w):jo(w)&&Po('string "refs" are not supported in Inferno 1.0. Use callback "refs" instead.')}}(e,t,n,r,i,o):14&o?function(e,t,n,r,i,o){var a=t.type,s=e.key,l=t.key;if(e.type!==a||s!==l)Wa(e,t,n,r,i);else{var u=t.props||Jo;if(o){var c=e.children;c.$UPD=!0,c.$V=t,Xa(c,c.state,t,u,n,r,i,!1,!1),c.$UPD=!1}else{var p=!0,f=e.props,d=t.ref,h=!Co(d),m=e.children;if(t.dom=e.dom,t.children=m,h&&So(d.onComponentShouldUpdate)&&(p=d.onComponentShouldUpdate(f,u)),!1!==p){h&&So(d.onComponentWillUpdate)&&d.onComponentWillUpdate(f,u);var v=a(u,r);v!==_o&&(Ha(m,v=Ia(v,t),n,r,i),t.children=v,t.dom=v.dom,h&&So(d.onComponentDidUpdate)&&d.onComponentDidUpdate(f,u))}else 14&m.flags&&(m.parentVNode=t)}}}(e,t,n,r,i,(4&o)>0):16&o?function(e,t){var n=t.children,r=e.dom;n!==e.children&&(r.nodeValue=n);t.dom=r}(e,t):512&o?t.dom=e.dom:function(e,t,n){var r=e.type,i=t.type,o=t.children;if(Ka(e.childFlags,t.childFlags,e.children,o,r,n,!1),t.dom=e.dom,r!==i&&!Oo(o)){var a=o.dom;r.removeChild(a),i.appendChild(a)}}(e,t,r)}function Ka(e,t,n,r,i,o,a){switch(e){case 2:switch(t){case 2:Ha(n,r,i,o,a);break;case 1:ja(n,i);break;default:ja(n,i),Va(r,i,o,a)}break;case 1:switch(t){case 2:Ta(r,i,o,a);break;case 1:break;default:Va(r,i,o,a)}break;default:if(12&t){var s=n.length,l=r.length;0===s?l>0&&Va(r,i,o,a):0===l?Da(i,n):8===t&&8===e?function(e,t,n,r,i,o,a){var s,l,u=o-1,c=a-1,p=0,f=e[p],d=t[p];e:{for(;f.key===d.key;){if(d.dom&&(t[p]=d=qo(d)),Ha(f,d,n,r,i),e[p]=d,++p>u||p>c)break e;f=e[p],d=t[p]}for(f=e[u],d=t[c];f.key===d.key;){if(d.dom&&(t[c]=d=qo(d)),Ha(f,d,n,r,i),e[u]=d,c--,p>--u||p>c)break e;f=e[u],d=t[c]}}if(p>u){if(p<=c)for(var h=(l=c+1)<a?t[l].dom:null;p<=c;)(d=t[p]).dom&&(t[p]=d=qo(d)),p++,na(n,Ta(d,null,r,i),h)}else if(p>c)for(;p<=u;)ja(e[p++],n);else{var m=p,v=p,y=u-p+1,g=c-p+1,b=[];for(s=0;s<g;s++)b.push(0);var w=y===o,_=!1,x=0,k=0;if(a<4||(y|g)<32)for(s=m;s<=u;s++)if(f=e[s],k<g){for(p=v;p<=c;p++)if(d=t[p],f.key===d.key){if(b[p-v]=s+1,w)for(w=!1;s>m;)ja(e[m++],n);x>p?_=!0:x=p,d.dom&&(t[p]=d=qo(d)),Ha(f,d,n,r,i),k++;break}!w&&p>c&&ja(f,n)}else w||ja(f,n);else{var E={};for(s=v;s<=c;s++)E[t[s].key]=s;for(s=m;s<=u;s++)if(f=e[s],k<g)if(void 0!==(p=E[f.key])){if(w)for(w=!1;s>m;)ja(e[m++],n);d=t[p],b[p-v]=s+1,x>p?_=!0:x=p,d.dom&&(t[p]=d=qo(d)),Ha(f,d,n,r,i),k++}else w||ja(f,n);else w||ja(f,n)}if(w)Da(n,e),Va(t,n,r,i);else if(_){var C=function(e){var t,n,r,i,o,a=e.slice(),s=[0],l=e.length;for(t=0;t<l;t++){var u=e[t];if(0!==u){if(e[n=s[s.length-1]]<u){a[t]=n,s.push(t);continue}for(r=0,i=s.length-1;r<i;)e[s[o=(r+i)/2|0]]<u?r=o+1:i=o;u<e[s[r]]&&(r>0&&(a[t]=s[r-1]),s[r]=t)}}r=s.length,i=s[r-1];for(;r-- >0;)s[r]=i,i=a[i];return s}(b);for(p=C.length-1,s=g-1;s>=0;s--)0===b[s]?((d=t[x=s+v]).dom&&(t[x]=d=qo(d)),l=x+1,na(n,Ta(d,null,r,i),l<a?t[l].dom:null)):p<0||s!==C[p]?(l=(x=s+v)+1,na(n,(d=t[x]).dom,l<a?t[l].dom:null)):p--}else if(k!==g)for(s=g-1;s>=0;s--)0===b[s]&&((d=t[x=s+v]).dom&&(t[x]=d=qo(d)),l=x+1,na(n,Ta(d,null,r,i),l<a?t[l].dom:null))}}(n,r,i,o,a,s,l):function(e,t,n,r,i,o,a){for(var s,l,u=o>a?a:o,c=0;c<u;c++)s=t[c],l=e[c],s.dom&&(s=t[c]=qo(s)),Ha(l,s,n,r,i),e[c]=s;if(o<a)for(c=u;c<a;c++)(s=t[c]).dom&&(s=t[c]=qo(s)),Ta(s,n,r,i);else if(o>a)for(c=u;c<o;c++)ja(e[c],n)}(n,r,i,o,a,s,l)}else 1===t?Da(i,n):2===t&&(Da(i,n),Ta(r,i,o,a))}}function Xa(e,t,n,r,i,o,a,s,l){var u,c=e.state,p=e.props;if(n.children=e,e.$UN)Ro("Inferno Error: Can only update a mounted or mounting component. This usually means you called setState() or forceUpdate() on an unmounted component. This is a no-op.");else{if(p!==r||r===Jo){if(!l&&So(e.componentWillReceiveProps)){if(e.$BR=!0,e.componentWillReceiveProps(r,o),e.$UN)return;e.$BR=!1}e.$PSS&&(t=Ao(t,e.$PS),e.$PSS=!1,e.$PS=null)}var f=Boolean(e.shouldComponentUpdate);if(s||!f||f&&e.shouldComponentUpdate(r,t,o)){So(e.componentWillUpdate)&&(e.$BS=!0,e.componentWillUpdate(r,t,o),e.$BS=!1),e.props=r,e.state=t,e.context=o,So(Xo.beforeRender)&&Xo.beforeRender(e),u=e.render(r,t,o),So(Xo.afterRender)&&Xo.afterRender(e);var d,h=u!==_o;if(So(e.getChildContext)&&(d=e.getChildContext()),d=Co(d)?o:Ao(o,d),e.$CX=d,h){var m=e.$LI,v=Ia(u,n);Ha(m,v,i,d,a),e.$LI=v,So(e.componentDidUpdate)&&e.componentDidUpdate(p,c)}}else e.props=r,e.state=t,e.context=o;n.dom=e.$LI.dom}}xo&&null===document.body&&Ro('Inferno warning: you cannot initialize inferno without "document.body". Wait on "DOMContentLoaded" event, add script to bottom of body, or use async/defer attributes on script tag.');var Ya=xo?document.body:null;function Qa(e,t,n){if(Ya===t&&Po('you cannot render() to the "document.body". Use an empty element as a container instead.'),e!==_o){var r=t.$V;return Co(r)?Oo(e)||(e.dom&&(e=qo(e)),Mo(t.firstChild)?(Ta(e,t,Jo,!1),t.$V=e):function(e,t,n){var r=t.firstChild;if(!Mo(r))for(Oo(e)||qa(e,r,Jo,!1),r=t.firstChild;r=r.nextSibling;)t.removeChild(r);ea.length>0&&ia(ea),t.$V=e,So(n)&&n()}(e,t),r=e):Co(e)?(ja(r,t),t.$V=null):(e.dom&&(e=qo(e)),Ha(r,e,t,Jo,!1),r=t.$V=e),ea.length>0&&ia(ea),So(n)&&n(),So(Xo.renderComplete)&&Xo.renderComplete(r),r&&14&r.flags?r.children:void 0}}var Za="undefined"==typeof Promise?null:Promise.resolve(),Ja="undefined"==typeof requestAnimationFrame?setTimeout:requestAnimationFrame.bind(window);function es(e,t,n,r){So(t)&&(t=t(e.state,e.props,e.context));var i,o=e.$PS;if(Co(o))e.$PS=t;else for(var a in t)o[a]=t[a];if(e.$PSS||e.$BR)e.$PSS=!0,e.$BR&&So(n)&&ea.push(n.bind(e));else if(e.$UPD){var s=e.$QU;Mo(s)&&(s=e.$QU=[],i=function(e,t){return function(){e.$QU=null,e.$UPD=!0,ts(e,!1,(function(){for(var n=0,r=t.length;n<r;n++)t[n].call(e)})),e.$UPD=!1}}(e,s),Za?Za.then(i):Ja(i)),So(n)&&s.push(n)}else e.$PSS=!0,e.$UPD=!0,ts(e,r,n),e.$UPD=!1}function ts(e,t,n){if(!e.$UN){if(t||!e.$BR){e.$PSS=!1;var r=e.$PS,i=Ao(e.state,r),o=e.props,a=e.context;e.$PS=null;var s=e.$V,l=e.$LI;if(Xa(e,i,s,o,l.dom&&l.dom.parentNode,a,(32&s.flags)>0,t,!0),e.$UN)return;if(0==(1024&e.$LI.flags))for(var u=e.$LI.dom;!Mo(s=s.parentVNode);)(14&s.flags)>0&&(s.dom=u);ea.length>0&&ia(ea)}else e.state=e.$PS,e.$PS=null;So(n)&&n.call(e)}}var ns=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||Jo,this.context=t||Jo};ns.prototype.forceUpdate=function(e){this.$UN||es(this,{},e,!0)},ns.prototype.setState=function(e,t){this.$UN||(this.$BS?Po("cannot update state via setState() in componentWillUpdate() or constructor."):es(this,e,t,!1))},ns.prototype.render=function(e,t,n){};var rs=function(){};console.info("Inferno is in development mode."),-1===(rs.name||rs.toString()).indexOf("testFn")&&Ro("It looks like you're using a minified copy of the development build of Inferno. When deploying Inferno apps to production, make sure to use the production build which skips development warnings and is faster. See http://infernojs.org for more details.");var is=function(e){s(n,e);var t=d(n);function n(e){var i;r(this,n);var o=(i=t.call(this,e))._injector=e.injector;i._sheet=o.get("sheet"),i._changeSupport=o.get("changeSupport"),i._components=o.get("components"),i._eventBus=o.get("eventBus");var a=o.get("throttle");return i.onElementsChanged=i.onElementsChanged.bind(p(i)),i.onScroll=a(i.onScroll.bind(p(i))),i}return o(n,[{key:"onElementsChanged",value:function(){this.forceUpdate()}},{key:"onScroll",value:function(){this._eventBus.fire("sheet.scroll")}},{key:"getChildContext",value:function(){return{changeSupport:this._changeSupport,components:this._components,injector:this._injector}}},{key:"componentWillMount",value:function(){var e=this._sheet.getRoot().id;this._changeSupport.onElementsChanged(e,this.onElementsChanged)}},{key:"componentWillUnmount",value:function(){var e=this._sheet.getRoot().id;this._changeSupport.offElementsChanged(e,this.onElementsChanged)}},{key:"render",value:function(){var e=this._sheet.getRoot(),t=e.rows,n=e.cols,r=this._components.getComponents("table.before"),i=this._components.getComponents("table.after"),o=this._components.getComponent("table.head"),a=this._components.getComponent("table.body"),s=this._components.getComponent("table.foot");return zo(1,"div","tjs-container",[r&&r.map((function(e,t){return Uo(2,e,null,t)})),zo(1,"div","tjs-table-container",zo(1,"table","tjs-table",[o&&Uo(2,o,{rows:t,cols:n}),a&&Uo(2,a,{rows:t,cols:n}),s&&Uo(2,s,{rows:t,cols:n})],0),2,{onScroll:this.onScroll}),i&&i.map((function(e,t){return Uo(2,e,null,t)}))],0)}}]),n}(ns),os=function(){function e(t,n,i,o,a){r(this,e);var s=i.container;this._container=s,o.on("root.added",(function(){Qa(Uo(2,is,{injector:a}),s)})),o.on("root.remove",(function(){Qa(null,s)}))}return o(e,[{key:"getContainer",value:function(){return this._container}}]),e}();os.$inject=["changeSupport","components","config.renderer","eventBus","injector"];var as={__init__:["changeSupport","components","renderer"],changeSupport:["type",bo],components:["type",wo],renderer:["type",os]},ss=function(){function e(t,n){var i=this;r(this,e),this._elementRegistry=t,this._eventBus=n,this._root=null,n.on("table.clear",(function(){i.setRoot(null)}))}return o(e,[{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,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(e,t){var n=this,r=this.getRoot();if(r.cols.length!=e.cells.length)throw new Error("number of cells is not equal to number of cols");return void 0===t&&(t=r.rows.length),ls(t,r.rows,e),e.root=r,this._elementRegistry.add(e),e.cells.forEach((function(i,o){n._elementRegistry.add(i),i.row=e,i.col=r.cols[o],ls(t,r.cols[o].cells,i)})),this._eventBus.fire("row.add",{row:e}),e}},{key:"removeRow",value:function(e){var t=this,n=this.getRoot();"string"==typeof e&&(e=this._elementRegistry.get(e));var r=n.rows.indexOf(e);-1!==r&&(us(r,n.rows),e.root=void 0,this._elementRegistry.remove(e),e.cells.forEach((function(e,i){t._elementRegistry.remove(e),e.col=void 0,us(r,n.cols[i].cells)})),this._eventBus.fire("row.remove",{row:e}))}},{key:"addCol",value:function(e,t){var n=this,r=this.getRoot();if(this._elementRegistry.add(e),r.rows.length!=e.cells.length)throw new Error("number of cells is not equal to number of rows");return void 0===t&&(t=r.cols.length),ls(t,r.cols,e),e.root=r,e.cells.forEach((function(i,o){n._elementRegistry.add(i),i.col=e,i.row=r.rows[o],ls(t,r.rows[o].cells,i)})),this._eventBus.fire("col.add",{col:e}),e}},{key:"removeCol",value:function(e){var t=this,n=this.getRoot();"string"==typeof e&&(e=this._elementRegistry.get(e));var r=n.cols.indexOf(e);-1!==r&&(us(r,n.cols),e.root=void 0,this._elementRegistry.remove(e),e.cells.forEach((function(e,i){t._elementRegistry.remove(e),e.row=void 0,us(r,n.rows[i].cells)})),this._eventBus.fire("col.remove",{col:e}))}},{key:"resized",value:function(){this._eventBus.fire("sheet.resized")}}]),e}();function ls(e,t,n){return t.splice(e,0,n)}function us(e,t){return t.splice(e,1)}function cs(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t="number"==typeof e?e:e?300:0;return t?function(e){return T(e,t)}:function(e){return e}}ss.$inject=["elementRegistry","eventBus"],cs.$inject=["config.throttle"];var ps={__depends__:[as],__init__:["elementFactory","sheet"],elementFactory:["type",vo],elementRegistry:["type",yo],eventBus:["type",U],sheet:["type",ss],throttle:["factory",cs]},fs=["modules"],ds=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,e);var n=t.injector;if(!n){var i=this._init(t),o=i.modules,a=i.config;n=hs(a,o)}this.get=n.get,this.invoke=n.invoke,this.get("eventBus").fire("table.init"),this.get("eventBus").fire("diagram.init")}return o(e,[{key:"_init",value:function(e){return{modules:e.modules,config:c(e,fs)}}},{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")}}]),e}();function hs(e,t){var n=new On([{config:["value",e]},ps].concat(t||[]));return n.init(),n}function ms(e){if(!e)return"<null>";var t=e.id?' id="'.concat(e.id,'"'):"";return"<".concat(e.$type).concat(t," />")}function vs(e,t){function n(t,n,r){if(t.gfx)throw new Error("already rendered ".concat(ms(t)));return e.element(t,n,r)}function r(e,t,r){M(e,(function(e){n(e,t,r)}))}function i(e,t,r){M(e,(function(e){n(e,t,r)}))}return{handleDecision:function(t){t.id||(t.id="decision");var o=t.decisionLogic;if(!o)throw new Error("no table for ".concat(ms(t)));if(!o.output)throw new Error("missing output for ".concat(ms(o)));var a,s,l,u,c=(u=o,e.table(u));o.input&&r(o.input,c,o),r(o.output,c,o),a=o.rule,s=c,l=o,M(a,(function(e){n(e,s,l),i(e.inputEntry,e),i(e.outputEntry,e)}))}}}function ys(e,n){var r=e.elements,i=e.index;return i[n]?e:{elements:[].concat(v(r),[n]),index:t(t({},i),{},a({},n,!0))}}function gs(e,t){return e.elements.join(t)}function bs(){for(var e={elements:[],index:{}},t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return r.forEach((function(t){var r=n(t);"string"===r&&t.length>0?e=ys(e,t):"object"===r&&null!==t&&Object.keys(t).forEach((function(n){t[n]&&(e=ys(e,n))}))})),gs(e," ")}function ws(e){return _s(e.constructor,e)}function _s(e,t){var n=e.$inject;if(n){var r=t.context.injector,i=[].concat(v(n),[function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];for(var o in r){var a=n[o],s=r[o];t[a]=s}}]);r.invoke(i)}}function xs(e,t){Object.keys(t).forEach((function(n){if("$inject"!==n&&"__init"!==n){var r=t[n];"constructor"===n&&r.call(e,e.props,e.context);var i=e[n];if(void 0!==i){if("function"!=typeof i)throw new Error("failed to mixin <".concat(n,">: cannot combine with non-fn component value"));e[n]=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var o;return n.forEach((function(t){if(void 0!==(o=t.call.apply(t,[e].concat(r))))return!1})),o}.bind(e)}(e,i,r)}else e[n]=r.bind(e)}})),"$inject"in t&&_s(t,e),"__init"in t&&t.__init.call(e,e.props,e.context)}var ks={getSelectionClasses:function(){var e=this.state;return bs({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.".concat(t,".changed"),this.selectionChanged)}},Es=ks;ks.$inject=["eventBus"];var Cs=["className","elementId","coords"],Os=function(e){s(i,e);var n=d(i);function i(e,t){var o;return r(this,i),xs(p(o=n.call(this,e,t)),Es),ws(p(o)),o}return o(i,[{key:"getRenderProps",value:function(){for(var e=this.props,n=e.className,r=e.elementId,i=e.coords,o=c(e,Cs),a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var u={className:bs.apply(void 0,s.concat([this.getSelectionClasses(),n]))};return r&&(u["data-element-id"]=r),i&&(u["data-coords"]=i),t(t({},u),o)}}]),i}(ns),Ss=function(e){s(i,e);var n=d(i);function i(e,t){var o;return r(this,i),(o=n.call(this,e,t)).state={},o}return o(i,[{key:"render",value:function(){return Go(zo(1,"td",null,this.props.children,0,t({},this.getRenderProps("cell"))))}}]),i}(Os),js=["type","context"],Ns=["type","context"];function Ms(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ds(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ms(Object(n),!0).forEach((function(t){Ps(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ms(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ps(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rs(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var As={slotFill:function(e,t){var n=e.type,r=e.context,i=Rs(e,js),o=this.components.getComponent(n,r)||t;return o?Go(Uo(2,o,Ds(Ds({},r),i))):null},slotFills:function(e){var t=e.type,n=e.context,r=Rs(e,Ns);return this.components.getComponents(t,n).map((function(e){return Go(Uo(2,e,Ds(Ds({},n),r)))}))}};function Bs(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}As.$inject=["components"];var Is=function(e){s(n,e);var t=d(n);function n(e,i){var o;return r(this,n),Bs(p(o=t.call(this,e,i)),"onElementsChanged",(function(){o.forceUpdate()})),xs(p(o),As),ws(p(o)),o}return o(n,[{key:"componentDidMount",value:function(){this.changeSupport.onElementsChanged(this.getRoot(),this.onElementsChanged)}},{key:"componentWillUnmount",value:function(){this.changeSupport.offElementsChanged(this.getRoot(),this.onElementsChanged)}},{key:"getRoot",value:function(){return this.sheet.getRoot()}},{key:"render",value:function(){var e=(this.getRoot().businessObject.get("annotationsWidth")||400)+"px";return zo(1,"th","annotation header",[this.slotFills({type:"cell-inner",context:{cellType:"annotations",col:this.sheet.getRoot(),minWidth:400}}),this.translate("Annotations")],0,{style:{width:e}})}}]),n}(ns);function Ts(e){var t=e.row.businessObject,n=t.id,r=t.description;return Uo(2,Ss,{className:"annotation",elementId:n,children:r||"-"})}function Ls(e){e.onGetComponent("cell",(function(e){var t=e.cellType;return"after-label-cells"===t?Is:"after-rule-cells"===t?Ts:void 0}))}Is.$inject=["changeSupport","sheet","translate"],Ls.$inject=["components"];var $s={__init__:["annotationsProvider"],annotationsProvider:["type",Ls]};function Vs(e,t){return $({id:e.id,type:e.$type,businessObject:e},t)}var zs=function(){function e(t,n,i){r(this,e),this._elementFactory=t,this._eventBus=n,this._sheet=i}return o(e,[{key:"add",value:function(e){var t,n=this;if(Yr(e,"dmn:DecisionTable"))t=this._elementFactory.createRoot(Vs(e)),this._sheet.setRoot(t);else if(Yr(e,"dmn:InputClause"))t=this._elementFactory.createCol(Vs(e)),this._sheet.addCol(t);else if(Yr(e,"dmn:OutputClause"))t=this._elementFactory.createCol(Vs(e)),this._sheet.addCol(t);else if(Yr(e,"dmn:DecisionRule")){e.inputEntry||(e.inputEntry=[]),e.outputEntry||(e.outputEntry=[]);var r=[].concat(v(e.inputEntry),v(e.outputEntry)).map((function(e){return n._elementFactory.createCell(Vs(e))}));t=this._elementFactory.createRow($(Vs(e),{cells:r})),this._sheet.addRow(t)}return this._eventBus.fire("dmnElement.added",{element:t}),t}}]),e}();zs.$inject=["elementFactory","eventBus","sheet"];var Us={__depends__:[{__depends__:[Ei],tableImporter:["type",zs]},as]};function Fs(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Gs=function(e){s(n,e);var t=d(n);function n(e,i){var o;return r(this,n),Fs(p(o=t.call(this,e,i)),"onElementsChanged",(function(){o.forceUpdate()})),xs(p(o),As),o._sheet=i.injector.get("sheet"),o._changeSupport=i.changeSupport,o}return o(n,[{key:"componentWillMount",value:function(){var e=this._sheet.getRoot();this._changeSupport.onElementsChanged(e.id,this.onElementsChanged)}},{key:"componentWillUnmount",value:function(){var e=this._sheet.getRoot();this._changeSupport.offElementsChanged(e.id,this.onElementsChanged)}},{key:"render",value:function(){var e=this,t=this._sheet.getRoot();if(!Yr(t,"dmn:DMNElement"))return null;var n=Qr(t),r=n.input,i=n.output;return zo(1,"thead",null,zo(1,"tr",null,[zo(1,"th","index-column"),this.slotFills({type:"cell",context:{cellType:"before-label-cells"}}),r&&r.map((function(t,n){var i=t.width||"192px";return e.slotFill({type:"cell",context:{cellType:"input-header",input:t,index:n,inputsLength:r.length,width:i},key:t.id},qs)})),i.map((function(t,n){return e.slotFill({type:"cell",context:{cellType:"output-header",output:t,index:n,outputsLength:i.length},key:t.id},Ws)})),this.slotFills({type:"cell",context:{cellType:"after-label-cells"}})],0),2)}}]),n}(ns);function qs(e,t){var n=e.input,r=e.className,i=e.index,o=n.label,a=n.inputExpression,s=n.inputValues,l=t.injector.get("translate");return zo(1,"th",(r||"")+" input-cell",[zo(1,"div","clause",l(0===i?"When":"And"),0),o?zo(1,"div","input-label",o,0,{title:l("Input Label: ")+o}):zo(1,"div","input-expression",a.text,0,{title:l("Input Expression: ")+a.text}),zo(1,"div","input-variable",s&&s.text||a.typeRef,0,{title:s&&s.text?l("Input Values"):l("Input Type")})],0,{"data-col-id":n.id},n.id)}function Ws(e,t){var n=e.output,r=e.className,i=e.index,o=n.label,a=n.name,s=n.outputValues,l=n.typeRef,u=t.injector.get("translate");return zo(1,"th",(r||"")+" output-cell",[zo(1,"div","clause",u(0===i?"Then":"And"),0),o?zo(1,"div","output-label",o,0,{title:u("Output Label")}):zo(1,"div","output-name",a,0,{title:u("Output Name")}),zo(1,"div","output-variable",s&&s.text||l,0,{title:s&&s.text?u("Output Values"):u("Output Type")})],0,null,n.id)}function Hs(e){e.onGetComponent("table.head",(function(){return Gs}))}Hs.$inject=["components"];var Ks={__init__:["decisionTableHeadProvider"],decisionTableHeadProvider:["type",Hs]},Xs=function(e){s(n,e);var t=d(n);function n(e,i){var o;return r(this,n),(o=t.call(this,e,i))._translate=i.injector.get("translate"),ws(p(o)),o}return o(n,[{key:"render",value:function(){var e=this.sheet.getRoot();if(!Yr(e,"dmn:DMNElement"))return null;var t=e.businessObject.$parent.name,n=this.components.getComponent("hit-policy")||Ys;return zo(1,"div","decision-table-properties",[zo(1,"div","decision-table-name",t,0,{title:this._translate("Decision Name: ")+t}),zo(1,"div","decision-table-header-separator"),Uo(2,n)],4)}}]),n}(ns);function Ys(){return null}Xs.$inject=["sheet","components"];var Qs=o((function e(t){r(this,e),t.onGetComponent("table.before",500,(function(){return Xs}))}));Qs.$inject=["components"];var Zs={__init__:["decisionTableProperties"],decisionTableProperties:["type",Qs]},Js=function(e){s(n,e);var t=d(n);function n(){return r(this,n),t.apply(this,arguments)}return o(n,[{key:"render",value:function(){var e=this.props,t=e.row,n=e.rowIndex,r=this.context.components.getComponents("cell-inner",{cellType:"rule-index",row:t,rowIndex:n});return zo(1,"td","rule-index",[r&&r.map((function(e){return Uo(2,e,{row:t,rowIndex:n})})),n+1],0,{"data-element-id":t.id,"data-row-id":t.id})}}]),n}(ns),el=o((function e(t){r(this,e),t.onGetComponent("cell",(function(e){if("before-rule-cells"===e.cellType)return Js}))}));el.$inject=["components"];var tl={__init__:["decisionRuleIndices"],decisionRuleIndices:["type",el]},nl=[{label:"FEEL",value:"feel"}],rl=function(){function e(t){r(this,e),this._injector=t;var n=t.get("config.expressionLanguages")||{};this._config={options:nl,defaults:{editor:"feel"}},n.options&&(this._config.options=n.options);var i=this._getLegacyDefaults();$(this._config.defaults,i,n.defaults)}return o(e,[{key:"getDefault",value:function(e){var t=this._config.defaults,n=t[e]||t.editor;return this._getLanguageByValue(n)||this.getAll()[0]}},{key:"getLabel",value:function(e){var t=this._getLanguageByValue(e);return t?t.label:e}},{key:"getAll",value:function(){return this._config.options}},{key:"_getLegacyDefaults",value:function(){var e={},t=this._injector,n=t.get("config.defaultInputExpressionLanguage"),r=t.get("config.defaultOutputExpressionLanguage");return n&&(e.inputCell=n),r&&(e.outputCell=r),e}},{key:"_getLanguageByValue",value:function(e){return j(this.getAll(),(function(t){return e===t.value}))}}]),e}();rl.$inject=["injector"];var il={__init__:["expressionLanguages"],expressionLanguages:["type",rl]},ol=function(e){s(n,e);var t=d(n);function n(){return r(this,n),t.apply(this,arguments)}return o(n,[{key:"render",value:function(e){var t=e.rows,n=e.cols,r=this.context.components;return zo(1,"tbody",null,t.map((function(e,t){var i=r.getComponent("row",{rowType:"rule"});return i&&Uo(2,i,{row:e,rowIndex:t,cols:n},e.id)})),0)}}]),n}(ns),al=function(e){s(n,e);var t=d(n);function n(e,i){var o;return r(this,n),xs(p(o=t.call(this,e,i)),As),o}return o(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.row,r=t.rowIndex,i=t.cols,o=n.cells;return zo(1,"tr",null,[this.slotFills({type:"cell",context:{cellType:"before-rule-cells",row:n,rowIndex:r}}),o.map((function(t,o){return e.slotFill({type:"cell",context:{cellType:"rule",cell:t,rowIndex:r,colIndex:o},key:t.id,row:n,col:i[o]})})),this.slotFills({type:"cell",context:{cellType:"after-rule-cells",row:n,rowIndex:r}})],0)}}]),n}(ns),sl=function(e){s(n,e);var t=d(n);function n(){return r(this,n),t.apply(this,arguments)}return o(n,[{key:"render",value:function(){var e=this.props,t=e.cell,n=e.row,r=e.col;return Yr(t,"dmn:UnaryTests")?Uo(2,Ss,{className:"input-cell",elementId:t.id,"data-row-id":n.id,"data-col-id":r.id,children:t.businessObject.text}):Uo(2,Ss,{className:"output-cell",elementId:t.id,"data-row-id":n.id,"data-col-id":r.id,children:t.businessObject.text})}}]),n}(ns),ll=o((function e(t){r(this,e),t.onGetComponent("table.body",(function(){return ol})),t.onGetComponent("row",(function(e){if("rule"===e.rowType)return al})),t.onGetComponent("cell",(function(e){if("rule"===e.cellType)return sl}))}));ll.$inject=["components"];var ul={__depends__:[il],__init__:["decisionRules"],decisionRules:["type",ll]},cl=[{label:"Unique",value:{hitPolicy:"UNIQUE",aggregation:void 0},explanation:"No overlap is possible and all rules are disjoint. Only a single rule can be matched"},{label:"First",value:{hitPolicy:"FIRST",aggregation:void 0},explanation:"Rules may overlap. The first matching rule will be chosen"},{label:"Priority",value:{hitPolicy:"PRIORITY",aggregation:void 0},explanation:"Rules may overlap. The one with the highest priority will be chosen"},{label:"Any",value:{hitPolicy:"ANY",aggregation:void 0},explanation:"Rules may overlap. Their output have to match"},{label:"Collect",value:{hitPolicy:"COLLECT",aggregation:void 0},explanation:"Collects the values of all matching rules"},{label:"Collect (Sum)",value:{hitPolicy:"COLLECT",aggregation:"SUM"},explanation:"Collects the values of all matching rules and sums up to a single value"},{label:"Collect (Min)",value:{hitPolicy:"COLLECT",aggregation:"MIN"},explanation:"Collects the values of all matching rules and uses the lowest value"},{label:"Collect (Max)",value:{hitPolicy:"COLLECT",aggregation:"MAX"},explanation:"Collects the values of all matching rules and uses the highest value"},{label:"Collect (Count)",value:{hitPolicy:"COLLECT",aggregation:"COUNT"},explanation:"Collects the values of all matching rules and counts the number of them"},{label:"Rule order",value:{hitPolicy:"RULE ORDER",aggregation:void 0},explanation:"Collects the values of all matching rules in rule order"},{label:"Output order",value:{hitPolicy:"OUTPUT ORDER",aggregation:void 0},explanation:"Collects the values of all matching rules in decreasing output priority order"}],pl=function(e){s(n,e);var t=d(n);function n(e,i){var o;return r(this,n),(o=t.call(this,e,i))._translate=i.injector.get("translate"),ws(p(o)),o}return o(n,[{key:"getRoot",value:function(){return this.sheet.getRoot()}},{key:"render",value:function(){var e=this.getRoot().businessObject,t=e.aggregation,n=e.hitPolicy,r=j(cl,(function(e){return r=e.value,i={aggregation:t,hitPolicy:n},r.hitPolicy===i.hitPolicy&&r.aggregation===i.aggregation;var r,i}));return zo(1,"div","hit-policy header",[zo(1,"label","dms-label",this._translate("Hit Policy:"),0),zo(1,"span","hit-policy-value",this._translate(r.label),0)],4,{title:this._translate(r.explanation)})}}]),n}(ns);function fl(e){e.onGetComponent("hit-policy",(function(){return pl}))}pl.$inject=["sheet"],fl.$inject=["components"];var dl={__init__:["hitPolicyProvider"],hitPolicyProvider:["type",fl]};function hl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ml=function(e){s(n,e);var t=d(n);function n(e,i){var o;r(this,n),hl(p(o=t.call(this,e,i)),"onClick",(function(){o._eventBus.fire("showDrd")}));var a=i.injector;return o._translate=a.get("translate"),o._eventBus=a.get("eventBus"),o}return o(n,[{key:"render",value:function(){var e=this;return zo(1,"div","view-drd",zo(1,"button","view-drd-button",this._translate("View DRD"),0,{type:"button",onClick:this.onClick}),2,null,null,(function(t){return e.node=t}))}}]),n}(ns),vl=function(){function e(t,n,i,o){var a=this;r(this,e),this._injector=i,this._sheet=o,t.onGetComponent("table.before",(function(){if(a.canViewDrd())return ml})),n.on("showDrd",(function(){var e=i.get("_parent",!1),t=yl(o.getRoot());if(t){var n=e.getView(t);e.open(n)}}))}return o(e,[{key:"canViewDrd",value:function(){var e=this._injector.get("_parent",!1);if(!e)return!1;var t=yl(this._sheet.getRoot());return!!e.getView(t)}}]),e}();function yl(e){var t=e.businessObject;if(t)return t.$parent.$parent}vl.$inject=["components","eventBus","injector","sheet"];var gl={__init__:["viewDrd"],viewDrd:["type",vl]};function bl(){return zo(32,"svg",null,[zo(1,"path",null,null,1,{fill:"#000000",d:"M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"}),zo(1,"path",null,null,1,{fill:"#000000",d:"M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"})],4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14.02 5.57",width:"53",height:"21",style:"vertical-align:middle"})}function wl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _l=function(e){s(n,e);var t=d(n);function n(e,i){var o;r(this,n),wl(p(o=t.call(this,e,i)),"onClick",(function(){o._eventBus.fire("poweredBy.show")}));var a=i.injector;return o._eventBus=a.get("eventBus"),o}return o(n,[{key:"render",value:function(){var e=this;return zo(1,"div","powered-by",zo(1,"div","powered-by__logo",Uo(2,bl),2,{title:"Powered by bpmn.io",onClick:this.onClick},null,(function(t){return e.node=t})),2)}}]),n}(ns),xl=function(e){s(n,e);var t=d(n);function n(e){var i;return r(this,n),(i=t.call(this,e)).state={show:!1},i.onClick=i.onClick.bind(p(i)),i.onShow=i.onShow.bind(p(i)),i}return o(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&&zo(1,"div","powered-by-overlay",zo(1,"div","powered-by-overlay-content",[zo(1,"a","logo",Uo(2,bl),2,{href:"https://bpmn.io",target:"_blank",rel:"noopener"}),zo(1,"span",null,[Fo("Web-based tooling for BPMN, DMN and CMMN diagrams powered by "),zo(1,"a",null,Fo("bpmn.io"),2,{href:"http://bpmn.io",target:"_blank"}),Fo(".")],4)],4,{onClick:function(e){return e.stopPropagation()}}),2,{onClick:this.onClick})}}]),n}(ns),kl=o((function e(t,n){r(this,e),t.onGetComponent("table.before",(function(){return _l})),t.onGetComponent("table.before",(function(){return xl}))}));kl.$inject=["components","eventBus"];var El={__init__:["poweredBy"],poweredBy:["type",kl]},Cl=["modules","additionalModules"];function Ol(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Sl=function(e){s(n,e);var t=d(n);function n(){var e;r(this,n);var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=n._createContainer();return(e=t.call(this,$(i,{renderer:{container:o}})))._container=o,e}return o(n,[{key:"open",value:function(e){var t=this;return new Promise((function(n,r){var i;try{return t._decision&&t.clear(),t._decision=e,function(e,t,n){var r=e.get("tableImporter"),i=e.get("eventBus"),o=e.get("sheet");e.get("modeling",!1);var a,s=[];i.fire("import.render.start",{decision:t});try{!function(e){new vs({create:function(e,t,n,i){return r.create(e,t,n,i)},table:function(e){return r.add(e)},element:function(e,t,n){return r.add(e,t,n)},error:function(e,t){s.push({message:e,context:t})}}).handleDecision(e)}(t)}catch(e){a=e}i.fire("import.render.complete",{error:a,warnings:s}),i.fire("elements.changed",{elements:[o.getRoot()]}),n(a,s)}(t,e,(function(e,t){e?(e.warnings=t||[],r(e)):n({warnings:t||[]})}))}catch(e){i=e}i?(i.warnings=i.warnings||[],r(i)):n({warnings:[]})}))}},{key:"_init",value:function(e){var t=e.modules,n=e.additionalModules,r=Ol(e,Cl),i=t||this.getModules(),o=n||[],a=[{decisionTable:["value",this]}];return{modules:[El].concat(v(i),v(o),a),config:r}}},{key:"on",value:function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)}},{key:"off",value:function(e,t){this.get("eventBus").off(e,t)}},{key:"_emit",value:function(e,t){return this.get("eventBus").fire(e,t)}},{key:"attachTo",value:function(e){if(!e)throw new Error("parentNode required");this.detach();var t=this._container;e.appendChild(t),this._emit("attach",{})}},{key:"detach",value:function(){var e=this._container;e.parentNode&&(this._emit("detach",{}),an(e))}},{key:"destroy",value:function(){m(l(n.prototype),"destroy",this).call(this),this.detach()}},{key:"getModules",value:function(){return n._getModules()}}],[{key:"_getModules",value:function(){return[$s,Us,Ei,Ks,Zs,tl,ul,dl,gl]}},{key:"_createContainer",value:function(){return rn('<div class="dmn-decision-table-container"></div>')}}]),n}(ds),jl=function(){function e(t){var n=this;r(this,e),this._listeners={},t.on("elements.changed",(function(e){var t=e.elements;n.elementsChanged(t)})),t.on("element.updateId",(function(e){var t=e.element,r=e.newId;n.updateId(t.id,r)}))}return o(e,[{key:"elementsChanged",value:function(e){for(var t={},n=e.length,r=0;r<n;r++){var i=e[r].id;if(t[i])return;t[i]=!0;var o=this._listeners[i]&&this._listeners[i].length;if(o)for(var a=0;a<o;a++)this._listeners[i][a]&&this._listeners[i][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}();jl.$inject=["eventBus"];var Nl=function(){function e(){r(this,e),this._listeners={}}return o(e,[{key:"getComponent",value:function(e,t){var n=this._listeners[e];if(n){for(var r,i=0;i<n.length&&!(r=n[i].callback(t));i++);return r}}},{key:"getComponents",value:function(e,t){var n=this._listeners[e];if(n){for(var r=[],i=0;i<n.length;i++){var o=n[i].callback(t);o&&r.push(o)}if(r.length)return r}}},{key:"onGetComponent",value:function(e,t,n){if(C(t)&&(n=t,t=1e3),!E(t))throw new Error("priority must be a number");var r,i,o=this._getListeners(e),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,r,i=this._getListeners(e);if(t)for(r=i.length-1;n=i[r];r--)n.callback===t&&i.splice(r,1);else i.length=0}},{key:"_getListeners",value:function(e){var t=this._listeners[e];return t||(this._listeners[e]=t=[]),t}}]),e}(),Ml=function(e){s(n,e);var t=d(n);function n(e){var i;r(this,n);var o=(i=t.call(this,e))._injector=e.injector;return i._changeSupport=o.get("changeSupport"),i._components=o.get("components"),i._renderer=o.get("renderer"),i}return o(n,[{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 zo(1,"div","viewer-container",e&&e.map((function(e,t){return Uo(2,e,null,t)})),0)}}]),n}(ns),Dl=function(){function e(t,n,i,o,a){r(this,e);var s=i.container;this._container=s,o.on("renderer.mount",(function(){Qa(Uo(2,Ml,{injector:a}),s)})),o.on("renderer.unmount",(function(){Qa(null,s)}))}return o(e,[{key:"getContainer",value:function(){return this._container}}]),e}();Dl.$inject=["changeSupport","components","config.renderer","eventBus","injector"];var Pl={__init__:["changeSupport","components","renderer"],changeSupport:["type",jl],components:["type",Nl],eventBus:["type",U],renderer:["type",Dl]},Rl=["modules"];function Al(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Bl=function(){function e(){r(this,e);var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.injector;if(!n){var i=this._init(t),o=i.modules,a=i.config;n=Il(a,o)}this.get=n.get,this.invoke=n.invoke,this.get("eventBus").fire("viewer.init")}return o(e,[{key:"_init",value:function(e){return{modules:e.modules,config:Al(e,Rl)}}},{key:"destroy",value:function(){this.get("eventBus").fire("viewer.destroy")}},{key:"clear",value:function(){this.get("eventBus").fire("viewer.clear")}}]),e}();function Il(e,t){var n=new On([{config:["value",e]},Pl].concat(t||[]));return n.init(),n}var Tl=function(){function e(t,n){r(this,e),this._eventBus=n,this._viewer=t}return o(e,[{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}}]),e}();Tl.$inject=["viewer","eventBus"];var Ll={__init__:["elementRegistry"],elementRegistry:["type",Tl]},$l=function(e){s(n,e);var t=d(n);function n(e,i){var o;return r(this,n),(o=t.call(this,e,i))._viewer=i.injector.get("viewer"),o}return o(n,[{key:"render",value:function(){return zo(1,"div","decision-properties",zo(1,"h3","decision-name",this._viewer.getDecision().name,0),2)}}]),n}(ns),Vl=o((function e(t){r(this,e),t.onGetComponent("viewer",1500,(function(){return $l}))}));Vl.$inject=["components"];var zl={__init__:["decisionProperties"],decisionProperties:["type",Vl]},Ul=function(e){s(n,e);var t=d(n);function n(e,i){var o;return r(this,n),(o=t.call(this,e,i))._translate=i.injector.get("translate"),o._viewer=i.injector.get("viewer"),o}return o(n,[{key:"render",value:function(){var e=this._viewer.getDecision(),t=e.decisionLogic,n=e.variable;return zo(1,"div","literal-expression-properties",zo(1,"table",null,[zo(1,"tr",null,[zo(1,"td",null,this._translate("Variable Name:"),0),zo(1,"td",null,zo(1,"span",null,n.name||"-",0),2)],4),zo(1,"tr",null,[zo(1,"td",null,this._translate("Variable Type:"),0),zo(1,"td",null,zo(1,"span",null,this._translate(n.typeRef||"")||"-",0),2)],4),zo(1,"tr",null,[zo(1,"td",null,this._translate("Expression Language:"),0),zo(1,"td",null,zo(1,"span",null,t.expressionLanguage||"-",0),2)],4)],4),2)}}]),n}(ns),Fl=o((function e(t){r(this,e),t.onGetComponent("viewer",500,(function(){return Ul}))}));Fl.$inject=["components"];var Gl={__depends__:[],__init__:["literalExpressionProperties"],literalExpressionProperties:["type",Fl]};function ql(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Wl=function(e){s(n,e);var t=d(n);function n(e,i){var o;r(this,n),ql(p(o=t.call(this,e,i)),"onClick",(function(){o._eventBus.fire("poweredBy.show")}));var a=i.injector;return o._eventBus=a.get("eventBus"),o}return o(n,[{key:"render",value:function(){var e=this;return zo(1,"div","powered-by",zo(1,"div","powered-by__logo",Uo(2,bl),2),2,{onClick:this.onClick,title:"Powered by bpmn.io"},null,(function(t){return e.node=t}))}}]),n}(ns),Hl=function(e){s(n,e);var t=d(n);function n(e){var i;return r(this,n),(i=t.call(this,e)).state={show:!1},i.onClick=i.onClick.bind(p(i)),i.onShow=i.onShow.bind(p(i)),i}return o(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&&zo(1,"div","powered-by-overlay",zo(1,"div","powered-by-overlay-content",[zo(1,"a","logo",Uo(2,bl),2,{href:"https://bpmn.io",target:"_blank",rel:"noopener"}),zo(1,"span",null,[Fo("Web-based tooling for BPMN, DMN and CMMN diagrams powered by "),zo(1,"a",null,Fo("bpmn.io"),2,{href:"http://bpmn.io",target:"_blank"}),Fo(".")],4)],4,{onClick:function(e){return e.stopPropagation()}}),2,{onClick:this.onClick})}}]),n}(ns),Kl=o((function e(t,n){r(this,e),t.onGetComponent("viewer",2e3,(function(){return Wl})),t.onGetComponent("viewer",(function(){return Hl}))}));Kl.$inject=["components","eventBus"];var Xl={__init__:["poweredBy"],poweredBy:["type",Kl]},Yl=function(e){s(n,e);var t=d(n);function n(e,i){var o;return r(this,n),(o=t.call(this,e,i))._viewer=i.injector.get("viewer"),o}return o(n,[{key:"render",value:function(){return zo(1,"div","textarea",zo(1,"div","content",this._viewer.getDecision().decisionLogic.text,0),2)}}]),n}(ns),Ql=o((function e(t){r(this,e),t.onGetComponent("viewer",(function(){return Yl}))}));Ql.$inject=["components"];var Zl={__init__:["textarea"],textarea:["type",Ql]};function Jl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var eu=function(e){s(n,e);var t=d(n);function n(e,i){var o;r(this,n),Jl(p(o=t.call(this,e,i)),"onClick",(function(){o._eventBus.fire("showDrd")}));var a=i.injector;return o._translate=a.get("translate"),o._eventBus=a.get("eventBus"),o}return o(n,[{key:"render",value:function(){var e=this;return zo(1,"div","view-drd",zo(1,"button","view-drd-button",this._translate("View DRD"),0,{type:"button",onClick:this.onClick}),2,null,null,(function(t){return e.node=t}))}}]),n}(ns);eu.$inject=["translate"];var tu=function(){function e(t,n,i,o){var a=this;r(this,e),this._injector=o,this._viewer=n,t.onGetComponent("viewer",2e3,(function(){if(a.canViewDrd())return eu})),i.on("showDrd",(function(){var e=o.get("_parent",!1),t=a.getDefinitions(),n=e.getView(t);e.open(n)}))}return o(e,[{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}}]),e}();tu.$inject=["components","viewer","eventBus","injector"];var nu={__init__:["viewDrd"],viewDrd:["type",tu]},ru=["modules","additionalModules"];function iu(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var ou=function(e){s(n,e);var t=d(n);function n(){var e;r(this,n);var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=n._createContainer();return(e=t.call(this,$(i,{renderer:{container:o}})))._container=o,e}return o(n,[{key:"open",value:function(e){var t=this;return new Promise((function(n,r){var i;try{t._decision&&(t.clear(),t.get("eventBus").fire("renderer.unmount")),t._decision=e,t.get("eventBus").fire("import",e),t.get("eventBus").fire("renderer.mount")}catch(e){i=e}i?(i.warnings=i.warnings||[],r(i)):n({warnings:[]})}))}},{key:"_init",value:function(e){var t=e.modules,n=e.additionalModules,r=iu(e,ru),i=t||this.getModules(),o=n||[],a=[{viewer:["value",this]}];return{modules:[].concat(v(i),v(o),a),config:r}}},{key:"on",value:function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)}},{key:"off",value:function(e,t){this.get("eventBus").off(e,t)}},{key:"_emit",value:function(e,t){return this.get("eventBus").fire(e,t)}},{key:"getDecision",value:function(){return this._decision}},{key:"attachTo",value:function(e){if(!e)throw new Error("parentNode required");this.detach(),e.appendChild(this._container),this._emit("attach",{})}},{key:"detach",value:function(){var e=this._container;e.parentNode&&(this._emit("detach",{}),an(e))}},{key:"destroy",value:function(){m(l(n.prototype),"destroy",this).call(this),this.detach()}},{key:"getModules",value:function(){return n._getModules()}}],[{key:"_getModules",value:function(){return[Ll,Ei,zl,Gl,Xl,Zl,nu]}},{key:"_createContainer",value:function(){return rn('<div class="dmn-literal-expression-container"></div>')}}]),n}(Bl);var au=function(e){s(n,e);var t=d(n);function n(){return r(this,n),t.apply(this,arguments)}return o(n,[{key:"_getViewProviders",value:function(){return[{id:"drd",constructor:co,opens:function(e){return Yr(e,"dmn:Definitions")&&((t=e).dmnDI&&t.dmnDI.diagrams&&t.dmnDI.diagrams[0]);var t}},{id:"decisionTable",constructor:Sl,opens:function(e){return Yr(e,"dmn:Decision")&&Yr(e.decisionLogic,"dmn:DecisionTable")}},{id:"literalExpression",constructor:ou,opens:function(e){return Yr(e,"dmn:Decision")&&Yr(e.decisionLogic,"dmn:LiteralExpression")}}]}}]),n}(dn);return au}));
17