You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
6 lines
649 KiB
6 lines
649 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-8c9b05c8"],{"62e4":function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},"668d":function(e,t,n){"use strict";var i=n("7d7d");function r(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)}function o(e,t,n){var r=i.extend(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:r}),r.length&&r.forEach((function(i){e.set(i,t.inverse,n)}))}function a(e,t,n){var i=t.inverse,r=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return r},set:function(t){if(t!==r){var o=r;r=null,o&&e.unset(o,i,n),r=t,e.set(r,i,n)}}})}function s(e,t){if(!(this instanceof s))return new s(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}s.prototype.bind=function(e,t){if("string"===typeof t){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?o(this,t,e):a(this,t,e)},s.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return i.isExtended(n)||o(this,t,e),n},s.prototype.ensureBound=function(e,t){r(e,t)||this.bind(e,t)},s.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},s.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)},e.exports=s},7024:function(e,t,n){"use strict";function i(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function r(e,t){return t={exports:{}},e(t,t.exports),t.exports}n.d(t,"a",(function(){return jA}));var o=r((function(e){var t=e.exports=function(e,n){if(n||(n=16),void 0===e&&(e=128),e<=0)return"0";for(var i=Math.log(Math.pow(2,e))/Math.log(n),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,e/r))/Math.log(n)*r;var o=i-Math.floor(i),a="";for(r=0;r<Math.floor(i);r++){var s=Math.floor(Math.random()*n).toString(n);a=s+a}if(o){var c=Math.pow(n,o);s=Math.floor(Math.random()*c).toString(n);a=s+a}var u=parseInt(a,n);return u!==1/0&&u>=Math.pow(2,e)?t(e,n):a};t.rack=function(e,n,i){var r=function(r){var a=0;do{if(a++>10){if(!i)throw new Error("too many ID collisions, use more bits");e+=i}var s=t(e,n)}while(Object.hasOwnProperty.call(o,s));return o[s]=r,s},o=r.hats={};return r.get=function(e){return r.hats[e]},r.set=function(e,t){return r.hats[e]=t,r},r.bits=e||128,r.base=n||16,r}}));function a(e){if(!(this instanceof a))return new a(e);e=e||[128,36,1],this._seed=e.length?o.rack(e[0],e[1],e[2]):e}a.prototype.next=function(e){return this._seed(e||!0)},a.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},a.prototype.claim=function(e,t){this._seed.set(e,t||!0)},a.prototype.assigned=function(e){return this._seed.get(e)||!1},a.prototype.unclaim=function(e){delete this._seed.hats[e]},a.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var s=a;function c(e){return Array.prototype.concat.apply([],e)}var u=Object.prototype.toString,l=Object.prototype.hasOwnProperty;function p(e){return void 0===e}function d(e){return void 0!==e}function f(e){return null==e}function h(e){return"[object Array]"===u.call(e)}function m(e){return"[object Object]"===u.call(e)}function v(e){return"[object Number]"===u.call(e)}function g(e){var t=u.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t||"[object Proxy]"===t}function y(e){return"[object String]"===u.call(e)}function b(e){if(!h(e))throw new Error("must supply array")}function x(e,t){return l.call(e,t)}function w(e,t){var n;return t=L(t),C(e,(function(e,i){if(t(e,i))return n=e,!1})),n}function _(e,t){t=L(t);var n=h(e)?-1:void 0;return C(e,(function(e,i){if(t(e,i))return n=i,!1})),n}function E(e,t){var n=[];return C(e,(function(e,i){t(e,i)&&n.push(e)})),n}function C(e,t){var n,i;if(!p(e)){var r=h(e)?$:z;for(var o in e)if(x(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}}function S(e,t){return p(e)?[]:(b(e),t=L(t),e.filter((function(e,n){return!t(e,n)})))}function A(e,t,n){return C(e,(function(e,i){n=t(n,e,i)})),n}function T(e,t){return!!A(e,(function(e,n,i){return e&&t(n,i)}),!0)}function k(e,t){return!!w(e,t)}function R(e,t){var n=[];return C(e,(function(e,i){n.push(t(e,i))})),n}function P(e){return e&&Object.keys(e)||[]}function D(e){return P(e).length}function M(e){return R(e,(function(e){return e}))}function B(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=I(t),C(e,(function(e){var i=t(e)||"_",r=n[i];r||(r=n[i]=[]),r.push(e)})),n}function O(e){e=I(e);for(var t={},n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];C(i,(function(n){return B(n,e,t)}));var o=R(t,(function(e,t){return e[0]}));return o}var j=O;function N(e,t){t=I(t);var n=[];return C(e,(function(e,i){for(var r=t(e,i),o={d:r,v:e},a=0;a<n.length;a++){var s=n[a].d;if(r<s)return void n.splice(a,0,o)}n.push(o)})),R(n,(function(e){return e.v}))}function F(e){return function(t){return T(e,(function(e,n){return t[n]===e}))}}function I(e){return g(e)?e:function(t){return t[e]}}function L(e){return g(e)?e:function(t){return t===e}}function z(e){return e}function $(e){return Number(e)}function H(e,t){var n,i,r,o;function a(n){var a=Date.now(),u=n?0:o+t-a;if(u>0)return s(u);e.apply(r,i),c()}function s(e){n=setTimeout(a,e)}function c(){n&&clearTimeout(n),n=o=i=r=void 0}function u(){n&&a(!0),c()}function l(){o=Date.now();for(var e=arguments.length,a=new Array(e),c=0;c<e;c++)a[c]=arguments[c];i=a,r=this,n||s(t)}return l.flush=u,l.cancel=c,l}function G(e,t){return e.bind(t)}function V(){return V=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},V.apply(this,arguments)}function W(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return V.apply(void 0,[e].concat(n))}function U(e,t){var n={},i=Object(e);return C(t,(function(t){t in i&&(n[t]=e[t])})),n}function q(e,t){var n={},i=Object(e);return C(i,(function(e,i){-1===t.indexOf(i)&&(n[i]=e)})),n}var K=Object.prototype.toString,Y=Object.prototype.hasOwnProperty;function X(e){return void 0===e}function Z(e){return"[object Array]"===K.call(e)}function J(e,t){return Y.call(e,t)}function Q(e,t){var n,i;if(!X(e)){var r=Z(e)?te:ee;for(var o in e)if(J(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}}function ee(e){return e}function te(e){return Number(e)}function ne(e){for(var t=e.style,n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return Q(i,(function(e){e&&Q(e,(function(e,n){t[n]=e}))})),e}function ie(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)}var re=[].indexOf,oe=function(e,t){if(re)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1},ae=/\s+/,se=Object.prototype.toString;function ce(e){return new ue(e)}function ue(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function le(e){var t;while(e.childNodes.length)t=e.childNodes[0],e.removeChild(t);return e}ue.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array(),n=oe(t,e);return~n||t.push(e),this.el.className=t.join(" "),this},ue.prototype.remove=function(e){if("[object RegExp]"==se.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=oe(t,e);return~n&&t.splice(n,1),this.el.className=t.join(" "),this},ue.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},ue.prototype.toggle=function(e,t){return this.list?("undefined"!==typeof t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):("undefined"!==typeof t?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},ue.prototype.array=function(){var e=this.el.getAttribute("class")||"",t=e.replace(/^\s+|\s+$/g,""),n=t.split(ae);return""===n[0]&&n.shift(),n},ue.prototype.has=ue.prototype.contains=function(e){return this.list?this.list.contains(e):!!~oe(this.array(),e)};var pe="undefined"!==typeof Element?Element.prototype:{},de=pe.matches||pe.matchesSelector||pe.webkitMatchesSelector||pe.mozMatchesSelector||pe.msMatchesSelector||pe.oMatchesSelector,fe=he;function he(e,t){if(!e||1!==e.nodeType)return!1;if(de)return de.call(e,t);for(var n=e.parentNode.querySelectorAll(t),i=0;i<n.length;i++)if(n[i]==e)return!0;return!1}function me(e,t,n){var i=n?e:e.parentNode;while(i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE){if(fe(i,t))return i;i=i.parentNode}return fe(i,t)?i:null}var ve=window.addEventListener?"addEventListener":"attachEvent",ge=window.removeEventListener?"removeEventListener":"detachEvent",ye="addEventListener"!==ve?"on":"",be=function(e,t,n,i){return e[ve](ye+t,n,i||!1),n},xe=function(e,t,n,i){return e[ge](ye+t,n,i||!1),n},we={bind:be,unbind:xe},_e=["focus","blur"];function Ee(e,t,n,i,r){return-1!==_e.indexOf(n)&&(r=!0),we.bind(e,n,(function(n){var r=n.target||n.srcElement;n.delegateTarget=me(r,t,!0,e),n.delegateTarget&&i.call(e,n)}),r)}function Ce(e,t,n,i){return-1!==_e.indexOf(t)&&(i=!0),we.unbind(e,t,n,i)}var Se,Ae={bind:Ee,unbind:Ce},Te=Pe,ke=!1;"undefined"!==typeof document&&(Se=document.createElement("div"),Se.innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',ke=!Se.getElementsByTagName("link").length,Se=void 0);var Re={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:ke?[1,"X<div>","</div>"]:[0,"",""]};function Pe(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if("body"==i){var r=t.createElement("html");return r.innerHTML=e,r.removeChild(r.lastChild)}var o=Re[i]||Re._default,a=o[0],s=o[1],c=o[2];r=t.createElement("div");r.innerHTML=s+e+c;while(a--)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);var u=t.createDocumentFragment();while(r.firstChild)u.appendChild(r.removeChild(r.firstChild));return u}function De(e,t){return t=t||document,t.querySelector(e)}function Me(e,t){return t=t||document,t.querySelectorAll(e)}function Be(e){e.parentNode&&e.parentNode.removeChild(e)}function Oe(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(n){}return e}function je(e,t){return t.appendChild(Oe(e,t))}function Ne(e,t){return je(t,e),e}Re.td=Re.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Re.option=Re.optgroup=[1,'<select multiple="multiple">',"</select>"],Re.thead=Re.tbody=Re.colgroup=Re.caption=Re.tfoot=[1,"<table>","</table>"],Re.polyline=Re.ellipse=Re.polygon=Re.circle=Re.text=Re.line=Re.path=Re.rect=Re.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Fe=2,Ie={"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":Fe,"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":Fe,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function Le(e,t){return Ie[t]?e.style[t]:e.getAttributeNS(null,t)}function ze(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=Ie[i];r?(r===Fe&&"number"===typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function $e(e,t){var n,i,r=Object.keys(t);for(n=0,i;i=r[n];n++)ze(e,i,t[i])}function He(e,t,n){if("string"===typeof t){if(void 0===n)return Le(e,t);ze(e,t,n)}else $e(e,t);return e}function Ge(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}var Ve=/\s+/,We=Object.prototype.toString;function Ue(e){return"undefined"!==typeof e}function qe(e){return new Ke(e)}function Ke(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Ye(e){var t=e.parentNode;return t&&t.removeChild(e),e}function Xe(e){var t;while(t=e.firstChild)Ye(t);return e}function Ze(e){return e.cloneNode(!0)}Ke.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array(),n=Ge(t,e);return~n||t.push(e),Ue(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" "),this},Ke.prototype.remove=function(e){if("[object RegExp]"===We.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=Ge(t,e);return~n&&t.splice(n,1),this.el.className.baseVal=t.join(" "),this},Ke.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Ke.prototype.toggle=function(e,t){return this.list?(Ue(t)?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(Ue(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},Ke.prototype.array=function(){var e=this.el.getAttribute("class")||"",t=e.replace(/^\s+|\s+$/g,""),n=t.split(Ve);return""===n[0]&&n.shift(),n},Ke.prototype.has=Ke.prototype.contains=function(e){return this.list?this.list.contains(e):!!~Ge(this.array(),e)};var Je={svg:"http://www.w3.org/2000/svg"},Qe='<svg xmlns="'+Je.svg+'"';function et(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(Je.svg)&&(e=Qe+e.substring(4)):(e=Qe+">"+e+"</svg>",t=!0);var n=tt(e);if(!t)return n;var i=document.createDocumentFragment(),r=n.firstChild;while(r.firstChild)i.appendChild(r.firstChild);return i}function tt(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function nt(e,t){var n;return"<"===e.charAt(0)?(n=et(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Je.svg,e),t&&He(n,t),n}var it=null;function rt(){return null===it&&(it=nt("svg")),it}function ot(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function at(e,t,n,i,r,o){var a=rt().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return ot(a,e);case 6:return ot(a,{a:e,b:t,c:n,d:i,e:r,f:o})}}function st(e){return e?rt().createSVGTransformFromMatrix(e):rt().createSVGTransform()}var ct=/([&<>]{1})/g,ut=/([\n\r"]{1})/g,lt={"&":"&","<":"<",">":">",'"':"'"};function pt(e,t){function n(e,t){return lt[t]||t}return e.replace(t,n)}function dt(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(pt(e.textContent,ct));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(r=e.attributes,n=0,i=r.length;n<i;++n)o=r.item(n),t.push(" ",o.name,'="',pt(o.value,ut),'"');if(e.hasChildNodes()){for(t.push(">"),a=e.childNodes,n=0,i=a.length;n<i;++n)dt(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",pt(e.nodeValue,ct),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function ft(e,t){var n=et(t);if(Xe(e),t){mt(n)||(n=n.documentElement);for(var i=gt(n.childNodes),r=0;r<i.length;r++)je(i[r],e)}}function ht(e){var t=e.firstChild,n=[];while(t)dt(t,n),t=t.nextSibling;return n.join("")}function mt(e){return"#document-fragment"===e.nodeName}function vt(e,t){if(void 0!==t){try{ft(e,t)}catch(n){throw new Error("error parsing SVG: "+n.message)}return e}return ht(e)}function gt(e){return Array.prototype.slice.call(e)}function yt(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function bt(e,t){var n,i;for(e.clear(),n=0;i=t[n];n++)e.appendItem(yt(e,i))}function xt(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),bt(n,t)),n.consolidate()}var wt=/^class[ {]/;function _t(e){return wt.test(e.toString())}function Et(e){return"[object Array]"===Object.prototype.toString.call(e)}function Ct(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function St(){var e=Array.prototype.slice.call(arguments);1===e.length&&Et(e[0])&&(e=e[0]);var t=e.pop();return t.$inject=e,t}var At=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Tt=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,kt=/\/\*([^*]*)\*\//m;function Rt(e){if("function"!==typeof e)throw new Error('Cannot annotate "'+e+'". Expected a function!');var t=e.toString().match(_t(e)?At:Tt);if(!t)return[];var n=t[1]||t[2];return n&&n.split(",").map((function(e){var t=e.match(kt);return(t&&t[1]||e).trim()}))||[]}function Pt(e,t){t=t||{get:function(e,t){if(n.push(e),!1===t)return null;throw a('No provider for "'+e+'"!')}};var n=[],i=this._providers=Object.create(t._providers||null),r=this._instances=Object.create(null),o=r.injector=this,a=function(e){var t=n.join(" -> ");return n.length=0,new Error(t?e+" (Resolving: "+t+")":e)};function s(e,o){if(!i[e]&&-1!==e.indexOf(".")){var c=e.split("."),u=s(c.shift());while(c.length)u=u[c.shift()];return u}if(Ct(r,e))return r[e];if(Ct(i,e)){if(-1!==n.indexOf(e))throw n.push(e),a("Cannot resolve circular dependency!");return n.push(e),r[e]=i[e][0](i[e][1]),n.pop(),r[e]}return t.get(e,o)}function c(e,t){if("undefined"===typeof t&&(t={}),"function"!==typeof e){if(!Et(e))throw new Error('Cannot invoke "'+e+'". Expected a function!');e=St(e.slice())}var n=e.$inject||Rt(e),i=n.map((function(e){return Ct(t,e)?t[e]:s(e)}));return{fn:e,dependencies:i}}function u(e){var t=c(e),n=t.fn,i=t.dependencies,r=Function.prototype.bind.apply(n,[null].concat(i));return new r}function l(e,t,n){var i=c(e,n),r=i.fn,o=i.dependencies;return r.apply(t,o)}function p(e){return St((function(t){return e.get(t)}))}function d(e,t){if(t&&t.length){var n,r,a,s,c=Object.create(null),u=Object.create(null),l=[],d=[],f=[];for(var h in i)n=i[h],-1!==t.indexOf(h)&&("private"===n[2]?(r=l.indexOf(n[3]),-1===r?(a=n[3].createChild([],t),s=p(a),l.push(n[3]),d.push(a),f.push(s),c[h]=[s,h,"private",a]):c[h]=[f[r],h,"private",d[r]]):c[h]=[n[2],n[1]],u[h]=!0),"factory"!==n[2]&&"type"!==n[2]||!n[1].$scope||t.forEach((function(e){-1!==n[1].$scope.indexOf(e)&&(c[h]=[n[2],n[1]],u[e]=!0)}));t.forEach((function(e){if(!u[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')})),e.unshift(c)}return new Pt(e,o)}var f={factory:l,type:u,value:function(e){return e}};function h(e,t){var n=e.__init__||[];return function(){n.forEach((function(e){"string"===typeof e?t.get(e):t.invoke(e)}))}}function m(e){var t=e.__exports__;if(t){var n=e.__modules__,r=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=(n||[]).concat(r),s=d(a),c=St((function(e){return s.get(e)}));t.forEach((function(e){i[e]=[c,e,"private",s]}));var u=(e.__init__||[]).slice();return u.unshift((function(){s.init()})),e=Object.assign({},e,{__init__:u}),h(e,s)}return Object.keys(e).forEach((function(t){if("__init__"!==t&&"__depends__"!==t)if("private"!==e[t][2]){var n=e[t][0],r=e[t][1];i[t]=[f[n],Dt(n,r),n]}else i[t]=e[t]})),h(e,o)}function v(e,t){return-1!==e.indexOf(t)?e:(e=(t.__depends__||[]).reduce(v,e),-1!==e.indexOf(t)?e:e.concat(t))}function g(e){var t=e.reduce(v,[]).map(m),n=!1;return function(){n||(n=!0,t.forEach((function(e){return e()})))}}this.get=s,this.invoke=l,this.instantiate=u,this.createChild=d,this.init=g(e)}function Dt(e,t){return"value"!==e&&Et(t)&&(t=St(t.slice())),t}var Mt=1e3;function Bt(e,t){var n=this;t=t||Mt,e.on(["render.shape","render.connection"],t,(function(e,t){var i=e.type,r=t.element,o=t.gfx,a=t.attrs;if(n.canRender(r))return"render.shape"===i?n.drawShape(o,r,a):n.drawConnection(o,r,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 Ot(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")}function jt(e){for(var t,n="",i=0;t=e[i];i++)n+=t.x+","+t.y+" ";return n}function Nt(e,t){var n=nt("polyline");return He(n,{points:jt(e)}),t&&He(n,t),n}function Ft(e,t){return He(e,{points:jt(t)}),e}function It(e){return E(e,(function(t){return!w(e,(function(e){return e!==t&&Lt(t,e)}))}))}function Lt(e,t){if(t){if(e===t)return t;if(e.parent)return Lt(e.parent,t)}}function zt(e,t,n){var i=!n||-1===e.indexOf(t);return i&&e.push(t),i}function $t(e,t,n){n=n||0,h(e)||(e=[e]),C(e,(function(e,i){var r=t(e,i,n);h(r)&&r.length&&$t(r,t,n+1)}))}function Ht(e,t,n){var i=[],r=[];return $t(e,(function(e,o,a){zt(i,e,t);var s=e.children;if((-1===n||a<n)&&s&&zt(r,s,t))return s})),i}function Gt(e,t){return Ht(e,!t,-1)}function Vt(e,t,n){p(t)&&(t=!0),m(t)&&(n=t,t=!0),n=n||{};var i=Yt(n.allShapes),r=Yt(n.allConnections),o=Yt(n.enclosedElements),a=Yt(n.enclosedConnections),s=Yt(n.topLevel,t&&B(e,(function(e){return e.id})));function c(e){s[e.source.id]&&s[e.target.id]&&(s[e.id]=[e]),i[e.source.id]&&i[e.target.id]&&(a[e.id]=o[e.id]=e),r[e.id]=e}function u(e){if(o[e.id]=e,!e.waypoints)return i[e.id]=e,C(e.incoming,c),C(e.outgoing,c),e.children;a[e.id]=r[e.id]=e}return $t(e,u),{allShapes:i,allConnections:r,topLevel:s,enclosedConnections:a,enclosedElements:o}}function Wt(e,t){var n,i,r,o;return t=!!t,h(e)||(e=[e]),C(e,(function(e){var a=e;e.waypoints&&!t&&(a=Wt(e.waypoints,!0));var s=a.x,c=a.y,u=a.height||0,l=a.width||0;(s<n||void 0===n)&&(n=s),(c<i||void 0===i)&&(i=c),(s+l>r||void 0===r)&&(r=s+l),(c+u>o||void 0===o)&&(o=c+u)})),{x:n,y:i,height:o-i,width:r-n}}function Ut(e,t){var n={};return C(e,(function(e){var i=e;i.waypoints&&(i=Wt(i)),!v(t.y)&&i.x>t.x&&(n[e.id]=e),!v(t.x)&&i.y>t.y&&(n[e.id]=e),i.x>t.x&&i.y>t.y&&(v(t.width)&&v(t.height)&&i.width+i.x<t.width+t.x&&i.height+i.y<t.height+t.y?n[e.id]=e:v(t.width)&&v(t.height)||(n[e.id]=e))})),n}function qt(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function Kt(e){return!(!e||!e.isFrame)}function Yt(e,t){return W({},e||{},t||{})}Bt.prototype.canRender=function(){},Bt.prototype.drawShape=function(){},Bt.prototype.drawConnection=function(){},Bt.prototype.getShapePath=function(){},Bt.prototype.getConnectionPath=function(){};var Xt=1;function Zt(e,t){Bt.call(this,e,Xt),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})}function Jt(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(e,t,n){var i=this.style(t,n);return W(i,{class:e})},this.style=function(t,n){h(t)||n||(n=t,t=[]);var i=A(t,(function(t,n){return W(t,e[n]||{})}),{});return n?W(i,n):i},this.computeStyle=function(e,n,i){return h(n)||(i=n,n=[]),t.style(n||[],W({},i,e||{}))}}i(Zt,Bt),Zt.prototype.canRender=function(){return!0},Zt.prototype.drawShape=function(e,t,n){var i=nt("rect");return He(i,{x:0,y:0,width:t.width||0,height:t.height||0}),Kt(t)?He(i,W({},this.FRAME_STYLE,n||{})):He(i,W({},this.SHAPE_STYLE,n||{})),Ne(e,i),i},Zt.prototype.drawConnection=function(e,t,n){var i=Nt(t.waypoints,W({},this.CONNECTION_STYLE,n||{}));return Ne(e,i),i},Zt.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width,r=e.height,o=[["M",t,n],["l",i,0],["l",0,r],["l",-i,0],["z"]];return Ot(o)},Zt.prototype.getConnectionPath=function(e){var t,n,i=e.waypoints,r=[];for(t=0;n=i[t];t++)n=n.original||n,r.push([0===t?"M":"L",n.x,n.y]);return Ot(r)},Zt.$inject=["eventBus","styles"];var Qt={__init__:["defaultRenderer"],defaultRenderer:["type",Zt],styles:["type",Jt]};function en(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return-1!==n&&e.splice(n,1),n}function tn(e,t,n){if(e&&t){"number"!==typeof n&&(n=-1);var i=e.indexOf(t);if(-1!==i){if(i===n)return;if(-1===n)return;e.splice(i,1)}-1!==n?e.splice(n,0,t):e.push(t)}}function nn(e,t){return e&&t?e.indexOf(t):-1}function rn(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function on(e,t,n,i){if("undefined"===typeof i&&(i=5),!e||!t||!n)return!1;var r=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=rn(e,t);return Math.abs(r/o)<=i}var an=2;function sn(e,t){var n;return n=h(e)?e:[e,t],cn(n)?"h":!!un(n)&&"v"}function cn(e,t){var n;n=h(e)?e:[e,t];var i=n.slice().shift();return T(n,(function(e){return Math.abs(i.y-e.y)<=an}))}function un(e,t){var n;n=h(e)?e:[e,t];var i=n.slice().shift();return T(n,(function(e){return Math.abs(i.x-e.x)<=an}))}function ln(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x<t.x+t.width+n&&e.y<t.y+t.height+n}function pn(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}var dn=n("e5ab"),fn=n.n(dn);function hn(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function mn(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function vn(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function gn(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function yn(e){return mn({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function bn(e){var t=e.waypoints,n=t.reduce((function(e,n,i){var r=t[i-1];if(r){var o=e[e.length-1],a=o&&o.endLength||0,s=Sn(r,n);e.push({start:r,end:n,startLength:a,endLength:a+s,length:s})}return e}),[]),i=n.reduce((function(e,t){return e+t.length}),0),r=i/2,o=0,a=n[o];while(a.endLength<r)a=n[++o];var s=(r-a.startLength)/a.length,c={x:a.start.x+(a.end.x-a.start.x)*s,y:a.start.y+(a.end.y-a.start.y)*s};return c}function xn(e){return An(e)?bn(e):yn(e)}function wn(e,t,n){n=n||0,m(n)||(n={x:n,y:n});var i=vn(e),r=vn(t),o=i.bottom+n.y<=r.top,a=i.left-n.x>=r.right,s=i.top-n.y>=r.bottom,c=i.right+n.x<=r.left,u=o?"top":s?"bottom":null,l=c?"left":a?"right":null;return l&&u?u+"-"+l:l||u||"intersect"}function _n(e,t,n){var i=En(e,t);return 1===i.length||2===i.length&&rn(i[0],i[1])<1?mn(i[0]):i.length>1?(i=N(i,(function(e){var t=Math.floor(100*e.t2)||1;return t=100-t,t=(t<10?"0":"")+t,e.segment2+"#"+t})),mn(i[n?0:i.length-1])):null}function En(e,t){return fn()(e,t)}function Cn(e){e=e.slice();var t,n,i,r=0;while(e[r])t=e[r],n=e[r-1],i=e[r+1],0===rn(t,i)||on(n,i,t)?e.splice(r,1):r++;return e}function Sn(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function An(e){return!!e.waypoints}function Tn(e,t){return Math.round(e*t)/t}function kn(e){return v(e)?e+"px":e}function Rn(e){while(e.parent)e=e.parent;return e}function Pn(e){e=W({},{width:"100%",height:"100%"},e);var t=e.container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container"),ne(n,{position:"relative",overflow:"hidden",width:kn(e.width),height:kn(e.height)}),t.appendChild(n),n}function Dn(e,t,n){var i=nt("g");qe(i).add(t);var r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}var Mn="base",Bn=0,On=1,jn={shape:["x","y","width","height"],connection:["waypoints"]};function Nn(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._init(e||{})}function Fn(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}Nn.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],Nn.prototype._init=function(e){var t=this._eventBus,n=this._container=Pn(e),i=this._svg=nt("svg");He(i,{width:"100%",height:"100%"}),Ne(n,i);var r=this._viewport=Dn(i,"viewport");!1!==e.deferUpdate&&(this._viewboxChanged=H(G(this._viewboxChanged,this),300)),t.on("diagram.init",(function(){t.fire("canvas.init",{svg:i,viewport:r})}),this),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],(function(){delete this._cachedViewbox}),this),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},Nn.prototype._destroy=function(e){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});var t=this._container.parentNode;t&&t.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},Nn.prototype._clear=function(){var e=this,t=this._elementRegistry.getAll();t.forEach((function(t){var n=qt(t);"root"===n?e.removeRootElement(t):e._removeElement(t,n)})),this._planes=[],this._rootElement=null,delete this._cachedViewbox},Nn.prototype.getDefaultLayer=function(){return this.getLayer(Mn,Bn)},Nn.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)),"undefined"!==typeof t&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},Nn.prototype._getChildIndex=function(e){return A(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},Nn.prototype._createLayer=function(e,t){"undefined"===typeof t&&(t=On);var n=this._getChildIndex(t);return{group:Dn(this._viewport,"layer-"+e,n),index:t,visible:!0}},Nn.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,i=t.group,r=t.index;if(t.visible)return i;var o=this._getChildIndex(r);return n.insertBefore(i,n.childNodes[o]||null),t.visible=!0,i},Nn.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?(Ye(n),t.visible=!1,n):n},Nn.prototype._removeLayer=function(e){var t=this._layers[e];t&&(delete this._layers[e],Ye(t.group))},Nn.prototype.getActiveLayer=function(){var e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},Nn.prototype.findRoot=function(e){if("string"===typeof e&&(e=this._elementRegistry.get(e)),e){var t=this._findPlaneForRoot(Rn(e))||{};return t.rootElement}},Nn.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},Nn.prototype._findPlaneForRoot=function(e){return w(this._planes,(function(t){return t.rootElement===e}))},Nn.prototype.getContainer=function(){return this._container},Nn.prototype._updateMarker=function(e,t,n){var i;e.id||(e=this._elementRegistry.get(e)),i=this._elementRegistry._elements[e.id],i&&(C([i.gfx,i.secondaryGfx],(function(e){e&&(n?qe(e).add(t):qe(e).remove(t))})),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},Nn.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},Nn.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},Nn.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));var n=this.getGraphics(e);return qe(n).has(t)},Nn.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},Nn.prototype.getRootElement=function(){var e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},Nn.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 i=this.getLayer(n,Bn);return this.hideLayer(n),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},Nn.prototype.removeRootElement=function(e){"string"===typeof e&&(e=this._elementRegistry.get(e));var t=this._findPlaneForRoot(e);if(t)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},Nn.prototype.setRootElement=function(e,t){if(d(t))throw new Error("override not supported");if(e!==this._rootElement){var n;if(!e)throw new Error("rootElement required");return n=this._findPlaneForRoot(e),n||(e=this.addRootElement(e)),this._setRoot(e),e}},Nn.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)},Nn.prototype._addRoot=function(e,t){var n=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:e}),n.add(e,t),i.fire("root.added",{element:e,gfx:t})},Nn.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})},Nn.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=jn[e],i=T(n,(function(e){return"undefined"!==typeof t[e]}));if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+e)},Nn.prototype._setParent=function(e,t,n){tn(t.children,e,n),e.parent=t},Nn.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();var r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);var a=o.create(e,t,i);return this._elementRegistry.add(t,a),o.update(e,t,a),r.fire(e+".added",{element:t,gfx:a}),t},Nn.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},Nn.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},Nn.prototype._removeElement=function(e,t){var n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e),e)return r.fire(t+".remove",{element:e}),i.remove(e),en(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},Nn.prototype.removeShape=function(e){return this._removeElement(e,"shape")},Nn.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},Nn.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},Nn.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Nn.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},Nn.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;var t,n,i,r,o,a,s,c=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);xt(c,t)})),e):(i=this._rootElement?this.getActiveLayer():null,t=i&&i.getBBox()||{},r=xt(c),n=r?r.matrix:at(),o=Tn(n.a,1e3),a=Tn(-n.e||0,1e3),s=Tn(-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},e)},Nn.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox((function(){e=W({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Fn(t,n)})),{x:n.e,y:n.f}},Nn.prototype.scrollToElement=function(e,t){var n=100;"string"===typeof e&&(e=this._elementRegistry.get(e));var i=this.findRoot(e);i!==this.getRootElement()&&this.setRootElement(i),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 r,o,a=Wt(e),s=vn(a),c=this.viewbox(),u=this.zoom();c.y+=t.top/u,c.x+=t.left/u,c.width-=(t.right+t.left)/u,c.height-=(t.bottom+t.top)/u;var l=vn(c),p=a.width<c.width&&a.height<c.height;if(p){var d=Math.max(0,s.right-l.right),f=Math.min(0,s.left-l.left),h=Math.max(0,s.bottom-l.bottom),m=Math.min(0,s.top-l.top);r=d||f,o=h||m}else r=a.x-c.x,o=a.y-c.y;this.scroll({dx:-r*u,dy:-o*u})},Nn.prototype.zoom=function(e,t){return e?"fit-viewport"===e?this._fitViewport(t):(this._changeViewbox((function(){"object"!==typeof t&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)})),Tn(i.a,1e3)):this.viewbox(e).scale;var n,i},Nn.prototype._fitViewport=function(e){var t,n,i=this.viewbox(),r=i.outer,o=i.inner;return o.x>=0&&o.y>=0&&o.x+o.width<=r.width&&o.y+o.height<=r.height&&!e?n={x:0,y:0,width:Math.max(o.width+o.x,r.width),height:Math.max(o.height+o.y,r.height)}:(t=Math.min(1,r.width/o.width,r.height/o.height),n={x:o.x+(e?o.width/2-r.width/t/2:0),y:o.y+(e?o.height/2-r.height/t/2:0),width:r.width/t,height:r.height/t}),this.viewbox(n),this.viewbox(!1).scale},Nn.prototype._setZoom=function(e,t){var n,i,r,o,a,s=this._svg,c=this._viewport,u=s.createSVGMatrix(),l=s.createSVGPoint();r=c.getCTM();var p=r.a;return t?(n=W(l,t),i=n.matrixTransform(r.inverse()),o=u.translate(i.x,i.y).scale(1/p*e).translate(-i.x,-i.y),a=r.multiply(o)):a=u.scale(e),Fn(this._viewport,a),a},Nn.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},Nn.prototype.getAbsoluteBBox=function(e){var t,n=this.viewbox();if(e.waypoints){var i=this.getGraphics(e);t=i.getBBox()}else t=e;var r=t.x*n.scale-n.x*n.scale,o=t.y*n.scale-n.y*n.scale,a=t.width*n.scale,s=t.height*n.scale;return{x:r,y:o,width:a,height:s}},Nn.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var In="data-element-id";function Ln(e){this._elements={},this._eventBus=e}Ln.$inject=["eventBus"],Ln.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),He(t,In,i),n&&He(n,In,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},Ln.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(He(i.gfx,In,""),i.secondaryGfx&&He(i.secondaryGfx,In,""),delete t[n])},Ln.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),i=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,i)},Ln.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&He(t,In,i),t},Ln.prototype.get=function(e){var t;t="string"===typeof e?e:e&&He(e,In);var n=this._elements[t];return n&&n.element},Ln.prototype.filter=function(e){var t=[];return this.forEach((function(n,i){e(n,i)&&t.push(n)})),t},Ln.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i<n.length;i++){var r=n[i],o=t[r],a=o.element,s=o.gfx;if(e(a,s))return a}},Ln.prototype.getAll=function(){return this.filter((function(e){return e}))},Ln.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach((function(n){var i=t[n],r=i.element,o=i.gfx;return e(r,o)}))},Ln.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},Ln.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};var zn=n("8fcf"),$n=n.n(zn),Hn=new $n.a({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Gn=new $n.a({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Vn=new $n.a({name:"attachers",collection:!0},{name:"host"}),Wn=new $n.a({name:"outgoing",collection:!0},{name:"source"}),Un=new $n.a({name:"incoming",collection:!0},{name:"target"});function qn(){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)}}),Hn.bind(this,"parent"),Gn.bind(this,"labels"),Wn.bind(this,"outgoing"),Un.bind(this,"incoming")}function Kn(){qn.call(this),Hn.bind(this,"children"),Vn.bind(this,"host"),Vn.bind(this,"attachers")}function Yn(){Kn.call(this)}function Xn(){Kn.call(this),Gn.bind(this,"labelTarget")}function Zn(){qn.call(this),Wn.bind(this,"source"),Un.bind(this,"target")}i(Kn,qn),i(Yn,Kn),i(Xn,Kn),i(Zn,qn);var Jn={connection:Zn,shape:Kn,label:Xn,root:Yn};function Qn(e,t){var n=Jn[e];if(!n)throw new Error("unknown type: <"+e+">");return W(new n,t)}function ei(){this._uid=12}ei.prototype.createRoot=function(e){return this.create("root",e)},ei.prototype.createLabel=function(e){return this.create("label",e)},ei.prototype.createShape=function(e){return this.create("shape",e)},ei.prototype.createConnection=function(e){return this.create("connection",e)},ei.prototype.create=function(e,t){return t=W({},t||{}),t.id||(t.id=e+"_"+this._uid++),Qn(e,t)};var ti="__fn",ni=1e3,ii=Array.prototype.slice;function ri(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function oi(){}function ai(e,t){return e.apply(null,t)}function si(e){return e.childNodes[0]}function ci(e){return e.parentNode.childNodes[1]}function ui(e,t,n,i,r){var o=st();o.setTranslate(t,n);var a=st();a.setRotate(i||0,0,0);var s=st();s.setScale(r||1,r||1),xt(e,[o,a,s])}function li(e,t,n){var i=st();i.setTranslate(t,n),xt(e,i)}function pi(e,t){var n=st();n.setRotate(t,0,0),xt(e,n)}function di(e,t){this._eventBus=e,this._elementRegistry=t}function fi(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}ri.prototype.on=function(e,t,n,i){if(e=h(e)?e:[e],g(t)&&(i=n,n=t,t=ni),!v(t))throw new Error("priority must be a number");var r=n;i&&(r=G(n,i),r[ti]=n[ti]||n);var o=this;e.forEach((function(e){o._addListener(e,{priority:t,callback:r,next:null})}))},ri.prototype.once=function(e,t,n,i){var r=this;if(g(t)&&(i=n,n=t,t=ni),!v(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var t=n.apply(i,arguments);return r.off(e,o),t}o[ti]=n,this.on(e,t,o)},ri.prototype.off=function(e,t){e=h(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},ri.prototype.createEvent=function(e){var t=new oi;return t.init(e),t},ri.prototype.fire=function(e,t){var n,i,r,o;if(o=ii.call(arguments),"object"===typeof e&&(t=e,e=t.type),!e)throw new Error("no event type specified");if(i=this._listeners[e],i){n=t instanceof oi?t:this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==a&&(n.type=a)}return void 0===r&&n.defaultPrevented&&(r=!1),r}},ri.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},ri.prototype._destroy=function(){this._listeners={}},ri.prototype._invokeListeners=function(e,t,n){var i;while(n){if(e.cancelBubble)break;i=this._invokeListener(e,t,n),n=n.next}return i},ri.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=ai(n.callback,t),void 0!==i&&(e.returnValue=i,e.stopPropagation()),!1===i&&e.preventDefault()}catch(r){if(!this.handleError(r))throw console.error("unhandled error in event listener",r),r}return i},ri.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){while(i){if(i.priority<t.priority)return t.next=i,void(n?n.next=t:this._setListeners(e,t));n=i,i=i.next}n.next=t}else this._setListeners(e,t)},ri.prototype._getListeners=function(e){return this._listeners[e]},ri.prototype._setListeners=function(e,t){this._listeners[e]=t},ri.prototype._removeListener=function(e,t){var n,i,r,o=this._getListeners(e);if(t)while(o)n=o.next,r=o.callback,r!==t&&r[ti]!==t||(i?i.next=n:this._setListeners(e,n)),i=o,o=n;else this._setListeners(e,null)},oi.prototype.stopPropagation=function(){this.cancelBubble=!0},oi.prototype.preventDefault=function(){this.defaultPrevented=!0},oi.prototype.init=function(e){W(this,e||{})},di.$inject=["eventBus","elementRegistry"],di.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=ci(n),t||(t=nt("g"),qe(t).add("djs-children"),Ne(n.parentNode,t))):t=n,t},di.prototype._clear=function(e){var t=si(e);return le(t),t},di.prototype._createContainer=function(e,t,n,i){var r=nt("g");qe(r).add("djs-group"),"undefined"!==typeof n?fi(r,t,t.childNodes[n]):Ne(t,r);var o=nt("g");qe(o).add("djs-element"),qe(o).add("djs-"+e),i&&qe(o).add("djs-frame"),Ne(r,o);var a=nt("g");return qe(a).add("djs-visual"),Ne(o,a),o},di.prototype.create=function(e,t,n){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,n,Kt(t))},di.prototype.updateContainments=function(e){var t,n=this,i=this._elementRegistry;t=A(e,(function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e}),{}),C(t,(function(e){var t=e.children;if(t){var r=n._getChildrenContainer(e);C(t.slice().reverse(),(function(e){var t=i.getGraphics(e);fi(t.parentNode,r)}))}}))},di.prototype.drawShape=function(e,t){var n=this._eventBus;return n.fire("render.shape",{gfx:e,element:t})},di.prototype.getShapePath=function(e){var t=this._eventBus;return t.fire("render.getShapePath",e)},di.prototype.drawConnection=function(e,t){var n=this._eventBus;return n.fire("render.connection",{gfx:e,element:t})},di.prototype.getConnectionPath=function(e){var t=this._eventBus;return t.fire("render.getConnectionPath",e)},di.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if("shape"===e)this.drawShape(i,t),li(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(i,t)}t.hidden?He(n,"display","none"):He(n,"display","block")}},di.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);Ye(t.parentNode)};var hi={__depends__:[Qt],__init__:["canvas"],canvas:["type",Nn],elementRegistry:["type",Ln],elementFactory:["type",ei],eventBus:["type",ri],graphicsFactory:["type",di]};function mi(e){var t=new Pt(e);return t.init(),t}function vi(e){e=e||{};var t={config:["value",e]},n=[t,hi].concat(e.modules||[]);return mi(n)}function gi(e,t){this.injector=t=t||vi(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}function yi(){}function bi(e,t){this.model=e,this.properties=t}gi.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},gi.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},yi.prototype.get=function(e){return this.$model.properties.get(this,e)},yi.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},bi.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(yi.prototype);C(e.properties,(function(e){e.isMany||void 0===e.default||(i[e.name]=e.default)})),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function o(e){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),C(e,G((function(e,t){this.set(t,e)}),this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var xi={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},wi={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function _i(e,t){var n=wi[e];return n?n(t):t}function Ei(e){return!!xi[e]}function Ci(e){return!!wi[e]}function Si(e,t){var n,i,r=e.split(/:/);if(1===r.length)n=e,i=t;else{if(2!==r.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=r[1],i=r[0]}return e=(i?i+":":"")+n,{name:e,prefix:i,localName:n}}function Ai(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function Ti(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,C(e,G(this.registerPackage,this))}function ki(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function Ri(e){this.model=e}function Pi(e){return"undefined"===typeof e}function Di(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Mi(e){this.properties=new Ri(this),this.factory=new bi(this,this.properties),this.registry=new Ti(e,this.properties),this.typeCache={}}Ai.prototype.build=function(){return U(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Ai.prototype.addProperty=function(e,t,n){"boolean"===typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var i=this.properties;void 0!==t?i.splice(t,0,e):i.push(e)},Ai.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=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=r.indexOf(e);if(-1===s)throw new Error("property <"+i.name+"> not found in property list");r.splice(s,1),this.addProperty(t,n?void 0:s,a),o[i.name]=o[i.localName]=t},Ai.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=Si(r[0],i),a=Si(r[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},Ai.prototype.addNamedProperty=function(e,t){var n=e.ns,i=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),i[n.name]=i[n.localName]=e},Ai.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Ai.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},Ai.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},Ai.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},Ai.prototype.hasProperty=function(e){return this.propertiesByName[e]},Ai.prototype.addTrait=function(e,t){var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(C(e.properties,G((function(n){n=W({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var i=n.replaces,r=n.redefines;i||r?this.redefineProperty(n,i||r,i):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))}),this)),i.push(e),n[r]=e)},Ti.prototype.getPackage=function(e){return this.packageMap[e]},Ti.prototype.getPackages=function(){return this.packages},Ti.prototype.registerPackage=function(e){e=W({},e);var t=this.packageMap;ki(t,e,"prefix"),ki(t,e,"uri"),C(e.types,G((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Ti.prototype.registerType=function(e,t){e=W({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:W(e.meta||{})});var n=Si(e.name,t.prefix),i=n.name,r={};C(e.properties,G((function(e){var t=Si(e.name,n.prefix),i=t.name;Ei(e.type)||(e.type=Si(e.type,t.prefix).name),W(e,{ns:t,name:i}),r[i]=e}),this)),W(e,{ns:n,name:i,propertiesByName:r}),C(e.extends,G((function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(i)}),this)),this.definePackage(e,t),this.typeMap[i]=e},Ti.prototype.mapTypes=function(e,t,n){var i=Ei(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(e){return a(e,!0)}function a(n,i){var o=Si(n,Ei(n)?"":e.prefix);r.mapTypes(o,t,i)}if(!i)throw new Error("unknown type <"+e.name+">");C(i.superClass,n?o:a),t(i,!n),C(i.traits,o)},Ti.prototype.getEffectiveDescriptor=function(e){var t=Si(e),n=new Ai(t);this.mapTypes(t,(function(e,t){n.addTrait(e,t)}));var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},Ti.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},Ri.prototype.set=function(e,t,n){if(!y(t)||!t.length)throw new TypeError("property name must be a non-empty string");var i=this.model.getPropertyDescriptor(e,t),r=i&&i.name;Pi(n)?i?delete e[r]:delete e.$attrs[t]:i?r in e?e[r]=n:Di(e,i,n):e.$attrs[t]=n},Ri.prototype.get=function(e,t){var n=this.model.getPropertyDescriptor(e,t);if(!n)return e.$attrs[t];var i=n.name;return!e[i]&&n.isMany&&Di(e,n,[]),e[i]},Ri.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;n=W({},n,{get:function(){return i}}),delete n.value}Object.defineProperty(e,t,n)},Ri.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},Ri.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},Mi.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Mi.prototype.getType=function(e){var t=this.typeCache,n=y(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},Mi.prototype.createAny=function(e,t,n){var i=Si(e),r={$type:e,$instanceOf:function(e){return e===this.$type}},o={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),C(n,(function(e,t){m(e)&&void 0!==e.value?r[e.name]=e.value:r[t]=e})),r},Mi.prototype.getPackage=function(e){return this.registry.getPackage(e)},Mi.prototype.getPackages=function(){return this.registry.getPackages()},Mi.prototype.getElementDescriptor=function(e){return e.$descriptor},Mi.prototype.hasType=function(e,t){void 0===t&&(t=e,e=this);var n=e.$model.getElementDescriptor(e);return t in n.allTypesByName},Mi.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Mi.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var Bi=String.fromCharCode,Oi=Object.prototype.hasOwnProperty,ji=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,Ni={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function Fi(e,t,n,i){return i?Oi.call(Ni,i)?Ni[i]:"&"+i+";":Bi(t||parseInt(n,16))}function Ii(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(ji,Fi):e}Object.keys(Ni).forEach((function(e){Ni[e.toUpperCase()]=Ni[e]}));var Li="http://www.w3.org/2001/XMLSchema-instance",zi="xsi",$i="xsi:type",Hi="non-whitespace outside of root node";function Gi(e){return new Error(e)}function Vi(e){return"missing namespace for prefix <"+e+">"}function Wi(e){return{get:e,enumerable:!0}}function Ui(e){var t,n={};for(t in e)n[t]=e[t];return n}function qi(e){return e+"$uri"}function Ki(e){var t,n,i={};for(t in e)n=e[t],i[n]=n,i[qi(n)]=t;return i}function Yi(){return{line:0,column:0}}function Xi(e){throw e}function Zi(e){if(!this)return new Zi(e);var t,n,i,r,o,a,s,c,u,l=e&&e["proxy"],p=Xi,d=Yi,f=!1,h=!1,m=null,v=!1;function g(e){e instanceof Error||(e=Gi(e)),m=e,p(e,d)}function y(e){o&&(e instanceof Error||(e=Gi(e)),o(e,d))}function b(e){var o,p,m,b,x,w,_,E,C,S,A,T=h?[]:null,k=h?Ki(u):null,R=[],P=0,D=!1,M=!1,B=0,O=0,j="",N=0;function F(){if(null!==A)return A;var e,t,n,i,r,o,a,s,c,l,p,d=h&&k["xmlns"],m=h&&f?[]:null,v=N,g=j,b=g.length,x={},w={};e:for(;v<b;v++)if(c=!1,l=g.charCodeAt(v),!(32===l||l<14&&l>8)){for((l<65||l>122||l>90&&l<97)&&95!==l&&58!==l&&(y("illegal first char attribute name"),c=!0),p=v+1;p<b;p++)if(l=g.charCodeAt(p),!(l>96&&l<123||l>64&&l<91||l>47&&l<59||46===l||45===l||95===l)){if(32===l||l<14&&l>8){y("missing attribute value"),v=p;continue e}if(61===l)break;y("illegal attribute name char"),c=!0}if(s=g.substring(v,p),"xmlns:xmlns"===s&&(y("illegal declaration of xmlns"),c=!0),l=g.charCodeAt(p+1),34===l)p=g.indexOf('"',v=p+2),-1===p&&(p=g.indexOf("'",v),-1!==p&&(y("attribute value quote missmatch"),c=!0));else if(39===l)p=g.indexOf("'",v=p+2),-1===p&&(p=g.indexOf('"',v),-1!==p&&(y("attribute value quote missmatch"),c=!0));else for(y("missing attribute value quotes"),c=!0,p+=1;p<b;p++)if(l=g.charCodeAt(p+1),32===l||l<14&&l>8)break;for(-1===p&&(y("missing closing quotes"),p=b,c=!0),c||(o=g.substring(v,p)),v=p;p+1<b;p++){if(l=g.charCodeAt(p+1),32===l||l<14&&l>8)break;v===p&&(y("illegal character after attribute end"),c=!0)}if(v=p+1,!c)if(s in w)y("attribute <"+s+"> already defined");else if(w[s]=!0,h)if(f){if(r="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null,null!==r){if(e=Ii(o),t=qi(r),a=u[e],!a){if("xmlns"===r||t in k&&k[t]!==e)do{a="ns"+P++}while("undefined"!==typeof k[a]);else a=r;u[e]=a}k[r]!==a&&(i||(k=Ui(k),i=!0),k[r]=a,"xmlns"===r&&(k[qi(a)]=e,d=a),k[t]=e),x[s]=o;continue}m.push(s,o)}else l=s.indexOf(":"),-1!==l?(n=k[s.substring(0,l)])?(s=d===n?s.substr(l+1):n+s.substr(l),s===$i&&(l=o.indexOf(":"),-1!==l?(n=o.substring(0,l),n=k[n]||n,o=n+o.substring(l)):o=d+":"+o),x[s]=o):y(Vi(s.substring(0,l))):x[s]=o;else x[s]=o}if(f)for(v=0,b=m.length;v<b;v++){if(s=m[v++],o=m[v],l=s.indexOf(":"),-1!==l){if(!(n=k[s.substring(0,l)])){y(Vi(s.substring(0,l)));continue}s=d===n?s.substr(l+1):n+s.substr(l),s===$i&&(l=o.indexOf(":"),-1!==l?(n=o.substring(0,l),n=k[n]||n,o=n+o.substring(l)):o=d+":"+o)}x[s]=o}return A=x}function I(){var t,n,i=/(\r\n|\r|\n)/g,r=0,o=0,a=0,s=O;while(B>=a){if(t=i.exec(e),!t)break;if(s=t[0].length+t.index,s>B)break;r+=1,a=s}return-1==B?(o=s,n=e.substring(O)):0===O?n=e.substring(O,B):(o=B-a,n=-1==O?e.substring(B):e.substring(B,O+1)),{data:n,line:r,column:o}}d=I,l&&(S=Object.create({},{name:Wi((function(){return E})),originalName:Wi((function(){return C})),attrs:Wi(F),ns:Wi((function(){return k}))}));while(-1!==O){if(B=60===e.charCodeAt(O)?O:e.indexOf("<",O),-1===B)return R.length?g("unexpected end of file"):0===O?g("missing start tag"):void(O<e.length&&e.substring(O).trim()&&y(Hi));if(O!==B)if(R.length){if(t&&(t(e.substring(O,B),Ii,d),v))return}else if(e.substring(O,B).trim()&&(y(Hi),v))return;if(x=e.charCodeAt(B+1),33===x){if(b=e.charCodeAt(B+2),91===b&&"CDATA["===e.substr(B+3,6)){if(O=e.indexOf("]]>",B),-1===O)return g("unclosed cdata");if(r&&(r(e.substring(B+9,O),d),v))return;O+=3;continue}if(45===b&&45===e.charCodeAt(B+3)){if(O=e.indexOf("--\x3e",B),-1===O)return g("unclosed comment");if(a&&(a(e.substring(B+4,O),Ii,d),v))return;O+=3;continue}}if(63!==x){for(p=B+1;;p++){if(w=e.charCodeAt(p),isNaN(w))return O=-1,g("unclosed tag");if(34===w)b=e.indexOf('"',p+1),p=-1!==b?b:p;else if(39===w)b=e.indexOf("'",p+1),p=-1!==b?b:p;else if(62===w){O=p;break}}if(33!==x){if(A={},47===x){if(D=!1,M=!0,!R.length)return g("missing open tag");if(p=E=R.pop(),b=B+2+p.length,e.substring(B+2,b)!==p)return g("closing tag mismatch");for(;b<O;b++)if(x=e.charCodeAt(b),!(32===x||x>8&&x<14))return g("close tag")}else{if(47===e.charCodeAt(O-1)?(p=E=e.substring(B+1,O-1),D=!0,M=!0):(p=E=e.substring(B+1,O),D=!0,M=!1),!(x>96&&x<123||x>64&&x<91||95===x||58===x))return g("illegal first char nodeName");for(b=1,m=p.length;b<m;b++)if(x=p.charCodeAt(b),!(x>96&&x<123||x>64&&x<91||x>47&&x<59||45===x||95===x||46==x)){if(32===x||x<14&&x>8){E=p.substring(0,b),A=null;break}return g("invalid nodeName")}M||R.push(E)}if(h){if(o=k,D&&(M||T.push(o),null===A&&(f=-1!==p.indexOf("xmlns",b))&&(N=b,j=p,F(),f=!1)),C=E,x=E.indexOf(":"),-1!==x){if(_=k[E.substring(0,x)],!_)return g("missing namespace on <"+C+">");E=E.substr(x+1)}else _=k["xmlns"];_&&(E=_+":"+E)}if(D&&(N=b,j=p,n&&(l?n(S,Ii,M,d):n(E,F,Ii,M,d),v)))return;if(M){if(i&&(i(l?S:E,Ii,D,d),v))return;h&&(k=D?o:T.pop())}O+=1}else{if(c&&(c(e.substring(B,O+1),Ii,d),v))return;O+=1}}else{if(O=e.indexOf("?>",B),-1===O)return g("unclosed question");if(s&&(s(e.substring(B,O+2),d),v))return;O+=2}}}this["on"]=function(e,u){if("function"!==typeof u)throw Gi("required args <name, cb>");switch(e){case"openTag":n=u;break;case"text":t=u;break;case"closeTag":i=u;break;case"error":p=u;break;case"warn":o=u;break;case"cdata":r=u;break;case"attention":c=u;break;case"question":s=u;break;case"comment":a=u;break;default:throw Gi("unsupported event: "+e)}return this},this["ns"]=function(e){if("undefined"===typeof e&&(e={}),"object"!==typeof e)throw Gi("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return n[Li]=zi,h=!0,u=n,this},this["parse"]=function(e){if("string"!==typeof e)throw Gi("required args <xml=string>");return m=null,b(e),d=Yi,v=!1,m},this["stop"]=function(){v=!0}}function Ji(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var Qi={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},er="xsi:type";function tr(e){return e.xml&&e.xml.serialize}function nr(e){return tr(e)===er}function ir(e){return"property"===tr(e)}function rr(e){return e.charAt(0).toUpperCase()+e.slice(1)}function or(e,t){return Ji(t)?e.prefix+":"+rr(e.localName):e.name}function ar(e,t){var n=e.name,i=e.localName,r=t.xml&&t.xml.typePrefix;return r&&0===i.indexOf(r)?e.prefix+":"+i.slice(r.length):n}function sr(e,t){var n=Si(e),i=t.getPackage(n.prefix);return ar(n,i)}function cr(e){return new Error(e)}function ur(e){return e.$descriptor}function lr(e){W(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw cr("expected element");var t,n=this.elementsById,i=ur(e),r=i.idProperty;if(r&&(t=e.get(r.name),t)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw cr("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function pr(){}function dr(){}function fr(){}function hr(e,t){this.property=e,this.context=t}function mr(e,t){this.element=t,this.propertyDesc=e}function vr(){}function gr(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function yr(e,t,n){gr.call(this,e,t,n)}function br(e,t,n){this.model=e,this.context=n}function xr(e){e instanceof Mi&&(e={model:e}),W(this,{lax:!1},e)}function wr(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}pr.prototype.handleEnd=function(){},pr.prototype.handleText=function(){},pr.prototype.handleNode=function(){},dr.prototype=Object.create(pr.prototype),dr.prototype.handleNode=function(){return this},fr.prototype=Object.create(pr.prototype),fr.prototype.handleText=function(e){this.body=(this.body||"")+e},hr.prototype=Object.create(fr.prototype),hr.prototype.handleNode=function(e){if(this.element)throw cr("expected no sub nodes");return this.element=this.createReference(e),this},hr.prototype.handleEnd=function(){this.element.id=this.body},hr.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},mr.prototype=Object.create(fr.prototype),mr.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=_i(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},vr.prototype=Object.create(fr.prototype),vr.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},gr.prototype=Object.create(vr.prototype),gr.prototype.addReference=function(e){this.context.addReference(e)},gr.prototype.handleText=function(e){var t=this.element,n=ur(t),i=n.bodyProperty;if(!i)throw cr("unexpected body text <"+e+">");fr.prototype.handleText.call(this,e)},gr.prototype.handleEnd=function(){var e=this.body,t=this.element,n=ur(t),i=n.bodyProperty;i&&void 0!==e&&(e=_i(i.type,e),t.set(i.name,e))},gr.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=ur(i),o=this.context,a=new i({}),s=this.model;return C(n,(function(e,n){var i,c=r.propertiesByName[n];c&&c.isReference?c.isMany?(i=e.split(" "),C(i,(function(e){o.addReference({element:a,property:c.ns.name,id:e})}))):o.addReference({element:a,property:c.ns.name,id:e}):(c?e=_i(c.type,e):"xmlns"!==n&&(t=Si(n,r.ns.prefix),s.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:a,property:n,value:e})),a.set(n,e))})),a},gr.prototype.getPropertyForNode=function(e){var t,n,i=e.name,r=Si(i),o=this.type,a=this.model,s=ur(o),c=r.name,u=s.propertiesByName[c];if(u&&!u.isAttr)return nr(u)&&(t=e.attributes[er],t)?(t=sr(t,a),n=a.getType(t),W({},u,{effectiveType:ur(n).name})):u;var l=a.getPackage(r.prefix);if(l){if(t=or(r,l),n=a.getType(t),u=w(s.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})),u)return W({},u,{effectiveType:ur(n).name})}else if(u=w(s.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})),u)return u;throw cr("unrecognized element <"+r.name+">")},gr.prototype.toString=function(){return"ElementDescriptor["+ur(this.type).name+"]"},gr.prototype.valueHandler=function(e,t){return new mr(e,t)},gr.prototype.referenceHandler=function(e){return new hr(e,this.context)},gr.prototype.handler=function(e){return"Element"===e?new br(this.model,e,this.context):new gr(this.model,e,this.context)},gr.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,n=t.effectiveType||t.type,Ci(n))return this.valueHandler(t,i);r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e);var o=r.element;return void 0!==o&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(W(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},yr.prototype=Object.create(gr.prototype),yr.prototype.createElement=function(e){var t=e.name,n=Si(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&or(n,o)||t;if(!r.hasType(a))throw cr("unexpected element <"+e.originalName+">");return gr.prototype.createElement.call(this,e)},br.prototype=Object.create(vr.prototype),br.prototype.createElement=function(e){var t=e.name,n=Si(t),i=n.prefix,r=e.ns[i+"$uri"],o=e.attributes;return this.model.createAny(t,r,o)},br.prototype.handleChild=function(e){var t,n=new br(this.model,"Element",this.context).handleNode(e),i=this.element,r=n.element;return void 0!==r&&(t=i.$children=i.$children||[],t.push(r),r.$parent=i),n},br.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},xr.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof gr?(i=t,t={}):"string"===typeof t?(i=this.handler(t),t={}):"string"===typeof i&&(i=this.handler(i));var r=this.model,o=this.lax,a=new lr(W({},t,{rootHandler:i})),s=new Zi({proxy:!0}),c=wr();function u(e,t,n){var i=t(),r=i.line,o=i.column,s=i.data;"<"===s.charAt(0)&&-1!==s.indexOf(" ")&&(s=s.slice(0,s.indexOf(" "))+">");var c="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return a.addWarning({message:c,error:e}),!0;throw cr(c)}function l(e,t){return u(e,t,!0)}function p(){var e,t,n=a.elementsById,i=a.references;for(e=0;t=i[e];e++){var r=t.element,o=n[t.id],s=ur(r).propertiesByName[t.property];if(o||a.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),s.isMany){var c=r.get(s.name),u=c.indexOf(t);-1===u&&(u=c.length),o?c[u]=o:c.splice(u,1)}else r.set(s.name,o)}}function d(){c.pop().handleEnd()}i.context=a,c.push(i);var f=/^<\?xml /i,h=/ encoding="([^"]+)"/i,m=/^utf-8$/i;function v(e){if(f.test(e)){var t=h.exec(e),n=t&&t[1];n&&!m.test(n)&&a.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}}function g(e,t){var n=c.peek();try{c.push(n.handleNode(e))}catch(i){u(i,t,o)&&c.push(new dr)}}function y(e,t){try{c.peek().handleText(e)}catch(n){l(n,t)}}function b(e,t){e.trim()&&y(e,t)}var x=r.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),{"http://www.w3.org/XML/1998/namespace":"xml"});return s.ns(x).on("openTag",(function(e,t,n,i){var r=e.attrs||{},o=Object.keys(r).reduce((function(e,n){var i=t(r[n]);return e[n]=i,e}),{}),a={name:e.name,originalName:e.originalName,attributes:o,ns:e.ns};g(a,i)})).on("question",v).on("closeTag",d).on("cdata",y).on("text",(function(e,t,n){b(t(e),n)})).on("error",u).on("warn",l),new Promise((function(t,n){var r;try{s.parse(e),p()}catch(d){r=d}var o=i.element;r||o||(r=cr("failed to parse document as <"+i.type.$descriptor.name+">"));var c=a.warnings,u=a.references,l=a.elementsById;return r?(r.warnings=c,n(r)):t({rootElement:o,elementsById:l,references:u,warnings:c})}))},xr.prototype.handler=function(e){return new yr(this.model,e)};var _r='<?xml version="1.0" encoding="UTF-8"?>\n',Er=/<|>|'|"|&|\n\r|\n/g,Cr=/<|>|&/g;function Sr(e){var t={},n={},i={},r=[],o=[];this.byUri=function(t){return n[t]||e&&e.byUri(t)},this.add=function(e,t){n[e.uri]=e,t?r.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,r=this.getNSKey(t);i[r]=this.byUri(n),e&&e.logUsed(t)},this.getUsed=function(e){function t(e){var t=n.getNSKey(e);return i[t]}var n=this,a=[].concat(r,o);return a.filter(t)}}function Ar(e){return e.charAt(0).toLowerCase()+e.slice(1)}function Tr(e,t){return Ji(t)?Ar(e):e}function kr(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function Rr(e){return y(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function Pr(e){return e.getUsed().filter((function(e){return"xml"!==e.prefix})).map((function(e){var t="xmlns"+(e.prefix?":"+e.prefix:"");return{name:t,value:e.uri}}))}function Dr(e,t){return t.isGeneric?W({localName:t.ns.localName},e):W({localName:Tr(t.ns.localName,t.$pkg)},e)}function Mr(e,t){return W({localName:t.ns.localName},e)}function Br(e){var t=e.$descriptor;return E(t.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!x(e,n))return!1;var i=e[n];return i!==t.default&&(null!==i&&(!t.isMany||i.length))}))}var Or={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},jr={"<":"lt",">":"gt","&":"amp"};function Nr(e,t,n){return e=y(e)?e:""+e,e.replace(t,(function(e){return"&"+n[e]+";"}))}function Fr(e){return Nr(e,Er,Or)}function Ir(e){return Nr(e,Cr,jr)}function Lr(e){return E(e,(function(e){return e.isAttr}))}function zr(e){return E(e,(function(e){return!e.isAttr}))}function $r(e){this.tagName=e}function Hr(){}function Gr(e){this.tagName=e}function Vr(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Wr(e,t){Vr.call(this,e,t)}function Ur(){this.value="",this.write=function(e){this.value+=e}}function qr(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 Kr(e){function t(t,n){var i=n||new Ur,r=new qr(i,e.format);if(e.preamble&&r.append(_r),(new Vr).build(t).serializeTo(r),!n)return i.value}return e=W({format:!1,preamble:!0},e||{}),{toXML:t}}function Yr(e,t){Mi.call(this,e,t)}$r.prototype.build=function(e){return this.element=e,this},$r.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},Hr.prototype.serializeValue=Hr.prototype.serializeTo=function(e){e.append(this.escape?Ir(this.value):this.value)},Hr.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(Cr)&&(this.escape=!0),this},kr(Gr,Hr),Gr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},Vr.prototype.build=function(e){this.element=e;var t,n,i=e.$descriptor,r=this.propertyDescriptor,o=i.isGeneric;return t=o?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),o||(n=Br(e),this.parseAttributes(Lr(n)),this.parseContainments(zr(n))),this.parseGenericAttributes(e,t),this},Vr.prototype.nsTagName=function(e){var t=this.logNamespaceUsed(e.ns);return Dr(t,e)},Vr.prototype.nsPropertyTagName=function(e){var t=this.logNamespaceUsed(e.ns);return Mr(t,e)},Vr.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Vr.prototype.nsAttributeName=function(e){var t;if(t=y(e)?Si(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}:W({localName:t.localName},n)},Vr.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return C(e,(function(r,o){var a;"$body"===o?n.push((new Hr).build({type:"String"},r)):"$children"===o?C(r,(function(e){n.push(new Vr(t).build(e))})):0!==o.indexOf("$")&&(a=t.parseNsAttribute(e,o,r),a&&i.push({name:o,value:r}))})),i},Vr.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=Si(t);if("xmlns"===o.prefix&&(i={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var a=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(a)}},Vr.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return C(i,(function(t,i){var o=n.parseNsAttribute(e,i,t);o&&r.push(o)})),r},Vr.prototype.parseGenericAttributes=function(e,t){var n=this;C(t,(function(t){if(t.name!==er)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(i){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,i)}}))},Vr.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;C(e,(function(e){var r=i.get(e.name),o=e.isReference,a=e.isMany;if(a||(r=[r]),e.isBody)n.push((new Hr).build(e,r[0]));else if(Ci(e.type))C(r,(function(i){n.push(new Gr(t.addTagName(t.nsPropertyTagName(e))).build(e,i))}));else if(o)C(r,(function(i){n.push(new $r(t.addTagName(t.nsPropertyTagName(e))).build(i))}));else{var s=nr(e),c=ir(e);C(r,(function(i){var r;r=s?new Wr(t,e):c?new Vr(t,e):new Vr(t),n.push(r.build(i))}))}}))},Vr.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new Sr(t):n=t),n},Vr.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,o=e.prefix,a=i.byUri(r);return a&&!n||i.add(e,t),i.mapPrefix(o,r),e},Vr.prototype.logNamespaceUsed=function(e,t){var n,i,r,o=this.element,a=o.$model,s=this.getNamespaces(t),c=e.prefix,u=e.uri;if(!c&&!u)return{localName:e.localName};if(r=Qi[c]||a&&(a.getPackage(c)||{}).uri,u=u||r||s.uriByPrefix(c),!u)throw new Error("no namespace uri given for prefix <"+c+">");if(e=s.byUri(u),!e){n=c,i=1;while(s.uriByPrefix(n))n=c+"_"+i++;e=this.logNamespace({prefix:n,uri:u},r===u)}return c&&s.mapPrefix(c,u),e},Vr.prototype.parseAttributes=function(e){var t=this,n=this.element;C(e,(function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];C(i,(function(e){r.push(e.id)})),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)}))},Vr.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),Rr(e)},Vr.prototype.addAttribute=function(e,t){var n=this.attrs;y(t)&&(t=Fr(t));var i=_(n,(function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix})),r={name:e,value:t};-1!==i?n.splice(i,1,r):n.push(r)},Vr.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=Pr(n).concat(t)),C(t,(function(t){e.append(" ").append(Rr(t.name)).append('="').append(t.value).append('"')}))},Vr.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Hr;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),C(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},kr(Wr,Vr),Wr.prototype.parseNsAttributes=function(e){var t=Vr.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(er),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},Wr.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},Yr.prototype=Object.create(Mi.prototype),Yr.prototype.fromXML=function(e,t,n){y(t)||(n=t,t="bpmn:Definitions");var i=new xr(W({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},Yr.prototype.toXML=function(e,t){var n=new Kr(t);return new Promise((function(t,i){try{var r=n.toXML(e);return t({xml:r})}catch(o){return i(o)}}))};var Xr="BPMN20",Zr="http://www.omg.org/spec/BPMN/20100524/MODEL",Jr="bpmn",Qr=[],eo=[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isAttr:!0,isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],to=[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],no={tagAlias:"lowerCase",typePrefix:"t"},io={name:Xr,uri:Zr,prefix:Jr,associations:Qr,types:eo,enumerations:to,xml:no},ro="BPMNDI",oo="http://www.omg.org/spec/BPMN/20100524/DI",ao="bpmndi",so=[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],co=[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],uo=[],lo={name:ro,uri:oo,prefix:ao,types:so,enumerations:co,associations:uo},po="DC",fo="http://www.omg.org/spec/DD/20100524/DC",ho="dc",mo=[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],vo=[],go={name:po,uri:fo,prefix:ho,types:mo,associations:vo},yo="DI",bo="http://www.omg.org/spec/DD/20100524/DI",xo="di",wo=[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],_o=[],Eo={tagAlias:"lowerCase"},Co={name:yo,uri:bo,prefix:xo,types:wo,associations:_o,xml:Eo},So="bpmn.io colors for BPMN",Ao="http://bpmn.io/schema/bpmn/biocolor/1.0",To="bioc",ko=[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],Ro=[],Po=[],Do={name:So,uri:Ao,prefix:To,types:ko,enumerations:Ro,associations:Po},Mo="BPMN in Color",Bo="http://www.omg.org/spec/BPMN/non-normative/color/1.0",Oo="color",jo=[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],No=[],Fo=[],Io={name:Mo,uri:Bo,prefix:Oo,types:jo,enumerations:No,associations:Fo},Lo={bpmn:io,bpmndi:lo,dc:go,di:Co,bioc:Do,color:Io};function zo(e,t){var n=W({},Lo,e);return new Yr(n,t)}function $o(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}function Ho(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&&g(arguments[t-1])))return e.apply(this,arguments);var n=arguments[t-1];console.warn(new Error("Passing callbacks to "+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 i=Array.prototype.slice.call(arguments,0,-1);e.apply(this,i).then((function(e){var t=Object.keys(e)[0];return n(null,e[t])}),(function(e){return n(e,e.warnings)}))}}var Go="Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472";function Vo(e){x(e,"di")||Object.defineProperty(e,"di",{enumerable:!1,get:function(){throw new Error(Go)}})}function Wo(e,t){return e.$instanceOf(t)}function Uo(e){return w(e.rootElements,(function(e){return Wo(e,"bpmn:Process")||Wo(e,"bpmn:Collaboration")}))}function qo(e,t){var n={},i=[],r={};function o(e,t){return function(n){e(n,t)}}function a(e){n[e.id]=e}function s(e){return n[e.id]}function c(n,i){var o=n.gfx;if(o)throw new Error(t("already rendered {element}",{element:$o(n)}));return e.element(n,r[n.id],i)}function u(t,n){return e.root(t,r[t.id],n)}function l(e,n){try{var i=r[e.id]&&c(e,n);return a(e),i}catch(o){p(o.message,{element:e,error:o}),console.error(t("failed to import {element}",{element:$o(e)})),console.error(o)}}function p(t,n){e.error(t,n)}function d(e){var n=e.bpmnElement;n?r[n.id]?p(t("multiple DI elements defined for {element}",{element:$o(n)}),{element:n}):(r[n.id]=e,Vo(n)):p(t("no bpmnElement referenced in {element}",{element:$o(e)}),{element:e})}function f(e){h(e.plane)}function h(e){d(e),C(e.planeElement,m)}function m(e){d(e)}function v(e,n){var o=e.diagrams;if(n&&-1===o.indexOf(n))throw new Error(t("diagram not part of bpmn:Definitions"));if(!n&&o&&o.length&&(n=o[0]),!n)throw new Error(t("no diagram to display"));r={},f(n);var a=n.plane;if(!a)throw new Error(t("no plane for {element}",{element:$o(n)}));var s=a.bpmnElement;if(!s){if(s=Uo(e),!s)throw new Error(t("no process or collaboration to display"));p(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:$o(a),rootElement:$o(s)})),a.bpmnElement=s,d(a)}var c=u(s,a);if(Wo(s,"bpmn:Process")||Wo(s,"bpmn:SubProcess"))y(s,c);else{if(!Wo(s,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:$o(a),rootElement:$o(s)}));z(s,c),b(e.rootElements,c)}g(i)}function g(){var e;while(i.length)e=i.shift(),e()}function y(e,t){F(e,t),R(e.ioSpecification,t),k(e.artifacts,t),a(e)}function b(e,t){var n=E(e,(function(e){return!s(e)&&Wo(e,"bpmn:Process")&&e.laneSets}));n.forEach(o(y,t))}function x(e,t){l(e,t)}function w(e,t){C(e,o(x,t))}function _(e,t){l(e,t)}function S(e,t){l(e,t)}function A(e,t){l(e,t)}function T(e,t){l(e,t)}function k(e,t){C(e,(function(e){Wo(e,"bpmn:Association")?i.push((function(){T(e,t)})):T(e,t)}))}function R(e,t){e&&(C(e.dataInputs,o(S,t)),C(e.dataOutputs,o(A,t)))}function P(e,t){F(e,t),k(e.artifacts,t)}function D(e,t){var n=l(e,t);Wo(e,"bpmn:SubProcess")&&P(e,n||t),Wo(e,"bpmn:Activity")&&R(e.ioSpecification,t),i.push((function(){C(e.dataInputAssociations,o(_,t)),C(e.dataOutputAssociations,o(_,t))}))}function M(e,t){l(e,t)}function B(e,t){l(e,t)}function O(e,t){i.push((function(){var n=l(e,t);e.childLaneSet&&j(e.childLaneSet,n||t),$(e)}))}function j(e,t){C(e.lanes,o(O,t))}function N(e,t){C(e,o(j,t))}function F(e,t){I(e.flowElements,t),e.laneSets&&N(e.laneSets,t)}function I(e,n){C(e,(function(e){Wo(e,"bpmn:SequenceFlow")?i.push((function(){M(e,n)})):Wo(e,"bpmn:BoundaryEvent")?i.unshift((function(){D(e,n)})):Wo(e,"bpmn:FlowNode")?D(e,n):Wo(e,"bpmn:DataObject")||(Wo(e,"bpmn:DataStoreReference")||Wo(e,"bpmn:DataObjectReference")?B(e,n):p(t("unrecognized flowElement {element} in context {context}",{element:$o(e),context:n?$o(n.businessObject):"null"}),{element:e,context:n}))}))}function L(e,t){var n=l(e,t),i=e.processRef;i&&y(i,n||t)}function z(e,t){C(e.participants,o(L,t)),k(e.artifacts,t),i.push((function(){w(e.messageFlows,t)}))}function $(e){C(e.flowNodeRef,(function(t){var n=t.get("lanes");n&&n.push(e)}))}return{handleDeferred:g,handleDefinitions:v,handleSubProcess:P,registerDi:d}}function Ko(e,t){var n=Xo(e);return n&&"function"===typeof n.$instanceOf&&n.$instanceOf(t)}function Yo(e,t){return k(t,(function(t){return Ko(e,t)}))}function Xo(e){return e&&e.businessObject||e}function Zo(e){return e&&e.di}function Jo(e,t,n){var i,r,o,a,s,c=[];function u(e,t){var n={root:function(e,t){return i.add(e,t)},element:function(e,t,n){return i.add(e,t,n)},error:function(e,t){c.push({message:e,context:t})}},r=new qo(n,o);t=t||e.diagrams&&e.diagrams[0];var s=Qo(e,t);if(!s)throw new Error(o("no diagram to display"));C(s,(function(t){r.handleDefinitions(e,t)}));var u=t.plane.bpmnElement.id;a.setRootElement(a.findRoot(u+"_plane")||a.findRoot(u))}return new Promise((function(l,p){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("translate"),a=e.get("canvas"),r.fire("import.render.start",{definitions:t}),u(t,n),r.fire("import.render.complete",{error:s,warnings:c}),l({warnings:c})}catch(d){return d.warnings=c,p(d)}}))}function Qo(e,t){if(t){var n,i=t.plane.bpmnElement,r=i;Ko(i,"bpmn:Process")||Ko(i,"bpmn:Collaboration")||(r=ta(i)),n=Ko(r,"bpmn:Collaboration")?r:w(e.rootElements,(function(e){if(Ko(e,"bpmn:Collaboration"))return w(e.participants,(function(e){return e.processRef===r}))}));var o=[r];n&&(o=R(n.participants,(function(e){return e.processRef})),o.push(n));var a=ea(o),s=[t],c=[i];return C(e.diagrams,(function(e){var t=e.plane.bpmnElement;-1!==a.indexOf(t)&&-1===c.indexOf(t)&&(s.push(e),c.push(t))})),s}}function ea(e){var t=[];return C(e,(function(e){e&&(t.push(e),t=t.concat(ea(e.flowElements)))})),t}function ta(e){var t=e;while(t){if(Ko(t,"bpmn:Process"))return t;t=t.$parent}}var na,ia='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>',ra=ia,oa={verticalAlign:"middle"},aa={color:"#404040"},sa={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},ca={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},ua={position:"absolute",left:"50%",top:"40%",transform:"translate(-50%)",width:"260px",padding:"10px",background:"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",display:"flex",lineHeight:"1.3"},la='<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link">'+ra+'</a><span>Web-based tooling for BPMN, DMN and CMMN diagrams powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>';function pa(){na=Te(la),ne(na,sa),ne(De("svg",na),oa),ne(De(".backdrop",na),ca),ne(De(".notice",na),ua),ne(De(".link",na),aa,{margin:"15px 20px 15px 10px",alignSelf:"center"})}function da(){na||(pa(),Ae.bind(na,".backdrop","click",(function(e){document.body.removeChild(na)}))),document.body.appendChild(na)}function fa(e){e=W({},va,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),ba(this._container),this._init(this._container,this._moddle,e)}function ha(e,t){return e.warnings=t,e}function ma(e){var t=/unparsable content <([^>]+)> detected([\s\S]*)$/,n=t.exec(e.message);return n&&(e.message="unparsable content <"+n[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+n[2]),e}i(fa,gi),fa.prototype.importXML=Ho((function(e,t){var n=this;function i(e){var t=n.get("eventBus").createEvent(e);return Object.defineProperty(t,"context",{enumerable:!0,get:function(){return console.warn(new Error("import.parse.complete <context> is deprecated and will be removed in future library versions")),{warnings:e.warnings,references:e.references,elementsById:e.elementsById}}}),t}return new Promise((function(r,o){e=n._emit("import.parse.start",{xml:e})||e,n._moddle.fromXML(e,"bpmn:Definitions").then((function(e){var a=e.rootElement,s=e.references,c=e.warnings,u=e.elementsById;a=n._emit("import.parse.complete",i({error:null,definitions:a,elementsById:u,references:s,warnings:c}))||a,n.importDefinitions(a,t).then((function(e){var t=[].concat(c,e.warnings||[]);return n._emit("import.done",{error:null,warnings:t}),r({warnings:t})})).catch((function(e){var t=[].concat(c,e.warnings||[]);return n._emit("import.done",{error:e,warnings:t}),o(ha(e,t))}))})).catch((function(e){return n._emit("import.parse.complete",{error:e}),e=ma(e),n._emit("import.done",{error:e,warnings:e.warnings}),o(e)}))}))})),fa.prototype.importDefinitions=Ho((function(e,t){var n=this;return new Promise((function(i,r){n._setDefinitions(e),n.open(t).then((function(e){var t=e.warnings;return i({warnings:t})})).catch((function(e){return r(e)}))}))})),fa.prototype.open=Ho((function(e){var t=this._definitions,n=e,i=this;return new Promise((function(r,o){if(!t){var a=new Error("no XML imported");return o(ha(a,[]))}if("string"===typeof e&&(n=ya(t,e),!n)){var s=new Error("BPMNDiagram <"+e+"> not found");return o(ha(s,[]))}try{i.clear()}catch(c){return o(ha(c,[]))}Jo(i,t,n).then((function(e){var t=e.warnings;return r({warnings:t})})).catch((function(e){return o(e)}))}))})),fa.prototype.saveXML=Ho((function(e){e=e||{};var t=this,n=this._definitions;return new Promise((function(i){if(!n)return i({error:new Error("no definitions loaded")});n=t._emit("saveXML.start",{definitions:n})||n,t._moddle.toXML(n,e).then((function(e){var n=e.xml;return n=t._emit("saveXML.serialized",{xml:n})||n,i({xml:n})}))})).catch((function(e){return{error:e}})).then((function(e){t._emit("saveXML.done",e);var n=e.error;return n?Promise.reject(n):e}))})),fa.prototype.saveSVG=Ho((function(e){e=e||{};var t=this;return new Promise((function(e,n){var i,r;t._emit("saveSVG.start");try{var o=t.get("canvas"),a=o.getActiveLayer(),s=De("defs",o._svg),c=vt(a),u=s?"<defs>"+vt(s)+"</defs>":"",l=a.getBBox();i='<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+l.width+'" height="'+l.height+'" viewBox="'+l.x+" "+l.y+" "+l.width+" "+l.height+'" version="1.1">'+u+c+"</svg>"}catch(p){r=p}return t._emit("saveSVG.done",{error:r,svg:i}),r?n(r):e({svg:i})}))})),fa.prototype._setDefinitions=function(e){this._definitions=e},fa.prototype.getModules=function(){return this._modules},fa.prototype.clear=function(){this.getDefinitions()&&gi.prototype.clear.call(this)},fa.prototype.destroy=function(){gi.prototype.destroy.call(this),Be(this._container)},fa.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},fa.prototype.off=function(e,t){this.get("eventBus").off(e,t)},fa.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),"string"===typeof e&&(e=De(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},fa.prototype.getDefinitions=function(){return this._definitions},fa.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},fa.prototype._init=function(e,t,n){var i=n.modules||this.getModules(),r=n.additionalModules||[],o=[{bpmnjs:["value",this],moddle:["value",t]}],a=[].concat(o,i,r),s=W(q(n,["additionalModules"]),{canvas:W({},n.canvas,{container:e}),modules:a});gi.call(this,s),n&&n.container&&this.attachTo(n.container)},fa.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},fa.prototype._createContainer=function(e){var t=Te('<div class="bjs-container"></div>');return ne(t,{width:ga(e.width),height:ga(e.height),position:e.position}),t},fa.prototype._createModdle=function(e){var t=W({},this._moddleExtensions,e.moddleExtensions);return new zo(t)},fa.prototype._modules=[];var va={width:"100%",height:"100%",position:"relative"};function ga(e){return e+(v(e)?"px":"")}function ya(e,t){return t&&w(e.diagrams,(function(e){return e.id===t}))||null}function ba(e){var t=ra,n='<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+t+"</a>",i=Te(n);ne(De("svg",i),oa),ne(i,aa,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(i),we.bind(i,"click",(function(e){da(),e.preventDefault()}))}function xa(e){fa.call(this,e),this.on("import.parse.complete",(function(e){e.error||this._collectIds(e.definitions,e.elementsById)}),this),this.on("diagram.destroy",(function(){this.get("moddle").ids.clear()}),this)}function wa(e,t){return!Ko(e,"bpmn:CallActivity")&&(Ko(e,"bpmn:SubProcess")?(t=t||Zo(e),!(!t||!Ko(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded):!Ko(e,"bpmn:Participant")||!!Xo(e).processRef)}function _a(e){return e&&!1!==Xo(e).isInterrupting}function Ea(e){return e&&!!Xo(e).triggeredByEvent}function Ca(e,t){var n=Xo(e),i=!1;return n.eventDefinitions&&C(n.eventDefinitions,(function(e){Ko(e,t)&&(i=!0)})),i}function Sa(e){return Ca(e,"bpmn:ErrorEventDefinition")}function Aa(e){return Ca(e,"bpmn:EscalationEventDefinition")}function Ta(e){return Ca(e,"bpmn:CompensateEventDefinition")}function ka(e){return Ko(e,"bpmn:FlowElement")||Ko(e,"bpmn:Participant")||Ko(e,"bpmn:Lane")||Ko(e,"bpmn:SequenceFlow")||Ko(e,"bpmn:MessageFlow")||Ko(e,"bpmn:DataInput")||Ko(e,"bpmn:DataOutput")?"name":Ko(e,"bpmn:TextAnnotation")?"text":Ko(e,"bpmn:Group")?"categoryValueRef":void 0}function Ra(e){var t=e["categoryValueRef"];return t&&t.value||""}function Pa(e){var t=e.businessObject,n=ka(t);if(n)return"categoryValueRef"===n?Ra(t):t[n]||""}function Da(e,t,n){var i=e.businessObject,r=ka(i);return r&&("categoryValueRef"===r?i["categoryValueRef"].value=t:i[r]=t),e}i(xa,fa),xa.prototype._createModdle=function(e){var t=fa.prototype._createModdle.call(this,e);return t.ids=new s([32,36,1]),t},xa.prototype._collectIds=function(e,t){var n,i=e.$model,r=i.ids;for(n in r.clear(),t)r.claim(n,t[n])};var Ma="hsl(225, 10%, 15%)";function Ba(e,t,n){function i(e,t){return T(t,(function(t,n){return e[n]==t}))}return k(e.eventDefinitions,(function(r){return r.$type===t&&i(e,n)}))}function Oa(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}function ja(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}function Na(e){return e.businessObject}function Fa(e,t){var n=Zo(e);return n.get("color:background-color")||n.get("bioc:fill")||t||"white"}function Ia(e,t){var n=Zo(e);return n.get("color:border-color")||n.get("bioc:stroke")||t||Ma}function La(e,t,n){var i=Zo(e),r=i.get("label");return r&&r.get("color:color")||t||Ia(e,n)}function za(e){var t=e.x+e.width/2,n=e.y+e.height/2,i=e.width/2,r=[["M",t,n],["m",0,-i],["a",i,i,0,1,1,0,2*i],["a",i,i,0,1,1,0,-2*i],["z"]];return Ot(r)}function $a(e,t){var n=e.x,i=e.y,r=e.width,o=e.height,a=[["M",n+t,i],["l",r-2*t,0],["a",t,t,0,0,1,t,t],["l",0,o-2*t],["a",t,t,0,0,1,-t,t],["l",2*t-r,0],["a",t,t,0,0,1,-t,-t],["l",0,2*t-o],["a",t,t,0,0,1,t,-t],["z"]];return Ot(a)}function Ha(e){var t=e.width,n=e.height,i=e.x,r=e.y,o=t/2,a=n/2,s=[["M",i+o,r],["l",o,a],["l",-o,a],["l",-o,-a],["z"]];return Ot(s)}function Ga(e){var t=e.x,n=e.y,i=e.width,r=e.height,o=[["M",t,n],["l",i,0],["l",0,r],["l",-i,0],["z"]];return Ot(o)}var Va=new s,Wa=10,Ua=3,qa=.95,Ka=.35,Ya=10;function Xa(e,t,n,i,r,o,a){Bt.call(this,t,a);var s=e&&e.defaultFillColor,c=e&&e.defaultStrokeColor,u=e&&e.defaultLabelColor,l=Va.next(),p={},d=n.computeStyle;function f(e,t){var n=W({fill:Ma,strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},t.attrs),i=t.ref||{x:0,y:0},o=t.scale||1;"none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]);var a=nt("marker");He(t.element,n),Ne(a,t.element),He(a,{id:e,viewBox:"0 0 20 20",refX:i.x,refY:i.y,markerWidth:20*o,markerHeight:20*o,orient:"auto"});var s=De("defs",r._svg);s||(s=nt("defs"),Ne(r._svg,s)),Ne(s,a),p[e]=a}function h(e){return e.replace(/[^0-9a-zA-z]+/g,"_")}function v(e,t,n){var i=e+"-"+h(t)+"-"+h(n)+"-"+l;return p[i]||g(i,e,t,n),"url(#"+i+")"}function g(e,t,n,i){if("sequenceflow-end"===t){var r=nt("path");He(r,{d:"M 1 5 L 11 10 L 1 15 Z"}),f(e,{element:r,ref:{x:11,y:10},scale:.5,attrs:{fill:i,stroke:i}})}if("messageflow-start"===t){var o=nt("circle");He(o,{cx:6,cy:6,r:3.5}),f(e,{element:o,attrs:{fill:n,stroke:i},ref:{x:6,y:6}})}if("messageflow-end"===t){var a=nt("path");He(a,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),f(e,{element:a,attrs:{fill:n,stroke:i,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if("association-start"===t){var s=nt("path");He(s,{d:"M 11 5 L 1 10 L 11 15"}),f(e,{element:s,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if("association-end"===t){var c=nt("path");He(c,{d:"M 1 5 L 11 10 L 1 15"}),f(e,{element:c,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if("conditional-flow-marker"===t){var u=nt("path");He(u,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),f(e,{element:u,attrs:{fill:n,stroke:i},ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===t){var l=nt("path");He(l,{d:"M 6 4 L 10 16"}),f(e,{element:l,attrs:{stroke:i},ref:{x:0,y:10},scale:.5})}}function y(e,t,n,i,r){m(i)&&(r=i,i=0),i=i||0,r=d(r,{stroke:Ma,strokeWidth:2,fill:"white"}),"none"===r.fill&&delete r.fillOpacity;var o=t/2,a=n/2,s=nt("circle");return He(s,{cx:o,cy:a,r:Math.round((t+n)/4-i)}),He(s,r),Ne(e,s),s}function b(e,t,n,i,r,o){m(r)&&(o=r,r=0),r=r||0,o=d(o,{stroke:Ma,strokeWidth:2,fill:"white"});var a=nt("rect");return He(a,{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i}),He(a,o),Ne(e,a),a}function x(e,t,n,i){var r=t/2,o=n/2,a=[{x:r,y:0},{x:t,y:o},{x:r,y:n},{x:0,y:o}],s=a.map((function(e){return e.x+","+e.y})).join(" ");i=d(i,{stroke:Ma,strokeWidth:2,fill:"white"});var c=nt("polygon");return He(c,{points:s}),He(c,i),Ne(e,c),c}function w(e,t,n){n=d(n,["no-fill"],{stroke:Ma,strokeWidth:2,fill:"none"});var i=Nt(t,n);return Ne(e,i),i}function _(e,t,n){n=d(n,["no-fill"],{strokeWidth:2,stroke:Ma});var i=nt("path");return He(i,{d:t}),He(i,n),Ne(e,i),i}function E(e,t,n,i){return _(t,n,W({"data-marker":e},i))}function S(e){return B[e]}function A(e){return function(t,n){return S(e)(t,n)}}function T(e,t){var n=Na(e),i=Oa(n);return n.eventDefinitions&&n.eventDefinitions.length>1?n.parallelMultiple?S("bpmn:ParallelMultipleEventDefinition")(t,e,i):S("bpmn:MultipleEventDefinition")(t,e,i):Ba(n,"bpmn:MessageEventDefinition")?S("bpmn:MessageEventDefinition")(t,e,i):Ba(n,"bpmn:TimerEventDefinition")?S("bpmn:TimerEventDefinition")(t,e,i):Ba(n,"bpmn:ConditionalEventDefinition")?S("bpmn:ConditionalEventDefinition")(t,e):Ba(n,"bpmn:SignalEventDefinition")?S("bpmn:SignalEventDefinition")(t,e,i):Ba(n,"bpmn:EscalationEventDefinition")?S("bpmn:EscalationEventDefinition")(t,e,i):Ba(n,"bpmn:LinkEventDefinition")?S("bpmn:LinkEventDefinition")(t,e,i):Ba(n,"bpmn:ErrorEventDefinition")?S("bpmn:ErrorEventDefinition")(t,e,i):Ba(n,"bpmn:CancelEventDefinition")?S("bpmn:CancelEventDefinition")(t,e,i):Ba(n,"bpmn:CompensateEventDefinition")?S("bpmn:CompensateEventDefinition")(t,e,i):Ba(n,"bpmn:TerminateEventDefinition")?S("bpmn:TerminateEventDefinition")(t,e,i):null}function k(e,t,n){n=W({size:{width:100}},n);var i=o.createText(t||"",n);return qe(i).add("djs-label"),Ne(e,i),i}function R(e,t,n){var i=Na(t);return k(e,i.name,{box:t,align:n,padding:5,style:{fill:La(t,u,c)}})}function P(e,t){var n={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return k(e,Pa(t),{box:n,fitBox:!0,style:W({},o.getExternalStyle(),{fill:La(t,u,c)})})}function D(e,t,n){var i=k(e,t,{box:{height:30,width:n.height},align:"center-middle",style:{fill:La(n,u,c)}}),r=-1*n.height;ui(i,0,-r,270)}function M(e){for(var t=e.waypoints,n="m "+t[0].x+","+t[0].y,i=1;i<t.length;i++)n+="L"+t[i].x+","+t[i].y+" ";return n}var B=this.handlers={"bpmn:Event":function(e,t,n){return"fillOpacity"in n||(n.fillOpacity=qa),y(e,t.width,t.height,n)},"bpmn:StartEvent":function(e,t){var n={fill:Fa(t,s),stroke:Ia(t,c)},i=Na(t);i.isInterrupting||(n={strokeDasharray:"6",strokeLinecap:"round",fill:Fa(t,s),stroke:Ia(t,c)});var r=S("bpmn:Event")(e,t,n);return T(t,e),r},"bpmn:MessageEventDefinition":function(e,t,n){var r=i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),o=n?Ia(t,c):Fa(t,s),a=n?Fa(t,s):Ia(t,c),u=_(e,r,{strokeWidth:1,fill:o,stroke:a});return u},"bpmn:TimerEventDefinition":function(e,t){var n=y(e,t.width,t.height,.2*t.height,{strokeWidth:2,fill:Fa(t,s),stroke:Ia(t,c)}),r=i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}});_(e,r,{strokeWidth:2,strokeLinecap:"square",stroke:Ia(t,c)});for(var o=0;o<12;o++){var a=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),u=t.width/2,l=t.height/2;_(e,a,{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*o+","+l+","+u+")",stroke:Ia(t,c)})}return n},"bpmn:EscalationEventDefinition":function(e,t,n){var r=i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),o=n?Ia(t,c):"none";return _(e,r,{strokeWidth:1,fill:o,stroke:Ia(t,c)})},"bpmn:ConditionalEventDefinition":function(e,t){var n=i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}});return _(e,n,{strokeWidth:1,stroke:Ia(t,c)})},"bpmn:LinkEventDefinition":function(e,t,n){var r=i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),o=n?Ia(t,c):"none";return _(e,r,{strokeWidth:1,fill:o,stroke:Ia(t,c)})},"bpmn:ErrorEventDefinition":function(e,t,n){var r=i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),o=n?Ia(t,c):"none";return _(e,r,{strokeWidth:1,fill:o,stroke:Ia(t,c)})},"bpmn:CancelEventDefinition":function(e,t,n){var r=i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),o=n?Ia(t,c):"none",a=_(e,r,{strokeWidth:1,fill:o,stroke:Ia(t,c)});return pi(a,45),a},"bpmn:CompensateEventDefinition":function(e,t,n){var r=i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),o=n?Ia(t,c):"none";return _(e,r,{strokeWidth:1,fill:o,stroke:Ia(t,c)})},"bpmn:SignalEventDefinition":function(e,t,n){var r=i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),o=n?Ia(t,c):"none";return _(e,r,{strokeWidth:1,fill:o,stroke:Ia(t,c)})},"bpmn:MultipleEventDefinition":function(e,t,n){var r=i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),o=n?Ia(t,c):"none";return _(e,r,{strokeWidth:1,fill:o})},"bpmn:ParallelMultipleEventDefinition":function(e,t){var n=i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}});return _(e,n,{strokeWidth:1,fill:Ia(t,c),stroke:Ia(t,c)})},"bpmn:EndEvent":function(e,t){var n=S("bpmn:Event")(e,t,{strokeWidth:4,fill:Fa(t,s),stroke:Ia(t,c)});return T(t,e,!0),n},"bpmn:TerminateEventDefinition":function(e,t){var n=y(e,t.width,t.height,8,{strokeWidth:4,fill:Ia(t,c),stroke:Ia(t,c)});return n},"bpmn:IntermediateEvent":function(e,t){var n=S("bpmn:Event")(e,t,{strokeWidth:1,fill:Fa(t,s),stroke:Ia(t,c)});return y(e,t.width,t.height,Ua,{strokeWidth:1,fill:Fa(t,"none"),stroke:Ia(t,c)}),T(t,e),n},"bpmn:IntermediateCatchEvent":A("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":A("bpmn:IntermediateEvent"),"bpmn:Activity":function(e,t,n){return n=n||{},"fillOpacity"in n||(n.fillOpacity=qa),b(e,t.width,t.height,Wa,n)},"bpmn:Task":function(e,t){var n={fill:Fa(t,s),stroke:Ia(t,c)},i=S("bpmn:Activity")(e,t,n);return R(e,t,"center-middle"),O(e,t),i},"bpmn:ServiceTask":function(e,t){var n=S("bpmn:Task")(e,t),r=i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});_(e,r,{strokeWidth:1,fill:Fa(t,s),stroke:Ia(t,c)});var o=i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}});_(e,o,{strokeWidth:0,fill:Fa(t,s)});var a=i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return _(e,a,{strokeWidth:1,fill:Fa(t,s),stroke:Ia(t,c)}),n},"bpmn:UserTask":function(e,t){var n=S("bpmn:Task")(e,t),r=15,o=12,a=i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:r,y:o}});_(e,a,{strokeWidth:.5,fill:Fa(t,s),stroke:Ia(t,c)});var u=i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:r,y:o}});_(e,u,{strokeWidth:.5,fill:Fa(t,s),stroke:Ia(t,c)});var l=i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:r,y:o}});return _(e,l,{strokeWidth:.5,fill:Ia(t,c),stroke:Ia(t,c)}),n},"bpmn:ManualTask":function(e,t){var n=S("bpmn:Task")(e,t),r=i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return _(e,r,{strokeWidth:.5,fill:Fa(t,s),stroke:Ia(t,c)}),n},"bpmn:SendTask":function(e,t){var n=S("bpmn:Task")(e,t),r=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return _(e,r,{strokeWidth:1,fill:Ia(t,c),stroke:Fa(t,s)}),n},"bpmn:ReceiveTask":function(e,t){var n,r=Na(t),o=S("bpmn:Task")(e,t);return r.instantiate?(y(e,28,28,4.4,{strokeWidth:1}),n=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):n=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),_(e,n,{strokeWidth:1,fill:Fa(t,s),stroke:Ia(t,c)}),o},"bpmn:ScriptTask":function(e,t){var n=S("bpmn:Task")(e,t),r=i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return _(e,r,{strokeWidth:1,stroke:Ia(t,c)}),n},"bpmn:BusinessRuleTask":function(e,t){var n=S("bpmn:Task")(e,t),r=i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),o=_(e,r);He(o,{strokeWidth:1,fill:Fa(t,"#aaaaaa"),stroke:Ia(t,c)});var a=i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),s=_(e,a);return He(s,{strokeWidth:1,stroke:Ia(t,c)}),n},"bpmn:SubProcess":function(e,t,n){n=W({fill:Fa(t,s),stroke:Ia(t,c)},n);var i=S("bpmn:Activity")(e,t,n),r=wa(t);return Ea(t)&&He(i,{strokeDasharray:"1,2"}),R(e,t,r?"center-top":"center-middle"),r?O(e,t):O(e,t,["SubProcessMarker"]),i},"bpmn:AdHocSubProcess":function(e,t){return S("bpmn:SubProcess")(e,t)},"bpmn:Transaction":function(e,t){var i=S("bpmn:SubProcess")(e,t),r=n.style(["no-fill","no-events"],{stroke:Ia(t,c)});return b(e,t.width,t.height,Wa-2,Ua,r),i},"bpmn:CallActivity":function(e,t){return S("bpmn:SubProcess")(e,t,{strokeWidth:5})},"bpmn:Participant":function(e,t){var n={fillOpacity:qa,fill:Fa(t,s),stroke:Ia(t,c)},i=S("bpmn:Lane")(e,t,n),r=wa(t);if(r){w(e,[{x:30,y:0},{x:30,y:t.height}],{stroke:Ia(t,c)});var o=Na(t).name;D(e,o,t)}else{var a=Na(t).name;k(e,a,{box:t,align:"center-middle",style:{fill:La(t,u,c)}})}var l=!!Na(t).participantMultiplicity;return l&&S("ParticipantMultiplicityMarker")(e,t),i},"bpmn:Lane":function(e,t,n){var i=b(e,t.width,t.height,0,W({fill:Fa(t,s),fillOpacity:Ka,stroke:Ia(t,c)},n)),r=Na(t);if("bpmn:Lane"===r.$type){var o=r.name;D(e,o,t)}return i},"bpmn:InclusiveGateway":function(e,t){var n=S("bpmn:Gateway")(e,t);return y(e,t.width,t.height,.24*t.height,{strokeWidth:2.5,fill:Fa(t,s),stroke:Ia(t,c)}),n},"bpmn:ExclusiveGateway":function(e,t){var n=S("bpmn:Gateway")(e,t),r=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return Zo(t).isMarkerVisible&&_(e,r,{strokeWidth:1,fill:Ia(t,c),stroke:Ia(t,c)}),n},"bpmn:ComplexGateway":function(e,t){var n=S("bpmn:Gateway")(e,t),r=i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}});return _(e,r,{strokeWidth:1,fill:Ia(t,c),stroke:Ia(t,c)}),n},"bpmn:ParallelGateway":function(e,t){var n=S("bpmn:Gateway")(e,t),r=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}});return _(e,r,{strokeWidth:1,fill:Ia(t,c),stroke:Ia(t,c)}),n},"bpmn:EventBasedGateway":function(e,t){var n=Na(t),r=S("bpmn:Gateway")(e,t);y(e,t.width,t.height,.2*t.height,{strokeWidth:1,fill:"none",stroke:Ia(t,c)});var o=n.eventGatewayType,a=!!n.instantiate;function s(){var n=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}}),r={strokeWidth:2,fill:Fa(t,"none"),stroke:Ia(t,c)};_(e,n,r)}if("Parallel"===o){var u=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),l=_(e,u);He(l,{strokeWidth:1,fill:"none"})}else if("Exclusive"===o){if(!a){var p=y(e,t.width,t.height,.26*t.height);He(p,{strokeWidth:1,fill:"none",stroke:Ia(t,c)})}s()}return r},"bpmn:Gateway":function(e,t){var n={fill:Fa(t,s),fillOpacity:qa,stroke:Ia(t,c)};return x(e,t.width,t.height,n)},"bpmn:SequenceFlow":function(e,t){var n,i=M(t),r=Fa(t,s),o=Ia(t,c),a={strokeLinejoin:"round",markerEnd:v("sequenceflow-end",r,o),stroke:Ia(t,c)},u=_(e,i,a),l=Na(t);return t.source&&(n=t.source.businessObject,l.conditionExpression&&n.$instanceOf("bpmn:Activity")&&He(u,{markerStart:v("conditional-flow-marker",r,o)}),n.default&&(n.$instanceOf("bpmn:Gateway")||n.$instanceOf("bpmn:Activity"))&&n.default===l&&He(u,{markerStart:v("conditional-default-flow-marker",r,o)})),u},"bpmn:Association":function(e,t,n){var i=Na(t),r=Fa(t,s),o=Ia(t,c);return n=W({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",stroke:Ia(t,c)},n||{}),"One"!==i.associationDirection&&"Both"!==i.associationDirection||(n.markerEnd=v("association-end",r,o)),"Both"===i.associationDirection&&(n.markerStart=v("association-start",r,o)),w(e,t.waypoints,n)},"bpmn:DataInputAssociation":function(e,t){var n=Fa(t,s),i=Ia(t,c);return S("bpmn:Association")(e,t,{markerEnd:v("association-end",n,i)})},"bpmn:DataOutputAssociation":function(e,t){var n=Fa(t,s),i=Ia(t,c);return S("bpmn:Association")(e,t,{markerEnd:v("association-end",n,i)})},"bpmn:MessageFlow":function(e,t){var n=Na(t),r=Zo(t),o=Fa(t,s),a=Ia(t,c),l=M(t),p={markerEnd:v("messageflow-end",o,a),markerStart:v("messageflow-start",o,a),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px",stroke:Ia(t,c)},d=_(e,l,p);if(n.messageRef){var f=d.getPointAtLength(d.getTotalLength()/2),h=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:f.x,y:f.y}}),m={strokeWidth:1};"initiating"===r.messageVisibleKind?(m.fill="white",m.stroke=Ma):(m.fill="#888",m.stroke="white");var g=_(e,h,m),y=n.messageRef.name,b=k(e,y,{align:"center-top",fitBox:!0,style:{fill:Ia(t,u,c)}}),x=g.getBBox(),w=b.getBBox(),E=f.x-w.width/2,C=f.y+x.height/2+Ya;ui(b,E,C,0)}return d},"bpmn:DataObject":function(e,t){var n=i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),r=_(e,n,{fill:Fa(t,s),fillOpacity:qa,stroke:Ia(t,c)}),o=Na(t);return ja(o)&&j(e,t),r},"bpmn:DataObjectReference":A("bpmn:DataObject"),"bpmn:DataInput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=S("bpmn:DataObject")(e,t);return _(e,n,{strokeWidth:1}),r},"bpmn:DataOutput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=S("bpmn:DataObject")(e,t);return _(e,n,{strokeWidth:1,fill:Ma}),r},"bpmn:DataStoreReference":function(e,t){var n=i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),r=_(e,n,{strokeWidth:2,fill:Fa(t,s),fillOpacity:qa,stroke:Ia(t,c)});return r},"bpmn:BoundaryEvent":function(e,t){var n=Na(t),i=n.cancelActivity,r={strokeWidth:1,fill:Fa(t,s),stroke:Ia(t,c)};i||(r.strokeDasharray="6",r.strokeLinecap="round");var o=W({},r,{fillOpacity:1}),a=W({},r,{fill:"none"}),u=S("bpmn:Event")(e,t,o);return y(e,t.width,t.height,Ua,a),T(t,e),u},"bpmn:Group":function(e,t){var n=b(e,t.width,t.height,Wa,{stroke:Ia(t,c),strokeWidth:1,strokeDasharray:"8,3,1,3",fill:"none",pointerEvents:"none"});return n},label:function(e,t){return P(e,t)},"bpmn:TextAnnotation":function(e,t){var n={fill:"none",stroke:"none"},r=b(e,t.width,t.height,0,0,n),o=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}});_(e,o,{stroke:Ia(t,c)});var a=Na(t).text||"";return k(e,a,{box:t,align:"left-top",padding:5,style:{fill:La(t,u,c)}}),r},ParticipantMultiplicityMarker:function(e,t){var n=i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:t.width/2/t.width,my:(t.height-15)/t.height}});E("participant-multiplicity",e,n,{strokeWidth:2,fill:Fa(t,s),stroke:Ia(t,c)})},SubProcessMarker:function(e,t){var n=b(e,14,14,0,{strokeWidth:1,fill:Fa(t,s),stroke:Ia(t,c)});li(n,t.width/2-7.5,t.height-20);var r=i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7.5)/t.width,my:(t.height-20)/t.height}});E("sub-process",e,r,{fill:Fa(t,s),stroke:Ia(t,c)})},ParallelMarker:function(e,t,n){var r=i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.parallel)/t.width,my:(t.height-20)/t.height}});E("parallel",e,r,{fill:Fa(t,s),stroke:Ia(t,c)})},SequentialMarker:function(e,t,n){var r=i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.seq)/t.width,my:(t.height-19)/t.height}});E("sequential",e,r,{fill:Fa(t,s),stroke:Ia(t,c)})},CompensationMarker:function(e,t,n){var r=i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.compensation)/t.width,my:(t.height-13)/t.height}});E("compensation",e,r,{strokeWidth:1,fill:Fa(t,s),stroke:Ia(t,c)})},LoopMarker:function(e,t,n){var r=i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.loop)/t.width,my:(t.height-7)/t.height}});E("loop",e,r,{strokeWidth:1,fill:Fa(t,s),stroke:Ia(t,c),strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){var r=i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.adhoc)/t.width,my:(t.height-15)/t.height}});E("adhoc",e,r,{strokeWidth:1,fill:Ia(t,c),stroke:Ia(t,c)})}};function O(e,t,n){var i,r=Na(t),o=n&&-1!==n.indexOf("SubProcessMarker");i=o?{seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},C(n,(function(n){S(n)(e,t,i)})),r.isForCompensation&&S("CompensationMarker")(e,t,i),"bpmn:AdHocSubProcess"===r.$type&&S("AdhocMarker")(e,t,i);var a=r.loopCharacteristics,s=a&&a.isSequential;a&&(void 0===s&&S("LoopMarker")(e,t,i),!1===s&&S("ParallelMarker")(e,t,i),!0===s&&S("SequentialMarker")(e,t,i))}function j(e,t){var n=(t.height-18)/t.height,r=i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.33,my:n}});_(e,r,{strokeWidth:2})}this._drawPath=_,this._renderer=S}i(Xa,Bt),Xa.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],Xa.prototype.canRender=function(e){return Ko(e,"bpmn:BaseElement")},Xa.prototype.drawShape=function(e,t){var n=t.type,i=this._renderer(n);return i(e,t)},Xa.prototype.drawConnection=function(e,t){var n=t.type,i=this._renderer(n);return i(e,t)},Xa.prototype.getShapePath=function(e){return Ko(e,"bpmn:Event")?za(e):Ko(e,"bpmn:Activity")?$a(e,Wa):Ko(e,"bpmn:Gateway")?Ha(e):Ga(e)};var Za=0,Ja={width:150,height:50};function Qa(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function es(e){return m(e)?W({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}function ts(e,t){var n;t.textContent=e;try{var i,r=""===e;return t.textContent=r?"dummy":e,n=t.getBBox(),i={width:n.width+2*n.x,height:n.height},r&&(i.width=0),i}catch(o){return{width:0,height:0}}}function ns(e,t,n){for(var i,r=e.shift(),o=r;;){if(i=ts(o,n),i.width=o?i.width:0," "===o||""===o||i.width<Math.round(t)||o.length<2)return is(e,o,r,i);o=as(o,i.width,t)}}function is(e,t,n,i){if(t.length<n.length){var r=n.slice(t.length).trim();e.unshift(r)}return{width:i.width,height:i.height,text:t}}var rs="";function os(e,t){var n,i=e.split(/(\s|-|\u00AD)/g),r=[],o=0;if(i.length>1)while(n=i.shift()){if(!(n.length+o<t)){"-"!==n&&n!==rs||r.pop();break}r.push(n),o+=n.length}var a=r[r.length-1];return a&&a===rs&&(r[r.length-1]="-"),r.join("")}function as(e,t,n){var i=Math.max(e.length*(n/t),1),r=os(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function ss(){var e=document.getElementById("helper-svg");return e||(e=nt("svg"),He(e,{id:"helper-svg"}),ne(e,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(e)),e}function cs(e){this._config=W({},{size:Ja,padding:Za,style:{},align:"center-top"},e||{})}function us(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}cs.prototype.createText=function(e,t){return this.layoutText(e,t).element},cs.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},cs.prototype.layoutText=function(e,t){var n=W({},this._config.size,t.box),i=W({},this._config.style,t.style),r=Qa(t.align||this._config.align),o=es(void 0!==t.padding?t.padding:this._config.padding),a=t.fitBox||!1,s=us(i),c=e.split(/\u00AD?\r?\n/),u=[],l=n.width-o.left-o.right,p=nt("text");He(p,{x:0,y:0}),He(p,i);var d=ss();Ne(d,p);while(c.length)u.push(ns(c,l,p));"middle"===r.vertical&&(o.top=o.bottom=0);var f=A(u,(function(e,t,n){return e+(s||t.height)}),0)+o.top+o.bottom,h=A(u,(function(e,t,n){return t.width>e?t.width:e}),0),m=o.top;"middle"===r.vertical&&(m+=(n.height-f)/2),m-=(s||u[0].height)/4;var v=nt("text");He(v,i),C(u,(function(e){var t;switch(m+=s||e.height,r.horizontal){case"left":t=o.left;break;case"right":t=(a?h:l)-o.right-e.width;break;default:t=Math.max(((a?h:l)-e.width)/2+o.left,0)}var n=nt("tspan");He(n,{x:t,y:m}),n.textContent=e.text,Ne(v,n)})),Ye(p);var g={width:h,height:f};return{dimensions:g,element:v}};var ls=12,ps=1.2,ds=30;function fs(e){var t=W({fontFamily:"Arial, sans-serif",fontSize:ls,fontWeight:"normal",lineHeight:ps},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=W({},t,{fontSize:n},e&&e.externalStyle||{}),r=new cs({style:t});this.getExternalLabelBounds=function(e,t){var n=r.getDimensions(t,{box:{width:90,height:30,x:e.width/2+e.x,y:e.height/2+e.y},style:i});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 i=r.getDimensions(n,{box:e,style:t,align:"left-top",padding:5});return{x:e.x,y:e.y,width:e.width,height:Math.max(ds,Math.round(i.height))}},this.createText=function(e,t){return r.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}function hs(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var o={};if(t.position){for(var a=t.containerHeight/r.height*t.yScaleFactor,s=t.containerWidth/r.width*t.xScaleFactor,c=0;c<r.heightElements.length;c++)o["y"+c]=r.heightElements[c]*a;for(var u=0;u<r.widthElements.length;u++)o["x"+u]=r.widthElements[u]*s}var l=ys(r.d,{mx:n,my:i,e:o});return l}}fs.$inject=["config.textRenderer"];var ms=/\{([^{}]+)\}/g,vs=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;function gs(e,t,n){var i=n;return t.replace(vs,(function(e,t,n,r,o){t=t||r,i&&(t in i&&(i=i[t]),"function"==typeof i&&o&&(i=i()))})),i=(null==i||i==n?e:i)+"",i}function ys(e,t){return String(e).replace(ms,(function(e,n){return gs(e,n,t)}))}var bs={__init__:["bpmnRenderer"],bpmnRenderer:["type",Xa],textRenderer:["type",fs],pathMap:["type",hs]};function xs(e,t){return t=t||{},e.replace(/{([^}]+)}/g,(function(e,n){return t[n]||"{"+n+"}"}))}var ws={translate:["value",xs]},_s={width:90,height:20},Es=15;function Cs(e){return Ko(e,"bpmn:Event")||Ko(e,"bpmn:Gateway")||Ko(e,"bpmn:DataStoreReference")||Ko(e,"bpmn:DataObjectReference")||Ko(e,"bpmn:DataInput")||Ko(e,"bpmn:DataOutput")||Ko(e,"bpmn:SequenceFlow")||Ko(e,"bpmn:MessageFlow")||Ko(e,"bpmn:Group")}function Ss(e){return Ps(e.label)}function As(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)],r=Ts(e),o=Math.atan((i.y-n.y)/(i.x-n.x)),a=r.x,s=r.y;return Math.abs(o)<Math.PI/2?s-=Es:a+=Es,{x:a,y:s}}function Ts(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)];return{x:n.x+(i.x-n.x)/2,y:n.y+(i.y-n.y)/2}}function ks(e){return e.waypoints?As(e.waypoints):Ko(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+_s.height/2}:{x:e.x+e.width/2,y:e.y+e.height+_s.height/2}}function Rs(e,t){var n,i,r,o=e.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(_s.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=ks(t),i=_s),W({x:n.x-i.width/2,y:n.y-i.height/2},i)}function Ps(e){return e&&!!e.labelTarget}function Ds(e,t,n){return W({id:e.id,type:e.$type,businessObject:e,di:t},n)}function Ms(e,t,n){var i=e.waypoint;return!i||i.length<2?[xn(t),xn(n)]:i.map((function(e){return{x:e.x,y:e.y}}))}function Bs(e,t,n,i){return new Error(e("element {element} referenced by {referenced}#{property} not yet drawn",{element:$o(n),referenced:$o(t),property:i}))}function Os(e,t,n,i,r,o){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textRenderer=o}function js(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function Ns(e){return Ko(e,"bpmn:Group")}Os.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate","textRenderer"],Os.prototype.add=function(e,t,n){var i,r,o,a=this._translate;if(Ko(t,"bpmndi:BPMNPlane")){var s=Ko(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};i=this._elementFactory.createRoot(Ds(e,t,s)),this._canvas.addRootElement(i)}else if(Ko(t,"bpmndi:BPMNShape")){var c=!wa(e,t),u=Ns(e);r=n&&(n.hidden||n.collapsed);var l=t.bounds;i=this._elementFactory.createShape(Ds(e,t,{collapsed:c,hidden:r,x:Math.round(l.x),y:Math.round(l.y),width:Math.round(l.width),height:Math.round(l.height),isFrame:u})),Ko(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,i),Ko(e,"bpmn:Lane")&&(o=0),Ko(e,"bpmn:DataStoreReference")&&(js(n,xn(l))||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else{if(!Ko(t,"bpmndi:BPMNEdge"))throw new Error(a("unknown di {di} for element {semantic}",{di:$o(t),semantic:$o(e)}));var p=this._getSource(e),d=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(Ds(e,t,{hidden:r,source:p,target:d,waypoints:Ms(t,p,d)})),Ko(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}return Cs(e)&&Pa(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},Os.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:$o(e)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw Bs(n,e,i,"attachedToRef");t.host=r,o||(r.attachers=o=[]),-1===o.indexOf(t)&&o.push(t)},Os.prototype.addLabel=function(e,t,n){var i,r,o;return i=Rs(t,n),r=Pa(n),r&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(Ds(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!Pa(n),x:Math.round(i.x),y:Math.round(i.y),width:Math.round(i.width),height:Math.round(i.height)})),this._canvas.addShape(o,n.parent)},Os.prototype._getEnd=function(e,t){var n,i,r=e.$type,o=this._translate;if(i=e[t+"Ref"],"source"===t&&"bpmn:DataInputAssociation"===r&&(i=i&&i[0]),("source"===t&&"bpmn:DataOutputAssociation"===r||"target"===t&&"bpmn:DataInputAssociation"===r)&&(i=e.$parent),n=i&&this._getElement(i),n)return n;throw i?Bs(o,e,i,t+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:$o(e),side:t}))},Os.prototype._getSource=function(e){return this._getEnd(e,"source")},Os.prototype._getTarget=function(e){return this._getEnd(e,"target")},Os.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var Fs={__depends__:[ws],bpmnImporter:["type",Os]},Is={__depends__:[bs,Fs]};function Ls(e){e&&"function"===typeof e.stopPropagation&&e.stopPropagation()}function zs(e){return e.originalEvent||e.srcEvent}function $s(e,t){Ls(e,t),Ls(zs(e),t)}function Hs(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function Gs(){return/mac/i.test(navigator.platform)}function Vs(e,t){return(zs(e)||e).button===t}function Ws(e){return Vs(e,0)}function Us(e){return Vs(e,1)}function qs(e){var t=zs(e)||e;return!!Ws(e)&&(Gs()?t.metaKey:t.ctrlKey)}function Ks(e){var t=zs(e)||e;return Ws(e)&&t.shiftKey}function Ys(e){return!0}function Xs(e){return Ws(e)||Us(e)}var Zs=500;function Js(e,t,n){var i=this;function r(n,i,r){var o,a,c;s(n,i)||(r?a=t.getGraphics(r):(o=i.delegateTarget||i.target,o&&(a=o,r=t.get(a))),a&&r&&(c=e.fire(n,{element:r,gfx:a,originalEvent:i}),!1===c&&(i.stopPropagation(),i.preventDefault())))}var o={};function a(e){return o[e]}function s(e,t){var n=u[e]||Ws;return!n(t)}var c={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},u={"element.contextmenu":Ys,"element.mousedown":Xs,"element.mouseup":Xs,"element.click":Xs,"element.dblclick":Xs};function l(e,t,n){var i=c[e];if(!i)throw new Error("unmapped DOM event name <"+e+">");return r(i,t,n)}var p="svg, .djs-element";function d(e,t,n,i){var a=o[n]=function(e){r(n,e)};i&&(u[n]=i),a.$delegate=Ae.bind(e,p,t,a)}function f(e,t,n){var i=a(n);i&&Ae.unbind(e,t,i.$delegate)}function h(e){C(c,(function(t,n){d(e,n,t)}))}function m(e){C(c,(function(t,n){f(e,n,t)}))}e.on("canvas.destroy",(function(e){m(e.svg)})),e.on("canvas.init",(function(e){h(e.svg)})),e.on(["shape.added","connection.added"],(function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.createHit",{element:n,gfx:i})})),e.on(["shape.changed","connection.changed"],Zs,(function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.updateHit",{element:n,gfx:i})})),e.on("interactionEvents.createHit",Zs,(function(e){var t=e.element,n=e.gfx;i.createDefaultHit(t,n)})),e.on("interactionEvents.updateHit",(function(e){var t=e.element,n=e.gfx;i.updateDefaultHit(t,n)}));var v=w("djs-hit djs-hit-stroke"),g=w("djs-hit djs-hit-click-stroke"),y=w("djs-hit djs-hit-all"),b=w("djs-hit djs-hit-no-move"),x={all:y,"click-stroke":g,stroke:v,"no-move":b};function w(e,t){return t=W({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function _(e,t){var n=x[t];if(!n)throw new Error("invalid hit type <"+t+">");return He(e,n),e}function E(e,t){Ne(e,t)}this.removeHits=function(e){var t=Me(".djs-hit",e);C(t,Ye)},this.createDefaultHit=function(e,t){var n,i=e.waypoints,r=e.isFrame;return i?this.createWaypointsHit(t,i):(n=r?"stroke":"all",this.createBoxHit(t,n,{width:e.width,height:e.height}))},this.createWaypointsHit=function(e,t){var n=Nt(t);return _(n,"stroke"),E(e,n),n},this.createBoxHit=function(e,t,n){n=W({x:0,y:0},n);var i=nt("rect");return _(i,t),He(i,n),E(e,i),i},this.updateDefaultHit=function(e,t){var n=De(".djs-hit",t);if(n)return e.waypoints?Ft(n,e.waypoints):He(n,{width:e.width,height:e.height}),n},this.fire=r,this.triggerMouseEvent=l,this.mouseHandler=a,this.registerEvent=d,this.unregisterEvent=f}Js.$inject=["eventBus","elementRegistry","styles"];var Qs={__init__:["interactionEvents"],interactionEvents:["type",Js]},ec=500;function tc(e,t,n){this.offset=6;var i=t.cls("djs-outline",["no-fill"]),r=this;function o(e,t){var n=nt("rect");return He(n,W({x:10,y:10,rx:3,width:100,height:100},i)),Ne(e,n),n}e.on(["shape.added","shape.changed"],ec,(function(e){var t=e.element,n=e.gfx,i=De(".djs-outline",n);i||(i=o(n,t)),r.updateShapeOutline(i,t)})),e.on(["connection.added","connection.changed"],(function(e){var t=e.element,n=e.gfx,i=De(".djs-outline",n);i||(i=o(n,t)),r.updateConnectionOutline(i,t)}))}tc.prototype.updateShapeOutline=function(e,t){He(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},tc.prototype.updateConnectionOutline=function(e,t){var n=Wt(t);He(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},tc.$inject=["eventBus","styles","elementRegistry"];var nc={__init__:["outline"],outline:["type",tc]};function ic(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)}))}ic.$inject=["eventBus","canvas"],ic.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(-1!==n){var i=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})}},ic.prototype.get=function(){return this._selectedElements},ic.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},ic.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();h(e)||(e=e?[e]:[]);var r=this._canvas,o=r.getRootElement();e=e.filter((function(e){var t=r.findRoot(e);return o===t})),t?C(e,(function(e){-1===n.indexOf(e)&&n.push(e)})):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var rc="hover",oc="selected",ac=6;function sc(e,t,n){this._canvas=e;var i=this;function r(t,n){e.addMarker(t,n)}function o(t,n){e.removeMarker(t,n)}this._multiSelectionBox=null,t.on("element.hover",(function(e){r(e.element,rc)})),t.on("element.out",(function(e){o(e.element,rc)})),t.on("selection.changed",(function(e){function t(e){o(e,oc)}function n(e){r(e,oc)}var a=e.oldSelection,s=e.newSelection;C(a,(function(e){-1===s.indexOf(e)&&t(e)})),C(s,(function(e){-1===a.indexOf(e)&&n(e)})),i._updateSelectionOutline(s)})),t.on("element.changed",(function(e){n.isSelected(e.element)&&i._updateSelectionOutline(n.get())}))}function cc(e){return{x:e.x-ac,y:e.y-ac,width:e.width+2*ac,height:e.height+2*ac}}function uc(e,t,n,i){e.on("create.end",500,(function(e){var n=e.context,i=n.canExecute,r=n.elements,o=n.hints||{},a=o.autoSelect;if(i){if(!1===a)return;h(a)?t.select(a):t.select(r.filter(lc))}})),e.on("connect.end",500,(function(e){var n=e.context,i=n.connection;i&&t.select(i)})),e.on("shape.move.end",500,(function(e){var n=e.previousSelection||[],r=i.get(e.context.shape.id),o=w(n,(function(e){return r.id===e.id}));o||t.select(r)})),e.on("element.click",(function(e){if(Ws(e)){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),o=t.get().length>1,a=qs(e)||Ks(e);if(r&&o)return a?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,a)}}))}function lc(e){return!e.hidden}sc.$inject=["canvas","eventBus","selection"],sc.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");Xe(t);var n=e.length>1,i=this._canvas.getContainer();if(qe(i)[n?"add":"remove"]("djs-multi-select"),n){var r=cc(Wt(e)),o=nt("rect");He(o,W({rx:3},r)),qe(o).add("djs-selection-outline"),Ne(t,o)}},uc.$inject=["eventBus","selection","canvas","elementRegistry"];var pc={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Qs,nc],selection:["type",ic],selectionVisuals:["type",sc],selectionBehavior:["type",uc]};function dc(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}dc.prototype.next=function(){return this._prefix+ ++this._counter};var fc=new dc("ov"),hc=500;function mc(e,t,n,i){this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=fc,this._overlayDefaults=W({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=vc(n.getContainer()),this._init()}function vc(e){var t=Te('<div class="djs-overlay-container" />');return ne(t,{position:"absolute",width:0,height:0}),e.insertBefore(t,e.firstChild),t}function gc(e,t,n){ne(e,{left:t+"px",top:n+"px"})}function yc(e,t){e.style.display=!1===t?"none":""}function bc(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}mc.$inject=["config.overlays","eventBus","canvas","elementRegistry"],mc.prototype.get=function(e){if(y(e)&&(e={id:e}),y(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?E(t.overlays,F({type:e.type})):t.overlays.slice():[]}return e.type?E(this._overlays,F({type:e.type})):e.id?this._overlays[e.id]:null},mc.prototype.add=function(e,t,n){if(m(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 i=this._ids.next();return n=W({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},mc.prototype.remove=function(e){var t=this.get(e)||[];h(t)||(t=[t]);var n=this;C(t,(function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(Be(e.html),Be(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var i=t.overlays.indexOf(e);-1!==i&&t.overlays.splice(i,1)}}))},mc.prototype.show=function(){yc(this._overlayRoot)},mc.prototype.hide=function(){yc(this._overlayRoot,!1)},mc.prototype.clear=function(){this._overlays={},this._overlayContainers=[],le(this._overlayRoot)},mc.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=Wt(t);i=o.x,r=o.y}gc(n,i,r),ie(e.html,"data-container-id",t.id)},mc.prototype._updateOverlay=function(e){var t,n,i=e.position,r=e.htmlContainer,o=e.element,a=i.left,s=i.top;void 0!==i.right&&(t=o.waypoints?Wt(o).width:o.width,a=-1*i.right+t);void 0!==i.bottom&&(n=o.waypoints?Wt(o).height:o.height,s=-1*i.bottom+n);gc(r,a||0,s||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},mc.prototype._createOverlayContainer=function(e){var t=Te('<div class="djs-overlays" />');ne(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},mc.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";bc(this._overlayRoot,n)},mc.prototype._getOverlayContainer=function(e,t){var n=w(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},mc.prototype._addOverlay=function(e){var t,n,i=e.id,r=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),y(o)&&(o=Te(o)),n=this._getOverlayContainer(r),t=Te('<div class="djs-overlay" data-overlay-id="'+i+'">'),ne(t,{position:"absolute"}),t.appendChild(o),e.type&&ce(t).add("djs-overlay-"+e.type);var a=this._canvas.findRoot(r),s=this._canvas.getRootElement();yc(t,a===s),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[i]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},mc.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),r=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,s=this._canvas.getRootElement(),c=!0;(i!==s||n&&(d(r)&&r>t.scale||d(o)&&o<t.scale))&&(c=!1),yc(a,c),this._updateOverlayScale(e,t)},mc.prototype._updateOverlayScale=function(e,t){var n,i,r,o=e.scale,a=e.htmlContainer,s="";!0!==o&&(!1===o?(n=1,i=1):(n=o.min,i=o.max),d(n)&&t.scale<n&&(r=(1/t.scale||1)*n),d(i)&&t.scale>i&&(r=(1/t.scale||1)*i)),d(r)&&(s="scale("+r+","+r+")"),bc(a,s)},mc.prototype._updateOverlaysVisibilty=function(e){var t=this;C(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},mc.prototype._init=function(){var e=this._eventBus,t=this;function n(e){t._updateRoot(e),t._updateOverlaysVisibilty(e),t.show()}e.on("canvas.viewbox.changing",(function(e){t.hide()})),e.on("canvas.viewbox.changed",(function(e){n(e.viewbox)})),e.on(["shape.remove","connection.remove"],(function(e){var n=e.element,i=t.get({element:n});C(i,(function(e){t.remove(e.id)}));var r=t._getOverlayContainer(n);if(r){Be(r.html);var o=t._overlayContainers.indexOf(r);-1!==o&&t._overlayContainers.splice(o,1)}})),e.on("element.changed",hc,(function(e){var n=e.element,i=t._getOverlayContainer(n,!0);i&&(C(i.overlays,(function(e){t._updateOverlay(e)})),t._updateOverlayContainer(i))})),e.on("element.marker.update",(function(e){var n=t._getOverlayContainer(e.element,!0);n&&ce(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 xc={__init__:["overlays"],overlays:["type",mc]};function wc(e,t,n,i){e.on("element.changed",(function(i){var r=i.element;(r.parent||r===t.getRootElement())&&(i.gfx=n.getGraphics(r)),i.gfx&&e.fire(qt(r)+".changed",i)})),e.on("elements.changed",(function(t){var n=t.elements;n.forEach((function(t){e.fire("element.changed",{element:t})})),i.updateContainments(n)})),e.on("shape.changed",(function(e){i.update("shape",e.element,e.gfx)})),e.on("connection.changed",(function(e){i.update("connection",e.element,e.gfx)}))}wc.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var _c={__init__:["changeSupport"],changeSupport:["type",wc]},Ec=1e3;function Cc(e){this._eventBus=e}function Sc(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}Cc.$inject=["eventBus"],Cc.prototype.on=function(e,t,n,i,r,o){if((g(t)||v(t))&&(o=r,r=i,i=n,n=t,t=null),g(n)&&(o=r,r=i,i=n,n=Ec),m(r)&&(o=r,r=!1),!g(i))throw new Error("handlerFn must be a function");h(e)||(e=[e]);var a=this._eventBus;C(e,(function(e){var s=["commandStack",e,t].filter((function(e){return e})).join(".");a.on(s,n,r?Sc(i,o):i,o)}))};var Ac=["canExecute","preExecute","preExecuted","execute","executed","postExecute","postExecuted","revert","reverted"];function Tc(e,t){t.invoke(Cc,this),this.executed((function(t){var n=t.context;n.rootElement?e.setRootElement(n.rootElement):n.rootElement=e.getRootElement()})),this.revert((function(t){var n=t.context;n.rootElement&&e.setRootElement(n.rootElement)}))}C(Ac,(function(e){Cc.prototype[e]=function(t,n,i,r,o){(g(t)||v(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}})),i(Tc,Cc),Tc.$inject=["canvas","injector"];var kc={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",Tc]},Rc=n("e7a5"),Pc=n.n(Rc),Dc={"&":"&","<":"<",">":">",'"':""","'":"'"};function Mc(e){return e=""+e,e&&e.replace(/[&<>"']/g,(function(e){return Dc[e]}))}var Bc="_plane";function Oc(e){var t=e.id;return Lc(t)}function jc(e){var t=e.id;return Ko(e,"bpmn:SubProcess")?Ic(t):t}function Nc(e){return Ic(e)}function Fc(e){var t=Zo(e);return Ko(t,"bpmndi:BPMNPlane")}function Ic(e){return e+Bc}function Lc(e){return e.replace(new RegExp(Bc+"$"),"")}var zc="bjs-breadcrumbs-shown";function $c(e,t,n,i){var r=Te('<ul class="bjs-breadcrumbs"></ul>'),o=i.getContainer(),a=ce(o);o.appendChild(r);var s=[];function c(e){e&&(s=Hc(e));var n=s.map((function(e){var n=Mc(e.name||e.id),r=Te('<li><span class="bjs-crumb"><a title="'+n+'">'+n+"</a></span></li>"),o=i.findRoot(jc(e))||i.findRoot(e.id);if(!o&&Ko(e,"bpmn:Process")){var a=t.find((function(t){var n=Xo(t);return n&&n.processRef&&n.processRef===e}));o=i.findRoot(a.id)}return r.addEventListener("click",(function(){i.setRootElement(o)})),r}));r.innerHTML="";var o=n.length>1;a.toggle(zc,o),n.forEach((function(e){r.appendChild(e)}))}e.on("element.changed",(function(e){var t=e.element,n=Xo(t),i=w(s,(function(e){return e===n}));i&&c()})),e.on("root.set",(function(e){c(e.element)}))}function Hc(e){for(var t=Xo(e),n=[],i=t;i;i=i.$parent)(Ko(i,"bpmn:SubProcess")||Ko(i,"bpmn:Process"))&&n.push(i);return n.reverse()}function Gc(e,t){var n=null,i=new Vc;e.on("root.set",(function(e){var r=e.element,o=t.viewbox(),a=i.get(r);if(i.set(n,{x:o.x,y:o.y,zoom:o.scale}),n=r,!Ko(r,"bpmn:Collaboration")||a){a=a||{x:0,y:0,zoom:1};var s=(o.x-a.x)*o.scale,c=(o.y-a.y)*o.scale;0===s&&0===c||t.scroll({dx:s,dy:c}),a.zoom!==o.scale&&t.zoom(a.zoom,{x:0,y:0})}})),e.on("diagram.clear",(function(){i.clear(),n=null}))}function Vc(){this._entries=[],this.set=function(e,t){var n=!1;for(var i in this._entries)if(this._entries[i][0]===e){this._entries[i][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}-1!==t&&this._entries.splice(t,1)}}$c.$inject=["eventBus","elementRegistry","overlays","canvas"],Gc.$inject=["eventBus","canvas"];var Wc={x:180,y:160};function Uc(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,(function(e,t){n.handleImport(t.definitions)}))}function qc(e){return Ko(e,"bpmndi:BPMNDiagram")?e:qc(e.$parent)}function Kc(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach((function(e){if(e.bounds){var n=vn(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}})),gn(t)}function Yc(e,t){var n=e.$parent;return!(!Ko(n,"bpmn:SubProcess")||n===t.bpmnElement)&&!Yo(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"])}Uc.prototype.handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach((function(e){e.plane&&e.plane.bpmnElement&&(t._processToDiagramMap[e.plane.bpmnElement.id]=e)}));var n=[];e.diagrams.forEach((function(e){var i=t.createNewDiagrams(e.plane);Array.prototype.push.apply(n,i)})),n.forEach((function(e){t.movePlaneElementsToOrigin(e.plane)}))}},Uc.prototype.createNewDiagrams=function(e){var t=this,n=[],i=[];e.get("planeElement").forEach((function(t){var r=t.bpmnElement;if(r){var o=r.$parent;Ko(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),Yc(r,e)&&i.push({diElement:t,parent:o})}}));var r=[];return n.forEach((function(e){if(!t._processToDiagramMap[e.id]){var n=t.createDiagram(e);t._processToDiagramMap[e.id]=n,r.push(n)}})),i.forEach((function(e){var i=e.diElement,r=e.parent;while(r&&-1===n.indexOf(r))r=r.$parent;if(r){var o=t._processToDiagramMap[r.id];t.moveToDiPlane(i,o.plane)}})),r},Uc.prototype.movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=Kc(e),i={x:n.x-Wc.x,y:n.y-Wc.y};t.forEach((function(e){e.waypoint?e.waypoint.forEach((function(e){e.x=e.x-i.x,e.y=e.y-i.y})):e.bounds&&(e.bounds.x=e.bounds.x-i.x,e.bounds.y=e.bounds.y-i.y)}))},Uc.prototype.moveToDiPlane=function(e,t){var n=qc(e),i=n.plane.get("planeElement");i.splice(i.indexOf(e),1),t.get("planeElement").push(e)},Uc.prototype.createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n},Uc.$inject=["eventBus","moddle"];var Xc=250,Zc='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg>',Jc="bjs-drilldown-empty";function Qc(e,t,n,i){Cc.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i;var r=this;this.executed("shape.toggleCollapse",Xc,(function(e){var t=e.shape;r.canDrillDown(t)?r.addOverlay(t):r.removeOverlay(t)}),!0),this.reverted("shape.toggleCollapse",Xc,(function(e){var t=e.shape;r.canDrillDown(t)?r.addOverlay(t):r.removeOverlay(t)}),!0),this.executed(["shape.create","shape.move","shape.delete"],Xc,(function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;r.canDrillDown(i)&&r.addOverlay(i),r.updateDrilldownOverlay(t),r.updateDrilldownOverlay(n),r.updateDrilldownOverlay(i)}),!0),this.reverted(["shape.create","shape.move","shape.delete"],Xc,(function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;r.canDrillDown(i)&&r.addOverlay(i),r.updateDrilldownOverlay(t),r.updateDrilldownOverlay(n),r.updateDrilldownOverlay(i)}),!0),t.on("import.render.complete",(function(){n.filter((function(e){return r.canDrillDown(e)})).map((function(e){r.addOverlay(e)}))}))}i(Qc,Cc),Qc.prototype.updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this.updateOverlayVisibility(n)}},Qc.prototype.canDrillDown=function(e){var t=this._canvas;return Ko(e,"bpmn:SubProcess")&&t.findRoot(jc(e))},Qc.prototype.updateOverlayVisibility=function(e){var t=this._overlays,n=e.businessObject,i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.flowElements&&n.flowElements.length;ce(i.html).toggle(Jc,!r)}},Qc.prototype.addOverlay=function(e){var t=this._canvas,n=this._overlays,i=n.get({element:e,type:"drilldown"});i.length&&this.removeOverlay(e);var r=Te('<button class="bjs-drilldown">'+Zc+"</button>");r.addEventListener("click",(function(){t.setRootElement(t.findRoot(jc(e)))})),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:r}),this.updateOverlayVisibility(e)},Qc.prototype.removeOverlay=function(e){var t=this._overlays;t.remove({element:e,type:"drilldown"})},Qc.$inject=["canvas","eventBus","elementRegistry","overlays"];var eu={__depends__:[xc,_c,kc],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",$c],drilldownCentering:["type",Gc],drilldownOverlayBehavior:["type",Qc],subprocessCompatibility:["type",Uc]};function tu(e){fa.call(this,e)}i(tu,fa),tu.prototype._modules=[Is,ws,pc,xc,eu],tu.prototype._moddleExtensions={};var nu=67,iu=86,ru=89,ou=90,au=["c","C",nu],su=["v","V",iu],cu=["y","Y",ru],uu=["z","Z",ou];function lu(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function pu(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function du(e,t){return e=h(e)?e:[e],-1!==e.indexOf(t.key)||-1!==e.indexOf(t.keyCode)}function fu(e){return e.shiftKey}function hu(e){return pu(e)&&du(au,e)}function mu(e){return pu(e)&&du(su,e)}function vu(e){return pu(e)&&!fu(e)&&du(uu,e)}function gu(e){return pu(e)&&(du(cu,e)||du(uu,e)&&fu(e))}var yu="keyboard.keydown",bu="keyboard.keyup",xu="input-handle-modified-keys",wu=1e3;function _u(e,t){var n=this;this._config=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",(function(){n._fire("destroy"),n.unbind()})),t.on("diagram.init",(function(){n._fire("init")})),t.on("attach",(function(){e&&e.bindTo&&n.bind(e.bindTo)})),t.on("detach",(function(){n.unbind()}))}function Eu(e){return e&&(fe(e,"input, textarea")||"true"===e.contentEditable)}_u.$inject=["config.keyboard","eventBus"],_u.prototype._keydownHandler=function(e){this._keyHandler(e,yu)},_u.prototype._keyupHandler=function(e){this._keyHandler(e,bu)},_u.prototype._keyHandler=function(e,t){var n;if(!this._isEventIgnored(e)){var i={keyEvent:e};n=this._eventBus.fire(t||yu,i),n&&e.preventDefault()}},_u.prototype._isEventIgnored=function(e){return Eu(e.target)&&this._isModifiedKeyIgnored(e)},_u.prototype._isModifiedKeyIgnored=function(e){if(!pu(e))return!0;var t=this._getAllowedModifiers(e.target);return-1===t.indexOf(e.key)},_u.prototype._getAllowedModifiers=function(e){var t=me(e,"["+xu+"]",!0);return!t||this._node&&!this._node.contains(t)?[]:t.getAttribute(xu).split(",")},_u.prototype.bind=function(e){this.unbind(),this._node=e,we.bind(e,"keydown",this._keydownHandler,!0),we.bind(e,"keyup",this._keyupHandler,!0),this._fire("bind")},_u.prototype.getBinding=function(){return this._node},_u.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),we.unbind(e,"keydown",this._keydownHandler,!0),we.unbind(e,"keyup",this._keyupHandler,!0)),this._node=null},_u.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},_u.prototype.addListener=function(e,t,n){g(e)&&(n=t,t=e,e=wu),this._eventBus.on(n||yu,e,t)},_u.prototype.removeListener=function(e,t){this._eventBus.off(t||yu,e)},_u.prototype.hasModifier=lu,_u.prototype.isCmd=pu,_u.prototype.isShift=fu,_u.prototype.isKey=du;var Cu=500;function Su(e,t){var n=this;e.on("editorActions.init",Cu,(function(e){var i=e.editorActions;n.registerBindings(t,i)}))}Su.$inject=["eventBus","keyboard"],Su.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}n("undo",(function(e){var n=e.keyEvent;if(vu(n))return t.trigger("undo"),!0})),n("redo",(function(e){var n=e.keyEvent;if(gu(n))return t.trigger("redo"),!0})),n("copy",(function(e){var n=e.keyEvent;if(hu(n))return t.trigger("copy"),!0})),n("paste",(function(e){var n=e.keyEvent;if(mu(n))return t.trigger("paste"),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(du(["+","Add","="],n)&&pu(n))return t.trigger("stepZoom",{value:1}),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(du(["-","Subtract"],n)&&pu(n))return t.trigger("stepZoom",{value:-1}),!0})),n("zoom",(function(e){var n=e.keyEvent;if(du("0",n)&&pu(n))return t.trigger("zoom",{value:1}),!0})),n("removeSelection",(function(e){var n=e.keyEvent;if(du(["Backspace","Delete","Del"],n))return t.trigger("removeSelection"),!0}))};var Au={__init__:["keyboard","keyboardBindings"],keyboard:["type",_u],keyboardBindings:["type",Su]},Tu={moveSpeed:50,moveSpeedAccelerated:200};function ku(e,t,n){var i=this;function r(e){var n=e.keyEvent,r=i._config;if(t.isCmd(n)&&t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],n)){var o,a=t.isShift(n)?r.moveSpeedAccelerated:r.moveSpeed;switch(n.key){case"ArrowLeft":case"Left":o="left";break;case"ArrowUp":case"Up":o="up";break;case"ArrowRight":case"Right":o="right";break;case"ArrowDown":case"Down":o="down";break}return i.moveCanvas({speed:a,direction:o}),!0}}this._config=W({},Tu,e||{}),t.addListener(r),this.moveCanvas=function(e){var t=0,i=0,r=e.speed,o=r/Math.min(Math.sqrt(n.viewbox().scale),1);switch(e.direction){case"left":t=o;break;case"up":i=o;break;case"right":t=-o;break;case"down":i=-o;break}n.scroll({dx:t,dy:i})}}ku.$inject=["config.keyboardMove","keyboard","canvas"];var Ru={__depends__:[Au],__init__:["keyboardMove"],keyboardMove:["type",ku]},Pu=/^djs-cursor-.*$/;function Du(e){var t=ce(document.body);t.removeMatching(Pu),e&&t.add("djs-cursor-"+e)}function Mu(){Du(null)}var Bu=5e3;function Ou(e,t){function n(){return!1}return t=t||"element.click",e.once(t,Bu,n),function(){e.off(t,n)}}function ju(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Nu(e,t){return{x:e.x-t.x,y:e.y-t.y}}var Fu=15;function Iu(e,t){var n;function i(i){var r=n.start,o=n.button,a=Hs(i),s=Nu(a,r);if(!n.dragging&&Lu(s)>Fu&&(n.dragging=!0,0===o&&Ou(e),Du("grab")),n.dragging){var c=n.last||n.start;s=Nu(a,c),t.scroll({dx:s.x,dy:s.y}),n.last=a}i.preventDefault()}function r(e){we.unbind(document,"mousemove",i),we.unbind(document,"mouseup",r),n=null,Mu()}function o(e){if(!me(e.target,".djs-draggable")){var t=e.button;if(!(t>=2||e.ctrlKey||e.shiftKey||e.altKey))return n={button:t,start:Hs(e)},we.bind(document,"mousemove",i),we.bind(document,"mouseup",r),!0}}e.on("element.mousedown",500,(function(e){return o(e.originalEvent)})),this.isActive=function(){return!!n}}function Lu(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}Iu.$inject=["eventBus","canvas"];var zu={__init__:["moveCanvas"],moveCanvas:["type",Iu]};function $u(e){return Math.log(e)/Math.log(10)}function Hu(e,t){var n=$u(e.min),i=$u(e.max),r=Math.abs(n)+Math.abs(i);return r/t}function Gu(e,t){return Math.max(e.min,Math.min(e.max,t))}var Vu=Math.sign||function(e){return e>=0?1:-1},Wu={min:.2,max:4},Uu=10,qu=.1,Ku=.75;function Yu(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=G(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||Ku;var i=this;t.on("canvas.init",(function(t){i._init(!1!==e.enabled)}))}Yu.$inject=["config.zoomScroll","eventBus","canvas"],Yu.prototype.scroll=function(e){this._canvas.scroll(e)},Yu.prototype.reset=function(){this._canvas.zoom("fit-viewport")},Yu.prototype.zoom=function(e,t){var n=Hu(Wu,2*Uu);this._totalDelta+=e,Math.abs(this._totalDelta)>qu&&(this._zoom(e,t,n),this._totalDelta=0)},Yu.prototype._handleWheel=function(e){if(!me(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,i=e.ctrlKey,r=e.shiftKey,o=-1*this._scale;if(o*=i?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,i){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))*Vu(e.deltaY)*o,this.zoom(n,s)}else n=r?{dx:o*e.deltaY,dy:0}:{dx:o*e.deltaX,dy:o*e.deltaY},this.scroll(n)}},Yu.prototype.stepZoom=function(e,t){var n=Hu(Wu,Uu);this._zoom(e,t,n)},Yu.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=$u(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var s=Math.pow(10,a);i.zoom(Gu(Wu,s),t)},Yu.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return"undefined"===typeof e&&(e=!i),i!==e&&we[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},Yu.prototype._init=function(e){this.toggle(e)};var Xu={__init__:["zoomScroll"],zoomScroll:["type",Yu]};function Zu(e){tu.call(this,e)}i(Zu,tu),Zu.prototype._navigationModules=[Ru,zu,Xu],Zu.prototype._modules=[].concat(tu.prototype._modules,Zu.prototype._navigationModules);var Ju=n("c8b5"),Qu=n.n(Ju),el=.2,tl=4,nl=["mousedown","mouseup","mouseover","mouseout","click","dblclick"];function il(){}function rl(e,t){return t.get(e,!1)}function ol(e){e.preventDefault(),"function"===typeof e.stopPropagation?e.stopPropagation():e.srcEvent&&"function"===typeof e.srcEvent.stopPropagation&&e.srcEvent.stopPropagation(),"function"===typeof e.stopImmediatePropagation&&e.stopImmediatePropagation()}function al(e){function t(t){C(nl,(function(t){we.bind(e,t,ol,!0)}))}function n(t){setTimeout((function(){C(nl,(function(t){we.unbind(e,t,ol,!0)}))}),500)}we.bind(e,"touchstart",t,!0),we.bind(e,"touchend",n,!0),we.bind(e,"touchcancel",n,!0);var i=new Qu.a.Manager(e,{inputClass:Qu.a.TouchInput,recognizers:[],domEvents:!0}),r=new Qu.a.Tap,o=new Qu.a.Pan({threshold:10}),a=new Qu.a.Press,s=new Qu.a.Pinch,c=new Qu.a.Tap({event:"doubletap",taps:2});return s.requireFailure(o),s.requireFailure(a),i.add([o,a,s,c,r]),i.reset=function(e){var t=this.recognizers,n=this.session;n.stopped||(il("recognizer","stop"),i.stop(e),setTimeout((function(){var e,i;for(il("recognizer","reset"),e=0;i=t[e];e++)i.reset(),i.state=8;n.curRecognizer=null}),0))},i.on("hammer.input",(function(e){e.srcEvent.defaultPrevented&&i.reset(!0)})),i}function sl(e,t,n,i,r){var o,a=rl("dragging",e),s=rl("move",e),c=rl("contextPad",e),u=rl("palette",e);function l(e,t){return function(n){il("element",e,n);var o=p(n.target),a=o&&i.get(o);return t&&(n.srcEvent.button=t),r.fire(e,n,a)}}function p(e){var t=me(e,"svg, .djs-element",!0);return t}function d(e){function n(e){il("canvas","grab start");var n=0,i=0;function r(e){var r=e.deltaX-n,o=e.deltaY-i;t.scroll({dx:r,dy:o}),n=e.deltaX,i=e.deltaY}function a(e){o.off("panmove",r),o.off("panend",a),o.off("pancancel",a),il("canvas","grab end")}o.on("panmove",r),o.on("panend",a),o.on("pancancel",a)}function r(e){var r=p(e.target),o=r&&i.get(r);if(s&&t.getRootElement()!==o)return il("element","move start",o,e,!0),s.start(e,o,!0);n(e)}function a(e){il("canvas","zoom start");var n=t.zoom(),i=e.center;function r(e){var r=1-(1-e.scale)/1.5,o=Math.max(el,Math.min(tl,r*n));t.zoom(o,i),ol(e)}function a(e){o.off("pinchmove",r),o.off("pinchend",a),o.off("pinchcancel",a),o.reset(!0),il("canvas","zoom end")}o.on("pinchmove",r),o.on("pinchend",a),o.on("pinchcancel",a)}o=al(e),o.on("tap",l("element.click")),o.on("doubletap",l("element.dblclick",1)),o.on("panstart",r),o.on("press",r),o.on("pinchstart",a)}a&&n.on("drag.move",(function(e){var t=e.originalEvent;if(t&&!(t instanceof MouseEvent)){var n=Hs(t),r=document.elementFromPoint(n.x,n.y),o=p(r),s=o&&i.get(o);s!==e.hover&&(e.hover&&a.out(e),s&&(a.hover({element:s,gfx:o}),e.hover=s,e.hoverGfx=o))}})),c&&n.on("contextPad.create",(function(e){var t=e.pad.html,n=al(t);n.on("panstart",(function(e){il("context-pad","panstart",e),c.trigger("dragstart",e,!0)})),n.on("press",(function(e){il("context-pad","press",e),c.trigger("dragstart",e,!0)})),n.on("tap",(function(e){il("context-pad","tap",e),c.trigger("click",e)}))})),u&&n.on("palette.create",(function(e){var t=e.container,n=al(t);n.on("panstart",(function(e){il("palette","panstart",e),u.trigger("dragstart",e,!0)})),n.on("press",(function(e){il("palette","press",e),u.trigger("dragstart",e,!0)})),n.on("tap",(function(e){il("palette","tap",e),u.trigger("click",e)}))})),n.on("canvas.init",(function(e){d(e.svg)}))}function cl(e,t){var n=this;t.on("canvas.init",(function(e){n.addBBoxMarker(e.svg)}))}sl.$inject=["injector","canvas","eventBus","elementRegistry","interactionEvents","touchFix"],cl.$inject=["canvas","eventBus"],cl.prototype.addBBoxMarker=function(e){var t={fill:"none",class:"outer-bound-marker"},n=nt("rect");He(n,{x:-1e4,y:1e4,width:10,height:10}),He(n,t),Ne(e,n);var i=nt("rect");He(i,{x:1e4,y:1e4,width:10,height:10}),He(i,t),Ne(e,i)};var ul={__depends__:[Qs],__init__:["touchInteractionEvents"],touchInteractionEvents:["type",sl],touchFix:["type",cl]},ll={__depends__:[ul]};function pl(e){return e&&e[e.length-1]}function dl(e){return e.y}function fl(e){return e.x}var hl={left:fl,center:fl,right:function(e){return e.x+e.width},top:dl,middle:dl,bottom:function(e){return e.y+e.height}};function ml(e,t){this._modeling=e,this._rules=t}ml.$inject=["modeling","rules"],ml.prototype._getOrientationDetails=function(e){var t=["top","bottom","middle"],n="x",i="width";return-1!==t.indexOf(e)&&(n="y",i="height"),{axis:n,dimension:i}},ml.prototype._isType=function(e,t){return-1!==t.indexOf(e)},ml.prototype._alignmentPosition=function(e,t){var n,i,r,o=this._getOrientationDetails(e),a=o.axis,s=o.dimension,c={},u={},l=!1;function p(e,t){return Math.round((e[a]+t[a]+t[s])/2)}if(this._isType(e,["left","top"]))c[e]=t[0][a];else if(this._isType(e,["right","bottom"]))r=pl(t),c[e]=r[a]+r[s];else if(this._isType(e,["center","middle"])){if(C(t,(function(e){var t=e[a]+Math.round(e[s]/2);u[t]?u[t].elements.push(e):u[t]={elements:[e],center:t}})),n=N(u,(function(e){return e.elements.length>1&&(l=!0),e.elements.length})),l)return c[e]=pl(n).center,c;i=t[0],t=N(t,(function(e){return e[a]+e[s]})),r=pl(t),c[e]=p(i,r)}return c},ml.prototype.trigger=function(e,t){var n,i=this._modeling,r=E(e,(function(e){return!(e.waypoints||e.host||e.labelTarget)}));if(n=this._rules.allowed("elements.align",{elements:r}),h(n)&&(r=n),!(r.length<2)&&n){var o=hl[t],a=N(r,o),s=this._alignmentPosition(t,a);i.alignElements(a,s)}};var vl={__init__:["alignElements"],alignElements:["type",ml]},gl=".entry",yl=1e3,bl=12;function xl(e,t,n,i){this._canvas=e,this._eventBus=n,this._overlays=i;var r=d(t&&t.scale)?t.scale:{min:1,max:1.5};this._overlaysConfig={scale:r},this._current=null,this._init()}function wl(e,t){var n=ce(e);t=h(t)?t:t.split(/\s+/g),t.forEach((function(e){n.add(e)}))}function _l(e,t){return-1!==e.indexOf(t)}xl.$inject=["canvas","config.contextPad","eventBus","overlays"],xl.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",(function(t){var n=t.newSelection,i=n.length?1===n.length?n[0]:n:null;i?e.open(i,!0):e.close()})),this._eventBus.on("elements.changed",(function(t){var n=t.elements,i=e._current;if(i){var r=i.target,o=k(h(r)?r:[r],(function(e){return _l(n,e)}));o&&e.open(r,!0)}}))},xl.prototype.registerProvider=function(e,t){t||(t=e,e=yl),this._eventBus.on("contextPad.getProviders",e,(function(e){e.providers.push(t)}))},xl.prototype.getEntries=function(e){var t=this._getProviders(),n=h(e)?"getMultiElementContextPadEntries":"getContextPadEntries",i={};return C(t,(function(t){if(g(t[n])){var r=t[n](e);g(r)?i=r(i):C(r,(function(e,t){i[t]=e}))}})),i},xl.prototype.trigger=function(e,t,n){var i,r,o,a=this._current.target,s=this._current.entries,c=t.delegateTarget||t.target;if(!c)return t.preventDefault();if(i=s[ie(c,"data-action")],r=i.action,o=t.originalEvent||t,g(r)){if("click"===e)return r(o,a,n)}else if(r[e])return r[e](o,a,n);t.preventDefault()},xl.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},xl.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},xl.prototype._updateAndOpen=function(e){var t,n=this.getEntries(e),i=this.getPad(e),r=i.html;C(n,(function(e,n){var i,o=e.group||"default",a=Te(e.html||'<div class="entry" draggable="true"></div>');ie(a,"data-action",n),i=De("[data-group="+Pc()(o)+"]",r),i||(i=Te('<div class="group"></div>'),ie(i,"data-group",o),r.appendChild(i)),i.appendChild(a),e.className&&wl(a,e.className),e.title&&ie(a,"title",e.title),e.imageUrl&&(t=Te("<img>"),ie(t,"src",e.imageUrl),t.style.width="100%",t.style.height="100%",a.appendChild(t))})),ce(r).add("open"),this._current={target:e,entries:n,pad:i},this._eventBus.fire("contextPad.open",{current:this._current})},xl.prototype.getPad=function(e){if(this.isOpen())return this._current.pad;var t=this,n=this._overlays,i=Te('<div class="djs-context-pad"></div>'),r=this._getPosition(e),o=W({html:i},this._overlaysConfig,r);Ae.bind(i,gl,"click",(function(e){t.trigger("click",e)})),Ae.bind(i,gl,"dragstart",(function(e){t.trigger("dragstart",e)})),we.bind(i,"mousedown",(function(e){e.stopPropagation()}));var a=this._canvas.getRootElement();this._overlayId=n.add(a,"context-pad",o);var s=n.get(this._overlayId);return this._eventBus.fire("contextPad.create",{target:e,pad:s}),s},xl.prototype.close=function(){this.isOpen()&&(this._overlays.remove(this._overlayId),this._overlayId=null,this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},xl.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return h(e)===h(n)&&(h(e)?e.length===n.length&&T(e,(function(e){return _l(n,e)})):n===e)},xl.prototype._getPosition=function(e){var t=h(e)?e:[e],n=Wt(t);return{position:{left:n.x+n.width+bl,top:n.y-bl/2}}};var El={__depends__:[Qs,xc],contextPad:["type",xl]},Cl="data-id",Sl=["contextPad.close","canvas.viewbox.changing","commandStack.changed"],Al=1e3;function Tl(e,t,n){var i=d(e&&e.scale)?e.scale:{min:1,max:1.5};this._config={scale:i},this._eventBus=t,this._canvas=n,this._providers={},this._current={}}function kl(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}Tl.$inject=["config.popupMenu","eventBus","canvas"],Tl.prototype.registerProvider=function(e,t,n){n||(n=t,t=Al),this._eventBus.on("popupMenu.getProviders."+e,t,(function(e){e.providers.push(n)}))},Tl.prototype.isEmpty=function(e,t){if(!e)throw new Error("element parameter is missing");if(!t)throw new Error("providerId parameter is missing");var n=this._getProviders(t);if(!n)return!0;var i=this._getEntries(e,n),r=this._getHeaderEntries(e,n),o=D(i)>0,a=r&&D(r)>0;return!o&&!a},Tl.prototype.open=function(e,t,n){var i=this._getProviders(t);if(!e)throw new Error("Element is missing");if(!i||!i.length)throw new Error("No registered providers for: "+t);if(!n)throw new Error("the position argument is missing");this.isOpen()&&this.close(),this._emit("open");var r=this._current={className:t,element:e,position:n},o=this._getEntries(e,i),a=this._getHeaderEntries(e,i);r.entries=W({},o,a),r.container=this._createContainer(t),D(a)&&r.container.appendChild(this._createEntries(a,"djs-popup-header")),D(o)&&r.container.appendChild(this._createEntries(o,"djs-popup-body"));var s=this._canvas,c=s.getContainer();this._attachContainer(r.container,c,n.cursor),this._bindAutoClose()},Tl.prototype.close=function(){this.isOpen()&&(this._emit("close"),this._unbindAutoClose(),Be(this._current.container),this._current.container=null)},Tl.prototype.isOpen=function(){return!!this._current.container},Tl.prototype.trigger=function(e){e.preventDefault();var t=e.delegateTarget||e.target,n=ie(t,Cl),i=this._getEntry(n);if(i.action)return i.action.call(null,e,i)},Tl.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"popupMenu.getProviders."+e,providers:[]});return this._eventBus.fire(t),t.providers},Tl.prototype._getEntries=function(e,t){var n={};return C(t,(function(t){if(t.getPopupMenuEntries){var i=t.getPopupMenuEntries(e);g(i)?n=i(n):C(i,(function(e,t){n[t]=e}))}else C(t.getEntries(e),(function(e){var t=e.id;if(!t)throw new Error("every entry must have the id property set");n[t]=q(e,["id"])}))})),n},Tl.prototype._getHeaderEntries=function(e,t){var n={};return C(t,(function(t){if(t.getPopupMenuHeaderEntries){var i=t.getPopupMenuHeaderEntries(e);g(i)?n=i(n):C(i,(function(e,t){n[t]=e}))}else{if(!t.getHeaderEntries)return;C(t.getHeaderEntries(e),(function(e){var t=e.id;if(!t)throw new Error("every entry must have the id property set");n[t]=q(e,["id"])}))}})),n},Tl.prototype._getEntry=function(e){var t=this._current.entries[e];if(!t)throw new Error("entry not found");return t},Tl.prototype._emit=function(e){this._eventBus.fire("popupMenu."+e)},Tl.prototype._createContainer=function(e){var t=Te('<div class="djs-popup">'),n=this._current.position,i=this._current.className;return ne(t,{position:"absolute",left:n.x+"px",top:n.y+"px",visibility:"hidden"}),ce(t).add(i),ie(t,"data-popup",e),t},Tl.prototype._attachContainer=function(e,t,n){var i=this;Ae.bind(e,".entry","click",(function(e){i.trigger(e)})),this._updateScale(e),t.appendChild(e),n&&this._assureIsInbounds(e,n),ne(e,{visibility:"visible"})},Tl.prototype._updateScale=function(e){var t,n,i=this._canvas.zoom(),r=this._config.scale,o=i;!0!==r&&(!1===r?(t=1,n=1):(t=r.min,n=r.max),d(t)&&i<t&&(o=t),d(n)&&i>n&&(o=n)),kl(e,"scale("+o+")")},Tl.prototype._assureIsInbounds=function(e,t){var n,i,r=this._canvas,o=r._container.getBoundingClientRect(),a=e.offsetLeft,s=e.offsetTop,c=e.scrollWidth,u=e.scrollHeight,l={},p={x:t.x-o.left,y:t.y-o.top};a+c>o.width&&(l.x=!0),s+u>o.height&&(l.y=!0),l.x&&l.y?(n=p.x-c+"px",i=p.y-u+"px"):l.x?(n=p.x-c+"px",i=p.y+"px"):l.y&&p.y<u?(n=p.x+"px",i="10px"):l.y&&(n=p.x+"px",i=p.y-u+"px"),ne(e,{left:n,top:i},{zIndex:1e3})},Tl.prototype._createEntries=function(e,t){var n=Te("<div>"),i=this;return ce(n).add(t),C(e,(function(e,t){var r=i._createEntry(e,t),o=e.group||"default",a=De("[data-group="+Pc()(o)+"]",n);a||(a=Te('<div class="group"></div>'),ie(a,"data-group",o),n.appendChild(a)),a.appendChild(r)})),n},Tl.prototype._createEntry=function(e,t){var n=Te("<div>"),i=ce(n);if(i.add("entry"),e.className&&e.className.split(" ").forEach((function(e){i.add(e)})),ie(n,Cl,t),e.label){var r=Te("<span>");r.textContent=e.label,n.appendChild(r)}if(e.imageUrl){var o=Te("<img>");ie(o,"src",e.imageUrl),n.appendChild(o)}return!0===e.active&&i.add("active"),!0===e.disabled&&i.add("disabled"),e.title&&(n.title=e.title),n},Tl.prototype._bindAutoClose=function(){this._eventBus.once(Sl,this.close,this)},Tl.prototype._unbindAutoClose=function(){this._eventBus.off(Sl,this.close,this)};var Rl={__init__:["popupMenu"],popupMenu:["type",Tl]},Pl={align:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%202000%202000%22%3E%3Cpath%20style%3D%22stroke%3AcurrentColor%3Bstroke-width%3A100%3Bstroke-linecap%3Around%22%20d%3D%22M200%20150v1700%22%2F%3E%3Crect%20x%3D%22500%22%20y%3D%22150%22%20width%3D%221300%22%20height%3D%22700%22%20rx%3D%221%22%20style%3D%22fill%3Anone%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%22%2F%3E%3Crect%20x%3D%22500%22%20y%3D%221150%22%20width%3D%22700%22%20height%3D%22700%22%20rx%3D%221%22%20style%3D%22fill%3AcurrentColor%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%3Bopacity%3A.5%22%2F%3E%3C%2Fsvg%3E",bottom:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201800%201800%22%3E%3Cpath%20style%3D%22stroke%3AcurrentColor%3Bstroke-width%3A100%3Bstroke-linecap%3Around%22%20d%3D%22M150%201650h1500%22%2F%3E%3Crect%20x%3D%22150%22%20y%3D%22350%22%20width%3D%22600%22%20height%3D%221300%22%20rx%3D%221%22%20style%3D%22fill%3Anone%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%22%2F%3E%3Crect%20x%3D%221050%22%20y%3D%22850%22%20width%3D%22600%22%20height%3D%22800%22%20rx%3D%221%22%20style%3D%22fill%3AcurrentColor%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%3Bopacity%3A.5%22%2F%3E%3C%2Fsvg%3E",center:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201800%201800%22%3E%3Cpath%20style%3D%22stroke%3AcurrentColor%3Bstroke-width%3A100%3Bstroke-linecap%3Around%22%20d%3D%22M900%20150v1500%22%2F%3E%3Crect%20x%3D%22250%22%20y%3D%22150%22%20width%3D%221300%22%20height%3D%22600%22%20rx%3D%221%22%20style%3D%22fill%3Anone%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%22%2F%3E%3Crect%20x%3D%22500%22%20y%3D%221050%22%20width%3D%22800%22%20height%3D%22600%22%20rx%3D%221%22%20style%3D%22fill%3AcurrentColor%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%3Bopacity%3A.5%22%2F%3E%3C%2Fsvg%3E",left:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201800%201800%22%3E%3Cpath%20style%3D%22stroke%3AcurrentColor%3Bstroke-width%3A100%3Bstroke-linecap%3Around%22%20d%3D%22M100%20150v1500%22%2F%3E%3Crect%20x%3D%22100%22%20y%3D%22150%22%20width%3D%221300%22%20height%3D%22600%22%20rx%3D%221%22%20style%3D%22fill%3Anone%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%22%2F%3E%3Crect%20x%3D%22100%22%20y%3D%221050%22%20width%3D%22800%22%20height%3D%22600%22%20rx%3D%221%22%20style%3D%22fill%3AcurrentColor%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%3Bopacity%3A.5%22%2F%3E%3C%2Fsvg%3E",right:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201800%201800%22%3E%3Cpath%20style%3D%22stroke%3AcurrentColor%3Bstroke-width%3A100%3Bstroke-linecap%3Around%22%20d%3D%22M1650%20150v1500%22%2F%3E%3Crect%20x%3D%22350%22%20y%3D%22150%22%20width%3D%221300%22%20height%3D%22600%22%20rx%3D%221%22%20style%3D%22fill%3Anone%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%22%2F%3E%3Crect%20x%3D%22850%22%20y%3D%221050%22%20width%3D%22800%22%20height%3D%22600%22%20rx%3D%221%22%20style%3D%22fill%3AcurrentColor%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%3Bopacity%3A.5%22%2F%3E%3C%2Fsvg%3E",top:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201800%201800%22%3E%3Cpath%20style%3D%22stroke%3AcurrentColor%3Bstroke-width%3A100%3Bstroke-linecap%3Around%22%20d%3D%22M150%20150h1500%22%2F%3E%3Crect%20x%3D%22150%22%20y%3D%22150%22%20width%3D%22600%22%20height%3D%221300%22%20rx%3D%221%22%20style%3D%22fill%3Anone%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%22%2F%3E%3Crect%20x%3D%221050%22%20y%3D%22150%22%20width%3D%22600%22%20height%3D%22800%22%20rx%3D%221%22%20style%3D%22fill%3AcurrentColor%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%3Bopacity%3A.5%22%2F%3E%3C%2Fsvg%3E",middle:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201800%201800%22%3E%3Cpath%20style%3D%22stroke%3AcurrentColor%3Bstroke-width%3A100%3Bstroke-linecap%3Around%22%20d%3D%22M150%20900h1500%22%2F%3E%3Crect%20x%3D%22150%22%20y%3D%22250%22%20width%3D%22600%22%20height%3D%221300%22%20rx%3D%221%22%20style%3D%22fill%3Anone%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%22%2F%3E%3Crect%20x%3D%221050%22%20y%3D%22500%22%20width%3D%22600%22%20height%3D%22800%22%20rx%3D%221%22%20style%3D%22fill%3AcurrentColor%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%3Bopacity%3A.5%22%2F%3E%3C%2Fsvg%3E"},Dl=Pl,Ml=900;function Bl(e,t,n,i){e.registerProvider(Ml,this),this._contextPad=e,this._popupMenu=t,this._translate=n,this._canvas=i}Bl.$inject=["contextPad","popupMenu","translate","canvas"],Bl.prototype.getMultiElementContextPadEntries=function(e){var t={};return this._isAllowed(e)&&W(t,this._getEntries(e)),t},Bl.prototype._isAllowed=function(e){return!this._popupMenu.isEmpty(e,"align-elements")},Bl.prototype._getEntries=function(e){var t=this;return{"align-elements":{group:"align-elements",title:t._translate("Align elements"),imageUrl:Dl["align"],action:{click:function(e,n){var i=t._getMenuPosition(n);W(i,{cursor:{x:e.x,y:e.y}}),t._popupMenu.open(n,"align-elements",i)}}}}},Bl.prototype._getMenuPosition=function(e){var t=5,n=this._canvas.getContainer(),i=this._contextPad.getPad(e).html,r=n.getBoundingClientRect(),o=i.getBoundingClientRect(),a=o.top-r.top,s=o.left-r.left,c={x:s,y:a+o.height+t};return c};var Ol=["left","center","right","top","middle","bottom"];function jl(e,t,n,i){this._alignElements=t,this._translate=n,this._popupMenu=e,this._rules=i,e.registerProvider("align-elements",this)}function Nl(e){Cc.call(this,e),this.init()}function Fl(e){Nl.call(this,e)}jl.$inject=["popupMenu","alignElements","translate","rules"],jl.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&W(t,this._getEntries(e)),t},jl.prototype._isAllowed=function(e){return this._rules.allowed("elements.align",{elements:e})},jl.prototype._getEntries=function(e){var t=this._alignElements,n=this._translate,i=this._popupMenu,r={};return C(Ol,(function(o){r["align-elements-"+o]={group:"align",title:n("Align elements "+o),className:"bjs-align-elements-menu-entry",imageUrl:Dl[o],action:function(n,r){t.trigger(e,o),i.close()}}})),r},Nl.$inject=["eventBus"],i(Nl,Cc),Nl.prototype.addRule=function(e,t,n){var i=this;"string"===typeof e&&(e=[e]),e.forEach((function(e){i.canExecute(e,t,(function(e,t,i){return n(e)}),!0)}))},Nl.prototype.init=function(){},Fl.$inject=["eventBus"],i(Fl,Nl),Fl.prototype.init=function(){this.addRule("elements.align",(function(e){var t=e.elements,n=E(t,(function(e){return!(e.waypoints||e.host||e.labelTarget)}));return n=It(n),!(n.length<2)&&n}))};var Il={__depends__:[vl,El,Rl],__init__:["alignElementsContextPadProvider","alignElementsMenuProvider","bpmnAlignElements"],alignElementsContextPadProvider:["type",Bl],alignElementsMenuProvider:["type",jl],bpmnAlignElements:["type",Fl]},Ll=10,zl=50,$l=250;function Hl(e,t,n,i){var r;while(r=Vl(e,n,t))n=i(t,n,r);return n}function Gl(e){return function(t,n,i){var r={x:n.x,y:n.y};return["x","y"].forEach((function(o){var a=e[o];if(a){var s="x"===o?"width":"height",c=a.margin,u=a.minDistance;r[o]=c<0?Math.min(i[o]+c-t[s]/2,n[o]-u+c):Math.max(i[o]+i[s]+c+t[s]/2,n[o]+u+c)}})),r}}function Vl(e,t,n){var i={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height},r=Ul(e,n);return w(r,(function(e){if(e===n)return!1;var t=wn(e,i,Ll);return"intersect"===t}))}function Wl(e,t){function n(t){return t.source===e?1:-1}t||(t={});var i=t.defaultDistance||zl,r=t.direction||"e",o=t.filter,a=t.getWeight||n,s=t.maxDistance||$l,c=t.reference||"start";function u(e,t){return"n"===r?"start"===c?vn(e).top-vn(t).bottom:"center"===c?vn(e).top-xn(t).y:vn(e).top-vn(t).top:"w"===r?"start"===c?vn(e).left-vn(t).right:"center"===c?vn(e).left-xn(t).x:vn(e).left-vn(t).left:"s"===r?"start"===c?vn(t).top-vn(e).bottom:"center"===c?xn(t).y-vn(e).bottom:vn(t).bottom-vn(e).bottom:"start"===c?vn(t).left-vn(e).right:"center"===c?xn(t).x-vn(e).right:vn(t).right-vn(e).right}o||(o=Xl);var l=e.incoming.filter(o).map((function(t){var n=a(t),i=n<0?u(t.source,e):u(e,t.source);return{id:t.source.id,distance:i,weight:n}})),p=e.outgoing.filter(o).map((function(t){var n=a(t),i=n>0?u(e,t.target):u(t.target,e);return{id:t.target.id,distance:i,weight:n}})),d=l.concat(p).reduce((function(e,t){return e[t.id+"__weight_"+t.weight]=t,e}),{}),f=A(d,(function(e,t){var n=t.distance,i=t.weight;return n<0||n>s||(e[String(n)]||(e[String(n)]=0),e[String(n)]+=1*i,(!e.distance||e[e.distance]<e[String(n)])&&(e.distance=n)),e}),{});return f.distance||i}function Ul(e){var t=ql(e);return e.host&&(t=t.concat(ql(e.host))),e.attachers&&(t=t.concat(e.attachers.reduce((function(e,t){return e.concat(ql(t))}),[]))),t}function ql(e){return Yl(e).concat(Kl(e))}function Kl(e){return e.incoming.map((function(e){return e.source}))}function Yl(e){return e.outgoing.map((function(e){return e.target}))}function Xl(){return!0}var Zl=100;function Jl(e,t,n){e.on("autoPlace",Zl,(function(e){var t=e.shape,n=e.source;return Ql(n,t)})),e.on("autoPlace.end",(function(e){n.scrollToElement(e.shape)})),this.append=function(n,i,r){e.fire("autoPlace.start",{source:n,shape:i});var o=e.fire("autoPlace",{source:n,shape:i}),a=t.appendShape(n,i,o,n.parent,r);return e.fire("autoPlace.end",{source:n,shape:a}),a}}function Ql(e,t,n){n||(n={});var i=n.defaultDistance||zl,r=xn(e),o=vn(e);return{x:o.right+i+t.width/2,y:r.y}}function ep(e,t){e.on("autoPlace.end",500,(function(e){t.select(e.shape)}))}Jl.$inject=["eventBus","modeling","canvas"],ep.$inject=["eventBus","selection"];var tp={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",Jl],autoPlaceSelectionBehavior:["type",ep]};function np(e,t){return Ko(t,"bpmn:TextAnnotation")?op(e,t):Yo(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])?ap(e,t):Ko(t,"bpmn:FlowNode")?ip(e,t):void 0}function ip(e,t){var n=vn(e),i=xn(e),r=Wl(e,{filter:function(e){return Ko(e,"bpmn:SequenceFlow")}}),o=30,a=80,s="left";Ko(e,"bpmn:BoundaryEvent")&&(s=wn(e,e.host,-25),-1!==s.indexOf("top")&&(o*=-1));var c={x:n.right+r+t.width/2,y:i.y+rp(s,a)},u={y:{margin:o,minDistance:a}};return Hl(e,t,c,Gl(u))}function rp(e,t){return-1!=e.indexOf("top")?-1*t:-1!=e.indexOf("bottom")?t:0}function op(e,t){var n=vn(e),i={x:n.right+t.width/2,y:n.top-50-t.height/2};sp(e)&&(i=xn(e),i.x+=100,i.y-=50);var r={y:{margin:-30,minDistance:20}};return Hl(e,t,i,Gl(r))}function ap(e,t){var n=vn(e),i={x:n.right-10+t.width/2,y:n.bottom+40+t.width/2},r={x:{margin:30,minDistance:30}};return Hl(e,t,i,Gl(r))}function sp(e){return!!e.waypoints}function cp(e){e.on("autoPlace",(function(e){var t=e.shape,n=e.source;return np(n,t)}))}cp.$inject=["eventBus"];var up={__depends__:[tp],__init__:["bpmnAutoPlace"],bpmnAutoPlace:["type",cp]};function lp(e,t,n,i){Cc.call(this,e),this._elementRegistry=t,this._modeling=n,this._rules=i;var r=this;this.postExecuted(["shape.create"],(function(e){var t=e.context,n=t.hints||{},i=t.shape,o=t.parent||t.newParent;!1!==n.autoResize&&r._expand([i],o)})),this.postExecuted(["elements.move"],(function(e){var t=e.context,n=c(M(t.closure.topLevel)),i=t.hints,o=!i||i.autoResize;if(!1!==o){var a=B(n,(function(e){return e.parent.id}));C(a,(function(e,t){h(o)&&(e=e.filter((function(e){return w(o,F({id:e.id}))}))),r._expand(e,t)}))}})),this.postExecuted(["shape.toggleCollapse"],(function(e){var t=e.context,n=t.hints,i=t.shape;n&&!1===n.autoResize||i.collapsed||r._expand(i.children||[],i)})),this.postExecuted(["shape.resize"],(function(e){var t=e.context,n=t.hints,i=t.shape,o=i.parent;n&&!1===n.autoResize||o&&r._expand([i],o)}))}function pp(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function dp(e,t){var n="";return e=vn(e),t=vn(t),e.top>t.top&&(n=n.concat("n")),e.right<t.right&&(n=n.concat("w")),e.bottom<t.bottom&&(n=n.concat("s")),e.left>t.left&&(n=n.concat("e")),n}function fp(e){e.invoke(lp,this)}function hp(e){Nl.call(this,e);var t=this;this.addRule("element.autoResize",(function(e){return t.canResize(e.elements,e.target)}))}function mp(e,t){hp.call(this,e),this._modeling=t}lp.$inject=["eventBus","elementRegistry","modeling","rules"],i(lp,Cc),lp.prototype._getOptimalBounds=function(e,t){var n=this.getOffset(t),i=this.getPadding(t),r=vn(Wt(e)),o=vn(t),a={};return r.top-o.top<i.top&&(a.top=r.top-n.top),r.left-o.left<i.left&&(a.left=r.left-n.left),o.right-r.right<i.right&&(a.right=r.right+n.right),o.bottom-r.bottom<i.bottom&&(a.bottom=r.bottom+n.bottom),gn(W({},o,a))},lp.prototype._expand=function(e,t){"string"===typeof t&&(t=this._elementRegistry.get(t));var n=this._rules.allowed("element.autoResize",{elements:e,target:t});if(n){var i=this._getOptimalBounds(e,t);if(pp(i,t)){var r=dp(U(t,["x","y","width","height"]),i);this.resize(t,i,{autoResize:r});var o=t.parent;o&&this._expand([t],o)}}},lp.prototype.getOffset=function(e){return{top:60,bottom:60,left:100,right:100}},lp.prototype.getPadding=function(e){return{top:2,bottom:2,left:15,right:15}},lp.prototype.resize=function(e,t,n){this._modeling.resizeShape(e,t,null,n)},fp.$inject=["injector"],i(fp,lp),fp.prototype.resize=function(e,t,n){Ko(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)},hp.$inject=["eventBus"],i(hp,Nl),hp.prototype.canResize=function(e,t){return!1},i(mp,hp),mp.$inject=["eventBus","modeling"],mp.prototype.canResize=function(e,t){if(Ko(t.di,"bpmndi:BPMNPlane"))return!1;if(!Ko(t,"bpmn:Participant")&&!Ko(t,"bpmn:Lane")&&!Ko(t,"bpmn:SubProcess"))return!1;var n=!0;return C(e,(function(e){(Ko(e,"bpmn:Lane")||e.labelTarget)&&(n=!1)})),n};var vp={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",fp],bpmnAutoResizeProvider:["type",mp]},gp=1500;function yp(e,t,n){var i=this,r=n.get("dragging",!1);function o(t){if(!t.hover){var n=t.originalEvent,o=i._findTargetGfx(n),a=o&&e.get(o);o&&a&&(t.stopPropagation(),r.hover({element:a,gfx:o}),r.move(n))}}r&&t.on("drag.start",(function(e){t.once("drag.move",gp,(function(e){o(e)}))})),function(){var e,n;t.on("element.hover",(function(t){e=t.gfx,n=t.element})),t.on("element.hover",gp,(function(i){n&&t.fire("element.out",{element:n,gfx:e})})),t.on("element.out",(function(){e=null,n=null}))}(),this._findTargetGfx=function(e){var t,n;if(e instanceof MouseEvent)return t=Hs(e),n=document.elementFromPoint(t.x,t.y),bp(n)}}function bp(e){return me(e,"svg, .djs-element",!0)}yp.$inject=["elementRegistry","eventBus","injector"];var xp={__init__:["hoverFix"],hoverFix:["type",yp]},wp=Math.round,_p="djs-drag-active";function Ep(e){e.preventDefault()}function Cp(e){return"undefined"!==typeof TouchEvent&&e instanceof TouchEvent}function Sp(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function Ap(e,t,n,i){var r,o={threshold:5,trapClick:!0};function a(e){var n=t.viewbox(),i=t._container.getBoundingClientRect();return{x:n.x+(e.x-i.left)/n.scale,y:n.y+(e.y-i.top)/n.scale}}function s(t,n){n=n||r;var i=e.createEvent(W({},n.payload,n.data,{isTouch:n.isTouch}));return!1!==e.fire("drag."+t,i)&&e.fire(n.prefix+"."+t,i)}function c(e){var t=e.filter((function(e){return i.get(e.id)}));t.length&&n.select(t)}function u(e,i){var o=r.payload,c=r.displacement,u=r.globalStart,l=Hs(e),p=Nu(l,u),d=r.localStart,f=a(l),h=Nu(f,d);if(!r.active&&(i||Sp(p)>r.threshold)){if(W(o,{x:wp(d.x+c.x),y:wp(d.y+c.y),dx:0,dy:0},{originalEvent:e}),!1===s("start"))return v();r.active=!0,r.keepSelection||(o.previousSelection=n.get(),n.select(null)),r.cursor&&Du(r.cursor),t.addMarker(t.getRootElement(),_p)}$s(e),r.active&&(W(o,{x:wp(f.x+c.x),y:wp(f.y+c.y),dx:wp(h.x),dy:wp(h.y)},{originalEvent:e}),s("move"))}function l(e){var t,n=!0;r.active&&(e&&(r.payload.originalEvent=e,$s(e)),n=s("end")),!1===n&&s("rejected"),t=g(!0!==n),s("ended",t)}function p(e){27===e.which&&(Ep(e),v())}function d(t){var n;r.active&&(n=Ou(e),setTimeout(n,400),Ep(t)),l(t)}function f(e){u(e)}function h(e){var t=r.payload;t.hoverGfx=e.gfx,t.hover=e.element,s("hover")}function m(e){s("out");var t=r.payload;t.hoverGfx=null,t.hover=null}function v(e){var t;if(r){var n=r.active;n&&s("cancel"),t=g(e),n&&s("canceled",t)}}function g(i){var o,a;s("cleanup"),Mu(),a=r.trapClick?d:l,we.unbind(document,"mousemove",u),we.unbind(document,"dragstart",Ep),we.unbind(document,"selectstart",Ep),we.unbind(document,"mousedown",a,!0),we.unbind(document,"mouseup",a,!0),we.unbind(document,"keyup",p),we.unbind(document,"touchstart",f,!0),we.unbind(document,"touchcancel",v,!0),we.unbind(document,"touchmove",u,!0),we.unbind(document,"touchend",l,!0),e.off("element.hover",h),e.off("element.out",m),t.removeMarker(t.getRootElement(),_p);var g=r.payload.previousSelection;return!1!==i&&g&&!n.get().length&&c(g),o=r,r=null,o}function y(t,n,i,c){r&&v(!1),"string"===typeof n&&(c=i,i=n,n=null),c=W({},o,c||{});var g,y,b,x,w,_=c.data||{};x=c.trapClick?d:l,t?(g=zs(t)||t,y=Hs(t),$s(t),"dragstart"===g.type&&Ep(g)):(g=null,y={x:0,y:0}),b=a(y),n||(n=b),w=Cp(g),r=W({prefix:i,data:_,payload:{},globalStart:y,displacement:Nu(n,b),localStart:b,isTouch:w},c),c.manual||(w?(we.bind(document,"touchstart",f,!0),we.bind(document,"touchcancel",v,!0),we.bind(document,"touchmove",u,!0),we.bind(document,"touchend",l,!0)):(we.bind(document,"mousemove",u),we.bind(document,"dragstart",Ep),we.bind(document,"selectstart",Ep),we.bind(document,"mousedown",x,!0),we.bind(document,"mouseup",x,!0)),we.bind(document,"keyup",p),e.on("element.hover",h),e.on("element.out",m)),s("init"),c.autoActivate&&u(t,!0)}e.on("diagram.destroy",v),this.init=y,this.move=u,this.hover=h,this.out=m,this.end=l,this.cancel=v,this.context=function(){return r},this.setOptions=function(e){W(o,e)}}Ap.$inject=["eventBus","canvas","selection","elementRegistry"];var Tp={__depends__:[xp,pc],dragging:["type",Ap]};function kp(e,t,n){this._canvas=n,this._opts=W({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},e);var i=this;t.on("drag.move",(function(e){var t=i._toBorderPoint(e);i.startScroll(t)})),t.on(["drag.cleanup"],(function(){i.stopScroll()}))}function Rp(e,t,n){return t<e&&e<n}kp.$inject=["config.autoScroll","eventBus","canvas"],kp.prototype.startScroll=function(e){var t=this._canvas,n=this._opts,i=this,r=t.getContainer().getBoundingClientRect(),o=[e.x,e.y,r.width-e.x,r.height-e.y];this.stopScroll();for(var a=0,s=0,c=0;c<4;c++)Rp(o[c],n.scrollThresholdOut[c],n.scrollThresholdIn[c])&&(0===c?a=n.scrollStep:1==c?s=n.scrollStep:2==c?a=-n.scrollStep:3==c&&(s=-n.scrollStep));0===a&&0===s||(t.scroll({dx:a,dy:s}),this._scrolling=setTimeout((function(){i.startScroll(e)}),n.scrollRepeatTimeout))},kp.prototype.stopScroll=function(){clearTimeout(this._scrolling)},kp.prototype.setOptions=function(e){this._opts=W({},this._opts,e)},kp.prototype._toBorderPoint=function(e){var t=this._canvas._container.getBoundingClientRect(),n=Hs(e.originalEvent);return{x:n.x-t.left,y:n.y-t.top}};var Pp={__depends__:[Tp],__init__:["autoScroll"],autoScroll:["type",kp]};function Dp(e){this._commandStack=e.get("commandStack",!1)}Dp.$inject=["injector"],Dp.prototype.allowed=function(e,t){var n=!0,i=this._commandStack;return i&&(n=i.canExecute(e,t)),void 0===n||n};var Mp={__init__:["rules"],rules:["type",Dp]},Bp=Math.round,Op=Math.max;function jp(e,t){var n=e.x,i=e.y;return[["M",n,i],["m",0,-t],["a",t,t,0,1,1,0,2*t],["a",t,t,0,1,1,0,-2*t],["z"]]}function Np(e){var t=[];return e.forEach((function(e,n){t.push([0===n?"M":"L",e.x,e.y])})),t}var Fp=10;function Ip(e,t){var n,i;for(n=0;i=e[n];n++)if(rn(i,t)<=Fp)return{point:e[n],bendpoint:!0,index:n};return null}function Lp(e,t){var n,i=fn()(jp(t,Fp),Np(e)),r=i[0],o=i[i.length-1];return r?r!==o?r.segment2!==o.segment2?(n=Op(r.segment2,o.segment2)-1,{point:e[n],bendpoint:!0,index:n}):{point:{x:Bp(r.x+o.x)/2,y:Bp(r.y+o.y)/2},index:r.segment2}:{point:{x:Bp(r.x),y:Bp(r.y)},index:r.segment2}:null}function zp(e,t){return Ip(e,t)||Lp(e,t)}function $p(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function Hp(e){return Math.atan((e[1].y-e[0].y)/(e[1].x-e[0].x))}function Gp(e,t){return t?{x:Math.cos(t)*e.x-Math.sin(t)*e.y,y:Math.sin(t)*e.x+Math.cos(t)*e.y}:e}function Vp(e,t,n){var i=[{n:e[0]-n[0],lambda:t[0]},{n:e[1]-n[1],lambda:t[1]}],r=i[0].n*t[0]+i[1].n*t[1],o=i[0].lambda*t[0]+i[1].lambda*t[1];return-r/o}function Wp(e,t){var n=t[0],i=t[1],r={x:i.x-n.x,y:i.y-n.y},o=Vp([n.x,n.y],[r.x,r.y],[e.x,e.y]);return{x:n.x+o*r.x,y:n.y+o*r.y}}function Up(e,t){var n=Wp(e,t),i={x:n.x-e.x,y:n.y-e.y};return $p(i)}function qp(e,t){return $p({x:e.x-t.x,y:e.y-t.y})}var Kp="djs-bendpoint",Yp="djs-segment-dragger";function Xp(e,t){var n,i=Hs(t),r=e._container.getBoundingClientRect();n={x:r.left,y:r.top};var o=e.viewbox();return{x:o.x+(i.x-n.x)/o.scale,y:o.y+(i.y-n.y)/o.scale}}function Zp(e,t,n){var i=Xp(e,n),r=zp(t,i);return r}function Jp(e,t){var n=nt("g");qe(n).add(Kp),Ne(e,n);var i=nt("circle");He(i,{cx:0,cy:0,r:4}),qe(i).add("djs-visual"),Ne(n,i);var r=nt("circle");return He(r,{cx:0,cy:0,r:10}),qe(r).add("djs-hit"),Ne(n,r),t&&qe(n).add(t),n}function Qp(e,t,n,i){var r=nt("g");Ne(e,r);var o=18,a=6,s=11,c=id(t,n,i),u=a+s,l=nt("rect");He(l,{x:-o/2,y:-a/2,width:o,height:a}),qe(l).add("djs-visual"),Ne(r,l);var p=nt("rect");return He(p,{x:-c/2,y:-u/2,width:c,height:u}),qe(p).add("djs-hit"),Ne(r,p),pi(r,"v"===i?90:0,0,0),r}function ed(e,t,n){var i=nt("g"),r=pn(t,n),o=sn(t,n);return Ne(e,i),Qp(i,t,n,o),qe(i).add(Yp),qe(i).add("h"===o?"horizontal":"vertical"),li(i,r.x,r.y),i}function td(e){return Math.abs(Math.round(2*e/3))}function nd(e,t){var n=rd(e,t);return Wp(e,n)}function id(e,t,n){var i=t.x-e.x,r=t.y-e.y;return td("h"===n?i:r)}function rd(e,t){for(var n,i=t.waypoints,r=1/0,o=0;o<i.length-1;o++){var a=i[o],s=i[o+1],c=Up(e,[a,s]);c<r&&(r=c,n=o)}return[i[n],i[n+1]]}function od(e,t,n,i,r){function o(e,t,n){var i,r,o,a,s,c,u=e.index,l=e.point;return!(u<=0||e.bendpoint)&&(i=t[u-1],r=t[u],o=pn(i,r),a=sn(i,r),s=Math.abs(l.x-o.x),c=Math.abs(l.y-o.y),a&&s<=n&&c<=n)}function a(e,t){var n,i,r,o,a=e.waypoints;return t.index<=0||t.bendpoint?null:(n={start:a[t.index-1],end:a[t.index]},i=sn(n.start,n.end),i?(r="h"===i?n.end.x-n.start.x:n.end.y-n.start.y,o=td(r)/2,o):null)}function s(e,n){var s,c=n.waypoints,u=Zp(t,c,e);if(u)return s=a(n,u),o(u,c,s)?r.start(e,n,u.index):i.start(e,n,u.index,!u.bendpoint),!0}function c(e,t,i){we.bind(e,t,(function(e){n.triggerMouseEvent(t,e,i),e.stopPropagation()}))}function u(e,n){var i=t.getLayer("overlays"),r=De('.djs-bendpoints[data-element-id="'+Pc()(e.id)+'"]',i);return!r&&n&&(r=nt("g"),He(r,{"data-element-id":e.id}),qe(r).add("djs-bendpoints"),Ne(i,r),c(r,"mousedown",e),c(r,"click",e),c(r,"dblclick",e)),r}function l(e,t){return De('.djs-segment-dragger[data-segment-idx="'+e+'"]',t)}function p(e,t){t.waypoints.forEach((function(t,n){var i=Jp(e);Ne(e,i),li(i,t.x,t.y)})),Jp(e,"floating")}function d(e,t){for(var n,i,r,o=t.waypoints,a=1;a<o.length;a++)n=o[a-1],i=o[a],sn(n,i)&&(r=ed(e,n,i),He(r,{"data-segment-idx":a}),c(r,"mousemove",t))}function f(e){C(Me("."+Kp,e),(function(e){Ye(e)}))}function h(e){C(Me("."+Yp,e),(function(e){Ye(e)}))}function m(e){var t=u(e);return t||(t=u(e,!0),p(t,e),d(t,e)),t}function v(e){var t=u(e);t&&(h(t),f(t),d(t,e),p(t,e))}function g(e,t){var n=De(".floating",e),i=t.point;n&&li(n,i.x,i.y)}function y(e,t,n){var i,r,o=l(t.index,e),a=n[t.index-1],s=n[t.index],c=t.point,u=pn(a,s),p=sn(a,s);o&&(i=ad(o),r={x:c.x-u.x,y:c.y-u.y},"v"===p&&(r={x:r.y,y:r.x}),li(i,r.x,r.y))}e.on("connection.changed",(function(e){v(e.element)})),e.on("connection.remove",(function(e){var t=u(e.element);t&&Ye(t)})),e.on("element.marker.update",(function(e){var t,n=e.element;n.waypoints&&(t=m(n),e.add?qe(t).add(e.marker):qe(t).remove(e.marker))})),e.on("element.mousemove",(function(e){var n,i,r=e.element,o=r.waypoints;if(o){if(n=u(r,!0),i=Zp(t,o,e.originalEvent),!i)return;g(n,i),i.bendpoint||y(n,i,o)}})),e.on("element.mousedown",(function(e){if(Ws(e)){var t=e.originalEvent,n=e.element;if(n.waypoints)return s(t,n)}})),e.on("selection.changed",(function(e){var t=e.newSelection,n=t[0];n&&n.waypoints&&m(n)})),e.on("element.hover",(function(e){var t=e.element;t.waypoints&&(m(t),n.registerEvent(e.gfx,"mousemove","element.mousemove"))})),e.on("element.out",(function(e){n.unregisterEvent(e.gfx,"mousemove","element.mousemove")})),e.on("element.updateId",(function(e){var t=e.element,n=e.newId;if(t.waypoints){var i=u(t);i&&He(i,{"data-element-id":n})}})),this.addHandles=m,this.updateHandles=v,this.getBendpointsContainer=u,this.getSegmentDragger=l}function ad(e){return De(".djs-visual",e)}od.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];var sd=Math.round,cd="reconnectStart",ud="reconnectEnd",ld="updateWaypoints";function pd(e,t,n,i,r,o){this._injector=e,this.start=function(e,t,o,a){var s,c=n.getGraphics(t),u=t.source,l=t.target,p=t.waypoints;s=a||0!==o?a||o!==p.length-1?ld:ud:cd;var d=s===ld?"connection.updateWaypoints":"connection.reconnect",f=r.allowed(d,{connection:t,source:u,target:l});!1===f&&(f=r.allowed(d,{connection:t,source:l,target:u})),!1!==f&&i.init(e,"bendpoint.move",{data:{connection:t,connectionGfx:c,context:{allowed:f,bendpointIndex:o,connection:t,source:u,target:l,insert:a,type:s}}})},t.on("bendpoint.move.hover",(function(e){var t,n=e.context,i=n.connection,o=i.source,a=i.target,s=e.hover,c=n.type;if(n.hover=s,s){var u=c===ld?"connection.updateWaypoints":"connection.reconnect";if(t=n.allowed=r.allowed(u,{connection:i,source:c===cd?s:o,target:c===ud?s:a}),t)return n.source=c===cd?s:o,void(n.target=c===ud?s:a);!1===t&&(t=n.allowed=r.allowed(u,{connection:i,source:c===ud?s:a,target:c===cd?s:o})),t&&(n.source=c===ud?s:a,n.target=c===cd?s:o)}})),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],(function(e){var t=e.context,n=t.type;t.hover=null,t.source=null,t.target=null,n!==ld&&(t.allowed=!1)})),t.on("bendpoint.move.end",(function(e){var t=e.context,n=t.allowed,i=t.bendpointIndex,r=t.connection,a=t.insert,s=r.waypoints.slice(),c=t.source,u=t.target,l=t.type,p=t.hints||{},d={x:sd(e.x),y:sd(e.y)};if(!n)return!1;l===ld?(a?s.splice(i,0,d):s[i]=d,p.bendpointMove={insert:a,bendpointIndex:i},s=this.cropWaypoints(r,s),o.updateWaypoints(r,Cn(s),p)):(l===cd?(p.docking="source",dd(t)&&(p.docking="target",p.newWaypoints=s.reverse())):l===ud&&(p.docking="target",dd(t)&&(p.docking="source",p.newWaypoints=s.reverse())),o.reconnect(r,c,u,d,p))}),this)}function dd(e){var t=e.hover,n=e.source,i=e.target,r=e.type;return r===cd?t&&i&&t===i&&n!==i:r===ud?t&&n&&t===n&&n!==i:void 0}pd.$inject=["injector","eventBus","canvas","dragging","rules","modeling"],pd.prototype.cropWaypoints=function(e,t){var n=this._injector.get("connectionDocking",!1);if(!n)return t;var i=e.waypoints;return e.waypoints=t,e.waypoints=n.getCroppedWaypoints(e),t=e.waypoints,e.waypoints=i,t};var fd="reconnectStart",hd="reconnectEnd",md="updateWaypoints",vd="connect-ok",gd="connect-not-ok",yd="connect-hover",bd="djs-updating",xd="djs-element-hidden",wd=1100;function _d(e,t,n,i){this._injector=t;var r=t.get("connectionPreview",!1);n.on("bendpoint.move.start",(function(e){var t=e.context,n=t.bendpointIndex,r=t.connection,o=t.insert,a=r.waypoints,s=a.slice();t.waypoints=a,o&&s.splice(n,0,{x:e.x,y:e.y}),r.waypoints=s;var c=t.draggerGfx=Jp(i.getLayer("overlays"));qe(c).add("djs-dragging"),i.addMarker(r,xd),i.addMarker(r,bd)})),n.on("bendpoint.move.hover",(function(e){var t=e.context,n=t.allowed,r=t.hover,o=t.type;if(r){if(i.addMarker(r,yd),o===md)return;n?(i.removeMarker(r,gd),i.addMarker(r,vd)):!1===n&&(i.removeMarker(r,vd),i.addMarker(r,gd))}})),n.on(["bendpoint.move.out","bendpoint.move.cleanup"],wd,(function(e){var t=e.context,n=t.hover,r=t.target;n&&(i.removeMarker(n,yd),i.removeMarker(n,r?vd:gd))})),n.on("bendpoint.move.move",(function(t){var n=t.context,i=n.allowed,o=n.bendpointIndex,a=n.draggerGfx,s=n.hover,c=n.type,u=n.connection,l=u.source,p=u.target,d=u.waypoints.slice(),f={x:t.x,y:t.y},h=n.hints||{},m={};r&&(h.connectionStart&&(m.connectionStart=h.connectionStart),h.connectionEnd&&(m.connectionEnd=h.connectionEnd),c===fd?dd(n)?(m.connectionEnd=m.connectionEnd||f,m.source=p,m.target=s||l,d=d.reverse()):(m.connectionStart=m.connectionStart||f,m.source=s||l,m.target=p):c===hd?dd(n)?(m.connectionStart=m.connectionStart||f,m.source=s||p,m.target=l,d=d.reverse()):(m.connectionEnd=m.connectionEnd||f,m.source=l,m.target=s||p):(m.noCropping=!0,m.noLayout=!0,d[o]=f),c===md&&(d=e.cropWaypoints(u,d)),m.waypoints=d,r.drawPreview(n,i,m)),li(a,t.x,t.y)}),this),n.on(["bendpoint.move.end","bendpoint.move.cancel"],wd,(function(e){var t=e.context,n=t.connection,o=t.draggerGfx,a=t.hover,s=t.target,c=t.waypoints;n.waypoints=c,Ye(o),i.removeMarker(n,bd),i.removeMarker(n,xd),a&&(i.removeMarker(a,vd),i.removeMarker(a,s?vd:gd)),r&&r.cleanUp(t)}))}_d.$inject=["bendpointMove","injector","eventBus","canvas"];var Ed="connect-hover",Cd="djs-updating";function Sd(e,t,n){return Ad(e,t,e[t]+n)}function Ad(e,t,n){return{x:"x"===t?n:e.x,y:"y"===t?n:e.y}}function Td(e,t,n,i){var r=Math.max(t[i],n[i]),o=Math.min(t[i],n[i]),a=20,s=Math.min(Math.max(o+a,e[i]),r-a);return Ad(t,i,s)}function kd(e){return"x"===e?"y":"x"}function Rd(e,t,n){var i,r;return e.original?e.original:(i=xn(t),r=kd(n),Ad(e,r,i[r]))}function Pd(e,t,n,i,r,o){var a=e.get("connectionDocking",!1);function s(e,t){if(!a)return t;var n,i=e.waypoints;return e.waypoints=t,n=a.getCroppedWaypoints(e),e.waypoints=i,n}function c(e){r.update("connection",e.connection,e.connectionGfx)}function u(e,t,n){var i=e.newWaypoints,r=e.segmentStartIndex+t,o=i[r],a=e.segmentEndIndex+t,s=i[a],c=kd(e.axis),u=Td(n,o,s,c);li(e.draggerGfx,u.x,u.y)}function l(e,t){var n=0,i=e.filter((function(i,r){return!on(e[r-1],e[r+1],i)||(n=r<=t?n-1:n,!1)}));return{waypoints:i,segmentOffset:n}}this.start=function(e,t,r){var o,a,s,c,u=n.getGraphics(t),l=r-1,p=r,d=t.waypoints,f=d[l],h=d[p],m=Zp(n,d,e);a=sn(f,h),a&&(s="v"===a?"x":"y",0===l&&(f=Rd(f,t.source,s)),p===d.length-1&&(h=Rd(h,t.target,s)),c=m?m.point:{x:(f.x+h.x)/2,y:(f.y+h.y)/2},o={connection:t,segmentStartIndex:l,segmentEndIndex:p,segmentStart:f,segmentEnd:h,axis:s,dragPosition:c},i.init(e,c,"connectionSegment.move",{cursor:"x"===s?"resize-ew":"resize-ns",data:{connection:t,connectionGfx:u,context:o}}))},t.on("connectionSegment.move.start",(function(e){var t=e.context,i=e.connection,r=n.getLayer("overlays");t.originalWaypoints=i.waypoints.slice(),t.draggerGfx=ed(r,t.segmentStart,t.segmentEnd),qe(t.draggerGfx).add("djs-dragging"),n.addMarker(i,Cd)})),t.on("connectionSegment.move.move",(function(e){var t,n,i=e.context,r=i.connection,o=i.segmentStartIndex,a=i.segmentEndIndex,l=i.segmentStart,p=i.segmentEnd,d=i.axis,f=i.originalWaypoints.slice(),h=Sd(l,d,e["d"+d]),m=Sd(p,d,e["d"+d]),v=f.length,g=0;f[o]=h,f[a]=m,o<2&&(t=wn(r.source,h),1===o?"intersect"===t&&(f.shift(),f[0]=h,g--):"intersect"!==t&&(f.unshift(l),g++)),a>v-3&&(n=wn(r.target,m),a===v-2?"intersect"===n&&(f.pop(),f[f.length-1]=m):"intersect"!==n&&f.push(p)),i.newWaypoints=r.waypoints=s(r,f),u(i,g,e),i.newSegmentStartIndex=o+g,c(e)})),t.on("connectionSegment.move.hover",(function(e){e.context.hover=e.hover,n.addMarker(e.hover,Ed)})),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],(function(e){var t=e.context.hover;t&&n.removeMarker(t,Ed)})),t.on("connectionSegment.move.cleanup",(function(e){var t=e.context,i=t.connection;t.draggerGfx&&Ye(t.draggerGfx),n.removeMarker(i,Cd)})),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],(function(e){var t=e.context,n=t.connection;n.waypoints=t.originalWaypoints,c(e)})),t.on("connectionSegment.move.end",(function(e){var t=e.context,n=t.connection,i=t.newWaypoints,r=t.newSegmentStartIndex;i=i.map((function(e){return{original:e.original,x:Math.round(e.x),y:Math.round(e.y)}}));var a=l(i,r),c=a.waypoints,u=s(n,c),p=a.segmentOffset,d={segmentMove:{segmentStartIndex:t.segmentStartIndex,newSegmentStartIndex:r+p}};o.updateWaypoints(n,u,d)}))}Pd.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var Dd=Math.abs,Md=Math.round;function Bd(e,t,n){var i,r;for(n=void 0===n?10:n,i=0;i<t.length;i++)if(r=t[i],Dd(r-e)<=n)return r}function Od(e){return{x:e.x,y:e.y}}function jd(e){return{x:e.x+e.width,y:e.y+e.height}}function Nd(e,t){return!e||isNaN(e.x)||isNaN(e.y)?t:{x:Md(e.x+e.width/2),y:Md(e.y+e.height/2)}}function Fd(e,t){var n=e.snapped;return!!n&&("string"===typeof t?n[t]:n.x&&n.y)}function Id(e,t,n){if("string"!==typeof t)throw new Error("axis must be in [x, y]");if("number"!==typeof n&&!1!==n)throw new Error("value must be Number or false");var i,r=e[t],o=e.snapped=e.snapped||{};return!1===n?o[t]=!1:(o[t]=!0,i=n-r,e[t]+=i,e["d"+t]+=i),r}function Ld(e){return e.children||[]}var zd=Math.abs,$d=Math.round,Hd=10;function Gd(e){function t(e,t){if(h(e)){var n=e.length;while(n--)if(zd(e[n]-t)<=Hd)return e[n]}else{e=+e;var i=t%e;if(i<Hd)return t-i;if(i>e-Hd)return t-i+e}return t}function n(e,t){return e.waypoints?nd(t,e):e.width?{x:$d(e.width/2+e.x),y:$d(e.height/2+e.y)}:void 0}function i(e){var t=e.context,i=t.snapPoints,r=t.connection,o=r.waypoints,a=t.segmentStart,s=t.segmentStartIndex,c=t.segmentEnd,u=t.segmentEndIndex,l=t.axis;if(i)return i;var p=[o[s-1],a,c,o[u+1]];return s<2&&p.unshift(n(r.source,e)),u>o.length-3&&p.unshift(n(r.target,e)),t.snapPoints=i={horizontal:[],vertical:[]},C(p,(function(e){e&&(e=e.original||e,"y"===l&&i.horizontal.push(e.y),"x"===l&&i.vertical.push(e.x))})),i}function r(e){var t=e.snapPoints,n=e.connection.waypoints,i=e.bendpointIndex;if(t)return t;var r=[n[i-1],n[i+1]];return e.snapPoints=t={horizontal:[],vertical:[]},C(r,(function(e){e&&(e=e.original||e,t.horizontal.push(e.y),t.vertical.push(e.x))})),t}e.on("connectionSegment.move.move",1500,(function(e){var n,r,o=i(e),a=e.x,s=e.y;if(o){n=t(o.vertical,a),r=t(o.horizontal,s);var c=a-n,u=s-r;W(e,{dx:e.dx-c,dy:e.dy-u,x:n,y:r}),(c||-1!==o.vertical.indexOf(a))&&Id(e,"x",n),(u||-1!==o.horizontal.indexOf(s))&&Id(e,"y",r)}})),e.on(["connect.hover","connect.move","connect.end"],1500,(function(e){var t=e.context,i=t.hover,r=i&&n(i,e);Vd(i)&&r&&r.x&&r.y&&(Id(e,"x",r.x),Id(e,"y",r.y))})),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,(function(e){var i,o,a=e.context,s=r(a),c=a.hover,u=c&&n(c,e),l=e.x,p=e.y;if(s){i=t(u?s.vertical.concat([u.x]):s.vertical,l),o=t(u?s.horizontal.concat([u.y]):s.horizontal,p);var d=l-i,f=p-o;W(e,{dx:e.dx-d,dy:e.dy-f,x:e.x-d,y:e.y-f}),(d||-1!==s.vertical.indexOf(l))&&Id(e,"x",i),(f||-1!==s.horizontal.indexOf(p))&&Id(e,"y",o)}}))}function Vd(e){return e&&!!e.waypoints}Gd.$inject=["eventBus"];var Wd={__depends__:[Tp,Mp],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",od],bendpointMove:["type",pd],bendpointMovePreview:["type",_d],connectionSegmentMove:["type",Pd],bendpointSnapping:["type",Gd]};function Ud(e,t,n,i){function r(e,t){return i.allowed("connection.create",{source:e,target:t})}function o(e,t){return r(t,e)}e.on("connect.hover",(function(e){var t,n=e.context,i=n.start,a=e.hover;if(n.hover=a,t=n.canExecute=r(i,a),!f(t)){if(!1!==t)return n.source=i,void(n.target=a);t=n.canExecute=o(i,a),f(t)||!1!==t&&(n.source=a,n.target=i)}})),e.on(["connect.out","connect.cleanup"],(function(e){var t=e.context;t.hover=null,t.source=null,t.target=null,t.canExecute=!1})),e.on("connect.end",(function(e){var t=e.context,i=t.canExecute,r=t.connectionStart,o={x:e.x,y:e.y},a=t.source,s=t.target;if(!i)return!1;var c=null,u={connectionStart:qd(t)?o:r,connectionEnd:qd(t)?r:o};m(i)&&(c=i),t.connection=n.connect(a,s,c,u)})),this.start=function(e,n,i,r){m(i)||(r=i,i=xn(n)),t.init(e,"connect",{autoActivate:r,data:{shape:n,context:{start:n,connectionStart:i}}})}}function qd(e){var t=e.hover,n=e.source,i=e.target;return t&&n&&t===n&&n!==i}Ud.$inject=["eventBus","dragging","modeling","rules"];var Kd=1100,Yd=900,Xd="connect-ok",Zd="connect-not-ok";function Jd(e,t,n){var i=e.get("connectionPreview",!1);i&&t.on("connect.move",(function(e){var t=e.context,n=t.canExecute,r=t.hover,o=t.source,a=t.start,s=t.startPosition,c=t.target,u=t.connectionStart||s,l=t.connectionEnd||{x:e.x,y:e.y},p=u,d=l;qd(t)&&(p=l,d=u),i.drawPreview(t,n,{source:o||a,target:c||r,connectionStart:p,connectionEnd:d})})),t.on("connect.hover",Yd,(function(e){var t=e.context,i=e.hover,r=t.canExecute;null!==r&&n.addMarker(i,r?Xd:Zd)})),t.on(["connect.out","connect.cleanup"],Kd,(function(e){var t=e.hover;t&&(n.removeMarker(t,Xd),n.removeMarker(t,Zd))})),i&&t.on("connect.cleanup",(function(e){i.cleanUp(e.context)}))}Jd.$inject=["injector","eventBus","canvas"];var Qd={__depends__:[pc,Mp,Tp],__init__:["connectPreview"],connect:["type",Ud],connectPreview:["type",Jd]},ef="djs-connection-preview";function tf(e,t,n,i){this._canvas=t,this._graphicsFactory=n,this._elementFactory=i,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}function nf(e){var t={};return function(n){var i=JSON.stringify(n),r=t[i];return r||(r=t[i]=e.apply(null,arguments)),r}}function rf(e){return m(e)?e:{}}tf.$inject=["injector","canvas","graphicsFactory","elementFactory"],tf.prototype.drawPreview=function(e,t,n){n=n||{};var i,r=e.connectionPreviewGfx,o=e.getConnection,a=n.source,s=n.target,c=n.waypoints,u=n.connectionStart,l=n.connectionEnd,p=n.noLayout,d=n.noCropping,f=n.noNoop,h=this;r||(r=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),Xe(r),o||(o=e.getConnection=nf((function(e,t,n){return h.getConnection(e,t,n)}))),t&&(i=o(t,a,s)),i?(i.waypoints=c||[],this._layouter&&!p&&(i.waypoints=this._layouter.layoutConnection(i,{source:a,target:s,connectionStart:u,connectionEnd:l,waypoints:n.waypoints||i.waypoints})),i.waypoints&&i.waypoints.length||(i.waypoints=[a?xn(a):u,s?xn(s):l]),this._connectionDocking&&(a||s)&&!d&&(i.waypoints=this._connectionDocking.getCroppedWaypoints(i,a,s)),this._graphicsFactory.drawConnection(r,i)):!f&&this.drawNoopPreview(r,n)},tf.prototype.drawNoopPreview=function(e,t){var n=t.source,i=t.target,r=t.connectionStart||xn(n),o=t.connectionEnd||xn(i),a=this.cropWaypoints(r,o,n,i),s=this.createNoopConnection(a[0],a[1]);Ne(e,s)},tf.prototype.cropWaypoints=function(e,t,n,i){var r=this._graphicsFactory,o=n&&r.getShapePath(n),a=i&&r.getShapePath(i),s=r.getConnectionPath({waypoints:[e,t]});return e=n&&_n(o,s,!0)||e,t=i&&_n(a,s,!1)||t,[e,t]},tf.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&Ye(e.connectionPreviewGfx)},tf.prototype.getConnection=function(e){var t=rf(e);return this._elementFactory.createConnection(t)},tf.prototype.createConnectionPreviewGfx=function(){var e=nt("g");return He(e,{pointerEvents:"none"}),qe(e).add(ef),Ne(this._canvas.getActiveLayer(),e),e},tf.prototype.createNoopConnection=function(e,t){var n=nt("polyline");return He(n,{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"}),He(n,{points:[e.x,e.y,t.x,t.y]}),n};var of={__init__:["connectionPreview"],connectionPreview:["type",tf]},af=Math.min,sf=Math.max;function cf(e){e.preventDefault()}function uf(e){e.stopPropagation()}function lf(e){return e.nodeType===Node.TEXT_NODE}function pf(e){return[].slice.call(e)}function df(e){this.container=e.container,this.parent=Te('<div class="djs-direct-editing-parent"><div class="djs-direct-editing-content" contenteditable="true"></div></div>'),this.content=De("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=G(this.autoResize,this),this.handlePaste=G(this.handlePaste,this)}function ff(e){return e.replace(/\r\n|\r|\n/g,"\n")}function hf(e,t){this._eventBus=e,this._providers=[],this._textbox=new df({container:t.getContainer(),keyHandler:G(this._handleKey,this),resizeHandler:G(this._handleResize,this)})}df.prototype.create=function(e,t,n,i){var r=this,o=this.parent,a=this.content,s=this.container;i=this.options=i||{},t=this.style=t||{};var c=U(t,["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);W(o.style,{width:e.width+"px",height:e.height+"px",maxWidth:e.maxWidth+"px",maxHeight:e.maxHeight+"px",minWidth:e.minWidth+"px",minHeight:e.minHeight+"px",left:e.x+"px",top:e.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},c);var u=U(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return W(a.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},u),i.centerVertically&&W(a.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},u),a.innerText=n,we.bind(a,"keydown",this.keyHandler),we.bind(a,"mousedown",uf),we.bind(a,"paste",r.handlePaste),i.autoResize&&we.bind(a,"input",this.autoResize),i.resizable&&this.resizable(t),s.appendChild(o),this.setSelection(a.lastChild,a.lastChild&&a.lastChild.length),o},df.prototype.handlePaste=function(e){var t,n=this.options,i=this.style;if(e.preventDefault(),t=e.clipboardData?e.clipboardData.getData("text/plain"):window.clipboardData.getData("Text"),this.insertText(t),n.autoResize){var r=this.autoResize(i);r&&this.resizeHandler(r)}},df.prototype.insertText=function(e){e=ff(e);var t=document.execCommand("insertText",!1,e);t||this._insertTextIE(e)},df.prototype._insertTextIE=function(e){var t,n,i=this.getSelection(),r=i.startContainer,o=i.endContainer,a=i.startOffset,s=i.endOffset,c=i.commonAncestorContainer,u=pf(c.childNodes);if(lf(c)){var l=r.textContent;r.textContent=l.substring(0,a)+e+l.substring(s),t=r,n=a+e.length}else if(r===this.content&&o===this.content){var p=document.createTextNode(e);this.content.insertBefore(p,u[a]),t=p,n=p.textContent.length}else{var d=u.indexOf(r),f=u.indexOf(o);u.forEach((function(t,n){n===d?t.textContent=r.textContent.substring(0,a)+e+o.textContent.substring(s):n>d&&n<=f&&Be(t)})),t=r,n=a+e.length}t&&void 0!==n&&setTimeout((function(){self.setSelection(t,n)}))},df.prototype.autoResize=function(){var e=this.parent,t=this.content,n=parseInt(this.style.fontSize)||12;if(t.scrollHeight>e.offsetHeight||t.scrollHeight<e.offsetHeight-n){var i=e.getBoundingClientRect(),r=t.scrollHeight;e.style.height=r+"px",this.resizeHandler({width:i.width,height:i.height,dx:0,dy:r-i.height})}},df.prototype.resizable=function(){var e=this,t=this.parent,n=this.resizeHandle,i=parseInt(this.style.minWidth)||0,r=parseInt(this.style.minHeight)||0,o=parseInt(this.style.maxWidth)||1/0,a=parseInt(this.style.maxHeight)||1/0;if(!n){var s,c,u,l;n=this.resizeHandle=Te('<div class="djs-direct-editing-resize-handle"></div>');var p=function(e){cf(e),uf(e),s=e.clientX,c=e.clientY;var n=t.getBoundingClientRect();u=n.width,l=n.height,we.bind(document,"mousemove",d),we.bind(document,"mouseup",f)},d=function(n){cf(n),uf(n);var p=af(sf(u+n.clientX-s,i),o),d=af(sf(l+n.clientY-c,r),a);t.style.width=p+"px",t.style.height=d+"px",e.resizeHandler({width:u,height:l,dx:n.clientX-s,dy:n.clientY-c})},f=function(e){cf(e),uf(e),we.unbind(document,"mousemove",d,!1),we.unbind(document,"mouseup",f,!1)};we.bind(n,"mousedown",p)}W(n.style,{position:"absolute",bottom:"0px",right:"0px",cursor:"nwse-resize",width:"0",height:"0",borderTop:(parseInt(this.style.fontSize)/4||3)+"px solid transparent",borderRight:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderBottom:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderLeft:(parseInt(this.style.fontSize)/4||3)+"px solid transparent"}),t.appendChild(n)},df.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),we.unbind(t,"keydown",this.keyHandler),we.unbind(t,"mousedown",uf),we.unbind(t,"input",this.autoResize),we.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),Be(n)),Be(e)},df.prototype.getValue=function(){return this.content.innerText.trim()},df.prototype.getSelection=function(){var e=window.getSelection(),t=e.getRangeAt(0);return t},df.prototype.setSelection=function(e,t){var n=document.createRange();null===e?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t));var i=window.getSelection();i.removeAllRanges(),i.addRange(n)},hf.$inject=["eventBus","canvas"],hf.prototype.registerProvider=function(e){this._providers.push(e)},hf.prototype.isActive=function(e){return!(!this._active||e&&this._active.element!==e)},hf.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},hf.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})},hf.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0},hf.prototype.complete=function(){var e=this._active;if(e){var t,n=e.context.bounds,i=this.$textbox.getBoundingClientRect(),r=this.getValue(),o=e.context.text;r===o&&i.height===n.height&&i.width===n.width||(t=this._textbox.container.getBoundingClientRect(),e.provider.update(e.element,r,e.context.text,{x:i.left-t.left,y:i.top-t.top,width:i.width,height:i.height})),this._fire("complete"),this.close()}},hf.prototype.getValue=function(){return this._textbox.getValue()},hf.prototype._handleKey=function(e){e.stopPropagation();var t=e.keyCode||e.charCode;return 27===t?(e.preventDefault(),this.cancel()):13!==t||e.shiftKey?void 0:(e.preventDefault(),this.complete())},hf.prototype._handleResize=function(e){this._fire("resize",e)},hf.prototype.activate=function(e){var t;this.isActive()&&this.cancel();var n=w(this._providers,(function(n){return(t=n.activate(e))?n:null}));return t&&(this.$textbox=this._textbox.create(t.bounds,t.style,t.text,t.options),this._active={element:e,context:t,provider:n},t.options&&t.options.resizable&&(this.resizable=!0),this._fire("activate")),!!t};var mf={__depends__:[Qs],__init__:["directEditing"],directEditing:["type",hf]},vf=["marker-start","marker-mid","marker-end"],gf=["circle","ellipse","line","path","polygon","polyline","rect"];function yf(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._styles=i,this._clonedMarkers={};var r=this;t.on("drag.cleanup",(function(){C(r._clonedMarkers,(function(e){Ye(e)})),r._clonedMarkers={}}))}function bf(e,t,n){var i=xf(He(e,t));return De("marker#"+i,n||document)}function xf(e){return e.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]}function wf(e){return"url(#"+e+")"}function _f(e){return-1!==gf.indexOf(e.nodeName)}yf.$inject=["elementRegistry","eventBus","canvas","styles"],yf.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},yf.prototype.addDragger=function(e,t,n){n=n||this.getGfx(e);var i=Ze(n),r=n.getBoundingClientRect();return this._cloneMarkers(si(i)),He(i,this._styles.cls("djs-dragger",[],{x:r.top,y:r.left})),Ne(t,i),i},yf.prototype.addFrame=function(e,t){var n=nt("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return Ne(t,n),n},yf.prototype._cloneMarkers=function(e){var t=this;if(e.childNodes)for(var n=0;n<e.childNodes.length;n++)t._cloneMarkers(e.childNodes[n]);_f(e)&&vf.forEach((function(n){if(He(e,n)){var i=bf(e,n,t._canvas.getContainer());t._cloneMarker(e,i,n)}}))},yf.prototype._cloneMarker=function(e,t,n){var i=t.id,r=this._clonedMarkers[i];if(!r){r=Ze(t);var o=i+"-clone";r.id=o,qe(r).add("djs-dragger").add("djs-dragger-marker"),this._clonedMarkers[i]=r;var a=De("defs",this._canvas._svg);a||(a=nt("defs"),Ne(this._canvas._svg,a)),Ne(a,r)}var s=wf(this._clonedMarkers[i].id);He(e,n,s)};var Ef={__init__:["previewSupport"],previewSupport:["type",yf]},Cf="drop-ok",Sf="drop-not-ok",Af="attach-ok",Tf="new-parent",kf="create",Rf=2e3;function Pf(e,t,n,i,r){function o(e,t,n,i,o){if(!t)return!1;e=E(e,(function(t){var n=t.labelTarget;return!t.parent&&!(Of(t)&&-1!==e.indexOf(n))}));var a=w(e,(function(e){return!Mf(e)})),s=!1,c=!1,u=!1;Bf(e)&&(s=r.allowed("shape.attach",{position:n,shape:a,target:t})),s||(u=Bf(e)?r.allowed("shape.create",{position:n,shape:a,source:i,target:t}):r.allowed("elements.create",{elements:e,position:n,target:t}));var l=o.connectionTarget;return u||s?(a&&i&&(c=r.allowed("connection.create",{source:l===i?a:i,target:l===i?i:a,hints:{targetParent:t,targetAttach:s}})),{attach:s,connect:c}):(null===u||null===s)&&null}function a(t,n){[Af,Cf,Sf,Tf].forEach((function(i){i===n?e.addMarker(t,i):e.removeMarker(t,i)}))}function s(){var e=t.context();e&&e.prefix===kf&&t.cancel()}n.on(["create.move","create.hover"],(function(e){var t=e.context,n=t.elements,i=e.hover,r=t.source,s=t.hints||{};if(!i)return t.canExecute=!1,void(t.target=null);Df(e);var c={x:e.x,y:e.y},u=t.canExecute=i&&o(n,i,c,r,s);i&&null!==u&&(t.target=i,u&&u.attach?a(i,Af):a(i,u?Tf:Sf))})),n.on(["create.end","create.out","create.cleanup"],(function(e){var t=e.hover;t&&a(t,null)})),n.on("create.end",(function(e){var t=e.context,n=t.source,r=t.shape,o=t.elements,a=t.target,s=t.canExecute,c=s&&s.attach,u=s&&s.connect,l=t.hints||{};if(!1===s||!a)return!1;Df(e);var p={x:e.x,y:e.y};u?r=i.appendShape(n,r,p,a,{attach:c,connection:!0===u?{}:u,connectionTarget:l.connectionTarget}):(o=i.createElements(o,p,a,W({},l,{attach:c})),r=w(o,(function(e){return!Mf(e)}))),W(t,{elements:o,shape:r}),W(e,{elements:o,shape:r})})),n.on("create.init",(function(){n.on("elements.changed",s),n.once(["create.cancel","create.end"],Rf,(function(){n.off("elements.changed",s)}))})),this.start=function(e,n,i){h(n)||(n=[n]);var r=w(n,(function(e){return!Mf(e)}));if(r){i=W({elements:n,hints:{},shape:r},i||{}),C(n,(function(e){v(e.x)||(e.x=0),v(e.y)||(e.y=0)}));var o=E(n,(function(e){return!e.hidden})),a=Wt(o);C(n,(function(e){Mf(e)&&(e.waypoints=R(e.waypoints,(function(e){return{x:e.x-a.x-a.width/2,y:e.y-a.y-a.height/2}}))),W(e,{x:e.x-a.x-a.width/2,y:e.y-a.y-a.height/2})})),t.init(e,kf,{cursor:"grabbing",autoActivate:!0,data:{shape:r,elements:n,context:i}})}}}function Df(e){var t=e.context,n=t.createConstraints;n&&(n.left&&(e.x=Math.max(e.x,n.left)),n.right&&(e.x=Math.min(e.x,n.right)),n.top&&(e.y=Math.max(e.y,n.top)),n.bottom&&(e.y=Math.min(e.y,n.bottom)))}function Mf(e){return!!e.waypoints}function Bf(e){return e&&1===e.length&&!Mf(e[0])}function Of(e){return!!e.labelTarget}Pf.$inject=["canvas","dragging","eventBus","modeling","rules"];var jf=750;function Nf(e,t,n,i,r){function o(e){var t=nt("g");He(t,r.cls("djs-drag-group",["no-events"]));var o=nt("g");return e.forEach((function(e){var r;e.hidden||(e.waypoints?(r=n._createContainer("connection",o),n.drawConnection(si(r),e)):(r=n._createContainer("shape",o),n.drawShape(si(r),e),li(r,e.x,e.y)),i.addDragger(e,t,r))})),t}t.on("create.move",jf,(function(t){var n,i=t.hover,r=t.context,a=r.elements,s=r.dragGroup;s||(s=r.dragGroup=o(a)),i?(s.parentNode||(n=e.getActiveLayer(),Ne(n,s)),li(s,t.x,t.y)):Ye(s)})),t.on("create.cleanup",(function(e){var t=e.context,n=t.dragGroup;n&&Ye(n)}))}Nf.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];var Ff={__depends__:[Tp,Ef,Mp,pc],__init__:["create","createPreview"],create:["type",Pf],createPreview:["type",Nf]};function If(){}If.prototype.get=function(){return this._data},If.prototype.set=function(e){this._data=e},If.prototype.clear=function(){var e=this._data;return delete this._data,e},If.prototype.isEmpty=function(){return!this._data};var Lf={clipboard:["type",If]};function zf(e){var t=this;function n(e){t._lastMoveEvent=e}this._lastMoveEvent=null,e.on("canvas.init",(function(e){var i=t._svg=e.svg;i.addEventListener("mousemove",n)})),e.on("canvas.destroy",(function(){t._lastMouseEvent=null,t._svg.removeEventListener("mousemove",n)}))}function $f(e,t){var n=document.createEvent("MouseEvent"),i=e,r=t,o=e,a=t;return n.initMouseEvent&&n.initMouseEvent("mousemove",!0,!0,window,0,i,r,o,a,!1,!1,!1,!1,0,null),n}zf.$inject=["eventBus"],zf.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||$f(0,0)};var Hf={__init__:["mouse"],mouse:["type",zf]};function Gf(e,t,n,i,r,o,a,s){this._canvas=e,this._create=t,this._clipboard=n,this._elementFactory=i,this._eventBus=r,this._modeling=o,this._mouse=a,this._rules=s,r.on("copyPaste.copyElement",(function(e){var t=e.descriptor,n=e.element,i=e.elements;t.priority=1,t.id=n.id;var r=w(i,(function(e){return e===n.parent}));r&&(t.parent=n.parent.id),Vf(n)&&(t.priority=2,t.host=n.host.id),Wf(n)&&(t.priority=3,t.source=n.source.id,t.target=n.target.id,t.waypoints=qf(n)),Uf(n)&&(t.priority=4,t.labelTarget=n.labelTarget.id),C(["x","y","width","height"],(function(e){v(n[e])&&(t[e]=n[e])})),t.hidden=n.hidden,t.collapsed=n.collapsed})),r.on("copyPaste.pasteElements",(function(e){var t=e.hints;W(t,{createElementsBehavior:!1})}))}function Vf(e){return!!e.host}function Wf(e){return!!e.waypoints}function Uf(e){return!!e.labelTarget}function qf(e){return R(e.waypoints,(function(e){return e=Kf(e),e.original&&(e.original=Kf(e.original)),e}))}function Kf(e){return W({},e)}function Yf(e,t){var n=t.indexOf(e);return-1===n?t:t.splice(n,1)}Gf.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"],Gf.prototype.copy=function(e){var t,n;return h(e)||(e=e?[e]:[]),t=this._eventBus.fire("copyPaste.canCopyElements",{elements:e}),n=!1===t?{}:this.createTree(h(t)?t:e),this._clipboard.set(n),this._eventBus.fire("copyPaste.elementsCopied",{elements:e,tree:n}),n},Gf.prototype.paste=function(e){var t=this._clipboard.get();if(!this._clipboard.isEmpty()){var n=e&&e.hints||{};this._eventBus.fire("copyPaste.pasteElements",{hints:n});var i=this._createElements(t);if(e&&e.element&&e.point)return this._paste(i,e.element,e.point,n);this._create.start(this._mouse.getLastMoveEvent(),i,{hints:n||{}})}},Gf.prototype._paste=function(e,t,n,i){C(e,(function(e){v(e.x)||(e.x=0),v(e.y)||(e.y=0)}));var r=Wt(e);return C(e,(function(e){Wf(e)&&(e.waypoints=R(e.waypoints,(function(e){return{x:e.x-r.x-r.width/2,y:e.y-r.y-r.height/2}}))),W(e,{x:e.x-r.x-r.width/2,y:e.y-r.y-r.height/2})})),this._modeling.createElements(e,n,t,W({},i))},Gf.prototype._createElements=function(e){var t=this,n=this._eventBus,i={},r=[];return C(e,(function(e,o){o=parseInt(o,10),e=N(e,"priority"),C(e,(function(e){var o,a=W({},q(e,["priority"]));return i[e.parent]?a.parent=i[e.parent]:delete a.parent,n.fire("copyPaste.pasteElement",{cache:i,descriptor:a}),Wf(a)?(a.source=i[e.source],a.target=i[e.target],o=i[e.id]=t.createConnection(a),void r.push(o)):Uf(a)?(a.labelTarget=i[a.labelTarget],o=i[e.id]=t.createLabel(a),void r.push(o)):(a.host&&(a.host=i[a.host]),o=i[e.id]=t.createShape(a),void r.push(o))}))})),r},Gf.prototype.createConnection=function(e){var t=this._elementFactory.createConnection(q(e,["id"]));return t},Gf.prototype.createLabel=function(e){var t=this._elementFactory.createLabel(q(e,["id"]));return t},Gf.prototype.createShape=function(e){var t=this._elementFactory.createShape(q(e,["id"]));return t},Gf.prototype.hasRelations=function(e,t){var n,i,r;return!(Wf(e)&&(i=w(t,F({id:e.source.id})),r=w(t,F({id:e.target.id})),!i||!r))&&!(Uf(e)&&(n=w(t,F({id:e.labelTarget.id})),!n))},Gf.prototype.createTree=function(e){var t=this._rules,n=this,i={},r=[],o=It(e);function a(e,n){return t.allowed("element.copy",{element:e,elements:n})}function s(e,t){var n=w(r,(function(t){return e===t.element}));n?n.depth<t&&(r=c(n,r),r.push({element:n.element,depth:t})):r.push({element:e,depth:t})}function c(e,t){var n=t.indexOf(e);return-1!==n&&t.splice(n,1),t}return $t(o,(function(e,t,i){if(!Uf(e)){C(e.labels,(function(e){s(e,i)})),C([e.attachers,e.incoming,e.outgoing],o),s(e,i);var r=[];return e.children&&(r=e.children.slice()),n._eventBus.fire("copyPaste.createTree",{element:e,children:r}),r}function o(e){e&&e.length&&C(e,(function(e){C(e.labels,(function(e){s(e,i)})),s(e,i)}))}})),e=R(r,(function(e){return e.element})),r=R(r,(function(t){return t.descriptor={},n._eventBus.fire("copyPaste.copyElement",{descriptor:t.descriptor,element:t.element,elements:e}),t})),r=N(r,(function(e){return e.descriptor.priority})),e=R(r,(function(e){return e.element})),C(r,(function(t){var r=t.depth;n.hasRelations(t.element,e)&&a(t.element,e)?(i[r]||(i[r]=[]),i[r].push(t.descriptor)):Yf(t.element,e)})),i};var Xf={__depends__:[Lf,Ff,Hf,Mp],__init__:["copyPaste"],copyPaste:["type",Gf]};function Zf(e,t,n){h(n)||(n=[n]),C(n,(function(n){p(e[n])||(t[n]=e[n])}))}var Jf=750;function Qf(e,t,n){function i(t,i){var r=e.create(t.$type);return n.copyElement(t,r,null,i)}t.on("copyPaste.copyElement",Jf,(function(e){var t=e.descriptor,n=e.element,r=Xo(n);if(eh(n))return t;var o=t.businessObject=i(r,!0),a=t.di=i(Zo(n),!0);a.bpmnElement=o,Zf(o,t,"name"),Zf(a,t,"isExpanded"),r.default&&(t.default=r.default.id)}));var r="-bpmn-js-refs";function o(e){return e[r]=e[r]||{}}function a(e,t){e[r]=t}function s(e,t,n){var i=Xo(e);return e.default&&(n[e.default]={element:i,property:"default"}),e.host&&(Xo(e).attachedToRef=Xo(t[e.host])),q(n,A(n,(function(t,n,r){var o=n.element,a=n.property;return r===e.id&&(o[a]=i,t.push(e.id)),t}),[]))}t.on("copyPaste.pasteElement",(function(e){var t=e.cache,n=e.descriptor,r=n.businessObject,o=n.di;if(eh(n))return n.businessObject=Xo(t[n.labelTarget]),void(n.di=Zo(t[n.labelTarget]));r=n.businessObject=i(r),o=n.di=i(o),o.bpmnElement=r,Zf(n,r,["isExpanded","name"]),n.type=r.$type})),t.on("copyPaste.copyElement",Jf,(function(e){var t=e.descriptor,n=e.element;if(Ko(n,"bpmn:Participant")){var r=Xo(n);r.processRef&&(t.processRef=i(r.processRef,!0))}})),t.on("copyPaste.pasteElement",(function(e){var t=e.descriptor,n=t.processRef;n&&(t.processRef=i(n))})),t.on("copyPaste.pasteElement",Jf,(function(e){var t=e.cache,n=e.descriptor;a(t,s(n,t,o(t)))}))}function eh(e){return!!e.labelTarget}Qf.$inject=["bpmnFactory","eventBus","moddleCopy"];var th=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing","categoryValue"];function nh(e,t,n){this._bpmnFactory=t,this._eventBus=e,this._moddle=n,e.on("moddleCopy.canCopyProperties",(function(e){var t=e.propertyNames;if(t&&t.length)return N(t,(function(e){return"extensionElements"===e}))})),e.on("moddleCopy.canCopyProperty",(function(e){var t=e.parent,n=m(t)&&t.$descriptor,i=e.propertyName;return(!i||-1===th.indexOf(i))&&(!(i&&n&&!w(n.properties,F({name:i})))&&void 0)})),e.on("moddleCopy.canSetCopiedProperty",(function(e){var t=e.property;if(rh(t,"bpmn:ExtensionElements")&&(!t.values||!t.values.length))return!1}))}function ih(e,t){return A(e.properties,(function(e,n){return t&&n.default?e:e.concat(n.name)}),[])}function rh(e,t){return e&&"function"===typeof e.$instanceOf&&e.$instanceOf(t)}nh.$inject=["eventBus","bpmnFactory","moddle"],nh.prototype.copyElement=function(e,t,n,i){var r=this;n&&!h(n)&&(n=[n]),n=n||ih(e.$descriptor);var o=this._eventBus.fire("moddleCopy.canCopyProperties",{propertyNames:n,sourceElement:e,targetElement:t,clone:i});return!1===o||(h(o)&&(n=o),C(n,(function(n){var o;x(e,n)&&(o=e.get(n));var a=r.copyProperty(o,t,n,i);if(d(a)){var s=r._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent:t,property:a,propertyName:n});!1!==s&&t.set(n,a)}}))),t},nh.prototype.copyProperty=function(e,t,n,i){var r=this,o=this._eventBus.fire("moddleCopy.canCopyProperty",{parent:t,property:e,propertyName:n,clone:i});if(!1!==o){if(o)return m(o)&&o.$type&&!o.$parent&&(o.$parent=t),o;var a=this._moddle.getPropertyDescriptor(t,n);if(!a.isReference){if(a.isId)return e&&this._copyId(e,t,i);if(h(e))return A(e,(function(e,a){return o=r.copyProperty(a,t,n,i),o?e.concat(o):e}),[]);if(m(e)&&e.$type){if(this._moddle.getElementDescriptor(e).isGeneric)return;return o=r._bpmnFactory.create(e.$type),o.$parent=t,o=r.copyElement(e,o,null,i),o}return e}}},nh.prototype._copyId=function(e,t,n){return n?e:this._moddle.ids.assigned(e)?void 0:(this._moddle.ids.claim(e,t),e)};var oh={__depends__:[Xf],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",Qf],moddleCopy:["type",nh]},ah=Math.round;function sh(e){this._modeling=e}sh.$inject=["modeling"],sh.prototype.replaceElement=function(e,t,n){if(e.waypoints)return null;var i=this._modeling,r=t.width||e.width,o=t.height||e.height,a=t.x||e.x,s=t.y||e.y,c=ah(a+r/2),u=ah(s+o/2);return i.replaceShape(e,W({},t,{x:c,y:u,width:r,height:o}),n)};var ch={__init__:["replace"],replace:["type",sh]};function uh(e,t,n){h(n)||(n=[n]),C(n,(function(n){p(e[n])||(t[n]=e[n])}))}var lh=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function ph(e,t){var n,i=e&&x(e,"collapsed")?e.collapsed:!wa(e);return n=t&&(x(t,"collapsed")||x(t,"isExpanded"))?x(t,"collapsed")?t.collapsed:!t.isExpanded:i,i!==n}function dh(e,t,n,i,r,o,a){function s(s,c,u){u=u||{};var l=c.type,p=s.businessObject;if(fh(p)&&"bpmn:SubProcess"===l&&ph(s,c))return i.toggleCollapse(s),s;var d=e.create(l),f={type:l,businessObject:d,di:{}};uh(s.di,f.di,["fill","stroke","background-color","border-color","color"]);var h=ih(p.$descriptor),m=ih(d.$descriptor,!0),v=mh(h,m);W(d,U(c,lh));var g=E(v,(function(e){return"eventDefinitions"===e?hh(s,c.eventDefinitionType):"loopCharacteristics"===e?!Ea(d):!x(d,e)&&(("processRef"!==e||!1!==c.isExpanded)&&"triggeredByEvent"!==e)}));if(d=n.copyElement(p,d,g),c.eventDefinitionType&&(hh(d,c.eventDefinitionType)||(f.eventDefinitionType=c.eventDefinitionType,f.eventDefinitionAttrs=c.eventDefinitionAttrs)),Ko(p,"bpmn:Activity")){if(fh(p))f.isExpanded=wa(s);else if(c&&x(c,"isExpanded")){f.isExpanded=c.isExpanded;var y=t.getDefaultSize(d,{isExpanded:f.isExpanded});f.width=y.width,f.height=y.height,f.x=s.x-(f.width-s.width)/2,f.y=s.y-(f.height-s.height)/2}wa(s)&&!Ko(p,"bpmn:Task")&&f.isExpanded&&(f.width=s.width,f.height=s.height)}return fh(p)&&!fh(d)&&(u.moveChildren=!1),Ko(p,"bpmn:Participant")&&(!0===c.isExpanded?d.processRef=e.create("bpmn:Process"):u.moveChildren=!1,f.width=s.width,f.height=t.getDefaultSize(f).height),o.allowed("shape.resize",{shape:d})||(f.height=t.getDefaultSize(f).height,f.width=t.getDefaultSize(f).width),d.name=p.name,Yo(p,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&Yo(d,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&(d.default=p.default),c.host&&!Ko(p,"bpmn:BoundaryEvent")&&Ko(d,"bpmn:BoundaryEvent")&&(f.host=c.host),"bpmn:DataStoreReference"!==f.type&&"bpmn:DataObjectReference"!==f.type||(f.x=s.x+(s.width-f.width)/2),f=r.replaceElement(s,f,u),!1!==u.select&&a.select(f),f}this.replaceElement=s}function fh(e){return Ko(e,"bpmn:SubProcess")}function hh(e,t){var n=Xo(e);return t&&n.get("eventDefinitions").some((function(e){return Ko(e,t)}))}function mh(e,t){return e.filter((function(e){return-1!==t.indexOf(e)}))}dh.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules","selection"];var vh={__depends__:[oh,ch,pc],bpmnReplace:["type",dh]};function gh(e){return function(t){var n=t.target,i=Xo(e),r=i.eventDefinitions&&i.eventDefinitions[0],o=i.$type===n.type,a=(r&&r.$type)===n.eventDefinitionType,s=i.triggeredByEvent===n.triggeredByEvent,c=void 0===n.isExpanded||n.isExpanded===wa(e);return!o||!a||!s||!c}}var yh=[{label:"Start Event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message Start Event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer Start Event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Conditional Start Event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Signal Start Event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],bh=[{label:"Start Event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}}],xh=[{label:"Start Event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message Intermediate Catch Event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message Intermediate Throw Event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer Intermediate Catch Event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Escalation Intermediate Throw Event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Conditional Intermediate Catch Event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Link Intermediate Catch Event",actionName:"replace-with-link-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-link",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Link Intermediate Throw Event",actionName:"replace-with-link-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-link",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Compensation Intermediate Throw Event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal Intermediate Catch Event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal Intermediate Throw Event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],wh=[{label:"Start Event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message End Event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Escalation End Event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Error End Event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Cancel End Event",actionName:"replace-with-cancel-end",className:"bpmn-icon-end-event-cancel",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},{label:"Compensation End Event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal End Event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Terminate End Event",actionName:"replace-with-terminate-end",className:"bpmn-icon-end-event-terminate",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:TerminateEventDefinition"}}],_h=[{label:"Exclusive Gateway",actionName:"replace-with-exclusive-gateway",className:"bpmn-icon-gateway-xor",target:{type:"bpmn:ExclusiveGateway"}},{label:"Parallel Gateway",actionName:"replace-with-parallel-gateway",className:"bpmn-icon-gateway-parallel",target:{type:"bpmn:ParallelGateway"}},{label:"Inclusive Gateway",actionName:"replace-with-inclusive-gateway",className:"bpmn-icon-gateway-or",target:{type:"bpmn:InclusiveGateway"}},{label:"Complex Gateway",actionName:"replace-with-complex-gateway",className:"bpmn-icon-gateway-complex",target:{type:"bpmn:ComplexGateway"}},{label:"Event based Gateway",actionName:"replace-with-event-based-gateway",className:"bpmn-icon-gateway-eventbased",target:{type:"bpmn:EventBasedGateway",instantiate:!1,eventGatewayType:"Exclusive"}}],Eh=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event Sub Process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Sub Process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}}],Ch=[{label:"Sub Process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Event Sub Process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}}],Sh=[{label:"Sub Process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}}],Ah=[{label:"Task",actionName:"replace-with-task",className:"bpmn-icon-task",target:{type:"bpmn:Task"}},{label:"Send Task",actionName:"replace-with-send-task",className:"bpmn-icon-send",target:{type:"bpmn:SendTask"}},{label:"Receive Task",actionName:"replace-with-receive-task",className:"bpmn-icon-receive",target:{type:"bpmn:ReceiveTask"}},{label:"User Task",actionName:"replace-with-user-task",className:"bpmn-icon-user",target:{type:"bpmn:UserTask"}},{label:"Manual Task",actionName:"replace-with-manual-task",className:"bpmn-icon-manual",target:{type:"bpmn:ManualTask"}},{label:"Business Rule Task",actionName:"replace-with-rule-task",className:"bpmn-icon-business-rule",target:{type:"bpmn:BusinessRuleTask"}},{label:"Service Task",actionName:"replace-with-service-task",className:"bpmn-icon-service",target:{type:"bpmn:ServiceTask"}},{label:"Script Task",actionName:"replace-with-script-task",className:"bpmn-icon-script",target:{type:"bpmn:ScriptTask"}},{label:"Call Activity",actionName:"replace-with-call-activity",className:"bpmn-icon-call-activity",target:{type:"bpmn:CallActivity"}},{label:"Sub Process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}},{label:"Sub Process (expanded)",actionName:"replace-with-expanded-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}}],Th=[{label:"Data Store Reference",actionName:"replace-with-data-store-reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}}],kh=[{label:"Data Object Reference",actionName:"replace-with-data-object-reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}}],Rh=[{label:"Message Boundary Event",actionName:"replace-with-message-boundary",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer Boundary Event",actionName:"replace-with-timer-boundary",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Escalation Boundary Event",actionName:"replace-with-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Conditional Boundary Event",actionName:"replace-with-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Error Boundary Event",actionName:"replace-with-error-boundary",className:"bpmn-icon-intermediate-event-catch-error",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Cancel Boundary Event",actionName:"replace-with-cancel-boundary",className:"bpmn-icon-intermediate-event-catch-cancel",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},{label:"Signal Boundary Event",actionName:"replace-with-signal-boundary",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Compensation Boundary Event",actionName:"replace-with-compensation-boundary",className:"bpmn-icon-intermediate-event-catch-compensation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Message Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-message-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!1}},{label:"Timer Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!1}},{label:"Escalation Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!1}},{label:"Conditional Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!1}},{label:"Signal Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!1}}],Ph=[{label:"Message Start Event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer Start Event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Conditional Start Event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Signal Start Event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Error Start Event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Escalation Start Event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Compensation Start Event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Message Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-message-start",className:"bpmn-icon-start-event-non-interrupting-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!1}},{label:"Timer Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-start",className:"bpmn-icon-start-event-non-interrupting-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!1}},{label:"Conditional Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-start",className:"bpmn-icon-start-event-non-interrupting-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!1}},{label:"Signal Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-start",className:"bpmn-icon-start-event-non-interrupting-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!1}},{label:"Escalation Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-start",className:"bpmn-icon-start-event-non-interrupting-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!1}}],Dh=[{label:"Sequence Flow",actionName:"replace-with-sequence-flow",className:"bpmn-icon-connection"},{label:"Default Flow",actionName:"replace-with-default-flow",className:"bpmn-icon-default-flow"},{label:"Conditional Flow",actionName:"replace-with-conditional-flow",className:"bpmn-icon-conditional-flow"}],Mh=[{label:"Expanded Pool",actionName:"replace-with-expanded-pool",className:"bpmn-icon-participant",target:{type:"bpmn:Participant",isExpanded:!0}},{label:function(e){var t="Empty Pool";return e.children&&e.children.length&&(t+=" (removes content)"),t},actionName:"replace-with-collapsed-pool",className:"bpmn-icon-lane",target:{type:"bpmn:Participant",isExpanded:!1}}];function Bh(e,t,n,i,r,o,a){this._bpmnFactory=e,this._popupMenu=t,this._modeling=n,this._moddle=i,this._bpmnReplace=r,this._rules=o,this._translate=a,this.register()}Bh.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate"],Bh.prototype.register=function(){this._popupMenu.registerProvider("bpmn-replace",this)},Bh.prototype.getEntries=function(e){var t,n=e.businessObject,i=this._rules;if(!i.allowed("shape.replace",{element:e}))return[];var r=gh(e);return Ko(n,"bpmn:DataObjectReference")?this._createEntries(e,Th):Ko(n,"bpmn:DataStoreReference")&&!Ko(e.parent,"bpmn:Collaboration")?this._createEntries(e,kh):Ko(n,"bpmn:StartEvent")&&!Ko(n.$parent,"bpmn:SubProcess")?(t=E(yh,r),this._createEntries(e,t)):Ko(n,"bpmn:Participant")?(t=E(Mh,(function(t){return wa(e)!==t.target.isExpanded})),this._createEntries(e,t)):Ko(n,"bpmn:StartEvent")&&Ea(n.$parent)?(t=E(Ph,(function(t){var n=t.target,i=!1!==n.isInterrupting,o=Xo(e).isInterrupting===i;return r(t)||!r(t)&&!o})),this._createEntries(e,t)):Ko(n,"bpmn:StartEvent")&&!Ea(n.$parent)&&Ko(n.$parent,"bpmn:SubProcess")?(t=E(bh,r),this._createEntries(e,t)):Ko(n,"bpmn:EndEvent")?(t=E(wh,(function(e){var t=e.target;return!("bpmn:CancelEventDefinition"==t.eventDefinitionType&&!Ko(n.$parent,"bpmn:Transaction"))&&r(e)})),this._createEntries(e,t)):Ko(n,"bpmn:BoundaryEvent")?(t=E(Rh,(function(e){var t=e.target;if("bpmn:CancelEventDefinition"==t.eventDefinitionType&&!Ko(n.attachedToRef,"bpmn:Transaction"))return!1;var i=!1!==t.cancelActivity,o=n.cancelActivity==i;return r(e)||!r(e)&&!o})),this._createEntries(e,t)):Ko(n,"bpmn:IntermediateCatchEvent")||Ko(n,"bpmn:IntermediateThrowEvent")?(t=E(xh,r),this._createEntries(e,t)):Ko(n,"bpmn:Gateway")?(t=E(_h,r),this._createEntries(e,t)):Ko(n,"bpmn:Transaction")?(t=E(Ch,r),this._createEntries(e,t)):Ea(n)&&wa(e)?(t=E(Sh,r),this._createEntries(e,t)):Ko(n,"bpmn:SubProcess")&&wa(e)?(t=E(Eh,r),this._createEntries(e,t)):Ko(n,"bpmn:AdHocSubProcess")&&!wa(e)?(t=E(Ah,(function(t){var n=t.target,i="bpmn:SubProcess"===n.type,r=!0===n.isExpanded;return gh(e,n)&&(!i||r)})),this._createEntries(e,t)):Ko(n,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(e,Dh):Ko(n,"bpmn:FlowNode")?(t=E(Ah,r),Ko(n,"bpmn:SubProcess")&&!wa(e)&&(t=E(t,(function(e){return"Sub Process (collapsed)"!==e.label}))),this._createEntries(e,t)):[]},Bh.prototype.getHeaderEntries=function(e){var t=[];return Ko(e,"bpmn:Activity")&&!Ea(e)&&(t=t.concat(this._getLoopEntries(e))),Ko(e,"bpmn:DataObjectReference")&&(t=t.concat(this._getDataObjectIsCollection(e))),Ko(e,"bpmn:Participant")&&(t=t.concat(this._getParticipantMultiplicity(e))),!Ko(e,"bpmn:SubProcess")||Ko(e,"bpmn:Transaction")||Ea(e)||t.push(this._getAdHocEntry(e)),t},Bh.prototype._createEntries=function(e,t){var n=[],i=this;return C(t,(function(t){var r=i._createMenuEntry(t,e);n.push(r)})),n},Bh.prototype._createSequenceFlowEntries=function(e,t){var n=Xo(e),i=[],r=this._modeling,o=this._moddle,a=this;return C(t,(function(t){switch(t.actionName){case"replace-with-default-flow":n.sourceRef.default!==n&&(Ko(n.sourceRef,"bpmn:ExclusiveGateway")||Ko(n.sourceRef,"bpmn:InclusiveGateway")||Ko(n.sourceRef,"bpmn:ComplexGateway")||Ko(n.sourceRef,"bpmn:Activity"))&&i.push(a._createMenuEntry(t,e,(function(){r.updateProperties(e.source,{default:n})})));break;case"replace-with-conditional-flow":!n.conditionExpression&&Ko(n.sourceRef,"bpmn:Activity")&&i.push(a._createMenuEntry(t,e,(function(){var t=o.create("bpmn:FormalExpression",{body:""});r.updateProperties(e,{conditionExpression:t})})));break;default:if(Ko(n.sourceRef,"bpmn:Activity")&&n.conditionExpression)return i.push(a._createMenuEntry(t,e,(function(){r.updateProperties(e,{conditionExpression:void 0})})));if((Ko(n.sourceRef,"bpmn:ExclusiveGateway")||Ko(n.sourceRef,"bpmn:InclusiveGateway")||Ko(n.sourceRef,"bpmn:ComplexGateway")||Ko(n.sourceRef,"bpmn:Activity"))&&n.sourceRef.default===n)return i.push(a._createMenuEntry(t,e,(function(){r.updateProperties(e.source,{default:void 0})})))}})),i},Bh.prototype._createMenuEntry=function(e,t,n){var i=this._translate,r=this._bpmnReplace.replaceElement,o=function(){return r(t,e.target)},a=e.label;a&&"function"===typeof a&&(a=a(t)),n=n||o;var s={label:i(a),className:e.className,id:e.actionName,action:n};return s},Bh.prototype._getLoopEntries=function(e){var t=this,n=this._translate;function i(n,i){var r=Xo(e).loopCharacteristics;i.active?r=void 0:(!p(i.options.isSequential)&&r&&Ko(r,i.options.loopCharacteristics)||(r=t._moddle.create(i.options.loopCharacteristics)),r.isSequential=i.options.isSequential),t._modeling.updateProperties(e,{loopCharacteristics:r})}var r,o,a,s=Xo(e),c=s.loopCharacteristics;c&&(r=c.isSequential,o=void 0===c.isSequential,a=void 0!==c.isSequential&&!c.isSequential);var u=[{id:"toggle-parallel-mi",className:"bpmn-icon-parallel-mi-marker",title:n("Parallel Multi Instance"),active:a,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!1}},{id:"toggle-sequential-mi",className:"bpmn-icon-sequential-mi-marker",title:n("Sequential Multi Instance"),active:r,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!0}},{id:"toggle-loop",className:"bpmn-icon-loop-marker",title:n("Loop"),active:o,action:i,options:{loopCharacteristics:"bpmn:StandardLoopCharacteristics"}}];return u},Bh.prototype._getDataObjectIsCollection=function(e){var t=this,n=this._translate;function i(n,i){t._modeling.updateModdleProperties(e,r,{isCollection:!i.active})}var r=e.businessObject.dataObjectRef,o=r.isCollection,a=[{id:"toggle-is-collection",className:"bpmn-icon-parallel-mi-marker",title:n("Collection"),active:o,action:i}];return a},Bh.prototype._getParticipantMultiplicity=function(e){var t=this,n=this._bpmnFactory,i=this._translate;function r(i,r){var o,a=r.active;a||(o=n.create("bpmn:ParticipantMultiplicity")),t._modeling.updateProperties(e,{participantMultiplicity:o})}var o=e.businessObject.participantMultiplicity,a=[{id:"toggle-participant-multiplicity",className:"bpmn-icon-parallel-mi-marker",title:i("Participant Multiplicity"),active:!!o,action:r}];return a},Bh.prototype._getAdHocEntry=function(e){var t=this._translate,n=Xo(e),i=Ko(n,"bpmn:AdHocSubProcess"),r=this._bpmnReplace.replaceElement,o={id:"toggle-adhoc",className:"bpmn-icon-ad-hoc-marker",title:t("Ad-hoc"),active:i,action:function(t,n){return r(e,i?{type:"bpmn:SubProcess"}:{type:"bpmn:AdHocSubProcess"},{autoResize:!1,layoutConnection:!1})}};return o};var Oh={__depends__:[Rl,vh],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",Bh]};function jh(e,t){"string"===typeof t&&(t=[t]);while(e=e.parent)if(Yo(e,t))return e;return null}var Nh=Math.max,Fh=Math.min,Ih=20;function Lh(e,t){return{top:e.top-t.top,right:e.right-t.right,bottom:e.bottom-t.bottom,left:e.left-t.left}}function zh(e,t,n){var i=n.x,r=n.y,o={x:e.x,y:e.y,width:e.width,height:e.height};return-1!==t.indexOf("n")?(o.y=e.y+r,o.height=e.height-r):-1!==t.indexOf("s")&&(o.height=e.height+r),-1!==t.indexOf("e")?o.width=e.width+i:-1!==t.indexOf("w")&&(o.x=e.x+i,o.width=e.width-i),o}function $h(e,t){return{x:e.x+(t.left||0),y:e.y+(t.top||0),width:e.width-(t.left||0)+(t.right||0),height:e.height-(t.top||0)+(t.bottom||0)}}function Hh(e,t,n){var i=t[e],r=n.min&&n.min[e],o=n.max&&n.max[e];return v(r)&&(i=(/top|left/.test(e)?Fh:Nh)(i,r)),v(o)&&(i=(/top|left/.test(e)?Nh:Fh)(i,o)),i}function Gh(e,t){if(!t)return e;var n=vn(e);return gn({top:Hh("top",n,t),right:Hh("right",n,t),bottom:Hh("bottom",n,t),left:Hh("left",n,t)})}function Vh(e,t,n,i){var r=vn(t),o={top:/n/.test(e)?r.bottom-n.height:r.top,left:/w/.test(e)?r.right-n.width:r.left,bottom:/s/.test(e)?r.top+n.height:r.bottom,right:/e/.test(e)?r.left+n.width:r.right},a=i?vn(i):o,s={top:Fh(o.top,a.top),left:Fh(o.left,a.left),bottom:Nh(o.bottom,a.bottom),right:Nh(o.right,a.right)};return gn(s)}function Wh(e,t){return"undefined"!==typeof e?e:Ih}function Uh(e,t){var n,i,r,o;return"object"===typeof t?(n=Wh(t.left),i=Wh(t.right),r=Wh(t.top),o=Wh(t.bottom)):n=i=r=o=Wh(t),{x:e.x-n,y:e.y-r,width:e.width+n+i,height:e.height+r+o}}function qh(e){return!e.waypoints&&"label"!==e.type}function Kh(e,t){var n;if(n=void 0===e.length?E(e.children,qh):e,n.length)return Uh(Wt(n),t)}var Yh=Math.abs;function Xh(e,t){return Lh(vn(t),vn(e))}var Zh=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],Jh=30;function Qh(e,t){return t=t||[],e.children.filter((function(e){Ko(e,"bpmn:Lane")&&(Qh(e,t),t.push(e))})),t}function em(e){return e.children.filter((function(e){return Ko(e,"bpmn:Lane")}))}function tm(e){return jh(e,Zh)||e}function nm(e,t){var n=tm(e),i=Ko(n,"bpmn:Process")?[]:[n],r=Qh(n,i),o=vn(e),a=vn(t),s=Xh(e,t),c=[];return r.forEach((function(t){if(t!==e){var n=0,i=s.right,r=0,u=s.left,l=vn(t);s.top&&(Yh(l.bottom-o.top)<10&&(r=a.top-l.bottom),Yh(l.top-o.top)<5&&(n=a.top-l.top)),s.bottom&&(Yh(l.top-o.bottom)<10&&(n=a.bottom-l.top),Yh(l.bottom-o.bottom)<5&&(r=a.bottom-l.bottom)),(n||i||r||u)&&c.push({shape:t,newBounds:$h(t,{top:n,right:i,bottom:r,left:u})})}})),c}function im(e,t,n,i,r,o,a,s,c,u,l,p){e=e||{},i.registerProvider(this),this._contextPad=i,this._modeling=r,this._elementFactory=o,this._connect=a,this._create=s,this._popupMenu=c,this._canvas=u,this._rules=l,this._translate=p,!1!==e.autoPlace&&(this._autoPlace=t.get("autoPlace",!1)),n.on("create.end",250,(function(e){var t=e.context,n=t.shape;if(qs(e)&&i.isOpen(n)){var r=i.getEntries(n);r.replace&&r.replace.action.click(e,n)}}))}function rm(e,t,n){var i=e.$instanceOf(t),r=!1,o=e.eventDefinitions||[];return C(o,(function(e){e.$type===n&&(r=!0)})),i&&r}function om(e,t){return-1!==e.indexOf(t)}im.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate"],im.prototype.getMultiElementContextPadEntries=function(e){var t=this._modeling,n={};return this._isDeleteAllowed(e)&&W(n,{delete:{group:"edit",className:"bpmn-icon-trash",title:this._translate("Remove"),action:{click:function(e,n){t.removeElements(n.slice())}}}}),n},im.prototype._isDeleteAllowed=function(e){var t=this._rules.allowed("elements.delete",{elements:e});return h(t)?T(t,(function(e){return om(t,e)})):t},im.prototype.getContextPadEntries=function(e){var t=this._contextPad,n=this._modeling,i=this._elementFactory,r=this._connect,o=this._create,a=this._popupMenu,s=this._canvas,c=this._rules,u=this._autoPlace,l=this._translate,p={};if("label"===e.type)return p;var d=e.businessObject;function f(e,t){r.start(e,t)}function m(e,t){n.removeElements([t])}function v(e){var n=5,i=s.getContainer(),r=t.getPad(e).html,o=i.getBoundingClientRect(),a=r.getBoundingClientRect(),c=a.top-o.top,u=a.left-o.left,l={x:u,y:c+a.height+n};return l}function g(e,t,n,r){function a(t,n){var a=i.createShape(W({type:e},r));o.start(t,a,{source:n})}"string"!==typeof n&&(r=n,n=l("Append {type}",{type:e.replace(/^bpmn:/,"")}));var s=u?function(t,n){var o=i.createShape(W({type:e},r));u.append(n,o)}:a;return{group:"model",className:t,title:n,action:{dragstart:a,click:s}}}function y(e){return function(i,r){n.splitLane(r,e),t.open(r,!0)}}if(Yo(d,["bpmn:Lane","bpmn:Participant"])&&wa(e)){var b=em(e);W(p,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:l("Add Lane above"),action:{click:function(e,t){n.addLane(t,"top")}}}}),b.length<2&&(e.height>=120&&W(p,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:l("Divide into two Lanes"),action:{click:y(2)}}}),e.height>=180&&W(p,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:l("Divide into three Lanes"),action:{click:y(3)}}})),W(p,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:l("Add Lane below"),action:{click:function(e,t){n.addLane(t,"bottom")}}}})}Ko(d,"bpmn:FlowNode")&&(Ko(d,"bpmn:EventBasedGateway")?W(p,{"append.receive-task":g("bpmn:ReceiveTask","bpmn-icon-receive-task",l("Append ReceiveTask")),"append.message-intermediate-event":g("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",l("Append MessageIntermediateCatchEvent"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":g("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",l("Append TimerIntermediateCatchEvent"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":g("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",l("Append ConditionIntermediateCatchEvent"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":g("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",l("Append SignalIntermediateCatchEvent"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):rm(d,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?W(p,{"append.compensation-activity":g("bpmn:Task","bpmn-icon-task",l("Append compensation activity"),{isForCompensation:!0})}):Ko(d,"bpmn:EndEvent")||d.isForCompensation||rm(d,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")||Ea(d)||W(p,{"append.end-event":g("bpmn:EndEvent","bpmn-icon-end-event-none",l("Append EndEvent")),"append.gateway":g("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",l("Append Gateway")),"append.append-task":g("bpmn:Task","bpmn-icon-task",l("Append Task")),"append.intermediate-event":g("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",l("Append Intermediate/Boundary Event"))})),a.isEmpty(e,"bpmn-replace")||W(p,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:l("Change type"),action:{click:function(e,t){var n=W(v(t),{cursor:{x:e.x,y:e.y}});a.open(t,"bpmn-replace",n)}}}}),Ko(d,"bpmn:SequenceFlow")&&W(p,{"append.text-annotation":g("bpmn:TextAnnotation","bpmn-icon-text-annotation")}),Yo(d,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&W(p,{"append.text-annotation":g("bpmn:TextAnnotation","bpmn-icon-text-annotation"),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:l("Connect using "+(d.isForCompensation?"":"Sequence/MessageFlow or ")+"Association"),action:{click:f,dragstart:f}}}),Ko(d,"bpmn:TextAnnotation")&&W(p,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:l("Connect using Association"),action:{click:f,dragstart:f}}}),Yo(d,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&W(p,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:l("Connect using DataInputAssociation"),action:{click:f,dragstart:f}}}),Ko(d,"bpmn:Group")&&W(p,{"append.text-annotation":g("bpmn:TextAnnotation","bpmn-icon-text-annotation")});var x=c.allowed("elements.delete",{elements:[e]});return h(x)&&(x=x[0]===e),x&&W(p,{delete:{group:"edit",className:"bpmn-icon-trash",title:l("Remove"),action:{click:m}}}),p};var am={__depends__:[mf,El,pc,Qd,Ff,Oh],__init__:["contextPadProvider"],contextPadProvider:["type",im]},sm={horizontal:["x","width"],vertical:["y","height"]},cm=5;function um(e,t){this._modeling=e,this._filters=[],this.registerFilter((function(e){var n=t.allowed("elements.distribute",{elements:e});return h(n)?n:n?e:[]}))}um.$inject=["modeling","rules"],um.prototype.registerFilter=function(e){if("function"!==typeof e)throw new Error("the filter has to be a function");this._filters.push(e)},um.prototype.trigger=function(e,t){var n,i,r=this._modeling;if(!(e.length<3)&&(this._setOrientation(t),i=this._filterElements(e),n=this._createGroups(i),!(n.length<=2)))return r.distributeElements(n,this._axis,this._dimension),n},um.prototype._filterElements=function(e){var t=this._filters,n=this._axis,i=this._dimension,r=[].concat(e);return t.length?(C(t,(function(e){r=e(r,n,i)})),r):e},um.prototype._createGroups=function(e){var t=[],n=this,i=this._axis,r=this._dimension;if(!i)throw new Error('must have a defined "axis" and "dimension"');var o=N(e,i);return C(o,(function(e,o){var a,s=n._findRange(e,i,r),c=t[t.length-1];c&&n._hasIntersection(c.range,s)?t[t.length-1].elements.push(e):(a={range:s,elements:[e]},t.push(a))})),t},um.prototype._setOrientation=function(e){var t=sm[e];this._axis=t[0],this._dimension=t[1]},um.prototype._hasIntersection=function(e,t){return Math.max(e.min,e.max)>=Math.min(t.min,t.max)&&Math.min(e.min,e.max)<=Math.max(t.min,t.max)},um.prototype._findRange=function(e){var t=e[this._axis],n=e[this._dimension];return{min:t+cm,max:t+n-cm}};var lm={__init__:["distributeElements"],distributeElements:["type",um]};function pm(e,t,n){Nl.call(this,t)}pm.$inject=["distributeElements","eventBus","rules"],i(pm,Nl),pm.prototype.init=function(){this.addRule("elements.distribute",(function(e){var t=e.elements;return t=E(t,(function(e){var t=Yo(e,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(e.labelTarget||t)})),t=It(t),!(t.length<3)&&t}))};var dm={horizontal:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201800%201800%22%3E%3Cpath%20style%3D%22fill%3Anone%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%3Bstroke-linejoin%3Around%22%20d%3D%22M450%20400V150h900v250%22%2F%3E%3Crect%20x%3D%22150%22%20y%3D%22450%22%20width%3D%22600%22%20height%3D%221200%22%20rx%3D%221%22%20style%3D%22fill%3Anone%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%22%2F%3E%3Crect%20x%3D%221050%22%20y%3D%22450%22%20width%3D%22600%22%20height%3D%22800%22%20rx%3D%221%22%20style%3D%22fill%3AcurrentColor%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%3Bopacity%3A.5%22%2F%3E%3C%2Fsvg%3E",vertical:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201800%201800%22%3E%3Cpath%20style%3D%22fill%3Anone%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%3Bstroke-linejoin%3Around%22%20d%3D%22M400%201350H150V450h250%22%2F%3E%3Crect%20x%3D%22450%22%20y%3D%22150%22%20width%3D%221200%22%20height%3D%22600%22%20rx%3D%221%22%20style%3D%22fill%3Anone%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%22%2F%3E%3Crect%20x%3D%22450%22%20y%3D%221050%22%20width%3D%22800%22%20height%3D%22600%22%20rx%3D%221%22%20style%3D%22fill%3AcurrentColor%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%3Bopacity%3A.5%22%2F%3E%3C%2Fsvg%3E"},fm=dm,hm=900;function mm(e,t,n,i){this._distributeElements=t,this._translate=n,this._popupMenu=e,this._rules=i,e.registerProvider("align-elements",hm,this)}mm.$inject=["popupMenu","distributeElements","translate","rules"],mm.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&W(t,this._getEntries(e)),t},mm.prototype._isAllowed=function(e){return this._rules.allowed("elements.distribute",{elements:e})},mm.prototype._getEntries=function(e){var t=this._distributeElements,n=this._translate,i=this._popupMenu,r={"distribute-elements-horizontal":{group:"distribute",title:n("Distribute elements horizontally"),className:"bjs-align-elements-menu-entry",imageUrl:fm["horizontal"],action:function(n,r){t.trigger(e,"horizontal"),i.close()}},"distribute-elements-vertical":{group:"distribute",title:n("Distribute elements vertically"),imageUrl:fm["vertical"],action:function(n,r){t.trigger(e,"vertical"),i.close()}}};return r};var vm={__depends__:[Rl,lm],__init__:["bpmnDistributeElements","distributeElementsMenuProvider"],bpmnDistributeElements:["type",pm],distributeElementsMenuProvider:["type",mm]},gm="is not a registered action",ym="is already registered";function bm(e,t){this._actions={};var n=this;e.on("diagram.init",(function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})}))}function xm(e,t){return new Error(e+" "+t)}bm.$inject=["eventBus","injector"],bm.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),n=e.get("modeling",!1),i=e.get("selection",!1),r=e.get("zoomScroll",!1),o=e.get("copyPaste",!1),a=e.get("canvas",!1),s=e.get("rules",!1),c=e.get("keyboardMove",!1),u=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",(function(){t.undo()})),this.register("redo",(function(){t.redo()}))),o&&i&&this.register("copy",(function(){var e=i.get();if(e.length)return o.copy(e)})),o&&this.register("paste",(function(){o.paste()})),r&&this.register("stepZoom",(function(e){r.stepZoom(e.value)})),a&&this.register("zoom",(function(e){a.zoom(e.value)})),n&&i&&s&&this.register("removeSelection",(function(){var e=i.get();if(e.length){var t,r=s.allowed("elements.delete",{elements:e});!1!==r&&(t=h(r)?r:e,t.length&&n.removeElements(t.slice()))}})),c&&this.register("moveCanvas",(function(e){c.moveCanvas(e)})),u&&this.register("moveSelection",(function(e){u.moveSelection(e.direction,e.accelerated)}))},bm.prototype.trigger=function(e,t){if(!this._actions[e])throw xm(e,gm);return this._actions[e](t)},bm.prototype.register=function(e,t){var n=this;if("string"===typeof e)return this._registerAction(e,t);C(e,(function(e,t){n._registerAction(t,e)}))},bm.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw xm(e,ym);this._actions[e]=t},bm.prototype.unregister=function(e){if(!this.isRegistered(e))throw xm(e,gm);this._actions[e]=void 0},bm.prototype.getActions=function(){return Object.keys(this._actions)},bm.prototype.isRegistered=function(e){return!!this._actions[e]};var wm={__init__:["editorActions"],editorActions:["type",bm]};function _m(e){e.invoke(bm,this)}i(_m,bm),_m.$inject=["injector"],_m.prototype._registerDefaultActions=function(e){bm.prototype._registerDefaultActions.call(this,e);var t=e.get("canvas",!1),n=e.get("elementRegistry",!1),i=e.get("selection",!1),r=e.get("spaceTool",!1),o=e.get("lassoTool",!1),a=e.get("handTool",!1),s=e.get("globalConnect",!1),c=e.get("distributeElements",!1),u=e.get("alignElements",!1),l=e.get("directEditing",!1),p=e.get("searchPad",!1),d=e.get("modeling",!1);t&&n&&i&&this._registerAction("selectElements",(function(){var e=t.getRootElement(),r=n.filter((function(t){return t!==e}));return i.select(r),r})),r&&this._registerAction("spaceTool",(function(){r.toggle()})),o&&this._registerAction("lassoTool",(function(){o.toggle()})),a&&this._registerAction("handTool",(function(){a.toggle()})),s&&this._registerAction("globalConnectTool",(function(){s.toggle()})),i&&c&&this._registerAction("distributeElements",(function(e){var t=i.get(),n=e.type;t.length&&c.trigger(t,n)})),i&&u&&this._registerAction("alignElements",(function(e){var t=i.get(),n=[],r=e.type;t.length&&(n=E(t,(function(e){return!Ko(e,"bpmn:Lane")})),u.trigger(n,r))})),i&&d&&this._registerAction("setColor",(function(e){var t=i.get();t.length&&d.setColor(t,e)})),i&&l&&this._registerAction("directEditing",(function(){var e=i.get();e.length&&l.activate(e[0])})),p&&this._registerAction("find",(function(){p.toggle()})),t&&d&&this._registerAction("moveToOrigin",(function(){var e,i,r=t.getRootElement();i=Ko(r,"bpmn:Collaboration")?n.filter((function(e){return Ko(e.parent,"bpmn:Collaboration")})):n.filter((function(e){return e!==r&&!Ko(e.parent,"bpmn:SubProcess")})),e=Wt(i),d.moveElements(i,{x:-e.x,y:-e.y},r)}))};var Em={__depends__:[wm],editorActions:["type",_m]};function Cm(e){e.on(["create.init","shape.move.init"],(function(e){var t=e.context,n=e.shape;Yo(n,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(t.gridSnappingContext||(t.gridSnappingContext={}),t.gridSnappingContext.snapLocation="top-left")}))}Cm.$inject=["eventBus"];var Sm=10;function Am(e,t,n){return n||(n="round"),Math[n](e/t)*t}var Tm=1200,km=800;function Rm(e,t,n){var i=!n||!1!==n.active;this._eventBus=t;var r=this;t.on("diagram.init",km,(function(){r.setActive(i)})),t.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],Tm,(function(t){var n=t.originalEvent;if(!(!r.active||n&&pu(n))){var i=t.context,o=i.gridSnappingContext;o||(o=i.gridSnappingContext={}),["x","y"].forEach((function(n){var i={},o=Dm(t,n,e);o&&(i.offset=o);var a=Pm(t,n);a&&W(i,a),Fd(t,n)||r.snapEvent(t,n,i)}))}}))}function Pm(e,t){var n=e.context,i=n.createConstraints,r=n.resizeConstraints||{},o=n.gridSnappingContext,a=o.snapConstraints;if(a&&a[t])return a[t];a||(a=o.snapConstraints={}),a[t]||(a[t]={});var s=n.direction;i&&(Mm(t)?(a.x.min=i.left,a.x.max=i.right):(a.y.min=i.top,a.y.max=i.bottom));var c=r.min,u=r.max;return c&&(Mm(t)?Om(s)?a.x.max=c.left:a.x.min=c.right:Bm(s)?a.y.max=c.top:a.y.min=c.bottom),u&&(Mm(t)?Om(s)?a.x.min=u.left:a.x.max=u.right:Bm(s)?a.y.min=u.top:a.y.max=u.bottom),a[t]}function Dm(e,t,n){var i=e.context,r=e.shape,o=i.gridSnappingContext,a=o.snapLocation,s=o.snapOffset;return s&&v(s[t])?s[t]:(s||(s=o.snapOffset={}),v(s[t])||(s[t]=0),r?(n.get(r.id)||(Mm(t)?s[t]+=r[t]+r.width/2:s[t]+=r[t]+r.height/2),a?("x"===t?/left/.test(a)?s[t]-=r.width/2:/right/.test(a)&&(s[t]+=r.width/2):/top/.test(a)?s[t]-=r.height/2:/bottom/.test(a)&&(s[t]+=r.height/2),s[t]):s[t]):s[t])}function Mm(e){return"x"===e}function Bm(e){return-1!==e.indexOf("n")}function Om(e){return-1!==e.indexOf("w")}function jm(e,t){Cc.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",(function(e){var t=e.context,i=t.hints||{},r=i.autoResize;if(r){var o=t.shape,a=t.newBounds;y(r)?t.newBounds=n.snapComplex(a,r):t.newBounds=n.snapSimple(o,a)}}))}Rm.prototype.snapEvent=function(e,t,n){var i=this.snapValue(e[t],n);Id(e,t,i)},Rm.prototype.getGridSpacing=function(){return Sm},Rm.prototype.snapValue=function(e,t){var n,i,r=0;return t&&t.offset&&(r=t.offset),e+=r,e=Am(e,Sm),t&&t.min&&(n=t.min,v(n)&&(n=Am(n+r,Sm,"ceil"),e=Math.max(e,n))),t&&t.max&&(i=t.max,v(i)&&(i=Am(i+r,Sm,"floor"),e=Math.min(e,i))),e-=r,e},Rm.prototype.isActive=function(){return this.active},Rm.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})},Rm.prototype.toggleActive=function(){this.setActive(!this.active)},Rm.$inject=["elementRegistry","eventBus","config.gridSnapping"],jm.$inject=["eventBus","gridSnapping","modeling"],i(jm,Cc),jm.prototype.snapSimple=function(e,t){var n=this._gridSnapping;return t.width=n.snapValue(t.width,{min:t.width}),t.height=n.snapValue(t.height,{min:t.height}),t.x=e.x+e.width/2-t.width/2,t.y=e.y+e.height/2-t.height/2,t},jm.prototype.snapComplex=function(e,t){return/w|e/.test(t)&&(e=this.snapHorizontally(e,t)),/n|s/.test(t)&&(e=this.snapVertically(e,t)),e},jm.prototype.snapHorizontally=function(e,t){var n=this._gridSnapping,i=/w/.test(t),r=/e/.test(t),o={};return o.width=n.snapValue(e.width,{min:e.width}),r&&(i?(o.x=n.snapValue(e.x,{max:e.x}),o.width+=n.snapValue(e.x-o.x,{min:e.x-o.x})):e.x=e.x+e.width-o.width),W(e,o),e},jm.prototype.snapVertically=function(e,t){var n=this._gridSnapping,i=/n/.test(t),r=/s/.test(t),o={};return o.height=n.snapValue(e.height,{min:e.height}),i&&(r?(o.y=n.snapValue(e.y,{max:e.y}),o.height+=n.snapValue(e.y-o.y,{min:e.y-o.y})):e.y=e.y+e.height-o.height),W(e,o),e};var Nm=2e3;function Fm(e,t){e.on(["spaceTool.move","spaceTool.end"],Nm,(function(e){var n=e.context;if(n.initialized){var i,r=n.axis;"x"===r?(i=t.snapValue(e.dx),e.x=e.x+i-e.dx,e.dx=i):(i=t.snapValue(e.dy),e.y=e.y+i-e.dy,e.dy=i)}}))}Fm.$inject=["eventBus","gridSnapping"];var Im={__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",jm],gridSnappingSpaceToolBehavior:["type",Fm]},Lm={__depends__:[Im],__init__:["gridSnapping"],gridSnapping:["type",Rm]},zm=2e3;function $m(e,t){e.on("autoPlace",zm,(function(e){var n=e.source,i=xn(n),r=e.shape,o=np(n,r);return["x","y"].forEach((function(e){var n={};o[e]!==i[e]&&(o[e]>i[e]?n.min=o[e]:n.max=o[e],Ko(r,"bpmn:TextAnnotation")&&(Hm(e)?n.offset=-r.width/2:n.offset=-r.height/2),o[e]=t.snapValue(o[e],n))})),o}))}function Hm(e){return"x"===e}$m.$inject=["eventBus","gridSnapping"];var Gm=1750;function Vm(e,t,n){t.on(["create.start","shape.move.start"],Gm,(function(t){var i=t.context,r=i.shape,o=e.getRootElement();if(Ko(r,"bpmn:Participant")&&Ko(o,"bpmn:Process")&&o.children.length){var a=i.createConstraints;a&&(r.width=n.snapValue(r.width,{min:r.width}),r.height=n.snapValue(r.height,{min:r.height}))}}))}Vm.$inject=["canvas","eventBus","gridSnapping"];var Wm=3e3;function Um(e,t,n){Cc.call(this,e),this._gridSnapping=t;var i=this;this.postExecuted(["connection.create","connection.layout"],Wm,(function(e){var t=e.context,r=t.connection,o=t.hints||{},a=r.waypoints;o.connectionStart||o.connectionEnd||!1===o.createElementsBehavior||qm(a)&&n.updateWaypoints(r,i.snapMiddleSegments(a))}))}function qm(e){return e.length>3}function Km(e){return"h"===e}function Ym(e){return"v"===e}function Xm(e,t,n){var i=sn(t,n),r={};return Km(i)&&(r.y=e.snapValue(t.y)),Ym(i)&&(r.x=e.snapValue(t.x)),("x"in r||"y"in r)&&(t=W({},t,r),n=W({},n,r)),[t,n]}Um.$inject=["eventBus","gridSnapping","modeling"],i(Um,Cc),Um.prototype.snapMiddleSegments=function(e){var t,n=this._gridSnapping;e=e.slice();for(var i=1;i<e.length-2;i++)t=Xm(n,e[i],e[i+1]),e[i]=t[0],e[i+1]=t[1];return e};var Zm={__init__:["gridSnappingAutoPlaceBehavior","gridSnappingParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",$m],gridSnappingParticipantBehavior:["type",Vm],gridSnappingLayoutConnectionBehavior:["type",Um]},Jm={__depends__:[Lm,Zm],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",Cm]},Qm=30,ev=30;function tv(e,t){this._interactionEvents=t;var n=this;e.on(["interactionEvents.createHit","interactionEvents.updateHit"],(function(e){var t=e.element,i=e.gfx;return Ko(t,"bpmn:Lane")?n.createParticipantHit(t,i):Ko(t,"bpmn:Participant")?wa(t)?n.createParticipantHit(t,i):n.createDefaultHit(t,i):Ko(t,"bpmn:SubProcess")?wa(t)?n.createSubProcessHit(t,i):n.createDefaultHit(t,i):void 0}))}tv.$inject=["eventBus","interactionEvents"],tv.prototype.createDefaultHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createDefaultHit(e,t),!0},tv.prototype.createParticipantHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:Qm,height:e.height}),!0},tv.prototype.createSubProcessHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:e.width,height:ev}),!0};var nv={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",tv]};function iv(e){e.invoke(Su,this)}i(iv,Su),iv.$inject=["injector"],iv.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}Su.prototype.registerBindings.call(this,e,t),n("selectElements",(function(n){var i=n.keyEvent;if(e.isKey(["a","A"],i)&&e.isCmd(i))return t.trigger("selectElements"),!0})),n("find",(function(n){var i=n.keyEvent;if(e.isKey(["f","F"],i)&&e.isCmd(i))return t.trigger("find"),!0})),n("spaceTool",(function(n){var i=n.keyEvent;if(!e.hasModifier(i))return e.isKey(["s","S"],i)?(t.trigger("spaceTool"),!0):void 0})),n("lassoTool",(function(n){var i=n.keyEvent;if(!e.hasModifier(i))return e.isKey(["l","L"],i)?(t.trigger("lassoTool"),!0):void 0})),n("handTool",(function(n){var i=n.keyEvent;if(!e.hasModifier(i))return e.isKey(["h","H"],i)?(t.trigger("handTool"),!0):void 0})),n("globalConnectTool",(function(n){var i=n.keyEvent;if(!e.hasModifier(i))return e.isKey(["c","C"],i)?(t.trigger("globalConnectTool"),!0):void 0})),n("directEditing",(function(n){var i=n.keyEvent;if(!e.hasModifier(i))return e.isKey(["e","E"],i)?(t.trigger("directEditing"),!0):void 0}))};var rv={__depends__:[Au],__init__:["keyboardBindings"],keyboardBindings:["type",iv]},ov={moveSpeed:1,moveSpeedAccelerated:10},av=1500,sv="left",cv="up",uv="right",lv="down",pv={ArrowLeft:sv,Left:sv,ArrowUp:cv,Up:cv,ArrowRight:uv,Right:uv,ArrowDown:lv,Down:lv},dv={left:function(e){return{x:-e,y:0}},up:function(e){return{x:0,y:-e}},right:function(e){return{x:e,y:0}},down:function(e){return{x:0,y:e}}};function fv(e,t,n,i,r){var o=this;this._config=W({},ov,e||{}),t.addListener(av,(function(e){var n=e.keyEvent,i=pv[n.key];if(i&&!t.isCmd(n)){var r=t.isShift(n);return o.moveSelection(i,r),!0}})),this.moveSelection=function(e,t){var o=r.get();if(o.length){var a=this._config[t?"moveSpeedAccelerated":"moveSpeed"],s=dv[e](a),c=i.allowed("elements.move",{shapes:o});c&&n.moveElements(o,s)}}}fv.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];var hv={__depends__:[Au,pc],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",fv]},mv=10;function vv(e,t,n,i){this._dragging=i,this._rules=t;var r=this;function o(e,t){var n,i=e.shape,o=e.direction,a=e.resizeConstraints;e.delta=t,n=zh(i,o,t),e.newBounds=Gh(n,a),e.canExecute=r.canResize(e)}function a(e){var t=e.resizeConstraints,n=e.minBounds;void 0===t&&(void 0===n&&(n=r.computeMinResizeBox(e)),e.resizeConstraints={min:vn(n)})}function s(e){var t=e.shape,i=e.canExecute,r=e.newBounds;if(i){if(r=hn(r),!gv(t,r))return;n.resizeShape(t,r)}}e.on("resize.start",(function(e){a(e.context)})),e.on("resize.move",(function(e){var t={x:e.dx,y:e.dy};o(e.context,t)})),e.on("resize.end",(function(e){s(e.context)}))}function gv(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function yv(e,t){var n=xn(e),i=vn(e),r={x:n.x,y:n.y};return-1!==t.indexOf("n")?r.y=i.top:-1!==t.indexOf("s")&&(r.y=i.bottom),-1!==t.indexOf("e")?r.x=i.right:-1!==t.indexOf("w")&&(r.x=i.left),r}function bv(e){var t="resize-";return"n"===e||"s"===e?t+"ns":"e"===e||"w"===e?t+"ew":"nw"===e||"se"===e?t+"nwse":t+"nesw"}vv.prototype.canResize=function(e){var t=this._rules,n=U(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)},vv.prototype.activate=function(e,t,n){var i,r,o=this._dragging;if("string"===typeof n&&(n={direction:n}),i=W({shape:t},n),r=i.direction,!r)throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");o.init(e,yv(t,r),"resize",{autoActivate:!0,cursor:bv(r),data:{shape:t,context:i}})},vv.prototype.computeMinResizeBox=function(e){var t,n,i=e.shape,r=e.direction;return t=e.minDimensions||{width:mv,height:mv},n=Kh(i,e.childrenBoxPadding),Vh(r,i,t,n)},vv.$inject=["eventBus","rules","modeling","dragging"];var xv="djs-resizing",wv="resize-not-ok",_v=500;function Ev(e,t,n){function i(e){var i=e.shape,r=e.newBounds,o=e.frame;o||(o=e.frame=n.addFrame(i,t.getActiveLayer()),t.addMarker(i,xv)),r.width>5&&He(o,{x:r.x,width:r.width}),r.height>5&&He(o,{y:r.y,height:r.height}),e.canExecute?qe(o).remove(wv):qe(o).add(wv)}function r(e){var n=e.shape,i=e.frame;i&&Ye(e.frame),t.removeMarker(n,xv)}e.on("resize.move",_v,(function(e){i(e.context)})),e.on("resize.cleanup",(function(e){r(e.context)}))}Ev.$inject=["eventBus","canvas","previewSupport"];var Cv=-6,Sv=8,Av=20,Tv="djs-resizer",kv=["n","w","s","e","nw","ne","se","sw"];function Rv(e,t,n,i){this._resize=i,this._canvas=t;var r=this;e.on("selection.changed",(function(e){var t=e.newSelection;r.removeResizers(),1===t.length&&C(t,G(r.addResizer,r))})),e.on("shape.changed",(function(e){var t=e.element;n.isSelected(t)&&(r.removeResizers(),r.addResizer(t))}))}function Pv(e){var t={x:0,y:0};return-1!==e.indexOf("e")?t.x=-Cv:-1!==e.indexOf("w")&&(t.x=Cv),-1!==e.indexOf("s")?t.y=-Cv:-1!==e.indexOf("n")&&(t.y=Cv),t}function Dv(e){return!!e.waypoints}Rv.prototype.makeDraggable=function(e,t,n){var i=this._resize;function r(t){Ws(t)&&i.activate(t,e,n)}we.bind(t,"mousedown",r),we.bind(t,"touchstart",r)},Rv.prototype._createResizer=function(e,t,n,i){var r=this._getResizersParent(),o=Pv(i),a=nt("g");qe(a).add(Tv),qe(a).add(Tv+"-"+e.id),qe(a).add(Tv+"-"+i),Ne(r,a);var s=nt("rect");He(s,{x:-Sv/2+o.x,y:-Sv/2+o.y,width:Sv,height:Sv}),qe(s).add(Tv+"-visual"),Ne(a,s);var c=nt("rect");return He(c,{x:-Av/2+o.x,y:-Av/2+o.y,width:Av,height:Av}),qe(c).add(Tv+"-hit"),Ne(a,c),ui(a,t,n),a},Rv.prototype.createResizer=function(e,t){var n=yv(e,t),i=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,i,t)},Rv.prototype.addResizer=function(e){var t=this;!Dv(e)&&this._resize.canResize({shape:e})&&C(kv,(function(n){t.createResizer(e,n)}))},Rv.prototype.removeResizers=function(){var e=this._getResizersParent();Xe(e)},Rv.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},Rv.$inject=["eventBus","canvas","selection","resize"];var Mv={__depends__:[Mp,Tp,Ef],__init__:["resize","resizePreview","resizeHandles"],resize:["type",vv],resizePreview:["type",Ev],resizeHandles:["type",Rv]},Bv=2e3;function Ov(e,t,n,i,r,o,a){function s(e,t){(t||Yo(e,["bpmn:Task","bpmn:TextAnnotation"])||jv(e))&&i.activate(e)}this._bpmnFactory=t,this._canvas=n,this._modeling=r,this._textRenderer=a,i.registerProvider(this),e.on("element.dblclick",(function(e){s(e.element,!0)})),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open","root.set","selection.changed"],(function(e){i.isActive()&&i.complete()})),e.on(["shape.remove","connection.remove"],Bv,(function(e){i.isActive(e.element)&&i.cancel()})),e.on(["commandStack.changed"],(function(e){i.isActive()&&i.cancel()})),e.on("directEditing.activate",(function(e){o.removeResizers()})),e.on("create.end",500,(function(e){var t=e.context,n=t.shape,i=e.context.canExecute,r=e.isTouch;r||i&&(t.hints&&!1===t.hints.createElementsBehavior||s(n))})),e.on("autoPlace.end",500,(function(e){s(e.shape)}))}function jv(e){return Ko(e,"bpmn:SubProcess")&&!wa(e)}function Nv(e){return Ko(e,"bpmn:SubProcess")&&wa(e)}function Fv(e){return Ko(e,"bpmn:Participant")&&!wa(e)}function Iv(e){return Ko(e,"bpmn:Participant")&&wa(e)}function Lv(e){return!e||!e.trim()}Ov.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],Ov.prototype.activate=function(e){var t=Pa(e);if(void 0!==t){var n={text:t},i=this.getEditingBBox(e);W(n,i);var r={};return(Yo(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||jv(e))&&W(r,{centerVertically:!0}),Cs(e)&&W(r,{autoResize:!0}),Ko(e,"bpmn:TextAnnotation")&&W(r,{resizable:!0,autoResize:!0}),W(n,{options:r}),n}},Ov.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,i=t.getAbsoluteBBox(n),r={x:i.x+i.width/2,y:i.y+i.height/2},o={x:i.x,y:i.y},a=t.zoom(),s=this._textRenderer.getDefaultStyle(),c=this._textRenderer.getExternalStyle(),u=c.fontSize*a,l=c.lineHeight,p=s.fontSize*a,d=s.lineHeight,f={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};(Ko(e,"bpmn:Lane")||Iv(e))&&(W(o,{width:i.height,height:30*a,x:i.x-i.height/2+15*a,y:r.y-30*a/2}),W(f,{fontSize:p+"px",lineHeight:d,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px",transform:"rotate(-90deg)"})),(Yo(e,["bpmn:Task","bpmn:CallActivity"])||Fv(e)||jv(e))&&(W(o,{width:i.width,height:i.height}),W(f,{fontSize:p+"px",lineHeight:d,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"})),Nv(e)&&(W(o,{width:i.width,x:i.x}),W(f,{fontSize:p+"px",lineHeight:d,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"}));var h=90*a,m=7*a,v=4*a;if(n.labelTarget&&(W(o,{width:h,height:i.height+m+v,x:r.x-h/2,y:i.y-m}),W(f,{fontSize:u+"px",lineHeight:l,paddingTop:m+"px",paddingBottom:v+"px"})),Cs(n)&&!Ss(n)&&!Ps(n)){var g=ks(e),y=t.getAbsoluteBBox({x:g.x,y:g.y,width:0,height:0}),b=u+m+v;W(o,{width:h,height:b,x:y.x-h/2,y:y.y-b/2}),W(f,{fontSize:u+"px",lineHeight:l,paddingTop:m+"px",paddingBottom:v+"px"})}return Ko(e,"bpmn:TextAnnotation")&&(W(o,{width:i.width,height:i.height,minWidth:30*a,minHeight:10*a}),W(f,{textAlign:"left",paddingTop:5*a+"px",paddingBottom:7*a+"px",paddingLeft:7*a+"px",paddingRight:5*a+"px",fontSize:p+"px",lineHeight:d})),{bounds:o,style:f}},Ov.prototype.update=function(e,t,n,i){var r,o;Ko(e,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(e),r={x:e.x,y:e.y,width:e.width/o.width*i.width,height:e.height/o.height*i.height}),Lv(t)&&(t=null),this._modeling.updateLabel(e,t,r)};var zv="djs-element-hidden",$v="djs-label-hidden";function Hv(e,t,n,i){var r,o,a,s=this,c=t.getDefaultLayer();e.on("directEditing.activate",(function(e){var n=e.active;if(r=n.element.label||n.element,Ko(r,"bpmn:TextAnnotation")){o=t.getAbsoluteBBox(r),a=nt("g");var u=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r.width,containerHeight:r.height,position:{mx:0,my:0}}),l=s.path=nt("path");He(l,{d:u,strokeWidth:2,stroke:Gv(r)}),Ne(a,l),Ne(c,a),li(a,r.x,r.y)}Ko(r,"bpmn:TextAnnotation")||r.labelTarget?t.addMarker(r,zv):(Ko(r,"bpmn:Task")||Ko(r,"bpmn:CallActivity")||Ko(r,"bpmn:SubProcess")||Ko(r,"bpmn:Participant"))&&t.addMarker(r,$v)})),e.on("directEditing.resize",(function(e){if(Ko(r,"bpmn:TextAnnotation")){var t=e.height,n=e.dy,a=Math.max(r.height/o.height*(t+n),0),c=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r.width,containerHeight:a,position:{mx:0,my:0}});He(s.path,{d:c})}})),e.on(["directEditing.complete","directEditing.cancel"],(function(e){var n=e.active;n&&(t.removeMarker(n.element.label||n.element,zv),t.removeMarker(r,$v)),r=void 0,o=void 0,a&&(Ye(a),a=void 0)}))}function Gv(e,t){var n=Zo(e);return n.get("stroke")||t||"black"}Hv.$inject=["eventBus","canvas","elementRegistry","pathMap"];var Vv={__depends__:[_c,Mv,mf],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",Ov],labelEditingPreview:["type",Hv]},Wv=["top","bottom","left","right"],Uv=10;function qv(e,t){function n(e){if(Ss(e)){var t=Xv(e);t&&i(e,t)}}function i(e,n){var i=xn(e),r=e.label,o=xn(r);if(r.parent){var a,s=vn(e);switch(n){case"top":a={x:i.x,y:s.top-Uv-r.height/2};break;case"left":a={x:s.left-Uv-r.width/2,y:i.y};break;case"bottom":a={x:i.x,y:s.bottom+Uv+r.height/2};break;case"right":a={x:s.right+Uv+r.width/2,y:i.y};break}var c=Nu(a,o);t.moveShape(r,c)}}Cc.call(this,e),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],(function(e){var t=e.context,i=t.connection,r=i.source,o=i.target,a=t.hints||{};!1!==a.createElementsBehavior&&(n(r),n(o))})),this.postExecuted(["label.create"],(function(e){var t=e.context,i=t.shape,r=t.hints||{};!1!==r.createElementsBehavior&&n(i.labelTarget)})),this.postExecuted(["elements.create"],(function(e){var t=e.context,i=t.elements,r=t.hints||{};!1!==r.createElementsBehavior&&i.forEach((function(e){n(e)}))}))}function Kv(e){var t,n=e.host,i=xn(e),r=wn(i,n);t=r.indexOf("-")>=0?r.split("-"):[r];var o=Wv.filter((function(e){return-1===t.indexOf(e)}));return o}function Yv(e){var t=xn(e),n=[].concat(e.incoming.map((function(e){return e.waypoints[e.waypoints.length-2]})),e.outgoing.map((function(e){return e.waypoints[1]}))).map((function(e){return Zv(t,e)}));return n}function Xv(e){var t=xn(e.label),n=xn(e),i=Zv(n,t);if(Jv(i)){var r=Yv(e);if(e.host){var o=Kv(e);r=r.concat(o)}var a=Wv.filter((function(e){return-1===r.indexOf(e)}));if(-1===a.indexOf(i))return a[0]}}function Zv(e,t){return wn(t,e,5)}function Jv(e){return-1!==Wv.indexOf(e)}function Qv(e,t,n){Cc.call(this,e),this.preExecute("shape.append",(function(e){var t=e.source,n=e.shape;e.position||(Ko(n,"bpmn:TextAnnotation")?e.position={x:t.x+t.width/2+75,y:t.y-50-n.height/2}:e.position={x:t.x+t.width+80+n.width/2,y:t.y+t.height/2})}),!0)}function eg(e,t){e.invoke(Cc,this),this.postExecute("shape.move",(function(e){var n=e.newParent,i=e.shape,r=E(i.incoming.concat(i.outgoing),(function(e){return Ko(e,"bpmn:Association")}));C(r,(function(e){t.moveConnection(e,{x:0,y:0},n)}))}),!0)}i(qv,Cc),qv.$inject=["eventBus","modeling"],i(Qv,Cc),Qv.$inject=["eventBus","elementFactory","bpmnRules"],i(eg,Cc),eg.$inject=["injector","modeling"];var tg=500;function ng(e,t){t.invoke(Cc,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",tg,(function(e){var t=e.elements;t=t.filter((function(e){var t=e.host;return rg(e,t)})),1===t.length&&t.map((function(e){return t.indexOf(e)})).forEach((function(i){var r=t[i];e.elements[i]=n.replaceShape(t[i],r)}))}),!0),this.preExecute("elements.move",tg,(function(e){var t=e.shapes,i=e.newHost;if(1===t.length){var r=t[0];rg(r,i)&&(e.shapes=[n.replaceShape(r,i)])}}),!0)}function ig(e){var t=Xo(e),n=t.eventDefinitions;return n&&n[0]}function rg(e,t){return!Ps(e)&&Yo(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}function og(e,t){function n(e){return E(e.attachers,(function(e){return Ko(e,"bpmn:BoundaryEvent")}))}Cc.call(this,e),this.postExecute("connection.create",(function(e){var i=e.context.source,r=e.context.target,o=n(r);Ko(i,"bpmn:EventBasedGateway")&&Ko(r,"bpmn:ReceiveTask")&&o.length>0&&t.removeElements(o)})),this.postExecute("connection.reconnect",(function(e){var i=e.context.oldSource,r=e.context.newSource;Ko(i,"bpmn:Gateway")&&Ko(r,"bpmn:EventBasedGateway")&&C(r.outgoing,(function(e){var i=e.target,r=n(i);Ko(i,"bpmn:ReceiveTask")&&r.length>0&&t.removeElements(r)}))}))}function ag(e){e.invoke(Cc,this),this.preExecute("shape.create",1500,(function(e){var t=e.context,n=t.parent,i=t.shape;Ko(n,"bpmn:Lane")&&!Ko(i,"bpmn:Lane")&&(t.parent=jh(n,"bpmn:Participant"))}))}function sg(e,t,n){Cc.call(this,e),this.preExecute("shape.create",(function(e){var n=e.context,i=n.shape;if(Ko(i,"bpmn:DataObjectReference")&&"label"!==i.type){var r=t.create("bpmn:DataObject");i.businessObject.dataObjectRef=r}}))}ng.$inject=["bpmnReplace","injector"],i(ng,Cc),ng.prototype.replaceShape=function(e,t){var n=ig(e),i={type:"bpmn:BoundaryEvent",host:t};return n&&(i.eventDefinitionType=n.$type),this._bpmnReplace.replaceElement(e,i,{layoutConnection:!1})},og.$inject=["eventBus","modeling"],i(og,Cc),ag.$inject=["injector"],i(ag,Cc),sg.$inject=["eventBus","bpmnFactory","moddle"],i(sg,Cc);var cg=20,ug=20,lg=30,pg=2e3;function dg(e,t,n){function i(){var t=e.getRootElement();return Ko(t,"bpmn:Collaboration")?t:n.makeCollaboration()}Cc.call(this,t),t.on(["create.start","shape.move.start"],pg,(function(t){var n=t.context,i=n.shape,r=e.getRootElement();if(Ko(i,"bpmn:Participant")&&Ko(r,"bpmn:Process")&&r.children.length){var o=r.children.filter((function(e){return!Ko(e,"bpmn:Group")&&!Ps(e)&&!mg(e)}));if(o.length){var a=Wt(o),s=fg(i,a);W(i,s),n.createConstraints=hg(i,a)}}})),t.on("create.start",pg,(function(n){var i=n.context,r=i.shape,o=e.getRootElement(),a=e.getGraphics(o);function s(e){e.element=o,e.gfx=a}Ko(r,"bpmn:Participant")&&Ko(o,"bpmn:Process")&&(t.on("element.hover",pg,s),t.once("create.cleanup",(function(){t.off("element.hover",s)})))})),this.preExecute("elements.create",pg,(function(e){var t,n=e.elements,r=e.parent,o=vg(n);o&&Ko(r,"bpmn:Process")&&(e.parent=i(),t=e.hints=e.hints||{},t.participant=o,t.process=r,t.processRef=Xo(o).get("processRef"))}),!0),this.preExecute("shape.create",(function(e){var t=e.parent,n=e.shape;Ko(n,"bpmn:Participant")&&Ko(t,"bpmn:Process")&&(e.parent=i(),e.process=t,e.processRef=Xo(n).get("processRef"))}),!0),this.execute("shape.create",(function(e){var t=e.hints||{},n=e.process||t.process,i=e.shape,r=t.participant;!n||r&&i!==r||Xo(i).set("processRef",Xo(n))}),!0),this.revert("shape.create",(function(e){var t=e.hints||{},n=e.process||t.process,i=e.processRef||t.processRef,r=e.shape,o=t.participant;!n||o&&r!==o||Xo(r).set("processRef",i)}),!0),this.postExecute("shape.create",(function(e){var t=e.hints||{},i=e.process||e.hints.process,r=e.shape,o=t.participant;if(i){var a=i.children.slice();o?r===o&&n.moveElements(a,{x:0,y:0},o):n.moveElements(a,{x:0,y:0},r)}}),!0)}function fg(e,t){t={width:t.width+2*cg+lg,height:t.height+2*ug};var n=Math.max(e.width,t.width),i=Math.max(e.height,t.height);return{x:-n/2,y:-i/2,width:n,height:i}}function hg(e,t){return t=vn(t),{bottom:t.top+e.height/2-ug,left:t.right-e.width/2+cg,top:t.bottom-e.height/2+ug,right:t.left+e.width/2-cg-lg}}function mg(e){return!!e.waypoints}function vg(e){return w(e,(function(e){return Ko(e,"bpmn:Participant")}))}dg.$inject=["canvas","eventBus","modeling"],i(dg,Cc);var gg="__targetRef_placeholder";function yg(e,t){function n(e,t,n){var i=e.get("dataInputAssociations");return w(i,(function(e){return e!==n&&e.targetRef===t}))}function i(e,n){var i=e.get("properties"),r=w(i,(function(e){return e.name===gg}));return!r&&n&&(r=t.create("bpmn:Property",{name:gg}),tn(i,r)),r}function r(e,t){var r=i(e);r&&(n(e,r,t)||en(e.get("properties"),r))}function o(e){var t,n=e.context,o=n.connection,a=o.businessObject,s=o.target,c=s&&s.businessObject,u=n.newTarget,l=u&&u.businessObject,p=n.oldTarget||n.target,d=p&&p.businessObject,f=o.businessObject;d&&d!==c&&r(d,a),l&&l!==c&&r(l,a),c?(t=i(c,!0),f.targetRef=t):f.targetRef=null}Cc.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],bg(o)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],bg(o))}function bg(e){return function(t){var n=t.context,i=n.connection;if(Ko(i,"bpmn:DataInputAssociation"))return e(t)}}function xg(e){this._bpmnUpdater=e}function wg(e,t,n,i){function r(){return n.filter((function(e){return Ko(e,"bpmn:Participant")&&Xo(e).processRef}))[0]}function o(e){return e.children.filter((function(e){return Ko(e,"bpmn:DataStoreReference")&&!e.labelTarget}))}function a(e,n){var i=e.businessObject||e;if(n=n||r(),n){var o=n.businessObject||n;t.execute("dataStore.updateContainment",{dataStoreBo:i,dataStoreDi:Zo(e),newSemanticParent:o.processRef||o,newDiParent:Zo(n)})}}Cc.call(this,i),t.registerHandler("dataStore.updateContainment",xg),this.preExecute("shape.create",(function(e){var t=e.context,n=t.shape;Ko(n,"bpmn:DataStoreReference")&&"label"!==n.type&&(t.hints||(t.hints={}),t.hints.autoResize=!1)})),this.preExecute("elements.move",(function(e){var t=e.context,n=t.shapes,i=n.filter((function(e){return Ko(e,"bpmn:DataStoreReference")}));i.length&&(t.hints||(t.hints={}),t.hints.autoResize=n.filter((function(e){return!Ko(e,"bpmn:DataStoreReference")})))})),this.postExecute("shape.create",(function(e){var t=e.context,n=t.shape,i=n.parent;Ko(n,"bpmn:DataStoreReference")&&"label"!==n.type&&Ko(i,"bpmn:Collaboration")&&a(n)})),this.postExecute("shape.move",(function(e){var t=e.context,n=t.shape,i=t.oldParent,r=n.parent;if(!Ko(i,"bpmn:Collaboration")&&Ko(n,"bpmn:DataStoreReference")&&"label"!==n.type&&Ko(r,"bpmn:Collaboration")){var o=Ko(i,"bpmn:Participant")?i:Eg(i,"bpmn:Participant");a(n,o)}})),this.postExecute("shape.delete",(function(t){var n=t.context,i=n.shape,r=e.getRootElement();Yo(i,["bpmn:Participant","bpmn:SubProcess"])&&Ko(r,"bpmn:Collaboration")&&o(r).filter((function(e){return _g(e,i)})).forEach((function(e){a(e)}))})),this.postExecute("canvas.updateRoot",(function(e){var t=e.context,n=t.oldRoot,i=t.newRoot,r=o(n);r.forEach((function(e){Ko(i,"bpmn:Process")&&a(e,i)}))}))}function _g(e,t){var n=e.businessObject||e,i=t.businessObject||t;while(n.$parent){if(n.$parent===i.processRef||i)return!0;n=n.$parent}return!1}function Eg(e,t){while(e.parent){if(Ko(e.parent,t))return e.parent;e=e.parent}}yg.$inject=["eventBus","bpmnFactory"],i(yg,Cc),xg.$inject=["bpmnUpdater"],xg.prototype.execute=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,i=e.newSemanticParent,r=e.newDiParent;e.oldSemanticParent=t.$parent,e.oldDiParent=n.$parent,this._bpmnUpdater.updateSemanticParent(t,i),this._bpmnUpdater.updateDiParent(n,r)},xg.prototype.revert=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,i=e.oldSemanticParent,r=e.oldDiParent;this._bpmnUpdater.updateSemanticParent(t,i),this._bpmnUpdater.updateDiParent(n,r)},wg.$inject=["canvas","commandStack","elementRegistry","eventBus"],i(wg,Cc);var Cg=500;function Sg(e,t,n){function i(e,t){var i,r,o,a=em(t),s=[],c=[];($t(a,(function(t){return t.y>e.y?c.push(t):s.push(t),t.children})),a.length)&&(i=c.length&&s.length?e.height/2:e.height,s.length&&(r=n.calculateAdjustments(s,"y",i,e.y-10),n.makeSpace(r.movingShapes,r.resizingShapes,{x:0,y:i},"s")),c.length&&(o=n.calculateAdjustments(c,"y",-i,e.y+e.height+10),n.makeSpace(o.movingShapes,o.resizingShapes,{x:0,y:-i},"n")))}Cc.call(this,e),this.postExecuted("shape.delete",Cg,(function(e){var t=e.context,n=t.hints,r=t.shape,o=t.oldParent;Ko(r,"bpmn:Lane")&&(n&&n.nested||i(r,o))}))}Sg.$inject=["eventBus","modeling","spaceTool"],i(Sg,Cc);var Ag=500;function Tg(e,t){t.invoke(Cc,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",Ag,(function(e){var t=e.elements;t.filter((function(e){var t=e.host;return Rg(e,t)})).map((function(e){return t.indexOf(e)})).forEach((function(i){e.elements[i]=n.replaceShape(t[i])}))}),!0),this.preExecute("elements.move",Ag,(function(e){var t=e.shapes,i=e.newHost;t.forEach((function(e,r){var o=e.host;Rg(e,Pg(t,o)?o:i)&&(t[r]=n.replaceShape(e))}))}),!0)}function kg(e){var t=Xo(e),n=t.eventDefinitions;return n&&n[0]}function Rg(e,t){return!Ps(e)&&Ko(e,"bpmn:BoundaryEvent")&&!t}function Pg(e,t){return-1!==e.indexOf(t)}function Dg(e,t,n){function i(e,i,r){var o,a,s,c,u,l,p,d,f=i.waypoints,h=e.outgoing.slice(),m=e.incoming.slice();d=v(r.width)?xn(r):r;var g=zp(f,d);if(g){if(o=f.slice(0,g.index),a=f.slice(g.index+(g.bendpoint?1:0)),!o.length||!a.length)return;s=g.bendpoint?f[g.index]:d,1!==o.length&&Mg(e,o[o.length-1])||o.push(Bg(s)),1!==a.length&&Mg(e,a[0])||a.unshift(Bg(s))}c=i.source,u=i.target,t.canConnect(c,e,i)&&(n.reconnectEnd(i,e,o||d),l=i),t.canConnect(e,u,i)&&(l?p=n.connect(e,u,{type:i.type,waypoints:a}):(n.reconnectStart(i,e,a||d),p=i));var y=[].concat(l&&E(m,(function(e){return e.source===l.source}))||[],p&&E(h,(function(e){return e.target===p.target}))||[]);y.length&&n.removeElements(y)}Cc.call(this,e),this.preExecute("elements.move",(function(e){var n=e.newParent,i=e.shapes,r=e.delta,o=i[0];if(o&&n){n&&n.waypoints&&(e.newParent=n=n.parent);var a=xn(o),s={x:a.x+r.x,y:a.y+r.y},c=w(n.children,(function(e){var n=t.canInsert(i,e);return n&&zp(e.waypoints,s)}));c&&(e.targetFlow=c,e.position=s)}}),!0),this.postExecuted("elements.move",(function(e){var t=e.shapes,n=e.targetFlow,r=e.position;n&&i(t[0],n,r)}),!0),this.preExecute("shape.create",(function(e){var n=e.parent,i=e.shape;t.canInsert(i,n)&&(e.targetFlow=n,e.parent=n.parent)}),!0),this.postExecuted("shape.create",(function(e){var t=e.shape,n=e.targetFlow,r=e.position;n&&i(t,n,r)}),!0)}function Mg(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function Bg(e){return W({},e)}function Og(e,t){Cc.call(this,e),this.preExecuted("connection.create",(function(e){var n=e.context,i=n.source,r=n.target,o=r.incoming.slice();n.hints&&!1===n.hints.createElementsBehavior||Ko(i,"bpmn:EventBasedGateway")&&r.incoming.length&&o.filter(jg).forEach((function(e){t.removeConnection(e)}))})),this.preExecuted("shape.replace",(function(e){var n,i,r=e.context.newShape;Ko(r,"bpmn:EventBasedGateway")&&(n=r.outgoing.filter(jg).map((function(e){return e.target})),i=n.reduce((function(e,t){var n=t.incoming.filter(jg);return e.concat(n)}),[]),i.forEach((function(e){e.source!==r&&t.removeConnection(e)})))}))}function jg(e){return Ko(e,"bpmn:SequenceFlow")}Tg.$inject=["bpmnReplace","injector"],i(Tg,Cc),Tg.prototype.replaceShape=function(e){var t,n=kg(e);return t=n?{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:n.$type}:{type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,t,{layoutConnection:!1})},i(Dg,Cc),Dg.$inject=["eventBus","bpmnRules","modeling"],Og.$inject=["eventBus","modeling"],i(Og,Cc);var Ng=1500,Fg=2e3;function Ig(e,t,n){t.on(["create.hover","create.move","create.out","create.end","shape.move.hover","shape.move.move","shape.move.out","shape.move.end"],Ng,(function(t){var i=t.context,r=i.shape||t.shape,o=t.hover;Ko(o,"bpmn:Lane")&&!Yo(r,["bpmn:Lane","bpmn:Participant"])&&(t.hover=tm(o),t.hoverGfx=e.getGraphics(t.hover));var a=n.getRootElement();o!==a&&(r.labelTarget||Ko(r,"bpmn:Group"))&&(t.hover=a,t.hoverGfx=e.getGraphics(t.hover))})),t.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],Ng,(function(t){var n=t.hover;Ko(n,"bpmn:Lane")&&(t.hover=tm(n)||n,t.hoverGfx=e.getGraphics(t.hover))})),t.on(["bendpoint.move.hover"],Ng,(function(t){var n=t.context,i=t.hover,r=n.type;Ko(i,"bpmn:Lane")&&/reconnect/.test(r)&&(t.hover=tm(i)||i,t.hoverGfx=e.getGraphics(t.hover))})),t.on(["connect.start"],Ng,(function(e){var t=e.context,n=t.start;Ko(n,"bpmn:Lane")&&(t.start=tm(n)||n)})),t.on("shape.move.start",Fg,(function(e){var t=e.shape;Ko(t,"bpmn:Lane")&&(e.shape=tm(t)||t)}))}function Lg(e){return e.create("bpmn:Category")}function zg(e){return e.create("bpmn:CategoryValue")}function $g(e,t,n){return tn(t.get("categoryValue"),e),e.$parent=t,tn(n.get("rootElements"),t),t.$parent=n,e}function Hg(e){var t=e.$parent;return t&&(en(t.get("categoryValue"),e),e.$parent=null),e}function Gg(e){var t=e.$parent;return t&&(en(t.get("rootElements"),e),e.$parent=null),e}Ig.$inject=["elementRegistry","eventBus","canvas"];var Vg=770;function Wg(e,t,n,i,r,o){function a(){return n.filter((function(e){return Ko(e,"bpmn:Group")}))}function s(e,t){return e.some((function(e){var n=Xo(e),i=n.categoryValueRef&&n.categoryValueRef.$parent;return i===t}))}function c(e,t){return e.some((function(e){var n=Xo(e);return n.categoryValueRef===t}))}function u(e,t,n){var i=a().filter((function(e){return e.businessObject!==n}));t&&!s(i,t)&&Gg(t),e&&!c(i,e)&&Hg(e)}function l(e,n){return $g(e,n,t.getDefinitions())}function p(n,i){var r=Xo(n),o=r.categoryValueRef;o||(o=r.categoryValueRef=i.categoryValue=i.categoryValue||zg(e));var a=o.$parent;a||(a=o.$parent=i.category=i.category||Lg(e)),l(o,a,t.getDefinitions())}function d(e,t){var n=t.category,i=t.categoryValue,r=Xo(e);i?(r.categoryValueRef=null,u(i,n,r)):u(null,r.categoryValueRef.$parent,r)}function f(t,n){var i=e.create(t.$type);return o.copyElement(t,i,null,n)}r.invoke(Cc,this),this.execute("label.create",(function(e){var t=e.context,n=t.labelTarget;Ko(n,"bpmn:Group")&&p(n,t)})),this.revert("label.create",(function(e){var t=e.context,n=t.labelTarget;Ko(n,"bpmn:Group")&&d(n,t)})),this.execute("shape.delete",(function(e){var t=e.context,n=t.shape,i=Xo(n);if(Ko(n,"bpmn:Group")&&!n.labelTarget){var r,o=t.categoryValue=i.categoryValueRef;o&&(r=t.category=o.$parent,u(o,r,i),i.categoryValueRef=null)}})),this.reverted("shape.delete",(function(e){var t=e.context,n=t.shape;if(Ko(n,"bpmn:Group")&&!n.labelTarget){var i=t.category,r=t.categoryValue,o=Xo(n);r&&(o.categoryValueRef=r,l(r,i))}})),this.execute("shape.create",(function(e){var t=e.context,n=t.shape;Ko(n,"bpmn:Group")&&!n.labelTarget&&Xo(n).categoryValueRef&&p(n,t)})),this.reverted("shape.create",(function(e){var t=e.context,n=t.shape;Ko(n,"bpmn:Group")&&!n.labelTarget&&Xo(n).categoryValueRef&&d(n,t)})),i.on("copyPaste.copyElement",Vg,(function(e){var t=e.descriptor,n=e.element;if(Ko(n,"bpmn:Group")&&!n.labelTarget){var i=Xo(n);if(i.categoryValueRef){var r=i.categoryValueRef;t.categoryValue=f(r,!0),r.$parent&&(t.category=f(r.$parent,!0))}}})),i.on("copyPaste.pasteElement",Vg,(function(e){var t=e.descriptor,n=t.businessObject,i=t.categoryValue,r=t.category;i&&(i=n.categoryValueRef=f(i)),r&&(i.$parent=f(r)),delete t.category,delete t.categoryValue}))}function Ug(e,t,n,i){var r,o,a,s,c;return r=(i.y-n.y)*(t.x-e.x)-(i.x-n.x)*(t.y-e.y),0==r?null:(o=e.y-n.y,a=e.x-n.x,c=(i.x-n.x)*o-(i.y-n.y)*a,s=c/r,{x:Math.round(e.x+s*(t.x-e.x)),y:Math.round(e.y+s*(t.y-e.y))})}function qg(e){function t(e,t,n){var i,r={x:n.x,y:n.y-50},o={x:n.x-50,y:n.y},a=Ug(e,t,n,r),s=Ug(e,t,n,o);i=a&&s?Kg(a,n)>Kg(s,n)?s:a:a||s,e.original=i}function n(e){var n=e.waypoints;t(n[0],n[1],xn(e.source)),t(n[n.length-1],n[n.length-2],xn(e.target))}e.on("bpmnElement.added",(function(e){var t=e.element;t.waypoints&&n(t)}))}function Kg(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Yg(e){Cc.call(this,e);var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],(function(e){var n=e.context.shape,i=Xo(n),r=Zo(n);Yo(i,t)&&!r.get("isHorizontal")&&r.set("isHorizontal",!0)}))}Wg.$inject=["bpmnFactory","bpmnjs","elementRegistry","eventBus","injector","moddleCopy"],i(Wg,Cc),qg.$inject=["eventBus"],Yg.$inject=["eventBus"],i(Yg,Cc);var Xg=Math.sqrt,Zg=Math.min,Jg=Math.max,Qg=Math.abs;function ey(e){return Math.pow(e,2)}function ty(e,t){return Xg(ey(e.x-t.x)+ey(e.y-t.y))}function ny(e,t){var n,i,r,o,a,s,c,u,l,p,d,f=0;for(f=0;f<t.length-1;f++){if(n=t[f],i=t[f+1],cy(n,i)?c=[n]:(r=ty(e,n),o=ty(e,i),s=Zg(r,o),c=iy(n,i,e,s)),c.length<1)throw new Error("expected between [1, 2] circle -> line intersections");1===c.length&&(u={type:"bendpoint",position:c[0],segmentIndex:f,bendpointIndex:cy(n,c[0])?f:f+1}),2===c.length&&(a=ay(c[0],c[1]),u={type:"segment",position:a,segmentIndex:f,relativeLocation:ty(n,a)/ty(n,i)}),l=ty(u.position,e),(!d||p>l)&&(d=u,p=l)}return d}function iy(e,t,n,i){var r=t.x-e.x,o=t.y-e.y,a=n.x-e.x,s=n.y-e.y,c=r*r+o*o,u=r*a+o*s,l=a*a+s*s-i*i,p=u/c,d=l/c,f=p*p-d;if(f<0&&f>-1e-6&&(f=0),f<0)return[];var h=Xg(f),m=-p+h,v=-p-h,g={x:e.x-r*m,y:e.y-o*m};if(0===f)return[g];var y={x:e.x-r*v,y:e.y-o*v};return[g,y].filter((function(n){return ry(n,e,t)}))}function ry(e,t,n){return oy(e.x,t.x,n.x)&&oy(e.y,t.y,n.y)}function oy(e,t,n){return e>=Zg(t,n)-sy&&e<=Jg(t,n)+sy}function ay(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}var sy=.1;function cy(e,t){return Qg(e.x-t.x)<=sy&&Qg(e.y-t.y)<=sy}function uy(e,t,n,i){var r=n.segmentIndex,o=t.length-e.length;if(i.segmentMove){var a=i.segmentMove.segmentStartIndex,s=i.segmentMove.newSegmentStartIndex;return r===a?s:r>=s?r+o<s?s:r+o:r}if(i.bendpointMove){var c,u=i.bendpointMove.insert,l=i.bendpointMove.bendpointIndex;if(0===o)return r;if(r>=l&&(c=u?r+1:r-1),r<l&&(c=r,u&&"bendpoint"!==n.type&&l-1===r)){var p=py(t,l);p<n.relativeLocation&&c++}return c}return 0===o?r:i.connectionStart&&0===r?0:i.connectionEnd&&r===e.length-2?t.length-2:Math.floor((t.length-2)/2)}function ly(e,t,n,i){var r=0,o=0,a={point:e,delta:{x:0,y:0}},s=ny(e,n),c=s.segmentIndex,u=uy(n,t,s,i);if(u<0||u>t.length-2||null===u)return a;var l=fy(n,c),p=fy(t,u),d=s.position,f=hy(l,d),h=dy(l,p);if("bendpoint"===s.type){var m=t.length-n.length,v=s.bendpointIndex,g=n[v];if(-1!==t.indexOf(g))return a;if(0===m){var y=t[v];return r=y.x-s.position.x,o=y.y-s.position.y,{delta:{x:r,y:o},point:{x:e.x+r,y:e.y+o}}}m<0&&0!==v&&v<n.length-1&&(f=py(n,v))}var b={x:(p[1].x-p[0].x)*f+p[0].x,y:(p[1].y-p[0].y)*f+p[0].y},x=Gp({x:e.x-d.x,y:e.y-d.y},h);return r=b.x+x.x-e.x,o=b.y+x.y-e.y,{point:mn(b),delta:mn({x:r,y:o})}}function py(e,t){var n=qp(e[t-1],e[t]),i=qp(e[t],e[t+1]),r=n/(n+i);return r}function dy(e,t){var n=Hp(e),i=Hp(t);return i-n}function fy(e,t){return[e[t],e[t+1]]}function hy(e,t){var n=qp(e[0],e[1]),i=qp(e[0],t);return 0===n?0:i/n}function my(e,t,n,i){var r=vy(e);return ly(r,t,n,i).delta}function vy(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function gy(e,t,n){var i=ju(t),r=ju(n),o=Nu(e,i),a={x:o.x*(n.width/t.width),y:o.y*(n.height/t.height)};return mn({x:r.x+a.x,y:r.y+a.y})}function yy(e,t,n){var i=ju(e),r=ju(t),o=ju(n),a=Nu(e,i),s=Nu(i,r),c=by(i,t,n);if(c)return c;var u={x:s.x*(n.width/t.width),y:s.y*(n.height/t.height)},l={x:o.x+u.x,y:o.y+u.y};return mn({x:l.x+a.x-e.x,y:l.y+a.y-e.y})}function by(e,t,n){var i=vn(t),r=vn(n);if(xy(i,r))return null;var o,a,s,c=wn(t,e);if("top"===c)o={x:0,y:r.bottom-i.bottom};else if("bottom"===c)o={x:0,y:r.top-i.top};else if("right"===c)o={x:r.left-i.left,y:0};else{if("left"!==c)return null;o={x:r.right-i.right,y:0}}return a={x:e.x+o.x,y:e.y+o.y},s=wn(n,a),s!==c?null:o}function xy(e,t){return wy(e,t)||_y(e,t)}function wy(e,t){return e.right!==t.right&&e.left!==t.left}function _y(e,t){return e.top!==t.top&&e.bottom!==t.bottom}var Ey={width:90,height:20},Cy="name",Sy="text";function Ay(e,t,n,i){function r(e){var t=e.context,n=t.connection,i=n.label,r=W({},t.hints),o=t.newWaypoints||n.waypoints,a=t.oldWaypoints;return"undefined"===typeof r.startChanged&&(r.startChanged=!!r.connectionStart),"undefined"===typeof r.endChanged&&(r.endChanged=!!r.connectionEnd),my(i,o,a,r)}Cc.call(this,e),this.postExecute("element.updateProperties",(function(e){var n=e.context,r=n.element,o=n.properties;if(Cy in o&&t.updateLabel(r,o[Cy]),Sy in o&&Ko(r,"bpmn:TextAnnotation")){var a=i.getTextAnnotationBounds({x:r.x,y:r.y,width:r.width,height:r.height},o[Sy]||"");t.updateLabel(r,o.text,a)}})),this.postExecute(["shape.create","connection.create"],(function(e){var n=e.context,r=n.hints||{};if(!1!==r.createElementsBehavior){var o=n.shape||n.connection,a=o.businessObject;if(!Ps(o)&&Cs(o)&&Pa(o)){var s=ks(o),c=i.getExternalLabelBounds(Ey,Pa(o));t.createLabel(o,s,{id:a.id+"_label",businessObject:a,width:c.width,height:c.height})}}})),this.postExecute("shape.delete",(function(e){var n=e.context,i=n.labelTarget,r=n.hints||{};i&&!1!==r.unsetLabel&&t.updateLabel(i,null,null,{removeShape:!1})})),this.postExecute(["label.create"],(function(e){var t,i=e.context,r=i.shape,o=i.labelTarget;o&&Ko(o,"bpmn:BaseElement")&&(t=Zo(o),t.label||(t.label=n.create("bpmndi:BPMNLabel",{bounds:n.create("dc:Bounds")}),r.di=t),W(t.label.bounds,{x:r.x,y:r.y,width:r.width,height:r.height}))})),this.postExecute(["connection.layout","connection.updateWaypoints"],(function(e){var n=e.context,i=n.hints||{};if(!1!==i.labelBehavior){var o,a=n.connection,s=a.label;s&&s.parent&&(o=r(e),t.moveShape(s,o))}})),this.postExecute(["shape.replace"],(function(e){var t=e.context,n=t.newShape,i=t.oldShape,r=Xo(n);r&&Cs(r)&&i.label&&n.label&&(n.label.x=i.label.x,n.label.y=i.label.y)})),this.postExecute("shape.resize",(function(e){var n=e.context,i=n.shape,r=n.newBounds,o=n.oldBounds;if(Ss(i)){var a=i.label,s=xn(a),c=Ry(o),u=ky(s,c),l=Ty(u,o,r);t.moveShape(a,l)}}))}function Ty(e,t,n){var i=gy(e,t,n);return mn(Nu(i,e))}function ky(e,t){if(t.length){var n=Py(e,t);return Wp(e,n)}}function Ry(e){return[[{x:e.x,y:e.y},{x:e.x+(e.width||0),y:e.y}],[{x:e.x+(e.width||0),y:e.y},{x:e.x+(e.width||0),y:e.y+(e.height||0)}],[{x:e.x,y:e.y+(e.height||0)},{x:e.x+(e.width||0),y:e.y+(e.height||0)}],[{x:e.x,y:e.y},{x:e.x,y:e.y+(e.height||0)}]]}function Py(e,t){var n=t.map((function(t){return{line:t,distance:Up(e,t)}})),i=N(n,"distance");return i[0].line}function Dy(e,t,n,i){return ly(e,t,n,i).point}function My(e,t){function n(e,t){var n=e.context,i=n.connection,r=W({},n.hints),o=n.newWaypoints||i.waypoints,a=n.oldWaypoints;return"undefined"===typeof r.startChanged&&(r.startChanged=!!r.connectionStart),"undefined"===typeof r.endChanged&&(r.endChanged=!!r.connectionEnd),Dy(t,o,a,r)}Cc.call(this,e),this.postExecute(["connection.layout","connection.updateWaypoints"],(function(e){var i=e.context,r=i.connection,o=r.outgoing,a=r.incoming;a.forEach((function(i){var r=i.waypoints[i.waypoints.length-1],o=n(e,r),a=[].concat(i.waypoints.slice(0,-1),[o]);t.updateWaypoints(i,a)})),o.forEach((function(i){var r=i.waypoints[0],o=n(e,r),a=[].concat([o],i.waypoints.slice(1));t.updateWaypoints(i,a)}))})),this.postExecute(["connection.move"],(function(e){var n=e.context,i=n.connection,r=i.outgoing,o=i.incoming,a=n.delta;o.forEach((function(e){var n=e.waypoints[e.waypoints.length-1],i={x:n.x+a.x,y:n.y+a.y},r=[].concat(e.waypoints.slice(0,-1),[i]);t.updateWaypoints(e,r)})),r.forEach((function(e){var n=e.waypoints[0],i={x:n.x+a.x,y:n.y+a.y},r=[].concat([i],e.waypoints.slice(1));t.updateWaypoints(e,r)}))}))}function By(e,t,n){var i=Iy(e),r=Ly(i,t),o=i[0];return r.length?r[r.length-1]:gy(o.original||o,n,t)}function Oy(e,t,n){var i=Iy(e),r=Ly(i,t),o=i[i.length-1];return r.length?r[0]:gy(o.original||o,n,t)}function jy(e,t,n){var i=Iy(e),r=Fy(t,n),o=i[0];return gy(o.original||o,r,t)}function Ny(e,t,n){var i=Iy(e),r=Fy(t,n),o=i[i.length-1];return gy(o.original||o,r,t)}function Fy(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function Iy(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function Ly(e,t){var n=R(e,$y);return E(n,(function(e){return zy(e,t)}))}function zy(e,t){return"intersect"===wn(t,e,1)}function $y(e){return e.original||e}function Hy(e,t){Cc.call(this,e),this.postExecute("shape.replace",(function(e){var n=e.oldShape,i=e.newShape;if(Gy(n,i)){var r=Vy(n);r.incoming.forEach((function(e){var r=Oy(e,i,n);t.reconnectEnd(e,i,r)})),r.outgoing.forEach((function(e){var r=By(e,i,n);t.reconnectStart(e,i,r)}))}}),!0)}function Gy(e,t){return Ko(e,"bpmn:Participant")&&wa(e)&&Ko(t,"bpmn:Participant")&&!wa(t)}function Vy(e){var t=Gt([e],!1),n=[],i=[];return t.forEach((function(t){t!==e&&(t.incoming.forEach((function(e){Ko(e,"bpmn:MessageFlow")&&n.push(e)})),t.outgoing.forEach((function(e){Ko(e,"bpmn:MessageFlow")&&i.push(e)})))}),[]),{incoming:n,outgoing:i}}i(Ay,Cc),Ay.$inject=["eventBus","modeling","bpmnFactory","textRenderer"],i(My,Cc),My.$inject=["eventBus","modeling"],Hy.$inject=["eventBus","modeling"],i(Hy,Cc);var Wy="flow elements must be children of pools/participants";function Uy(e,t,n){function i(e,n,i){t.add({position:{x:e.x+5,y:e.y+5},type:"error",timeout:i||2e3,html:"<div>"+n+"</div>"})}e.on(["shape.move.rejected","create.rejected"],(function(e){var t=e.context,r=t.shape,o=t.target;Ko(o,"bpmn:Collaboration")&&Ko(r,"bpmn:FlowNode")&&i(e,n(Wy))}))}function qy(e,t){Cc.call(this,e),this.preExecute("shape.resize",(function(e){var n=e.shape,i=Zo(n),r=i&&i.get("label"),o=r&&r.get("bounds");o&&t.updateModdleProperties(n,r,{bounds:void 0})}),!0)}function Ky(e,t,n){Cc.call(this,e),this.preExecute("shape.delete",(function(e){var i=e.context.shape;if(1===i.incoming.length&&1===i.outgoing.length){var r=i.incoming[0],o=i.outgoing[0];if(Ko(r,"bpmn:SequenceFlow")&&Ko(o,"bpmn:SequenceFlow")&&t.canConnect(r.source,o.target,r)){var a=Xy(r.waypoints,o.waypoints);n.reconnectEnd(r,o.target,a)}}}))}function Yy(e){return e.original||e}function Xy(e,t){var n=Ug(Yy(e[e.length-2]),Yy(e[e.length-1]),Yy(t[1]),Yy(t[0]));return n?[].concat(e.slice(0,e.length-1),[n],t.slice(1)):[Yy(e[0]),Yy(t[t.length-1])]}function Zy(e,t){Cc.call(this,e),this.preExecute("shape.delete",(function(e){var t=e.shape,n=t.parent;Ko(t,"bpmn:Participant")&&(e.collaborationRoot=n)}),!0),this.postExecute("shape.delete",(function(e){var n=e.collaborationRoot;n&&!n.businessObject.participants.length&&t.makeProcess()}),!0)}function Jy(e,t,n,i){Cc.call(this,e);var r=i.get("dragging",!1);function o(e){var i,r,o=e.source,a=e.target,s=e.parent;s&&(Ko(e,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(o,a)||(r=!0),n.canConnectMessageFlow(o,a)&&(i="bpmn:MessageFlow")),Ko(e,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(o,a)||(r=!0),n.canConnectSequenceFlow(o,a)&&(i="bpmn:SequenceFlow")),Ko(e,"bpmn:Association")&&!n.canConnectAssociation(o,a)&&(r=!0),r&&t.removeConnection(e),i&&t.connect(o,a,{type:i,waypoints:e.waypoints.slice()}))}function a(e){var i,o,a=e.context,c=a.connection,u=a.newSource||c.source,l=a.newTarget||c.target;i=n.canConnect(u,l),i&&i.type!==c.type&&(o=t.connect(u,l,{type:i.type,waypoints:c.waypoints.slice()}),t.removeConnection(c),a.connection=o,r&&s(c,o))}function s(e,t){var n,i=r.context(),o=i&&i.payload.previousSelection;o&&o.length&&(n=o.indexOf(e),-1!==n&&o.splice(n,1,t))}this.postExecuted("elements.move",(function(e){var t=e.closure,n=t.allConnections;C(n,o)}),!0),this.preExecute("connection.reconnect",a),this.postExecuted("element.updateProperties",(function(e){var n,i=e.context,r=i.properties,o=i.element,a=o.businessObject;r.default&&(n=w(o.outgoing,F({id:o.businessObject.default.id})),n&&t.updateProperties(n,{conditionExpression:void 0})),r.conditionExpression&&a.sourceRef.default===a&&t.updateProperties(o.source,{default:void 0})}))}function Qy(e,t,n,i,r,o){i.invoke(Cc,this),this._bpmnReplace=e,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,(function(e){var n=e.context,i=n.parent,r=n.elements,o=A(r,(function(e,n){var r=t.canReplace([n],n.host||n.parent||i);return r?e.concat(r.replacements):e}),[]);o.length&&this.replaceElements(r,o)}),this),this.postExecuted(["elements.move"],500,(function(e){var n=e.context,i=n.newParent,r=n.newHost,o=[];C(n.closure.topLevel,(function(e){o=Ea(e)?o.concat(e.children):o.concat(e)})),1===o.length&&r&&(i=r);var a=t.canReplace(o,i);a&&this.replaceElements(o,a.replacements,r)}),this),this.postExecute(["shape.replace"],1500,(function(e){var n,i=e.context,r=i.oldShape,o=i.newShape,a=r.attachers;a&&a.length&&(n=t.canReplace(a,o),this.replaceElements(a,n.replacements))}),this),this.postExecuted(["shape.replace"],1500,(function(e){var t=e.context,n=t.oldShape,i=t.newShape;r.unclaimId(n.businessObject.id,n.businessObject),r.updateProperties(i,{id:n.id})}))}Uy.$inject=["eventBus","tooltips","translate"],i(qy,Cc),qy.$inject=["eventBus","modeling"],i(Ky,Cc),Ky.$inject=["eventBus","bpmnRules","modeling"],Zy.$inject=["eventBus","modeling"],i(Zy,Cc),i(Jy,Cc),Jy.$inject=["eventBus","modeling","bpmnRules","injector"],i(Qy,Cc),Qy.prototype.replaceElements=function(e,t){var n=this._elementRegistry,i=this._bpmnReplace,r=this._selection;C(t,(function(t){var r={type:t.newElementType},o=n.get(t.oldElementId),a=e.indexOf(o);e[a]=i.replaceElement(o,r,{select:!1})})),t&&r.select(e)},Qy.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var eb=1500,tb={width:140,height:120},nb={width:300,height:60},ib={width:300,height:150},rb={width:140,height:120},ob={width:50,height:30};function ab(e){e.on("resize.start",eb,(function(e){var t=e.context,n=t.shape,i=t.direction,r=t.balanced;(Ko(n,"bpmn:Lane")||Ko(n,"bpmn:Participant"))&&(t.resizeConstraints=gb(n,i,r)),Ko(n,"bpmn:Participant")&&(t.minDimensions=ib),Ko(n,"bpmn:SubProcess")&&wa(n)&&(t.minDimensions=rb),Ko(n,"bpmn:TextAnnotation")&&(t.minDimensions=ob)}))}ab.$inject=["eventBus"];var sb=Math.abs,cb=Math.min,ub=Math.max;function lb(e,t,n,i){var r=e[t];e[t]=void 0===r?n:i(n,r)}function pb(e,t,n){return lb(e,t,n,cb)}function db(e,t,n){return lb(e,t,n,ub)}var fb=20,hb=50,mb=20,vb=20;function gb(e,t,n){var i=tm(e),r=!0,o=!0,a=Qh(i,[i]),s=vn(e),c={},u={};/e/.test(t)?u.right=s.left+nb.width:/w/.test(t)&&(u.left=s.right-nb.width),a.forEach((function(e){var i=vn(e);/n/.test(t)&&(i.top<s.top-10&&(r=!1),n&&sb(s.top-i.bottom)<10&&db(c,"top",i.top+nb.height),sb(s.top-i.top)<5&&pb(u,"top",i.bottom-nb.height)),/s/.test(t)&&(i.bottom>s.bottom+10&&(o=!1),n&&sb(s.bottom-i.top)<10&&pb(c,"bottom",i.bottom-nb.height),sb(s.bottom-i.bottom)<5&&db(u,"bottom",i.top+nb.height))}));var l=i.children.filter((function(e){return!e.hidden&&!e.waypoints&&(Ko(e,"bpmn:FlowElement")||Ko(e,"bpmn:Artifact"))}));return l.forEach((function(e){var n=vn(e);r&&/n/.test(t)&&pb(u,"top",n.top-mb),/e/.test(t)&&db(u,"right",n.right+fb),o&&/s/.test(t)&&db(u,"bottom",n.bottom+vb),/w/.test(t)&&pb(u,"left",n.left-hb)})),{min:u,max:c}}var yb=1001;function bb(e,t){e.on("resize.start",yb+500,(function(e){var t=e.context,n=t.shape;(Ko(n,"bpmn:Lane")||Ko(n,"bpmn:Participant"))&&(t.balanced=!qs(e))})),e.on("resize.end",yb,(function(e){var n=e.context,i=n.shape,r=n.canExecute,o=n.newBounds;if(Ko(i,"bpmn:Lane")||Ko(i,"bpmn:Participant"))return r&&(o=hn(o),t.resizeLane(i,o,n.balanced)),!1}))}bb.$inject=["eventBus","modeling"];var xb=500;function wb(e,t,n,i,r){function o(e){return Yo(e,["bpmn:ReceiveTask","bpmn:SendTask"])||_b(e,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(t){var n=e.getDefinitions(),i=n.get("rootElements");return!!w(i,F({id:t.id}))}function s(e){return Ko(e,"bpmn:ErrorEventDefinition")?"errorRef":Ko(e,"bpmn:EscalationEventDefinition")?"escalationRef":Ko(e,"bpmn:MessageEventDefinition")?"messageRef":Ko(e,"bpmn:SignalEventDefinition")?"signalRef":void 0}function c(e){if(Yo(e,["bpmn:ReceiveTask","bpmn:SendTask"]))return e.get("messageRef");var t=e.get("eventDefinitions"),n=t[0];return n.get(s(n))}function u(e,t){if(Yo(e,["bpmn:ReceiveTask","bpmn:SendTask"]))return e.set("messageRef",t);var n=e.get("eventDefinitions"),i=n[0];return i.set(s(i),t)}n.invoke(Cc,this),this.executed("shape.create",(function(t){var n=t.shape;if(o(n)){var i,r=Xo(n),s=c(r);s&&!a(s)&&(i=e.getDefinitions().get("rootElements"),tn(i,s),t.addedRootElement=s)}}),!0),this.reverted("shape.create",(function(t){var n=t.addedRootElement;if(n){var i=e.getDefinitions().get("rootElements");en(i,n)}}),!0),t.on("copyPaste.copyElement",(function(e){var t=e.descriptor,n=e.element;if(!n.labelTarget&&o(n)){var i=Xo(n),r=c(i);r&&(t.referencedRootElement=r)}})),t.on("copyPaste.pasteElement",xb,(function(e){var t=e.descriptor,n=t.businessObject,o=t.referencedRootElement;o&&(a(o)||(o=i.copyElement(o,r.create(o.$type))),u(n,o),delete t.referencedRootElement)}))}function _b(e,t){return h(t)||(t=[t]),k(t,(function(t){return Ca(e,t)}))}wb.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],i(wb,Cc);var Eb=Math.max;function Cb(e){e.on("spaceTool.getMinDimensions",(function(e){var t=e.shapes,n=e.axis,i=e.start,r={};return C(t,(function(e){var t=e.id;Ko(e,"bpmn:Participant")&&(Sb(n)?r[t]=ib:r[t]={width:ib.width,height:Ab(e,i)}),Ko(e,"bpmn:SubProcess")&&wa(e)&&(r[t]=rb),Ko(e,"bpmn:TextAnnotation")&&(r[t]=ob),Ko(e,"bpmn:Group")&&(r[t]=tb)})),r}))}function Sb(e){return"x"===e}function Ab(e,t){var n;return Tb(e)?(n=kb(e,t),Eb(ib.height,n)):ib.height}function Tb(e){return!!em(e).length}function kb(e,t){var n,i=em(e);return n=Rb(i,t),e.height-n.height+nb.height}function Rb(e,t){var n,i,r;for(n=0;n<e.length;n++)if(i=e[n],t>=i.y&&t<=i.y+i.height)return r=em(i),r.length?Rb(r,t):i}Cb.$inject=["eventBus"];var Pb=400,Db=600,Mb={x:180,y:160};function Bb(e,t,n,i,r,o,a){Cc.call(this,t),this._canvas=e,this._eventBus=t,this._modeling=n,this._elementFactory=i,this._bpmnFactory=r,this._bpmnjs=o,this._elementRegistry=a;var s=this;function c(e){return Ko(e,"bpmn:SubProcess")&&!wa(e)}function u(t){var n=t.shape,i=t.newRootElement,r=Xo(n);i=s._addDiagram(i||r),t.newRootElement=e.addRootElement(i)}function l(t){var n=t.shape,i=Xo(n);s._removeDiagram(i);var r=t.newRootElement=a.get(jc(i));e.removeRootElement(r)}this.executed("shape.create",(function(e){var t=e.shape;c(t)&&u(e)}),!0),this.postExecuted("shape.create",(function(e){var t=e.shape,n=e.newRootElement;n&&t.children&&(s._showRecursively(t.children),s._moveChildrenToShape(t,n))}),!0),this.reverted("shape.create",(function(e){var t=e.shape;c(t)&&l(e)}),!0),this.preExecuted("shape.delete",(function(e){var t=e.shape;if(c(t)){var i=a.get(jc(t));i&&n.removeElements(i.children.slice())}}),!0),this.executed("shape.delete",(function(e){var t=e.shape;c(t)&&l(e)}),!0),this.reverted("shape.delete",(function(e){var t=e.shape;c(t)&&u(e)}),!0),this.preExecuted("shape.replace",(function(t){var n=t.oldShape,i=t.newShape;c(n)&&c(i)&&(t.oldRoot=e.removeRootElement(jc(n)))}),!0),this.postExecuted("shape.replace",(function(t){var i=t.newShape,r=t.oldRoot,o=e.findRoot(jc(i));if(r&&o){var a=r.children;n.moveElements(a,{x:0,y:0},o)}}),!0),this.executed("element.updateProperties",(function(e){var t=e.element;if(Ko(t,"bpmn:SubProcess")){var n=e.properties,i=e.oldProperties,r=i.id,o=n.id;if(r!==o){if(Fc(t))return a.updateId(t,Nc(o)),void a.updateId(r,o);var s=a.get(Nc(r));s&&a.updateId(Nc(r),Nc(o))}}}),!0),this.reverted("element.updateProperties",(function(e){var t=e.element;if(Ko(t,"bpmn:SubProcess")){var n=e.properties,i=e.oldProperties,r=i.id,o=n.id;if(r!==o){if(Fc(t))return a.updateId(t,Nc(r)),void a.updateId(o,r);var s=a.get(Nc(o));s&&a.updateId(s,Nc(r))}}}),!0),t.on("element.changed",(function(e){var n=e.element;if(Fc(n)){var i=n,r=a.get(Oc(i));r&&r!==i&&t.fire("element.changed",{element:r})}})),this.executed("shape.toggleCollapse",Pb,(function(e){var t=e.shape;Ko(t,"bpmn:SubProcess")&&(wa(t)?l(e):(u(e),s._showRecursively(t.children)))}),!0),this.reverted("shape.toggleCollapse",Pb,(function(e){var t=e.shape;Ko(t,"bpmn:SubProcess")&&(wa(t)?l(e):(u(e),s._showRecursively(t.children)))}),!0),this.postExecuted("shape.toggleCollapse",Db,(function(e){var t=e.shape;if(Ko(t,"bpmn:SubProcess")){var n=e.newRootElement;n&&(wa(t)?s._moveChildrenToShape(n,t):s._moveChildrenToShape(t,n))}}),!0),t.on("copyPaste.createTree",(function(e){var t=e.element,n=e.children;if(c(t)){var i=jc(t),r=a.get(i);r&&n.push.apply(n,r.children)}})),t.on("copyPaste.copyElement",(function(e){var t=e.descriptor,n=e.element,i=e.elements,r=n.parent,o=Ko(Zo(r),"bpmndi:BPMNPlane");if(o){var a=Oc(r),s=w(i,(function(e){return e.id===a}));s&&(t.parent=s.id)}})),t.on("copyPaste.pasteElement",(function(e){var t=e.descriptor;t.parent&&(c(t.parent)||t.parent.hidden)&&(t.hidden=!0)}))}function Ob(e,t){e.invoke(Cc,this),this.postExecuted("shape.replace",(function(e){var n=e.context.oldShape,i=e.context.newShape;if(Ko(i,"bpmn:SubProcess")&&(Ko(n,"bpmn:Task")||Ko(n,"bpmn:CallActivity"))&&wa(i)){var r=jb(i);t.createShape({type:"bpmn:StartEvent"},r,i)}}))}function jb(e){return{x:e.x+e.width/6,y:e.y+e.height/2}}function Nb(e,t){Cc.call(this,e),this.postExecuted("shape.toggleCollapse",1500,(function(e){var n=e.shape;if(!wa(n)){var i=Gt(n);i.forEach((function(e){var t=e.incoming.slice(),n=e.outgoing.slice();C(t,(function(e){r(e,!0)})),C(n,(function(e){r(e,!1)}))}))}function r(e,r){-1!==i.indexOf(e.source)&&-1!==i.indexOf(e.target)||(r?t.reconnectEnd(e,n,xn(n)):t.reconnectStart(e,n,xn(n)))}}),!0)}i(Bb,Cc),Bb.prototype._moveChildrenToShape=function(e,t){var n,i=this._modeling,r=e.children;if(r){r=r.concat(r.reduce((function(t,n){return n.label&&n.label.parent!==e?t.concat(n.label):t}),[]));var o=r.filter((function(e){return!e.hidden}));if(o.length){var a=Wt(o);if(t.x){var s=xn(t),c=xn(a);n={x:s.x-c.x,y:s.y-c.y}}else n={x:Mb.x-a.x,y:Mb.y-a.y};i.moveElements(r,n,t,{autoResize:!1})}else i.moveElements(r,{x:0,y:0},t,{autoResize:!1})}},Bb.prototype._showRecursively=function(e,t){var n=this,i=[];return e.forEach((function(e){e.hidden=!!t,i=i.concat(e),e.children&&(i=i.concat(n._showRecursively(e.children,e.collapsed||t)))})),i},Bb.prototype._addDiagram=function(e){var t=this._bpmnjs,n=t.getDefinitions().diagrams;return e.businessObject||(e=this._createNewDiagram(e)),n.push(e.di.$parent),e},Bb.prototype._createNewDiagram=function(e){var t=this._bpmnFactory,n=this._elementFactory,i=t.create("bpmndi:BPMNPlane",{bpmnElement:e}),r=t.create("bpmndi:BPMNDiagram",{plane:i});i.$parent=r;var o=n.createRoot({id:jc(e),type:e.$type,di:i,businessObject:e,collapsed:!0});return o},Bb.prototype._removeDiagram=function(e){var t=this._bpmnjs,n=t.getDefinitions().diagrams,i=w(n,(function(t){return t.plane.bpmnElement.id===e.id}));return n.splice(n.indexOf(i),1),i},Bb.$inject=["canvas","eventBus","modeling","elementFactory","bpmnFactory","bpmnjs","elementRegistry"],Ob.$inject=["injector","modeling"],i(Ob,Cc),i(Nb,Cc),Nb.$inject=["eventBus","modeling"];var Fb=500;function Ib(e,t,n,i){function r(e){e.length&&e.forEach((function(e){"label"!==e.type||e.businessObject.name||(e.hidden=!0)}))}function o(e,t){var n,i,r=e.children,o=t;return n=Lb(r).concat([e]),i=Kh(n),i?(o.width=Math.max(i.width,o.width),o.height=Math.max(i.height,o.height),o.x=i.x+(i.width-o.width)/2,o.y=i.y+(i.height-o.height)/2):(o.x=e.x+(e.width-o.width)/2,o.y=e.y+(e.height-o.height)/2),o}function a(e,t){return{x:e.x+(e.width-t.width)/2,y:e.y+(e.height-t.height)/2,width:t.width,height:t.height}}Cc.call(this,e),this.executed(["shape.toggleCollapse"],Fb,(function(e){var t=e.context,n=t.shape;Ko(n,"bpmn:SubProcess")&&(n.collapsed?Zo(n).isExpanded=!1:(r(n.children),Zo(n).isExpanded=!0))})),this.reverted(["shape.toggleCollapse"],Fb,(function(e){var t=e.context,n=t.shape;n.collapsed?Zo(n).isExpanded=!1:Zo(n).isExpanded=!0})),this.postExecuted(["shape.toggleCollapse"],Fb,(function(e){var i,r=e.context.shape,s=t.getDefaultSize(r);i=r.collapsed?a(r,s):o(r,s),n.resizeShape(r,i,null,{autoResize:!r.collapsed&&"nwse"})}))}function Lb(e){return e.filter((function(e){return!e.hidden}))}function zb(e,t,n,i){t.invoke(Cc,this),this.preExecute("shape.delete",(function(e){var t=e.context,r=t.shape,o=r.businessObject;Ps(r)||(Ko(r,"bpmn:Participant")&&wa(r)&&n.ids.unclaim(o.processRef.id),i.unclaimId(o.id,o))})),this.preExecute("connection.delete",(function(e){var t=e.context,n=t.connection,r=n.businessObject;i.unclaimId(r.id,r)})),this.preExecute("canvas.updateRoot",(function(){var t=e.getRootElement(),i=t.businessObject;Ko(t,"bpmn:Collaboration")&&n.ids.unclaim(i.id)}))}function $b(e,t){Cc.call(this,e),this.preExecute("connection.delete",(function(e){var n=e.context,i=n.connection,r=i.source;Hb(i,r)&&t.updateProperties(r,{default:null})}))}function Hb(e,t){if(!Ko(e,"bpmn:SequenceFlow"))return!1;var n=Xo(t),i=Xo(e);return n.get("default")===i}i(Ib,Cc),Ib.$inject=["eventBus","elementFactory","modeling"],i(zb,Cc),zb.$inject=["canvas","injector","moddle","modeling"],i($b,Cc),$b.$inject=["eventBus","modeling"];var Gb=500,Vb=5e3;function Wb(e,t,n){var i;function r(){return i=i||new Ub,i.enter(),i}function o(){if(!i)throw new Error(n("out of bounds release"));return i}function a(){if(!i)throw new Error(n("out of bounds release"));var e=i.leave();return e&&(t.updateLaneRefs(i.flowNodes,i.lanes),i=null),e}Cc.call(this,e);var s=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(s,Vb,(function(e){r()})),this.postExecuted(s,Gb,(function(e){a()})),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],(function(e){var t=e.context,n=t.shape,i=o();n.labelTarget||(Ko(n,"bpmn:Lane")&&i.addLane(n),Ko(n,"bpmn:FlowNode")&&i.addFlowNode(n))}))}function Ub(){this.flowNodes=[],this.lanes=[],this.counter=0,this.addLane=function(e){this.lanes.push(e)},this.addFlowNode=function(e){this.flowNodes.push(e)},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}Wb.$inject=["eventBus","modeling","translate"],i(Wb,Cc);var qb={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","associationBehavior","attachEventBehavior","boundaryEventBehavior","createBehavior","createDataObjectBehavior","createParticipantBehavior","dataInputAssociationBehavior","dataStoreBehavior","deleteLaneBehavior","detachEventBehavior","dropOnFlowBehavior","eventBasedGatewayBehavior","fixHoverBehavior","groupBehavior","importDockingFix","isHorizontalFix","labelBehavior","layoutConnectionBehavior","messageFlowBehavior","modelingFeedback","removeElementBehavior","removeEmbeddedLabelBoundsBehavior","removeParticipantBehavior","replaceConnectionBehavior","replaceElementBehaviour","resizeBehavior","resizeLaneBehavior","rootElementReferenceBehavior","spaceToolBehavior","subProcessPlaneBehavior","subProcessStartEventBehavior","toggleCollapseConnectionBehaviour","toggleElementCollapseBehaviour","unclaimIdBehavior","updateFlowNodeRefsBehavior","unsetDefaultFlowBehavior"],adaptiveLabelPositioningBehavior:["type",qv],appendBehavior:["type",Qv],associationBehavior:["type",eg],attachEventBehavior:["type",ng],boundaryEventBehavior:["type",og],createBehavior:["type",ag],createDataObjectBehavior:["type",sg],createParticipantBehavior:["type",dg],dataInputAssociationBehavior:["type",yg],dataStoreBehavior:["type",wg],deleteLaneBehavior:["type",Sg],detachEventBehavior:["type",Tg],dropOnFlowBehavior:["type",Dg],eventBasedGatewayBehavior:["type",Og],fixHoverBehavior:["type",Ig],groupBehavior:["type",Wg],importDockingFix:["type",qg],isHorizontalFix:["type",Yg],labelBehavior:["type",Ay],layoutConnectionBehavior:["type",My],messageFlowBehavior:["type",Hy],modelingFeedback:["type",Uy],removeElementBehavior:["type",Ky],removeEmbeddedLabelBoundsBehavior:["type",qy],removeParticipantBehavior:["type",Zy],replaceConnectionBehavior:["type",Jy],replaceElementBehaviour:["type",Qy],resizeBehavior:["type",ab],resizeLaneBehavior:["type",bb],rootElementReferenceBehavior:["type",wb],spaceToolBehavior:["type",Cb],subProcessPlaneBehavior:["type",Bb],subProcessStartEventBehavior:["type",Ob],toggleCollapseConnectionBehaviour:["type",Nb],toggleElementCollapseBehaviour:["type",Ib],unclaimIdBehavior:["type",zb],unsetDefaultFlowBehavior:["type",$b],updateFlowNodeRefsBehavior:["type",Wb]};function Kb(e,t){var n=wn(e,t,-15);return"intersect"!==n?n:null}function Yb(e){Nl.call(this,e)}function Xb(e){return Zb(e)?null:Yo(e,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}function Zb(e){return!e||Ps(e)}function Jb(e,t){return e===t}function Qb(e){do{if(Ko(e,"bpmn:Process"))return Xo(e);if(Ko(e,"bpmn:Participant"))return Xo(e).processRef||Xo(e)}while(e=e.parent)}function ex(e){return Ko(e,"bpmn:TextAnnotation")}function tx(e){return Ko(e,"bpmn:Group")&&!e.labelTarget}function nx(e){return Ko(e,"bpmn:BoundaryEvent")&&ux(e,"bpmn:CompensateEventDefinition")}function ix(e){return Xo(e).isForCompensation}function rx(e,t){var n=Qb(e),i=Qb(t);return n===i}function ox(e){return Ko(e,"bpmn:InteractionNode")&&!Ko(e,"bpmn:BoundaryEvent")&&(!Ko(e,"bpmn:Event")||Ko(e,"bpmn:ThrowEvent")&&lx(e,"bpmn:MessageEventDefinition"))}function ax(e){return Ko(e,"bpmn:InteractionNode")&&!ix(e)&&(!Ko(e,"bpmn:Event")||Ko(e,"bpmn:CatchEvent")&&lx(e,"bpmn:MessageEventDefinition"))&&!(Ko(e,"bpmn:BoundaryEvent")&&!ux(e,"bpmn:MessageEventDefinition"))}function sx(e){var t=e;while(t=t.parent){if(Ko(t,"bpmn:FlowElementsContainer"))return Xo(t);if(Ko(t,"bpmn:Participant"))return Xo(t).processRef}return null}function cx(e,t){var n=sx(e),i=sx(t);return n===i}function ux(e,t){var n=Xo(e);return!!w(n.eventDefinitions||[],(function(e){return Ko(e,t)}))}function lx(e,t){var n=Xo(e);return(n.eventDefinitions||[]).every((function(e){return Ko(e,t)}))}function px(e){return Ko(e,"bpmn:FlowNode")&&!Ko(e,"bpmn:EndEvent")&&!Ea(e)&&!(Ko(e,"bpmn:IntermediateThrowEvent")&&ux(e,"bpmn:LinkEventDefinition"))&&!nx(e)&&!ix(e)}function dx(e){return Ko(e,"bpmn:FlowNode")&&!Ko(e,"bpmn:StartEvent")&&!Ko(e,"bpmn:BoundaryEvent")&&!Ea(e)&&!(Ko(e,"bpmn:IntermediateCatchEvent")&&ux(e,"bpmn:LinkEventDefinition"))&&!ix(e)}function fx(e){return Ko(e,"bpmn:ReceiveTask")||Ko(e,"bpmn:IntermediateCatchEvent")&&(ux(e,"bpmn:MessageEventDefinition")||ux(e,"bpmn:TimerEventDefinition")||ux(e,"bpmn:ConditionalEventDefinition")||ux(e,"bpmn:SignalEventDefinition"))}function hx(e){return e.waypoints}function mx(e){var t=[];while(e)e=e.parent,e&&t.push(e);return t}function vx(e,t){var n=mx(t);return-1!==n.indexOf(e)}function gx(e,t,n){if(Zb(e)||Zb(t))return null;if(!Ko(n,"bpmn:DataAssociation")){if(Ox(e,t))return{type:"bpmn:MessageFlow"};if(jx(e,t))return{type:"bpmn:SequenceFlow"}}var i=Nx(e,t);return i||(nx(e)&&ix(t)?{type:"bpmn:Association",associationDirection:"One"}:!!Bx(e,t)&&{type:"bpmn:Association"})}function yx(e,t,n){return!(!Ps(e)&&!tx(e))||!(Ko(t,"bpmn:Participant")&&!wa(t))&&(Ko(e,"bpmn:Participant")?Ko(t,"bpmn:Process")||Ko(t,"bpmn:Collaboration"):Yo(e,["bpmn:DataInput","bpmn:DataOutput"])&&e.parent?t===e.parent:Ko(e,"bpmn:Lane")?Ko(t,"bpmn:Participant")||Ko(t,"bpmn:Lane"):!(Ko(e,"bpmn:BoundaryEvent")&&!bx(e))&&(Ko(e,"bpmn:FlowElement")&&!Ko(e,"bpmn:DataStoreReference")?Ko(t,"bpmn:FlowElementsContainer")?wa(t):Yo(t,["bpmn:Participant","bpmn:Lane"]):Ko(e,"bpmn:DataStoreReference")&&Ko(t,"bpmn:Collaboration")?k(Xo(t).get("participants"),(function(e){return!!e.get("processRef")})):Yo(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?Yo(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):!!Ko(e,"bpmn:MessageFlow")&&(Ko(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t)))}function bx(e){return Xo(e).cancelActivity&&(Ex(e)||Cx(e))}function xx(e){return!Ps(e)&&Ko(e,"bpmn:BoundaryEvent")}function wx(e){return Ko(e,"bpmn:Lane")}function _x(e){return!!xx(e)||(!(!Ko(e,"bpmn:IntermediateThrowEvent")||!Ex(e))||Ko(e,"bpmn:IntermediateCatchEvent")&&Cx(e))}function Ex(e){var t=Xo(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function Cx(e){return Sx(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function Sx(e,t){return t.some((function(t){return ux(e,t)}))}function Ax(e){return Ko(e,"bpmn:ReceiveTask")&&w(e.incoming,(function(e){return Ko(e.source,"bpmn:EventBasedGateway")}))}function Tx(e,t,n,i){if(Array.isArray(e)||(e=[e]),1!==e.length)return!1;var r=e[0];return!Ps(r)&&(!!_x(r)&&(!Ea(t)&&(!(!Ko(t,"bpmn:Activity")||ix(t))&&(!(i&&!Kb(i,t))&&(!Ax(t)&&"attach")))))}function kx(e,t,n){if(!t)return!1;var i={replacements:[]};return C(e,(function(e){Ea(t)||Ko(e,"bpmn:StartEvent")&&"label"!==e.type&&yx(e,t)&&(_a(e)||i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"}),(Sa(e)||Aa(e)||Ta(e))&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"}),Sx(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&Ko(t,"bpmn:SubProcess")&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"})),Ko(t,"bpmn:Transaction")||ux(e,"bpmn:CancelEventDefinition")&&"label"!==e.type&&(Ko(e,"bpmn:EndEvent")&&yx(e,t)&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:EndEvent"}),Ko(e,"bpmn:BoundaryEvent")&&Tx(e,t,null,n)&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:BoundaryEvent"}))})),!!i.replacements.length&&i}function Rx(e,t){return!k(e,wx)&&(!t||e.every((function(e){return yx(e,t)})))}function Px(e,t,n,i){return!!t&&(!(!Ps(e)&&!tx(e))||!Jb(n,t)&&((!n||!vx(n,t))&&(yx(e,t,i)||Fx(e,t,i))))}function Dx(e,t){return Ko(e,"bpmn:SubProcess")?wa(e)&&(!t||t.width>=100&&t.height>=80):Ko(e,"bpmn:Lane")?!t||t.width>=130&&t.height>=60:Ko(e,"bpmn:Participant")?!t||t.width>=250&&t.height>=50:!!ex(e)||!!tx(e)}function Mx(e,t){var n=ex(e),i=ex(t);return(n||i)&&n!==i}function Bx(e,t){return!(!nx(e)||!ix(t))||!vx(t,e)&&!vx(e,t)&&(!!Mx(e,t)||!!Nx(e,t))}function Ox(e,t){return!(Hx(e)&&!Hx(t))&&(ox(e)&&ax(t)&&!rx(e,t))}function jx(e,t){return!(fx(t)&&t.incoming.length>0&&$x(t.incoming)&&!Ko(e,"bpmn:EventBasedGateway"))&&(px(e)&&dx(t)&&cx(e,t)&&!(Ko(e,"bpmn:EventBasedGateway")&&!fx(t)))}function Nx(e,t){return Yo(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&Yo(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:!(!Yo(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])||!Yo(e,["bpmn:Activity","bpmn:CatchEvent"]))&&{type:"bpmn:DataOutputAssociation"}}function Fx(e,t,n){if(!t)return!1;if(Array.isArray(e)){if(1!==e.length)return!1;e=e[0]}return t.source!==e&&t.target!==e&&(Yo(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!Ps(t)&&Ko(e,"bpmn:FlowNode")&&!Ko(e,"bpmn:BoundaryEvent")&&yx(e,t.parent,n))}function Ix(e,t){return e&&t&&-1!==e.indexOf(t)}function Lx(e,t){return!!Ps(t)||!(Ko(t,"bpmn:Lane")&&!Ix(e,t.parent))}function zx(e){if(e&&e.source)return Ko(e.source,"bpmn:EventBasedGateway")}function $x(e){return e=e||[],e.some(zx)}function Hx(e){return jh(e,"bpmn:Process")||jh(e,"bpmn:Collaboration")}i(Yb,Nl),Yb.$inject=["eventBus"],Yb.prototype.init=function(){this.addRule("connection.start",(function(e){var t=e.source;return Xb(t)})),this.addRule("connection.create",(function(e){var t=e.source,n=e.target,i=e.hints||{},r=i.targetParent,o=i.targetAttach;if(o)return!1;r&&(n.parent=r);try{return gx(t,n)}finally{r&&(n.parent=null)}})),this.addRule("connection.reconnect",(function(e){var t=e.connection,n=e.source,i=e.target;return gx(n,i,t)})),this.addRule("connection.updateWaypoints",(function(e){return{type:e.connection.type}})),this.addRule("shape.resize",(function(e){var t=e.shape,n=e.newBounds;return Dx(t,n)})),this.addRule("elements.create",(function(e){var t=e.elements,n=e.position,i=e.target;return!(hx(i)&&!Fx(t,i,n))&&T(t,(function(e){return hx(e)?gx(e.source,e.target,e):e.host?Tx(e,e.host,null,n):Px(e,i,null,n)}))})),this.addRule("elements.move",(function(e){var t=e.target,n=e.shapes,i=e.position;return Tx(n,t,null,i)||kx(n,t,i)||Rx(n,t,i)||Fx(n,t,i)})),this.addRule("shape.create",(function(e){return Px(e.shape,e.target,e.source,e.position)})),this.addRule("shape.attach",(function(e){return Tx(e.shape,e.target,null,e.position)})),this.addRule("element.copy",(function(e){var t=e.element,n=e.elements;return Lx(n,t)}))},Yb.prototype.canConnectMessageFlow=Ox,Yb.prototype.canConnectSequenceFlow=jx,Yb.prototype.canConnectDataAssociation=Nx,Yb.prototype.canConnectAssociation=Bx,Yb.prototype.canMove=Rx,Yb.prototype.canAttach=Tx,Yb.prototype.canReplace=kx,Yb.prototype.canDrop=yx,Yb.prototype.canInsert=Fx,Yb.prototype.canCreate=Px,Yb.prototype.canConnect=gx,Yb.prototype.canResize=Dx,Yb.prototype.canCopy=Lx;var Gx={__depends__:[Mp],__init__:["bpmnRules"],bpmnRules:["type",Yb]},Vx=2e3;function Wx(e,t){function n(){var e=t.getRootElements();C(e,(function(e){var t,n,i=Zo(e);t=Gt([e],!1),t=E(t,(function(t){return t!==e&&!t.labelTarget})),n=R(t,Zo),i.set("planeElement",n)}))}e.on("saveXML.start",Vx,n)}Wx.$inject=["eventBus","canvas"];var Ux={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",Wx]};function qx(e){Cc.call(this,e);var t=this;this.preExecute(["shape.create","connection.create"],(function(e){var n=e.context,i=n.shape||n.connection,r=n.parent,o=t.getOrdering(i,r);o&&(void 0!==o.parent&&(n.parent=o.parent),n.parentIndex=o.index)})),this.preExecute(["shape.move","connection.move"],(function(e){var n=e.context,i=n.shape||n.connection,r=n.newParent||i.parent,o=t.getOrdering(i,r);o&&(void 0!==o.parent&&(n.newParent=o.parent),n.newParentIndex=o.index)}))}function Kx(e,t,n){qx.call(this,e);var i=[{type:"bpmn:SubProcess",order:{level:6}},{type:"bpmn:SequenceFlow",order:{level:9,containers:["bpmn:Participant","bpmn:FlowElementsContainer"]}},{type:"bpmn:DataAssociation",order:{level:9,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:MessageFlow",order:{level:9,containers:["bpmn:Collaboration"]}},{type:"bpmn:Association",order:{level:6,containers:["bpmn:Participant","bpmn:FlowElementsContainer","bpmn:Collaboration"]}},{type:"bpmn:BoundaryEvent",order:{level:8}},{type:"bpmn:Group",order:{level:10,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:FlowElement",order:{level:5}},{type:"bpmn:Participant",order:{level:-2}},{type:"bpmn:Lane",order:{level:-1}}];function r(e){if(e.labelTarget)return{level:10};var t=w(i,(function(t){return Yo(e,[t.type])}));return t&&t.order||{level:1}}function o(e){var t=e.order;if(t||(e.order=t=r(e)),!t)throw new Error("no order for <"+e.id+">");return t}function a(e,t,n){var i=t;while(i){if(Yo(i,n))break;i=i.parent}if(!i)throw new Error("no parent for <"+e.id+"> in <"+(t&&t.id)+">");return i}this.getOrdering=function(e,n){if(e.labelTarget)return{parent:t.findRoot(n)||t.getRootElement(),index:-1};var i=o(e);i.containers&&(n=a(e,n,i.containers));var r=n.children.indexOf(e),s=_(n.children,(function(t){return!(!e.labelTarget&&t.labelTarget)&&i.level<o(t).level}));return-1!==s&&-1!==r&&r<s&&(s-=1),{index:s,parent:n}}}qx.prototype.getOrdering=function(e,t){return null},i(qx,Cc),Kx.$inject=["eventBus","canvas","translate"],i(Kx,qx);var Yx={__depends__:[ws],__init__:["bpmnOrderingProvider"],bpmnOrderingProvider:["type",Kx]};function Xx(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],(function(){this.clear(!1)}),this)}Xx.$inject=["eventBus","injector"],Xx.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";var n={command:e,context:t};this._pushAction(n),this._internalExecute(n),this._popAction(n)},Xx.prototype.canExecute=function(e,t){var n={command:e,context:t},i=this._getHandler(e),r=this._fire(e,"canExecute",n);if(void 0===r){if(!i)return!1;i.canExecute&&(r=i.canExecute(t))}return r},Xx.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,!1!==e&&this._fire("changed",{trigger:"clear"})},Xx.prototype.undo=function(){var e,t=this._getUndoAction();if(t){this._currentExecution.trigger="undo",this._pushAction(t);while(t){if(this._internalUndo(t),e=this._getUndoAction(),!e||e.id!==t.id)break;t=e}this._popAction()}},Xx.prototype.redo=function(){var e,t=this._getRedoAction();if(t){this._currentExecution.trigger="redo",this._pushAction(t);while(t){if(this._internalExecute(t,!0),e=this._getRedoAction(),!e||e.id!==t.id)break;t=e}this._popAction()}},Xx.prototype.register=function(e,t){this._setHandler(e,t)},Xx.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");var n=this._injector.instantiate(t);this.register(e,n)},Xx.prototype.canUndo=function(){return!!this._getUndoAction()},Xx.prototype.canRedo=function(){return!!this._getRedoAction()},Xx.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},Xx.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},Xx.prototype._internalUndo=function(e){var t=this,n=e.command,i=e.context,r=this._getHandler(n);this._atomicDo((function(){t._fire(n,"revert",e),r.revert&&t._markDirty(r.revert(i)),t._revertedAction(e),t._fire(n,"reverted",e)}))},Xx.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);var i,r,o,a=t?[e+"."+t,t]:[e];for(n=this._eventBus.createEvent(n),i=0;r=a[i];i++)if(o=this._eventBus.fire("commandStack."+r,n),n.cancelBubble)break;return o},Xx.prototype._createId=function(){return this._uid++},Xx.prototype._atomicDo=function(e){var t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},Xx.prototype._internalExecute=function(e,t){var n=this,i=e.command,r=e.context,o=this._getHandler(i);if(!o)throw new Error("no command handler registered for <"+i+">");this._pushAction(e),t||(this._fire(i,"preExecute",e),o.preExecute&&o.preExecute(r),this._fire(i,"preExecuted",e)),this._atomicDo((function(){n._fire(i,"execute",e),o.execute&&n._markDirty(o.execute(r)),n._executedAction(e,t),n._fire(i,"executed",e)})),t||(this._fire(i,"postExecute",e),o.postExecute&&o.postExecute(r),this._fire(i,"postExecuted",e)),this._popAction(e)},Xx.prototype._pushAction=function(e){var t=this._currentExecution,n=t.actions,i=n[0];if(t.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+e.command+")");e.id||(e.id=i&&i.id||this._createId()),n.push(e)},Xx.prototype._popAction=function(){var e=this._currentExecution,t=e.trigger,n=e.actions,i=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:O("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},Xx.prototype._markDirty=function(e){var t=this._currentExecution;e&&(e=h(e)?e:[e],t.dirty=t.dirty.concat(e))},Xx.prototype._executedAction=function(e,t){var n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},Xx.prototype._revertedAction=function(e){this._stackIdx--},Xx.prototype._getHandler=function(e){return this._handlerMap[e]},Xx.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};var Zx={commandStack:["type",Xx]},Jx=new dc("tt");function Qx(e){var t=Te('<div class="djs-tooltip-container" />');return ne(t,{position:"absolute",width:"0",height:"0"}),e.insertBefore(t,e.firstChild),t}function ew(e,t,n){ne(e,{left:t+"px",top:n+"px"})}function tw(e,t){e.style.display=!1===t?"none":""}var nw="djs-tooltip",iw="."+nw;function rw(e,t){this._eventBus=e,this._canvas=t,this._ids=Jx,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=Qx(t.getContainer());var n=this;Ae.bind(this._tooltipRoot,iw,"mousedown",(function(e){e.stopPropagation()})),Ae.bind(this._tooltipRoot,iw,"mouseover",(function(e){n.trigger("mouseover",e)})),Ae.bind(this._tooltipRoot,iw,"mouseout",(function(e){n.trigger("mouseout",e)})),this._init()}rw.$inject=["eventBus","canvas"],rw.prototype.add=function(e){if(!e.position)throw new Error("must specifiy tooltip position");if(!e.html)throw new Error("must specifiy tooltip html");var t=this._ids.next();return e=W({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t},rw.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,i=this.get(ie(n,"data-tooltip-id"));i&&("mouseover"===e&&i.timeout&&this.clearTimeout(i),"mouseout"===e&&i.timeout&&(i.timeout=1e3,this.setTimeout(i)))},rw.prototype.get=function(e){return"string"!==typeof e&&(e=e.id),this._tooltips[e]},rw.prototype.clearTimeout=function(e){if(e=this.get(e),e){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}},rw.prototype.setTimeout=function(e){if(e=this.get(e),e){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout((function(){t.remove(e)}),e.timeout)}},rw.prototype.remove=function(e){var t=this.get(e);t&&(Be(t.html),Be(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])},rw.prototype.show=function(){tw(this._tooltipRoot)},rw.prototype.hide=function(){tw(this._tooltipRoot,!1)},rw.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1,i="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._tooltipRoot.style.transform=i,this._tooltipRoot.style["-ms-transform"]=i},rw.prototype._addTooltip=function(e){var t,n=e.id,i=e.html,r=this._tooltipRoot;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),y(i)&&(i=Te(i)),t=Te('<div data-tooltip-id="'+n+'" class="'+nw+'">'),ne(t,{position:"absolute"}),t.appendChild(i),e.type&&ce(t).add("djs-tooltip-"+e.type),e.className&&ce(t).add(e.className),e.htmlContainer=t,r.appendChild(t),this._tooltips[n]=e,this._updateTooltip(e)},rw.prototype._updateTooltip=function(e){var t=e.position,n=e.htmlContainer;ew(n,t.x,t.y)},rw.prototype._updateTooltipVisibilty=function(e){C(this._tooltips,(function(t){var n=t.show,i=t.htmlContainer,r=!0;n&&((n.minZoom>e.scale||n.maxZoom<e.scale)&&(r=!1),tw(i,r))}))},rw.prototype._init=function(){var e=this;function t(t){e._updateRoot(t),e._updateTooltipVisibilty(t),e.show()}this._eventBus.on("canvas.viewbox.changing",(function(t){e.hide()})),this._eventBus.on("canvas.viewbox.changed",(function(e){t(e.viewbox)}))};var ow={__init__:["tooltips"],tooltips:["type",rw]};function aw(e,t){if("function"!==typeof t)throw new Error("removeFn iterator must be a function");if(e){var n;while(n=e[0])t(n);return e}}var sw=250,cw=1400;function uw(e,t,n){Cc.call(this,t);var i=e.get("movePreview",!1);t.on("shape.move.start",cw,(function(e){var t=e.context,n=t.shapes,i=t.validatedShapes;t.shapes=lw(n),t.validatedShapes=lw(i)})),i&&t.on("shape.move.start",sw,(function(e){var t=e.context,n=t.shapes,r=[];C(n,(function(e){C(e.labels,(function(n){n.hidden||-1!==t.shapes.indexOf(n)||r.push(n),e.labelTarget&&r.push(e)}))})),C(r,(function(e){i.makeDraggable(t,e,!0)}))})),this.preExecuted("elements.move",cw,(function(e){var t=e.context,n=t.closure,i=n.enclosedElements,r=[];C(i,(function(e){C(e.labels,(function(e){i[e.id]||r.push(e)}))})),n.addAll(r)})),this.preExecute(["connection.delete","shape.delete"],(function(e){var t=e.context,i=t.connection||t.shape;aw(i.labels,(function(e){n.removeShape(e,{nested:!0})}))})),this.execute("shape.delete",(function(e){var t=e.context,n=t.shape,i=n.labelTarget;i&&(t.labelTargetIndex=nn(i.labels,n),t.labelTarget=i,n.labelTarget=null)})),this.revert("shape.delete",(function(e){var t=e.context,n=t.shape,i=t.labelTarget,r=t.labelTargetIndex;i&&(tn(i.labels,n,r),n.labelTarget=i)}))}function lw(e){return E(e,(function(t){return-1===e.indexOf(t.labelTarget)}))}i(uw,Cc),uw.$inject=["injector","eventBus","modeling"];var pw={__init__:["labelSupport"],labelSupport:["type",uw]},dw=251,fw=1401,hw="attach-ok";function mw(e,t,n,i,r){Cc.call(this,t);var o=e.get("movePreview",!1);t.on("shape.move.start",fw,(function(e){var t=e.context,n=t.shapes,i=t.validatedShapes;t.shapes=gw(n),t.validatedShapes=yw(i)})),o&&t.on("shape.move.start",dw,(function(e){var t=e.context,n=t.shapes,i=vw(n);C(i,(function(e){o.makeDraggable(t,e,!0),C(e.labels,(function(e){o.makeDraggable(t,e,!0)}))}))})),o&&t.on("shape.move.start",(function(e){var i=e.context,r=i.shapes;if(1===r.length){var o=r[0],a=o.host;a&&(n.addMarker(a,hw),t.once(["shape.move.out","shape.move.cleanup"],(function(){n.removeMarker(a,hw)})))}})),this.preExecuted("elements.move",fw,(function(e){var t=e.context,n=t.closure,i=t.shapes,r=vw(i);C(r,(function(e){n.add(e,n.topLevel[e.host.id])}))})),this.postExecuted("elements.move",(function(e){var t,n=e.context,i=n.shapes,o=n.newHost;o&&1!==i.length||(t=o?i:E(i,(function(e){var t=e.host;return bw(e)&&!xw(i,t)})),C(t,(function(e){r.updateAttachment(e,o)})))})),this.postExecuted("elements.move",(function(e){var t=e.context.shapes;C(t,(function(e){C(e.attachers,(function(e){C(e.outgoing.slice(),(function(e){var t=i.allowed("connection.reconnect",{connection:e,source:e.source,target:e.target});t||r.removeConnection(e)})),C(e.incoming.slice(),(function(e){var t=i.allowed("connection.reconnect",{connection:e,source:e.source,target:e.target});t||r.removeConnection(e)}))}))}))})),this.postExecute("shape.create",(function(e){var t=e.context,n=t.shape,i=t.host;i&&r.updateAttachment(n,i)})),this.postExecute("shape.replace",(function(e){var t=e.context,n=t.oldShape,o=t.newShape;aw(n.attachers,(function(e){var t=i.allowed("elements.move",{target:o,shapes:[e]});"attach"===t?r.updateAttachment(e,o):r.removeShape(e)})),o.attachers.length&&C(o.attachers,(function(e){var t=yy(e,n,o);r.moveShape(e,t,e.parent)}))})),this.postExecute("shape.resize",(function(e){var t=e.context,n=t.shape,i=t.oldBounds,o=t.newBounds,a=n.attachers,s=t.hints||{};!1!==s.attachSupport&&C(a,(function(e){var t=yy(e,i,o);r.moveShape(e,t,e.parent),C(e.labels,(function(e){r.moveShape(e,t,e.parent)}))}))})),this.preExecute("shape.delete",(function(e){var t=e.context.shape;aw(t.attachers,(function(e){r.removeShape(e)})),t.host&&r.updateAttachment(t,null)}))}function vw(e){return c(R(e,(function(e){return e.attachers||[]})))}function gw(e){var t=vw(e);return j("id",e,t)}function yw(e){var t=B(e,"id");return E(e,(function(e){while(e){if(e.host&&t[e.host.id])return!1;e=e.parent}return!0}))}function bw(e){return!!e.host}function xw(e,t){return-1!==e.indexOf(t)}i(mw,Cc),mw.$inject=["injector","eventBus","canvas","rules","modeling"];var ww={__depends__:[Mp],__init__:["attachSupport"],attachSupport:["type",mw]},_w=250;function Ew(e,t){this._eventBus=e,this._dragging=t,this._tools=[],this._active=null}function Cw(e){var t=e.originalEvent&&e.originalEvent.target;return t&&me(t,'.group[data-group="tools"]')}Ew.$inject=["eventBus","dragging"],Ew.prototype.registerTool=function(e,t){var n=this._tools;if(!t)throw new Error('A tool has to be registered with it\'s "events"');n.push(e),this.bindEvents(e,t)},Ew.prototype.isActive=function(e){return e&&this._active===e},Ew.prototype.length=function(e){return this._tools.length},Ew.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))},Ew.prototype.bindEvents=function(e,t){var n=this._eventBus,i=this._dragging,r=[];n.on(t.tool+".init",(function(t){var n=t.context;if(!n.reactivate&&this.isActive(e))return this.setActive(null),void i.cancel();this.setActive(e)}),this),C(t,(function(e){r.push(e+".ended"),r.push(e+".canceled")})),n.on(r,_w,(function(e){this._active&&(Cw(e)||this.setActive(null))}),this)};var Sw={__depends__:[Tp],__init__:["toolManager"],toolManager:["type",Ew]};function Aw(e,t){if("x"===e){if(t>0)return"e";if(t<0)return"w"}if("y"===e){if(t>0)return"s";if(t<0)return"n"}return null}function Tw(e,t){var n=[];return C(e.concat(t),(function(i){var r=i.incoming,o=i.outgoing;C(r.concat(o),(function(i){var r=i.source,o=i.target;(kw(e,r)||kw(e,o)||kw(t,r)||kw(t,o))&&(kw(n,i)||n.push(i))}))})),n}function kw(e,t){return-1!==e.indexOf(t)}function Rw(e,t,n){var i=e.x,r=e.y,o=e.width,a=e.height,s=n.x,c=n.y;switch(t){case"n":return{x:i,y:r+c,width:o,height:a-c};case"s":return{x:i,y:r,width:o,height:a+c};case"w":return{x:i+s,y:r,width:o-s,height:a};case"e":return{x:i,y:r,width:o+s,height:a};default:throw new Error("unknown direction: "+t)}}var Pw=Math.abs,Dw=Math.round,Mw={x:"width",y:"height"},Bw="crosshair",Ow={n:"top",w:"left",s:"bottom",e:"right"},jw=1500,Nw={n:"s",w:"e",s:"n",e:"w"},Fw=20;function Iw(e,t,n,i,r,o,a){this._canvas=e,this._dragging=t,this._eventBus=n,this._modeling=i,this._rules=r,this._toolManager=o,this._mouse=a;var s=this;o.registerTool("space",{tool:"spaceTool.selection",dragging:"spaceTool"}),n.on("spaceTool.selection.end",(function(e){n.once("spaceTool.selection.ended",(function(){s.activateMakeSpace(e.originalEvent)}))})),n.on("spaceTool.move",jw,(function(e){var t=e.context,n=t.initialized;n||(n=t.initialized=s.init(e,t)),n&&zw(e)})),n.on("spaceTool.end",(function(e){var t=e.context,i=t.axis,r=t.direction,o=t.movingShapes,a=t.resizingShapes,c=t.start;if(t.initialized){zw(e);var u={x:0,y:0};u[i]=Dw(e["d"+i]),s.makeSpace(o,a,u,r,c),n.once("spaceTool.ended",(function(e){s.activateSelection(e.originalEvent,!0,!0)}))}}))}function Lw(e){return{top:e.top-Fw,right:e.right+Fw,bottom:e.bottom+Fw,left:e.left-Fw}}function zw(e){var t,n,i=e.context,r=i.spaceToolConstraints;r&&(v(r.left)&&(t=Math.max(e.x,r.left),e.dx=e.dx+t-e.x,e.x=t),v(r.right)&&(t=Math.min(e.x,r.right),e.dx=e.dx+t-e.x,e.x=t),v(r.top)&&(n=Math.max(e.y,r.top),e.dy=e.dy+n-e.y,e.y=n),v(r.bottom)&&(n=Math.min(e.y,r.bottom),e.dy=e.dy+n-e.y,e.y=n))}function $w(e,t,n,i,r){var o=e.movingShapes,a=e.resizingShapes;if(a.length){var s,c,u={};return C(a,(function(e){var l,p,d,f=vn(e),h=E(e.children,(function(e){return!Gw(e)&&!Vw(e)&&!Hw(o,e)&&!Hw(a,e)})),m=E(e.children,(function(e){return!Gw(e)&&!Vw(e)&&Hw(o,e)}));h.length&&(p=Lw(vn(Wt(h))),l=i-f[Ow[n]]+p[Ow[n]],"n"===n?u.bottom=c=v(c)?Math.min(c,l):l:"w"===n?u.right=c=v(c)?Math.min(c,l):l:"s"===n?u.top=s=v(s)?Math.max(s,l):l:"e"===n&&(u.left=s=v(s)?Math.max(s,l):l)),m.length&&(d=Lw(vn(Wt(m))),l=i-d[Ow[Nw[n]]]+f[Ow[Nw[n]]],"n"===n?u.bottom=c=v(c)?Math.min(c,l):l:"w"===n?u.right=c=v(c)?Math.min(c,l):l:"s"===n?u.top=s=v(s)?Math.max(s,l):l:"e"===n&&(u.left=s=v(s)?Math.max(s,l):l));var g=r&&r[e.id];g&&("n"===n?(l=i+e[Mw[t]]-g[Mw[t]],u.bottom=c=v(c)?Math.min(c,l):l):"w"===n?(l=i+e[Mw[t]]-g[Mw[t]],u.right=c=v(c)?Math.min(c,l):l):"s"===n?(l=i-e[Mw[t]]+g[Mw[t]],u.top=s=v(s)?Math.max(s,l):l):"e"===n&&(l=i-e[Mw[t]]+g[Mw[t]],u.left=s=v(s)?Math.max(s,l):l))})),u}}function Hw(e,t){return-1!==e.indexOf(t)}function Gw(e){return!!e.waypoints}function Vw(e){return!!e.labelTarget}Iw.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"],Iw.prototype.activateSelection=function(e,t,n){this._dragging.init(e,"spaceTool.selection",{autoActivate:t,cursor:Bw,data:{context:{reactivate:n}},trapClick:!1})},Iw.prototype.activateMakeSpace=function(e){this._dragging.init(e,"spaceTool",{autoActivate:!0,cursor:Bw,data:{context:{}}})},Iw.prototype.makeSpace=function(e,t,n,i,r){return this._modeling.createSpace(e,t,n,i,r)},Iw.prototype.init=function(e,t){var n=Pw(e.dx)>Pw(e.dy)?"x":"y",i=e["d"+n],r=e[n]-i;if(Pw(i)<5)return!1;i<0&&(i*=-1),qs(e)&&(i*=-1);var o=Aw(n,i),a=this._canvas.getRootElement(),s=Gt(a,!0),c=this.calculateAdjustments(s,n,i,r),u=this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:c.resizingShapes,start:r}),l=$w(c,n,o,r,u);return W(t,c,{axis:n,direction:o,spaceToolConstraints:l,start:r}),Du("resize-"+("x"===n?"ew":"ns")),!0},Iw.prototype.calculateAdjustments=function(e,t,n,i){var r=this._rules,o=[],a=[];return C(e,(function(e){if(e.parent&&!Gw(e)){var s=e[t],c=s+e[Mw[t]];return n>0&&s>i||n<0&&c<i?o.push(e):s<i&&c>i&&r.allowed("shape.resize",{shape:e})?a.push(e):void 0}})),{movingShapes:o,resizingShapes:a}},Iw.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},Iw.prototype.isActive=function(){var e=this._dragging.context();return e&&/^spaceTool/.test(e.prefix)};var Ww="djs-dragging",Uw="djs-resizing",qw=250,Kw=Math.max;function Yw(e,t,n,i,r){function o(e,t){C(e,(function(e){r.addDragger(e,t),n.addMarker(e,Ww)}))}e.on("spaceTool.selection.start",(function(e){var t=n.getLayer("space"),r=e.context,o={x:"M 0,-10000 L 0,10000",y:"M -10000,0 L 10000,0"},a=nt("g");He(a,i.cls("djs-crosshair-group",["no-events"])),Ne(t,a);var s=nt("path");He(s,"d",o.x),qe(s).add("djs-crosshair"),Ne(a,s);var c=nt("path");He(c,"d",o.y),qe(c).add("djs-crosshair"),Ne(a,c),r.crosshairGroup=a})),e.on("spaceTool.selection.move",(function(e){var t=e.context.crosshairGroup;li(t,e.x,e.y)})),e.on("spaceTool.selection.cleanup",(function(e){var t=e.context,n=t.crosshairGroup;n&&Ye(n)})),e.on("spaceTool.move",qw,(function(e){var a=e.context,s=a.line,c=a.axis,u=a.movingShapes,l=a.resizingShapes;if(a.initialized){if(!a.dragGroup){var p=n.getLayer("space");s=nt("path"),He(s,"d","M0,0 L0,0"),qe(s).add("djs-crosshair"),Ne(p,s),a.line=s;var d=nt("g");He(d,i.cls("djs-drag-group",["no-events"])),Ne(n.getActiveLayer(),d),o(u,d);var f=a.movingConnections=t.filter((function(e){var t=!1;C(u,(function(n){C(n.outgoing,(function(n){e===n&&(t=!0)}))}));var n=!1;C(u,(function(t){C(t.incoming,(function(t){e===t&&(n=!0)}))}));var i=!1;C(l,(function(t){C(t.outgoing,(function(t){e===t&&(i=!0)}))}));var r=!1;return C(l,(function(t){C(t.incoming,(function(t){e===t&&(r=!0)}))})),Xw(e)&&(t||i)&&(n||r)}));o(f,d),a.dragGroup=d}if(!a.frameGroup){var h=nt("g");He(h,i.cls("djs-frame-group",["no-events"])),Ne(n.getActiveLayer(),h);var m=[];C(l,(function(e){var t=r.addFrame(e,h),i=t.getBBox();m.push({element:t,initialBounds:i}),n.addMarker(e,Uw)})),a.frameGroup=h,a.frames=m}var v={x:"M"+e.x+", -10000 L"+e.x+", 10000",y:"M -10000, "+e.y+" L 10000, "+e.y};He(s,{d:v[c]});var g={x:"y",y:"x"},y={x:e.dx,y:e.dy};y[g[a.axis]]=0,li(a.dragGroup,y.x,y.y),C(a.frames,(function(e){var t,n,i=e.element,r=e.initialBounds;"e"===a.direction?He(i,{width:Kw(r.width+y.x,5)}):(t=Kw(r.width-y.x,5),He(i,{width:t,x:r.x+r.width-t})),"s"===a.direction?He(i,{height:Kw(r.height+y.y,5)}):(n=Kw(r.height-y.y,5),He(i,{height:n,y:r.y+r.height-n}))}))}})),e.on("spaceTool.cleanup",(function(e){var t=e.context,i=t.movingShapes,r=t.movingConnections,o=t.resizingShapes,a=t.line,s=t.dragGroup,c=t.frameGroup;C(i,(function(e){n.removeMarker(e,Ww)})),C(r,(function(e){n.removeMarker(e,Ww)})),s&&(Ye(a),Ye(s)),C(o,(function(e){n.removeMarker(e,Uw)})),c&&Ye(c)}))}function Xw(e){return e.waypoints}Yw.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];var Zw={__init__:["spaceToolPreview"],__depends__:[Tp,Mp,Sw,Ef,Hf],spaceTool:["type",Iw],spaceToolPreview:["type",Yw]};function Jw(e){this._model=e}function Qw(e,t,n,i){Cc.call(this,e),this._bpmnFactory=t,this._translate=i;var r=this;function o(e){var t,i=e.context,r=i.hints||{};i.cropped||!1===r.createElementsBehavior||(t=i.connection,t.waypoints=n.getCroppedWaypoints(t),i.cropped=!0)}function a(e){var t=e.context;r.updateParent(t.shape||t.connection,t.oldParent)}function s(e){var t=e.context,n=t.shape||t.connection,i=t.parent||t.newParent;r.updateParent(n,i)}function c(e){var t=e.context,n=t.oldRoot,i=n.children;C(i,(function(e){Ko(e,"bpmn:BaseElement")&&r.updateParent(e)}))}function u(e){var t=e.context.shape;Ko(t,"bpmn:BaseElement")&&r.updateBounds(t)}function l(e){r.updateConnection(e.context)}function p(e){r.updateConnectionWaypoints(e.context.connection)}function d(e){r.updateAttachment(e.context)}this.executed(["connection.layout","connection.create"],o),this.reverted(["connection.layout"],(function(e){delete e.context.cropped})),this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],t_(a)),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],t_(s)),this.executed(["canvas.updateRoot"],c),this.reverted(["canvas.updateRoot"],c),this.executed(["shape.move","shape.create","shape.resize"],t_((function(e){"label"!==e.context.shape.type&&u(e)}))),this.reverted(["shape.move","shape.create","shape.resize"],t_((function(e){"label"!==e.context.shape.type&&u(e)}))),e.on("shape.changed",(function(e){"label"===e.element.type&&u({context:{shape:e.element}})})),this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],t_(l)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],t_(l)),this.executed(["connection.layout","connection.move","connection.updateWaypoints"],t_(p)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],t_(p)),this.executed("connection.reconnect",t_((function(e){var t=e.context,n=t.connection,i=t.oldSource,r=t.newSource,o=Xo(n),a=Xo(i),s=Xo(r);o.conditionExpression&&!Yo(s,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(t.oldConditionExpression=o.conditionExpression,delete o.conditionExpression),i!==r&&a.default===o&&(t.oldDefault=a.default,delete a.default)}))),this.reverted("connection.reconnect",t_((function(e){var t=e.context,n=t.connection,i=t.oldSource,r=t.newSource,o=Xo(n),a=Xo(i),s=Xo(r);t.oldConditionExpression&&(o.conditionExpression=t.oldConditionExpression),t.oldDefault&&(a.default=t.oldDefault,delete s.default)}))),this.executed(["element.updateAttachment"],t_(d)),this.reverted(["element.updateAttachment"],t_(d))}function e_(e){while(e&&!Ko(e,"bpmn:Definitions"))e=e.$parent;return e}function t_(e){return function(t){var n=t.context,i=n.shape||n.connection;Ko(i,"bpmn:BaseElement")&&e(t)}}function n_(e){if(Ko(e,"bpmn:Activity")){var t=Zo(e);if(t){var n=t.get("label");if(n)return n.get("bounds")}}}function i_(e,t,n){ei.call(this),this._bpmnFactory=e,this._moddle=t,this._translate=n}function r_(e,t,n){return C(n,(function(n){t=o_(e,t,n)})),t}function o_(e,t,n){return void 0===t[n]?t:(e[n]=t[n],q(t,[n]))}function a_(e){return Yo(e,["bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane"])}function s_(e,t){this._modeling=e,this._canvas=t}function c_(e){this._modeling=e}function u_(e,t){return k(e.outgoing,(function(e){return e.target===t}))}function l_(e,t){this._canvas=e,this._layouter=t}Jw.$inject=["moddle"],Jw.prototype._needsId=function(e){return Yo(e,["bpmn:RootElement","bpmn:FlowElement","bpmn:MessageFlow","bpmn:DataAssociation","bpmn:Artifact","bpmn:Participant","bpmn:Lane","bpmn:LaneSet","bpmn:Process","bpmn:Collaboration","bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane","bpmn:Property","bpmn:CategoryValue"])},Jw.prototype._ensureId=function(e){var t;e.id?this._model.ids.claim(e.id,e):(t=Ko(e,"bpmn:Activity")?"Activity":Ko(e,"bpmn:Event")?"Event":Ko(e,"bpmn:Gateway")?"Gateway":Yo(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])?"Flow":(e.$type||"").replace(/^[^:]*:/g,""),t+="_",!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e)))},Jw.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n},Jw.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},Jw.prototype.createDiShape=function(e,t){return this.create("bpmndi:BPMNShape",W({bpmnElement:e,bounds:this.createDiBounds()},t))},Jw.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)},Jw.prototype.createDiWaypoints=function(e){var t=this;return R(e,(function(e){return t.createDiWaypoint(e)}))},Jw.prototype.createDiWaypoint=function(e){return this.create("dc:Point",U(e,["x","y"]))},Jw.prototype.createDiEdge=function(e,t){return this.create("bpmndi:BPMNEdge",W({bpmnElement:e,waypoint:this.createDiWaypoints([])},t))},Jw.prototype.createDiPlane=function(e,t){return this.create("bpmndi:BPMNPlane",W({bpmnElement:e},t))},i(Qw,Cc),Qw.$inject=["eventBus","bpmnFactory","connectionDocking","translate"],Qw.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,i=t.host;n.attachedToRef=i&&i.businessObject},Qw.prototype.updateParent=function(e,t){if(!(e instanceof Xn)&&!(Ko(e,"bpmn:DataStoreReference")&&e.parent&&Ko(e.parent,"bpmn:Collaboration"))){var n=e.parent,i=e.businessObject,r=Zo(e),o=n&&n.businessObject,a=Zo(n);Ko(e,"bpmn:FlowNode")&&this.updateFlowNodeRefs(i,o,t&&t.businessObject),Ko(e,"bpmn:DataOutputAssociation")&&(o=e.source?e.source.businessObject:null),Ko(e,"bpmn:DataInputAssociation")&&(o=e.target?e.target.businessObject:null),this.updateSemanticParent(i,o),Ko(e,"bpmn:DataObjectReference")&&i.dataObjectRef&&this.updateSemanticParent(i.dataObjectRef,o),this.updateDiParent(r,a)}},Qw.prototype.updateBounds=function(e){var t=Zo(e),n=n_(e);if(n){var i=Nu(n,t.get("bounds"));W(n,{x:e.x+i.x,y:e.y+i.y})}var r=e instanceof Xn?this._getLabel(t):t,o=r.bounds;o||(o=this._bpmnFactory.createDiBounds(),r.set("bounds",o)),W(o,{x:e.x,y:e.y,width:e.width,height:e.height})},Qw.prototype.updateFlowNodeRefs=function(e,t,n){var i,r;n!==t&&(Ko(n,"bpmn:Lane")&&(i=n.get("flowNodeRef"),en(i,e)),Ko(t,"bpmn:Lane")&&(r=t.get("flowNodeRef"),tn(r,e)))},Qw.prototype.updateDiConnection=function(e,t,n){var i=Zo(e),r=Zo(t),o=Zo(n);i.sourceElement&&i.sourceElement.bpmnElement!==Xo(t)&&(i.sourceElement=t&&r),i.targetElement&&i.targetElement.bpmnElement!==Xo(n)&&(i.targetElement=n&&o)},Qw.prototype.updateDiParent=function(e,t){if(t&&!Ko(t,"bpmndi:BPMNPlane")&&(t=t.$parent),e.$parent!==t){var n=(t||e.$parent).get("planeElement");t?(n.push(e),e.$parent=t):(en(n,e),e.$parent=null)}},Qw.prototype.getLaneSet=function(e){var t,n;return Ko(e,"bpmn:Lane")?(t=e.childLaneSet,t||(t=this._bpmnFactory.create("bpmn:LaneSet"),e.childLaneSet=t,t.$parent=e),t):(Ko(e,"bpmn:Participant")&&(e=e.processRef),n=e.get("laneSets"),t=n[0],t||(t=this._bpmnFactory.create("bpmn:LaneSet"),t.$parent=e,n.push(t)),t)},Qw.prototype.updateSemanticParent=function(e,t,n){var i,r=this._translate;if(e.$parent!==t&&(!Ko(e,"bpmn:DataInput")&&!Ko(e,"bpmn:DataOutput")||(Ko(t,"bpmn:Participant")&&"processRef"in t&&(t=t.processRef),!("ioSpecification"in t)||t.ioSpecification!==e.$parent))){if(Ko(e,"bpmn:Lane"))t&&(t=this.getLaneSet(t)),i="lanes";else if(Ko(e,"bpmn:FlowElement")){if(t)if(Ko(t,"bpmn:Participant"))t=t.processRef;else if(Ko(t,"bpmn:Lane"))do{t=t.$parent.$parent}while(Ko(t,"bpmn:Lane"));i="flowElements"}else if(Ko(e,"bpmn:Artifact")){while(t&&!Ko(t,"bpmn:Process")&&!Ko(t,"bpmn:SubProcess")&&!Ko(t,"bpmn:Collaboration")){if(Ko(t,"bpmn:Participant")){t=t.processRef;break}t=t.$parent}i="artifacts"}else if(Ko(e,"bpmn:MessageFlow"))i="messageFlows";else if(Ko(e,"bpmn:Participant")){i="participants";var o,a=e.processRef;a&&(o=e_(e.$parent||t),e.$parent&&(en(o.get("rootElements"),a),a.$parent=null),t&&(tn(o.get("rootElements"),a),a.$parent=o))}else Ko(e,"bpmn:DataOutputAssociation")?i="dataOutputAssociations":Ko(e,"bpmn:DataInputAssociation")&&(i="dataInputAssociations");if(!i)throw new Error(r("no parent for {element} in {parent}",{element:e.id,parent:t.id}));var s;if(e.$parent&&(s=e.$parent.get(i),en(s,e)),t?(s=t.get(i),s.push(e),e.$parent=t):e.$parent=null,n){var c=n.get(i);en(s,e),t&&(c||(c=[],t.set(i,c)),c.push(e))}}},Qw.prototype.updateConnectionWaypoints=function(e){var t=Zo(e);t.set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))},Qw.prototype.updateConnection=function(e){var t,n=e.connection,i=Xo(n),r=n.source,o=Xo(r),a=n.target,s=Xo(n.target);if(Ko(i,"bpmn:DataAssociation"))Ko(i,"bpmn:DataInputAssociation")?(i.get("sourceRef")[0]=o,t=e.parent||e.newParent||s,this.updateSemanticParent(i,s,t)):Ko(i,"bpmn:DataOutputAssociation")&&(t=e.parent||e.newParent||o,this.updateSemanticParent(i,o,t),i.targetRef=s);else{var c=Ko(i,"bpmn:SequenceFlow");i.sourceRef!==o&&(c&&(en(i.sourceRef&&i.sourceRef.get("outgoing"),i),o&&o.get("outgoing")&&o.get("outgoing").push(i)),i.sourceRef=o),i.targetRef!==s&&(c&&(en(i.targetRef&&i.targetRef.get("incoming"),i),s&&s.get("incoming")&&s.get("incoming").push(i)),i.targetRef=s)}this.updateConnectionWaypoints(n),this.updateDiConnection(n,r,a)},Qw.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label},i(i_,ei),i_.$inject=["bpmnFactory","moddle","translate"],i_.prototype.baseCreate=ei.prototype.create,i_.prototype.create=function(e,t){if("label"===e){var n=t.di||this._bpmnFactory.createDiLabel();return this.baseCreate(e,W({type:"label",di:n},_s,t))}return this.createBpmnElement(e,t)},i_.prototype.createBpmnElement=function(e,t){var n,i=this._translate;t=W({},t||{});var r,o,a=t.businessObject,s=t.di;if(!a){if(!t.type)throw new Error(i("no shape type specified"));a=this._bpmnFactory.create(t.type),Vo(a)}if(!a_(s)){var c=W({},s||{},{id:a.id+"_di"});s="root"===e?this._bpmnFactory.createDiPlane(a,c):"connection"===e?this._bpmnFactory.createDiEdge(a,c):this._bpmnFactory.createDiShape(a,c)}return Ko(a,"bpmn:Group")&&(t=W({isFrame:!0},t)),t=r_(a,t,["processRef","isInterrupting","associationDirection","isForCompensation"]),t.isExpanded&&(t=o_(s,t,"isExpanded")),Ko(a,"bpmn:SubProcess")&&(t.collapsed=!wa(a,s)),Ko(a,"bpmn:ExclusiveGateway")&&(s.isMarkerVisible=!0),t.eventDefinitionType&&(r=a.get("eventDefinitions")||[],o=this._bpmnFactory.create(t.eventDefinitionType,t.eventDefinitionAttrs),"bpmn:ConditionalEventDefinition"===t.eventDefinitionType&&(o.condition=this._bpmnFactory.create("bpmn:FormalExpression")),r.push(o),o.$parent=a,a.eventDefinitions=r,delete t.eventDefinitionType),n=this.getDefaultSize(a,s),t=W({id:a.id},n,t,{businessObject:a,di:s}),this.baseCreate(e,t)},i_.prototype.getDefaultSize=function(e,t){var n=Xo(e);return t=t||Zo(e),Ko(n,"bpmn:SubProcess")?wa(n,t)?{width:350,height:200}:{width:100,height:80}:Ko(n,"bpmn:Task")?{width:100,height:80}:Ko(n,"bpmn:Gateway")?{width:50,height:50}:Ko(n,"bpmn:Event")?{width:36,height:36}:Ko(n,"bpmn:Participant")?wa(n,t)?{width:600,height:250}:{width:400,height:60}:Ko(n,"bpmn:Lane")?{width:400,height:100}:Ko(n,"bpmn:DataObjectReference")?{width:36,height:50}:Ko(n,"bpmn:DataStoreReference")?{width:50,height:50}:Ko(n,"bpmn:TextAnnotation")?{width:100,height:30}:Ko(n,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}},i_.prototype.createParticipantShape=function(e){return m(e)||(e={isExpanded:e}),e=W({type:"bpmn:Participant"},e||{}),!1!==e.isExpanded&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)},s_.$inject=["modeling","canvas"],s_.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,i=e.alignment;C(n,(function(e){var n={x:0,y:0};i.left?n.x=i.left-e.x:i.right?n.x=i.right-e.width-e.x:i.center?n.x=i.center-Math.round(e.width/2)-e.x:i.top?n.y=i.top-e.y:i.bottom?n.y=i.bottom-e.height-e.y:i.middle&&(n.y=i.middle-Math.round(e.height/2)-e.y),t.moveElements([e],n,e.parent)}))},s_.prototype.postExecute=function(e){},c_.$inject=["modeling"],c_.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var n=e.target||t.parent,i=e.shape,r=e.hints||{};i=e.shape=this._modeling.createShape(i,e.position,n,{attach:r.attach}),e.shape=i},c_.prototype.postExecute=function(e){var t=e.hints||{};u_(e.source,e.shape)||(t.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))},l_.$inject=["canvas","layouter"],l_.prototype.execute=function(e){var t=e.connection,n=e.source,i=e.target,r=e.parent,o=e.parentIndex,a=e.hints;if(!n||!i)throw new Error("source and target required");if(!r)throw new Error("parent required");return t.source=n,t.target=i,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,a)),this._canvas.addConnection(t,r,o),t},l_.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var p_=Math.round;function d_(e){this._modeling=e}function f_(e){return!!e.waypoints}d_.$inject=["modeling"],d_.prototype.preExecute=function(e){var t=e.elements,n=e.parent,i=e.parentIndex,r=e.position,o=e.hints,a=this._modeling;C(t,(function(e){v(e.x)||(e.x=0),v(e.y)||(e.y=0)}));var s=E(t,(function(e){return!e.hidden})),c=Wt(s);C(t,(function(e){f_(e)&&(e.waypoints=R(e.waypoints,(function(e){return{x:p_(e.x-c.x-c.width/2+r.x),y:p_(e.y-c.y-c.height/2+r.y)}}))),W(e,{x:p_(e.x-c.x-c.width/2+r.x),y:p_(e.y-c.y-c.height/2+r.y)})}));var u=It(t),l={};C(t,(function(e){if(f_(e))l[e.id]=v(i)?a.createConnection(l[e.source.id],l[e.target.id],i,e,e.parent||n,o):a.createConnection(l[e.source.id],l[e.target.id],e,e.parent||n,o);else{var t=W({},o);-1===u.indexOf(e)&&(t.autoResize=!1),l[e.id]=v(i)?a.createShape(e,U(e,["x","y","width","height"]),e.parent||n,i,t):a.createShape(e,U(e,["x","y","width","height"]),e.parent||n,t)}})),e.elements=M(l)};var h_=Math.round;function m_(e){this._canvas=e}function v_(e){m_.call(this,e)}m_.$inject=["canvas"],m_.prototype.execute=function(e){var t=e.shape,n=e.position,i=e.parent,r=e.parentIndex;if(!i)throw new Error("parent required");if(!n)throw new Error("position required");return void 0!==n.width?W(t,n):W(t,{x:n.x-h_(t.width/2),y:n.y-h_(t.height/2)}),this._canvas.addShape(t,i,r),t},m_.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t},i(v_,m_),v_.$inject=["canvas"];var g_=m_.prototype.execute;v_.prototype.execute=function(e){var t=e.shape;return b_(t),t.labelTarget=e.labelTarget,g_.call(this,e)};var y_=m_.prototype.revert;function b_(e){["width","height"].forEach((function(t){"undefined"===typeof e[t]&&(e[t]=0)}))}function x_(e,t){this._canvas=e,this._modeling=t}function w_(e,t){this._modeling=e,this._elementRegistry=t}function __(e,t){this._canvas=e,this._modeling=t}function E_(e){return e.waypoints}function C_(e){this._modeling=e}v_.prototype.revert=function(e){return e.shape.labelTarget=null,y_.call(this,e)},x_.$inject=["canvas","modeling"],x_.prototype.preExecute=function(e){var t=this._modeling,n=e.connection;aw(n.incoming,(function(e){t.removeConnection(e,{nested:!0})})),aw(n.outgoing,(function(e){t.removeConnection(e,{nested:!0})}))},x_.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=nn(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},x_.prototype.revert=function(e){var t=e.connection,n=e.parent,i=e.parentIndex;return t.source=e.source,t.target=e.target,tn(n.children,t,i),this._canvas.addConnection(t,n),t},w_.$inject=["modeling","elementRegistry"],w_.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry,i=e.elements;C(i,(function(e){n.get(e.id)&&(e.waypoints?t.removeConnection(e):t.removeShape(e))}))},__.$inject=["canvas","modeling"],__.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;aw(n.incoming,(function(e){t.removeConnection(e,{nested:!0})})),aw(n.outgoing,(function(e){t.removeConnection(e,{nested:!0})})),aw(n.children,(function(e){E_(e)?t.removeConnection(e,{nested:!0}):t.removeShape(e,{nested:!0})}))},__.prototype.execute=function(e){var t=this._canvas,n=e.shape,i=n.parent;return e.oldParent=i,e.oldParentIndex=nn(i.children,n),t.removeShape(n),n},__.prototype.revert=function(e){var t=this._canvas,n=e.shape,i=e.oldParent,r=e.oldParentIndex;return tn(i.children,n,r),t.addShape(n,i),n},C_.$inject=["modeling"];var S_={x:"y",y:"x"};function A_(e,t){this._layouter=e,this._canvas=t}function T_(){}function k_(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}function R_(e){this._modeling=e}function P_(e){this._helper=new R_(e)}function D_(e){this._modeling=e,this._helper=new R_(e)}function M_(e){this._modeling=e}function B_(e){return e.original||e}function O_(e,t){this._modeling=e,this._rules=t}function j_(e){this._modeling=e}function N_(e){this._modeling=e}function F_(e){return W({},e)}function I_(e){return R(e.waypoints,(function(e){return e=F_(e),e.original&&(e.original=F_(e.original)),e}))}function L_(e){switch(e){case"n":return"y";case"w":return"x";case"s":return"y";case"e":return"x"}}function z_(e,t,n){var i=L_(n);return/e|s/.test(n)?e[i]>t:/n|w/.test(n)?e[i]<t:void 0}function $_(e,t){return-1!==e.indexOf(t)}function H_(e){return{x:e.x,y:e.y,height:e.height,width:e.width}}function G_(e){this._modeling=e}function V_(e){var t={};return C(e,(function(e){t[e.id]=e.hidden,e.children&&(t=W({},t,V_(e.children)))})),t}function W_(e,t){var n=[];return C(e,(function(e){e.hidden=t,n=n.concat(e),e.children&&(n=n.concat(W_(e.children,e.collapsed||t)))})),n}function U_(e,t){var n=[];return C(e,(function(e){e.hidden=t[e.id],n=n.concat(e),e.children&&(n=n.concat(U_(e.children,t)))})),n}function q_(e){this._modeling=e}function K_(e,t){return en(e&&e.attachers,t)}function Y_(e,t,n){if(e){var i=e.attachers;i||(e.attachers=i=[]),tn(i,t,n)}}function X_(){}function Z_(e,t,n){this._eventBus=e,this._elementFactory=t,this._commandStack=n;var i=this;e.on("diagram.init",(function(){i.registerHandlers(n)}))}function J_(e){this._elementRegistry=e}function Q_(e,t){return A(t,(function(t,n){return t[n]=e.get(n),t}),{})}function eE(e,t){C(t,(function(t,n){e.set(n,t)}))}function tE(e,t){return t.filter((function(t){return Ko(t,"bpmn:DataObjectReference")&&Xo(t).dataObjectRef===e}))}C_.prototype.preExecute=function(e){var t=this._modeling,n=e.groups,i=e.axis,r=e.dimension;function o(e,t){e.range.min=Math.min(t[i],e.range.min),e.range.max=Math.max(t[i]+t[r],e.range.max)}function a(e){return e[i]+e[r]/2}function s(e){return e.length-1}function c(e){return e.max-e.min}function u(e,n){var r={y:0};r[i]=e-a(n),r[i]&&(r[S_[i]]=0,t.moveElements([n],r,n.parent))}var l,p,d=n[0],f=s(n),h=n[f],m=0;C(n,(function(e,t){var l,p,d;e.elements.length<2?t&&t!==n.length-1&&(o(e,e.elements[0]),m+=c(e.range)):(l=N(e.elements,i),p=l[0],t===f&&(p=l[s(l)]),d=a(p),e.range=null,C(l,(function(t){u(d,t),null!==e.range?o(e,t):e.range={min:t[i],max:t[i]+t[r]}})),t&&t!==n.length-1&&(m+=c(e.range)))})),p=Math.abs(h.range.min-d.range.max),l=Math.round((p-m)/(n.length-1)),l<n.length-1||C(n,(function(e,o){var a,s={};e!==d&&e!==h&&(a=n[o-1],e.range.max=0,C(e.elements,(function(n,o){s[S_[i]]=0,s[i]=a.range.max-n[i]+l,e.range.min!==n[i]&&(s[i]+=n[i]-e.range.min),s[i]&&t.moveElements([n],s,n.parent),e.range.max=Math.max(n[i]+n[r],o?e.range.max:0)})))}))},C_.prototype.postExecute=function(e){},A_.$inject=["layouter","canvas"],A_.prototype.execute=function(e){var t=e.connection,n=t.waypoints;return W(e,{oldWaypoints:n}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t},A_.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t},T_.prototype.execute=function(e){var t=e.connection,n=e.delta,i=e.newParent||t.parent,r=e.newParentIndex,o=t.parent;return e.oldParent=o,e.oldParentIndex=en(o.children,t),tn(i.children,t,r),t.parent=i,C(t.waypoints,(function(e){e.x+=n.x,e.y+=n.y,e.original&&(e.original.x+=n.x,e.original.y+=n.y)})),t},T_.prototype.revert=function(e){var t=e.connection,n=t.parent,i=e.oldParent,r=e.oldParentIndex,o=e.delta;return en(n.children,t),tn(i.children,t,r),t.parent=i,C(t.waypoints,(function(e){e.x-=o.x,e.y-=o.y,e.original&&(e.original.x-=o.x,e.original.y-=o.y)})),t},k_.prototype.add=function(e,t){return this.addAll([e],t)},k_.prototype.addAll=function(e,t){var n=Vt(e,!!t,this);return W(this,n),this},R_.prototype.moveRecursive=function(e,t,n){return e?this.moveClosure(this.getClosure(e),t,n):[]},R_.prototype.moveClosure=function(e,t,n,i,r){var o=this._modeling,a=e.allShapes,s=e.allConnections,c=e.enclosedConnections,u=e.topLevel,l=!1;r&&r.parent===n&&(l=!0),C(a,(function(e){o.moveShape(e,t,u[e.id]&&!l&&n,{recurse:!1,layout:!1})})),C(s,(function(e){var i=!!a[e.source.id],r=!!a[e.target.id];c[e.id]&&i&&r?o.moveConnection(e,t,u[e.id]&&!l&&n):o.layoutConnection(e,{connectionStart:i&&jy(e,e.source,t),connectionEnd:r&&Ny(e,e.target,t)})}))},R_.prototype.getClosure=function(e){return(new k_).addAll(e,!0)},P_.$inject=["modeling"],P_.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)},P_.prototype.postExecute=function(e){var t,n=e.hints;n&&n.primaryShape&&(t=n.primaryShape,n.oldParent=t.parent),this._helper.moveClosure(e.closure,e.delta,e.newParent,e.newHost,t)},D_.$inject=["modeling"],D_.prototype.execute=function(e){var t=e.shape,n=e.delta,i=e.newParent||t.parent,r=e.newParentIndex,o=t.parent;return e.oldBounds=U(t,["x","y","width","height"]),e.oldParent=o,e.oldParentIndex=en(o.children,t),tn(i.children,t,r),W(t,{parent:i,x:t.x+n.x,y:t.y+n.y}),t},D_.prototype.postExecute=function(e){var t=e.shape,n=e.delta,i=e.hints,r=this._modeling;!1!==i.layout&&(C(t.incoming,(function(e){r.layoutConnection(e,{connectionEnd:Ny(e,t,n)})})),C(t.outgoing,(function(e){r.layoutConnection(e,{connectionStart:jy(e,t,n)})}))),!1!==i.recurse&&this.moveChildren(e)},D_.prototype.revert=function(e){var t=e.shape,n=e.oldParent,i=e.oldParentIndex,r=e.delta;return tn(n.children,t,i),W(t,{parent:n,x:t.x-r.x,y:t.y-r.y}),t},D_.prototype.moveChildren=function(e){var t=e.delta,n=e.shape;this._helper.moveRecursive(n.children,t,null)},D_.prototype.getNewParent=function(e){return e.newParent||e.shape.parent},M_.$inject=["modeling"],M_.prototype.execute=function(e){var t=e.newSource,n=e.newTarget,i=e.connection,r=e.dockingOrPoints;if(!t&&!n)throw new Error("newSource or newTarget required");return h(r)&&(e.oldWaypoints=i.waypoints,i.waypoints=r),t&&(e.oldSource=i.source,i.source=t),n&&(e.oldTarget=i.target,i.target=n),i},M_.prototype.postExecute=function(e){var t=e.connection,n=e.newSource,i=e.newTarget,r=e.dockingOrPoints,o=e.hints||{},a={};o.connectionStart&&(a.connectionStart=o.connectionStart),o.connectionEnd&&(a.connectionEnd=o.connectionEnd),!1!==o.layoutConnection&&(!n||i&&"source"!==o.docking||(a.connectionStart=a.connectionStart||B_(h(r)?r[0]:r)),!i||n&&"target"!==o.docking||(a.connectionEnd=a.connectionEnd||B_(h(r)?r[r.length-1]:r)),o.newWaypoints&&(a.waypoints=o.newWaypoints),this._modeling.layoutConnection(t,a))},M_.prototype.revert=function(e){var t=e.oldSource,n=e.oldTarget,i=e.oldWaypoints,r=e.connection;return t&&(r.source=t),n&&(r.target=n),i&&(r.waypoints=i),r},O_.$inject=["modeling","rules"],O_.prototype.preExecute=function(e){var t,n=this,i=this._modeling,r=this._rules,o=e.oldShape,a=e.newData,s=e.hints||{};function c(e,t,n){return r.allowed("connection.reconnect",{connection:n,source:e,target:t})}var u,l={x:a.x,y:a.y},p={x:o.x,y:o.y,width:o.width,height:o.height};t=e.newShape=e.newShape||n.createShape(a,l,o.parent,s),o.host&&i.updateAttachment(t,o.host),!1!==s.moveChildren&&(u=o.children.slice(),i.moveElements(u,{x:0,y:0},t,s));var d=o.incoming.slice(),f=o.outgoing.slice();C(d,(function(e){var i=e.source,r=c(i,t,e);r&&n.reconnectEnd(e,t,Oy(e,t,p),s)})),C(f,(function(e){var i=e.target,r=c(t,i,e);r&&n.reconnectStart(e,t,By(e,t,p),s)}))},O_.prototype.postExecute=function(e){var t=e.oldShape;this._modeling.removeShape(t)},O_.prototype.execute=function(e){},O_.prototype.revert=function(e){},O_.prototype.createShape=function(e,t,n,i){return this._modeling.createShape(e,t,n,i)},O_.prototype.reconnectStart=function(e,t,n,i){this._modeling.reconnectStart(e,t,n,i)},O_.prototype.reconnectEnd=function(e,t,n,i){this._modeling.reconnectEnd(e,t,n,i)},j_.$inject=["modeling"],j_.prototype.execute=function(e){var t=e.shape,n=e.newBounds,i=e.minBounds;if(void 0===n.x||void 0===n.y||void 0===n.width||void 0===n.height)throw new Error("newBounds must have {x, y, width, height} properties");if(i&&(n.width<i.width||n.height<i.height))throw new Error("width and height cannot be less than minimum height and width");if(!i&&n.width<10||n.height<10)throw new Error("width and height cannot be less than 10px");return e.oldBounds={width:t.width,height:t.height,x:t.x,y:t.y},W(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},j_.prototype.postExecute=function(e){var t=this._modeling,n=e.shape,i=e.oldBounds,r=e.hints||{};!1!==r.layout&&(C(n.incoming,(function(e){t.layoutConnection(e,{connectionEnd:Oy(e,n,i)})})),C(n.outgoing,(function(e){t.layoutConnection(e,{connectionStart:By(e,n,i)})})))},j_.prototype.revert=function(e){var t=e.shape,n=e.oldBounds;return W(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},N_.$inject=["modeling"],N_.prototype.preExecute=function(e){var t=e.delta,n=e.direction,i=e.movingShapes,r=e.resizingShapes,o=e.start,a={};this.moveShapes(i,t),C(r,(function(e){a[e.id]=H_(e)})),this.resizeShapes(r,t,n),this.updateConnectionWaypoints(Tw(i,r),t,n,o,i,r,a)},N_.prototype.execute=function(){},N_.prototype.revert=function(){},N_.prototype.moveShapes=function(e,t){var n=this;C(e,(function(e){n._modeling.moveShape(e,t,null,{autoResize:!1,layout:!1,recurse:!1})}))},N_.prototype.resizeShapes=function(e,t,n){var i=this;C(e,(function(e){var r=Rw(e,n,t);i._modeling.resizeShape(e,r,null,{attachSupport:!1,autoResize:!1,layout:!1})}))},N_.prototype.updateConnectionWaypoints=function(e,t,n,i,r,o,a){var s=this,c=r.concat(o);C(e,(function(e){var u=e.source,l=e.target,p=I_(e),d=L_(n),f={labelBehavior:!1};$_(c,u)&&$_(c,l)?(p=R(p,(function(e){return z_(e,i,n)&&(e[d]=e[d]+t[d]),e.original&&z_(e.original,i,n)&&(e.original[d]=e.original[d]+t[d]),e})),s._modeling.updateWaypoints(e,p,{labelBehavior:!1})):($_(c,u)||$_(c,l))&&($_(r,u)?f.connectionStart=jy(e,u,t):$_(r,l)?f.connectionEnd=Ny(e,l,t):$_(o,u)?f.connectionStart=By(e,u,a[u.id]):$_(o,l)&&(f.connectionEnd=Oy(e,l,a[l.id])),s._modeling.layoutConnection(e,f))}))},G_.$inject=["modeling"],G_.prototype.execute=function(e){var t=e.shape,n=t.children;e.oldChildrenVisibility=V_(n),t.collapsed=!t.collapsed;var i=W_(n,t.collapsed);return[t].concat(i)},G_.prototype.revert=function(e){var t=e.shape,n=e.oldChildrenVisibility,i=t.children,r=U_(i,n);return t.collapsed=!t.collapsed,[t].concat(r)},q_.$inject=["modeling"],q_.prototype.execute=function(e){var t=e.shape,n=e.newHost,i=t.host;return e.oldHost=i,e.attacherIdx=K_(i,t),Y_(n,t),t.host=n,t},q_.prototype.revert=function(e){var t=e.shape,n=e.newHost,i=e.oldHost,r=e.attacherIdx;return t.host=i,K_(n,t),Y_(i,t,r),t},X_.prototype.execute=function(e){var t=e.connection,n=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=n,t},X_.prototype.revert=function(e){var t=e.connection,n=e.oldWaypoints;return t.waypoints=n,t},Z_.$inject=["eventBus","elementFactory","commandStack"],Z_.prototype.getHandlers=function(){return{"shape.append":c_,"shape.create":m_,"shape.delete":__,"shape.move":D_,"shape.resize":j_,"shape.replace":O_,"shape.toggleCollapse":G_,spaceTool:N_,"label.create":v_,"connection.create":l_,"connection.delete":x_,"connection.move":T_,"connection.layout":A_,"connection.updateWaypoints":X_,"connection.reconnect":M_,"elements.create":d_,"elements.move":P_,"elements.delete":w_,"elements.distribute":C_,"elements.align":s_,"element.updateAttachment":q_}},Z_.prototype.registerHandlers=function(e){C(this.getHandlers(),(function(t,n){e.registerHandler(n,t)}))},Z_.prototype.moveShape=function(e,t,n,i,r){"object"===typeof i&&(r=i,i=null);var o={shape:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("shape.move",o)},Z_.prototype.updateAttachment=function(e,t){var n={shape:e,newHost:t};this._commandStack.execute("element.updateAttachment",n)},Z_.prototype.moveElements=function(e,t,n,i){i=i||{};var r,o=i.attach,a=n;!0===o?(r=n,a=n.parent):!1===o&&(r=null);var s={shapes:e,delta:t,newParent:a,newHost:r,hints:i};this._commandStack.execute("elements.move",s)},Z_.prototype.moveConnection=function(e,t,n,i,r){"object"===typeof i&&(r=i,i=void 0);var o={connection:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("connection.move",o)},Z_.prototype.layoutConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.layout",n)},Z_.prototype.createConnection=function(e,t,n,i,r,o){"object"===typeof n&&(o=r,r=i,i=n,n=void 0),i=this._create("connection",i);var a={source:e,target:t,parent:r,parentIndex:n,connection:i,hints:o};return this._commandStack.execute("connection.create",a),a.connection},Z_.prototype.createShape=function(e,t,n,i,r){"number"!==typeof i&&(r=i,i=void 0),r=r||{};var o,a,s=r.attach;e=this._create("shape",e),s?(o=n.parent,a=n):o=n;var c={position:t,shape:e,parent:o,parentIndex:i,host:a,hints:r};return this._commandStack.execute("shape.create",c),c.shape},Z_.prototype.createElements=function(e,t,n,i,r){h(e)||(e=[e]),"number"!==typeof i&&(r=i,i=void 0),r=r||{};var o={position:t,elements:e,parent:n,parentIndex:i,hints:r};return this._commandStack.execute("elements.create",o),o.elements},Z_.prototype.createLabel=function(e,t,n,i){n=this._create("label",n);var r={labelTarget:e,position:t,parent:i||e.parent,shape:n};return this._commandStack.execute("label.create",r),r.shape},Z_.prototype.appendShape=function(e,t,n,i,r){r=r||{},t=this._create("shape",t);var o={source:e,position:n,target:i,shape:t,connection:r.connection,connectionParent:r.connectionParent,hints:r};return this._commandStack.execute("shape.append",o),o.shape},Z_.prototype.removeElements=function(e){var t={elements:e};this._commandStack.execute("elements.delete",t)},Z_.prototype.distributeElements=function(e,t,n){var i={groups:e,axis:t,dimension:n};this._commandStack.execute("elements.distribute",i)},Z_.prototype.removeShape=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.delete",n)},Z_.prototype.removeConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.delete",n)},Z_.prototype.replaceShape=function(e,t,n){var i={oldShape:e,newData:t,hints:n||{}};return this._commandStack.execute("shape.replace",i),i.newShape},Z_.prototype.alignElements=function(e,t){var n={elements:e,alignment:t};this._commandStack.execute("elements.align",n)},Z_.prototype.resizeShape=function(e,t,n,i){var r={shape:e,newBounds:t,minBounds:n,hints:i};this._commandStack.execute("shape.resize",r)},Z_.prototype.createSpace=function(e,t,n,i,r){var o={delta:n,direction:i,movingShapes:e,resizingShapes:t,start:r};this._commandStack.execute("spaceTool",o)},Z_.prototype.updateWaypoints=function(e,t,n){var i={connection:e,newWaypoints:t,hints:n||{}};this._commandStack.execute("connection.updateWaypoints",i)},Z_.prototype.reconnect=function(e,t,n,i,r){var o={connection:e,newSource:t,newTarget:n,dockingOrPoints:i,hints:r||{}};this._commandStack.execute("connection.reconnect",o)},Z_.prototype.reconnectStart=function(e,t,n,i){i||(i={}),this.reconnect(e,t,e.target,n,W(i,{docking:"source"}))},Z_.prototype.reconnectEnd=function(e,t,n,i){i||(i={}),this.reconnect(e,e.source,t,n,W(i,{docking:"target"}))},Z_.prototype.connect=function(e,t,n,i){return this.createConnection(e,t,n||{},e.parent,i)},Z_.prototype._create=function(e,t){return t instanceof qn?t:this._elementFactory.create(e,t)},Z_.prototype.toggleCollapse=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.toggleCollapse",n)},J_.$inject=["elementRegistry"],J_.prototype.execute=function(e){var t=e.element,n=e.moddleElement,i=e.properties;if(!n)throw new Error("<moddleElement> required");var r=e.changed||this.getVisualReferences(n).concat(t),o=e.oldProperties||Q_(n,P(i));return eE(n,i),e.oldProperties=o,e.changed=r,r},J_.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,i=e.changed;return eE(n,t),i},J_.prototype.getVisualReferences=function(e){var t=this._elementRegistry;return Ko(e,"bpmn:DataObject")?tE(e,t):[]};var nE="default",iE="id",rE="di",oE={width:0,height:0};function aE(e,t,n,i,r){this._elementRegistry=e,this._moddle=t,this._translate=n,this._modeling=i,this._textRenderer=r}function sE(e,t){return iE in e&&e[iE]!==t[iE]}function cE(e,t){var n=P(t),i=e.businessObject,r=Zo(e);return A(n,(function(e,n){return e[n]=n!==rE?i.get(n):uE(r,P(t.di)),e}),{})}function uE(e,t){return A(t,(function(t,n){return t[n]=e&&e.get(n),t}),{})}function lE(e,t){var n=e.businessObject,i=Zo(e);C(t,(function(e,t){t!==rE?n.set(t,e):i&&pE(i,e)}))}function pE(e,t){C(t,(function(t,n){e.set(n,t)}))}aE.$inject=["elementRegistry","moddle","translate","modeling","textRenderer"],aE.prototype.execute=function(e){var t=e.element,n=[t],i=this._translate;if(!t)throw new Error(i("element required"));var r=this._elementRegistry,o=this._moddle.ids,a=t.businessObject,s=fE(e.properties),c=e.oldProperties||cE(t,s);return sE(s,a)&&(o.unclaim(a[iE]),r.updateId(t,s[iE]),o.claim(s[iE],a)),nE in s&&(s[nE]&&n.push(r.get(s[nE].id)),a[nE]&&n.push(r.get(a[nE].id))),lE(t,s),e.oldProperties=c,e.changed=n,n},aE.prototype.postExecute=function(e){var t=e.element,n=t.label,i=n&&Xo(n).name;if(i){var r=this._textRenderer.getExternalLabelBounds(n,i);this._modeling.resizeShape(n,r,oE)}},aE.prototype.revert=function(e){var t=e.element,n=e.properties,i=e.oldProperties,r=t.businessObject,o=this._elementRegistry,a=this._moddle.ids;return lE(t,i),sE(n,r)&&(a.unclaim(n[iE]),o.updateId(t,i[iE]),a.claim(i[iE],r)),e.changed};var dE=["default"];function fE(e){var t=W({},e);return dE.forEach((function(n){n in e&&(t[n]=Xo(t[n]))})),t}function hE(e,t){this._canvas=e,this._modeling=t}function mE(e,t){this._modeling=e,this._spaceTool=t}function vE(e,t){this._modeling=e,this._translate=t}function gE(e,t){this._modeling=e,this._spaceTool=t}hE.$inject=["canvas","modeling"],hE.prototype.execute=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=t.getRootElement(),o=r.businessObject,a=o.$parent,s=Zo(r);t.setRootElement(n),t.removeRootElement(r),tn(a.rootElements,i),i.$parent=a,en(a.rootElements,o),o.$parent=null,r.di=null,s.bpmnElement=i,n.di=s,e.oldRoot=r},hE.prototype.revert=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=e.oldRoot,o=r.businessObject,a=i.$parent,s=Zo(n);t.setRootElement(r),t.removeRootElement(n),en(a.rootElements,i),i.$parent=null,tn(a.rootElements,o),o.$parent=a,n.di=null,s.bpmnElement=o,r.di=s},mE.$inject=["modeling","spaceTool"],mE.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,i=e.shape,r=e.location,o=tm(i),a=o===i,s=a?i:i.parent,c=em(s);c.length||n.createShape({type:"bpmn:Lane"},{x:i.x+Jh,y:i.y,width:i.width-Jh,height:i.height},s);var u=[];$t(o,(function(e){return u.push(e),e.label&&u.push(e.label),e===i?[]:E(e.children,(function(e){return e!==i}))}));var l="top"===r?-120:120,p="top"===r?i.y:i.y+i.height,d=p+("top"===r?10:-10),f="top"===r?"n":"s",h=t.calculateAdjustments(u,"y",l,d);t.makeSpace(h.movingShapes,h.resizingShapes,{x:0,y:l},f,d),e.newLane=n.createShape({type:"bpmn:Lane"},{x:i.x+(a?Jh:0),y:p-("top"===r?120:0),width:i.width-(a?Jh:0),height:120},s)},vE.$inject=["modeling","translate"],vE.prototype.preExecute=function(e){var t=this._modeling,n=this._translate,i=e.shape,r=e.count,o=em(i),a=o.length;if(a>r)throw new Error(n("more than {count} child lanes",{count:r}));var s,c,u,l,p,d=Math.round(i.height/r);for(p=0;p<r;p++)s=i.y+p*d,c=p===r-1?i.height-d*p:d,u={x:i.x+Jh,y:s,width:i.width-Jh,height:c},p<a?t.resizeShape(o[p],u):(l={type:"bpmn:Lane"},t.createShape(l,u,i))},gE.$inject=["modeling","spaceTool"],gE.prototype.preExecute=function(e){var t=e.shape,n=e.newBounds,i=e.balanced;!1!==i?this.resizeBalanced(t,n):this.resizeSpace(t,n)},gE.prototype.resizeBalanced=function(e,t){var n=this._modeling,i=nm(e,t);n.resizeShape(e,t),i.forEach((function(e){n.resizeShape(e.shape,e.newBounds)}))},gE.prototype.resizeSpace=function(e,t){var n,i,r,o,a,s=this._spaceTool,c=vn(e),u=vn(t),l=Lh(u,c),p=tm(e),d=[],f=[];$t(p,(function(e){return d.push(e),(Ko(e,"bpmn:Lane")||Ko(e,"bpmn:Participant"))&&f.push(e),e.children})),(l.bottom||l.top)&&(n=l.bottom||l.top,i=e.y+(l.bottom?e.height:0)+(l.bottom?-10:10),r=l.bottom?"s":"n",o=l.top>0||l.bottom<0?-n:n,a=s.calculateAdjustments(d,"y",o,i),s.makeSpace(a.movingShapes,a.resizingShapes,{x:0,y:n},r)),(l.left||l.right)&&(n=l.right||l.left,i=e.x+(l.right?e.width:0)+(l.right?-10:100),r=l.right?"e":"w",o=l.left>0||l.right<0?-n:n,a=s.calculateAdjustments(f,"x",o,i),s.makeSpace(a.movingShapes,a.resizingShapes,{x:n,y:0},r))};var yE="flowNodeRef",bE="lanes";function xE(e){this._elementRegistry=e}function wE(e){this._moddle=e}xE.$inject=["elementRegistry"],xE.prototype.computeUpdates=function(e,t){var n=[],i=[],r={},o=[];function a(e,t){var n=vn(t),i={x:e.x+e.width/2,y:e.y+e.height/2};return i.x>n.left&&i.x<n.right&&i.y>n.top&&i.y<n.bottom}function s(e){-1===n.indexOf(e)&&(o.push(e),n.push(e))}function c(e){var t=tm(e);return r[t.id]||(r[t.id]=Qh(t)),r[t.id]}function u(e){if(!e.parent)return[];var t=c(e);return t.filter((function(t){return a(e,t)})).map((function(e){return e.businessObject}))}return t.forEach((function(e){var t=tm(e);if(t&&-1===n.indexOf(t)){var i=t.children.filter((function(e){return Ko(e,"bpmn:FlowNode")}));i.forEach(s),n.push(t)}})),e.forEach(s),o.forEach((function(e){var t=e.businessObject,n=t.get(bE),r=n.slice(),o=u(e);i.push({flowNode:t,remove:r,add:o})})),t.forEach((function(e){var t=e.businessObject;e.parent||t.get(yE).forEach((function(e){i.push({flowNode:e,remove:[t],add:[]})}))})),i},xE.prototype.execute=function(e){var t=e.updates;t||(t=e.updates=this.computeUpdates(e.flowNodeShapes,e.laneShapes)),t.forEach((function(e){var t=e.flowNode,n=t.get(bE);e.remove.forEach((function(e){en(n,e),en(e.get(yE),t)})),e.add.forEach((function(e){tn(n,e),tn(e.get(yE),t)}))}))},xE.prototype.revert=function(e){var t=e.updates;t.forEach((function(e){var t=e.flowNode,n=t.get(bE);e.add.forEach((function(e){en(n,e),en(e.get(yE),t)})),e.remove.forEach((function(e){tn(n,e),tn(e.get(yE),t)}))}))},wE.$inject=["moddle"],wE.prototype.execute=function(e){var t=this._moddle.ids,n=e.id,i=e.element,r=e.claiming;r?t.claim(n,i):t.unclaim(n)},wE.prototype.revert=function(e){var t=this._moddle.ids,n=e.id,i=e.element,r=e.claiming;r?t.unclaim(n):t.claim(n,i)};var _E={fill:void 0,stroke:void 0};function EE(e){this._commandStack=e,this._normalizeColor=function(e){if(e){if(y(e)){var t=CE(e);if(t)return t}throw new Error("invalid color value: "+e)}}}function CE(e){var t=document.createElement("canvas").getContext("2d");return t.fillStyle="transparent",t.fillStyle=e,/^#[0-9a-fA-F]{6}$/.test(t.fillStyle)?t.fillStyle:null}function SE(e){return!!e.waypoints}function AE(e){"border-color"in e&&(e.stroke=e["border-color"]),"background-color"in e&&(e.fill=e["background-color"])}EE.$inject=["commandStack"],EE.prototype.postExecute=function(e){var t=e.elements,n=e.colors||_E,i=this,r={};"fill"in n&&W(r,{"background-color":this._normalizeColor(n.fill)}),"stroke"in n&&W(r,{"border-color":this._normalizeColor(n.stroke)}),C(t,(function(e){var t=SE(e)?U(r,["border-color"]):r,n=Zo(e);if(AE(t),Ps(e))i._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:n.label,properties:{color:r["border-color"]}});else{if(!Yo(n,["bpmndi:BPMNEdge","bpmndi:BPMNShape"]))return;i._commandStack.execute("element.updateProperties",{element:e,properties:{di:t}})}}))};var TE={width:0,height:0};function kE(e,t,n){function i(e,t){if(!Cs(e)){var i=Zo(e);t&&!i.label&&(i.label=n.create("bpmndi:BPMNLabel")),!t&&i.label&&delete i.label}}function r(e,t){var n=e.label||e,r=e.labelTarget||e;return Da(n,t,r!==n),i(e,t),[n,r]}function o(t){var n=t.element,i=n.businessObject,r=t.newLabel;if(!Ps(n)&&Cs(n)&&!Ss(n)&&!RE(r)){var o=7,a=ks(n);a={x:a.x,y:a.y+o},e.createLabel(n,a,{id:i.id+"_label",businessObject:i,di:n.di})}}function a(e){return e.oldLabel=Pa(e.element),r(e.element,e.newLabel)}function s(e){return r(e.element,e.oldLabel)}function c(n){var i=n.element,r=i.label||i,o=n.newLabel,a=n.newBounds,s=n.hints||{};if(Ps(r)||Ko(r,"bpmn:TextAnnotation"))if(Ps(r)&&RE(o))!1!==s.removeShape&&e.removeShape(r,{unsetLabel:!1});else{var c=Pa(r);"undefined"===typeof a&&(a=t.getExternalLabelBounds(r,c)),a&&e.resizeShape(r,a,TE)}}this.preExecute=o,this.execute=a,this.revert=s,this.postExecute=c}function RE(e){return!e||!e.trim()}function PE(e,t,n,i){Z_.call(this,e,t,n),this._bpmnRules=i}function DE(){}kE.$inject=["modeling","textRenderer","bpmnFactory"],i(PE,Z_),PE.$inject=["eventBus","elementFactory","commandStack","bpmnRules"],PE.prototype.getHandlers=function(){var e=Z_.prototype.getHandlers.call(this);return e["element.updateModdleProperties"]=J_,e["element.updateProperties"]=aE,e["canvas.updateRoot"]=hE,e["lane.add"]=mE,e["lane.resize"]=gE,e["lane.split"]=vE,e["lane.updateRefs"]=xE,e["id.updateClaim"]=wE,e["element.setColor"]=EE,e["element.updateLabel"]=kE,e},PE.prototype.updateLabel=function(e,t,n,i){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:n,hints:i||{}})},PE.prototype.connect=function(e,t,n,i){var r=this._bpmnRules;if(n||(n=r.canConnect(e,t)),n)return this.createConnection(e,t,n,e.parent,i)},PE.prototype.updateModdleProperties=function(e,t,n){this._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:n})},PE.prototype.updateProperties=function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})},PE.prototype.resizeLane=function(e,t,n){this._commandStack.execute("lane.resize",{shape:e,newBounds:t,balanced:n})},PE.prototype.addLane=function(e,t){var n={shape:e,location:t};return this._commandStack.execute("lane.add",n),n.newLane},PE.prototype.splitLane=function(e,t){this._commandStack.execute("lane.split",{shape:e,count:t})},PE.prototype.makeCollaboration=function(){var e=this._create("root",{type:"bpmn:Collaboration"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e},PE.prototype.updateLaneRefs=function(e,t){this._commandStack.execute("lane.updateRefs",{flowNodeShapes:e,laneShapes:t})},PE.prototype.makeProcess=function(){var e=this._create("root",{type:"bpmn:Process"}),t={newRoot:e};this._commandStack.execute("canvas.updateRoot",t)},PE.prototype.claimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t,claiming:!0})},PE.prototype.unclaimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t})},PE.prototype.setColor=function(e,t){e.length||(e=[e]),this._commandStack.execute("element.setColor",{elements:e,colors:t})},DE.prototype.layoutConnection=function(e,t){return t=t||{},[t.connectionStart||xn(t.source||e.source),t.connectionEnd||xn(t.target||e.target)]};var ME=20,BE=5,OE=Math.round,jE=20,NE={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function FE(e,t){return!{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/./,v:/./}[t].test(e)}function IE(e,t){return{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/left|right/,v:/top|bottom/}[e].test(t)}function LE(e,t,n){var i,r,o=wn(t,e,BE),a=n.split(":")[0],s=OE((t.x-e.x)/2+e.x),c=OE((t.y-e.y)/2+e.y),u=IE(a,o),l=/h|r|l/.test(a),p=!1,d=!1;return u?(i=l?{x:s,y:e.y}:{x:e.x,y:c},r=l?"h:h":"v:v"):(p=FE(o,a),r=l?"h:v":"v:h",p?l?(d=c===e.y,i={x:e.x+ME*(/l/.test(a)?-1:1),y:d?c+ME:c}):(d=s===e.x,i={x:d?s+ME:s,y:e.y+ME*(/t/.test(a)?-1:1)}):i={x:s,y:c}),{waypoints:WE(e,i,r).concat(i),directions:r,turnNextDirections:d}}function zE(e,t,n){return LE(e,t,n)}function $E(e,t,n){var i=LE(t,e,GE(n));return{waypoints:i.waypoints.slice().reverse(),directions:GE(i.directions),turnNextDirections:i.turnNextDirections}}function HE(e,t){var n=e.directions.split(":")[1],i=t.directions.split(":")[0];e.turnNextDirections&&(n="h"==n?"v":"h"),t.turnNextDirections&&(i="h"==i?"v":"h");var r=n+":"+i,o=WE(e.waypoints[e.waypoints.length-1],t.waypoints[0],r);return{waypoints:o,directions:r}}function GE(e){return e.split(":").reverse().join(":")}function VE(e,t,n){var i=OE((t.x-e.x)/2+e.x),r=OE((t.y-e.y)/2+e.y);if("h:v"===n)return[{x:t.x,y:e.y}];if("v:h"===n)return[{x:e.x,y:t.y}];if("h:h"===n)return[{x:i,y:e.y},{x:i,y:t.y}];if("v:v"===n)return[{x:e.x,y:r},{x:t.x,y:r}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}function WE(e,t,n){if(n=n||"h:h",!nC(n))throw new Error("unknown directions: <"+n+">: must be specified as <start>:<end> with start/end in { h,v,t,r,b,l }");if(iC(n)){var i=zE(e,t,n),r=$E(e,t,n),o=HE(i,r);return[].concat(i.waypoints,o.waypoints,r.waypoints)}return VE(e,t,n)}function UE(e,t,n){var i=WE(e,t,n);return i.unshift(e),i.push(t),aC(i)}function qE(e,t,n,i,r){var o=r&&r.preferredLayouts||[],a=S(o,"straight")[0]||"h:h",s=NE[a]||0,c=wn(e,t,s),u=tC(c,a);n=n||xn(e),i=i||xn(t);var l=u.split(":"),p=oC(n,e,l[0],rC(c)),d=oC(i,t,l[1],c);return UE(p,d,u)}function KE(e,t,n,i,r,o){h(n)&&(r=n,o=i,n=xn(e),i=xn(t)),o=W({preferredLayouts:[]},o),r=r||[];var a,s=o.preferredLayouts,c=-1!==s.indexOf("straight");return a=c&&ZE(e,t,n,i,o),a||(a=o.connectionEnd&&QE(t,e,i,r),a||(a=o.connectionStart&&JE(e,t,n,r),a||(!o.connectionStart&&!o.connectionEnd&&r&&r.length?r:qE(e,t,n,i,o))))}function YE(e,t,n){return e>=t&&e<=n}function XE(e,t,n){var i={x:"width",y:"height"};return YE(t[e],n[e],n[e]+n[i[e]])}function ZE(e,t,n,i,r){var o,a,s={};return a=wn(e,t),/^(top|bottom|left|right)$/.test(a)?(/top|bottom/.test(a)&&(o="x"),/left|right/.test(a)&&(o="y"),"target"===r.preserveDocking?XE(o,i,e)?(s[o]=i[o],[{x:void 0!==s.x?s.x:n.x,y:void 0!==s.y?s.y:n.y,original:{x:void 0!==s.x?s.x:n.x,y:void 0!==s.y?s.y:n.y}},{x:i.x,y:i.y}]):null:XE(o,n,t)?(s[o]=n[o],[{x:n.x,y:n.y},{x:void 0!==s.x?s.x:i.x,y:void 0!==s.y?s.y:i.y,original:{x:void 0!==s.x?s.x:i.x,y:void 0!==s.y?s.y:i.y}}]):null):null}function JE(e,t,n,i){return eC(e,t,n,i)}function QE(e,t,n,i){var r=i.slice().reverse();return r=eC(e,t,n,r),r?r.reverse():null}function eC(e,t,n,i){function r(e){return e.length<3||!(e.length>4)&&!!w(e,(function(t,n){var i=e[n-1];return i&&rn(t,i)<3}))}function o(e,t,n){var i=sn(t,e);switch(i){case"v":return{x:n.x,y:e.y};case"h":return{x:e.x,y:n.y}}return{x:e.x,y:e.y}}function a(e,t,n){var i;for(i=e.length-2;0!==i;i--)if(ln(e[i],t,jE)||ln(e[i],n,jE))return e.slice(i);return e}if(r(i))return null;var s,c=i[0],u=i.slice();return u[0]=n,u[1]=o(u[1],c,n),s=a(u,e,t),s!==u&&(u=eC(e,t,n,s)),u&&sn(u)?null:u}function tC(e,t){if(iC(t))return t;switch(e){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return t}}function nC(e){return e&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(e)}function iC(e){return e&&/t|r|b|l/.test(e)}function rC(e){return{top:"bottom",bottom:"top",left:"right",right:"left","top-left":"bottom-right","bottom-right":"top-left","top-right":"bottom-left","bottom-left":"top-right"}[e]}function oC(e,t,n,i){if("h"===n&&(n=/left/.test(i)?"l":"r"),"v"===n&&(n=/top/.test(i)?"t":"b"),"t"===n)return{original:e,x:e.x,y:t.y};if("r"===n)return{original:e,x:t.x+t.width,y:e.y};if("b"===n)return{original:e,x:e.x,y:t.y+t.height};if("l"===n)return{original:e,x:t.x,y:e.y};throw new Error("unexpected dockingDirection: <"+n+">")}function aC(e){return e.reduce((function(t,n,i){var r=t[t.length-1],o=e[i+1];return on(r,o,n,0)||t.push(n),t}),[])}var sC=-10,cC=40,uC={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},lC={top:"t",right:"r",bottom:"b",left:"l"};function pC(){}function dC(e){var t=e.host;return wn(xn(e),t,sC)}function fC(e,t){return{preferredLayouts:["straight","v:v"],preserveDocking:hC(e,t)}}function hC(e,t){return Ko(t,"bpmn:Participant")?"source":Ko(e,"bpmn:Participant")?"target":bC(t)?"source":bC(e)||Ko(t,"bpmn:Event")?"target":Ko(e,"bpmn:Event")?"source":null}function mC(e){return{preferredLayouts:["straight","h:h"],preserveDocking:vC(e)}}function vC(e){return bC(e)?"target":"source"}function gC(e,t){return e?e.original||e:xn(t)}function yC(e,t){return Ko(t,"bpmn:Activity")&&Ko(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function bC(e){return Ko(e,"bpmn:SubProcess")&&wa(e)}function xC(e,t){return e===t}function wC(e,t){return-1!==t.indexOf(e)}function _C(e){var t=/right|left/.exec(e);return t&&t[0]}function EC(e){var t=/top|bottom/.exec(e);return t&&t[0]}function CC(e,t){return uC[e]===t}function SC(e,t){var n=_C(e),i=uC[n];return-1!==t.indexOf(i)}function AC(e,t){var n=EC(e),i=uC[n];return-1!==t.indexOf(i)}function TC(e){return"right"===e||"left"===e}function kC(e,t){var n=t.waypoints,i=n&&n.length&&wn(n[0],e);return"top"===i?["t:r"]:"right"===i?["r:b"]:"left"===i?["l:t"]:["b:l"]}function RC(e,t,n){var i,r,o=xn(e),a=xn(t),s=dC(e),c=xC(e.host,t),u=wC(s,["top","right","bottom","left"]),l=wn(a,o,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return c?PC(s,u,e,t,n):(i=BC(s,l,u),r=OC(s,l,u),[i+":"+r])}function PC(e,t,n,i,r){var o,a=t?e:EC(e),s=lC[a];return o=t?TC(e)?DC("y",n,i,r)?"h":"b":DC("x",n,i,r)?"v":"l":"v",[s+":"+o]}function DC(e,t,n,i){var r=cC;return!(MC(e,i,n,r)||MC(e,i,{x:n.x+n.width,y:n.y+n.height},r)||MC(e,i,xn(t),r))}function MC(e,t,n,i){return Math.abs(t[e]-n[e])<i}function BC(e,t,n){return n?lC[e]:xC(EC(e),EC(t))||CC(_C(e),_C(t))?lC[EC(e)]:lC[_C(e)]}function OC(e,t,n){return n?TC(e)?SC(e,t)||xC(e,t)?"h":"v":AC(e,t)||xC(e,t)?"v":"h":TC(t)||xC(EC(e),EC(t))&&_C(t)?"h":"v"}function jC(e){return W({original:e.point.original||e.point},e.actual)}function NC(e,t){this._elementRegistry=e,this._graphicsFactory=t}i(pC,DE),pC.prototype.layoutConnection=function(e,t){t||(t={});var n,i,r=t.source||e.source,o=t.target||e.target,a=t.waypoints||e.waypoints,s=t.connectionStart,c=t.connectionEnd;return s||(s=gC(a&&a[0],r)),c||(c=gC(a&&a[a.length-1],o)),(Ko(e,"bpmn:Association")||Ko(e,"bpmn:DataAssociation"))&&a&&!yC(r,o)?[].concat([s],a.slice(1,-1),[c]):(Ko(e,"bpmn:MessageFlow")?n=fC(r,o):(Ko(e,"bpmn:SequenceFlow")||yC(r,o))&&(n=r===o?{preferredLayouts:kC(r,e)}:Ko(r,"bpmn:BoundaryEvent")?{preferredLayouts:RC(r,o,c)}:bC(r)||bC(o)?mC(r):Ko(r,"bpmn:Gateway")?{preferredLayouts:["v:h"]}:Ko(o,"bpmn:Gateway")?{preferredLayouts:["h:v"]}:{preferredLayouts:["h:h"]}),n&&(n=W(n,t),i=aC(KE(r,o,s,c,a,n))),i||[s,c])},NC.$inject=["elementRegistry","graphicsFactory"],NC.prototype.getCroppedWaypoints=function(e,t,n){t=t||e.source,n=n||e.target;var i=this.getDockingPoint(e,t,!0),r=this.getDockingPoint(e,n),o=e.waypoints.slice(i.idx+1,r.idx);return o.unshift(jC(i)),o.push(jC(r)),o},NC.prototype.getDockingPoint=function(e,t,n){var i,r,o,a=e.waypoints;return i=n?0:a.length-1,r=a[i],o=this._getIntersection(t,e,n),{point:r,actual:o||r,idx:i}},NC.prototype._getIntersection=function(e,t,n){var i=this._getShapePath(e),r=this._getConnectionPath(t);return _n(i,r,n)},NC.prototype._getConnectionPath=function(e){return this._graphicsFactory.getConnectionPath(e)},NC.prototype._getShapePath=function(e){return this._graphicsFactory.getShapePath(e)},NC.prototype._getGfx=function(e){return this._elementRegistry.getGraphics(e)};var FC={__init__:["modeling","bpmnUpdater"],__depends__:[qb,Gx,Ux,Yx,vh,Zx,ow,pw,ww,pc,_c,Zw],bpmnFactory:["type",Jw],bpmnUpdater:["type",Qw],elementFactory:["type",i_],modeling:["type",PE],layouter:["type",pC],connectionDocking:["type",NC]},IC=500,LC=1250,zC=1500,$C=Math.round;function HC(e){return{x:e.x+$C(e.width/2),y:e.y+$C(e.height/2)}}function GC(e,t,n,i,r){function o(e,t,n,i){return r.allowed("elements.move",{shapes:e,delta:t,position:n,target:i})}function a(e,n,i,r){if(m(i)&&(r=i,i=!1),!n.waypoints&&n.parent&&!qe(e.target).has("djs-hit-no-move")){var o=HC(n);return t.init(e,o,"shape.move",{cursor:"grabbing",autoActivate:i,data:{shape:n,context:r||{}}}),!0}}e.on("shape.move.start",zC,(function(e){var t=e.context,n=e.shape,r=i.get().slice();-1===r.indexOf(n)&&(r=[n]),r=VC(r),W(t,{shapes:r,validatedShapes:r,shape:n})})),e.on("shape.move.start",LC,(function(e){var t,n=e.context,i=n.validatedShapes;if(t=n.canExecute=o(i),!t)return!1})),e.on("shape.move.move",IC,(function(e){var t,n=e.context,i=n.validatedShapes,r=e.hover,a={x:e.dx,y:e.dy},s={x:e.x,y:e.y};t=o(i,a,s,r),n.delta=a,n.canExecute=t,n.target=null!==t?r:null})),e.on("shape.move.end",(function(e){var t=e.context,i=t.delta,r=t.canExecute,o="attach"===r,a=t.shapes;if(!1===r)return!1;i.x=$C(i.x),i.y=$C(i.y),0===i.x&&0===i.y||n.moveElements(a,i,t.target,{primaryShape:t.shape,attach:o})})),e.on("element.mousedown",(function(e){if(Ws(e)){var t=zs(e);if(!t)throw new Error("must supply DOM mousedown event");return a(t,e.element)}})),this.start=a}function VC(e){var t=B(e,"id");return E(e,(function(e){while(e=e.parent)if(t[e.id])return!1;return!0}))}GC.$inject=["eventBus","dragging","modeling","selection","rules"];var WC=499,UC="djs-dragging",qC="drop-ok",KC="drop-not-ok",YC="new-parent",XC="attach-ok";function ZC(e,t,n,i){function r(e){var t=o(e),n=JC(t);return n}function o(e){var t=Gt(e,!0),n=R(t,(function(e){return(e.incoming||[]).concat(e.outgoing||[])}));return c(t.concat(n))}function a(e,n){[XC,qC,KC,YC].forEach((function(i){i===n?t.addMarker(e,i):t.removeMarker(e,i)}))}function s(e,n,r){i.addDragger(n,e.dragGroup),r&&t.addMarker(n,UC),e.allDraggedElements?e.allDraggedElements.push(n):e.allDraggedElements=[n]}e.on("shape.move.start",WC,(function(e){var a=e.context,s=a.shapes,u=a.allDraggedElements,l=r(s);if(!a.dragGroup){var p=nt("g");He(p,n.cls("djs-drag-group",["no-events"]));var d=t.getActiveLayer();Ne(d,p),a.dragGroup=p}l.forEach((function(e){i.addDragger(e,a.dragGroup)})),u=u?c([u,o(s)]):o(s),C(u,(function(e){t.addMarker(e,UC)})),a.allDraggedElements=u,a.differentParents=QC(s)})),e.on("shape.move.move",WC,(function(e){var t=e.context,n=t.dragGroup,i=t.target,r=t.shape.parent,o=t.canExecute;i&&("attach"===o?a(i,XC):t.canExecute&&i&&i.id!==r.id?a(i,YC):a(i,t.canExecute?qC:KC)),li(n,e.dx,e.dy)})),e.on(["shape.move.out","shape.move.cleanup"],(function(e){var t=e.context,n=t.target;n&&a(n,null)})),e.on("shape.move.cleanup",(function(e){var n=e.context,i=n.allDraggedElements,r=n.dragGroup;C(i,(function(e){t.removeMarker(e,UC)})),r&&Ye(r)})),this.makeDraggable=s}function JC(e){var t=E(e,(function(t){return!eS(t)||w(e,F({id:t.source.id}))&&w(e,F({id:t.target.id}))}));return t}function QC(e){return 1!==D(B(e,(function(e){return e.parent&&e.parent.id})))}function eS(e){return e.waypoints}ZC.$inject=["eventBus","canvas","styles","previewSupport"];var tS={__depends__:[Qs,pc,nc,Mp,Tp,Ef],__init__:["move","movePreview"],move:["type",GC],movePreview:["type",ZC]},nS=".djs-palette-toggle",iS=".entry",rS=nS+", "+iS,oS="djs-palette-",aS="shown",sS="open",cS="two-column",uS=1e3;function lS(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",(function(e){var t=e.tool;n.updateToolHighlight(t)})),e.on("i18n.changed",(function(){n._update()})),e.on("diagram.init",(function(){n._diagramInitialized=!0,n._rebuild()}))}function pS(e,t){var n=ce(e),i=h(t)?t:t.split(/\s+/g);i.forEach((function(e){n.add(e)}))}function dS(e,t){var n=t.getPaletteEntries();return g(n)?n(e):(C(n,(function(t,n){e[n]=t})),e)}lS.$inject=["eventBus","canvas"],lS.prototype.registerProvider=function(e,t){t||(t=e,e=uS),this._eventBus.on("palette.getProviders",e,(function(e){e.providers.push(t)})),this._rebuild()},lS.prototype.getEntries=function(){var e=this._getProviders();return e.reduce(dS,{})},lS.prototype._rebuild=function(){if(this._diagramInitialized){var e=this._getProviders();e.length&&(this._container||this._init(),this._update())}},lS.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),i=this._container=Te(lS.HTML_MARKUP);n.appendChild(i),ce(n).add(oS+aS),Ae.bind(i,rS,"click",(function(t){var n=t.delegateTarget;if(fe(n,nS))return e.toggle();e.trigger("click",t)})),we.bind(i,"mousedown",(function(e){e.stopPropagation()})),Ae.bind(i,iS,"dragstart",(function(t){e.trigger("dragstart",t)})),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:i})},lS.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},lS.prototype._toggleState=function(e){e=e||{};var t,n=this._getParentContainer(),i=this._container,r=this._eventBus,o=ce(i),a=ce(n);t="twoColumn"in e?e.twoColumn:this._needsCollapse(n.clientHeight,this._entries||{}),o.toggle(cS,t),a.toggle(oS+cS,t),"open"in e&&(o.toggle(sS,e.open),a.toggle(oS+sS,e.open)),r.fire("palette.changed",{twoColumn:t,open:this.isOpen()})},lS.prototype._update=function(){var e=De(".djs-palette-entries",this._container),t=this._entries=this.getEntries();le(e),C(t,(function(t,n){var i=t.group||"default",r=De("[data-group="+Pc()(i)+"]",e);r||(r=Te('<div class="group"></div>'),ie(r,"data-group",i),e.appendChild(r));var o=t.html||(t.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'),a=Te(o);if(r.appendChild(a),!t.separator&&(ie(a,"data-action",n),t.title&&ie(a,"title",t.title),t.className&&pS(a,t.className),t.imageUrl)){var s=Te("<img>");ie(s,"src",t.imageUrl),a.appendChild(s)}})),this.open()},lS.prototype.trigger=function(e,t,n){var i,r,o,a=this._entries,s=t.delegateTarget||t.target;if(!s)return t.preventDefault();i=a[ie(s,"data-action")],i&&(r=i.action,o=t.originalEvent||t,g(r)?"click"===e&&r(o,n):r[e]&&r[e](o,n),t.preventDefault())},lS.prototype._layoutChanged=function(){this._toggleState({})},lS.prototype._needsCollapse=function(e,t){var n=50,i=46*Object.keys(t).length;return e<i+n},lS.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},lS.prototype.open=function(){this._toggleState({open:!0})},lS.prototype.toggle=function(e){this.isOpen()?this.close():this.open()},lS.prototype.isActiveTool=function(e){return e&&this._activeTool===e},lS.prototype.updateToolHighlight=function(e){var t,n;this._toolsContainer||(t=De(".djs-palette-entries",this._container),this._toolsContainer=De("[data-group=tools]",t)),n=this._toolsContainer,C(n.children,(function(t){var n=t.getAttribute("data-action");if(n){var i=ce(t);n=n.replace("-tool",""),i.contains("entry")&&n===e?i.add("highlighted-entry"):i.remove("highlighted-entry")}}))},lS.prototype.isOpen=function(){return ce(this._container).has(sS)},lS.prototype._getParentContainer=function(){return this._canvas.getContainer()},lS.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';var fS={__init__:["palette"],palette:["type",lS]},hS="crosshair";function mS(e,t,n,i,r,o,a){this._selection=r,this._dragging=n,this._mouse=a;var s=this,c={create:function(e){var n,i=t.getActiveLayer();n=e.frame=nt("rect"),He(n,{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),Ne(i,n)},update:function(e){var t=e.frame,n=e.bbox;He(t,{x:n.x,y:n.y,width:n.width,height:n.height})},remove:function(e){e.frame&&Ye(e.frame)}};o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",(function(t){var n=t.originalEvent.target;(t.hover||n instanceof SVGElement)&&e.once("lasso.selection.ended",(function(){s.activateLasso(t.originalEvent,!0)}))})),e.on("lasso.end",(function(e){var t=vS(e),n=i.filter((function(e){return e}));s.select(n,t)})),e.on("lasso.start",(function(e){var t=e.context;t.bbox=vS(e),c.create(t)})),e.on("lasso.move",(function(e){var t=e.context;t.bbox=vS(e),c.update(t)})),e.on("lasso.cleanup",(function(e){var t=e.context;c.remove(t)})),e.on("element.mousedown",1500,(function(e){if(Ks(e))return s.activateLasso(e.originalEvent),!0}))}function vS(e){var t,n={x:e.x-e.dx,y:e.y-e.dy},i={x:e.x,y:e.y};return t=n.x<=i.x&&n.y<i.y||n.x<i.x&&n.y<=i.y?{x:n.x,y:n.y,width:i.x-n.x,height:i.y-n.y}:n.x>=i.x&&n.y<i.y||n.x>i.x&&n.y<=i.y?{x:i.x,y:n.y,width:n.x-i.x,height:i.y-n.y}:n.x<=i.x&&n.y>i.y||n.x<i.x&&n.y>=i.y?{x:n.x,y:i.y,width:i.x-n.x,height:n.y-i.y}:n.x>=i.x&&n.y>i.y||n.x>i.x&&n.y>=i.y?{x:i.x,y:i.y,width:n.x-i.x,height:n.y-i.y}:{x:i.x,y:i.y,width:0,height:0},t}mS.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],mS.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:hS,data:{context:{}}})},mS.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:hS,data:{context:{}}})},mS.prototype.select=function(e,t){var n=Ut(e,t);this._selection.select(M(n))},mS.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},mS.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};var gS={__depends__:[Sw,Hf],__init__:["lassoTool"],lassoTool:["type",mS]},yS=1500,bS="grab";function xS(e,t,n,i,r,o){this._dragging=n,this._mouse=o;var a=this,s=i.get("keyboard",!1);r.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",yS,(function(e){if(qs(e))return a.activateMove(e.originalEvent,!0),!1})),s&&s.addListener(yS,(function(e){if(wS(e.keyEvent)&&!a.isActive()){var t=a._mouse.getLastMoveEvent();a.activateMove(t,!!t)}}),"keyboard.keydown"),s&&s.addListener(yS,(function(e){wS(e.keyEvent)&&a.isActive()&&a.toggle()}),"keyboard.keyup"),e.on("hand.end",(function(t){var n=t.originalEvent.target;if(!t.hover&&!(n instanceof SVGElement))return!1;e.once("hand.ended",(function(){a.activateMove(t.originalEvent,{reactivate:!0})}))})),e.on("hand.move.move",(function(e){var n=t.viewbox().scale;t.scroll({dx:e.dx*n,dy:e.dy*n})})),e.on("hand.move.end",(function(t){var n=t.context,i=n.reactivate;return!qs(t)&&i&&e.once("hand.move.ended",(function(e){a.activateHand(e.originalEvent,!0,!0)})),!1}))}function wS(e){return du(" ",e)}xS.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],xS.prototype.activateMove=function(e,t,n){"object"===typeof t&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:bS,data:{context:n||{}}})},xS.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:bS,data:{context:{reactivate:n}}})},xS.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)},xS.prototype.isActive=function(){var e=this._dragging.context();return!!e&&/^(hand|hand\.move)$/.test(e.prefix)};var _S={__depends__:[Sw,Hf],__init__:["handTool"],handTool:["type",xS]},ES="connect-ok",CS="connect-not-ok";function SS(e,t,n,i,r,o,a){var s=this;this._dragging=t,this._rules=o,this._mouse=a,r.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),e.on("global-connect.hover",(function(e){var t=e.context,n=e.hover,r=t.canStartConnect=s.canStartConnect(n);null!==r&&(t.startTarget=n,i.addMarker(n,r?ES:CS))})),e.on(["global-connect.out","global-connect.cleanup"],(function(e){var t=e.context.startTarget,n=e.context.canStartConnect;t&&i.removeMarker(t,n?ES:CS)})),e.on(["global-connect.ended"],(function(t){var i=t.context,r=i.startTarget,o={x:t.x,y:t.y},a=s.canStartConnect(r);if(a)return e.once("element.out",(function(){e.once(["connect.ended","connect.canceled"],(function(){e.fire("global-connect.drag.ended")})),n.start(null,r,o)})),!1}))}SS.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"],SS.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})},SS.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)},SS.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)},SS.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};var AS={__depends__:[Qd,Mp,Tp,Sw,Hf],globalConnect:["type",SS]};function TS(e,t,n,i,r,o,a,s){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=i,this._lassoTool=r,this._handTool=o,this._globalConnect=a,this._translate=s,e.registerProvider(this)}TS.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],TS.prototype.getPaletteEntries=function(e){var t={},n=this._create,i=this._elementFactory,r=this._spaceTool,o=this._lassoTool,a=this._handTool,s=this._globalConnect,c=this._translate;function u(e,t,r,o,a){function s(t){var r=i.createShape(W({type:e},a));if(a){var o=Zo(r);o.isExpanded=a.isExpanded}n.start(t,r)}var u=e.replace(/^bpmn:/,"");return{group:t,className:r,title:o||c("Create {type}",{type:u}),action:{dragstart:s,click:s}}}function l(e){var t=i.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),r=i.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:t});n.start(e,[t,r],{hints:{autoSelect:[t]}})}function p(e){n.start(e,i.createParticipantShape())}return W(t,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:c("Activate the hand tool"),action:{click:function(e){a.activateHand(e)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:c("Activate the lasso tool"),action:{click:function(e){o.activateSelection(e)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:c("Activate the create/remove space tool"),action:{click:function(e){r.activateSelection(e)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:c("Activate the global connect tool"),action:{click:function(e){s.start(e)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":u("bpmn:StartEvent","event","bpmn-icon-start-event-none",c("Create StartEvent")),"create.intermediate-event":u("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",c("Create Intermediate/Boundary Event")),"create.end-event":u("bpmn:EndEvent","event","bpmn-icon-end-event-none",c("Create EndEvent")),"create.exclusive-gateway":u("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",c("Create Gateway")),"create.task":u("bpmn:Task","activity","bpmn-icon-task",c("Create Task")),"create.data-object":u("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",c("Create DataObjectReference")),"create.data-store":u("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",c("Create DataStoreReference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:c("Create expanded SubProcess"),action:{dragstart:l,click:l}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:c("Create Pool/Participant"),action:{dragstart:p,click:p}},"create.group":u("bpmn:Group","artifact","bpmn-icon-group",c("Create Group"))}),t};var kS={__depends__:[fS,Ff,Zw,gS,_S,AS,ws],__init__:["paletteProvider"],paletteProvider:["type",TS]},RS=250;function PS(e,t,n,i,r){function o(e){var o=e.canExecute.replacements;C(o,(function(o){var a=o.oldElementId,s={type:o.newElementType};if(!e.visualReplacements[a]){var c=t.get(a);W(s,{x:c.x,y:c.y});var u=n.createShape(s);i.addShape(u,c.parent);var l=De('[data-element-id="'+Pc()(c.id)+'"]',e.dragGroup);l&&He(l,{display:"none"});var p=r.addDragger(u,e.dragGroup);e.visualReplacements[a]=p,i.removeShape(u)}}))}function a(e){var t=e.visualReplacements;C(t,(function(n,i){var r=De('[data-element-id="'+Pc()(i)+'"]',e.dragGroup);r&&He(r,{display:"inline"}),n.remove(),t[i]&&delete t[i]}))}Cc.call(this,e),e.on("shape.move.move",RS,(function(e){var t=e.context,n=t.canExecute;t.visualReplacements||(t.visualReplacements={}),n&&n.replacements?o(t):a(t)}))}PS.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"],i(PS,Cc);var DS={__depends__:[Ef],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",PS]},MS=1250,BS=40,OS=20,jS=10,NS=20,FS=["x","y"],IS=Math.abs;function LS(e){e.on(["connect.hover","connect.move","connect.end"],MS,(function(e){var t=e.context,n=t.canExecute,i=t.start,r=t.hover,o=t.source,a=t.target;e.originalEvent&&pu(e.originalEvent)||(t.initialConnectionStart||(t.initialConnectionStart=t.connectionStart),n&&r&&zS(e,r,qS(r)),r&&WS(n,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(t.connectionStart=Nd(i),Yo(r,["bpmn:Event","bpmn:Gateway"])&&GS(e,Nd(r)),Yo(r,["bpmn:Task","bpmn:SubProcess"])&&$S(e,r),Ko(o,"bpmn:BoundaryEvent")&&a===o.host&&HS(e)):VS(n,"bpmn:MessageFlow")?(Ko(i,"bpmn:Event")&&(t.connectionStart=Nd(i)),Ko(r,"bpmn:Event")&&GS(e,Nd(r))):t.connectionStart=t.initialConnectionStart)}))}function zS(e,t,n){FS.forEach((function(i){var r=US(i,t);e[i]<t[i]+n?Id(e,i,t[i]+n):e[i]>t[i]+r-n&&Id(e,i,t[i]+r-n)}))}function $S(e,t){var n=Nd(t);FS.forEach((function(i){KS(e,t,i)&&Id(e,i,n[i])}))}function HS(e){var t=e.context,n=t.source,i=t.target;if(!YS(t)){var r=Nd(n),o=wn(r,i,-10),a=[];/top|bottom/.test(o)&&a.push("x"),/left|right/.test(o)&&a.push("y"),a.forEach((function(t){var n,i=e[t];IS(i-r[t])<BS&&(n=i>r[t]?r[t]+BS:r[t]-BS,Id(e,t,n))}))}}function GS(e,t){Id(e,"x",t.x),Id(e,"y",t.y)}function VS(e,t){return e&&e.type===t}function WS(e,t){return k(t,(function(t){return VS(e,t)}))}function US(e,t){return"x"===e?t.width:t.height}function qS(e){return Ko(e,"bpmn:Task")?jS:OS}function KS(e,t,n){return e[n]>t[n]+NS&&e[n]<t[n]+US(n,t)-NS}function YS(e){var t=e.hover,n=e.source;return t&&n&&t===n}function XS(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}function ZS(e){this._snapValues={}}LS.$inject=["eventBus"],XS.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]},XS.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,-1===this._snapLocations.indexOf(e)&&this._snapLocations.push(e)},XS.prototype.addDefaultSnap=function(e,t){var n=this._defaultSnaps[e];n||(n=this._defaultSnaps[e]=[]),n.push(t)},XS.prototype.getSnapLocations=function(){return this._snapLocations},XS.prototype.setSnapLocations=function(e){this._snapLocations=e},XS.prototype.pointsForTarget=function(e){var t=e.id||e,n=this._targets[t];return n||(n=this._targets[t]=new ZS,n.initDefaults(this._defaultSnaps)),n},ZS.prototype.add=function(e,t){var n=this._snapValues[e];n||(n=this._snapValues[e]={x:[],y:[]}),-1===n.x.indexOf(t.x)&&n.x.push(t.x),-1===n.y.indexOf(t.y)&&n.y.push(t.y)},ZS.prototype.snap=function(e,t,n,i){var r=this._snapValues[t];return r&&Bd(e[n],r[n],i)},ZS.prototype.initDefaults=function(e){var t=this;C(e||{},(function(e,n){C(e,(function(e){t.add(n,e)}))}))};var JS=1250;function QS(e,t,n){var i=this;this._elementRegistry=e,t.on(["create.start","shape.move.start"],(function(e){i.initSnap(e)})),t.on(["create.move","create.end","shape.move.move","shape.move.end"],JS,(function(e){var t=e.context,r=t.shape,o=t.snapContext,a=t.target;if((!e.originalEvent||!pu(e.originalEvent))&&!Fd(e)&&a){var s=o.pointsForTarget(a);s.initialized||(s=i.addSnapTargetPoints(s,r,a),s.initialized=!0),n.snap(e,s)}})),t.on(["create.cleanup","shape.move.cleanup"],(function(){n.hide()}))}function eA(e){return!!e.waypoints}function tA(e){return!!e.hidden}function nA(e){return!!e.labelTarget}QS.$inject=["elementRegistry","eventBus","snapping"],QS.prototype.initSnap=function(e){var t,n=this._elementRegistry,i=e.context,r=i.shape,o=i.snapContext;o||(o=i.snapContext=new XS),t=n.get(r.id)?Nd(r,e):{x:e.x+Nd(r).x,y:e.y+Nd(r).y};var a={x:t.x-r.width/2,y:t.y-r.height/2},s={x:t.x+r.width/2,y:t.y+r.height/2};return o.setSnapOrigin("mid",{x:t.x-e.x,y:t.y-e.y}),nA(r)||(o.setSnapOrigin("top-left",{x:a.x-e.x,y:a.y-e.y}),o.setSnapOrigin("bottom-right",{x:s.x-e.x,y:s.y-e.y})),o},QS.prototype.addSnapTargetPoints=function(e,t,n){var i=this.getSnapTargets(t,n);return C(i,(function(n){if(nA(n))nA(t)&&e.add("mid",Nd(n));else if(eA(n)){if(n.waypoints.length<3)return;var i=n.waypoints.slice(1,-1);C(i,(function(t){e.add("mid",t)}))}else e.add("mid",Nd(n))})),v(t.x)&&v(t.y)?(this._elementRegistry.get(t.id)&&e.add("mid",Nd(t)),e):e},QS.prototype.getSnapTargets=function(e,t){return Ld(t).filter((function(e){return!tA(e)}))};var iA=1500;function rA(e,t){t.invoke(QS,this),e.on(["create.move","create.end"],iA,cA),e.on(["create.move","create.end","shape.move.move","shape.move.end"],iA,(function(e){var t=e.context,n=t.canExecute,i=t.target,r=n&&("attach"===n||n.attach);r&&!Fd(e)&&oA(e,i)}))}function oA(e,t){var n,i=vn(t),r=Kb(e,t),o=e.context,a=o.shape;n=a.parent?{x:0,y:0}:xn(a),/top/.test(r)?Id(e,"y",i.top-n.y):/bottom/.test(r)&&Id(e,"y",i.bottom-n.y),/left/.test(r)?Id(e,"x",i.left-n.x):/right/.test(r)&&Id(e,"x",i.right-n.x)}function aA(e,t){return e.every((function(e){return Ko(e,t)}))}function sA(e){return!(!Ko(e,"bpmn:SubProcess")||!wa(e))||Ko(e,"bpmn:Participant")}function cA(e){var t=e.context,n=t.createConstraints;if(n){var i=n.top,r=n.right,o=n.bottom,a=n.left;(a&&a>=e.x||r&&r<=e.x)&&Id(e,"x",e.x),(i&&i>=e.y||o&&o<=e.y)&&Id(e,"y",e.y)}}function uA(e,t){return-1!==e.indexOf(t)}function lA(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}i(rA,QS),rA.$inject=["eventBus","injector"],rA.prototype.initSnap=function(e){var t=QS.prototype.initSnap.call(this,e),n=e.shape,i=!!this._elementRegistry.get(n.id);return C(n.outgoing,(function(n){var r=n.waypoints[0];r=r.original||r,t.setSnapOrigin(n.id+"-docking",lA(r,i,e))})),C(n.incoming,(function(n){var r=n.waypoints[n.waypoints.length-1];r=r.original||r,t.setSnapOrigin(n.id+"-docking",lA(r,i,e))})),Ko(n,"bpmn:Participant")&&t.setSnapLocations(["top-left","bottom-right","mid"]),t},rA.prototype.addSnapTargetPoints=function(e,t,n){QS.prototype.addSnapTargetPoints.call(this,e,t,n);var i=this.getSnapTargets(t,n);C(i,(function(n){(sA(n)||aA([t,n],"bpmn:TextAnnotation"))&&(e.add("top-left",Od(n)),e.add("bottom-right",jd(n)))}));var r=this._elementRegistry;return C(t.incoming,(function(n){if(r.get(t.id)){uA(i,n.source)||e.add("mid",xn(n.source));var o=n.waypoints[0];e.add(n.id+"-docking",o.original||o)}})),C(t.outgoing,(function(n){if(r.get(t.id)){uA(i,n.target)||e.add("mid",xn(n.target));var o=n.waypoints[n.waypoints.length-1];e.add(n.id+"-docking",o.original||o)}})),Ko(n,"bpmn:SequenceFlow")&&(e=this.addSnapTargetPoints(e,t,n.parent)),e},rA.prototype.getSnapTargets=function(e,t){return QS.prototype.getSnapTargets.call(this,e,t).filter((function(e){return!Ko(e,"bpmn:Lane")}))};var pA=1250;function dA(e,t){var n=this;e.on(["resize.start"],(function(e){n.initSnap(e)})),e.on(["resize.move","resize.end"],pA,(function(e){var i=e.context,r=i.shape,o=r.parent,a=i.direction,s=i.snapContext;if((!e.originalEvent||!pu(e.originalEvent))&&!Fd(e)){var c=s.pointsForTarget(o);c.initialized||(c=n.addSnapTargetPoints(c,r,o,a),c.initialized=!0),yA(a)&&Id(e,"x",e.x),bA(a)&&Id(e,"y",e.y),t.snap(e,c)}})),e.on(["resize.cleanup"],(function(){t.hide()}))}function fA(e,t){var n=xn(e),i=vn(e),r={x:n.x,y:n.y};return-1!==t.indexOf("n")?r.y=i.top:-1!==t.indexOf("s")&&(r.y=i.bottom),-1!==t.indexOf("e")?r.x=i.right:-1!==t.indexOf("w")&&(r.x=i.left),r}function hA(e,t){return e.host===t}function mA(e){return!!e.waypoints}function vA(e){return!!e.hidden}function gA(e){return!!e.labelTarget}function yA(e){return"n"===e||"s"===e}function bA(e){return"e"===e||"w"===e}dA.prototype.initSnap=function(e){var t=e.context,n=t.shape,i=t.direction,r=t.snapContext;r||(r=t.snapContext=new XS);var o=fA(n,i);return r.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),r},dA.prototype.addSnapTargetPoints=function(e,t,n,i){var r=this.getSnapTargets(t,n);return C(r,(function(t){e.add("corner",jd(t)),e.add("corner",Od(t))})),e.add("corner",fA(t,i)),e},dA.$inject=["eventBus","snapping"],dA.prototype.getSnapTargets=function(e,t){return Ld(t).filter((function(t){return!hA(t,e)&&!mA(t)&&!vA(t)&&!gA(t)}))};var xA=7,wA=1e3;function _A(e){this._canvas=e,this._asyncHide=H(G(this.hide,this),wA)}_A.$inject=["canvas"],_A.prototype.snap=function(e,t){var n=e.context,i=n.snapContext,r=i.getSnapLocations(),o={x:Fd(e,"x"),y:Fd(e,"y")};C(r,(function(n){var r=i.getSnapOrigin(n),a={x:e.x+r.x,y:e.y+r.y};if(C(["x","y"],(function(e){var i;o[e]||(i=t.snap(a,n,e,xA),void 0!==i&&(o[e]={value:i,originValue:i-r[e]}))})),o.x&&o.y)return!1})),this.showSnapLine("vertical",o.x&&o.x.value),this.showSnapLine("horizontal",o.y&&o.y.value),C(["x","y"],(function(t){var n=o[t];m(n)&&Id(e,t,n.originValue)}))},_A.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=nt("path");return He(n,{d:"M0,0 L0,0"}),qe(n).add("djs-snap-line"),Ne(t,n),{update:function(t){v(t)?He(n,"horizontal"===e?{d:"M-100000,"+t+" L+100000,"+t,display:""}:{d:"M "+t+",-100000 L "+t+", +100000",display:""}):He(n,{display:"none"})}}},_A.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},_A.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()},_A.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},_A.prototype.hide=function(){C(this._snapLines,(function(e){e.update()}))};var EA={__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",QS],resizeSnapping:["type",dA],snapping:["type",_A]},CA={__depends__:[EA],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",LS],createMoveSnapping:["type",rA]};function SA(e,t,n,i){this._open=!1,this._results=[],this._eventMaps=[],this._canvas=e,this._eventBus=t,this._overlays=n,this._selection=i,this._container=Te(SA.BOX_HTML),this._searchInput=De(SA.INPUT_SELECTOR,this._container),this._resultsContainer=De(SA.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy"],this.close,this)}function AA(e){var t=6,n=e.width+2*t,i=e.height+2*t,r={width:n+"px",height:i+"px"},o=Te('<div class="'+SA.OVERLAY_CLASS+'"></div>');return ne(o,r),{position:{bottom:i-t,right:n-t},show:!0,html:o}}function TA(e,t,n){var i=kA(t),r=Te(n);r.innerHTML=i,e.appendChild(r)}function kA(e){var t="";return e.forEach((function(e){e.matched?t+='<strong class="'+SA.RESULT_HIGHLIGHT_CLASS+'">'+Mc(e.matched)+"</strong>":t+=Mc(e.normal)})),""!==t?t:null}SA.$inject=["canvas","eventBus","overlays","selection"],SA.prototype._bindEvents=function(){var e=this;function t(t,n,i,r){e._eventMaps.push({el:t,type:i,listener:Ae.bind(t,n,i,r)})}t(document,"html","click",(function(t){e.close()})),t(this._container,SA.INPUT_SELECTOR,"click",(function(e){e.stopPropagation(),e.delegateTarget.focus()})),t(this._container,SA.RESULT_SELECTOR,"mouseover",(function(t){t.stopPropagation(),e._scrollToNode(t.delegateTarget),e._preselect(t.delegateTarget)})),t(this._container,SA.RESULT_SELECTOR,"click",(function(t){t.stopPropagation(),e._select(t.delegateTarget)})),t(this._container,SA.INPUT_SELECTOR,"keydown",(function(e){38===e.keyCode&&e.preventDefault(),40===e.keyCode&&e.preventDefault()})),t(this._container,SA.INPUT_SELECTOR,"keyup",(function(t){if(27===t.keyCode)return e.close();if(13===t.keyCode){var n=e._getCurrentResult();return n?e._select(n):e.close()}return 38===t.keyCode?e._scrollToDirection(!0):40===t.keyCode?e._scrollToDirection():void(37!==t.keyCode&&39!==t.keyCode&&e._search(t.delegateTarget.value))}))},SA.prototype._unbindEvents=function(){this._eventMaps.forEach((function(e){Ae.unbind(e.el,e.type,e.listener)}))},SA.prototype._search=function(e){var t=this;if(this._clearResults(),e&&""!==e){var n=this._searchProvider.find(e);if(n.length){n.forEach((function(e){var n=e.element.id,i=t._createResultNode(e,n);t._results[n]={element:e.element,node:i}}));var i=De(SA.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(i),this._preselect(i)}}},SA.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}},SA.prototype._scrollToNode=function(e){if(e&&e!==this._getCurrentResult()){var t=e.offsetTop,n=this._resultsContainer.scrollTop,i=t-this._resultsContainer.clientHeight+e.clientHeight;t<n?this._resultsContainer.scrollTop=t:n<i&&(this._resultsContainer.scrollTop=i)}},SA.prototype._clearResults=function(){le(this._resultsContainer),this._results=[],this._resetOverlay(),this._eventBus.fire("searchPad.cleared")},SA.prototype._getCurrentResult=function(){return De(SA.RESULT_SELECTED_SELECTOR,this._resultsContainer)},SA.prototype._createResultNode=function(e,t){var n=Te(SA.RESULT_HTML);return e.primaryTokens.length>0&&TA(n,e.primaryTokens,SA.RESULT_PRIMARY_HTML),TA(n,e.secondaryTokens,SA.RESULT_SECONDARY_HTML),ie(n,SA.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n},SA.prototype.registerProvider=function(e){this._searchProvider=e},SA.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._bindEvents(),this._open=!0,ce(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},SA.prototype.close=function(){this.isOpen()&&(this._unbindEvents(),this._open=!1,ce(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._resetOverlay(),this._eventBus.fire("searchPad.closed"))},SA.prototype.toggle=function(){this.isOpen()?this.close():this.open()},SA.prototype.isOpen=function(){return this._open},SA.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&ce(t).remove(SA.RESULT_SELECTED_CLASS);var n=ie(e,SA.RESULT_ID_ATTRIBUTE),i=this._results[n].element;ce(e).add(SA.RESULT_SELECTED_CLASS),this._resetOverlay(i),this._canvas.scrollToElement(i,{top:400}),this._selection.select(i),this._eventBus.fire("searchPad.preselected",i)}},SA.prototype._select=function(e){var t=ie(e,SA.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this.close(),this._resetOverlay(),this._canvas.scrollToElement(n,{top:400}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)},SA.prototype._resetOverlay=function(e){if(this._overlayId&&this._overlays.remove(this._overlayId),e){var t=Wt(e),n=AA(t);this._overlayId=this._overlays.add(e,n)}},SA.CONTAINER_SELECTOR=".djs-search-container",SA.INPUT_SELECTOR=".djs-search-input input",SA.RESULTS_CONTAINER_SELECTOR=".djs-search-results",SA.RESULT_SELECTOR=".djs-search-result",SA.RESULT_SELECTED_CLASS="djs-search-result-selected",SA.RESULT_SELECTED_SELECTOR="."+SA.RESULT_SELECTED_CLASS,SA.RESULT_ID_ATTRIBUTE="data-result-id",SA.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",SA.OVERLAY_CLASS="djs-search-overlay",SA.BOX_HTML='<div class="djs-search-container djs-draggable djs-scrollable"><div class="djs-search-input"><input type="text"/></div><div class="djs-search-results"></div></div>',SA.RESULT_HTML='<div class="djs-search-result"></div>',SA.RESULT_PRIMARY_HTML='<div class="djs-search-result-primary"></div>',SA.RESULT_SECONDARY_HTML='<p class="djs-search-result-secondary"></p>';var RA={__depends__:[xc,pc],searchPad:["type",SA]};function PA(e,t,n){this._elementRegistry=e,this._canvas=n,t.registerProvider(this)}function DA(e){var t=E(e,(function(e){return!!e.matched}));return t.length>0}function MA(e,t){var n=[],i=e;if(!e)return n;e=e.toLowerCase(),t=t.toLowerCase();var r=e.indexOf(t);return r>-1?(0!==r&&n.push({normal:i.substr(0,r)}),n.push({matched:i.substr(r,t.length)}),t.length+r<e.length&&n.push({normal:i.substr(t.length+r,e.length)})):n.push({normal:i}),n}PA.$inject=["elementRegistry","searchPad","canvas"],PA.prototype.find=function(e){var t=this._canvas.getRootElement(),n=this._elementRegistry.filter((function(e){return!e.labelTarget}));return n=E(n,(function(e){return e!==t})),n=R(n,(function(t){return{primaryTokens:MA(Pa(t),e),secondaryTokens:MA(t.id,e),element:t}})),n=E(n,(function(e){return DA(e.primaryTokens)||DA(e.secondaryTokens)})),n=N(n,(function(e){return Pa(e.element)+e.element.id})),n};var BA={__depends__:[RA],__init__:["bpmnSearch"],bpmnSearch:["type",PA]},OA='<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" targetNamespace="http://bpmn.io/schema/bpmn" id="Definitions_1"><bpmn:process id="Process_1" isExecutable="false"><bpmn:startEvent id="StartEvent_1"/></bpmn:process><bpmndi:BPMNDiagram id="BPMNDiagram_1"><bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1"><bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"><dc:Bounds height="36.0" width="36.0" x="173.0" y="102.0"/></bpmndi:BPMNShape></bpmndi:BPMNPlane></bpmndi:BPMNDiagram></bpmn:definitions>';function jA(e){xa.call(this,e)}i(jA,xa),jA.Viewer=tu,jA.NavigatedViewer=Zu,jA.prototype.createDiagram=Ho((function(){return this.importXML(OA)})),jA.prototype._interactionModules=[Ru,zu,ll,Xu],jA.prototype._modelingModules=[Il,up,Pp,vp,Wd,Qd,of,am,oh,Ff,vm,Em,Jm,nv,rv,hv,Vv,FC,tS,kS,DS,Mv,CA,BA],jA.prototype._modules=[].concat(tu.prototype._modules,jA.prototype._interactionModules,jA.prototype._modelingModules)},"7d7d":function(e,t,n){"use strict";function i(e,t,n,i){var r=n.inverse;return Object.defineProperty(e,"remove",{value:function(e){var n=this.indexOf(e);return-1!==n&&(this.splice(n,1),t.unset(e,r,i)),e}}),Object.defineProperty(e,"contains",{value:function(e){return-1!==this.indexOf(e)}}),Object.defineProperty(e,"add",{value:function(e,n){var o=this.indexOf(e);if("undefined"===typeof n){if(-1!==o)return;n=this.length}-1!==o&&this.splice(o,1),this.splice(n,0,e),-1===o&&t.set(e,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}function r(e){return!0===e.__refs_collection}e.exports.extend=i,e.exports.isExtended=r},"8fcf":function(e,t,n){e.exports=n("668d"),e.exports.Collection=n("7d7d")},"9b3c":function(e,t,n){(function(t,n){e.exports=n()})("undefined"!==typeof self&&self,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({"00ee":function(e,t,n){var i=n("b622"),r=i("toStringTag"),o={};o[r]="z",e.exports="[object z]"===String(o)},"0366":function(e,t,n){var i=n("1c0b");e.exports=function(e,t,n){if(i(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,r){return e.call(t,n,i,r)}}return function(){return e.apply(t,arguments)}}},"057f":function(e,t,n){var i=n("fc6a"),r=n("241c").f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return r(e)}catch(t){return a.slice()}};e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?s(e):r(i(e))}},"06cf":function(e,t,n){var i=n("83ab"),r=n("d1e7"),o=n("5c6c"),a=n("fc6a"),s=n("c04e"),c=n("5135"),u=n("0cfb"),l=Object.getOwnPropertyDescriptor;t.f=i?l:function(e,t){if(e=a(e),t=s(t,!0),u)try{return l(e,t)}catch(n){}if(c(e,t))return o(!r.f.call(e,t),e[t])}},"0cfb":function(e,t,n){var i=n("83ab"),r=n("d039"),o=n("cc12");e.exports=!i&&!r((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},1276:function(e,t,n){"use strict";var i=n("d784"),r=n("44e7"),o=n("825a"),a=n("1d80"),s=n("4840"),c=n("8aa5"),u=n("50c4"),l=n("14c3"),p=n("9263"),d=n("d039"),f=[].push,h=Math.min,m=4294967295,v=!d((function(){return!RegExp(m,"y")}));i("split",2,(function(e,t,n){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var i=String(a(this)),o=void 0===n?m:n>>>0;if(0===o)return[];if(void 0===e)return[i];if(!r(e))return t.call(i,e,o);var s,c,u,l=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),h=0,v=new RegExp(e.source,d+"g");while(s=p.call(v,i)){if(c=v.lastIndex,c>h&&(l.push(i.slice(h,s.index)),s.length>1&&s.index<i.length&&f.apply(l,s.slice(1)),u=s[0].length,h=c,l.length>=o))break;v.lastIndex===s.index&&v.lastIndex++}return h===i.length?!u&&v.test("")||l.push(""):l.push(i.slice(h)),l.length>o?l.slice(0,o):l}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var r=a(this),o=void 0==t?void 0:t[e];return void 0!==o?o.call(t,r,n):i.call(String(r),t,n)},function(e,r){var a=n(i,e,this,r,i!==t);if(a.done)return a.value;var p=o(e),d=String(this),f=s(p,RegExp),g=p.unicode,y=(p.ignoreCase?"i":"")+(p.multiline?"m":"")+(p.unicode?"u":"")+(v?"y":"g"),b=new f(v?p:"^(?:"+p.source+")",y),x=void 0===r?m:r>>>0;if(0===x)return[];if(0===d.length)return null===l(b,d)?[d]:[];var w=0,_=0,E=[];while(_<d.length){b.lastIndex=v?_:0;var C,S=l(b,v?d:d.slice(_));if(null===S||(C=h(u(b.lastIndex+(v?0:_)),d.length))===w)_=c(d,_,g);else{if(E.push(d.slice(w,_)),E.length===x)return E;for(var A=1;A<=S.length-1;A++)if(E.push(S[A]),E.length===x)return E;_=w=C}}return E.push(d.slice(w)),E}]}),!v)},"129f":function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e===1/t:e!=e&&t!=t}},"14c3":function(e,t,n){var i=n("c6b6"),r=n("9263");e.exports=function(e,t){var n=e.exec;if("function"===typeof n){var o=n.call(e,t);if("object"!==typeof o)throw TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==i(e))throw TypeError("RegExp#exec called on incompatible receiver");return r.call(e,t)}},"159b":function(e,t,n){var i=n("da84"),r=n("fdbc"),o=n("17c2"),a=n("9112");for(var s in r){var c=i[s],u=c&&c.prototype;if(u&&u.forEach!==o)try{a(u,"forEach",o)}catch(l){u.forEach=o}}},"17c2":function(e,t,n){"use strict";var i=n("b727").forEach,r=n("a640"),o=n("ae40"),a=r("forEach"),s=o("forEach");e.exports=a&&s?[].forEach:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}},"19aa":function(e,t){e.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},"1be4":function(e,t,n){var i=n("d066");e.exports=i("document","documentElement")},"1c0b":function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},"1c7e":function(e,t,n){var i=n("b622"),r=i("iterator"),o=!1;try{var a=0,s={next:function(){return{done:!!a++}},return:function(){o=!0}};s[r]=function(){return this},Array.from(s,(function(){throw 2}))}catch(c){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i={};i[r]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(c){}return n}},"1cdc":function(e,t,n){var i=n("342f");e.exports=/(iphone|ipod|ipad).*applewebkit/i.test(i)},"1d80":function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},"1dde":function(e,t,n){var i=n("d039"),r=n("b622"),o=n("2d00"),a=r("species");e.exports=function(e){return o>=51||!i((function(){var t=[],n=t.constructor={};return n[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},2266:function(e,t,n){var i=n("825a"),r=n("e95a"),o=n("50c4"),a=n("0366"),s=n("35a1"),c=n("9bdd"),u=function(e,t){this.stopped=e,this.result=t},l=e.exports=function(e,t,n,l,p){var d,f,h,m,v,g,y,b=a(t,n,l?2:1);if(p)d=e;else{if(f=s(e),"function"!=typeof f)throw TypeError("Target is not iterable");if(r(f)){for(h=0,m=o(e.length);m>h;h++)if(v=l?b(i(y=e[h])[0],y[1]):b(e[h]),v&&v instanceof u)return v;return new u(!1)}d=f.call(e)}g=d.next;while(!(y=g.call(d)).done)if(v=c(d,b,y.value,l),"object"==typeof v&&v&&v instanceof u)return v;return new u(!1)};l.stop=function(e){return new u(!0,e)}},"23cb":function(e,t,n){var i=n("a691"),r=Math.max,o=Math.min;e.exports=function(e,t){var n=i(e);return n<0?r(n+t,0):o(n,t)}},"23e7":function(e,t,n){var i=n("da84"),r=n("06cf").f,o=n("9112"),a=n("6eeb"),s=n("ce4e"),c=n("e893"),u=n("94ca");e.exports=function(e,t){var n,l,p,d,f,h,m=e.target,v=e.global,g=e.stat;if(l=v?i:g?i[m]||s(m,{}):(i[m]||{}).prototype,l)for(p in t){if(f=t[p],e.noTargetGet?(h=r(l,p),d=h&&h.value):d=l[p],n=u(v?p:m+(g?".":"#")+p,e.forced),!n&&void 0!==d){if(typeof f===typeof d)continue;c(f,d)}(e.sham||d&&d.sham)&&o(f,"sham",!0),a(l,p,f,e)}}},"241c":function(e,t,n){var i=n("ca84"),r=n("7839"),o=r.concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return i(e,o)}},2532:function(e,t,n){"use strict";var i=n("23e7"),r=n("5a34"),o=n("1d80"),a=n("ab13");i({target:"String",proto:!0,forced:!a("includes")},{includes:function(e){return!!~String(o(this)).indexOf(r(e),arguments.length>1?arguments[1]:void 0)}})},"25f0":function(e,t,n){"use strict";var i=n("6eeb"),r=n("825a"),o=n("d039"),a=n("ad6d"),s="toString",c=RegExp.prototype,u=c[s],l=o((function(){return"/a/b"!=u.call({source:"a",flags:"b"})})),p=u.name!=s;(l||p)&&i(RegExp.prototype,s,(function(){var e=r(this),t=String(e.source),n=e.flags,i=String(void 0===n&&e instanceof RegExp&&!("flags"in c)?a.call(e):n);return"/"+t+"/"+i}),{unsafe:!0})},2626:function(e,t,n){"use strict";var i=n("d066"),r=n("9bf2"),o=n("b622"),a=n("83ab"),s=o("species");e.exports=function(e){var t=i(e),n=r.f;a&&t&&!t[s]&&n(t,s,{configurable:!0,get:function(){return this}})}},"2cf4":function(e,t,n){var i,r,o,a=n("da84"),s=n("d039"),c=n("c6b6"),u=n("0366"),l=n("1be4"),p=n("cc12"),d=n("1cdc"),f=a.location,h=a.setImmediate,m=a.clearImmediate,v=a.process,g=a.MessageChannel,y=a.Dispatch,b=0,x={},w="onreadystatechange",_=function(e){if(x.hasOwnProperty(e)){var t=x[e];delete x[e],t()}},E=function(e){return function(){_(e)}},C=function(e){_(e.data)},S=function(e){a.postMessage(e+"",f.protocol+"//"+f.host)};h&&m||(h=function(e){var t=[],n=1;while(arguments.length>n)t.push(arguments[n++]);return x[++b]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},i(b),b},m=function(e){delete x[e]},"process"==c(v)?i=function(e){v.nextTick(E(e))}:y&&y.now?i=function(e){y.now(E(e))}:g&&!d?(r=new g,o=r.port2,r.port1.onmessage=C,i=u(o.postMessage,o,1)):!a.addEventListener||"function"!=typeof postMessage||a.importScripts||s(S)||"file:"===f.protocol?i=w in p("script")?function(e){l.appendChild(p("script"))[w]=function(){l.removeChild(this),_(e)}}:function(e){setTimeout(E(e),0)}:(i=S,a.addEventListener("message",C,!1))),e.exports={set:h,clear:m}},"2d00":function(e,t,n){var i,r,o=n("da84"),a=n("342f"),s=o.process,c=s&&s.versions,u=c&&c.v8;u?(i=u.split("."),r=i[0]+i[1]):a&&(i=a.match(/Edge\/(\d+)/),(!i||i[1]>=74)&&(i=a.match(/Chrome\/(\d+)/),i&&(r=i[1]))),e.exports=r&&+r},"2e03":function(e,t,n){},"342f":function(e,t,n){var i=n("d066");e.exports=i("navigator","userAgent")||""},"35a1":function(e,t,n){var i=n("f5df"),r=n("3f8c"),o=n("b622"),a=o("iterator");e.exports=function(e){if(void 0!=e)return e[a]||e["@@iterator"]||r[i(e)]}},"37e8":function(e,t,n){var i=n("83ab"),r=n("9bf2"),o=n("825a"),a=n("df75");e.exports=i?Object.defineProperties:function(e,t){o(e);var n,i=a(t),s=i.length,c=0;while(s>c)r.f(e,n=i[c++],t[n]);return e}},"3bbe":function(e,t,n){var i=n("861d");e.exports=function(e){if(!i(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},"3ca3":function(e,t,n){"use strict";var i=n("6547").charAt,r=n("69f3"),o=n("7dd0"),a="String Iterator",s=r.set,c=r.getterFor(a);o(String,"String",(function(e){s(this,{type:a,string:String(e),index:0})}),(function(){var e,t=c(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=i(n,r),t.index+=e.length,{value:e,done:!1})}))},"3f8c":function(e,t){e.exports={}},4160:function(e,t,n){"use strict";var i=n("23e7"),r=n("17c2");i({target:"Array",proto:!0,forced:[].forEach!=r},{forEach:r})},"428f":function(e,t,n){var i=n("da84");e.exports=i},"44ad":function(e,t,n){var i=n("d039"),r=n("c6b6"),o="".split;e.exports=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==r(e)?o.call(e,""):Object(e)}:Object},"44d2":function(e,t,n){var i=n("b622"),r=n("7c73"),o=n("9bf2"),a=i("unscopables"),s=Array.prototype;void 0==s[a]&&o.f(s,a,{configurable:!0,value:r(null)}),e.exports=function(e){s[a][e]=!0}},"44de":function(e,t,n){var i=n("da84");e.exports=function(e,t){var n=i.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}},"44e7":function(e,t,n){var i=n("861d"),r=n("c6b6"),o=n("b622"),a=o("match");e.exports=function(e){var t;return i(e)&&(void 0!==(t=e[a])?!!t:"RegExp"==r(e))}},4840:function(e,t,n){var i=n("825a"),r=n("1c0b"),o=n("b622"),a=o("species");e.exports=function(e,t){var n,o=i(e).constructor;return void 0===o||void 0==(n=i(o)[a])?t:r(n)}},4930:function(e,t,n){var i=n("d039");e.exports=!!Object.getOwnPropertySymbols&&!i((function(){return!String(Symbol())}))},"4d64":function(e,t,n){var i=n("fc6a"),r=n("50c4"),o=n("23cb"),a=function(e){return function(t,n,a){var s,c=i(t),u=r(c.length),l=o(a,u);if(e&&n!=n){while(u>l)if(s=c[l++],s!=s)return!0}else for(;u>l;l++)if((e||l in c)&&c[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},"4de4":function(e,t,n){"use strict";var i=n("23e7"),r=n("b727").filter,o=n("1dde"),a=n("ae40"),s=o("filter"),c=a("filter");i({target:"Array",proto:!0,forced:!s||!c},{filter:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}})},"4df4":function(e,t,n){"use strict";var i=n("0366"),r=n("7b0b"),o=n("9bdd"),a=n("e95a"),s=n("50c4"),c=n("8418"),u=n("35a1");e.exports=function(e){var t,n,l,p,d,f,h=r(e),m="function"==typeof this?this:Array,v=arguments.length,g=v>1?arguments[1]:void 0,y=void 0!==g,b=u(h),x=0;if(y&&(g=i(g,v>2?arguments[2]:void 0,2)),void 0==b||m==Array&&a(b))for(t=s(h.length),n=new m(t);t>x;x++)f=y?g(h[x],x):h[x],c(n,x,f);else for(p=b.call(h),d=p.next,n=new m;!(l=d.call(p)).done;x++)f=y?o(p,g,[l.value,x],!0):l.value,c(n,x,f);return n.length=x,n}},"50c4":function(e,t,n){var i=n("a691"),r=Math.min;e.exports=function(e){return e>0?r(i(e),9007199254740991):0}},5135:function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},5319:function(e,t,n){"use strict";var i=n("d784"),r=n("825a"),o=n("7b0b"),a=n("50c4"),s=n("a691"),c=n("1d80"),u=n("8aa5"),l=n("14c3"),p=Math.max,d=Math.min,f=Math.floor,h=/\$([$&'`]|\d\d?|<[^>]*>)/g,m=/\$([$&'`]|\d\d?)/g,v=function(e){return void 0===e?e:String(e)};i("replace",2,(function(e,t,n,i){var g=i.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,y=i.REPLACE_KEEPS_$0,b=g?"$":"$0";return[function(n,i){var r=c(this),o=void 0==n?void 0:n[e];return void 0!==o?o.call(n,r,i):t.call(String(r),n,i)},function(e,i){if(!g&&y||"string"===typeof i&&-1===i.indexOf(b)){var o=n(t,e,this,i);if(o.done)return o.value}var c=r(e),f=String(this),h="function"===typeof i;h||(i=String(i));var m=c.global;if(m){var w=c.unicode;c.lastIndex=0}var _=[];while(1){var E=l(c,f);if(null===E)break;if(_.push(E),!m)break;var C=String(E[0]);""===C&&(c.lastIndex=u(f,a(c.lastIndex),w))}for(var S="",A=0,T=0;T<_.length;T++){E=_[T];for(var k=String(E[0]),R=p(d(s(E.index),f.length),0),P=[],D=1;D<E.length;D++)P.push(v(E[D]));var M=E.groups;if(h){var B=[k].concat(P,R,f);void 0!==M&&B.push(M);var O=String(i.apply(void 0,B))}else O=x(k,f,R,P,M,i);R>=A&&(S+=f.slice(A,R)+O,A=R+k.length)}return S+f.slice(A)}];function x(e,n,i,r,a,s){var c=i+e.length,u=r.length,l=m;return void 0!==a&&(a=o(a),l=h),t.call(s,l,(function(t,o){var s;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return n.slice(0,i);case"'":return n.slice(c);case"<":s=a[o.slice(1,-1)];break;default:var l=+o;if(0===l)return t;if(l>u){var p=f(l/10);return 0===p?t:p<=u?void 0===r[p-1]?o.charAt(1):r[p-1]+o.charAt(1):t}s=r[l-1]}return void 0===s?"":s}))}}))},5692:function(e,t,n){var i=n("c430"),r=n("c6cd");(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:i?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},"56ef":function(e,t,n){var i=n("d066"),r=n("241c"),o=n("7418"),a=n("825a");e.exports=i("Reflect","ownKeys")||function(e){var t=r.f(a(e)),n=o.f;return n?t.concat(n(e)):t}},"5a34":function(e,t,n){var i=n("44e7");e.exports=function(e){if(i(e))throw TypeError("The method doesn't accept regular expressions");return e}},"5c6c":function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"62e4":function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},6547:function(e,t,n){var i=n("a691"),r=n("1d80"),o=function(e){return function(t,n){var o,a,s=String(r(t)),c=i(n),u=s.length;return c<0||c>=u?e?"":void 0:(o=s.charCodeAt(c),o<55296||o>56319||c+1===u||(a=s.charCodeAt(c+1))<56320||a>57343?e?s.charAt(c):o:e?s.slice(c,c+2):a-56320+(o-55296<<10)+65536)}};e.exports={codeAt:o(!1),charAt:o(!0)}},"65f0":function(e,t,n){var i=n("861d"),r=n("e8b5"),o=n("b622"),a=o("species");e.exports=function(e,t){var n;return r(e)&&(n=e.constructor,"function"!=typeof n||n!==Array&&!r(n.prototype)?i(n)&&(n=n[a],null===n&&(n=void 0)):n=void 0),new(void 0===n?Array:n)(0===t?0:t)}},"69f3":function(e,t,n){var i,r,o,a=n("7f9a"),s=n("da84"),c=n("861d"),u=n("9112"),l=n("5135"),p=n("f772"),d=n("d012"),f=s.WeakMap,h=function(e){return o(e)?r(e):i(e,{})},m=function(e){return function(t){var n;if(!c(t)||(n=r(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}};if(a){var v=new f,g=v.get,y=v.has,b=v.set;i=function(e,t){return b.call(v,e,t),t},r=function(e){return g.call(v,e)||{}},o=function(e){return y.call(v,e)}}else{var x=p("state");d[x]=!0,i=function(e,t){return u(e,x,t),t},r=function(e){return l(e,x)?e[x]:{}},o=function(e){return l(e,x)}}e.exports={set:i,get:r,has:o,enforce:h,getterFor:m}},"6eeb":function(e,t,n){var i=n("da84"),r=n("9112"),o=n("5135"),a=n("ce4e"),s=n("8925"),c=n("69f3"),u=c.get,l=c.enforce,p=String(String).split("String");(e.exports=function(e,t,n,s){var c=!!s&&!!s.unsafe,u=!!s&&!!s.enumerable,d=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof t||o(n,"name")||r(n,"name",t),l(n).source=p.join("string"==typeof t?t:"")),e!==i?(c?!d&&e[t]&&(u=!0):delete e[t],u?e[t]=n:r(e,t,n)):u?e[t]=n:a(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&u(this).source||s(this)}))},7418:function(e,t){t.f=Object.getOwnPropertySymbols},"746f":function(e,t,n){var i=n("428f"),r=n("5135"),o=n("e538"),a=n("9bf2").f;e.exports=function(e){var t=i.Symbol||(i.Symbol={});r(t,e)||a(t,e,{value:o.f(e)})}},7839:function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(e,t,n){var i=n("1d80");e.exports=function(e){return Object(i(e))}},"7c73":function(e,t,n){var i,r=n("825a"),o=n("37e8"),a=n("7839"),s=n("d012"),c=n("1be4"),u=n("cc12"),l=n("f772"),p=">",d="<",f="prototype",h="script",m=l("IE_PROTO"),v=function(){},g=function(e){return d+h+p+e+d+"/"+h+p},y=function(e){e.write(g("")),e.close();var t=e.parentWindow.Object;return e=null,t},b=function(){var e,t=u("iframe"),n="java"+h+":";return t.style.display="none",c.appendChild(t),t.src=String(n),e=t.contentWindow.document,e.open(),e.write(g("document.F=Object")),e.close(),e.F},x=function(){try{i=document.domain&&new ActiveXObject("htmlfile")}catch(t){}x=i?y(i):b();var e=a.length;while(e--)delete x[f][a[e]];return x()};s[m]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(v[f]=r(e),n=new v,v[f]=null,n[m]=e):n=x(),void 0===t?n:o(n,t)}},"7dd0":function(e,t,n){"use strict";var i=n("23e7"),r=n("9ed3"),o=n("e163"),a=n("d2bb"),s=n("d44e"),c=n("9112"),u=n("6eeb"),l=n("b622"),p=n("c430"),d=n("3f8c"),f=n("ae93"),h=f.IteratorPrototype,m=f.BUGGY_SAFARI_ITERATORS,v=l("iterator"),g="keys",y="values",b="entries",x=function(){return this};e.exports=function(e,t,n,l,f,w,_){r(n,t,l);var E,C,S,A=function(e){if(e===f&&D)return D;if(!m&&e in R)return R[e];switch(e){case g:return function(){return new n(this,e)};case y:return function(){return new n(this,e)};case b:return function(){return new n(this,e)}}return function(){return new n(this)}},T=t+" Iterator",k=!1,R=e.prototype,P=R[v]||R["@@iterator"]||f&&R[f],D=!m&&P||A(f),M="Array"==t&&R.entries||P;if(M&&(E=o(M.call(new e)),h!==Object.prototype&&E.next&&(p||o(E)===h||(a?a(E,h):"function"!=typeof E[v]&&c(E,v,x)),s(E,T,!0,!0),p&&(d[T]=x))),f==y&&P&&P.name!==y&&(k=!0,D=function(){return P.call(this)}),p&&!_||R[v]===D||c(R,v,D),d[t]=D,f)if(C={values:A(y),keys:w?D:A(g),entries:A(b)},_)for(S in C)(m||k||!(S in R))&&u(R,S,C[S]);else i({target:t,proto:!0,forced:m||k},C);return C}},"7f9a":function(e,t,n){var i=n("da84"),r=n("8925"),o=i.WeakMap;e.exports="function"===typeof o&&/native code/.test(r(o))},"825a":function(e,t,n){var i=n("861d");e.exports=function(e){if(!i(e))throw TypeError(String(e)+" is not an object");return e}},"83ab":function(e,t,n){var i=n("d039");e.exports=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},8418:function(e,t,n){"use strict";var i=n("c04e"),r=n("9bf2"),o=n("5c6c");e.exports=function(e,t,n){var a=i(t);a in e?r.f(e,a,o(0,n)):e[a]=n}},"841c":function(e,t,n){"use strict";var i=n("d784"),r=n("825a"),o=n("1d80"),a=n("129f"),s=n("14c3");i("search",1,(function(e,t,n){return[function(t){var n=o(this),i=void 0==t?void 0:t[e];return void 0!==i?i.call(t,n):new RegExp(t)[e](String(n))},function(e){var i=n(t,e,this);if(i.done)return i.value;var o=r(e),c=String(this),u=o.lastIndex;a(u,0)||(o.lastIndex=0);var l=s(o,c);return a(o.lastIndex,u)||(o.lastIndex=u),null===l?-1:l.index}]}))},"861d":function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},8875:function(e,t,n){var i,r,o;(function(n,a){r=[],i=a,o="function"===typeof i?i.apply(t,r):i,void 0===o||(e.exports=o)})("undefined"!==typeof self&&self,(function(){function e(){var t=Object.getOwnPropertyDescriptor(document,"currentScript");if(!t&&"currentScript"in document&&document.currentScript)return document.currentScript;if(t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw new Error}catch(f){var n,i,r,o=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,a=/@([^@]*):(\d+):(\d+)\s*$/gi,s=o.exec(f.stack)||a.exec(f.stack),c=s&&s[1]||!1,u=s&&s[2]||!1,l=document.location.href.replace(document.location.hash,""),p=document.getElementsByTagName("script");c===l&&(n=document.documentElement.outerHTML,i=new RegExp("(?:[^\\n]+?\\n){0,"+(u-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),r=n.replace(i,"$1").trim());for(var d=0;d<p.length;d++){if("interactive"===p[d].readyState)return p[d];if(p[d].src===c)return p[d];if(c===l&&p[d].innerHTML&&p[d].innerHTML.trim()===r)return p[d]}return null}}return e}))},8925:function(e,t,n){var i=n("c6cd"),r=Function.toString;"function"!=typeof i.inspectSource&&(i.inspectSource=function(e){return r.call(e)}),e.exports=i.inspectSource},"8aa5":function(e,t,n){"use strict";var i=n("6547").charAt;e.exports=function(e,t,n){return t+(n?i(e,t).length:1)}},"90e3":function(e,t){var n=0,i=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+i).toString(36)}},9112:function(e,t,n){var i=n("83ab"),r=n("9bf2"),o=n("5c6c");e.exports=i?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},9263:function(e,t,n){"use strict";var i=n("ad6d"),r=n("9f7f"),o=RegExp.prototype.exec,a=String.prototype.replace,s=o,c=function(){var e=/a/,t=/b*/g;return o.call(e,"a"),o.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),u=r.UNSUPPORTED_Y||r.BROKEN_CARET,l=void 0!==/()??/.exec("")[1],p=c||l||u;p&&(s=function(e){var t,n,r,s,p=this,d=u&&p.sticky,f=i.call(p),h=p.source,m=0,v=e;return d&&(f=f.replace("y",""),-1===f.indexOf("g")&&(f+="g"),v=String(e).slice(p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&"\n"!==e[p.lastIndex-1])&&(h="(?: "+h+")",v=" "+v,m++),n=new RegExp("^(?:"+h+")",f)),l&&(n=new RegExp("^"+h+"$(?!\\s)",f)),c&&(t=p.lastIndex),r=o.call(d?n:p,v),d?r?(r.input=r.input.slice(m),r[0]=r[0].slice(m),r.index=p.lastIndex,p.lastIndex+=r[0].length):p.lastIndex=0:c&&r&&(p.lastIndex=p.global?r.index+r[0].length:t),l&&r&&r.length>1&&a.call(r[0],n,(function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(r[s]=void 0)})),r}),e.exports=s},"94ca":function(e,t,n){var i=n("d039"),r=/#|\.prototype\./,o=function(e,t){var n=s[a(e)];return n==u||n!=c&&("function"==typeof t?i(t):!!t)},a=o.normalize=function(e){return String(e).replace(r,".").toLowerCase()},s=o.data={},c=o.NATIVE="N",u=o.POLYFILL="P";e.exports=o},"9bdd":function(e,t,n){var i=n("825a");e.exports=function(e,t,n,r){try{return r?t(i(n)[0],n[1]):t(n)}catch(a){var o=e["return"];throw void 0!==o&&i(o.call(e)),a}}},"9bf2":function(e,t,n){var i=n("83ab"),r=n("0cfb"),o=n("825a"),a=n("c04e"),s=Object.defineProperty;t.f=i?s:function(e,t,n){if(o(e),t=a(t,!0),o(n),r)try{return s(e,t,n)}catch(i){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},"9ed3":function(e,t,n){"use strict";var i=n("ae93").IteratorPrototype,r=n("7c73"),o=n("5c6c"),a=n("d44e"),s=n("3f8c"),c=function(){return this};e.exports=function(e,t,n){var u=t+" Iterator";return e.prototype=r(i,{next:o(1,n)}),a(e,u,!1,!0),s[u]=c,e}},"9f7f":function(e,t,n){"use strict";var i=n("d039");function r(e,t){return RegExp(e,t)}t.UNSUPPORTED_Y=i((function(){var e=r("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),t.BROKEN_CARET=i((function(){var e=r("^r","gy");return e.lastIndex=2,null!=e.exec("str")}))},a434:function(e,t,n){"use strict";var i=n("23e7"),r=n("23cb"),o=n("a691"),a=n("50c4"),s=n("7b0b"),c=n("65f0"),u=n("8418"),l=n("1dde"),p=n("ae40"),d=l("splice"),f=p("splice",{ACCESSORS:!0,0:0,1:2}),h=Math.max,m=Math.min,v=9007199254740991,g="Maximum allowed length exceeded";i({target:"Array",proto:!0,forced:!d||!f},{splice:function(e,t){var n,i,l,p,d,f,y=s(this),b=a(y.length),x=r(e,b),w=arguments.length;if(0===w?n=i=0:1===w?(n=0,i=b-x):(n=w-2,i=m(h(o(t),0),b-x)),b+n-i>v)throw TypeError(g);for(l=c(y,i),p=0;p<i;p++)d=x+p,d in y&&u(l,p,y[d]);if(l.length=i,n<i){for(p=x;p<b-i;p++)d=p+i,f=p+n,d in y?y[f]=y[d]:delete y[f];for(p=b;p>b-i+n;p--)delete y[p-1]}else if(n>i)for(p=b-i;p>x;p--)d=p+i-1,f=p+n-1,d in y?y[f]=y[d]:delete y[f];for(p=0;p<n;p++)y[p+x]=arguments[p+2];return y.length=b-i+n,l}})},a480:function(e,t,n){},a4d3:function(e,t,n){"use strict";var i=n("23e7"),r=n("da84"),o=n("d066"),a=n("c430"),s=n("83ab"),c=n("4930"),u=n("fdbf"),l=n("d039"),p=n("5135"),d=n("e8b5"),f=n("861d"),h=n("825a"),m=n("7b0b"),v=n("fc6a"),g=n("c04e"),y=n("5c6c"),b=n("7c73"),x=n("df75"),w=n("241c"),_=n("057f"),E=n("7418"),C=n("06cf"),S=n("9bf2"),A=n("d1e7"),T=n("9112"),k=n("6eeb"),R=n("5692"),P=n("f772"),D=n("d012"),M=n("90e3"),B=n("b622"),O=n("e538"),j=n("746f"),N=n("d44e"),F=n("69f3"),I=n("b727").forEach,L=P("hidden"),z="Symbol",$="prototype",H=B("toPrimitive"),G=F.set,V=F.getterFor(z),W=Object[$],U=r.Symbol,q=o("JSON","stringify"),K=C.f,Y=S.f,X=_.f,Z=A.f,J=R("symbols"),Q=R("op-symbols"),ee=R("string-to-symbol-registry"),te=R("symbol-to-string-registry"),ne=R("wks"),ie=r.QObject,re=!ie||!ie[$]||!ie[$].findChild,oe=s&&l((function(){return 7!=b(Y({},"a",{get:function(){return Y(this,"a",{value:7}).a}})).a}))?function(e,t,n){var i=K(W,t);i&&delete W[t],Y(e,t,n),i&&e!==W&&Y(W,t,i)}:Y,ae=function(e,t){var n=J[e]=b(U[$]);return G(n,{type:z,tag:e,description:t}),s||(n.description=t),n},se=u?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof U},ce=function(e,t,n){e===W&&ce(Q,t,n),h(e);var i=g(t,!0);return h(n),p(J,i)?(n.enumerable?(p(e,L)&&e[L][i]&&(e[L][i]=!1),n=b(n,{enumerable:y(0,!1)})):(p(e,L)||Y(e,L,y(1,{})),e[L][i]=!0),oe(e,i,n)):Y(e,i,n)},ue=function(e,t){h(e);var n=v(t),i=x(n).concat(he(n));return I(i,(function(t){s&&!pe.call(n,t)||ce(e,t,n[t])})),e},le=function(e,t){return void 0===t?b(e):ue(b(e),t)},pe=function(e){var t=g(e,!0),n=Z.call(this,t);return!(this===W&&p(J,t)&&!p(Q,t))&&(!(n||!p(this,t)||!p(J,t)||p(this,L)&&this[L][t])||n)},de=function(e,t){var n=v(e),i=g(t,!0);if(n!==W||!p(J,i)||p(Q,i)){var r=K(n,i);return!r||!p(J,i)||p(n,L)&&n[L][i]||(r.enumerable=!0),r}},fe=function(e){var t=X(v(e)),n=[];return I(t,(function(e){p(J,e)||p(D,e)||n.push(e)})),n},he=function(e){var t=e===W,n=X(t?Q:v(e)),i=[];return I(n,(function(e){!p(J,e)||t&&!p(W,e)||i.push(J[e])})),i};if(c||(U=function(){if(this instanceof U)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=M(e),n=function(e){this===W&&n.call(Q,e),p(this,L)&&p(this[L],t)&&(this[L][t]=!1),oe(this,t,y(1,e))};return s&&re&&oe(W,t,{configurable:!0,set:n}),ae(t,e)},k(U[$],"toString",(function(){return V(this).tag})),k(U,"withoutSetter",(function(e){return ae(M(e),e)})),A.f=pe,S.f=ce,C.f=de,w.f=_.f=fe,E.f=he,O.f=function(e){return ae(B(e),e)},s&&(Y(U[$],"description",{configurable:!0,get:function(){return V(this).description}}),a||k(W,"propertyIsEnumerable",pe,{unsafe:!0}))),i({global:!0,wrap:!0,forced:!c,sham:!c},{Symbol:U}),I(x(ne),(function(e){j(e)})),i({target:z,stat:!0,forced:!c},{for:function(e){var t=String(e);if(p(ee,t))return ee[t];var n=U(t);return ee[t]=n,te[n]=t,n},keyFor:function(e){if(!se(e))throw TypeError(e+" is not a symbol");if(p(te,e))return te[e]},useSetter:function(){re=!0},useSimple:function(){re=!1}}),i({target:"Object",stat:!0,forced:!c,sham:!s},{create:le,defineProperty:ce,defineProperties:ue,getOwnPropertyDescriptor:de}),i({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:fe,getOwnPropertySymbols:he}),i({target:"Object",stat:!0,forced:l((function(){E.f(1)}))},{getOwnPropertySymbols:function(e){return E.f(m(e))}}),q){var me=!c||l((function(){var e=U();return"[null]"!=q([e])||"{}"!=q({a:e})||"{}"!=q(Object(e))}));i({target:"JSON",stat:!0,forced:me},{stringify:function(e,t,n){var i,r=[e],o=1;while(arguments.length>o)r.push(arguments[o++]);if(i=t,(f(t)||void 0!==e)&&!se(e))return d(t)||(t=function(e,t){if("function"==typeof i&&(t=i.call(this,e,t)),!se(t))return t}),r[1]=t,q.apply(null,r)}})}U[$][H]||T(U[$],H,U[$].valueOf),N(U,z),D[L]=!0},a630:function(e,t,n){var i=n("23e7"),r=n("4df4"),o=n("1c7e"),a=!o((function(e){Array.from(e)}));i({target:"Array",stat:!0,forced:a},{from:r})},a640:function(e,t,n){"use strict";var i=n("d039");e.exports=function(e,t){var n=[][e];return!!n&&i((function(){n.call(null,t||function(){throw 1},1)}))}},a657:function(e,t,n){},a691:function(e,t){var n=Math.ceil,i=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?i:n)(e)}},ab13:function(e,t,n){var i=n("b622"),r=i("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(i){}}return!1}},ac1f:function(e,t,n){"use strict";var i=n("23e7"),r=n("9263");i({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},ad6d:function(e,t,n){"use strict";var i=n("825a");e.exports=function(){var e=i(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},ae40:function(e,t,n){var i=n("83ab"),r=n("d039"),o=n("5135"),a=Object.defineProperty,s={},c=function(e){throw e};e.exports=function(e,t){if(o(s,e))return s[e];t||(t={});var n=[][e],u=!!o(t,"ACCESSORS")&&t.ACCESSORS,l=o(t,0)?t[0]:c,p=o(t,1)?t[1]:void 0;return s[e]=!!n&&!r((function(){if(u&&!i)return!0;var e={length:-1};u?a(e,1,{enumerable:!0,get:c}):e[1]=1,n.call(e,l,p)}))}},ae93:function(e,t,n){"use strict";var i,r,o,a=n("e163"),s=n("9112"),c=n("5135"),u=n("b622"),l=n("c430"),p=u("iterator"),d=!1,f=function(){return this};[].keys&&(o=[].keys(),"next"in o?(r=a(a(o)),r!==Object.prototype&&(i=r)):d=!0),void 0==i&&(i={}),l||c(i,p)||s(i,p,f),e.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:d}},b041:function(e,t,n){"use strict";var i=n("00ee"),r=n("f5df");e.exports=i?{}.toString:function(){return"[object "+r(this)+"]"}},b0c0:function(e,t,n){var i=n("83ab"),r=n("9bf2").f,o=Function.prototype,a=o.toString,s=/^\s*function ([^ (]*)/,c="name";i&&!(c in o)&&r(o,c,{configurable:!0,get:function(){try{return a.call(this).match(s)[1]}catch(e){return""}}})},b372:function(e,t,n){"use strict";var i=n("2e03"),r=n.n(i);r.a},b575:function(e,t,n){var i,r,o,a,s,c,u,l,p=n("da84"),d=n("06cf").f,f=n("c6b6"),h=n("2cf4").set,m=n("1cdc"),v=p.MutationObserver||p.WebKitMutationObserver,g=p.process,y=p.Promise,b="process"==f(g),x=d(p,"queueMicrotask"),w=x&&x.value;w||(i=function(){var e,t;b&&(e=g.domain)&&e.exit();while(r){t=r.fn,r=r.next;try{t()}catch(n){throw r?a():o=void 0,n}}o=void 0,e&&e.enter()},b?a=function(){g.nextTick(i)}:v&&!m?(s=!0,c=document.createTextNode(""),new v(i).observe(c,{characterData:!0}),a=function(){c.data=s=!s}):y&&y.resolve?(u=y.resolve(void 0),l=u.then,a=function(){l.call(u,i)}):a=function(){h.call(p,i)}),e.exports=w||function(e){var t={fn:e,next:void 0};o&&(o.next=t),r||(r=t,a()),o=t}},b622:function(e,t,n){var i=n("da84"),r=n("5692"),o=n("5135"),a=n("90e3"),s=n("4930"),c=n("fdbf"),u=r("wks"),l=i.Symbol,p=c?l:l&&l.withoutSetter||a;e.exports=function(e){return o(u,e)||(s&&o(l,e)?u[e]=l[e]:u[e]=p("Symbol."+e)),u[e]}},b64b:function(e,t,n){var i=n("23e7"),r=n("7b0b"),o=n("df75"),a=n("d039"),s=a((function(){o(1)}));i({target:"Object",stat:!0,forced:s},{keys:function(e){return o(r(e))}})},b727:function(e,t,n){var i=n("0366"),r=n("44ad"),o=n("7b0b"),a=n("50c4"),s=n("65f0"),c=[].push,u=function(e){var t=1==e,n=2==e,u=3==e,l=4==e,p=6==e,d=5==e||p;return function(f,h,m,v){for(var g,y,b=o(f),x=r(b),w=i(h,m,3),_=a(x.length),E=0,C=v||s,S=t?C(f,_):n?C(f,0):void 0;_>E;E++)if((d||E in x)&&(g=x[E],y=w(g,E,b),e))if(t)S[E]=y;else if(y)switch(e){case 3:return!0;case 5:return g;case 6:return E;case 2:c.call(S,g)}else if(l)return!1;return p?-1:u||l?l:S}};e.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6)}},be52:function(e,t,n){"use strict";var i=n("a657"),r=n.n(i);r.a},c04e:function(e,t,n){var i=n("861d");e.exports=function(e,t){if(!i(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!i(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!i(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!i(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},c430:function(e,t){e.exports=!1},c6b6:function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},c6cd:function(e,t,n){var i=n("da84"),r=n("ce4e"),o="__core-js_shared__",a=i[o]||r(o,{});e.exports=a},c8ba:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(i){"object"===typeof window&&(n=window)}e.exports=n},ca84:function(e,t,n){var i=n("5135"),r=n("fc6a"),o=n("4d64").indexOf,a=n("d012");e.exports=function(e,t){var n,s=r(e),c=0,u=[];for(n in s)!i(a,n)&&i(s,n)&&u.push(n);while(t.length>c)i(s,n=t[c++])&&(~o(u,n)||u.push(n));return u}},caad:function(e,t,n){"use strict";var i=n("23e7"),r=n("4d64").includes,o=n("44d2"),a=n("ae40"),s=a("indexOf",{ACCESSORS:!0,1:0});i({target:"Array",proto:!0,forced:!s},{includes:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}}),o("includes")},cc12:function(e,t,n){var i=n("da84"),r=n("861d"),o=i.document,a=r(o)&&r(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},cd3f:function(e,t,n){(function(e,n){var i=200,r="__lodash_hash_undefined__",o=9007199254740991,a="[object Arguments]",s="[object Array]",c="[object Boolean]",u="[object Date]",l="[object Error]",p="[object Function]",d="[object GeneratorFunction]",f="[object Map]",h="[object Number]",m="[object Object]",v="[object Promise]",g="[object RegExp]",y="[object Set]",b="[object String]",x="[object Symbol]",w="[object WeakMap]",_="[object ArrayBuffer]",E="[object DataView]",C="[object Float32Array]",S="[object Float64Array]",A="[object Int8Array]",T="[object Int16Array]",k="[object Int32Array]",R="[object Uint8Array]",P="[object Uint8ClampedArray]",D="[object Uint16Array]",M="[object Uint32Array]",B=/[\\^$.*+?()[\]{}|]/g,O=/\w*$/,j=/^\[object .+?Constructor\]$/,N=/^(?:0|[1-9]\d*)$/,F={};F[a]=F[s]=F[_]=F[E]=F[c]=F[u]=F[C]=F[S]=F[A]=F[T]=F[k]=F[f]=F[h]=F[m]=F[g]=F[y]=F[b]=F[x]=F[R]=F[P]=F[D]=F[M]=!0,F[l]=F[p]=F[w]=!1;var I="object"==typeof e&&e&&e.Object===Object&&e,L="object"==typeof self&&self&&self.Object===Object&&self,z=I||L||Function("return this")(),$=t&&!t.nodeType&&t,H=$&&"object"==typeof n&&n&&!n.nodeType&&n,G=H&&H.exports===$;function V(e,t){return e.set(t[0],t[1]),e}function W(e,t){return e.add(t),e}function U(e,t){var n=-1,i=e?e.length:0;while(++n<i)if(!1===t(e[n],n,e))break;return e}function q(e,t){var n=-1,i=t.length,r=e.length;while(++n<i)e[r+n]=t[n];return e}function K(e,t,n,i){var r=-1,o=e?e.length:0;i&&o&&(n=e[++r]);while(++r<o)n=t(n,e[r],r,e);return n}function Y(e,t){var n=-1,i=Array(e);while(++n<e)i[n]=t(n);return i}function X(e,t){return null==e?void 0:e[t]}function Z(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(n){}return t}function J(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n}function Q(e,t){return function(n){return e(t(n))}}function ee(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var te=Array.prototype,ne=Function.prototype,ie=Object.prototype,re=z["__core-js_shared__"],oe=function(){var e=/[^.]+$/.exec(re&&re.keys&&re.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),ae=ne.toString,se=ie.hasOwnProperty,ce=ie.toString,ue=RegExp("^"+ae.call(se).replace(B,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),le=G?z.Buffer:void 0,pe=z.Symbol,de=z.Uint8Array,fe=Q(Object.getPrototypeOf,Object),he=Object.create,me=ie.propertyIsEnumerable,ve=te.splice,ge=Object.getOwnPropertySymbols,ye=le?le.isBuffer:void 0,be=Q(Object.keys,Object),xe=At(z,"DataView"),we=At(z,"Map"),_e=At(z,"Promise"),Ee=At(z,"Set"),Ce=At(z,"WeakMap"),Se=At(Object,"create"),Ae=Nt(xe),Te=Nt(we),ke=Nt(_e),Re=Nt(Ee),Pe=Nt(Ce),De=pe?pe.prototype:void 0,Me=De?De.valueOf:void 0;function Be(e){var t=-1,n=e?e.length:0;this.clear();while(++t<n){var i=e[t];this.set(i[0],i[1])}}function Oe(){this.__data__=Se?Se(null):{}}function je(e){return this.has(e)&&delete this.__data__[e]}function Ne(e){var t=this.__data__;if(Se){var n=t[e];return n===r?void 0:n}return se.call(t,e)?t[e]:void 0}function Fe(e){var t=this.__data__;return Se?void 0!==t[e]:se.call(t,e)}function Ie(e,t){var n=this.__data__;return n[e]=Se&&void 0===t?r:t,this}function Le(e){var t=-1,n=e?e.length:0;this.clear();while(++t<n){var i=e[t];this.set(i[0],i[1])}}function ze(){this.__data__=[]}function $e(e){var t=this.__data__,n=ot(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():ve.call(t,n,1),!0}function He(e){var t=this.__data__,n=ot(t,e);return n<0?void 0:t[n][1]}function Ge(e){return ot(this.__data__,e)>-1}function Ve(e,t){var n=this.__data__,i=ot(n,e);return i<0?n.push([e,t]):n[i][1]=t,this}function We(e){var t=-1,n=e?e.length:0;this.clear();while(++t<n){var i=e[t];this.set(i[0],i[1])}}function Ue(){this.__data__={hash:new Be,map:new(we||Le),string:new Be}}function qe(e){return St(this,e)["delete"](e)}function Ke(e){return St(this,e).get(e)}function Ye(e){return St(this,e).has(e)}function Xe(e,t){return St(this,e).set(e,t),this}function Ze(e){this.__data__=new Le(e)}function Je(){this.__data__=new Le}function Qe(e){return this.__data__["delete"](e)}function et(e){return this.__data__.get(e)}function tt(e){return this.__data__.has(e)}function nt(e,t){var n=this.__data__;if(n instanceof Le){var r=n.__data__;if(!we||r.length<i-1)return r.push([e,t]),this;n=this.__data__=new We(r)}return n.set(e,t),this}function it(e,t){var n=zt(e)||Lt(e)?Y(e.length,String):[],i=n.length,r=!!i;for(var o in e)!t&&!se.call(e,o)||r&&("length"==o||Mt(o,i))||n.push(o);return n}function rt(e,t,n){var i=e[t];se.call(e,t)&&It(i,n)&&(void 0!==n||t in e)||(e[t]=n)}function ot(e,t){var n=e.length;while(n--)if(It(e[n][0],t))return n;return-1}function at(e,t){return e&&_t(t,Kt(t),e)}function st(e,t,n,i,r,o,s){var c;if(i&&(c=o?i(e,r,o,s):i(e)),void 0!==c)return c;if(!Ut(e))return e;var u=zt(e);if(u){if(c=Rt(e),!t)return wt(e,c)}else{var l=kt(e),f=l==p||l==d;if(Gt(e))return ft(e,t);if(l==m||l==a||f&&!o){if(Z(e))return o?e:{};if(c=Pt(f?{}:e),!t)return Et(e,at(c,e))}else{if(!F[l])return o?e:{};c=Dt(e,l,st,t)}}s||(s=new Ze);var h=s.get(e);if(h)return h;if(s.set(e,c),!u)var v=n?Ct(e):Kt(e);return U(v||e,(function(r,o){v&&(o=r,r=e[o]),rt(c,o,st(r,t,n,i,o,e,s))})),c}function ct(e){return Ut(e)?he(e):{}}function ut(e,t,n){var i=t(e);return zt(e)?i:q(i,n(e))}function lt(e){return ce.call(e)}function pt(e){if(!Ut(e)||Ot(e))return!1;var t=Vt(e)||Z(e)?ue:j;return t.test(Nt(e))}function dt(e){if(!jt(e))return be(e);var t=[];for(var n in Object(e))se.call(e,n)&&"constructor"!=n&&t.push(n);return t}function ft(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}function ht(e){var t=new e.constructor(e.byteLength);return new de(t).set(new de(e)),t}function mt(e,t){var n=t?ht(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function vt(e,t,n){var i=t?n(J(e),!0):J(e);return K(i,V,new e.constructor)}function gt(e){var t=new e.constructor(e.source,O.exec(e));return t.lastIndex=e.lastIndex,t}function yt(e,t,n){var i=t?n(ee(e),!0):ee(e);return K(i,W,new e.constructor)}function bt(e){return Me?Object(Me.call(e)):{}}function xt(e,t){var n=t?ht(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function wt(e,t){var n=-1,i=e.length;t||(t=Array(i));while(++n<i)t[n]=e[n];return t}function _t(e,t,n,i){n||(n={});var r=-1,o=t.length;while(++r<o){var a=t[r],s=i?i(n[a],e[a],a,n,e):void 0;rt(n,a,void 0===s?e[a]:s)}return n}function Et(e,t){return _t(e,Tt(e),t)}function Ct(e){return ut(e,Kt,Tt)}function St(e,t){var n=e.__data__;return Bt(t)?n["string"==typeof t?"string":"hash"]:n.map}function At(e,t){var n=X(e,t);return pt(n)?n:void 0}Be.prototype.clear=Oe,Be.prototype["delete"]=je,Be.prototype.get=Ne,Be.prototype.has=Fe,Be.prototype.set=Ie,Le.prototype.clear=ze,Le.prototype["delete"]=$e,Le.prototype.get=He,Le.prototype.has=Ge,Le.prototype.set=Ve,We.prototype.clear=Ue,We.prototype["delete"]=qe,We.prototype.get=Ke,We.prototype.has=Ye,We.prototype.set=Xe,Ze.prototype.clear=Je,Ze.prototype["delete"]=Qe,Ze.prototype.get=et,Ze.prototype.has=tt,Ze.prototype.set=nt;var Tt=ge?Q(ge,Object):Yt,kt=lt;function Rt(e){var t=e.length,n=e.constructor(t);return t&&"string"==typeof e[0]&&se.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function Pt(e){return"function"!=typeof e.constructor||jt(e)?{}:ct(fe(e))}function Dt(e,t,n,i){var r=e.constructor;switch(t){case _:return ht(e);case c:case u:return new r(+e);case E:return mt(e,i);case C:case S:case A:case T:case k:case R:case P:case D:case M:return xt(e,i);case f:return vt(e,i,n);case h:case b:return new r(e);case g:return gt(e);case y:return yt(e,i,n);case x:return bt(e)}}function Mt(e,t){return t=null==t?o:t,!!t&&("number"==typeof e||N.test(e))&&e>-1&&e%1==0&&e<t}function Bt(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function Ot(e){return!!oe&&oe in e}function jt(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||ie;return e===n}function Nt(e){if(null!=e){try{return ae.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Ft(e){return st(e,!0,!0)}function It(e,t){return e===t||e!==e&&t!==t}function Lt(e){return Ht(e)&&se.call(e,"callee")&&(!me.call(e,"callee")||ce.call(e)==a)}(xe&&kt(new xe(new ArrayBuffer(1)))!=E||we&&kt(new we)!=f||_e&&kt(_e.resolve())!=v||Ee&&kt(new Ee)!=y||Ce&&kt(new Ce)!=w)&&(kt=function(e){var t=ce.call(e),n=t==m?e.constructor:void 0,i=n?Nt(n):void 0;if(i)switch(i){case Ae:return E;case Te:return f;case ke:return v;case Re:return y;case Pe:return w}return t});var zt=Array.isArray;function $t(e){return null!=e&&Wt(e.length)&&!Vt(e)}function Ht(e){return qt(e)&&$t(e)}var Gt=ye||Xt;function Vt(e){var t=Ut(e)?ce.call(e):"";return t==p||t==d}function Wt(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function Ut(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function qt(e){return!!e&&"object"==typeof e}function Kt(e){return $t(e)?it(e):dt(e)}function Yt(){return[]}function Xt(){return!1}n.exports=Ft}).call(this,n("c8ba"),n("62e4")(e))},cdf9:function(e,t,n){var i=n("825a"),r=n("861d"),o=n("f069");e.exports=function(e,t){if(i(e),r(t)&&t.constructor===e)return t;var n=o.f(e),a=n.resolve;return a(t),n.promise}},ce4e:function(e,t,n){var i=n("da84"),r=n("9112");e.exports=function(e,t){try{r(i,e,t)}catch(n){i[e]=t}return t}},d012:function(e,t){e.exports={}},d039:function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},d066:function(e,t,n){var i=n("428f"),r=n("da84"),o=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?o(i[e])||o(r[e]):i[e]&&i[e][t]||r[e]&&r[e][t]}},d1e7:function(e,t,n){"use strict";var i={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!i.call({1:2},1);t.f=o?function(e){var t=r(this,e);return!!t&&t.enumerable}:i},d28b:function(e,t,n){var i=n("746f");i("iterator")},d2bb:function(e,t,n){var i=n("825a"),r=n("3bbe");e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,e.call(n,[]),t=n instanceof Array}catch(o){}return function(n,o){return i(n),r(o),t?e.call(n,o):n.__proto__=o,n}}():void 0)},d3b7:function(e,t,n){var i=n("00ee"),r=n("6eeb"),o=n("b041");i||r(Object.prototype,"toString",o,{unsafe:!0})},d44e:function(e,t,n){var i=n("9bf2").f,r=n("5135"),o=n("b622"),a=o("toStringTag");e.exports=function(e,t,n){e&&!r(e=n?e:e.prototype,a)&&i(e,a,{configurable:!0,value:t})}},d784:function(e,t,n){"use strict";n("ac1f");var i=n("6eeb"),r=n("d039"),o=n("b622"),a=n("9263"),s=n("9112"),c=o("species"),u=!r((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),l=function(){return"$0"==="a".replace(/./,"$0")}(),p=o("replace"),d=function(){return!!/./[p]&&""===/./[p]("a","$0")}(),f=!r((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));e.exports=function(e,t,n,p){var h=o(e),m=!r((function(){var t={};return t[h]=function(){return 7},7!=""[e](t)})),v=m&&!r((function(){var t=!1,n=/a/;return"split"===e&&(n={},n.constructor={},n.constructor[c]=function(){return n},n.flags="",n[h]=/./[h]),n.exec=function(){return t=!0,null},n[h](""),!t}));if(!m||!v||"replace"===e&&(!u||!l||d)||"split"===e&&!f){var g=/./[h],y=n(h,""[e],(function(e,t,n,i,r){return t.exec===a?m&&!r?{done:!0,value:g.call(t,n,i)}:{done:!0,value:e.call(n,t,i)}:{done:!1}}),{REPLACE_KEEPS_$0:l,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:d}),b=y[0],x=y[1];i(String.prototype,e,b),i(RegExp.prototype,h,2==t?function(e,t){return x.call(e,this,t)}:function(e){return x.call(e,this)})}p&&s(RegExp.prototype[h],"sham",!0)}},d81d:function(e,t,n){"use strict";var i=n("23e7"),r=n("b727").map,o=n("1dde"),a=n("ae40"),s=o("map"),c=a("map");i({target:"Array",proto:!0,forced:!s||!c},{map:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}})},da81:function(e,t,n){(function(e,n){var i=200,r="__lodash_hash_undefined__",o=800,a=16,s=9007199254740991,c="[object Arguments]",u="[object Array]",l="[object AsyncFunction]",p="[object Boolean]",d="[object Date]",f="[object Error]",h="[object Function]",m="[object GeneratorFunction]",v="[object Map]",g="[object Number]",y="[object Null]",b="[object Object]",x="[object Proxy]",w="[object RegExp]",_="[object Set]",E="[object String]",C="[object Undefined]",S="[object WeakMap]",A="[object ArrayBuffer]",T="[object DataView]",k="[object Float32Array]",R="[object Float64Array]",P="[object Int8Array]",D="[object Int16Array]",M="[object Int32Array]",B="[object Uint8Array]",O="[object Uint8ClampedArray]",j="[object Uint16Array]",N="[object Uint32Array]",F=/[\\^$.*+?()[\]{}|]/g,I=/^\[object .+?Constructor\]$/,L=/^(?:0|[1-9]\d*)$/,z={};z[k]=z[R]=z[P]=z[D]=z[M]=z[B]=z[O]=z[j]=z[N]=!0,z[c]=z[u]=z[A]=z[p]=z[T]=z[d]=z[f]=z[h]=z[v]=z[g]=z[b]=z[w]=z[_]=z[E]=z[S]=!1;var $="object"==typeof e&&e&&e.Object===Object&&e,H="object"==typeof self&&self&&self.Object===Object&&self,G=$||H||Function("return this")(),V=t&&!t.nodeType&&t,W=V&&"object"==typeof n&&n&&!n.nodeType&&n,U=W&&W.exports===V,q=U&&$.process,K=function(){try{var e=W&&W.require&&W.require("util").types;return e||q&&q.binding&&q.binding("util")}catch(t){}}(),Y=K&&K.isTypedArray;function X(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Z(e,t){var n=-1,i=Array(e);while(++n<e)i[n]=t(n);return i}function J(e){return function(t){return e(t)}}function Q(e,t){return null==e?void 0:e[t]}function ee(e,t){return function(n){return e(t(n))}}var te=Array.prototype,ne=Function.prototype,ie=Object.prototype,re=G["__core-js_shared__"],oe=ne.toString,ae=ie.hasOwnProperty,se=function(){var e=/[^.]+$/.exec(re&&re.keys&&re.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),ce=ie.toString,ue=oe.call(Object),le=RegExp("^"+oe.call(ae).replace(F,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pe=U?G.Buffer:void 0,de=G.Symbol,fe=G.Uint8Array,he=pe?pe.allocUnsafe:void 0,me=ee(Object.getPrototypeOf,Object),ve=Object.create,ge=ie.propertyIsEnumerable,ye=te.splice,be=de?de.toStringTag:void 0,xe=function(){try{var e=xt(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),we=pe?pe.isBuffer:void 0,_e=Math.max,Ee=Date.now,Ce=xt(G,"Map"),Se=xt(Object,"create"),Ae=function(){function e(){}return function(t){if(!Gt(t))return{};if(ve)return ve(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Te(e){var t=-1,n=null==e?0:e.length;this.clear();while(++t<n){var i=e[t];this.set(i[0],i[1])}}function ke(){this.__data__=Se?Se(null):{},this.size=0}function Re(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Pe(e){var t=this.__data__;if(Se){var n=t[e];return n===r?void 0:n}return ae.call(t,e)?t[e]:void 0}function De(e){var t=this.__data__;return Se?void 0!==t[e]:ae.call(t,e)}function Me(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Se&&void 0===t?r:t,this}function Be(e){var t=-1,n=null==e?0:e.length;this.clear();while(++t<n){var i=e[t];this.set(i[0],i[1])}}function Oe(){this.__data__=[],this.size=0}function je(e){var t=this.__data__,n=et(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():ye.call(t,n,1),--this.size,!0}function Ne(e){var t=this.__data__,n=et(t,e);return n<0?void 0:t[n][1]}function Fe(e){return et(this.__data__,e)>-1}function Ie(e,t){var n=this.__data__,i=et(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}function Le(e){var t=-1,n=null==e?0:e.length;this.clear();while(++t<n){var i=e[t];this.set(i[0],i[1])}}function ze(){this.size=0,this.__data__={hash:new Te,map:new(Ce||Be),string:new Te}}function $e(e){var t=bt(this,e)["delete"](e);return this.size-=t?1:0,t}function He(e){return bt(this,e).get(e)}function Ge(e){return bt(this,e).has(e)}function Ve(e,t){var n=bt(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}function We(e){var t=this.__data__=new Be(e);this.size=t.size}function Ue(){this.__data__=new Be,this.size=0}function qe(e){var t=this.__data__,n=t["delete"](e);return this.size=t.size,n}function Ke(e){return this.__data__.get(e)}function Ye(e){return this.__data__.has(e)}function Xe(e,t){var n=this.__data__;if(n instanceof Be){var r=n.__data__;if(!Ce||r.length<i-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Le(r)}return n.set(e,t),this.size=n.size,this}function Ze(e,t){var n=Ft(e),i=!n&&Nt(e),r=!n&&!i&&zt(e),o=!n&&!i&&!r&&Ut(e),a=n||i||r||o,s=a?Z(e.length,String):[],c=s.length;for(var u in e)!t&&!ae.call(e,u)||a&&("length"==u||r&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Et(u,c))||s.push(u);return s}function Je(e,t,n){(void 0!==n&&!jt(e[t],n)||void 0===n&&!(t in e))&&tt(e,t,n)}function Qe(e,t,n){var i=e[t];ae.call(e,t)&&jt(i,n)&&(void 0!==n||t in e)||tt(e,t,n)}function et(e,t){var n=e.length;while(n--)if(jt(e[n][0],t))return n;return-1}function tt(e,t,n){"__proto__"==t&&xe?xe(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}Te.prototype.clear=ke,Te.prototype["delete"]=Re,Te.prototype.get=Pe,Te.prototype.has=De,Te.prototype.set=Me,Be.prototype.clear=Oe,Be.prototype["delete"]=je,Be.prototype.get=Ne,Be.prototype.has=Fe,Be.prototype.set=Ie,Le.prototype.clear=ze,Le.prototype["delete"]=$e,Le.prototype.get=He,Le.prototype.has=Ge,Le.prototype.set=Ve,We.prototype.clear=Ue,We.prototype["delete"]=qe,We.prototype.get=Ke,We.prototype.has=Ye,We.prototype.set=Xe;var nt=yt();function it(e){return null==e?void 0===e?C:y:be&&be in Object(e)?wt(e):Rt(e)}function rt(e){return Vt(e)&&it(e)==c}function ot(e){if(!Gt(e)||At(e))return!1;var t=$t(e)?le:I;return t.test(Ot(e))}function at(e){return Vt(e)&&Ht(e.length)&&!!z[it(e)]}function st(e){if(!Gt(e))return kt(e);var t=Tt(e),n=[];for(var i in e)("constructor"!=i||!t&&ae.call(e,i))&&n.push(i);return n}function ct(e,t,n,i,r){e!==t&&nt(t,(function(o,a){if(r||(r=new We),Gt(o))ut(e,t,a,n,ct,i,r);else{var s=i?i(Dt(e,a),o,a+"",e,t,r):void 0;void 0===s&&(s=o),Je(e,a,s)}}),Kt)}function ut(e,t,n,i,r,o,a){var s=Dt(e,n),c=Dt(t,n),u=a.get(c);if(u)Je(e,n,u);else{var l=o?o(s,c,n+"",e,t,a):void 0,p=void 0===l;if(p){var d=Ft(c),f=!d&&zt(c),h=!d&&!f&&Ut(c);l=c,d||f||h?Ft(s)?l=s:Lt(s)?l=mt(s):f?(p=!1,l=dt(c,!0)):h?(p=!1,l=ht(c,!0)):l=[]:Wt(c)||Nt(c)?(l=s,Nt(s)?l=qt(s):Gt(s)&&!$t(s)||(l=_t(c))):p=!1}p&&(a.set(c,l),r(l,c,i,o,a),a["delete"](c)),Je(e,n,l)}}function lt(e,t){return Mt(Pt(e,t,Zt),e+"")}var pt=xe?function(e,t){return xe(e,"toString",{configurable:!0,enumerable:!1,value:Xt(t),writable:!0})}:Zt;function dt(e,t){if(t)return e.slice();var n=e.length,i=he?he(n):new e.constructor(n);return e.copy(i),i}function ft(e){var t=new e.constructor(e.byteLength);return new fe(t).set(new fe(e)),t}function ht(e,t){var n=t?ft(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function mt(e,t){var n=-1,i=e.length;t||(t=Array(i));while(++n<i)t[n]=e[n];return t}function vt(e,t,n,i){var r=!n;n||(n={});var o=-1,a=t.length;while(++o<a){var s=t[o],c=i?i(n[s],e[s],s,n,e):void 0;void 0===c&&(c=e[s]),r?tt(n,s,c):Qe(n,s,c)}return n}function gt(e){return lt((function(t,n){var i=-1,r=n.length,o=r>1?n[r-1]:void 0,a=r>2?n[2]:void 0;o=e.length>3&&"function"==typeof o?(r--,o):void 0,a&&Ct(n[0],n[1],a)&&(o=r<3?void 0:o,r=1),t=Object(t);while(++i<r){var s=n[i];s&&e(t,s,i,o)}return t}))}function yt(e){return function(t,n,i){var r=-1,o=Object(t),a=i(t),s=a.length;while(s--){var c=a[e?s:++r];if(!1===n(o[c],c,o))break}return t}}function bt(e,t){var n=e.__data__;return St(t)?n["string"==typeof t?"string":"hash"]:n.map}function xt(e,t){var n=Q(e,t);return ot(n)?n:void 0}function wt(e){var t=ae.call(e,be),n=e[be];try{e[be]=void 0;var i=!0}catch(o){}var r=ce.call(e);return i&&(t?e[be]=n:delete e[be]),r}function _t(e){return"function"!=typeof e.constructor||Tt(e)?{}:Ae(me(e))}function Et(e,t){var n=typeof e;return t=null==t?s:t,!!t&&("number"==n||"symbol"!=n&&L.test(e))&&e>-1&&e%1==0&&e<t}function Ct(e,t,n){if(!Gt(n))return!1;var i=typeof t;return!!("number"==i?It(n)&&Et(t,n.length):"string"==i&&t in n)&&jt(n[t],e)}function St(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function At(e){return!!se&&se in e}function Tt(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||ie;return e===n}function kt(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}function Rt(e){return ce.call(e)}function Pt(e,t,n){return t=_e(void 0===t?e.length-1:t,0),function(){var i=arguments,r=-1,o=_e(i.length-t,0),a=Array(o);while(++r<o)a[r]=i[t+r];r=-1;var s=Array(t+1);while(++r<t)s[r]=i[r];return s[t]=n(a),X(e,this,s)}}function Dt(e,t){if(("constructor"!==t||"function"!==typeof e[t])&&"__proto__"!=t)return e[t]}var Mt=Bt(pt);function Bt(e){var t=0,n=0;return function(){var i=Ee(),r=a-(i-n);if(n=i,r>0){if(++t>=o)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Ot(e){if(null!=e){try{return oe.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function jt(e,t){return e===t||e!==e&&t!==t}var Nt=rt(function(){return arguments}())?rt:function(e){return Vt(e)&&ae.call(e,"callee")&&!ge.call(e,"callee")},Ft=Array.isArray;function It(e){return null!=e&&Ht(e.length)&&!$t(e)}function Lt(e){return Vt(e)&&It(e)}var zt=we||Jt;function $t(e){if(!Gt(e))return!1;var t=it(e);return t==h||t==m||t==l||t==x}function Ht(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function Gt(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Vt(e){return null!=e&&"object"==typeof e}function Wt(e){if(!Vt(e)||it(e)!=b)return!1;var t=me(e);if(null===t)return!0;var n=ae.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&oe.call(n)==ue}var Ut=Y?J(Y):at;function qt(e){return vt(e,Kt(e))}function Kt(e){return It(e)?Ze(e,!0):st(e)}var Yt=gt((function(e,t,n){ct(e,t,n)}));function Xt(e){return function(){return e}}function Zt(e){return e}function Jt(){return!1}n.exports=Yt}).call(this,n("c8ba"),n("62e4")(e))},da84:function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||Function("return this")()}).call(this,n("c8ba"))},ddb0:function(e,t,n){var i=n("da84"),r=n("fdbc"),o=n("e260"),a=n("9112"),s=n("b622"),c=s("iterator"),u=s("toStringTag"),l=o.values;for(var p in r){var d=i[p],f=d&&d.prototype;if(f){if(f[c]!==l)try{a(f,c,l)}catch(m){f[c]=l}if(f[u]||a(f,u,p),r[p])for(var h in o)if(f[h]!==o[h])try{a(f,h,o[h])}catch(m){f[h]=o[h]}}}},df75:function(e,t,n){var i=n("ca84"),r=n("7839");e.exports=Object.keys||function(e){return i(e,r)}},e01a:function(e,t,n){"use strict";var i=n("23e7"),r=n("83ab"),o=n("da84"),a=n("5135"),s=n("861d"),c=n("9bf2").f,u=n("e893"),l=o.Symbol;if(r&&"function"==typeof l&&(!("description"in l.prototype)||void 0!==l().description)){var p={},d=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof d?new l(e):void 0===e?l():l(e);return""===e&&(p[t]=!0),t};u(d,l);var f=d.prototype=l.prototype;f.constructor=d;var h=f.toString,m="Symbol(test)"==String(l("test")),v=/^Symbol\((.*)\)[^)]+$/;c(f,"description",{configurable:!0,get:function(){var e=s(this)?this.valueOf():this,t=h.call(e);if(a(p,e))return"";var n=m?t.slice(7,-1):t.replace(v,"$1");return""===n?void 0:n}}),i({global:!0,forced:!0},{Symbol:d})}},e163:function(e,t,n){var i=n("5135"),r=n("7b0b"),o=n("f772"),a=n("e177"),s=o("IE_PROTO"),c=Object.prototype;e.exports=a?Object.getPrototypeOf:function(e){return e=r(e),i(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?c:null}},e177:function(e,t,n){var i=n("d039");e.exports=!i((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},e260:function(e,t,n){"use strict";var i=n("fc6a"),r=n("44d2"),o=n("3f8c"),a=n("69f3"),s=n("7dd0"),c="Array Iterator",u=a.set,l=a.getterFor(c);e.exports=s(Array,"Array",(function(e,t){u(this,{type:c,target:i(e),index:0,kind:t})}),(function(){var e=l(this),t=e.target,n=e.kind,i=e.index++;return!t||i>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:i,done:!1}:"values"==n?{value:t[i],done:!1}:{value:[i,t[i]],done:!1}}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},e2cc:function(e,t,n){var i=n("6eeb");e.exports=function(e,t,n){for(var r in t)i(e,r,t[r],n);return e}},e538:function(e,t,n){var i=n("b622");t.f=i},e667:function(e,t){e.exports=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}}},e6cf:function(e,t,n){"use strict";var i,r,o,a,s=n("23e7"),c=n("c430"),u=n("da84"),l=n("d066"),p=n("fea9"),d=n("6eeb"),f=n("e2cc"),h=n("d44e"),m=n("2626"),v=n("861d"),g=n("1c0b"),y=n("19aa"),b=n("c6b6"),x=n("8925"),w=n("2266"),_=n("1c7e"),E=n("4840"),C=n("2cf4").set,S=n("b575"),A=n("cdf9"),T=n("44de"),k=n("f069"),R=n("e667"),P=n("69f3"),D=n("94ca"),M=n("b622"),B=n("2d00"),O=M("species"),j="Promise",N=P.get,F=P.set,I=P.getterFor(j),L=p,z=u.TypeError,$=u.document,H=u.process,G=l("fetch"),V=k.f,W=V,U="process"==b(H),q=!!($&&$.createEvent&&u.dispatchEvent),K="unhandledrejection",Y="rejectionhandled",X=0,Z=1,J=2,Q=1,ee=2,te=D(j,(function(){var e=x(L)!==String(L);if(!e){if(66===B)return!0;if(!U&&"function"!=typeof PromiseRejectionEvent)return!0}if(c&&!L.prototype["finally"])return!0;if(B>=51&&/native code/.test(L))return!1;var t=L.resolve(1),n=function(e){e((function(){}),(function(){}))},i=t.constructor={};return i[O]=n,!(t.then((function(){}))instanceof n)})),ne=te||!_((function(e){L.all(e)["catch"]((function(){}))})),ie=function(e){var t;return!(!v(e)||"function"!=typeof(t=e.then))&&t},re=function(e,t,n){if(!t.notified){t.notified=!0;var i=t.reactions;S((function(){var r=t.value,o=t.state==Z,a=0;while(i.length>a){var s,c,u,l=i[a++],p=o?l.ok:l.fail,d=l.resolve,f=l.reject,h=l.domain;try{p?(o||(t.rejection===ee&&ce(e,t),t.rejection=Q),!0===p?s=r:(h&&h.enter(),s=p(r),h&&(h.exit(),u=!0)),s===l.promise?f(z("Promise-chain cycle")):(c=ie(s))?c.call(s,d,f):d(s)):f(r)}catch(m){h&&!u&&h.exit(),f(m)}}t.reactions=[],t.notified=!1,n&&!t.rejection&&ae(e,t)}))}},oe=function(e,t,n){var i,r;q?(i=$.createEvent("Event"),i.promise=t,i.reason=n,i.initEvent(e,!1,!0),u.dispatchEvent(i)):i={promise:t,reason:n},(r=u["on"+e])?r(i):e===K&&T("Unhandled promise rejection",n)},ae=function(e,t){C.call(u,(function(){var n,i=t.value,r=se(t);if(r&&(n=R((function(){U?H.emit("unhandledRejection",i,e):oe(K,e,i)})),t.rejection=U||se(t)?ee:Q,n.error))throw n.value}))},se=function(e){return e.rejection!==Q&&!e.parent},ce=function(e,t){C.call(u,(function(){U?H.emit("rejectionHandled",e):oe(Y,e,t.value)}))},ue=function(e,t,n,i){return function(r){e(t,n,r,i)}},le=function(e,t,n,i){t.done||(t.done=!0,i&&(t=i),t.value=n,t.state=J,re(e,t,!0))},pe=function(e,t,n,i){if(!t.done){t.done=!0,i&&(t=i);try{if(e===n)throw z("Promise can't be resolved itself");var r=ie(n);r?S((function(){var i={done:!1};try{r.call(n,ue(pe,e,i,t),ue(le,e,i,t))}catch(o){le(e,i,o,t)}})):(t.value=n,t.state=Z,re(e,t,!1))}catch(o){le(e,{done:!1},o,t)}}};te&&(L=function(e){y(this,L,j),g(e),i.call(this);var t=N(this);try{e(ue(pe,this,t),ue(le,this,t))}catch(n){le(this,t,n)}},i=function(e){F(this,{type:j,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:X,value:void 0})},i.prototype=f(L.prototype,{then:function(e,t){var n=I(this),i=V(E(this,L));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=U?H.domain:void 0,n.parent=!0,n.reactions.push(i),n.state!=X&&re(this,n,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),r=function(){var e=new i,t=N(e);this.promise=e,this.resolve=ue(pe,e,t),this.reject=ue(le,e,t)},k.f=V=function(e){return e===L||e===o?new r(e):W(e)},c||"function"!=typeof p||(a=p.prototype.then,d(p.prototype,"then",(function(e,t){var n=this;return new L((function(e,t){a.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof G&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return A(L,G.apply(u,arguments))}}))),s({global:!0,wrap:!0,forced:te},{Promise:L}),h(L,j,!1,!0),m(j),o=l(j),s({target:j,stat:!0,forced:te},{reject:function(e){var t=V(this);return t.reject.call(void 0,e),t.promise}}),s({target:j,stat:!0,forced:c||te},{resolve:function(e){return A(c&&this===o?L:this,e)}}),s({target:j,stat:!0,forced:ne},{all:function(e){var t=this,n=V(t),i=n.resolve,r=n.reject,o=R((function(){var n=g(t.resolve),o=[],a=0,s=1;w(e,(function(e){var c=a++,u=!1;o.push(void 0),s++,n.call(t,e).then((function(e){u||(u=!0,o[c]=e,--s||i(o))}),r)})),--s||i(o)}));return o.error&&r(o.value),n.promise},race:function(e){var t=this,n=V(t),i=n.reject,r=R((function(){var r=g(t.resolve);w(e,(function(e){r.call(t,e).then(n.resolve,i)}))}));return r.error&&i(r.value),n.promise}})},e893:function(e,t,n){var i=n("5135"),r=n("56ef"),o=n("06cf"),a=n("9bf2");e.exports=function(e,t){for(var n=r(t),s=a.f,c=o.f,u=0;u<n.length;u++){var l=n[u];i(e,l)||s(e,l,c(t,l))}}},e8b5:function(e,t,n){var i=n("c6b6");e.exports=Array.isArray||function(e){return"Array"==i(e)}},e95a:function(e,t,n){var i=n("b622"),r=n("3f8c"),o=i("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||a[o]===e)}},f069:function(e,t,n){"use strict";var i=n("1c0b"),r=function(e){var t,n;this.promise=new e((function(e,i){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=i})),this.resolve=i(t),this.reject=i(n)};e.exports.f=function(e){return new r(e)}},f5df:function(e,t,n){var i=n("00ee"),r=n("c6b6"),o=n("b622"),a=o("toStringTag"),s="Arguments"==r(function(){return arguments}()),c=function(e,t){try{return e[t]}catch(n){}};e.exports=i?r:function(e){var t,n,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=c(t=Object(e),a))?n:s?r(t):"Object"==(i=r(t))&&"function"==typeof t.callee?"Arguments":i}},f772:function(e,t,n){var i=n("5692"),r=n("90e3"),o=i("keys");e.exports=function(e){return o[e]||(o[e]=r(e))}},fb15:function(e,t,n){"use strict";if(n.r(t),"undefined"!==typeof window){var i=window.document.currentScript,r=n("8875");i=r(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:r});var o=i&&i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);o&&(n.p=o[1])}n("d81d"),n("b0c0");var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.isInitFormData&&e.computedConfig.item?n("el-form",{ref:"refForm",attrs:{model:e.formData,inline:e.computedConfig.inline,"label-position":e.computedConfig.labelPosition,"label-width":e.computedConfig.labelWidth,"label-suffix":e.computedConfig.labelSuffix,"hide-required-asterisk":e.computedConfig.hideRequiredAsterisk,"show-message":e.computedConfig.showMessage,"inline-message":e.computedConfig.inlineMessage,"status-icon":e.computedConfig.statusIcon,"validate-on-rule-change":e.computedConfig.validateOnRuleChange,size:e.computedConfig.size,disabled:e.computedConfig.disabled},on:{validate:function(t,n,i){return e.computeFunction(e.computedConfig.validate,t,n,i)}}},[e._l(e.computedConfig.item,(function(t,i){return["string"===typeof t.slot&&e.computeBoolen(t.show,!0)?e._t(t.slot):"tabs"===t.xType?n("el-tabs",{key:i,staticClass:"tab-table",attrs:{type:e.computedConfig.tabs.type,closable:e.computedConfig.tabs.closable,addable:e.computedConfig.tabs.addable,editable:e.computedConfig.tabs.editable,"tab-position":e.computedConfig.tabs.tabPosition,stretch:e.computedConfig.tabs.stretch},on:{"tab-click":function(t){return e.computeFunction(e.computedConfig.tabs.tabClick,t)},"tab-remove":function(t){return e.computeFunction(e.computedConfig.tabs.tabRemove,t)},"tab-add":function(){return e.computeFunction(e.computedConfig.tabs.tabAdd)},edit:function(t,n){return e.computeFunction(e.computedConfig.tabs.edit,t,n)}},model:{value:e.activeTab,callback:function(t){e.activeTab=t},expression:"activeTab"}},[e._l(t.tabs,(function(t,i){return[e.computeBoolen(t.show,!0)?n("el-tab-pane",{key:i,attrs:{name:t.name,disabled:e.computeBoolen(t.disabled,!1),closable:e.computeBoolen(t.closable,!1),lazy:e.computeBoolen(t.lazy,!1),label:t.label}},[e.computeBoolen(t.addConfig.show,!0)?n("el-button",{class:t.addConfig.className,style:t.addConfig.style,attrs:{type:t.addConfig.type,icon:t.addConfig.icon,size:t.addConfig.size,plain:e.computeBoolen(t.addConfig.plain,!1),round:e.computeBoolen(t.addConfig.round,!1),circle:e.computeBoolen(t.addConfig.circle,!1)},on:{click:function(n){return t.addConfig.click(t.add,e.formData[t.name])}}},[t.addConfig.text?n("span",[e._v(e._s(t.addConfig.text))]):e._e()]):e._e(),"form"===t.type?n("xForm",{ref:t.name+"_XForm",refInFor:!0,attrs:{config:e.childFormConfig(t.formConfig)},model:{value:e.formData[t.name],callback:function(n){e.$set(e.formData,t.name,n)},expression:"formData[tabConfig.name]"}},[e._l(t.formConfig.item,(function(t){return["slot"===e.getComponentType(t)?e._t(t.name,null,{slot:t.name}):e._e(),e._t(t.slot,null,{slot:t.slot})]}))],2):n("el-table",{attrs:{data:e.formData[t.name],height:t.height,"max-height":t.maxHeight,stripe:t.stripe,border:t.border,size:t.size,fit:t.fit,"show-header":t.showHeader,"highlight-current-row":t.highlightCurrentRow,"current-row-key":t.currentRowKey,"row-class-name":t.rowClassName,"row-style":t.rowStyle,"cell-class-name":t.cellClassName,"cell-style":t.cellStyle,"header-row-class-name":t.headerRowClassName,"header-row-style":t.headerRowStyle,"header-cell-class-name":t.headerCellClassName,"header-cell-style":t.headerCellStyle,"row-key":t.rowKey,"empty-text":t.emptyText,"default-expand-all":t.defaultExpandAll,"expand-row-keys":t.expandRowKeys,"default-sort":t.defaultSort,"tooltip-effect":t.tooltipEffect,"show-summary":t.showSummary,"sum-text":t.sumText,"summary-method":t.summaryMethod,"span-method":t.spanMethod,"select-on-indeterminate":t.selectOnIndeterminate,indent:t.indent,lazy:t.lazy,load:t.load,"tree-props":t.treeProps},on:{select:function(n,i){return e.computeFunction(t.select,n,i)},"select-all":function(n){return e.computeFunction(t.selectAll,n)},"selection-change":function(n){return e.computeFunction(t.selectionChange,n)},"cell-mouse-enter":function(n,i,r,o){return e.computeFunction(t.cellMouseEnter,n,i,r,o)},"cell-mouse-leave":function(n,i,r,o){return e.computeFunction(t.cellMouseLeave,n,i,r,o)},"cell-click":function(n,i,r,o){return e.computeFunction(t.cellClick,n,i,r,o)},"cell-dblclick":function(n,i,r,o){return e.computeFunction(t.cellDblclick,n,i,r,o)},"row-click":function(n,i,r){return e.computeFunction(t.rowClick,n,i,r)},"row-contextmenu":function(n,i,r){return e.computeFunction(t.rowContextmenu,n,i,r)},"row-dblclick":function(n,i,r){return e.computeFunction(t.rowDblclick,n,i,r)},"header-click":function(n,i){return e.computeFunction(t.headerClick,n,i)},"header-contextmenu":function(n,i){return e.computeFunction(t.headerContextmenu,n,i)},"sort-change":function(n){return e.computeFunction(t.sortChange,n)},"filter-change":function(n){return e.computeFunction(t.filterChange,n)},"current-change":function(n,i){return e.computeFunction(t.currentChange,n,i)},"header-dragend":function(n,i,r,o){return e.computeFunction(t.headerDragend,n,i,r,o)},"expand-change":function(n,i){return e.computeFunction(t.expandChange,n,i)}}},[e._l(t.column,(function(i){return[n("xColumn",{key:i.name,attrs:{config:i,"tab-config":t},scopedSlots:e._u([i.slot?{key:i.name,fn:function(t){return[e._t(i.name,null,null,t)]}}:null],null,!0)})]})),t.operate.show?n("el-table-column",{attrs:{label:t.operate.label,width:t.operate.width,"header-align":t.operate.headerAlign,align:t.operate.align},scopedSlots:e._u([{key:"default",fn:function(i){return[n("el-form-item",{attrs:{"label-width":"0px"}},[e._l(t.operate.btn,(function(r,o){return[e.operateShow(r,i.row)?n("el-button",{key:o,class:r.className,style:r.style,attrs:{type:r.type,icon:r.icon,size:r.size,plain:e.computeBoolen(r.plain,!1),round:e.computeBoolen(r.round,!1),circle:e.computeBoolen(r.circle,!1)},on:{click:function(n){return r.click(e.formData[t.name],i.$index,t.remove)}}},[r.text?n("span",[e._v(e._s(r.text))]):e._e()]):e._e()]}))],2)]}}],null,!0)}):e._e()],2)],1):e._e()]}))],2):e.computeBoolen(t.show,!0)?n("el-form-item",{key:i,attrs:{prop:t.name,label:t.label,rules:t.rules}},[t.tooltip?n("span",{attrs:{slot:"label"},slot:"label"},[e._v(" "+e._s(t.label)+" "),n("el-tooltip",{attrs:{effect:e.computedConfig.tooltip.effect,placement:e.computedConfig.tooltip.placement}},[n("div",{attrs:{slot:"content"},slot:"content"},[n("span",{domProps:{innerHTML:e._s(t.tooltip)}})]),n("i",{class:e.computedConfig.tooltip.iconName,style:e.computedConfig.tooltip.iconStyle})]),e._v(" "+e._s(e.computedConfig.labelSuffix)+" ")],1):e._e(),"slot"===e.getComponentType(t)?e._t(t.name):n(e.getComponentType(t),{tag:"component",style:t.style?t.style:e.computedConfig.itemStyle,attrs:{config:t},model:{value:e.formData[t.name],callback:function(n){e.$set(e.formData,t.name,n)},expression:"formData[configItem.name]"}})],2):e._e()]})),e.computedConfig.operate?n("el-form-item",[e._l(e.computedConfig.operate,(function(t,i){return[e.computeBoolen(t.show,!0)?n("el-button",{key:i,attrs:{size:t.size,type:t.type,plain:t.plain,round:t.round,circle:t.circle,loading:t.loading,disabled:t.disabled,icon:t.icon,autofocus:t.autofocus,"native-type":t.nativeType},on:{click:function(n){return t.click(e.formData)}}},[e._v(" "+e._s(t.text)+" ")]):e._e()]}))],2):e._e()],2):e._e()},s=[];function c(e){return c="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}n("4de4"),n("4160"),n("caad"),n("a434"),n("b64b"),n("d3b7"),n("e6cf"),n("ac1f"),n("5319"),n("1276"),n("159b"),n("a4d3"),n("e01a"),n("d28b"),n("e260"),n("3ca3"),n("ddb0");var u=n("da81"),l=n.n(u),p={input:{disabled:!1,type:"text",valueKey:"value",debounce:300,placement:"bottom-start",triggerOnFocus:!0,selectWhenUnmatched:!1,maxlength:null,minlength:null,showWordLimit:!1,placeholder:null,clearable:!1,size:"medium",rows:3,autosize:!1,autocomplete:"off",resize:"none",validateEvent:!0,hideLoading:!1,popperAppendToBody:!0,highlightFirstItem:!1},autocomplete:{disabled:!1,placeholder:null,valueKey:"value",debounce:300,placement:"bottom-start",fetchSuggestions:null,popperClass:null,triggerOnFocus:!0,name:null,selectWhenUnmatched:!1,label:null,prefixIcon:null,suffixIcon:null,hideLoading:!1,popperAppendToBody:!0,highlightFirstItem:!1,maxlength:null,minlength:null,clearable:!1,size:"medium",rows:3,autosize:!1,autocomplete:"off",resize:"none",validateEvent:!0},select:{disabled:!1,multiple:!1,valueKey:"value",size:"medium",clearable:!1,collapseTags:!1,multipleLimit:0,autocomplete:"off",placeholder:"请选择",filterable:!1,allowCreate:!1,remote:!1,loading:!1,loadingText:"加载中",noMatchText:"无匹配数据",noDataText:"无数据",reserveKeyword:!1,defaultFirstOption:!1,popperAppendToBody:!0,automaticDropdown:!1},datePicker:{disabled:!1,readonly:!1,editable:!0,clearable:!0,size:"",placeholder:"请选择日期",startPlaceholder:"开始时间",endPlaceholder:"结束时间",type:"date",format:"",align:"left",pickerOptions:{},rangeSeparator:":",valueFormat:"",unlinkPanels:!1,prefixIcon:"el-icon-date",clearIcon:"el-icon-circle-close",validateEvent:!0},checkbox:{disabled:!1,size:"medium",min:void 0,max:void 0,textColor:"#ffffff",fill:"#409EFF",border:!1},radio:{disabled:!1,border:!1,size:"medium",textColor:"#ffffff",fill:"#409EFF"},cascader:{disabled:!1,size:"medium",placeholder:"请选择",clearable:!1,showAllLevels:!0,collapseTags:!1,separator:" / ",debounce:300},switch:{disabled:!1,width:40,activeValue:!0,inactiveValue:!1,activeColor:"#409EFF",inactiveColor:"#C0CCDA",validateEvent:!0},inputNumber:{disabled:!1,min:"-Infinity",max:"Infinity",step:1,stepStrictly:!1,precision:null,size:"medium",controls:!0,controlsPosition:null,placeholder:null},slider:{disabled:!1,min:0,max:100,step:1,showInput:!1,showInputControls:!0,inputSize:"small",showStops:!1,showTooltip:!0,range:!1,vertical:!1,height:null,label:null,debounce:300,marks:null},timePicker:{disabled:!1,editable:!0,clearable:!0,size:"medium",placeholder:"",align:"left",startPlaceholder:"",endPlaceholder:"",isRange:!1,arrowControl:!1,pickerOptions:{},rangeSeparator:":",valueFormat:"",prefixIcon:"el-icon-time",clearIcon:"el-icon-circle-close",selectableRange:null,format:"HH:mm:ss"},timeSelect:{disabled:!1,editable:!0,clearable:!0,size:"medium",placeholder:"",align:"left",startPlaceholder:"",endPlaceholder:"",isRange:!1,arrowControl:!1,pickerOptions:{},rangeSeparator:":",valueFormat:"",prefixIcon:"el-icon-time",clearIcon:"el-icon-circle-close",start:"09:00",end:"18:00",step:"00:30",minTime:"00:00",maxTime:null},rate:{disabled:!1,max:5,texts:["极差","失望","一般","满意","惊喜"],colors:["#F7BA2A","#F7BA2A","#F7BA2A"],allowHalf:!1,lowThreshold:2,highThreshold:4,voidColor:"#C6D1DE",iconClasses:["el-icon-star-on","el-icon-star-on","el-icon-star-on"],showText:!1,showScore:!1,textColor:"#1F2D3D",scoreTemplate:"{value}",disabledVoidColor:"#EFF2F7",voidIconClass:"el-icon-star-off",disabledVoidIconClass:"el-icon-star-on"},colorPicker:{disabled:!1,size:"medium",predefine:null,showAlpha:!1,colorFormat:"hex"},transfer:{disabled:!1,filterable:!1,filterPlaceholder:"请输入搜索内容",targetOrder:"original",titles:["列表 1","列表 2"],buttonTexts:[],format:{noChecked:"${checked}/${total}",hasChecked:"${checked}/${total}"},props:null},xtable:{btn:{size:"medium",type:"primary",plain:!1,round:!1,circle:!1,loading:!1,disabled:!1,icon:null,autofocus:!1,nativeType:"button"},table:{height:null,maxHeight:null,stripe:!1,border:!1,size:"medium",fit:!0,showHeader:!0,highlightCurrentRow:!1,rowClassName:null,rowStyle:null,cellClassName:null,cellStyle:null,headerRowClassName:null,headerRowStyle:null,headerCellClassName:null,headerCellStyle:null,emptyText:"暂无数据",defaultExpandAll:!1,defaultSort:{order:"ascending"},tooltipEffect:"dark",showSummary:!1,sumText:"合计",selectOnIndeterminate:!0,indent:16,treeProps:{hasChildren:"hasChildren",children:"children"}},column:{width:null,minWidth:null,fixed:!1,sortable:!1,sortOrders:["ascending","descending",null],resizable:!0,showOverflowTooltip:!1,align:"center",headerAlign:"center",className:null,labelClassName:null,reserveSelection:!1,filterPlacement:null,filterMultiple:!0},search:{form:{inline:!0,labelPosition:"right",labelWidth:"auto",labelSuffix:void 0,hideRequiredAsterisk:!1,showMessage:!0,inlineMessage:!1,statusIcon:!1,validateOnRuleChange:!0,size:"medium",disabled:!1,itemStyle:"width: 200px;"},btn:{size:"medium",type:"primary",plain:!1,round:!1,circle:!1,loading:!1,disabled:!1,icon:null,autofocus:!1,nativeType:"button",searchBtn:{show:!0,text:"搜索",icon:"el-icon-search"},resetBtn:{show:!0,text:"重置",icon:"el-icon-refresh-right"}}},operate:{column:{label:"操作"},btn:{size:"medium",type:"primary",plain:!1,round:!1,circle:!1,loading:!1,disabled:!1,icon:null,autofocus:!1,nativeType:"button"},dropdown:{className:"",text:"更多",placement:"bottom-end",trigger:"hover",hideOnClick:!0,showTimeout:250,hideTimeout:150,tabindex:0,divided:!1}}},xform:{form:{inline:!1,labelPosition:"right",labelWidth:"120px",labelSuffix:void 0,hideRequiredAsterisk:!1,showMessage:!0,inlineMessage:!1,statusIcon:!1,validateOnRuleChange:!0,size:"medium",disabled:!1,itemStyle:"max-width: 300px; width: 100%;",tooltip:{effect:"dark",placement:"top-start",iconName:"el-icon-info",iconStyle:"color: #409EFF"},tabs:{type:"border-card",closable:!1,addable:!1,editable:!1,tabPosition:"top",stretch:!1,table:{height:null,maxHeight:null,stripe:!1,border:!0,size:"medium",fit:!0,showHeader:!0,highlightCurrentRow:!1,rowClassName:null,rowStyle:null,cellClassName:null,cellStyle:null,headerRowClassName:null,headerRowStyle:null,headerCellClassName:null,headerCellStyle:null,emptyText:"暂无数据",defaultExpandAll:!1,defaultSort:{order:"ascending"},tooltipEffect:"dark",showSummary:!1,sumText:"合计",selectOnIndeterminate:!0,indent:16,treeProps:{hasChildren:"hasChildren",children:"children"},column:{width:null,minWidth:null,showOverflowTooltip:!1,align:"center",headerAlign:"center",className:null,style:"width: 100%"},addConfig:{show:!0,type:"primary",icon:"",text:"新增",size:"mini",circle:!1,style:"margin-bottom:14px;",className:"",click:function(e,t){e?e(t):t.splice(t.length,0,{})}},operate:{show:!0,label:"操作",width:"60px",headerAlign:"center",align:"center",btn:[{type:"danger",icon:"el-icon-close",text:"",size:"mini",circle:!0,style:"",className:"",click:function(e,t,n){n?n(e,t):e.splice(t,1)}}]}}}},operate:{btn:{size:"medium",type:"primary",plain:!1,round:!1,circle:!1,loading:!1,disabled:!1,icon:null,autofocus:!1,nativeType:"button"}}}},d={get:function(){return p},set:function(e){l()(p,e)}},f=function(){return{model:{prop:"propData",event:"input"},props:{config:{type:Object,default:{},required:!0},propData:{default:""}},data:function(){return{formData:this.propData,globalConfig:d.get()}},methods:{computeBoolen:function(e,t){return this.isBoolen(e)?e:!this.isEmpty(e)||t||!1},computeFunction:function(e){if(!e)return!1;for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];e.apply(void 0,n)},isEmpty:function(e){return"null"===e||null==e||"undefined"===e||void 0===e||""===e},isBoolen:function(e){return"boolean"===typeof e},isObject:function(e){return"object"===c(e)}},watch:{formData:{handler:function(e){this.$emit("input",e),this.$emit("change",e)},deep:!0},propData:{handler:function(e){this.formData=e},deep:!0}}}};function h(e){var t=e.xType,n=e.type;return"slot"===t?"slot":"cascader"===t?"xCascader":"checkbox"===t?"xCheckbox":"colorPicker"===t?"xColorPicker":"datePicker"===t?"xDatePicker":"input"===t?"xInput":"autocomplete"===t?"xAutocomplete":"inputNumber"===t?"xInputNumber":"radio"===t?"xRadio":"rate"===t?"xRate":"select"===t?"tree"===n?"xTree":"xSelect":"slider"===t?"xSlider":"switch"===t?"xSwitch":"timePicker"===t?"xTimePicker":"timeSelect"===t?"xTimeSelect":"transfer"===t?"xTransfer":void 0}var m=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-cascader",{attrs:{options:e.computedConfig.options,props:e.computedConfig.props,size:e.computedConfig.size,placeholder:e.computedConfig.placeholder,disabled:e.computedConfig.disabled,clearable:e.computedConfig.clearable,"show-all-levels":e.computedConfig.showAllLevels,"collapse-tags":e.computedConfig.collapseTags,separator:e.computedConfig.separator,filterable:e.computedConfig.filterable,"filter-method":e.computedConfig.filterMethod,debounce:e.computedConfig.debounce,"before-filter":e.computedConfig.beforeFilter,"popper-class":e.computedConfig.popperClass},on:{change:function(t){return e.computeFunction(e.computedConfig.change,t)},"expand-change":function(t){return e.computeFunction(e.computedConfig.expandChange,t)},blur:function(t){return e.computeFunction(e.computedConfig.blur,t)},focus:function(t){return e.computeFunction(e.computedConfig.focus,t)},"visible-change":function(t){return e.computeFunction(e.computedConfig.visibleChange,t)},"remove-tag":function(t){return e.computeFunction(e.computedConfig.removeTag,t)}},model:{value:e.formData,callback:function(t){e.formData=t},expression:"formData"}})},v=[],g={mixins:[f()],data:function(){return{}},computed:{computedConfig:function(){var e={};return l()(e,this.globalConfig.cascader,this.config),e}}},y=g;function b(e,t,n,i,r,o,a,s){var c,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),i&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),a?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=c):r&&(c=s?function(){r.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:r),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(e,t){return c.call(t),l(e,t)}}else{var p=u.beforeCreate;u.beforeCreate=p?[].concat(p,c):[c]}return{exports:e,options:u}}var x=b(y,m,v,!1,null,null,null),w=x.exports,_=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-checkbox-group",{attrs:{size:e.computedConfig.size,disabled:e.computedConfig.disabled,min:e.computedConfig.min,max:e.computedConfig.max,"text-color":e.computedConfig.textColor,fill:e.computedConfig.fill},on:{change:function(t){return e.computeFunction(e.computedConfig.change,t)}},model:{value:e.formData,callback:function(t){e.formData=t},expression:"formData"}},e._l(e.getDic,(function(t,i){return n("el-checkbox",{key:i,attrs:{label:t[e.valueName],"true-label":t.trueLabel,"false-label":t.falseLabel,disabled:t.disabled,border:e.computedConfig.border,checked:t.checked,indeterminate:t.indeterminate}},[e._v(e._s(t[e.labelName]))])})),1)},E=[],C={mixins:[f()],data:function(){var e=this;return{labelName:e.config.dic.label?e.config.dic.label:"label",valueName:e.config.dic.value?e.config.dic.value:"value"}},computed:{getDic:function(){var e=this.config.dic;return e instanceof Array?e:e.data instanceof Array?e.data:void 0},computedConfig:function(){var e={};return l()(e,this.globalConfig.checkbox,this.config),e}}},S=C,A=b(S,_,E,!1,null,null,null),T=A.exports,k=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-color-picker",{attrs:{disabled:e.computedConfig.disabled,size:e.computedConfig.size,predefine:e.computedConfig.predefine,"show-alpha":e.computedConfig.showAlpha,"color-format":e.computedConfig.colorFormat,"popper-class":e.computedConfig.popperClass},on:{change:function(t){return e.computeFunction(e.computedConfig.change,t)},"active-change":function(t){return e.computeFunction(e.computedConfig.activeChange,t)}},model:{value:e.formData,callback:function(t){e.formData=t},expression:"formData"}})},R=[],P={mixins:[f()],data:function(){return{}},computed:{computedConfig:function(){var e={};return l()(e,this.globalConfig.colorPicker,this.config),e}}},D=P,M=b(D,k,R,!1,null,null,null),B=M.exports,O=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-date-picker",{attrs:{readonly:e.computedConfig.readonly,disabled:e.computedConfig.disabled,editable:e.computedConfig.editable,clearable:e.computedConfig.clearable,size:e.computedConfig.size,placeholder:e.computedConfig.placeholder,"start-placeholder":e.computedConfig.startPlaceholder,"end-placeholder":e.computedConfig.endPlaceholder,type:e.computedConfig.type,format:e.computedConfig.format,align:e.computedConfig.align,"popper-class":e.computedConfig.popperClass,"picker-options":e.computedConfig.pickerOptions,"range-separator":e.computedConfig.rangeSeparator,"default-value":e.computedConfig.defaultValue,"default-time":e.computedConfig.defaultTime,"value-format":e.computedConfig.valueFormat,name:e.computedConfig.name,"unlink-panels":e.computedConfig.unlinkPanels,"prefix-icon":e.computedConfig.prefixIcon,"clear-icon":e.computedConfig.clearIcon,"validate-event":e.computedConfig.validateEvent},on:{change:function(t){return e.computeFunction(e.computedConfig.change,t)},blur:function(t){return e.computeFunction(e.computedConfig.blur,t)},focus:function(t){return e.computeFunction(e.computedConfig.focus,t)}},model:{value:e.formData,callback:function(t){e.formData=t},expression:"formData"}})},j=[],N={mixins:[f()],data:function(){return{}},computed:{computedConfig:function(){var e={};return l()(e,this.globalConfig.datePicker,this.config),e}}},F=N,I=b(F,O,j,!1,null,null,null),L=I.exports,z=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-input",{attrs:{type:e.computedConfig.type,value:e.computedConfig.value,maxlength:e.computedConfig.maxlength,minlength:e.computedConfig.minlength,"show-word-limit":e.computedConfig.showWordLimit,placeholder:e.computedConfig.placeholder,clearable:e.computedConfig.clearable,"show-password":e.computedConfig.showPassword,disabled:e.computedConfig.disabled,size:e.computedConfig.size,"prefix-icon":e.computedConfig.prefixIcon,"suffix-icon":e.computedConfig.suffixIcon,rows:e.computedConfig.rows,autosize:e.computedConfig.autosize,autocomplete:e.computedConfig.autocomplete,"auto-complete":e.computedConfig.autoComplete,name:e.computedConfig.name,readonly:e.computedConfig.readonly,max:e.computedConfig.max,min:e.computedConfig.min,step:e.computedConfig.step,resize:e.computedConfig.resize,autofocus:e.computedConfig.autofocus,form:e.computedConfig.form,label:e.computedConfig.label,tabindex:e.computedConfig.tabindex},on:{blur:function(t){return e.computeFunction(e.computedConfig.blur,t)},focus:function(t){return e.computeFunction(e.computedConfig.focus,t)},change:function(t){return e.computeFunction(e.computedConfig.change,t)},input:function(t){return e.computeFunction(e.computedConfig.input,t)},clear:function(t){return e.computeFunction(e.computedConfig.clear,t)}},model:{value:e.formData,callback:function(t){e.formData=t},expression:"formData"}})},$=[],H={mixins:[f()],data:function(){return{}},computed:{computedConfig:function(){var e={};return l()(e,this.globalConfig.input,this.config),e}},methods:{handleChange:function(e){}}},G=H,V=b(G,z,$,!1,null,null,null),W=V.exports,U=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-autocomplete",{attrs:{placeholder:e.computedConfig.placeholder,disabled:e.computedConfig.disabled,"value-key":e.computedConfig.valueKey,value:e.computedConfig.value,debounce:e.computedConfig.debounce,placement:e.computedConfig.placement,"fetch-suggestions":e.computedConfig.fetchSuggestions,"popper-class":e.computedConfig.popperClass,"trigger-on-focus":e.computedConfig.triggerOnFocus,name:e.computedConfig.name,"select-when-unmatched":e.computedConfig.selectWhenUnmatched,label:e.computedConfig.label,"prefix-icon":e.computedConfig.prefixIcon,"suffix-icon":e.computedConfig.suffixIcon,"hide-loading":e.computedConfig.hideLoading,"popper-append-to-body":e.computedConfig.popperAppendToBody,"highlight-first-item":e.computedConfig.highlightFirstItem,maxlength:e.computedConfig.maxlength,minlength:e.computedConfig.minlength,"show-word-limit":e.computedConfig.showWordLimit,clearable:e.computedConfig.clearable,"show-password":e.computedConfig.showPassword,size:e.computedConfig.size,rows:e.computedConfig.rows,autosize:e.computedConfig.autosize,autocomplete:e.computedConfig.autocomplete,"auto-complete":e.computedConfig.autoComplete,readonly:e.computedConfig.readonly,max:e.computedConfig.max,min:e.computedConfig.min,step:e.computedConfig.step,resize:e.computedConfig.resize,autofocus:e.computedConfig.autofocus,form:e.computedConfig.form,tabindex:e.computedConfig.tabindex},on:{blur:function(t){return e.computeFunction(e.computedConfig.blur,t)},focus:function(t){return e.computeFunction(e.computedConfig.focus,t)},change:function(t){return e.computeFunction(e.computedConfig.change,t)},input:function(t){return e.computeFunction(e.computedConfig.input,t)},clear:function(t){return e.computeFunction(e.computedConfig.clear,t)},select:function(t){return e.computeFunction(e.computedConfig.select,t)}},model:{value:e.formData,callback:function(t){e.formData=t},expression:"formData"}})},q=[],K={mixins:[f()],data:function(){return{}},computed:{computedConfig:function(){var e={};return l()(e,this.globalConfig.input,this.config),e}},methods:{handleChange:function(e){}}},Y=K,X=b(Y,U,q,!1,null,null,null),Z=X.exports,J=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-input-number",{attrs:{min:e.computedConfig.min,max:e.computedConfig.max,step:e.computedConfig.step,"step-strictly":e.computedConfig.stepStrictly,precision:e.computedConfig.precision,size:e.computedConfig.size,disabled:e.computedConfig.disabled,controls:e.computedConfig.controls,"controls-position":e.computedConfig.controlsPosition,name:e.computedConfig.name,label:e.computedConfig.label,placeholde:e.computedConfig.placeholde},on:{change:function(t,n){return e.computeFunction(e.computedConfig.change,t,n)},blur:function(t){return e.computeFunction(e.computedConfig.blur,t)},focus:function(t){return e.computeFunction(e.computedConfig.focus,t)}},model:{value:e.formData,callback:function(t){e.formData=t},expression:"formData"}})},Q=[],ee={mixins:[f()],data:function(){return{}},computed:{computedConfig:function(){var e={};return l()(e,this.globalConfig.inputNumber,this.config),e}}},te=ee,ne=b(te,J,Q,!1,null,null,null),ie=ne.exports,re=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-radio-group",{attrs:{disabled:e.computedConfig.disabled,size:e.computedConfig.size,"text-color":e.computedConfig.textColor,fill:e.computedConfig.fill},on:{change:function(t){return e.computeFunction(e.computedConfig.change,t)}},model:{value:e.formData,callback:function(t){e.formData=t},expression:"formData"}},e._l(e.config.dic,(function(t,i){return n("el-radio",{key:i,attrs:{disabled:t.disabled,label:t.value,border:e.computedConfig.border}},[e._v(e._s(t.label))])})),1)},oe=[],ae={mixins:[f()],data:function(){return{}},computed:{computedConfig:function(){var e={};return l()(e,this.globalConfig.radio,this.config),e}}},se=ae,ce=b(se,re,oe,!1,null,null,null),ue=ce.exports,le=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-rate",{attrs:{max:e.computedConfig.max,disabled:e.computedConfig.disabled,texts:e.computedConfig.texts,colors:e.computedConfig.colors,"allow-half":e.computedConfig.allowHalf,"low-threshold":e.computedConfig.lowThreshold,"high-threshold":e.computedConfig.highThreshold,"void-color":e.computedConfig.voidColor,"icon-classes":e.computedConfig.iconClasses,"show-text":e.computedConfig.showText,"show-score":e.computedConfig.showScore,"text-color":e.computedConfig.textColor,"score-template":e.computedConfig.scoreTemplate,"disabled-void-color":e.computedConfig.disabledVoidColor,"void-icon-class":e.computedConfig.voidIconClass,"disabled-void-icon-class":e.computedConfig.disabledVoidIconClass},on:{change:function(t){return e.computeFunction(e.computedConfig.change,t)}},model:{value:e.formData,callback:function(t){e.formData=t},expression:"formData"}})},pe=[],de={mixins:[f()],data:function(){return{}},computed:{computedConfig:function(){var e={};return l()(e,this.globalConfig.rate,this.config),e}}},fe=de,he=b(fe,le,pe,!1,null,null,null),me=he.exports,ve=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-select",{attrs:{multiple:e.computedConfig.multiple,disabled:e.computedConfig.disabled,"value-key":e.computedConfig.valueKey,size:e.computedConfig.size,clearable:e.computedConfig.clearable,"collapse-tags":e.computedConfig.collapseTags,"multiple-limit":e.computedConfig.multipleLimit,name:e.computedConfig.name,autocomplete:e.computedConfig.autocomplete,placeholder:e.computedConfig.placeholder,filterable:e.computedConfig.filterable,"allow-create":e.computedConfig.allowCreate,"filter-method":e.computedConfig.filterMethod,remote:e.computedConfig.remote,"remote-method":e.computedConfig.remoteMethod,loading:e.computedConfig.loading,"loading-text":e.computedConfig.loadingText,"no-match-text":e.computedConfig.noMatchText,"no-data-text":e.computedConfig.noDataText,"popper-class":e.computedConfig.popperClass,"reserve-keyword":e.computedConfig.reserveKeyword,"default-first-option":e.computedConfig.defaultFirstOption,"popper-append-to-body":e.computedConfig.popperAppendToBody,"automatic-dropdown":e.computedConfig.automaticDropdown},on:{change:function(t){return e.computeFunction(e.computedConfig.change,t)},"visible-change":function(t){return e.computeFunction(e.computedConfig.visibleChange,t)},"remove-tag":function(t){return e.computeFunction(e.computedConfig.removeTag,t)},clear:function(t){return e.computeFunction(e.computedConfig.clear,t)},blur:function(t){return e.computeFunction(e.computedConfig.blur,t)},focus:function(t){return e.computeFunction(e.computedConfig.focus,t)}},model:{value:e.formData,callback:function(t){e.formData=t},expression:"formData"}},e._l(e.getDic,(function(t,i){return n("el-option",{key:i,attrs:{disabled:t.disabled,label:t[e.labelName],value:t[e.valueName]}})})),1)},ge=[],ye={mixins:[f()],data:function(){var e=this;return{labelName:e.config.dic.label?e.config.dic.label:"label",valueName:e.config.dic.value?e.config.dic.value:"value"}},computed:{getDic:function(){var e=this.config.dic;return e instanceof Array?e:e.data instanceof Array?e.data:void 0},computedConfig:function(){var e={};return l()(e,this.globalConfig.select,this.config),e}}},be=ye,xe=b(be,ve,ge,!1,null,null,null),we=xe.exports,_e=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-slider",{attrs:{min:e.computedConfig.min,max:e.computedConfig.max,disabled:e.computedConfig.disabled,step:e.computedConfig.step,range:e.computedConfig.range,vertical:e.computedConfig.vertical,height:e.computedConfig.height,label:e.computedConfig.label,debounce:e.computedConfig.debounce,marks:e.computedConfig.marks,"tooltip-class":e.computedConfig.tooltipClass,"show-input":e.computedConfig.showInput,"show-input-controls":e.computedConfig.showInputControls,"input-size":e.computedConfig.inputSize,"show-stops":e.computedConfig.showStops,"show-tooltip":e.computedConfig.showTooltip,"format-tooltip":e.computedConfig.formatTooltip},on:{change:function(t){return e.computeFunction(e.computedConfig.change,t)},input:function(t){return e.computeFunction(e.computedConfig.input,t)}},model:{value:e.formData,callback:function(t){e.formData=t},expression:"formData"}})},Ee=[],Ce={mixins:[f()],data:function(){return{}},computed:{computedConfig:function(){var e={};return l()(e,this.globalConfig.slider,this.config),e}}},Se=Ce,Ae=b(Se,_e,Ee,!1,null,null,null),Te=Ae.exports,ke=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-switch",{attrs:{disabled:e.computedConfig.disabled,width:e.computedConfig.width,"active-icon-class":e.computedConfig.activeIconClass,"inactive-icon-class":e.computedConfig.inactiveIconClass,"active-text":e.computedConfig.activeText,"inactive-text":e.computedConfig.inactiveText,"active-value":e.computedConfig.activeValue,"inactive-value":e.computedConfig.inactiveValue,"active-color":e.computedConfig.activeColor,"inactive-color":e.computedConfig.inactiveColor,name:e.computedConfig.name,"validate-event":e.computedConfig.validateEvent},on:{change:function(t){return e.computeFunction(e.computedConfig.change,t)}},model:{value:e.formData,callback:function(t){e.formData=t},expression:"formData"}})},Re=[],Pe={mixins:[f()],data:function(){return{}},computed:{computedConfig:function(){var e={};return l()(e,this.globalConfig.switch,this.config),e}}},De=Pe,Me=b(De,ke,Re,!1,null,null,null),Be=Me.exports,Oe=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-time-picker",{attrs:{readonly:e.computedConfig.readonly,disabled:e.computedConfig.disabled,editable:e.computedConfig.editable,clearable:e.computedConfig.clearable,size:e.computedConfig.size,placeholder:e.computedConfig.placeholder,align:e.computedConfig.align,name:e.computedConfig.name,"start-placeholder":e.computedConfig.startPlaceholder,"end-placeholder":e.computedConfig.endPlaceholder,"is-range":e.computedConfig.isRange,"arrow-control":e.computedConfig.arrowControl,"popper-class":e.computedConfig.popperClass,"picker-options":e.computedConfig.pickerOptions,"range-separator":e.computedConfig.rangeSeparator,"value-format":e.computedConfig.valueFormat,"default-value":e.computedConfig.defaultValue,"prefix-icon":e.computedConfig.prefixIcon,"clear-icon":e.computedConfig.clearIcon,"selectable-range":e.computedConfig.selectableRange,format:e.computedConfig.format},on:{change:function(t){return e.computeFunction(e.computedConfig.change,t)},blur:function(t){return e.computeFunction(e.computedConfig.blur,t)},focus:function(t){return e.computeFunction(e.computedConfig.focus,t)}},model:{value:e.formData,callback:function(t){e.formData=t},expression:"formData"}})},je=[],Ne={mixins:[f()],data:function(){return{}},computed:{computedConfig:function(){var e={};return l()(e,this.globalConfig.timePicker,this.config),e}}},Fe=Ne,Ie=b(Fe,Oe,je,!1,null,null,null),Le=Ie.exports,ze=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-time-select",{attrs:{readonly:e.computedConfig.readonly,disabled:e.computedConfig.disabled,editable:e.computedConfig.editable,clearable:e.computedConfig.clearable,size:e.computedConfig.size,placeholder:e.computedConfig.placeholder,align:e.computedConfig.align,name:e.computedConfig.name,"start-placeholder":e.computedConfig.startPlaceholder,"end-placeholder":e.computedConfig.endPlaceholder,"is-range":e.computedConfig.isRange,"arrow-control":e.computedConfig.arrowControl,"popper-class":e.computedConfig.popperClass,"picker-options":e.computedConfig.pickerOptions,"range-separator":e.computedConfig.rangeSeparator,"value-format":e.computedConfig.valueFormat,"default-value":e.computedConfig.defaultValue,"prefix-icon":e.computedConfig.prefixIcon,"clear-icon":e.computedConfig.clearIcon,start:e.computedConfig.start,end:e.computedConfig.end,step:e.computedConfig.step,"min-time":e.computedConfig.minTime,"max-time":e.computedConfig.maxTime},on:{change:function(t){return e.computeFunction(e.computedConfig.change,t)},blur:function(t){return e.computeFunction(e.computedConfig.blur,t)},focus:function(t){return e.computeFunction(e.computedConfig.focus,t)}},model:{value:e.formData,callback:function(t){e.formData=t},expression:"formData"}})},$e=[],He={mixins:[f()],data:function(){return{}},computed:{computedConfig:function(){var e={};return l()(e,this.globalConfig.timeSelect,this.config),e}}},Ge=He,Ve=b(Ge,ze,$e,!1,null,null,null),We=Ve.exports,Ue=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-transfer",{attrs:{data:e.computedConfig.data,filterable:e.computedConfig.filterable,titles:e.computedConfig.titles,format:e.computedConfig.format,props:e.computedConfig.props,"filter-placeholder":e.computedConfig.filterPlaceholder,"filter-method":e.computedConfig.filterMethod,"target-order":e.computedConfig.targetOrder,"button-texts":e.computedConfig.buttonTexts,"render-content":e.computedConfig.renderContent,"left-default-checked":e.computedConfig.leftDefaultChecked,"right-default-checked":e.computedConfig.rightDefaultChecked},on:{change:function(t,n,i){return e.computeFunction(e.computedConfig.change,t,n,i)},"left-check-change":function(t,n){return e.computeFunction(e.computedConfig.blur,t,n)},"right-check-change":function(t,n){return e.computeFunction(e.computedConfig.blur,t,n)}},model:{value:e.formData,callback:function(t){e.formData=t},expression:"formData"}})},qe=[],Ke={mixins:[f()],data:function(){return{}},computed:{computedConfig:function(){var e={};return l()(e,this.globalConfig.transfer,this.config),e}}},Ye=Ke,Xe=b(Ye,Ue,qe,!1,null,null,null),Ze=Xe.exports,Je=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-select",{ref:"select",attrs:{disabled:e.config.disabled,multiple:e.config.multiple,placeholder:e.config.placeholder,clearable:!0,"collapse-tags":e.config.collapseTags,filterable:"",size:e.config.size},on:{"visible-change":e.handleOptionHidden},model:{value:e.formData,callback:function(t){e.formData=t},expression:"formData"}},[n("el-option",{staticStyle:{display:"none"},attrs:{value:""}}),e._l(e.options,(function(t,i){return n("el-option",{key:i,staticStyle:{display:"none"},attrs:{label:t[e.getTreeProps.label],value:t[e.getNodekey]}})})),n("el-tree",{ref:"tree",staticClass:"select-tree",attrs:{data:e.treeData,"node-key":e.getNodekey,"show-checkbox":e.config.multiple,"default-expand-all":e.computeBoolen(e.config.defaultExpandAll,!1),"expand-on-click-node":!1,props:e.getTreeProps,"highlight-current":!0},on:{check:e.handleCheckChange,"node-click":e.handleNodeClick},scopedSlots:e._u([{key:"default",fn:function(t){t.node;var i=t.data;return[n("span",{staticStyle:{"margin-left":"10px","font-size":"14px"}},[e._v(e._s(i[e.getTreeProps.label]))])]}}])})],2)},Qe=[],et=(n("2532"),{name:"XTree",mixins:[f()],data:function(){return{treeData:[]}},computed:{getNodekey:function(){return this.config.dic.value?this.config.dic.value:"value"},getTreeProps:function(){var e={children:"children",label:"label"};return this.config.dic.label&&(e.label=this.config.dic.label),this.config.dic.children&&(e.children=this.config.dic.children),e},options:function(){var e=this,t=[];function n(e){e.forEach((function(e){t.push(e),e.children&&n(e.children)}))}return this.formData?(n(this.treeData),t.filter((function(t){return e.formData.includes(t[e.getNodekey])}))):[]}},watch:{formData:{handler:function(e){var t=this,n=this.config.multiple?e:[e];null!==e&&void 0!==e&&""!==e&&n.length&&this.$nextTick().then((function(){t.$refs.tree.setCheckedKeys(n)}))},immediate:!0},config:{handler:function(e){var t=this.config.dic;t instanceof Array?this.treeData=t:t instanceof Object&&(this.treeData=t.data)},immediate:!0,deep:!0}},methods:{handleNodeClick:function(e){this.config.multiple||(this.formData=e[this.getNodekey],this.$refs.select.blur())},handleCheckChange:function(e,t){this.config.multiple?this.formData=t.checkedKeys:this.formData=this.$refs.tree.getCheckedKeys()[0]},handleOptionHidden:function(e){if(e){var t=this.config.multiple?this.formData:[this.formData];this.$refs.tree.setCheckedKeys(t)}}}}),tt=et,nt=(n("fe74"),b(tt,Je,Qe,!1,null,null,null)),it=nt.exports,rt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.computeBoolen(e.columnConfig.show,!0)?n("el-table-column",{attrs:{"header-align":e.columnConfig.headerAlign,prop:e.columnConfig.name,label:e.columnConfig.label,width:e.columnConfig.width,"min-width":e.columnConfig.minWidth,"show-overflow-tooltip":e.columnConfig.showOverflowTooltip,align:e.columnConfig.align,"class-name":e.columnConfig.className,"render-header":e.columnConfig.renderHeader},scopedSlots:e._u([e.columnConfig.children?null:{key:"default",fn:function(t){return[n("el-form-item",{attrs:{"label-width":"0px",rules:e.columnConfig.rules,prop:e.tabConfig.name+"."+t.$index+"."+e.columnConfig.name}},[e.columnConfig.slot?e._t(e.columnConfig.name,null,null,t):e.columnConfig.xType?n(e.getComponentType(e.columnConfig),{tag:"component",style:e.columnConfig.style,attrs:{config:e.columnConfig},model:{value:t.row[e.columnConfig.name],callback:function(n){e.$set(t.row,e.columnConfig.name,n)},expression:"scope.row[columnConfig.name]"}}):n("span",[e._v(e._s(e.filterTableData(t.row[e.columnConfig.name])))])],2)]}}],null,!0)},[e.columnConfig.children?e._l(e.columnConfig.children,(function(t,i){return n("xColumn",{key:t.name||i,attrs:{"tab-config":e.tabConfig,config:t},scopedSlots:e._u([t.slot?{key:t.name,fn:function(n){return[e._t(t.name,null,null,n)]}}:null],null,!0)})})):e._e(),e.columnConfig.children?e._e():n("template",{slot:"header"},[e._v(" "+e._s(e.columnConfig.label)+" "),e.columnConfig.tooltip?n("el-tooltip",{attrs:{effect:e.tooltipConfig.effect,placement:e.tooltipConfig.placement}},[n("div",{attrs:{slot:"content"},slot:"content"},[n("span",{domProps:{innerHTML:e._s(e.columnConfig.tooltip)}})]),n("i",{class:e.tooltipConfig.iconName,style:e.tooltipConfig.iconStyle})]):e._e()],1)],2):e._e()},ot=[];function at(e,t){var n="label",i="value";if((e.data||e.label||e.value)&&(e.label&&(n=e.label),e.value&&(i=e.value),e=e.data),e)for(var r=0;r<e.length;r++)if(e[r][i]===t)return e[r][n];return""}var st={name:"XColumn",components:{xCascader:w,xCheckbox:T,xColorPicker:B,xDatePicker:L,xInput:W,xAutocomplete:Z,xInputNumber:ie,xRadio:ue,xRate:me,xSelect:we,xSlider:Te,xSwitch:Be,xTimePicker:Le,xTimeSelect:We,xTransfer:Ze,xTree:it},mixins:[f()],props:{config:{type:Object,default:function(){}},tabConfig:{type:Object,default:function(){}}},computed:{columnConfig:function(){var e={};return l()(e,this.globalConfig.xform.form.tabs.table.column,this.config),e},tooltipConfig:function(){return this.globalConfig.xform.form.tooltip}},methods:{filterTableData:function(e){return this.config.dic?at(this.config.dic,e):e},getComponentType:h}},ct=st,ut=b(ct,rt,ot,!1,null,null,null),lt=ut.exports,pt={name:"XForm",components:{xCascader:w,xCheckbox:T,xColorPicker:B,xDatePicker:L,xInput:W,xAutocomplete:Z,xInputNumber:ie,xRadio:ue,xRate:me,xSelect:we,xSlider:Te,xSwitch:Be,xTimePicker:Le,xTimeSelect:We,xTransfer:Ze,xTree:it,xColumn:lt},mixins:[f()],data:function(){return{rules:{},isInitFormData:!1,activeTab:""}},computed:{computedConfig:function(){var e=this,t={};l()(t,this.globalConfig.xform.form,this.config);for(var n=function(n){var i=e.config.item[n];t.item[n]=l()({},e.globalConfig[i.xType],i),"tabs"===i.xType&&t.item[n].tabs.forEach((function(i,r){var o={};l()(o,e.globalConfig.xform.form.tabs.table,i),e.$set(t.item[n].tabs,r,o)}))},i=0;i<this.config.item.length;i++)n(i);if(this.config.operate)for(var r=0;r<this.config.operate.length;r++){var o=this.config.operate[r];t.operate[r]=l()({},this.globalConfig.xform.operate.btn,o)}return t}},created:function(){this.initFormData(),this.isInitFormData=!0},methods:{initFormData:function(){var e=this,t=["checkbox"],n=["datetimerange","daterange","monthrange"];this.config.item.forEach((function(i){i.multiple||t.includes(i.xType)||n.includes(i.type)?e.formData[i.name]||(e.formData[i.name]=[]):"tabs"===i.xType?i.tabs.forEach((function(t,n){0===n&&(e.activeTab=t.name),e.formData[t.name]||("form"===t.type?e.formData[t.name]={}:e.formData[t.name]=[])})):i.name&&void 0===e.formData[i.name]&&e.$set(e.formData,i.name,"")})),this.formData=JSON.parse(JSON.stringify(this.formData))},getComponentType:h,resetFields:function(){this.$refs["refForm"].resetFields()},clearValidate:function(){this.$refs["refForm"].clearValidate()},validate:function(e){var t=this,n=new Promise((function(n,i){t.$refs["refForm"].validate((function(r,o){if(r)(function(){for(var e=Object.keys(t.$refs).filter((function(e){return/_XForm$/.test(e)})),r=function(r){t.$refs[e[r]][0].validate((function(o){o?n():(t.activeTab=e[r].replace(/_XForm$/,""),i())}))},o=0;o<e.length;o++)r(o);n()})();else{for(var a in o)/\.\d\./.test(a)&&(t.activeTab=a.split(".")[0]);i()}e&&e(r,o)}))}));if(void 0===e)return n},addDynamic:function(e,t){e?e(t):t.splice(t.length,0,{})},operateShow:function(e,t){return"boolean"===typeof e.show?e.show:"function"!==typeof e.show||e.show(t)},childFormConfig:function(e){return l()({disabled:this.computedConfig.disabled},e)}}},dt=pt,ft=(n("b372"),b(dt,a,s,!1,null,null,null)),ht=ft.exports;ht.install=function(e){e.component(ht.name,ht)};var mt=ht,vt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e.formConfig?n("x-form",{ref:"xForm",attrs:{config:e.formConfig},model:{value:e.formData,callback:function(t){e.formData=t},expression:"formData"}}):e._e(),e._t("middle"),e.tableBtn?n("el-row",{staticStyle:{margin:"5px"}},[e._l(e.tableBtn,(function(t,i){return[e.computeBoolen(t.show,!0)?n("el-button",{key:i,attrs:{size:t.size,type:t.type,plain:t.plain,round:t.round,circle:t.circle,loading:t.loading,disabled:t.disabled,icon:t.icon,autofocus:t.autofocus,"native-type":t.nativeType},on:{click:function(e){return t.click()}}},[e._v(" "+e._s(t.text)+" ")]):e._e()]}))],2):e._e(),n("el-table",{ref:"table",attrs:{data:e.data,height:e.computedConfig.height,"max-height":e.computedConfig.maxHeight,stripe:e.computedConfig.stripe,border:e.computedConfig.border,size:e.computedConfig.size,fit:e.computedConfig.fit,"show-header":e.computedConfig.showHeader,"highlight-current-row":e.computedConfig.highlightCurrentRow,"current-row-key":e.computedConfig.currentRowKey,"row-class-name":e.computedConfig.rowClassName,"row-style":e.computedConfig.rowStyle,"cell-class-name":e.computedConfig.cellClassName,"cell-style":e.computedConfig.cellStyle,"header-row-class-name":e.computedConfig.headerRowClassName,"header-row-style":e.computedConfig.headerRowStyle,"header-cell-class-name":e.computedConfig.headerCellClassName,"header-cell-style":e.computedConfig.headerCellStyle,"row-key":e.computedConfig.rowKey,"empty-text":e.computedConfig.emptyText,"default-expand-all":e.computedConfig.defaultExpandAll,"expand-row-keys":e.computedConfig.expandRowKeys,"default-sort":e.computedConfig.defaultSort,"tooltip-effect":e.computedConfig.tooltipEffect,"show-summary":e.computedConfig.showSummary,"sum-text":e.computedConfig.sumText,"summary-method":e.computedConfig.summaryMethod,"span-method":e.computedConfig.spanMethod,"select-on-indeterminate":e.computedConfig.selectOnIndeterminate,indent:e.computedConfig.indent,lazy:e.computedConfig.lazy,load:e.computedConfig.load,"tree-props":e.computedConfig.treeProps},on:{select:function(t,n){return e.computeFunction(e.computedConfig.select,t,n)},"select-all":function(t){return e.computeFunction(e.computedConfig.selectAll,t)},"selection-change":function(t){return e.computeFunction(e.computedConfig.selectionChange,t)},"cell-mouse-enter":function(t,n,i,r){return e.computeFunction(e.computedConfig.cellMouseEnter,t,n,i,r)},"cell-mouse-leave":function(t,n,i,r){return e.computeFunction(e.computedConfig.cellMouseLeave,t,n,i,r)},"cell-click":function(t,n,i,r){return e.computeFunction(e.computedConfig.cellClick,t,n,i,r)},"cell-dblclick":function(t,n,i,r){return e.computeFunction(e.computedConfig.cellDblclick,t,n,i,r)},"row-click":function(t,n,i){return e.computeFunction(e.computedConfig.rowClick,t,n,i)},"row-contextmenu":function(t,n,i){return e.computeFunction(e.computedConfig.rowContextmenu,t,n,i)},"row-dblclick":function(t,n,i){return e.computeFunction(e.computedConfig.rowDblclick,t,n,i)},"header-click":function(t,n){return e.computeFunction(e.computedConfig.headerClick,t,n)},"header-contextmenu":function(t,n){return e.computeFunction(e.computedConfig.headerContextmenu,t,n)},"sort-change":function(t){return e.computeFunction(e.computedConfig.sortChange,t)},"filter-change":function(t){return e.computeFunction(e.computedConfig.filterChange,t)},"current-change":function(t,n){return e.computeFunction(e.computedConfig.currentChange,t,n)},"header-dragend":function(t,n,i,r){return e.computeFunction(e.computedConfig.headerDragend,t,n,i,r)},"expand-change":function(t,n){return e.computeFunction(e.computedConfig.expandChange,t,n)}}},[e._l(e.computedConfig.column,(function(t,i){return[n("xColumn",{key:i,attrs:{config:t},scopedSlots:e._u([t.slot?{key:t.name,fn:function(n){return[e._t(t.name,null,null,n)]}}:null],null,!0)})]})),e.operateConfig?n("el-table-column",{attrs:{label:e.operateConfig.label,width:e.operateConfig.width,"min-width":e.operateConfig.minWidth,fixed:e.operateConfig.fixed,"render-header":e.operateConfig.renderHeader,resizable:e.operateConfig.resizable,align:e.operateConfig.align,"header-align":e.operateConfig.headerAlign,"class-name":e.operateConfig.className,"label-class-name":e.operateConfig.labelClassName},scopedSlots:e._u([{key:"default",fn:function(t){return[e._l(e.operateConfig.btn,(function(i,r){return[e.operateShow(i,t.row)?n("el-button",{key:r,attrs:{size:i.size,type:i.type,plain:i.plain,round:i.round,circle:i.circle,loading:i.loading,disabled:i.disabled,icon:i.icon,autofocus:i.autofocus,"native-type":i.nativeType},on:{click:function(e){return i.click(t.row,t.$index)}}},[e._v(" "+e._s(i.text)+" ")]):e._e()]})),e.operateDropdownShow(t.row)?[n("el-dropdown",{class:e.operateConfig.dropdown.config.className,attrs:{placement:e.operateConfig.dropdown.config.placement,trigger:e.operateConfig.dropdown.config.trigger,"hide-on-click":e.operateConfig.dropdown.config.hideOnClick,"show-timeout":e.operateConfig.dropdown.config.showTimeout,"hide-timeout":e.operateConfig.dropdown.config.hideTimeout,tabindex:e.operateConfig.dropdown.config.tabindex},on:{command:function(n){return e.handleDropdownCommand(n,t.row)}}},[n("span",{staticClass:"el-dropdown-link"},[e._v(" "+e._s(e.operateConfig.dropdown.config.text)),n("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),n("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[e._l(e.operateConfig.dropdown.btn,(function(i,r){return[e.operateShow(i,t.row)?n("el-dropdown-item",{key:r,attrs:{divided:e.operateConfig.dropdown.config.divided,disabled:i.disabled,icon:i.icon,command:r}},[e._v(" "+e._s(i.text)+" ")]):e._e()]}))],2)],1)]:e._e()]}}],null,!1,3671975447)}):e._e()],2),e.page&&e.page.total?n("div",{staticClass:"block foot"},[n("el-pagination",{staticStyle:{"margin-top":"8px"},attrs:{"current-page":e.page.pageNum,"page-sizes":e.page.pageSizes,"page-size":e.page.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.page.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1):e._e()],2)},gt=[];function yt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function bt(e,t){if(e){if("string"===typeof e)return yt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yt(e,t):void 0}}function xt(e,t){var n;if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=bt(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n["return"]||n["return"]()}finally{if(s)throw o}}}}n("841c"),n("a630"),n("fb6a"),n("25f0");var wt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.computeBoolen(e.computedConfig.show,!0)?n("el-table-column",{attrs:{type:e.computedConfig.type,index:e.computedConfig.index,"column-key":e.computedConfig.columnKey,label:e.computedConfig.label,prop:e.computedConfig.name,width:e.computedConfig.width,"min-width":e.computedConfig.minWidth,fixed:e.computedConfig.fixed,"render-header":e.computedConfig.renderHeader,sortable:e.computedConfig.sortable,"sort-method":e.computedConfig.sortMethod,"sort-by":e.computedConfig.sortBy,"sort-orders":e.computedConfig.sortOrders,resizable:e.computedConfig.resizable,formatter:function(t,n,i,r){return e.computedConfig.formatter?e.computedConfig.formatter(t,n,i,r):e.filterTableData(t,n,i,r,e.config)},"show-overflow-tooltip":e.computedConfig.showOverflowTooltip,align:e.computedConfig.align,"header-align":e.computedConfig.headerAlign,"class-name":e.computedConfig.className,"label-class-name":e.computedConfig.labelClassName,selectable:e.computedConfig.selectable,"reserve-selection":e.computedConfig.reserveSelection,filters:e.computedConfig.filters,"filter-placement":e.computedConfig.filterPlacement,"filter-multiple":e.computedConfig.filterMultiple,"filter-method":e.computedConfig.filterMethod,"filtered-value":e.computedConfig.filteredValue},scopedSlots:e._u([e.computedConfig.slot?{key:"default",fn:function(t){return[e._t(e.computedConfig.name,null,null,t)]}}:null],null,!0)},[e.computedConfig.children?e._l(e.computedConfig.children,(function(t,i){return n("xColumn",{key:i,attrs:{config:t},scopedSlots:e._u([t.slot?{key:t.name,fn:function(n){return[e._t(t.name,null,null,n)]}}:null],null,!0)})})):e._e()],2):e._e()},_t=[],Et={name:"XColumn",mixins:[f()],props:{config:{type:Object,default:function(){}}},computed:{computedConfig:function(){var e={};return l()(e,this.globalConfig.xtable.column,this.config),e}},methods:{filterTableData:function(e,t,n,i,r){if(e)return r.dic?at(r.dic,n):n}}},Ct=Et,St=b(Ct,wt,_t,!1,null,null,null),At=St.exports,Tt=n("cd3f"),kt=n.n(Tt),Rt={name:"XTable",components:{xForm:ht,xColumn:At},mixins:[f()],props:{data:{type:Array,default:function(){return[]}},page:{type:Object,default:null},load:{type:Function,default:function(){}}},data:function(){return{}},computed:{formConfig:function(){var e=this,t={item:[],operate:[]},n=l()({},this.globalConfig.xtable.search,this.config.search);if(l()(t,n.form),!1!==this.config.searchBtn){var i=l()({},n.btn,n.btn.searchBtn,{click:e.search});t.operate.push(i)}if(!1!==this.config.resetBtn){var r=l()({},n.btn,n.btn.resetBtn,{click:e.reset});t.operate.push(r)}return this.config.btn&&this.config.btn.forEach((function(e){var i=l()({},n.btn,e);t.operate.push(i)})),this.config.column.forEach((function(e){if(e.search){var n=kt()(e);delete n.show,t.item.push(n)}})),!!t.item.length&&t},tableBtn:function(){var e=this;return!!(this.config.tableBtn&&this.config.tableBtn.length>0)&&this.config.tableBtn.map((function(t){return l()({},e.globalConfig.xtable.btn,t)}))},computedConfig:function(){var e={};return l()(e,this.globalConfig.xtable.table,this.config),e},operateConfig:function(){if(!this.config.operate||!this.config.operate.length)return null;var e={};if(l()(e,this.globalConfig.xtable.column,this.globalConfig.xtable.operate.column),e.btn=[],e.dropdown={config:this.globalConfig.xtable.operate.dropdown,btn:[]},this.config.operate){var t,n=xt(this.config.operate);try{for(n.s();!(t=n.n()).done;){var i=t.value,r=l()({},this.globalConfig.xtable.operate.btn,i);!0===r.dropdown?e.dropdown.btn.push(r):e.btn.push(r)}}catch(o){n.e(o)}finally{n.f()}}return e}},methods:{reset:function(){this.page&&(this.page.pageNum=1),this.$refs["xForm"].resetFields(),this.getList()},operateShow:function(e,t){return"boolean"===typeof e.show?e.show:"function"===typeof e.show?e.show(t):this.globalConfig.xtable.operate.btn.show},operateDropdownShow:function(e){var t=this,n=this.operateConfig.dropdown.btn.filter((function(n){return"boolean"===typeof n.show?n.show:"function"===typeof n.show?n.show(e):t.globalConfig.xtable.operate.dropdown.show}));return n.length>0},handleDropdownCommand:function(e,t){this.operateConfig.dropdown.btn[e].click(t)},search:function(){this.page&&(this.page.pageNum=1),this.getList()},getList:function(){this.load()},handleSizeChange:function(e){this.page.pageSize=e,this.$emit("update:page",this.page),this.getList()},handleCurrentChange:function(e){this.page.pageNum=e,this.$emit("update:page",this.page),this.getList()},clearSelection:function(){this.$refs.table.clearSelection()},toggleRowSelection:function(e,t){this.$refs.table.toggleRowSelection(e,t)},toggleAllSelection:function(){this.$refs.table.toggleAllSelection()},toggleRowExpansion:function(e,t){this.$refs.table.toggleRowExpansion(e,t)},setCurrentRow:function(e){this.$refs.table.setCurrentRow(e)},clearSort:function(){this.$refs.table.clearSort()},clearFilter:function(e){this.$refs.table.clearFilter(e)},doLayout:function(){this.$refs.table.doLayout()},sort:function(e,t){this.$refs.table.sort(e,t)}}},Pt=Rt,Dt=(n("be52"),b(Pt,vt,gt,!1,null,"d5bf0506",null)),Mt=Dt.exports;Mt.install=function(e){e.component(Mt.name,Mt)};var Bt=Mt,Ot=[mt,Bt];function jt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};d.set(t),Ot.map((function(t){e.component(t.name,t)}))}var Nt={install:jt,xForm:mt,xTable:Bt};t["default"]=Nt},fb6a:function(e,t,n){"use strict";var i=n("23e7"),r=n("861d"),o=n("e8b5"),a=n("23cb"),s=n("50c4"),c=n("fc6a"),u=n("8418"),l=n("b622"),p=n("1dde"),d=n("ae40"),f=p("slice"),h=d("slice",{ACCESSORS:!0,0:0,1:2}),m=l("species"),v=[].slice,g=Math.max;i({target:"Array",proto:!0,forced:!f||!h},{slice:function(e,t){var n,i,l,p=c(this),d=s(p.length),f=a(e,d),h=a(void 0===t?d:t,d);if(o(p)&&(n=p.constructor,"function"!=typeof n||n!==Array&&!o(n.prototype)?r(n)&&(n=n[m],null===n&&(n=void 0)):n=void 0,n===Array||void 0===n))return v.call(p,f,h);for(i=new(void 0===n?Array:n)(g(h-f,0)),l=0;f<h;f++,l++)f in p&&u(i,l,p[f]);return i.length=l,i}})},fc6a:function(e,t,n){var i=n("44ad"),r=n("1d80");e.exports=function(e){return i(r(e))}},fdbc:function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},fdbf:function(e,t,n){var i=n("4930");e.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},fe74:function(e,t,n){"use strict";var i=n("a480"),r=n.n(i);r.a},fea9:function(e,t,n){var i=n("da84");e.exports=i.Promise}})}))},a8b6:function(e,t,n){"use strict";var i=n("da81"),r=n.n(i);const o={input:{disabled:!1,type:"text",valueKey:"value",debounce:300,placement:"bottom-start",triggerOnFocus:!0,selectWhenUnmatched:!1,maxlength:null,minlength:null,showWordLimit:!1,placeholder:null,clearable:!1,size:"medium",rows:3,autosize:!1,autocomplete:"off",resize:"none",validateEvent:!0,hideLoading:!1,popperAppendToBody:!0,highlightFirstItem:!1},autocomplete:{disabled:!1,placeholder:null,valueKey:"value",debounce:300,placement:"bottom-start",fetchSuggestions:null,popperClass:null,triggerOnFocus:!0,name:null,selectWhenUnmatched:!1,label:null,prefixIcon:null,suffixIcon:null,hideLoading:!1,popperAppendToBody:!0,highlightFirstItem:!1,maxlength:null,minlength:null,clearable:!1,size:"medium",rows:3,autosize:!1,autocomplete:"off",resize:"none",validateEvent:!0},select:{disabled:!1,multiple:!1,valueKey:"value",size:"medium",clearable:!1,collapseTags:!1,multipleLimit:0,autocomplete:"off",placeholder:"请选择",filterable:!1,allowCreate:!1,remote:!1,loading:!1,loadingText:"加载中",noMatchText:"无匹配数据",noDataText:"无数据",reserveKeyword:!1,defaultFirstOption:!1,popperAppendToBody:!0,automaticDropdown:!1},datePicker:{disabled:!1,readonly:!1,editable:!0,clearable:!0,size:"",placeholder:"请选择日期",startPlaceholder:"开始时间",endPlaceholder:"结束时间",type:"date",format:"",align:"left",pickerOptions:{},rangeSeparator:":",valueFormat:"",unlinkPanels:!1,prefixIcon:"el-icon-date",clearIcon:"el-icon-circle-close",validateEvent:!0},checkbox:{disabled:!1,size:"medium",min:void 0,max:void 0,textColor:"#ffffff",fill:"#409EFF",border:!1},radio:{disabled:!1,border:!1,size:"medium",textColor:"#ffffff",fill:"#409EFF"},cascader:{disabled:!1,size:"medium",placeholder:"请选择",clearable:!1,showAllLevels:!0,collapseTags:!1,separator:" / ",debounce:300},switch:{disabled:!1,width:40,activeValue:!0,inactiveValue:!1,activeColor:"#409EFF",inactiveColor:"#C0CCDA",validateEvent:!0},inputNumber:{disabled:!1,min:"-Infinity",max:"Infinity",step:1,stepStrictly:!1,precision:null,size:"medium",controls:!0,controlsPosition:null,placeholder:null},slider:{disabled:!1,min:0,max:100,step:1,showInput:!1,showInputControls:!0,inputSize:"small",showStops:!1,showTooltip:!0,range:!1,vertical:!1,height:null,label:null,debounce:300,marks:null},timePicker:{disabled:!1,editable:!0,clearable:!0,size:"medium",placeholder:"",align:"left",startPlaceholder:"",endPlaceholder:"",isRange:!1,arrowControl:!1,pickerOptions:{},rangeSeparator:":",valueFormat:"",prefixIcon:"el-icon-time",clearIcon:"el-icon-circle-close",selectableRange:null,format:"HH:mm:ss"},timeSelect:{disabled:!1,editable:!0,clearable:!0,size:"medium",placeholder:"",align:"left",startPlaceholder:"",endPlaceholder:"",isRange:!1,arrowControl:!1,pickerOptions:{},rangeSeparator:":",valueFormat:"",prefixIcon:"el-icon-time",clearIcon:"el-icon-circle-close",start:"09:00",end:"18:00",step:"00:30",minTime:"00:00",maxTime:null},rate:{disabled:!1,max:5,texts:["极差","失望","一般","满意","惊喜"],colors:["#F7BA2A","#F7BA2A","#F7BA2A"],allowHalf:!1,lowThreshold:2,highThreshold:4,voidColor:"#C6D1DE",iconClasses:["el-icon-star-on","el-icon-star-on","el-icon-star-on"],showText:!1,showScore:!1,textColor:"#1F2D3D",scoreTemplate:"{value}",disabledVoidColor:"#EFF2F7",voidIconClass:"el-icon-star-off",disabledVoidIconClass:"el-icon-star-on"},colorPicker:{disabled:!1,size:"medium",predefine:null,showAlpha:!1,colorFormat:"hex"},transfer:{disabled:!1,filterable:!1,filterPlaceholder:"请输入搜索内容",targetOrder:"original",titles:["列表 1","列表 2"],buttonTexts:[],format:{noChecked:"${checked}/${total}",hasChecked:"${checked}/${total}"},props:null},xtable:{btn:{size:"medium",type:"primary",plain:!1,round:!1,circle:!1,loading:!1,disabled:!1,icon:null,autofocus:!1,nativeType:"button"},table:{height:null,maxHeight:null,stripe:!1,border:!1,size:"medium",fit:!0,showHeader:!0,highlightCurrentRow:!1,rowClassName:null,rowStyle:null,cellClassName:null,cellStyle:null,headerRowClassName:null,headerRowStyle:null,headerCellClassName:null,headerCellStyle:null,emptyText:"暂无数据",defaultExpandAll:!1,defaultSort:{order:"ascending"},tooltipEffect:"dark",showSummary:!1,sumText:"合计",selectOnIndeterminate:!0,indent:16,treeProps:{hasChildren:"hasChildren",children:"children"}},column:{width:null,minWidth:null,fixed:!1,sortable:!1,sortOrders:["ascending","descending",null],resizable:!0,showOverflowTooltip:!1,align:"center",headerAlign:"center",className:null,labelClassName:null,reserveSelection:!1,filterPlacement:null,filterMultiple:!0},search:{form:{inline:!0,labelPosition:"right",labelWidth:"auto",labelSuffix:void 0,hideRequiredAsterisk:!1,showMessage:!0,inlineMessage:!1,statusIcon:!1,validateOnRuleChange:!0,size:"medium",disabled:!1,itemStyle:"width: 200px;"},btn:{size:"medium",type:"primary",plain:!1,round:!1,circle:!1,loading:!1,disabled:!1,icon:null,autofocus:!1,nativeType:"button",searchBtn:{show:!0,text:"搜索",icon:"el-icon-search"},resetBtn:{show:!0,text:"重置",icon:"el-icon-refresh-right"}}},operate:{column:{label:"操作"},btn:{size:"medium",type:"primary",plain:!1,round:!1,circle:!1,loading:!1,disabled:!1,icon:null,autofocus:!1,nativeType:"button"},dropdown:{className:"",text:"更多",placement:"bottom-end",trigger:"hover",hideOnClick:!0,showTimeout:250,hideTimeout:150,tabindex:0,divided:!1}}},xform:{form:{inline:!1,labelPosition:"right",labelWidth:"120px",labelSuffix:void 0,hideRequiredAsterisk:!1,showMessage:!0,inlineMessage:!1,statusIcon:!1,validateOnRuleChange:!0,size:"medium",disabled:!1,itemStyle:"max-width: 300px; width: 100%;",tooltip:{effect:"dark",placement:"top-start",iconName:"el-icon-info",iconStyle:"color: #409EFF"},tabs:{type:"border-card",closable:!1,addable:!1,editable:!1,tabPosition:"top",stretch:!1,table:{height:null,maxHeight:null,stripe:!1,border:!0,size:"medium",fit:!0,showHeader:!0,highlightCurrentRow:!1,rowClassName:null,rowStyle:null,cellClassName:null,cellStyle:null,headerRowClassName:null,headerRowStyle:null,headerCellClassName:null,headerCellStyle:null,emptyText:"暂无数据",defaultExpandAll:!1,defaultSort:{order:"ascending"},tooltipEffect:"dark",showSummary:!1,sumText:"合计",selectOnIndeterminate:!0,indent:16,treeProps:{hasChildren:"hasChildren",children:"children"},column:{width:null,minWidth:null,showOverflowTooltip:!1,align:"center",headerAlign:"center",className:null,style:"width: 100%"},addConfig:{show:!0,type:"primary",icon:"",text:"新增",size:"mini",circle:!1,style:"margin-bottom:14px;",className:"",click:(e,t)=>{e?e(t):t.splice(t.length,0,{})}},operate:{show:!0,label:"操作",width:"60px",headerAlign:"center",align:"center",btn:[{type:"danger",icon:"el-icon-close",text:"",size:"mini",circle:!0,style:"",className:"",click:(e,t,n)=>{n?n(e,t):e.splice(t,1)}}]}}}},operate:{btn:{size:"medium",type:"primary",plain:!1,round:!1,circle:!1,loading:!1,disabled:!1,icon:null,autofocus:!1,nativeType:"button"}}}};t["a"]={get:()=>o,set:e=>{r()(o,e)}}},c8b5:function(e,t,n){var i;
|
|
/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
* http://hammerjs.github.io/
|
|
*
|
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
* Licensed under the MIT license */(function(r,o,a,s){"use strict";var c,u=["","webkit","Moz","MS","ms","o"],l=o.createElement("div"),p="function",d=Math.round,f=Math.abs,h=Date.now;function m(e,t,n){return setTimeout(_(e,n),t)}function v(e,t,n){return!!Array.isArray(e)&&(g(e,n[t],n),!0)}function g(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s){i=0;while(i<e.length)t.call(n,e[i],i,e),i++}else for(i in e)e.hasOwnProperty(i)&&t.call(n,e[i],i,e)}function y(e,t,n){var i="DEPRECATED METHOD: "+t+"\n"+n+" AT \n";return function(){var t=new Error("get-stack-trace"),n=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=r.console&&(r.console.warn||r.console.log);return o&&o.call(r.console,i,n),e.apply(this,arguments)}}c="function"!==typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(i!==s&&null!==i)for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r])}return t}:Object.assign;var b=y((function(e,t,n){var i=Object.keys(t),r=0;while(r<i.length)(!n||n&&e[i[r]]===s)&&(e[i[r]]=t[i[r]]),r++;return e}),"extend","Use `assign`."),x=y((function(e,t){return b(e,t,!0)}),"merge","Use `assign`.");function w(e,t,n){var i,r=t.prototype;i=e.prototype=Object.create(r),i.constructor=e,i._super=r,n&&c(i,n)}function _(e,t){return function(){return e.apply(t,arguments)}}function E(e,t){return typeof e==p?e.apply(t&&t[0]||s,t):e}function C(e,t){return e===s?t:e}function S(e,t,n){g(R(t),(function(t){e.addEventListener(t,n,!1)}))}function A(e,t,n){g(R(t),(function(t){e.removeEventListener(t,n,!1)}))}function T(e,t){while(e){if(e==t)return!0;e=e.parentNode}return!1}function k(e,t){return e.indexOf(t)>-1}function R(e){return e.trim().split(/\s+/g)}function P(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);var i=0;while(i<e.length){if(n&&e[i][n]==t||!n&&e[i]===t)return i;i++}return-1}function D(e){return Array.prototype.slice.call(e,0)}function M(e,t,n){var i=[],r=[],o=0;while(o<e.length){var a=t?e[o][t]:e[o];P(r,a)<0&&i.push(e[o]),r[o]=a,o++}return n&&(i=t?i.sort((function(e,n){return e[t]>n[t]})):i.sort()),i}function B(e,t){var n,i,r=t[0].toUpperCase()+t.slice(1),o=0;while(o<u.length){if(n=u[o],i=n?n+r:t,i in e)return i;o++}return s}var O=1;function j(){return O++}function N(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||r}var F=/mobile|tablet|ip(ad|hone|od)|android/i,I="ontouchstart"in r,L=B(r,"PointerEvent")!==s,z=I&&F.test(navigator.userAgent),$="touch",H="pen",G="mouse",V="kinect",W=25,U=1,q=2,K=4,Y=8,X=1,Z=2,J=4,Q=8,ee=16,te=Z|J,ne=Q|ee,ie=te|ne,re=["x","y"],oe=["clientX","clientY"];function ae(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){E(e.options.enable,[e])&&n.handler(t)},this.init()}function se(e){var t,n=e.options.inputClass;return t=n||(L?ke:z?Ne:I?ze:Ee),new t(e,ce)}function ce(e,t,n){var i=n.pointers.length,r=n.changedPointers.length,o=t&U&&i-r===0,a=t&(K|Y)&&i-r===0;n.isFirst=!!o,n.isFinal=!!a,o&&(e.session={}),n.eventType=t,ue(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function ue(e,t){var n=e.session,i=t.pointers,r=i.length;n.firstInput||(n.firstInput=de(t)),r>1&&!n.firstMultiple?n.firstMultiple=de(t):1===r&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,s=a?a.center:o.center,c=t.center=fe(i);t.timeStamp=h(),t.deltaTime=t.timeStamp-o.timeStamp,t.angle=ge(s,c),t.distance=ve(s,c),le(n,t),t.offsetDirection=me(t.deltaX,t.deltaY);var u=he(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=u.x,t.overallVelocityY=u.y,t.overallVelocity=f(u.x)>f(u.y)?u.x:u.y,t.scale=a?be(a.pointers,i):1,t.rotation=a?ye(a.pointers,i):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,pe(n,t);var l=e.element;T(t.srcEvent.target,l)&&(l=t.srcEvent.target),t.target=l}function le(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},o=e.prevInput||{};t.eventType!==U&&o.eventType!==K||(r=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}function pe(e,t){var n,i,r,o,a=e.lastInterval||t,c=t.timeStamp-a.timeStamp;if(t.eventType!=Y&&(c>W||a.velocity===s)){var u=t.deltaX-a.deltaX,l=t.deltaY-a.deltaY,p=he(c,u,l);i=p.x,r=p.y,n=f(p.x)>f(p.y)?p.x:p.y,o=me(u,l),e.lastInterval=t}else n=a.velocity,i=a.velocityX,r=a.velocityY,o=a.direction;t.velocity=n,t.velocityX=i,t.velocityY=r,t.direction=o}function de(e){var t=[],n=0;while(n<e.pointers.length)t[n]={clientX:d(e.pointers[n].clientX),clientY:d(e.pointers[n].clientY)},n++;return{timeStamp:h(),pointers:t,center:fe(t),deltaX:e.deltaX,deltaY:e.deltaY}}function fe(e){var t=e.length;if(1===t)return{x:d(e[0].clientX),y:d(e[0].clientY)};var n=0,i=0,r=0;while(r<t)n+=e[r].clientX,i+=e[r].clientY,r++;return{x:d(n/t),y:d(i/t)}}function he(e,t,n){return{x:t/e||0,y:n/e||0}}function me(e,t){return e===t?X:f(e)>=f(t)?e<0?Z:J:t<0?Q:ee}function ve(e,t,n){n||(n=re);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function ge(e,t,n){n||(n=re);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return 180*Math.atan2(r,i)/Math.PI}function ye(e,t){return ge(t[1],t[0],oe)+ge(e[1],e[0],oe)}function be(e,t){return ve(t[0],t[1],oe)/ve(e[0],e[1],oe)}ae.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(N(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&A(this.element,this.evEl,this.domHandler),this.evTarget&&A(this.target,this.evTarget,this.domHandler),this.evWin&&A(N(this.element),this.evWin,this.domHandler)}};var xe={mousedown:U,mousemove:q,mouseup:K},we="mousedown",_e="mousemove mouseup";function Ee(){this.evEl=we,this.evWin=_e,this.pressed=!1,ae.apply(this,arguments)}w(Ee,ae,{handler:function(e){var t=xe[e.type];t&U&&0===e.button&&(this.pressed=!0),t&q&&1!==e.which&&(t=K),this.pressed&&(t&K&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:G,srcEvent:e}))}});var Ce={pointerdown:U,pointermove:q,pointerup:K,pointercancel:Y,pointerout:Y},Se={2:$,3:H,4:G,5:V},Ae="pointerdown",Te="pointermove pointerup pointercancel";function ke(){this.evEl=Ae,this.evWin=Te,ae.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(Ae="MSPointerDown",Te="MSPointerMove MSPointerUp MSPointerCancel"),w(ke,ae,{handler:function(e){var t=this.store,n=!1,i=e.type.toLowerCase().replace("ms",""),r=Ce[i],o=Se[e.pointerType]||e.pointerType,a=o==$,s=P(t,e.pointerId,"pointerId");r&U&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):r&(K|Y)&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var Re={touchstart:U,touchmove:q,touchend:K,touchcancel:Y},Pe="touchstart",De="touchstart touchmove touchend touchcancel";function Me(){this.evTarget=Pe,this.evWin=De,this.started=!1,ae.apply(this,arguments)}function Be(e,t){var n=D(e.touches),i=D(e.changedTouches);return t&(K|Y)&&(n=M(n.concat(i),"identifier",!0)),[n,i]}w(Me,ae,{handler:function(e){var t=Re[e.type];if(t===U&&(this.started=!0),this.started){var n=Be.call(this,e,t);t&(K|Y)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:$,srcEvent:e})}}});var Oe={touchstart:U,touchmove:q,touchend:K,touchcancel:Y},je="touchstart touchmove touchend touchcancel";function Ne(){this.evTarget=je,this.targetIds={},ae.apply(this,arguments)}function Fe(e,t){var n=D(e.touches),i=this.targetIds;if(t&(U|q)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,o,a=D(e.changedTouches),s=[],c=this.target;if(o=n.filter((function(e){return T(e.target,c)})),t===U){r=0;while(r<o.length)i[o[r].identifier]=!0,r++}r=0;while(r<a.length)i[a[r].identifier]&&s.push(a[r]),t&(K|Y)&&delete i[a[r].identifier],r++;return s.length?[M(o.concat(s),"identifier",!0),s]:void 0}w(Ne,ae,{handler:function(e){var t=Oe[e.type],n=Fe.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:$,srcEvent:e})}});var Ie=2500,Le=25;function ze(){ae.apply(this,arguments);var e=_(this.handler,this);this.touch=new Ne(this.manager,e),this.mouse=new Ee(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function $e(e,t){e&U?(this.primaryTouch=t.changedPointers[0].identifier,He.call(this,t)):e&(K|Y)&&He.call(this,t)}function He(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var i=this.lastTouches,r=function(){var e=i.indexOf(n);e>-1&&i.splice(e,1)};setTimeout(r,Ie)}}function Ge(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var r=this.lastTouches[i],o=Math.abs(t-r.x),a=Math.abs(n-r.y);if(o<=Le&&a<=Le)return!0}return!1}w(ze,ae,{handler:function(e,t,n){var i=n.pointerType==$,r=n.pointerType==G;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)$e.call(this,t,n);else if(r&&Ge.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Ve=B(l.style,"touchAction"),We=Ve!==s,Ue="compute",qe="auto",Ke="manipulation",Ye="none",Xe="pan-x",Ze="pan-y",Je=tt();function Qe(e,t){this.manager=e,this.set(t)}function et(e){if(k(e,Ye))return Ye;var t=k(e,Xe),n=k(e,Ze);return t&&n?Ye:t||n?t?Xe:Ze:k(e,Ke)?Ke:qe}function tt(){if(!We)return!1;var e={},t=r.CSS&&r.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(n){e[n]=!t||r.CSS.supports("touch-action",n)})),e}Qe.prototype={set:function(e){e==Ue&&(e=this.compute()),We&&this.manager.element.style&&Je[e]&&(this.manager.element.style[Ve]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return g(this.manager.recognizers,(function(t){E(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),et(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var i=this.actions,r=k(i,Ye)&&!Je[Ye],o=k(i,Ze)&&!Je[Ze],a=k(i,Xe)&&!Je[Xe];if(r){var s=1===e.pointers.length,c=e.distance<2,u=e.deltaTime<250;if(s&&c&&u)return}if(!a||!o)return r||o&&n&te||a&&n&ne?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var nt=1,it=2,rt=4,ot=8,at=ot,st=16,ct=32;function ut(e){this.options=c({},this.defaults,e||{}),this.id=j(),this.manager=null,this.options.enable=C(this.options.enable,!0),this.state=nt,this.simultaneous={},this.requireFail=[]}function lt(e){return e&st?"cancel":e&ot?"end":e&rt?"move":e&it?"start":""}function pt(e){return e==ee?"down":e==Q?"up":e==Z?"left":e==J?"right":""}function dt(e,t){var n=t.manager;return n?n.get(e):e}function ft(){ut.apply(this,arguments)}function ht(){ft.apply(this,arguments),this.pX=null,this.pY=null}function mt(){ft.apply(this,arguments)}function vt(){ut.apply(this,arguments),this._timer=null,this._input=null}function gt(){ft.apply(this,arguments)}function yt(){ft.apply(this,arguments)}function bt(){ut.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function xt(e,t){return t=t||{},t.recognizers=C(t.recognizers,xt.defaults.preset),new Et(e,t)}ut.prototype={defaults:{},set:function(e){return c(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(v(e,"recognizeWith",this))return this;var t=this.simultaneous;return e=dt(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return v(e,"dropRecognizeWith",this)||(e=dt(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(v(e,"requireFailure",this))return this;var t=this.requireFail;return e=dt(e,this),-1===P(t,e)&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(v(e,"dropRequireFailure",this))return this;e=dt(e,this);var t=P(this.requireFail,e);return t>-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 i(n){t.manager.emit(n,e)}n<ot&&i(t.options.event+lt(n)),i(t.options.event),e.additionalEvent&&i(e.additionalEvent),n>=ot&&i(t.options.event+lt(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=ct},canEmit:function(){var e=0;while(e<this.requireFail.length){if(!(this.requireFail[e].state&(ct|nt)))return!1;e++}return!0},recognize:function(e){var t=c({},e);if(!E(this.options.enable,[this,t]))return this.reset(),void(this.state=ct);this.state&(at|st|ct)&&(this.state=nt),this.state=this.process(t),this.state&(it|rt|ot|st)&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},w(ft,ut,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,i=t&(it|rt),r=this.attrTest(e);return i&&(n&Y||!r)?t|st:i||r?n&K?t|ot:t&it?t|rt:it:ct}}),w(ht,ft,{defaults:{event:"pan",threshold:10,pointers:1,direction:ie},getTouchAction:function(){var e=this.options.direction,t=[];return e&te&&t.push(Ze),e&ne&&t.push(Xe),t},directionTest:function(e){var t=this.options,n=!0,i=e.distance,r=e.direction,o=e.deltaX,a=e.deltaY;return r&t.direction||(t.direction&te?(r=0===o?X:o<0?Z:J,n=o!=this.pX,i=Math.abs(e.deltaX)):(r=0===a?X:a<0?Q:ee,n=a!=this.pY,i=Math.abs(e.deltaY))),e.direction=r,n&&i>t.threshold&&r&t.direction},attrTest:function(e){return ft.prototype.attrTest.call(this,e)&&(this.state&it||!(this.state&it)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=pt(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),w(mt,ft,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ye]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&it)},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)}}),w(vt,ut,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[qe]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance<t.threshold,r=e.deltaTime>t.time;if(this._input=e,!i||!n||e.eventType&(K|Y)&&!r)this.reset();else if(e.eventType&U)this.reset(),this._timer=m((function(){this.state=at,this.tryEmit()}),t.time,this);else if(e.eventType&K)return at;return ct},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===at&&(e&&e.eventType&K?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}}),w(gt,ft,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ye]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&it)}}),w(yt,ft,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:te|ne,pointers:1},getTouchAction:function(){return ht.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(te|ne)?t=e.overallVelocity:n&te?t=e.overallVelocityX:n&ne&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&f(t)>this.options.velocity&&e.eventType&K},emit:function(e){var t=pt(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),w(bt,ut,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ke]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance<t.threshold,r=e.deltaTime<t.time;if(this.reset(),e.eventType&U&&0===this.count)return this.failTimeout();if(i&&r&&n){if(e.eventType!=K)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||ve(this.pCenter,e.center)<t.posThreshold;this.pTime=e.timeStamp,this.pCenter=e.center,a&&o?this.count+=1:this.count=1,this._input=e;var s=this.count%t.taps;if(0===s)return this.hasRequireFailures()?(this._timer=m((function(){this.state=at,this.tryEmit()}),t.interval,this),it):at}return ct},failTimeout:function(){return this._timer=m((function(){this.state=ct}),this.options.interval,this),ct},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==at&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),xt.VERSION="2.0.7",xt.defaults={domEvents:!1,touchAction:Ue,enable:!0,inputTarget:null,inputClass:null,preset:[[gt,{enable:!1}],[mt,{enable:!1},["rotate"]],[yt,{direction:te}],[ht,{direction:te},["swipe"]],[bt],[bt,{event:"doubletap",taps:2},["tap"]],[vt]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var wt=1,_t=2;function Et(e,t){this.options=c({},xt.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=se(this),this.touchAction=new Qe(this,this.options.touchAction),Ct(this,!0),g(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Ct(e,t){var n,i=e.element;i.style&&(g(e.options.cssProps,(function(r,o){n=B(i.style,o),t?(e.oldCssProps[n]=i.style[n],i.style[n]=r):i.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}function St(e,t){var n=o.createEvent("Event");n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}Et.prototype={set:function(e){return c(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?_t:wt},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var i=this.recognizers,r=t.curRecognizer;(!r||r&&r.state&at)&&(r=t.curRecognizer=null);var o=0;while(o<i.length)n=i[o],t.stopped===_t||r&&n!=r&&!n.canRecognizeWith(r)?n.reset():n.recognize(e),!r&&n.state&(it|rt|ot)&&(r=t.curRecognizer=n),o++}},get:function(e){if(e instanceof ut)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(v(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(v(e,"remove",this))return this;if(e=this.get(e),e){var t=this.recognizers,n=P(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==s&&t!==s){var n=this.handlers;return g(R(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==s){var n=this.handlers;return g(R(e),(function(e){t?n[e]&&n[e].splice(P(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&St(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};var i=0;while(i<n.length)n[i](t),i++}},destroy:function(){this.element&&Ct(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},c(xt,{INPUT_START:U,INPUT_MOVE:q,INPUT_END:K,INPUT_CANCEL:Y,STATE_POSSIBLE:nt,STATE_BEGAN:it,STATE_CHANGED:rt,STATE_ENDED:ot,STATE_RECOGNIZED:at,STATE_CANCELLED:st,STATE_FAILED:ct,DIRECTION_NONE:X,DIRECTION_LEFT:Z,DIRECTION_RIGHT:J,DIRECTION_UP:Q,DIRECTION_DOWN:ee,DIRECTION_HORIZONTAL:te,DIRECTION_VERTICAL:ne,DIRECTION_ALL:ie,Manager:Et,Input:ae,TouchAction:Qe,TouchInput:Ne,MouseInput:Ee,PointerEventInput:ke,TouchMouseInput:ze,SingleTouchInput:Me,Recognizer:ut,AttrRecognizer:ft,Tap:bt,Pan:ht,Swipe:yt,Pinch:mt,Rotate:gt,Press:vt,on:S,off:A,each:g,merge:x,extend:b,assign:c,inherit:w,bindFn:_,prefixed:B});var At="undefined"!==typeof r?r:"undefined"!==typeof self?self:{};At.Hammer=xt,i=function(){return xt}.call(t,n,t,e),i===s||(e.exports=i)})(window,document)},da81:function(e,t,n){(function(e,n){var i=200,r="__lodash_hash_undefined__",o=800,a=16,s=9007199254740991,c="[object Arguments]",u="[object Array]",l="[object AsyncFunction]",p="[object Boolean]",d="[object Date]",f="[object Error]",h="[object Function]",m="[object GeneratorFunction]",v="[object Map]",g="[object Number]",y="[object Null]",b="[object Object]",x="[object Proxy]",w="[object RegExp]",_="[object Set]",E="[object String]",C="[object Undefined]",S="[object WeakMap]",A="[object ArrayBuffer]",T="[object DataView]",k="[object Float32Array]",R="[object Float64Array]",P="[object Int8Array]",D="[object Int16Array]",M="[object Int32Array]",B="[object Uint8Array]",O="[object Uint8ClampedArray]",j="[object Uint16Array]",N="[object Uint32Array]",F=/[\\^$.*+?()[\]{}|]/g,I=/^\[object .+?Constructor\]$/,L=/^(?:0|[1-9]\d*)$/,z={};z[k]=z[R]=z[P]=z[D]=z[M]=z[B]=z[O]=z[j]=z[N]=!0,z[c]=z[u]=z[A]=z[p]=z[T]=z[d]=z[f]=z[h]=z[v]=z[g]=z[b]=z[w]=z[_]=z[E]=z[S]=!1;var $="object"==typeof e&&e&&e.Object===Object&&e,H="object"==typeof self&&self&&self.Object===Object&&self,G=$||H||Function("return this")(),V=t&&!t.nodeType&&t,W=V&&"object"==typeof n&&n&&!n.nodeType&&n,U=W&&W.exports===V,q=U&&$.process,K=function(){try{var e=W&&W.require&&W.require("util").types;return e||q&&q.binding&&q.binding("util")}catch(t){}}(),Y=K&&K.isTypedArray;function X(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Z(e,t){var n=-1,i=Array(e);while(++n<e)i[n]=t(n);return i}function J(e){return function(t){return e(t)}}function Q(e,t){return null==e?void 0:e[t]}function ee(e,t){return function(n){return e(t(n))}}var te=Array.prototype,ne=Function.prototype,ie=Object.prototype,re=G["__core-js_shared__"],oe=ne.toString,ae=ie.hasOwnProperty,se=function(){var e=/[^.]+$/.exec(re&&re.keys&&re.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),ce=ie.toString,ue=oe.call(Object),le=RegExp("^"+oe.call(ae).replace(F,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pe=U?G.Buffer:void 0,de=G.Symbol,fe=G.Uint8Array,he=pe?pe.allocUnsafe:void 0,me=ee(Object.getPrototypeOf,Object),ve=Object.create,ge=ie.propertyIsEnumerable,ye=te.splice,be=de?de.toStringTag:void 0,xe=function(){try{var e=xt(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),we=pe?pe.isBuffer:void 0,_e=Math.max,Ee=Date.now,Ce=xt(G,"Map"),Se=xt(Object,"create"),Ae=function(){function e(){}return function(t){if(!Gt(t))return{};if(ve)return ve(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Te(e){var t=-1,n=null==e?0:e.length;this.clear();while(++t<n){var i=e[t];this.set(i[0],i[1])}}function ke(){this.__data__=Se?Se(null):{},this.size=0}function Re(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Pe(e){var t=this.__data__;if(Se){var n=t[e];return n===r?void 0:n}return ae.call(t,e)?t[e]:void 0}function De(e){var t=this.__data__;return Se?void 0!==t[e]:ae.call(t,e)}function Me(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Se&&void 0===t?r:t,this}function Be(e){var t=-1,n=null==e?0:e.length;this.clear();while(++t<n){var i=e[t];this.set(i[0],i[1])}}function Oe(){this.__data__=[],this.size=0}function je(e){var t=this.__data__,n=et(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():ye.call(t,n,1),--this.size,!0}function Ne(e){var t=this.__data__,n=et(t,e);return n<0?void 0:t[n][1]}function Fe(e){return et(this.__data__,e)>-1}function Ie(e,t){var n=this.__data__,i=et(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}function Le(e){var t=-1,n=null==e?0:e.length;this.clear();while(++t<n){var i=e[t];this.set(i[0],i[1])}}function ze(){this.size=0,this.__data__={hash:new Te,map:new(Ce||Be),string:new Te}}function $e(e){var t=bt(this,e)["delete"](e);return this.size-=t?1:0,t}function He(e){return bt(this,e).get(e)}function Ge(e){return bt(this,e).has(e)}function Ve(e,t){var n=bt(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}function We(e){var t=this.__data__=new Be(e);this.size=t.size}function Ue(){this.__data__=new Be,this.size=0}function qe(e){var t=this.__data__,n=t["delete"](e);return this.size=t.size,n}function Ke(e){return this.__data__.get(e)}function Ye(e){return this.__data__.has(e)}function Xe(e,t){var n=this.__data__;if(n instanceof Be){var r=n.__data__;if(!Ce||r.length<i-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Le(r)}return n.set(e,t),this.size=n.size,this}function Ze(e,t){var n=Ft(e),i=!n&&Nt(e),r=!n&&!i&&zt(e),o=!n&&!i&&!r&&Ut(e),a=n||i||r||o,s=a?Z(e.length,String):[],c=s.length;for(var u in e)!t&&!ae.call(e,u)||a&&("length"==u||r&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Et(u,c))||s.push(u);return s}function Je(e,t,n){(void 0!==n&&!jt(e[t],n)||void 0===n&&!(t in e))&&tt(e,t,n)}function Qe(e,t,n){var i=e[t];ae.call(e,t)&&jt(i,n)&&(void 0!==n||t in e)||tt(e,t,n)}function et(e,t){var n=e.length;while(n--)if(jt(e[n][0],t))return n;return-1}function tt(e,t,n){"__proto__"==t&&xe?xe(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}Te.prototype.clear=ke,Te.prototype["delete"]=Re,Te.prototype.get=Pe,Te.prototype.has=De,Te.prototype.set=Me,Be.prototype.clear=Oe,Be.prototype["delete"]=je,Be.prototype.get=Ne,Be.prototype.has=Fe,Be.prototype.set=Ie,Le.prototype.clear=ze,Le.prototype["delete"]=$e,Le.prototype.get=He,Le.prototype.has=Ge,Le.prototype.set=Ve,We.prototype.clear=Ue,We.prototype["delete"]=qe,We.prototype.get=Ke,We.prototype.has=Ye,We.prototype.set=Xe;var nt=yt();function it(e){return null==e?void 0===e?C:y:be&&be in Object(e)?wt(e):Rt(e)}function rt(e){return Vt(e)&&it(e)==c}function ot(e){if(!Gt(e)||At(e))return!1;var t=$t(e)?le:I;return t.test(Ot(e))}function at(e){return Vt(e)&&Ht(e.length)&&!!z[it(e)]}function st(e){if(!Gt(e))return kt(e);var t=Tt(e),n=[];for(var i in e)("constructor"!=i||!t&&ae.call(e,i))&&n.push(i);return n}function ct(e,t,n,i,r){e!==t&&nt(t,(function(o,a){if(r||(r=new We),Gt(o))ut(e,t,a,n,ct,i,r);else{var s=i?i(Dt(e,a),o,a+"",e,t,r):void 0;void 0===s&&(s=o),Je(e,a,s)}}),Kt)}function ut(e,t,n,i,r,o,a){var s=Dt(e,n),c=Dt(t,n),u=a.get(c);if(u)Je(e,n,u);else{var l=o?o(s,c,n+"",e,t,a):void 0,p=void 0===l;if(p){var d=Ft(c),f=!d&&zt(c),h=!d&&!f&&Ut(c);l=c,d||f||h?Ft(s)?l=s:Lt(s)?l=mt(s):f?(p=!1,l=dt(c,!0)):h?(p=!1,l=ht(c,!0)):l=[]:Wt(c)||Nt(c)?(l=s,Nt(s)?l=qt(s):Gt(s)&&!$t(s)||(l=_t(c))):p=!1}p&&(a.set(c,l),r(l,c,i,o,a),a["delete"](c)),Je(e,n,l)}}function lt(e,t){return Mt(Pt(e,t,Zt),e+"")}var pt=xe?function(e,t){return xe(e,"toString",{configurable:!0,enumerable:!1,value:Xt(t),writable:!0})}:Zt;function dt(e,t){if(t)return e.slice();var n=e.length,i=he?he(n):new e.constructor(n);return e.copy(i),i}function ft(e){var t=new e.constructor(e.byteLength);return new fe(t).set(new fe(e)),t}function ht(e,t){var n=t?ft(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function mt(e,t){var n=-1,i=e.length;t||(t=Array(i));while(++n<i)t[n]=e[n];return t}function vt(e,t,n,i){var r=!n;n||(n={});var o=-1,a=t.length;while(++o<a){var s=t[o],c=i?i(n[s],e[s],s,n,e):void 0;void 0===c&&(c=e[s]),r?tt(n,s,c):Qe(n,s,c)}return n}function gt(e){return lt((function(t,n){var i=-1,r=n.length,o=r>1?n[r-1]:void 0,a=r>2?n[2]:void 0;o=e.length>3&&"function"==typeof o?(r--,o):void 0,a&&Ct(n[0],n[1],a)&&(o=r<3?void 0:o,r=1),t=Object(t);while(++i<r){var s=n[i];s&&e(t,s,i,o)}return t}))}function yt(e){return function(t,n,i){var r=-1,o=Object(t),a=i(t),s=a.length;while(s--){var c=a[e?s:++r];if(!1===n(o[c],c,o))break}return t}}function bt(e,t){var n=e.__data__;return St(t)?n["string"==typeof t?"string":"hash"]:n.map}function xt(e,t){var n=Q(e,t);return ot(n)?n:void 0}function wt(e){var t=ae.call(e,be),n=e[be];try{e[be]=void 0;var i=!0}catch(o){}var r=ce.call(e);return i&&(t?e[be]=n:delete e[be]),r}function _t(e){return"function"!=typeof e.constructor||Tt(e)?{}:Ae(me(e))}function Et(e,t){var n=typeof e;return t=null==t?s:t,!!t&&("number"==n||"symbol"!=n&&L.test(e))&&e>-1&&e%1==0&&e<t}function Ct(e,t,n){if(!Gt(n))return!1;var i=typeof t;return!!("number"==i?It(n)&&Et(t,n.length):"string"==i&&t in n)&&jt(n[t],e)}function St(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function At(e){return!!se&&se in e}function Tt(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||ie;return e===n}function kt(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}function Rt(e){return ce.call(e)}function Pt(e,t,n){return t=_e(void 0===t?e.length-1:t,0),function(){var i=arguments,r=-1,o=_e(i.length-t,0),a=Array(o);while(++r<o)a[r]=i[t+r];r=-1;var s=Array(t+1);while(++r<t)s[r]=i[r];return s[t]=n(a),X(e,this,s)}}function Dt(e,t){if(("constructor"!==t||"function"!==typeof e[t])&&"__proto__"!=t)return e[t]}var Mt=Bt(pt);function Bt(e){var t=0,n=0;return function(){var i=Ee(),r=a-(i-n);if(n=i,r>0){if(++t>=o)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Ot(e){if(null!=e){try{return oe.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function jt(e,t){return e===t||e!==e&&t!==t}var Nt=rt(function(){return arguments}())?rt:function(e){return Vt(e)&&ae.call(e,"callee")&&!ge.call(e,"callee")},Ft=Array.isArray;function It(e){return null!=e&&Ht(e.length)&&!$t(e)}function Lt(e){return Vt(e)&&It(e)}var zt=we||Jt;function $t(e){if(!Gt(e))return!1;var t=it(e);return t==h||t==m||t==l||t==x}function Ht(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function Gt(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Vt(e){return null!=e&&"object"==typeof e}function Wt(e){if(!Vt(e)||it(e)!=b)return!1;var t=me(e);if(null===t)return!0;var n=ae.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&oe.call(n)==ue}var Ut=Y?J(Y):at;function qt(e){return vt(e,Kt(e))}function Kt(e){return It(e)?Ze(e,!0):st(e)}var Yt=gt((function(e,t,n){ct(e,t,n)}));function Xt(e){return function(){return e}}function Zt(e){return e}function Jt(){return!1}n.exports=Yt}).call(this,n("c8ba"),n("62e4")(e))},e5ab:function(e,t,n){"use strict";var i=/,?([a-z]),?/gi,r=parseFloat,o=Math,a=o.PI,s=o.min,c=o.max,u=o.pow,l=o.abs,p=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/gi,d=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/gi,f=Array.isArray||function(e){return e instanceof Array};function h(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function m(e){if("function"==typeof e||Object(e)!==e)return e;var t=new e.constructor;for(var n in e)h(e,n)&&(t[n]=m(e[n]));return t}function v(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return e.push(e.splice(n,1)[0])}function g(e){function t(){var n=Array.prototype.slice.call(arguments,0),i=n.join("␀"),r=t.cache=t.cache||{},o=t.count=t.count||[];return h(r,i)?(v(o,i),r[i]):(o.length>=1e3&&delete r[o.shift()],o.push(i),r[i]=e.apply(0,n),r[i])}return t}function y(e){if(!e)return null;var t=b(e);if(t.arr)return m(t.arr);var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},i=[];return f(e)&&f(e[0])&&(i=m(e)),i.length||String(e).replace(p,(function(e,t,r){var o=[],a=t.toLowerCase();r.replace(d,(function(e,t){t&&o.push(+t)})),"m"==a&&o.length>2&&(i.push([t].concat(o.splice(0,2))),a="l",t="m"==t?"l":"L");while(o.length>=n[a])if(i.push([t].concat(o.splice(0,n[a]))),!n[a])break})),i.toString=b.toString,t.arr=m(i),i}function b(e){var t=b.ps=b.ps||{};return t[e]?t[e].sleep=100:t[e]={sleep:100},setTimeout((function(){for(var n in t)h(t,n)&&n!=e&&(t[n].sleep--,!t[n].sleep&&delete t[n])})),t[e]}function x(e,t,n,i){return 1===arguments.length&&(t=e.y,n=e.width,i=e.height,e=e.x),{x:e,y:t,width:n,height:i,x2:e+n,y2:t+i}}function w(){return this.join(",").replace(i,"$1")}function _(e){var t=m(e);return t.toString=w,t}function E(e,t,n,i,r,o,a,s,c){var l=1-c,p=u(l,3),d=u(l,2),f=c*c,h=f*c,m=p*e+3*d*c*n+3*l*c*c*r+h*a,v=p*t+3*d*c*i+3*l*c*c*o+h*s;return{x:P(m),y:P(v)}}function C(e){var t=I.apply(null,e);return x(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function S(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function A(e,t){return e=x(e),t=x(t),S(t,e.x,e.y)||S(t,e.x2,e.y)||S(t,e.x,e.y2)||S(t,e.x2,e.y2)||S(e,t.x,t.y)||S(e,t.x2,t.y)||S(e,t.x,t.y2)||S(e,t.x2,t.y2)||(e.x<t.x2&&e.x>t.x||t.x<e.x2&&t.x>e.x)&&(e.y<t.y2&&e.y>t.y||t.y<e.y2&&t.y>e.y)}function T(e,t,n,i,r){var o=-3*t+9*n-9*i+3*r,a=e*o+6*t-12*n+6*i;return e*a-3*t+3*n}function k(e,t,n,i,r,a,s,c,u){null==u&&(u=1),u=u>1?1:u<0?0:u;for(var l=u/2,p=12,d=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,m=0;m<p;m++){var v=l*d[m]+l,g=T(v,e,n,r,s),y=T(v,t,i,a,c),b=g*g+y*y;h+=f[m]*o.sqrt(b)}return l*h}function R(e,t,n,i,r,o,a,u){if(!(c(e,n)<s(r,a)||s(e,n)>c(r,a)||c(t,i)<s(o,u)||s(t,i)>c(o,u))){var l=(e*i-t*n)*(r-a)-(e-n)*(r*u-o*a),p=(e*i-t*n)*(o-u)-(t-i)*(r*u-o*a),d=(e-n)*(o-u)-(t-i)*(r-a);if(d){var f=P(l/d),h=P(p/d),m=+f.toFixed(2),v=+h.toFixed(2);if(!(m<+s(e,n).toFixed(2)||m>+c(e,n).toFixed(2)||m<+s(r,a).toFixed(2)||m>+c(r,a).toFixed(2)||v<+s(t,i).toFixed(2)||v>+c(t,i).toFixed(2)||v<+s(o,u).toFixed(2)||v>+c(o,u).toFixed(2)))return{x:f,y:h}}}}function P(e){return Math.round(1e11*e)/1e11}function D(e,t,n){var i=C(e),r=C(t);if(!A(i,r))return n?0:[];for(var o=k.apply(0,e),a=k.apply(0,t),s=O(e)?1:~~(o/5)||1,c=O(t)?1:~~(a/5)||1,u=[],p=[],d={},f=n?0:[],h=0;h<s+1;h++){var m=E.apply(0,e.concat(h/s));u.push({x:m.x,y:m.y,t:h/s})}for(h=0;h<c+1;h++)m=E.apply(0,t.concat(h/c)),p.push({x:m.x,y:m.y,t:h/c});for(h=0;h<s;h++)for(var v=0;v<c;v++){var g,y=u[h],b=u[h+1],x=p[v],w=p[v+1],_=l(b.x-y.x)<.01?"y":"x",S=l(w.x-x.x)<.01?"y":"x",T=R(y.x,y.y,b.x,b.y,x.x,x.y,w.x,w.y);if(T){if(g=T.x.toFixed(9)+"#"+T.y.toFixed(9),d[g])continue;d[g]=!0;var P=y.t+l((T[_]-y[_])/(b[_]-y[_]))*(b.t-y.t),D=x.t+l((T[S]-x[S])/(w[S]-x[S]))*(w.t-x.t);P>=0&&P<=1&&D>=0&&D<=1&&(n?f++:f.push({x:T.x,y:T.y,t1:P,t2:D}))}}return f}function M(e,t,n){e=L(e),t=L(t);for(var i,r,o,a,s,c,u,l,p,d,f=n?0:[],h=0,m=e.length;h<m;h++){var v=e[h];if("M"==v[0])i=s=v[1],r=c=v[2];else{"C"==v[0]?(p=[i,r].concat(v.slice(1)),i=p[6],r=p[7]):(p=[i,r,i,r,s,c,s,c],i=s,r=c);for(var g=0,y=t.length;g<y;g++){var b=t[g];if("M"==b[0])o=u=b[1],a=l=b[2];else{"C"==b[0]?(d=[o,a].concat(b.slice(1)),o=d[6],a=d[7]):(d=[o,a,o,a,u,l,u,l],o=u,a=l);var x=D(p,d,n);if(n)f+=x;else{for(var w=0,_=x.length;w<_;w++)x[w].segment1=h,x[w].segment2=g,x[w].bez1=p,x[w].bez2=d;f=f.concat(x)}}}}}return f}function B(e){var t=b(e);if(t.abs)return _(t.abs);if(f(e)&&f(e&&e[0])||(e=y(e)),!e||!e.length)return[["M",0,0]];var n,i=[],r=0,o=0,a=0,s=0,c=0;"M"==e[0][0]&&(r=+e[0][1],o=+e[0][2],a=r,s=o,c++,i[0]=["M",r,o]);for(var u,l,p=c,d=e.length;p<d;p++){if(i.push(u=[]),l=e[p],n=l[0],n!=n.toUpperCase())switch(u[0]=n.toUpperCase(),u[0]){case"A":u[1]=l[1],u[2]=l[2],u[3]=l[3],u[4]=l[4],u[5]=l[5],u[6]=+l[6]+r,u[7]=+l[7]+o;break;case"V":u[1]=+l[1]+o;break;case"H":u[1]=+l[1]+r;break;case"M":a=+l[1]+r,s=+l[2]+o;default:for(var h=1,m=l.length;h<m;h++)u[h]=+l[h]+(h%2?r:o)}else for(var v=0,g=l.length;v<g;v++)u[v]=l[v];switch(n=n.toUpperCase(),u[0]){case"Z":r=+a,o=+s;break;case"H":r=u[1];break;case"V":o=u[1];break;case"M":a=u[u.length-2],s=u[u.length-1];default:r=u[u.length-2],o=u[u.length-1]}}return i.toString=w,t.abs=_(i),i}function O(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function j(e,t,n,i){return[e,t,n,i,n,i]}function N(e,t,n,i,r,o){var a=1/3,s=2/3;return[a*e+s*n,a*t+s*i,a*r+s*n,a*o+s*i,r,o]}function F(e,t,n,i,r,s,c,u,p,d){var f,h=120*a/180,m=a/180*(+r||0),v=[],y=g((function(e,t,n){var i=e*o.cos(n)-t*o.sin(n),r=e*o.sin(n)+t*o.cos(n);return{x:i,y:r}}));if(d)T=d[0],k=d[1],S=d[2],A=d[3];else{f=y(e,t,-m),e=f.x,t=f.y,f=y(u,p,-m),u=f.x,p=f.y;var b=(e-u)/2,x=(t-p)/2,w=b*b/(n*n)+x*x/(i*i);w>1&&(w=o.sqrt(w),n*=w,i*=w);var _=n*n,E=i*i,C=(s==c?-1:1)*o.sqrt(l((_*E-_*x*x-E*b*b)/(_*x*x+E*b*b))),S=C*n*x/i+(e+u)/2,A=C*-i*b/n+(t+p)/2,T=o.asin(((t-A)/i).toFixed(9)),k=o.asin(((p-A)/i).toFixed(9));T=e<S?a-T:T,k=u<S?a-k:k,T<0&&(T=2*a+T),k<0&&(k=2*a+k),c&&T>k&&(T-=2*a),!c&&k>T&&(k-=2*a)}var R=k-T;if(l(R)>h){var P=k,D=u,M=p;k=T+h*(c&&k>T?1:-1),u=S+n*o.cos(k),p=A+i*o.sin(k),v=F(u,p,n,i,r,0,c,D,M,[k,P,S,A])}R=k-T;var B=o.cos(T),O=o.sin(T),j=o.cos(k),N=o.sin(k),I=o.tan(R/4),L=4/3*n*I,z=4/3*i*I,$=[e,t],H=[e+L*O,t-z*B],G=[u+L*N,p-z*j],V=[u,p];if(H[0]=2*$[0]-H[0],H[1]=2*$[1]-H[1],d)return[H,G,V].concat(v);v=[H,G,V].concat(v).join().split(",");for(var W=[],U=0,q=v.length;U<q;U++)W[U]=U%2?y(v[U-1],v[U],m).y:y(v[U],v[U+1],m).x;return W}function I(e,t,n,i,r,a,u,p){for(var d,f,h,m,v,g,y,b,x=[],w=[[],[]],_=0;_<2;++_)if(0==_?(f=6*e-12*n+6*r,d=-3*e+9*n-9*r+3*u,h=3*n-3*e):(f=6*t-12*i+6*a,d=-3*t+9*i-9*a+3*p,h=3*i-3*t),l(d)<1e-12){if(l(f)<1e-12)continue;m=-h/f,0<m&&m<1&&x.push(m)}else y=f*f-4*h*d,b=o.sqrt(y),y<0||(v=(-f+b)/(2*d),0<v&&v<1&&x.push(v),g=(-f-b)/(2*d),0<g&&g<1&&x.push(g));var E,C=x.length,S=C;while(C--)m=x[C],E=1-m,w[0][C]=E*E*E*e+3*E*E*m*n+3*E*m*m*r+m*m*m*u,w[1][C]=E*E*E*t+3*E*E*m*i+3*E*m*m*a+m*m*m*p;return w[0][S]=e,w[1][S]=t,w[0][S+1]=u,w[1][S+1]=p,w[0].length=w[1].length=S+2,{x0:s.apply(0,w[0]),y0:s.apply(0,w[1]),x1:c.apply(0,w[0]),y1:c.apply(0,w[1])}}function L(e){var t=b(e);if(t.curve)return _(t.curve);for(var n=B(e),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o=function(e,t,n){var i,r;if(!e)return["C",t.x,t.y,t.x,t.y,t.x,t.y];switch(!(e[0]in{T:1,Q:1})&&(t.qx=t.qy=null),e[0]){case"M":t.X=e[1],t.Y=e[2];break;case"A":e=["C"].concat(F.apply(0,[t.x,t.y].concat(e.slice(1))));break;case"S":"C"==n||"S"==n?(i=2*t.x-t.bx,r=2*t.y-t.by):(i=t.x,r=t.y),e=["C",i,r].concat(e.slice(1));break;case"T":"Q"==n||"T"==n?(t.qx=2*t.x-t.qx,t.qy=2*t.y-t.qy):(t.qx=t.x,t.qy=t.y),e=["C"].concat(N(t.x,t.y,t.qx,t.qy,e[1],e[2]));break;case"Q":t.qx=e[1],t.qy=e[2],e=["C"].concat(N(t.x,t.y,e[1],e[2],e[3],e[4]));break;case"L":e=["C"].concat(j(t.x,t.y,e[1],e[2]));break;case"H":e=["C"].concat(j(t.x,t.y,e[1],t.y));break;case"V":e=["C"].concat(j(t.x,t.y,t.x,e[1]));break;case"Z":e=["C"].concat(j(t.x,t.y,t.X,t.Y));break}return e},a=function(e,t){if(e[t].length>7){e[t].shift();var i=e[t];while(i.length)s[t]="A",e.splice(t++,0,["C"].concat(i.splice(0,6)));e.splice(t,1),p=n.length}},s=[],c="",u="",l=0,p=n.length;l<p;l++){n[l]&&(c=n[l][0]),"C"!=c&&(s[l]=c,l&&(u=s[l-1])),n[l]=o(n[l],i,u),"A"!=s[l]&&"C"==c&&(s[l]="C"),a(n,l);var d=n[l],f=d.length;i.x=d[f-2],i.y=d[f-1],i.bx=r(d[f-4])||i.x,i.by=r(d[f-3])||i.y}return t.curve=_(n),n}e.exports=M},e7a5:function(e,t,n){(function(t){(function(t,n){e.exports=n(t)})("undefined"!=typeof t?t:this,(function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");var t,n=String(e),i=n.length,r=-1,o="",a=n.charCodeAt(0);while(++r<i)t=n.charCodeAt(r),o+=0!=t?t>=1&&t<=31||127==t||0==r&&t>=48&&t<=57||1==r&&t>=48&&t<=57&&45==a?"\\"+t.toString(16)+" ":(0!=r||1!=i||45!=t)&&(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?n.charAt(r):"\\"+n.charAt(r):"�";return o};return e.CSS||(e.CSS={}),e.CSS.escape=t,t}))}).call(this,n("c8ba"))}}]);
|