/*! dmn-js - dmn-navigated-viewer v14.1.2 | Copyright (c) 2014-present, camunda Services GmbH | bpmn.io/license */ !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=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=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 h(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 d(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=d(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);n0)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;l1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r or , 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,Z(e,ee(this.registerPackage,this))}function he(e,t,n){var r=t[n];if(r in e)throw new Error("package with "+n+" <"+r+"> already defined")}function de(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 de(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),Z(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||(Z(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;he(t,e,"prefix"),he(t,e,"uri"),Z(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={};Z(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}),Z(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+">");Z(r.superClass,n?o:a),t(r,!n),Z(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})},de.prototype.set=function(e,t,n){if(!Y(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},de.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]},de.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)},de.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},de.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=Y(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}),Z(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),ke(e,(function(e,r){if(t(e,r))return n=e,!1})),n}function Ee(e,t){var n=[];return ke(e,(function(e,r){t(e,r)&&n.push(e)})),n}function ke(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 Me(){return Me=Object.assign||function(e){for(var t=1;t1?t-1:0),r=1;r",lt:"<",quot:'"'};function Te(e,t,n,r){return r?Pe.call(Re,r)?Re[r]:"&"+r+";":Ne(t||parseInt(n,16))}function Ae(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(De,Te):e}Object.keys(Re).forEach((function(e){Re[e.toUpperCase()]=Re[e]}));var Ie="xsi:type",Be="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 We(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=We,h=Fe,d=!1,m=!1,v=null,y=!1;function g(e){e instanceof Error||(e=Le(e)),v=e,f(e,h)}function b(e){a&&(e instanceof Error||(e=Le(e)),a(e,h))}this.on=function(e,n){if("function"!=typeof n)throw Le("required args ");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 ");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 ");return v=null,function(e){var n,a,f,v,w,_,x,E,k,C,O,S=m?[]:null,M=m?function(e){var t,n,r={};for(t in e)r[n=e[t]]=n,r[Ue(n)]=t;return r}(c):null,j=[],N=0,P=!1,D=!1,R=0,T=0,A="",I=0;function B(){if(null!==O)return O;var e,t,n,r,i,o,a,s,l,u,p,f=m&&M.xmlns,h=m&&d?[]:null,v=I,y=A,g=y.length,w={},_={};e:for(;v8)){for((u<65||u>122||u>90&&u<97)&&95!==u&&58!==u&&(b("illegal first char attribute name"),l=!0),p=v+1;p96&&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;p8);p++);for(-1===p&&(b("missing closing quotes"),p=g,l=!0),l||(o=y.substring(v,p)),v=p;p+18);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(d){if(null!==(i="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null)){if(e=Ae(o),t=Ue(i),!(a=c[e])){if("xmlns"===i||t in M&&M[t]!==e)do{a="ns"+N++}while(void 0!==M[a]);else a=i;c[e]=a}M[i]!==a&&(r||(M=ze(M),r=!0),M[i]=a,"xmlns"===i&&(M[Ue(a)]=e,f=a),M[t]=e),w[s]=o;continue}h.push(s,o)}else-1!==(u=s.indexOf(":"))?(n=M[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=M[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(d)for(v=0,g=h.length;v=a&&(t=r.exec(e))&&!((s=t[0].length+t.index)>R);)i+=1,a=s;return-1==R?(o=s,n=e.substring(T)):0===T?n=e.substring(T,R):(o=R-a,n=-1==T?e.substring(R):e.substring(R,T+1)),{data:n,line:i,column:o}}h=L,p&&(C=Object.create({},{name:Ve((function(){return E})),originalName:Ve((function(){return k})),attrs:Ve(B),ns:Ve((function(){return M}))}));for(;-1!==T;){if(-1===(R=60===e.charCodeAt(T)?T:e.indexOf("<",T)))return j.length?g("unexpected end of file"):0===T?g("missing start tag"):void(T",R)))return g("unclosed cdata");if(o&&(o(e.substring(R+9,T),h),y))return;T+=3;continue}if(45===v&&45===e.charCodeAt(R+3)){if(-1===(T=e.indexOf("--\x3e",R)))return g("unclosed comment");if(s&&(s(e.substring(R+4,T),Ae,h),y))return;T+=3;continue}}if(63!==w){for(a=R+1;;a++){if(_=e.charCodeAt(a),isNaN(_))return T=-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===_){T=a;break}}if(33!==w){if(O={},47===w){if(P=!1,D=!0,!j.length)return g("missing open tag");if(a=E=j.pop(),v=R+2+a.length,e.substring(R+2,v)!==a)return g("closing tag mismatch");for(;v8&&w<14))return g("close tag")}else{if(47===e.charCodeAt(T-1)?(a=E=e.substring(R+1,T-1),P=!0,D=!0):(a=E=e.substring(R+1,T),P=!0,D=!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;v96&&w<123||w>64&&w<91||w>47&&w<59||45===w||95===w||46==w)){if(32===w||w<14&&w>8){E=a.substring(0,v),O=null;break}return g("invalid nodeName")}D||j.push(E)}if(m){if(n=M,P&&(D||S.push(n),null===O&&(d=-1!==a.indexOf("xmlns",v))&&(I=v,A=a,B(),d=!1)),k=E,-1!==(w=E.indexOf(":"))){if(!(x=M[E.substring(0,w)]))return g("missing namespace on <"+k+">");E=E.substr(w+1)}else x=M.xmlns;x&&(E=x+":"+E)}if(P&&(I=v,A=a,r&&(p?r(C,Ae,D,h):r(E,B,Ae,D,h),y)))return;if(D){if(i&&(i(p?C:E,Ae,P,h),y))return;m&&(M=P?n:S.pop())}T+=1}else{if(u&&(u(e.substring(R,T+1),Ae,h),y))return;T+=1}}else{if(-1===(T=e.indexOf("?>",R)))return g("unclosed question");if(l&&(l(e.substring(R,T+2),h),y))return;T+=2}}}(e),h=Fe,y=!1,v},this.stop=function(){y=!0}}function Ge(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"},Xe="xsi:type";function Ye(e){return e.xml&&e.xml.serialize}function Ke(e){return Ye(e)===Xe}function Ze(e,t){return Ge(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function Qe(e){return new Error(e)}function Je(e){return e.$descriptor}function et(e){je(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw Qe("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 Qe("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}),je(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 Qe("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 Qe("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 ke(n,(function(e,n){var r=i.propertiesByName[n];r&&r.isReference?r.isMany?ke(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 Ke(l)&&(t=e.attributes[Xe])?(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),je({},l,{effectiveType:Je(n=o.getType(t)).name})):l;var u=o.getPackage(r.prefix);if(u){if(t=Ze(r,u),n=o.getType(t),l=xe(a.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})))return je({},l,{effectiveType:Je(n).name})}else if(l=xe(a.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})))return l;throw Qe("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?(je(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&&Ze(n,o)||t;if(!i.hasType(a))throw Qe("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(je({},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 Qe(l)}function c(e,t){return u(e,t,!0)}r.context=a,l.push(r);var p=/^<\?xml /i,f=/ encoding="([^"]+)"/i,h=/^utf-8$/i;function d(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&&!h.test(n)&&a.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){l.pop().handleEnd()})).on("cdata",d).on("text",(function(e,t,n){!function(e,t){e.trim()&&d(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=Qe("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 ht(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 dt(e,t){return Ge(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 Et(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function kt(e,t){Et.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=je({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('\n'),(new Et).build(t).serializeTo(i),!n)return r.value}}}function Mt(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+"").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("").appendNewLine()},Et.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 Ee(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(Ee(n,(function(e){return e.isAttr}))),this.parseContainments(function(e){return Ee(e,(function(e){return!e.isAttr}))}(n))),this.parseGenericAttributes(e,t),this},Et.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?je({localName:t.ns.localName},e):je({localName:dt(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},Et.prototype.nsPropertyTagName=function(e){return function(e,t){return je({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},Et.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Et.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}:je({localName:t.localName},n)},Et.prototype.parseGeneric=function(e){var t=this,n=this.body,r=[];return ke(e,(function(i,o){"$body"===o?n.push((new _t).build({type:"String"},i)):"$children"===o?ke(i,(function(e){n.push(new Et(t).build(e))})):0!==o.indexOf("$")&&t.parseNsAttribute(e,o,i)&&r.push({name:o,value:i})})),r},Et.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)}},Et.prototype.parseNsAttributes=function(e,t){var n=this,r=e.$attrs,i=[];return ke(r,(function(t,r){var o=n.parseNsAttribute(e,r,t);o&&i.push(o)})),i},Et.prototype.parseGenericAttributes=function(e,t){var n=this;ke(t,(function(t){if(t.name!==Xe)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}}))},Et.prototype.parseContainments=function(e){var t=this,n=this.body,r=this.element;ke(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))ke(i,(function(r){n.push(new xt(t.addTagName(t.nsPropertyTagName(e))).build(e,r))}));else if(o)ke(i,(function(r){n.push(new wt(t.addTagName(t.nsPropertyTagName(e))).build(r))}));else{var a=Ke(e),s=function(e){return"property"===Ye(e)}(e);ke(i,(function(r){var i;i=a?new kt(t,e):s?new Et(t,e):new Et(t),n.push(i.build(r))}))}}))},Et.prototype.getNamespaces=function(e){var t,n=this.namespaces,r=this.parent;return n||(t=r&&r.getNamespaces(),e||!t?this.namespaces=n=new ht(t):n=t),n},Et.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},Et.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},Et.prototype.parseAttributes=function(e){var t=this,n=this.element;ke(e,(function(e){var r=n.get(e.name);if(e.isReference)if(e.isMany){var i=[];ke(r,(function(e){i.push(e.id)})),r=i.join(" ")}else r=r.id;t.addAttribute(t.nsAttributeName(e),r)}))},Et.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),vt(e)},Et.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 ke(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)},Et.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)),ke(t,(function(t){e.append(" ").append(vt(t.name)).append('="').append(t.value).append('"')}))},Et.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(),ke(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append("")),e.appendNewLine()},mt(kt,Et),kt.prototype.parseNsAttributes=function(e){var t=Et.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(Xe),(r.prefix?r.prefix+":":"")+o+n.ns.localName),t},kt.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},Mt.prototype=Object.create(ve.prototype),Mt.prototype.fromXML=function(e,t,n){var r;r=t,"[object String]"!==W.call(r)&&(n=t,t="dmn:Definitions");var i=new ct(G({model:this,lax:!0},n)),o=i.handler(t);return i.fromXML(e,o)},Mt.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 jt={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 Nt(e,t){return new Mt(G({},jt,e),t)}function Pt(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 Dt=Object.prototype.toString,Rt=Object.prototype.hasOwnProperty;function Tt(e,t){return Rt.call(e,t)}function At(e,t){var n;if(void 0!==e){var r=function(e){return"[object Array]"===Dt.call(e)}(e)?Bt:It;for(var i in e)if(Tt(e,i)&&!1===t(n=e[i],r(i)))return n}}function It(e){return e}function Bt(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
a',nn=!Jt.getElementsByTagName("link").length,Jt=void 0);var rn={legend:[1,"
","
"],tr:[2,"","
"],col:[2,"","
"],_default:nn?[1,"X
","
"]:[0,"",""]};rn.td=rn.th=[3,"","
"],rn.option=rn.optgroup=[1,'"],rn.thead=rn.tbody=rn.colgroup=rn.caption=rn.tfoot=[1,"","
"],rn.polyline=rn.ellipse=rn.polygon=rn.circle=rn.text=rn.line=rn.path=rn.rect=rn.g=[1,'',""];var on=tn;function an(e,t){return(t=t||document).querySelector(e)}function sn(e){e.parentNode&&e.parentNode.removeChild(e)}function ln(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 "+un(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 un(e){return e.replace("bound ","")}function cn(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 pn(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};fn(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=ln(this.open.bind(this)),this.importXML=ln(this.importXML.bind(this)),this.saveXML=ln(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 "!==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 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=an(e)),e.appendChild(this._container),this._emit("attach",{})}},{key:"detach",value:function(){this._emit("detach",{}),sn(this._container)}},{key:"destroy",value:function(){var e=this;Object.keys(this._viewers).forEach((function(t){gn(e._viewers[t],"destroy")})),sn(this._container)}},{key:"_init",value:function(e){this._options=e,this._moddle=this._createModdle(e),this._viewers={},this._views=[];var t=on('
'),n=$({},hn,e);$(t.style,{width:mn(n.width),height:mn(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");var n=t.constructor,r=this._options[e]||{};return new n(pn(pn(pn({},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 Nt(e.moddleExtensions)}},{key:"_getViewProviders",value:function(){return[]}}]),e}();function mn(e){return e+(k(e)?"px":"")}function vn(e,t){return _(e)?!!_(t)&&(e.element===t.element||e.id===t.id):!_(t)}function yn(e,t){return!e||!t||e.name!==t.name}function gn(e,t){C(e[t])&&e[t]()}function bn(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}var wn=/^class[ {]/;function _n(e){return Array.isArray(e)}function xn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function En(){for(var e=arguments.length,t=new Array(e),n=0;n ");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(xn(i,e))return i[e];if(xn(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(!_n(e))throw a('Cannot invoke "'.concat(e,'". Expected a function!'));e=En(e.slice())}return{fn:e,dependencies:(e.$inject||Sn(e)).map((function(e){return xn(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=[],h=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=En((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 d in r)h(d);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 Mn(e,o)}var f,h,d={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=En((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]=[d[n],jn(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),h=!1,function(){h||(h=!0,f.forEach((function(e){return e()})))})}function jn(e,t){return"value"!==e&&_n(t)&&(t=En(t.slice())),t}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 Pn(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 Pn(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 Rn={"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 Tn(e,t,n){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=Rn[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 Rn[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);Tn(e,t,n)}else!function(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)Tn(e,r,t[r])}(e,t);return e}var In=Object.prototype.toString;function Bn(e){return new Ln(e)}function Ln(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function $n(e){var t=e.parentNode;return t&&t.removeChild(e),e}function Vn(e){for(var t;t=e.firstChild;)$n(t);return e}Ln.prototype.add=function(e){return this.list.add(e),this},Ln.prototype.remove=function(e){return"[object RegExp]"==In.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Ln.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n"+e+"",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 Wn(e,t){var n;return"<"===e.charAt(0)?(n=Fn(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(zn,e),t&&An(n,t),n}var qn=null;function Gn(){return null===qn&&(qn=Wn("svg")),qn}function Hn(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)e[r]=t[r];return e}var Xn=/([&<>]{1})/g,Yn=/([\n\r"]{1})/g,Kn={"&":"&","<":"<",">":">",'"':"'"};function Zn(e,t){return e.replace(t,(function(e,t){return Kn[t]||t}))}function Qn(e,t){var n,r,i,o,a;switch(e.nodeType){case 3:t.push(Zn(e.textContent,Xn));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,r=(i=e.attributes).length;n"),n=0,r=(a=e.childNodes).length;n")}else t.push("/>");break;case 8:t.push("\x3c!--",Zn(e.nodeValue,Xn),"--\x3e");break;case 4:t.push("");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function Jn(e,t){var n=Fn(t);if(Vn(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;oi||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 fr(e){return!(!e||!e.isFrame)}function hr(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})}bn(hr,Nn),hr.prototype.canRender=function(){return!0},hr.prototype.drawShape=function(e,t,n){var r=Wn("rect");return An(r,{x:0,y:0,width:t.width||0,height:t.height||0}),fr(t)?An(r,$({},this.FRAME_STYLE,n||{})):An(r,$({},this.SHAPE_STYLE,n||{})),Dn(e,r),r},hr.prototype.drawConnection=function(e,t,n){var r=ur(t.waypoints,$({},this.CONNECTION_STYLE,n||{}));return Dn(e,r),r},hr.prototype.getShapePath=function(e){var t=e.x,n=e.y,r=e.width;return rr([["M",t,n],["l",r,0],["l",0,e.height],["l",-r,0],["z"]])},hr.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 rr(i)},hr.$inject=["eventBus","styles"];var dr={__init__:["defaultRenderer"],defaultRenderer:["type",hr],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=P(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 mr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function vr(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function yr(e,t){return Math.round(e*t)/t}function gr(e){return k(e)?e+"px":e}function br(e,t,n){var r=Wn("g");Bn(r).add(t);var i=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(r,e.childNodes[i]||null),r}var wr={shape:["x","y","width","height"],connection:["waypoints"]};function _r(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 xr(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}_r.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],_r.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:gr(e.width),height:gr(e.height)}),t.appendChild(n),n}(e),i=this._svg=Wn("svg");An(i,{width:"100%",height:"100%"}),Dn(r,i);var o=this._viewport=br(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)},_r.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},_r.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},_r.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},_r.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},_r.prototype._getChildIndex=function(e){return P(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},_r.prototype._createLayer=function(e,t){void 0===t&&(t=1);var n=this._getChildIndex(t);return{group:br(this._viewport,"layer-"+e,n),index:t,visible:!0}},_r.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},_r.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?($n(n),t.visible=!1,n):n},_r.prototype._removeLayer=function(e){var t=this._layers[e];t&&(delete this._layers[e],$n(t.group))},_r.prototype.getActiveLayer=function(){var e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},_r.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}},_r.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},_r.prototype._findPlaneForRoot=function(e){return M(this._planes,(function(t){return t.rootElement===e}))},_r.prototype.getContainer=function(){return this._container},_r.prototype._updateMarker=function(e,t,n){var r;e.id||(e=this._elementRegistry.get(e)),(r=this._elementRegistry._elements[e.id])&&(N([r.gfx,r.secondaryGfx],(function(e){e&&(n?Bn(e).add(t):Bn(e).remove(t))})),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))},_r.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},_r.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},_r.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),Bn(this.getGraphics(e)).has(t)},_r.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},_r.prototype.getRootElement=function(){var e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},_r.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},_r.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},_r.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}},_r.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)},_r.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})},_r.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})},_r.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=wr[e],r=D(n,(function(e){return void 0!==t[e]}));if(!r)throw new Error("must supply { "+n.join(", ")+" } with "+e)},_r.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},_r.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},_r.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},_r.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},_r.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},_r.prototype.removeShape=function(e){return this._removeElement(e,"shape")},_r.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},_r.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},_r.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},_r.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},_r.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);nr(l,t)})),e):(t=(r=this._rootElement?this.getActiveLayer():null)&&r.getBBox()||{},n=(i=nr(l))?i.matrix:function(e,t,n,r,i,o){var a=Gn().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return Hn(a,e);case 6:return Hn(a,{a:e,b:t,c:n,d:r,e:i,f:o})}}(),o=yr(n.a,1e3),a=yr(-n.e||0,1e3),s=yr(-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})},_r.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),xr(t,n)})),{x:n.e,y:n.f}},_r.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=pr(e),s=vr(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=vr(l);if(a.width=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},_r.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),xr(this._viewport,o),o},_r.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},_r.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}},_r.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Er="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,Er,r),n&&An(n,Er,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,Er,""),r.secondaryGfx&&An(r.secondaryGfx,Er,""),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,Er,r),t},kr.prototype.get=function(e){var t;t="string"==typeof e?e:e&&An(e,Er);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 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 Mr.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 Pr=Nr;!function(e){e.exports=Pr,e.exports.Collection=Sr}(Or);var Dr=mr(Cr),Rr=new Dr({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Tr=new Dr({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Ar=new Dr({name:"attachers",collection:!0},{name:"host"}),Ir=new Dr({name:"outgoing",collection:!0},{name:"source"}),Br=new Dr({name:"incoming",collection:!0},{name:"target"});function Lr(){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)}}),Rr.bind(this,"parent"),Tr.bind(this,"labels"),Ir.bind(this,"outgoing"),Br.bind(this,"incoming")}function $r(){Lr.call(this),Rr.bind(this,"children"),Ar.bind(this,"host"),Ar.bind(this,"attachers")}function Vr(){$r.call(this)}function zr(){$r.call(this),Tr.bind(this,"labelTarget")}function Ur(){Lr.call(this),Ir.bind(this,"source"),Br.bind(this,"target")}bn($r,Lr),bn(Vr,$r),bn(zr,$r),bn(Ur,Lr);var Fr={connection:Ur,shape:$r,label:zr,root:Vr};function Wr(){this._uid=12}function qr(e,t,n){var r,i=r?Gn().createSVGTransformFromMatrix(r):Gn().createSVGTransform();i.setTranslate(t,n),nr(e,i)}function Gr(e,t){this._eventBus=e,this._elementRegistry=t}function Hr(e,t,n){var r=n||t.firstChild;e!==r&&t.insertBefore(e,r)}Wr.prototype.createRoot=function(e){return this.create("root",e)},Wr.prototype.createLabel=function(e){return this.create("label",e)},Wr.prototype.createShape=function(e){return this.create("shape",e)},Wr.prototype.createConnection=function(e){return this.create("connection",e)},Wr.prototype.create=function(e,t){return(t=$({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=Fr[e];if(!n)throw new Error("unknown type: <"+e+">");return $(new n,t)}(e,t)},Gr.$inject=["eventBus","elementRegistry"],Gr.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(e){return e.parentNode.childNodes[1]}(n),t||(Bn(t=Wn("g")).add("djs-children"),Dn(n.parentNode,t))):t=n,t},Gr.prototype._clear=function(e){var t=function(e){return e.childNodes[0]}(e);return Ft(t),t},Gr.prototype._createContainer=function(e,t,n,r){var i=Wn("g");Bn(i).add("djs-group"),void 0!==n?Hr(i,t,t.childNodes[n]):Dn(t,i);var o=Wn("g");Bn(o).add("djs-element"),Bn(o).add("djs-"+e),r&&Bn(o).add("djs-frame"),Dn(i,o);var a=Wn("g");return Bn(a).add("djs-visual"),Dn(o,a),o},Gr.prototype.create=function(e,t,n){var r=this._getChildrenContainer(t.parent);return this._createContainer(e,r,n,fr(t))},Gr.prototype.updateContainments=function(e){var t,n=this,r=this._elementRegistry;t=P(e,(function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e}),{}),N(t,(function(e){var t=e.children;if(t){var i=n._getChildrenContainer(e);N(t.slice().reverse(),(function(e){Hr(r.getGraphics(e).parentNode,i)}))}}))},Gr.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},Gr.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},Gr.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},Gr.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},Gr.prototype.update=function(e,t,n){if(t.parent){var r=this._clear(n);if("shape"===e)this.drawShape(r,t),qr(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")}},Gr.prototype.remove=function(e){$n(this._elementRegistry.getGraphics(e).parentNode)};var Xr={__depends__:[dr],__init__:["canvas"],canvas:["type",_r],elementRegistry:["type",kr],elementFactory:["type",Wr],eventBus:["type",U],graphicsFactory:["type",Gr]};function Yr(e){return function(e){var t=new Mn(e);return t.init(),t}([{config:["value",e=e||{}]},Xr].concat(e.modules||[]))}function Kr(e,t){this.injector=t=t||Yr(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}function Zr(e,t){var n=Qr(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function Qr(e){return e&&e.businessObject||e}Kr.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Kr.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};var Jr=new Dr({name:"dmnElementRef",enumerable:!0},{name:"di",configurable:!0});function ei(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}):(Jr.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){N(e.diagramElements,i)}(a),l=t,e.root(l),N(t.get("drgElement"),(function(e){r(e),function(e){N(["informationRequirement","knowledgeRequirement","authorityRequirement"],(function(t){N(e[t],(function(e){o((function(){r(e)}))}))}))}(e)})),function(e){N(e,(function(e){Zr(e,"dmn:Association")?function(e){o((function(){r(e)}))}(e):r(e)}))}(t.get("artifact")),N(n,(function(e){e()}))}}}var ti=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.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 ni(e){if(!(this instanceof ni))return new ni(e);e=e||[128,36,1],this._seed=e.length?ti.rack(e[0],e[1],e[2]):e}ni.prototype.next=function(e){return this._seed(e||!0)},ni.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},ni.prototype.claim=function(e,t){this._seed.set(e,t||!0)},ni.prototype.assigned=function(e){return this._seed.get(e)||!1},ni.prototype.unclaim=function(e){delete this._seed.hats[e]},ni.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var ri=new ni,ii="hsl(225, 10%, 15%)";function oi(e,t,n,r,i,o){Nn.call(this,t);var a=ri.next(),s=r.computeStyle,l={},u=e&&e.defaultFillColor||"white",c=e&&e.defaultStrokeColor||ii,p=e&&e.defaultLabelColor;function f(e,t,n){var r=e+"-"+si(t)+"-"+si(n)+"-"+a;return l[r]||function(e,t,n,r){if("association-start"===t){var i=Wn("path");An(i,{d:"M 11 5 L 1 10 L 11 15"}),h(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=Wn("path");An(o,{d:"M 1 5 L 11 10 L 1 15"}),h(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=Wn("path");An(a,{d:"M 1 5 L 11 10 L 1 15 Z"}),h(e,{element:a,attrs:{fill:r,stroke:"none"},ref:{x:11,y:10},scale:1})}else if("knowledge-requirement-end"===t){var s=Wn("path");An(s,{d:"M 1 3 L 11 10 L 1 17"}),h(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=Wn("circle");An(l,{cx:3,cy:3,r:3}),h(e,{element:l,attrs:{fill:r,stroke:"none"},ref:{x:3,y:3},scale:.9})}}(r,e,0,n),"url(#"+r+")"}function h(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=Wn("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=an("defs",o._svg);s||(s=Wn("defs"),Dn(o._svg,s)),Dn(s,a),l[e]=a}function d(e,t,n,r,i,o){E(i)&&(o=i,i=0),i=i||0,o=s(o,{stroke:ii,strokeWidth:2,fill:"white"});var a=Wn("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:ci(t,p,c)}},r))}function y(e,t,n){n=s(n,["no-fill"],{strokeWidth:2,stroke:ii});var r=Wn("path");return An(r,{d:t}),An(r,n),Dn(e,r),r}var g={"dmn:Decision":function(e,t){var n=d(e,t.width,t.height,0,{stroke:li(t,c),fill:ui(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:ui(t,u),stroke:li(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:ui(t,u),stroke:li(t,c)});return v(e,t,"center-middle"),r},"dmn:InputData":function(e,t){var n=d(e,t.width,t.height,22,{stroke:li(t,c),fill:ui(t,u)});return v(e,t,"center-middle"),n},"dmn:TextAnnotation":function(e,t){var r=d(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:li(t,c)}),m(e,ai(t).text||"",{style:{fill:ci(t,p,c)},box:t,align:"left-top",padding:5}),r},"dmn:Association":function(e,t){var n=ai(t),r=ui(t,u),i=li(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=ui(t,u),r=li(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=ui(t,u),r=li(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=ui(t,u),r=li(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=ur(t,n=s(n,["no-fill"],{stroke:ii,strokeWidth:2,fill:"none"}));return Dn(e,r),r}this.canRender=function(e){return Zr(e,"dmn:DMNElement")||Zr(e,"dmn:InformationRequirement")||Zr(e,"dmn:KnowledgeRequirement")||Zr(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 ai(e){return e.businessObject}function si(e){return e.replace(/[^0-9a-zA-z]+/g,"_")}function li(e,t){return t}function ui(e,t){return t}function ci(e,t,n){return t||li(0,n)}bn(oi,Nn),oi.$inject=["config.drdRenderer","eventBus","pathMap","styles","textRenderer","canvas"];var pi={width:150,height:50};function fi(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 hi(e,t,n){for(var r,i=e.shift(),o=i;;){if((r=fi(o,n)).width=o?r.width:0," "===o||""===o||r.width1)for(;n=r.shift();){if(!(n.length+oe?t.width:e}),0),d=o.top;"middle"===i.vertical&&(d+=(n.height-f)/2),d-=(s||u[0].height)/4;var m=Wn("text");return An(m,r),N(u,(function(e){var t;switch(d+=s||e.height,i.horizontal){case"left":t=o.left;break;case"right":t=(a?h:c)-o.right-e.width;break;default:t=Math.max(((a?h:c)-e.width)/2+o.left,0)}var n=Wn("tspan");An(n,{x:t,y:d}),n.textContent=e.text,Dn(m,n)})),$n(p),{dimensions:{width:h,height:f},element:m}};function yi(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 vi({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}}yi.$inject=["config.textRenderer"];var gi=/\{([^{}]+)\}/g,bi=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var wi={__init__:["drdRenderer"],drdRenderer:["type",oi],textRenderer:["type",yi],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");return An(e,n),e}function v(e,t){Dn(e,t)}this.removeHits=function(e){var t;N((t=".djs-hit",(e||document).querySelectorAll(t)),$n)},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=ur(t);return m(n,"stroke"),v(e,n),n},this.createBoxHit=function(e,t,n){n=$({x:0,y:0},n);var r=Wn("rect");return m(r,t),An(r,n),v(e,r),r},this.updateDefaultHit=function(e,t){var n=an(".djs-hit",t);if(n)return e.waypoints?cr(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}Ri.$inject=["eventBus","elementRegistry","styles"];var Ti={__init__:["interactionEvents"],interactionEvents:["type",Ri]};function Ai(e,t){this.offset=6;var n=t.cls("djs-outline",["no-fill"]),r=this;function i(e,t){var r=Wn("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=an(".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=an(".djs-outline",n);o||(o=i(n)),r.updateConnectionOutline(o,t)}))}Ai.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})},Ai.prototype.updateConnectionOutline=function(e,t){var n=pr(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})},Ai.$inject=["eventBus","styles","elementRegistry"];var Ii={__init__:["outline"],outline:["type",Ai]};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?N(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 Li="hover",$i="selected";function Vi(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,Li)})),t.on("element.out",(function(e){o(e.element,Li)})),t.on("selection.changed",(function(e){var t=e.oldSelection,n=e.newSelection;N(t,(function(e){-1===n.indexOf(e)&&o(e,$i)})),N(n,(function(e){-1===t.indexOf(e)&&i(e,$i)})),r._updateSelectionOutline(n)})),t.on("element.changed",(function(e){n.isSelected(e.element)&&r._updateSelectionOutline(n.get())}))}function zi(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(Ui))}})),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);M(n,(function(e){return i.id===e.id}))||t.select(i)})),e.on("element.click",(function(e){if(ji(e)){var r=e.element;r===n.getRootElement()&&(r=null);var i=t.isSelected(r),o=t.get().length>1,a=Ni(e)||function(e){var t=Oi(e)||e;return ji(e)&&t.shiftKey}(e);if(i&&o)return a?t.deselect(r):t.select(r);i?t.deselect(r):t.select(r,a)}}))}function Ui(e){return!e.hidden}Vi.$inject=["canvas","eventBus","selection"],Vi.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");Vn(t);var n=e.length>1;if(Bn(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}}(pr(e)),i=Wn("rect");An(i,$({rx:3},r)),Bn(i).add("djs-selection-outline"),Dn(t,i)}},zi.$inject=["eventBus","selection","canvas","elementRegistry"];var Fi={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Ti,Ii],selection:["type",Bi],selectionVisuals:["type",Vi],selectionBehavior:["type",zi]};function Wi(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}Wi.prototype.next=function(){return this._prefix+ ++this._counter};var qi=new Wi("ov");function Gi(e,t,n,r){var i,o;this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=qi,this._overlayDefaults=$({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(i=n.getContainer(),Lt(o=on('
'),{position:"absolute",width:0,height:0}),i.insertBefore(o,i.firstChild),o),this._init()}function Hi(e,t,n){Lt(e,{left:t+"px",top:n+"px"})}function Xi(e,t){e.style.display=!1===t?"none":""}function Yi(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?j(t.overlays,R({type:e.type})):t.overlays.slice():[]}return e.type?j(this._overlays,R({type:e.type})):e.id?this._overlays[e.id]:null},Gi.prototype.add=function(e,t,n){if(E(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;N(t,(function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(sn(e.html),sn(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(){Xi(this._overlayRoot)},Gi.prototype.hide=function(){Xi(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=pr(t);r=o.x,i=o.y}Hi(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?pr(o).width:o.width,a=-1*r.right+t);void 0!==r.bottom&&(n=o.waypoints?pr(o).height:o.height,s=-1*r.bottom+n);Hi(i,a||0,s||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Gi.prototype._createOverlayContainer=function(e){var t=on('
');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(",")+")";Yi(this._overlayRoot,n)},Gi.prototype._getOverlayContainer=function(e,t){var n=M(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=on(o)),n=this._getOverlayContainer(i),Lt(t=on('
'),{position:"absolute"}),t.appendChild(o),e.type&&zt(t).add("djs-overlay-"+e.type),Xi(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)&&or&&(i=(1/t.scale||1)*r)),_(i)&&(s="scale("+i+","+i+")"),Yi(a,s)},Gi.prototype._updateOverlaysVisibilty=function(e){var t=this;N(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;N(t.get({element:n}),(function(e){t.remove(e.id)}));var r=t._getOverlayContainer(n);if(r){sn(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&&(N(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 Zi(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='
'}function Qi(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)}))}Zi.$inject=["eventBus","canvas","translate"],Zi.prototype._init=function(){var e=this._canvas,t=this._eventBus,n=e.getContainer(),r=this._container=on(this.HTML_MARKUP);n.appendChild(r),this.nameElement=an(".dmn-definitions-name",this._container),this.idElement=an(".dmn-definitions-id",this._container),en.bind(r,".dmn-definitions-name, .dmn-definitions-id","mousedown",(function(e){e.stopPropagation()})),t.fire("definitionIdView.create",{html:r})},Zi.prototype.update=function(){var e=this._canvas.getRootElement().businessObject;this.nameElement.textContent=e.name,this.idElement.textContent=e.id},Qi.$inject=["eventBus","canvas"];var Ji={__depends__:[Ci],__init__:["definitionPropertiesView","definitionPropertiesPaletteAdapter"],definitionPropertiesView:["type",Zi],definitionPropertiesPaletteAdapter:["type",Qi]},eo=[{className:"dmn-icon-decision-table",matches:function(e){var t=e.businessObject;return Zr(t,"dmn:Decision")&&Zr(t.decisionLogic,"dmn:DecisionTable")}},{className:"dmn-icon-literal-expression",matches:function(e){var t=e.businessObject;return Zr(t,"dmn:Decision")&&Zr(t.decisionLogic,"dmn:LiteralExpression")}}],to=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\n \n
\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;en.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}();to.$inject=["injector","eventBus","overlays","config.drillDown"];var no={__depends__:[Ki],__init__:["drillDown"],drillDown:["type",to]},ro=''; /** * This file must not be changed or exchanged. * * @see http://bpmn.io/license for more information. */function io(e){return e.join(";")}var oo,ao='
'+ro+'Web-based tooling for BPMN, DMN and CMMN diagrams powered by bpmn.io.
';var so=["additionalModules","canvas"];function lo(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 uo(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function fo(e){ /** * Adds the project logo to the diagram container as * required by the bpmn.io license. * * @see http://bpmn.io/license * * @param {Element} container */ var t,n;this._container=this._createContainer(),t=this._container,n=on(''+ro+""),t.appendChild(n),Zt.bind(n,"click",(function(e){oo||(oo=on(ao),en.bind(oo,".backdrop","click",(function(e){document.body.removeChild(oo)}))),document.body.appendChild(oo),e.preventDefault()})),this._init(this._container,e)}function ho(e,t){return{x:e.x-t.x,y:e.y-t.y}}function mo(e){return Math.log(e)/Math.log(10)}function vo(e,t){var n=mo(e.min),r=mo(e.max);return(Math.abs(n)+Math.abs(r))/t}bn(fo,Kr),fo.prototype.saveSVG=ln((function(e){var t=this;return new Promise((function(e){var n=t.get("canvas"),r=n.getActiveLayer(),i=an("defs",n._svg),o=er(r),a=i&&i.outerHTML||"",s=r.getBBox();e({svg:'\n\x3c!-- created with dmn-js / http://bpmn.io --\x3e\n\n'+a+o+""})}))})),fo.prototype.getModules=function(){return this._modules},fo.prototype.destroy=function(){Kr.prototype.destroy.call(this),sn(this._container)},fo.prototype.on=function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)},fo.prototype.off=function(e,t){this.get("eventBus").off(e,t)},fo.prototype._init=function(e,t){var n=t.additionalModules,r=t.canvas,i=po(t,so),o=t.modules||this.getModules(),a=[].concat([{drd:["value",this]}],v(o),v(n||[])),s=uo(uo({},i),{},{canvas:uo(uo({},r),{},{container:e}),modules:a});Kr.call(this,s),t&&t.container&&this.attachTo(t.container)},fo.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},fo.prototype._createContainer=function(){return on('
')},fo.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 ei({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:[]})}))},fo.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()},fo.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},fo.prototype._modules=[ki,Ci,Fi,Ki,Ji,no];var yo=Math.sign||function(e){return e>=0?1:-1},go={min:.2,max:4};function bo(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=L(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||.75;var r=this;t.on("canvas.init",(function(t){r._init(!1!==e.enabled)}))}bo.$inject=["config.zoomScroll","eventBus","canvas"],bo.prototype.scroll=function(e){this._canvas.scroll(e)},bo.prototype.reset=function(){this._canvas.zoom("fit-viewport")},bo.prototype.zoom=function(e,t){var n=vo(go,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},bo.prototype._handleWheel=function(e){if(!qt(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,r=e.ctrlKey,i=e.shiftKey,o=-1*this._scale;if(o*=r?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,r){var a=t.getBoundingClientRect(),s={x:e.clientX-a.left,y:e.clientY-a.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*yo(e.deltaY)*o,this.zoom(n,s)}else n=i?{dx:o*e.deltaY,dy:0}:{dx:o*e.deltaX,dy:o*e.deltaY},this.scroll(n)}},bo.prototype.stepZoom=function(e,t){var n=vo(go,10);this._zoom(e,t,n)},bo.prototype._zoom=function(e,t,n){var r=this._canvas,i=e>0?1:-1,o=mo(r.zoom()),a=Math.round(o/n)*n;a+=n*i;var s,l,u=Math.pow(10,a);r.zoom((s=go,l=u,Math.max(s.min,Math.min(s.max,l))),t)},bo.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,r=this._enabled;return void 0===e&&(e=!r),r!==e&&Zt[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},bo.prototype._init=function(e){this.toggle(e)};var wo={__init__:["zoomScroll"],zoomScroll:["type",bo]},_o=/^djs-cursor-.*$/;function xo(e){var t=zt(document.body);t.removeMatching(_o),e&&t.add("djs-cursor-"+e)}function Eo(e,t){var n;function r(r){var i,o=n.start,a=n.button,s=Si(r),l=ho(s,o);(!n.dragging&&(i=l,Math.sqrt(Math.pow(i.x,2)+Math.pow(i.y,2))>15)&&(n.dragging=!0,0===a&&function(e,t){function n(){return!1}t=t||"element.click",e.once(t,5e3,n)}(e),xo("grab")),n.dragging)&&(l=ho(s,n.last||n.start),t.scroll({dx:l.x,dy:l.y}),n.last=s);r.preventDefault()}function i(e){Zt.unbind(document,"mousemove",r),Zt.unbind(document,"mouseup",i),n=null,xo(null)}e.on("element.mousedown",500,(function(e){return function(e){if(qt(e.target,".djs-draggable"))return;var t=e.button;if(t>=2||e.ctrlKey||e.shiftKey||e.altKey)return;return n={button:t,start:Si(e)},Zt.bind(document,"mousemove",r),Zt.bind(document,"mouseup",i),!0}(e.originalEvent)})),this.isActive=function(){return!!n}}Eo.$inject=["eventBus","canvas"];var ko={__init__:["moveCanvas"],moveCanvas:["type",Eo]},Co={};!function(e){!function(t,r,i,o){var a,s=["","webkit","Moz","MS","ms","o"],l=r.createElement("div"),u=Math.round,c=Math.abs,p=Date.now;function f(e,t,n){return setTimeout(b(e,n),t)}function h(e,t,n){return!!Array.isArray(e)&&(d(e,n[t],n),!0)}function d(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==o)for(r=0;r\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,i,r),e.apply(this,arguments)}}a="function"!=typeof Object.assign?function(e){if(e===o||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n-1}function O(e){return e.trim().split(/\s+/g)}function S(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;rn[t]})):r.sort()),r}function N(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),a=0;a1&&!n.firstMultiple?n.firstMultiple=F(t):1===i&&(n.firstMultiple=!1);var a=n.firstInput,s=n.firstMultiple,l=s?s.center:a.center,u=t.center=W(r);t.timeStamp=p(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=X(l,u),t.distance=H(l,u),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y});t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=G(t.deltaX,t.deltaY);var f=q(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=f.x,t.overallVelocityY=f.y,t.overallVelocity=c(f.x)>c(f.y)?f.x:f.y,t.scale=s?(h=s.pointers,d=r,H(d[0],d[1],V)/H(h[0],h[1],V)):1,t.rotation=s?function(e,t){return X(t[1],t[0],V)+X(e[1],e[0],V)}(s.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,i,a,s=e.lastInterval||t,l=t.timeStamp-s.timeStamp;if(8!=t.eventType&&(l>25||s.velocity===o)){var u=t.deltaX-s.deltaX,p=t.deltaY-s.deltaY,f=q(l,u,p);r=f.x,i=f.y,n=c(f.x)>c(f.y)?f.x:f.y,a=G(u,p),e.lastInterval=t}else n=s.velocity,r=s.velocityX,i=s.velocityY,a=s.direction;t.velocity=n,t.velocityX=r,t.velocityY=i,t.direction=a}(n,t);var h,d;var m=e.element;k(t.srcEvent.target,m)&&(m=t.srcEvent.target);t.target=m}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function F(e){for(var t=[],n=0;n=c(t)?e<0?2:4:t<0?8:16}function H(e,t,n){n||(n=$);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function X(e,t,n){n||(n=$);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}z.prototype={handler:function(){},init:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(D(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(D(this.element),this.evWin,this.domHandler)}};var Y={mousedown:1,mousemove:2,mouseup:4},K="mousedown",Z="mousemove mouseup";function Q(){this.evEl=K,this.evWin=Z,this.pressed=!1,z.apply(this,arguments)}g(Q,z,{handler:function(e){var t=Y[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:B,srcEvent:e}))}});var J={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},ee={2:I,3:"pen",4:B,5:"kinect"},te="pointerdown",ne="pointermove pointerup pointercancel";function re(){this.evEl=te,this.evWin=ne,z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(te="MSPointerDown",ne="MSPointerMove MSPointerUp MSPointerCancel"),g(re,z,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=J[r],o=ee[e.pointerType]||e.pointerType,a=o==I,s=S(t,e.pointerId,"pointerId");1&i&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):12&i&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var ie={touchstart:1,touchmove:2,touchend:4,touchcancel:8},oe="touchstart",ae="touchstart touchmove touchend touchcancel";function se(){this.evTarget=oe,this.evWin=ae,this.started=!1,z.apply(this,arguments)}function le(e,t){var n=M(e.touches),r=M(e.changedTouches);return 12&t&&(n=j(n.concat(r),"identifier",!0)),[n,r]}g(se,z,{handler:function(e){var t=ie[e.type];if(1===t&&(this.started=!0),this.started){var n=le.call(this,e,t);12&t&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:e})}}});var ue={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ce="touchstart touchmove touchend touchcancel";function pe(){this.evTarget=ce,this.targetIds={},z.apply(this,arguments)}function fe(e,t){var n=M(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=M(e.changedTouches),s=[],l=this.target;if(o=n.filter((function(e){return k(e.target,l)})),1===t)for(i=0;i-1&&r.splice(e,1)}),2500)}}function ve(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+je(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+je(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Se},canEmit:function(){for(var e=0;et.threshold&&i&t.direction},attrTest:function(e){return De.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Ne(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),g(Te,De,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[xe]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),g(Ae,Me,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[we]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distancet.time;if(this._input=e,!r||!n||12&e.eventType&&!i)this.reset();else if(1&e.eventType)this.reset(),this._timer=f((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return Se},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=p(),this.manager.emit(this.options.event,this._input)))}}),g(Ie,De,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[xe]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),g(Be,De,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Re.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:n&L&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&c(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Ne(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),g(Le,Me,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[_e]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance1&&void 0!==arguments[1]?arguments[1]:{};return t.id||(t.id=e+"_"+this._uid++),Bo(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}(),Vo=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 zo(this._elements)}},{key:"forEach",value:function(e){zo(this._elements).forEach((function(t){return e(t)}))}},{key:"filter",value:function(e){return zo(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 zo(e){return Object.keys(e).map((function(t){return e[t]}))}Vo.$inject=["eventBus"];var Uo=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;r3?e.slice(0,3).toString()+",...":e.toString())+")";else if(Ho(e))t="Text("+e+")";else if(Yo(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 oa(e,t){for(var r={},i=0,o=e.length;i0);t&&ta(t+ia(e))}e.isValidated=!0}var la="$";function ua(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 ca(e,t,n,r,i,o,a,s){14&e&&ta("Creating Component vNodes using createVNode is not allowed. Use Inferno.createComponentVNode method.");var l=void 0===i?1:i,u=ua(l,r,n,e,a,o,s,t);return 0===l&&ya(u,u.children),aa(u),u}function pa(e,t,n,r,i){1&e&&ta("Creating element vNodes using createComponentVNode is not allowed. Use Inferno.createVNode method."),(2&e)>0&&(e=t.prototype&&Ko(t.prototype.render)?4:8);var o=t.defaultProps;if(!Xo(o))for(var a in n||(n={}),o)ea(n[a])&&(n[a]=o[a]);if((8&e)>0){var s=t.defaultHooks;if(!Xo(s))if(i)for(var l in s)ea(i[l])&&(i[l]=s[l]);else i=s}var u=ua(1,null,null,e,r,n,i,t),c=ga.createVNode;return Ko(c)&&c(u),u}function fa(e,t){return ua(1,Xo(e)?"":e,null,16,t,null,null,null)}function ha(e){var t=e.props;if(t){var n=e.flags;481&n&&(void 0!==t.children&&Xo(e.children)&&ya(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?ra(e.ref,t.ref):t.ref,t.ref=void 0)}return e}function da(e){var t,n=e.flags;if(14&n){var r,i=e.props;if(!Jo(i))for(var o in r={},i)r[o]=i[o];t=pa(n,e.type,r,e.key,e.ref)}else 481&n?t=ca(n,e.type,e.className,e.children,e.childFlags,e.props,e.key,e.ref):16&n?t=fa(e.children,e.key):1024&n&&(t=e);return t}function ma(){return fa("",null)}function va(e,t,n,r){for(var i=e.length;n0;for(var s in a&&(o=Ka(n))&&Ya(t,r,n),n)ns(s,null,n[s],r,i,o,null);a&&Xa(t,e,r,n,!0,o)}function is(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===xa&&(i.props=n),i.$UN=!1,Ko(i.componentWillMount)){if(i.$BR=!0,i.componentWillMount(),i.$PSS){var o=i.state,a=i.$PS;if(Jo(o))i.state=a;else for(var s in a)o[s]=a[s];i.$PSS=!1,i.$PS=null}i.$BR=!1}Ko(ga.beforeRender)&&ga.beforeRender(i);var l,u=os(i.render(n,i.state,r),e);return Ko(i.getChildContext)&&(l=i.getChildContext()),Xo(l)?i.$CX=r:i.$CX=ra(r,l),Ko(ga.afterRender)&&ga.afterRender(i),i.$LI=u,i}function os(e,t){return Go(e)&&ta("a valid Inferno VNode (or null) must be returned from a component render. You may have returned an array or an invalid object."),Yo(e)?e=ma():Ho(e)?e=fa(e,null):(e.dom&&(e=da(e)),14&e.flags&&(e.parentVNode=t)),e}function as(e,t,r,i){var o=e.flags;return 481&o?ls(e,t,r,i):14&o?function(e,t,n,r,i){var o,a=e.type,s=e.props||xa,l=e.ref;if(i){var u=is(e,a,s,n);e.dom=o=as(u.$LI,null,u.$CX,r),cs(e,l,u),u.$UPD=!1}else{var c=os(a(s,n),e);e.children=c,e.dom=o=as(c,null,n,r),ps(s,l,o)}Jo(t)||ka(t,o);return o}(e,t,r,i,(4&o)>0):512&o||16&o?ss(e,t):1024&o?(as(e.children,e.type,r,!1),e.dom=ss(ma(),t)):void("object"===n(e)?ta("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)+'".'):ta('mount() expects a valid VNode, instead it received an object with the type "'+n(e)+'".'))}function ss(e,t){var n=e.dom=document.createTextNode(e.children);return Jo(t)||ka(t,n),n}function ls(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,Xo(s)||""===s||(r?c.setAttribute("class",s):c.className=s),sa(e),Jo(t)||ka(t,c),0==(1&u)){var p=!0===r&&"foreignObject"!==e.type;2===u?as(o,c,n,p):12&u&&us(o,c,n,p)}return Jo(a)||rs(e,i,a,c,r),Zo(l)&&ta('string "refs" are not supported in Inferno 1.0. Use callback "refs" instead.'),Ko(l)&&fs(c,l),c}function us(e,t,n,r){for(var i=0,o=e.length;i0,1!==t.nodeType||t.tagName.toLowerCase()!==e.type){na("Inferno hydration: Server-side markup doesn't match client-side markup or Initial render target is not empty");var u=ls(e,null,n,r);e.dom=u,Oa(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)Jo(c)?as(i,t,n,r):(f=c.nextSibling,ds(i,c,n,r),c=f);else if(12&p)for(var h=0,d=i.length;h0):481&o?hs(e,t,r,i):16&o?function(e,t){if(3!==t.nodeType){var n=ss(e,null);e.dom=n,Oa(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:(ta('hydrate() expects a valid VNode, instead it received an object with the type "'+n(e)+'".'),ta())}function ms(e,t,n,r,i){Qa(e),Oa(n,as(t,null,r,i),e.dom)}function vs(e,t,n,r,i){var o=0|t.flags;e.flags!==o||2048&o?ms(e,t,n,r,i):481&o?function(e,t,n,r,i,o){var a=t.type;if(e.type!==a)ms(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 h=u||xa;if((s=c||xa)!==xa)for(var d in(p=(448&o)>0)&&(f=Ka(s)),s){var m=h[d],v=s[d];m!==v&&ns(d,m,v,l,i,f,e)}if(h!==xa)for(var y in h)s.hasOwnProperty(y)||Xo(h[y])||ns(y,h[y],null,l,i,f,e)}var g=e.children,b=t.children,w=t.ref,_=e.className,x=t.className;sa(t),4096&o?function(e,t){e.textContent!==t.children&&(e.textContent=t.children)}(l,b):ys(e.childFlags,t.childFlags,g,b,l,r,i&&"foreignObject"!==a),p&&Xa(o,t,l,s,!1,f),_!==x&&(Xo(x)?l.removeAttribute("class"):i?l.setAttribute("class",x):l.className=x),Ko(w)&&e.ref!==w?fs(l,w):Zo(w)&&ta('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)ms(e,t,n,r,i);else{var u=t.props||xa;if(o){var c=e.children;c.$UPD=!0,c.$V=t,gs(c,c.state,t,u,n,r,i,!1,!1),c.$UPD=!1}else{var p=!0,f=e.props,h=t.ref,d=!Xo(h),m=e.children;if(t.dom=e.dom,t.children=m,d&&Ko(h.onComponentShouldUpdate)&&(p=h.onComponentShouldUpdate(f,u)),!1!==p){d&&Ko(h.onComponentWillUpdate)&&h.onComponentWillUpdate(f,u);var v=a(u,r);v!==Wo&&(vs(m,v=os(v,t),n,r,i),t.children=v,t.dom=v.dom,d&&Ko(h.onComponentDidUpdate)&&h.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(ys(e.childFlags,t.childFlags,e.children,o,r,n,!1),t.dom=e.dom,r!==i&&!Yo(o)){var a=o.dom;r.removeChild(a),i.appendChild(a)}}(e,t,r)}function ys(e,t,n,r,i,o,a){switch(e){case 2:switch(t){case 2:vs(n,r,i,o,a);break;case 1:Za(n,i);break;default:Za(n,i),us(r,i,o,a)}break;case 1:switch(t){case 2:as(r,i,o,a);break;case 1:break;default:us(r,i,o,a)}break;default:if(12&t){var s=n.length,l=r.length;0===s?l>0&&us(r,i,o,a):0===l?es(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],h=t[p];e:{for(;f.key===h.key;){if(h.dom&&(t[p]=h=da(h)),vs(f,h,n,r,i),e[p]=h,++p>u||p>c)break e;f=e[p],h=t[p]}for(f=e[u],h=t[c];f.key===h.key;){if(h.dom&&(t[c]=h=da(h)),vs(f,h,n,r,i),e[u]=h,c--,p>--u||p>c)break e;f=e[u],h=t[c]}}if(p>u){if(p<=c)for(var d=(l=c+1)c)for(;p<=u;)Za(e[p++],n);else{var m=p,v=p,y=u-p+1,g=c-p+1,b=[];for(s=0;sm;)Za(e[m++],n);x>p?_=!0:x=p,h.dom&&(t[p]=h=da(h)),vs(f,h,n,r,i),E++;break}!w&&p>c&&Za(f,n)}else w||Za(f,n);else{var k={};for(s=v;s<=c;s++)k[t[s].key]=s;for(s=m;s<=u;s++)if(f=e[s],Em;)Za(e[m++],n);h=t[p],b[p-v]=s+1,x>p?_=!0:x=p,h.dom&&(t[p]=h=da(h)),vs(f,h,n,r,i),E++}else w||Za(f,n);else w||Za(f,n)}if(w)es(n,e),us(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;t0&&(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]?((h=t[x=s+v]).dom&&(t[x]=h=da(h)),l=x+1,Ca(n,as(h,null,r,i),l=0;s--)0===b[s]&&((h=t[x=s+v]).dom&&(t[x]=h=da(h)),l=x+1,Ca(n,as(h,null,r,i),la?a:o,c=0;ca)for(c=u;c0&&Sa(Ea),t.$V=e,Ko(n)&&n()}(e,t),r=e):Xo(e)?(Za(r,t),t.$V=null):(e.dom&&(e=da(e)),vs(r,e,t,xa,!1),r=t.$V=e),Ea.length>0&&Sa(Ea),Ko(n)&&n(),Ko(ga.renderComplete)&&ga.renderComplete(r),r&&14&r.flags?r.children:void 0}}var _s="undefined"==typeof Promise?null:Promise.resolve(),xs="undefined"==typeof requestAnimationFrame?setTimeout:requestAnimationFrame.bind(window);function Es(e,t,n,r){Ko(t)&&(t=t(e.state,e.props,e.context));var i,o=e.$PS;if(Xo(o))e.$PS=t;else for(var a in t)o[a]=t[a];if(e.$PSS||e.$BR)e.$PSS=!0,e.$BR&&Ko(n)&&Ea.push(n.bind(e));else if(e.$UPD){var s=e.$QU;Jo(s)&&(s=e.$QU=[],i=function(e,t){return function(){e.$QU=null,e.$UPD=!0,ks(e,!1,(function(){for(var n=0,r=t.length;n0,t,!0),e.$UN)return;if(0==(1024&e.$LI.flags))for(var u=e.$LI.dom;!Jo(s=s.parentVNode);)(14&s.flags)>0&&(s.dom=u);Ea.length>0&&Sa(Ea)}else e.state=e.$PS,e.$PS=null;Ko(n)&&n.call(e)}}var Cs=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||xa,this.context=t||xa};Cs.prototype.forceUpdate=function(e){this.$UN||Es(this,{},e,!0)},Cs.prototype.setState=function(e,t){this.$UN||(this.$BS?ta("cannot update state via setState() in componentWillUpdate() or constructor."):Es(this,e,t,!1))},Cs.prototype.render=function(e,t,n){};var Os=function(){};console.info("Inferno is in development mode."),-1===(Os.name||Os.toString()).indexOf("testFn")&&na("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 Ss=function(e){s(n,e);var t=h(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 ca(1,"div","tjs-container",[r&&r.map((function(e,t){return pa(2,e,null,t)})),ca(1,"div","tjs-table-container",ca(1,"table","tjs-table",[o&&pa(2,o,{rows:t,cols:n}),a&&pa(2,a,{rows:t,cols:n}),s&&pa(2,s,{rows:t,cols:n})],0),2,{onScroll:this.onScroll}),i&&i.map((function(e,t){return pa(2,e,null,t)}))],0)}}]),n}(Cs),Ms=function(){function e(t,n,i,o,a){r(this,e);var s=i.container;this._container=s,o.on("root.added",(function(){ws(pa(2,Ss,{injector:a}),s)})),o.on("root.remove",(function(){ws(null,s)}))}return o(e,[{key:"getContainer",value:function(){return this._container}}]),e}();Ms.$inject=["changeSupport","components","config.renderer","eventBus","injector"];var js={__init__:["changeSupport","components","renderer"],changeSupport:["type",Uo],components:["type",Fo],renderer:["type",Ms]},Ns=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),Ps(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],Ps(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&&(Ds(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,Ds(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),Ps(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],Ps(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&&(Ds(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,Ds(r,n.rows[i].cells)})),this._eventBus.fire("col.remove",{col:e}))}},{key:"resized",value:function(){this._eventBus.fire("sheet.resized")}}]),e}();function Ps(e,t,n){return t.splice(e,0,n)}function Ds(e,t){return t.splice(e,1)}function Rs(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t="number"==typeof e?e:e?300:0;return t?function(e){return B(e,t)}:function(e){return e}}Ns.$inject=["elementRegistry","eventBus"],Rs.$inject=["config.throttle"];var Ts={__depends__:[js],__init__:["elementFactory","sheet"],elementFactory:["type",$o],elementRegistry:["type",Vo],eventBus:["type",U],sheet:["type",Ns],throttle:["factory",Rs]},As=["modules"],Is=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=Bs(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,As)}}},{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 Bs(e,t){var n=new Mn([{config:["value",e]},Ts].concat(t||[]));return n.init(),n}function Ls(e){if(!e)return"";var t=e.id?' id="'.concat(e.id,'"'):"";return"<".concat(e.$type).concat(t," />")}function $s(e,t){function n(t,n,r){if(t.gfx)throw new Error("already rendered ".concat(Ls(t)));return e.element(t,n,r)}function r(e,t,r){N(e,(function(e){n(e,t,r)}))}function i(e,t,r){N(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(Ls(t)));if(!o.output)throw new Error("missing output for ".concat(Ls(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,N(a,(function(e){n(e,s,l),i(e.inputEntry,e),i(e.outputEntry,e)}))}}}function Vs(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 zs(e,t){return e.elements.join(t)}function Us(){for(var e={elements:[],index:{}},t=arguments.length,r=new Array(t),i=0;i0?e=Vs(e,t):"object"===r&&null!==t&&Object.keys(t).forEach((function(n){t[n]&&(e=Vs(e,n))}))})),zs(e," ")}function Fs(e){return Ws(e.constructor,e)}function Ws(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: 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=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var rl={slotFill:function(e,t){var n=e.type,r=e.context,i=nl(e,Zs),o=this.components.getComponent(n,r)||t;return o?ha(pa(2,o,el(el({},r),i))):null},slotFills:function(e){var t=e.type,n=e.context,r=nl(e,Qs);return this.components.getComponents(t,n).map((function(e){return ha(pa(2,e,el(el({},n),r)))}))}};function il(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}rl.$inject=["components"];var ol=function(e){s(n,e);var t=h(n);function n(e,i){var o;return r(this,n),il(p(o=t.call(this,e,i)),"onElementsChanged",(function(){o.forceUpdate()})),qs(p(o),rl),Fs(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 ca(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}(Cs);function al(e){var t=e.row.businessObject,n=t.id,r=t.description;return pa(2,Ks,{className:"annotation",elementId:n,children:r||"-"})}function sl(e){e.onGetComponent("cell",(function(e){var t=e.cellType;return"after-label-cells"===t?ol:"after-rule-cells"===t?al:void 0}))}ol.$inject=["changeSupport","sheet","translate"],sl.$inject=["components"];var ll={__init__:["annotationsProvider"],annotationsProvider:["type",sl]};function ul(e,t){return $({id:e.id,type:e.$type,businessObject:e},t)}var cl=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(Zr(e,"dmn:DecisionTable"))t=this._elementFactory.createRoot(ul(e)),this._sheet.setRoot(t);else if(Zr(e,"dmn:InputClause"))t=this._elementFactory.createCol(ul(e)),this._sheet.addCol(t);else if(Zr(e,"dmn:OutputClause"))t=this._elementFactory.createCol(ul(e)),this._sheet.addCol(t);else if(Zr(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(ul(e))}));t=this._elementFactory.createRow($(ul(e),{cells:r})),this._sheet.addRow(t)}return this._eventBus.fire("dmnElement.added",{element:t}),t}}]),e}();cl.$inject=["elementFactory","eventBus","sheet"];var pl={__depends__:[{__depends__:[Ci],tableImporter:["type",cl]},js]};function fl(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 hl=function(e){s(n,e);var t=h(n);function n(e,i){var o;return r(this,n),fl(p(o=t.call(this,e,i)),"onElementsChanged",(function(){o.forceUpdate()})),qs(p(o),rl),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(!Zr(t,"dmn:DMNElement"))return null;var n=Qr(t),r=n.input,i=n.output;return ca(1,"thead",null,ca(1,"tr",null,[ca(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},dl)})),i.map((function(t,n){return e.slotFill({type:"cell",context:{cellType:"output-header",output:t,index:n,outputsLength:i.length},key:t.id},ml)})),this.slotFills({type:"cell",context:{cellType:"after-label-cells"}})],0),2)}}]),n}(Cs);function dl(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 ca(1,"th",(r||"")+" input-cell",[ca(1,"div","clause",l(0===i?"When":"And"),0),o?ca(1,"div","input-label",o,0,{title:l("Input Label: ")+o}):ca(1,"div","input-expression",a.text,0,{title:l("Input Expression: ")+a.text}),ca(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 ml(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 ca(1,"th",(r||"")+" output-cell",[ca(1,"div","clause",u(0===i?"Then":"And"),0),o?ca(1,"div","output-label",o,0,{title:u("Output Label")}):ca(1,"div","output-name",a,0,{title:u("Output Name")}),ca(1,"div","output-variable",s&&s.text||l,0,{title:s&&s.text?u("Output Values"):u("Output Type")})],0,null,n.id)}function vl(e){e.onGetComponent("table.head",(function(){return hl}))}vl.$inject=["components"];var yl={__init__:["decisionTableHeadProvider"],decisionTableHeadProvider:["type",vl]},gl=function(e){s(n,e);var t=h(n);function n(e,i){var o;return r(this,n),(o=t.call(this,e,i))._translate=i.injector.get("translate"),Fs(p(o)),o}return o(n,[{key:"render",value:function(){var e=this.sheet.getRoot();if(!Zr(e,"dmn:DMNElement"))return null;var t=e.businessObject.$parent.name,n=this.components.getComponent("hit-policy")||bl;return ca(1,"div","decision-table-properties",[ca(1,"div","decision-table-name",t,0,{title:this._translate("Decision Name: ")+t}),ca(1,"div","decision-table-header-separator"),pa(2,n)],4)}}]),n}(Cs);function bl(){return null}gl.$inject=["sheet","components"];var wl=o((function e(t){r(this,e),t.onGetComponent("table.before",500,(function(){return gl}))}));wl.$inject=["components"];var _l={__init__:["decisionTableProperties"],decisionTableProperties:["type",wl]},xl=function(e){s(n,e);var t=h(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 ca(1,"td","rule-index",[r&&r.map((function(e){return pa(2,e,{row:t,rowIndex:n})})),n+1],0,{"data-element-id":t.id,"data-row-id":t.id})}}]),n}(Cs),El=o((function e(t){r(this,e),t.onGetComponent("cell",(function(e){if("before-rule-cells"===e.cellType)return xl}))}));El.$inject=["components"];var kl={__init__:["decisionRuleIndices"],decisionRuleIndices:["type",El]},Cl=[{label:"FEEL",value:"feel"}],Ol=function(){function e(t){r(this,e),this._injector=t;var n=t.get("config.expressionLanguages")||{};this._config={options:Cl,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 M(this.getAll(),(function(t){return e===t.value}))}}]),e}();Ol.$inject=["injector"];var Sl={__init__:["expressionLanguages"],expressionLanguages:["type",Ol]},Ml=function(e){s(n,e);var t=h(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 ca(1,"tbody",null,t.map((function(e,t){var i=r.getComponent("row",{rowType:"rule"});return i&&pa(2,i,{row:e,rowIndex:t,cols:n},e.id)})),0)}}]),n}(Cs),jl=function(e){s(n,e);var t=h(n);function n(e,i){var o;return r(this,n),qs(p(o=t.call(this,e,i)),rl),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 ca(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}(Cs),Nl=function(e){s(n,e);var t=h(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 Zr(t,"dmn:UnaryTests")?pa(2,Ks,{className:"input-cell",elementId:t.id,"data-row-id":n.id,"data-col-id":r.id,children:t.businessObject.text}):pa(2,Ks,{className:"output-cell",elementId:t.id,"data-row-id":n.id,"data-col-id":r.id,children:t.businessObject.text})}}]),n}(Cs),Pl=o((function e(t){r(this,e),t.onGetComponent("table.body",(function(){return Ml})),t.onGetComponent("row",(function(e){if("rule"===e.rowType)return jl})),t.onGetComponent("cell",(function(e){if("rule"===e.cellType)return Nl}))}));Pl.$inject=["components"];var Dl={__depends__:[Sl],__init__:["decisionRules"],decisionRules:["type",Pl]},Rl=[{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"}],Tl=function(e){s(n,e);var t=h(n);function n(e,i){var o;return r(this,n),(o=t.call(this,e,i))._translate=i.injector.get("translate"),Fs(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=M(Rl,(function(e){return r=e.value,i={aggregation:t,hitPolicy:n},r.hitPolicy===i.hitPolicy&&r.aggregation===i.aggregation;var r,i}));return ca(1,"div","hit-policy header",[ca(1,"label","dms-label",this._translate("Hit Policy:"),0),ca(1,"span","hit-policy-value",this._translate(r.label),0)],4,{title:this._translate(r.explanation)})}}]),n}(Cs);function Al(e){e.onGetComponent("hit-policy",(function(){return Tl}))}Tl.$inject=["sheet"],Al.$inject=["components"];var Il={__init__:["hitPolicyProvider"],hitPolicyProvider:["type",Al]};function Bl(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 Ll=function(e){s(n,e);var t=h(n);function n(e,i){var o;r(this,n),Bl(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 ca(1,"div","view-drd",ca(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}(Cs),$l=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 Ll})),n.on("showDrd",(function(){var e=i.get("_parent",!1),t=Vl(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=Vl(this._sheet.getRoot());return!!e.getView(t)}}]),e}();function Vl(e){var t=e.businessObject;if(t)return t.$parent.$parent}$l.$inject=["components","eventBus","injector","sheet"];var zl={__init__:["viewDrd"],viewDrd:["type",$l]};function Ul(){return ca(32,"svg",null,[ca(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"}),ca(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 Fl(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=h(n);function n(e,i){var o;r(this,n),Fl(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 ca(1,"div","powered-by",ca(1,"div","powered-by__logo",pa(2,Ul),2,{title:"Powered by bpmn.io",onClick:this.onClick},null,(function(t){return e.node=t})),2)}}]),n}(Cs),ql=function(e){s(n,e);var t=h(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&&ca(1,"div","powered-by-overlay",ca(1,"div","powered-by-overlay-content",[ca(1,"a","logo",pa(2,Ul),2,{href:"https://bpmn.io",target:"_blank",rel:"noopener"}),ca(1,"span",null,[fa("Web-based tooling for BPMN, DMN and CMMN diagrams powered by "),ca(1,"a",null,fa("bpmn.io"),2,{href:"http://bpmn.io",target:"_blank"}),fa(".")],4)],4,{onClick:function(e){return e.stopPropagation()}}),2,{onClick:this.onClick})}}]),n}(Cs),Gl=o((function e(t,n){r(this,e),t.onGetComponent("table.before",(function(){return Wl})),t.onGetComponent("table.before",(function(){return ql}))}));Gl.$inject=["components","eventBus"];var Hl={__init__:["poweredBy"],poweredBy:["type",Gl]},Xl=["modules","additionalModules"];function Yl(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=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Kl=function(e){s(n,e);var t=h(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 $s({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=Yl(e,Xl),i=t||this.getModules(),o=n||[],a=[{decisionTable:["value",this]}];return{modules:[Hl].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",{}),sn(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,pl,Ci,yl,_l,kl,Dl,Il,zl]}},{key:"_createContainer",value:function(){return on('
')}}]),n}(Is),Zl=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=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var iu=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=ou(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:ru(e,nu)}}},{key:"destroy",value:function(){this.get("eventBus").fire("viewer.destroy")}},{key:"clear",value:function(){this.get("eventBus").fire("viewer.clear")}}]),e}();function ou(e,t){var n=new Mn([{config:["value",e]},tu].concat(t||[]));return n.init(),n}var au=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}();au.$inject=["viewer","eventBus"];var su={__init__:["elementRegistry"],elementRegistry:["type",au]},lu=function(e){s(n,e);var t=h(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 ca(1,"div","decision-properties",ca(1,"h3","decision-name",this._viewer.getDecision().name,0),2)}}]),n}(Cs),uu=o((function e(t){r(this,e),t.onGetComponent("viewer",1500,(function(){return lu}))}));uu.$inject=["components"];var cu={__init__:["decisionProperties"],decisionProperties:["type",uu]},pu=function(e){s(n,e);var t=h(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 ca(1,"div","literal-expression-properties",ca(1,"table",null,[ca(1,"tr",null,[ca(1,"td",null,this._translate("Variable Name:"),0),ca(1,"td",null,ca(1,"span",null,n.name||"-",0),2)],4),ca(1,"tr",null,[ca(1,"td",null,this._translate("Variable Type:"),0),ca(1,"td",null,ca(1,"span",null,this._translate(n.typeRef||"")||"-",0),2)],4),ca(1,"tr",null,[ca(1,"td",null,this._translate("Expression Language:"),0),ca(1,"td",null,ca(1,"span",null,t.expressionLanguage||"-",0),2)],4)],4),2)}}]),n}(Cs),fu=o((function e(t){r(this,e),t.onGetComponent("viewer",500,(function(){return pu}))}));fu.$inject=["components"];var hu={__depends__:[],__init__:["literalExpressionProperties"],literalExpressionProperties:["type",fu]};function du(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 mu=function(e){s(n,e);var t=h(n);function n(e,i){var o;r(this,n),du(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 ca(1,"div","powered-by",ca(1,"div","powered-by__logo",pa(2,Ul),2),2,{onClick:this.onClick,title:"Powered by bpmn.io"},null,(function(t){return e.node=t}))}}]),n}(Cs),vu=function(e){s(n,e);var t=h(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&&ca(1,"div","powered-by-overlay",ca(1,"div","powered-by-overlay-content",[ca(1,"a","logo",pa(2,Ul),2,{href:"https://bpmn.io",target:"_blank",rel:"noopener"}),ca(1,"span",null,[fa("Web-based tooling for BPMN, DMN and CMMN diagrams powered by "),ca(1,"a",null,fa("bpmn.io"),2,{href:"http://bpmn.io",target:"_blank"}),fa(".")],4)],4,{onClick:function(e){return e.stopPropagation()}}),2,{onClick:this.onClick})}}]),n}(Cs),yu=o((function e(t,n){r(this,e),t.onGetComponent("viewer",2e3,(function(){return mu})),t.onGetComponent("viewer",(function(){return vu}))}));yu.$inject=["components","eventBus"];var gu={__init__:["poweredBy"],poweredBy:["type",yu]},bu=function(e){s(n,e);var t=h(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 ca(1,"div","textarea",ca(1,"div","content",this._viewer.getDecision().decisionLogic.text,0),2)}}]),n}(Cs),wu=o((function e(t){r(this,e),t.onGetComponent("viewer",(function(){return bu}))}));wu.$inject=["components"];var _u={__init__:["textarea"],textarea:["type",wu]};function xu(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=h(n);function n(e,i){var o;r(this,n),xu(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 ca(1,"div","view-drd",ca(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}(Cs);Eu.$inject=["translate"];var ku=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}();ku.$inject=["components","viewer","eventBus","injector"];var Cu={__init__:["viewDrd"],viewDrd:["type",ku]},Ou=["modules","additionalModules"];function Su(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=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Mu=function(e){s(n,e);var t=h(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=Su(e,Ou),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",{}),sn(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[su,Ci,cu,hu,gu,_u,Cu]}},{key:"_createContainer",value:function(){return on('
')}}]),n}(iu);var ju=function(e){s(n,e);var t=h(n);function n(){return r(this,n),t.apply(this,arguments)}return o(n,[{key:"_getViewProviders",value:function(){return[{id:"drd",constructor:To,opens:function(e){return Zr(e,"dmn:Definitions")&&((t=e).dmnDI&&t.dmnDI.diagrams&&t.dmnDI.diagrams[0]);var t}},{id:"decisionTable",constructor:Kl,opens:function(e){return Zr(e,"dmn:Decision")&&Zr(e.decisionLogic,"dmn:DecisionTable")}},{id:"literalExpression",constructor:Mu,opens:function(e){return Zr(e,"dmn:Decision")&&Zr(e.decisionLogic,"dmn:LiteralExpression")}}]}}]),n}(dn);return ju}));